]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.7 - patch 20110115
[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 echo "$as_me:5695: checking for NetBSD form.h" >&5
5696 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
5697 if test "${cf_cv_netbsd_form_h+set}" = set; then
5698   echo $ECHO_N "(cached) $ECHO_C" >&6
5699 else
5700
5701 cat >conftest.$ac_ext <<_ACEOF
5702 #line 5702 "configure"
5703 #include "confdefs.h"
5704
5705 #include <${cf_cv_ncurses_header:-curses.h}>
5706 #include <form.h>
5707
5708 int
5709 main ()
5710 {
5711
5712         FORM *form;
5713         int y = current_field(form)->cursor_ypos;
5714         int x = current_field(form)->cursor_xpos;
5715
5716   ;
5717   return 0;
5718 }
5719 _ACEOF
5720 rm -f conftest.$ac_objext
5721 if { (eval echo "$as_me:5721: \"$ac_compile\"") >&5
5722   (eval $ac_compile) 2>&5
5723   ac_status=$?
5724   echo "$as_me:5724: \$? = $ac_status" >&5
5725   (exit $ac_status); } &&
5726          { ac_try='test -s conftest.$ac_objext'
5727   { (eval echo "$as_me:5727: \"$ac_try\"") >&5
5728   (eval $ac_try) 2>&5
5729   ac_status=$?
5730   echo "$as_me:5730: \$? = $ac_status" >&5
5731   (exit $ac_status); }; }; then
5732   cf_cv_netbsd_form_h=yes
5733
5734 else
5735   echo "$as_me: failed program was:" >&5
5736 cat conftest.$ac_ext >&5
5737 cf_cv_netbsd_form_h=no
5738 fi
5739 rm -f conftest.$ac_objext conftest.$ac_ext
5740
5741 fi
5742 echo "$as_me:5742: result: $cf_cv_netbsd_form_h" >&5
5743 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
5744
5745 test "$cf_cv_netbsd_form_h" = yes && cat >>confdefs.h <<\EOF
5746 #define HAVE_NETBSD_FORM_H 1
5747 EOF
5748
5749 echo "$as_me:5749: checking for NetBSD menu.h" >&5
5750 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
5751 if test "${cf_cv_netbsd_menu_h+set}" = set; then
5752   echo $ECHO_N "(cached) $ECHO_C" >&6
5753 else
5754
5755 cat >conftest.$ac_ext <<_ACEOF
5756 #line 5756 "configure"
5757 #include "confdefs.h"
5758
5759 #include <${cf_cv_ncurses_header:-curses.h}>
5760 #include <menu.h>
5761
5762 int
5763 main ()
5764 {
5765
5766         MENU *menu;
5767         int y = menu->max_item_width;
5768
5769   ;
5770   return 0;
5771 }
5772 _ACEOF
5773 rm -f conftest.$ac_objext
5774 if { (eval echo "$as_me:5774: \"$ac_compile\"") >&5
5775   (eval $ac_compile) 2>&5
5776   ac_status=$?
5777   echo "$as_me:5777: \$? = $ac_status" >&5
5778   (exit $ac_status); } &&
5779          { ac_try='test -s conftest.$ac_objext'
5780   { (eval echo "$as_me:5780: \"$ac_try\"") >&5
5781   (eval $ac_try) 2>&5
5782   ac_status=$?
5783   echo "$as_me:5783: \$? = $ac_status" >&5
5784   (exit $ac_status); }; }; then
5785   cf_cv_netbsd_menu_h=yes
5786
5787 else
5788   echo "$as_me: failed program was:" >&5
5789 cat conftest.$ac_ext >&5
5790 cf_cv_netbsd_menu_h=no
5791 fi
5792 rm -f conftest.$ac_objext conftest.$ac_ext
5793
5794 fi
5795 echo "$as_me:5795: result: $cf_cv_netbsd_menu_h" >&5
5796 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
5797
5798 test "$cf_cv_netbsd_menu_h" = yes && cat >>confdefs.h <<\EOF
5799 #define HAVE_NETBSD_MENU_H 1
5800 EOF
5801
5802         ;;
5803 ncurses)
5804
5805 cf_ncuconfig_root=ncurses
5806
5807 echo "Looking for ${cf_ncuconfig_root}-config"
5808 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5809 do
5810   # Extract the first word of "$ac_prog", so it can be a program name with args.
5811 set dummy $ac_prog; ac_word=$2
5812 echo "$as_me:5812: checking for $ac_word" >&5
5813 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5814 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
5815   echo $ECHO_N "(cached) $ECHO_C" >&6
5816 else
5817   case $NCURSES_CONFIG in
5818   [\\/]* | ?:[\\/]*)
5819   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
5820   ;;
5821   *)
5822   ac_save_IFS=$IFS; IFS=$ac_path_separator
5823 ac_dummy="$PATH"
5824 for ac_dir in $ac_dummy; do
5825   IFS=$ac_save_IFS
5826   test -z "$ac_dir" && ac_dir=.
5827   if $as_executable_p "$ac_dir/$ac_word"; then
5828    ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
5829    echo "$as_me:5829: found $ac_dir/$ac_word" >&5
5830    break
5831 fi
5832 done
5833
5834   ;;
5835 esac
5836 fi
5837 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
5838
5839 if test -n "$NCURSES_CONFIG"; then
5840   echo "$as_me:5840: result: $NCURSES_CONFIG" >&5
5841 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5842 else
5843   echo "$as_me:5843: result: no" >&5
5844 echo "${ECHO_T}no" >&6
5845 fi
5846
5847   test -n "$NCURSES_CONFIG" && break
5848 done
5849 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
5850
5851 if test "$NCURSES_CONFIG" != none ; then
5852
5853 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5854 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
5855
5856 # even with config script, some packages use no-override for curses.h
5857
5858 echo "$as_me:5858: checking if we have identified curses headers" >&5
5859 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5860 if test "${cf_cv_ncurses_header+set}" = set; then
5861   echo $ECHO_N "(cached) $ECHO_C" >&6
5862 else
5863
5864 cf_cv_ncurses_header=none
5865 for cf_header in  \
5866     ncurses/curses.h \
5867         ncurses/ncurses.h \
5868         curses.h \
5869         ncurses.h
5870 do
5871 cat >conftest.$ac_ext <<_ACEOF
5872 #line 5872 "configure"
5873 #include "confdefs.h"
5874 #include <${cf_header}>
5875 int
5876 main ()
5877 {
5878 initscr(); tgoto("?", 0,0)
5879   ;
5880   return 0;
5881 }
5882 _ACEOF
5883 rm -f conftest.$ac_objext
5884 if { (eval echo "$as_me:5884: \"$ac_compile\"") >&5
5885   (eval $ac_compile) 2>&5
5886   ac_status=$?
5887   echo "$as_me:5887: \$? = $ac_status" >&5
5888   (exit $ac_status); } &&
5889          { ac_try='test -s conftest.$ac_objext'
5890   { (eval echo "$as_me:5890: \"$ac_try\"") >&5
5891   (eval $ac_try) 2>&5
5892   ac_status=$?
5893   echo "$as_me:5893: \$? = $ac_status" >&5
5894   (exit $ac_status); }; }; then
5895   cf_cv_ncurses_header=$cf_header; break
5896 else
5897   echo "$as_me: failed program was:" >&5
5898 cat conftest.$ac_ext >&5
5899 fi
5900 rm -f conftest.$ac_objext conftest.$ac_ext
5901 done
5902
5903 fi
5904 echo "$as_me:5904: result: $cf_cv_ncurses_header" >&5
5905 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5906
5907 if test "$cf_cv_ncurses_header" = none ; then
5908         { { echo "$as_me:5908: error: No curses header-files found" >&5
5909 echo "$as_me: error: No curses header-files found" >&2;}
5910    { (exit 1); exit 1; }; }
5911 fi
5912
5913 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5914
5915 for ac_header in $cf_cv_ncurses_header
5916 do
5917 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5918 echo "$as_me:5918: checking for $ac_header" >&5
5919 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5920 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5921   echo $ECHO_N "(cached) $ECHO_C" >&6
5922 else
5923   cat >conftest.$ac_ext <<_ACEOF
5924 #line 5924 "configure"
5925 #include "confdefs.h"
5926 #include <$ac_header>
5927 _ACEOF
5928 if { (eval echo "$as_me:5928: \"$ac_cpp conftest.$ac_ext\"") >&5
5929   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5930   ac_status=$?
5931   egrep -v '^ *\+' conftest.er1 >conftest.err
5932   rm -f conftest.er1
5933   cat conftest.err >&5
5934   echo "$as_me:5934: \$? = $ac_status" >&5
5935   (exit $ac_status); } >/dev/null; then
5936   if test -s conftest.err; then
5937     ac_cpp_err=$ac_c_preproc_warn_flag
5938   else
5939     ac_cpp_err=
5940   fi
5941 else
5942   ac_cpp_err=yes
5943 fi
5944 if test -z "$ac_cpp_err"; then
5945   eval "$as_ac_Header=yes"
5946 else
5947   echo "$as_me: failed program was:" >&5
5948   cat conftest.$ac_ext >&5
5949   eval "$as_ac_Header=no"
5950 fi
5951 rm -f conftest.err conftest.$ac_ext
5952 fi
5953 echo "$as_me:5953: result: `eval echo '${'$as_ac_Header'}'`" >&5
5954 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5955 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5956   cat >>confdefs.h <<EOF
5957 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5958 EOF
5959
5960 fi
5961 done
5962
5963 cat >>confdefs.h <<\EOF
5964 #define NCURSES 1
5965 EOF
5966
5967 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5968
5969 cat >>confdefs.h <<EOF
5970 #define $cf_nculib_ROOT 1
5971 EOF
5972
5973 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5974
5975 else
5976
5977 cf_ncuhdr_root=ncurses
5978
5979 test -n "$cf_cv_curses_dir" && \
5980 test "$cf_cv_curses_dir" != "no" && { \
5981
5982 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5983   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5984   do
5985         while test $cf_add_incdir != /usr/include
5986         do
5987           if test -d $cf_add_incdir
5988           then
5989                 cf_have_incdir=no
5990                 if test -n "$CFLAGS$CPPFLAGS" ; then
5991                   # a loop is needed to ensure we can add subdirs of existing dirs
5992                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5993                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5994                           cf_have_incdir=yes; break
5995                         fi
5996                   done
5997                 fi
5998
5999                 if test "$cf_have_incdir" = no ; then
6000                   if test "$cf_add_incdir" = /usr/local/include ; then
6001                         if test "$GCC" = yes
6002                         then
6003                           cf_save_CPPFLAGS=$CPPFLAGS
6004                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6005                           cat >conftest.$ac_ext <<_ACEOF
6006 #line 6006 "configure"
6007 #include "confdefs.h"
6008 #include <stdio.h>
6009 int
6010 main ()
6011 {
6012 printf("Hello")
6013   ;
6014   return 0;
6015 }
6016 _ACEOF
6017 rm -f conftest.$ac_objext
6018 if { (eval echo "$as_me:6018: \"$ac_compile\"") >&5
6019   (eval $ac_compile) 2>&5
6020   ac_status=$?
6021   echo "$as_me:6021: \$? = $ac_status" >&5
6022   (exit $ac_status); } &&
6023          { ac_try='test -s conftest.$ac_objext'
6024   { (eval echo "$as_me:6024: \"$ac_try\"") >&5
6025   (eval $ac_try) 2>&5
6026   ac_status=$?
6027   echo "$as_me:6027: \$? = $ac_status" >&5
6028   (exit $ac_status); }; }; then
6029   :
6030 else
6031   echo "$as_me: failed program was:" >&5
6032 cat conftest.$ac_ext >&5
6033 cf_have_incdir=yes
6034 fi
6035 rm -f conftest.$ac_objext conftest.$ac_ext
6036                           CPPFLAGS=$cf_save_CPPFLAGS
6037                         fi
6038                   fi
6039                 fi
6040
6041                 if test "$cf_have_incdir" = no ; then
6042                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6043
6044 echo "${as_me:-configure}:6044: testing adding $cf_add_incdir to include-path ..." 1>&5
6045
6046                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6047
6048                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6049                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6050                   cf_add_incdir="$cf_top_incdir"
6051                 else
6052                   break
6053                 fi
6054           fi
6055         done
6056   done
6057 fi
6058
6059 }
6060
6061 echo "$as_me:6061: checking for $cf_ncuhdr_root header in include-path" >&5
6062 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6063 if test "${cf_cv_ncurses_h+set}" = set; then
6064   echo $ECHO_N "(cached) $ECHO_C" >&6
6065 else
6066
6067         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6068         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6069         for cf_header in $cf_header_list
6070         do
6071
6072         cat >conftest.$ac_ext <<_ACEOF
6073 #line 6073 "configure"
6074 #include "confdefs.h"
6075
6076 #include <$cf_header>
6077 int
6078 main ()
6079 {
6080
6081 #ifdef NCURSES_VERSION
6082
6083 printf("%s\n", NCURSES_VERSION);
6084 #else
6085 #ifdef __NCURSES_H
6086 printf("old\n");
6087 #else
6088         make an error
6089 #endif
6090 #endif
6091
6092   ;
6093   return 0;
6094 }
6095 _ACEOF
6096 rm -f conftest.$ac_objext
6097 if { (eval echo "$as_me:6097: \"$ac_compile\"") >&5
6098   (eval $ac_compile) 2>&5
6099   ac_status=$?
6100   echo "$as_me:6100: \$? = $ac_status" >&5
6101   (exit $ac_status); } &&
6102          { ac_try='test -s conftest.$ac_objext'
6103   { (eval echo "$as_me:6103: \"$ac_try\"") >&5
6104   (eval $ac_try) 2>&5
6105   ac_status=$?
6106   echo "$as_me:6106: \$? = $ac_status" >&5
6107   (exit $ac_status); }; }; then
6108   cf_cv_ncurses_h=$cf_header
6109
6110 else
6111   echo "$as_me: failed program was:" >&5
6112 cat conftest.$ac_ext >&5
6113 cf_cv_ncurses_h=no
6114 fi
6115 rm -f conftest.$ac_objext conftest.$ac_ext
6116
6117                 test "$cf_cv_ncurses_h" != no && break
6118         done
6119
6120 fi
6121 echo "$as_me:6121: result: $cf_cv_ncurses_h" >&5
6122 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6123
6124 if test "$cf_cv_ncurses_h" != no ; then
6125         cf_cv_ncurses_header=$cf_cv_ncurses_h
6126 else
6127
6128 echo "$as_me:6128: checking for $cf_ncuhdr_root include-path" >&5
6129 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6130 if test "${cf_cv_ncurses_h2+set}" = set; then
6131   echo $ECHO_N "(cached) $ECHO_C" >&6
6132 else
6133
6134         test -n "$verbose" && echo
6135
6136 cf_search=
6137
6138 # collect the current set of include-directories from compiler flags
6139 cf_header_path_list=""
6140 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6141         for cf_header_path in $CPPFLAGS $CFLAGS
6142         do
6143                 case $cf_header_path in #(vi
6144                 -I*)
6145                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6146
6147 test "$cf_header_path" != "NONE" && \
6148 test -d "$cf_header_path" && \
6149  {
6150         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6151         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6152         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6153         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6154         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6155         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"
6156 }
6157
6158                         cf_header_path_list="$cf_header_path_list $cf_search"
6159                         ;;
6160                 esac
6161         done
6162 fi
6163
6164 # add the variations for the package we are looking for
6165
6166 cf_search=
6167
6168 test "/usr" != "$prefix" && \
6169 test -d "/usr" && \
6170 (test $prefix = NONE || test "/usr" != "$prefix") && {
6171         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6172         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6173         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
6174         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
6175         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
6176         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6177 }
6178
6179 test "$prefix" != "NONE" && \
6180 test -d "$prefix" && \
6181  {
6182         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6183         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6184         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6185         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6186         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6187         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6188 }
6189
6190 test "/usr/local" != "$prefix" && \
6191 test -d "/usr/local" && \
6192 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6193         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
6194         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
6195         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
6196         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
6197         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
6198         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6199 }
6200
6201 test "/opt" != "$prefix" && \
6202 test -d "/opt" && \
6203 (test $prefix = NONE || test "/opt" != "$prefix") && {
6204         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
6205         test -d /opt/include &&          cf_search="$cf_search /opt/include"
6206         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
6207         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
6208         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
6209         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6210 }
6211
6212 test "$HOME" != "$prefix" && \
6213 test -d "$HOME" && \
6214 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6215         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
6216         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
6217         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
6218         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
6219         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
6220         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6221 }
6222
6223 test "$includedir" != NONE && \
6224 test "$includedir" != "/usr/include" && \
6225 test -d "$includedir" && {
6226         test -d $includedir &&    cf_search="$cf_search $includedir"
6227         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6228 }
6229
6230 test "$oldincludedir" != NONE && \
6231 test "$oldincludedir" != "/usr/include" && \
6232 test -d "$oldincludedir" && {
6233         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6234         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6235 }
6236
6237 cf_search="$cf_search $cf_header_path_list"
6238
6239         test -n "$verbose" && echo search path $cf_search
6240         cf_save2_CPPFLAGS="$CPPFLAGS"
6241         for cf_incdir in $cf_search
6242         do
6243
6244 if test -n "$cf_incdir" ; then
6245   for cf_add_incdir in $cf_incdir
6246   do
6247         while test $cf_add_incdir != /usr/include
6248         do
6249           if test -d $cf_add_incdir
6250           then
6251                 cf_have_incdir=no
6252                 if test -n "$CFLAGS$CPPFLAGS" ; then
6253                   # a loop is needed to ensure we can add subdirs of existing dirs
6254                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6255                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6256                           cf_have_incdir=yes; break
6257                         fi
6258                   done
6259                 fi
6260
6261                 if test "$cf_have_incdir" = no ; then
6262                   if test "$cf_add_incdir" = /usr/local/include ; then
6263                         if test "$GCC" = yes
6264                         then
6265                           cf_save_CPPFLAGS=$CPPFLAGS
6266                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6267                           cat >conftest.$ac_ext <<_ACEOF
6268 #line 6268 "configure"
6269 #include "confdefs.h"
6270 #include <stdio.h>
6271 int
6272 main ()
6273 {
6274 printf("Hello")
6275   ;
6276   return 0;
6277 }
6278 _ACEOF
6279 rm -f conftest.$ac_objext
6280 if { (eval echo "$as_me:6280: \"$ac_compile\"") >&5
6281   (eval $ac_compile) 2>&5
6282   ac_status=$?
6283   echo "$as_me:6283: \$? = $ac_status" >&5
6284   (exit $ac_status); } &&
6285          { ac_try='test -s conftest.$ac_objext'
6286   { (eval echo "$as_me:6286: \"$ac_try\"") >&5
6287   (eval $ac_try) 2>&5
6288   ac_status=$?
6289   echo "$as_me:6289: \$? = $ac_status" >&5
6290   (exit $ac_status); }; }; then
6291   :
6292 else
6293   echo "$as_me: failed program was:" >&5
6294 cat conftest.$ac_ext >&5
6295 cf_have_incdir=yes
6296 fi
6297 rm -f conftest.$ac_objext conftest.$ac_ext
6298                           CPPFLAGS=$cf_save_CPPFLAGS
6299                         fi
6300                   fi
6301                 fi
6302
6303                 if test "$cf_have_incdir" = no ; then
6304                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6305
6306 echo "${as_me:-configure}:6306: testing adding $cf_add_incdir to include-path ..." 1>&5
6307
6308                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6309
6310                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6311                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6312                   cf_add_incdir="$cf_top_incdir"
6313                 else
6314                   break
6315                 fi
6316           fi
6317         done
6318   done
6319 fi
6320
6321                 for cf_header in \
6322                         ncurses.h \
6323                         curses.h
6324                 do
6325
6326         cat >conftest.$ac_ext <<_ACEOF
6327 #line 6327 "configure"
6328 #include "confdefs.h"
6329
6330 #include <$cf_header>
6331 int
6332 main ()
6333 {
6334
6335 #ifdef NCURSES_VERSION
6336
6337 printf("%s\n", NCURSES_VERSION);
6338 #else
6339 #ifdef __NCURSES_H
6340 printf("old\n");
6341 #else
6342         make an error
6343 #endif
6344 #endif
6345
6346   ;
6347   return 0;
6348 }
6349 _ACEOF
6350 rm -f conftest.$ac_objext
6351 if { (eval echo "$as_me:6351: \"$ac_compile\"") >&5
6352   (eval $ac_compile) 2>&5
6353   ac_status=$?
6354   echo "$as_me:6354: \$? = $ac_status" >&5
6355   (exit $ac_status); } &&
6356          { ac_try='test -s conftest.$ac_objext'
6357   { (eval echo "$as_me:6357: \"$ac_try\"") >&5
6358   (eval $ac_try) 2>&5
6359   ac_status=$?
6360   echo "$as_me:6360: \$? = $ac_status" >&5
6361   (exit $ac_status); }; }; then
6362   cf_cv_ncurses_h2=$cf_header
6363
6364 else
6365   echo "$as_me: failed program was:" >&5
6366 cat conftest.$ac_ext >&5
6367 cf_cv_ncurses_h2=no
6368 fi
6369 rm -f conftest.$ac_objext conftest.$ac_ext
6370
6371                         if test "$cf_cv_ncurses_h2" != no ; then
6372                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6373                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6374                                 break
6375                         fi
6376                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6377                 done
6378                 CPPFLAGS="$cf_save2_CPPFLAGS"
6379                 test "$cf_cv_ncurses_h2" != no && break
6380         done
6381         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6381: error: not found" >&5
6382 echo "$as_me: error: not found" >&2;}
6383    { (exit 1); exit 1; }; }
6384
6385 fi
6386 echo "$as_me:6386: result: $cf_cv_ncurses_h2" >&5
6387 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6388
6389         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6390         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6391         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6392                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6393         fi
6394
6395 if test -n "$cf_1st_incdir" ; then
6396   for cf_add_incdir in $cf_1st_incdir
6397   do
6398         while test $cf_add_incdir != /usr/include
6399         do
6400           if test -d $cf_add_incdir
6401           then
6402                 cf_have_incdir=no
6403                 if test -n "$CFLAGS$CPPFLAGS" ; then
6404                   # a loop is needed to ensure we can add subdirs of existing dirs
6405                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6406                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6407                           cf_have_incdir=yes; break
6408                         fi
6409                   done
6410                 fi
6411
6412                 if test "$cf_have_incdir" = no ; then
6413                   if test "$cf_add_incdir" = /usr/local/include ; then
6414                         if test "$GCC" = yes
6415                         then
6416                           cf_save_CPPFLAGS=$CPPFLAGS
6417                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6418                           cat >conftest.$ac_ext <<_ACEOF
6419 #line 6419 "configure"
6420 #include "confdefs.h"
6421 #include <stdio.h>
6422 int
6423 main ()
6424 {
6425 printf("Hello")
6426   ;
6427   return 0;
6428 }
6429 _ACEOF
6430 rm -f conftest.$ac_objext
6431 if { (eval echo "$as_me:6431: \"$ac_compile\"") >&5
6432   (eval $ac_compile) 2>&5
6433   ac_status=$?
6434   echo "$as_me:6434: \$? = $ac_status" >&5
6435   (exit $ac_status); } &&
6436          { ac_try='test -s conftest.$ac_objext'
6437   { (eval echo "$as_me:6437: \"$ac_try\"") >&5
6438   (eval $ac_try) 2>&5
6439   ac_status=$?
6440   echo "$as_me:6440: \$? = $ac_status" >&5
6441   (exit $ac_status); }; }; then
6442   :
6443 else
6444   echo "$as_me: failed program was:" >&5
6445 cat conftest.$ac_ext >&5
6446 cf_have_incdir=yes
6447 fi
6448 rm -f conftest.$ac_objext conftest.$ac_ext
6449                           CPPFLAGS=$cf_save_CPPFLAGS
6450                         fi
6451                   fi
6452                 fi
6453
6454                 if test "$cf_have_incdir" = no ; then
6455                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6456
6457 echo "${as_me:-configure}:6457: testing adding $cf_add_incdir to include-path ..." 1>&5
6458
6459                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6460
6461                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6462                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6463                   cf_add_incdir="$cf_top_incdir"
6464                 else
6465                   break
6466                 fi
6467           fi
6468         done
6469   done
6470 fi
6471
6472 fi
6473
6474 # Set definitions to allow ifdef'ing for ncurses.h
6475
6476 case $cf_cv_ncurses_header in # (vi
6477 *ncurses.h)
6478         cat >>confdefs.h <<\EOF
6479 #define HAVE_NCURSES_H 1
6480 EOF
6481
6482         ;;
6483 esac
6484
6485 case $cf_cv_ncurses_header in # (vi
6486 ncurses/curses.h|ncurses/ncurses.h)
6487         cat >>confdefs.h <<\EOF
6488 #define HAVE_NCURSES_NCURSES_H 1
6489 EOF
6490
6491         ;;
6492 ncursesw/curses.h|ncursesw/ncurses.h)
6493         cat >>confdefs.h <<\EOF
6494 #define HAVE_NCURSESW_NCURSES_H 1
6495 EOF
6496
6497         ;;
6498 esac
6499
6500 echo "$as_me:6500: checking for terminfo header" >&5
6501 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6502 if test "${cf_cv_term_header+set}" = set; then
6503   echo $ECHO_N "(cached) $ECHO_C" >&6
6504 else
6505
6506 case ${cf_cv_ncurses_header} in #(vi
6507 */ncurses.h|*/ncursesw.h) #(vi
6508         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6509         ;;
6510 *)
6511         cf_term_header=term.h
6512         ;;
6513 esac
6514
6515 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6516 do
6517 cat >conftest.$ac_ext <<_ACEOF
6518 #line 6518 "configure"
6519 #include "confdefs.h"
6520 #include <stdio.h>
6521 #include <${cf_cv_ncurses_header:-curses.h}>
6522 #include <$cf_test>
6523
6524 int
6525 main ()
6526 {
6527 int x = auto_left_margin
6528   ;
6529   return 0;
6530 }
6531 _ACEOF
6532 rm -f conftest.$ac_objext
6533 if { (eval echo "$as_me:6533: \"$ac_compile\"") >&5
6534   (eval $ac_compile) 2>&5
6535   ac_status=$?
6536   echo "$as_me:6536: \$? = $ac_status" >&5
6537   (exit $ac_status); } &&
6538          { ac_try='test -s conftest.$ac_objext'
6539   { (eval echo "$as_me:6539: \"$ac_try\"") >&5
6540   (eval $ac_try) 2>&5
6541   ac_status=$?
6542   echo "$as_me:6542: \$? = $ac_status" >&5
6543   (exit $ac_status); }; }; then
6544
6545         cf_cv_term_header="$cf_test"
6546 else
6547   echo "$as_me: failed program was:" >&5
6548 cat conftest.$ac_ext >&5
6549
6550         cf_cv_term_header=unknown
6551
6552 fi
6553 rm -f conftest.$ac_objext conftest.$ac_ext
6554         test "$cf_cv_term_header" != unknown && break
6555 done
6556
6557 fi
6558 echo "$as_me:6558: result: $cf_cv_term_header" >&5
6559 echo "${ECHO_T}$cf_cv_term_header" >&6
6560
6561 # Set definitions to allow ifdef'ing to accommodate subdirectories
6562
6563 case $cf_cv_term_header in # (vi
6564 *term.h)
6565         cat >>confdefs.h <<\EOF
6566 #define HAVE_TERM_H 1
6567 EOF
6568
6569         ;;
6570 esac
6571
6572 case $cf_cv_term_header in # (vi
6573 ncurses/term.h) #(vi
6574         cat >>confdefs.h <<\EOF
6575 #define HAVE_NCURSES_TERM_H 1
6576 EOF
6577
6578         ;;
6579 ncursesw/term.h)
6580         cat >>confdefs.h <<\EOF
6581 #define HAVE_NCURSESW_TERM_H 1
6582 EOF
6583
6584         ;;
6585 esac
6586
6587 # some applications need this, but should check for NCURSES_VERSION
6588 cat >>confdefs.h <<\EOF
6589 #define NCURSES 1
6590 EOF
6591
6592 echo "$as_me:6592: checking for ncurses version" >&5
6593 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6594 if test "${cf_cv_ncurses_version+set}" = set; then
6595   echo $ECHO_N "(cached) $ECHO_C" >&6
6596 else
6597
6598         cf_cv_ncurses_version=no
6599         cf_tempfile=out$$
6600         rm -f $cf_tempfile
6601         if test "$cross_compiling" = yes; then
6602
6603         # This will not work if the preprocessor splits the line after the
6604         # Autoconf token.  The 'unproto' program does that.
6605         cat > conftest.$ac_ext <<EOF
6606 #include <${cf_cv_ncurses_header:-curses.h}>
6607 #undef Autoconf
6608 #ifdef NCURSES_VERSION
6609 Autoconf NCURSES_VERSION
6610 #else
6611 #ifdef __NCURSES_H
6612 Autoconf "old"
6613 #endif
6614 ;
6615 #endif
6616 EOF
6617         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6618         { (eval echo "$as_me:6618: \"$cf_try\"") >&5
6619   (eval $cf_try) 2>&5
6620   ac_status=$?
6621   echo "$as_me:6621: \$? = $ac_status" >&5
6622   (exit $ac_status); }
6623         if test -f conftest.out ; then
6624                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6625                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6626                 rm -f conftest.out
6627         fi
6628
6629 else
6630   cat >conftest.$ac_ext <<_ACEOF
6631 #line 6631 "configure"
6632 #include "confdefs.h"
6633
6634 #include <${cf_cv_ncurses_header:-curses.h}>
6635 #include <stdio.h>
6636 int main()
6637 {
6638         FILE *fp = fopen("$cf_tempfile", "w");
6639 #ifdef NCURSES_VERSION
6640 # ifdef NCURSES_VERSION_PATCH
6641         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6642 # else
6643         fprintf(fp, "%s\n", NCURSES_VERSION);
6644 # endif
6645 #else
6646 # ifdef __NCURSES_H
6647         fprintf(fp, "old\n");
6648 # else
6649         make an error
6650 # endif
6651 #endif
6652         ${cf_cv_main_return:-return}(0);
6653 }
6654 _ACEOF
6655 rm -f conftest$ac_exeext
6656 if { (eval echo "$as_me:6656: \"$ac_link\"") >&5
6657   (eval $ac_link) 2>&5
6658   ac_status=$?
6659   echo "$as_me:6659: \$? = $ac_status" >&5
6660   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6661   { (eval echo "$as_me:6661: \"$ac_try\"") >&5
6662   (eval $ac_try) 2>&5
6663   ac_status=$?
6664   echo "$as_me:6664: \$? = $ac_status" >&5
6665   (exit $ac_status); }; }; then
6666
6667         cf_cv_ncurses_version=`cat $cf_tempfile`
6668 else
6669   echo "$as_me: program exited with status $ac_status" >&5
6670 echo "$as_me: failed program was:" >&5
6671 cat conftest.$ac_ext >&5
6672 fi
6673 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6674 fi
6675         rm -f $cf_tempfile
6676
6677 fi
6678 echo "$as_me:6678: result: $cf_cv_ncurses_version" >&5
6679 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6680 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
6681 #define NCURSES 1
6682 EOF
6683
6684 cf_nculib_root=ncurses
6685         # This works, except for the special case where we find gpm, but
6686         # ncurses is in a nonstandard location via $LIBS, and we really want
6687         # to link gpm.
6688 cf_ncurses_LIBS=""
6689 cf_ncurses_SAVE="$LIBS"
6690 echo "$as_me:6690: checking for Gpm_Open in -lgpm" >&5
6691 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6692 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6693   echo $ECHO_N "(cached) $ECHO_C" >&6
6694 else
6695   ac_check_lib_save_LIBS=$LIBS
6696 LIBS="-lgpm  $LIBS"
6697 cat >conftest.$ac_ext <<_ACEOF
6698 #line 6698 "configure"
6699 #include "confdefs.h"
6700
6701 /* Override any gcc2 internal prototype to avoid an error.  */
6702 #ifdef __cplusplus
6703 extern "C"
6704 #endif
6705 /* We use char because int might match the return type of a gcc2
6706    builtin and then its argument prototype would still apply.  */
6707 char Gpm_Open ();
6708 int
6709 main ()
6710 {
6711 Gpm_Open ();
6712   ;
6713   return 0;
6714 }
6715 _ACEOF
6716 rm -f conftest.$ac_objext conftest$ac_exeext
6717 if { (eval echo "$as_me:6717: \"$ac_link\"") >&5
6718   (eval $ac_link) 2>&5
6719   ac_status=$?
6720   echo "$as_me:6720: \$? = $ac_status" >&5
6721   (exit $ac_status); } &&
6722          { ac_try='test -s conftest$ac_exeext'
6723   { (eval echo "$as_me:6723: \"$ac_try\"") >&5
6724   (eval $ac_try) 2>&5
6725   ac_status=$?
6726   echo "$as_me:6726: \$? = $ac_status" >&5
6727   (exit $ac_status); }; }; then
6728   ac_cv_lib_gpm_Gpm_Open=yes
6729 else
6730   echo "$as_me: failed program was:" >&5
6731 cat conftest.$ac_ext >&5
6732 ac_cv_lib_gpm_Gpm_Open=no
6733 fi
6734 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6735 LIBS=$ac_check_lib_save_LIBS
6736 fi
6737 echo "$as_me:6737: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6738 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6739 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6740   echo "$as_me:6740: checking for initscr in -lgpm" >&5
6741 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6742 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6743   echo $ECHO_N "(cached) $ECHO_C" >&6
6744 else
6745   ac_check_lib_save_LIBS=$LIBS
6746 LIBS="-lgpm  $LIBS"
6747 cat >conftest.$ac_ext <<_ACEOF
6748 #line 6748 "configure"
6749 #include "confdefs.h"
6750
6751 /* Override any gcc2 internal prototype to avoid an error.  */
6752 #ifdef __cplusplus
6753 extern "C"
6754 #endif
6755 /* We use char because int might match the return type of a gcc2
6756    builtin and then its argument prototype would still apply.  */
6757 char initscr ();
6758 int
6759 main ()
6760 {
6761 initscr ();
6762   ;
6763   return 0;
6764 }
6765 _ACEOF
6766 rm -f conftest.$ac_objext conftest$ac_exeext
6767 if { (eval echo "$as_me:6767: \"$ac_link\"") >&5
6768   (eval $ac_link) 2>&5
6769   ac_status=$?
6770   echo "$as_me:6770: \$? = $ac_status" >&5
6771   (exit $ac_status); } &&
6772          { ac_try='test -s conftest$ac_exeext'
6773   { (eval echo "$as_me:6773: \"$ac_try\"") >&5
6774   (eval $ac_try) 2>&5
6775   ac_status=$?
6776   echo "$as_me:6776: \$? = $ac_status" >&5
6777   (exit $ac_status); }; }; then
6778   ac_cv_lib_gpm_initscr=yes
6779 else
6780   echo "$as_me: failed program was:" >&5
6781 cat conftest.$ac_ext >&5
6782 ac_cv_lib_gpm_initscr=no
6783 fi
6784 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6785 LIBS=$ac_check_lib_save_LIBS
6786 fi
6787 echo "$as_me:6787: result: $ac_cv_lib_gpm_initscr" >&5
6788 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6789 if test $ac_cv_lib_gpm_initscr = yes; then
6790   LIBS="$cf_ncurses_SAVE"
6791 else
6792   cf_ncurses_LIBS="-lgpm"
6793 fi
6794
6795 fi
6796
6797 case $host_os in #(vi
6798 freebsd*)
6799         # This is only necessary if you are linking against an obsolete
6800         # version of ncurses (but it should do no harm, since it's static).
6801         if test "$cf_nculib_root" = ncurses ; then
6802                 echo "$as_me:6802: checking for tgoto in -lmytinfo" >&5
6803 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6804 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6805   echo $ECHO_N "(cached) $ECHO_C" >&6
6806 else
6807   ac_check_lib_save_LIBS=$LIBS
6808 LIBS="-lmytinfo  $LIBS"
6809 cat >conftest.$ac_ext <<_ACEOF
6810 #line 6810 "configure"
6811 #include "confdefs.h"
6812
6813 /* Override any gcc2 internal prototype to avoid an error.  */
6814 #ifdef __cplusplus
6815 extern "C"
6816 #endif
6817 /* We use char because int might match the return type of a gcc2
6818    builtin and then its argument prototype would still apply.  */
6819 char tgoto ();
6820 int
6821 main ()
6822 {
6823 tgoto ();
6824   ;
6825   return 0;
6826 }
6827 _ACEOF
6828 rm -f conftest.$ac_objext conftest$ac_exeext
6829 if { (eval echo "$as_me:6829: \"$ac_link\"") >&5
6830   (eval $ac_link) 2>&5
6831   ac_status=$?
6832   echo "$as_me:6832: \$? = $ac_status" >&5
6833   (exit $ac_status); } &&
6834          { ac_try='test -s conftest$ac_exeext'
6835   { (eval echo "$as_me:6835: \"$ac_try\"") >&5
6836   (eval $ac_try) 2>&5
6837   ac_status=$?
6838   echo "$as_me:6838: \$? = $ac_status" >&5
6839   (exit $ac_status); }; }; then
6840   ac_cv_lib_mytinfo_tgoto=yes
6841 else
6842   echo "$as_me: failed program was:" >&5
6843 cat conftest.$ac_ext >&5
6844 ac_cv_lib_mytinfo_tgoto=no
6845 fi
6846 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6847 LIBS=$ac_check_lib_save_LIBS
6848 fi
6849 echo "$as_me:6849: result: $ac_cv_lib_mytinfo_tgoto" >&5
6850 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6851 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6852   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6853 fi
6854
6855         fi
6856         ;;
6857 esac
6858
6859 LIBS="$cf_ncurses_LIBS $LIBS"
6860
6861 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6862 then
6863         LIBS="-l$cf_nculib_root $LIBS"
6864 else
6865
6866         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6867         cf_libdir=""
6868         echo "$as_me:6868: checking for initscr" >&5
6869 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6870 if test "${ac_cv_func_initscr+set}" = set; then
6871   echo $ECHO_N "(cached) $ECHO_C" >&6
6872 else
6873   cat >conftest.$ac_ext <<_ACEOF
6874 #line 6874 "configure"
6875 #include "confdefs.h"
6876 /* System header to define __stub macros and hopefully few prototypes,
6877     which can conflict with char initscr (); below.  */
6878 #include <assert.h>
6879 /* Override any gcc2 internal prototype to avoid an error.  */
6880 #ifdef __cplusplus
6881 extern "C"
6882 #endif
6883 /* We use char because int might match the return type of a gcc2
6884    builtin and then its argument prototype would still apply.  */
6885 char initscr ();
6886 char (*f) ();
6887
6888 int
6889 main ()
6890 {
6891 /* The GNU C library defines this for functions which it implements
6892     to always fail with ENOSYS.  Some functions are actually named
6893     something starting with __ and the normal name is an alias.  */
6894 #if defined (__stub_initscr) || defined (__stub___initscr)
6895 choke me
6896 #else
6897 f = initscr;
6898 #endif
6899
6900   ;
6901   return 0;
6902 }
6903 _ACEOF
6904 rm -f conftest.$ac_objext conftest$ac_exeext
6905 if { (eval echo "$as_me:6905: \"$ac_link\"") >&5
6906   (eval $ac_link) 2>&5
6907   ac_status=$?
6908   echo "$as_me:6908: \$? = $ac_status" >&5
6909   (exit $ac_status); } &&
6910          { ac_try='test -s conftest$ac_exeext'
6911   { (eval echo "$as_me:6911: \"$ac_try\"") >&5
6912   (eval $ac_try) 2>&5
6913   ac_status=$?
6914   echo "$as_me:6914: \$? = $ac_status" >&5
6915   (exit $ac_status); }; }; then
6916   ac_cv_func_initscr=yes
6917 else
6918   echo "$as_me: failed program was:" >&5
6919 cat conftest.$ac_ext >&5
6920 ac_cv_func_initscr=no
6921 fi
6922 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6923 fi
6924 echo "$as_me:6924: result: $ac_cv_func_initscr" >&5
6925 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6926 if test $ac_cv_func_initscr = yes; then
6927   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6928 else
6929
6930                 cf_save_LIBS="$LIBS"
6931                 echo "$as_me:6931: checking for initscr in -l$cf_nculib_root" >&5
6932 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6933                 LIBS="-l$cf_nculib_root $LIBS"
6934                 cat >conftest.$ac_ext <<_ACEOF
6935 #line 6935 "configure"
6936 #include "confdefs.h"
6937 #include <${cf_cv_ncurses_header:-curses.h}>
6938 int
6939 main ()
6940 {
6941 initscr()
6942   ;
6943   return 0;
6944 }
6945 _ACEOF
6946 rm -f conftest.$ac_objext conftest$ac_exeext
6947 if { (eval echo "$as_me:6947: \"$ac_link\"") >&5
6948   (eval $ac_link) 2>&5
6949   ac_status=$?
6950   echo "$as_me:6950: \$? = $ac_status" >&5
6951   (exit $ac_status); } &&
6952          { ac_try='test -s conftest$ac_exeext'
6953   { (eval echo "$as_me:6953: \"$ac_try\"") >&5
6954   (eval $ac_try) 2>&5
6955   ac_status=$?
6956   echo "$as_me:6956: \$? = $ac_status" >&5
6957   (exit $ac_status); }; }; then
6958   echo "$as_me:6958: result: yes" >&5
6959 echo "${ECHO_T}yes" >&6
6960                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6961
6962 else
6963   echo "$as_me: failed program was:" >&5
6964 cat conftest.$ac_ext >&5
6965 echo "$as_me:6965: result: no" >&5
6966 echo "${ECHO_T}no" >&6
6967
6968 cf_search=
6969 cf_library_path_list=""
6970 if test -n "${LDFLAGS}${LIBS}" ; then
6971         for cf_library_path in $LDFLAGS $LIBS
6972         do
6973                 case $cf_library_path in #(vi
6974                 -L*)
6975                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6976
6977 test "$cf_library_path" != "NONE" && \
6978 test -d "$cf_library_path" && \
6979  {
6980         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6981         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6982         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6983         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6984         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6985         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"
6986 }
6987
6988                         cf_library_path_list="$cf_library_path_list $cf_search"
6989                         ;;
6990                 esac
6991         done
6992 fi
6993
6994 cf_search=
6995
6996 test "/usr" != "$prefix" && \
6997 test -d "/usr" && \
6998 (test $prefix = NONE || test "/usr" != "$prefix") && {
6999         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7000         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7001         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
7002         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
7003         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
7004         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
7005 }
7006
7007 test "$prefix" != "NONE" && \
7008 test -d "$prefix" && \
7009  {
7010         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7011         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7012         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7013         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7014         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7015         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7016 }
7017
7018 test "/usr/local" != "$prefix" && \
7019 test -d "/usr/local" && \
7020 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7021         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7022         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7023         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
7024         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
7025         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
7026         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
7027 }
7028
7029 test "/opt" != "$prefix" && \
7030 test -d "/opt" && \
7031 (test $prefix = NONE || test "/opt" != "$prefix") && {
7032         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7033         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7034         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
7035         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
7036         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
7037         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
7038 }
7039
7040 test "$HOME" != "$prefix" && \
7041 test -d "$HOME" && \
7042 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7043         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7044         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7045         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
7046         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
7047         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
7048         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
7049 }
7050
7051 cf_search="$cf_library_path_list $cf_search"
7052
7053                         for cf_libdir in $cf_search
7054                         do
7055                                 echo "$as_me:7055: checking for -l$cf_nculib_root in $cf_libdir" >&5
7056 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7057                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7058                                 cat >conftest.$ac_ext <<_ACEOF
7059 #line 7059 "configure"
7060 #include "confdefs.h"
7061 #include <${cf_cv_ncurses_header:-curses.h}>
7062 int
7063 main ()
7064 {
7065 initscr()
7066   ;
7067   return 0;
7068 }
7069 _ACEOF
7070 rm -f conftest.$ac_objext conftest$ac_exeext
7071 if { (eval echo "$as_me:7071: \"$ac_link\"") >&5
7072   (eval $ac_link) 2>&5
7073   ac_status=$?
7074   echo "$as_me:7074: \$? = $ac_status" >&5
7075   (exit $ac_status); } &&
7076          { ac_try='test -s conftest$ac_exeext'
7077   { (eval echo "$as_me:7077: \"$ac_try\"") >&5
7078   (eval $ac_try) 2>&5
7079   ac_status=$?
7080   echo "$as_me:7080: \$? = $ac_status" >&5
7081   (exit $ac_status); }; }; then
7082   echo "$as_me:7082: result: yes" >&5
7083 echo "${ECHO_T}yes" >&6
7084                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7085                                          break
7086 else
7087   echo "$as_me: failed program was:" >&5
7088 cat conftest.$ac_ext >&5
7089 echo "$as_me:7089: result: no" >&5
7090 echo "${ECHO_T}no" >&6
7091                                          LIBS="$cf_save_LIBS"
7092 fi
7093 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7094                         done
7095
7096 fi
7097 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7098
7099 fi
7100
7101 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7102
7103 if test $cf_found_library = no ; then
7104         { { echo "$as_me:7104: error: Cannot link $cf_nculib_root library" >&5
7105 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7106    { (exit 1); exit 1; }; }
7107 fi
7108
7109 fi
7110
7111 if test -n "$cf_ncurses_LIBS" ; then
7112         echo "$as_me:7112: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7113 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7114         cf_ncurses_SAVE="$LIBS"
7115         for p in $cf_ncurses_LIBS ; do
7116                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7117                 if test "$q" != "$LIBS" ; then
7118                         LIBS="$q"
7119                 fi
7120         done
7121         cat >conftest.$ac_ext <<_ACEOF
7122 #line 7122 "configure"
7123 #include "confdefs.h"
7124 #include <${cf_cv_ncurses_header:-curses.h}>
7125 int
7126 main ()
7127 {
7128 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7129   ;
7130   return 0;
7131 }
7132 _ACEOF
7133 rm -f conftest.$ac_objext conftest$ac_exeext
7134 if { (eval echo "$as_me:7134: \"$ac_link\"") >&5
7135   (eval $ac_link) 2>&5
7136   ac_status=$?
7137   echo "$as_me:7137: \$? = $ac_status" >&5
7138   (exit $ac_status); } &&
7139          { ac_try='test -s conftest$ac_exeext'
7140   { (eval echo "$as_me:7140: \"$ac_try\"") >&5
7141   (eval $ac_try) 2>&5
7142   ac_status=$?
7143   echo "$as_me:7143: \$? = $ac_status" >&5
7144   (exit $ac_status); }; }; then
7145   echo "$as_me:7145: result: yes" >&5
7146 echo "${ECHO_T}yes" >&6
7147 else
7148   echo "$as_me: failed program was:" >&5
7149 cat conftest.$ac_ext >&5
7150 echo "$as_me:7150: result: no" >&5
7151 echo "${ECHO_T}no" >&6
7152                  LIBS="$cf_ncurses_SAVE"
7153 fi
7154 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7155 fi
7156
7157 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7158
7159 cat >>confdefs.h <<EOF
7160 #define $cf_nculib_ROOT 1
7161 EOF
7162
7163 fi
7164
7165         ;;
7166 ncursesw)
7167         cf_cv_libtype=w
7168
7169 echo "$as_me:7169: checking for multibyte character support" >&5
7170 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7171 if test "${cf_cv_utf8_lib+set}" = set; then
7172   echo $ECHO_N "(cached) $ECHO_C" >&6
7173 else
7174
7175         cf_save_LIBS="$LIBS"
7176         cat >conftest.$ac_ext <<_ACEOF
7177 #line 7177 "configure"
7178 #include "confdefs.h"
7179
7180 #include <stdlib.h>
7181 int
7182 main ()
7183 {
7184 putwc(0,0);
7185   ;
7186   return 0;
7187 }
7188 _ACEOF
7189 rm -f conftest.$ac_objext conftest$ac_exeext
7190 if { (eval echo "$as_me:7190: \"$ac_link\"") >&5
7191   (eval $ac_link) 2>&5
7192   ac_status=$?
7193   echo "$as_me:7193: \$? = $ac_status" >&5
7194   (exit $ac_status); } &&
7195          { ac_try='test -s conftest$ac_exeext'
7196   { (eval echo "$as_me:7196: \"$ac_try\"") >&5
7197   (eval $ac_try) 2>&5
7198   ac_status=$?
7199   echo "$as_me:7199: \$? = $ac_status" >&5
7200   (exit $ac_status); }; }; then
7201   cf_cv_utf8_lib=yes
7202 else
7203   echo "$as_me: failed program was:" >&5
7204 cat conftest.$ac_ext >&5
7205
7206 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7207 # will be set on completion of the AC_TRY_LINK below.
7208 cf_cv_header_path_utf8=
7209 cf_cv_library_path_utf8=
7210
7211 echo "${as_me:-configure}:7211: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7212
7213 cf_save_LIBS="$LIBS"
7214
7215 cat >conftest.$ac_ext <<_ACEOF
7216 #line 7216 "configure"
7217 #include "confdefs.h"
7218
7219 #include <libutf8.h>
7220 int
7221 main ()
7222 {
7223 putwc(0,0);
7224   ;
7225   return 0;
7226 }
7227 _ACEOF
7228 rm -f conftest.$ac_objext conftest$ac_exeext
7229 if { (eval echo "$as_me:7229: \"$ac_link\"") >&5
7230   (eval $ac_link) 2>&5
7231   ac_status=$?
7232   echo "$as_me:7232: \$? = $ac_status" >&5
7233   (exit $ac_status); } &&
7234          { ac_try='test -s conftest$ac_exeext'
7235   { (eval echo "$as_me:7235: \"$ac_try\"") >&5
7236   (eval $ac_try) 2>&5
7237   ac_status=$?
7238   echo "$as_me:7238: \$? = $ac_status" >&5
7239   (exit $ac_status); }; }; then
7240
7241         cf_cv_find_linkage_utf8=yes
7242         cf_cv_header_path_utf8=/usr/include
7243         cf_cv_library_path_utf8=/usr/lib
7244
7245 else
7246   echo "$as_me: failed program was:" >&5
7247 cat conftest.$ac_ext >&5
7248
7249 LIBS="-lutf8  $cf_save_LIBS"
7250
7251 cat >conftest.$ac_ext <<_ACEOF
7252 #line 7252 "configure"
7253 #include "confdefs.h"
7254
7255 #include <libutf8.h>
7256 int
7257 main ()
7258 {
7259 putwc(0,0);
7260   ;
7261   return 0;
7262 }
7263 _ACEOF
7264 rm -f conftest.$ac_objext conftest$ac_exeext
7265 if { (eval echo "$as_me:7265: \"$ac_link\"") >&5
7266   (eval $ac_link) 2>&5
7267   ac_status=$?
7268   echo "$as_me:7268: \$? = $ac_status" >&5
7269   (exit $ac_status); } &&
7270          { ac_try='test -s conftest$ac_exeext'
7271   { (eval echo "$as_me:7271: \"$ac_try\"") >&5
7272   (eval $ac_try) 2>&5
7273   ac_status=$?
7274   echo "$as_me:7274: \$? = $ac_status" >&5
7275   (exit $ac_status); }; }; then
7276
7277         cf_cv_find_linkage_utf8=yes
7278         cf_cv_header_path_utf8=/usr/include
7279         cf_cv_library_path_utf8=/usr/lib
7280         cf_cv_library_file_utf8="-lutf8"
7281
7282 else
7283   echo "$as_me: failed program was:" >&5
7284 cat conftest.$ac_ext >&5
7285
7286         cf_cv_find_linkage_utf8=no
7287         LIBS="$cf_save_LIBS"
7288
7289     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
7290
7291 echo "${as_me:-configure}:7291: testing find linkage for utf8 library ..." 1>&5
7292
7293 echo "${as_me:-configure}:7293: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7294
7295     cf_save_CPPFLAGS="$CPPFLAGS"
7296     cf_test_CPPFLAGS="$CPPFLAGS"
7297
7298 cf_search=
7299
7300 # collect the current set of include-directories from compiler flags
7301 cf_header_path_list=""
7302 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7303         for cf_header_path in $CPPFLAGS $CFLAGS
7304         do
7305                 case $cf_header_path in #(vi
7306                 -I*)
7307                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7308
7309 test "$cf_header_path" != "NONE" && \
7310 test -d "$cf_header_path" && \
7311  {
7312         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7313         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7314         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7315         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7316         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7317         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7318 }
7319
7320                         cf_header_path_list="$cf_header_path_list $cf_search"
7321                         ;;
7322                 esac
7323         done
7324 fi
7325
7326 # add the variations for the package we are looking for
7327
7328 cf_search=
7329
7330 test "/usr" != "$prefix" && \
7331 test -d "/usr" && \
7332 (test $prefix = NONE || test "/usr" != "$prefix") && {
7333         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7334         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7335         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
7336         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
7337         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
7338         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
7339 }
7340
7341 test "$prefix" != "NONE" && \
7342 test -d "$prefix" && \
7343  {
7344         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7345         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7346         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7347         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7348         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7349         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7350 }
7351
7352 test "/usr/local" != "$prefix" && \
7353 test -d "/usr/local" && \
7354 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7355         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
7356         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
7357         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
7358         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
7359         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
7360         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
7361 }
7362
7363 test "/opt" != "$prefix" && \
7364 test -d "/opt" && \
7365 (test $prefix = NONE || test "/opt" != "$prefix") && {
7366         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
7367         test -d /opt/include &&          cf_search="$cf_search /opt/include"
7368         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
7369         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
7370         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
7371         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
7372 }
7373
7374 test "$HOME" != "$prefix" && \
7375 test -d "$HOME" && \
7376 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7377         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
7378         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
7379         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
7380         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
7381         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
7382         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
7383 }
7384
7385 test "$includedir" != NONE && \
7386 test "$includedir" != "/usr/include" && \
7387 test -d "$includedir" && {
7388         test -d $includedir &&    cf_search="$cf_search $includedir"
7389         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7390 }
7391
7392 test "$oldincludedir" != NONE && \
7393 test "$oldincludedir" != "/usr/include" && \
7394 test -d "$oldincludedir" && {
7395         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7396         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7397 }
7398
7399 cf_search="$cf_search $cf_header_path_list"
7400
7401     for cf_cv_header_path_utf8 in $cf_search
7402     do
7403       if test -d $cf_cv_header_path_utf8 ; then
7404         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7405
7406 echo "${as_me:-configure}:7406: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7407
7408         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
7409         cat >conftest.$ac_ext <<_ACEOF
7410 #line 7410 "configure"
7411 #include "confdefs.h"
7412
7413 #include <libutf8.h>
7414 int
7415 main ()
7416 {
7417 putwc(0,0);
7418   ;
7419   return 0;
7420 }
7421 _ACEOF
7422 rm -f conftest.$ac_objext
7423 if { (eval echo "$as_me:7423: \"$ac_compile\"") >&5
7424   (eval $ac_compile) 2>&5
7425   ac_status=$?
7426   echo "$as_me:7426: \$? = $ac_status" >&5
7427   (exit $ac_status); } &&
7428          { ac_try='test -s conftest.$ac_objext'
7429   { (eval echo "$as_me:7429: \"$ac_try\"") >&5
7430   (eval $ac_try) 2>&5
7431   ac_status=$?
7432   echo "$as_me:7432: \$? = $ac_status" >&5
7433   (exit $ac_status); }; }; then
7434
7435             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7436
7437 echo "${as_me:-configure}:7437: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7438
7439             cf_cv_find_linkage_utf8=maybe
7440             cf_test_CPPFLAGS="$CPPFLAGS"
7441             break
7442 else
7443   echo "$as_me: failed program was:" >&5
7444 cat conftest.$ac_ext >&5
7445
7446             CPPFLAGS="$cf_save_CPPFLAGS"
7447
7448 fi
7449 rm -f conftest.$ac_objext conftest.$ac_ext
7450       fi
7451     done
7452
7453     if test "$cf_cv_find_linkage_utf8" = maybe ; then
7454
7455 echo "${as_me:-configure}:7455: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7456
7457       cf_save_LIBS="$LIBS"
7458       cf_save_LDFLAGS="$LDFLAGS"
7459
7460       if test "$cf_cv_find_linkage_utf8" != yes ; then
7461
7462 cf_search=
7463 cf_library_path_list=""
7464 if test -n "${LDFLAGS}${LIBS}" ; then
7465         for cf_library_path in $LDFLAGS $LIBS
7466         do
7467                 case $cf_library_path in #(vi
7468                 -L*)
7469                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7470
7471 test "$cf_library_path" != "NONE" && \
7472 test -d "$cf_library_path" && \
7473  {
7474         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7475         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7476         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7477         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7478         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7479         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7480 }
7481
7482                         cf_library_path_list="$cf_library_path_list $cf_search"
7483                         ;;
7484                 esac
7485         done
7486 fi
7487
7488 cf_search=
7489
7490 test "/usr" != "$prefix" && \
7491 test -d "/usr" && \
7492 (test $prefix = NONE || test "/usr" != "$prefix") && {
7493         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7494         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7495         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
7496         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
7497         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
7498         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
7499 }
7500
7501 test "$prefix" != "NONE" && \
7502 test -d "$prefix" && \
7503  {
7504         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7505         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7506         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7507         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7508         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7509         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7510 }
7511
7512 test "/usr/local" != "$prefix" && \
7513 test -d "/usr/local" && \
7514 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7515         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7516         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7517         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
7518         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
7519         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
7520         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
7521 }
7522
7523 test "/opt" != "$prefix" && \
7524 test -d "/opt" && \
7525 (test $prefix = NONE || test "/opt" != "$prefix") && {
7526         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7527         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7528         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
7529         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
7530         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
7531         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
7532 }
7533
7534 test "$HOME" != "$prefix" && \
7535 test -d "$HOME" && \
7536 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7537         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7538         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7539         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
7540         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
7541         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
7542         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
7543 }
7544
7545 cf_search="$cf_library_path_list $cf_search"
7546
7547         for cf_cv_library_path_utf8 in $cf_search
7548         do
7549           if test -d $cf_cv_library_path_utf8 ; then
7550             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
7551
7552 echo "${as_me:-configure}:7552: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7553
7554             CPPFLAGS="$cf_test_CPPFLAGS"
7555             LIBS="-lutf8  $cf_save_LIBS"
7556             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7557             cat >conftest.$ac_ext <<_ACEOF
7558 #line 7558 "configure"
7559 #include "confdefs.h"
7560
7561 #include <libutf8.h>
7562 int
7563 main ()
7564 {
7565 putwc(0,0);
7566   ;
7567   return 0;
7568 }
7569 _ACEOF
7570 rm -f conftest.$ac_objext conftest$ac_exeext
7571 if { (eval echo "$as_me:7571: \"$ac_link\"") >&5
7572   (eval $ac_link) 2>&5
7573   ac_status=$?
7574   echo "$as_me:7574: \$? = $ac_status" >&5
7575   (exit $ac_status); } &&
7576          { ac_try='test -s conftest$ac_exeext'
7577   { (eval echo "$as_me:7577: \"$ac_try\"") >&5
7578   (eval $ac_try) 2>&5
7579   ac_status=$?
7580   echo "$as_me:7580: \$? = $ac_status" >&5
7581   (exit $ac_status); }; }; then
7582
7583                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7584
7585 echo "${as_me:-configure}:7585: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7586
7587                 cf_cv_find_linkage_utf8=yes
7588                 cf_cv_library_file_utf8="-lutf8"
7589                 break
7590 else
7591   echo "$as_me: failed program was:" >&5
7592 cat conftest.$ac_ext >&5
7593
7594                 CPPFLAGS="$cf_save_CPPFLAGS"
7595                 LIBS="$cf_save_LIBS"
7596                 LDFLAGS="$cf_save_LDFLAGS"
7597
7598 fi
7599 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7600           fi
7601         done
7602         CPPFLAGS="$cf_save_CPPFLAGS"
7603         LDFLAGS="$cf_save_LDFLAGS"
7604       fi
7605
7606     else
7607       cf_cv_find_linkage_utf8=no
7608     fi
7609
7610 fi
7611 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7612
7613 fi
7614 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7615
7616 LIBS="$cf_save_LIBS"
7617
7618 if test "$cf_cv_find_linkage_utf8" = yes ; then
7619 cf_cv_utf8_lib=add-on
7620 else
7621 cf_cv_utf8_lib=no
7622 fi
7623
7624 fi
7625 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7626 fi
7627 echo "$as_me:7627: result: $cf_cv_utf8_lib" >&5
7628 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7629
7630 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7631 # ncurses/ncursesw:
7632 if test "$cf_cv_utf8_lib" = "add-on" ; then
7633         cat >>confdefs.h <<\EOF
7634 #define HAVE_LIBUTF8_H 1
7635 EOF
7636
7637 if test -n "$cf_cv_header_path_utf8" ; then
7638   for cf_add_incdir in $cf_cv_header_path_utf8
7639   do
7640         while test $cf_add_incdir != /usr/include
7641         do
7642           if test -d $cf_add_incdir
7643           then
7644                 cf_have_incdir=no
7645                 if test -n "$CFLAGS$CPPFLAGS" ; then
7646                   # a loop is needed to ensure we can add subdirs of existing dirs
7647                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7648                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7649                           cf_have_incdir=yes; break
7650                         fi
7651                   done
7652                 fi
7653
7654                 if test "$cf_have_incdir" = no ; then
7655                   if test "$cf_add_incdir" = /usr/local/include ; then
7656                         if test "$GCC" = yes
7657                         then
7658                           cf_save_CPPFLAGS=$CPPFLAGS
7659                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7660                           cat >conftest.$ac_ext <<_ACEOF
7661 #line 7661 "configure"
7662 #include "confdefs.h"
7663 #include <stdio.h>
7664 int
7665 main ()
7666 {
7667 printf("Hello")
7668   ;
7669   return 0;
7670 }
7671 _ACEOF
7672 rm -f conftest.$ac_objext
7673 if { (eval echo "$as_me:7673: \"$ac_compile\"") >&5
7674   (eval $ac_compile) 2>&5
7675   ac_status=$?
7676   echo "$as_me:7676: \$? = $ac_status" >&5
7677   (exit $ac_status); } &&
7678          { ac_try='test -s conftest.$ac_objext'
7679   { (eval echo "$as_me:7679: \"$ac_try\"") >&5
7680   (eval $ac_try) 2>&5
7681   ac_status=$?
7682   echo "$as_me:7682: \$? = $ac_status" >&5
7683   (exit $ac_status); }; }; then
7684   :
7685 else
7686   echo "$as_me: failed program was:" >&5
7687 cat conftest.$ac_ext >&5
7688 cf_have_incdir=yes
7689 fi
7690 rm -f conftest.$ac_objext conftest.$ac_ext
7691                           CPPFLAGS=$cf_save_CPPFLAGS
7692                         fi
7693                   fi
7694                 fi
7695
7696                 if test "$cf_have_incdir" = no ; then
7697                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7698
7699 echo "${as_me:-configure}:7699: testing adding $cf_add_incdir to include-path ..." 1>&5
7700
7701                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7702
7703                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7704                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7705                   cf_add_incdir="$cf_top_incdir"
7706                 else
7707                   break
7708                 fi
7709           fi
7710         done
7711   done
7712 fi
7713
7714 if test -n "$cf_cv_library_path_utf8" ; then
7715   for cf_add_libdir in $cf_cv_library_path_utf8
7716   do
7717     if test $cf_add_libdir = /usr/lib ; then
7718       :
7719     elif test -d $cf_add_libdir
7720     then
7721       cf_have_libdir=no
7722       if test -n "$LDFLAGS$LIBS" ; then
7723         # a loop is needed to ensure we can add subdirs of existing dirs
7724         for cf_test_libdir in $LDFLAGS $LIBS ; do
7725           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7726             cf_have_libdir=yes; break
7727           fi
7728         done
7729       fi
7730       if test "$cf_have_libdir" = no ; then
7731         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7732
7733 echo "${as_me:-configure}:7733: testing adding $cf_add_libdir to library-path ..." 1>&5
7734
7735         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7736       fi
7737     fi
7738   done
7739 fi
7740
7741         LIBS="$cf_cv_library_file_utf8 $LIBS"
7742 fi
7743
7744 cf_ncuconfig_root=ncursesw
7745
7746 echo "Looking for ${cf_ncuconfig_root}-config"
7747 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7748 do
7749   # Extract the first word of "$ac_prog", so it can be a program name with args.
7750 set dummy $ac_prog; ac_word=$2
7751 echo "$as_me:7751: checking for $ac_word" >&5
7752 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7753 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
7754   echo $ECHO_N "(cached) $ECHO_C" >&6
7755 else
7756   case $NCURSES_CONFIG in
7757   [\\/]* | ?:[\\/]*)
7758   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
7759   ;;
7760   *)
7761   ac_save_IFS=$IFS; IFS=$ac_path_separator
7762 ac_dummy="$PATH"
7763 for ac_dir in $ac_dummy; do
7764   IFS=$ac_save_IFS
7765   test -z "$ac_dir" && ac_dir=.
7766   if $as_executable_p "$ac_dir/$ac_word"; then
7767    ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
7768    echo "$as_me:7768: found $ac_dir/$ac_word" >&5
7769    break
7770 fi
7771 done
7772
7773   ;;
7774 esac
7775 fi
7776 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
7777
7778 if test -n "$NCURSES_CONFIG"; then
7779   echo "$as_me:7779: result: $NCURSES_CONFIG" >&5
7780 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7781 else
7782   echo "$as_me:7782: result: no" >&5
7783 echo "${ECHO_T}no" >&6
7784 fi
7785
7786   test -n "$NCURSES_CONFIG" && break
7787 done
7788 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
7789
7790 if test "$NCURSES_CONFIG" != none ; then
7791
7792 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7793 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
7794
7795 # even with config script, some packages use no-override for curses.h
7796
7797 echo "$as_me:7797: checking if we have identified curses headers" >&5
7798 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7799 if test "${cf_cv_ncurses_header+set}" = set; then
7800   echo $ECHO_N "(cached) $ECHO_C" >&6
7801 else
7802
7803 cf_cv_ncurses_header=none
7804 for cf_header in  \
7805     ncursesw/curses.h \
7806         ncursesw/ncurses.h \
7807         curses.h \
7808         ncurses.h
7809 do
7810 cat >conftest.$ac_ext <<_ACEOF
7811 #line 7811 "configure"
7812 #include "confdefs.h"
7813 #include <${cf_header}>
7814 int
7815 main ()
7816 {
7817 initscr(); tgoto("?", 0,0)
7818   ;
7819   return 0;
7820 }
7821 _ACEOF
7822 rm -f conftest.$ac_objext
7823 if { (eval echo "$as_me:7823: \"$ac_compile\"") >&5
7824   (eval $ac_compile) 2>&5
7825   ac_status=$?
7826   echo "$as_me:7826: \$? = $ac_status" >&5
7827   (exit $ac_status); } &&
7828          { ac_try='test -s conftest.$ac_objext'
7829   { (eval echo "$as_me:7829: \"$ac_try\"") >&5
7830   (eval $ac_try) 2>&5
7831   ac_status=$?
7832   echo "$as_me:7832: \$? = $ac_status" >&5
7833   (exit $ac_status); }; }; then
7834   cf_cv_ncurses_header=$cf_header; break
7835 else
7836   echo "$as_me: failed program was:" >&5
7837 cat conftest.$ac_ext >&5
7838 fi
7839 rm -f conftest.$ac_objext conftest.$ac_ext
7840 done
7841
7842 fi
7843 echo "$as_me:7843: result: $cf_cv_ncurses_header" >&5
7844 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7845
7846 if test "$cf_cv_ncurses_header" = none ; then
7847         { { echo "$as_me:7847: error: No curses header-files found" >&5
7848 echo "$as_me: error: No curses header-files found" >&2;}
7849    { (exit 1); exit 1; }; }
7850 fi
7851
7852 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7853
7854 for ac_header in $cf_cv_ncurses_header
7855 do
7856 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7857 echo "$as_me:7857: checking for $ac_header" >&5
7858 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7859 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7860   echo $ECHO_N "(cached) $ECHO_C" >&6
7861 else
7862   cat >conftest.$ac_ext <<_ACEOF
7863 #line 7863 "configure"
7864 #include "confdefs.h"
7865 #include <$ac_header>
7866 _ACEOF
7867 if { (eval echo "$as_me:7867: \"$ac_cpp conftest.$ac_ext\"") >&5
7868   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7869   ac_status=$?
7870   egrep -v '^ *\+' conftest.er1 >conftest.err
7871   rm -f conftest.er1
7872   cat conftest.err >&5
7873   echo "$as_me:7873: \$? = $ac_status" >&5
7874   (exit $ac_status); } >/dev/null; then
7875   if test -s conftest.err; then
7876     ac_cpp_err=$ac_c_preproc_warn_flag
7877   else
7878     ac_cpp_err=
7879   fi
7880 else
7881   ac_cpp_err=yes
7882 fi
7883 if test -z "$ac_cpp_err"; then
7884   eval "$as_ac_Header=yes"
7885 else
7886   echo "$as_me: failed program was:" >&5
7887   cat conftest.$ac_ext >&5
7888   eval "$as_ac_Header=no"
7889 fi
7890 rm -f conftest.err conftest.$ac_ext
7891 fi
7892 echo "$as_me:7892: result: `eval echo '${'$as_ac_Header'}'`" >&5
7893 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7894 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7895   cat >>confdefs.h <<EOF
7896 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7897 EOF
7898
7899 fi
7900 done
7901
7902 cat >>confdefs.h <<\EOF
7903 #define NCURSES 1
7904 EOF
7905
7906 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7907
7908 cat >>confdefs.h <<EOF
7909 #define $cf_nculib_ROOT 1
7910 EOF
7911
7912 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7913
7914 else
7915
7916 cf_ncuhdr_root=ncursesw
7917
7918 test -n "$cf_cv_curses_dir" && \
7919 test "$cf_cv_curses_dir" != "no" && { \
7920
7921 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7922   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7923   do
7924         while test $cf_add_incdir != /usr/include
7925         do
7926           if test -d $cf_add_incdir
7927           then
7928                 cf_have_incdir=no
7929                 if test -n "$CFLAGS$CPPFLAGS" ; then
7930                   # a loop is needed to ensure we can add subdirs of existing dirs
7931                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7932                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7933                           cf_have_incdir=yes; break
7934                         fi
7935                   done
7936                 fi
7937
7938                 if test "$cf_have_incdir" = no ; then
7939                   if test "$cf_add_incdir" = /usr/local/include ; then
7940                         if test "$GCC" = yes
7941                         then
7942                           cf_save_CPPFLAGS=$CPPFLAGS
7943                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7944                           cat >conftest.$ac_ext <<_ACEOF
7945 #line 7945 "configure"
7946 #include "confdefs.h"
7947 #include <stdio.h>
7948 int
7949 main ()
7950 {
7951 printf("Hello")
7952   ;
7953   return 0;
7954 }
7955 _ACEOF
7956 rm -f conftest.$ac_objext
7957 if { (eval echo "$as_me:7957: \"$ac_compile\"") >&5
7958   (eval $ac_compile) 2>&5
7959   ac_status=$?
7960   echo "$as_me:7960: \$? = $ac_status" >&5
7961   (exit $ac_status); } &&
7962          { ac_try='test -s conftest.$ac_objext'
7963   { (eval echo "$as_me:7963: \"$ac_try\"") >&5
7964   (eval $ac_try) 2>&5
7965   ac_status=$?
7966   echo "$as_me:7966: \$? = $ac_status" >&5
7967   (exit $ac_status); }; }; then
7968   :
7969 else
7970   echo "$as_me: failed program was:" >&5
7971 cat conftest.$ac_ext >&5
7972 cf_have_incdir=yes
7973 fi
7974 rm -f conftest.$ac_objext conftest.$ac_ext
7975                           CPPFLAGS=$cf_save_CPPFLAGS
7976                         fi
7977                   fi
7978                 fi
7979
7980                 if test "$cf_have_incdir" = no ; then
7981                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7982
7983 echo "${as_me:-configure}:7983: testing adding $cf_add_incdir to include-path ..." 1>&5
7984
7985                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7986
7987                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7988                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7989                   cf_add_incdir="$cf_top_incdir"
7990                 else
7991                   break
7992                 fi
7993           fi
7994         done
7995   done
7996 fi
7997
7998 }
7999
8000 echo "$as_me:8000: checking for $cf_ncuhdr_root header in include-path" >&5
8001 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8002 if test "${cf_cv_ncurses_h+set}" = set; then
8003   echo $ECHO_N "(cached) $ECHO_C" >&6
8004 else
8005
8006         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8007         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8008         for cf_header in $cf_header_list
8009         do
8010
8011         cat >conftest.$ac_ext <<_ACEOF
8012 #line 8012 "configure"
8013 #include "confdefs.h"
8014
8015 #define _XOPEN_SOURCE_EXTENDED
8016 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8017 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8018
8019 #include <$cf_header>
8020 int
8021 main ()
8022 {
8023
8024 #ifdef NCURSES_VERSION
8025
8026 #ifndef WACS_BSSB
8027         make an error
8028 #endif
8029
8030 printf("%s\n", NCURSES_VERSION);
8031 #else
8032 #ifdef __NCURSES_H
8033 printf("old\n");
8034 #else
8035         make an error
8036 #endif
8037 #endif
8038
8039   ;
8040   return 0;
8041 }
8042 _ACEOF
8043 rm -f conftest.$ac_objext
8044 if { (eval echo "$as_me:8044: \"$ac_compile\"") >&5
8045   (eval $ac_compile) 2>&5
8046   ac_status=$?
8047   echo "$as_me:8047: \$? = $ac_status" >&5
8048   (exit $ac_status); } &&
8049          { ac_try='test -s conftest.$ac_objext'
8050   { (eval echo "$as_me:8050: \"$ac_try\"") >&5
8051   (eval $ac_try) 2>&5
8052   ac_status=$?
8053   echo "$as_me:8053: \$? = $ac_status" >&5
8054   (exit $ac_status); }; }; then
8055   cf_cv_ncurses_h=$cf_header
8056
8057 else
8058   echo "$as_me: failed program was:" >&5
8059 cat conftest.$ac_ext >&5
8060 cf_cv_ncurses_h=no
8061 fi
8062 rm -f conftest.$ac_objext conftest.$ac_ext
8063
8064                 test "$cf_cv_ncurses_h" != no && break
8065         done
8066
8067 fi
8068 echo "$as_me:8068: result: $cf_cv_ncurses_h" >&5
8069 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8070
8071 if test "$cf_cv_ncurses_h" != no ; then
8072         cf_cv_ncurses_header=$cf_cv_ncurses_h
8073 else
8074
8075 echo "$as_me:8075: checking for $cf_ncuhdr_root include-path" >&5
8076 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8077 if test "${cf_cv_ncurses_h2+set}" = set; then
8078   echo $ECHO_N "(cached) $ECHO_C" >&6
8079 else
8080
8081         test -n "$verbose" && echo
8082
8083 cf_search=
8084
8085 # collect the current set of include-directories from compiler flags
8086 cf_header_path_list=""
8087 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8088         for cf_header_path in $CPPFLAGS $CFLAGS
8089         do
8090                 case $cf_header_path in #(vi
8091                 -I*)
8092                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8093
8094 test "$cf_header_path" != "NONE" && \
8095 test -d "$cf_header_path" && \
8096  {
8097         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8098         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8099         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8100         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8101         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8102         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"
8103 }
8104
8105                         cf_header_path_list="$cf_header_path_list $cf_search"
8106                         ;;
8107                 esac
8108         done
8109 fi
8110
8111 # add the variations for the package we are looking for
8112
8113 cf_search=
8114
8115 test "/usr" != "$prefix" && \
8116 test -d "/usr" && \
8117 (test $prefix = NONE || test "/usr" != "$prefix") && {
8118         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
8119         test -d /usr/include &&          cf_search="$cf_search /usr/include"
8120         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
8121         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
8122         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
8123         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8124 }
8125
8126 test "$prefix" != "NONE" && \
8127 test -d "$prefix" && \
8128  {
8129         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8130         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8131         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8132         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8133         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8134         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8135 }
8136
8137 test "/usr/local" != "$prefix" && \
8138 test -d "/usr/local" && \
8139 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8140         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
8141         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
8142         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
8143         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
8144         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
8145         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8146 }
8147
8148 test "/opt" != "$prefix" && \
8149 test -d "/opt" && \
8150 (test $prefix = NONE || test "/opt" != "$prefix") && {
8151         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
8152         test -d /opt/include &&          cf_search="$cf_search /opt/include"
8153         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
8154         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
8155         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
8156         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8157 }
8158
8159 test "$HOME" != "$prefix" && \
8160 test -d "$HOME" && \
8161 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8162         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
8163         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
8164         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
8165         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
8166         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
8167         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8168 }
8169
8170 test "$includedir" != NONE && \
8171 test "$includedir" != "/usr/include" && \
8172 test -d "$includedir" && {
8173         test -d $includedir &&    cf_search="$cf_search $includedir"
8174         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8175 }
8176
8177 test "$oldincludedir" != NONE && \
8178 test "$oldincludedir" != "/usr/include" && \
8179 test -d "$oldincludedir" && {
8180         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8181         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8182 }
8183
8184 cf_search="$cf_search $cf_header_path_list"
8185
8186         test -n "$verbose" && echo search path $cf_search
8187         cf_save2_CPPFLAGS="$CPPFLAGS"
8188         for cf_incdir in $cf_search
8189         do
8190
8191 if test -n "$cf_incdir" ; then
8192   for cf_add_incdir in $cf_incdir
8193   do
8194         while test $cf_add_incdir != /usr/include
8195         do
8196           if test -d $cf_add_incdir
8197           then
8198                 cf_have_incdir=no
8199                 if test -n "$CFLAGS$CPPFLAGS" ; then
8200                   # a loop is needed to ensure we can add subdirs of existing dirs
8201                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8202                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8203                           cf_have_incdir=yes; break
8204                         fi
8205                   done
8206                 fi
8207
8208                 if test "$cf_have_incdir" = no ; then
8209                   if test "$cf_add_incdir" = /usr/local/include ; then
8210                         if test "$GCC" = yes
8211                         then
8212                           cf_save_CPPFLAGS=$CPPFLAGS
8213                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8214                           cat >conftest.$ac_ext <<_ACEOF
8215 #line 8215 "configure"
8216 #include "confdefs.h"
8217 #include <stdio.h>
8218 int
8219 main ()
8220 {
8221 printf("Hello")
8222   ;
8223   return 0;
8224 }
8225 _ACEOF
8226 rm -f conftest.$ac_objext
8227 if { (eval echo "$as_me:8227: \"$ac_compile\"") >&5
8228   (eval $ac_compile) 2>&5
8229   ac_status=$?
8230   echo "$as_me:8230: \$? = $ac_status" >&5
8231   (exit $ac_status); } &&
8232          { ac_try='test -s conftest.$ac_objext'
8233   { (eval echo "$as_me:8233: \"$ac_try\"") >&5
8234   (eval $ac_try) 2>&5
8235   ac_status=$?
8236   echo "$as_me:8236: \$? = $ac_status" >&5
8237   (exit $ac_status); }; }; then
8238   :
8239 else
8240   echo "$as_me: failed program was:" >&5
8241 cat conftest.$ac_ext >&5
8242 cf_have_incdir=yes
8243 fi
8244 rm -f conftest.$ac_objext conftest.$ac_ext
8245                           CPPFLAGS=$cf_save_CPPFLAGS
8246                         fi
8247                   fi
8248                 fi
8249
8250                 if test "$cf_have_incdir" = no ; then
8251                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8252
8253 echo "${as_me:-configure}:8253: testing adding $cf_add_incdir to include-path ..." 1>&5
8254
8255                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8256
8257                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8258                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8259                   cf_add_incdir="$cf_top_incdir"
8260                 else
8261                   break
8262                 fi
8263           fi
8264         done
8265   done
8266 fi
8267
8268                 for cf_header in \
8269                         ncurses.h \
8270                         curses.h
8271                 do
8272
8273         cat >conftest.$ac_ext <<_ACEOF
8274 #line 8274 "configure"
8275 #include "confdefs.h"
8276
8277 #include <$cf_header>
8278 int
8279 main ()
8280 {
8281
8282 #ifdef NCURSES_VERSION
8283
8284 printf("%s\n", NCURSES_VERSION);
8285 #else
8286 #ifdef __NCURSES_H
8287 printf("old\n");
8288 #else
8289         make an error
8290 #endif
8291 #endif
8292
8293   ;
8294   return 0;
8295 }
8296 _ACEOF
8297 rm -f conftest.$ac_objext
8298 if { (eval echo "$as_me:8298: \"$ac_compile\"") >&5
8299   (eval $ac_compile) 2>&5
8300   ac_status=$?
8301   echo "$as_me:8301: \$? = $ac_status" >&5
8302   (exit $ac_status); } &&
8303          { ac_try='test -s conftest.$ac_objext'
8304   { (eval echo "$as_me:8304: \"$ac_try\"") >&5
8305   (eval $ac_try) 2>&5
8306   ac_status=$?
8307   echo "$as_me:8307: \$? = $ac_status" >&5
8308   (exit $ac_status); }; }; then
8309   cf_cv_ncurses_h2=$cf_header
8310
8311 else
8312   echo "$as_me: failed program was:" >&5
8313 cat conftest.$ac_ext >&5
8314 cf_cv_ncurses_h2=no
8315 fi
8316 rm -f conftest.$ac_objext conftest.$ac_ext
8317
8318                         if test "$cf_cv_ncurses_h2" != no ; then
8319                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8320                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8321                                 break
8322                         fi
8323                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8324                 done
8325                 CPPFLAGS="$cf_save2_CPPFLAGS"
8326                 test "$cf_cv_ncurses_h2" != no && break
8327         done
8328         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8328: error: not found" >&5
8329 echo "$as_me: error: not found" >&2;}
8330    { (exit 1); exit 1; }; }
8331
8332 fi
8333 echo "$as_me:8333: result: $cf_cv_ncurses_h2" >&5
8334 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8335
8336         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8337         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8338         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8339                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8340         fi
8341
8342 if test -n "$cf_1st_incdir" ; then
8343   for cf_add_incdir in $cf_1st_incdir
8344   do
8345         while test $cf_add_incdir != /usr/include
8346         do
8347           if test -d $cf_add_incdir
8348           then
8349                 cf_have_incdir=no
8350                 if test -n "$CFLAGS$CPPFLAGS" ; then
8351                   # a loop is needed to ensure we can add subdirs of existing dirs
8352                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8353                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8354                           cf_have_incdir=yes; break
8355                         fi
8356                   done
8357                 fi
8358
8359                 if test "$cf_have_incdir" = no ; then
8360                   if test "$cf_add_incdir" = /usr/local/include ; then
8361                         if test "$GCC" = yes
8362                         then
8363                           cf_save_CPPFLAGS=$CPPFLAGS
8364                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8365                           cat >conftest.$ac_ext <<_ACEOF
8366 #line 8366 "configure"
8367 #include "confdefs.h"
8368 #include <stdio.h>
8369 int
8370 main ()
8371 {
8372 printf("Hello")
8373   ;
8374   return 0;
8375 }
8376 _ACEOF
8377 rm -f conftest.$ac_objext
8378 if { (eval echo "$as_me:8378: \"$ac_compile\"") >&5
8379   (eval $ac_compile) 2>&5
8380   ac_status=$?
8381   echo "$as_me:8381: \$? = $ac_status" >&5
8382   (exit $ac_status); } &&
8383          { ac_try='test -s conftest.$ac_objext'
8384   { (eval echo "$as_me:8384: \"$ac_try\"") >&5
8385   (eval $ac_try) 2>&5
8386   ac_status=$?
8387   echo "$as_me:8387: \$? = $ac_status" >&5
8388   (exit $ac_status); }; }; then
8389   :
8390 else
8391   echo "$as_me: failed program was:" >&5
8392 cat conftest.$ac_ext >&5
8393 cf_have_incdir=yes
8394 fi
8395 rm -f conftest.$ac_objext conftest.$ac_ext
8396                           CPPFLAGS=$cf_save_CPPFLAGS
8397                         fi
8398                   fi
8399                 fi
8400
8401                 if test "$cf_have_incdir" = no ; then
8402                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8403
8404 echo "${as_me:-configure}:8404: testing adding $cf_add_incdir to include-path ..." 1>&5
8405
8406                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8407
8408                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8409                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8410                   cf_add_incdir="$cf_top_incdir"
8411                 else
8412                   break
8413                 fi
8414           fi
8415         done
8416   done
8417 fi
8418
8419 fi
8420
8421 # Set definitions to allow ifdef'ing for ncurses.h
8422
8423 case $cf_cv_ncurses_header in # (vi
8424 *ncurses.h)
8425         cat >>confdefs.h <<\EOF
8426 #define HAVE_NCURSES_H 1
8427 EOF
8428
8429         ;;
8430 esac
8431
8432 case $cf_cv_ncurses_header in # (vi
8433 ncurses/curses.h|ncurses/ncurses.h)
8434         cat >>confdefs.h <<\EOF
8435 #define HAVE_NCURSES_NCURSES_H 1
8436 EOF
8437
8438         ;;
8439 ncursesw/curses.h|ncursesw/ncurses.h)
8440         cat >>confdefs.h <<\EOF
8441 #define HAVE_NCURSESW_NCURSES_H 1
8442 EOF
8443
8444         ;;
8445 esac
8446
8447 echo "$as_me:8447: checking for terminfo header" >&5
8448 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8449 if test "${cf_cv_term_header+set}" = set; then
8450   echo $ECHO_N "(cached) $ECHO_C" >&6
8451 else
8452
8453 case ${cf_cv_ncurses_header} in #(vi
8454 */ncurses.h|*/ncursesw.h) #(vi
8455         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8456         ;;
8457 *)
8458         cf_term_header=term.h
8459         ;;
8460 esac
8461
8462 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8463 do
8464 cat >conftest.$ac_ext <<_ACEOF
8465 #line 8465 "configure"
8466 #include "confdefs.h"
8467 #include <stdio.h>
8468 #include <${cf_cv_ncurses_header:-curses.h}>
8469 #include <$cf_test>
8470
8471 int
8472 main ()
8473 {
8474 int x = auto_left_margin
8475   ;
8476   return 0;
8477 }
8478 _ACEOF
8479 rm -f conftest.$ac_objext
8480 if { (eval echo "$as_me:8480: \"$ac_compile\"") >&5
8481   (eval $ac_compile) 2>&5
8482   ac_status=$?
8483   echo "$as_me:8483: \$? = $ac_status" >&5
8484   (exit $ac_status); } &&
8485          { ac_try='test -s conftest.$ac_objext'
8486   { (eval echo "$as_me:8486: \"$ac_try\"") >&5
8487   (eval $ac_try) 2>&5
8488   ac_status=$?
8489   echo "$as_me:8489: \$? = $ac_status" >&5
8490   (exit $ac_status); }; }; then
8491
8492         cf_cv_term_header="$cf_test"
8493 else
8494   echo "$as_me: failed program was:" >&5
8495 cat conftest.$ac_ext >&5
8496
8497         cf_cv_term_header=unknown
8498
8499 fi
8500 rm -f conftest.$ac_objext conftest.$ac_ext
8501         test "$cf_cv_term_header" != unknown && break
8502 done
8503
8504 fi
8505 echo "$as_me:8505: result: $cf_cv_term_header" >&5
8506 echo "${ECHO_T}$cf_cv_term_header" >&6
8507
8508 # Set definitions to allow ifdef'ing to accommodate subdirectories
8509
8510 case $cf_cv_term_header in # (vi
8511 *term.h)
8512         cat >>confdefs.h <<\EOF
8513 #define HAVE_TERM_H 1
8514 EOF
8515
8516         ;;
8517 esac
8518
8519 case $cf_cv_term_header in # (vi
8520 ncurses/term.h) #(vi
8521         cat >>confdefs.h <<\EOF
8522 #define HAVE_NCURSES_TERM_H 1
8523 EOF
8524
8525         ;;
8526 ncursesw/term.h)
8527         cat >>confdefs.h <<\EOF
8528 #define HAVE_NCURSESW_TERM_H 1
8529 EOF
8530
8531         ;;
8532 esac
8533
8534 # some applications need this, but should check for NCURSES_VERSION
8535 cat >>confdefs.h <<\EOF
8536 #define NCURSES 1
8537 EOF
8538
8539 echo "$as_me:8539: checking for ncurses version" >&5
8540 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8541 if test "${cf_cv_ncurses_version+set}" = set; then
8542   echo $ECHO_N "(cached) $ECHO_C" >&6
8543 else
8544
8545         cf_cv_ncurses_version=no
8546         cf_tempfile=out$$
8547         rm -f $cf_tempfile
8548         if test "$cross_compiling" = yes; then
8549
8550         # This will not work if the preprocessor splits the line after the
8551         # Autoconf token.  The 'unproto' program does that.
8552         cat > conftest.$ac_ext <<EOF
8553 #include <${cf_cv_ncurses_header:-curses.h}>
8554 #undef Autoconf
8555 #ifdef NCURSES_VERSION
8556 Autoconf NCURSES_VERSION
8557 #else
8558 #ifdef __NCURSES_H
8559 Autoconf "old"
8560 #endif
8561 ;
8562 #endif
8563 EOF
8564         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8565         { (eval echo "$as_me:8565: \"$cf_try\"") >&5
8566   (eval $cf_try) 2>&5
8567   ac_status=$?
8568   echo "$as_me:8568: \$? = $ac_status" >&5
8569   (exit $ac_status); }
8570         if test -f conftest.out ; then
8571                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8572                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8573                 rm -f conftest.out
8574         fi
8575
8576 else
8577   cat >conftest.$ac_ext <<_ACEOF
8578 #line 8578 "configure"
8579 #include "confdefs.h"
8580
8581 #include <${cf_cv_ncurses_header:-curses.h}>
8582 #include <stdio.h>
8583 int main()
8584 {
8585         FILE *fp = fopen("$cf_tempfile", "w");
8586 #ifdef NCURSES_VERSION
8587 # ifdef NCURSES_VERSION_PATCH
8588         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8589 # else
8590         fprintf(fp, "%s\n", NCURSES_VERSION);
8591 # endif
8592 #else
8593 # ifdef __NCURSES_H
8594         fprintf(fp, "old\n");
8595 # else
8596         make an error
8597 # endif
8598 #endif
8599         ${cf_cv_main_return:-return}(0);
8600 }
8601 _ACEOF
8602 rm -f conftest$ac_exeext
8603 if { (eval echo "$as_me:8603: \"$ac_link\"") >&5
8604   (eval $ac_link) 2>&5
8605   ac_status=$?
8606   echo "$as_me:8606: \$? = $ac_status" >&5
8607   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8608   { (eval echo "$as_me:8608: \"$ac_try\"") >&5
8609   (eval $ac_try) 2>&5
8610   ac_status=$?
8611   echo "$as_me:8611: \$? = $ac_status" >&5
8612   (exit $ac_status); }; }; then
8613
8614         cf_cv_ncurses_version=`cat $cf_tempfile`
8615 else
8616   echo "$as_me: program exited with status $ac_status" >&5
8617 echo "$as_me: failed program was:" >&5
8618 cat conftest.$ac_ext >&5
8619 fi
8620 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8621 fi
8622         rm -f $cf_tempfile
8623
8624 fi
8625 echo "$as_me:8625: result: $cf_cv_ncurses_version" >&5
8626 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8627 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
8628 #define NCURSES 1
8629 EOF
8630
8631 cf_nculib_root=ncursesw
8632         # This works, except for the special case where we find gpm, but
8633         # ncurses is in a nonstandard location via $LIBS, and we really want
8634         # to link gpm.
8635 cf_ncurses_LIBS=""
8636 cf_ncurses_SAVE="$LIBS"
8637 echo "$as_me:8637: checking for Gpm_Open in -lgpm" >&5
8638 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8639 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8640   echo $ECHO_N "(cached) $ECHO_C" >&6
8641 else
8642   ac_check_lib_save_LIBS=$LIBS
8643 LIBS="-lgpm  $LIBS"
8644 cat >conftest.$ac_ext <<_ACEOF
8645 #line 8645 "configure"
8646 #include "confdefs.h"
8647
8648 /* Override any gcc2 internal prototype to avoid an error.  */
8649 #ifdef __cplusplus
8650 extern "C"
8651 #endif
8652 /* We use char because int might match the return type of a gcc2
8653    builtin and then its argument prototype would still apply.  */
8654 char Gpm_Open ();
8655 int
8656 main ()
8657 {
8658 Gpm_Open ();
8659   ;
8660   return 0;
8661 }
8662 _ACEOF
8663 rm -f conftest.$ac_objext conftest$ac_exeext
8664 if { (eval echo "$as_me:8664: \"$ac_link\"") >&5
8665   (eval $ac_link) 2>&5
8666   ac_status=$?
8667   echo "$as_me:8667: \$? = $ac_status" >&5
8668   (exit $ac_status); } &&
8669          { ac_try='test -s conftest$ac_exeext'
8670   { (eval echo "$as_me:8670: \"$ac_try\"") >&5
8671   (eval $ac_try) 2>&5
8672   ac_status=$?
8673   echo "$as_me:8673: \$? = $ac_status" >&5
8674   (exit $ac_status); }; }; then
8675   ac_cv_lib_gpm_Gpm_Open=yes
8676 else
8677   echo "$as_me: failed program was:" >&5
8678 cat conftest.$ac_ext >&5
8679 ac_cv_lib_gpm_Gpm_Open=no
8680 fi
8681 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8682 LIBS=$ac_check_lib_save_LIBS
8683 fi
8684 echo "$as_me:8684: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8685 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8686 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8687   echo "$as_me:8687: checking for initscr in -lgpm" >&5
8688 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8689 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8690   echo $ECHO_N "(cached) $ECHO_C" >&6
8691 else
8692   ac_check_lib_save_LIBS=$LIBS
8693 LIBS="-lgpm  $LIBS"
8694 cat >conftest.$ac_ext <<_ACEOF
8695 #line 8695 "configure"
8696 #include "confdefs.h"
8697
8698 /* Override any gcc2 internal prototype to avoid an error.  */
8699 #ifdef __cplusplus
8700 extern "C"
8701 #endif
8702 /* We use char because int might match the return type of a gcc2
8703    builtin and then its argument prototype would still apply.  */
8704 char initscr ();
8705 int
8706 main ()
8707 {
8708 initscr ();
8709   ;
8710   return 0;
8711 }
8712 _ACEOF
8713 rm -f conftest.$ac_objext conftest$ac_exeext
8714 if { (eval echo "$as_me:8714: \"$ac_link\"") >&5
8715   (eval $ac_link) 2>&5
8716   ac_status=$?
8717   echo "$as_me:8717: \$? = $ac_status" >&5
8718   (exit $ac_status); } &&
8719          { ac_try='test -s conftest$ac_exeext'
8720   { (eval echo "$as_me:8720: \"$ac_try\"") >&5
8721   (eval $ac_try) 2>&5
8722   ac_status=$?
8723   echo "$as_me:8723: \$? = $ac_status" >&5
8724   (exit $ac_status); }; }; then
8725   ac_cv_lib_gpm_initscr=yes
8726 else
8727   echo "$as_me: failed program was:" >&5
8728 cat conftest.$ac_ext >&5
8729 ac_cv_lib_gpm_initscr=no
8730 fi
8731 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8732 LIBS=$ac_check_lib_save_LIBS
8733 fi
8734 echo "$as_me:8734: result: $ac_cv_lib_gpm_initscr" >&5
8735 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8736 if test $ac_cv_lib_gpm_initscr = yes; then
8737   LIBS="$cf_ncurses_SAVE"
8738 else
8739   cf_ncurses_LIBS="-lgpm"
8740 fi
8741
8742 fi
8743
8744 case $host_os in #(vi
8745 freebsd*)
8746         # This is only necessary if you are linking against an obsolete
8747         # version of ncurses (but it should do no harm, since it's static).
8748         if test "$cf_nculib_root" = ncurses ; then
8749                 echo "$as_me:8749: checking for tgoto in -lmytinfo" >&5
8750 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8751 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8752   echo $ECHO_N "(cached) $ECHO_C" >&6
8753 else
8754   ac_check_lib_save_LIBS=$LIBS
8755 LIBS="-lmytinfo  $LIBS"
8756 cat >conftest.$ac_ext <<_ACEOF
8757 #line 8757 "configure"
8758 #include "confdefs.h"
8759
8760 /* Override any gcc2 internal prototype to avoid an error.  */
8761 #ifdef __cplusplus
8762 extern "C"
8763 #endif
8764 /* We use char because int might match the return type of a gcc2
8765    builtin and then its argument prototype would still apply.  */
8766 char tgoto ();
8767 int
8768 main ()
8769 {
8770 tgoto ();
8771   ;
8772   return 0;
8773 }
8774 _ACEOF
8775 rm -f conftest.$ac_objext conftest$ac_exeext
8776 if { (eval echo "$as_me:8776: \"$ac_link\"") >&5
8777   (eval $ac_link) 2>&5
8778   ac_status=$?
8779   echo "$as_me:8779: \$? = $ac_status" >&5
8780   (exit $ac_status); } &&
8781          { ac_try='test -s conftest$ac_exeext'
8782   { (eval echo "$as_me:8782: \"$ac_try\"") >&5
8783   (eval $ac_try) 2>&5
8784   ac_status=$?
8785   echo "$as_me:8785: \$? = $ac_status" >&5
8786   (exit $ac_status); }; }; then
8787   ac_cv_lib_mytinfo_tgoto=yes
8788 else
8789   echo "$as_me: failed program was:" >&5
8790 cat conftest.$ac_ext >&5
8791 ac_cv_lib_mytinfo_tgoto=no
8792 fi
8793 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8794 LIBS=$ac_check_lib_save_LIBS
8795 fi
8796 echo "$as_me:8796: result: $ac_cv_lib_mytinfo_tgoto" >&5
8797 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8798 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8799   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8800 fi
8801
8802         fi
8803         ;;
8804 esac
8805
8806 LIBS="$cf_ncurses_LIBS $LIBS"
8807
8808 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8809 then
8810         LIBS="-l$cf_nculib_root $LIBS"
8811 else
8812
8813         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8814         cf_libdir=""
8815         echo "$as_me:8815: checking for initscr" >&5
8816 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8817 if test "${ac_cv_func_initscr+set}" = set; then
8818   echo $ECHO_N "(cached) $ECHO_C" >&6
8819 else
8820   cat >conftest.$ac_ext <<_ACEOF
8821 #line 8821 "configure"
8822 #include "confdefs.h"
8823 /* System header to define __stub macros and hopefully few prototypes,
8824     which can conflict with char initscr (); below.  */
8825 #include <assert.h>
8826 /* Override any gcc2 internal prototype to avoid an error.  */
8827 #ifdef __cplusplus
8828 extern "C"
8829 #endif
8830 /* We use char because int might match the return type of a gcc2
8831    builtin and then its argument prototype would still apply.  */
8832 char initscr ();
8833 char (*f) ();
8834
8835 int
8836 main ()
8837 {
8838 /* The GNU C library defines this for functions which it implements
8839     to always fail with ENOSYS.  Some functions are actually named
8840     something starting with __ and the normal name is an alias.  */
8841 #if defined (__stub_initscr) || defined (__stub___initscr)
8842 choke me
8843 #else
8844 f = initscr;
8845 #endif
8846
8847   ;
8848   return 0;
8849 }
8850 _ACEOF
8851 rm -f conftest.$ac_objext conftest$ac_exeext
8852 if { (eval echo "$as_me:8852: \"$ac_link\"") >&5
8853   (eval $ac_link) 2>&5
8854   ac_status=$?
8855   echo "$as_me:8855: \$? = $ac_status" >&5
8856   (exit $ac_status); } &&
8857          { ac_try='test -s conftest$ac_exeext'
8858   { (eval echo "$as_me:8858: \"$ac_try\"") >&5
8859   (eval $ac_try) 2>&5
8860   ac_status=$?
8861   echo "$as_me:8861: \$? = $ac_status" >&5
8862   (exit $ac_status); }; }; then
8863   ac_cv_func_initscr=yes
8864 else
8865   echo "$as_me: failed program was:" >&5
8866 cat conftest.$ac_ext >&5
8867 ac_cv_func_initscr=no
8868 fi
8869 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8870 fi
8871 echo "$as_me:8871: result: $ac_cv_func_initscr" >&5
8872 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8873 if test $ac_cv_func_initscr = yes; then
8874   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8875 else
8876
8877                 cf_save_LIBS="$LIBS"
8878                 echo "$as_me:8878: checking for initscr in -l$cf_nculib_root" >&5
8879 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8880                 LIBS="-l$cf_nculib_root $LIBS"
8881                 cat >conftest.$ac_ext <<_ACEOF
8882 #line 8882 "configure"
8883 #include "confdefs.h"
8884 #include <${cf_cv_ncurses_header:-curses.h}>
8885 int
8886 main ()
8887 {
8888 initscr()
8889   ;
8890   return 0;
8891 }
8892 _ACEOF
8893 rm -f conftest.$ac_objext conftest$ac_exeext
8894 if { (eval echo "$as_me:8894: \"$ac_link\"") >&5
8895   (eval $ac_link) 2>&5
8896   ac_status=$?
8897   echo "$as_me:8897: \$? = $ac_status" >&5
8898   (exit $ac_status); } &&
8899          { ac_try='test -s conftest$ac_exeext'
8900   { (eval echo "$as_me:8900: \"$ac_try\"") >&5
8901   (eval $ac_try) 2>&5
8902   ac_status=$?
8903   echo "$as_me:8903: \$? = $ac_status" >&5
8904   (exit $ac_status); }; }; then
8905   echo "$as_me:8905: result: yes" >&5
8906 echo "${ECHO_T}yes" >&6
8907                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8908
8909 else
8910   echo "$as_me: failed program was:" >&5
8911 cat conftest.$ac_ext >&5
8912 echo "$as_me:8912: result: no" >&5
8913 echo "${ECHO_T}no" >&6
8914
8915 cf_search=
8916 cf_library_path_list=""
8917 if test -n "${LDFLAGS}${LIBS}" ; then
8918         for cf_library_path in $LDFLAGS $LIBS
8919         do
8920                 case $cf_library_path in #(vi
8921                 -L*)
8922                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8923
8924 test "$cf_library_path" != "NONE" && \
8925 test -d "$cf_library_path" && \
8926  {
8927         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8928         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8929         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8930         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8931         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8932         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"
8933 }
8934
8935                         cf_library_path_list="$cf_library_path_list $cf_search"
8936                         ;;
8937                 esac
8938         done
8939 fi
8940
8941 cf_search=
8942
8943 test "/usr" != "$prefix" && \
8944 test -d "/usr" && \
8945 (test $prefix = NONE || test "/usr" != "$prefix") && {
8946         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
8947         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
8948         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
8949         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
8950         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
8951         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
8952 }
8953
8954 test "$prefix" != "NONE" && \
8955 test -d "$prefix" && \
8956  {
8957         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8958         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8959         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8960         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8961         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8962         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8963 }
8964
8965 test "/usr/local" != "$prefix" && \
8966 test -d "/usr/local" && \
8967 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8968         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
8969         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
8970         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
8971         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
8972         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
8973         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
8974 }
8975
8976 test "/opt" != "$prefix" && \
8977 test -d "/opt" && \
8978 (test $prefix = NONE || test "/opt" != "$prefix") && {
8979         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
8980         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
8981         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
8982         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
8983         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
8984         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
8985 }
8986
8987 test "$HOME" != "$prefix" && \
8988 test -d "$HOME" && \
8989 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8990         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
8991         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
8992         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
8993         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
8994         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
8995         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
8996 }
8997
8998 cf_search="$cf_library_path_list $cf_search"
8999
9000                         for cf_libdir in $cf_search
9001                         do
9002                                 echo "$as_me:9002: checking for -l$cf_nculib_root in $cf_libdir" >&5
9003 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9004                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9005                                 cat >conftest.$ac_ext <<_ACEOF
9006 #line 9006 "configure"
9007 #include "confdefs.h"
9008 #include <${cf_cv_ncurses_header:-curses.h}>
9009 int
9010 main ()
9011 {
9012 initscr()
9013   ;
9014   return 0;
9015 }
9016 _ACEOF
9017 rm -f conftest.$ac_objext conftest$ac_exeext
9018 if { (eval echo "$as_me:9018: \"$ac_link\"") >&5
9019   (eval $ac_link) 2>&5
9020   ac_status=$?
9021   echo "$as_me:9021: \$? = $ac_status" >&5
9022   (exit $ac_status); } &&
9023          { ac_try='test -s conftest$ac_exeext'
9024   { (eval echo "$as_me:9024: \"$ac_try\"") >&5
9025   (eval $ac_try) 2>&5
9026   ac_status=$?
9027   echo "$as_me:9027: \$? = $ac_status" >&5
9028   (exit $ac_status); }; }; then
9029   echo "$as_me:9029: result: yes" >&5
9030 echo "${ECHO_T}yes" >&6
9031                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9032                                          break
9033 else
9034   echo "$as_me: failed program was:" >&5
9035 cat conftest.$ac_ext >&5
9036 echo "$as_me:9036: result: no" >&5
9037 echo "${ECHO_T}no" >&6
9038                                          LIBS="$cf_save_LIBS"
9039 fi
9040 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9041                         done
9042
9043 fi
9044 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9045
9046 fi
9047
9048 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9049
9050 if test $cf_found_library = no ; then
9051         { { echo "$as_me:9051: error: Cannot link $cf_nculib_root library" >&5
9052 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9053    { (exit 1); exit 1; }; }
9054 fi
9055
9056 fi
9057
9058 if test -n "$cf_ncurses_LIBS" ; then
9059         echo "$as_me:9059: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9060 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9061         cf_ncurses_SAVE="$LIBS"
9062         for p in $cf_ncurses_LIBS ; do
9063                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9064                 if test "$q" != "$LIBS" ; then
9065                         LIBS="$q"
9066                 fi
9067         done
9068         cat >conftest.$ac_ext <<_ACEOF
9069 #line 9069 "configure"
9070 #include "confdefs.h"
9071 #include <${cf_cv_ncurses_header:-curses.h}>
9072 int
9073 main ()
9074 {
9075 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9076   ;
9077   return 0;
9078 }
9079 _ACEOF
9080 rm -f conftest.$ac_objext conftest$ac_exeext
9081 if { (eval echo "$as_me:9081: \"$ac_link\"") >&5
9082   (eval $ac_link) 2>&5
9083   ac_status=$?
9084   echo "$as_me:9084: \$? = $ac_status" >&5
9085   (exit $ac_status); } &&
9086          { ac_try='test -s conftest$ac_exeext'
9087   { (eval echo "$as_me:9087: \"$ac_try\"") >&5
9088   (eval $ac_try) 2>&5
9089   ac_status=$?
9090   echo "$as_me:9090: \$? = $ac_status" >&5
9091   (exit $ac_status); }; }; then
9092   echo "$as_me:9092: result: yes" >&5
9093 echo "${ECHO_T}yes" >&6
9094 else
9095   echo "$as_me: failed program was:" >&5
9096 cat conftest.$ac_ext >&5
9097 echo "$as_me:9097: result: no" >&5
9098 echo "${ECHO_T}no" >&6
9099                  LIBS="$cf_ncurses_SAVE"
9100 fi
9101 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9102 fi
9103
9104 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9105
9106 cat >>confdefs.h <<EOF
9107 #define $cf_nculib_ROOT 1
9108 EOF
9109
9110 fi
9111
9112         ;;
9113 pdcurses) #(vi
9114
9115 echo "$as_me:9115: checking if you want to use pkg-config" >&5
9116 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
9117
9118 # Check whether --with-pkg-config or --without-pkg-config was given.
9119 if test "${with_pkg_config+set}" = set; then
9120   withval="$with_pkg_config"
9121   cf_pkg_config=$withval
9122 else
9123   cf_pkg_config=yes
9124 fi;
9125 echo "$as_me:9125: result: $cf_pkg_config" >&5
9126 echo "${ECHO_T}$cf_pkg_config" >&6
9127
9128 case $cf_pkg_config in #(vi
9129 no) #(vi
9130         PKG_CONFIG=none
9131         ;;
9132 yes) #(vi
9133         # Extract the first word of "pkg-config", so it can be a program name with args.
9134 set dummy pkg-config; ac_word=$2
9135 echo "$as_me:9135: checking for $ac_word" >&5
9136 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9137 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
9138   echo $ECHO_N "(cached) $ECHO_C" >&6
9139 else
9140   case $PKG_CONFIG in
9141   [\\/]* | ?:[\\/]*)
9142   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
9143   ;;
9144   *)
9145   ac_save_IFS=$IFS; IFS=$ac_path_separator
9146 ac_dummy="$PATH"
9147 for ac_dir in $ac_dummy; do
9148   IFS=$ac_save_IFS
9149   test -z "$ac_dir" && ac_dir=.
9150   if $as_executable_p "$ac_dir/$ac_word"; then
9151    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
9152    echo "$as_me:9152: found $ac_dir/$ac_word" >&5
9153    break
9154 fi
9155 done
9156
9157   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="none"
9158   ;;
9159 esac
9160 fi
9161 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
9162
9163 if test -n "$PKG_CONFIG"; then
9164   echo "$as_me:9164: result: $PKG_CONFIG" >&5
9165 echo "${ECHO_T}$PKG_CONFIG" >&6
9166 else
9167   echo "$as_me:9167: result: no" >&5
9168 echo "${ECHO_T}no" >&6
9169 fi
9170
9171         ;;
9172 *)
9173         PKG_CONFIG=$withval
9174         ;;
9175 esac
9176
9177 test -z "$PKG_CONFIG" && PKG_CONFIG=none
9178 if test "$PKG_CONFIG" != none ; then
9179
9180 if test "x$prefix" != xNONE; then
9181   cf_path_syntax="$prefix"
9182 else
9183   cf_path_syntax="$ac_default_prefix"
9184 fi
9185
9186 case ".$PKG_CONFIG" in #(vi
9187 .\$\(*\)*|.\'*\'*) #(vi
9188   ;;
9189 ..|./*|.\\*) #(vi
9190   ;;
9191 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
9192   ;;
9193 .\${*prefix}*) #(vi
9194   eval PKG_CONFIG="$PKG_CONFIG"
9195   case ".$PKG_CONFIG" in #(vi
9196   .NONE/*)
9197     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
9198     ;;
9199   esac
9200   ;; #(vi
9201 .no|.NONE/*)
9202   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
9203   ;;
9204 *)
9205   { { echo "$as_me:9205: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
9206 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
9207    { (exit 1); exit 1; }; }
9208   ;;
9209 esac
9210
9211 fi
9212
9213 echo "$as_me:9213: checking for X" >&5
9214 echo $ECHO_N "checking for X... $ECHO_C" >&6
9215
9216 # Check whether --with-x or --without-x was given.
9217 if test "${with_x+set}" = set; then
9218   withval="$with_x"
9219
9220 fi;
9221 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9222 if test "x$with_x" = xno; then
9223   # The user explicitly disabled X.
9224   have_x=disabled
9225 else
9226   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9227     # Both variables are already set.
9228     have_x=yes
9229   else
9230     if test "${ac_cv_have_x+set}" = set; then
9231   echo $ECHO_N "(cached) $ECHO_C" >&6
9232 else
9233   # One or both of the vars are not set, and there is no cached value.
9234 ac_x_includes=no ac_x_libraries=no
9235 rm -fr conftest.dir
9236 if mkdir conftest.dir; then
9237   cd conftest.dir
9238   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9239   cat >Imakefile <<'EOF'
9240 acfindx:
9241         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9242 EOF
9243   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9244     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9245     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9246     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9247     for ac_extension in a so sl dylib dll; do
9248       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9249          test -f $ac_im_libdir/libX11.$ac_extension; then
9250         ac_im_usrlibdir=$ac_im_libdir; break
9251       fi
9252     done
9253     # Screen out bogus values from the imake configuration.  They are
9254     # bogus both because they are the default anyway, and because
9255     # using them would break gcc on systems where it needs fixed includes.
9256     case $ac_im_incroot in
9257         /usr/include) ;;
9258         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9259     esac
9260     case $ac_im_usrlibdir in
9261         /usr/lib | /lib) ;;
9262         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9263     esac
9264   fi
9265   cd ..
9266   rm -fr conftest.dir
9267 fi
9268
9269 # Standard set of common directories for X headers.
9270 # Check X11 before X11Rn because it is often a symlink to the current release.
9271 ac_x_header_dirs='
9272 /usr/X11/include
9273 /usr/X11R6/include
9274 /usr/X11R5/include
9275 /usr/X11R4/include
9276
9277 /usr/include/X11
9278 /usr/include/X11R6
9279 /usr/include/X11R5
9280 /usr/include/X11R4
9281
9282 /usr/local/X11/include
9283 /usr/local/X11R6/include
9284 /usr/local/X11R5/include
9285 /usr/local/X11R4/include
9286
9287 /usr/local/include/X11
9288 /usr/local/include/X11R6
9289 /usr/local/include/X11R5
9290 /usr/local/include/X11R4
9291
9292 /usr/X386/include
9293 /usr/x386/include
9294 /usr/XFree86/include/X11
9295
9296 /usr/include
9297 /usr/local/include
9298 /usr/unsupported/include
9299 /usr/athena/include
9300 /usr/local/x11r5/include
9301 /usr/lpp/Xamples/include
9302
9303 /usr/openwin/include
9304 /usr/openwin/share/include'
9305
9306 if test "$ac_x_includes" = no; then
9307   # Guess where to find include files, by looking for Intrinsic.h.
9308   # First, try using that file with no special directory specified.
9309   cat >conftest.$ac_ext <<_ACEOF
9310 #line 9310 "configure"
9311 #include "confdefs.h"
9312 #include <X11/Intrinsic.h>
9313 _ACEOF
9314 if { (eval echo "$as_me:9314: \"$ac_cpp conftest.$ac_ext\"") >&5
9315   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9316   ac_status=$?
9317   egrep -v '^ *\+' conftest.er1 >conftest.err
9318   rm -f conftest.er1
9319   cat conftest.err >&5
9320   echo "$as_me:9320: \$? = $ac_status" >&5
9321   (exit $ac_status); } >/dev/null; then
9322   if test -s conftest.err; then
9323     ac_cpp_err=$ac_c_preproc_warn_flag
9324   else
9325     ac_cpp_err=
9326   fi
9327 else
9328   ac_cpp_err=yes
9329 fi
9330 if test -z "$ac_cpp_err"; then
9331   # We can compile using X headers with no special include directory.
9332 ac_x_includes=
9333 else
9334   echo "$as_me: failed program was:" >&5
9335   cat conftest.$ac_ext >&5
9336   for ac_dir in $ac_x_header_dirs; do
9337   if test -r "$ac_dir/X11/Intrinsic.h"; then
9338     ac_x_includes=$ac_dir
9339     break
9340   fi
9341 done
9342 fi
9343 rm -f conftest.err conftest.$ac_ext
9344 fi # $ac_x_includes = no
9345
9346 if test "$ac_x_libraries" = no; then
9347   # Check for the libraries.
9348   # See if we find them without any special options.
9349   # Don't add to $LIBS permanently.
9350   ac_save_LIBS=$LIBS
9351   LIBS="-lXt $LIBS"
9352   cat >conftest.$ac_ext <<_ACEOF
9353 #line 9353 "configure"
9354 #include "confdefs.h"
9355 #include <X11/Intrinsic.h>
9356 int
9357 main ()
9358 {
9359 XtMalloc (0)
9360   ;
9361   return 0;
9362 }
9363 _ACEOF
9364 rm -f conftest.$ac_objext conftest$ac_exeext
9365 if { (eval echo "$as_me:9365: \"$ac_link\"") >&5
9366   (eval $ac_link) 2>&5
9367   ac_status=$?
9368   echo "$as_me:9368: \$? = $ac_status" >&5
9369   (exit $ac_status); } &&
9370          { ac_try='test -s conftest$ac_exeext'
9371   { (eval echo "$as_me:9371: \"$ac_try\"") >&5
9372   (eval $ac_try) 2>&5
9373   ac_status=$?
9374   echo "$as_me:9374: \$? = $ac_status" >&5
9375   (exit $ac_status); }; }; then
9376   LIBS=$ac_save_LIBS
9377 # We can link X programs with no special library path.
9378 ac_x_libraries=
9379 else
9380   echo "$as_me: failed program was:" >&5
9381 cat conftest.$ac_ext >&5
9382 LIBS=$ac_save_LIBS
9383 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9384 do
9385   # Don't even attempt the hair of trying to link an X program!
9386   for ac_extension in a so sl dylib dll; do
9387     if test -r $ac_dir/libXt.$ac_extension; then
9388       ac_x_libraries=$ac_dir
9389       break 2
9390     fi
9391   done
9392 done
9393 fi
9394 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9395 fi # $ac_x_libraries = no
9396
9397 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9398   # Didn't find X anywhere.  Cache the known absence of X.
9399   ac_cv_have_x="have_x=no"
9400 else
9401   # Record where we found X for the cache.
9402   ac_cv_have_x="have_x=yes \
9403                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9404 fi
9405 fi
9406
9407   fi
9408   eval "$ac_cv_have_x"
9409 fi # $with_x != no
9410
9411 if test "$have_x" != yes; then
9412   echo "$as_me:9412: result: $have_x" >&5
9413 echo "${ECHO_T}$have_x" >&6
9414   no_x=yes
9415 else
9416   # If each of the values was on the command line, it overrides each guess.
9417   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9418   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9419   # Update the cache value to reflect the command line values.
9420   ac_cv_have_x="have_x=yes \
9421                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9422   echo "$as_me:9422: result: libraries $x_libraries, headers $x_includes" >&5
9423 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9424 fi
9425
9426 if test "$no_x" = yes; then
9427   # Not all programs may use this symbol, but it does not hurt to define it.
9428
9429 cat >>confdefs.h <<\EOF
9430 #define X_DISPLAY_MISSING 1
9431 EOF
9432
9433   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9434 else
9435   if test -n "$x_includes"; then
9436     X_CFLAGS="$X_CFLAGS -I$x_includes"
9437   fi
9438
9439   # It would also be nice to do this for all -L options, not just this one.
9440   if test -n "$x_libraries"; then
9441     X_LIBS="$X_LIBS -L$x_libraries"
9442     # For Solaris; some versions of Sun CC require a space after -R and
9443     # others require no space.  Words are not sufficient . . . .
9444     case `(uname -sr) 2>/dev/null` in
9445     "SunOS 5"*)
9446       echo "$as_me:9446: checking whether -R must be followed by a space" >&5
9447 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9448       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9449       cat >conftest.$ac_ext <<_ACEOF
9450 #line 9450 "configure"
9451 #include "confdefs.h"
9452
9453 int
9454 main ()
9455 {
9456
9457   ;
9458   return 0;
9459 }
9460 _ACEOF
9461 rm -f conftest.$ac_objext conftest$ac_exeext
9462 if { (eval echo "$as_me:9462: \"$ac_link\"") >&5
9463   (eval $ac_link) 2>&5
9464   ac_status=$?
9465   echo "$as_me:9465: \$? = $ac_status" >&5
9466   (exit $ac_status); } &&
9467          { ac_try='test -s conftest$ac_exeext'
9468   { (eval echo "$as_me:9468: \"$ac_try\"") >&5
9469   (eval $ac_try) 2>&5
9470   ac_status=$?
9471   echo "$as_me:9471: \$? = $ac_status" >&5
9472   (exit $ac_status); }; }; then
9473   ac_R_nospace=yes
9474 else
9475   echo "$as_me: failed program was:" >&5
9476 cat conftest.$ac_ext >&5
9477 ac_R_nospace=no
9478 fi
9479 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9480       if test $ac_R_nospace = yes; then
9481         echo "$as_me:9481: result: no" >&5
9482 echo "${ECHO_T}no" >&6
9483         X_LIBS="$X_LIBS -R$x_libraries"
9484       else
9485         LIBS="$ac_xsave_LIBS -R $x_libraries"
9486         cat >conftest.$ac_ext <<_ACEOF
9487 #line 9487 "configure"
9488 #include "confdefs.h"
9489
9490 int
9491 main ()
9492 {
9493
9494   ;
9495   return 0;
9496 }
9497 _ACEOF
9498 rm -f conftest.$ac_objext conftest$ac_exeext
9499 if { (eval echo "$as_me:9499: \"$ac_link\"") >&5
9500   (eval $ac_link) 2>&5
9501   ac_status=$?
9502   echo "$as_me:9502: \$? = $ac_status" >&5
9503   (exit $ac_status); } &&
9504          { ac_try='test -s conftest$ac_exeext'
9505   { (eval echo "$as_me:9505: \"$ac_try\"") >&5
9506   (eval $ac_try) 2>&5
9507   ac_status=$?
9508   echo "$as_me:9508: \$? = $ac_status" >&5
9509   (exit $ac_status); }; }; then
9510   ac_R_space=yes
9511 else
9512   echo "$as_me: failed program was:" >&5
9513 cat conftest.$ac_ext >&5
9514 ac_R_space=no
9515 fi
9516 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9517         if test $ac_R_space = yes; then
9518           echo "$as_me:9518: result: yes" >&5
9519 echo "${ECHO_T}yes" >&6
9520           X_LIBS="$X_LIBS -R $x_libraries"
9521         else
9522           echo "$as_me:9522: result: neither works" >&5
9523 echo "${ECHO_T}neither works" >&6
9524         fi
9525       fi
9526       LIBS=$ac_xsave_LIBS
9527     esac
9528   fi
9529
9530   # Check for system-dependent libraries X programs must link with.
9531   # Do this before checking for the system-independent R6 libraries
9532   # (-lICE), since we may need -lsocket or whatever for X linking.
9533
9534   if test "$ISC" = yes; then
9535     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9536   else
9537     # Martyn Johnson says this is needed for Ultrix, if the X
9538     # libraries were built with DECnet support.  And Karl Berry says
9539     # the Alpha needs dnet_stub (dnet does not exist).
9540     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9541     cat >conftest.$ac_ext <<_ACEOF
9542 #line 9542 "configure"
9543 #include "confdefs.h"
9544
9545 /* Override any gcc2 internal prototype to avoid an error.  */
9546 #ifdef __cplusplus
9547 extern "C"
9548 #endif
9549 /* We use char because int might match the return type of a gcc2
9550    builtin and then its argument prototype would still apply.  */
9551 char XOpenDisplay ();
9552 int
9553 main ()
9554 {
9555 XOpenDisplay ();
9556   ;
9557   return 0;
9558 }
9559 _ACEOF
9560 rm -f conftest.$ac_objext conftest$ac_exeext
9561 if { (eval echo "$as_me:9561: \"$ac_link\"") >&5
9562   (eval $ac_link) 2>&5
9563   ac_status=$?
9564   echo "$as_me:9564: \$? = $ac_status" >&5
9565   (exit $ac_status); } &&
9566          { ac_try='test -s conftest$ac_exeext'
9567   { (eval echo "$as_me:9567: \"$ac_try\"") >&5
9568   (eval $ac_try) 2>&5
9569   ac_status=$?
9570   echo "$as_me:9570: \$? = $ac_status" >&5
9571   (exit $ac_status); }; }; then
9572   :
9573 else
9574   echo "$as_me: failed program was:" >&5
9575 cat conftest.$ac_ext >&5
9576 echo "$as_me:9576: checking for dnet_ntoa in -ldnet" >&5
9577 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9578 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9579   echo $ECHO_N "(cached) $ECHO_C" >&6
9580 else
9581   ac_check_lib_save_LIBS=$LIBS
9582 LIBS="-ldnet  $LIBS"
9583 cat >conftest.$ac_ext <<_ACEOF
9584 #line 9584 "configure"
9585 #include "confdefs.h"
9586
9587 /* Override any gcc2 internal prototype to avoid an error.  */
9588 #ifdef __cplusplus
9589 extern "C"
9590 #endif
9591 /* We use char because int might match the return type of a gcc2
9592    builtin and then its argument prototype would still apply.  */
9593 char dnet_ntoa ();
9594 int
9595 main ()
9596 {
9597 dnet_ntoa ();
9598   ;
9599   return 0;
9600 }
9601 _ACEOF
9602 rm -f conftest.$ac_objext conftest$ac_exeext
9603 if { (eval echo "$as_me:9603: \"$ac_link\"") >&5
9604   (eval $ac_link) 2>&5
9605   ac_status=$?
9606   echo "$as_me:9606: \$? = $ac_status" >&5
9607   (exit $ac_status); } &&
9608          { ac_try='test -s conftest$ac_exeext'
9609   { (eval echo "$as_me:9609: \"$ac_try\"") >&5
9610   (eval $ac_try) 2>&5
9611   ac_status=$?
9612   echo "$as_me:9612: \$? = $ac_status" >&5
9613   (exit $ac_status); }; }; then
9614   ac_cv_lib_dnet_dnet_ntoa=yes
9615 else
9616   echo "$as_me: failed program was:" >&5
9617 cat conftest.$ac_ext >&5
9618 ac_cv_lib_dnet_dnet_ntoa=no
9619 fi
9620 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9621 LIBS=$ac_check_lib_save_LIBS
9622 fi
9623 echo "$as_me:9623: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9624 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9625 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9626   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9627 fi
9628
9629     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9630       echo "$as_me:9630: checking for dnet_ntoa in -ldnet_stub" >&5
9631 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9632 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9633   echo $ECHO_N "(cached) $ECHO_C" >&6
9634 else
9635   ac_check_lib_save_LIBS=$LIBS
9636 LIBS="-ldnet_stub  $LIBS"
9637 cat >conftest.$ac_ext <<_ACEOF
9638 #line 9638 "configure"
9639 #include "confdefs.h"
9640
9641 /* Override any gcc2 internal prototype to avoid an error.  */
9642 #ifdef __cplusplus
9643 extern "C"
9644 #endif
9645 /* We use char because int might match the return type of a gcc2
9646    builtin and then its argument prototype would still apply.  */
9647 char dnet_ntoa ();
9648 int
9649 main ()
9650 {
9651 dnet_ntoa ();
9652   ;
9653   return 0;
9654 }
9655 _ACEOF
9656 rm -f conftest.$ac_objext conftest$ac_exeext
9657 if { (eval echo "$as_me:9657: \"$ac_link\"") >&5
9658   (eval $ac_link) 2>&5
9659   ac_status=$?
9660   echo "$as_me:9660: \$? = $ac_status" >&5
9661   (exit $ac_status); } &&
9662          { ac_try='test -s conftest$ac_exeext'
9663   { (eval echo "$as_me:9663: \"$ac_try\"") >&5
9664   (eval $ac_try) 2>&5
9665   ac_status=$?
9666   echo "$as_me:9666: \$? = $ac_status" >&5
9667   (exit $ac_status); }; }; then
9668   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9669 else
9670   echo "$as_me: failed program was:" >&5
9671 cat conftest.$ac_ext >&5
9672 ac_cv_lib_dnet_stub_dnet_ntoa=no
9673 fi
9674 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9675 LIBS=$ac_check_lib_save_LIBS
9676 fi
9677 echo "$as_me:9677: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9678 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9679 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9680   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9681 fi
9682
9683     fi
9684 fi
9685 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9686     LIBS="$ac_xsave_LIBS"
9687
9688     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9689     # to get the SysV transport functions.
9690     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9691     # needs -lnsl.
9692     # The nsl library prevents programs from opening the X display
9693     # on Irix 5.2, according to T.E. Dickey.
9694     # The functions gethostbyname, getservbyname, and inet_addr are
9695     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9696     echo "$as_me:9696: checking for gethostbyname" >&5
9697 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9698 if test "${ac_cv_func_gethostbyname+set}" = set; then
9699   echo $ECHO_N "(cached) $ECHO_C" >&6
9700 else
9701   cat >conftest.$ac_ext <<_ACEOF
9702 #line 9702 "configure"
9703 #include "confdefs.h"
9704 /* System header to define __stub macros and hopefully few prototypes,
9705     which can conflict with char gethostbyname (); below.  */
9706 #include <assert.h>
9707 /* Override any gcc2 internal prototype to avoid an error.  */
9708 #ifdef __cplusplus
9709 extern "C"
9710 #endif
9711 /* We use char because int might match the return type of a gcc2
9712    builtin and then its argument prototype would still apply.  */
9713 char gethostbyname ();
9714 char (*f) ();
9715
9716 int
9717 main ()
9718 {
9719 /* The GNU C library defines this for functions which it implements
9720     to always fail with ENOSYS.  Some functions are actually named
9721     something starting with __ and the normal name is an alias.  */
9722 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9723 choke me
9724 #else
9725 f = gethostbyname;
9726 #endif
9727
9728   ;
9729   return 0;
9730 }
9731 _ACEOF
9732 rm -f conftest.$ac_objext conftest$ac_exeext
9733 if { (eval echo "$as_me:9733: \"$ac_link\"") >&5
9734   (eval $ac_link) 2>&5
9735   ac_status=$?
9736   echo "$as_me:9736: \$? = $ac_status" >&5
9737   (exit $ac_status); } &&
9738          { ac_try='test -s conftest$ac_exeext'
9739   { (eval echo "$as_me:9739: \"$ac_try\"") >&5
9740   (eval $ac_try) 2>&5
9741   ac_status=$?
9742   echo "$as_me:9742: \$? = $ac_status" >&5
9743   (exit $ac_status); }; }; then
9744   ac_cv_func_gethostbyname=yes
9745 else
9746   echo "$as_me: failed program was:" >&5
9747 cat conftest.$ac_ext >&5
9748 ac_cv_func_gethostbyname=no
9749 fi
9750 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9751 fi
9752 echo "$as_me:9752: result: $ac_cv_func_gethostbyname" >&5
9753 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9754
9755     if test $ac_cv_func_gethostbyname = no; then
9756       echo "$as_me:9756: checking for gethostbyname in -lnsl" >&5
9757 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9758 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9759   echo $ECHO_N "(cached) $ECHO_C" >&6
9760 else
9761   ac_check_lib_save_LIBS=$LIBS
9762 LIBS="-lnsl  $LIBS"
9763 cat >conftest.$ac_ext <<_ACEOF
9764 #line 9764 "configure"
9765 #include "confdefs.h"
9766
9767 /* Override any gcc2 internal prototype to avoid an error.  */
9768 #ifdef __cplusplus
9769 extern "C"
9770 #endif
9771 /* We use char because int might match the return type of a gcc2
9772    builtin and then its argument prototype would still apply.  */
9773 char gethostbyname ();
9774 int
9775 main ()
9776 {
9777 gethostbyname ();
9778   ;
9779   return 0;
9780 }
9781 _ACEOF
9782 rm -f conftest.$ac_objext conftest$ac_exeext
9783 if { (eval echo "$as_me:9783: \"$ac_link\"") >&5
9784   (eval $ac_link) 2>&5
9785   ac_status=$?
9786   echo "$as_me:9786: \$? = $ac_status" >&5
9787   (exit $ac_status); } &&
9788          { ac_try='test -s conftest$ac_exeext'
9789   { (eval echo "$as_me:9789: \"$ac_try\"") >&5
9790   (eval $ac_try) 2>&5
9791   ac_status=$?
9792   echo "$as_me:9792: \$? = $ac_status" >&5
9793   (exit $ac_status); }; }; then
9794   ac_cv_lib_nsl_gethostbyname=yes
9795 else
9796   echo "$as_me: failed program was:" >&5
9797 cat conftest.$ac_ext >&5
9798 ac_cv_lib_nsl_gethostbyname=no
9799 fi
9800 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9801 LIBS=$ac_check_lib_save_LIBS
9802 fi
9803 echo "$as_me:9803: result: $ac_cv_lib_nsl_gethostbyname" >&5
9804 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9805 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9806   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9807 fi
9808
9809       if test $ac_cv_lib_nsl_gethostbyname = no; then
9810         echo "$as_me:9810: checking for gethostbyname in -lbsd" >&5
9811 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9812 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9813   echo $ECHO_N "(cached) $ECHO_C" >&6
9814 else
9815   ac_check_lib_save_LIBS=$LIBS
9816 LIBS="-lbsd  $LIBS"
9817 cat >conftest.$ac_ext <<_ACEOF
9818 #line 9818 "configure"
9819 #include "confdefs.h"
9820
9821 /* Override any gcc2 internal prototype to avoid an error.  */
9822 #ifdef __cplusplus
9823 extern "C"
9824 #endif
9825 /* We use char because int might match the return type of a gcc2
9826    builtin and then its argument prototype would still apply.  */
9827 char gethostbyname ();
9828 int
9829 main ()
9830 {
9831 gethostbyname ();
9832   ;
9833   return 0;
9834 }
9835 _ACEOF
9836 rm -f conftest.$ac_objext conftest$ac_exeext
9837 if { (eval echo "$as_me:9837: \"$ac_link\"") >&5
9838   (eval $ac_link) 2>&5
9839   ac_status=$?
9840   echo "$as_me:9840: \$? = $ac_status" >&5
9841   (exit $ac_status); } &&
9842          { ac_try='test -s conftest$ac_exeext'
9843   { (eval echo "$as_me:9843: \"$ac_try\"") >&5
9844   (eval $ac_try) 2>&5
9845   ac_status=$?
9846   echo "$as_me:9846: \$? = $ac_status" >&5
9847   (exit $ac_status); }; }; then
9848   ac_cv_lib_bsd_gethostbyname=yes
9849 else
9850   echo "$as_me: failed program was:" >&5
9851 cat conftest.$ac_ext >&5
9852 ac_cv_lib_bsd_gethostbyname=no
9853 fi
9854 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9855 LIBS=$ac_check_lib_save_LIBS
9856 fi
9857 echo "$as_me:9857: result: $ac_cv_lib_bsd_gethostbyname" >&5
9858 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
9859 if test $ac_cv_lib_bsd_gethostbyname = yes; then
9860   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
9861 fi
9862
9863       fi
9864     fi
9865
9866     # lieder@skyler.mavd.honeywell.com says without -lsocket,
9867     # socket/setsockopt and other routines are undefined under SCO ODT
9868     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
9869     # on later versions), says Simon Leinen: it contains gethostby*
9870     # variants that don't use the nameserver (or something).  -lsocket
9871     # must be given before -lnsl if both are needed.  We assume that
9872     # if connect needs -lnsl, so does gethostbyname.
9873     echo "$as_me:9873: checking for connect" >&5
9874 echo $ECHO_N "checking for connect... $ECHO_C" >&6
9875 if test "${ac_cv_func_connect+set}" = set; then
9876   echo $ECHO_N "(cached) $ECHO_C" >&6
9877 else
9878   cat >conftest.$ac_ext <<_ACEOF
9879 #line 9879 "configure"
9880 #include "confdefs.h"
9881 /* System header to define __stub macros and hopefully few prototypes,
9882     which can conflict with char connect (); below.  */
9883 #include <assert.h>
9884 /* Override any gcc2 internal prototype to avoid an error.  */
9885 #ifdef __cplusplus
9886 extern "C"
9887 #endif
9888 /* We use char because int might match the return type of a gcc2
9889    builtin and then its argument prototype would still apply.  */
9890 char connect ();
9891 char (*f) ();
9892
9893 int
9894 main ()
9895 {
9896 /* The GNU C library defines this for functions which it implements
9897     to always fail with ENOSYS.  Some functions are actually named
9898     something starting with __ and the normal name is an alias.  */
9899 #if defined (__stub_connect) || defined (__stub___connect)
9900 choke me
9901 #else
9902 f = connect;
9903 #endif
9904
9905   ;
9906   return 0;
9907 }
9908 _ACEOF
9909 rm -f conftest.$ac_objext conftest$ac_exeext
9910 if { (eval echo "$as_me:9910: \"$ac_link\"") >&5
9911   (eval $ac_link) 2>&5
9912   ac_status=$?
9913   echo "$as_me:9913: \$? = $ac_status" >&5
9914   (exit $ac_status); } &&
9915          { ac_try='test -s conftest$ac_exeext'
9916   { (eval echo "$as_me:9916: \"$ac_try\"") >&5
9917   (eval $ac_try) 2>&5
9918   ac_status=$?
9919   echo "$as_me:9919: \$? = $ac_status" >&5
9920   (exit $ac_status); }; }; then
9921   ac_cv_func_connect=yes
9922 else
9923   echo "$as_me: failed program was:" >&5
9924 cat conftest.$ac_ext >&5
9925 ac_cv_func_connect=no
9926 fi
9927 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9928 fi
9929 echo "$as_me:9929: result: $ac_cv_func_connect" >&5
9930 echo "${ECHO_T}$ac_cv_func_connect" >&6
9931
9932     if test $ac_cv_func_connect = no; then
9933       echo "$as_me:9933: checking for connect in -lsocket" >&5
9934 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
9935 if test "${ac_cv_lib_socket_connect+set}" = set; then
9936   echo $ECHO_N "(cached) $ECHO_C" >&6
9937 else
9938   ac_check_lib_save_LIBS=$LIBS
9939 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
9940 cat >conftest.$ac_ext <<_ACEOF
9941 #line 9941 "configure"
9942 #include "confdefs.h"
9943
9944 /* Override any gcc2 internal prototype to avoid an error.  */
9945 #ifdef __cplusplus
9946 extern "C"
9947 #endif
9948 /* We use char because int might match the return type of a gcc2
9949    builtin and then its argument prototype would still apply.  */
9950 char connect ();
9951 int
9952 main ()
9953 {
9954 connect ();
9955   ;
9956   return 0;
9957 }
9958 _ACEOF
9959 rm -f conftest.$ac_objext conftest$ac_exeext
9960 if { (eval echo "$as_me:9960: \"$ac_link\"") >&5
9961   (eval $ac_link) 2>&5
9962   ac_status=$?
9963   echo "$as_me:9963: \$? = $ac_status" >&5
9964   (exit $ac_status); } &&
9965          { ac_try='test -s conftest$ac_exeext'
9966   { (eval echo "$as_me:9966: \"$ac_try\"") >&5
9967   (eval $ac_try) 2>&5
9968   ac_status=$?
9969   echo "$as_me:9969: \$? = $ac_status" >&5
9970   (exit $ac_status); }; }; then
9971   ac_cv_lib_socket_connect=yes
9972 else
9973   echo "$as_me: failed program was:" >&5
9974 cat conftest.$ac_ext >&5
9975 ac_cv_lib_socket_connect=no
9976 fi
9977 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9978 LIBS=$ac_check_lib_save_LIBS
9979 fi
9980 echo "$as_me:9980: result: $ac_cv_lib_socket_connect" >&5
9981 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
9982 if test $ac_cv_lib_socket_connect = yes; then
9983   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
9984 fi
9985
9986     fi
9987
9988     # Guillermo Gomez says -lposix is necessary on A/UX.
9989     echo "$as_me:9989: checking for remove" >&5
9990 echo $ECHO_N "checking for remove... $ECHO_C" >&6
9991 if test "${ac_cv_func_remove+set}" = set; then
9992   echo $ECHO_N "(cached) $ECHO_C" >&6
9993 else
9994   cat >conftest.$ac_ext <<_ACEOF
9995 #line 9995 "configure"
9996 #include "confdefs.h"
9997 /* System header to define __stub macros and hopefully few prototypes,
9998     which can conflict with char remove (); below.  */
9999 #include <assert.h>
10000 /* Override any gcc2 internal prototype to avoid an error.  */
10001 #ifdef __cplusplus
10002 extern "C"
10003 #endif
10004 /* We use char because int might match the return type of a gcc2
10005    builtin and then its argument prototype would still apply.  */
10006 char remove ();
10007 char (*f) ();
10008
10009 int
10010 main ()
10011 {
10012 /* The GNU C library defines this for functions which it implements
10013     to always fail with ENOSYS.  Some functions are actually named
10014     something starting with __ and the normal name is an alias.  */
10015 #if defined (__stub_remove) || defined (__stub___remove)
10016 choke me
10017 #else
10018 f = remove;
10019 #endif
10020
10021   ;
10022   return 0;
10023 }
10024 _ACEOF
10025 rm -f conftest.$ac_objext conftest$ac_exeext
10026 if { (eval echo "$as_me:10026: \"$ac_link\"") >&5
10027   (eval $ac_link) 2>&5
10028   ac_status=$?
10029   echo "$as_me:10029: \$? = $ac_status" >&5
10030   (exit $ac_status); } &&
10031          { ac_try='test -s conftest$ac_exeext'
10032   { (eval echo "$as_me:10032: \"$ac_try\"") >&5
10033   (eval $ac_try) 2>&5
10034   ac_status=$?
10035   echo "$as_me:10035: \$? = $ac_status" >&5
10036   (exit $ac_status); }; }; then
10037   ac_cv_func_remove=yes
10038 else
10039   echo "$as_me: failed program was:" >&5
10040 cat conftest.$ac_ext >&5
10041 ac_cv_func_remove=no
10042 fi
10043 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10044 fi
10045 echo "$as_me:10045: result: $ac_cv_func_remove" >&5
10046 echo "${ECHO_T}$ac_cv_func_remove" >&6
10047
10048     if test $ac_cv_func_remove = no; then
10049       echo "$as_me:10049: checking for remove in -lposix" >&5
10050 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10051 if test "${ac_cv_lib_posix_remove+set}" = set; then
10052   echo $ECHO_N "(cached) $ECHO_C" >&6
10053 else
10054   ac_check_lib_save_LIBS=$LIBS
10055 LIBS="-lposix  $LIBS"
10056 cat >conftest.$ac_ext <<_ACEOF
10057 #line 10057 "configure"
10058 #include "confdefs.h"
10059
10060 /* Override any gcc2 internal prototype to avoid an error.  */
10061 #ifdef __cplusplus
10062 extern "C"
10063 #endif
10064 /* We use char because int might match the return type of a gcc2
10065    builtin and then its argument prototype would still apply.  */
10066 char remove ();
10067 int
10068 main ()
10069 {
10070 remove ();
10071   ;
10072   return 0;
10073 }
10074 _ACEOF
10075 rm -f conftest.$ac_objext conftest$ac_exeext
10076 if { (eval echo "$as_me:10076: \"$ac_link\"") >&5
10077   (eval $ac_link) 2>&5
10078   ac_status=$?
10079   echo "$as_me:10079: \$? = $ac_status" >&5
10080   (exit $ac_status); } &&
10081          { ac_try='test -s conftest$ac_exeext'
10082   { (eval echo "$as_me:10082: \"$ac_try\"") >&5
10083   (eval $ac_try) 2>&5
10084   ac_status=$?
10085   echo "$as_me:10085: \$? = $ac_status" >&5
10086   (exit $ac_status); }; }; then
10087   ac_cv_lib_posix_remove=yes
10088 else
10089   echo "$as_me: failed program was:" >&5
10090 cat conftest.$ac_ext >&5
10091 ac_cv_lib_posix_remove=no
10092 fi
10093 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10094 LIBS=$ac_check_lib_save_LIBS
10095 fi
10096 echo "$as_me:10096: result: $ac_cv_lib_posix_remove" >&5
10097 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10098 if test $ac_cv_lib_posix_remove = yes; then
10099   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10100 fi
10101
10102     fi
10103
10104     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10105     echo "$as_me:10105: checking for shmat" >&5
10106 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10107 if test "${ac_cv_func_shmat+set}" = set; then
10108   echo $ECHO_N "(cached) $ECHO_C" >&6
10109 else
10110   cat >conftest.$ac_ext <<_ACEOF
10111 #line 10111 "configure"
10112 #include "confdefs.h"
10113 /* System header to define __stub macros and hopefully few prototypes,
10114     which can conflict with char shmat (); below.  */
10115 #include <assert.h>
10116 /* Override any gcc2 internal prototype to avoid an error.  */
10117 #ifdef __cplusplus
10118 extern "C"
10119 #endif
10120 /* We use char because int might match the return type of a gcc2
10121    builtin and then its argument prototype would still apply.  */
10122 char shmat ();
10123 char (*f) ();
10124
10125 int
10126 main ()
10127 {
10128 /* The GNU C library defines this for functions which it implements
10129     to always fail with ENOSYS.  Some functions are actually named
10130     something starting with __ and the normal name is an alias.  */
10131 #if defined (__stub_shmat) || defined (__stub___shmat)
10132 choke me
10133 #else
10134 f = shmat;
10135 #endif
10136
10137   ;
10138   return 0;
10139 }
10140 _ACEOF
10141 rm -f conftest.$ac_objext conftest$ac_exeext
10142 if { (eval echo "$as_me:10142: \"$ac_link\"") >&5
10143   (eval $ac_link) 2>&5
10144   ac_status=$?
10145   echo "$as_me:10145: \$? = $ac_status" >&5
10146   (exit $ac_status); } &&
10147          { ac_try='test -s conftest$ac_exeext'
10148   { (eval echo "$as_me:10148: \"$ac_try\"") >&5
10149   (eval $ac_try) 2>&5
10150   ac_status=$?
10151   echo "$as_me:10151: \$? = $ac_status" >&5
10152   (exit $ac_status); }; }; then
10153   ac_cv_func_shmat=yes
10154 else
10155   echo "$as_me: failed program was:" >&5
10156 cat conftest.$ac_ext >&5
10157 ac_cv_func_shmat=no
10158 fi
10159 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10160 fi
10161 echo "$as_me:10161: result: $ac_cv_func_shmat" >&5
10162 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10163
10164     if test $ac_cv_func_shmat = no; then
10165       echo "$as_me:10165: checking for shmat in -lipc" >&5
10166 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10167 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10168   echo $ECHO_N "(cached) $ECHO_C" >&6
10169 else
10170   ac_check_lib_save_LIBS=$LIBS
10171 LIBS="-lipc  $LIBS"
10172 cat >conftest.$ac_ext <<_ACEOF
10173 #line 10173 "configure"
10174 #include "confdefs.h"
10175
10176 /* Override any gcc2 internal prototype to avoid an error.  */
10177 #ifdef __cplusplus
10178 extern "C"
10179 #endif
10180 /* We use char because int might match the return type of a gcc2
10181    builtin and then its argument prototype would still apply.  */
10182 char shmat ();
10183 int
10184 main ()
10185 {
10186 shmat ();
10187   ;
10188   return 0;
10189 }
10190 _ACEOF
10191 rm -f conftest.$ac_objext conftest$ac_exeext
10192 if { (eval echo "$as_me:10192: \"$ac_link\"") >&5
10193   (eval $ac_link) 2>&5
10194   ac_status=$?
10195   echo "$as_me:10195: \$? = $ac_status" >&5
10196   (exit $ac_status); } &&
10197          { ac_try='test -s conftest$ac_exeext'
10198   { (eval echo "$as_me:10198: \"$ac_try\"") >&5
10199   (eval $ac_try) 2>&5
10200   ac_status=$?
10201   echo "$as_me:10201: \$? = $ac_status" >&5
10202   (exit $ac_status); }; }; then
10203   ac_cv_lib_ipc_shmat=yes
10204 else
10205   echo "$as_me: failed program was:" >&5
10206 cat conftest.$ac_ext >&5
10207 ac_cv_lib_ipc_shmat=no
10208 fi
10209 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10210 LIBS=$ac_check_lib_save_LIBS
10211 fi
10212 echo "$as_me:10212: result: $ac_cv_lib_ipc_shmat" >&5
10213 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10214 if test $ac_cv_lib_ipc_shmat = yes; then
10215   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10216 fi
10217
10218     fi
10219   fi
10220
10221   # Check for libraries that X11R6 Xt/Xaw programs need.
10222   ac_save_LDFLAGS=$LDFLAGS
10223   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10224   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10225   # check for ICE first), but we must link in the order -lSM -lICE or
10226   # we get undefined symbols.  So assume we have SM if we have ICE.
10227   # These have to be linked with before -lX11, unlike the other
10228   # libraries we check for below, so use a different variable.
10229   # John Interrante, Karl Berry
10230   echo "$as_me:10230: checking for IceConnectionNumber in -lICE" >&5
10231 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10232 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10233   echo $ECHO_N "(cached) $ECHO_C" >&6
10234 else
10235   ac_check_lib_save_LIBS=$LIBS
10236 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10237 cat >conftest.$ac_ext <<_ACEOF
10238 #line 10238 "configure"
10239 #include "confdefs.h"
10240
10241 /* Override any gcc2 internal prototype to avoid an error.  */
10242 #ifdef __cplusplus
10243 extern "C"
10244 #endif
10245 /* We use char because int might match the return type of a gcc2
10246    builtin and then its argument prototype would still apply.  */
10247 char IceConnectionNumber ();
10248 int
10249 main ()
10250 {
10251 IceConnectionNumber ();
10252   ;
10253   return 0;
10254 }
10255 _ACEOF
10256 rm -f conftest.$ac_objext conftest$ac_exeext
10257 if { (eval echo "$as_me:10257: \"$ac_link\"") >&5
10258   (eval $ac_link) 2>&5
10259   ac_status=$?
10260   echo "$as_me:10260: \$? = $ac_status" >&5
10261   (exit $ac_status); } &&
10262          { ac_try='test -s conftest$ac_exeext'
10263   { (eval echo "$as_me:10263: \"$ac_try\"") >&5
10264   (eval $ac_try) 2>&5
10265   ac_status=$?
10266   echo "$as_me:10266: \$? = $ac_status" >&5
10267   (exit $ac_status); }; }; then
10268   ac_cv_lib_ICE_IceConnectionNumber=yes
10269 else
10270   echo "$as_me: failed program was:" >&5
10271 cat conftest.$ac_ext >&5
10272 ac_cv_lib_ICE_IceConnectionNumber=no
10273 fi
10274 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10275 LIBS=$ac_check_lib_save_LIBS
10276 fi
10277 echo "$as_me:10277: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10278 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10279 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10280   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10281 fi
10282
10283   LDFLAGS=$ac_save_LDFLAGS
10284
10285 fi
10286
10287 cf_x_athena=${cf_x_athena:-Xaw}
10288
10289 echo "$as_me:10289: checking if you want to link with Xaw 3d library" >&5
10290 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10291 withval=
10292
10293 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10294 if test "${with_Xaw3d+set}" = set; then
10295   withval="$with_Xaw3d"
10296
10297 fi;
10298 if test "$withval" = yes ; then
10299         cf_x_athena=Xaw3d
10300         echo "$as_me:10300: result: yes" >&5
10301 echo "${ECHO_T}yes" >&6
10302 else
10303         echo "$as_me:10303: result: no" >&5
10304 echo "${ECHO_T}no" >&6
10305 fi
10306
10307 echo "$as_me:10307: checking if you want to link with neXT Athena library" >&5
10308 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10309 withval=
10310
10311 # Check whether --with-neXtaw or --without-neXtaw was given.
10312 if test "${with_neXtaw+set}" = set; then
10313   withval="$with_neXtaw"
10314
10315 fi;
10316 if test "$withval" = yes ; then
10317         cf_x_athena=neXtaw
10318         echo "$as_me:10318: result: yes" >&5
10319 echo "${ECHO_T}yes" >&6
10320 else
10321         echo "$as_me:10321: result: no" >&5
10322 echo "${ECHO_T}no" >&6
10323 fi
10324
10325 echo "$as_me:10325: checking if you want to link with Athena-Plus library" >&5
10326 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10327 withval=
10328
10329 # Check whether --with-XawPlus or --without-XawPlus was given.
10330 if test "${with_XawPlus+set}" = set; then
10331   withval="$with_XawPlus"
10332
10333 fi;
10334 if test "$withval" = yes ; then
10335         cf_x_athena=XawPlus
10336         echo "$as_me:10336: result: yes" >&5
10337 echo "${ECHO_T}yes" >&6
10338 else
10339         echo "$as_me:10339: result: no" >&5
10340 echo "${ECHO_T}no" >&6
10341 fi
10342
10343 cf_x_athena_lib=""
10344
10345 if test "$PKG_CONFIG" != none ; then
10346         cf_athena_list=
10347         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10348         for cf_athena_pkg in \
10349                 $cf_athena_list \
10350                 ${cf_x_athena} \
10351                 ${cf_x_athena}-devel \
10352                 lib${cf_x_athena} \
10353                 lib${cf_x_athena}-devel
10354         do
10355
10356 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10357         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10358
10359 echo "${as_me:-configure}:10359: testing found package $cf_athena_pkg ..." 1>&5
10360
10361         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10362         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10363         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10364
10365 echo "${as_me:-configure}:10365: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10366
10367         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10368
10369 echo "${as_me:-configure}:10369: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10370
10371 cf_fix_cppflags=no
10372 cf_new_cflags=
10373 cf_new_cppflags=
10374 cf_new_extra_cppflags=
10375
10376 for cf_add_cflags in $cf_pkgconfig_incs
10377 do
10378 case $cf_fix_cppflags in
10379 no)
10380         case $cf_add_cflags in #(vi
10381         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10382                 case $cf_add_cflags in
10383                 -D*)
10384                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10385
10386                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10387                                 && test -z "${cf_tst_cflags}" \
10388                                 && cf_fix_cppflags=yes
10389
10390                         if test $cf_fix_cppflags = yes ; then
10391                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10392                                 continue
10393                         elif test "${cf_tst_cflags}" = "\"'" ; then
10394                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10395                                 continue
10396                         fi
10397                         ;;
10398                 esac
10399                 case "$CPPFLAGS" in
10400                 *$cf_add_cflags) #(vi
10401                         ;;
10402                 *) #(vi
10403                         case $cf_add_cflags in #(vi
10404                         -D*)
10405                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10406
10407 CPPFLAGS=`echo "$CPPFLAGS" | \
10408         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10409                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10410
10411                                 ;;
10412                         esac
10413                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10414                         ;;
10415                 esac
10416                 ;;
10417         *)
10418                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10419                 ;;
10420         esac
10421         ;;
10422 yes)
10423         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10424
10425         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10426
10427         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10428                 && test -z "${cf_tst_cflags}" \
10429                 && cf_fix_cppflags=no
10430         ;;
10431 esac
10432 done
10433
10434 if test -n "$cf_new_cflags" ; then
10435
10436         CFLAGS="$CFLAGS $cf_new_cflags"
10437 fi
10438
10439 if test -n "$cf_new_cppflags" ; then
10440
10441         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10442 fi
10443
10444 if test -n "$cf_new_extra_cppflags" ; then
10445
10446         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10447 fi
10448
10449         LIBS="$cf_pkgconfig_libs $LIBS"
10450
10451                         cf_x_athena_lib="$cf_pkgconfig_libs"
10452
10453 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10454
10455                         cat >>confdefs.h <<EOF
10456 #define $cf_x_athena_LIBS 1
10457 EOF
10458
10459 echo "$as_me:10459: checking for usable $cf_x_athena/Xmu package" >&5
10460 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10461 if test "${cf_cv_xaw_compat+set}" = set; then
10462   echo $ECHO_N "(cached) $ECHO_C" >&6
10463 else
10464
10465 cat >conftest.$ac_ext <<_ACEOF
10466 #line 10466 "configure"
10467 #include "confdefs.h"
10468
10469 #include <X11/Xmu/CharSet.h>
10470
10471 int
10472 main ()
10473 {
10474
10475 int check = XmuCompareISOLatin1("big", "small")
10476
10477   ;
10478   return 0;
10479 }
10480 _ACEOF
10481 rm -f conftest.$ac_objext conftest$ac_exeext
10482 if { (eval echo "$as_me:10482: \"$ac_link\"") >&5
10483   (eval $ac_link) 2>&5
10484   ac_status=$?
10485   echo "$as_me:10485: \$? = $ac_status" >&5
10486   (exit $ac_status); } &&
10487          { ac_try='test -s conftest$ac_exeext'
10488   { (eval echo "$as_me:10488: \"$ac_try\"") >&5
10489   (eval $ac_try) 2>&5
10490   ac_status=$?
10491   echo "$as_me:10491: \$? = $ac_status" >&5
10492   (exit $ac_status); }; }; then
10493   cf_cv_xaw_compat=yes
10494 else
10495   echo "$as_me: failed program was:" >&5
10496 cat conftest.$ac_ext >&5
10497 cf_cv_xaw_compat=no
10498 fi
10499 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10500 fi
10501 echo "$as_me:10501: result: $cf_cv_xaw_compat" >&5
10502 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10503
10504                         if test "$cf_cv_xaw_compat" = no
10505                         then
10506                                 # workaround for broken ".pc" files...
10507                                 case "$cf_x_athena_lib" in #(vi
10508                                 *-lXmu*) #(vi
10509                                         ;;
10510                                 *)
10511                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10512
10513 echo "${as_me:-configure}:10513: testing work around broken package ..." 1>&5
10514
10515 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10516         test -n "$verbose" && echo "    found package xmu" 1>&6
10517
10518 echo "${as_me:-configure}:10518: testing found package xmu ..." 1>&5
10519
10520         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10521         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10522         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10523
10524 echo "${as_me:-configure}:10524: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10525
10526         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10527
10528 echo "${as_me:-configure}:10528: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10529
10530 cf_fix_cppflags=no
10531 cf_new_cflags=
10532 cf_new_cppflags=
10533 cf_new_extra_cppflags=
10534
10535 for cf_add_cflags in $cf_pkgconfig_incs
10536 do
10537 case $cf_fix_cppflags in
10538 no)
10539         case $cf_add_cflags in #(vi
10540         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10541                 case $cf_add_cflags in
10542                 -D*)
10543                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10544
10545                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10546                                 && test -z "${cf_tst_cflags}" \
10547                                 && cf_fix_cppflags=yes
10548
10549                         if test $cf_fix_cppflags = yes ; then
10550                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10551                                 continue
10552                         elif test "${cf_tst_cflags}" = "\"'" ; then
10553                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10554                                 continue
10555                         fi
10556                         ;;
10557                 esac
10558                 case "$CPPFLAGS" in
10559                 *$cf_add_cflags) #(vi
10560                         ;;
10561                 *) #(vi
10562                         case $cf_add_cflags in #(vi
10563                         -D*)
10564                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10565
10566 CPPFLAGS=`echo "$CPPFLAGS" | \
10567         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10568                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10569
10570                                 ;;
10571                         esac
10572                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10573                         ;;
10574                 esac
10575                 ;;
10576         *)
10577                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10578                 ;;
10579         esac
10580         ;;
10581 yes)
10582         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10583
10584         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10585
10586         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10587                 && test -z "${cf_tst_cflags}" \
10588                 && cf_fix_cppflags=no
10589         ;;
10590 esac
10591 done
10592
10593 if test -n "$cf_new_cflags" ; then
10594
10595         CFLAGS="$CFLAGS $cf_new_cflags"
10596 fi
10597
10598 if test -n "$cf_new_cppflags" ; then
10599
10600         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10601 fi
10602
10603 if test -n "$cf_new_extra_cppflags" ; then
10604
10605         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10606 fi
10607
10608         LIBS="$cf_pkgconfig_libs $LIBS"
10609         :
10610 else
10611
10612 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10613
10614 echo "${as_me:-configure}:10614: testing ...before $LIBS ..." 1>&5
10615
10616 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lXmu ," -e 's/  / /g'`
10617 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10618
10619 echo "${as_me:-configure}:10619: testing ...after  $LIBS ..." 1>&5
10620
10621 fi
10622
10623                                         ;;
10624                                 esac
10625                         fi
10626
10627                         break
10628 else
10629         :
10630 fi
10631
10632         done
10633 fi
10634
10635 if test -z "$cf_x_athena_lib" ; then
10636
10637 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10638         test -n "$verbose" && echo "    found package Xext" 1>&6
10639
10640 echo "${as_me:-configure}:10640: testing found package Xext ..." 1>&5
10641
10642         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10643         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10644         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10645
10646 echo "${as_me:-configure}:10646: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10647
10648         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10649
10650 echo "${as_me:-configure}:10650: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10651
10652 cf_fix_cppflags=no
10653 cf_new_cflags=
10654 cf_new_cppflags=
10655 cf_new_extra_cppflags=
10656
10657 for cf_add_cflags in $cf_pkgconfig_incs
10658 do
10659 case $cf_fix_cppflags in
10660 no)
10661         case $cf_add_cflags in #(vi
10662         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10663                 case $cf_add_cflags in
10664                 -D*)
10665                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10666
10667                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10668                                 && test -z "${cf_tst_cflags}" \
10669                                 && cf_fix_cppflags=yes
10670
10671                         if test $cf_fix_cppflags = yes ; then
10672                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10673                                 continue
10674                         elif test "${cf_tst_cflags}" = "\"'" ; then
10675                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10676                                 continue
10677                         fi
10678                         ;;
10679                 esac
10680                 case "$CPPFLAGS" in
10681                 *$cf_add_cflags) #(vi
10682                         ;;
10683                 *) #(vi
10684                         case $cf_add_cflags in #(vi
10685                         -D*)
10686                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10687
10688 CPPFLAGS=`echo "$CPPFLAGS" | \
10689         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10690                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10691
10692                                 ;;
10693                         esac
10694                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10695                         ;;
10696                 esac
10697                 ;;
10698         *)
10699                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10700                 ;;
10701         esac
10702         ;;
10703 yes)
10704         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10705
10706         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10707
10708         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10709                 && test -z "${cf_tst_cflags}" \
10710                 && cf_fix_cppflags=no
10711         ;;
10712 esac
10713 done
10714
10715 if test -n "$cf_new_cflags" ; then
10716
10717         CFLAGS="$CFLAGS $cf_new_cflags"
10718 fi
10719
10720 if test -n "$cf_new_cppflags" ; then
10721
10722         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10723 fi
10724
10725 if test -n "$cf_new_extra_cppflags" ; then
10726
10727         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10728 fi
10729
10730         LIBS="$cf_pkgconfig_libs $LIBS"
10731         :
10732 else
10733
10734         echo "$as_me:10734: checking for XextCreateExtension in -lXext" >&5
10735 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10736 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10737   echo $ECHO_N "(cached) $ECHO_C" >&6
10738 else
10739   ac_check_lib_save_LIBS=$LIBS
10740 LIBS="-lXext  $LIBS"
10741 cat >conftest.$ac_ext <<_ACEOF
10742 #line 10742 "configure"
10743 #include "confdefs.h"
10744
10745 /* Override any gcc2 internal prototype to avoid an error.  */
10746 #ifdef __cplusplus
10747 extern "C"
10748 #endif
10749 /* We use char because int might match the return type of a gcc2
10750    builtin and then its argument prototype would still apply.  */
10751 char XextCreateExtension ();
10752 int
10753 main ()
10754 {
10755 XextCreateExtension ();
10756   ;
10757   return 0;
10758 }
10759 _ACEOF
10760 rm -f conftest.$ac_objext conftest$ac_exeext
10761 if { (eval echo "$as_me:10761: \"$ac_link\"") >&5
10762   (eval $ac_link) 2>&5
10763   ac_status=$?
10764   echo "$as_me:10764: \$? = $ac_status" >&5
10765   (exit $ac_status); } &&
10766          { ac_try='test -s conftest$ac_exeext'
10767   { (eval echo "$as_me:10767: \"$ac_try\"") >&5
10768   (eval $ac_try) 2>&5
10769   ac_status=$?
10770   echo "$as_me:10770: \$? = $ac_status" >&5
10771   (exit $ac_status); }; }; then
10772   ac_cv_lib_Xext_XextCreateExtension=yes
10773 else
10774   echo "$as_me: failed program was:" >&5
10775 cat conftest.$ac_ext >&5
10776 ac_cv_lib_Xext_XextCreateExtension=no
10777 fi
10778 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10779 LIBS=$ac_check_lib_save_LIBS
10780 fi
10781 echo "$as_me:10781: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
10782 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
10783 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
10784   LIBS="-lXext $LIBS"
10785 fi
10786
10787 fi
10788
10789 cf_have_X_LIBS=no
10790
10791 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
10792         test -n "$verbose" && echo "    found package xt" 1>&6
10793
10794 echo "${as_me:-configure}:10794: testing found package xt ..." 1>&5
10795
10796         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
10797         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
10798         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
10799
10800 echo "${as_me:-configure}:10800: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10801
10802         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
10803
10804 echo "${as_me:-configure}:10804: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
10805
10806 cf_fix_cppflags=no
10807 cf_new_cflags=
10808 cf_new_cppflags=
10809 cf_new_extra_cppflags=
10810
10811 for cf_add_cflags in $cf_pkgconfig_incs
10812 do
10813 case $cf_fix_cppflags in
10814 no)
10815         case $cf_add_cflags in #(vi
10816         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10817                 case $cf_add_cflags in
10818                 -D*)
10819                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10820
10821                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10822                                 && test -z "${cf_tst_cflags}" \
10823                                 && cf_fix_cppflags=yes
10824
10825                         if test $cf_fix_cppflags = yes ; then
10826                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10827                                 continue
10828                         elif test "${cf_tst_cflags}" = "\"'" ; then
10829                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10830                                 continue
10831                         fi
10832                         ;;
10833                 esac
10834                 case "$CPPFLAGS" in
10835                 *$cf_add_cflags) #(vi
10836                         ;;
10837                 *) #(vi
10838                         case $cf_add_cflags in #(vi
10839                         -D*)
10840                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10841
10842 CPPFLAGS=`echo "$CPPFLAGS" | \
10843         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10844                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10845
10846                                 ;;
10847                         esac
10848                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10849                         ;;
10850                 esac
10851                 ;;
10852         *)
10853                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10854                 ;;
10855         esac
10856         ;;
10857 yes)
10858         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10859
10860         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10861
10862         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10863                 && test -z "${cf_tst_cflags}" \
10864                 && cf_fix_cppflags=no
10865         ;;
10866 esac
10867 done
10868
10869 if test -n "$cf_new_cflags" ; then
10870
10871         CFLAGS="$CFLAGS $cf_new_cflags"
10872 fi
10873
10874 if test -n "$cf_new_cppflags" ; then
10875
10876         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10877 fi
10878
10879 if test -n "$cf_new_extra_cppflags" ; then
10880
10881         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10882 fi
10883
10884         LIBS="$cf_pkgconfig_libs $LIBS"
10885
10886         case "x$LIBS" in #(vi
10887         *-lX11*) #(vi
10888                 ;;
10889         *)
10890 # we have an "xt" package, but it may omit Xt's dependency on X11
10891 echo "$as_me:10891: checking for usable X dependency" >&5
10892 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
10893 if test "${cf_cv_xt_x11_compat+set}" = set; then
10894   echo $ECHO_N "(cached) $ECHO_C" >&6
10895 else
10896
10897 cat >conftest.$ac_ext <<_ACEOF
10898 #line 10898 "configure"
10899 #include "confdefs.h"
10900
10901 #include <X11/Xlib.h>
10902
10903 int
10904 main ()
10905 {
10906
10907         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
10908         int rc2 = XClearWindow((Display*) 0, (Window) 0);
10909         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
10910         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
10911
10912   ;
10913   return 0;
10914 }
10915 _ACEOF
10916 rm -f conftest.$ac_objext conftest$ac_exeext
10917 if { (eval echo "$as_me:10917: \"$ac_link\"") >&5
10918   (eval $ac_link) 2>&5
10919   ac_status=$?
10920   echo "$as_me:10920: \$? = $ac_status" >&5
10921   (exit $ac_status); } &&
10922          { ac_try='test -s conftest$ac_exeext'
10923   { (eval echo "$as_me:10923: \"$ac_try\"") >&5
10924   (eval $ac_try) 2>&5
10925   ac_status=$?
10926   echo "$as_me:10926: \$? = $ac_status" >&5
10927   (exit $ac_status); }; }; then
10928   cf_cv_xt_x11_compat=yes
10929 else
10930   echo "$as_me: failed program was:" >&5
10931 cat conftest.$ac_ext >&5
10932 cf_cv_xt_x11_compat=no
10933 fi
10934 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10935 fi
10936 echo "$as_me:10936: result: $cf_cv_xt_x11_compat" >&5
10937 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
10938                 if test "$cf_cv_xt_x11_compat" = no
10939                 then
10940                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
10941
10942 echo "${as_me:-configure}:10942: testing work around broken X11 dependency ..." 1>&5
10943
10944                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
10945
10946 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
10947         test -n "$verbose" && echo "    found package x11" 1>&6
10948
10949 echo "${as_me:-configure}:10949: testing found package x11 ..." 1>&5
10950
10951         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
10952         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
10953         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
10954
10955 echo "${as_me:-configure}:10955: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10956
10957         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
10958
10959 echo "${as_me:-configure}:10959: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
10960
10961 cf_fix_cppflags=no
10962 cf_new_cflags=
10963 cf_new_cppflags=
10964 cf_new_extra_cppflags=
10965
10966 for cf_add_cflags in $cf_pkgconfig_incs
10967 do
10968 case $cf_fix_cppflags in
10969 no)
10970         case $cf_add_cflags in #(vi
10971         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10972                 case $cf_add_cflags in
10973                 -D*)
10974                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10975
10976                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10977                                 && test -z "${cf_tst_cflags}" \
10978                                 && cf_fix_cppflags=yes
10979
10980                         if test $cf_fix_cppflags = yes ; then
10981                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10982                                 continue
10983                         elif test "${cf_tst_cflags}" = "\"'" ; then
10984                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10985                                 continue
10986                         fi
10987                         ;;
10988                 esac
10989                 case "$CPPFLAGS" in
10990                 *$cf_add_cflags) #(vi
10991                         ;;
10992                 *) #(vi
10993                         case $cf_add_cflags in #(vi
10994                         -D*)
10995                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10996
10997 CPPFLAGS=`echo "$CPPFLAGS" | \
10998         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10999                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11000
11001                                 ;;
11002                         esac
11003                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11004                         ;;
11005                 esac
11006                 ;;
11007         *)
11008                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11009                 ;;
11010         esac
11011         ;;
11012 yes)
11013         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11014
11015         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11016
11017         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11018                 && test -z "${cf_tst_cflags}" \
11019                 && cf_fix_cppflags=no
11020         ;;
11021 esac
11022 done
11023
11024 if test -n "$cf_new_cflags" ; then
11025
11026         CFLAGS="$CFLAGS $cf_new_cflags"
11027 fi
11028
11029 if test -n "$cf_new_cppflags" ; then
11030
11031         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11032 fi
11033
11034 if test -n "$cf_new_extra_cppflags" ; then
11035
11036         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11037 fi
11038
11039         LIBS="$cf_pkgconfig_libs $LIBS"
11040         :
11041 else
11042
11043 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11044
11045 echo "${as_me:-configure}:11045: testing ...before $LIBS ..." 1>&5
11046
11047 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lX11 ," -e 's/  / /g'`
11048 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11049
11050 echo "${as_me:-configure}:11050: testing ...after  $LIBS ..." 1>&5
11051
11052 fi
11053
11054                 fi
11055                 ;;
11056         esac
11057
11058 echo "$as_me:11058: checking for usable X Toolkit package" >&5
11059 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11060 if test "${cf_cv_xt_ice_compat+set}" = set; then
11061   echo $ECHO_N "(cached) $ECHO_C" >&6
11062 else
11063
11064 cat >conftest.$ac_ext <<_ACEOF
11065 #line 11065 "configure"
11066 #include "confdefs.h"
11067
11068 #include <X11/Shell.h>
11069
11070 int
11071 main ()
11072 {
11073 int num = IceConnectionNumber(0)
11074
11075   ;
11076   return 0;
11077 }
11078 _ACEOF
11079 rm -f conftest.$ac_objext conftest$ac_exeext
11080 if { (eval echo "$as_me:11080: \"$ac_link\"") >&5
11081   (eval $ac_link) 2>&5
11082   ac_status=$?
11083   echo "$as_me:11083: \$? = $ac_status" >&5
11084   (exit $ac_status); } &&
11085          { ac_try='test -s conftest$ac_exeext'
11086   { (eval echo "$as_me:11086: \"$ac_try\"") >&5
11087   (eval $ac_try) 2>&5
11088   ac_status=$?
11089   echo "$as_me:11089: \$? = $ac_status" >&5
11090   (exit $ac_status); }; }; then
11091   cf_cv_xt_ice_compat=yes
11092 else
11093   echo "$as_me: failed program was:" >&5
11094 cat conftest.$ac_ext >&5
11095 cf_cv_xt_ice_compat=no
11096 fi
11097 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11098 fi
11099 echo "$as_me:11099: result: $cf_cv_xt_ice_compat" >&5
11100 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11101
11102         if test "$cf_cv_xt_ice_compat" = no
11103         then
11104                 # workaround for broken ".pc" files used for X Toolkit.
11105                 case "x$X_PRE_LIBS" in #(vi
11106                 *-lICE*)
11107                         case "x$LIBS" in #(vi
11108                         *-lICE*) #(vi
11109                                 ;;
11110                         *)
11111                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11112
11113 echo "${as_me:-configure}:11113: testing work around broken ICE dependency ..." 1>&5
11114
11115 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11116         test -n "$verbose" && echo "    found package ice" 1>&6
11117
11118 echo "${as_me:-configure}:11118: testing found package ice ..." 1>&5
11119
11120         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11121         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11122         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11123
11124 echo "${as_me:-configure}:11124: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11125
11126         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11127
11128 echo "${as_me:-configure}:11128: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11129
11130 cf_fix_cppflags=no
11131 cf_new_cflags=
11132 cf_new_cppflags=
11133 cf_new_extra_cppflags=
11134
11135 for cf_add_cflags in $cf_pkgconfig_incs
11136 do
11137 case $cf_fix_cppflags in
11138 no)
11139         case $cf_add_cflags in #(vi
11140         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11141                 case $cf_add_cflags in
11142                 -D*)
11143                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11144
11145                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11146                                 && test -z "${cf_tst_cflags}" \
11147                                 && cf_fix_cppflags=yes
11148
11149                         if test $cf_fix_cppflags = yes ; then
11150                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11151                                 continue
11152                         elif test "${cf_tst_cflags}" = "\"'" ; then
11153                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11154                                 continue
11155                         fi
11156                         ;;
11157                 esac
11158                 case "$CPPFLAGS" in
11159                 *$cf_add_cflags) #(vi
11160                         ;;
11161                 *) #(vi
11162                         case $cf_add_cflags in #(vi
11163                         -D*)
11164                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11165
11166 CPPFLAGS=`echo "$CPPFLAGS" | \
11167         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11168                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11169
11170                                 ;;
11171                         esac
11172                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11173                         ;;
11174                 esac
11175                 ;;
11176         *)
11177                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11178                 ;;
11179         esac
11180         ;;
11181 yes)
11182         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11183
11184         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11185
11186         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11187                 && test -z "${cf_tst_cflags}" \
11188                 && cf_fix_cppflags=no
11189         ;;
11190 esac
11191 done
11192
11193 if test -n "$cf_new_cflags" ; then
11194
11195         CFLAGS="$CFLAGS $cf_new_cflags"
11196 fi
11197
11198 if test -n "$cf_new_cppflags" ; then
11199
11200         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11201 fi
11202
11203 if test -n "$cf_new_extra_cppflags" ; then
11204
11205         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11206 fi
11207
11208         LIBS="$cf_pkgconfig_libs $LIBS"
11209
11210 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11211         test -n "$verbose" && echo "    found package sm" 1>&6
11212
11213 echo "${as_me:-configure}:11213: testing found package sm ..." 1>&5
11214
11215         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11216         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11217         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11218
11219 echo "${as_me:-configure}:11219: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11220
11221         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11222
11223 echo "${as_me:-configure}:11223: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11224
11225 cf_fix_cppflags=no
11226 cf_new_cflags=
11227 cf_new_cppflags=
11228 cf_new_extra_cppflags=
11229
11230 for cf_add_cflags in $cf_pkgconfig_incs
11231 do
11232 case $cf_fix_cppflags in
11233 no)
11234         case $cf_add_cflags in #(vi
11235         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11236                 case $cf_add_cflags in
11237                 -D*)
11238                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11239
11240                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11241                                 && test -z "${cf_tst_cflags}" \
11242                                 && cf_fix_cppflags=yes
11243
11244                         if test $cf_fix_cppflags = yes ; then
11245                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11246                                 continue
11247                         elif test "${cf_tst_cflags}" = "\"'" ; then
11248                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11249                                 continue
11250                         fi
11251                         ;;
11252                 esac
11253                 case "$CPPFLAGS" in
11254                 *$cf_add_cflags) #(vi
11255                         ;;
11256                 *) #(vi
11257                         case $cf_add_cflags in #(vi
11258                         -D*)
11259                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11260
11261 CPPFLAGS=`echo "$CPPFLAGS" | \
11262         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11263                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11264
11265                                 ;;
11266                         esac
11267                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11268                         ;;
11269                 esac
11270                 ;;
11271         *)
11272                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11273                 ;;
11274         esac
11275         ;;
11276 yes)
11277         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11278
11279         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11280
11281         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11282                 && test -z "${cf_tst_cflags}" \
11283                 && cf_fix_cppflags=no
11284         ;;
11285 esac
11286 done
11287
11288 if test -n "$cf_new_cflags" ; then
11289
11290         CFLAGS="$CFLAGS $cf_new_cflags"
11291 fi
11292
11293 if test -n "$cf_new_cppflags" ; then
11294
11295         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11296 fi
11297
11298 if test -n "$cf_new_extra_cppflags" ; then
11299
11300         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11301 fi
11302
11303         LIBS="$cf_pkgconfig_libs $LIBS"
11304         :
11305 else
11306         :
11307 fi
11308
11309 else
11310
11311 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11312
11313 echo "${as_me:-configure}:11313: testing ...before $LIBS ..." 1>&5
11314
11315 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/  / /g'`
11316 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11317
11318 echo "${as_me:-configure}:11318: testing ...after  $LIBS ..." 1>&5
11319
11320 fi
11321
11322                                 ;;
11323                         esac
11324                         ;;
11325                 esac
11326         fi
11327
11328         cf_have_X_LIBS=yes
11329
11330 else
11331
11332         LDFLAGS="$X_LIBS $LDFLAGS"
11333
11334 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11335
11336 echo "${as_me:-configure}:11336: testing checking additions to CFLAGS ..." 1>&5
11337
11338 cf_check_cflags="$CFLAGS"
11339 cf_check_cppflags="$CPPFLAGS"
11340
11341 cf_fix_cppflags=no
11342 cf_new_cflags=
11343 cf_new_cppflags=
11344 cf_new_extra_cppflags=
11345
11346 for cf_add_cflags in $X_CFLAGS
11347 do
11348 case $cf_fix_cppflags in
11349 no)
11350         case $cf_add_cflags in #(vi
11351         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11352                 case $cf_add_cflags in
11353                 -D*)
11354                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11355
11356                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11357                                 && test -z "${cf_tst_cflags}" \
11358                                 && cf_fix_cppflags=yes
11359
11360                         if test $cf_fix_cppflags = yes ; then
11361                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11362                                 continue
11363                         elif test "${cf_tst_cflags}" = "\"'" ; then
11364                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11365                                 continue
11366                         fi
11367                         ;;
11368                 esac
11369                 case "$CPPFLAGS" in
11370                 *$cf_add_cflags) #(vi
11371                         ;;
11372                 *) #(vi
11373                         case $cf_add_cflags in #(vi
11374                         -D*)
11375                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11376
11377 CPPFLAGS=`echo "$CPPFLAGS" | \
11378         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11379                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11380
11381                                 ;;
11382                         esac
11383                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11384                         ;;
11385                 esac
11386                 ;;
11387         *)
11388                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11389                 ;;
11390         esac
11391         ;;
11392 yes)
11393         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11394
11395         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11396
11397         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11398                 && test -z "${cf_tst_cflags}" \
11399                 && cf_fix_cppflags=no
11400         ;;
11401 esac
11402 done
11403
11404 if test -n "$cf_new_cflags" ; then
11405         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11406
11407 echo "${as_me:-configure}:11407: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11408
11409         CFLAGS="$CFLAGS $cf_new_cflags"
11410 fi
11411
11412 if test -n "$cf_new_cppflags" ; then
11413         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11414
11415 echo "${as_me:-configure}:11415: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11416
11417         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11418 fi
11419
11420 if test -n "$cf_new_extra_cppflags" ; then
11421         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11422
11423 echo "${as_me:-configure}:11423: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11424
11425         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11426 fi
11427
11428 if test "$cf_check_cflags" != "$CFLAGS" ; then
11429 cat >conftest.$ac_ext <<_ACEOF
11430 #line 11430 "configure"
11431 #include "confdefs.h"
11432 #include <stdio.h>
11433 int
11434 main ()
11435 {
11436 printf("Hello world");
11437   ;
11438   return 0;
11439 }
11440 _ACEOF
11441 rm -f conftest.$ac_objext conftest$ac_exeext
11442 if { (eval echo "$as_me:11442: \"$ac_link\"") >&5
11443   (eval $ac_link) 2>&5
11444   ac_status=$?
11445   echo "$as_me:11445: \$? = $ac_status" >&5
11446   (exit $ac_status); } &&
11447          { ac_try='test -s conftest$ac_exeext'
11448   { (eval echo "$as_me:11448: \"$ac_try\"") >&5
11449   (eval $ac_try) 2>&5
11450   ac_status=$?
11451   echo "$as_me:11451: \$? = $ac_status" >&5
11452   (exit $ac_status); }; }; then
11453   :
11454 else
11455   echo "$as_me: failed program was:" >&5
11456 cat conftest.$ac_ext >&5
11457 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
11458
11459 echo "${as_me:-configure}:11459: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
11460
11461          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
11462                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
11463
11464 echo "${as_me:-configure}:11464: testing but keeping change to \$CPPFLAGS ..." 1>&5
11465
11466          fi
11467          CFLAGS="$cf_check_flags"
11468 fi
11469 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11470 fi
11471
11472         echo "$as_me:11472: checking for XOpenDisplay" >&5
11473 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
11474 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
11475   echo $ECHO_N "(cached) $ECHO_C" >&6
11476 else
11477   cat >conftest.$ac_ext <<_ACEOF
11478 #line 11478 "configure"
11479 #include "confdefs.h"
11480 /* System header to define __stub macros and hopefully few prototypes,
11481     which can conflict with char XOpenDisplay (); below.  */
11482 #include <assert.h>
11483 /* Override any gcc2 internal prototype to avoid an error.  */
11484 #ifdef __cplusplus
11485 extern "C"
11486 #endif
11487 /* We use char because int might match the return type of a gcc2
11488    builtin and then its argument prototype would still apply.  */
11489 char XOpenDisplay ();
11490 char (*f) ();
11491
11492 int
11493 main ()
11494 {
11495 /* The GNU C library defines this for functions which it implements
11496     to always fail with ENOSYS.  Some functions are actually named
11497     something starting with __ and the normal name is an alias.  */
11498 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
11499 choke me
11500 #else
11501 f = XOpenDisplay;
11502 #endif
11503
11504   ;
11505   return 0;
11506 }
11507 _ACEOF
11508 rm -f conftest.$ac_objext conftest$ac_exeext
11509 if { (eval echo "$as_me:11509: \"$ac_link\"") >&5
11510   (eval $ac_link) 2>&5
11511   ac_status=$?
11512   echo "$as_me:11512: \$? = $ac_status" >&5
11513   (exit $ac_status); } &&
11514          { ac_try='test -s conftest$ac_exeext'
11515   { (eval echo "$as_me:11515: \"$ac_try\"") >&5
11516   (eval $ac_try) 2>&5
11517   ac_status=$?
11518   echo "$as_me:11518: \$? = $ac_status" >&5
11519   (exit $ac_status); }; }; then
11520   ac_cv_func_XOpenDisplay=yes
11521 else
11522   echo "$as_me: failed program was:" >&5
11523 cat conftest.$ac_ext >&5
11524 ac_cv_func_XOpenDisplay=no
11525 fi
11526 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11527 fi
11528 echo "$as_me:11528: result: $ac_cv_func_XOpenDisplay" >&5
11529 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
11530 if test $ac_cv_func_XOpenDisplay = yes; then
11531   :
11532 else
11533
11534         echo "$as_me:11534: checking for XOpenDisplay in -lX11" >&5
11535 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
11536 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
11537   echo $ECHO_N "(cached) $ECHO_C" >&6
11538 else
11539   ac_check_lib_save_LIBS=$LIBS
11540 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11541 cat >conftest.$ac_ext <<_ACEOF
11542 #line 11542 "configure"
11543 #include "confdefs.h"
11544
11545 /* Override any gcc2 internal prototype to avoid an error.  */
11546 #ifdef __cplusplus
11547 extern "C"
11548 #endif
11549 /* We use char because int might match the return type of a gcc2
11550    builtin and then its argument prototype would still apply.  */
11551 char XOpenDisplay ();
11552 int
11553 main ()
11554 {
11555 XOpenDisplay ();
11556   ;
11557   return 0;
11558 }
11559 _ACEOF
11560 rm -f conftest.$ac_objext conftest$ac_exeext
11561 if { (eval echo "$as_me:11561: \"$ac_link\"") >&5
11562   (eval $ac_link) 2>&5
11563   ac_status=$?
11564   echo "$as_me:11564: \$? = $ac_status" >&5
11565   (exit $ac_status); } &&
11566          { ac_try='test -s conftest$ac_exeext'
11567   { (eval echo "$as_me:11567: \"$ac_try\"") >&5
11568   (eval $ac_try) 2>&5
11569   ac_status=$?
11570   echo "$as_me:11570: \$? = $ac_status" >&5
11571   (exit $ac_status); }; }; then
11572   ac_cv_lib_X11_XOpenDisplay=yes
11573 else
11574   echo "$as_me: failed program was:" >&5
11575 cat conftest.$ac_ext >&5
11576 ac_cv_lib_X11_XOpenDisplay=no
11577 fi
11578 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11579 LIBS=$ac_check_lib_save_LIBS
11580 fi
11581 echo "$as_me:11581: result: $ac_cv_lib_X11_XOpenDisplay" >&5
11582 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
11583 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
11584   LIBS="-lX11 $LIBS"
11585 fi
11586
11587 fi
11588
11589         echo "$as_me:11589: checking for XtAppInitialize" >&5
11590 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
11591 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
11592   echo $ECHO_N "(cached) $ECHO_C" >&6
11593 else
11594   cat >conftest.$ac_ext <<_ACEOF
11595 #line 11595 "configure"
11596 #include "confdefs.h"
11597 /* System header to define __stub macros and hopefully few prototypes,
11598     which can conflict with char XtAppInitialize (); below.  */
11599 #include <assert.h>
11600 /* Override any gcc2 internal prototype to avoid an error.  */
11601 #ifdef __cplusplus
11602 extern "C"
11603 #endif
11604 /* We use char because int might match the return type of a gcc2
11605    builtin and then its argument prototype would still apply.  */
11606 char XtAppInitialize ();
11607 char (*f) ();
11608
11609 int
11610 main ()
11611 {
11612 /* The GNU C library defines this for functions which it implements
11613     to always fail with ENOSYS.  Some functions are actually named
11614     something starting with __ and the normal name is an alias.  */
11615 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
11616 choke me
11617 #else
11618 f = XtAppInitialize;
11619 #endif
11620
11621   ;
11622   return 0;
11623 }
11624 _ACEOF
11625 rm -f conftest.$ac_objext conftest$ac_exeext
11626 if { (eval echo "$as_me:11626: \"$ac_link\"") >&5
11627   (eval $ac_link) 2>&5
11628   ac_status=$?
11629   echo "$as_me:11629: \$? = $ac_status" >&5
11630   (exit $ac_status); } &&
11631          { ac_try='test -s conftest$ac_exeext'
11632   { (eval echo "$as_me:11632: \"$ac_try\"") >&5
11633   (eval $ac_try) 2>&5
11634   ac_status=$?
11635   echo "$as_me:11635: \$? = $ac_status" >&5
11636   (exit $ac_status); }; }; then
11637   ac_cv_func_XtAppInitialize=yes
11638 else
11639   echo "$as_me: failed program was:" >&5
11640 cat conftest.$ac_ext >&5
11641 ac_cv_func_XtAppInitialize=no
11642 fi
11643 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11644 fi
11645 echo "$as_me:11645: result: $ac_cv_func_XtAppInitialize" >&5
11646 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
11647 if test $ac_cv_func_XtAppInitialize = yes; then
11648   :
11649 else
11650
11651         echo "$as_me:11651: checking for XtAppInitialize in -lXt" >&5
11652 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
11653 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
11654   echo $ECHO_N "(cached) $ECHO_C" >&6
11655 else
11656   ac_check_lib_save_LIBS=$LIBS
11657 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11658 cat >conftest.$ac_ext <<_ACEOF
11659 #line 11659 "configure"
11660 #include "confdefs.h"
11661
11662 /* Override any gcc2 internal prototype to avoid an error.  */
11663 #ifdef __cplusplus
11664 extern "C"
11665 #endif
11666 /* We use char because int might match the return type of a gcc2
11667    builtin and then its argument prototype would still apply.  */
11668 char XtAppInitialize ();
11669 int
11670 main ()
11671 {
11672 XtAppInitialize ();
11673   ;
11674   return 0;
11675 }
11676 _ACEOF
11677 rm -f conftest.$ac_objext conftest$ac_exeext
11678 if { (eval echo "$as_me:11678: \"$ac_link\"") >&5
11679   (eval $ac_link) 2>&5
11680   ac_status=$?
11681   echo "$as_me:11681: \$? = $ac_status" >&5
11682   (exit $ac_status); } &&
11683          { ac_try='test -s conftest$ac_exeext'
11684   { (eval echo "$as_me:11684: \"$ac_try\"") >&5
11685   (eval $ac_try) 2>&5
11686   ac_status=$?
11687   echo "$as_me:11687: \$? = $ac_status" >&5
11688   (exit $ac_status); }; }; then
11689   ac_cv_lib_Xt_XtAppInitialize=yes
11690 else
11691   echo "$as_me: failed program was:" >&5
11692 cat conftest.$ac_ext >&5
11693 ac_cv_lib_Xt_XtAppInitialize=no
11694 fi
11695 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11696 LIBS=$ac_check_lib_save_LIBS
11697 fi
11698 echo "$as_me:11698: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
11699 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
11700 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
11701   cat >>confdefs.h <<\EOF
11702 #define HAVE_LIBXT 1
11703 EOF
11704
11705                  cf_have_X_LIBS=Xt
11706                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
11707 fi
11708
11709 fi
11710
11711 fi
11712
11713 if test $cf_have_X_LIBS = no ; then
11714         { echo "$as_me:11714: WARNING: Unable to successfully link X Toolkit library (-lXt) with
11715 test program.  You will have to check and add the proper libraries by hand
11716 to makefile." >&5
11717 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
11718 test program.  You will have to check and add the proper libraries by hand
11719 to makefile." >&2;}
11720 fi
11721
11722 cf_x_athena_root=$cf_x_athena
11723 cf_x_athena_inc=""
11724
11725 for cf_path in default \
11726         /usr/contrib/X11R6 \
11727         /usr/contrib/X11R5 \
11728         /usr/lib/X11R5 \
11729         /usr/local
11730 do
11731         if test -z "$cf_x_athena_inc" ; then
11732                 cf_save="$CPPFLAGS"
11733                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
11734                 if test $cf_path != default ; then
11735                         CPPFLAGS="$cf_save -I$cf_path/include"
11736                         echo "$as_me:11736: checking for $cf_test in $cf_path" >&5
11737 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
11738                 else
11739                         echo "$as_me:11739: checking for $cf_test" >&5
11740 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
11741                 fi
11742                 cat >conftest.$ac_ext <<_ACEOF
11743 #line 11743 "configure"
11744 #include "confdefs.h"
11745
11746 #include <X11/Intrinsic.h>
11747 #include <$cf_test>
11748 int
11749 main ()
11750 {
11751
11752   ;
11753   return 0;
11754 }
11755 _ACEOF
11756 rm -f conftest.$ac_objext
11757 if { (eval echo "$as_me:11757: \"$ac_compile\"") >&5
11758   (eval $ac_compile) 2>&5
11759   ac_status=$?
11760   echo "$as_me:11760: \$? = $ac_status" >&5
11761   (exit $ac_status); } &&
11762          { ac_try='test -s conftest.$ac_objext'
11763   { (eval echo "$as_me:11763: \"$ac_try\"") >&5
11764   (eval $ac_try) 2>&5
11765   ac_status=$?
11766   echo "$as_me:11766: \$? = $ac_status" >&5
11767   (exit $ac_status); }; }; then
11768   cf_result=yes
11769 else
11770   echo "$as_me: failed program was:" >&5
11771 cat conftest.$ac_ext >&5
11772 cf_result=no
11773 fi
11774 rm -f conftest.$ac_objext conftest.$ac_ext
11775                 echo "$as_me:11775: result: $cf_result" >&5
11776 echo "${ECHO_T}$cf_result" >&6
11777                 if test "$cf_result" = yes ; then
11778                         cf_x_athena_inc=$cf_path
11779                         break
11780                 else
11781                         CPPFLAGS="$cf_save"
11782                 fi
11783         fi
11784 done
11785
11786 if test -z "$cf_x_athena_inc" ; then
11787         { echo "$as_me:11787: WARNING: Unable to successfully find Athena header files with test program" >&5
11788 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
11789 elif test "$cf_x_athena_inc" != default ; then
11790         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
11791 fi
11792
11793 cf_x_athena_root=$cf_x_athena
11794 cf_x_athena_lib=""
11795
11796 for cf_path in default \
11797         /usr/contrib/X11R6 \
11798         /usr/contrib/X11R5 \
11799         /usr/lib/X11R5 \
11800         /usr/local
11801 do
11802         for cf_lib in \
11803                 "-l$cf_x_athena_root -lXmu" \
11804                 "-l$cf_x_athena_root -lXpm -lXmu" \
11805                 "-l${cf_x_athena_root}_s -lXmu_s"
11806         do
11807                 if test -z "$cf_x_athena_lib" ; then
11808                         cf_save="$LIBS"
11809                         cf_test=XawSimpleMenuAddGlobalActions
11810                         if test $cf_path != default ; then
11811                                 LIBS="-L$cf_path/lib $cf_lib $LIBS"
11812                                 echo "$as_me:11812: checking for $cf_lib in $cf_path" >&5
11813 echo $ECHO_N "checking for $cf_lib in $cf_path... $ECHO_C" >&6
11814                         else
11815                                 LIBS="$cf_lib $LIBS"
11816                                 echo "$as_me:11816: checking for $cf_test in $cf_lib" >&5
11817 echo $ECHO_N "checking for $cf_test in $cf_lib... $ECHO_C" >&6
11818                         fi
11819                         cat >conftest.$ac_ext <<_ACEOF
11820 #line 11820 "configure"
11821 #include "confdefs.h"
11822
11823 int
11824 main ()
11825 {
11826 $cf_test()
11827   ;
11828   return 0;
11829 }
11830 _ACEOF
11831 rm -f conftest.$ac_objext conftest$ac_exeext
11832 if { (eval echo "$as_me:11832: \"$ac_link\"") >&5
11833   (eval $ac_link) 2>&5
11834   ac_status=$?
11835   echo "$as_me:11835: \$? = $ac_status" >&5
11836   (exit $ac_status); } &&
11837          { ac_try='test -s conftest$ac_exeext'
11838   { (eval echo "$as_me:11838: \"$ac_try\"") >&5
11839   (eval $ac_try) 2>&5
11840   ac_status=$?
11841   echo "$as_me:11841: \$? = $ac_status" >&5
11842   (exit $ac_status); }; }; then
11843   cf_result=yes
11844 else
11845   echo "$as_me: failed program was:" >&5
11846 cat conftest.$ac_ext >&5
11847 cf_result=no
11848 fi
11849 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11850                         echo "$as_me:11850: result: $cf_result" >&5
11851 echo "${ECHO_T}$cf_result" >&6
11852                         if test "$cf_result" = yes ; then
11853                                 cf_x_athena_lib="$cf_lib"
11854                                 break
11855                         fi
11856                         LIBS="$cf_save"
11857                 fi
11858         done
11859 done
11860
11861 if test -z "$cf_x_athena_lib" ; then
11862         { { echo "$as_me:11862: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
11863 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
11864    { (exit 1); exit 1; }; }
11865 fi
11866
11867 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11868
11869 cat >>confdefs.h <<EOF
11870 #define $cf_x_athena_LIBS 1
11871 EOF
11872
11873 fi
11874
11875 for ac_prog in xcurses-config
11876 do
11877   # Extract the first word of "$ac_prog", so it can be a program name with args.
11878 set dummy $ac_prog; ac_word=$2
11879 echo "$as_me:11879: checking for $ac_word" >&5
11880 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11881 if test "${ac_cv_path_XCURSES_CONFIG+set}" = set; then
11882   echo $ECHO_N "(cached) $ECHO_C" >&6
11883 else
11884   case $XCURSES_CONFIG in
11885   [\\/]* | ?:[\\/]*)
11886   ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a path.
11887   ;;
11888   *)
11889   ac_save_IFS=$IFS; IFS=$ac_path_separator
11890 ac_dummy="$PATH"
11891 for ac_dir in $ac_dummy; do
11892   IFS=$ac_save_IFS
11893   test -z "$ac_dir" && ac_dir=.
11894   if $as_executable_p "$ac_dir/$ac_word"; then
11895    ac_cv_path_XCURSES_CONFIG="$ac_dir/$ac_word"
11896    echo "$as_me:11896: found $ac_dir/$ac_word" >&5
11897    break
11898 fi
11899 done
11900
11901   ;;
11902 esac
11903 fi
11904 XCURSES_CONFIG=$ac_cv_path_XCURSES_CONFIG
11905
11906 if test -n "$XCURSES_CONFIG"; then
11907   echo "$as_me:11907: result: $XCURSES_CONFIG" >&5
11908 echo "${ECHO_T}$XCURSES_CONFIG" >&6
11909 else
11910   echo "$as_me:11910: result: no" >&5
11911 echo "${ECHO_T}no" >&6
11912 fi
11913
11914   test -n "$XCURSES_CONFIG" && break
11915 done
11916 test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none"
11917
11918 if test "$XCURSES_CONFIG" != none ; then
11919
11920 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
11921 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
11922
11923 cf_cv_lib_XCurses=yes
11924
11925 else
11926
11927 LDFLAGS="$LDFLAGS $X_LIBS"
11928
11929 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11930
11931 echo "${as_me:-configure}:11931: testing checking additions to CFLAGS ..." 1>&5
11932
11933 cf_check_cflags="$CFLAGS"
11934 cf_check_cppflags="$CPPFLAGS"
11935
11936 cf_fix_cppflags=no
11937 cf_new_cflags=
11938 cf_new_cppflags=
11939 cf_new_extra_cppflags=
11940
11941 for cf_add_cflags in $X_CFLAGS
11942 do
11943 case $cf_fix_cppflags in
11944 no)
11945         case $cf_add_cflags in #(vi
11946         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11947                 case $cf_add_cflags in
11948                 -D*)
11949                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11950
11951                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11952                                 && test -z "${cf_tst_cflags}" \
11953                                 && cf_fix_cppflags=yes
11954
11955                         if test $cf_fix_cppflags = yes ; then
11956                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11957                                 continue
11958                         elif test "${cf_tst_cflags}" = "\"'" ; then
11959                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11960                                 continue
11961                         fi
11962                         ;;
11963                 esac
11964                 case "$CPPFLAGS" in
11965                 *$cf_add_cflags) #(vi
11966                         ;;
11967                 *) #(vi
11968                         case $cf_add_cflags in #(vi
11969                         -D*)
11970                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11971
11972 CPPFLAGS=`echo "$CPPFLAGS" | \
11973         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11974                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11975
11976                                 ;;
11977                         esac
11978                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11979                         ;;
11980                 esac
11981                 ;;
11982         *)
11983                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11984                 ;;
11985         esac
11986         ;;
11987 yes)
11988         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11989
11990         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11991
11992         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11993                 && test -z "${cf_tst_cflags}" \
11994                 && cf_fix_cppflags=no
11995         ;;
11996 esac
11997 done
11998
11999 if test -n "$cf_new_cflags" ; then
12000         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12001
12002 echo "${as_me:-configure}:12002: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12003
12004         CFLAGS="$CFLAGS $cf_new_cflags"
12005 fi
12006
12007 if test -n "$cf_new_cppflags" ; then
12008         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12009
12010 echo "${as_me:-configure}:12010: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12011
12012         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12013 fi
12014
12015 if test -n "$cf_new_extra_cppflags" ; then
12016         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12017
12018 echo "${as_me:-configure}:12018: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12019
12020         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12021 fi
12022
12023 if test "$cf_check_cflags" != "$CFLAGS" ; then
12024 cat >conftest.$ac_ext <<_ACEOF
12025 #line 12025 "configure"
12026 #include "confdefs.h"
12027 #include <stdio.h>
12028 int
12029 main ()
12030 {
12031 printf("Hello world");
12032   ;
12033   return 0;
12034 }
12035 _ACEOF
12036 rm -f conftest.$ac_objext conftest$ac_exeext
12037 if { (eval echo "$as_me:12037: \"$ac_link\"") >&5
12038   (eval $ac_link) 2>&5
12039   ac_status=$?
12040   echo "$as_me:12040: \$? = $ac_status" >&5
12041   (exit $ac_status); } &&
12042          { ac_try='test -s conftest$ac_exeext'
12043   { (eval echo "$as_me:12043: \"$ac_try\"") >&5
12044   (eval $ac_try) 2>&5
12045   ac_status=$?
12046   echo "$as_me:12046: \$? = $ac_status" >&5
12047   (exit $ac_status); }; }; then
12048   :
12049 else
12050   echo "$as_me: failed program was:" >&5
12051 cat conftest.$ac_ext >&5
12052 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12053
12054 echo "${as_me:-configure}:12054: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12055
12056          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
12057                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12058
12059 echo "${as_me:-configure}:12059: testing but keeping change to \$CPPFLAGS ..." 1>&5
12060
12061          fi
12062          CFLAGS="$cf_check_flags"
12063 fi
12064 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12065 fi
12066
12067 echo "$as_me:12067: checking for XOpenDisplay in -lX11" >&5
12068 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12069 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12070   echo $ECHO_N "(cached) $ECHO_C" >&6
12071 else
12072   ac_check_lib_save_LIBS=$LIBS
12073 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12074 cat >conftest.$ac_ext <<_ACEOF
12075 #line 12075 "configure"
12076 #include "confdefs.h"
12077
12078 /* Override any gcc2 internal prototype to avoid an error.  */
12079 #ifdef __cplusplus
12080 extern "C"
12081 #endif
12082 /* We use char because int might match the return type of a gcc2
12083    builtin and then its argument prototype would still apply.  */
12084 char XOpenDisplay ();
12085 int
12086 main ()
12087 {
12088 XOpenDisplay ();
12089   ;
12090   return 0;
12091 }
12092 _ACEOF
12093 rm -f conftest.$ac_objext conftest$ac_exeext
12094 if { (eval echo "$as_me:12094: \"$ac_link\"") >&5
12095   (eval $ac_link) 2>&5
12096   ac_status=$?
12097   echo "$as_me:12097: \$? = $ac_status" >&5
12098   (exit $ac_status); } &&
12099          { ac_try='test -s conftest$ac_exeext'
12100   { (eval echo "$as_me:12100: \"$ac_try\"") >&5
12101   (eval $ac_try) 2>&5
12102   ac_status=$?
12103   echo "$as_me:12103: \$? = $ac_status" >&5
12104   (exit $ac_status); }; }; then
12105   ac_cv_lib_X11_XOpenDisplay=yes
12106 else
12107   echo "$as_me: failed program was:" >&5
12108 cat conftest.$ac_ext >&5
12109 ac_cv_lib_X11_XOpenDisplay=no
12110 fi
12111 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12112 LIBS=$ac_check_lib_save_LIBS
12113 fi
12114 echo "$as_me:12114: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12115 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12116 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12117   LIBS="-lX11 $LIBS"
12118 fi
12119
12120 echo "$as_me:12120: checking for XCurses library" >&5
12121 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
12122 if test "${cf_cv_lib_XCurses+set}" = set; then
12123   echo $ECHO_N "(cached) $ECHO_C" >&6
12124 else
12125
12126 LIBS="-lXCurses $LIBS"
12127 cat >conftest.$ac_ext <<_ACEOF
12128 #line 12128 "configure"
12129 #include "confdefs.h"
12130
12131 #include <xcurses.h>
12132 char *XCursesProgramName = "test";
12133
12134 int
12135 main ()
12136 {
12137 XCursesExit();
12138   ;
12139   return 0;
12140 }
12141 _ACEOF
12142 rm -f conftest.$ac_objext conftest$ac_exeext
12143 if { (eval echo "$as_me:12143: \"$ac_link\"") >&5
12144   (eval $ac_link) 2>&5
12145   ac_status=$?
12146   echo "$as_me:12146: \$? = $ac_status" >&5
12147   (exit $ac_status); } &&
12148          { ac_try='test -s conftest$ac_exeext'
12149   { (eval echo "$as_me:12149: \"$ac_try\"") >&5
12150   (eval $ac_try) 2>&5
12151   ac_status=$?
12152   echo "$as_me:12152: \$? = $ac_status" >&5
12153   (exit $ac_status); }; }; then
12154   cf_cv_lib_XCurses=yes
12155 else
12156   echo "$as_me: failed program was:" >&5
12157 cat conftest.$ac_ext >&5
12158 cf_cv_lib_XCurses=no
12159 fi
12160 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12161
12162 fi
12163 echo "$as_me:12163: result: $cf_cv_lib_XCurses" >&5
12164 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
12165
12166 fi
12167
12168 if test $cf_cv_lib_XCurses = yes ; then
12169         cat >>confdefs.h <<\EOF
12170 #define UNIX 1
12171 EOF
12172
12173         cat >>confdefs.h <<\EOF
12174 #define XCURSES 1
12175 EOF
12176
12177         echo "$as_me:12177: checking for xcurses.h" >&5
12178 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
12179 if test "${ac_cv_header_xcurses_h+set}" = set; then
12180   echo $ECHO_N "(cached) $ECHO_C" >&6
12181 else
12182   cat >conftest.$ac_ext <<_ACEOF
12183 #line 12183 "configure"
12184 #include "confdefs.h"
12185 #include <xcurses.h>
12186 _ACEOF
12187 if { (eval echo "$as_me:12187: \"$ac_cpp conftest.$ac_ext\"") >&5
12188   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12189   ac_status=$?
12190   egrep -v '^ *\+' conftest.er1 >conftest.err
12191   rm -f conftest.er1
12192   cat conftest.err >&5
12193   echo "$as_me:12193: \$? = $ac_status" >&5
12194   (exit $ac_status); } >/dev/null; then
12195   if test -s conftest.err; then
12196     ac_cpp_err=$ac_c_preproc_warn_flag
12197   else
12198     ac_cpp_err=
12199   fi
12200 else
12201   ac_cpp_err=yes
12202 fi
12203 if test -z "$ac_cpp_err"; then
12204   ac_cv_header_xcurses_h=yes
12205 else
12206   echo "$as_me: failed program was:" >&5
12207   cat conftest.$ac_ext >&5
12208   ac_cv_header_xcurses_h=no
12209 fi
12210 rm -f conftest.err conftest.$ac_ext
12211 fi
12212 echo "$as_me:12212: result: $ac_cv_header_xcurses_h" >&5
12213 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
12214 if test $ac_cv_header_xcurses_h = yes; then
12215   cat >>confdefs.h <<\EOF
12216 #define HAVE_XCURSES 1
12217 EOF
12218
12219 fi
12220
12221 else
12222         { { echo "$as_me:12222: error: Cannot link with XCurses" >&5
12223 echo "$as_me: error: Cannot link with XCurses" >&2;}
12224    { (exit 1); exit 1; }; }
12225 fi
12226
12227         ;;
12228 esac
12229
12230 case $cf_cv_screen in #(vi
12231 pdcurses) #(vi
12232         ;;
12233 *)
12234         # look for curses-related libraries
12235
12236 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
12237 echo "$as_me:12237: checking for new_panel in -lpanel$cf_cv_libtype" >&5
12238 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
12239 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12240   echo $ECHO_N "(cached) $ECHO_C" >&6
12241 else
12242   ac_check_lib_save_LIBS=$LIBS
12243 LIBS="-lpanel$cf_cv_libtype  $LIBS"
12244 cat >conftest.$ac_ext <<_ACEOF
12245 #line 12245 "configure"
12246 #include "confdefs.h"
12247
12248 /* Override any gcc2 internal prototype to avoid an error.  */
12249 #ifdef __cplusplus
12250 extern "C"
12251 #endif
12252 /* We use char because int might match the return type of a gcc2
12253    builtin and then its argument prototype would still apply.  */
12254 char new_panel ();
12255 int
12256 main ()
12257 {
12258 new_panel ();
12259   ;
12260   return 0;
12261 }
12262 _ACEOF
12263 rm -f conftest.$ac_objext conftest$ac_exeext
12264 if { (eval echo "$as_me:12264: \"$ac_link\"") >&5
12265   (eval $ac_link) 2>&5
12266   ac_status=$?
12267   echo "$as_me:12267: \$? = $ac_status" >&5
12268   (exit $ac_status); } &&
12269          { ac_try='test -s conftest$ac_exeext'
12270   { (eval echo "$as_me:12270: \"$ac_try\"") >&5
12271   (eval $ac_try) 2>&5
12272   ac_status=$?
12273   echo "$as_me:12273: \$? = $ac_status" >&5
12274   (exit $ac_status); }; }; then
12275   eval "$as_ac_Lib=yes"
12276 else
12277   echo "$as_me: failed program was:" >&5
12278 cat conftest.$ac_ext >&5
12279 eval "$as_ac_Lib=no"
12280 fi
12281 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12282 LIBS=$ac_check_lib_save_LIBS
12283 fi
12284 echo "$as_me:12284: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12285 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12286 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12287   cat >>confdefs.h <<EOF
12288 #define `echo "HAVE_LIBpanel$cf_cv_libtype" | $as_tr_cpp` 1
12289 EOF
12290
12291   LIBS="-lpanel$cf_cv_libtype $LIBS"
12292
12293 fi
12294
12295 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
12296 echo "$as_me:12296: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
12297 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
12298 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12299   echo $ECHO_N "(cached) $ECHO_C" >&6
12300 else
12301   ac_check_lib_save_LIBS=$LIBS
12302 LIBS="-lmenu$cf_cv_libtype  $LIBS"
12303 cat >conftest.$ac_ext <<_ACEOF
12304 #line 12304 "configure"
12305 #include "confdefs.h"
12306
12307 /* Override any gcc2 internal prototype to avoid an error.  */
12308 #ifdef __cplusplus
12309 extern "C"
12310 #endif
12311 /* We use char because int might match the return type of a gcc2
12312    builtin and then its argument prototype would still apply.  */
12313 char menu_driver ();
12314 int
12315 main ()
12316 {
12317 menu_driver ();
12318   ;
12319   return 0;
12320 }
12321 _ACEOF
12322 rm -f conftest.$ac_objext conftest$ac_exeext
12323 if { (eval echo "$as_me:12323: \"$ac_link\"") >&5
12324   (eval $ac_link) 2>&5
12325   ac_status=$?
12326   echo "$as_me:12326: \$? = $ac_status" >&5
12327   (exit $ac_status); } &&
12328          { ac_try='test -s conftest$ac_exeext'
12329   { (eval echo "$as_me:12329: \"$ac_try\"") >&5
12330   (eval $ac_try) 2>&5
12331   ac_status=$?
12332   echo "$as_me:12332: \$? = $ac_status" >&5
12333   (exit $ac_status); }; }; then
12334   eval "$as_ac_Lib=yes"
12335 else
12336   echo "$as_me: failed program was:" >&5
12337 cat conftest.$ac_ext >&5
12338 eval "$as_ac_Lib=no"
12339 fi
12340 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12341 LIBS=$ac_check_lib_save_LIBS
12342 fi
12343 echo "$as_me:12343: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12344 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12345 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12346   cat >>confdefs.h <<EOF
12347 #define `echo "HAVE_LIBmenu$cf_cv_libtype" | $as_tr_cpp` 1
12348 EOF
12349
12350   LIBS="-lmenu$cf_cv_libtype $LIBS"
12351
12352 fi
12353
12354 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
12355 echo "$as_me:12355: checking for form_driver in -lform$cf_cv_libtype" >&5
12356 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
12357 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12358   echo $ECHO_N "(cached) $ECHO_C" >&6
12359 else
12360   ac_check_lib_save_LIBS=$LIBS
12361 LIBS="-lform$cf_cv_libtype  $LIBS"
12362 cat >conftest.$ac_ext <<_ACEOF
12363 #line 12363 "configure"
12364 #include "confdefs.h"
12365
12366 /* Override any gcc2 internal prototype to avoid an error.  */
12367 #ifdef __cplusplus
12368 extern "C"
12369 #endif
12370 /* We use char because int might match the return type of a gcc2
12371    builtin and then its argument prototype would still apply.  */
12372 char form_driver ();
12373 int
12374 main ()
12375 {
12376 form_driver ();
12377   ;
12378   return 0;
12379 }
12380 _ACEOF
12381 rm -f conftest.$ac_objext conftest$ac_exeext
12382 if { (eval echo "$as_me:12382: \"$ac_link\"") >&5
12383   (eval $ac_link) 2>&5
12384   ac_status=$?
12385   echo "$as_me:12385: \$? = $ac_status" >&5
12386   (exit $ac_status); } &&
12387          { ac_try='test -s conftest$ac_exeext'
12388   { (eval echo "$as_me:12388: \"$ac_try\"") >&5
12389   (eval $ac_try) 2>&5
12390   ac_status=$?
12391   echo "$as_me:12391: \$? = $ac_status" >&5
12392   (exit $ac_status); }; }; then
12393   eval "$as_ac_Lib=yes"
12394 else
12395   echo "$as_me: failed program was:" >&5
12396 cat conftest.$ac_ext >&5
12397 eval "$as_ac_Lib=no"
12398 fi
12399 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12400 LIBS=$ac_check_lib_save_LIBS
12401 fi
12402 echo "$as_me:12402: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12403 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12404 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12405   cat >>confdefs.h <<EOF
12406 #define `echo "HAVE_LIBform$cf_cv_libtype" | $as_tr_cpp` 1
12407 EOF
12408
12409   LIBS="-lform$cf_cv_libtype $LIBS"
12410
12411 fi
12412
12413         # look for curses-related headers
12414
12415 for ac_header in \
12416                 nc_alloc.h \
12417                 nomacros.h \
12418                 form.h \
12419                 menu.h \
12420                 panel.h \
12421                 term_entry.h \
12422
12423 do
12424 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12425 echo "$as_me:12425: checking for $ac_header" >&5
12426 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12427 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12428   echo $ECHO_N "(cached) $ECHO_C" >&6
12429 else
12430   cat >conftest.$ac_ext <<_ACEOF
12431 #line 12431 "configure"
12432 #include "confdefs.h"
12433 #include <$ac_header>
12434 _ACEOF
12435 if { (eval echo "$as_me:12435: \"$ac_cpp conftest.$ac_ext\"") >&5
12436   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12437   ac_status=$?
12438   egrep -v '^ *\+' conftest.er1 >conftest.err
12439   rm -f conftest.er1
12440   cat conftest.err >&5
12441   echo "$as_me:12441: \$? = $ac_status" >&5
12442   (exit $ac_status); } >/dev/null; then
12443   if test -s conftest.err; then
12444     ac_cpp_err=$ac_c_preproc_warn_flag
12445   else
12446     ac_cpp_err=
12447   fi
12448 else
12449   ac_cpp_err=yes
12450 fi
12451 if test -z "$ac_cpp_err"; then
12452   eval "$as_ac_Header=yes"
12453 else
12454   echo "$as_me: failed program was:" >&5
12455   cat conftest.$ac_ext >&5
12456   eval "$as_ac_Header=no"
12457 fi
12458 rm -f conftest.err conftest.$ac_ext
12459 fi
12460 echo "$as_me:12460: result: `eval echo '${'$as_ac_Header'}'`" >&5
12461 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12462 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12463   cat >>confdefs.h <<EOF
12464 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12465 EOF
12466
12467 fi
12468 done
12469
12470         ;;
12471 esac
12472
12473 echo "$as_me:12473: checking return type of signal handlers" >&5
12474 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
12475 if test "${ac_cv_type_signal+set}" = set; then
12476   echo $ECHO_N "(cached) $ECHO_C" >&6
12477 else
12478   cat >conftest.$ac_ext <<_ACEOF
12479 #line 12479 "configure"
12480 #include "confdefs.h"
12481 #include <sys/types.h>
12482 #include <signal.h>
12483 #ifdef signal
12484 # undef signal
12485 #endif
12486 #ifdef __cplusplus
12487 extern "C" void (*signal (int, void (*)(int)))(int);
12488 #else
12489 void (*signal ()) ();
12490 #endif
12491
12492 int
12493 main ()
12494 {
12495 int i;
12496   ;
12497   return 0;
12498 }
12499 _ACEOF
12500 rm -f conftest.$ac_objext
12501 if { (eval echo "$as_me:12501: \"$ac_compile\"") >&5
12502   (eval $ac_compile) 2>&5
12503   ac_status=$?
12504   echo "$as_me:12504: \$? = $ac_status" >&5
12505   (exit $ac_status); } &&
12506          { ac_try='test -s conftest.$ac_objext'
12507   { (eval echo "$as_me:12507: \"$ac_try\"") >&5
12508   (eval $ac_try) 2>&5
12509   ac_status=$?
12510   echo "$as_me:12510: \$? = $ac_status" >&5
12511   (exit $ac_status); }; }; then
12512   ac_cv_type_signal=void
12513 else
12514   echo "$as_me: failed program was:" >&5
12515 cat conftest.$ac_ext >&5
12516 ac_cv_type_signal=int
12517 fi
12518 rm -f conftest.$ac_objext conftest.$ac_ext
12519 fi
12520 echo "$as_me:12520: result: $ac_cv_type_signal" >&5
12521 echo "${ECHO_T}$ac_cv_type_signal" >&6
12522
12523 cat >>confdefs.h <<EOF
12524 #define RETSIGTYPE $ac_cv_type_signal
12525 EOF
12526
12527 echo "$as_me:12527: checking for ANSI C header files" >&5
12528 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
12529 if test "${ac_cv_header_stdc+set}" = set; then
12530   echo $ECHO_N "(cached) $ECHO_C" >&6
12531 else
12532   cat >conftest.$ac_ext <<_ACEOF
12533 #line 12533 "configure"
12534 #include "confdefs.h"
12535 #include <stdlib.h>
12536 #include <stdarg.h>
12537 #include <string.h>
12538 #include <float.h>
12539
12540 _ACEOF
12541 if { (eval echo "$as_me:12541: \"$ac_cpp conftest.$ac_ext\"") >&5
12542   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12543   ac_status=$?
12544   egrep -v '^ *\+' conftest.er1 >conftest.err
12545   rm -f conftest.er1
12546   cat conftest.err >&5
12547   echo "$as_me:12547: \$? = $ac_status" >&5
12548   (exit $ac_status); } >/dev/null; then
12549   if test -s conftest.err; then
12550     ac_cpp_err=$ac_c_preproc_warn_flag
12551   else
12552     ac_cpp_err=
12553   fi
12554 else
12555   ac_cpp_err=yes
12556 fi
12557 if test -z "$ac_cpp_err"; then
12558   ac_cv_header_stdc=yes
12559 else
12560   echo "$as_me: failed program was:" >&5
12561   cat conftest.$ac_ext >&5
12562   ac_cv_header_stdc=no
12563 fi
12564 rm -f conftest.err conftest.$ac_ext
12565
12566 if test $ac_cv_header_stdc = yes; then
12567   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12568   cat >conftest.$ac_ext <<_ACEOF
12569 #line 12569 "configure"
12570 #include "confdefs.h"
12571 #include <string.h>
12572
12573 _ACEOF
12574 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12575   egrep "memchr" >/dev/null 2>&1; then
12576   :
12577 else
12578   ac_cv_header_stdc=no
12579 fi
12580 rm -rf conftest*
12581
12582 fi
12583
12584 if test $ac_cv_header_stdc = yes; then
12585   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12586   cat >conftest.$ac_ext <<_ACEOF
12587 #line 12587 "configure"
12588 #include "confdefs.h"
12589 #include <stdlib.h>
12590
12591 _ACEOF
12592 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12593   egrep "free" >/dev/null 2>&1; then
12594   :
12595 else
12596   ac_cv_header_stdc=no
12597 fi
12598 rm -rf conftest*
12599
12600 fi
12601
12602 if test $ac_cv_header_stdc = yes; then
12603   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12604   if test "$cross_compiling" = yes; then
12605   :
12606 else
12607   cat >conftest.$ac_ext <<_ACEOF
12608 #line 12608 "configure"
12609 #include "confdefs.h"
12610 #include <ctype.h>
12611 #if ((' ' & 0x0FF) == 0x020)
12612 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12613 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12614 #else
12615 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
12616                      || ('j' <= (c) && (c) <= 'r') \
12617                      || ('s' <= (c) && (c) <= 'z'))
12618 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
12619 #endif
12620
12621 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12622 int
12623 main ()
12624 {
12625   int i;
12626   for (i = 0; i < 256; i++)
12627     if (XOR (islower (i), ISLOWER (i))
12628         || toupper (i) != TOUPPER (i))
12629       $ac_main_return(2);
12630   $ac_main_return (0);
12631 }
12632 _ACEOF
12633 rm -f conftest$ac_exeext
12634 if { (eval echo "$as_me:12634: \"$ac_link\"") >&5
12635   (eval $ac_link) 2>&5
12636   ac_status=$?
12637   echo "$as_me:12637: \$? = $ac_status" >&5
12638   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12639   { (eval echo "$as_me:12639: \"$ac_try\"") >&5
12640   (eval $ac_try) 2>&5
12641   ac_status=$?
12642   echo "$as_me:12642: \$? = $ac_status" >&5
12643   (exit $ac_status); }; }; then
12644   :
12645 else
12646   echo "$as_me: program exited with status $ac_status" >&5
12647 echo "$as_me: failed program was:" >&5
12648 cat conftest.$ac_ext >&5
12649 ac_cv_header_stdc=no
12650 fi
12651 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12652 fi
12653 fi
12654 fi
12655 echo "$as_me:12655: result: $ac_cv_header_stdc" >&5
12656 echo "${ECHO_T}$ac_cv_header_stdc" >&6
12657 if test $ac_cv_header_stdc = yes; then
12658
12659 cat >>confdefs.h <<\EOF
12660 #define STDC_HEADERS 1
12661 EOF
12662
12663 fi
12664
12665 echo "$as_me:12665: checking whether time.h and sys/time.h may both be included" >&5
12666 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
12667 if test "${ac_cv_header_time+set}" = set; then
12668   echo $ECHO_N "(cached) $ECHO_C" >&6
12669 else
12670   cat >conftest.$ac_ext <<_ACEOF
12671 #line 12671 "configure"
12672 #include "confdefs.h"
12673 #include <sys/types.h>
12674 #include <sys/time.h>
12675 #include <time.h>
12676
12677 int
12678 main ()
12679 {
12680 if ((struct tm *) 0)
12681 return 0;
12682   ;
12683   return 0;
12684 }
12685 _ACEOF
12686 rm -f conftest.$ac_objext
12687 if { (eval echo "$as_me:12687: \"$ac_compile\"") >&5
12688   (eval $ac_compile) 2>&5
12689   ac_status=$?
12690   echo "$as_me:12690: \$? = $ac_status" >&5
12691   (exit $ac_status); } &&
12692          { ac_try='test -s conftest.$ac_objext'
12693   { (eval echo "$as_me:12693: \"$ac_try\"") >&5
12694   (eval $ac_try) 2>&5
12695   ac_status=$?
12696   echo "$as_me:12696: \$? = $ac_status" >&5
12697   (exit $ac_status); }; }; then
12698   ac_cv_header_time=yes
12699 else
12700   echo "$as_me: failed program was:" >&5
12701 cat conftest.$ac_ext >&5
12702 ac_cv_header_time=no
12703 fi
12704 rm -f conftest.$ac_objext conftest.$ac_ext
12705 fi
12706 echo "$as_me:12706: result: $ac_cv_header_time" >&5
12707 echo "${ECHO_T}$ac_cv_header_time" >&6
12708 if test $ac_cv_header_time = yes; then
12709
12710 cat >>confdefs.h <<\EOF
12711 #define TIME_WITH_SYS_TIME 1
12712 EOF
12713
12714 fi
12715
12716 for ac_header in \
12717 getopt.h \
12718 locale.h \
12719 stdarg.h \
12720 sys/ioctl.h \
12721 sys/select.h \
12722 sys/time.h \
12723 termios.h \
12724 unistd.h \
12725
12726 do
12727 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12728 echo "$as_me:12728: checking for $ac_header" >&5
12729 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12730 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12731   echo $ECHO_N "(cached) $ECHO_C" >&6
12732 else
12733   cat >conftest.$ac_ext <<_ACEOF
12734 #line 12734 "configure"
12735 #include "confdefs.h"
12736 #include <$ac_header>
12737 _ACEOF
12738 if { (eval echo "$as_me:12738: \"$ac_cpp conftest.$ac_ext\"") >&5
12739   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12740   ac_status=$?
12741   egrep -v '^ *\+' conftest.er1 >conftest.err
12742   rm -f conftest.er1
12743   cat conftest.err >&5
12744   echo "$as_me:12744: \$? = $ac_status" >&5
12745   (exit $ac_status); } >/dev/null; then
12746   if test -s conftest.err; then
12747     ac_cpp_err=$ac_c_preproc_warn_flag
12748   else
12749     ac_cpp_err=
12750   fi
12751 else
12752   ac_cpp_err=yes
12753 fi
12754 if test -z "$ac_cpp_err"; then
12755   eval "$as_ac_Header=yes"
12756 else
12757   echo "$as_me: failed program was:" >&5
12758   cat conftest.$ac_ext >&5
12759   eval "$as_ac_Header=no"
12760 fi
12761 rm -f conftest.err conftest.$ac_ext
12762 fi
12763 echo "$as_me:12763: result: `eval echo '${'$as_ac_Header'}'`" >&5
12764 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12765 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12766   cat >>confdefs.h <<EOF
12767 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12768 EOF
12769
12770 fi
12771 done
12772
12773 for ac_func in \
12774 gettimeofday \
12775 mblen \
12776 mbrlen \
12777 mbrtowc \
12778 mbsrtowcs \
12779 mbstowcs \
12780 mbtowc \
12781 strdup \
12782 wcsrtombs \
12783 wcstombs \
12784
12785 do
12786 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
12787 echo "$as_me:12787: checking for $ac_func" >&5
12788 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
12789 if eval "test \"\${$as_ac_var+set}\" = set"; then
12790   echo $ECHO_N "(cached) $ECHO_C" >&6
12791 else
12792   cat >conftest.$ac_ext <<_ACEOF
12793 #line 12793 "configure"
12794 #include "confdefs.h"
12795 /* System header to define __stub macros and hopefully few prototypes,
12796     which can conflict with char $ac_func (); below.  */
12797 #include <assert.h>
12798 /* Override any gcc2 internal prototype to avoid an error.  */
12799 #ifdef __cplusplus
12800 extern "C"
12801 #endif
12802 /* We use char because int might match the return type of a gcc2
12803    builtin and then its argument prototype would still apply.  */
12804 char $ac_func ();
12805 char (*f) ();
12806
12807 int
12808 main ()
12809 {
12810 /* The GNU C library defines this for functions which it implements
12811     to always fail with ENOSYS.  Some functions are actually named
12812     something starting with __ and the normal name is an alias.  */
12813 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12814 choke me
12815 #else
12816 f = $ac_func;
12817 #endif
12818
12819   ;
12820   return 0;
12821 }
12822 _ACEOF
12823 rm -f conftest.$ac_objext conftest$ac_exeext
12824 if { (eval echo "$as_me:12824: \"$ac_link\"") >&5
12825   (eval $ac_link) 2>&5
12826   ac_status=$?
12827   echo "$as_me:12827: \$? = $ac_status" >&5
12828   (exit $ac_status); } &&
12829          { ac_try='test -s conftest$ac_exeext'
12830   { (eval echo "$as_me:12830: \"$ac_try\"") >&5
12831   (eval $ac_try) 2>&5
12832   ac_status=$?
12833   echo "$as_me:12833: \$? = $ac_status" >&5
12834   (exit $ac_status); }; }; then
12835   eval "$as_ac_var=yes"
12836 else
12837   echo "$as_me: failed program was:" >&5
12838 cat conftest.$ac_ext >&5
12839 eval "$as_ac_var=no"
12840 fi
12841 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12842 fi
12843 echo "$as_me:12843: result: `eval echo '${'$as_ac_var'}'`" >&5
12844 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
12845 if test `eval echo '${'$as_ac_var'}'` = yes; then
12846   cat >>confdefs.h <<EOF
12847 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
12848 EOF
12849
12850 fi
12851 done
12852
12853 echo "$as_me:12853: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
12854 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
12855 if test "${cf_cv_need_xopen_extension+set}" = set; then
12856   echo $ECHO_N "(cached) $ECHO_C" >&6
12857 else
12858
12859 cat >conftest.$ac_ext <<_ACEOF
12860 #line 12860 "configure"
12861 #include "confdefs.h"
12862
12863 #include <stdlib.h>
12864 #include <${cf_cv_ncurses_header:-curses.h}>
12865 int
12866 main ()
12867 {
12868
12869 #if defined(NCURSES_VERSION_PATCH)
12870 if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
12871         make an error
12872 #endif
12873 #endif
12874         long x = winnstr(stdscr, "", 0);
12875         int x1, y1;
12876         getbegyx(stdscr, y1, x1)
12877   ;
12878   return 0;
12879 }
12880 _ACEOF
12881 rm -f conftest.$ac_objext conftest$ac_exeext
12882 if { (eval echo "$as_me:12882: \"$ac_link\"") >&5
12883   (eval $ac_link) 2>&5
12884   ac_status=$?
12885   echo "$as_me:12885: \$? = $ac_status" >&5
12886   (exit $ac_status); } &&
12887          { ac_try='test -s conftest$ac_exeext'
12888   { (eval echo "$as_me:12888: \"$ac_try\"") >&5
12889   (eval $ac_try) 2>&5
12890   ac_status=$?
12891   echo "$as_me:12891: \$? = $ac_status" >&5
12892   (exit $ac_status); }; }; then
12893   cf_cv_need_xopen_extension=no
12894 else
12895   echo "$as_me: failed program was:" >&5
12896 cat conftest.$ac_ext >&5
12897 cat >conftest.$ac_ext <<_ACEOF
12898 #line 12898 "configure"
12899 #include "confdefs.h"
12900
12901 #define _XOPEN_SOURCE_EXTENDED
12902 #include <stdlib.h>
12903 #include <${cf_cv_ncurses_header:-curses.h}>
12904 int
12905 main ()
12906 {
12907
12908 #ifdef NCURSES_VERSION
12909         cchar_t check;
12910         int check2 = curs_set((int)sizeof(check));
12911 #endif
12912         long x = winnstr(stdscr, "", 0);
12913         int x1, y1;
12914         getbegyx(stdscr, y1, x1)
12915   ;
12916   return 0;
12917 }
12918 _ACEOF
12919 rm -f conftest.$ac_objext conftest$ac_exeext
12920 if { (eval echo "$as_me:12920: \"$ac_link\"") >&5
12921   (eval $ac_link) 2>&5
12922   ac_status=$?
12923   echo "$as_me:12923: \$? = $ac_status" >&5
12924   (exit $ac_status); } &&
12925          { ac_try='test -s conftest$ac_exeext'
12926   { (eval echo "$as_me:12926: \"$ac_try\"") >&5
12927   (eval $ac_try) 2>&5
12928   ac_status=$?
12929   echo "$as_me:12929: \$? = $ac_status" >&5
12930   (exit $ac_status); }; }; then
12931   cf_cv_need_xopen_extension=yes
12932 else
12933   echo "$as_me: failed program was:" >&5
12934 cat conftest.$ac_ext >&5
12935 cf_cv_need_xopen_extension=unknown
12936 fi
12937 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12938 fi
12939 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12940 fi
12941 echo "$as_me:12941: result: $cf_cv_need_xopen_extension" >&5
12942 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
12943 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
12944
12945 echo "$as_me:12945: checking for term.h" >&5
12946 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
12947 if test "${cf_cv_term_header+set}" = set; then
12948   echo $ECHO_N "(cached) $ECHO_C" >&6
12949 else
12950
12951 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
12952 # for <term.h> if we do not find the variant.
12953 for cf_header in \
12954         `echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%/.*%/%'`term.h \
12955         term.h
12956 do
12957         cat >conftest.$ac_ext <<_ACEOF
12958 #line 12958 "configure"
12959 #include "confdefs.h"
12960
12961 #include <${cf_cv_ncurses_header:-curses.h}>
12962 #include <${cf_header}>
12963 int
12964 main ()
12965 {
12966 WINDOW *x
12967   ;
12968   return 0;
12969 }
12970 _ACEOF
12971 rm -f conftest.$ac_objext
12972 if { (eval echo "$as_me:12972: \"$ac_compile\"") >&5
12973   (eval $ac_compile) 2>&5
12974   ac_status=$?
12975   echo "$as_me:12975: \$? = $ac_status" >&5
12976   (exit $ac_status); } &&
12977          { ac_try='test -s conftest.$ac_objext'
12978   { (eval echo "$as_me:12978: \"$ac_try\"") >&5
12979   (eval $ac_try) 2>&5
12980   ac_status=$?
12981   echo "$as_me:12981: \$? = $ac_status" >&5
12982   (exit $ac_status); }; }; then
12983   cf_cv_term_header=$cf_header
12984          break
12985 else
12986   echo "$as_me: failed program was:" >&5
12987 cat conftest.$ac_ext >&5
12988 cf_cv_term_header=no
12989 fi
12990 rm -f conftest.$ac_objext conftest.$ac_ext
12991 done
12992
12993 case $cf_cv_term_header in #(vi
12994 no)
12995         # If curses is ncurses, some packagers still mess it up by trying to make
12996         # us use GNU termcap.  This handles the most common case.
12997         for cf_header in ncurses/term.h ncursesw/term.h
12998         do
12999                 cat >conftest.$ac_ext <<_ACEOF
13000 #line 13000 "configure"
13001 #include "confdefs.h"
13002
13003 #include <${cf_cv_ncurses_header:-curses.h}>
13004 #ifdef NCURSES_VERSION
13005 #include <${cf_header}>
13006 #else
13007 make an error
13008 #endif
13009 int
13010 main ()
13011 {
13012 WINDOW *x
13013   ;
13014   return 0;
13015 }
13016 _ACEOF
13017 rm -f conftest.$ac_objext
13018 if { (eval echo "$as_me:13018: \"$ac_compile\"") >&5
13019   (eval $ac_compile) 2>&5
13020   ac_status=$?
13021   echo "$as_me:13021: \$? = $ac_status" >&5
13022   (exit $ac_status); } &&
13023          { ac_try='test -s conftest.$ac_objext'
13024   { (eval echo "$as_me:13024: \"$ac_try\"") >&5
13025   (eval $ac_try) 2>&5
13026   ac_status=$?
13027   echo "$as_me:13027: \$? = $ac_status" >&5
13028   (exit $ac_status); }; }; then
13029   cf_cv_term_header=$cf_header
13030                          break
13031 else
13032   echo "$as_me: failed program was:" >&5
13033 cat conftest.$ac_ext >&5
13034 cf_cv_term_header=no
13035 fi
13036 rm -f conftest.$ac_objext conftest.$ac_ext
13037         done
13038         ;;
13039 esac
13040
13041 fi
13042 echo "$as_me:13042: result: $cf_cv_term_header" >&5
13043 echo "${ECHO_T}$cf_cv_term_header" >&6
13044
13045 case $cf_cv_term_header in #(vi
13046 term.h) #(vi
13047         cat >>confdefs.h <<\EOF
13048 #define HAVE_TERM_H 1
13049 EOF
13050
13051         ;;
13052 ncurses/term.h) #(vi
13053         cat >>confdefs.h <<\EOF
13054 #define HAVE_NCURSES_TERM_H 1
13055 EOF
13056
13057         ;;
13058 ncursesw/term.h)
13059         cat >>confdefs.h <<\EOF
13060 #define HAVE_NCURSESW_TERM_H 1
13061 EOF
13062
13063         ;;
13064 esac
13065
13066 for cf_func in \
13067 chgat \
13068 color_set \
13069 filter \
13070 getbegx \
13071 getcurx \
13072 getmaxx \
13073 getnstr \
13074 getparx \
13075 getwin \
13076 mvvline \
13077 mvwvline \
13078 napms \
13079 putwin \
13080 resize_term \
13081 resizeterm \
13082 ripoffline \
13083 scr_dump \
13084 setupterm \
13085 slk_color \
13086 slk_init \
13087 termattrs \
13088 tgetent \
13089 tigetnum \
13090 tigetstr \
13091 typeahead \
13092 use_default_colors \
13093 vw_printw \
13094 vsscanf \
13095 wchgat \
13096 winsstr \
13097 wresize \
13098 wsyncdown \
13099
13100 do
13101
13102 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13103
13104         echo "$as_me:13104: checking for ${cf_func}" >&5
13105 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
13106
13107 echo "${as_me:-configure}:13107: testing ${cf_func} ..." 1>&5
13108
13109         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
13110   echo $ECHO_N "(cached) $ECHO_C" >&6
13111 else
13112
13113                 eval cf_result='$ac_cv_func_'$cf_func
13114                 if test ".$cf_result" != ".no"; then
13115                         cat >conftest.$ac_ext <<_ACEOF
13116 #line 13116 "configure"
13117 #include "confdefs.h"
13118
13119 #ifdef HAVE_XCURSES
13120 #include <xcurses.h>
13121 char * XCursesProgramName = "test";
13122 #else
13123 #include <${cf_cv_ncurses_header:-curses.h}>
13124 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13125 #include <ncursesw/term.h>
13126 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13127 #include <ncurses/term.h>
13128 #elif defined(HAVE_TERM_H)
13129 #include <term.h>
13130 #endif
13131 #endif
13132
13133 int
13134 main ()
13135 {
13136
13137 #ifndef ${cf_func}
13138 long foo = (long)(&${cf_func});
13139 ${cf_cv_main_return:-return}(foo == 0);
13140 #endif
13141
13142   ;
13143   return 0;
13144 }
13145 _ACEOF
13146 rm -f conftest.$ac_objext conftest$ac_exeext
13147 if { (eval echo "$as_me:13147: \"$ac_link\"") >&5
13148   (eval $ac_link) 2>&5
13149   ac_status=$?
13150   echo "$as_me:13150: \$? = $ac_status" >&5
13151   (exit $ac_status); } &&
13152          { ac_try='test -s conftest$ac_exeext'
13153   { (eval echo "$as_me:13153: \"$ac_try\"") >&5
13154   (eval $ac_try) 2>&5
13155   ac_status=$?
13156   echo "$as_me:13156: \$? = $ac_status" >&5
13157   (exit $ac_status); }; }; then
13158   cf_result=yes
13159 else
13160   echo "$as_me: failed program was:" >&5
13161 cat conftest.$ac_ext >&5
13162 cf_result=no
13163 fi
13164 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13165                 fi
13166                 eval 'cf_cv_func_'$cf_func'=$cf_result'
13167
13168 fi
13169
13170         # use the computed/retrieved cache-value:
13171         eval 'cf_result=$cf_cv_func_'$cf_func
13172         echo "$as_me:13172: result: $cf_result" >&5
13173 echo "${ECHO_T}$cf_result" >&6
13174         if test $cf_result != no; then
13175                 cat >>confdefs.h <<EOF
13176 #define HAVE_${cf_tr_func} 1
13177 EOF
13178
13179         fi
13180 done
13181
13182 echo "$as_me:13182: checking for ncurses extended functions" >&5
13183 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
13184 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
13185   echo $ECHO_N "(cached) $ECHO_C" >&6
13186 else
13187
13188 cat >conftest.$ac_ext <<_ACEOF
13189 #line 13189 "configure"
13190 #include "confdefs.h"
13191
13192 #include <${cf_cv_ncurses_header:-curses.h}>
13193 int
13194 main ()
13195 {
13196
13197 int x = NCURSES_EXT_FUNCS
13198
13199   ;
13200   return 0;
13201 }
13202 _ACEOF
13203 rm -f conftest.$ac_objext
13204 if { (eval echo "$as_me:13204: \"$ac_compile\"") >&5
13205   (eval $ac_compile) 2>&5
13206   ac_status=$?
13207   echo "$as_me:13207: \$? = $ac_status" >&5
13208   (exit $ac_status); } &&
13209          { ac_try='test -s conftest.$ac_objext'
13210   { (eval echo "$as_me:13210: \"$ac_try\"") >&5
13211   (eval $ac_try) 2>&5
13212   ac_status=$?
13213   echo "$as_me:13213: \$? = $ac_status" >&5
13214   (exit $ac_status); }; }; then
13215   cf_cv_ncurses_ext_funcs=defined
13216 else
13217   echo "$as_me: failed program was:" >&5
13218 cat conftest.$ac_ext >&5
13219
13220 cat >conftest.$ac_ext <<_ACEOF
13221 #line 13221 "configure"
13222 #include "confdefs.h"
13223
13224 #include <${cf_cv_ncurses_header:-curses.h}>
13225 int
13226 main ()
13227 {
13228
13229         (void) assume_default_colors (0, 0);
13230         (void) curses_version ();
13231         (void) define_key (0, 0);
13232         (void) is_term_resized (0, 0);
13233         (void) key_defined (0);
13234         (void) keybound (0, 0);
13235         (void) keyok (0, 0);
13236         (void) resize_term (0, 0);
13237         (void) resizeterm (0, 0);
13238         (void) use_default_colors ();
13239         (void) use_extended_names (0);
13240         (void) wresize (0, 0, 0);
13241   ;
13242   return 0;
13243 }
13244 _ACEOF
13245 rm -f conftest.$ac_objext conftest$ac_exeext
13246 if { (eval echo "$as_me:13246: \"$ac_link\"") >&5
13247   (eval $ac_link) 2>&5
13248   ac_status=$?
13249   echo "$as_me:13249: \$? = $ac_status" >&5
13250   (exit $ac_status); } &&
13251          { ac_try='test -s conftest$ac_exeext'
13252   { (eval echo "$as_me:13252: \"$ac_try\"") >&5
13253   (eval $ac_try) 2>&5
13254   ac_status=$?
13255   echo "$as_me:13255: \$? = $ac_status" >&5
13256   (exit $ac_status); }; }; then
13257   cf_cv_ncurses_ext_funcs=yes
13258 else
13259   echo "$as_me: failed program was:" >&5
13260 cat conftest.$ac_ext >&5
13261 cf_cv_ncurses_ext_funcs=no
13262 fi
13263 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13264
13265 fi
13266 rm -f conftest.$ac_objext conftest.$ac_ext
13267
13268 fi
13269 echo "$as_me:13269: result: $cf_cv_ncurses_ext_funcs" >&5
13270 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
13271 test "$cf_cv_ncurses_ext_funcs" = yes && cat >>confdefs.h <<\EOF
13272 #define NCURSES_EXT_FUNCS 1
13273 EOF
13274
13275 echo "$as_me:13275: checking for wide-character functions" >&5
13276 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
13277 if test "${cf_cv_widechar_funcs+set}" = set; then
13278   echo $ECHO_N "(cached) $ECHO_C" >&6
13279 else
13280
13281 cat >conftest.$ac_ext <<_ACEOF
13282 #line 13282 "configure"
13283 #include "confdefs.h"
13284
13285 #include <${cf_cv_ncurses_header:-curses.h}>
13286 int
13287 main ()
13288 {
13289
13290         static wchar_t src_wchar[2];
13291         static cchar_t dst_cchar;
13292         setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
13293
13294   ;
13295   return 0;
13296 }
13297 _ACEOF
13298 rm -f conftest.$ac_objext conftest$ac_exeext
13299 if { (eval echo "$as_me:13299: \"$ac_link\"") >&5
13300   (eval $ac_link) 2>&5
13301   ac_status=$?
13302   echo "$as_me:13302: \$? = $ac_status" >&5
13303   (exit $ac_status); } &&
13304          { ac_try='test -s conftest$ac_exeext'
13305   { (eval echo "$as_me:13305: \"$ac_try\"") >&5
13306   (eval $ac_try) 2>&5
13307   ac_status=$?
13308   echo "$as_me:13308: \$? = $ac_status" >&5
13309   (exit $ac_status); }; }; then
13310   cf_cv_widechar_funcs=yes
13311 else
13312   echo "$as_me: failed program was:" >&5
13313 cat conftest.$ac_ext >&5
13314 cf_cv_widechar_funcs=no
13315 fi
13316 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13317
13318 fi
13319 echo "$as_me:13319: result: $cf_cv_widechar_funcs" >&5
13320 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
13321 if test "$cf_cv_widechar_funcs" != no ; then
13322         cat >>confdefs.h <<\EOF
13323 #define USE_WIDEC_SUPPORT 1
13324 EOF
13325
13326 else
13327         cat >>confdefs.h <<\EOF
13328 #define USE_WIDEC_SUPPORT 0
13329 EOF
13330
13331 fi
13332
13333 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
13334
13335 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
13336                   inttypes.h stdint.h unistd.h
13337 do
13338 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13339 echo "$as_me:13339: checking for $ac_header" >&5
13340 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13341 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13342   echo $ECHO_N "(cached) $ECHO_C" >&6
13343 else
13344   cat >conftest.$ac_ext <<_ACEOF
13345 #line 13345 "configure"
13346 #include "confdefs.h"
13347 $ac_includes_default
13348 #include <$ac_header>
13349 _ACEOF
13350 rm -f conftest.$ac_objext
13351 if { (eval echo "$as_me:13351: \"$ac_compile\"") >&5
13352   (eval $ac_compile) 2>&5
13353   ac_status=$?
13354   echo "$as_me:13354: \$? = $ac_status" >&5
13355   (exit $ac_status); } &&
13356          { ac_try='test -s conftest.$ac_objext'
13357   { (eval echo "$as_me:13357: \"$ac_try\"") >&5
13358   (eval $ac_try) 2>&5
13359   ac_status=$?
13360   echo "$as_me:13360: \$? = $ac_status" >&5
13361   (exit $ac_status); }; }; then
13362   eval "$as_ac_Header=yes"
13363 else
13364   echo "$as_me: failed program was:" >&5
13365 cat conftest.$ac_ext >&5
13366 eval "$as_ac_Header=no"
13367 fi
13368 rm -f conftest.$ac_objext conftest.$ac_ext
13369 fi
13370 echo "$as_me:13370: result: `eval echo '${'$as_ac_Header'}'`" >&5
13371 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13372 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13373   cat >>confdefs.h <<EOF
13374 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13375 EOF
13376
13377 fi
13378 done
13379
13380 echo "$as_me:13380: checking for pid_t" >&5
13381 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
13382 if test "${ac_cv_type_pid_t+set}" = set; then
13383   echo $ECHO_N "(cached) $ECHO_C" >&6
13384 else
13385   cat >conftest.$ac_ext <<_ACEOF
13386 #line 13386 "configure"
13387 #include "confdefs.h"
13388 $ac_includes_default
13389 int
13390 main ()
13391 {
13392 if ((pid_t *) 0)
13393   return 0;
13394 if (sizeof (pid_t))
13395   return 0;
13396   ;
13397   return 0;
13398 }
13399 _ACEOF
13400 rm -f conftest.$ac_objext
13401 if { (eval echo "$as_me:13401: \"$ac_compile\"") >&5
13402   (eval $ac_compile) 2>&5
13403   ac_status=$?
13404   echo "$as_me:13404: \$? = $ac_status" >&5
13405   (exit $ac_status); } &&
13406          { ac_try='test -s conftest.$ac_objext'
13407   { (eval echo "$as_me:13407: \"$ac_try\"") >&5
13408   (eval $ac_try) 2>&5
13409   ac_status=$?
13410   echo "$as_me:13410: \$? = $ac_status" >&5
13411   (exit $ac_status); }; }; then
13412   ac_cv_type_pid_t=yes
13413 else
13414   echo "$as_me: failed program was:" >&5
13415 cat conftest.$ac_ext >&5
13416 ac_cv_type_pid_t=no
13417 fi
13418 rm -f conftest.$ac_objext conftest.$ac_ext
13419 fi
13420 echo "$as_me:13420: result: $ac_cv_type_pid_t" >&5
13421 echo "${ECHO_T}$ac_cv_type_pid_t" >&6
13422 if test $ac_cv_type_pid_t = yes; then
13423   :
13424 else
13425
13426 cat >>confdefs.h <<EOF
13427 #define pid_t int
13428 EOF
13429
13430 fi
13431
13432 for ac_header in unistd.h vfork.h
13433 do
13434 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13435 echo "$as_me:13435: checking for $ac_header" >&5
13436 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13437 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13438   echo $ECHO_N "(cached) $ECHO_C" >&6
13439 else
13440   cat >conftest.$ac_ext <<_ACEOF
13441 #line 13441 "configure"
13442 #include "confdefs.h"
13443 #include <$ac_header>
13444 _ACEOF
13445 if { (eval echo "$as_me:13445: \"$ac_cpp conftest.$ac_ext\"") >&5
13446   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13447   ac_status=$?
13448   egrep -v '^ *\+' conftest.er1 >conftest.err
13449   rm -f conftest.er1
13450   cat conftest.err >&5
13451   echo "$as_me:13451: \$? = $ac_status" >&5
13452   (exit $ac_status); } >/dev/null; then
13453   if test -s conftest.err; then
13454     ac_cpp_err=$ac_c_preproc_warn_flag
13455   else
13456     ac_cpp_err=
13457   fi
13458 else
13459   ac_cpp_err=yes
13460 fi
13461 if test -z "$ac_cpp_err"; then
13462   eval "$as_ac_Header=yes"
13463 else
13464   echo "$as_me: failed program was:" >&5
13465   cat conftest.$ac_ext >&5
13466   eval "$as_ac_Header=no"
13467 fi
13468 rm -f conftest.err conftest.$ac_ext
13469 fi
13470 echo "$as_me:13470: result: `eval echo '${'$as_ac_Header'}'`" >&5
13471 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13472 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13473   cat >>confdefs.h <<EOF
13474 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13475 EOF
13476
13477 fi
13478 done
13479
13480 for ac_func in fork vfork
13481 do
13482 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13483 echo "$as_me:13483: checking for $ac_func" >&5
13484 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13485 if eval "test \"\${$as_ac_var+set}\" = set"; then
13486   echo $ECHO_N "(cached) $ECHO_C" >&6
13487 else
13488   cat >conftest.$ac_ext <<_ACEOF
13489 #line 13489 "configure"
13490 #include "confdefs.h"
13491 /* System header to define __stub macros and hopefully few prototypes,
13492     which can conflict with char $ac_func (); below.  */
13493 #include <assert.h>
13494 /* Override any gcc2 internal prototype to avoid an error.  */
13495 #ifdef __cplusplus
13496 extern "C"
13497 #endif
13498 /* We use char because int might match the return type of a gcc2
13499    builtin and then its argument prototype would still apply.  */
13500 char $ac_func ();
13501 char (*f) ();
13502
13503 int
13504 main ()
13505 {
13506 /* The GNU C library defines this for functions which it implements
13507     to always fail with ENOSYS.  Some functions are actually named
13508     something starting with __ and the normal name is an alias.  */
13509 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13510 choke me
13511 #else
13512 f = $ac_func;
13513 #endif
13514
13515   ;
13516   return 0;
13517 }
13518 _ACEOF
13519 rm -f conftest.$ac_objext conftest$ac_exeext
13520 if { (eval echo "$as_me:13520: \"$ac_link\"") >&5
13521   (eval $ac_link) 2>&5
13522   ac_status=$?
13523   echo "$as_me:13523: \$? = $ac_status" >&5
13524   (exit $ac_status); } &&
13525          { ac_try='test -s conftest$ac_exeext'
13526   { (eval echo "$as_me:13526: \"$ac_try\"") >&5
13527   (eval $ac_try) 2>&5
13528   ac_status=$?
13529   echo "$as_me:13529: \$? = $ac_status" >&5
13530   (exit $ac_status); }; }; then
13531   eval "$as_ac_var=yes"
13532 else
13533   echo "$as_me: failed program was:" >&5
13534 cat conftest.$ac_ext >&5
13535 eval "$as_ac_var=no"
13536 fi
13537 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13538 fi
13539 echo "$as_me:13539: result: `eval echo '${'$as_ac_var'}'`" >&5
13540 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13541 if test `eval echo '${'$as_ac_var'}'` = yes; then
13542   cat >>confdefs.h <<EOF
13543 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13544 EOF
13545
13546 fi
13547 done
13548
13549 ac_cv_func_fork_works=$ac_cv_func_fork
13550 if test "x$ac_cv_func_fork" = xyes; then
13551   echo "$as_me:13551: checking for working fork" >&5
13552 echo $ECHO_N "checking for working fork... $ECHO_C" >&6
13553 if test "${ac_cv_func_fork_works+set}" = set; then
13554   echo $ECHO_N "(cached) $ECHO_C" >&6
13555 else
13556   if test "$cross_compiling" = yes; then
13557   ac_cv_func_fork_works=cross
13558 else
13559   cat >conftest.$ac_ext <<_ACEOF
13560 /* By Rüdiger Kuhlmann. */
13561       #include <sys/types.h>
13562       #if HAVE_UNISTD_H
13563       # include <unistd.h>
13564       #endif
13565       /* Some systems only have a dummy stub for fork() */
13566       int main ()
13567       {
13568         if (fork() < 0)
13569           $ac_main_return (1);
13570         $ac_main_return (0);
13571       }
13572 _ACEOF
13573 rm -f conftest$ac_exeext
13574 if { (eval echo "$as_me:13574: \"$ac_link\"") >&5
13575   (eval $ac_link) 2>&5
13576   ac_status=$?
13577   echo "$as_me:13577: \$? = $ac_status" >&5
13578   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13579   { (eval echo "$as_me:13579: \"$ac_try\"") >&5
13580   (eval $ac_try) 2>&5
13581   ac_status=$?
13582   echo "$as_me:13582: \$? = $ac_status" >&5
13583   (exit $ac_status); }; }; then
13584   ac_cv_func_fork_works=yes
13585 else
13586   echo "$as_me: program exited with status $ac_status" >&5
13587 echo "$as_me: failed program was:" >&5
13588 cat conftest.$ac_ext >&5
13589 ac_cv_func_fork_works=no
13590 fi
13591 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13592 fi
13593 fi
13594 echo "$as_me:13594: result: $ac_cv_func_fork_works" >&5
13595 echo "${ECHO_T}$ac_cv_func_fork_works" >&6
13596
13597 fi
13598 if test "x$ac_cv_func_fork_works" = xcross; then
13599   case $host in
13600     *-*-amigaos* | *-*-msdosdjgpp*)
13601       # Override, as these systems have only a dummy fork() stub
13602       ac_cv_func_fork_works=no
13603       ;;
13604     *)
13605       ac_cv_func_fork_works=yes
13606       ;;
13607   esac
13608   { echo "$as_me:13608: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&5
13609 echo "$as_me: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&2;}
13610 fi
13611 ac_cv_func_vfork_works=$ac_cv_func_vfork
13612 if test "x$ac_cv_func_vfork" = xyes; then
13613   echo "$as_me:13613: checking for working vfork" >&5
13614 echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
13615 if test "${ac_cv_func_vfork_works+set}" = set; then
13616   echo $ECHO_N "(cached) $ECHO_C" >&6
13617 else
13618   if test "$cross_compiling" = yes; then
13619   ac_cv_func_vfork_works=cross
13620 else
13621   cat >conftest.$ac_ext <<_ACEOF
13622 #line 13622 "configure"
13623 #include "confdefs.h"
13624 /* Thanks to Paul Eggert for this test.  */
13625 #include <stdio.h>
13626 #include <sys/types.h>
13627 #include <sys/stat.h>
13628 #if HAVE_UNISTD_H
13629 # include <unistd.h>
13630 #endif
13631 #if HAVE_VFORK_H
13632 # include <vfork.h>
13633 #endif
13634 /* On some sparc systems, changes by the child to local and incoming
13635    argument registers are propagated back to the parent.  The compiler
13636    is told about this with #include <vfork.h>, but some compilers
13637    (e.g. gcc -O) don't grok <vfork.h>.  Test for this by using a
13638    static variable whose address is put into a register that is
13639    clobbered by the vfork.  */
13640 static
13641 #ifdef __cplusplus
13642 sparc_address_test (int arg)
13643 # else
13644 sparc_address_test (arg) int arg;
13645 #endif
13646 {
13647   static pid_t child;
13648   if (!child) {
13649     child = vfork ();
13650     if (child < 0) {
13651       perror ("vfork");
13652       _exit(2);
13653     }
13654     if (!child) {
13655       arg = getpid();
13656       write(-1, "", 0);
13657       _exit (arg);
13658     }
13659   }
13660 }
13661
13662 int
13663 main ()
13664 {
13665   pid_t parent = getpid ();
13666   pid_t child;
13667
13668   sparc_address_test ();
13669
13670   child = vfork ();
13671
13672   if (child == 0) {
13673     /* Here is another test for sparc vfork register problems.  This
13674        test uses lots of local variables, at least as many local
13675        variables as main has allocated so far including compiler
13676        temporaries.  4 locals are enough for gcc 1.40.3 on a Solaris
13677        4.1.3 sparc, but we use 8 to be safe.  A buggy compiler should
13678        reuse the register of parent for one of the local variables,
13679        since it will think that parent can't possibly be used any more
13680        in this routine.  Assigning to the local variable will thus
13681        munge parent in the parent process.  */
13682     pid_t
13683       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
13684       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
13685     /* Convince the compiler that p..p7 are live; otherwise, it might
13686        use the same hardware register for all 8 local variables.  */
13687     if (p != p1 || p != p2 || p != p3 || p != p4
13688         || p != p5 || p != p6 || p != p7)
13689       _exit(1);
13690
13691     /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
13692        from child file descriptors.  If the child closes a descriptor
13693        before it execs or exits, this munges the parent's descriptor
13694        as well.  Test for this by closing stdout in the child.  */
13695     _exit(close(fileno(stdout)) != 0);
13696   } else {
13697     int status;
13698     struct stat st;
13699
13700     while (wait(&status) != child)
13701       ;
13702     $ac_main_return(
13703          /* Was there some problem with vforking?  */
13704          child < 0
13705
13706          /* Did the child fail?  (This shouldn't happen.)  */
13707          || status
13708
13709          /* Did the vfork/compiler bug occur?  */
13710          || parent != getpid()
13711
13712          /* Did the file descriptor bug occur?  */
13713          || fstat(fileno(stdout), &st) != 0
13714          );
13715   }
13716 }
13717 _ACEOF
13718 rm -f conftest$ac_exeext
13719 if { (eval echo "$as_me:13719: \"$ac_link\"") >&5
13720   (eval $ac_link) 2>&5
13721   ac_status=$?
13722   echo "$as_me:13722: \$? = $ac_status" >&5
13723   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13724   { (eval echo "$as_me:13724: \"$ac_try\"") >&5
13725   (eval $ac_try) 2>&5
13726   ac_status=$?
13727   echo "$as_me:13727: \$? = $ac_status" >&5
13728   (exit $ac_status); }; }; then
13729   ac_cv_func_vfork_works=yes
13730 else
13731   echo "$as_me: program exited with status $ac_status" >&5
13732 echo "$as_me: failed program was:" >&5
13733 cat conftest.$ac_ext >&5
13734 ac_cv_func_vfork_works=no
13735 fi
13736 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13737 fi
13738 fi
13739 echo "$as_me:13739: result: $ac_cv_func_vfork_works" >&5
13740 echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
13741
13742 fi;
13743 if test "x$ac_cv_func_fork_works" = xcross; then
13744   ac_cv_func_vfork_works=ac_cv_func_vfork
13745   { echo "$as_me:13745: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&5
13746 echo "$as_me: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&2;}
13747 fi
13748
13749 if test "x$ac_cv_func_vfork_works" = xyes; then
13750
13751 cat >>confdefs.h <<\EOF
13752 #define HAVE_WORKING_VFORK 1
13753 EOF
13754
13755 else
13756
13757 cat >>confdefs.h <<\EOF
13758 #define vfork fork
13759 EOF
13760
13761 fi
13762 if test "x$ac_cv_func_fork_works" = xyes; then
13763
13764 cat >>confdefs.h <<\EOF
13765 #define HAVE_WORKING_FORK 1
13766 EOF
13767
13768 fi
13769
13770 echo "$as_me:13770: checking if sys/time.h works with sys/select.h" >&5
13771 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
13772 if test "${cf_cv_sys_time_select+set}" = set; then
13773   echo $ECHO_N "(cached) $ECHO_C" >&6
13774 else
13775
13776 cat >conftest.$ac_ext <<_ACEOF
13777 #line 13777 "configure"
13778 #include "confdefs.h"
13779
13780 #include <sys/types.h>
13781 #ifdef HAVE_SYS_TIME_H
13782 #include <sys/time.h>
13783 #endif
13784 #ifdef HAVE_SYS_SELECT_H
13785 #include <sys/select.h>
13786 #endif
13787
13788 int
13789 main ()
13790 {
13791
13792   ;
13793   return 0;
13794 }
13795 _ACEOF
13796 rm -f conftest.$ac_objext
13797 if { (eval echo "$as_me:13797: \"$ac_compile\"") >&5
13798   (eval $ac_compile) 2>&5
13799   ac_status=$?
13800   echo "$as_me:13800: \$? = $ac_status" >&5
13801   (exit $ac_status); } &&
13802          { ac_try='test -s conftest.$ac_objext'
13803   { (eval echo "$as_me:13803: \"$ac_try\"") >&5
13804   (eval $ac_try) 2>&5
13805   ac_status=$?
13806   echo "$as_me:13806: \$? = $ac_status" >&5
13807   (exit $ac_status); }; }; then
13808   cf_cv_sys_time_select=yes
13809 else
13810   echo "$as_me: failed program was:" >&5
13811 cat conftest.$ac_ext >&5
13812 cf_cv_sys_time_select=no
13813 fi
13814 rm -f conftest.$ac_objext conftest.$ac_ext
13815
13816 fi
13817
13818 echo "$as_me:13818: result: $cf_cv_sys_time_select" >&5
13819 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
13820 test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF
13821 #define HAVE_SYS_TIME_SELECT 1
13822 EOF
13823
13824 echo "$as_me:13824: checking for function curses_version" >&5
13825 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
13826 if test "${cf_cv_func_curses_version+set}" = set; then
13827   echo $ECHO_N "(cached) $ECHO_C" >&6
13828 else
13829
13830 if test "$cross_compiling" = yes; then
13831   cf_cv_func_curses_version=unknown
13832 else
13833   cat >conftest.$ac_ext <<_ACEOF
13834 #line 13834 "configure"
13835 #include "confdefs.h"
13836
13837 #include <${cf_cv_ncurses_header:-curses.h}>
13838 int main()
13839 {
13840         char temp[1024];
13841         sprintf(temp, "%s\n", curses_version());
13842         ${cf_cv_main_return:-return}(0);
13843 }
13844
13845 _ACEOF
13846 rm -f conftest$ac_exeext
13847 if { (eval echo "$as_me:13847: \"$ac_link\"") >&5
13848   (eval $ac_link) 2>&5
13849   ac_status=$?
13850   echo "$as_me:13850: \$? = $ac_status" >&5
13851   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13852   { (eval echo "$as_me:13852: \"$ac_try\"") >&5
13853   (eval $ac_try) 2>&5
13854   ac_status=$?
13855   echo "$as_me:13855: \$? = $ac_status" >&5
13856   (exit $ac_status); }; }; then
13857   cf_cv_func_curses_version=yes
13858
13859 else
13860   echo "$as_me: program exited with status $ac_status" >&5
13861 echo "$as_me: failed program was:" >&5
13862 cat conftest.$ac_ext >&5
13863 cf_cv_func_curses_version=no
13864
13865 fi
13866 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13867 fi
13868 rm -f core
13869 fi
13870 echo "$as_me:13870: result: $cf_cv_func_curses_version" >&5
13871 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
13872 test "$cf_cv_func_curses_version" = yes && cat >>confdefs.h <<\EOF
13873 #define HAVE_CURSES_VERSION 1
13874 EOF
13875
13876 echo "$as_me:13876: checking for ncurses wrap-prefix" >&5
13877 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
13878
13879 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
13880 if test "${with_ncurses_wrap_prefix+set}" = set; then
13881   withval="$with_ncurses_wrap_prefix"
13882   NCURSES_WRAP_PREFIX=$withval
13883 else
13884   NCURSES_WRAP_PREFIX=_nc_
13885 fi;
13886 echo "$as_me:13886: result: $NCURSES_WRAP_PREFIX" >&5
13887 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
13888
13889 echo "$as_me:13889: checking for alternate character set array" >&5
13890 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
13891 if test "${cf_cv_curses_acs_map+set}" = set; then
13892   echo $ECHO_N "(cached) $ECHO_C" >&6
13893 else
13894
13895 cf_cv_curses_acs_map=unknown
13896 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
13897 do
13898 cat >conftest.$ac_ext <<_ACEOF
13899 #line 13899 "configure"
13900 #include "confdefs.h"
13901
13902 #include <${cf_cv_ncurses_header:-curses.h}>
13903
13904 int
13905 main ()
13906 {
13907
13908 $name['k'] = ACS_PLUS
13909
13910   ;
13911   return 0;
13912 }
13913 _ACEOF
13914 rm -f conftest.$ac_objext conftest$ac_exeext
13915 if { (eval echo "$as_me:13915: \"$ac_link\"") >&5
13916   (eval $ac_link) 2>&5
13917   ac_status=$?
13918   echo "$as_me:13918: \$? = $ac_status" >&5
13919   (exit $ac_status); } &&
13920          { ac_try='test -s conftest$ac_exeext'
13921   { (eval echo "$as_me:13921: \"$ac_try\"") >&5
13922   (eval $ac_try) 2>&5
13923   ac_status=$?
13924   echo "$as_me:13924: \$? = $ac_status" >&5
13925   (exit $ac_status); }; }; then
13926   cf_cv_curses_acs_map=$name; break
13927 else
13928   echo "$as_me: failed program was:" >&5
13929 cat conftest.$ac_ext >&5
13930 fi
13931 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13932 done
13933
13934 fi
13935 echo "$as_me:13935: result: $cf_cv_curses_acs_map" >&5
13936 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
13937
13938 test "$cf_cv_curses_acs_map" != unknown && cat >>confdefs.h <<EOF
13939 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
13940 EOF
13941
13942 echo "$as_me:13942: checking for wide alternate character set array" >&5
13943 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
13944 if test "${cf_cv_curses_wacs_map+set}" = set; then
13945   echo $ECHO_N "(cached) $ECHO_C" >&6
13946 else
13947
13948         cf_cv_curses_wacs_map=unknown
13949         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
13950         do
13951         cat >conftest.$ac_ext <<_ACEOF
13952 #line 13952 "configure"
13953 #include "confdefs.h"
13954
13955 #ifndef _XOPEN_SOURCE_EXTENDED
13956 #define _XOPEN_SOURCE_EXTENDED
13957 #endif
13958 #include <${cf_cv_ncurses_header:-curses.h}>
13959 int
13960 main ()
13961 {
13962 void *foo = &($name['k'])
13963   ;
13964   return 0;
13965 }
13966 _ACEOF
13967 rm -f conftest.$ac_objext conftest$ac_exeext
13968 if { (eval echo "$as_me:13968: \"$ac_link\"") >&5
13969   (eval $ac_link) 2>&5
13970   ac_status=$?
13971   echo "$as_me:13971: \$? = $ac_status" >&5
13972   (exit $ac_status); } &&
13973          { ac_try='test -s conftest$ac_exeext'
13974   { (eval echo "$as_me:13974: \"$ac_try\"") >&5
13975   (eval $ac_try) 2>&5
13976   ac_status=$?
13977   echo "$as_me:13977: \$? = $ac_status" >&5
13978   (exit $ac_status); }; }; then
13979   cf_cv_curses_wacs_map=$name
13980          break
13981 else
13982   echo "$as_me: failed program was:" >&5
13983 cat conftest.$ac_ext >&5
13984 fi
13985 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13986         done
13987 fi
13988 echo "$as_me:13988: result: $cf_cv_curses_wacs_map" >&5
13989 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
13990
13991 test "$cf_cv_curses_wacs_map" != unknown && cat >>confdefs.h <<EOF
13992 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
13993 EOF
13994
13995 echo "$as_me:13995: checking for wide alternate character constants" >&5
13996 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
13997 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
13998   echo $ECHO_N "(cached) $ECHO_C" >&6
13999 else
14000
14001 cf_cv_curses_wacs_symbols=no
14002 if test "$cf_cv_curses_wacs_map" != unknown
14003 then
14004         cat >conftest.$ac_ext <<_ACEOF
14005 #line 14005 "configure"
14006 #include "confdefs.h"
14007
14008 #ifndef _XOPEN_SOURCE_EXTENDED
14009 #define _XOPEN_SOURCE_EXTENDED
14010 #endif
14011 #include <${cf_cv_ncurses_header:-curses.h}>
14012 int
14013 main ()
14014 {
14015 cchar_t *foo = WACS_PLUS;
14016          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
14017   ;
14018   return 0;
14019 }
14020 _ACEOF
14021 rm -f conftest.$ac_objext conftest$ac_exeext
14022 if { (eval echo "$as_me:14022: \"$ac_link\"") >&5
14023   (eval $ac_link) 2>&5
14024   ac_status=$?
14025   echo "$as_me:14025: \$? = $ac_status" >&5
14026   (exit $ac_status); } &&
14027          { ac_try='test -s conftest$ac_exeext'
14028   { (eval echo "$as_me:14028: \"$ac_try\"") >&5
14029   (eval $ac_try) 2>&5
14030   ac_status=$?
14031   echo "$as_me:14031: \$? = $ac_status" >&5
14032   (exit $ac_status); }; }; then
14033   cf_cv_curses_wacs_symbols=yes
14034 else
14035   echo "$as_me: failed program was:" >&5
14036 cat conftest.$ac_ext >&5
14037 fi
14038 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14039 else
14040         cat >conftest.$ac_ext <<_ACEOF
14041 #line 14041 "configure"
14042 #include "confdefs.h"
14043
14044 #ifndef _XOPEN_SOURCE_EXTENDED
14045 #define _XOPEN_SOURCE_EXTENDED
14046 #endif
14047 #include <${cf_cv_ncurses_header:-curses.h}>
14048 int
14049 main ()
14050 {
14051 cchar_t *foo = WACS_PLUS
14052   ;
14053   return 0;
14054 }
14055 _ACEOF
14056 rm -f conftest.$ac_objext conftest$ac_exeext
14057 if { (eval echo "$as_me:14057: \"$ac_link\"") >&5
14058   (eval $ac_link) 2>&5
14059   ac_status=$?
14060   echo "$as_me:14060: \$? = $ac_status" >&5
14061   (exit $ac_status); } &&
14062          { ac_try='test -s conftest$ac_exeext'
14063   { (eval echo "$as_me:14063: \"$ac_try\"") >&5
14064   (eval $ac_try) 2>&5
14065   ac_status=$?
14066   echo "$as_me:14066: \$? = $ac_status" >&5
14067   (exit $ac_status); }; }; then
14068   cf_cv_curses_wacs_symbols=yes
14069 else
14070   echo "$as_me: failed program was:" >&5
14071 cat conftest.$ac_ext >&5
14072 fi
14073 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14074 fi
14075
14076 fi
14077 echo "$as_me:14077: result: $cf_cv_curses_wacs_symbols" >&5
14078 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
14079
14080 test "$cf_cv_curses_wacs_symbols" != no && cat >>confdefs.h <<\EOF
14081 #define CURSES_WACS_SYMBOLS 1
14082 EOF
14083
14084 echo "$as_me:14084: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14085 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14086 cat >conftest.$ac_ext <<_ACEOF
14087 #line 14087 "configure"
14088 #include "confdefs.h"
14089
14090 #ifndef _XOPEN_SOURCE_EXTENDED
14091 #define _XOPEN_SOURCE_EXTENDED
14092 #endif
14093 #include <${cf_cv_ncurses_header:-curses.h}>
14094 int
14095 main ()
14096 {
14097
14098 attr_t foo
14099
14100   ;
14101   return 0;
14102 }
14103 _ACEOF
14104 rm -f conftest.$ac_objext
14105 if { (eval echo "$as_me:14105: \"$ac_compile\"") >&5
14106   (eval $ac_compile) 2>&5
14107   ac_status=$?
14108   echo "$as_me:14108: \$? = $ac_status" >&5
14109   (exit $ac_status); } &&
14110          { ac_try='test -s conftest.$ac_objext'
14111   { (eval echo "$as_me:14111: \"$ac_try\"") >&5
14112   (eval $ac_try) 2>&5
14113   ac_status=$?
14114   echo "$as_me:14114: \$? = $ac_status" >&5
14115   (exit $ac_status); }; }; then
14116   cf_result=yes
14117 else
14118   echo "$as_me: failed program was:" >&5
14119 cat conftest.$ac_ext >&5
14120 cf_result=no
14121 fi
14122 rm -f conftest.$ac_objext conftest.$ac_ext
14123 echo "$as_me:14123: result: $cf_result" >&5
14124 echo "${ECHO_T}$cf_result" >&6
14125 if test $cf_result = yes ; then
14126
14127 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14128
14129         cat >>confdefs.h <<EOF
14130 #define $cf_result 1
14131 EOF
14132
14133 else
14134         cat >>confdefs.h <<EOF
14135 #define attr_t long
14136 EOF
14137
14138 fi
14139
14140 # This is needed on Tru64 5.0 to declare mbstate_t
14141 echo "$as_me:14141: checking if we must include wchar.h to declare mbstate_t" >&5
14142 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
14143 if test "${cf_cv_mbstate_t+set}" = set; then
14144   echo $ECHO_N "(cached) $ECHO_C" >&6
14145 else
14146
14147 cat >conftest.$ac_ext <<_ACEOF
14148 #line 14148 "configure"
14149 #include "confdefs.h"
14150
14151 #include <stdlib.h>
14152 #include <stdarg.h>
14153 #include <stdio.h>
14154 #ifdef HAVE_LIBUTF8_H
14155 #include <libutf8.h>
14156 #endif
14157 int
14158 main ()
14159 {
14160 mbstate_t state
14161   ;
14162   return 0;
14163 }
14164 _ACEOF
14165 rm -f conftest.$ac_objext
14166 if { (eval echo "$as_me:14166: \"$ac_compile\"") >&5
14167   (eval $ac_compile) 2>&5
14168   ac_status=$?
14169   echo "$as_me:14169: \$? = $ac_status" >&5
14170   (exit $ac_status); } &&
14171          { ac_try='test -s conftest.$ac_objext'
14172   { (eval echo "$as_me:14172: \"$ac_try\"") >&5
14173   (eval $ac_try) 2>&5
14174   ac_status=$?
14175   echo "$as_me:14175: \$? = $ac_status" >&5
14176   (exit $ac_status); }; }; then
14177   cf_cv_mbstate_t=no
14178 else
14179   echo "$as_me: failed program was:" >&5
14180 cat conftest.$ac_ext >&5
14181 cat >conftest.$ac_ext <<_ACEOF
14182 #line 14182 "configure"
14183 #include "confdefs.h"
14184
14185 #include <stdlib.h>
14186 #include <stdarg.h>
14187 #include <stdio.h>
14188 #include <wchar.h>
14189 #ifdef HAVE_LIBUTF8_H
14190 #include <libutf8.h>
14191 #endif
14192 int
14193 main ()
14194 {
14195 mbstate_t value
14196   ;
14197   return 0;
14198 }
14199 _ACEOF
14200 rm -f conftest.$ac_objext
14201 if { (eval echo "$as_me:14201: \"$ac_compile\"") >&5
14202   (eval $ac_compile) 2>&5
14203   ac_status=$?
14204   echo "$as_me:14204: \$? = $ac_status" >&5
14205   (exit $ac_status); } &&
14206          { ac_try='test -s conftest.$ac_objext'
14207   { (eval echo "$as_me:14207: \"$ac_try\"") >&5
14208   (eval $ac_try) 2>&5
14209   ac_status=$?
14210   echo "$as_me:14210: \$? = $ac_status" >&5
14211   (exit $ac_status); }; }; then
14212   cf_cv_mbstate_t=yes
14213 else
14214   echo "$as_me: failed program was:" >&5
14215 cat conftest.$ac_ext >&5
14216 cf_cv_mbstate_t=unknown
14217 fi
14218 rm -f conftest.$ac_objext conftest.$ac_ext
14219 fi
14220 rm -f conftest.$ac_objext conftest.$ac_ext
14221 fi
14222 echo "$as_me:14222: result: $cf_cv_mbstate_t" >&5
14223 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
14224
14225 if test "$cf_cv_mbstate_t" = yes ; then
14226         cat >>confdefs.h <<\EOF
14227 #define NEED_WCHAR_H 1
14228 EOF
14229
14230         NEED_WCHAR_H=1
14231 fi
14232
14233 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
14234 if test "$cf_cv_mbstate_t" = unknown ; then
14235         NCURSES_MBSTATE_T=1
14236 fi
14237
14238 # if we find mbstate_t in either place, use substitution to provide a fallback.
14239 if test "$cf_cv_mbstate_t" != unknown ; then
14240         NCURSES_OK_MBSTATE_T=1
14241 fi
14242
14243 # This is needed on Tru64 5.0 to declare wchar_t
14244 echo "$as_me:14244: checking if we must include wchar.h to declare wchar_t" >&5
14245 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
14246 if test "${cf_cv_wchar_t+set}" = set; then
14247   echo $ECHO_N "(cached) $ECHO_C" >&6
14248 else
14249
14250 cat >conftest.$ac_ext <<_ACEOF
14251 #line 14251 "configure"
14252 #include "confdefs.h"
14253
14254 #include <stdlib.h>
14255 #include <stdarg.h>
14256 #include <stdio.h>
14257 #ifdef HAVE_LIBUTF8_H
14258 #include <libutf8.h>
14259 #endif
14260 int
14261 main ()
14262 {
14263 wchar_t state
14264   ;
14265   return 0;
14266 }
14267 _ACEOF
14268 rm -f conftest.$ac_objext
14269 if { (eval echo "$as_me:14269: \"$ac_compile\"") >&5
14270   (eval $ac_compile) 2>&5
14271   ac_status=$?
14272   echo "$as_me:14272: \$? = $ac_status" >&5
14273   (exit $ac_status); } &&
14274          { ac_try='test -s conftest.$ac_objext'
14275   { (eval echo "$as_me:14275: \"$ac_try\"") >&5
14276   (eval $ac_try) 2>&5
14277   ac_status=$?
14278   echo "$as_me:14278: \$? = $ac_status" >&5
14279   (exit $ac_status); }; }; then
14280   cf_cv_wchar_t=no
14281 else
14282   echo "$as_me: failed program was:" >&5
14283 cat conftest.$ac_ext >&5
14284 cat >conftest.$ac_ext <<_ACEOF
14285 #line 14285 "configure"
14286 #include "confdefs.h"
14287
14288 #include <stdlib.h>
14289 #include <stdarg.h>
14290 #include <stdio.h>
14291 #include <wchar.h>
14292 #ifdef HAVE_LIBUTF8_H
14293 #include <libutf8.h>
14294 #endif
14295 int
14296 main ()
14297 {
14298 wchar_t value
14299   ;
14300   return 0;
14301 }
14302 _ACEOF
14303 rm -f conftest.$ac_objext
14304 if { (eval echo "$as_me:14304: \"$ac_compile\"") >&5
14305   (eval $ac_compile) 2>&5
14306   ac_status=$?
14307   echo "$as_me:14307: \$? = $ac_status" >&5
14308   (exit $ac_status); } &&
14309          { ac_try='test -s conftest.$ac_objext'
14310   { (eval echo "$as_me:14310: \"$ac_try\"") >&5
14311   (eval $ac_try) 2>&5
14312   ac_status=$?
14313   echo "$as_me:14313: \$? = $ac_status" >&5
14314   (exit $ac_status); }; }; then
14315   cf_cv_wchar_t=yes
14316 else
14317   echo "$as_me: failed program was:" >&5
14318 cat conftest.$ac_ext >&5
14319 cf_cv_wchar_t=unknown
14320 fi
14321 rm -f conftest.$ac_objext conftest.$ac_ext
14322 fi
14323 rm -f conftest.$ac_objext conftest.$ac_ext
14324 fi
14325 echo "$as_me:14325: result: $cf_cv_wchar_t" >&5
14326 echo "${ECHO_T}$cf_cv_wchar_t" >&6
14327
14328 if test "$cf_cv_wchar_t" = yes ; then
14329         cat >>confdefs.h <<\EOF
14330 #define NEED_WCHAR_H 1
14331 EOF
14332
14333         NEED_WCHAR_H=1
14334 fi
14335
14336 # if we do not find wchar_t in either place, use substitution to provide a fallback.
14337 if test "$cf_cv_wchar_t" = unknown ; then
14338         NCURSES_WCHAR_T=1
14339 fi
14340
14341 # if we find wchar_t in either place, use substitution to provide a fallback.
14342 if test "$cf_cv_wchar_t" != unknown ; then
14343         NCURSES_OK_WCHAR_T=1
14344 fi
14345
14346 # This is needed on Tru64 5.0 to declare wint_t
14347 echo "$as_me:14347: checking if we must include wchar.h to declare wint_t" >&5
14348 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
14349 if test "${cf_cv_wint_t+set}" = set; then
14350   echo $ECHO_N "(cached) $ECHO_C" >&6
14351 else
14352
14353 cat >conftest.$ac_ext <<_ACEOF
14354 #line 14354 "configure"
14355 #include "confdefs.h"
14356
14357 #include <stdlib.h>
14358 #include <stdarg.h>
14359 #include <stdio.h>
14360 #ifdef HAVE_LIBUTF8_H
14361 #include <libutf8.h>
14362 #endif
14363 int
14364 main ()
14365 {
14366 wint_t state
14367   ;
14368   return 0;
14369 }
14370 _ACEOF
14371 rm -f conftest.$ac_objext
14372 if { (eval echo "$as_me:14372: \"$ac_compile\"") >&5
14373   (eval $ac_compile) 2>&5
14374   ac_status=$?
14375   echo "$as_me:14375: \$? = $ac_status" >&5
14376   (exit $ac_status); } &&
14377          { ac_try='test -s conftest.$ac_objext'
14378   { (eval echo "$as_me:14378: \"$ac_try\"") >&5
14379   (eval $ac_try) 2>&5
14380   ac_status=$?
14381   echo "$as_me:14381: \$? = $ac_status" >&5
14382   (exit $ac_status); }; }; then
14383   cf_cv_wint_t=no
14384 else
14385   echo "$as_me: failed program was:" >&5
14386 cat conftest.$ac_ext >&5
14387 cat >conftest.$ac_ext <<_ACEOF
14388 #line 14388 "configure"
14389 #include "confdefs.h"
14390
14391 #include <stdlib.h>
14392 #include <stdarg.h>
14393 #include <stdio.h>
14394 #include <wchar.h>
14395 #ifdef HAVE_LIBUTF8_H
14396 #include <libutf8.h>
14397 #endif
14398 int
14399 main ()
14400 {
14401 wint_t value
14402   ;
14403   return 0;
14404 }
14405 _ACEOF
14406 rm -f conftest.$ac_objext
14407 if { (eval echo "$as_me:14407: \"$ac_compile\"") >&5
14408   (eval $ac_compile) 2>&5
14409   ac_status=$?
14410   echo "$as_me:14410: \$? = $ac_status" >&5
14411   (exit $ac_status); } &&
14412          { ac_try='test -s conftest.$ac_objext'
14413   { (eval echo "$as_me:14413: \"$ac_try\"") >&5
14414   (eval $ac_try) 2>&5
14415   ac_status=$?
14416   echo "$as_me:14416: \$? = $ac_status" >&5
14417   (exit $ac_status); }; }; then
14418   cf_cv_wint_t=yes
14419 else
14420   echo "$as_me: failed program was:" >&5
14421 cat conftest.$ac_ext >&5
14422 cf_cv_wint_t=unknown
14423 fi
14424 rm -f conftest.$ac_objext conftest.$ac_ext
14425 fi
14426 rm -f conftest.$ac_objext conftest.$ac_ext
14427 fi
14428 echo "$as_me:14428: result: $cf_cv_wint_t" >&5
14429 echo "${ECHO_T}$cf_cv_wint_t" >&6
14430
14431 if test "$cf_cv_wint_t" = yes ; then
14432         cat >>confdefs.h <<\EOF
14433 #define NEED_WCHAR_H 1
14434 EOF
14435
14436         NEED_WCHAR_H=1
14437 fi
14438
14439 # if we do not find wint_t in either place, use substitution to provide a fallback.
14440 if test "$cf_cv_wint_t" = unknown ; then
14441         NCURSES_WINT_T=1
14442 fi
14443
14444 # if we find wint_t in either place, use substitution to provide a fallback.
14445 if test "$cf_cv_wint_t" != unknown ; then
14446         NCURSES_OK_WINT_T=1
14447 fi
14448
14449 if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
14450
14451 echo "$as_me:14451: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14452 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14453 cat >conftest.$ac_ext <<_ACEOF
14454 #line 14454 "configure"
14455 #include "confdefs.h"
14456
14457 #ifndef _XOPEN_SOURCE_EXTENDED
14458 #define _XOPEN_SOURCE_EXTENDED
14459 #endif
14460 #include <${cf_cv_ncurses_header:-curses.h}>
14461 int
14462 main ()
14463 {
14464
14465 mbstate_t foo
14466
14467   ;
14468   return 0;
14469 }
14470 _ACEOF
14471 rm -f conftest.$ac_objext
14472 if { (eval echo "$as_me:14472: \"$ac_compile\"") >&5
14473   (eval $ac_compile) 2>&5
14474   ac_status=$?
14475   echo "$as_me:14475: \$? = $ac_status" >&5
14476   (exit $ac_status); } &&
14477          { ac_try='test -s conftest.$ac_objext'
14478   { (eval echo "$as_me:14478: \"$ac_try\"") >&5
14479   (eval $ac_try) 2>&5
14480   ac_status=$?
14481   echo "$as_me:14481: \$? = $ac_status" >&5
14482   (exit $ac_status); }; }; then
14483   cf_result=yes
14484 else
14485   echo "$as_me: failed program was:" >&5
14486 cat conftest.$ac_ext >&5
14487 cf_result=no
14488 fi
14489 rm -f conftest.$ac_objext conftest.$ac_ext
14490 echo "$as_me:14490: result: $cf_result" >&5
14491 echo "${ECHO_T}$cf_result" >&6
14492 if test $cf_result = yes ; then
14493
14494 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14495
14496         cat >>confdefs.h <<EOF
14497 #define $cf_result 1
14498 EOF
14499
14500 else
14501         cat >>confdefs.h <<EOF
14502 #define mbstate_t long
14503 EOF
14504
14505 fi
14506
14507 fi
14508
14509 if test "$NCURSES_OK_WCHAR_T" = 0 ; then
14510
14511 echo "$as_me:14511: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14512 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14513 cat >conftest.$ac_ext <<_ACEOF
14514 #line 14514 "configure"
14515 #include "confdefs.h"
14516
14517 #ifndef _XOPEN_SOURCE_EXTENDED
14518 #define _XOPEN_SOURCE_EXTENDED
14519 #endif
14520 #include <${cf_cv_ncurses_header:-curses.h}>
14521 int
14522 main ()
14523 {
14524
14525 wchar_t foo
14526
14527   ;
14528   return 0;
14529 }
14530 _ACEOF
14531 rm -f conftest.$ac_objext
14532 if { (eval echo "$as_me:14532: \"$ac_compile\"") >&5
14533   (eval $ac_compile) 2>&5
14534   ac_status=$?
14535   echo "$as_me:14535: \$? = $ac_status" >&5
14536   (exit $ac_status); } &&
14537          { ac_try='test -s conftest.$ac_objext'
14538   { (eval echo "$as_me:14538: \"$ac_try\"") >&5
14539   (eval $ac_try) 2>&5
14540   ac_status=$?
14541   echo "$as_me:14541: \$? = $ac_status" >&5
14542   (exit $ac_status); }; }; then
14543   cf_result=yes
14544 else
14545   echo "$as_me: failed program was:" >&5
14546 cat conftest.$ac_ext >&5
14547 cf_result=no
14548 fi
14549 rm -f conftest.$ac_objext conftest.$ac_ext
14550 echo "$as_me:14550: result: $cf_result" >&5
14551 echo "${ECHO_T}$cf_result" >&6
14552 if test $cf_result = yes ; then
14553
14554 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14555
14556         cat >>confdefs.h <<EOF
14557 #define $cf_result 1
14558 EOF
14559
14560 else
14561         cat >>confdefs.h <<EOF
14562 #define wchar_t long
14563 EOF
14564
14565 fi
14566
14567 fi
14568
14569 if test "$NCURSES_OK_WINT_T" = 0 ; then
14570
14571 echo "$as_me:14571: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14572 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14573 cat >conftest.$ac_ext <<_ACEOF
14574 #line 14574 "configure"
14575 #include "confdefs.h"
14576
14577 #ifndef _XOPEN_SOURCE_EXTENDED
14578 #define _XOPEN_SOURCE_EXTENDED
14579 #endif
14580 #include <${cf_cv_ncurses_header:-curses.h}>
14581 int
14582 main ()
14583 {
14584
14585 wint_t foo
14586
14587   ;
14588   return 0;
14589 }
14590 _ACEOF
14591 rm -f conftest.$ac_objext
14592 if { (eval echo "$as_me:14592: \"$ac_compile\"") >&5
14593   (eval $ac_compile) 2>&5
14594   ac_status=$?
14595   echo "$as_me:14595: \$? = $ac_status" >&5
14596   (exit $ac_status); } &&
14597          { ac_try='test -s conftest.$ac_objext'
14598   { (eval echo "$as_me:14598: \"$ac_try\"") >&5
14599   (eval $ac_try) 2>&5
14600   ac_status=$?
14601   echo "$as_me:14601: \$? = $ac_status" >&5
14602   (exit $ac_status); }; }; then
14603   cf_result=yes
14604 else
14605   echo "$as_me: failed program was:" >&5
14606 cat conftest.$ac_ext >&5
14607 cf_result=no
14608 fi
14609 rm -f conftest.$ac_objext conftest.$ac_ext
14610 echo "$as_me:14610: result: $cf_result" >&5
14611 echo "${ECHO_T}$cf_result" >&6
14612 if test $cf_result = yes ; then
14613
14614 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14615
14616         cat >>confdefs.h <<EOF
14617 #define $cf_result 1
14618 EOF
14619
14620 else
14621         cat >>confdefs.h <<EOF
14622 #define wint_t long
14623 EOF
14624
14625 fi
14626
14627 fi
14628
14629 echo "$as_me:14629: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
14630 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14631
14632 cat >conftest.$ac_ext <<_ACEOF
14633 #line 14633 "configure"
14634 #include "confdefs.h"
14635
14636 #ifdef HAVE_XCURSES
14637 #include <xcurses.h>
14638 char * XCursesProgramName = "test";
14639 #else
14640 #include <${cf_cv_ncurses_header:-curses.h}>
14641 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14642 #include <ncursesw/term.h>
14643 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14644 #include <ncurses/term.h>
14645 #elif defined(HAVE_TERM_H)
14646 #include <term.h>
14647 #endif
14648 #endif
14649
14650 int
14651 main ()
14652 {
14653
14654 void *foo = &(boolnames)
14655
14656   ;
14657   return 0;
14658 }
14659 _ACEOF
14660 rm -f conftest.$ac_objext
14661 if { (eval echo "$as_me:14661: \"$ac_compile\"") >&5
14662   (eval $ac_compile) 2>&5
14663   ac_status=$?
14664   echo "$as_me:14664: \$? = $ac_status" >&5
14665   (exit $ac_status); } &&
14666          { ac_try='test -s conftest.$ac_objext'
14667   { (eval echo "$as_me:14667: \"$ac_try\"") >&5
14668   (eval $ac_try) 2>&5
14669   ac_status=$?
14670   echo "$as_me:14670: \$? = $ac_status" >&5
14671   (exit $ac_status); }; }; then
14672   cf_result=yes
14673 else
14674   echo "$as_me: failed program was:" >&5
14675 cat conftest.$ac_ext >&5
14676 cf_result=no
14677 fi
14678 rm -f conftest.$ac_objext conftest.$ac_ext
14679 echo "$as_me:14679: result: $cf_result" >&5
14680 echo "${ECHO_T}$cf_result" >&6
14681
14682 if test $cf_result = yes ; then
14683
14684 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14685
14686         cat >>confdefs.h <<EOF
14687 #define $cf_result 1
14688 EOF
14689
14690 else
14691         echo "$as_me:14691: checking for data boolnames in library" >&5
14692 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
14693         # BSD linkers insist on making weak linkage, but resolve at runtime.
14694         if test "$cross_compiling" = yes; then
14695
14696         # cross-compiling
14697         cat >conftest.$ac_ext <<_ACEOF
14698 #line 14698 "configure"
14699 #include "confdefs.h"
14700
14701 #ifdef HAVE_XCURSES
14702 #include <xcurses.h>
14703 char * XCursesProgramName = "test";
14704 #else
14705 #include <${cf_cv_ncurses_header:-curses.h}>
14706 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14707 #include <ncursesw/term.h>
14708 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14709 #include <ncurses/term.h>
14710 #elif defined(HAVE_TERM_H)
14711 #include <term.h>
14712 #endif
14713 #endif
14714
14715 extern char boolnames;
14716 int
14717 main ()
14718 {
14719
14720         do {
14721                 void *foo = &(boolnames);
14722                 ${cf_cv_main_return:-return}(foo == 0);
14723         } while (0)
14724
14725   ;
14726   return 0;
14727 }
14728 _ACEOF
14729 rm -f conftest.$ac_objext conftest$ac_exeext
14730 if { (eval echo "$as_me:14730: \"$ac_link\"") >&5
14731   (eval $ac_link) 2>&5
14732   ac_status=$?
14733   echo "$as_me:14733: \$? = $ac_status" >&5
14734   (exit $ac_status); } &&
14735          { ac_try='test -s conftest$ac_exeext'
14736   { (eval echo "$as_me:14736: \"$ac_try\"") >&5
14737   (eval $ac_try) 2>&5
14738   ac_status=$?
14739   echo "$as_me:14739: \$? = $ac_status" >&5
14740   (exit $ac_status); }; }; then
14741   cf_result=yes
14742 else
14743   echo "$as_me: failed program was:" >&5
14744 cat conftest.$ac_ext >&5
14745 cf_result=no
14746 fi
14747 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14748
14749 else
14750   cat >conftest.$ac_ext <<_ACEOF
14751 #line 14751 "configure"
14752 #include "confdefs.h"
14753
14754 #ifdef HAVE_XCURSES
14755 #include <xcurses.h>
14756 char * XCursesProgramName = "test";
14757 #else
14758 #include <${cf_cv_ncurses_header:-curses.h}>
14759 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14760 #include <ncursesw/term.h>
14761 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14762 #include <ncurses/term.h>
14763 #elif defined(HAVE_TERM_H)
14764 #include <term.h>
14765 #endif
14766 #endif
14767
14768 extern char boolnames;
14769 int main(void)
14770 {
14771         void *foo = &(boolnames);
14772         ${cf_cv_main_return:-return}(foo == 0);
14773 }
14774 _ACEOF
14775 rm -f conftest$ac_exeext
14776 if { (eval echo "$as_me:14776: \"$ac_link\"") >&5
14777   (eval $ac_link) 2>&5
14778   ac_status=$?
14779   echo "$as_me:14779: \$? = $ac_status" >&5
14780   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14781   { (eval echo "$as_me:14781: \"$ac_try\"") >&5
14782   (eval $ac_try) 2>&5
14783   ac_status=$?
14784   echo "$as_me:14784: \$? = $ac_status" >&5
14785   (exit $ac_status); }; }; then
14786   cf_result=yes
14787 else
14788   echo "$as_me: program exited with status $ac_status" >&5
14789 echo "$as_me: failed program was:" >&5
14790 cat conftest.$ac_ext >&5
14791 cf_result=no
14792 fi
14793 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14794 fi
14795         echo "$as_me:14795: result: $cf_result" >&5
14796 echo "${ECHO_T}$cf_result" >&6
14797         if test $cf_result = yes ; then
14798
14799 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14800
14801                 cat >>confdefs.h <<EOF
14802 #define $cf_result 1
14803 EOF
14804
14805         fi
14806 fi
14807
14808 echo "$as_me:14808: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
14809 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14810
14811 cat >conftest.$ac_ext <<_ACEOF
14812 #line 14812 "configure"
14813 #include "confdefs.h"
14814
14815 #ifdef HAVE_XCURSES
14816 #include <xcurses.h>
14817 char * XCursesProgramName = "test";
14818 #else
14819 #include <${cf_cv_ncurses_header:-curses.h}>
14820 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14821 #include <ncursesw/term.h>
14822 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14823 #include <ncurses/term.h>
14824 #elif defined(HAVE_TERM_H)
14825 #include <term.h>
14826 #endif
14827 #endif
14828
14829 int
14830 main ()
14831 {
14832
14833 void *foo = &(boolfnames)
14834
14835   ;
14836   return 0;
14837 }
14838 _ACEOF
14839 rm -f conftest.$ac_objext
14840 if { (eval echo "$as_me:14840: \"$ac_compile\"") >&5
14841   (eval $ac_compile) 2>&5
14842   ac_status=$?
14843   echo "$as_me:14843: \$? = $ac_status" >&5
14844   (exit $ac_status); } &&
14845          { ac_try='test -s conftest.$ac_objext'
14846   { (eval echo "$as_me:14846: \"$ac_try\"") >&5
14847   (eval $ac_try) 2>&5
14848   ac_status=$?
14849   echo "$as_me:14849: \$? = $ac_status" >&5
14850   (exit $ac_status); }; }; then
14851   cf_result=yes
14852 else
14853   echo "$as_me: failed program was:" >&5
14854 cat conftest.$ac_ext >&5
14855 cf_result=no
14856 fi
14857 rm -f conftest.$ac_objext conftest.$ac_ext
14858 echo "$as_me:14858: result: $cf_result" >&5
14859 echo "${ECHO_T}$cf_result" >&6
14860
14861 if test $cf_result = yes ; then
14862
14863 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14864
14865         cat >>confdefs.h <<EOF
14866 #define $cf_result 1
14867 EOF
14868
14869 else
14870         echo "$as_me:14870: checking for data boolfnames in library" >&5
14871 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
14872         # BSD linkers insist on making weak linkage, but resolve at runtime.
14873         if test "$cross_compiling" = yes; then
14874
14875         # cross-compiling
14876         cat >conftest.$ac_ext <<_ACEOF
14877 #line 14877 "configure"
14878 #include "confdefs.h"
14879
14880 #ifdef HAVE_XCURSES
14881 #include <xcurses.h>
14882 char * XCursesProgramName = "test";
14883 #else
14884 #include <${cf_cv_ncurses_header:-curses.h}>
14885 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14886 #include <ncursesw/term.h>
14887 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14888 #include <ncurses/term.h>
14889 #elif defined(HAVE_TERM_H)
14890 #include <term.h>
14891 #endif
14892 #endif
14893
14894 extern char boolfnames;
14895 int
14896 main ()
14897 {
14898
14899         do {
14900                 void *foo = &(boolfnames);
14901                 ${cf_cv_main_return:-return}(foo == 0);
14902         } while (0)
14903
14904   ;
14905   return 0;
14906 }
14907 _ACEOF
14908 rm -f conftest.$ac_objext conftest$ac_exeext
14909 if { (eval echo "$as_me:14909: \"$ac_link\"") >&5
14910   (eval $ac_link) 2>&5
14911   ac_status=$?
14912   echo "$as_me:14912: \$? = $ac_status" >&5
14913   (exit $ac_status); } &&
14914          { ac_try='test -s conftest$ac_exeext'
14915   { (eval echo "$as_me:14915: \"$ac_try\"") >&5
14916   (eval $ac_try) 2>&5
14917   ac_status=$?
14918   echo "$as_me:14918: \$? = $ac_status" >&5
14919   (exit $ac_status); }; }; then
14920   cf_result=yes
14921 else
14922   echo "$as_me: failed program was:" >&5
14923 cat conftest.$ac_ext >&5
14924 cf_result=no
14925 fi
14926 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14927
14928 else
14929   cat >conftest.$ac_ext <<_ACEOF
14930 #line 14930 "configure"
14931 #include "confdefs.h"
14932
14933 #ifdef HAVE_XCURSES
14934 #include <xcurses.h>
14935 char * XCursesProgramName = "test";
14936 #else
14937 #include <${cf_cv_ncurses_header:-curses.h}>
14938 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14939 #include <ncursesw/term.h>
14940 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14941 #include <ncurses/term.h>
14942 #elif defined(HAVE_TERM_H)
14943 #include <term.h>
14944 #endif
14945 #endif
14946
14947 extern char boolfnames;
14948 int main(void)
14949 {
14950         void *foo = &(boolfnames);
14951         ${cf_cv_main_return:-return}(foo == 0);
14952 }
14953 _ACEOF
14954 rm -f conftest$ac_exeext
14955 if { (eval echo "$as_me:14955: \"$ac_link\"") >&5
14956   (eval $ac_link) 2>&5
14957   ac_status=$?
14958   echo "$as_me:14958: \$? = $ac_status" >&5
14959   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14960   { (eval echo "$as_me:14960: \"$ac_try\"") >&5
14961   (eval $ac_try) 2>&5
14962   ac_status=$?
14963   echo "$as_me:14963: \$? = $ac_status" >&5
14964   (exit $ac_status); }; }; then
14965   cf_result=yes
14966 else
14967   echo "$as_me: program exited with status $ac_status" >&5
14968 echo "$as_me: failed program was:" >&5
14969 cat conftest.$ac_ext >&5
14970 cf_result=no
14971 fi
14972 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14973 fi
14974         echo "$as_me:14974: result: $cf_result" >&5
14975 echo "${ECHO_T}$cf_result" >&6
14976         if test $cf_result = yes ; then
14977
14978 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14979
14980                 cat >>confdefs.h <<EOF
14981 #define $cf_result 1
14982 EOF
14983
14984         fi
14985 fi
14986
14987 TEST_ARGS="$LIBS"
14988 LIBS=
14989
14990 ac_config_files="$ac_config_files Makefile"
14991 ac_config_commands="$ac_config_commands default"
14992 cat >confcache <<\_ACEOF
14993 # This file is a shell script that caches the results of configure
14994 # tests run on this system so they can be shared between configure
14995 # scripts and configure runs, see configure's option --config-cache.
14996 # It is not useful on other systems.  If it contains results you don't
14997 # want to keep, you may remove or edit it.
14998 #
14999 # config.status only pays attention to the cache file if you give it
15000 # the --recheck option to rerun configure.
15001 #
15002 # `ac_cv_env_foo' variables (set or unset) will be overriden when
15003 # loading this file, other *unset* `ac_cv_foo' will be assigned the
15004 # following values.
15005
15006 _ACEOF
15007
15008 # The following way of writing the cache mishandles newlines in values,
15009 # but we know of no workaround that is simple, portable, and efficient.
15010 # So, don't put newlines in cache variables' values.
15011 # Ultrix sh set writes to stderr and can't be redirected directly,
15012 # and sets the high bit in the cache file unless we assign to the vars.
15013 {
15014   (set) 2>&1 |
15015     case `(ac_space=' '; set | grep ac_space) 2>&1` in
15016     *ac_space=\ *)
15017       # `set' does not quote correctly, so add quotes (double-quote
15018       # substitution turns \\\\ into \\, and sed turns \\ into \).
15019       sed -n \
15020         "s/'/'\\\\''/g;
15021           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
15022       ;;
15023     *)
15024       # `set' quotes correctly as required by POSIX, so do not add quotes.
15025       sed -n \
15026         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
15027       ;;
15028     esac;
15029 } |
15030   sed '
15031      t clear
15032      : clear
15033      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
15034      t end
15035      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
15036      : end' >>confcache
15037 if cmp -s $cache_file confcache; then :; else
15038   if test -w $cache_file; then
15039     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
15040     cat confcache >$cache_file
15041   else
15042     echo "not updating unwritable cache $cache_file"
15043   fi
15044 fi
15045 rm -f confcache
15046
15047 test "x$prefix" = xNONE && prefix=$ac_default_prefix
15048 # Let make expand exec_prefix.
15049 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
15050
15051 # VPATH may cause trouble with some makes, so we remove $(srcdir),
15052 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
15053 # trailing colons and then remove the whole line if VPATH becomes empty
15054 # (actually we leave an empty line to preserve line numbers).
15055 if test "x$srcdir" = x.; then
15056   ac_vpsub='/^[         ]*VPATH[        ]*=/{
15057 s/:*\$(srcdir):*/:/;
15058 s/:*\${srcdir}:*/:/;
15059 s/:*@srcdir@:*/:/;
15060 s/^\([^=]*=[    ]*\):*/\1/;
15061 s/:*$//;
15062 s/^[^=]*=[      ]*$//;
15063 }'
15064 fi
15065
15066 DEFS=-DHAVE_CONFIG_H
15067
15068 : ${CONFIG_STATUS=./config.status}
15069 ac_clean_files_save=$ac_clean_files
15070 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
15071 { echo "$as_me:15071: creating $CONFIG_STATUS" >&5
15072 echo "$as_me: creating $CONFIG_STATUS" >&6;}
15073 cat >$CONFIG_STATUS <<_ACEOF
15074 #! $SHELL
15075 # Generated automatically by configure.
15076 # Run this file to recreate the current configuration.
15077 # Compiler output produced by configure, useful for debugging
15078 # configure, is in config.log if it exists.
15079
15080 debug=false
15081 SHELL=\${CONFIG_SHELL-$SHELL}
15082 ac_cs_invocation="\$0 \$@"
15083
15084 _ACEOF
15085
15086 cat >>$CONFIG_STATUS <<\_ACEOF
15087 # Be Bourne compatible
15088 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
15089   emulate sh
15090   NULLCMD=:
15091 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
15092   set -o posix
15093 fi
15094
15095 # Name of the executable.
15096 as_me=`echo "$0" |sed 's,.*[\\/],,'`
15097
15098 if expr a : '\(a\)' >/dev/null 2>&1; then
15099   as_expr=expr
15100 else
15101   as_expr=false
15102 fi
15103
15104 rm -f conf$$ conf$$.exe conf$$.file
15105 echo >conf$$.file
15106 if ln -s conf$$.file conf$$ 2>/dev/null; then
15107   # We could just check for DJGPP; but this test a) works b) is more generic
15108   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
15109   if test -f conf$$.exe; then
15110     # Don't use ln at all; we don't have any links
15111     as_ln_s='cp -p'
15112   else
15113     as_ln_s='ln -s'
15114   fi
15115 elif ln conf$$.file conf$$ 2>/dev/null; then
15116   as_ln_s=ln
15117 else
15118   as_ln_s='cp -p'
15119 fi
15120 rm -f conf$$ conf$$.exe conf$$.file
15121
15122 as_executable_p="test -f"
15123
15124 # Support unset when possible.
15125 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
15126   as_unset=unset
15127 else
15128   as_unset=false
15129 fi
15130
15131 # NLS nuisances.
15132 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
15133 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
15134 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
15135 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
15136 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
15137 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
15138 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
15139 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
15140
15141 # IFS
15142 # We need space, tab and new line, in precisely that order.
15143 as_nl='
15144 '
15145 IFS="   $as_nl"
15146
15147 # CDPATH.
15148 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
15149
15150 exec 6>&1
15151
15152 _ACEOF
15153
15154 # Files that config.status was made for.
15155 if test -n "$ac_config_files"; then
15156   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
15157 fi
15158
15159 if test -n "$ac_config_headers"; then
15160   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
15161 fi
15162
15163 if test -n "$ac_config_links"; then
15164   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
15165 fi
15166
15167 if test -n "$ac_config_commands"; then
15168   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
15169 fi
15170
15171 cat >>$CONFIG_STATUS <<\EOF
15172
15173 ac_cs_usage="\
15174 \`$as_me' instantiates files from templates according to the
15175 current configuration.
15176
15177 Usage: $0 [OPTIONS] [FILE]...
15178
15179   -h, --help       print this help, then exit
15180   -V, --version    print version number, then exit
15181   -d, --debug      don't remove temporary files
15182       --recheck    update $as_me by reconfiguring in the same conditions
15183   --file=FILE[:TEMPLATE]
15184                    instantiate the configuration file FILE
15185   --header=FILE[:TEMPLATE]
15186                    instantiate the configuration header FILE
15187
15188 Configuration files:
15189 $config_files
15190
15191 Configuration headers:
15192 $config_headers
15193
15194 Configuration commands:
15195 $config_commands
15196
15197 Report bugs to <dickey@invisible-island.net>."
15198 EOF
15199
15200 cat >>$CONFIG_STATUS <<EOF
15201 ac_cs_version="\\
15202 config.status
15203 configured by $0, generated by GNU Autoconf 2.52.20101001,
15204   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
15205
15206 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
15207 Free Software Foundation, Inc.
15208 This config.status script is free software; the Free Software Foundation
15209 gives unlimited permission to copy, distribute and modify it."
15210 srcdir=$srcdir
15211 INSTALL="$INSTALL"
15212 EOF
15213
15214 cat >>$CONFIG_STATUS <<\EOF
15215 # If no file are specified by the user, then we need to provide default
15216 # value.  By we need to know if files were specified by the user.
15217 ac_need_defaults=:
15218 while test $# != 0
15219 do
15220   case $1 in
15221   --*=*)
15222     ac_option=`expr "x$1" : 'x\([^=]*\)='`
15223     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
15224     shift
15225     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
15226     shift
15227     ;;
15228   -*);;
15229   *) # This is not an option, so the user has probably given explicit
15230      # arguments.
15231      ac_need_defaults=false;;
15232   esac
15233
15234   case $1 in
15235   # Handling of the options.
15236 EOF
15237 cat >>$CONFIG_STATUS <<EOF
15238   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
15239     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
15240     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
15241 EOF
15242 cat >>$CONFIG_STATUS <<\EOF
15243   --version | --vers* | -V )
15244     echo "$ac_cs_version"; exit 0 ;;
15245   --he | --h)
15246     # Conflict between --help and --header
15247     { { echo "$as_me:15247: error: ambiguous option: $1
15248 Try \`$0 --help' for more information." >&5
15249 echo "$as_me: error: ambiguous option: $1
15250 Try \`$0 --help' for more information." >&2;}
15251    { (exit 1); exit 1; }; };;
15252   --help | --hel | -h )
15253     echo "$ac_cs_usage"; exit 0 ;;
15254   --debug | --d* | -d )
15255     debug=: ;;
15256   --file | --fil | --fi | --f )
15257     shift
15258     CONFIG_FILES="$CONFIG_FILES $1"
15259     ac_need_defaults=false;;
15260   --header | --heade | --head | --hea )
15261     shift
15262     CONFIG_HEADERS="$CONFIG_HEADERS $1"
15263     ac_need_defaults=false;;
15264
15265   # This is an error.
15266   -*) { { echo "$as_me:15266: error: unrecognized option: $1
15267 Try \`$0 --help' for more information." >&5
15268 echo "$as_me: error: unrecognized option: $1
15269 Try \`$0 --help' for more information." >&2;}
15270    { (exit 1); exit 1; }; } ;;
15271
15272   *) ac_config_targets="$ac_config_targets $1" ;;
15273
15274   esac
15275   shift
15276 done
15277
15278 exec 5>>config.log
15279 cat >&5 << _ACEOF
15280
15281 ## ----------------------- ##
15282 ## Running config.status.  ##
15283 ## ----------------------- ##
15284
15285 This file was extended by $as_me 2.52.20101001, executed with
15286   CONFIG_FILES    = $CONFIG_FILES
15287   CONFIG_HEADERS  = $CONFIG_HEADERS
15288   CONFIG_LINKS    = $CONFIG_LINKS
15289   CONFIG_COMMANDS = $CONFIG_COMMANDS
15290   > $ac_cs_invocation
15291 on `(hostname || uname -n) 2>/dev/null | sed 1q`
15292
15293 _ACEOF
15294 EOF
15295
15296 cat >>$CONFIG_STATUS <<EOF
15297 #
15298 # INIT-COMMANDS section.
15299 #
15300
15301 AWK="$AWK"
15302 ECHO_LD="$ECHO_LD"
15303
15304 EOF
15305
15306 cat >>$CONFIG_STATUS <<\EOF
15307 for ac_config_target in $ac_config_targets
15308 do
15309   case "$ac_config_target" in
15310   # Handling of arguments.
15311   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
15312   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
15313   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
15314   *) { { echo "$as_me:15314: error: invalid argument: $ac_config_target" >&5
15315 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
15316    { (exit 1); exit 1; }; };;
15317   esac
15318 done
15319
15320 # If the user did not use the arguments to specify the items to instantiate,
15321 # then the envvar interface is used.  Set only those that are not.
15322 # We use the long form for the default assignment because of an extremely
15323 # bizarre bug on SunOS 4.1.3.
15324 if $ac_need_defaults; then
15325   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
15326   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
15327   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
15328 fi
15329
15330 # Create a temporary directory, and hook for its removal unless debugging.
15331 $debug ||
15332 {
15333   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
15334   trap '{ (exit 1); exit 1; }' 1 2 13 15
15335 }
15336
15337 # Create a (secure) tmp directory for tmp files.
15338 : ${TMPDIR=/tmp}
15339 {
15340   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
15341   test -n "$tmp" && test -d "$tmp"
15342 }  ||
15343 {
15344   tmp=$TMPDIR/cs$$-$RANDOM
15345   (umask 077 && mkdir $tmp)
15346 } ||
15347 {
15348    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
15349    { (exit 1); exit 1; }
15350 }
15351
15352 EOF
15353
15354 cat >>$CONFIG_STATUS <<EOF
15355
15356 #
15357 # CONFIG_FILES section.
15358 #
15359
15360 # No need to generate the scripts if there are no CONFIG_FILES.
15361 # This happens for instance when ./config.status config.h
15362 if test -n "\$CONFIG_FILES"; then
15363   # Protect against being on the right side of a sed subst in config.status.
15364   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
15365    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
15366 s,@SHELL@,$SHELL,;t t
15367 s,@exec_prefix@,$exec_prefix,;t t
15368 s,@prefix@,$prefix,;t t
15369 s,@program_transform_name@,$program_transform_name,;t t
15370 s,@bindir@,$bindir,;t t
15371 s,@sbindir@,$sbindir,;t t
15372 s,@libexecdir@,$libexecdir,;t t
15373 s,@datadir@,$datadir,;t t
15374 s,@sysconfdir@,$sysconfdir,;t t
15375 s,@sharedstatedir@,$sharedstatedir,;t t
15376 s,@localstatedir@,$localstatedir,;t t
15377 s,@libdir@,$libdir,;t t
15378 s,@includedir@,$includedir,;t t
15379 s,@oldincludedir@,$oldincludedir,;t t
15380 s,@infodir@,$infodir,;t t
15381 s,@mandir@,$mandir,;t t
15382 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
15383 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
15384 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
15385 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
15386 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
15387 s,@build_alias@,$build_alias,;t t
15388 s,@host_alias@,$host_alias,;t t
15389 s,@target_alias@,$target_alias,;t t
15390 s,@ECHO_C@,$ECHO_C,;t t
15391 s,@ECHO_N@,$ECHO_N,;t t
15392 s,@ECHO_T@,$ECHO_T,;t t
15393 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
15394 s,@DEFS@,$DEFS,;t t
15395 s,@LIBS@,$LIBS,;t t
15396 s,@build@,$build,;t t
15397 s,@build_cpu@,$build_cpu,;t t
15398 s,@build_vendor@,$build_vendor,;t t
15399 s,@build_os@,$build_os,;t t
15400 s,@host@,$host,;t t
15401 s,@host_cpu@,$host_cpu,;t t
15402 s,@host_vendor@,$host_vendor,;t t
15403 s,@host_os@,$host_os,;t t
15404 s,@SET_MAKE@,$SET_MAKE,;t t
15405 s,@CC@,$CC,;t t
15406 s,@CFLAGS@,$CFLAGS,;t t
15407 s,@LDFLAGS@,$LDFLAGS,;t t
15408 s,@CPPFLAGS@,$CPPFLAGS,;t t
15409 s,@ac_ct_CC@,$ac_ct_CC,;t t
15410 s,@EXEEXT@,$EXEEXT,;t t
15411 s,@OBJEXT@,$OBJEXT,;t t
15412 s,@CPP@,$CPP,;t t
15413 s,@AWK@,$AWK,;t t
15414 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
15415 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
15416 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
15417 s,@LINT@,$LINT,;t t
15418 s,@LINT_OPTS@,$LINT_OPTS,;t t
15419 s,@CTAGS@,$CTAGS,;t t
15420 s,@ETAGS@,$ETAGS,;t t
15421 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
15422 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
15423 s,@MATH_LIB@,$MATH_LIB,;t t
15424 s,@CC_G_OPT@,$CC_G_OPT,;t t
15425 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
15426 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
15427 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
15428 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
15429 s,@LD@,$LD,;t t
15430 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
15431 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
15432 s,@LD_MODEL@,$LD_MODEL,;t t
15433 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
15434 s,@LIBTOOL@,$LIBTOOL,;t t
15435 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
15436 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
15437 s,@LIB_LINK@,$LIB_LINK,;t t
15438 s,@LINK_TESTS@,$LINK_TESTS,;t t
15439 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
15440 s,@PTHREAD@,$PTHREAD,;t t
15441 s,@TEST_ARGS@,$TEST_ARGS,;t t
15442 s,@TEST_DEPS@,$TEST_DEPS,;t t
15443 s,@TEST_LIBS@,$TEST_LIBS,;t t
15444 s,@TINFO_ARGS@,$TINFO_ARGS,;t t
15445 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
15446 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
15447 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
15448 s,@ECHO_LT@,$ECHO_LT,;t t
15449 s,@ECHO_LD@,$ECHO_LD,;t t
15450 s,@RULE_CC@,$RULE_CC,;t t
15451 s,@SHOW_CC@,$SHOW_CC,;t t
15452 s,@ECHO_CC@,$ECHO_CC,;t t
15453 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
15454 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
15455 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
15456 s,@X_CFLAGS@,$X_CFLAGS,;t t
15457 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
15458 s,@X_LIBS@,$X_LIBS,;t t
15459 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
15460 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
15461 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
15462 CEOF
15463
15464 EOF
15465
15466   cat >>$CONFIG_STATUS <<\EOF
15467   # Split the substitutions into bite-sized pieces for seds with
15468   # small command number limits, like on Digital OSF/1 and HP-UX.
15469   ac_max_sed_lines=48
15470   ac_sed_frag=1 # Number of current file.
15471   ac_beg=1 # First line for current file.
15472   ac_end=$ac_max_sed_lines # Line after last line for current file.
15473   ac_more_lines=:
15474   ac_sed_cmds=
15475   while $ac_more_lines; do
15476     if test $ac_beg -gt 1; then
15477       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15478     else
15479       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15480     fi
15481     if test ! -s $tmp/subs.frag; then
15482       ac_more_lines=false
15483     else
15484       # The purpose of the label and of the branching condition is to
15485       # speed up the sed processing (if there are no `@' at all, there
15486       # is no need to browse any of the substitutions).
15487       # These are the two extra sed commands mentioned above.
15488       (echo ':t
15489   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
15490       if test -z "$ac_sed_cmds"; then
15491         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
15492       else
15493         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
15494       fi
15495       ac_sed_frag=`expr $ac_sed_frag + 1`
15496       ac_beg=$ac_end
15497       ac_end=`expr $ac_end + $ac_max_sed_lines`
15498     fi
15499   done
15500   if test -z "$ac_sed_cmds"; then
15501     ac_sed_cmds=cat
15502   fi
15503 fi # test -n "$CONFIG_FILES"
15504
15505 EOF
15506 cat >>$CONFIG_STATUS <<\EOF
15507 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
15508   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15509   case $ac_file in
15510   - | *:- | *:-:* ) # input from stdin
15511         cat >$tmp/stdin
15512         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15513         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15514   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15515         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15516   * )   ac_file_in=$ac_file.in ;;
15517   esac
15518
15519   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
15520   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15521          X"$ac_file" : 'X\(//\)[^/]' \| \
15522          X"$ac_file" : 'X\(//\)$' \| \
15523          X"$ac_file" : 'X\(/\)' \| \
15524          .     : '\(.\)' 2>/dev/null ||
15525 echo X"$ac_file" |
15526     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15527           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15528           /^X\(\/\/\)$/{ s//\1/; q; }
15529           /^X\(\/\).*/{ s//\1/; q; }
15530           s/.*/./; q'`
15531   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15532     { case "$ac_dir" in
15533   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15534   *)                      as_incr_dir=.;;
15535 esac
15536 as_dummy="$ac_dir"
15537 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15538   case $as_mkdir_dir in
15539     # Skip DOS drivespec
15540     ?:) as_incr_dir=$as_mkdir_dir ;;
15541     *)
15542       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15543       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15544     ;;
15545   esac
15546 done; }
15547
15548     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
15549     # A "../" for each directory in $ac_dir_suffix.
15550     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
15551   else
15552     ac_dir_suffix= ac_dots=
15553   fi
15554
15555   case $srcdir in
15556   .)  ac_srcdir=.
15557       if test -z "$ac_dots"; then
15558          ac_top_srcdir=.
15559       else
15560          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
15561       fi ;;
15562   [\\/]* | ?:[\\/]* )
15563       ac_srcdir=$srcdir$ac_dir_suffix;
15564       ac_top_srcdir=$srcdir ;;
15565   *) # Relative path.
15566     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
15567     ac_top_srcdir=$ac_dots$srcdir ;;
15568   esac
15569
15570   case $INSTALL in
15571   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
15572   *) ac_INSTALL=$ac_dots$INSTALL ;;
15573   esac
15574
15575   if test x"$ac_file" != x-; then
15576     { echo "$as_me:15576: creating $ac_file" >&5
15577 echo "$as_me: creating $ac_file" >&6;}
15578     rm -f "$ac_file"
15579   fi
15580   # Let's still pretend it is `configure' which instantiates (i.e., don't
15581   # use $as_me), people would be surprised to read:
15582   #    /* config.h.  Generated automatically by config.status.  */
15583   configure_input="Generated automatically from `echo $ac_file_in |
15584                                                  sed 's,.*/,,'` by configure."
15585
15586   # First look for the input files in the build tree, otherwise in the
15587   # src tree.
15588   ac_file_inputs=`IFS=:
15589     for f in $ac_file_in; do
15590       case $f in
15591       -) echo $tmp/stdin ;;
15592       [\\/$]*)
15593          # Absolute (can't be DOS-style, as IFS=:)
15594          test -f "$f" || { { echo "$as_me:15594: error: cannot find input file: $f" >&5
15595 echo "$as_me: error: cannot find input file: $f" >&2;}
15596    { (exit 1); exit 1; }; }
15597          echo $f;;
15598       *) # Relative
15599          if test -f "$f"; then
15600            # Build tree
15601            echo $f
15602          elif test -f "$srcdir/$f"; then
15603            # Source tree
15604            echo $srcdir/$f
15605          else
15606            # /dev/null tree
15607            { { echo "$as_me:15607: error: cannot find input file: $f" >&5
15608 echo "$as_me: error: cannot find input file: $f" >&2;}
15609    { (exit 1); exit 1; }; }
15610          fi;;
15611       esac
15612     done` || { (exit 1); exit 1; }
15613 EOF
15614 cat >>$CONFIG_STATUS <<EOF
15615   sed "$ac_vpsub
15616 $extrasub
15617 EOF
15618 cat >>$CONFIG_STATUS <<\EOF
15619 :t
15620 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
15621 s,@configure_input@,$configure_input,;t t
15622 s,@srcdir@,$ac_srcdir,;t t
15623 s,@top_srcdir@,$ac_top_srcdir,;t t
15624 s,@INSTALL@,$ac_INSTALL,;t t
15625 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
15626   rm -f $tmp/stdin
15627   if test x"$ac_file" != x-; then
15628     mv $tmp/out $ac_file
15629   else
15630     cat $tmp/out
15631     rm -f $tmp/out
15632   fi
15633
15634 done
15635 EOF
15636 cat >>$CONFIG_STATUS <<\EOF
15637
15638 #
15639 # CONFIG_HEADER section.
15640 #
15641
15642 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
15643 # NAME is the cpp macro being defined and VALUE is the value it is being given.
15644 #
15645 # ac_d sets the value in "#define NAME VALUE" lines.
15646 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
15647 ac_dB='[        ].*$,\1#\2'
15648 ac_dC=' '
15649 ac_dD=',;t'
15650 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
15651 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15652 ac_iB='\([      ]\),\1#\2define\3'
15653 ac_iC=' '
15654 ac_iD='\4,;t'
15655 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
15656 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15657 ac_uB='$,\1#\2define\3'
15658 ac_uC=' '
15659 ac_uD=',;t'
15660
15661 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
15662   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15663   case $ac_file in
15664   - | *:- | *:-:* ) # input from stdin
15665         cat >$tmp/stdin
15666         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15667         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15668   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15669         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15670   * )   ac_file_in=$ac_file.in ;;
15671   esac
15672
15673   test x"$ac_file" != x- && { echo "$as_me:15673: creating $ac_file" >&5
15674 echo "$as_me: creating $ac_file" >&6;}
15675
15676   # First look for the input files in the build tree, otherwise in the
15677   # src tree.
15678   ac_file_inputs=`IFS=:
15679     for f in $ac_file_in; do
15680       case $f in
15681       -) echo $tmp/stdin ;;
15682       [\\/$]*)
15683          # Absolute (can't be DOS-style, as IFS=:)
15684          test -f "$f" || { { echo "$as_me:15684: error: cannot find input file: $f" >&5
15685 echo "$as_me: error: cannot find input file: $f" >&2;}
15686    { (exit 1); exit 1; }; }
15687          echo $f;;
15688       *) # Relative
15689          if test -f "$f"; then
15690            # Build tree
15691            echo $f
15692          elif test -f "$srcdir/$f"; then
15693            # Source tree
15694            echo $srcdir/$f
15695          else
15696            # /dev/null tree
15697            { { echo "$as_me:15697: error: cannot find input file: $f" >&5
15698 echo "$as_me: error: cannot find input file: $f" >&2;}
15699    { (exit 1); exit 1; }; }
15700          fi;;
15701       esac
15702     done` || { (exit 1); exit 1; }
15703   # Remove the trailing spaces.
15704   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
15705
15706 EOF
15707
15708 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
15709 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
15710 # be either 'cat' or 'sort'.
15711 cat confdefs.h | uniq >conftest.vals
15712
15713 # Break up conftest.vals because some shells have a limit on
15714 # the size of here documents, and old seds have small limits too.
15715
15716 rm -f conftest.tail
15717 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
15718 while grep . conftest.vals >/dev/null
15719 do
15720   # Write chunks of a limited-size here document to conftest.frag.
15721   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
15722   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
15723   echo 'CEOF' >> $CONFIG_STATUS
15724   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
15725   rm -f conftest.vals
15726   mv conftest.tail conftest.vals
15727 done
15728 rm -f conftest.vals
15729
15730 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
15731 # marker @DEFS@.
15732 echo '  cat >> conftest.edit <<CEOF
15733 /@DEFS@/r conftest.frag
15734 /@DEFS@/d
15735 CEOF
15736 sed -f conftest.edit $tmp/in > $tmp/out
15737 rm -f $tmp/in
15738 mv $tmp/out $tmp/in
15739 rm -f conftest.edit conftest.frag
15740 ' >> $CONFIG_STATUS
15741
15742 cat >>$CONFIG_STATUS <<\EOF
15743   # Let's still pretend it is `configure' which instantiates (i.e., don't
15744   # use $as_me), people would be surprised to read:
15745   #    /* config.h.  Generated automatically by config.status.  */
15746   if test x"$ac_file" = x-; then
15747     echo "/* Generated automatically by configure.  */" >$tmp/config.h
15748   else
15749     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
15750   fi
15751   cat $tmp/in >>$tmp/config.h
15752   rm -f $tmp/in
15753   if test x"$ac_file" != x-; then
15754     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
15755       { echo "$as_me:15755: $ac_file is unchanged" >&5
15756 echo "$as_me: $ac_file is unchanged" >&6;}
15757     else
15758       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15759          X"$ac_file" : 'X\(//\)[^/]' \| \
15760          X"$ac_file" : 'X\(//\)$' \| \
15761          X"$ac_file" : 'X\(/\)' \| \
15762          .     : '\(.\)' 2>/dev/null ||
15763 echo X"$ac_file" |
15764     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15765           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15766           /^X\(\/\/\)$/{ s//\1/; q; }
15767           /^X\(\/\).*/{ s//\1/; q; }
15768           s/.*/./; q'`
15769       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15770         { case "$ac_dir" in
15771   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15772   *)                      as_incr_dir=.;;
15773 esac
15774 as_dummy="$ac_dir"
15775 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15776   case $as_mkdir_dir in
15777     # Skip DOS drivespec
15778     ?:) as_incr_dir=$as_mkdir_dir ;;
15779     *)
15780       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15781       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15782     ;;
15783   esac
15784 done; }
15785
15786       fi
15787       rm -f $ac_file
15788       mv $tmp/config.h $ac_file
15789     fi
15790   else
15791     cat $tmp/config.h
15792     rm -f $tmp/config.h
15793   fi
15794 done
15795 EOF
15796 cat >>$CONFIG_STATUS <<\EOF
15797 #
15798 # CONFIG_COMMANDS section.
15799 #
15800 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
15801   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
15802   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
15803
15804   case $ac_dest in
15805     default )
15806
15807 for cf_dir in .
15808 do
15809         if test ! -d $srcdir/$cf_dir; then
15810                 continue
15811         elif test -f $srcdir/$cf_dir/programs; then
15812                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
15813         fi
15814 done
15815
15816         cat >>Makefile <<TEST_EOF
15817
15818 # These rules are generated so we do not rely on suffix rules, which do not
15819 # work consistently for different make-programs (the '\$(MODEL)/' confuses
15820 # some, and the '\$x' confuses others).
15821 TEST_EOF
15822
15823 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
15824 for N in $LIST
15825 do
15826         cat >>Makefile <<TEST_EOF
15827
15828 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
15829         \$(srcdir)/test.priv.h \\
15830         ncurses_cfg.h
15831         @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
15832 TEST_EOF
15833 done
15834
15835 if test -f ../config.guess && test -f ../config.sub
15836 then
15837         cat >>Makefile <<TEST_EOF
15838
15839 # if we used CF_INHERIT for getting these files, we can remove them
15840 distclean::
15841         rm -f config.guess config.sub
15842 TEST_EOF
15843 fi
15844  ;;
15845   esac
15846 done
15847 EOF
15848
15849 cat >>$CONFIG_STATUS <<\EOF
15850
15851 { (exit 0); exit 0; }
15852 EOF
15853 chmod +x $CONFIG_STATUS
15854 ac_clean_files=$ac_clean_files_save
15855
15856 # configure is writing to config.log, and then calls config.status.
15857 # config.status does its own redirection, appending to config.log.
15858 # Unfortunately, on DOS this fails, as config.log is still kept open
15859 # by configure, so config.status won't be able to write to it; its
15860 # output is simply discarded.  So we exec the FD to /dev/null,
15861 # effectively closing config.log, so it can be properly (re)opened and
15862 # appended to by config.status.  When coming back to configure, we
15863 # need to make the FD available again.
15864 if test "$no_create" != yes; then
15865   ac_cs_success=:
15866   exec 5>/dev/null
15867   $SHELL $CONFIG_STATUS || ac_cs_success=false
15868   exec 5>>config.log
15869   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
15870   # would make configure fail if this is the last instruction.
15871   $ac_cs_success || { (exit 1); exit 1; }
15872 fi
15873