]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.9 - patch 20111030
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20101002.
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
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datadir='${prefix}/share'
138 sysconfdir='${prefix}/etc'
139 sharedstatedir='${prefix}/com'
140 localstatedir='${prefix}/var'
141 libdir='${exec_prefix}/lib'
142 includedir='${prefix}/include'
143 oldincludedir='/usr/include'
144 infodir='${prefix}/info'
145 mandir='${prefix}/man'
146
147 # Identity of this package.
148 PACKAGE_NAME=
149 PACKAGE_TARNAME=
150 PACKAGE_VERSION=
151 PACKAGE_STRING=
152 PACKAGE_BUGREPORT=
153
154 ac_prev=
155 for ac_option
156 do
157   # If the previous option needs an argument, assign it.
158   if test -n "$ac_prev"; then
159     eval "$ac_prev=\$ac_option"
160     ac_prev=
161     continue
162   fi
163
164   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
165
166   # Accept the important Cygnus configure options, so we can diagnose typos.
167
168   case $ac_option in
169
170   -bindir | --bindir | --bindi | --bind | --bin | --bi)
171     ac_prev=bindir ;;
172   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
173     bindir=$ac_optarg ;;
174
175   -build | --build | --buil | --bui | --bu)
176     ac_prev=build_alias ;;
177   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
178     build_alias=$ac_optarg ;;
179
180   -cache-file | --cache-file | --cache-fil | --cache-fi \
181   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
182     ac_prev=cache_file ;;
183   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
184   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
185     cache_file=$ac_optarg ;;
186
187   --config-cache | -C)
188     cache_file=config.cache ;;
189
190   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
191     ac_prev=datadir ;;
192   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
193   | --da=*)
194     datadir=$ac_optarg ;;
195
196   -disable-* | --disable-*)
197     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
198     # Reject names that are not valid shell variable names.
199     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
200       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
201    { (exit 1); exit 1; }; }
202     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
203     eval "enable_$ac_feature=no" ;;
204
205   -enable-* | --enable-*)
206     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
207     # Reject names that are not valid shell variable names.
208     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
209       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
210    { (exit 1); exit 1; }; }
211     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
212     case $ac_option in
213       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
214       *) ac_optarg=yes ;;
215     esac
216     eval "enable_$ac_feature='$ac_optarg'" ;;
217
218   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
219   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
220   | --exec | --exe | --ex)
221     ac_prev=exec_prefix ;;
222   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
223   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
224   | --exec=* | --exe=* | --ex=*)
225     exec_prefix=$ac_optarg ;;
226
227   -gas | --gas | --ga | --g)
228     # Obsolete; use --with-gas.
229     with_gas=yes ;;
230
231   -help | --help | --hel | --he | -h)
232     ac_init_help=long ;;
233   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
234     ac_init_help=recursive ;;
235   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
236     ac_init_help=short ;;
237
238   -host | --host | --hos | --ho)
239     ac_prev=host_alias ;;
240   -host=* | --host=* | --hos=* | --ho=*)
241     host_alias=$ac_optarg ;;
242
243   -includedir | --includedir | --includedi | --included | --include \
244   | --includ | --inclu | --incl | --inc)
245     ac_prev=includedir ;;
246   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
247   | --includ=* | --inclu=* | --incl=* | --inc=*)
248     includedir=$ac_optarg ;;
249
250   -infodir | --infodir | --infodi | --infod | --info | --inf)
251     ac_prev=infodir ;;
252   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
253     infodir=$ac_optarg ;;
254
255   -libdir | --libdir | --libdi | --libd)
256     ac_prev=libdir ;;
257   -libdir=* | --libdir=* | --libdi=* | --libd=*)
258     libdir=$ac_optarg ;;
259
260   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
261   | --libexe | --libex | --libe)
262     ac_prev=libexecdir ;;
263   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
264   | --libexe=* | --libex=* | --libe=*)
265     libexecdir=$ac_optarg ;;
266
267   -localstatedir | --localstatedir | --localstatedi | --localstated \
268   | --localstate | --localstat | --localsta | --localst \
269   | --locals | --local | --loca | --loc | --lo)
270     ac_prev=localstatedir ;;
271   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
272   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
273   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
274     localstatedir=$ac_optarg ;;
275
276   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
277     ac_prev=mandir ;;
278   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
279     mandir=$ac_optarg ;;
280
281   -nfp | --nfp | --nf)
282     # Obsolete; use --without-fp.
283     with_fp=no ;;
284
285   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
286   | --no-cr | --no-c)
287     no_create=yes ;;
288
289   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
290   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
291     no_recursion=yes ;;
292
293   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
294   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
295   | --oldin | --oldi | --old | --ol | --o)
296     ac_prev=oldincludedir ;;
297   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
298   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
299   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
300     oldincludedir=$ac_optarg ;;
301
302   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
303     ac_prev=prefix ;;
304   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
305     prefix=$ac_optarg ;;
306
307   -program-prefix | --program-prefix | --program-prefi | --program-pref \
308   | --program-pre | --program-pr | --program-p)
309     ac_prev=program_prefix ;;
310   -program-prefix=* | --program-prefix=* | --program-prefi=* \
311   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
312     program_prefix=$ac_optarg ;;
313
314   -program-suffix | --program-suffix | --program-suffi | --program-suff \
315   | --program-suf | --program-su | --program-s)
316     ac_prev=program_suffix ;;
317   -program-suffix=* | --program-suffix=* | --program-suffi=* \
318   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
319     program_suffix=$ac_optarg ;;
320
321   -program-transform-name | --program-transform-name \
322   | --program-transform-nam | --program-transform-na \
323   | --program-transform-n | --program-transform- \
324   | --program-transform | --program-transfor \
325   | --program-transfo | --program-transf \
326   | --program-trans | --program-tran \
327   | --progr-tra | --program-tr | --program-t)
328     ac_prev=program_transform_name ;;
329   -program-transform-name=* | --program-transform-name=* \
330   | --program-transform-nam=* | --program-transform-na=* \
331   | --program-transform-n=* | --program-transform-=* \
332   | --program-transform=* | --program-transfor=* \
333   | --program-transfo=* | --program-transf=* \
334   | --program-trans=* | --program-tran=* \
335   | --progr-tra=* | --program-tr=* | --program-t=*)
336     program_transform_name=$ac_optarg ;;
337
338   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
339   | -silent | --silent | --silen | --sile | --sil)
340     silent=yes ;;
341
342   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
343     ac_prev=sbindir ;;
344   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
345   | --sbi=* | --sb=*)
346     sbindir=$ac_optarg ;;
347
348   -sharedstatedir | --sharedstatedir | --sharedstatedi \
349   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
350   | --sharedst | --shareds | --shared | --share | --shar \
351   | --sha | --sh)
352     ac_prev=sharedstatedir ;;
353   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
354   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
355   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
356   | --sha=* | --sh=*)
357     sharedstatedir=$ac_optarg ;;
358
359   -site | --site | --sit)
360     ac_prev=site ;;
361   -site=* | --site=* | --sit=*)
362     site=$ac_optarg ;;
363
364   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
365     ac_prev=srcdir ;;
366   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
367     srcdir=$ac_optarg ;;
368
369   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
370   | --syscon | --sysco | --sysc | --sys | --sy)
371     ac_prev=sysconfdir ;;
372   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
373   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
374     sysconfdir=$ac_optarg ;;
375
376   -target | --target | --targe | --targ | --tar | --ta | --t)
377     ac_prev=target_alias ;;
378   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
379     target_alias=$ac_optarg ;;
380
381   -v | -verbose | --verbose | --verbos | --verbo | --verb)
382     verbose=yes ;;
383
384   -version | --version | --versio | --versi | --vers | -V)
385     ac_init_version=: ;;
386
387   -with-* | --with-*)
388     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
389     # Reject names that are not valid shell variable names.
390     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
391       { echo "$as_me: error: invalid package name: $ac_package" >&2
392    { (exit 1); exit 1; }; }
393     ac_package=`echo $ac_package| sed 's/-/_/g'`
394     case $ac_option in
395       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
396       *) ac_optarg=yes ;;
397     esac
398     eval "with_$ac_package='$ac_optarg'" ;;
399
400   -without-* | --without-*)
401     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
402     # Reject names that are not valid shell variable names.
403     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
404       { echo "$as_me: error: invalid package name: $ac_package" >&2
405    { (exit 1); exit 1; }; }
406     ac_package=`echo $ac_package | sed 's/-/_/g'`
407     eval "with_$ac_package=no" ;;
408
409   --x)
410     # Obsolete; use --with-x.
411     with_x=yes ;;
412
413   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
414   | --x-incl | --x-inc | --x-in | --x-i)
415     ac_prev=x_includes ;;
416   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
417   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
418     x_includes=$ac_optarg ;;
419
420   -x-libraries | --x-libraries | --x-librarie | --x-librari \
421   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
422     ac_prev=x_libraries ;;
423   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
424   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
425     x_libraries=$ac_optarg ;;
426
427   -*) { echo "$as_me: error: unrecognized option: $ac_option
428 Try \`$0 --help' for more information." >&2
429    { (exit 1); exit 1; }; }
430     ;;
431
432   *=*)
433     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
434     # Reject names that are not valid shell variable names.
435     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
436       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
437    { (exit 1); exit 1; }; }
438     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
439     eval "$ac_envvar='$ac_optarg'"
440     export $ac_envvar ;;
441
442   *)
443     # FIXME: should be removed in autoconf 3.0.
444     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
445     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
446       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
447     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
448     ;;
449
450   esac
451 done
452
453 if test -n "$ac_prev"; then
454   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
455   { echo "$as_me: error: missing argument to $ac_option" >&2
456    { (exit 1); exit 1; }; }
457 fi
458
459 # Be sure to have absolute paths.
460 for ac_var in exec_prefix prefix
461 do
462   eval ac_val=$`echo $ac_var`
463   case $ac_val in
464     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
465     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
466    { (exit 1); exit 1; }; };;
467   esac
468 done
469
470 # Be sure to have absolute paths.
471 for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
472               localstatedir libdir includedir oldincludedir infodir mandir
473 do
474   eval ac_val=$`echo $ac_var`
475   case $ac_val in
476     [\\/$]* | ?:[\\/]* ) ;;
477     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
478    { (exit 1); exit 1; }; };;
479   esac
480 done
481
482 # There might be people who depend on the old broken behavior: `$host'
483 # used to hold the argument of --host etc.
484 build=$build_alias
485 host=$host_alias
486 target=$target_alias
487
488 # FIXME: should be removed in autoconf 3.0.
489 if test "x$host_alias" != x; then
490   if test "x$build_alias" = x; then
491     cross_compiling=maybe
492     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
493     If a cross compiler is detected then cross compile mode will be used." >&2
494   elif test "x$build_alias" != "x$host_alias"; then
495     cross_compiling=yes
496   fi
497 fi
498
499 ac_tool_prefix=
500 test -n "$host_alias" && ac_tool_prefix=$host_alias-
501
502 test "$silent" = yes && exec 6>/dev/null
503
504 # Find the source files, if location was not specified.
505 if test -z "$srcdir"; then
506   ac_srcdir_defaulted=yes
507   # Try the directory containing this script, then its parent.
508   ac_prog=$0
509   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
510   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
511   srcdir=$ac_confdir
512   if test ! -r $srcdir/$ac_unique_file; then
513     srcdir=..
514   fi
515 else
516   ac_srcdir_defaulted=no
517 fi
518 if test ! -r $srcdir/$ac_unique_file; then
519   if test "$ac_srcdir_defaulted" = yes; then
520     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
521    { (exit 1); exit 1; }; }
522   else
523     { echo "$as_me: error: cannot find sources in $srcdir" >&2
524    { (exit 1); exit 1; }; }
525   fi
526 fi
527 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
528 ac_env_build_alias_set=${build_alias+set}
529 ac_env_build_alias_value=$build_alias
530 ac_cv_env_build_alias_set=${build_alias+set}
531 ac_cv_env_build_alias_value=$build_alias
532 ac_env_host_alias_set=${host_alias+set}
533 ac_env_host_alias_value=$host_alias
534 ac_cv_env_host_alias_set=${host_alias+set}
535 ac_cv_env_host_alias_value=$host_alias
536 ac_env_target_alias_set=${target_alias+set}
537 ac_env_target_alias_value=$target_alias
538 ac_cv_env_target_alias_set=${target_alias+set}
539 ac_cv_env_target_alias_value=$target_alias
540 ac_env_CC_set=${CC+set}
541 ac_env_CC_value=$CC
542 ac_cv_env_CC_set=${CC+set}
543 ac_cv_env_CC_value=$CC
544 ac_env_CFLAGS_set=${CFLAGS+set}
545 ac_env_CFLAGS_value=$CFLAGS
546 ac_cv_env_CFLAGS_set=${CFLAGS+set}
547 ac_cv_env_CFLAGS_value=$CFLAGS
548 ac_env_LDFLAGS_set=${LDFLAGS+set}
549 ac_env_LDFLAGS_value=$LDFLAGS
550 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
551 ac_cv_env_LDFLAGS_value=$LDFLAGS
552 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
553 ac_env_CPPFLAGS_value=$CPPFLAGS
554 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
555 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
556 ac_env_CPP_set=${CPP+set}
557 ac_env_CPP_value=$CPP
558 ac_cv_env_CPP_set=${CPP+set}
559 ac_cv_env_CPP_value=$CPP
560
561 #
562 # Report the --help message.
563 #
564 if test "$ac_init_help" = "long"; then
565   # Omit some internal or obsolete options to make the list less imposing.
566   # This message is too long to be a string in the A/UX 3.1 sh.
567   cat <<EOF
568 \`configure' configures this package to adapt to many kinds of systems.
569
570 Usage: $0 [OPTION]... [VAR=VALUE]...
571
572 To assign environment variables (e.g., CC, CFLAGS...), specify them as
573 VAR=VALUE.  See below for descriptions of some of the useful variables.
574
575 Defaults for the options are specified in brackets.
576
577 Configuration:
578   -h, --help              display this help and exit
579       --help=short        display options specific to this package
580       --help=recursive    display the short help of all the included packages
581   -V, --version           display version information and exit
582   -q, --quiet, --silent   do not print \`checking...' messages
583       --cache-file=FILE   cache test results in FILE [disabled]
584   -C, --config-cache      alias for \`--cache-file=config.cache'
585   -n, --no-create         do not create output files
586       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
587
588 EOF
589
590   cat <<EOF
591 Installation directories:
592   --prefix=PREFIX         install architecture-independent files in PREFIX
593                           [$ac_default_prefix]
594   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
595                           [PREFIX]
596
597 By default, \`make install' will install all the files in
598 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
599 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
600 for instance \`--prefix=\$HOME'.
601
602 For better control, use the options below.
603
604 Fine tuning of the installation directories:
605   --bindir=DIR            user executables [EPREFIX/bin]
606   --sbindir=DIR           system admin executables [EPREFIX/sbin]
607   --libexecdir=DIR        program executables [EPREFIX/libexec]
608   --datadir=DIR           read-only architecture-independent data [PREFIX/share]
609   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
610   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
611   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
612   --libdir=DIR            object code libraries [EPREFIX/lib]
613   --includedir=DIR        C header files [PREFIX/include]
614   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
615   --infodir=DIR           info documentation [PREFIX/info]
616   --mandir=DIR            man documentation [PREFIX/man]
617 EOF
618
619   cat <<\EOF
620
621 Program names:
622   --program-prefix=PREFIX            prepend PREFIX to installed program names
623   --program-suffix=SUFFIX            append SUFFIX to installed program names
624   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
625
626 X features:
627   --x-includes=DIR    X include files are in DIR
628   --x-libraries=DIR   X library files are in DIR
629
630 System types:
631   --build=BUILD           configure for building on BUILD [guessed]
632   --host=HOST       build programs to run on HOST [BUILD]
633 EOF
634 fi
635
636 if test -n "$ac_init_help"; then
637
638   cat <<\EOF
639
640 Optional Features:
641   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
642   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
643
644 Optional Packages:
645   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
646   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
647
648   --disable-echo          display "compiling" commands
649   --enable-warnings       test: turn on gcc compiler warnings
650   --with-dmalloc          test: use Gray Watson's dmalloc library
651   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
652   --with-valgrind         test: use valgrind
653   --disable-leaks         test: free permanent memory, analyze leaks
654   --disable-widec           disable checks for wide-character functions
655   --with-curses-dir=DIR   directory in which (n)curses is installed
656   --with-ncursesw         use wide ncurses-libraries (installed)
657   --with-ncurses          use ncurses-libraries (installed)
658   --with-pdcurses         compile/link with pdcurses X11 library
659   --with-curses-colr      compile/link with HPUX 10.x color-curses
660   --with-curses-5lib      compile/link with SunOS 5lib curses
661   --with-Xaw3d            link with Xaw 3d library
662   --with-neXtaw           link with neXT Athena library
663   --with-XawPlus          link with Athena-Plus library
664   --with-pkg-config{=path} enable/disable use of pkg-config
665   --with-x                use the X Window System
666   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
667   --disable-rpath-hack    don't add rpath options for additional libraries
668
669 Some influential environment variables:
670   CC          C compiler command
671   CFLAGS      C compiler flags
672   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
673               nonstandard directory <lib dir>
674   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
675               headers in a nonstandard directory <include dir>
676   CPP         C preprocessor
677
678 Use these variables to override the choices made by `configure' or to help
679 it to find libraries and programs with nonstandard names/locations.
680
681 EOF
682 fi
683
684 if test "$ac_init_help" = "recursive"; then
685   # If there are subdirs, report their specific --help.
686   ac_popdir=`pwd`
687   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
688     cd $ac_subdir
689     # A "../" for each directory in /$ac_subdir.
690     ac_dots=`echo $ac_subdir |
691              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
692
693     case $srcdir in
694     .) # No --srcdir option.  We are building in place.
695       ac_sub_srcdir=$srcdir ;;
696     [\\/]* | ?:[\\/]* ) # Absolute path.
697       ac_sub_srcdir=$srcdir/$ac_subdir ;;
698     *) # Relative path.
699       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
700     esac
701
702     # Check for guested configure; otherwise get Cygnus style configure.
703     if test -f $ac_sub_srcdir/configure.gnu; then
704       echo
705       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
706     elif test -f $ac_sub_srcdir/configure; then
707       echo
708       $SHELL $ac_sub_srcdir/configure  --help=recursive
709     elif test -f $ac_sub_srcdir/configure.ac ||
710            test -f $ac_sub_srcdir/configure.in; then
711       echo
712       $ac_configure --help
713     else
714       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
715     fi
716     cd $ac_popdir
717   done
718 fi
719
720 test -n "$ac_init_help" && exit 0
721 if $ac_init_version; then
722   cat <<\EOF
723
724 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
725 Free Software Foundation, Inc.
726 This configure script is free software; the Free Software Foundation
727 gives unlimited permission to copy, distribute and modify it.
728 EOF
729   exit 0
730 fi
731 exec 5>config.log
732 cat >&5 <<EOF
733 This file contains any messages produced by compilers while
734 running configure, to aid debugging if configure makes a mistake.
735
736 It was created by $as_me, which was
737 generated by GNU Autoconf 2.52.20101002.  Invocation command line was
738
739   $ $0 $@
740
741 EOF
742 {
743 cat <<_ASUNAME
744 ## ---------- ##
745 ## Platform.  ##
746 ## ---------- ##
747
748 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
749 uname -m = `(uname -m) 2>/dev/null || echo unknown`
750 uname -r = `(uname -r) 2>/dev/null || echo unknown`
751 uname -s = `(uname -s) 2>/dev/null || echo unknown`
752 uname -v = `(uname -v) 2>/dev/null || echo unknown`
753
754 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
755 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
756
757 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
758 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
759 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
760 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
761 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
762 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
763 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
764
765 PATH = $PATH
766
767 _ASUNAME
768 } >&5
769
770 cat >&5 <<EOF
771 ## ------------ ##
772 ## Core tests.  ##
773 ## ------------ ##
774
775 EOF
776
777 # Keep a trace of the command line.
778 # Strip out --no-create and --no-recursion so they do not pile up.
779 # Also quote any args containing shell meta-characters.
780 ac_configure_args=
781 ac_sep=
782 for ac_arg
783 do
784   case $ac_arg in
785   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
786   | --no-cr | --no-c) ;;
787   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
788   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
789   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
790     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
791     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
792     ac_sep=" " ;;
793   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
794      ac_sep=" " ;;
795   esac
796   # Get rid of the leading space.
797 done
798
799 # When interrupted or exit'd, cleanup temporary files, and complete
800 # config.log.  We remove comments because anyway the quotes in there
801 # would cause problems or look ugly.
802 trap 'exit_status=$?
803   # Save into config.log some information that might help in debugging.
804   echo >&5
805   echo "## ----------------- ##" >&5
806   echo "## Cache variables.  ##" >&5
807   echo "## ----------------- ##" >&5
808   echo >&5
809   # The following way of writing the cache mishandles newlines in values,
810 {
811   (set) 2>&1 |
812     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
813     *ac_space=\ *)
814       sed -n \
815         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
816           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
817       ;;
818     *)
819       sed -n \
820         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
821       ;;
822     esac;
823 } >&5
824   sed "/^$/d" confdefs.h >conftest.log
825   if test -s conftest.log; then
826     echo >&5
827     echo "## ------------ ##" >&5
828     echo "## confdefs.h.  ##" >&5
829     echo "## ------------ ##" >&5
830     echo >&5
831     cat conftest.log >&5
832   fi
833   (echo; echo) >&5
834   test "$ac_signal" != 0 &&
835     echo "$as_me: caught signal $ac_signal" >&5
836   echo "$as_me: exit $exit_status" >&5
837   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
838     exit $exit_status
839      ' 0
840 for ac_signal in 1 2 13 15; do
841   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
842 done
843 ac_signal=0
844
845 # confdefs.h avoids OS command line length limits that DEFS can exceed.
846 rm -rf conftest* confdefs.h
847 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
848 echo >confdefs.h
849
850 # Let the site file select an alternate cache file if it wants to.
851 # Prefer explicitly selected file to automatically selected ones.
852 if test -z "$CONFIG_SITE"; then
853   if test "x$prefix" != xNONE; then
854     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
855   else
856     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
857   fi
858 fi
859 for ac_site_file in $CONFIG_SITE; do
860   if test -r "$ac_site_file"; then
861     { echo "$as_me:861: loading site script $ac_site_file" >&5
862 echo "$as_me: loading site script $ac_site_file" >&6;}
863     cat "$ac_site_file" >&5
864     . "$ac_site_file"
865   fi
866 done
867
868 if test -r "$cache_file"; then
869   # Some versions of bash will fail to source /dev/null (special
870   # files actually), so we avoid doing that.
871   if test -f "$cache_file"; then
872     { echo "$as_me:872: loading cache $cache_file" >&5
873 echo "$as_me: loading cache $cache_file" >&6;}
874     case $cache_file in
875       [\\/]* | ?:[\\/]* ) . $cache_file;;
876       *)                      . ./$cache_file;;
877     esac
878   fi
879 else
880   { echo "$as_me:880: creating cache $cache_file" >&5
881 echo "$as_me: creating cache $cache_file" >&6;}
882   >$cache_file
883 fi
884
885 # Check that the precious variables saved in the cache have kept the same
886 # value.
887 ac_cache_corrupted=false
888 for ac_var in `(set) 2>&1 |
889                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
890   eval ac_old_set=\$ac_cv_env_${ac_var}_set
891   eval ac_new_set=\$ac_env_${ac_var}_set
892   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
893   eval ac_new_val="\$ac_env_${ac_var}_value"
894   case $ac_old_set,$ac_new_set in
895     set,)
896       { echo "$as_me:896: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
897 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
898       ac_cache_corrupted=: ;;
899     ,set)
900       { echo "$as_me:900: error: \`$ac_var' was not set in the previous run" >&5
901 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
902       ac_cache_corrupted=: ;;
903     ,);;
904     *)
905       if test "x$ac_old_val" != "x$ac_new_val"; then
906         { echo "$as_me:906: error: \`$ac_var' has changed since the previous run:" >&5
907 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
908         { echo "$as_me:908:   former value:  $ac_old_val" >&5
909 echo "$as_me:   former value:  $ac_old_val" >&2;}
910         { echo "$as_me:910:   current value: $ac_new_val" >&5
911 echo "$as_me:   current value: $ac_new_val" >&2;}
912         ac_cache_corrupted=:
913       fi;;
914   esac
915   # Pass precious variables to config.status.  It doesn't matter if
916   # we pass some twice (in addition to the command line arguments).
917   if test "$ac_new_set" = set; then
918     case $ac_new_val in
919     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
920       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
921       ac_configure_args="$ac_configure_args '$ac_arg'"
922       ;;
923     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
924        ;;
925     esac
926   fi
927 done
928 if $ac_cache_corrupted; then
929   { echo "$as_me:929: error: changes in the environment can compromise the build" >&5
930 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
931   { { echo "$as_me:931: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
932 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
933    { (exit 1); exit 1; }; }
934 fi
935
936 ac_ext=c
937 ac_cpp='$CPP $CPPFLAGS'
938 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
939 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
940 ac_compiler_gnu=$ac_cv_c_compiler_gnu
941 ac_main_return=return
942
943 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
944   *c*,-n*) ECHO_N= ECHO_C='
945 ' ECHO_T='      ' ;;
946   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
947   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
948 esac
949 echo "#! $SHELL" >conftest.sh
950 echo  "exit 0"   >>conftest.sh
951 chmod +x conftest.sh
952 if { (echo "$as_me:952: PATH=\".;.\"; conftest.sh") >&5
953   (PATH=".;."; conftest.sh) 2>&5
954   ac_status=$?
955   echo "$as_me:955: \$? = $ac_status" >&5
956   (exit $ac_status); }; then
957   ac_path_separator=';'
958 else
959   ac_path_separator=:
960 fi
961 PATH_SEPARATOR="$ac_path_separator"
962 rm -f conftest.sh
963
964 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
965
966 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
967
968 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
969
970 ac_aux_dir=
971 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
972   if test -f $ac_dir/install-sh; then
973     ac_aux_dir=$ac_dir
974     ac_install_sh="$ac_aux_dir/install-sh -c"
975     break
976   elif test -f $ac_dir/install.sh; then
977     ac_aux_dir=$ac_dir
978     ac_install_sh="$ac_aux_dir/install.sh -c"
979     break
980   elif test -f $ac_dir/shtool; then
981     ac_aux_dir=$ac_dir
982     ac_install_sh="$ac_aux_dir/shtool install -c"
983     break
984   fi
985 done
986 if test -z "$ac_aux_dir"; then
987   { { echo "$as_me:987: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
988 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
989    { (exit 1); exit 1; }; }
990 fi
991 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
992 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
993 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
994
995 # Make sure we can run config.sub.
996 $ac_config_sub sun4 >/dev/null 2>&1 ||
997   { { echo "$as_me:997: error: cannot run $ac_config_sub" >&5
998 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
999    { (exit 1); exit 1; }; }
1000
1001 echo "$as_me:1001: checking build system type" >&5
1002 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1003 if test "${ac_cv_build+set}" = set; then
1004   echo $ECHO_N "(cached) $ECHO_C" >&6
1005 else
1006   ac_cv_build_alias=$build_alias
1007 test -z "$ac_cv_build_alias" &&
1008   ac_cv_build_alias=`$ac_config_guess`
1009 test -z "$ac_cv_build_alias" &&
1010   { { echo "$as_me:1010: error: cannot guess build type; you must specify one" >&5
1011 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1012    { (exit 1); exit 1; }; }
1013 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1014   { { echo "$as_me:1014: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1015 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1016    { (exit 1); exit 1; }; }
1017
1018 fi
1019 echo "$as_me:1019: result: $ac_cv_build" >&5
1020 echo "${ECHO_T}$ac_cv_build" >&6
1021 build=$ac_cv_build
1022 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1023 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1024 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1025
1026 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1027         echo "$as_me:1027: checking host system type" >&5
1028 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1029 if test "${ac_cv_host+set}" = set; then
1030   echo $ECHO_N "(cached) $ECHO_C" >&6
1031 else
1032   ac_cv_host_alias=$host_alias
1033 test -z "$ac_cv_host_alias" &&
1034   ac_cv_host_alias=$ac_cv_build_alias
1035 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1036   { { echo "$as_me:1036: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1037 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1038    { (exit 1); exit 1; }; }
1039
1040 fi
1041 echo "$as_me:1041: result: $ac_cv_host" >&5
1042 echo "${ECHO_T}$ac_cv_host" >&6
1043 host=$ac_cv_host
1044 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1045 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1046 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1047
1048         system_name="$host_os"
1049 else
1050         system_name="`(uname -s -r) 2>/dev/null`"
1051         if test -z "$system_name" ; then
1052                 system_name="`(hostname) 2>/dev/null`"
1053         fi
1054 fi
1055 test -n "$system_name" && cat >>confdefs.h <<EOF
1056 #define SYSTEM_NAME "$system_name"
1057 EOF
1058
1059 if test "${cf_cv_system_name+set}" = set; then
1060   echo $ECHO_N "(cached) $ECHO_C" >&6
1061 else
1062   cf_cv_system_name="$system_name"
1063 fi
1064
1065 test -z "$system_name" && system_name="$cf_cv_system_name"
1066 test -n "$cf_cv_system_name" && echo "$as_me:1066: result: Configuring for $cf_cv_system_name" >&5
1067 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1068
1069 if test ".$system_name" != ".$cf_cv_system_name" ; then
1070         echo "$as_me:1070: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1071 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1072         { { echo "$as_me:1072: error: \"Please remove config.cache and try again.\"" >&5
1073 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1074    { (exit 1); exit 1; }; }
1075 fi
1076
1077 test "$program_prefix" != NONE &&
1078   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1079 # Use a double $ so make ignores it.
1080 test "$program_suffix" != NONE &&
1081   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1082 # Double any \ or $.  echo might interpret backslashes.
1083 # By default was `s,x,x', remove it if useless.
1084 cat <<\_ACEOF >conftest.sed
1085 s/[\\$]/&&/g;s/;s,x,x,$//
1086 _ACEOF
1087 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1088 rm conftest.sed
1089
1090 echo "$as_me:1090: checking whether ${MAKE-make} sets \${MAKE}" >&5
1091 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1092 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1093 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1094   echo $ECHO_N "(cached) $ECHO_C" >&6
1095 else
1096   cat >conftest.make <<\EOF
1097 all:
1098         @echo 'ac_maketemp="${MAKE}"'
1099 EOF
1100 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1101 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1102 if test -n "$ac_maketemp"; then
1103   eval ac_cv_prog_make_${ac_make}_set=yes
1104 else
1105   eval ac_cv_prog_make_${ac_make}_set=no
1106 fi
1107 rm -f conftest.make
1108 fi
1109 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1110   echo "$as_me:1110: result: yes" >&5
1111 echo "${ECHO_T}yes" >&6
1112   SET_MAKE=
1113 else
1114   echo "$as_me:1114: result: no" >&5
1115 echo "${ECHO_T}no" >&6
1116   SET_MAKE="MAKE=${MAKE-make}"
1117 fi
1118
1119 ac_ext=c
1120 ac_cpp='$CPP $CPPFLAGS'
1121 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1122 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1123 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1124 ac_main_return=return
1125 if test -n "$ac_tool_prefix"; then
1126   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1127 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1128 echo "$as_me:1128: checking for $ac_word" >&5
1129 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1130 if test "${ac_cv_prog_CC+set}" = set; then
1131   echo $ECHO_N "(cached) $ECHO_C" >&6
1132 else
1133   if test -n "$CC"; then
1134   ac_cv_prog_CC="$CC" # Let the user override the test.
1135 else
1136   ac_save_IFS=$IFS; IFS=$ac_path_separator
1137 ac_dummy="$PATH"
1138 for ac_dir in $ac_dummy; do
1139   IFS=$ac_save_IFS
1140   test -z "$ac_dir" && ac_dir=.
1141   $as_executable_p "$ac_dir/$ac_word" || continue
1142 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1143 echo "$as_me:1143: found $ac_dir/$ac_word" >&5
1144 break
1145 done
1146
1147 fi
1148 fi
1149 CC=$ac_cv_prog_CC
1150 if test -n "$CC"; then
1151   echo "$as_me:1151: result: $CC" >&5
1152 echo "${ECHO_T}$CC" >&6
1153 else
1154   echo "$as_me:1154: result: no" >&5
1155 echo "${ECHO_T}no" >&6
1156 fi
1157
1158 fi
1159 if test -z "$ac_cv_prog_CC"; then
1160   ac_ct_CC=$CC
1161   # Extract the first word of "gcc", so it can be a program name with args.
1162 set dummy gcc; ac_word=$2
1163 echo "$as_me:1163: checking for $ac_word" >&5
1164 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1165 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1166   echo $ECHO_N "(cached) $ECHO_C" >&6
1167 else
1168   if test -n "$ac_ct_CC"; then
1169   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1170 else
1171   ac_save_IFS=$IFS; IFS=$ac_path_separator
1172 ac_dummy="$PATH"
1173 for ac_dir in $ac_dummy; do
1174   IFS=$ac_save_IFS
1175   test -z "$ac_dir" && ac_dir=.
1176   $as_executable_p "$ac_dir/$ac_word" || continue
1177 ac_cv_prog_ac_ct_CC="gcc"
1178 echo "$as_me:1178: found $ac_dir/$ac_word" >&5
1179 break
1180 done
1181
1182 fi
1183 fi
1184 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1185 if test -n "$ac_ct_CC"; then
1186   echo "$as_me:1186: result: $ac_ct_CC" >&5
1187 echo "${ECHO_T}$ac_ct_CC" >&6
1188 else
1189   echo "$as_me:1189: result: no" >&5
1190 echo "${ECHO_T}no" >&6
1191 fi
1192
1193   CC=$ac_ct_CC
1194 else
1195   CC="$ac_cv_prog_CC"
1196 fi
1197
1198 if test -z "$CC"; then
1199   if test -n "$ac_tool_prefix"; then
1200   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1201 set dummy ${ac_tool_prefix}cc; ac_word=$2
1202 echo "$as_me:1202: checking for $ac_word" >&5
1203 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1204 if test "${ac_cv_prog_CC+set}" = set; then
1205   echo $ECHO_N "(cached) $ECHO_C" >&6
1206 else
1207   if test -n "$CC"; then
1208   ac_cv_prog_CC="$CC" # Let the user override the test.
1209 else
1210   ac_save_IFS=$IFS; IFS=$ac_path_separator
1211 ac_dummy="$PATH"
1212 for ac_dir in $ac_dummy; do
1213   IFS=$ac_save_IFS
1214   test -z "$ac_dir" && ac_dir=.
1215   $as_executable_p "$ac_dir/$ac_word" || continue
1216 ac_cv_prog_CC="${ac_tool_prefix}cc"
1217 echo "$as_me:1217: found $ac_dir/$ac_word" >&5
1218 break
1219 done
1220
1221 fi
1222 fi
1223 CC=$ac_cv_prog_CC
1224 if test -n "$CC"; then
1225   echo "$as_me:1225: result: $CC" >&5
1226 echo "${ECHO_T}$CC" >&6
1227 else
1228   echo "$as_me:1228: result: no" >&5
1229 echo "${ECHO_T}no" >&6
1230 fi
1231
1232 fi
1233 if test -z "$ac_cv_prog_CC"; then
1234   ac_ct_CC=$CC
1235   # Extract the first word of "cc", so it can be a program name with args.
1236 set dummy cc; ac_word=$2
1237 echo "$as_me:1237: checking for $ac_word" >&5
1238 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1239 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1240   echo $ECHO_N "(cached) $ECHO_C" >&6
1241 else
1242   if test -n "$ac_ct_CC"; then
1243   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1244 else
1245   ac_save_IFS=$IFS; IFS=$ac_path_separator
1246 ac_dummy="$PATH"
1247 for ac_dir in $ac_dummy; do
1248   IFS=$ac_save_IFS
1249   test -z "$ac_dir" && ac_dir=.
1250   $as_executable_p "$ac_dir/$ac_word" || continue
1251 ac_cv_prog_ac_ct_CC="cc"
1252 echo "$as_me:1252: found $ac_dir/$ac_word" >&5
1253 break
1254 done
1255
1256 fi
1257 fi
1258 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1259 if test -n "$ac_ct_CC"; then
1260   echo "$as_me:1260: result: $ac_ct_CC" >&5
1261 echo "${ECHO_T}$ac_ct_CC" >&6
1262 else
1263   echo "$as_me:1263: result: no" >&5
1264 echo "${ECHO_T}no" >&6
1265 fi
1266
1267   CC=$ac_ct_CC
1268 else
1269   CC="$ac_cv_prog_CC"
1270 fi
1271
1272 fi
1273 if test -z "$CC"; then
1274   # Extract the first word of "cc", so it can be a program name with args.
1275 set dummy cc; ac_word=$2
1276 echo "$as_me:1276: checking for $ac_word" >&5
1277 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1278 if test "${ac_cv_prog_CC+set}" = set; then
1279   echo $ECHO_N "(cached) $ECHO_C" >&6
1280 else
1281   if test -n "$CC"; then
1282   ac_cv_prog_CC="$CC" # Let the user override the test.
1283 else
1284   ac_prog_rejected=no
1285   ac_save_IFS=$IFS; IFS=$ac_path_separator
1286 ac_dummy="$PATH"
1287 for ac_dir in $ac_dummy; do
1288   IFS=$ac_save_IFS
1289   test -z "$ac_dir" && ac_dir=.
1290   $as_executable_p "$ac_dir/$ac_word" || continue
1291 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1292   ac_prog_rejected=yes
1293   continue
1294 fi
1295 ac_cv_prog_CC="cc"
1296 echo "$as_me:1296: found $ac_dir/$ac_word" >&5
1297 break
1298 done
1299
1300 if test $ac_prog_rejected = yes; then
1301   # We found a bogon in the path, so make sure we never use it.
1302   set dummy $ac_cv_prog_CC
1303   shift
1304   if test $# != 0; then
1305     # We chose a different compiler from the bogus one.
1306     # However, it has the same basename, so the bogon will be chosen
1307     # first if we set CC to just the basename; use the full file name.
1308     shift
1309     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1310     shift
1311     ac_cv_prog_CC="$@"
1312   fi
1313 fi
1314 fi
1315 fi
1316 CC=$ac_cv_prog_CC
1317 if test -n "$CC"; then
1318   echo "$as_me:1318: result: $CC" >&5
1319 echo "${ECHO_T}$CC" >&6
1320 else
1321   echo "$as_me:1321: result: no" >&5
1322 echo "${ECHO_T}no" >&6
1323 fi
1324
1325 fi
1326 if test -z "$CC"; then
1327   if test -n "$ac_tool_prefix"; then
1328   for ac_prog in cl
1329   do
1330     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1331 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1332 echo "$as_me:1332: checking for $ac_word" >&5
1333 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1334 if test "${ac_cv_prog_CC+set}" = set; then
1335   echo $ECHO_N "(cached) $ECHO_C" >&6
1336 else
1337   if test -n "$CC"; then
1338   ac_cv_prog_CC="$CC" # Let the user override the test.
1339 else
1340   ac_save_IFS=$IFS; IFS=$ac_path_separator
1341 ac_dummy="$PATH"
1342 for ac_dir in $ac_dummy; do
1343   IFS=$ac_save_IFS
1344   test -z "$ac_dir" && ac_dir=.
1345   $as_executable_p "$ac_dir/$ac_word" || continue
1346 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1347 echo "$as_me:1347: found $ac_dir/$ac_word" >&5
1348 break
1349 done
1350
1351 fi
1352 fi
1353 CC=$ac_cv_prog_CC
1354 if test -n "$CC"; then
1355   echo "$as_me:1355: result: $CC" >&5
1356 echo "${ECHO_T}$CC" >&6
1357 else
1358   echo "$as_me:1358: result: no" >&5
1359 echo "${ECHO_T}no" >&6
1360 fi
1361
1362     test -n "$CC" && break
1363   done
1364 fi
1365 if test -z "$CC"; then
1366   ac_ct_CC=$CC
1367   for ac_prog in cl
1368 do
1369   # Extract the first word of "$ac_prog", so it can be a program name with args.
1370 set dummy $ac_prog; ac_word=$2
1371 echo "$as_me:1371: checking for $ac_word" >&5
1372 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1373 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1374   echo $ECHO_N "(cached) $ECHO_C" >&6
1375 else
1376   if test -n "$ac_ct_CC"; then
1377   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1378 else
1379   ac_save_IFS=$IFS; IFS=$ac_path_separator
1380 ac_dummy="$PATH"
1381 for ac_dir in $ac_dummy; do
1382   IFS=$ac_save_IFS
1383   test -z "$ac_dir" && ac_dir=.
1384   $as_executable_p "$ac_dir/$ac_word" || continue
1385 ac_cv_prog_ac_ct_CC="$ac_prog"
1386 echo "$as_me:1386: found $ac_dir/$ac_word" >&5
1387 break
1388 done
1389
1390 fi
1391 fi
1392 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1393 if test -n "$ac_ct_CC"; then
1394   echo "$as_me:1394: result: $ac_ct_CC" >&5
1395 echo "${ECHO_T}$ac_ct_CC" >&6
1396 else
1397   echo "$as_me:1397: result: no" >&5
1398 echo "${ECHO_T}no" >&6
1399 fi
1400
1401   test -n "$ac_ct_CC" && break
1402 done
1403
1404   CC=$ac_ct_CC
1405 fi
1406
1407 fi
1408
1409 test -z "$CC" && { { echo "$as_me:1409: error: no acceptable cc found in \$PATH" >&5
1410 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1411    { (exit 1); exit 1; }; }
1412
1413 # Provide some information about the compiler.
1414 echo "$as_me:1414:" \
1415      "checking for C compiler version" >&5
1416 ac_compiler=`set X $ac_compile; echo $2`
1417 { (eval echo "$as_me:1417: \"$ac_compiler --version </dev/null >&5\"") >&5
1418   (eval $ac_compiler --version </dev/null >&5) 2>&5
1419   ac_status=$?
1420   echo "$as_me:1420: \$? = $ac_status" >&5
1421   (exit $ac_status); }
1422 { (eval echo "$as_me:1422: \"$ac_compiler -v </dev/null >&5\"") >&5
1423   (eval $ac_compiler -v </dev/null >&5) 2>&5
1424   ac_status=$?
1425   echo "$as_me:1425: \$? = $ac_status" >&5
1426   (exit $ac_status); }
1427 { (eval echo "$as_me:1427: \"$ac_compiler -V </dev/null >&5\"") >&5
1428   (eval $ac_compiler -V </dev/null >&5) 2>&5
1429   ac_status=$?
1430   echo "$as_me:1430: \$? = $ac_status" >&5
1431   (exit $ac_status); }
1432
1433 cat >conftest.$ac_ext <<_ACEOF
1434 #line 1434 "configure"
1435 #include "confdefs.h"
1436
1437 int
1438 main ()
1439 {
1440
1441   ;
1442   return 0;
1443 }
1444 _ACEOF
1445 ac_clean_files_save=$ac_clean_files
1446 ac_clean_files="$ac_clean_files a.out a.exe"
1447 # Try to create an executable without -o first, disregard a.out.
1448 # It will help us diagnose broken compilers, and finding out an intuition
1449 # of exeext.
1450 echo "$as_me:1450: checking for C compiler default output" >&5
1451 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1452 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1453 if { (eval echo "$as_me:1453: \"$ac_link_default\"") >&5
1454   (eval $ac_link_default) 2>&5
1455   ac_status=$?
1456   echo "$as_me:1456: \$? = $ac_status" >&5
1457   (exit $ac_status); }; then
1458   # Find the output, starting from the most likely.  This scheme is
1459 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1460 # resort.
1461 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1462                 ls a.out conftest 2>/dev/null;
1463                 ls a.* conftest.* 2>/dev/null`; do
1464   case $ac_file in
1465     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1466     a.out ) # We found the default executable, but exeext='' is most
1467             # certainly right.
1468             break;;
1469     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1470           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1471           export ac_cv_exeext
1472           break;;
1473     * ) break;;
1474   esac
1475 done
1476 else
1477   echo "$as_me: failed program was:" >&5
1478 cat conftest.$ac_ext >&5
1479 { { echo "$as_me:1479: error: C compiler cannot create executables" >&5
1480 echo "$as_me: error: C compiler cannot create executables" >&2;}
1481    { (exit 77); exit 77; }; }
1482 fi
1483
1484 ac_exeext=$ac_cv_exeext
1485 echo "$as_me:1485: result: $ac_file" >&5
1486 echo "${ECHO_T}$ac_file" >&6
1487
1488 # Check the compiler produces executables we can run.  If not, either
1489 # the compiler is broken, or we cross compile.
1490 echo "$as_me:1490: checking whether the C compiler works" >&5
1491 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1492 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1493 # If not cross compiling, check that we can run a simple program.
1494 if test "$cross_compiling" != yes; then
1495   if { ac_try='./$ac_file'
1496   { (eval echo "$as_me:1496: \"$ac_try\"") >&5
1497   (eval $ac_try) 2>&5
1498   ac_status=$?
1499   echo "$as_me:1499: \$? = $ac_status" >&5
1500   (exit $ac_status); }; }; then
1501     cross_compiling=no
1502   else
1503     if test "$cross_compiling" = maybe; then
1504         cross_compiling=yes
1505     else
1506         { { echo "$as_me:1506: error: cannot run C compiled programs.
1507 If you meant to cross compile, use \`--host'." >&5
1508 echo "$as_me: error: cannot run C compiled programs.
1509 If you meant to cross compile, use \`--host'." >&2;}
1510    { (exit 1); exit 1; }; }
1511     fi
1512   fi
1513 fi
1514 echo "$as_me:1514: result: yes" >&5
1515 echo "${ECHO_T}yes" >&6
1516
1517 rm -f a.out a.exe conftest$ac_cv_exeext
1518 ac_clean_files=$ac_clean_files_save
1519 # Check the compiler produces executables we can run.  If not, either
1520 # the compiler is broken, or we cross compile.
1521 echo "$as_me:1521: checking whether we are cross compiling" >&5
1522 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1523 echo "$as_me:1523: result: $cross_compiling" >&5
1524 echo "${ECHO_T}$cross_compiling" >&6
1525
1526 echo "$as_me:1526: checking for executable suffix" >&5
1527 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1528 if { (eval echo "$as_me:1528: \"$ac_link\"") >&5
1529   (eval $ac_link) 2>&5
1530   ac_status=$?
1531   echo "$as_me:1531: \$? = $ac_status" >&5
1532   (exit $ac_status); }; then
1533   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1534 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1535 # work properly (i.e., refer to `conftest.exe'), while it won't with
1536 # `rm'.
1537 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1538   case $ac_file in
1539     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1540     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1541           export ac_cv_exeext
1542           break;;
1543     * ) break;;
1544   esac
1545 done
1546 else
1547   { { echo "$as_me:1547: error: cannot compute EXEEXT: cannot compile and link" >&5
1548 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1549    { (exit 1); exit 1; }; }
1550 fi
1551
1552 rm -f conftest$ac_cv_exeext
1553 echo "$as_me:1553: result: $ac_cv_exeext" >&5
1554 echo "${ECHO_T}$ac_cv_exeext" >&6
1555
1556 rm -f conftest.$ac_ext
1557 EXEEXT=$ac_cv_exeext
1558 ac_exeext=$EXEEXT
1559 echo "$as_me:1559: checking for object suffix" >&5
1560 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1561 if test "${ac_cv_objext+set}" = set; then
1562   echo $ECHO_N "(cached) $ECHO_C" >&6
1563 else
1564   cat >conftest.$ac_ext <<_ACEOF
1565 #line 1565 "configure"
1566 #include "confdefs.h"
1567
1568 int
1569 main ()
1570 {
1571
1572   ;
1573   return 0;
1574 }
1575 _ACEOF
1576 rm -f conftest.o conftest.obj
1577 if { (eval echo "$as_me:1577: \"$ac_compile\"") >&5
1578   (eval $ac_compile) 2>&5
1579   ac_status=$?
1580   echo "$as_me:1580: \$? = $ac_status" >&5
1581   (exit $ac_status); }; then
1582   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1583   case $ac_file in
1584     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1585     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1586        break;;
1587   esac
1588 done
1589 else
1590   echo "$as_me: failed program was:" >&5
1591 cat conftest.$ac_ext >&5
1592 { { echo "$as_me:1592: error: cannot compute OBJEXT: cannot compile" >&5
1593 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1594    { (exit 1); exit 1; }; }
1595 fi
1596
1597 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1598 fi
1599 echo "$as_me:1599: result: $ac_cv_objext" >&5
1600 echo "${ECHO_T}$ac_cv_objext" >&6
1601 OBJEXT=$ac_cv_objext
1602 ac_objext=$OBJEXT
1603 echo "$as_me:1603: checking whether we are using the GNU C compiler" >&5
1604 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1605 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1606   echo $ECHO_N "(cached) $ECHO_C" >&6
1607 else
1608   cat >conftest.$ac_ext <<_ACEOF
1609 #line 1609 "configure"
1610 #include "confdefs.h"
1611
1612 int
1613 main ()
1614 {
1615 #ifndef __GNUC__
1616        choke me
1617 #endif
1618
1619   ;
1620   return 0;
1621 }
1622 _ACEOF
1623 rm -f conftest.$ac_objext
1624 if { (eval echo "$as_me:1624: \"$ac_compile\"") >&5
1625   (eval $ac_compile) 2>&5
1626   ac_status=$?
1627   echo "$as_me:1627: \$? = $ac_status" >&5
1628   (exit $ac_status); } &&
1629          { ac_try='test -s conftest.$ac_objext'
1630   { (eval echo "$as_me:1630: \"$ac_try\"") >&5
1631   (eval $ac_try) 2>&5
1632   ac_status=$?
1633   echo "$as_me:1633: \$? = $ac_status" >&5
1634   (exit $ac_status); }; }; then
1635   ac_compiler_gnu=yes
1636 else
1637   echo "$as_me: failed program was:" >&5
1638 cat conftest.$ac_ext >&5
1639 ac_compiler_gnu=no
1640 fi
1641 rm -f conftest.$ac_objext conftest.$ac_ext
1642 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1643
1644 fi
1645 echo "$as_me:1645: result: $ac_cv_c_compiler_gnu" >&5
1646 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1647 GCC=`test $ac_compiler_gnu = yes && echo yes`
1648 ac_test_CFLAGS=${CFLAGS+set}
1649 ac_save_CFLAGS=$CFLAGS
1650 CFLAGS="-g"
1651 echo "$as_me:1651: checking whether $CC accepts -g" >&5
1652 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1653 if test "${ac_cv_prog_cc_g+set}" = set; then
1654   echo $ECHO_N "(cached) $ECHO_C" >&6
1655 else
1656   cat >conftest.$ac_ext <<_ACEOF
1657 #line 1657 "configure"
1658 #include "confdefs.h"
1659
1660 int
1661 main ()
1662 {
1663
1664   ;
1665   return 0;
1666 }
1667 _ACEOF
1668 rm -f conftest.$ac_objext
1669 if { (eval echo "$as_me:1669: \"$ac_compile\"") >&5
1670   (eval $ac_compile) 2>&5
1671   ac_status=$?
1672   echo "$as_me:1672: \$? = $ac_status" >&5
1673   (exit $ac_status); } &&
1674          { ac_try='test -s conftest.$ac_objext'
1675   { (eval echo "$as_me:1675: \"$ac_try\"") >&5
1676   (eval $ac_try) 2>&5
1677   ac_status=$?
1678   echo "$as_me:1678: \$? = $ac_status" >&5
1679   (exit $ac_status); }; }; then
1680   ac_cv_prog_cc_g=yes
1681 else
1682   echo "$as_me: failed program was:" >&5
1683 cat conftest.$ac_ext >&5
1684 ac_cv_prog_cc_g=no
1685 fi
1686 rm -f conftest.$ac_objext conftest.$ac_ext
1687 fi
1688 echo "$as_me:1688: result: $ac_cv_prog_cc_g" >&5
1689 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1690 if test "$ac_test_CFLAGS" = set; then
1691   CFLAGS=$ac_save_CFLAGS
1692 elif test $ac_cv_prog_cc_g = yes; then
1693   if test "$GCC" = yes; then
1694     CFLAGS="-g -O2"
1695   else
1696     CFLAGS="-g"
1697   fi
1698 else
1699   if test "$GCC" = yes; then
1700     CFLAGS="-O2"
1701   else
1702     CFLAGS=
1703   fi
1704 fi
1705 # Some people use a C++ compiler to compile C.  Since we use `exit',
1706 # in C++ we need to declare it.  In case someone uses the same compiler
1707 # for both compiling C and C++ we need to have the C++ compiler decide
1708 # the declaration of exit, since it's the most demanding environment.
1709 cat >conftest.$ac_ext <<_ACEOF
1710 #ifndef __cplusplus
1711   choke me
1712 #endif
1713 _ACEOF
1714 rm -f conftest.$ac_objext
1715 if { (eval echo "$as_me:1715: \"$ac_compile\"") >&5
1716   (eval $ac_compile) 2>&5
1717   ac_status=$?
1718   echo "$as_me:1718: \$? = $ac_status" >&5
1719   (exit $ac_status); } &&
1720          { ac_try='test -s conftest.$ac_objext'
1721   { (eval echo "$as_me:1721: \"$ac_try\"") >&5
1722   (eval $ac_try) 2>&5
1723   ac_status=$?
1724   echo "$as_me:1724: \$? = $ac_status" >&5
1725   (exit $ac_status); }; }; then
1726   for ac_declaration in \
1727    ''\
1728    '#include <stdlib.h>' \
1729    'extern "C" void std::exit (int) throw (); using std::exit;' \
1730    'extern "C" void std::exit (int); using std::exit;' \
1731    'extern "C" void exit (int) throw ();' \
1732    'extern "C" void exit (int);' \
1733    'void exit (int);'
1734 do
1735   cat >conftest.$ac_ext <<_ACEOF
1736 #line 1736 "configure"
1737 #include "confdefs.h"
1738 #include <stdlib.h>
1739 $ac_declaration
1740 int
1741 main ()
1742 {
1743 exit (42);
1744   ;
1745   return 0;
1746 }
1747 _ACEOF
1748 rm -f conftest.$ac_objext
1749 if { (eval echo "$as_me:1749: \"$ac_compile\"") >&5
1750   (eval $ac_compile) 2>&5
1751   ac_status=$?
1752   echo "$as_me:1752: \$? = $ac_status" >&5
1753   (exit $ac_status); } &&
1754          { ac_try='test -s conftest.$ac_objext'
1755   { (eval echo "$as_me:1755: \"$ac_try\"") >&5
1756   (eval $ac_try) 2>&5
1757   ac_status=$?
1758   echo "$as_me:1758: \$? = $ac_status" >&5
1759   (exit $ac_status); }; }; then
1760   :
1761 else
1762   echo "$as_me: failed program was:" >&5
1763 cat conftest.$ac_ext >&5
1764 continue
1765 fi
1766 rm -f conftest.$ac_objext conftest.$ac_ext
1767   cat >conftest.$ac_ext <<_ACEOF
1768 #line 1768 "configure"
1769 #include "confdefs.h"
1770 $ac_declaration
1771 int
1772 main ()
1773 {
1774 exit (42);
1775   ;
1776   return 0;
1777 }
1778 _ACEOF
1779 rm -f conftest.$ac_objext
1780 if { (eval echo "$as_me:1780: \"$ac_compile\"") >&5
1781   (eval $ac_compile) 2>&5
1782   ac_status=$?
1783   echo "$as_me:1783: \$? = $ac_status" >&5
1784   (exit $ac_status); } &&
1785          { ac_try='test -s conftest.$ac_objext'
1786   { (eval echo "$as_me:1786: \"$ac_try\"") >&5
1787   (eval $ac_try) 2>&5
1788   ac_status=$?
1789   echo "$as_me:1789: \$? = $ac_status" >&5
1790   (exit $ac_status); }; }; then
1791   break
1792 else
1793   echo "$as_me: failed program was:" >&5
1794 cat conftest.$ac_ext >&5
1795 fi
1796 rm -f conftest.$ac_objext conftest.$ac_ext
1797 done
1798 rm -rf conftest*
1799 if test -n "$ac_declaration"; then
1800   echo '#ifdef __cplusplus' >>confdefs.h
1801   echo $ac_declaration      >>confdefs.h
1802   echo '#endif'             >>confdefs.h
1803 fi
1804
1805 else
1806   echo "$as_me: failed program was:" >&5
1807 cat conftest.$ac_ext >&5
1808 fi
1809 rm -f conftest.$ac_objext conftest.$ac_ext
1810 ac_ext=c
1811 ac_cpp='$CPP $CPPFLAGS'
1812 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1813 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1814 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1815 ac_main_return=return
1816
1817 ac_ext=c
1818 ac_cpp='$CPP $CPPFLAGS'
1819 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1820 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1821 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1822 ac_main_return=return
1823 echo "$as_me:1823: checking how to run the C preprocessor" >&5
1824 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1825 # On Suns, sometimes $CPP names a directory.
1826 if test -n "$CPP" && test -d "$CPP"; then
1827   CPP=
1828 fi
1829 if test -z "$CPP"; then
1830   if test "${ac_cv_prog_CPP+set}" = set; then
1831   echo $ECHO_N "(cached) $ECHO_C" >&6
1832 else
1833       # Double quotes because CPP needs to be expanded
1834     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1835     do
1836       ac_preproc_ok=false
1837 for ac_c_preproc_warn_flag in '' yes
1838 do
1839   # Use a header file that comes with gcc, so configuring glibc
1840   # with a fresh cross-compiler works.
1841   # On the NeXT, cc -E runs the code through the compiler's parser,
1842   # not just through cpp. "Syntax error" is here to catch this case.
1843   cat >conftest.$ac_ext <<_ACEOF
1844 #line 1844 "configure"
1845 #include "confdefs.h"
1846 #include <assert.h>
1847                      Syntax error
1848 _ACEOF
1849 if { (eval echo "$as_me:1849: \"$ac_cpp conftest.$ac_ext\"") >&5
1850   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1851   ac_status=$?
1852   egrep -v '^ *\+' conftest.er1 >conftest.err
1853   rm -f conftest.er1
1854   cat conftest.err >&5
1855   echo "$as_me:1855: \$? = $ac_status" >&5
1856   (exit $ac_status); } >/dev/null; then
1857   if test -s conftest.err; then
1858     ac_cpp_err=$ac_c_preproc_warn_flag
1859   else
1860     ac_cpp_err=
1861   fi
1862 else
1863   ac_cpp_err=yes
1864 fi
1865 if test -z "$ac_cpp_err"; then
1866   :
1867 else
1868   echo "$as_me: failed program was:" >&5
1869   cat conftest.$ac_ext >&5
1870   # Broken: fails on valid input.
1871 continue
1872 fi
1873 rm -f conftest.err conftest.$ac_ext
1874
1875   # OK, works on sane cases.  Now check whether non-existent headers
1876   # can be detected and how.
1877   cat >conftest.$ac_ext <<_ACEOF
1878 #line 1878 "configure"
1879 #include "confdefs.h"
1880 #include <ac_nonexistent.h>
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   # Broken: success on invalid input.
1900 continue
1901 else
1902   echo "$as_me: failed program was:" >&5
1903   cat conftest.$ac_ext >&5
1904   # Passes both tests.
1905 ac_preproc_ok=:
1906 break
1907 fi
1908 rm -f conftest.err conftest.$ac_ext
1909
1910 done
1911 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
1912 rm -f conftest.err conftest.$ac_ext
1913 if $ac_preproc_ok; then
1914   break
1915 fi
1916
1917     done
1918     ac_cv_prog_CPP=$CPP
1919
1920 fi
1921   CPP=$ac_cv_prog_CPP
1922 else
1923   ac_cv_prog_CPP=$CPP
1924 fi
1925 echo "$as_me:1925: result: $CPP" >&5
1926 echo "${ECHO_T}$CPP" >&6
1927 ac_preproc_ok=false
1928 for ac_c_preproc_warn_flag in '' yes
1929 do
1930   # Use a header file that comes with gcc, so configuring glibc
1931   # with a fresh cross-compiler works.
1932   # On the NeXT, cc -E runs the code through the compiler's parser,
1933   # not just through cpp. "Syntax error" is here to catch this case.
1934   cat >conftest.$ac_ext <<_ACEOF
1935 #line 1935 "configure"
1936 #include "confdefs.h"
1937 #include <assert.h>
1938                      Syntax error
1939 _ACEOF
1940 if { (eval echo "$as_me:1940: \"$ac_cpp conftest.$ac_ext\"") >&5
1941   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1942   ac_status=$?
1943   egrep -v '^ *\+' conftest.er1 >conftest.err
1944   rm -f conftest.er1
1945   cat conftest.err >&5
1946   echo "$as_me:1946: \$? = $ac_status" >&5
1947   (exit $ac_status); } >/dev/null; then
1948   if test -s conftest.err; then
1949     ac_cpp_err=$ac_c_preproc_warn_flag
1950   else
1951     ac_cpp_err=
1952   fi
1953 else
1954   ac_cpp_err=yes
1955 fi
1956 if test -z "$ac_cpp_err"; then
1957   :
1958 else
1959   echo "$as_me: failed program was:" >&5
1960   cat conftest.$ac_ext >&5
1961   # Broken: fails on valid input.
1962 continue
1963 fi
1964 rm -f conftest.err conftest.$ac_ext
1965
1966   # OK, works on sane cases.  Now check whether non-existent headers
1967   # can be detected and how.
1968   cat >conftest.$ac_ext <<_ACEOF
1969 #line 1969 "configure"
1970 #include "confdefs.h"
1971 #include <ac_nonexistent.h>
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   # Broken: success on invalid input.
1991 continue
1992 else
1993   echo "$as_me: failed program was:" >&5
1994   cat conftest.$ac_ext >&5
1995   # Passes both tests.
1996 ac_preproc_ok=:
1997 break
1998 fi
1999 rm -f conftest.err conftest.$ac_ext
2000
2001 done
2002 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2003 rm -f conftest.err conftest.$ac_ext
2004 if $ac_preproc_ok; then
2005   :
2006 else
2007   { { echo "$as_me:2007: error: C preprocessor \"$CPP\" fails sanity check" >&5
2008 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2009    { (exit 1); exit 1; }; }
2010 fi
2011
2012 ac_ext=c
2013 ac_cpp='$CPP $CPPFLAGS'
2014 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2015 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2016 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2017 ac_main_return=return
2018
2019 for ac_prog in mawk gawk nawk awk
2020 do
2021   # Extract the first word of "$ac_prog", so it can be a program name with args.
2022 set dummy $ac_prog; ac_word=$2
2023 echo "$as_me:2023: checking for $ac_word" >&5
2024 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2025 if test "${ac_cv_prog_AWK+set}" = set; then
2026   echo $ECHO_N "(cached) $ECHO_C" >&6
2027 else
2028   if test -n "$AWK"; then
2029   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2030 else
2031   ac_save_IFS=$IFS; IFS=$ac_path_separator
2032 ac_dummy="$PATH"
2033 for ac_dir in $ac_dummy; do
2034   IFS=$ac_save_IFS
2035   test -z "$ac_dir" && ac_dir=.
2036   $as_executable_p "$ac_dir/$ac_word" || continue
2037 ac_cv_prog_AWK="$ac_prog"
2038 echo "$as_me:2038: found $ac_dir/$ac_word" >&5
2039 break
2040 done
2041
2042 fi
2043 fi
2044 AWK=$ac_cv_prog_AWK
2045 if test -n "$AWK"; then
2046   echo "$as_me:2046: result: $AWK" >&5
2047 echo "${ECHO_T}$AWK" >&6
2048 else
2049   echo "$as_me:2049: result: no" >&5
2050 echo "${ECHO_T}no" >&6
2051 fi
2052
2053   test -n "$AWK" && break
2054 done
2055
2056 # Find a good install program.  We prefer a C program (faster),
2057 # so one script is as good as another.  But avoid the broken or
2058 # incompatible versions:
2059 # SysV /etc/install, /usr/sbin/install
2060 # SunOS /usr/etc/install
2061 # IRIX /sbin/install
2062 # AIX /bin/install
2063 # AmigaOS /C/install, which installs bootblocks on floppy discs
2064 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2065 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2066 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2067 # ./install, which can be erroneously created by make from ./install.sh.
2068 echo "$as_me:2068: checking for a BSD compatible install" >&5
2069 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2070 if test -z "$INSTALL"; then
2071 if test "${ac_cv_path_install+set}" = set; then
2072   echo $ECHO_N "(cached) $ECHO_C" >&6
2073 else
2074     ac_save_IFS=$IFS; IFS=$ac_path_separator
2075   for ac_dir in $PATH; do
2076     IFS=$ac_save_IFS
2077     # Account for people who put trailing slashes in PATH elements.
2078     case $ac_dir/ in
2079     / | ./ | .// | /cC/* \
2080     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2081     | /usr/ucb/* ) ;;
2082     *)
2083       # OSF1 and SCO ODT 3.0 have their own names for install.
2084       # Don't use installbsd from OSF since it installs stuff as root
2085       # by default.
2086       for ac_prog in ginstall scoinst install; do
2087         if $as_executable_p "$ac_dir/$ac_prog"; then
2088           if test $ac_prog = install &&
2089             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2090             # AIX install.  It has an incompatible calling convention.
2091             :
2092           elif test $ac_prog = install &&
2093             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2094             # program-specific install script used by HP pwplus--don't use.
2095             :
2096           else
2097             ac_cv_path_install="$ac_dir/$ac_prog -c"
2098             break 2
2099           fi
2100         fi
2101       done
2102       ;;
2103     esac
2104   done
2105
2106 fi
2107   if test "${ac_cv_path_install+set}" = set; then
2108     INSTALL=$ac_cv_path_install
2109   else
2110     # As a last resort, use the slow shell script.  We don't cache a
2111     # path for INSTALL within a source directory, because that will
2112     # break other packages using the cache if that directory is
2113     # removed, or if the path is relative.
2114     INSTALL=$ac_install_sh
2115   fi
2116 fi
2117 echo "$as_me:2117: result: $INSTALL" >&5
2118 echo "${ECHO_T}$INSTALL" >&6
2119
2120 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2121 # It thinks the first close brace ends the variable substitution.
2122 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2123
2124 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2125
2126 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2127
2128 case $INSTALL in
2129 /*)
2130   ;;
2131 *)
2132   cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2133   test -z "$cf_dir" && cf_dir=.
2134   INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2135   ;;
2136 esac
2137
2138 for ac_prog in tdlint lint alint splint lclint
2139 do
2140   # Extract the first word of "$ac_prog", so it can be a program name with args.
2141 set dummy $ac_prog; ac_word=$2
2142 echo "$as_me:2142: checking for $ac_word" >&5
2143 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2144 if test "${ac_cv_prog_LINT+set}" = set; then
2145   echo $ECHO_N "(cached) $ECHO_C" >&6
2146 else
2147   if test -n "$LINT"; then
2148   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2149 else
2150   ac_save_IFS=$IFS; IFS=$ac_path_separator
2151 ac_dummy="$PATH"
2152 for ac_dir in $ac_dummy; do
2153   IFS=$ac_save_IFS
2154   test -z "$ac_dir" && ac_dir=.
2155   $as_executable_p "$ac_dir/$ac_word" || continue
2156 ac_cv_prog_LINT="$ac_prog"
2157 echo "$as_me:2157: found $ac_dir/$ac_word" >&5
2158 break
2159 done
2160
2161 fi
2162 fi
2163 LINT=$ac_cv_prog_LINT
2164 if test -n "$LINT"; then
2165   echo "$as_me:2165: result: $LINT" >&5
2166 echo "${ECHO_T}$LINT" >&6
2167 else
2168   echo "$as_me:2168: result: no" >&5
2169 echo "${ECHO_T}no" >&6
2170 fi
2171
2172   test -n "$LINT" && break
2173 done
2174
2175 echo "$as_me:2175: checking if filesystem supports mixed-case filenames" >&5
2176 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2177 if test "${cf_cv_mixedcase+set}" = set; then
2178   echo $ECHO_N "(cached) $ECHO_C" >&6
2179 else
2180
2181 if test "$cross_compiling" = yes ; then
2182         case $target_alias in #(vi
2183         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
2184                 cf_cv_mixedcase=no
2185                 ;;
2186         *)
2187                 cf_cv_mixedcase=yes
2188                 ;;
2189         esac
2190 else
2191         rm -f conftest CONFTEST
2192         echo test >conftest
2193         if test -f CONFTEST ; then
2194                 cf_cv_mixedcase=no
2195         else
2196                 cf_cv_mixedcase=yes
2197         fi
2198         rm -f conftest CONFTEST
2199 fi
2200
2201 fi
2202 echo "$as_me:2202: result: $cf_cv_mixedcase" >&5
2203 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2204 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
2205 #define MIXEDCASE_FILENAMES 1
2206 EOF
2207
2208 for ac_prog in exctags ctags
2209 do
2210   # Extract the first word of "$ac_prog", so it can be a program name with args.
2211 set dummy $ac_prog; ac_word=$2
2212 echo "$as_me:2212: checking for $ac_word" >&5
2213 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2214 if test "${ac_cv_prog_CTAGS+set}" = set; then
2215   echo $ECHO_N "(cached) $ECHO_C" >&6
2216 else
2217   if test -n "$CTAGS"; then
2218   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2219 else
2220   ac_save_IFS=$IFS; IFS=$ac_path_separator
2221 ac_dummy="$PATH"
2222 for ac_dir in $ac_dummy; do
2223   IFS=$ac_save_IFS
2224   test -z "$ac_dir" && ac_dir=.
2225   $as_executable_p "$ac_dir/$ac_word" || continue
2226 ac_cv_prog_CTAGS="$ac_prog"
2227 echo "$as_me:2227: found $ac_dir/$ac_word" >&5
2228 break
2229 done
2230
2231 fi
2232 fi
2233 CTAGS=$ac_cv_prog_CTAGS
2234 if test -n "$CTAGS"; then
2235   echo "$as_me:2235: result: $CTAGS" >&5
2236 echo "${ECHO_T}$CTAGS" >&6
2237 else
2238   echo "$as_me:2238: result: no" >&5
2239 echo "${ECHO_T}no" >&6
2240 fi
2241
2242   test -n "$CTAGS" && break
2243 done
2244
2245 for ac_prog in exetags etags
2246 do
2247   # Extract the first word of "$ac_prog", so it can be a program name with args.
2248 set dummy $ac_prog; ac_word=$2
2249 echo "$as_me:2249: checking for $ac_word" >&5
2250 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2251 if test "${ac_cv_prog_ETAGS+set}" = set; then
2252   echo $ECHO_N "(cached) $ECHO_C" >&6
2253 else
2254   if test -n "$ETAGS"; then
2255   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2256 else
2257   ac_save_IFS=$IFS; IFS=$ac_path_separator
2258 ac_dummy="$PATH"
2259 for ac_dir in $ac_dummy; do
2260   IFS=$ac_save_IFS
2261   test -z "$ac_dir" && ac_dir=.
2262   $as_executable_p "$ac_dir/$ac_word" || continue
2263 ac_cv_prog_ETAGS="$ac_prog"
2264 echo "$as_me:2264: found $ac_dir/$ac_word" >&5
2265 break
2266 done
2267
2268 fi
2269 fi
2270 ETAGS=$ac_cv_prog_ETAGS
2271 if test -n "$ETAGS"; then
2272   echo "$as_me:2272: result: $ETAGS" >&5
2273 echo "${ECHO_T}$ETAGS" >&6
2274 else
2275   echo "$as_me:2275: result: no" >&5
2276 echo "${ECHO_T}no" >&6
2277 fi
2278
2279   test -n "$ETAGS" && break
2280 done
2281
2282 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2283 set dummy ${CTAGS:-ctags}; ac_word=$2
2284 echo "$as_me:2284: checking for $ac_word" >&5
2285 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2286 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2287   echo $ECHO_N "(cached) $ECHO_C" >&6
2288 else
2289   if test -n "$MAKE_LOWER_TAGS"; then
2290   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2291 else
2292   ac_save_IFS=$IFS; IFS=$ac_path_separator
2293 ac_dummy="$PATH"
2294 for ac_dir in $ac_dummy; do
2295   IFS=$ac_save_IFS
2296   test -z "$ac_dir" && ac_dir=.
2297   $as_executable_p "$ac_dir/$ac_word" || continue
2298 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2299 echo "$as_me:2299: found $ac_dir/$ac_word" >&5
2300 break
2301 done
2302
2303   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2304 fi
2305 fi
2306 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2307 if test -n "$MAKE_LOWER_TAGS"; then
2308   echo "$as_me:2308: result: $MAKE_LOWER_TAGS" >&5
2309 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2310 else
2311   echo "$as_me:2311: result: no" >&5
2312 echo "${ECHO_T}no" >&6
2313 fi
2314
2315 if test "$cf_cv_mixedcase" = yes ; then
2316         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2317 set dummy ${ETAGS:-etags}; ac_word=$2
2318 echo "$as_me:2318: checking for $ac_word" >&5
2319 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2320 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2321   echo $ECHO_N "(cached) $ECHO_C" >&6
2322 else
2323   if test -n "$MAKE_UPPER_TAGS"; then
2324   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2325 else
2326   ac_save_IFS=$IFS; IFS=$ac_path_separator
2327 ac_dummy="$PATH"
2328 for ac_dir in $ac_dummy; do
2329   IFS=$ac_save_IFS
2330   test -z "$ac_dir" && ac_dir=.
2331   $as_executable_p "$ac_dir/$ac_word" || continue
2332 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2333 echo "$as_me:2333: found $ac_dir/$ac_word" >&5
2334 break
2335 done
2336
2337   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2338 fi
2339 fi
2340 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2341 if test -n "$MAKE_UPPER_TAGS"; then
2342   echo "$as_me:2342: result: $MAKE_UPPER_TAGS" >&5
2343 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2344 else
2345   echo "$as_me:2345: result: no" >&5
2346 echo "${ECHO_T}no" >&6
2347 fi
2348
2349 else
2350         MAKE_UPPER_TAGS=no
2351 fi
2352
2353 if test "$MAKE_UPPER_TAGS" = yes ; then
2354         MAKE_UPPER_TAGS=
2355 else
2356         MAKE_UPPER_TAGS="#"
2357 fi
2358
2359 if test "$MAKE_LOWER_TAGS" = yes ; then
2360         MAKE_LOWER_TAGS=
2361 else
2362         MAKE_LOWER_TAGS="#"
2363 fi
2364
2365 echo "$as_me:2365: checking if -lm needed for math functions" >&5
2366 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2367 if test "${cf_cv_need_libm+set}" = set; then
2368   echo $ECHO_N "(cached) $ECHO_C" >&6
2369 else
2370
2371         cat >conftest.$ac_ext <<_ACEOF
2372 #line 2372 "configure"
2373 #include "confdefs.h"
2374
2375         #include <stdio.h>
2376         #include <math.h>
2377
2378 int
2379 main ()
2380 {
2381 double x = rand(); printf("result = %g\n", sin(x))
2382   ;
2383   return 0;
2384 }
2385 _ACEOF
2386 rm -f conftest.$ac_objext conftest$ac_exeext
2387 if { (eval echo "$as_me:2387: \"$ac_link\"") >&5
2388   (eval $ac_link) 2>&5
2389   ac_status=$?
2390   echo "$as_me:2390: \$? = $ac_status" >&5
2391   (exit $ac_status); } &&
2392          { ac_try='test -s conftest$ac_exeext'
2393   { (eval echo "$as_me:2393: \"$ac_try\"") >&5
2394   (eval $ac_try) 2>&5
2395   ac_status=$?
2396   echo "$as_me:2396: \$? = $ac_status" >&5
2397   (exit $ac_status); }; }; then
2398   cf_cv_need_libm=no
2399 else
2400   echo "$as_me: failed program was:" >&5
2401 cat conftest.$ac_ext >&5
2402 cf_cv_need_libm=yes
2403 fi
2404 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2405 fi
2406 echo "$as_me:2406: result: $cf_cv_need_libm" >&5
2407 echo "${ECHO_T}$cf_cv_need_libm" >&6
2408 if test "$cf_cv_need_libm" = yes
2409 then
2410 MATH_LIB=-lm
2411 fi
2412
2413 top_builddir=`pwd`
2414
2415 CC_G_OPT="-g"
2416 CC_SHARED_OPTS=unknown
2417 CPPFLAGS="$CPPFLAGS"
2418 DFT_DEP_SUFFIX=""
2419 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2420 DFT_UPR_MODEL="NORMAL"
2421 LD="ld"
2422 LDFLAGS_SHARED=""
2423 LDFLAGS_STATIC=""
2424 LD_MODEL=""
2425 LD_SHARED_OPTS=""
2426 LIBTOOL=""
2427 LIB_CLEAN=""
2428 LIB_COMPILE=""
2429 LIB_LINK='${CC}'
2430 LINK_TESTS=""
2431 LOCAL_LDFLAGS=""
2432 PTHREAD="-lm"
2433 TEST_ARGS=""
2434 TEST_DEPS=""
2435 TEST_LIBS=""
2436 TINFO_LDFLAGS=''
2437 TINFO_LIBS='$(LIBS_CURSES)'
2438 cf_cv_abi_version=""
2439 cf_cv_rel_version=""
2440
2441 cf_cv_screen=curses
2442 cf_cv_libtype=
2443
2444 # This should have been defined by AC_PROG_CC
2445 : ${CC:=cc}
2446
2447 # Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
2448 # into CC.  This will not help with broken scripts that wrap the compiler with
2449 # options, but eliminates a more common category of user confusion.
2450 echo "$as_me:2450: checking \$CC variable" >&5
2451 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2452 case "$CC" in #(vi
2453 *[\ \   ]-[IUD]*)
2454         echo "$as_me:2454: result: broken" >&5
2455 echo "${ECHO_T}broken" >&6
2456         { echo "$as_me:2456: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2457 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2458         # humor him...
2459         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
2460         CC=`echo "$CC" | sed -e 's/[    ].*//'`
2461
2462 cf_fix_cppflags=no
2463 cf_new_cflags=
2464 cf_new_cppflags=
2465 cf_new_extra_cppflags=
2466
2467 for cf_add_cflags in $cf_flags
2468 do
2469 case $cf_fix_cppflags in
2470 no)
2471         case $cf_add_cflags in #(vi
2472         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2473                 case $cf_add_cflags in
2474                 -D*)
2475                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2476
2477                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2478                                 && test -z "${cf_tst_cflags}" \
2479                                 && cf_fix_cppflags=yes
2480
2481                         if test $cf_fix_cppflags = yes ; then
2482                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2483                                 continue
2484                         elif test "${cf_tst_cflags}" = "\"'" ; then
2485                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2486                                 continue
2487                         fi
2488                         ;;
2489                 esac
2490                 case "$CPPFLAGS" in
2491                 *$cf_add_cflags) #(vi
2492                         ;;
2493                 *) #(vi
2494                         case $cf_add_cflags in #(vi
2495                         -D*)
2496                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2497
2498 CPPFLAGS=`echo "$CPPFLAGS" | \
2499         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2500                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2501
2502                                 ;;
2503                         esac
2504                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2505                         ;;
2506                 esac
2507                 ;;
2508         *)
2509                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2510                 ;;
2511         esac
2512         ;;
2513 yes)
2514         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2515
2516         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2517
2518         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2519                 && test -z "${cf_tst_cflags}" \
2520                 && cf_fix_cppflags=no
2521         ;;
2522 esac
2523 done
2524
2525 if test -n "$cf_new_cflags" ; then
2526
2527         CFLAGS="$CFLAGS $cf_new_cflags"
2528 fi
2529
2530 if test -n "$cf_new_cppflags" ; then
2531
2532         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2533 fi
2534
2535 if test -n "$cf_new_extra_cppflags" ; then
2536
2537         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2538 fi
2539
2540         ;;
2541 *)
2542         echo "$as_me:2542: result: ok" >&5
2543 echo "${ECHO_T}ok" >&6
2544         ;;
2545 esac
2546
2547 echo "$as_me:2547: checking for ${CC:-cc} option to accept ANSI C" >&5
2548 echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6
2549 if test "${cf_cv_ansi_cc+set}" = set; then
2550   echo $ECHO_N "(cached) $ECHO_C" >&6
2551 else
2552
2553 cf_cv_ansi_cc=no
2554 cf_save_CFLAGS="$CFLAGS"
2555 cf_save_CPPFLAGS="$CPPFLAGS"
2556 # Don't try gcc -ansi; that turns off useful extensions and
2557 # breaks some systems' header files.
2558 # AIX                   -qlanglvl=ansi
2559 # Ultrix and OSF/1      -std1
2560 # HP-UX                 -Aa -D_HPUX_SOURCE
2561 # SVR4                  -Xc
2562 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
2563 for cf_arg in "-DCC_HAS_PROTOS" \
2564         "" \
2565         -qlanglvl=ansi \
2566         -std1 \
2567         -Ae \
2568         "-Aa -D_HPUX_SOURCE" \
2569         -Xc
2570 do
2571
2572 cf_fix_cppflags=no
2573 cf_new_cflags=
2574 cf_new_cppflags=
2575 cf_new_extra_cppflags=
2576
2577 for cf_add_cflags in $cf_arg
2578 do
2579 case $cf_fix_cppflags in
2580 no)
2581         case $cf_add_cflags in #(vi
2582         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2583                 case $cf_add_cflags in
2584                 -D*)
2585                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2586
2587                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2588                                 && test -z "${cf_tst_cflags}" \
2589                                 && cf_fix_cppflags=yes
2590
2591                         if test $cf_fix_cppflags = yes ; then
2592                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2593                                 continue
2594                         elif test "${cf_tst_cflags}" = "\"'" ; then
2595                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2596                                 continue
2597                         fi
2598                         ;;
2599                 esac
2600                 case "$CPPFLAGS" in
2601                 *$cf_add_cflags) #(vi
2602                         ;;
2603                 *) #(vi
2604                         case $cf_add_cflags in #(vi
2605                         -D*)
2606                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2607
2608 CPPFLAGS=`echo "$CPPFLAGS" | \
2609         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2610                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2611
2612                                 ;;
2613                         esac
2614                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2615                         ;;
2616                 esac
2617                 ;;
2618         *)
2619                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2620                 ;;
2621         esac
2622         ;;
2623 yes)
2624         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2625
2626         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2627
2628         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2629                 && test -z "${cf_tst_cflags}" \
2630                 && cf_fix_cppflags=no
2631         ;;
2632 esac
2633 done
2634
2635 if test -n "$cf_new_cflags" ; then
2636
2637         CFLAGS="$CFLAGS $cf_new_cflags"
2638 fi
2639
2640 if test -n "$cf_new_cppflags" ; then
2641
2642         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2643 fi
2644
2645 if test -n "$cf_new_extra_cppflags" ; then
2646
2647         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2648 fi
2649
2650         cat >conftest.$ac_ext <<_ACEOF
2651 #line 2651 "configure"
2652 #include "confdefs.h"
2653
2654 #ifndef CC_HAS_PROTOS
2655 #if !defined(__STDC__) || (__STDC__ != 1)
2656 choke me
2657 #endif
2658 #endif
2659
2660 int
2661 main ()
2662 {
2663
2664         int test (int i, double x);
2665         struct s1 {int (*f) (int a);};
2666         struct s2 {int (*f) (double a);};
2667   ;
2668   return 0;
2669 }
2670 _ACEOF
2671 rm -f conftest.$ac_objext
2672 if { (eval echo "$as_me:2672: \"$ac_compile\"") >&5
2673   (eval $ac_compile) 2>&5
2674   ac_status=$?
2675   echo "$as_me:2675: \$? = $ac_status" >&5
2676   (exit $ac_status); } &&
2677          { ac_try='test -s conftest.$ac_objext'
2678   { (eval echo "$as_me:2678: \"$ac_try\"") >&5
2679   (eval $ac_try) 2>&5
2680   ac_status=$?
2681   echo "$as_me:2681: \$? = $ac_status" >&5
2682   (exit $ac_status); }; }; then
2683   cf_cv_ansi_cc="$cf_arg"; break
2684 else
2685   echo "$as_me: failed program was:" >&5
2686 cat conftest.$ac_ext >&5
2687 fi
2688 rm -f conftest.$ac_objext conftest.$ac_ext
2689 done
2690 CFLAGS="$cf_save_CFLAGS"
2691 CPPFLAGS="$cf_save_CPPFLAGS"
2692
2693 fi
2694 echo "$as_me:2694: result: $cf_cv_ansi_cc" >&5
2695 echo "${ECHO_T}$cf_cv_ansi_cc" >&6
2696
2697 if test "$cf_cv_ansi_cc" != "no"; then
2698 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
2699
2700 cf_fix_cppflags=no
2701 cf_new_cflags=
2702 cf_new_cppflags=
2703 cf_new_extra_cppflags=
2704
2705 for cf_add_cflags in $cf_cv_ansi_cc
2706 do
2707 case $cf_fix_cppflags in
2708 no)
2709         case $cf_add_cflags in #(vi
2710         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2711                 case $cf_add_cflags in
2712                 -D*)
2713                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2714
2715                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2716                                 && test -z "${cf_tst_cflags}" \
2717                                 && cf_fix_cppflags=yes
2718
2719                         if test $cf_fix_cppflags = yes ; then
2720                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2721                                 continue
2722                         elif test "${cf_tst_cflags}" = "\"'" ; then
2723                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2724                                 continue
2725                         fi
2726                         ;;
2727                 esac
2728                 case "$CPPFLAGS" in
2729                 *$cf_add_cflags) #(vi
2730                         ;;
2731                 *) #(vi
2732                         case $cf_add_cflags in #(vi
2733                         -D*)
2734                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2735
2736 CPPFLAGS=`echo "$CPPFLAGS" | \
2737         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2738                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2739
2740                                 ;;
2741                         esac
2742                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2743                         ;;
2744                 esac
2745                 ;;
2746         *)
2747                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2748                 ;;
2749         esac
2750         ;;
2751 yes)
2752         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2753
2754         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2755
2756         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2757                 && test -z "${cf_tst_cflags}" \
2758                 && cf_fix_cppflags=no
2759         ;;
2760 esac
2761 done
2762
2763 if test -n "$cf_new_cflags" ; then
2764
2765         CFLAGS="$CFLAGS $cf_new_cflags"
2766 fi
2767
2768 if test -n "$cf_new_cppflags" ; then
2769
2770         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2771 fi
2772
2773 if test -n "$cf_new_extra_cppflags" ; then
2774
2775         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2776 fi
2777
2778 else
2779         cat >>confdefs.h <<\EOF
2780 #define CC_HAS_PROTOS 1
2781 EOF
2782
2783 fi
2784 fi
2785
2786 if test "$cf_cv_ansi_cc" = "no"; then
2787         { { echo "$as_me:2787: error: Your compiler does not appear to recognize prototypes.
2788 You have the following choices:
2789         a. adjust your compiler options
2790         b. get an up-to-date compiler
2791         c. use a wrapper such as unproto" >&5
2792 echo "$as_me: error: Your compiler does not appear to recognize prototypes.
2793 You have the following choices:
2794         a. adjust your compiler options
2795         b. get an up-to-date compiler
2796         c. use a wrapper such as unproto" >&2;}
2797    { (exit 1); exit 1; }; }
2798 fi
2799
2800 if test "$GCC" = yes
2801 then
2802 cat > conftest.i <<EOF
2803 #ifndef GCC_PRINTF
2804 #define GCC_PRINTF 0
2805 #endif
2806 #ifndef GCC_SCANF
2807 #define GCC_SCANF 0
2808 #endif
2809 #ifndef GCC_NORETURN
2810 #define GCC_NORETURN /* nothing */
2811 #endif
2812 #ifndef GCC_UNUSED
2813 #define GCC_UNUSED /* nothing */
2814 #endif
2815 EOF
2816 if test "$GCC" = yes
2817 then
2818         { echo "$as_me:2818: checking for $CC __attribute__ directives..." >&5
2819 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2820 cat > conftest.$ac_ext <<EOF
2821 #line 2821 "${as_me:-configure}"
2822 #include "confdefs.h"
2823 #include "conftest.h"
2824 #include "conftest.i"
2825 #if     GCC_PRINTF
2826 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2827 #else
2828 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2829 #endif
2830 #if     GCC_SCANF
2831 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2832 #else
2833 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2834 #endif
2835 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2836 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2837 extern void foo(void) GCC_NORETURN;
2838 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2839 EOF
2840         cf_printf_attribute=no
2841         cf_scanf_attribute=no
2842         for cf_attribute in scanf printf unused noreturn
2843         do
2844
2845 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2846
2847                 cf_directive="__attribute__(($cf_attribute))"
2848                 echo "checking for $CC $cf_directive" 1>&5
2849
2850                 case $cf_attribute in #(vi
2851                 printf) #(vi
2852                         cf_printf_attribute=yes
2853                         cat >conftest.h <<EOF
2854 #define GCC_$cf_ATTRIBUTE 1
2855 EOF
2856                         ;;
2857                 scanf) #(vi
2858                         cf_scanf_attribute=yes
2859                         cat >conftest.h <<EOF
2860 #define GCC_$cf_ATTRIBUTE 1
2861 EOF
2862                         ;;
2863                 *) #(vi
2864                         cat >conftest.h <<EOF
2865 #define GCC_$cf_ATTRIBUTE $cf_directive
2866 EOF
2867                         ;;
2868                 esac
2869
2870                 if { (eval echo "$as_me:2870: \"$ac_compile\"") >&5
2871   (eval $ac_compile) 2>&5
2872   ac_status=$?
2873   echo "$as_me:2873: \$? = $ac_status" >&5
2874   (exit $ac_status); }; then
2875                         test -n "$verbose" && echo "$as_me:2875: result: ... $cf_attribute" >&5
2876 echo "${ECHO_T}... $cf_attribute" >&6
2877                         cat conftest.h >>confdefs.h
2878                         case $cf_attribute in #(vi
2879                         printf) #(vi
2880                                 if test "$cf_printf_attribute" = no ; then
2881                                         cat >>confdefs.h <<EOF
2882 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
2883 EOF
2884                                 else
2885                                         cat >>confdefs.h <<EOF
2886 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2887 EOF
2888                                 fi
2889                                 ;;
2890                         scanf) #(vi
2891                                 if test "$cf_scanf_attribute" = no ; then
2892                                         cat >>confdefs.h <<EOF
2893 #define GCC_SCANFLIKE(fmt,var) /* nothing */
2894 EOF
2895                                 else
2896                                         cat >>confdefs.h <<EOF
2897 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2898 EOF
2899                                 fi
2900                                 ;;
2901                         esac
2902                 fi
2903         done
2904 else
2905         fgrep define conftest.i >>confdefs.h
2906 fi
2907 rm -rf conftest*
2908 fi
2909
2910 cf_XOPEN_SOURCE=500
2911 cf_POSIX_C_SOURCE=199506L
2912 cf_xopen_source=
2913
2914 case $host_os in #(vi
2915 aix[4-7]*) #(vi
2916         cf_xopen_source="-D_ALL_SOURCE"
2917         ;;
2918 cygwin) #(vi
2919         cf_XOPEN_SOURCE=600
2920         ;;
2921 darwin[0-8].*) #(vi
2922         cf_xopen_source="-D_APPLE_C_SOURCE"
2923         ;;
2924 darwin*) #(vi
2925         cf_xopen_source="-D_DARWIN_C_SOURCE"
2926         ;;
2927 freebsd*|dragonfly*) #(vi
2928         # 5.x headers associate
2929         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2930         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2931         cf_POSIX_C_SOURCE=200112L
2932         cf_XOPEN_SOURCE=600
2933         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2934         ;;
2935 hpux11*) #(vi
2936         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2937         ;;
2938 hpux*) #(vi
2939         cf_xopen_source="-D_HPUX_SOURCE"
2940         ;;
2941 irix[56].*) #(vi
2942         cf_xopen_source="-D_SGI_SOURCE"
2943         ;;
2944 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
2945
2946 echo "$as_me:2946: checking if we must define _GNU_SOURCE" >&5
2947 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2948 if test "${cf_cv_gnu_source+set}" = set; then
2949   echo $ECHO_N "(cached) $ECHO_C" >&6
2950 else
2951
2952 cat >conftest.$ac_ext <<_ACEOF
2953 #line 2953 "configure"
2954 #include "confdefs.h"
2955 #include <sys/types.h>
2956 int
2957 main ()
2958 {
2959
2960 #ifndef _XOPEN_SOURCE
2961 make an error
2962 #endif
2963   ;
2964   return 0;
2965 }
2966 _ACEOF
2967 rm -f conftest.$ac_objext
2968 if { (eval echo "$as_me:2968: \"$ac_compile\"") >&5
2969   (eval $ac_compile) 2>&5
2970   ac_status=$?
2971   echo "$as_me:2971: \$? = $ac_status" >&5
2972   (exit $ac_status); } &&
2973          { ac_try='test -s conftest.$ac_objext'
2974   { (eval echo "$as_me:2974: \"$ac_try\"") >&5
2975   (eval $ac_try) 2>&5
2976   ac_status=$?
2977   echo "$as_me:2977: \$? = $ac_status" >&5
2978   (exit $ac_status); }; }; then
2979   cf_cv_gnu_source=no
2980 else
2981   echo "$as_me: failed program was:" >&5
2982 cat conftest.$ac_ext >&5
2983 cf_save="$CPPFLAGS"
2984          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
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 #ifdef _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_gnu_source=no
3013 else
3014   echo "$as_me: failed program was:" >&5
3015 cat conftest.$ac_ext >&5
3016 cf_cv_gnu_source=yes
3017 fi
3018 rm -f conftest.$ac_objext conftest.$ac_ext
3019         CPPFLAGS="$cf_save"
3020
3021 fi
3022 rm -f conftest.$ac_objext conftest.$ac_ext
3023
3024 fi
3025 echo "$as_me:3025: result: $cf_cv_gnu_source" >&5
3026 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3027 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3028
3029         ;;
3030 mirbsd*) #(vi
3031         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
3032         ;;
3033 netbsd*) #(vi
3034         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3035         ;;
3036 openbsd*) #(vi
3037         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3038         ;;
3039 osf[45]*) #(vi
3040         cf_xopen_source="-D_OSF_SOURCE"
3041         ;;
3042 nto-qnx*) #(vi
3043         cf_xopen_source="-D_QNX_SOURCE"
3044         ;;
3045 sco*) #(vi
3046         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3047         ;;
3048 solaris2.*) #(vi
3049         cf_xopen_source="-D__EXTENSIONS__"
3050         ;;
3051 *)
3052
3053 echo "$as_me:3053: checking if we should define _XOPEN_SOURCE" >&5
3054 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3055 if test "${cf_cv_xopen_source+set}" = set; then
3056   echo $ECHO_N "(cached) $ECHO_C" >&6
3057 else
3058
3059         cat >conftest.$ac_ext <<_ACEOF
3060 #line 3060 "configure"
3061 #include "confdefs.h"
3062
3063 #include <stdlib.h>
3064 #include <string.h>
3065 #include <sys/types.h>
3066
3067 int
3068 main ()
3069 {
3070
3071 #ifndef _XOPEN_SOURCE
3072 make an error
3073 #endif
3074   ;
3075   return 0;
3076 }
3077 _ACEOF
3078 rm -f conftest.$ac_objext
3079 if { (eval echo "$as_me:3079: \"$ac_compile\"") >&5
3080   (eval $ac_compile) 2>&5
3081   ac_status=$?
3082   echo "$as_me:3082: \$? = $ac_status" >&5
3083   (exit $ac_status); } &&
3084          { ac_try='test -s conftest.$ac_objext'
3085   { (eval echo "$as_me:3085: \"$ac_try\"") >&5
3086   (eval $ac_try) 2>&5
3087   ac_status=$?
3088   echo "$as_me:3088: \$? = $ac_status" >&5
3089   (exit $ac_status); }; }; then
3090   cf_cv_xopen_source=no
3091 else
3092   echo "$as_me: failed program was:" >&5
3093 cat conftest.$ac_ext >&5
3094 cf_save="$CPPFLAGS"
3095          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3096          cat >conftest.$ac_ext <<_ACEOF
3097 #line 3097 "configure"
3098 #include "confdefs.h"
3099
3100 #include <stdlib.h>
3101 #include <string.h>
3102 #include <sys/types.h>
3103
3104 int
3105 main ()
3106 {
3107
3108 #ifdef _XOPEN_SOURCE
3109 make an error
3110 #endif
3111   ;
3112   return 0;
3113 }
3114 _ACEOF
3115 rm -f conftest.$ac_objext
3116 if { (eval echo "$as_me:3116: \"$ac_compile\"") >&5
3117   (eval $ac_compile) 2>&5
3118   ac_status=$?
3119   echo "$as_me:3119: \$? = $ac_status" >&5
3120   (exit $ac_status); } &&
3121          { ac_try='test -s conftest.$ac_objext'
3122   { (eval echo "$as_me:3122: \"$ac_try\"") >&5
3123   (eval $ac_try) 2>&5
3124   ac_status=$?
3125   echo "$as_me:3125: \$? = $ac_status" >&5
3126   (exit $ac_status); }; }; then
3127   cf_cv_xopen_source=no
3128 else
3129   echo "$as_me: failed program was:" >&5
3130 cat conftest.$ac_ext >&5
3131 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3132 fi
3133 rm -f conftest.$ac_objext conftest.$ac_ext
3134         CPPFLAGS="$cf_save"
3135
3136 fi
3137 rm -f conftest.$ac_objext conftest.$ac_ext
3138
3139 fi
3140 echo "$as_me:3140: result: $cf_cv_xopen_source" >&5
3141 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3142
3143 if test "$cf_cv_xopen_source" != no ; then
3144
3145 CFLAGS=`echo "$CFLAGS" | \
3146         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3147                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3148
3149 CPPFLAGS=`echo "$CPPFLAGS" | \
3150         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3151                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3152
3153         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3154
3155 cf_fix_cppflags=no
3156 cf_new_cflags=
3157 cf_new_cppflags=
3158 cf_new_extra_cppflags=
3159
3160 for cf_add_cflags in $cf_temp_xopen_source
3161 do
3162 case $cf_fix_cppflags in
3163 no)
3164         case $cf_add_cflags in #(vi
3165         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3166                 case $cf_add_cflags in
3167                 -D*)
3168                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3169
3170                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3171                                 && test -z "${cf_tst_cflags}" \
3172                                 && cf_fix_cppflags=yes
3173
3174                         if test $cf_fix_cppflags = yes ; then
3175                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3176                                 continue
3177                         elif test "${cf_tst_cflags}" = "\"'" ; then
3178                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3179                                 continue
3180                         fi
3181                         ;;
3182                 esac
3183                 case "$CPPFLAGS" in
3184                 *$cf_add_cflags) #(vi
3185                         ;;
3186                 *) #(vi
3187                         case $cf_add_cflags in #(vi
3188                         -D*)
3189                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3190
3191 CPPFLAGS=`echo "$CPPFLAGS" | \
3192         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3193                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3194
3195                                 ;;
3196                         esac
3197                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3198                         ;;
3199                 esac
3200                 ;;
3201         *)
3202                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3203                 ;;
3204         esac
3205         ;;
3206 yes)
3207         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3208
3209         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3210
3211         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3212                 && test -z "${cf_tst_cflags}" \
3213                 && cf_fix_cppflags=no
3214         ;;
3215 esac
3216 done
3217
3218 if test -n "$cf_new_cflags" ; then
3219
3220         CFLAGS="$CFLAGS $cf_new_cflags"
3221 fi
3222
3223 if test -n "$cf_new_cppflags" ; then
3224
3225         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3226 fi
3227
3228 if test -n "$cf_new_extra_cppflags" ; then
3229
3230         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3231 fi
3232
3233 fi
3234
3235 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3236
3237 cf_save_CFLAGS="$CFLAGS"
3238 cf_save_CPPFLAGS="$CPPFLAGS"
3239
3240 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3241         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3242                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3243
3244 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3245         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3246                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3247
3248 echo "$as_me:3248: checking if we should define _POSIX_C_SOURCE" >&5
3249 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3250 if test "${cf_cv_posix_c_source+set}" = set; then
3251   echo $ECHO_N "(cached) $ECHO_C" >&6
3252 else
3253
3254 echo "${as_me:-configure}:3254: testing if the symbol is already defined go no further ..." 1>&5
3255
3256         cat >conftest.$ac_ext <<_ACEOF
3257 #line 3257 "configure"
3258 #include "confdefs.h"
3259 #include <sys/types.h>
3260 int
3261 main ()
3262 {
3263
3264 #ifndef _POSIX_C_SOURCE
3265 make an error
3266 #endif
3267   ;
3268   return 0;
3269 }
3270 _ACEOF
3271 rm -f conftest.$ac_objext
3272 if { (eval echo "$as_me:3272: \"$ac_compile\"") >&5
3273   (eval $ac_compile) 2>&5
3274   ac_status=$?
3275   echo "$as_me:3275: \$? = $ac_status" >&5
3276   (exit $ac_status); } &&
3277          { ac_try='test -s conftest.$ac_objext'
3278   { (eval echo "$as_me:3278: \"$ac_try\"") >&5
3279   (eval $ac_try) 2>&5
3280   ac_status=$?
3281   echo "$as_me:3281: \$? = $ac_status" >&5
3282   (exit $ac_status); }; }; then
3283   cf_cv_posix_c_source=no
3284 else
3285   echo "$as_me: failed program was:" >&5
3286 cat conftest.$ac_ext >&5
3287 cf_want_posix_source=no
3288          case .$cf_POSIX_C_SOURCE in #(vi
3289          .[12]??*) #(vi
3290                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3291                 ;;
3292          .2) #(vi
3293                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3294                 cf_want_posix_source=yes
3295                 ;;
3296          .*)
3297                 cf_want_posix_source=yes
3298                 ;;
3299          esac
3300          if test "$cf_want_posix_source" = yes ; then
3301                 cat >conftest.$ac_ext <<_ACEOF
3302 #line 3302 "configure"
3303 #include "confdefs.h"
3304 #include <sys/types.h>
3305 int
3306 main ()
3307 {
3308
3309 #ifdef _POSIX_SOURCE
3310 make an error
3311 #endif
3312   ;
3313   return 0;
3314 }
3315 _ACEOF
3316 rm -f conftest.$ac_objext
3317 if { (eval echo "$as_me:3317: \"$ac_compile\"") >&5
3318   (eval $ac_compile) 2>&5
3319   ac_status=$?
3320   echo "$as_me:3320: \$? = $ac_status" >&5
3321   (exit $ac_status); } &&
3322          { ac_try='test -s conftest.$ac_objext'
3323   { (eval echo "$as_me:3323: \"$ac_try\"") >&5
3324   (eval $ac_try) 2>&5
3325   ac_status=$?
3326   echo "$as_me:3326: \$? = $ac_status" >&5
3327   (exit $ac_status); }; }; then
3328   :
3329 else
3330   echo "$as_me: failed program was:" >&5
3331 cat conftest.$ac_ext >&5
3332 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3333 fi
3334 rm -f conftest.$ac_objext conftest.$ac_ext
3335          fi
3336
3337 echo "${as_me:-configure}:3337: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3338
3339          CFLAGS="$cf_trim_CFLAGS"
3340          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3341
3342 echo "${as_me:-configure}:3342: testing if the second compile does not leave our definition intact error ..." 1>&5
3343
3344          cat >conftest.$ac_ext <<_ACEOF
3345 #line 3345 "configure"
3346 #include "confdefs.h"
3347 #include <sys/types.h>
3348 int
3349 main ()
3350 {
3351
3352 #ifndef _POSIX_C_SOURCE
3353 make an error
3354 #endif
3355   ;
3356   return 0;
3357 }
3358 _ACEOF
3359 rm -f conftest.$ac_objext
3360 if { (eval echo "$as_me:3360: \"$ac_compile\"") >&5
3361   (eval $ac_compile) 2>&5
3362   ac_status=$?
3363   echo "$as_me:3363: \$? = $ac_status" >&5
3364   (exit $ac_status); } &&
3365          { ac_try='test -s conftest.$ac_objext'
3366   { (eval echo "$as_me:3366: \"$ac_try\"") >&5
3367   (eval $ac_try) 2>&5
3368   ac_status=$?
3369   echo "$as_me:3369: \$? = $ac_status" >&5
3370   (exit $ac_status); }; }; then
3371   :
3372 else
3373   echo "$as_me: failed program was:" >&5
3374 cat conftest.$ac_ext >&5
3375 cf_cv_posix_c_source=no
3376 fi
3377 rm -f conftest.$ac_objext conftest.$ac_ext
3378          CFLAGS="$cf_save_CFLAGS"
3379          CPPFLAGS="$cf_save_CPPFLAGS"
3380
3381 fi
3382 rm -f conftest.$ac_objext conftest.$ac_ext
3383
3384 fi
3385 echo "$as_me:3385: result: $cf_cv_posix_c_source" >&5
3386 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3387
3388 if test "$cf_cv_posix_c_source" != no ; then
3389         CFLAGS="$cf_trim_CFLAGS"
3390         CPPFLAGS="$cf_trim_CPPFLAGS"
3391
3392 cf_fix_cppflags=no
3393 cf_new_cflags=
3394 cf_new_cppflags=
3395 cf_new_extra_cppflags=
3396
3397 for cf_add_cflags in $cf_cv_posix_c_source
3398 do
3399 case $cf_fix_cppflags in
3400 no)
3401         case $cf_add_cflags in #(vi
3402         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3403                 case $cf_add_cflags in
3404                 -D*)
3405                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3406
3407                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3408                                 && test -z "${cf_tst_cflags}" \
3409                                 && cf_fix_cppflags=yes
3410
3411                         if test $cf_fix_cppflags = yes ; then
3412                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3413                                 continue
3414                         elif test "${cf_tst_cflags}" = "\"'" ; then
3415                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3416                                 continue
3417                         fi
3418                         ;;
3419                 esac
3420                 case "$CPPFLAGS" in
3421                 *$cf_add_cflags) #(vi
3422                         ;;
3423                 *) #(vi
3424                         case $cf_add_cflags in #(vi
3425                         -D*)
3426                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3427
3428 CPPFLAGS=`echo "$CPPFLAGS" | \
3429         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3430                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3431
3432                                 ;;
3433                         esac
3434                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3435                         ;;
3436                 esac
3437                 ;;
3438         *)
3439                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3440                 ;;
3441         esac
3442         ;;
3443 yes)
3444         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3445
3446         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3447
3448         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3449                 && test -z "${cf_tst_cflags}" \
3450                 && cf_fix_cppflags=no
3451         ;;
3452 esac
3453 done
3454
3455 if test -n "$cf_new_cflags" ; then
3456
3457         CFLAGS="$CFLAGS $cf_new_cflags"
3458 fi
3459
3460 if test -n "$cf_new_cppflags" ; then
3461
3462         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3463 fi
3464
3465 if test -n "$cf_new_extra_cppflags" ; then
3466
3467         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3468 fi
3469
3470 fi
3471
3472         ;;
3473 esac
3474
3475 if test -n "$cf_xopen_source" ; then
3476
3477 cf_fix_cppflags=no
3478 cf_new_cflags=
3479 cf_new_cppflags=
3480 cf_new_extra_cppflags=
3481
3482 for cf_add_cflags in $cf_xopen_source
3483 do
3484 case $cf_fix_cppflags in
3485 no)
3486         case $cf_add_cflags in #(vi
3487         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3488                 case $cf_add_cflags in
3489                 -D*)
3490                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3491
3492                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3493                                 && test -z "${cf_tst_cflags}" \
3494                                 && cf_fix_cppflags=yes
3495
3496                         if test $cf_fix_cppflags = yes ; then
3497                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3498                                 continue
3499                         elif test "${cf_tst_cflags}" = "\"'" ; then
3500                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3501                                 continue
3502                         fi
3503                         ;;
3504                 esac
3505                 case "$CPPFLAGS" in
3506                 *$cf_add_cflags) #(vi
3507                         ;;
3508                 *) #(vi
3509                         case $cf_add_cflags in #(vi
3510                         -D*)
3511                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3512
3513 CPPFLAGS=`echo "$CPPFLAGS" | \
3514         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3515                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3516
3517                                 ;;
3518                         esac
3519                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3520                         ;;
3521                 esac
3522                 ;;
3523         *)
3524                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3525                 ;;
3526         esac
3527         ;;
3528 yes)
3529         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3530
3531         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3532
3533         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3534                 && test -z "${cf_tst_cflags}" \
3535                 && cf_fix_cppflags=no
3536         ;;
3537 esac
3538 done
3539
3540 if test -n "$cf_new_cflags" ; then
3541
3542         CFLAGS="$CFLAGS $cf_new_cflags"
3543 fi
3544
3545 if test -n "$cf_new_cppflags" ; then
3546
3547         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3548 fi
3549
3550 if test -n "$cf_new_extra_cppflags" ; then
3551
3552         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3553 fi
3554
3555 fi
3556
3557 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3558         echo "$as_me:3558: checking if _XOPEN_SOURCE really is set" >&5
3559 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3560         cat >conftest.$ac_ext <<_ACEOF
3561 #line 3561 "configure"
3562 #include "confdefs.h"
3563 #include <stdlib.h>
3564 int
3565 main ()
3566 {
3567
3568 #ifndef _XOPEN_SOURCE
3569 make an error
3570 #endif
3571   ;
3572   return 0;
3573 }
3574 _ACEOF
3575 rm -f conftest.$ac_objext
3576 if { (eval echo "$as_me:3576: \"$ac_compile\"") >&5
3577   (eval $ac_compile) 2>&5
3578   ac_status=$?
3579   echo "$as_me:3579: \$? = $ac_status" >&5
3580   (exit $ac_status); } &&
3581          { ac_try='test -s conftest.$ac_objext'
3582   { (eval echo "$as_me:3582: \"$ac_try\"") >&5
3583   (eval $ac_try) 2>&5
3584   ac_status=$?
3585   echo "$as_me:3585: \$? = $ac_status" >&5
3586   (exit $ac_status); }; }; then
3587   cf_XOPEN_SOURCE_set=yes
3588 else
3589   echo "$as_me: failed program was:" >&5
3590 cat conftest.$ac_ext >&5
3591 cf_XOPEN_SOURCE_set=no
3592 fi
3593 rm -f conftest.$ac_objext conftest.$ac_ext
3594         echo "$as_me:3594: result: $cf_XOPEN_SOURCE_set" >&5
3595 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3596         if test $cf_XOPEN_SOURCE_set = yes
3597         then
3598                 cat >conftest.$ac_ext <<_ACEOF
3599 #line 3599 "configure"
3600 #include "confdefs.h"
3601 #include <stdlib.h>
3602 int
3603 main ()
3604 {
3605
3606 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3607 make an error
3608 #endif
3609   ;
3610   return 0;
3611 }
3612 _ACEOF
3613 rm -f conftest.$ac_objext
3614 if { (eval echo "$as_me:3614: \"$ac_compile\"") >&5
3615   (eval $ac_compile) 2>&5
3616   ac_status=$?
3617   echo "$as_me:3617: \$? = $ac_status" >&5
3618   (exit $ac_status); } &&
3619          { ac_try='test -s conftest.$ac_objext'
3620   { (eval echo "$as_me:3620: \"$ac_try\"") >&5
3621   (eval $ac_try) 2>&5
3622   ac_status=$?
3623   echo "$as_me:3623: \$? = $ac_status" >&5
3624   (exit $ac_status); }; }; then
3625   cf_XOPEN_SOURCE_set_ok=yes
3626 else
3627   echo "$as_me: failed program was:" >&5
3628 cat conftest.$ac_ext >&5
3629 cf_XOPEN_SOURCE_set_ok=no
3630 fi
3631 rm -f conftest.$ac_objext conftest.$ac_ext
3632                 if test $cf_XOPEN_SOURCE_set_ok = no
3633                 then
3634                         { echo "$as_me:3634: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3635 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3636                 fi
3637         else
3638
3639 echo "$as_me:3639: checking if we should define _XOPEN_SOURCE" >&5
3640 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3641 if test "${cf_cv_xopen_source+set}" = set; then
3642   echo $ECHO_N "(cached) $ECHO_C" >&6
3643 else
3644
3645         cat >conftest.$ac_ext <<_ACEOF
3646 #line 3646 "configure"
3647 #include "confdefs.h"
3648
3649 #include <stdlib.h>
3650 #include <string.h>
3651 #include <sys/types.h>
3652
3653 int
3654 main ()
3655 {
3656
3657 #ifndef _XOPEN_SOURCE
3658 make an error
3659 #endif
3660   ;
3661   return 0;
3662 }
3663 _ACEOF
3664 rm -f conftest.$ac_objext
3665 if { (eval echo "$as_me:3665: \"$ac_compile\"") >&5
3666   (eval $ac_compile) 2>&5
3667   ac_status=$?
3668   echo "$as_me:3668: \$? = $ac_status" >&5
3669   (exit $ac_status); } &&
3670          { ac_try='test -s conftest.$ac_objext'
3671   { (eval echo "$as_me:3671: \"$ac_try\"") >&5
3672   (eval $ac_try) 2>&5
3673   ac_status=$?
3674   echo "$as_me:3674: \$? = $ac_status" >&5
3675   (exit $ac_status); }; }; then
3676   cf_cv_xopen_source=no
3677 else
3678   echo "$as_me: failed program was:" >&5
3679 cat conftest.$ac_ext >&5
3680 cf_save="$CPPFLAGS"
3681          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3682          cat >conftest.$ac_ext <<_ACEOF
3683 #line 3683 "configure"
3684 #include "confdefs.h"
3685
3686 #include <stdlib.h>
3687 #include <string.h>
3688 #include <sys/types.h>
3689
3690 int
3691 main ()
3692 {
3693
3694 #ifdef _XOPEN_SOURCE
3695 make an error
3696 #endif
3697   ;
3698   return 0;
3699 }
3700 _ACEOF
3701 rm -f conftest.$ac_objext
3702 if { (eval echo "$as_me:3702: \"$ac_compile\"") >&5
3703   (eval $ac_compile) 2>&5
3704   ac_status=$?
3705   echo "$as_me:3705: \$? = $ac_status" >&5
3706   (exit $ac_status); } &&
3707          { ac_try='test -s conftest.$ac_objext'
3708   { (eval echo "$as_me:3708: \"$ac_try\"") >&5
3709   (eval $ac_try) 2>&5
3710   ac_status=$?
3711   echo "$as_me:3711: \$? = $ac_status" >&5
3712   (exit $ac_status); }; }; then
3713   cf_cv_xopen_source=no
3714 else
3715   echo "$as_me: failed program was:" >&5
3716 cat conftest.$ac_ext >&5
3717 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3718 fi
3719 rm -f conftest.$ac_objext conftest.$ac_ext
3720         CPPFLAGS="$cf_save"
3721
3722 fi
3723 rm -f conftest.$ac_objext conftest.$ac_ext
3724
3725 fi
3726 echo "$as_me:3726: result: $cf_cv_xopen_source" >&5
3727 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3728
3729 if test "$cf_cv_xopen_source" != no ; then
3730
3731 CFLAGS=`echo "$CFLAGS" | \
3732         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3733                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3734
3735 CPPFLAGS=`echo "$CPPFLAGS" | \
3736         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3737                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3738
3739         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3740
3741 cf_fix_cppflags=no
3742 cf_new_cflags=
3743 cf_new_cppflags=
3744 cf_new_extra_cppflags=
3745
3746 for cf_add_cflags in $cf_temp_xopen_source
3747 do
3748 case $cf_fix_cppflags in
3749 no)
3750         case $cf_add_cflags in #(vi
3751         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3752                 case $cf_add_cflags in
3753                 -D*)
3754                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3755
3756                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3757                                 && test -z "${cf_tst_cflags}" \
3758                                 && cf_fix_cppflags=yes
3759
3760                         if test $cf_fix_cppflags = yes ; then
3761                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3762                                 continue
3763                         elif test "${cf_tst_cflags}" = "\"'" ; then
3764                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3765                                 continue
3766                         fi
3767                         ;;
3768                 esac
3769                 case "$CPPFLAGS" in
3770                 *$cf_add_cflags) #(vi
3771                         ;;
3772                 *) #(vi
3773                         case $cf_add_cflags in #(vi
3774                         -D*)
3775                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3776
3777 CPPFLAGS=`echo "$CPPFLAGS" | \
3778         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3779                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3780
3781                                 ;;
3782                         esac
3783                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3784                         ;;
3785                 esac
3786                 ;;
3787         *)
3788                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3789                 ;;
3790         esac
3791         ;;
3792 yes)
3793         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3794
3795         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3796
3797         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3798                 && test -z "${cf_tst_cflags}" \
3799                 && cf_fix_cppflags=no
3800         ;;
3801 esac
3802 done
3803
3804 if test -n "$cf_new_cflags" ; then
3805
3806         CFLAGS="$CFLAGS $cf_new_cflags"
3807 fi
3808
3809 if test -n "$cf_new_cppflags" ; then
3810
3811         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3812 fi
3813
3814 if test -n "$cf_new_extra_cppflags" ; then
3815
3816         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3817 fi
3818
3819 fi
3820
3821         fi
3822 fi
3823
3824 echo "$as_me:3824: checking for $CC option to accept ANSI C" >&5
3825 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
3826 if test "${ac_cv_prog_cc_stdc+set}" = set; then
3827   echo $ECHO_N "(cached) $ECHO_C" >&6
3828 else
3829   ac_cv_prog_cc_stdc=no
3830 ac_save_CC=$CC
3831 cat >conftest.$ac_ext <<_ACEOF
3832 #line 3832 "configure"
3833 #include "confdefs.h"
3834 #include <stdarg.h>
3835 #include <stdio.h>
3836 #include <sys/types.h>
3837 #include <sys/stat.h>
3838 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3839 struct buf { int x; };
3840 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3841 static char *e (p, i)
3842      char **p;
3843      int i;
3844 {
3845   return p[i];
3846 }
3847 static char *f (char * (*g) (char **, int), char **p, ...)
3848 {
3849   char *s;
3850   va_list v;
3851   va_start (v,p);
3852   s = g (p, va_arg (v,int));
3853   va_end (v);
3854   return s;
3855 }
3856 int test (int i, double x);
3857 struct s1 {int (*f) (int a);};
3858 struct s2 {int (*f) (double a);};
3859 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3860 int argc;
3861 char **argv;
3862 int
3863 main ()
3864 {
3865 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3866   ;
3867   return 0;
3868 }
3869 _ACEOF
3870 # Don't try gcc -ansi; that turns off useful extensions and
3871 # breaks some systems' header files.
3872 # AIX                   -qlanglvl=ansi
3873 # Ultrix and OSF/1      -std1
3874 # HP-UX 10.20 and later -Ae
3875 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3876 # SVR4                  -Xc -D__EXTENSIONS__
3877 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3878 do
3879   CC="$ac_save_CC $ac_arg"
3880   rm -f conftest.$ac_objext
3881 if { (eval echo "$as_me:3881: \"$ac_compile\"") >&5
3882   (eval $ac_compile) 2>&5
3883   ac_status=$?
3884   echo "$as_me:3884: \$? = $ac_status" >&5
3885   (exit $ac_status); } &&
3886          { ac_try='test -s conftest.$ac_objext'
3887   { (eval echo "$as_me:3887: \"$ac_try\"") >&5
3888   (eval $ac_try) 2>&5
3889   ac_status=$?
3890   echo "$as_me:3890: \$? = $ac_status" >&5
3891   (exit $ac_status); }; }; then
3892   ac_cv_prog_cc_stdc=$ac_arg
3893 break
3894 else
3895   echo "$as_me: failed program was:" >&5
3896 cat conftest.$ac_ext >&5
3897 fi
3898 rm -f conftest.$ac_objext
3899 done
3900 rm -f conftest.$ac_ext conftest.$ac_objext
3901 CC=$ac_save_CC
3902
3903 fi
3904
3905 case "x$ac_cv_prog_cc_stdc" in
3906   x|xno)
3907     echo "$as_me:3907: result: none needed" >&5
3908 echo "${ECHO_T}none needed" >&6 ;;
3909   *)
3910     echo "$as_me:3910: result: $ac_cv_prog_cc_stdc" >&5
3911 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
3912     CC="$CC $ac_cv_prog_cc_stdc" ;;
3913 esac
3914
3915 echo "$as_me:3915: checking for an ANSI C-conforming const" >&5
3916 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
3917 if test "${ac_cv_c_const+set}" = set; then
3918   echo $ECHO_N "(cached) $ECHO_C" >&6
3919 else
3920   cat >conftest.$ac_ext <<_ACEOF
3921 #line 3921 "configure"
3922 #include "confdefs.h"
3923
3924 int
3925 main ()
3926 {
3927 /* FIXME: Include the comments suggested by Paul. */
3928 #ifndef __cplusplus
3929   /* Ultrix mips cc rejects this.  */
3930   typedef int charset[2];
3931   const charset x;
3932   /* SunOS 4.1.1 cc rejects this.  */
3933   char const *const *ccp;
3934   char **p;
3935   /* NEC SVR4.0.2 mips cc rejects this.  */
3936   struct point {int x, y;};
3937   static struct point const zero = {0,0};
3938   /* AIX XL C 1.02.0.0 rejects this.
3939      It does not let you subtract one const X* pointer from another in
3940      an arm of an if-expression whose if-part is not a constant
3941      expression */
3942   const char *g = "string";
3943   ccp = &g + (g ? g-g : 0);
3944   /* HPUX 7.0 cc rejects these. */
3945   ++ccp;
3946   p = (char**) ccp;
3947   ccp = (char const *const *) p;
3948   { /* SCO 3.2v4 cc rejects this.  */
3949     char *t;
3950     char const *s = 0 ? (char *) 0 : (char const *) 0;
3951
3952     *t++ = 0;
3953   }
3954   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3955     int x[] = {25, 17};
3956     const int *foo = &x[0];
3957     ++foo;
3958   }
3959   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3960     typedef const int *iptr;
3961     iptr p = 0;
3962     ++p;
3963   }
3964   { /* AIX XL C 1.02.0.0 rejects this saying
3965        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3966     struct s { int j; const int *ap[3]; };
3967     struct s *b; b->j = 5;
3968   }
3969   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3970     const int foo = 10;
3971   }
3972 #endif
3973
3974   ;
3975   return 0;
3976 }
3977 _ACEOF
3978 rm -f conftest.$ac_objext
3979 if { (eval echo "$as_me:3979: \"$ac_compile\"") >&5
3980   (eval $ac_compile) 2>&5
3981   ac_status=$?
3982   echo "$as_me:3982: \$? = $ac_status" >&5
3983   (exit $ac_status); } &&
3984          { ac_try='test -s conftest.$ac_objext'
3985   { (eval echo "$as_me:3985: \"$ac_try\"") >&5
3986   (eval $ac_try) 2>&5
3987   ac_status=$?
3988   echo "$as_me:3988: \$? = $ac_status" >&5
3989   (exit $ac_status); }; }; then
3990   ac_cv_c_const=yes
3991 else
3992   echo "$as_me: failed program was:" >&5
3993 cat conftest.$ac_ext >&5
3994 ac_cv_c_const=no
3995 fi
3996 rm -f conftest.$ac_objext conftest.$ac_ext
3997 fi
3998 echo "$as_me:3998: result: $ac_cv_c_const" >&5
3999 echo "${ECHO_T}$ac_cv_c_const" >&6
4000 if test $ac_cv_c_const = no; then
4001
4002 cat >>confdefs.h <<\EOF
4003 #define const
4004 EOF
4005
4006 fi
4007
4008 echo "$as_me:4008: checking for signal global datatype" >&5
4009 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4010 if test "${cf_cv_sig_atomic_t+set}" = set; then
4011   echo $ECHO_N "(cached) $ECHO_C" >&6
4012 else
4013
4014         for cf_type in \
4015                 "volatile sig_atomic_t" \
4016                 "sig_atomic_t" \
4017                 "int"
4018         do
4019         cat >conftest.$ac_ext <<_ACEOF
4020 #line 4020 "configure"
4021 #include "confdefs.h"
4022
4023 #include <sys/types.h>
4024 #include <signal.h>
4025 #include <stdio.h>
4026
4027 extern $cf_type x;
4028 $cf_type x;
4029 static void handler(int sig)
4030 {
4031         x = 5;
4032 }
4033 int
4034 main ()
4035 {
4036 signal(SIGINT, handler);
4037                  x = 1
4038   ;
4039   return 0;
4040 }
4041 _ACEOF
4042 rm -f conftest.$ac_objext
4043 if { (eval echo "$as_me:4043: \"$ac_compile\"") >&5
4044   (eval $ac_compile) 2>&5
4045   ac_status=$?
4046   echo "$as_me:4046: \$? = $ac_status" >&5
4047   (exit $ac_status); } &&
4048          { ac_try='test -s conftest.$ac_objext'
4049   { (eval echo "$as_me:4049: \"$ac_try\"") >&5
4050   (eval $ac_try) 2>&5
4051   ac_status=$?
4052   echo "$as_me:4052: \$? = $ac_status" >&5
4053   (exit $ac_status); }; }; then
4054   cf_cv_sig_atomic_t=$cf_type
4055 else
4056   echo "$as_me: failed program was:" >&5
4057 cat conftest.$ac_ext >&5
4058 cf_cv_sig_atomic_t=no
4059 fi
4060 rm -f conftest.$ac_objext conftest.$ac_ext
4061                 test "$cf_cv_sig_atomic_t" != no && break
4062         done
4063
4064 fi
4065
4066 echo "$as_me:4066: result: $cf_cv_sig_atomic_t" >&5
4067 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4068 test "$cf_cv_sig_atomic_t" != no && cat >>confdefs.h <<EOF
4069 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4070 EOF
4071
4072 echo "$as_me:4072: checking if you want to see long compiling messages" >&5
4073 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4074
4075 # Check whether --enable-echo or --disable-echo was given.
4076 if test "${enable_echo+set}" = set; then
4077   enableval="$enable_echo"
4078   test "$enableval" != no && enableval=yes
4079   if test "$enableval" != "yes" ; then
4080
4081     ECHO_LT='--silent'
4082     ECHO_LD='@echo linking $@;'
4083     RULE_CC='@echo compiling $<'
4084     SHOW_CC='@echo compiling $@'
4085     ECHO_CC='@'
4086
4087   else
4088
4089     ECHO_LT=''
4090     ECHO_LD=''
4091     RULE_CC=''
4092     SHOW_CC=''
4093     ECHO_CC=''
4094
4095   fi
4096 else
4097   enableval=yes
4098
4099     ECHO_LT=''
4100     ECHO_LD=''
4101     RULE_CC=''
4102     SHOW_CC=''
4103     ECHO_CC=''
4104
4105 fi;
4106 echo "$as_me:4106: result: $enableval" >&5
4107 echo "${ECHO_T}$enableval" >&6
4108
4109 GCC_VERSION=none
4110 if test "$GCC" = yes ; then
4111         echo "$as_me:4111: checking version of $CC" >&5
4112 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
4113         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
4114         test -z "$GCC_VERSION" && GCC_VERSION=unknown
4115         echo "$as_me:4115: result: $GCC_VERSION" >&5
4116 echo "${ECHO_T}$GCC_VERSION" >&6
4117 fi
4118
4119 if ( test "$GCC" = yes || test "$GXX" = yes )
4120 then
4121 echo "$as_me:4121: checking if you want to turn on gcc warnings" >&5
4122 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
4123
4124 # Check whether --enable-warnings or --disable-warnings was given.
4125 if test "${enable_warnings+set}" = set; then
4126   enableval="$enable_warnings"
4127   test "$enableval" != yes && enableval=no
4128   if test "$enableval" != "no" ; then
4129     with_warnings=yes
4130   else
4131     with_warnings=no
4132   fi
4133 else
4134   enableval=no
4135   with_warnings=no
4136
4137 fi;
4138 echo "$as_me:4138: result: $with_warnings" >&5
4139 echo "${ECHO_T}$with_warnings" >&6
4140 if test "$with_warnings" = "yes"
4141 then
4142
4143 if test "$GCC" = yes
4144 then
4145 cat > conftest.i <<EOF
4146 #ifndef GCC_PRINTF
4147 #define GCC_PRINTF 0
4148 #endif
4149 #ifndef GCC_SCANF
4150 #define GCC_SCANF 0
4151 #endif
4152 #ifndef GCC_NORETURN
4153 #define GCC_NORETURN /* nothing */
4154 #endif
4155 #ifndef GCC_UNUSED
4156 #define GCC_UNUSED /* nothing */
4157 #endif
4158 EOF
4159 if test "$GCC" = yes
4160 then
4161         { echo "$as_me:4161: checking for $CC __attribute__ directives..." >&5
4162 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
4163 cat > conftest.$ac_ext <<EOF
4164 #line 4164 "${as_me:-configure}"
4165 #include "confdefs.h"
4166 #include "conftest.h"
4167 #include "conftest.i"
4168 #if     GCC_PRINTF
4169 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
4170 #else
4171 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
4172 #endif
4173 #if     GCC_SCANF
4174 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
4175 #else
4176 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
4177 #endif
4178 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
4179 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
4180 extern void foo(void) GCC_NORETURN;
4181 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
4182 EOF
4183         cf_printf_attribute=no
4184         cf_scanf_attribute=no
4185         for cf_attribute in scanf printf unused noreturn
4186         do
4187
4188 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4189
4190                 cf_directive="__attribute__(($cf_attribute))"
4191                 echo "checking for $CC $cf_directive" 1>&5
4192
4193                 case $cf_attribute in #(vi
4194                 printf) #(vi
4195                         cf_printf_attribute=yes
4196                         cat >conftest.h <<EOF
4197 #define GCC_$cf_ATTRIBUTE 1
4198 EOF
4199                         ;;
4200                 scanf) #(vi
4201                         cf_scanf_attribute=yes
4202                         cat >conftest.h <<EOF
4203 #define GCC_$cf_ATTRIBUTE 1
4204 EOF
4205                         ;;
4206                 *) #(vi
4207                         cat >conftest.h <<EOF
4208 #define GCC_$cf_ATTRIBUTE $cf_directive
4209 EOF
4210                         ;;
4211                 esac
4212
4213                 if { (eval echo "$as_me:4213: \"$ac_compile\"") >&5
4214   (eval $ac_compile) 2>&5
4215   ac_status=$?
4216   echo "$as_me:4216: \$? = $ac_status" >&5
4217   (exit $ac_status); }; then
4218                         test -n "$verbose" && echo "$as_me:4218: result: ... $cf_attribute" >&5
4219 echo "${ECHO_T}... $cf_attribute" >&6
4220                         cat conftest.h >>confdefs.h
4221                         case $cf_attribute in #(vi
4222                         printf) #(vi
4223                                 if test "$cf_printf_attribute" = no ; then
4224                                         cat >>confdefs.h <<EOF
4225 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
4226 EOF
4227                                 else
4228                                         cat >>confdefs.h <<EOF
4229 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
4230 EOF
4231                                 fi
4232                                 ;;
4233                         scanf) #(vi
4234                                 if test "$cf_scanf_attribute" = no ; then
4235                                         cat >>confdefs.h <<EOF
4236 #define GCC_SCANFLIKE(fmt,var) /* nothing */
4237 EOF
4238                                 else
4239                                         cat >>confdefs.h <<EOF
4240 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
4241 EOF
4242                                 fi
4243                                 ;;
4244                         esac
4245                 fi
4246         done
4247 else
4248         fgrep define conftest.i >>confdefs.h
4249 fi
4250 rm -rf conftest*
4251 fi
4252
4253 INTEL_COMPILER=no
4254
4255 if test "$GCC" = yes ; then
4256         case $host_os in
4257         linux*|gnu*)
4258                 echo "$as_me:4258: checking if this is really Intel C compiler" >&5
4259 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
4260                 cf_save_CFLAGS="$CFLAGS"
4261                 CFLAGS="$CFLAGS -no-gcc"
4262                 cat >conftest.$ac_ext <<_ACEOF
4263 #line 4263 "configure"
4264 #include "confdefs.h"
4265
4266 int
4267 main ()
4268 {
4269
4270 #ifdef __INTEL_COMPILER
4271 #else
4272 make an error
4273 #endif
4274
4275   ;
4276   return 0;
4277 }
4278 _ACEOF
4279 rm -f conftest.$ac_objext
4280 if { (eval echo "$as_me:4280: \"$ac_compile\"") >&5
4281   (eval $ac_compile) 2>&5
4282   ac_status=$?
4283   echo "$as_me:4283: \$? = $ac_status" >&5
4284   (exit $ac_status); } &&
4285          { ac_try='test -s conftest.$ac_objext'
4286   { (eval echo "$as_me:4286: \"$ac_try\"") >&5
4287   (eval $ac_try) 2>&5
4288   ac_status=$?
4289   echo "$as_me:4289: \$? = $ac_status" >&5
4290   (exit $ac_status); }; }; then
4291   INTEL_COMPILER=yes
4292 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
4293
4294 else
4295   echo "$as_me: failed program was:" >&5
4296 cat conftest.$ac_ext >&5
4297 fi
4298 rm -f conftest.$ac_objext conftest.$ac_ext
4299                 CFLAGS="$cf_save_CFLAGS"
4300                 echo "$as_me:4300: result: $INTEL_COMPILER" >&5
4301 echo "${ECHO_T}$INTEL_COMPILER" >&6
4302                 ;;
4303         esac
4304 fi
4305
4306 cat > conftest.$ac_ext <<EOF
4307 #line 4307 "${as_me:-configure}"
4308 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
4309 EOF
4310
4311 if test "$INTEL_COMPILER" = yes
4312 then
4313 # The "-wdXXX" options suppress warnings:
4314 # remark #1419: external declaration in primary source file
4315 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
4316 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
4317 # remark #193: zero used for undefined preprocessing identifier
4318 # remark #593: variable "curs_sb_left_arrow" was set but never used
4319 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
4320 # remark #869: parameter "tw" was never referenced
4321 # remark #981: operands are evaluated in unspecified order
4322 # warning #279: controlling expression is constant
4323
4324         { echo "$as_me:4324: checking for $CC warning options..." >&5
4325 echo "$as_me: checking for $CC warning options..." >&6;}
4326         cf_save_CFLAGS="$CFLAGS"
4327         EXTRA_CFLAGS="-Wall"
4328         for cf_opt in \
4329                 wd1419 \
4330                 wd1683 \
4331                 wd1684 \
4332                 wd193 \
4333                 wd593 \
4334                 wd279 \
4335                 wd810 \
4336                 wd869 \
4337                 wd981
4338         do
4339                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
4340                 if { (eval echo "$as_me:4340: \"$ac_compile\"") >&5
4341   (eval $ac_compile) 2>&5
4342   ac_status=$?
4343   echo "$as_me:4343: \$? = $ac_status" >&5
4344   (exit $ac_status); }; then
4345                         test -n "$verbose" && echo "$as_me:4345: result: ... -$cf_opt" >&5
4346 echo "${ECHO_T}... -$cf_opt" >&6
4347                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
4348                 fi
4349         done
4350         CFLAGS="$cf_save_CFLAGS"
4351
4352 elif test "$GCC" = yes
4353 then
4354         { echo "$as_me:4354: checking for $CC warning options..." >&5
4355 echo "$as_me: checking for $CC warning options..." >&6;}
4356         cf_save_CFLAGS="$CFLAGS"
4357         EXTRA_CFLAGS=
4358         cf_warn_CONST=""
4359         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
4360         for cf_opt in W Wall \
4361                 Wbad-function-cast \
4362                 Wcast-align \
4363                 Wcast-qual \
4364                 Winline \
4365                 Wmissing-declarations \
4366                 Wmissing-prototypes \
4367                 Wnested-externs \
4368                 Wpointer-arith \
4369                 Wshadow \
4370                 Wstrict-prototypes \
4371                 Wundef $cf_warn_CONST
4372         do
4373                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
4374                 if { (eval echo "$as_me:4374: \"$ac_compile\"") >&5
4375   (eval $ac_compile) 2>&5
4376   ac_status=$?
4377   echo "$as_me:4377: \$? = $ac_status" >&5
4378   (exit $ac_status); }; then
4379                         test -n "$verbose" && echo "$as_me:4379: result: ... -$cf_opt" >&5
4380 echo "${ECHO_T}... -$cf_opt" >&6
4381                         case $cf_opt in #(vi
4382                         Wcast-qual) #(vi
4383                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
4384                                 ;;
4385                         Winline) #(vi
4386                                 case $GCC_VERSION in
4387                                 [34].*)
4388                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
4389
4390 echo "${as_me:-configure}:4390: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
4391
4392                                         continue;;
4393                                 esac
4394                                 ;;
4395                         esac
4396                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
4397                 fi
4398         done
4399         CFLAGS="$cf_save_CFLAGS"
4400 fi
4401 rm -rf conftest*
4402
4403 fi
4404 fi
4405
4406 echo "$as_me:4406: checking if you want to use dmalloc for testing" >&5
4407 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
4408
4409 # Check whether --with-dmalloc or --without-dmalloc was given.
4410 if test "${with_dmalloc+set}" = set; then
4411   withval="$with_dmalloc"
4412   cat >>confdefs.h <<\EOF
4413 #define USE_DMALLOC 1
4414 EOF
4415
4416         : ${with_cflags:=-g}
4417         : ${with_no_leaks:=yes}
4418          with_dmalloc=yes
4419 else
4420   with_dmalloc=
4421 fi;
4422 echo "$as_me:4422: result: ${with_dmalloc:-no}" >&5
4423 echo "${ECHO_T}${with_dmalloc:-no}" >&6
4424
4425 case .$with_cflags in #(vi
4426 .*-g*)
4427         case .$CFLAGS in #(vi
4428         .*-g*) #(vi
4429                 ;;
4430         *)
4431
4432 cf_fix_cppflags=no
4433 cf_new_cflags=
4434 cf_new_cppflags=
4435 cf_new_extra_cppflags=
4436
4437 for cf_add_cflags in -g
4438 do
4439 case $cf_fix_cppflags in
4440 no)
4441         case $cf_add_cflags in #(vi
4442         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4443                 case $cf_add_cflags in
4444                 -D*)
4445                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4446
4447                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4448                                 && test -z "${cf_tst_cflags}" \
4449                                 && cf_fix_cppflags=yes
4450
4451                         if test $cf_fix_cppflags = yes ; then
4452                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4453                                 continue
4454                         elif test "${cf_tst_cflags}" = "\"'" ; then
4455                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4456                                 continue
4457                         fi
4458                         ;;
4459                 esac
4460                 case "$CPPFLAGS" in
4461                 *$cf_add_cflags) #(vi
4462                         ;;
4463                 *) #(vi
4464                         case $cf_add_cflags in #(vi
4465                         -D*)
4466                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4467
4468 CPPFLAGS=`echo "$CPPFLAGS" | \
4469         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4470                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4471
4472                                 ;;
4473                         esac
4474                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4475                         ;;
4476                 esac
4477                 ;;
4478         *)
4479                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4480                 ;;
4481         esac
4482         ;;
4483 yes)
4484         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4485
4486         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4487
4488         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4489                 && test -z "${cf_tst_cflags}" \
4490                 && cf_fix_cppflags=no
4491         ;;
4492 esac
4493 done
4494
4495 if test -n "$cf_new_cflags" ; then
4496
4497         CFLAGS="$CFLAGS $cf_new_cflags"
4498 fi
4499
4500 if test -n "$cf_new_cppflags" ; then
4501
4502         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4503 fi
4504
4505 if test -n "$cf_new_extra_cppflags" ; then
4506
4507         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4508 fi
4509
4510                 ;;
4511         esac
4512         ;;
4513 esac
4514
4515 if test "$with_dmalloc" = yes ; then
4516         echo "$as_me:4516: checking for dmalloc.h" >&5
4517 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
4518 if test "${ac_cv_header_dmalloc_h+set}" = set; then
4519   echo $ECHO_N "(cached) $ECHO_C" >&6
4520 else
4521   cat >conftest.$ac_ext <<_ACEOF
4522 #line 4522 "configure"
4523 #include "confdefs.h"
4524 #include <dmalloc.h>
4525 _ACEOF
4526 if { (eval echo "$as_me:4526: \"$ac_cpp conftest.$ac_ext\"") >&5
4527   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4528   ac_status=$?
4529   egrep -v '^ *\+' conftest.er1 >conftest.err
4530   rm -f conftest.er1
4531   cat conftest.err >&5
4532   echo "$as_me:4532: \$? = $ac_status" >&5
4533   (exit $ac_status); } >/dev/null; then
4534   if test -s conftest.err; then
4535     ac_cpp_err=$ac_c_preproc_warn_flag
4536   else
4537     ac_cpp_err=
4538   fi
4539 else
4540   ac_cpp_err=yes
4541 fi
4542 if test -z "$ac_cpp_err"; then
4543   ac_cv_header_dmalloc_h=yes
4544 else
4545   echo "$as_me: failed program was:" >&5
4546   cat conftest.$ac_ext >&5
4547   ac_cv_header_dmalloc_h=no
4548 fi
4549 rm -f conftest.err conftest.$ac_ext
4550 fi
4551 echo "$as_me:4551: result: $ac_cv_header_dmalloc_h" >&5
4552 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
4553 if test $ac_cv_header_dmalloc_h = yes; then
4554
4555 echo "$as_me:4555: checking for dmalloc_debug in -ldmalloc" >&5
4556 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
4557 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
4558   echo $ECHO_N "(cached) $ECHO_C" >&6
4559 else
4560   ac_check_lib_save_LIBS=$LIBS
4561 LIBS="-ldmalloc  $LIBS"
4562 cat >conftest.$ac_ext <<_ACEOF
4563 #line 4563 "configure"
4564 #include "confdefs.h"
4565
4566 /* Override any gcc2 internal prototype to avoid an error.  */
4567 #ifdef __cplusplus
4568 extern "C"
4569 #endif
4570 /* We use char because int might match the return type of a gcc2
4571    builtin and then its argument prototype would still apply.  */
4572 char dmalloc_debug ();
4573 int
4574 main ()
4575 {
4576 dmalloc_debug ();
4577   ;
4578   return 0;
4579 }
4580 _ACEOF
4581 rm -f conftest.$ac_objext conftest$ac_exeext
4582 if { (eval echo "$as_me:4582: \"$ac_link\"") >&5
4583   (eval $ac_link) 2>&5
4584   ac_status=$?
4585   echo "$as_me:4585: \$? = $ac_status" >&5
4586   (exit $ac_status); } &&
4587          { ac_try='test -s conftest$ac_exeext'
4588   { (eval echo "$as_me:4588: \"$ac_try\"") >&5
4589   (eval $ac_try) 2>&5
4590   ac_status=$?
4591   echo "$as_me:4591: \$? = $ac_status" >&5
4592   (exit $ac_status); }; }; then
4593   ac_cv_lib_dmalloc_dmalloc_debug=yes
4594 else
4595   echo "$as_me: failed program was:" >&5
4596 cat conftest.$ac_ext >&5
4597 ac_cv_lib_dmalloc_dmalloc_debug=no
4598 fi
4599 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4600 LIBS=$ac_check_lib_save_LIBS
4601 fi
4602 echo "$as_me:4602: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
4603 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
4604 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
4605   cat >>confdefs.h <<EOF
4606 #define HAVE_LIBDMALLOC 1
4607 EOF
4608
4609   LIBS="-ldmalloc $LIBS"
4610
4611 fi
4612
4613 fi
4614
4615 fi
4616
4617 echo "$as_me:4617: checking if you want to use dbmalloc for testing" >&5
4618 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
4619
4620 # Check whether --with-dbmalloc or --without-dbmalloc was given.
4621 if test "${with_dbmalloc+set}" = set; then
4622   withval="$with_dbmalloc"
4623   cat >>confdefs.h <<\EOF
4624 #define USE_DBMALLOC 1
4625 EOF
4626
4627         : ${with_cflags:=-g}
4628         : ${with_no_leaks:=yes}
4629          with_dbmalloc=yes
4630 else
4631   with_dbmalloc=
4632 fi;
4633 echo "$as_me:4633: result: ${with_dbmalloc:-no}" >&5
4634 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
4635
4636 case .$with_cflags in #(vi
4637 .*-g*)
4638         case .$CFLAGS in #(vi
4639         .*-g*) #(vi
4640                 ;;
4641         *)
4642
4643 cf_fix_cppflags=no
4644 cf_new_cflags=
4645 cf_new_cppflags=
4646 cf_new_extra_cppflags=
4647
4648 for cf_add_cflags in -g
4649 do
4650 case $cf_fix_cppflags in
4651 no)
4652         case $cf_add_cflags in #(vi
4653         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4654                 case $cf_add_cflags in
4655                 -D*)
4656                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4657
4658                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4659                                 && test -z "${cf_tst_cflags}" \
4660                                 && cf_fix_cppflags=yes
4661
4662                         if test $cf_fix_cppflags = yes ; then
4663                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4664                                 continue
4665                         elif test "${cf_tst_cflags}" = "\"'" ; then
4666                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4667                                 continue
4668                         fi
4669                         ;;
4670                 esac
4671                 case "$CPPFLAGS" in
4672                 *$cf_add_cflags) #(vi
4673                         ;;
4674                 *) #(vi
4675                         case $cf_add_cflags in #(vi
4676                         -D*)
4677                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4678
4679 CPPFLAGS=`echo "$CPPFLAGS" | \
4680         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4681                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4682
4683                                 ;;
4684                         esac
4685                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4686                         ;;
4687                 esac
4688                 ;;
4689         *)
4690                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4691                 ;;
4692         esac
4693         ;;
4694 yes)
4695         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4696
4697         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4698
4699         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4700                 && test -z "${cf_tst_cflags}" \
4701                 && cf_fix_cppflags=no
4702         ;;
4703 esac
4704 done
4705
4706 if test -n "$cf_new_cflags" ; then
4707
4708         CFLAGS="$CFLAGS $cf_new_cflags"
4709 fi
4710
4711 if test -n "$cf_new_cppflags" ; then
4712
4713         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4714 fi
4715
4716 if test -n "$cf_new_extra_cppflags" ; then
4717
4718         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4719 fi
4720
4721                 ;;
4722         esac
4723         ;;
4724 esac
4725
4726 if test "$with_dbmalloc" = yes ; then
4727         echo "$as_me:4727: checking for dbmalloc.h" >&5
4728 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
4729 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
4730   echo $ECHO_N "(cached) $ECHO_C" >&6
4731 else
4732   cat >conftest.$ac_ext <<_ACEOF
4733 #line 4733 "configure"
4734 #include "confdefs.h"
4735 #include <dbmalloc.h>
4736 _ACEOF
4737 if { (eval echo "$as_me:4737: \"$ac_cpp conftest.$ac_ext\"") >&5
4738   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4739   ac_status=$?
4740   egrep -v '^ *\+' conftest.er1 >conftest.err
4741   rm -f conftest.er1
4742   cat conftest.err >&5
4743   echo "$as_me:4743: \$? = $ac_status" >&5
4744   (exit $ac_status); } >/dev/null; then
4745   if test -s conftest.err; then
4746     ac_cpp_err=$ac_c_preproc_warn_flag
4747   else
4748     ac_cpp_err=
4749   fi
4750 else
4751   ac_cpp_err=yes
4752 fi
4753 if test -z "$ac_cpp_err"; then
4754   ac_cv_header_dbmalloc_h=yes
4755 else
4756   echo "$as_me: failed program was:" >&5
4757   cat conftest.$ac_ext >&5
4758   ac_cv_header_dbmalloc_h=no
4759 fi
4760 rm -f conftest.err conftest.$ac_ext
4761 fi
4762 echo "$as_me:4762: result: $ac_cv_header_dbmalloc_h" >&5
4763 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
4764 if test $ac_cv_header_dbmalloc_h = yes; then
4765
4766 echo "$as_me:4766: checking for debug_malloc in -ldbmalloc" >&5
4767 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
4768 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
4769   echo $ECHO_N "(cached) $ECHO_C" >&6
4770 else
4771   ac_check_lib_save_LIBS=$LIBS
4772 LIBS="-ldbmalloc  $LIBS"
4773 cat >conftest.$ac_ext <<_ACEOF
4774 #line 4774 "configure"
4775 #include "confdefs.h"
4776
4777 /* Override any gcc2 internal prototype to avoid an error.  */
4778 #ifdef __cplusplus
4779 extern "C"
4780 #endif
4781 /* We use char because int might match the return type of a gcc2
4782    builtin and then its argument prototype would still apply.  */
4783 char debug_malloc ();
4784 int
4785 main ()
4786 {
4787 debug_malloc ();
4788   ;
4789   return 0;
4790 }
4791 _ACEOF
4792 rm -f conftest.$ac_objext conftest$ac_exeext
4793 if { (eval echo "$as_me:4793: \"$ac_link\"") >&5
4794   (eval $ac_link) 2>&5
4795   ac_status=$?
4796   echo "$as_me:4796: \$? = $ac_status" >&5
4797   (exit $ac_status); } &&
4798          { ac_try='test -s conftest$ac_exeext'
4799   { (eval echo "$as_me:4799: \"$ac_try\"") >&5
4800   (eval $ac_try) 2>&5
4801   ac_status=$?
4802   echo "$as_me:4802: \$? = $ac_status" >&5
4803   (exit $ac_status); }; }; then
4804   ac_cv_lib_dbmalloc_debug_malloc=yes
4805 else
4806   echo "$as_me: failed program was:" >&5
4807 cat conftest.$ac_ext >&5
4808 ac_cv_lib_dbmalloc_debug_malloc=no
4809 fi
4810 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4811 LIBS=$ac_check_lib_save_LIBS
4812 fi
4813 echo "$as_me:4813: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
4814 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
4815 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
4816   cat >>confdefs.h <<EOF
4817 #define HAVE_LIBDBMALLOC 1
4818 EOF
4819
4820   LIBS="-ldbmalloc $LIBS"
4821
4822 fi
4823
4824 fi
4825
4826 fi
4827
4828 echo "$as_me:4828: checking if you want to use valgrind for testing" >&5
4829 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
4830
4831 # Check whether --with-valgrind or --without-valgrind was given.
4832 if test "${with_valgrind+set}" = set; then
4833   withval="$with_valgrind"
4834   cat >>confdefs.h <<\EOF
4835 #define USE_VALGRIND 1
4836 EOF
4837
4838         : ${with_cflags:=-g}
4839         : ${with_no_leaks:=yes}
4840          with_valgrind=yes
4841 else
4842   with_valgrind=
4843 fi;
4844 echo "$as_me:4844: result: ${with_valgrind:-no}" >&5
4845 echo "${ECHO_T}${with_valgrind:-no}" >&6
4846
4847 case .$with_cflags in #(vi
4848 .*-g*)
4849         case .$CFLAGS in #(vi
4850         .*-g*) #(vi
4851                 ;;
4852         *)
4853
4854 cf_fix_cppflags=no
4855 cf_new_cflags=
4856 cf_new_cppflags=
4857 cf_new_extra_cppflags=
4858
4859 for cf_add_cflags in -g
4860 do
4861 case $cf_fix_cppflags in
4862 no)
4863         case $cf_add_cflags in #(vi
4864         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4865                 case $cf_add_cflags in
4866                 -D*)
4867                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4868
4869                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4870                                 && test -z "${cf_tst_cflags}" \
4871                                 && cf_fix_cppflags=yes
4872
4873                         if test $cf_fix_cppflags = yes ; then
4874                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4875                                 continue
4876                         elif test "${cf_tst_cflags}" = "\"'" ; then
4877                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4878                                 continue
4879                         fi
4880                         ;;
4881                 esac
4882                 case "$CPPFLAGS" in
4883                 *$cf_add_cflags) #(vi
4884                         ;;
4885                 *) #(vi
4886                         case $cf_add_cflags in #(vi
4887                         -D*)
4888                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4889
4890 CPPFLAGS=`echo "$CPPFLAGS" | \
4891         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4892                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4893
4894                                 ;;
4895                         esac
4896                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4897                         ;;
4898                 esac
4899                 ;;
4900         *)
4901                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4902                 ;;
4903         esac
4904         ;;
4905 yes)
4906         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4907
4908         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4909
4910         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4911                 && test -z "${cf_tst_cflags}" \
4912                 && cf_fix_cppflags=no
4913         ;;
4914 esac
4915 done
4916
4917 if test -n "$cf_new_cflags" ; then
4918
4919         CFLAGS="$CFLAGS $cf_new_cflags"
4920 fi
4921
4922 if test -n "$cf_new_cppflags" ; then
4923
4924         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4925 fi
4926
4927 if test -n "$cf_new_extra_cppflags" ; then
4928
4929         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4930 fi
4931
4932                 ;;
4933         esac
4934         ;;
4935 esac
4936
4937 echo "$as_me:4937: checking if you want to perform memory-leak testing" >&5
4938 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
4939
4940 # Check whether --enable-leaks or --disable-leaks was given.
4941 if test "${enable_leaks+set}" = set; then
4942   enableval="$enable_leaks"
4943   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
4944 else
4945   : ${with_no_leaks:=no}
4946 fi;
4947 echo "$as_me:4947: result: $with_no_leaks" >&5
4948 echo "${ECHO_T}$with_no_leaks" >&6
4949
4950 if test "$with_no_leaks" = yes ; then
4951         cat >>confdefs.h <<\EOF
4952 #define NO_LEAKS 1
4953 EOF
4954
4955         cat >>confdefs.h <<\EOF
4956 #define YY_NO_LEAKS 1
4957 EOF
4958
4959 fi
4960
4961 echo "$as_me:4961: checking if you want to check for wide-character functions" >&5
4962 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4963
4964 # Check whether --enable-widec or --disable-widec was given.
4965 if test "${enable_widec+set}" = set; then
4966   enableval="$enable_widec"
4967   test "$enableval" != no && enableval=yes
4968   if test "$enableval" != "yes" ; then
4969     cf_enable_widec=no
4970   else
4971     cf_enable_widec=yes
4972   fi
4973 else
4974   enableval=yes
4975   cf_enable_widec=yes
4976
4977 fi;
4978 echo "$as_me:4978: result: $cf_enable_widec" >&5
4979 echo "${ECHO_T}$cf_enable_widec" >&6
4980
4981 echo "$as_me:4981: checking for specific curses-directory" >&5
4982 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4983
4984 # Check whether --with-curses-dir or --without-curses-dir was given.
4985 if test "${with_curses_dir+set}" = set; then
4986   withval="$with_curses_dir"
4987   cf_cv_curses_dir=$withval
4988 else
4989   cf_cv_curses_dir=no
4990 fi;
4991 echo "$as_me:4991: result: $cf_cv_curses_dir" >&5
4992 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4993
4994 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4995 then
4996
4997 if test "x$prefix" != xNONE; then
4998   cf_path_syntax="$prefix"
4999 else
5000   cf_path_syntax="$ac_default_prefix"
5001 fi
5002
5003 case ".$withval" in #(vi
5004 .\$\(*\)*|.\'*\'*) #(vi
5005   ;;
5006 ..|./*|.\\*) #(vi
5007   ;;
5008 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
5009   ;;
5010 .\${*prefix}*) #(vi
5011   eval withval="$withval"
5012   case ".$withval" in #(vi
5013   .NONE/*)
5014     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5015     ;;
5016   esac
5017   ;; #(vi
5018 .no|.NONE/*)
5019   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5020   ;;
5021 *)
5022   { { echo "$as_me:5022: error: expected a pathname, not \"$withval\"" >&5
5023 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5024    { (exit 1); exit 1; }; }
5025   ;;
5026 esac
5027
5028         if test -d "$cf_cv_curses_dir"
5029         then
5030
5031 if test -n "$cf_cv_curses_dir/include" ; then
5032   for cf_add_incdir in $cf_cv_curses_dir/include
5033   do
5034         while test $cf_add_incdir != /usr/include
5035         do
5036           if test -d $cf_add_incdir
5037           then
5038                 cf_have_incdir=no
5039                 if test -n "$CFLAGS$CPPFLAGS" ; then
5040                   # a loop is needed to ensure we can add subdirs of existing dirs
5041                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5042                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5043                           cf_have_incdir=yes; break
5044                         fi
5045                   done
5046                 fi
5047
5048                 if test "$cf_have_incdir" = no ; then
5049                   if test "$cf_add_incdir" = /usr/local/include ; then
5050                         if test "$GCC" = yes
5051                         then
5052                           cf_save_CPPFLAGS=$CPPFLAGS
5053                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5054                           cat >conftest.$ac_ext <<_ACEOF
5055 #line 5055 "configure"
5056 #include "confdefs.h"
5057 #include <stdio.h>
5058 int
5059 main ()
5060 {
5061 printf("Hello")
5062   ;
5063   return 0;
5064 }
5065 _ACEOF
5066 rm -f conftest.$ac_objext
5067 if { (eval echo "$as_me:5067: \"$ac_compile\"") >&5
5068   (eval $ac_compile) 2>&5
5069   ac_status=$?
5070   echo "$as_me:5070: \$? = $ac_status" >&5
5071   (exit $ac_status); } &&
5072          { ac_try='test -s conftest.$ac_objext'
5073   { (eval echo "$as_me:5073: \"$ac_try\"") >&5
5074   (eval $ac_try) 2>&5
5075   ac_status=$?
5076   echo "$as_me:5076: \$? = $ac_status" >&5
5077   (exit $ac_status); }; }; then
5078   :
5079 else
5080   echo "$as_me: failed program was:" >&5
5081 cat conftest.$ac_ext >&5
5082 cf_have_incdir=yes
5083 fi
5084 rm -f conftest.$ac_objext conftest.$ac_ext
5085                           CPPFLAGS=$cf_save_CPPFLAGS
5086                         fi
5087                   fi
5088                 fi
5089
5090                 if test "$cf_have_incdir" = no ; then
5091                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5092
5093 echo "${as_me:-configure}:5093: testing adding $cf_add_incdir to include-path ..." 1>&5
5094
5095                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5096
5097                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5098                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5099                   cf_add_incdir="$cf_top_incdir"
5100                 else
5101                   break
5102                 fi
5103           fi
5104         done
5105   done
5106 fi
5107
5108 if test -n "$cf_cv_curses_dir/lib" ; then
5109   for cf_add_libdir in $cf_cv_curses_dir/lib
5110   do
5111     if test $cf_add_libdir = /usr/lib ; then
5112       :
5113     elif test -d $cf_add_libdir
5114     then
5115       cf_have_libdir=no
5116       if test -n "$LDFLAGS$LIBS" ; then
5117         # a loop is needed to ensure we can add subdirs of existing dirs
5118         for cf_test_libdir in $LDFLAGS $LIBS ; do
5119           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5120             cf_have_libdir=yes; break
5121           fi
5122         done
5123       fi
5124       if test "$cf_have_libdir" = no ; then
5125         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5126
5127 echo "${as_me:-configure}:5127: testing adding $cf_add_libdir to library-path ..." 1>&5
5128
5129         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5130       fi
5131     fi
5132   done
5133 fi
5134
5135         fi
5136 fi
5137
5138 echo "$as_me:5138: checking for specified curses library type" >&5
5139 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5140
5141 # Check whether --with-ncursesw or --without-ncursesw was given.
5142 if test "${with_ncursesw+set}" = set; then
5143   withval="$with_ncursesw"
5144   cf_cv_screen=ncursesw
5145 else
5146
5147 # Check whether --with-ncurses or --without-ncurses was given.
5148 if test "${with_ncurses+set}" = set; then
5149   withval="$with_ncurses"
5150   cf_cv_screen=ncurses
5151 else
5152
5153 # Check whether --with-pdcurses or --without-pdcurses was given.
5154 if test "${with_pdcurses+set}" = set; then
5155   withval="$with_pdcurses"
5156   cf_cv_screen=pdcurses
5157 else
5158
5159 # Check whether --with-curses-colr or --without-curses-colr was given.
5160 if test "${with_curses_colr+set}" = set; then
5161   withval="$with_curses_colr"
5162   cf_cv_screen=curses_colr
5163 else
5164
5165 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5166 if test "${with_curses_5lib+set}" = set; then
5167   withval="$with_curses_5lib"
5168   cf_cv_screen=curses_5lib
5169 fi;
5170 fi;
5171 fi;
5172 fi;
5173 fi;
5174
5175 echo "$as_me:5175: result: $cf_cv_screen" >&5
5176 echo "${ECHO_T}$cf_cv_screen" >&6
5177
5178 case $cf_cv_screen in
5179 curses|curses_*)
5180
5181 echo "$as_me:5181: checking for extra include directories" >&5
5182 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5183 if test "${cf_cv_curses_incdir+set}" = set; then
5184   echo $ECHO_N "(cached) $ECHO_C" >&6
5185 else
5186
5187 cf_cv_curses_incdir=no
5188 case $host_os in #(vi
5189 hpux10.*) #(vi
5190         if test "x$cf_cv_screen" = "xcurses_colr"
5191         then
5192                 test -d /usr/include/curses_colr && \
5193                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5194         fi
5195         ;;
5196 sunos3*|sunos4*)
5197         if test "x$cf_cv_screen" = "xcurses_5lib"
5198         then
5199                 test -d /usr/5lib && \
5200                 test -d /usr/5include && \
5201                 cf_cv_curses_incdir="-I/usr/5include"
5202         fi
5203         ;;
5204 esac
5205
5206 fi
5207 echo "$as_me:5207: result: $cf_cv_curses_incdir" >&5
5208 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5209 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
5210
5211 echo "$as_me:5211: checking if we have identified curses headers" >&5
5212 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5213 if test "${cf_cv_ncurses_header+set}" = set; then
5214   echo $ECHO_N "(cached) $ECHO_C" >&6
5215 else
5216
5217 cf_cv_ncurses_header=none
5218 for cf_header in  \
5219         ncurses.h \
5220         curses.h ncurses/ncurses.h ncurses/curses.h
5221 do
5222 cat >conftest.$ac_ext <<_ACEOF
5223 #line 5223 "configure"
5224 #include "confdefs.h"
5225 #include <${cf_header}>
5226 int
5227 main ()
5228 {
5229 initscr(); tgoto("?", 0,0)
5230   ;
5231   return 0;
5232 }
5233 _ACEOF
5234 rm -f conftest.$ac_objext
5235 if { (eval echo "$as_me:5235: \"$ac_compile\"") >&5
5236   (eval $ac_compile) 2>&5
5237   ac_status=$?
5238   echo "$as_me:5238: \$? = $ac_status" >&5
5239   (exit $ac_status); } &&
5240          { ac_try='test -s conftest.$ac_objext'
5241   { (eval echo "$as_me:5241: \"$ac_try\"") >&5
5242   (eval $ac_try) 2>&5
5243   ac_status=$?
5244   echo "$as_me:5244: \$? = $ac_status" >&5
5245   (exit $ac_status); }; }; then
5246   cf_cv_ncurses_header=$cf_header; break
5247 else
5248   echo "$as_me: failed program was:" >&5
5249 cat conftest.$ac_ext >&5
5250 fi
5251 rm -f conftest.$ac_objext conftest.$ac_ext
5252 done
5253
5254 fi
5255 echo "$as_me:5255: result: $cf_cv_ncurses_header" >&5
5256 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5257
5258 if test "$cf_cv_ncurses_header" = none ; then
5259         { { echo "$as_me:5259: error: No curses header-files found" >&5
5260 echo "$as_me: error: No curses header-files found" >&2;}
5261    { (exit 1); exit 1; }; }
5262 fi
5263
5264 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5265
5266 for ac_header in $cf_cv_ncurses_header
5267 do
5268 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5269 echo "$as_me:5269: checking for $ac_header" >&5
5270 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5271 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5272   echo $ECHO_N "(cached) $ECHO_C" >&6
5273 else
5274   cat >conftest.$ac_ext <<_ACEOF
5275 #line 5275 "configure"
5276 #include "confdefs.h"
5277 #include <$ac_header>
5278 _ACEOF
5279 if { (eval echo "$as_me:5279: \"$ac_cpp conftest.$ac_ext\"") >&5
5280   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5281   ac_status=$?
5282   egrep -v '^ *\+' conftest.er1 >conftest.err
5283   rm -f conftest.er1
5284   cat conftest.err >&5
5285   echo "$as_me:5285: \$? = $ac_status" >&5
5286   (exit $ac_status); } >/dev/null; then
5287   if test -s conftest.err; then
5288     ac_cpp_err=$ac_c_preproc_warn_flag
5289   else
5290     ac_cpp_err=
5291   fi
5292 else
5293   ac_cpp_err=yes
5294 fi
5295 if test -z "$ac_cpp_err"; then
5296   eval "$as_ac_Header=yes"
5297 else
5298   echo "$as_me: failed program was:" >&5
5299   cat conftest.$ac_ext >&5
5300   eval "$as_ac_Header=no"
5301 fi
5302 rm -f conftest.err conftest.$ac_ext
5303 fi
5304 echo "$as_me:5304: result: `eval echo '${'$as_ac_Header'}'`" >&5
5305 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5306 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5307   cat >>confdefs.h <<EOF
5308 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5309 EOF
5310
5311 fi
5312 done
5313
5314 echo "$as_me:5314: checking for terminfo header" >&5
5315 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5316 if test "${cf_cv_term_header+set}" = set; then
5317   echo $ECHO_N "(cached) $ECHO_C" >&6
5318 else
5319
5320 case ${cf_cv_ncurses_header} in #(vi
5321 */ncurses.h|*/ncursesw.h) #(vi
5322         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5323         ;;
5324 *)
5325         cf_term_header=term.h
5326         ;;
5327 esac
5328
5329 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5330 do
5331 cat >conftest.$ac_ext <<_ACEOF
5332 #line 5332 "configure"
5333 #include "confdefs.h"
5334 #include <stdio.h>
5335 #include <${cf_cv_ncurses_header:-curses.h}>
5336 #include <$cf_test>
5337
5338 int
5339 main ()
5340 {
5341 int x = auto_left_margin
5342   ;
5343   return 0;
5344 }
5345 _ACEOF
5346 rm -f conftest.$ac_objext
5347 if { (eval echo "$as_me:5347: \"$ac_compile\"") >&5
5348   (eval $ac_compile) 2>&5
5349   ac_status=$?
5350   echo "$as_me:5350: \$? = $ac_status" >&5
5351   (exit $ac_status); } &&
5352          { ac_try='test -s conftest.$ac_objext'
5353   { (eval echo "$as_me:5353: \"$ac_try\"") >&5
5354   (eval $ac_try) 2>&5
5355   ac_status=$?
5356   echo "$as_me:5356: \$? = $ac_status" >&5
5357   (exit $ac_status); }; }; then
5358
5359         cf_cv_term_header="$cf_test"
5360 else
5361   echo "$as_me: failed program was:" >&5
5362 cat conftest.$ac_ext >&5
5363
5364         cf_cv_term_header=unknown
5365
5366 fi
5367 rm -f conftest.$ac_objext conftest.$ac_ext
5368         test "$cf_cv_term_header" != unknown && break
5369 done
5370
5371 fi
5372 echo "$as_me:5372: result: $cf_cv_term_header" >&5
5373 echo "${ECHO_T}$cf_cv_term_header" >&6
5374
5375 # Set definitions to allow ifdef'ing to accommodate subdirectories
5376
5377 case $cf_cv_term_header in # (vi
5378 *term.h)
5379         cat >>confdefs.h <<\EOF
5380 #define HAVE_TERM_H 1
5381 EOF
5382
5383         ;;
5384 esac
5385
5386 case $cf_cv_term_header in # (vi
5387 ncurses/term.h) #(vi
5388         cat >>confdefs.h <<\EOF
5389 #define HAVE_NCURSES_TERM_H 1
5390 EOF
5391
5392         ;;
5393 ncursesw/term.h)
5394         cat >>confdefs.h <<\EOF
5395 #define HAVE_NCURSESW_TERM_H 1
5396 EOF
5397
5398         ;;
5399 esac
5400
5401 echo "$as_me:5401: checking for ncurses version" >&5
5402 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5403 if test "${cf_cv_ncurses_version+set}" = set; then
5404   echo $ECHO_N "(cached) $ECHO_C" >&6
5405 else
5406
5407         cf_cv_ncurses_version=no
5408         cf_tempfile=out$$
5409         rm -f $cf_tempfile
5410         if test "$cross_compiling" = yes; then
5411
5412         # This will not work if the preprocessor splits the line after the
5413         # Autoconf token.  The 'unproto' program does that.
5414         cat > conftest.$ac_ext <<EOF
5415 #include <${cf_cv_ncurses_header:-curses.h}>
5416 #undef Autoconf
5417 #ifdef NCURSES_VERSION
5418 Autoconf NCURSES_VERSION
5419 #else
5420 #ifdef __NCURSES_H
5421 Autoconf "old"
5422 #endif
5423 ;
5424 #endif
5425 EOF
5426         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5427         { (eval echo "$as_me:5427: \"$cf_try\"") >&5
5428   (eval $cf_try) 2>&5
5429   ac_status=$?
5430   echo "$as_me:5430: \$? = $ac_status" >&5
5431   (exit $ac_status); }
5432         if test -f conftest.out ; then
5433                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5434                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5435                 rm -f conftest.out
5436         fi
5437
5438 else
5439   cat >conftest.$ac_ext <<_ACEOF
5440 #line 5440 "configure"
5441 #include "confdefs.h"
5442
5443 #include <${cf_cv_ncurses_header:-curses.h}>
5444 #include <stdio.h>
5445 int main()
5446 {
5447         FILE *fp = fopen("$cf_tempfile", "w");
5448 #ifdef NCURSES_VERSION
5449 # ifdef NCURSES_VERSION_PATCH
5450         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5451 # else
5452         fprintf(fp, "%s\n", NCURSES_VERSION);
5453 # endif
5454 #else
5455 # ifdef __NCURSES_H
5456         fprintf(fp, "old\n");
5457 # else
5458         make an error
5459 # endif
5460 #endif
5461         ${cf_cv_main_return:-return}(0);
5462 }
5463 _ACEOF
5464 rm -f conftest$ac_exeext
5465 if { (eval echo "$as_me:5465: \"$ac_link\"") >&5
5466   (eval $ac_link) 2>&5
5467   ac_status=$?
5468   echo "$as_me:5468: \$? = $ac_status" >&5
5469   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5470   { (eval echo "$as_me:5470: \"$ac_try\"") >&5
5471   (eval $ac_try) 2>&5
5472   ac_status=$?
5473   echo "$as_me:5473: \$? = $ac_status" >&5
5474   (exit $ac_status); }; }; then
5475
5476         cf_cv_ncurses_version=`cat $cf_tempfile`
5477 else
5478   echo "$as_me: program exited with status $ac_status" >&5
5479 echo "$as_me: failed program was:" >&5
5480 cat conftest.$ac_ext >&5
5481 fi
5482 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5483 fi
5484         rm -f $cf_tempfile
5485
5486 fi
5487 echo "$as_me:5487: result: $cf_cv_ncurses_version" >&5
5488 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5489 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
5490 #define NCURSES 1
5491 EOF
5492
5493 echo "$as_me:5493: checking if we have identified curses libraries" >&5
5494 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5495 cat >conftest.$ac_ext <<_ACEOF
5496 #line 5496 "configure"
5497 #include "confdefs.h"
5498 #include <${cf_cv_ncurses_header:-curses.h}>
5499 int
5500 main ()
5501 {
5502 initscr(); tgoto("?", 0,0)
5503   ;
5504   return 0;
5505 }
5506 _ACEOF
5507 rm -f conftest.$ac_objext conftest$ac_exeext
5508 if { (eval echo "$as_me:5508: \"$ac_link\"") >&5
5509   (eval $ac_link) 2>&5
5510   ac_status=$?
5511   echo "$as_me:5511: \$? = $ac_status" >&5
5512   (exit $ac_status); } &&
5513          { ac_try='test -s conftest$ac_exeext'
5514   { (eval echo "$as_me:5514: \"$ac_try\"") >&5
5515   (eval $ac_try) 2>&5
5516   ac_status=$?
5517   echo "$as_me:5517: \$? = $ac_status" >&5
5518   (exit $ac_status); }; }; then
5519   cf_result=yes
5520 else
5521   echo "$as_me: failed program was:" >&5
5522 cat conftest.$ac_ext >&5
5523 cf_result=no
5524 fi
5525 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5526 echo "$as_me:5526: result: $cf_result" >&5
5527 echo "${ECHO_T}$cf_result" >&6
5528
5529 if test "$cf_result" = no ; then
5530 case $host_os in #(vi
5531 freebsd*) #(vi
5532     echo "$as_me:5532: checking for tgoto in -lmytinfo" >&5
5533 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5534 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5535   echo $ECHO_N "(cached) $ECHO_C" >&6
5536 else
5537   ac_check_lib_save_LIBS=$LIBS
5538 LIBS="-lmytinfo  $LIBS"
5539 cat >conftest.$ac_ext <<_ACEOF
5540 #line 5540 "configure"
5541 #include "confdefs.h"
5542
5543 /* Override any gcc2 internal prototype to avoid an error.  */
5544 #ifdef __cplusplus
5545 extern "C"
5546 #endif
5547 /* We use char because int might match the return type of a gcc2
5548    builtin and then its argument prototype would still apply.  */
5549 char tgoto ();
5550 int
5551 main ()
5552 {
5553 tgoto ();
5554   ;
5555   return 0;
5556 }
5557 _ACEOF
5558 rm -f conftest.$ac_objext conftest$ac_exeext
5559 if { (eval echo "$as_me:5559: \"$ac_link\"") >&5
5560   (eval $ac_link) 2>&5
5561   ac_status=$?
5562   echo "$as_me:5562: \$? = $ac_status" >&5
5563   (exit $ac_status); } &&
5564          { ac_try='test -s conftest$ac_exeext'
5565   { (eval echo "$as_me:5565: \"$ac_try\"") >&5
5566   (eval $ac_try) 2>&5
5567   ac_status=$?
5568   echo "$as_me:5568: \$? = $ac_status" >&5
5569   (exit $ac_status); }; }; then
5570   ac_cv_lib_mytinfo_tgoto=yes
5571 else
5572   echo "$as_me: failed program was:" >&5
5573 cat conftest.$ac_ext >&5
5574 ac_cv_lib_mytinfo_tgoto=no
5575 fi
5576 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5577 LIBS=$ac_check_lib_save_LIBS
5578 fi
5579 echo "$as_me:5579: result: $ac_cv_lib_mytinfo_tgoto" >&5
5580 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5581 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5582   LIBS="-lmytinfo $LIBS"
5583 fi
5584
5585     ;;
5586 hpux10.*) #(vi
5587         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5588         # next (1998), and xcurses "newer" (2000).  There is no header file for
5589         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5590         # term.h) for cur_colr
5591         if test "x$cf_cv_screen" = "xcurses_colr"
5592         then
5593                 echo "$as_me:5593: checking for initscr in -lcur_colr" >&5
5594 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5595 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5596   echo $ECHO_N "(cached) $ECHO_C" >&6
5597 else
5598   ac_check_lib_save_LIBS=$LIBS
5599 LIBS="-lcur_colr  $LIBS"
5600 cat >conftest.$ac_ext <<_ACEOF
5601 #line 5601 "configure"
5602 #include "confdefs.h"
5603
5604 /* Override any gcc2 internal prototype to avoid an error.  */
5605 #ifdef __cplusplus
5606 extern "C"
5607 #endif
5608 /* We use char because int might match the return type of a gcc2
5609    builtin and then its argument prototype would still apply.  */
5610 char initscr ();
5611 int
5612 main ()
5613 {
5614 initscr ();
5615   ;
5616   return 0;
5617 }
5618 _ACEOF
5619 rm -f conftest.$ac_objext conftest$ac_exeext
5620 if { (eval echo "$as_me:5620: \"$ac_link\"") >&5
5621   (eval $ac_link) 2>&5
5622   ac_status=$?
5623   echo "$as_me:5623: \$? = $ac_status" >&5
5624   (exit $ac_status); } &&
5625          { ac_try='test -s conftest$ac_exeext'
5626   { (eval echo "$as_me:5626: \"$ac_try\"") >&5
5627   (eval $ac_try) 2>&5
5628   ac_status=$?
5629   echo "$as_me:5629: \$? = $ac_status" >&5
5630   (exit $ac_status); }; }; then
5631   ac_cv_lib_cur_colr_initscr=yes
5632 else
5633   echo "$as_me: failed program was:" >&5
5634 cat conftest.$ac_ext >&5
5635 ac_cv_lib_cur_colr_initscr=no
5636 fi
5637 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5638 LIBS=$ac_check_lib_save_LIBS
5639 fi
5640 echo "$as_me:5640: result: $ac_cv_lib_cur_colr_initscr" >&5
5641 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5642 if test $ac_cv_lib_cur_colr_initscr = yes; then
5643
5644                         LIBS="-lcur_colr $LIBS"
5645                         ac_cv_func_initscr=yes
5646
5647 else
5648
5649                 echo "$as_me:5649: checking for initscr in -lHcurses" >&5
5650 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5651 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5652   echo $ECHO_N "(cached) $ECHO_C" >&6
5653 else
5654   ac_check_lib_save_LIBS=$LIBS
5655 LIBS="-lHcurses  $LIBS"
5656 cat >conftest.$ac_ext <<_ACEOF
5657 #line 5657 "configure"
5658 #include "confdefs.h"
5659
5660 /* Override any gcc2 internal prototype to avoid an error.  */
5661 #ifdef __cplusplus
5662 extern "C"
5663 #endif
5664 /* We use char because int might match the return type of a gcc2
5665    builtin and then its argument prototype would still apply.  */
5666 char initscr ();
5667 int
5668 main ()
5669 {
5670 initscr ();
5671   ;
5672   return 0;
5673 }
5674 _ACEOF
5675 rm -f conftest.$ac_objext conftest$ac_exeext
5676 if { (eval echo "$as_me:5676: \"$ac_link\"") >&5
5677   (eval $ac_link) 2>&5
5678   ac_status=$?
5679   echo "$as_me:5679: \$? = $ac_status" >&5
5680   (exit $ac_status); } &&
5681          { ac_try='test -s conftest$ac_exeext'
5682   { (eval echo "$as_me:5682: \"$ac_try\"") >&5
5683   (eval $ac_try) 2>&5
5684   ac_status=$?
5685   echo "$as_me:5685: \$? = $ac_status" >&5
5686   (exit $ac_status); }; }; then
5687   ac_cv_lib_Hcurses_initscr=yes
5688 else
5689   echo "$as_me: failed program was:" >&5
5690 cat conftest.$ac_ext >&5
5691 ac_cv_lib_Hcurses_initscr=no
5692 fi
5693 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5694 LIBS=$ac_check_lib_save_LIBS
5695 fi
5696 echo "$as_me:5696: result: $ac_cv_lib_Hcurses_initscr" >&5
5697 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5698 if test $ac_cv_lib_Hcurses_initscr = yes; then
5699
5700                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5701                         LIBS="-lHcurses $LIBS"
5702                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5703                         ac_cv_func_initscr=yes
5704
5705 fi
5706
5707 fi
5708
5709         fi
5710     ;;
5711 linux*)
5712         case `arch 2>/dev/null` in
5713         x86_64)
5714                 if test -d /lib64
5715                 then
5716
5717 if test -n "/lib64" ; then
5718   for cf_add_libdir in /lib64
5719   do
5720     if test $cf_add_libdir = /usr/lib ; then
5721       :
5722     elif test -d $cf_add_libdir
5723     then
5724       cf_have_libdir=no
5725       if test -n "$LDFLAGS$LIBS" ; then
5726         # a loop is needed to ensure we can add subdirs of existing dirs
5727         for cf_test_libdir in $LDFLAGS $LIBS ; do
5728           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5729             cf_have_libdir=yes; break
5730           fi
5731         done
5732       fi
5733       if test "$cf_have_libdir" = no ; then
5734         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5735
5736 echo "${as_me:-configure}:5736: testing adding $cf_add_libdir to library-path ..." 1>&5
5737
5738         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5739       fi
5740     fi
5741   done
5742 fi
5743
5744                 else
5745
5746 if test -n "/lib" ; then
5747   for cf_add_libdir in /lib
5748   do
5749     if test $cf_add_libdir = /usr/lib ; then
5750       :
5751     elif test -d $cf_add_libdir
5752     then
5753       cf_have_libdir=no
5754       if test -n "$LDFLAGS$LIBS" ; then
5755         # a loop is needed to ensure we can add subdirs of existing dirs
5756         for cf_test_libdir in $LDFLAGS $LIBS ; do
5757           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5758             cf_have_libdir=yes; break
5759           fi
5760         done
5761       fi
5762       if test "$cf_have_libdir" = no ; then
5763         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5764
5765 echo "${as_me:-configure}:5765: testing adding $cf_add_libdir to library-path ..." 1>&5
5766
5767         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5768       fi
5769     fi
5770   done
5771 fi
5772
5773                 fi
5774                 ;;
5775         *)
5776
5777 if test -n "/lib" ; then
5778   for cf_add_libdir in /lib
5779   do
5780     if test $cf_add_libdir = /usr/lib ; then
5781       :
5782     elif test -d $cf_add_libdir
5783     then
5784       cf_have_libdir=no
5785       if test -n "$LDFLAGS$LIBS" ; then
5786         # a loop is needed to ensure we can add subdirs of existing dirs
5787         for cf_test_libdir in $LDFLAGS $LIBS ; do
5788           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5789             cf_have_libdir=yes; break
5790           fi
5791         done
5792       fi
5793       if test "$cf_have_libdir" = no ; then
5794         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5795
5796 echo "${as_me:-configure}:5796: testing adding $cf_add_libdir to library-path ..." 1>&5
5797
5798         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5799       fi
5800     fi
5801   done
5802 fi
5803
5804                 ;;
5805         esac
5806     ;;
5807 sunos3*|sunos4*)
5808         if test "x$cf_cv_screen" = "xcurses_5lib"
5809         then
5810                 if test -d /usr/5lib ; then
5811
5812 if test -n "/usr/5lib" ; then
5813   for cf_add_libdir in /usr/5lib
5814   do
5815     if test $cf_add_libdir = /usr/lib ; then
5816       :
5817     elif test -d $cf_add_libdir
5818     then
5819       cf_have_libdir=no
5820       if test -n "$LDFLAGS$LIBS" ; then
5821         # a loop is needed to ensure we can add subdirs of existing dirs
5822         for cf_test_libdir in $LDFLAGS $LIBS ; do
5823           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5824             cf_have_libdir=yes; break
5825           fi
5826         done
5827       fi
5828       if test "$cf_have_libdir" = no ; then
5829         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5830
5831 echo "${as_me:-configure}:5831: testing adding $cf_add_libdir to library-path ..." 1>&5
5832
5833         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5834       fi
5835     fi
5836   done
5837 fi
5838
5839                         LIBS="-lcurses -ltermcap $LIBS"
5840                 fi
5841     fi
5842     ac_cv_func_initscr=yes
5843     ;;
5844 esac
5845
5846 if test ".$ac_cv_func_initscr" != .yes ; then
5847     cf_save_LIBS="$LIBS"
5848     cf_term_lib=""
5849     cf_curs_lib=""
5850
5851     if test ".${cf_cv_ncurses_version:-no}" != .no
5852     then
5853         cf_check_list="ncurses curses cursesX"
5854     else
5855         cf_check_list="cursesX curses ncurses"
5856     fi
5857
5858     # Check for library containing tgoto.  Do this before curses library
5859     # because it may be needed to link the test-case for initscr.
5860     echo "$as_me:5860: checking for tgoto" >&5
5861 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5862 if test "${ac_cv_func_tgoto+set}" = set; then
5863   echo $ECHO_N "(cached) $ECHO_C" >&6
5864 else
5865   cat >conftest.$ac_ext <<_ACEOF
5866 #line 5866 "configure"
5867 #include "confdefs.h"
5868 /* System header to define __stub macros and hopefully few prototypes,
5869     which can conflict with char tgoto (); below.  */
5870 #include <assert.h>
5871 /* Override any gcc2 internal prototype to avoid an error.  */
5872 #ifdef __cplusplus
5873 extern "C"
5874 #endif
5875 /* We use char because int might match the return type of a gcc2
5876    builtin and then its argument prototype would still apply.  */
5877 char tgoto ();
5878 char (*f) ();
5879
5880 int
5881 main ()
5882 {
5883 /* The GNU C library defines this for functions which it implements
5884     to always fail with ENOSYS.  Some functions are actually named
5885     something starting with __ and the normal name is an alias.  */
5886 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5887 choke me
5888 #else
5889 f = tgoto;
5890 #endif
5891
5892   ;
5893   return 0;
5894 }
5895 _ACEOF
5896 rm -f conftest.$ac_objext conftest$ac_exeext
5897 if { (eval echo "$as_me:5897: \"$ac_link\"") >&5
5898   (eval $ac_link) 2>&5
5899   ac_status=$?
5900   echo "$as_me:5900: \$? = $ac_status" >&5
5901   (exit $ac_status); } &&
5902          { ac_try='test -s conftest$ac_exeext'
5903   { (eval echo "$as_me:5903: \"$ac_try\"") >&5
5904   (eval $ac_try) 2>&5
5905   ac_status=$?
5906   echo "$as_me:5906: \$? = $ac_status" >&5
5907   (exit $ac_status); }; }; then
5908   ac_cv_func_tgoto=yes
5909 else
5910   echo "$as_me: failed program was:" >&5
5911 cat conftest.$ac_ext >&5
5912 ac_cv_func_tgoto=no
5913 fi
5914 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5915 fi
5916 echo "$as_me:5916: result: $ac_cv_func_tgoto" >&5
5917 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5918 if test $ac_cv_func_tgoto = yes; then
5919   cf_term_lib=predefined
5920 else
5921
5922         for cf_term_lib in $cf_check_list otermcap termcap termlib unknown
5923         do
5924             as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5925 echo "$as_me:5925: checking for tgoto in -l$cf_term_lib" >&5
5926 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5927 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5928   echo $ECHO_N "(cached) $ECHO_C" >&6
5929 else
5930   ac_check_lib_save_LIBS=$LIBS
5931 LIBS="-l$cf_term_lib  $LIBS"
5932 cat >conftest.$ac_ext <<_ACEOF
5933 #line 5933 "configure"
5934 #include "confdefs.h"
5935
5936 /* Override any gcc2 internal prototype to avoid an error.  */
5937 #ifdef __cplusplus
5938 extern "C"
5939 #endif
5940 /* We use char because int might match the return type of a gcc2
5941    builtin and then its argument prototype would still apply.  */
5942 char tgoto ();
5943 int
5944 main ()
5945 {
5946 tgoto ();
5947   ;
5948   return 0;
5949 }
5950 _ACEOF
5951 rm -f conftest.$ac_objext conftest$ac_exeext
5952 if { (eval echo "$as_me:5952: \"$ac_link\"") >&5
5953   (eval $ac_link) 2>&5
5954   ac_status=$?
5955   echo "$as_me:5955: \$? = $ac_status" >&5
5956   (exit $ac_status); } &&
5957          { ac_try='test -s conftest$ac_exeext'
5958   { (eval echo "$as_me:5958: \"$ac_try\"") >&5
5959   (eval $ac_try) 2>&5
5960   ac_status=$?
5961   echo "$as_me:5961: \$? = $ac_status" >&5
5962   (exit $ac_status); }; }; then
5963   eval "$as_ac_Lib=yes"
5964 else
5965   echo "$as_me: failed program was:" >&5
5966 cat conftest.$ac_ext >&5
5967 eval "$as_ac_Lib=no"
5968 fi
5969 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5970 LIBS=$ac_check_lib_save_LIBS
5971 fi
5972 echo "$as_me:5972: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5973 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5974 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5975   break
5976 fi
5977
5978         done
5979
5980 fi
5981
5982     # Check for library containing initscr
5983     test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5984         for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5985     do
5986         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5987 echo "$as_me:5987: checking for initscr in -l$cf_curs_lib" >&5
5988 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5989 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5990   echo $ECHO_N "(cached) $ECHO_C" >&6
5991 else
5992   ac_check_lib_save_LIBS=$LIBS
5993 LIBS="-l$cf_curs_lib  $LIBS"
5994 cat >conftest.$ac_ext <<_ACEOF
5995 #line 5995 "configure"
5996 #include "confdefs.h"
5997
5998 /* Override any gcc2 internal prototype to avoid an error.  */
5999 #ifdef __cplusplus
6000 extern "C"
6001 #endif
6002 /* We use char because int might match the return type of a gcc2
6003    builtin and then its argument prototype would still apply.  */
6004 char initscr ();
6005 int
6006 main ()
6007 {
6008 initscr ();
6009   ;
6010   return 0;
6011 }
6012 _ACEOF
6013 rm -f conftest.$ac_objext conftest$ac_exeext
6014 if { (eval echo "$as_me:6014: \"$ac_link\"") >&5
6015   (eval $ac_link) 2>&5
6016   ac_status=$?
6017   echo "$as_me:6017: \$? = $ac_status" >&5
6018   (exit $ac_status); } &&
6019          { ac_try='test -s conftest$ac_exeext'
6020   { (eval echo "$as_me:6020: \"$ac_try\"") >&5
6021   (eval $ac_try) 2>&5
6022   ac_status=$?
6023   echo "$as_me:6023: \$? = $ac_status" >&5
6024   (exit $ac_status); }; }; then
6025   eval "$as_ac_Lib=yes"
6026 else
6027   echo "$as_me: failed program was:" >&5
6028 cat conftest.$ac_ext >&5
6029 eval "$as_ac_Lib=no"
6030 fi
6031 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6032 LIBS=$ac_check_lib_save_LIBS
6033 fi
6034 echo "$as_me:6034: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6035 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6036 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6037   break
6038 fi
6039
6040     done
6041     test $cf_curs_lib = unknown && { { echo "$as_me:6041: error: no curses library found" >&5
6042 echo "$as_me: error: no curses library found" >&2;}
6043    { (exit 1); exit 1; }; }
6044
6045     LIBS="-l$cf_curs_lib $cf_save_LIBS"
6046     if test "$cf_term_lib" = unknown ; then
6047         echo "$as_me:6047: checking if we can link with $cf_curs_lib library" >&5
6048 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6049         cat >conftest.$ac_ext <<_ACEOF
6050 #line 6050 "configure"
6051 #include "confdefs.h"
6052 #include <${cf_cv_ncurses_header:-curses.h}>
6053 int
6054 main ()
6055 {
6056 initscr()
6057   ;
6058   return 0;
6059 }
6060 _ACEOF
6061 rm -f conftest.$ac_objext conftest$ac_exeext
6062 if { (eval echo "$as_me:6062: \"$ac_link\"") >&5
6063   (eval $ac_link) 2>&5
6064   ac_status=$?
6065   echo "$as_me:6065: \$? = $ac_status" >&5
6066   (exit $ac_status); } &&
6067          { ac_try='test -s conftest$ac_exeext'
6068   { (eval echo "$as_me:6068: \"$ac_try\"") >&5
6069   (eval $ac_try) 2>&5
6070   ac_status=$?
6071   echo "$as_me:6071: \$? = $ac_status" >&5
6072   (exit $ac_status); }; }; then
6073   cf_result=yes
6074 else
6075   echo "$as_me: failed program was:" >&5
6076 cat conftest.$ac_ext >&5
6077 cf_result=no
6078 fi
6079 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6080         echo "$as_me:6080: result: $cf_result" >&5
6081 echo "${ECHO_T}$cf_result" >&6
6082         test $cf_result = no && { { echo "$as_me:6082: error: Cannot link curses library" >&5
6083 echo "$as_me: error: Cannot link curses library" >&2;}
6084    { (exit 1); exit 1; }; }
6085     elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6086         :
6087     elif test "$cf_term_lib" != predefined ; then
6088         echo "$as_me:6088: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6089 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6090         cat >conftest.$ac_ext <<_ACEOF
6091 #line 6091 "configure"
6092 #include "confdefs.h"
6093 #include <${cf_cv_ncurses_header:-curses.h}>
6094 int
6095 main ()
6096 {
6097 initscr(); tgoto((char *)0, 0, 0);
6098   ;
6099   return 0;
6100 }
6101 _ACEOF
6102 rm -f conftest.$ac_objext conftest$ac_exeext
6103 if { (eval echo "$as_me:6103: \"$ac_link\"") >&5
6104   (eval $ac_link) 2>&5
6105   ac_status=$?
6106   echo "$as_me:6106: \$? = $ac_status" >&5
6107   (exit $ac_status); } &&
6108          { ac_try='test -s conftest$ac_exeext'
6109   { (eval echo "$as_me:6109: \"$ac_try\"") >&5
6110   (eval $ac_try) 2>&5
6111   ac_status=$?
6112   echo "$as_me:6112: \$? = $ac_status" >&5
6113   (exit $ac_status); }; }; then
6114   cf_result=no
6115 else
6116   echo "$as_me: failed program was:" >&5
6117 cat conftest.$ac_ext >&5
6118
6119             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6120             cat >conftest.$ac_ext <<_ACEOF
6121 #line 6121 "configure"
6122 #include "confdefs.h"
6123 #include <${cf_cv_ncurses_header:-curses.h}>
6124 int
6125 main ()
6126 {
6127 initscr()
6128   ;
6129   return 0;
6130 }
6131 _ACEOF
6132 rm -f conftest.$ac_objext conftest$ac_exeext
6133 if { (eval echo "$as_me:6133: \"$ac_link\"") >&5
6134   (eval $ac_link) 2>&5
6135   ac_status=$?
6136   echo "$as_me:6136: \$? = $ac_status" >&5
6137   (exit $ac_status); } &&
6138          { ac_try='test -s conftest$ac_exeext'
6139   { (eval echo "$as_me:6139: \"$ac_try\"") >&5
6140   (eval $ac_try) 2>&5
6141   ac_status=$?
6142   echo "$as_me:6142: \$? = $ac_status" >&5
6143   (exit $ac_status); }; }; then
6144   cf_result=yes
6145 else
6146   echo "$as_me: failed program was:" >&5
6147 cat conftest.$ac_ext >&5
6148 cf_result=error
6149 fi
6150 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6151
6152 fi
6153 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6154         echo "$as_me:6154: result: $cf_result" >&5
6155 echo "${ECHO_T}$cf_result" >&6
6156     fi
6157 fi
6158 fi
6159
6160 echo "$as_me:6160: checking for NetBSD form.h" >&5
6161 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
6162 if test "${cf_cv_netbsd_form_h+set}" = set; then
6163   echo $ECHO_N "(cached) $ECHO_C" >&6
6164 else
6165
6166 cat >conftest.$ac_ext <<_ACEOF
6167 #line 6167 "configure"
6168 #include "confdefs.h"
6169
6170 #include <${cf_cv_ncurses_header:-curses.h}>
6171 #include <form.h>
6172
6173 int
6174 main ()
6175 {
6176
6177         FORM *form;
6178         int y = current_field(form)->cursor_ypos;
6179         int x = current_field(form)->cursor_xpos;
6180
6181   ;
6182   return 0;
6183 }
6184 _ACEOF
6185 rm -f conftest.$ac_objext
6186 if { (eval echo "$as_me:6186: \"$ac_compile\"") >&5
6187   (eval $ac_compile) 2>&5
6188   ac_status=$?
6189   echo "$as_me:6189: \$? = $ac_status" >&5
6190   (exit $ac_status); } &&
6191          { ac_try='test -s conftest.$ac_objext'
6192   { (eval echo "$as_me:6192: \"$ac_try\"") >&5
6193   (eval $ac_try) 2>&5
6194   ac_status=$?
6195   echo "$as_me:6195: \$? = $ac_status" >&5
6196   (exit $ac_status); }; }; then
6197   cf_cv_netbsd_form_h=yes
6198
6199 else
6200   echo "$as_me: failed program was:" >&5
6201 cat conftest.$ac_ext >&5
6202 cf_cv_netbsd_form_h=no
6203 fi
6204 rm -f conftest.$ac_objext conftest.$ac_ext
6205
6206 fi
6207 echo "$as_me:6207: result: $cf_cv_netbsd_form_h" >&5
6208 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
6209
6210 test "$cf_cv_netbsd_form_h" = yes && cat >>confdefs.h <<\EOF
6211 #define HAVE_NETBSD_FORM_H 1
6212 EOF
6213
6214 echo "$as_me:6214: checking for NetBSD menu.h" >&5
6215 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
6216 if test "${cf_cv_netbsd_menu_h+set}" = set; then
6217   echo $ECHO_N "(cached) $ECHO_C" >&6
6218 else
6219
6220 cat >conftest.$ac_ext <<_ACEOF
6221 #line 6221 "configure"
6222 #include "confdefs.h"
6223
6224 #include <${cf_cv_ncurses_header:-curses.h}>
6225 #include <menu.h>
6226
6227 int
6228 main ()
6229 {
6230
6231         MENU *menu;
6232         int y = menu->max_item_width;
6233
6234   ;
6235   return 0;
6236 }
6237 _ACEOF
6238 rm -f conftest.$ac_objext
6239 if { (eval echo "$as_me:6239: \"$ac_compile\"") >&5
6240   (eval $ac_compile) 2>&5
6241   ac_status=$?
6242   echo "$as_me:6242: \$? = $ac_status" >&5
6243   (exit $ac_status); } &&
6244          { ac_try='test -s conftest.$ac_objext'
6245   { (eval echo "$as_me:6245: \"$ac_try\"") >&5
6246   (eval $ac_try) 2>&5
6247   ac_status=$?
6248   echo "$as_me:6248: \$? = $ac_status" >&5
6249   (exit $ac_status); }; }; then
6250   cf_cv_netbsd_menu_h=yes
6251
6252 else
6253   echo "$as_me: failed program was:" >&5
6254 cat conftest.$ac_ext >&5
6255 cf_cv_netbsd_menu_h=no
6256 fi
6257 rm -f conftest.$ac_objext conftest.$ac_ext
6258
6259 fi
6260 echo "$as_me:6260: result: $cf_cv_netbsd_menu_h" >&5
6261 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
6262
6263 test "$cf_cv_netbsd_menu_h" = yes && cat >>confdefs.h <<\EOF
6264 #define HAVE_NETBSD_MENU_H 1
6265 EOF
6266
6267         ;;
6268 ncurses)
6269
6270 cf_ncuconfig_root=ncurses
6271
6272 echo "Looking for ${cf_ncuconfig_root}-config"
6273 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6274 do
6275   # Extract the first word of "$ac_prog", so it can be a program name with args.
6276 set dummy $ac_prog; ac_word=$2
6277 echo "$as_me:6277: checking for $ac_word" >&5
6278 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6279 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
6280   echo $ECHO_N "(cached) $ECHO_C" >&6
6281 else
6282   case $NCURSES_CONFIG in
6283   [\\/]* | ?:[\\/]*)
6284   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
6285   ;;
6286   *)
6287   ac_save_IFS=$IFS; IFS=$ac_path_separator
6288 ac_dummy="$PATH"
6289 for ac_dir in $ac_dummy; do
6290   IFS=$ac_save_IFS
6291   test -z "$ac_dir" && ac_dir=.
6292   if $as_executable_p "$ac_dir/$ac_word"; then
6293    ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
6294    echo "$as_me:6294: found $ac_dir/$ac_word" >&5
6295    break
6296 fi
6297 done
6298
6299   ;;
6300 esac
6301 fi
6302 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
6303
6304 if test -n "$NCURSES_CONFIG"; then
6305   echo "$as_me:6305: result: $NCURSES_CONFIG" >&5
6306 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6307 else
6308   echo "$as_me:6308: result: no" >&5
6309 echo "${ECHO_T}no" >&6
6310 fi
6311
6312   test -n "$NCURSES_CONFIG" && break
6313 done
6314 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
6315
6316 if test "$NCURSES_CONFIG" != none ; then
6317
6318 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6319 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
6320
6321 # even with config script, some packages use no-override for curses.h
6322
6323 echo "$as_me:6323: checking if we have identified curses headers" >&5
6324 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6325 if test "${cf_cv_ncurses_header+set}" = set; then
6326   echo $ECHO_N "(cached) $ECHO_C" >&6
6327 else
6328
6329 cf_cv_ncurses_header=none
6330 for cf_header in  \
6331     ncurses/ncurses.h \
6332         ncurses/curses.h \
6333         ncurses.h \
6334         curses.h
6335 do
6336 cat >conftest.$ac_ext <<_ACEOF
6337 #line 6337 "configure"
6338 #include "confdefs.h"
6339 #include <${cf_header}>
6340 int
6341 main ()
6342 {
6343 initscr(); tgoto("?", 0,0)
6344   ;
6345   return 0;
6346 }
6347 _ACEOF
6348 rm -f conftest.$ac_objext
6349 if { (eval echo "$as_me:6349: \"$ac_compile\"") >&5
6350   (eval $ac_compile) 2>&5
6351   ac_status=$?
6352   echo "$as_me:6352: \$? = $ac_status" >&5
6353   (exit $ac_status); } &&
6354          { ac_try='test -s conftest.$ac_objext'
6355   { (eval echo "$as_me:6355: \"$ac_try\"") >&5
6356   (eval $ac_try) 2>&5
6357   ac_status=$?
6358   echo "$as_me:6358: \$? = $ac_status" >&5
6359   (exit $ac_status); }; }; then
6360   cf_cv_ncurses_header=$cf_header; break
6361 else
6362   echo "$as_me: failed program was:" >&5
6363 cat conftest.$ac_ext >&5
6364 fi
6365 rm -f conftest.$ac_objext conftest.$ac_ext
6366 done
6367
6368 fi
6369 echo "$as_me:6369: result: $cf_cv_ncurses_header" >&5
6370 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6371
6372 if test "$cf_cv_ncurses_header" = none ; then
6373         { { echo "$as_me:6373: error: No curses header-files found" >&5
6374 echo "$as_me: error: No curses header-files found" >&2;}
6375    { (exit 1); exit 1; }; }
6376 fi
6377
6378 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6379
6380 for ac_header in $cf_cv_ncurses_header
6381 do
6382 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6383 echo "$as_me:6383: checking for $ac_header" >&5
6384 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6385 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6386   echo $ECHO_N "(cached) $ECHO_C" >&6
6387 else
6388   cat >conftest.$ac_ext <<_ACEOF
6389 #line 6389 "configure"
6390 #include "confdefs.h"
6391 #include <$ac_header>
6392 _ACEOF
6393 if { (eval echo "$as_me:6393: \"$ac_cpp conftest.$ac_ext\"") >&5
6394   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6395   ac_status=$?
6396   egrep -v '^ *\+' conftest.er1 >conftest.err
6397   rm -f conftest.er1
6398   cat conftest.err >&5
6399   echo "$as_me:6399: \$? = $ac_status" >&5
6400   (exit $ac_status); } >/dev/null; then
6401   if test -s conftest.err; then
6402     ac_cpp_err=$ac_c_preproc_warn_flag
6403   else
6404     ac_cpp_err=
6405   fi
6406 else
6407   ac_cpp_err=yes
6408 fi
6409 if test -z "$ac_cpp_err"; then
6410   eval "$as_ac_Header=yes"
6411 else
6412   echo "$as_me: failed program was:" >&5
6413   cat conftest.$ac_ext >&5
6414   eval "$as_ac_Header=no"
6415 fi
6416 rm -f conftest.err conftest.$ac_ext
6417 fi
6418 echo "$as_me:6418: result: `eval echo '${'$as_ac_Header'}'`" >&5
6419 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6420 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6421   cat >>confdefs.h <<EOF
6422 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6423 EOF
6424
6425 fi
6426 done
6427
6428 cat >>confdefs.h <<\EOF
6429 #define NCURSES 1
6430 EOF
6431
6432 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6433
6434 cat >>confdefs.h <<EOF
6435 #define $cf_nculib_ROOT 1
6436 EOF
6437
6438 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6439
6440 else
6441
6442 cf_ncuhdr_root=ncurses
6443
6444 test -n "$cf_cv_curses_dir" && \
6445 test "$cf_cv_curses_dir" != "no" && { \
6446
6447 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6448   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6449   do
6450         while test $cf_add_incdir != /usr/include
6451         do
6452           if test -d $cf_add_incdir
6453           then
6454                 cf_have_incdir=no
6455                 if test -n "$CFLAGS$CPPFLAGS" ; then
6456                   # a loop is needed to ensure we can add subdirs of existing dirs
6457                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6458                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6459                           cf_have_incdir=yes; break
6460                         fi
6461                   done
6462                 fi
6463
6464                 if test "$cf_have_incdir" = no ; then
6465                   if test "$cf_add_incdir" = /usr/local/include ; then
6466                         if test "$GCC" = yes
6467                         then
6468                           cf_save_CPPFLAGS=$CPPFLAGS
6469                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6470                           cat >conftest.$ac_ext <<_ACEOF
6471 #line 6471 "configure"
6472 #include "confdefs.h"
6473 #include <stdio.h>
6474 int
6475 main ()
6476 {
6477 printf("Hello")
6478   ;
6479   return 0;
6480 }
6481 _ACEOF
6482 rm -f conftest.$ac_objext
6483 if { (eval echo "$as_me:6483: \"$ac_compile\"") >&5
6484   (eval $ac_compile) 2>&5
6485   ac_status=$?
6486   echo "$as_me:6486: \$? = $ac_status" >&5
6487   (exit $ac_status); } &&
6488          { ac_try='test -s conftest.$ac_objext'
6489   { (eval echo "$as_me:6489: \"$ac_try\"") >&5
6490   (eval $ac_try) 2>&5
6491   ac_status=$?
6492   echo "$as_me:6492: \$? = $ac_status" >&5
6493   (exit $ac_status); }; }; then
6494   :
6495 else
6496   echo "$as_me: failed program was:" >&5
6497 cat conftest.$ac_ext >&5
6498 cf_have_incdir=yes
6499 fi
6500 rm -f conftest.$ac_objext conftest.$ac_ext
6501                           CPPFLAGS=$cf_save_CPPFLAGS
6502                         fi
6503                   fi
6504                 fi
6505
6506                 if test "$cf_have_incdir" = no ; then
6507                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6508
6509 echo "${as_me:-configure}:6509: testing adding $cf_add_incdir to include-path ..." 1>&5
6510
6511                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6512
6513                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6514                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6515                   cf_add_incdir="$cf_top_incdir"
6516                 else
6517                   break
6518                 fi
6519           fi
6520         done
6521   done
6522 fi
6523
6524 }
6525
6526 echo "$as_me:6526: checking for $cf_ncuhdr_root header in include-path" >&5
6527 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6528 if test "${cf_cv_ncurses_h+set}" = set; then
6529   echo $ECHO_N "(cached) $ECHO_C" >&6
6530 else
6531
6532         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6533         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6534         for cf_header in $cf_header_list
6535         do
6536
6537         cat >conftest.$ac_ext <<_ACEOF
6538 #line 6538 "configure"
6539 #include "confdefs.h"
6540
6541 #include <$cf_header>
6542 int
6543 main ()
6544 {
6545
6546 #ifdef NCURSES_VERSION
6547
6548 printf("%s\n", NCURSES_VERSION);
6549 #else
6550 #ifdef __NCURSES_H
6551 printf("old\n");
6552 #else
6553         make an error
6554 #endif
6555 #endif
6556
6557   ;
6558   return 0;
6559 }
6560 _ACEOF
6561 rm -f conftest.$ac_objext
6562 if { (eval echo "$as_me:6562: \"$ac_compile\"") >&5
6563   (eval $ac_compile) 2>&5
6564   ac_status=$?
6565   echo "$as_me:6565: \$? = $ac_status" >&5
6566   (exit $ac_status); } &&
6567          { ac_try='test -s conftest.$ac_objext'
6568   { (eval echo "$as_me:6568: \"$ac_try\"") >&5
6569   (eval $ac_try) 2>&5
6570   ac_status=$?
6571   echo "$as_me:6571: \$? = $ac_status" >&5
6572   (exit $ac_status); }; }; then
6573   cf_cv_ncurses_h=$cf_header
6574
6575 else
6576   echo "$as_me: failed program was:" >&5
6577 cat conftest.$ac_ext >&5
6578 cf_cv_ncurses_h=no
6579 fi
6580 rm -f conftest.$ac_objext conftest.$ac_ext
6581
6582                 test "$cf_cv_ncurses_h" != no && break
6583         done
6584
6585 fi
6586 echo "$as_me:6586: result: $cf_cv_ncurses_h" >&5
6587 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6588
6589 if test "$cf_cv_ncurses_h" != no ; then
6590         cf_cv_ncurses_header=$cf_cv_ncurses_h
6591 else
6592
6593 echo "$as_me:6593: checking for $cf_ncuhdr_root include-path" >&5
6594 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6595 if test "${cf_cv_ncurses_h2+set}" = set; then
6596   echo $ECHO_N "(cached) $ECHO_C" >&6
6597 else
6598
6599         test -n "$verbose" && echo
6600
6601 cf_search=
6602
6603 # collect the current set of include-directories from compiler flags
6604 cf_header_path_list=""
6605 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6606         for cf_header_path in $CPPFLAGS $CFLAGS
6607         do
6608                 case $cf_header_path in #(vi
6609                 -I*)
6610                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6611
6612 test "$cf_header_path" != "NONE" && \
6613 test -d "$cf_header_path" && \
6614  {
6615         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6616         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6617         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6618         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6619         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6620         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"
6621 }
6622
6623                         cf_header_path_list="$cf_header_path_list $cf_search"
6624                         ;;
6625                 esac
6626         done
6627 fi
6628
6629 # add the variations for the package we are looking for
6630
6631 cf_search=
6632
6633 test "/usr" != "$prefix" && \
6634 test -d "/usr" && \
6635 (test $prefix = NONE || test "/usr" != "$prefix") && {
6636         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6637         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6638         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
6639         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
6640         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
6641         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6642 }
6643
6644 test "$prefix" != "NONE" && \
6645 test -d "$prefix" && \
6646  {
6647         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6648         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6649         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6650         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6651         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6652         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6653 }
6654
6655 test "/usr/local" != "$prefix" && \
6656 test -d "/usr/local" && \
6657 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6658         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
6659         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
6660         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
6661         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
6662         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
6663         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6664 }
6665
6666 test "/opt" != "$prefix" && \
6667 test -d "/opt" && \
6668 (test $prefix = NONE || test "/opt" != "$prefix") && {
6669         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
6670         test -d /opt/include &&          cf_search="$cf_search /opt/include"
6671         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
6672         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
6673         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
6674         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6675 }
6676
6677 test "$HOME" != "$prefix" && \
6678 test -d "$HOME" && \
6679 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6680         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
6681         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
6682         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
6683         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
6684         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
6685         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6686 }
6687
6688 test "$includedir" != NONE && \
6689 test "$includedir" != "/usr/include" && \
6690 test -d "$includedir" && {
6691         test -d $includedir &&    cf_search="$cf_search $includedir"
6692         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6693 }
6694
6695 test "$oldincludedir" != NONE && \
6696 test "$oldincludedir" != "/usr/include" && \
6697 test -d "$oldincludedir" && {
6698         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6699         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6700 }
6701
6702 cf_search="$cf_search $cf_header_path_list"
6703
6704         test -n "$verbose" && echo search path $cf_search
6705         cf_save2_CPPFLAGS="$CPPFLAGS"
6706         for cf_incdir in $cf_search
6707         do
6708
6709 if test -n "$cf_incdir" ; then
6710   for cf_add_incdir in $cf_incdir
6711   do
6712         while test $cf_add_incdir != /usr/include
6713         do
6714           if test -d $cf_add_incdir
6715           then
6716                 cf_have_incdir=no
6717                 if test -n "$CFLAGS$CPPFLAGS" ; then
6718                   # a loop is needed to ensure we can add subdirs of existing dirs
6719                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6720                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6721                           cf_have_incdir=yes; break
6722                         fi
6723                   done
6724                 fi
6725
6726                 if test "$cf_have_incdir" = no ; then
6727                   if test "$cf_add_incdir" = /usr/local/include ; then
6728                         if test "$GCC" = yes
6729                         then
6730                           cf_save_CPPFLAGS=$CPPFLAGS
6731                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6732                           cat >conftest.$ac_ext <<_ACEOF
6733 #line 6733 "configure"
6734 #include "confdefs.h"
6735 #include <stdio.h>
6736 int
6737 main ()
6738 {
6739 printf("Hello")
6740   ;
6741   return 0;
6742 }
6743 _ACEOF
6744 rm -f conftest.$ac_objext
6745 if { (eval echo "$as_me:6745: \"$ac_compile\"") >&5
6746   (eval $ac_compile) 2>&5
6747   ac_status=$?
6748   echo "$as_me:6748: \$? = $ac_status" >&5
6749   (exit $ac_status); } &&
6750          { ac_try='test -s conftest.$ac_objext'
6751   { (eval echo "$as_me:6751: \"$ac_try\"") >&5
6752   (eval $ac_try) 2>&5
6753   ac_status=$?
6754   echo "$as_me:6754: \$? = $ac_status" >&5
6755   (exit $ac_status); }; }; then
6756   :
6757 else
6758   echo "$as_me: failed program was:" >&5
6759 cat conftest.$ac_ext >&5
6760 cf_have_incdir=yes
6761 fi
6762 rm -f conftest.$ac_objext conftest.$ac_ext
6763                           CPPFLAGS=$cf_save_CPPFLAGS
6764                         fi
6765                   fi
6766                 fi
6767
6768                 if test "$cf_have_incdir" = no ; then
6769                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6770
6771 echo "${as_me:-configure}:6771: testing adding $cf_add_incdir to include-path ..." 1>&5
6772
6773                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6774
6775                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6776                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6777                   cf_add_incdir="$cf_top_incdir"
6778                 else
6779                   break
6780                 fi
6781           fi
6782         done
6783   done
6784 fi
6785
6786                 for cf_header in \
6787                         ncurses.h \
6788                         curses.h
6789                 do
6790
6791         cat >conftest.$ac_ext <<_ACEOF
6792 #line 6792 "configure"
6793 #include "confdefs.h"
6794
6795 #include <$cf_header>
6796 int
6797 main ()
6798 {
6799
6800 #ifdef NCURSES_VERSION
6801
6802 printf("%s\n", NCURSES_VERSION);
6803 #else
6804 #ifdef __NCURSES_H
6805 printf("old\n");
6806 #else
6807         make an error
6808 #endif
6809 #endif
6810
6811   ;
6812   return 0;
6813 }
6814 _ACEOF
6815 rm -f conftest.$ac_objext
6816 if { (eval echo "$as_me:6816: \"$ac_compile\"") >&5
6817   (eval $ac_compile) 2>&5
6818   ac_status=$?
6819   echo "$as_me:6819: \$? = $ac_status" >&5
6820   (exit $ac_status); } &&
6821          { ac_try='test -s conftest.$ac_objext'
6822   { (eval echo "$as_me:6822: \"$ac_try\"") >&5
6823   (eval $ac_try) 2>&5
6824   ac_status=$?
6825   echo "$as_me:6825: \$? = $ac_status" >&5
6826   (exit $ac_status); }; }; then
6827   cf_cv_ncurses_h2=$cf_header
6828
6829 else
6830   echo "$as_me: failed program was:" >&5
6831 cat conftest.$ac_ext >&5
6832 cf_cv_ncurses_h2=no
6833 fi
6834 rm -f conftest.$ac_objext conftest.$ac_ext
6835
6836                         if test "$cf_cv_ncurses_h2" != no ; then
6837                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6838                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6839                                 break
6840                         fi
6841                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6842                 done
6843                 CPPFLAGS="$cf_save2_CPPFLAGS"
6844                 test "$cf_cv_ncurses_h2" != no && break
6845         done
6846         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6846: error: not found" >&5
6847 echo "$as_me: error: not found" >&2;}
6848    { (exit 1); exit 1; }; }
6849
6850 fi
6851 echo "$as_me:6851: result: $cf_cv_ncurses_h2" >&5
6852 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6853
6854         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6855         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6856         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6857                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6858         fi
6859
6860 if test -n "$cf_1st_incdir" ; then
6861   for cf_add_incdir in $cf_1st_incdir
6862   do
6863         while test $cf_add_incdir != /usr/include
6864         do
6865           if test -d $cf_add_incdir
6866           then
6867                 cf_have_incdir=no
6868                 if test -n "$CFLAGS$CPPFLAGS" ; then
6869                   # a loop is needed to ensure we can add subdirs of existing dirs
6870                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6871                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6872                           cf_have_incdir=yes; break
6873                         fi
6874                   done
6875                 fi
6876
6877                 if test "$cf_have_incdir" = no ; then
6878                   if test "$cf_add_incdir" = /usr/local/include ; then
6879                         if test "$GCC" = yes
6880                         then
6881                           cf_save_CPPFLAGS=$CPPFLAGS
6882                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6883                           cat >conftest.$ac_ext <<_ACEOF
6884 #line 6884 "configure"
6885 #include "confdefs.h"
6886 #include <stdio.h>
6887 int
6888 main ()
6889 {
6890 printf("Hello")
6891   ;
6892   return 0;
6893 }
6894 _ACEOF
6895 rm -f conftest.$ac_objext
6896 if { (eval echo "$as_me:6896: \"$ac_compile\"") >&5
6897   (eval $ac_compile) 2>&5
6898   ac_status=$?
6899   echo "$as_me:6899: \$? = $ac_status" >&5
6900   (exit $ac_status); } &&
6901          { ac_try='test -s conftest.$ac_objext'
6902   { (eval echo "$as_me:6902: \"$ac_try\"") >&5
6903   (eval $ac_try) 2>&5
6904   ac_status=$?
6905   echo "$as_me:6905: \$? = $ac_status" >&5
6906   (exit $ac_status); }; }; then
6907   :
6908 else
6909   echo "$as_me: failed program was:" >&5
6910 cat conftest.$ac_ext >&5
6911 cf_have_incdir=yes
6912 fi
6913 rm -f conftest.$ac_objext conftest.$ac_ext
6914                           CPPFLAGS=$cf_save_CPPFLAGS
6915                         fi
6916                   fi
6917                 fi
6918
6919                 if test "$cf_have_incdir" = no ; then
6920                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6921
6922 echo "${as_me:-configure}:6922: testing adding $cf_add_incdir to include-path ..." 1>&5
6923
6924                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6925
6926                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6927                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6928                   cf_add_incdir="$cf_top_incdir"
6929                 else
6930                   break
6931                 fi
6932           fi
6933         done
6934   done
6935 fi
6936
6937 fi
6938
6939 # Set definitions to allow ifdef'ing for ncurses.h
6940
6941 case $cf_cv_ncurses_header in # (vi
6942 *ncurses.h)
6943         cat >>confdefs.h <<\EOF
6944 #define HAVE_NCURSES_H 1
6945 EOF
6946
6947         ;;
6948 esac
6949
6950 case $cf_cv_ncurses_header in # (vi
6951 ncurses/curses.h|ncurses/ncurses.h)
6952         cat >>confdefs.h <<\EOF
6953 #define HAVE_NCURSES_NCURSES_H 1
6954 EOF
6955
6956         ;;
6957 ncursesw/curses.h|ncursesw/ncurses.h)
6958         cat >>confdefs.h <<\EOF
6959 #define HAVE_NCURSESW_NCURSES_H 1
6960 EOF
6961
6962         ;;
6963 esac
6964
6965 echo "$as_me:6965: checking for terminfo header" >&5
6966 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6967 if test "${cf_cv_term_header+set}" = set; then
6968   echo $ECHO_N "(cached) $ECHO_C" >&6
6969 else
6970
6971 case ${cf_cv_ncurses_header} in #(vi
6972 */ncurses.h|*/ncursesw.h) #(vi
6973         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6974         ;;
6975 *)
6976         cf_term_header=term.h
6977         ;;
6978 esac
6979
6980 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6981 do
6982 cat >conftest.$ac_ext <<_ACEOF
6983 #line 6983 "configure"
6984 #include "confdefs.h"
6985 #include <stdio.h>
6986 #include <${cf_cv_ncurses_header:-curses.h}>
6987 #include <$cf_test>
6988
6989 int
6990 main ()
6991 {
6992 int x = auto_left_margin
6993   ;
6994   return 0;
6995 }
6996 _ACEOF
6997 rm -f conftest.$ac_objext
6998 if { (eval echo "$as_me:6998: \"$ac_compile\"") >&5
6999   (eval $ac_compile) 2>&5
7000   ac_status=$?
7001   echo "$as_me:7001: \$? = $ac_status" >&5
7002   (exit $ac_status); } &&
7003          { ac_try='test -s conftest.$ac_objext'
7004   { (eval echo "$as_me:7004: \"$ac_try\"") >&5
7005   (eval $ac_try) 2>&5
7006   ac_status=$?
7007   echo "$as_me:7007: \$? = $ac_status" >&5
7008   (exit $ac_status); }; }; then
7009
7010         cf_cv_term_header="$cf_test"
7011 else
7012   echo "$as_me: failed program was:" >&5
7013 cat conftest.$ac_ext >&5
7014
7015         cf_cv_term_header=unknown
7016
7017 fi
7018 rm -f conftest.$ac_objext conftest.$ac_ext
7019         test "$cf_cv_term_header" != unknown && break
7020 done
7021
7022 fi
7023 echo "$as_me:7023: result: $cf_cv_term_header" >&5
7024 echo "${ECHO_T}$cf_cv_term_header" >&6
7025
7026 # Set definitions to allow ifdef'ing to accommodate subdirectories
7027
7028 case $cf_cv_term_header in # (vi
7029 *term.h)
7030         cat >>confdefs.h <<\EOF
7031 #define HAVE_TERM_H 1
7032 EOF
7033
7034         ;;
7035 esac
7036
7037 case $cf_cv_term_header in # (vi
7038 ncurses/term.h) #(vi
7039         cat >>confdefs.h <<\EOF
7040 #define HAVE_NCURSES_TERM_H 1
7041 EOF
7042
7043         ;;
7044 ncursesw/term.h)
7045         cat >>confdefs.h <<\EOF
7046 #define HAVE_NCURSESW_TERM_H 1
7047 EOF
7048
7049         ;;
7050 esac
7051
7052 # some applications need this, but should check for NCURSES_VERSION
7053 cat >>confdefs.h <<\EOF
7054 #define NCURSES 1
7055 EOF
7056
7057 echo "$as_me:7057: checking for ncurses version" >&5
7058 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7059 if test "${cf_cv_ncurses_version+set}" = set; then
7060   echo $ECHO_N "(cached) $ECHO_C" >&6
7061 else
7062
7063         cf_cv_ncurses_version=no
7064         cf_tempfile=out$$
7065         rm -f $cf_tempfile
7066         if test "$cross_compiling" = yes; then
7067
7068         # This will not work if the preprocessor splits the line after the
7069         # Autoconf token.  The 'unproto' program does that.
7070         cat > conftest.$ac_ext <<EOF
7071 #include <${cf_cv_ncurses_header:-curses.h}>
7072 #undef Autoconf
7073 #ifdef NCURSES_VERSION
7074 Autoconf NCURSES_VERSION
7075 #else
7076 #ifdef __NCURSES_H
7077 Autoconf "old"
7078 #endif
7079 ;
7080 #endif
7081 EOF
7082         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7083         { (eval echo "$as_me:7083: \"$cf_try\"") >&5
7084   (eval $cf_try) 2>&5
7085   ac_status=$?
7086   echo "$as_me:7086: \$? = $ac_status" >&5
7087   (exit $ac_status); }
7088         if test -f conftest.out ; then
7089                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7090                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7091                 rm -f conftest.out
7092         fi
7093
7094 else
7095   cat >conftest.$ac_ext <<_ACEOF
7096 #line 7096 "configure"
7097 #include "confdefs.h"
7098
7099 #include <${cf_cv_ncurses_header:-curses.h}>
7100 #include <stdio.h>
7101 int main()
7102 {
7103         FILE *fp = fopen("$cf_tempfile", "w");
7104 #ifdef NCURSES_VERSION
7105 # ifdef NCURSES_VERSION_PATCH
7106         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7107 # else
7108         fprintf(fp, "%s\n", NCURSES_VERSION);
7109 # endif
7110 #else
7111 # ifdef __NCURSES_H
7112         fprintf(fp, "old\n");
7113 # else
7114         make an error
7115 # endif
7116 #endif
7117         ${cf_cv_main_return:-return}(0);
7118 }
7119 _ACEOF
7120 rm -f conftest$ac_exeext
7121 if { (eval echo "$as_me:7121: \"$ac_link\"") >&5
7122   (eval $ac_link) 2>&5
7123   ac_status=$?
7124   echo "$as_me:7124: \$? = $ac_status" >&5
7125   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7126   { (eval echo "$as_me:7126: \"$ac_try\"") >&5
7127   (eval $ac_try) 2>&5
7128   ac_status=$?
7129   echo "$as_me:7129: \$? = $ac_status" >&5
7130   (exit $ac_status); }; }; then
7131
7132         cf_cv_ncurses_version=`cat $cf_tempfile`
7133 else
7134   echo "$as_me: program exited with status $ac_status" >&5
7135 echo "$as_me: failed program was:" >&5
7136 cat conftest.$ac_ext >&5
7137 fi
7138 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7139 fi
7140         rm -f $cf_tempfile
7141
7142 fi
7143 echo "$as_me:7143: result: $cf_cv_ncurses_version" >&5
7144 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7145 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
7146 #define NCURSES 1
7147 EOF
7148
7149 cf_nculib_root=ncurses
7150         # This works, except for the special case where we find gpm, but
7151         # ncurses is in a nonstandard location via $LIBS, and we really want
7152         # to link gpm.
7153 cf_ncurses_LIBS=""
7154 cf_ncurses_SAVE="$LIBS"
7155 echo "$as_me:7155: checking for Gpm_Open in -lgpm" >&5
7156 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7157 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7158   echo $ECHO_N "(cached) $ECHO_C" >&6
7159 else
7160   ac_check_lib_save_LIBS=$LIBS
7161 LIBS="-lgpm  $LIBS"
7162 cat >conftest.$ac_ext <<_ACEOF
7163 #line 7163 "configure"
7164 #include "confdefs.h"
7165
7166 /* Override any gcc2 internal prototype to avoid an error.  */
7167 #ifdef __cplusplus
7168 extern "C"
7169 #endif
7170 /* We use char because int might match the return type of a gcc2
7171    builtin and then its argument prototype would still apply.  */
7172 char Gpm_Open ();
7173 int
7174 main ()
7175 {
7176 Gpm_Open ();
7177   ;
7178   return 0;
7179 }
7180 _ACEOF
7181 rm -f conftest.$ac_objext conftest$ac_exeext
7182 if { (eval echo "$as_me:7182: \"$ac_link\"") >&5
7183   (eval $ac_link) 2>&5
7184   ac_status=$?
7185   echo "$as_me:7185: \$? = $ac_status" >&5
7186   (exit $ac_status); } &&
7187          { ac_try='test -s conftest$ac_exeext'
7188   { (eval echo "$as_me:7188: \"$ac_try\"") >&5
7189   (eval $ac_try) 2>&5
7190   ac_status=$?
7191   echo "$as_me:7191: \$? = $ac_status" >&5
7192   (exit $ac_status); }; }; then
7193   ac_cv_lib_gpm_Gpm_Open=yes
7194 else
7195   echo "$as_me: failed program was:" >&5
7196 cat conftest.$ac_ext >&5
7197 ac_cv_lib_gpm_Gpm_Open=no
7198 fi
7199 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7200 LIBS=$ac_check_lib_save_LIBS
7201 fi
7202 echo "$as_me:7202: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7203 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7204 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7205   echo "$as_me:7205: checking for initscr in -lgpm" >&5
7206 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7207 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7208   echo $ECHO_N "(cached) $ECHO_C" >&6
7209 else
7210   ac_check_lib_save_LIBS=$LIBS
7211 LIBS="-lgpm  $LIBS"
7212 cat >conftest.$ac_ext <<_ACEOF
7213 #line 7213 "configure"
7214 #include "confdefs.h"
7215
7216 /* Override any gcc2 internal prototype to avoid an error.  */
7217 #ifdef __cplusplus
7218 extern "C"
7219 #endif
7220 /* We use char because int might match the return type of a gcc2
7221    builtin and then its argument prototype would still apply.  */
7222 char initscr ();
7223 int
7224 main ()
7225 {
7226 initscr ();
7227   ;
7228   return 0;
7229 }
7230 _ACEOF
7231 rm -f conftest.$ac_objext conftest$ac_exeext
7232 if { (eval echo "$as_me:7232: \"$ac_link\"") >&5
7233   (eval $ac_link) 2>&5
7234   ac_status=$?
7235   echo "$as_me:7235: \$? = $ac_status" >&5
7236   (exit $ac_status); } &&
7237          { ac_try='test -s conftest$ac_exeext'
7238   { (eval echo "$as_me:7238: \"$ac_try\"") >&5
7239   (eval $ac_try) 2>&5
7240   ac_status=$?
7241   echo "$as_me:7241: \$? = $ac_status" >&5
7242   (exit $ac_status); }; }; then
7243   ac_cv_lib_gpm_initscr=yes
7244 else
7245   echo "$as_me: failed program was:" >&5
7246 cat conftest.$ac_ext >&5
7247 ac_cv_lib_gpm_initscr=no
7248 fi
7249 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7250 LIBS=$ac_check_lib_save_LIBS
7251 fi
7252 echo "$as_me:7252: result: $ac_cv_lib_gpm_initscr" >&5
7253 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7254 if test $ac_cv_lib_gpm_initscr = yes; then
7255   LIBS="$cf_ncurses_SAVE"
7256 else
7257   cf_ncurses_LIBS="-lgpm"
7258 fi
7259
7260 fi
7261
7262 case $host_os in #(vi
7263 freebsd*)
7264         # This is only necessary if you are linking against an obsolete
7265         # version of ncurses (but it should do no harm, since it's static).
7266         if test "$cf_nculib_root" = ncurses ; then
7267                 echo "$as_me:7267: checking for tgoto in -lmytinfo" >&5
7268 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7269 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7270   echo $ECHO_N "(cached) $ECHO_C" >&6
7271 else
7272   ac_check_lib_save_LIBS=$LIBS
7273 LIBS="-lmytinfo  $LIBS"
7274 cat >conftest.$ac_ext <<_ACEOF
7275 #line 7275 "configure"
7276 #include "confdefs.h"
7277
7278 /* Override any gcc2 internal prototype to avoid an error.  */
7279 #ifdef __cplusplus
7280 extern "C"
7281 #endif
7282 /* We use char because int might match the return type of a gcc2
7283    builtin and then its argument prototype would still apply.  */
7284 char tgoto ();
7285 int
7286 main ()
7287 {
7288 tgoto ();
7289   ;
7290   return 0;
7291 }
7292 _ACEOF
7293 rm -f conftest.$ac_objext conftest$ac_exeext
7294 if { (eval echo "$as_me:7294: \"$ac_link\"") >&5
7295   (eval $ac_link) 2>&5
7296   ac_status=$?
7297   echo "$as_me:7297: \$? = $ac_status" >&5
7298   (exit $ac_status); } &&
7299          { ac_try='test -s conftest$ac_exeext'
7300   { (eval echo "$as_me:7300: \"$ac_try\"") >&5
7301   (eval $ac_try) 2>&5
7302   ac_status=$?
7303   echo "$as_me:7303: \$? = $ac_status" >&5
7304   (exit $ac_status); }; }; then
7305   ac_cv_lib_mytinfo_tgoto=yes
7306 else
7307   echo "$as_me: failed program was:" >&5
7308 cat conftest.$ac_ext >&5
7309 ac_cv_lib_mytinfo_tgoto=no
7310 fi
7311 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7312 LIBS=$ac_check_lib_save_LIBS
7313 fi
7314 echo "$as_me:7314: result: $ac_cv_lib_mytinfo_tgoto" >&5
7315 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7316 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7317   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7318 fi
7319
7320         fi
7321         ;;
7322 esac
7323
7324 LIBS="$cf_ncurses_LIBS $LIBS"
7325
7326 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7327 then
7328         LIBS="-l$cf_nculib_root $LIBS"
7329 else
7330
7331         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7332         cf_libdir=""
7333         echo "$as_me:7333: checking for initscr" >&5
7334 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7335 if test "${ac_cv_func_initscr+set}" = set; then
7336   echo $ECHO_N "(cached) $ECHO_C" >&6
7337 else
7338   cat >conftest.$ac_ext <<_ACEOF
7339 #line 7339 "configure"
7340 #include "confdefs.h"
7341 /* System header to define __stub macros and hopefully few prototypes,
7342     which can conflict with char initscr (); below.  */
7343 #include <assert.h>
7344 /* Override any gcc2 internal prototype to avoid an error.  */
7345 #ifdef __cplusplus
7346 extern "C"
7347 #endif
7348 /* We use char because int might match the return type of a gcc2
7349    builtin and then its argument prototype would still apply.  */
7350 char initscr ();
7351 char (*f) ();
7352
7353 int
7354 main ()
7355 {
7356 /* The GNU C library defines this for functions which it implements
7357     to always fail with ENOSYS.  Some functions are actually named
7358     something starting with __ and the normal name is an alias.  */
7359 #if defined (__stub_initscr) || defined (__stub___initscr)
7360 choke me
7361 #else
7362 f = initscr;
7363 #endif
7364
7365   ;
7366   return 0;
7367 }
7368 _ACEOF
7369 rm -f conftest.$ac_objext conftest$ac_exeext
7370 if { (eval echo "$as_me:7370: \"$ac_link\"") >&5
7371   (eval $ac_link) 2>&5
7372   ac_status=$?
7373   echo "$as_me:7373: \$? = $ac_status" >&5
7374   (exit $ac_status); } &&
7375          { ac_try='test -s conftest$ac_exeext'
7376   { (eval echo "$as_me:7376: \"$ac_try\"") >&5
7377   (eval $ac_try) 2>&5
7378   ac_status=$?
7379   echo "$as_me:7379: \$? = $ac_status" >&5
7380   (exit $ac_status); }; }; then
7381   ac_cv_func_initscr=yes
7382 else
7383   echo "$as_me: failed program was:" >&5
7384 cat conftest.$ac_ext >&5
7385 ac_cv_func_initscr=no
7386 fi
7387 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7388 fi
7389 echo "$as_me:7389: result: $ac_cv_func_initscr" >&5
7390 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7391 if test $ac_cv_func_initscr = yes; then
7392   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7393 else
7394
7395                 cf_save_LIBS="$LIBS"
7396                 echo "$as_me:7396: checking for initscr in -l$cf_nculib_root" >&5
7397 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7398                 LIBS="-l$cf_nculib_root $LIBS"
7399                 cat >conftest.$ac_ext <<_ACEOF
7400 #line 7400 "configure"
7401 #include "confdefs.h"
7402 #include <${cf_cv_ncurses_header:-curses.h}>
7403 int
7404 main ()
7405 {
7406 initscr()
7407   ;
7408   return 0;
7409 }
7410 _ACEOF
7411 rm -f conftest.$ac_objext conftest$ac_exeext
7412 if { (eval echo "$as_me:7412: \"$ac_link\"") >&5
7413   (eval $ac_link) 2>&5
7414   ac_status=$?
7415   echo "$as_me:7415: \$? = $ac_status" >&5
7416   (exit $ac_status); } &&
7417          { ac_try='test -s conftest$ac_exeext'
7418   { (eval echo "$as_me:7418: \"$ac_try\"") >&5
7419   (eval $ac_try) 2>&5
7420   ac_status=$?
7421   echo "$as_me:7421: \$? = $ac_status" >&5
7422   (exit $ac_status); }; }; then
7423   echo "$as_me:7423: result: yes" >&5
7424 echo "${ECHO_T}yes" >&6
7425                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7426
7427 else
7428   echo "$as_me: failed program was:" >&5
7429 cat conftest.$ac_ext >&5
7430 echo "$as_me:7430: result: no" >&5
7431 echo "${ECHO_T}no" >&6
7432
7433 cf_search=
7434 cf_library_path_list=""
7435 if test -n "${LDFLAGS}${LIBS}" ; then
7436         for cf_library_path in $LDFLAGS $LIBS
7437         do
7438                 case $cf_library_path in #(vi
7439                 -L*)
7440                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7441
7442 test "$cf_library_path" != "NONE" && \
7443 test -d "$cf_library_path" && \
7444  {
7445         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7446         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7447         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7448         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7449         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7450         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"
7451 }
7452
7453                         cf_library_path_list="$cf_library_path_list $cf_search"
7454                         ;;
7455                 esac
7456         done
7457 fi
7458
7459 cf_search=
7460
7461 test "/usr" != "$prefix" && \
7462 test -d "/usr" && \
7463 (test $prefix = NONE || test "/usr" != "$prefix") && {
7464         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7465         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7466         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
7467         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
7468         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
7469         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
7470 }
7471
7472 test "$prefix" != "NONE" && \
7473 test -d "$prefix" && \
7474  {
7475         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7476         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7477         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7478         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7479         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7480         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7481 }
7482
7483 test "/usr/local" != "$prefix" && \
7484 test -d "/usr/local" && \
7485 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7486         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7487         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7488         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
7489         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
7490         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
7491         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
7492 }
7493
7494 test "/opt" != "$prefix" && \
7495 test -d "/opt" && \
7496 (test $prefix = NONE || test "/opt" != "$prefix") && {
7497         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7498         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7499         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
7500         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
7501         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
7502         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
7503 }
7504
7505 test "$HOME" != "$prefix" && \
7506 test -d "$HOME" && \
7507 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7508         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7509         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7510         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
7511         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
7512         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
7513         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
7514 }
7515
7516 cf_search="$cf_library_path_list $cf_search"
7517
7518                         for cf_libdir in $cf_search
7519                         do
7520                                 echo "$as_me:7520: checking for -l$cf_nculib_root in $cf_libdir" >&5
7521 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7522                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7523                                 cat >conftest.$ac_ext <<_ACEOF
7524 #line 7524 "configure"
7525 #include "confdefs.h"
7526 #include <${cf_cv_ncurses_header:-curses.h}>
7527 int
7528 main ()
7529 {
7530 initscr()
7531   ;
7532   return 0;
7533 }
7534 _ACEOF
7535 rm -f conftest.$ac_objext conftest$ac_exeext
7536 if { (eval echo "$as_me:7536: \"$ac_link\"") >&5
7537   (eval $ac_link) 2>&5
7538   ac_status=$?
7539   echo "$as_me:7539: \$? = $ac_status" >&5
7540   (exit $ac_status); } &&
7541          { ac_try='test -s conftest$ac_exeext'
7542   { (eval echo "$as_me:7542: \"$ac_try\"") >&5
7543   (eval $ac_try) 2>&5
7544   ac_status=$?
7545   echo "$as_me:7545: \$? = $ac_status" >&5
7546   (exit $ac_status); }; }; then
7547   echo "$as_me:7547: result: yes" >&5
7548 echo "${ECHO_T}yes" >&6
7549                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7550                                          break
7551 else
7552   echo "$as_me: failed program was:" >&5
7553 cat conftest.$ac_ext >&5
7554 echo "$as_me:7554: result: no" >&5
7555 echo "${ECHO_T}no" >&6
7556                                          LIBS="$cf_save_LIBS"
7557 fi
7558 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7559                         done
7560
7561 fi
7562 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7563
7564 fi
7565
7566 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7567
7568 if test $cf_found_library = no ; then
7569         { { echo "$as_me:7569: error: Cannot link $cf_nculib_root library" >&5
7570 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7571    { (exit 1); exit 1; }; }
7572 fi
7573
7574 fi
7575
7576 if test -n "$cf_ncurses_LIBS" ; then
7577         echo "$as_me:7577: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7578 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7579         cf_ncurses_SAVE="$LIBS"
7580         for p in $cf_ncurses_LIBS ; do
7581                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7582                 if test "$q" != "$LIBS" ; then
7583                         LIBS="$q"
7584                 fi
7585         done
7586         cat >conftest.$ac_ext <<_ACEOF
7587 #line 7587 "configure"
7588 #include "confdefs.h"
7589 #include <${cf_cv_ncurses_header:-curses.h}>
7590 int
7591 main ()
7592 {
7593 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7594   ;
7595   return 0;
7596 }
7597 _ACEOF
7598 rm -f conftest.$ac_objext conftest$ac_exeext
7599 if { (eval echo "$as_me:7599: \"$ac_link\"") >&5
7600   (eval $ac_link) 2>&5
7601   ac_status=$?
7602   echo "$as_me:7602: \$? = $ac_status" >&5
7603   (exit $ac_status); } &&
7604          { ac_try='test -s conftest$ac_exeext'
7605   { (eval echo "$as_me:7605: \"$ac_try\"") >&5
7606   (eval $ac_try) 2>&5
7607   ac_status=$?
7608   echo "$as_me:7608: \$? = $ac_status" >&5
7609   (exit $ac_status); }; }; then
7610   echo "$as_me:7610: result: yes" >&5
7611 echo "${ECHO_T}yes" >&6
7612 else
7613   echo "$as_me: failed program was:" >&5
7614 cat conftest.$ac_ext >&5
7615 echo "$as_me:7615: result: no" >&5
7616 echo "${ECHO_T}no" >&6
7617                  LIBS="$cf_ncurses_SAVE"
7618 fi
7619 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7620 fi
7621
7622 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7623
7624 cat >>confdefs.h <<EOF
7625 #define $cf_nculib_ROOT 1
7626 EOF
7627
7628 fi
7629
7630         ;;
7631 ncursesw)
7632         cf_cv_libtype=w
7633
7634 echo "$as_me:7634: checking for multibyte character support" >&5
7635 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7636 if test "${cf_cv_utf8_lib+set}" = set; then
7637   echo $ECHO_N "(cached) $ECHO_C" >&6
7638 else
7639
7640         cf_save_LIBS="$LIBS"
7641         cat >conftest.$ac_ext <<_ACEOF
7642 #line 7642 "configure"
7643 #include "confdefs.h"
7644
7645 #include <stdlib.h>
7646 int
7647 main ()
7648 {
7649 putwc(0,0);
7650   ;
7651   return 0;
7652 }
7653 _ACEOF
7654 rm -f conftest.$ac_objext conftest$ac_exeext
7655 if { (eval echo "$as_me:7655: \"$ac_link\"") >&5
7656   (eval $ac_link) 2>&5
7657   ac_status=$?
7658   echo "$as_me:7658: \$? = $ac_status" >&5
7659   (exit $ac_status); } &&
7660          { ac_try='test -s conftest$ac_exeext'
7661   { (eval echo "$as_me:7661: \"$ac_try\"") >&5
7662   (eval $ac_try) 2>&5
7663   ac_status=$?
7664   echo "$as_me:7664: \$? = $ac_status" >&5
7665   (exit $ac_status); }; }; then
7666   cf_cv_utf8_lib=yes
7667 else
7668   echo "$as_me: failed program was:" >&5
7669 cat conftest.$ac_ext >&5
7670
7671 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7672 # will be set on completion of the AC_TRY_LINK below.
7673 cf_cv_header_path_utf8=
7674 cf_cv_library_path_utf8=
7675
7676 echo "${as_me:-configure}:7676: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7677
7678 cf_save_LIBS="$LIBS"
7679
7680 cat >conftest.$ac_ext <<_ACEOF
7681 #line 7681 "configure"
7682 #include "confdefs.h"
7683
7684 #include <libutf8.h>
7685 int
7686 main ()
7687 {
7688 putwc(0,0);
7689   ;
7690   return 0;
7691 }
7692 _ACEOF
7693 rm -f conftest.$ac_objext conftest$ac_exeext
7694 if { (eval echo "$as_me:7694: \"$ac_link\"") >&5
7695   (eval $ac_link) 2>&5
7696   ac_status=$?
7697   echo "$as_me:7697: \$? = $ac_status" >&5
7698   (exit $ac_status); } &&
7699          { ac_try='test -s conftest$ac_exeext'
7700   { (eval echo "$as_me:7700: \"$ac_try\"") >&5
7701   (eval $ac_try) 2>&5
7702   ac_status=$?
7703   echo "$as_me:7703: \$? = $ac_status" >&5
7704   (exit $ac_status); }; }; then
7705
7706         cf_cv_find_linkage_utf8=yes
7707         cf_cv_header_path_utf8=/usr/include
7708         cf_cv_library_path_utf8=/usr/lib
7709
7710 else
7711   echo "$as_me: failed program was:" >&5
7712 cat conftest.$ac_ext >&5
7713
7714 LIBS="-lutf8  $cf_save_LIBS"
7715
7716 cat >conftest.$ac_ext <<_ACEOF
7717 #line 7717 "configure"
7718 #include "confdefs.h"
7719
7720 #include <libutf8.h>
7721 int
7722 main ()
7723 {
7724 putwc(0,0);
7725   ;
7726   return 0;
7727 }
7728 _ACEOF
7729 rm -f conftest.$ac_objext conftest$ac_exeext
7730 if { (eval echo "$as_me:7730: \"$ac_link\"") >&5
7731   (eval $ac_link) 2>&5
7732   ac_status=$?
7733   echo "$as_me:7733: \$? = $ac_status" >&5
7734   (exit $ac_status); } &&
7735          { ac_try='test -s conftest$ac_exeext'
7736   { (eval echo "$as_me:7736: \"$ac_try\"") >&5
7737   (eval $ac_try) 2>&5
7738   ac_status=$?
7739   echo "$as_me:7739: \$? = $ac_status" >&5
7740   (exit $ac_status); }; }; then
7741
7742         cf_cv_find_linkage_utf8=yes
7743         cf_cv_header_path_utf8=/usr/include
7744         cf_cv_library_path_utf8=/usr/lib
7745         cf_cv_library_file_utf8="-lutf8"
7746
7747 else
7748   echo "$as_me: failed program was:" >&5
7749 cat conftest.$ac_ext >&5
7750
7751         cf_cv_find_linkage_utf8=no
7752         LIBS="$cf_save_LIBS"
7753
7754     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
7755
7756 echo "${as_me:-configure}:7756: testing find linkage for utf8 library ..." 1>&5
7757
7758 echo "${as_me:-configure}:7758: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7759
7760     cf_save_CPPFLAGS="$CPPFLAGS"
7761     cf_test_CPPFLAGS="$CPPFLAGS"
7762
7763 cf_search=
7764
7765 # collect the current set of include-directories from compiler flags
7766 cf_header_path_list=""
7767 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7768         for cf_header_path in $CPPFLAGS $CFLAGS
7769         do
7770                 case $cf_header_path in #(vi
7771                 -I*)
7772                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7773
7774 test "$cf_header_path" != "NONE" && \
7775 test -d "$cf_header_path" && \
7776  {
7777         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7778         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7779         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7780         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7781         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7782         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7783 }
7784
7785                         cf_header_path_list="$cf_header_path_list $cf_search"
7786                         ;;
7787                 esac
7788         done
7789 fi
7790
7791 # add the variations for the package we are looking for
7792
7793 cf_search=
7794
7795 test "/usr" != "$prefix" && \
7796 test -d "/usr" && \
7797 (test $prefix = NONE || test "/usr" != "$prefix") && {
7798         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7799         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7800         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
7801         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
7802         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
7803         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
7804 }
7805
7806 test "$prefix" != "NONE" && \
7807 test -d "$prefix" && \
7808  {
7809         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7810         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7811         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7812         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7813         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7814         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7815 }
7816
7817 test "/usr/local" != "$prefix" && \
7818 test -d "/usr/local" && \
7819 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7820         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
7821         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
7822         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
7823         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
7824         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
7825         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
7826 }
7827
7828 test "/opt" != "$prefix" && \
7829 test -d "/opt" && \
7830 (test $prefix = NONE || test "/opt" != "$prefix") && {
7831         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
7832         test -d /opt/include &&          cf_search="$cf_search /opt/include"
7833         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
7834         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
7835         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
7836         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
7837 }
7838
7839 test "$HOME" != "$prefix" && \
7840 test -d "$HOME" && \
7841 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7842         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
7843         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
7844         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
7845         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
7846         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
7847         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
7848 }
7849
7850 test "$includedir" != NONE && \
7851 test "$includedir" != "/usr/include" && \
7852 test -d "$includedir" && {
7853         test -d $includedir &&    cf_search="$cf_search $includedir"
7854         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7855 }
7856
7857 test "$oldincludedir" != NONE && \
7858 test "$oldincludedir" != "/usr/include" && \
7859 test -d "$oldincludedir" && {
7860         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7861         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7862 }
7863
7864 cf_search="$cf_search $cf_header_path_list"
7865
7866     for cf_cv_header_path_utf8 in $cf_search
7867     do
7868       if test -d $cf_cv_header_path_utf8 ; then
7869         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7870
7871 echo "${as_me:-configure}:7871: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7872
7873         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
7874         cat >conftest.$ac_ext <<_ACEOF
7875 #line 7875 "configure"
7876 #include "confdefs.h"
7877
7878 #include <libutf8.h>
7879 int
7880 main ()
7881 {
7882 putwc(0,0);
7883   ;
7884   return 0;
7885 }
7886 _ACEOF
7887 rm -f conftest.$ac_objext
7888 if { (eval echo "$as_me:7888: \"$ac_compile\"") >&5
7889   (eval $ac_compile) 2>&5
7890   ac_status=$?
7891   echo "$as_me:7891: \$? = $ac_status" >&5
7892   (exit $ac_status); } &&
7893          { ac_try='test -s conftest.$ac_objext'
7894   { (eval echo "$as_me:7894: \"$ac_try\"") >&5
7895   (eval $ac_try) 2>&5
7896   ac_status=$?
7897   echo "$as_me:7897: \$? = $ac_status" >&5
7898   (exit $ac_status); }; }; then
7899
7900             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7901
7902 echo "${as_me:-configure}:7902: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7903
7904             cf_cv_find_linkage_utf8=maybe
7905             cf_test_CPPFLAGS="$CPPFLAGS"
7906             break
7907 else
7908   echo "$as_me: failed program was:" >&5
7909 cat conftest.$ac_ext >&5
7910
7911             CPPFLAGS="$cf_save_CPPFLAGS"
7912
7913 fi
7914 rm -f conftest.$ac_objext conftest.$ac_ext
7915       fi
7916     done
7917
7918     if test "$cf_cv_find_linkage_utf8" = maybe ; then
7919
7920 echo "${as_me:-configure}:7920: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7921
7922       cf_save_LIBS="$LIBS"
7923       cf_save_LDFLAGS="$LDFLAGS"
7924
7925       if test "$cf_cv_find_linkage_utf8" != yes ; then
7926
7927 cf_search=
7928 cf_library_path_list=""
7929 if test -n "${LDFLAGS}${LIBS}" ; then
7930         for cf_library_path in $LDFLAGS $LIBS
7931         do
7932                 case $cf_library_path in #(vi
7933                 -L*)
7934                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7935
7936 test "$cf_library_path" != "NONE" && \
7937 test -d "$cf_library_path" && \
7938  {
7939         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7940         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7941         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7942         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7943         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7944         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7945 }
7946
7947                         cf_library_path_list="$cf_library_path_list $cf_search"
7948                         ;;
7949                 esac
7950         done
7951 fi
7952
7953 cf_search=
7954
7955 test "/usr" != "$prefix" && \
7956 test -d "/usr" && \
7957 (test $prefix = NONE || test "/usr" != "$prefix") && {
7958         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7959         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7960         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
7961         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
7962         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
7963         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
7964 }
7965
7966 test "$prefix" != "NONE" && \
7967 test -d "$prefix" && \
7968  {
7969         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7970         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7971         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7972         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7973         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7974         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7975 }
7976
7977 test "/usr/local" != "$prefix" && \
7978 test -d "/usr/local" && \
7979 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7980         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7981         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7982         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
7983         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
7984         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
7985         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
7986 }
7987
7988 test "/opt" != "$prefix" && \
7989 test -d "/opt" && \
7990 (test $prefix = NONE || test "/opt" != "$prefix") && {
7991         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7992         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7993         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
7994         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
7995         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
7996         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
7997 }
7998
7999 test "$HOME" != "$prefix" && \
8000 test -d "$HOME" && \
8001 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8002         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
8003         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
8004         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
8005         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
8006         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
8007         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
8008 }
8009
8010 cf_search="$cf_library_path_list $cf_search"
8011
8012         for cf_cv_library_path_utf8 in $cf_search
8013         do
8014           if test -d $cf_cv_library_path_utf8 ; then
8015             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
8016
8017 echo "${as_me:-configure}:8017: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
8018
8019             CPPFLAGS="$cf_test_CPPFLAGS"
8020             LIBS="-lutf8  $cf_save_LIBS"
8021             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
8022             cat >conftest.$ac_ext <<_ACEOF
8023 #line 8023 "configure"
8024 #include "confdefs.h"
8025
8026 #include <libutf8.h>
8027 int
8028 main ()
8029 {
8030 putwc(0,0);
8031   ;
8032   return 0;
8033 }
8034 _ACEOF
8035 rm -f conftest.$ac_objext conftest$ac_exeext
8036 if { (eval echo "$as_me:8036: \"$ac_link\"") >&5
8037   (eval $ac_link) 2>&5
8038   ac_status=$?
8039   echo "$as_me:8039: \$? = $ac_status" >&5
8040   (exit $ac_status); } &&
8041          { ac_try='test -s conftest$ac_exeext'
8042   { (eval echo "$as_me:8042: \"$ac_try\"") >&5
8043   (eval $ac_try) 2>&5
8044   ac_status=$?
8045   echo "$as_me:8045: \$? = $ac_status" >&5
8046   (exit $ac_status); }; }; then
8047
8048                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
8049
8050 echo "${as_me:-configure}:8050: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
8051
8052                 cf_cv_find_linkage_utf8=yes
8053                 cf_cv_library_file_utf8="-lutf8"
8054                 break
8055 else
8056   echo "$as_me: failed program was:" >&5
8057 cat conftest.$ac_ext >&5
8058
8059                 CPPFLAGS="$cf_save_CPPFLAGS"
8060                 LIBS="$cf_save_LIBS"
8061                 LDFLAGS="$cf_save_LDFLAGS"
8062
8063 fi
8064 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8065           fi
8066         done
8067         CPPFLAGS="$cf_save_CPPFLAGS"
8068         LDFLAGS="$cf_save_LDFLAGS"
8069       fi
8070
8071     else
8072       cf_cv_find_linkage_utf8=no
8073     fi
8074
8075 fi
8076 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8077
8078 fi
8079 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8080
8081 LIBS="$cf_save_LIBS"
8082
8083 if test "$cf_cv_find_linkage_utf8" = yes ; then
8084 cf_cv_utf8_lib=add-on
8085 else
8086 cf_cv_utf8_lib=no
8087 fi
8088
8089 fi
8090 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8091 fi
8092 echo "$as_me:8092: result: $cf_cv_utf8_lib" >&5
8093 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
8094
8095 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
8096 # ncurses/ncursesw:
8097 if test "$cf_cv_utf8_lib" = "add-on" ; then
8098         cat >>confdefs.h <<\EOF
8099 #define HAVE_LIBUTF8_H 1
8100 EOF
8101
8102 if test -n "$cf_cv_header_path_utf8" ; then
8103   for cf_add_incdir in $cf_cv_header_path_utf8
8104   do
8105         while test $cf_add_incdir != /usr/include
8106         do
8107           if test -d $cf_add_incdir
8108           then
8109                 cf_have_incdir=no
8110                 if test -n "$CFLAGS$CPPFLAGS" ; then
8111                   # a loop is needed to ensure we can add subdirs of existing dirs
8112                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8113                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8114                           cf_have_incdir=yes; break
8115                         fi
8116                   done
8117                 fi
8118
8119                 if test "$cf_have_incdir" = no ; then
8120                   if test "$cf_add_incdir" = /usr/local/include ; then
8121                         if test "$GCC" = yes
8122                         then
8123                           cf_save_CPPFLAGS=$CPPFLAGS
8124                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8125                           cat >conftest.$ac_ext <<_ACEOF
8126 #line 8126 "configure"
8127 #include "confdefs.h"
8128 #include <stdio.h>
8129 int
8130 main ()
8131 {
8132 printf("Hello")
8133   ;
8134   return 0;
8135 }
8136 _ACEOF
8137 rm -f conftest.$ac_objext
8138 if { (eval echo "$as_me:8138: \"$ac_compile\"") >&5
8139   (eval $ac_compile) 2>&5
8140   ac_status=$?
8141   echo "$as_me:8141: \$? = $ac_status" >&5
8142   (exit $ac_status); } &&
8143          { ac_try='test -s conftest.$ac_objext'
8144   { (eval echo "$as_me:8144: \"$ac_try\"") >&5
8145   (eval $ac_try) 2>&5
8146   ac_status=$?
8147   echo "$as_me:8147: \$? = $ac_status" >&5
8148   (exit $ac_status); }; }; then
8149   :
8150 else
8151   echo "$as_me: failed program was:" >&5
8152 cat conftest.$ac_ext >&5
8153 cf_have_incdir=yes
8154 fi
8155 rm -f conftest.$ac_objext conftest.$ac_ext
8156                           CPPFLAGS=$cf_save_CPPFLAGS
8157                         fi
8158                   fi
8159                 fi
8160
8161                 if test "$cf_have_incdir" = no ; then
8162                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8163
8164 echo "${as_me:-configure}:8164: testing adding $cf_add_incdir to include-path ..." 1>&5
8165
8166                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8167
8168                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8169                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8170                   cf_add_incdir="$cf_top_incdir"
8171                 else
8172                   break
8173                 fi
8174           fi
8175         done
8176   done
8177 fi
8178
8179 if test -n "$cf_cv_library_path_utf8" ; then
8180   for cf_add_libdir in $cf_cv_library_path_utf8
8181   do
8182     if test $cf_add_libdir = /usr/lib ; then
8183       :
8184     elif test -d $cf_add_libdir
8185     then
8186       cf_have_libdir=no
8187       if test -n "$LDFLAGS$LIBS" ; then
8188         # a loop is needed to ensure we can add subdirs of existing dirs
8189         for cf_test_libdir in $LDFLAGS $LIBS ; do
8190           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
8191             cf_have_libdir=yes; break
8192           fi
8193         done
8194       fi
8195       if test "$cf_have_libdir" = no ; then
8196         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
8197
8198 echo "${as_me:-configure}:8198: testing adding $cf_add_libdir to library-path ..." 1>&5
8199
8200         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
8201       fi
8202     fi
8203   done
8204 fi
8205
8206         LIBS="$cf_cv_library_file_utf8 $LIBS"
8207 fi
8208
8209 cf_ncuconfig_root=ncursesw
8210
8211 echo "Looking for ${cf_ncuconfig_root}-config"
8212 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8213 do
8214   # Extract the first word of "$ac_prog", so it can be a program name with args.
8215 set dummy $ac_prog; ac_word=$2
8216 echo "$as_me:8216: checking for $ac_word" >&5
8217 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8218 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
8219   echo $ECHO_N "(cached) $ECHO_C" >&6
8220 else
8221   case $NCURSES_CONFIG in
8222   [\\/]* | ?:[\\/]*)
8223   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
8224   ;;
8225   *)
8226   ac_save_IFS=$IFS; IFS=$ac_path_separator
8227 ac_dummy="$PATH"
8228 for ac_dir in $ac_dummy; do
8229   IFS=$ac_save_IFS
8230   test -z "$ac_dir" && ac_dir=.
8231   if $as_executable_p "$ac_dir/$ac_word"; then
8232    ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
8233    echo "$as_me:8233: found $ac_dir/$ac_word" >&5
8234    break
8235 fi
8236 done
8237
8238   ;;
8239 esac
8240 fi
8241 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
8242
8243 if test -n "$NCURSES_CONFIG"; then
8244   echo "$as_me:8244: result: $NCURSES_CONFIG" >&5
8245 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8246 else
8247   echo "$as_me:8247: result: no" >&5
8248 echo "${ECHO_T}no" >&6
8249 fi
8250
8251   test -n "$NCURSES_CONFIG" && break
8252 done
8253 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
8254
8255 if test "$NCURSES_CONFIG" != none ; then
8256
8257 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8258 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
8259
8260 # even with config script, some packages use no-override for curses.h
8261
8262 echo "$as_me:8262: checking if we have identified curses headers" >&5
8263 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8264 if test "${cf_cv_ncurses_header+set}" = set; then
8265   echo $ECHO_N "(cached) $ECHO_C" >&6
8266 else
8267
8268 cf_cv_ncurses_header=none
8269 for cf_header in  \
8270     ncursesw/ncurses.h \
8271         ncursesw/curses.h \
8272         ncurses.h \
8273         curses.h
8274 do
8275 cat >conftest.$ac_ext <<_ACEOF
8276 #line 8276 "configure"
8277 #include "confdefs.h"
8278 #include <${cf_header}>
8279 int
8280 main ()
8281 {
8282 initscr(); tgoto("?", 0,0)
8283   ;
8284   return 0;
8285 }
8286 _ACEOF
8287 rm -f conftest.$ac_objext
8288 if { (eval echo "$as_me:8288: \"$ac_compile\"") >&5
8289   (eval $ac_compile) 2>&5
8290   ac_status=$?
8291   echo "$as_me:8291: \$? = $ac_status" >&5
8292   (exit $ac_status); } &&
8293          { ac_try='test -s conftest.$ac_objext'
8294   { (eval echo "$as_me:8294: \"$ac_try\"") >&5
8295   (eval $ac_try) 2>&5
8296   ac_status=$?
8297   echo "$as_me:8297: \$? = $ac_status" >&5
8298   (exit $ac_status); }; }; then
8299   cf_cv_ncurses_header=$cf_header; break
8300 else
8301   echo "$as_me: failed program was:" >&5
8302 cat conftest.$ac_ext >&5
8303 fi
8304 rm -f conftest.$ac_objext conftest.$ac_ext
8305 done
8306
8307 fi
8308 echo "$as_me:8308: result: $cf_cv_ncurses_header" >&5
8309 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8310
8311 if test "$cf_cv_ncurses_header" = none ; then
8312         { { echo "$as_me:8312: error: No curses header-files found" >&5
8313 echo "$as_me: error: No curses header-files found" >&2;}
8314    { (exit 1); exit 1; }; }
8315 fi
8316
8317 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8318
8319 for ac_header in $cf_cv_ncurses_header
8320 do
8321 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8322 echo "$as_me:8322: checking for $ac_header" >&5
8323 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8324 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8325   echo $ECHO_N "(cached) $ECHO_C" >&6
8326 else
8327   cat >conftest.$ac_ext <<_ACEOF
8328 #line 8328 "configure"
8329 #include "confdefs.h"
8330 #include <$ac_header>
8331 _ACEOF
8332 if { (eval echo "$as_me:8332: \"$ac_cpp conftest.$ac_ext\"") >&5
8333   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8334   ac_status=$?
8335   egrep -v '^ *\+' conftest.er1 >conftest.err
8336   rm -f conftest.er1
8337   cat conftest.err >&5
8338   echo "$as_me:8338: \$? = $ac_status" >&5
8339   (exit $ac_status); } >/dev/null; then
8340   if test -s conftest.err; then
8341     ac_cpp_err=$ac_c_preproc_warn_flag
8342   else
8343     ac_cpp_err=
8344   fi
8345 else
8346   ac_cpp_err=yes
8347 fi
8348 if test -z "$ac_cpp_err"; then
8349   eval "$as_ac_Header=yes"
8350 else
8351   echo "$as_me: failed program was:" >&5
8352   cat conftest.$ac_ext >&5
8353   eval "$as_ac_Header=no"
8354 fi
8355 rm -f conftest.err conftest.$ac_ext
8356 fi
8357 echo "$as_me:8357: result: `eval echo '${'$as_ac_Header'}'`" >&5
8358 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8359 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8360   cat >>confdefs.h <<EOF
8361 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8362 EOF
8363
8364 fi
8365 done
8366
8367 cat >>confdefs.h <<\EOF
8368 #define NCURSES 1
8369 EOF
8370
8371 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8372
8373 cat >>confdefs.h <<EOF
8374 #define $cf_nculib_ROOT 1
8375 EOF
8376
8377 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8378
8379 else
8380
8381 cf_ncuhdr_root=ncursesw
8382
8383 test -n "$cf_cv_curses_dir" && \
8384 test "$cf_cv_curses_dir" != "no" && { \
8385
8386 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8387   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8388   do
8389         while test $cf_add_incdir != /usr/include
8390         do
8391           if test -d $cf_add_incdir
8392           then
8393                 cf_have_incdir=no
8394                 if test -n "$CFLAGS$CPPFLAGS" ; then
8395                   # a loop is needed to ensure we can add subdirs of existing dirs
8396                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8397                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8398                           cf_have_incdir=yes; break
8399                         fi
8400                   done
8401                 fi
8402
8403                 if test "$cf_have_incdir" = no ; then
8404                   if test "$cf_add_incdir" = /usr/local/include ; then
8405                         if test "$GCC" = yes
8406                         then
8407                           cf_save_CPPFLAGS=$CPPFLAGS
8408                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8409                           cat >conftest.$ac_ext <<_ACEOF
8410 #line 8410 "configure"
8411 #include "confdefs.h"
8412 #include <stdio.h>
8413 int
8414 main ()
8415 {
8416 printf("Hello")
8417   ;
8418   return 0;
8419 }
8420 _ACEOF
8421 rm -f conftest.$ac_objext
8422 if { (eval echo "$as_me:8422: \"$ac_compile\"") >&5
8423   (eval $ac_compile) 2>&5
8424   ac_status=$?
8425   echo "$as_me:8425: \$? = $ac_status" >&5
8426   (exit $ac_status); } &&
8427          { ac_try='test -s conftest.$ac_objext'
8428   { (eval echo "$as_me:8428: \"$ac_try\"") >&5
8429   (eval $ac_try) 2>&5
8430   ac_status=$?
8431   echo "$as_me:8431: \$? = $ac_status" >&5
8432   (exit $ac_status); }; }; then
8433   :
8434 else
8435   echo "$as_me: failed program was:" >&5
8436 cat conftest.$ac_ext >&5
8437 cf_have_incdir=yes
8438 fi
8439 rm -f conftest.$ac_objext conftest.$ac_ext
8440                           CPPFLAGS=$cf_save_CPPFLAGS
8441                         fi
8442                   fi
8443                 fi
8444
8445                 if test "$cf_have_incdir" = no ; then
8446                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8447
8448 echo "${as_me:-configure}:8448: testing adding $cf_add_incdir to include-path ..." 1>&5
8449
8450                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8451
8452                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8453                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8454                   cf_add_incdir="$cf_top_incdir"
8455                 else
8456                   break
8457                 fi
8458           fi
8459         done
8460   done
8461 fi
8462
8463 }
8464
8465 echo "$as_me:8465: checking for $cf_ncuhdr_root header in include-path" >&5
8466 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8467 if test "${cf_cv_ncurses_h+set}" = set; then
8468   echo $ECHO_N "(cached) $ECHO_C" >&6
8469 else
8470
8471         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8472         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8473         for cf_header in $cf_header_list
8474         do
8475
8476         cat >conftest.$ac_ext <<_ACEOF
8477 #line 8477 "configure"
8478 #include "confdefs.h"
8479
8480 #define _XOPEN_SOURCE_EXTENDED
8481 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8482 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8483
8484 #include <$cf_header>
8485 int
8486 main ()
8487 {
8488
8489 #ifdef NCURSES_VERSION
8490
8491 #ifndef WACS_BSSB
8492         make an error
8493 #endif
8494
8495 printf("%s\n", NCURSES_VERSION);
8496 #else
8497 #ifdef __NCURSES_H
8498 printf("old\n");
8499 #else
8500         make an error
8501 #endif
8502 #endif
8503
8504   ;
8505   return 0;
8506 }
8507 _ACEOF
8508 rm -f conftest.$ac_objext
8509 if { (eval echo "$as_me:8509: \"$ac_compile\"") >&5
8510   (eval $ac_compile) 2>&5
8511   ac_status=$?
8512   echo "$as_me:8512: \$? = $ac_status" >&5
8513   (exit $ac_status); } &&
8514          { ac_try='test -s conftest.$ac_objext'
8515   { (eval echo "$as_me:8515: \"$ac_try\"") >&5
8516   (eval $ac_try) 2>&5
8517   ac_status=$?
8518   echo "$as_me:8518: \$? = $ac_status" >&5
8519   (exit $ac_status); }; }; then
8520   cf_cv_ncurses_h=$cf_header
8521
8522 else
8523   echo "$as_me: failed program was:" >&5
8524 cat conftest.$ac_ext >&5
8525 cf_cv_ncurses_h=no
8526 fi
8527 rm -f conftest.$ac_objext conftest.$ac_ext
8528
8529                 test "$cf_cv_ncurses_h" != no && break
8530         done
8531
8532 fi
8533 echo "$as_me:8533: result: $cf_cv_ncurses_h" >&5
8534 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8535
8536 if test "$cf_cv_ncurses_h" != no ; then
8537         cf_cv_ncurses_header=$cf_cv_ncurses_h
8538 else
8539
8540 echo "$as_me:8540: checking for $cf_ncuhdr_root include-path" >&5
8541 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8542 if test "${cf_cv_ncurses_h2+set}" = set; then
8543   echo $ECHO_N "(cached) $ECHO_C" >&6
8544 else
8545
8546         test -n "$verbose" && echo
8547
8548 cf_search=
8549
8550 # collect the current set of include-directories from compiler flags
8551 cf_header_path_list=""
8552 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8553         for cf_header_path in $CPPFLAGS $CFLAGS
8554         do
8555                 case $cf_header_path in #(vi
8556                 -I*)
8557                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8558
8559 test "$cf_header_path" != "NONE" && \
8560 test -d "$cf_header_path" && \
8561  {
8562         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8563         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8564         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8565         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8566         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8567         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"
8568 }
8569
8570                         cf_header_path_list="$cf_header_path_list $cf_search"
8571                         ;;
8572                 esac
8573         done
8574 fi
8575
8576 # add the variations for the package we are looking for
8577
8578 cf_search=
8579
8580 test "/usr" != "$prefix" && \
8581 test -d "/usr" && \
8582 (test $prefix = NONE || test "/usr" != "$prefix") && {
8583         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
8584         test -d /usr/include &&          cf_search="$cf_search /usr/include"
8585         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
8586         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
8587         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
8588         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8589 }
8590
8591 test "$prefix" != "NONE" && \
8592 test -d "$prefix" && \
8593  {
8594         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8595         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8596         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8597         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8598         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8599         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8600 }
8601
8602 test "/usr/local" != "$prefix" && \
8603 test -d "/usr/local" && \
8604 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8605         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
8606         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
8607         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
8608         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
8609         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
8610         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8611 }
8612
8613 test "/opt" != "$prefix" && \
8614 test -d "/opt" && \
8615 (test $prefix = NONE || test "/opt" != "$prefix") && {
8616         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
8617         test -d /opt/include &&          cf_search="$cf_search /opt/include"
8618         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
8619         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
8620         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
8621         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8622 }
8623
8624 test "$HOME" != "$prefix" && \
8625 test -d "$HOME" && \
8626 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8627         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
8628         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
8629         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
8630         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
8631         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
8632         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8633 }
8634
8635 test "$includedir" != NONE && \
8636 test "$includedir" != "/usr/include" && \
8637 test -d "$includedir" && {
8638         test -d $includedir &&    cf_search="$cf_search $includedir"
8639         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8640 }
8641
8642 test "$oldincludedir" != NONE && \
8643 test "$oldincludedir" != "/usr/include" && \
8644 test -d "$oldincludedir" && {
8645         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8646         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8647 }
8648
8649 cf_search="$cf_search $cf_header_path_list"
8650
8651         test -n "$verbose" && echo search path $cf_search
8652         cf_save2_CPPFLAGS="$CPPFLAGS"
8653         for cf_incdir in $cf_search
8654         do
8655
8656 if test -n "$cf_incdir" ; then
8657   for cf_add_incdir in $cf_incdir
8658   do
8659         while test $cf_add_incdir != /usr/include
8660         do
8661           if test -d $cf_add_incdir
8662           then
8663                 cf_have_incdir=no
8664                 if test -n "$CFLAGS$CPPFLAGS" ; then
8665                   # a loop is needed to ensure we can add subdirs of existing dirs
8666                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8667                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8668                           cf_have_incdir=yes; break
8669                         fi
8670                   done
8671                 fi
8672
8673                 if test "$cf_have_incdir" = no ; then
8674                   if test "$cf_add_incdir" = /usr/local/include ; then
8675                         if test "$GCC" = yes
8676                         then
8677                           cf_save_CPPFLAGS=$CPPFLAGS
8678                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8679                           cat >conftest.$ac_ext <<_ACEOF
8680 #line 8680 "configure"
8681 #include "confdefs.h"
8682 #include <stdio.h>
8683 int
8684 main ()
8685 {
8686 printf("Hello")
8687   ;
8688   return 0;
8689 }
8690 _ACEOF
8691 rm -f conftest.$ac_objext
8692 if { (eval echo "$as_me:8692: \"$ac_compile\"") >&5
8693   (eval $ac_compile) 2>&5
8694   ac_status=$?
8695   echo "$as_me:8695: \$? = $ac_status" >&5
8696   (exit $ac_status); } &&
8697          { ac_try='test -s conftest.$ac_objext'
8698   { (eval echo "$as_me:8698: \"$ac_try\"") >&5
8699   (eval $ac_try) 2>&5
8700   ac_status=$?
8701   echo "$as_me:8701: \$? = $ac_status" >&5
8702   (exit $ac_status); }; }; then
8703   :
8704 else
8705   echo "$as_me: failed program was:" >&5
8706 cat conftest.$ac_ext >&5
8707 cf_have_incdir=yes
8708 fi
8709 rm -f conftest.$ac_objext conftest.$ac_ext
8710                           CPPFLAGS=$cf_save_CPPFLAGS
8711                         fi
8712                   fi
8713                 fi
8714
8715                 if test "$cf_have_incdir" = no ; then
8716                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8717
8718 echo "${as_me:-configure}:8718: testing adding $cf_add_incdir to include-path ..." 1>&5
8719
8720                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8721
8722                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8723                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8724                   cf_add_incdir="$cf_top_incdir"
8725                 else
8726                   break
8727                 fi
8728           fi
8729         done
8730   done
8731 fi
8732
8733                 for cf_header in \
8734                         ncurses.h \
8735                         curses.h
8736                 do
8737
8738         cat >conftest.$ac_ext <<_ACEOF
8739 #line 8739 "configure"
8740 #include "confdefs.h"
8741
8742 #include <$cf_header>
8743 int
8744 main ()
8745 {
8746
8747 #ifdef NCURSES_VERSION
8748
8749 printf("%s\n", NCURSES_VERSION);
8750 #else
8751 #ifdef __NCURSES_H
8752 printf("old\n");
8753 #else
8754         make an error
8755 #endif
8756 #endif
8757
8758   ;
8759   return 0;
8760 }
8761 _ACEOF
8762 rm -f conftest.$ac_objext
8763 if { (eval echo "$as_me:8763: \"$ac_compile\"") >&5
8764   (eval $ac_compile) 2>&5
8765   ac_status=$?
8766   echo "$as_me:8766: \$? = $ac_status" >&5
8767   (exit $ac_status); } &&
8768          { ac_try='test -s conftest.$ac_objext'
8769   { (eval echo "$as_me:8769: \"$ac_try\"") >&5
8770   (eval $ac_try) 2>&5
8771   ac_status=$?
8772   echo "$as_me:8772: \$? = $ac_status" >&5
8773   (exit $ac_status); }; }; then
8774   cf_cv_ncurses_h2=$cf_header
8775
8776 else
8777   echo "$as_me: failed program was:" >&5
8778 cat conftest.$ac_ext >&5
8779 cf_cv_ncurses_h2=no
8780 fi
8781 rm -f conftest.$ac_objext conftest.$ac_ext
8782
8783                         if test "$cf_cv_ncurses_h2" != no ; then
8784                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8785                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8786                                 break
8787                         fi
8788                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8789                 done
8790                 CPPFLAGS="$cf_save2_CPPFLAGS"
8791                 test "$cf_cv_ncurses_h2" != no && break
8792         done
8793         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8793: error: not found" >&5
8794 echo "$as_me: error: not found" >&2;}
8795    { (exit 1); exit 1; }; }
8796
8797 fi
8798 echo "$as_me:8798: result: $cf_cv_ncurses_h2" >&5
8799 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8800
8801         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8802         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8803         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8804                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8805         fi
8806
8807 if test -n "$cf_1st_incdir" ; then
8808   for cf_add_incdir in $cf_1st_incdir
8809   do
8810         while test $cf_add_incdir != /usr/include
8811         do
8812           if test -d $cf_add_incdir
8813           then
8814                 cf_have_incdir=no
8815                 if test -n "$CFLAGS$CPPFLAGS" ; then
8816                   # a loop is needed to ensure we can add subdirs of existing dirs
8817                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8818                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8819                           cf_have_incdir=yes; break
8820                         fi
8821                   done
8822                 fi
8823
8824                 if test "$cf_have_incdir" = no ; then
8825                   if test "$cf_add_incdir" = /usr/local/include ; then
8826                         if test "$GCC" = yes
8827                         then
8828                           cf_save_CPPFLAGS=$CPPFLAGS
8829                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8830                           cat >conftest.$ac_ext <<_ACEOF
8831 #line 8831 "configure"
8832 #include "confdefs.h"
8833 #include <stdio.h>
8834 int
8835 main ()
8836 {
8837 printf("Hello")
8838   ;
8839   return 0;
8840 }
8841 _ACEOF
8842 rm -f conftest.$ac_objext
8843 if { (eval echo "$as_me:8843: \"$ac_compile\"") >&5
8844   (eval $ac_compile) 2>&5
8845   ac_status=$?
8846   echo "$as_me:8846: \$? = $ac_status" >&5
8847   (exit $ac_status); } &&
8848          { ac_try='test -s conftest.$ac_objext'
8849   { (eval echo "$as_me:8849: \"$ac_try\"") >&5
8850   (eval $ac_try) 2>&5
8851   ac_status=$?
8852   echo "$as_me:8852: \$? = $ac_status" >&5
8853   (exit $ac_status); }; }; then
8854   :
8855 else
8856   echo "$as_me: failed program was:" >&5
8857 cat conftest.$ac_ext >&5
8858 cf_have_incdir=yes
8859 fi
8860 rm -f conftest.$ac_objext conftest.$ac_ext
8861                           CPPFLAGS=$cf_save_CPPFLAGS
8862                         fi
8863                   fi
8864                 fi
8865
8866                 if test "$cf_have_incdir" = no ; then
8867                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8868
8869 echo "${as_me:-configure}:8869: testing adding $cf_add_incdir to include-path ..." 1>&5
8870
8871                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8872
8873                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8874                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8875                   cf_add_incdir="$cf_top_incdir"
8876                 else
8877                   break
8878                 fi
8879           fi
8880         done
8881   done
8882 fi
8883
8884 fi
8885
8886 # Set definitions to allow ifdef'ing for ncurses.h
8887
8888 case $cf_cv_ncurses_header in # (vi
8889 *ncurses.h)
8890         cat >>confdefs.h <<\EOF
8891 #define HAVE_NCURSES_H 1
8892 EOF
8893
8894         ;;
8895 esac
8896
8897 case $cf_cv_ncurses_header in # (vi
8898 ncurses/curses.h|ncurses/ncurses.h)
8899         cat >>confdefs.h <<\EOF
8900 #define HAVE_NCURSES_NCURSES_H 1
8901 EOF
8902
8903         ;;
8904 ncursesw/curses.h|ncursesw/ncurses.h)
8905         cat >>confdefs.h <<\EOF
8906 #define HAVE_NCURSESW_NCURSES_H 1
8907 EOF
8908
8909         ;;
8910 esac
8911
8912 echo "$as_me:8912: checking for terminfo header" >&5
8913 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8914 if test "${cf_cv_term_header+set}" = set; then
8915   echo $ECHO_N "(cached) $ECHO_C" >&6
8916 else
8917
8918 case ${cf_cv_ncurses_header} in #(vi
8919 */ncurses.h|*/ncursesw.h) #(vi
8920         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8921         ;;
8922 *)
8923         cf_term_header=term.h
8924         ;;
8925 esac
8926
8927 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8928 do
8929 cat >conftest.$ac_ext <<_ACEOF
8930 #line 8930 "configure"
8931 #include "confdefs.h"
8932 #include <stdio.h>
8933 #include <${cf_cv_ncurses_header:-curses.h}>
8934 #include <$cf_test>
8935
8936 int
8937 main ()
8938 {
8939 int x = auto_left_margin
8940   ;
8941   return 0;
8942 }
8943 _ACEOF
8944 rm -f conftest.$ac_objext
8945 if { (eval echo "$as_me:8945: \"$ac_compile\"") >&5
8946   (eval $ac_compile) 2>&5
8947   ac_status=$?
8948   echo "$as_me:8948: \$? = $ac_status" >&5
8949   (exit $ac_status); } &&
8950          { ac_try='test -s conftest.$ac_objext'
8951   { (eval echo "$as_me:8951: \"$ac_try\"") >&5
8952   (eval $ac_try) 2>&5
8953   ac_status=$?
8954   echo "$as_me:8954: \$? = $ac_status" >&5
8955   (exit $ac_status); }; }; then
8956
8957         cf_cv_term_header="$cf_test"
8958 else
8959   echo "$as_me: failed program was:" >&5
8960 cat conftest.$ac_ext >&5
8961
8962         cf_cv_term_header=unknown
8963
8964 fi
8965 rm -f conftest.$ac_objext conftest.$ac_ext
8966         test "$cf_cv_term_header" != unknown && break
8967 done
8968
8969 fi
8970 echo "$as_me:8970: result: $cf_cv_term_header" >&5
8971 echo "${ECHO_T}$cf_cv_term_header" >&6
8972
8973 # Set definitions to allow ifdef'ing to accommodate subdirectories
8974
8975 case $cf_cv_term_header in # (vi
8976 *term.h)
8977         cat >>confdefs.h <<\EOF
8978 #define HAVE_TERM_H 1
8979 EOF
8980
8981         ;;
8982 esac
8983
8984 case $cf_cv_term_header in # (vi
8985 ncurses/term.h) #(vi
8986         cat >>confdefs.h <<\EOF
8987 #define HAVE_NCURSES_TERM_H 1
8988 EOF
8989
8990         ;;
8991 ncursesw/term.h)
8992         cat >>confdefs.h <<\EOF
8993 #define HAVE_NCURSESW_TERM_H 1
8994 EOF
8995
8996         ;;
8997 esac
8998
8999 # some applications need this, but should check for NCURSES_VERSION
9000 cat >>confdefs.h <<\EOF
9001 #define NCURSES 1
9002 EOF
9003
9004 echo "$as_me:9004: checking for ncurses version" >&5
9005 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9006 if test "${cf_cv_ncurses_version+set}" = set; then
9007   echo $ECHO_N "(cached) $ECHO_C" >&6
9008 else
9009
9010         cf_cv_ncurses_version=no
9011         cf_tempfile=out$$
9012         rm -f $cf_tempfile
9013         if test "$cross_compiling" = yes; then
9014
9015         # This will not work if the preprocessor splits the line after the
9016         # Autoconf token.  The 'unproto' program does that.
9017         cat > conftest.$ac_ext <<EOF
9018 #include <${cf_cv_ncurses_header:-curses.h}>
9019 #undef Autoconf
9020 #ifdef NCURSES_VERSION
9021 Autoconf NCURSES_VERSION
9022 #else
9023 #ifdef __NCURSES_H
9024 Autoconf "old"
9025 #endif
9026 ;
9027 #endif
9028 EOF
9029         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9030         { (eval echo "$as_me:9030: \"$cf_try\"") >&5
9031   (eval $cf_try) 2>&5
9032   ac_status=$?
9033   echo "$as_me:9033: \$? = $ac_status" >&5
9034   (exit $ac_status); }
9035         if test -f conftest.out ; then
9036                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9037                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9038                 rm -f conftest.out
9039         fi
9040
9041 else
9042   cat >conftest.$ac_ext <<_ACEOF
9043 #line 9043 "configure"
9044 #include "confdefs.h"
9045
9046 #include <${cf_cv_ncurses_header:-curses.h}>
9047 #include <stdio.h>
9048 int main()
9049 {
9050         FILE *fp = fopen("$cf_tempfile", "w");
9051 #ifdef NCURSES_VERSION
9052 # ifdef NCURSES_VERSION_PATCH
9053         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9054 # else
9055         fprintf(fp, "%s\n", NCURSES_VERSION);
9056 # endif
9057 #else
9058 # ifdef __NCURSES_H
9059         fprintf(fp, "old\n");
9060 # else
9061         make an error
9062 # endif
9063 #endif
9064         ${cf_cv_main_return:-return}(0);
9065 }
9066 _ACEOF
9067 rm -f conftest$ac_exeext
9068 if { (eval echo "$as_me:9068: \"$ac_link\"") >&5
9069   (eval $ac_link) 2>&5
9070   ac_status=$?
9071   echo "$as_me:9071: \$? = $ac_status" >&5
9072   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9073   { (eval echo "$as_me:9073: \"$ac_try\"") >&5
9074   (eval $ac_try) 2>&5
9075   ac_status=$?
9076   echo "$as_me:9076: \$? = $ac_status" >&5
9077   (exit $ac_status); }; }; then
9078
9079         cf_cv_ncurses_version=`cat $cf_tempfile`
9080 else
9081   echo "$as_me: program exited with status $ac_status" >&5
9082 echo "$as_me: failed program was:" >&5
9083 cat conftest.$ac_ext >&5
9084 fi
9085 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9086 fi
9087         rm -f $cf_tempfile
9088
9089 fi
9090 echo "$as_me:9090: result: $cf_cv_ncurses_version" >&5
9091 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9092 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
9093 #define NCURSES 1
9094 EOF
9095
9096 cf_nculib_root=ncursesw
9097         # This works, except for the special case where we find gpm, but
9098         # ncurses is in a nonstandard location via $LIBS, and we really want
9099         # to link gpm.
9100 cf_ncurses_LIBS=""
9101 cf_ncurses_SAVE="$LIBS"
9102 echo "$as_me:9102: checking for Gpm_Open in -lgpm" >&5
9103 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9104 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9105   echo $ECHO_N "(cached) $ECHO_C" >&6
9106 else
9107   ac_check_lib_save_LIBS=$LIBS
9108 LIBS="-lgpm  $LIBS"
9109 cat >conftest.$ac_ext <<_ACEOF
9110 #line 9110 "configure"
9111 #include "confdefs.h"
9112
9113 /* Override any gcc2 internal prototype to avoid an error.  */
9114 #ifdef __cplusplus
9115 extern "C"
9116 #endif
9117 /* We use char because int might match the return type of a gcc2
9118    builtin and then its argument prototype would still apply.  */
9119 char Gpm_Open ();
9120 int
9121 main ()
9122 {
9123 Gpm_Open ();
9124   ;
9125   return 0;
9126 }
9127 _ACEOF
9128 rm -f conftest.$ac_objext conftest$ac_exeext
9129 if { (eval echo "$as_me:9129: \"$ac_link\"") >&5
9130   (eval $ac_link) 2>&5
9131   ac_status=$?
9132   echo "$as_me:9132: \$? = $ac_status" >&5
9133   (exit $ac_status); } &&
9134          { ac_try='test -s conftest$ac_exeext'
9135   { (eval echo "$as_me:9135: \"$ac_try\"") >&5
9136   (eval $ac_try) 2>&5
9137   ac_status=$?
9138   echo "$as_me:9138: \$? = $ac_status" >&5
9139   (exit $ac_status); }; }; then
9140   ac_cv_lib_gpm_Gpm_Open=yes
9141 else
9142   echo "$as_me: failed program was:" >&5
9143 cat conftest.$ac_ext >&5
9144 ac_cv_lib_gpm_Gpm_Open=no
9145 fi
9146 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9147 LIBS=$ac_check_lib_save_LIBS
9148 fi
9149 echo "$as_me:9149: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9150 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9151 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9152   echo "$as_me:9152: checking for initscr in -lgpm" >&5
9153 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9154 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9155   echo $ECHO_N "(cached) $ECHO_C" >&6
9156 else
9157   ac_check_lib_save_LIBS=$LIBS
9158 LIBS="-lgpm  $LIBS"
9159 cat >conftest.$ac_ext <<_ACEOF
9160 #line 9160 "configure"
9161 #include "confdefs.h"
9162
9163 /* Override any gcc2 internal prototype to avoid an error.  */
9164 #ifdef __cplusplus
9165 extern "C"
9166 #endif
9167 /* We use char because int might match the return type of a gcc2
9168    builtin and then its argument prototype would still apply.  */
9169 char initscr ();
9170 int
9171 main ()
9172 {
9173 initscr ();
9174   ;
9175   return 0;
9176 }
9177 _ACEOF
9178 rm -f conftest.$ac_objext conftest$ac_exeext
9179 if { (eval echo "$as_me:9179: \"$ac_link\"") >&5
9180   (eval $ac_link) 2>&5
9181   ac_status=$?
9182   echo "$as_me:9182: \$? = $ac_status" >&5
9183   (exit $ac_status); } &&
9184          { ac_try='test -s conftest$ac_exeext'
9185   { (eval echo "$as_me:9185: \"$ac_try\"") >&5
9186   (eval $ac_try) 2>&5
9187   ac_status=$?
9188   echo "$as_me:9188: \$? = $ac_status" >&5
9189   (exit $ac_status); }; }; then
9190   ac_cv_lib_gpm_initscr=yes
9191 else
9192   echo "$as_me: failed program was:" >&5
9193 cat conftest.$ac_ext >&5
9194 ac_cv_lib_gpm_initscr=no
9195 fi
9196 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9197 LIBS=$ac_check_lib_save_LIBS
9198 fi
9199 echo "$as_me:9199: result: $ac_cv_lib_gpm_initscr" >&5
9200 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9201 if test $ac_cv_lib_gpm_initscr = yes; then
9202   LIBS="$cf_ncurses_SAVE"
9203 else
9204   cf_ncurses_LIBS="-lgpm"
9205 fi
9206
9207 fi
9208
9209 case $host_os in #(vi
9210 freebsd*)
9211         # This is only necessary if you are linking against an obsolete
9212         # version of ncurses (but it should do no harm, since it's static).
9213         if test "$cf_nculib_root" = ncurses ; then
9214                 echo "$as_me:9214: checking for tgoto in -lmytinfo" >&5
9215 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9216 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9217   echo $ECHO_N "(cached) $ECHO_C" >&6
9218 else
9219   ac_check_lib_save_LIBS=$LIBS
9220 LIBS="-lmytinfo  $LIBS"
9221 cat >conftest.$ac_ext <<_ACEOF
9222 #line 9222 "configure"
9223 #include "confdefs.h"
9224
9225 /* Override any gcc2 internal prototype to avoid an error.  */
9226 #ifdef __cplusplus
9227 extern "C"
9228 #endif
9229 /* We use char because int might match the return type of a gcc2
9230    builtin and then its argument prototype would still apply.  */
9231 char tgoto ();
9232 int
9233 main ()
9234 {
9235 tgoto ();
9236   ;
9237   return 0;
9238 }
9239 _ACEOF
9240 rm -f conftest.$ac_objext conftest$ac_exeext
9241 if { (eval echo "$as_me:9241: \"$ac_link\"") >&5
9242   (eval $ac_link) 2>&5
9243   ac_status=$?
9244   echo "$as_me:9244: \$? = $ac_status" >&5
9245   (exit $ac_status); } &&
9246          { ac_try='test -s conftest$ac_exeext'
9247   { (eval echo "$as_me:9247: \"$ac_try\"") >&5
9248   (eval $ac_try) 2>&5
9249   ac_status=$?
9250   echo "$as_me:9250: \$? = $ac_status" >&5
9251   (exit $ac_status); }; }; then
9252   ac_cv_lib_mytinfo_tgoto=yes
9253 else
9254   echo "$as_me: failed program was:" >&5
9255 cat conftest.$ac_ext >&5
9256 ac_cv_lib_mytinfo_tgoto=no
9257 fi
9258 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9259 LIBS=$ac_check_lib_save_LIBS
9260 fi
9261 echo "$as_me:9261: result: $ac_cv_lib_mytinfo_tgoto" >&5
9262 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9263 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9264   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9265 fi
9266
9267         fi
9268         ;;
9269 esac
9270
9271 LIBS="$cf_ncurses_LIBS $LIBS"
9272
9273 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9274 then
9275         LIBS="-l$cf_nculib_root $LIBS"
9276 else
9277
9278         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9279         cf_libdir=""
9280         echo "$as_me:9280: checking for initscr" >&5
9281 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9282 if test "${ac_cv_func_initscr+set}" = set; then
9283   echo $ECHO_N "(cached) $ECHO_C" >&6
9284 else
9285   cat >conftest.$ac_ext <<_ACEOF
9286 #line 9286 "configure"
9287 #include "confdefs.h"
9288 /* System header to define __stub macros and hopefully few prototypes,
9289     which can conflict with char initscr (); below.  */
9290 #include <assert.h>
9291 /* Override any gcc2 internal prototype to avoid an error.  */
9292 #ifdef __cplusplus
9293 extern "C"
9294 #endif
9295 /* We use char because int might match the return type of a gcc2
9296    builtin and then its argument prototype would still apply.  */
9297 char initscr ();
9298 char (*f) ();
9299
9300 int
9301 main ()
9302 {
9303 /* The GNU C library defines this for functions which it implements
9304     to always fail with ENOSYS.  Some functions are actually named
9305     something starting with __ and the normal name is an alias.  */
9306 #if defined (__stub_initscr) || defined (__stub___initscr)
9307 choke me
9308 #else
9309 f = initscr;
9310 #endif
9311
9312   ;
9313   return 0;
9314 }
9315 _ACEOF
9316 rm -f conftest.$ac_objext conftest$ac_exeext
9317 if { (eval echo "$as_me:9317: \"$ac_link\"") >&5
9318   (eval $ac_link) 2>&5
9319   ac_status=$?
9320   echo "$as_me:9320: \$? = $ac_status" >&5
9321   (exit $ac_status); } &&
9322          { ac_try='test -s conftest$ac_exeext'
9323   { (eval echo "$as_me:9323: \"$ac_try\"") >&5
9324   (eval $ac_try) 2>&5
9325   ac_status=$?
9326   echo "$as_me:9326: \$? = $ac_status" >&5
9327   (exit $ac_status); }; }; then
9328   ac_cv_func_initscr=yes
9329 else
9330   echo "$as_me: failed program was:" >&5
9331 cat conftest.$ac_ext >&5
9332 ac_cv_func_initscr=no
9333 fi
9334 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9335 fi
9336 echo "$as_me:9336: result: $ac_cv_func_initscr" >&5
9337 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9338 if test $ac_cv_func_initscr = yes; then
9339   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9340 else
9341
9342                 cf_save_LIBS="$LIBS"
9343                 echo "$as_me:9343: checking for initscr in -l$cf_nculib_root" >&5
9344 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9345                 LIBS="-l$cf_nculib_root $LIBS"
9346                 cat >conftest.$ac_ext <<_ACEOF
9347 #line 9347 "configure"
9348 #include "confdefs.h"
9349 #include <${cf_cv_ncurses_header:-curses.h}>
9350 int
9351 main ()
9352 {
9353 initscr()
9354   ;
9355   return 0;
9356 }
9357 _ACEOF
9358 rm -f conftest.$ac_objext conftest$ac_exeext
9359 if { (eval echo "$as_me:9359: \"$ac_link\"") >&5
9360   (eval $ac_link) 2>&5
9361   ac_status=$?
9362   echo "$as_me:9362: \$? = $ac_status" >&5
9363   (exit $ac_status); } &&
9364          { ac_try='test -s conftest$ac_exeext'
9365   { (eval echo "$as_me:9365: \"$ac_try\"") >&5
9366   (eval $ac_try) 2>&5
9367   ac_status=$?
9368   echo "$as_me:9368: \$? = $ac_status" >&5
9369   (exit $ac_status); }; }; then
9370   echo "$as_me:9370: result: yes" >&5
9371 echo "${ECHO_T}yes" >&6
9372                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9373
9374 else
9375   echo "$as_me: failed program was:" >&5
9376 cat conftest.$ac_ext >&5
9377 echo "$as_me:9377: result: no" >&5
9378 echo "${ECHO_T}no" >&6
9379
9380 cf_search=
9381 cf_library_path_list=""
9382 if test -n "${LDFLAGS}${LIBS}" ; then
9383         for cf_library_path in $LDFLAGS $LIBS
9384         do
9385                 case $cf_library_path in #(vi
9386                 -L*)
9387                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9388
9389 test "$cf_library_path" != "NONE" && \
9390 test -d "$cf_library_path" && \
9391  {
9392         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9393         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9394         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9395         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9396         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9397         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"
9398 }
9399
9400                         cf_library_path_list="$cf_library_path_list $cf_search"
9401                         ;;
9402                 esac
9403         done
9404 fi
9405
9406 cf_search=
9407
9408 test "/usr" != "$prefix" && \
9409 test -d "/usr" && \
9410 (test $prefix = NONE || test "/usr" != "$prefix") && {
9411         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
9412         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
9413         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
9414         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
9415         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
9416         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
9417 }
9418
9419 test "$prefix" != "NONE" && \
9420 test -d "$prefix" && \
9421  {
9422         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9423         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9424         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9425         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9426         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9427         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9428 }
9429
9430 test "/usr/local" != "$prefix" && \
9431 test -d "/usr/local" && \
9432 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
9433         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
9434         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
9435         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
9436         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
9437         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
9438         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
9439 }
9440
9441 test "/opt" != "$prefix" && \
9442 test -d "/opt" && \
9443 (test $prefix = NONE || test "/opt" != "$prefix") && {
9444         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
9445         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
9446         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
9447         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
9448         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
9449         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
9450 }
9451
9452 test "$HOME" != "$prefix" && \
9453 test -d "$HOME" && \
9454 (test $prefix = NONE || test "$HOME" != "$prefix") && {
9455         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
9456         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
9457         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
9458         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
9459         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
9460         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
9461 }
9462
9463 cf_search="$cf_library_path_list $cf_search"
9464
9465                         for cf_libdir in $cf_search
9466                         do
9467                                 echo "$as_me:9467: checking for -l$cf_nculib_root in $cf_libdir" >&5
9468 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9469                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9470                                 cat >conftest.$ac_ext <<_ACEOF
9471 #line 9471 "configure"
9472 #include "confdefs.h"
9473 #include <${cf_cv_ncurses_header:-curses.h}>
9474 int
9475 main ()
9476 {
9477 initscr()
9478   ;
9479   return 0;
9480 }
9481 _ACEOF
9482 rm -f conftest.$ac_objext conftest$ac_exeext
9483 if { (eval echo "$as_me:9483: \"$ac_link\"") >&5
9484   (eval $ac_link) 2>&5
9485   ac_status=$?
9486   echo "$as_me:9486: \$? = $ac_status" >&5
9487   (exit $ac_status); } &&
9488          { ac_try='test -s conftest$ac_exeext'
9489   { (eval echo "$as_me:9489: \"$ac_try\"") >&5
9490   (eval $ac_try) 2>&5
9491   ac_status=$?
9492   echo "$as_me:9492: \$? = $ac_status" >&5
9493   (exit $ac_status); }; }; then
9494   echo "$as_me:9494: result: yes" >&5
9495 echo "${ECHO_T}yes" >&6
9496                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9497                                          break
9498 else
9499   echo "$as_me: failed program was:" >&5
9500 cat conftest.$ac_ext >&5
9501 echo "$as_me:9501: result: no" >&5
9502 echo "${ECHO_T}no" >&6
9503                                          LIBS="$cf_save_LIBS"
9504 fi
9505 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9506                         done
9507
9508 fi
9509 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9510
9511 fi
9512
9513 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9514
9515 if test $cf_found_library = no ; then
9516         { { echo "$as_me:9516: error: Cannot link $cf_nculib_root library" >&5
9517 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9518    { (exit 1); exit 1; }; }
9519 fi
9520
9521 fi
9522
9523 if test -n "$cf_ncurses_LIBS" ; then
9524         echo "$as_me:9524: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9525 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9526         cf_ncurses_SAVE="$LIBS"
9527         for p in $cf_ncurses_LIBS ; do
9528                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9529                 if test "$q" != "$LIBS" ; then
9530                         LIBS="$q"
9531                 fi
9532         done
9533         cat >conftest.$ac_ext <<_ACEOF
9534 #line 9534 "configure"
9535 #include "confdefs.h"
9536 #include <${cf_cv_ncurses_header:-curses.h}>
9537 int
9538 main ()
9539 {
9540 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9541   ;
9542   return 0;
9543 }
9544 _ACEOF
9545 rm -f conftest.$ac_objext conftest$ac_exeext
9546 if { (eval echo "$as_me:9546: \"$ac_link\"") >&5
9547   (eval $ac_link) 2>&5
9548   ac_status=$?
9549   echo "$as_me:9549: \$? = $ac_status" >&5
9550   (exit $ac_status); } &&
9551          { ac_try='test -s conftest$ac_exeext'
9552   { (eval echo "$as_me:9552: \"$ac_try\"") >&5
9553   (eval $ac_try) 2>&5
9554   ac_status=$?
9555   echo "$as_me:9555: \$? = $ac_status" >&5
9556   (exit $ac_status); }; }; then
9557   echo "$as_me:9557: result: yes" >&5
9558 echo "${ECHO_T}yes" >&6
9559 else
9560   echo "$as_me: failed program was:" >&5
9561 cat conftest.$ac_ext >&5
9562 echo "$as_me:9562: result: no" >&5
9563 echo "${ECHO_T}no" >&6
9564                  LIBS="$cf_ncurses_SAVE"
9565 fi
9566 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9567 fi
9568
9569 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9570
9571 cat >>confdefs.h <<EOF
9572 #define $cf_nculib_ROOT 1
9573 EOF
9574
9575 fi
9576
9577         ;;
9578 pdcurses) #(vi
9579
9580 echo "$as_me:9580: checking if you want to use pkg-config" >&5
9581 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
9582
9583 # Check whether --with-pkg-config or --without-pkg-config was given.
9584 if test "${with_pkg_config+set}" = set; then
9585   withval="$with_pkg_config"
9586   cf_pkg_config=$withval
9587 else
9588   cf_pkg_config=yes
9589 fi;
9590 echo "$as_me:9590: result: $cf_pkg_config" >&5
9591 echo "${ECHO_T}$cf_pkg_config" >&6
9592
9593 case $cf_pkg_config in #(vi
9594 no) #(vi
9595         PKG_CONFIG=none
9596         ;;
9597 yes) #(vi
9598
9599 if test -n "$ac_tool_prefix"; then
9600   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
9601 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
9602 echo "$as_me:9602: checking for $ac_word" >&5
9603 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9604 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
9605   echo $ECHO_N "(cached) $ECHO_C" >&6
9606 else
9607   case $PKG_CONFIG in
9608   [\\/]* | ?:[\\/]*)
9609   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
9610   ;;
9611   *)
9612   ac_save_IFS=$IFS; IFS=$ac_path_separator
9613 ac_dummy="$PATH"
9614 for ac_dir in $ac_dummy; do
9615   IFS=$ac_save_IFS
9616   test -z "$ac_dir" && ac_dir=.
9617   if $as_executable_p "$ac_dir/$ac_word"; then
9618    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
9619    echo "$as_me:9619: found $ac_dir/$ac_word" >&5
9620    break
9621 fi
9622 done
9623
9624   ;;
9625 esac
9626 fi
9627 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
9628
9629 if test -n "$PKG_CONFIG"; then
9630   echo "$as_me:9630: result: $PKG_CONFIG" >&5
9631 echo "${ECHO_T}$PKG_CONFIG" >&6
9632 else
9633   echo "$as_me:9633: result: no" >&5
9634 echo "${ECHO_T}no" >&6
9635 fi
9636
9637 fi
9638 if test -z "$ac_cv_path_PKG_CONFIG"; then
9639   ac_pt_PKG_CONFIG=$PKG_CONFIG
9640   # Extract the first word of "pkg-config", so it can be a program name with args.
9641 set dummy pkg-config; ac_word=$2
9642 echo "$as_me:9642: checking for $ac_word" >&5
9643 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9644 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
9645   echo $ECHO_N "(cached) $ECHO_C" >&6
9646 else
9647   case $ac_pt_PKG_CONFIG in
9648   [\\/]* | ?:[\\/]*)
9649   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
9650   ;;
9651   *)
9652   ac_save_IFS=$IFS; IFS=$ac_path_separator
9653 ac_dummy="$PATH"
9654 for ac_dir in $ac_dummy; do
9655   IFS=$ac_save_IFS
9656   test -z "$ac_dir" && ac_dir=.
9657   if $as_executable_p "$ac_dir/$ac_word"; then
9658    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
9659    echo "$as_me:9659: found $ac_dir/$ac_word" >&5
9660    break
9661 fi
9662 done
9663
9664   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
9665   ;;
9666 esac
9667 fi
9668 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
9669
9670 if test -n "$ac_pt_PKG_CONFIG"; then
9671   echo "$as_me:9671: result: $ac_pt_PKG_CONFIG" >&5
9672 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
9673 else
9674   echo "$as_me:9674: result: no" >&5
9675 echo "${ECHO_T}no" >&6
9676 fi
9677
9678   PKG_CONFIG=$ac_pt_PKG_CONFIG
9679 else
9680   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
9681 fi
9682
9683         ;;
9684 *)
9685         PKG_CONFIG=$withval
9686         ;;
9687 esac
9688
9689 test -z "$PKG_CONFIG" && PKG_CONFIG=none
9690 if test "$PKG_CONFIG" != none ; then
9691
9692 if test "x$prefix" != xNONE; then
9693   cf_path_syntax="$prefix"
9694 else
9695   cf_path_syntax="$ac_default_prefix"
9696 fi
9697
9698 case ".$PKG_CONFIG" in #(vi
9699 .\$\(*\)*|.\'*\'*) #(vi
9700   ;;
9701 ..|./*|.\\*) #(vi
9702   ;;
9703 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
9704   ;;
9705 .\${*prefix}*) #(vi
9706   eval PKG_CONFIG="$PKG_CONFIG"
9707   case ".$PKG_CONFIG" in #(vi
9708   .NONE/*)
9709     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
9710     ;;
9711   esac
9712   ;; #(vi
9713 .no|.NONE/*)
9714   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
9715   ;;
9716 *)
9717   { { echo "$as_me:9717: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
9718 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
9719    { (exit 1); exit 1; }; }
9720   ;;
9721 esac
9722
9723 fi
9724
9725 echo "$as_me:9725: checking for X" >&5
9726 echo $ECHO_N "checking for X... $ECHO_C" >&6
9727
9728 # Check whether --with-x or --without-x was given.
9729 if test "${with_x+set}" = set; then
9730   withval="$with_x"
9731
9732 fi;
9733 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9734 if test "x$with_x" = xno; then
9735   # The user explicitly disabled X.
9736   have_x=disabled
9737 else
9738   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9739     # Both variables are already set.
9740     have_x=yes
9741   else
9742     if test "${ac_cv_have_x+set}" = set; then
9743   echo $ECHO_N "(cached) $ECHO_C" >&6
9744 else
9745   # One or both of the vars are not set, and there is no cached value.
9746 ac_x_includes=no ac_x_libraries=no
9747 rm -fr conftest.dir
9748 if mkdir conftest.dir; then
9749   cd conftest.dir
9750   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9751   cat >Imakefile <<'EOF'
9752 acfindx:
9753         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9754 EOF
9755   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9756     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9757     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9758     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9759     for ac_extension in a so sl dylib dll; do
9760       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9761          test -f $ac_im_libdir/libX11.$ac_extension; then
9762         ac_im_usrlibdir=$ac_im_libdir; break
9763       fi
9764     done
9765     # Screen out bogus values from the imake configuration.  They are
9766     # bogus both because they are the default anyway, and because
9767     # using them would break gcc on systems where it needs fixed includes.
9768     case $ac_im_incroot in
9769         /usr/include) ;;
9770         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9771     esac
9772     case $ac_im_usrlibdir in
9773         /usr/lib | /lib) ;;
9774         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9775     esac
9776   fi
9777   cd ..
9778   rm -fr conftest.dir
9779 fi
9780
9781 # Standard set of common directories for X headers.
9782 # Check X11 before X11Rn because it is often a symlink to the current release.
9783 ac_x_header_dirs='
9784 /usr/X11/include
9785 /usr/X11R6/include
9786 /usr/X11R5/include
9787 /usr/X11R4/include
9788
9789 /usr/include/X11
9790 /usr/include/X11R6
9791 /usr/include/X11R5
9792 /usr/include/X11R4
9793
9794 /usr/local/X11/include
9795 /usr/local/X11R6/include
9796 /usr/local/X11R5/include
9797 /usr/local/X11R4/include
9798
9799 /usr/local/include/X11
9800 /usr/local/include/X11R6
9801 /usr/local/include/X11R5
9802 /usr/local/include/X11R4
9803
9804 /usr/X386/include
9805 /usr/x386/include
9806 /usr/XFree86/include/X11
9807
9808 /usr/include
9809 /usr/local/include
9810 /usr/unsupported/include
9811 /usr/athena/include
9812 /usr/local/x11r5/include
9813 /usr/lpp/Xamples/include
9814
9815 /usr/openwin/include
9816 /usr/openwin/share/include'
9817
9818 if test "$ac_x_includes" = no; then
9819   # Guess where to find include files, by looking for Intrinsic.h.
9820   # First, try using that file with no special directory specified.
9821   cat >conftest.$ac_ext <<_ACEOF
9822 #line 9822 "configure"
9823 #include "confdefs.h"
9824 #include <X11/Intrinsic.h>
9825 _ACEOF
9826 if { (eval echo "$as_me:9826: \"$ac_cpp conftest.$ac_ext\"") >&5
9827   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9828   ac_status=$?
9829   egrep -v '^ *\+' conftest.er1 >conftest.err
9830   rm -f conftest.er1
9831   cat conftest.err >&5
9832   echo "$as_me:9832: \$? = $ac_status" >&5
9833   (exit $ac_status); } >/dev/null; then
9834   if test -s conftest.err; then
9835     ac_cpp_err=$ac_c_preproc_warn_flag
9836   else
9837     ac_cpp_err=
9838   fi
9839 else
9840   ac_cpp_err=yes
9841 fi
9842 if test -z "$ac_cpp_err"; then
9843   # We can compile using X headers with no special include directory.
9844 ac_x_includes=
9845 else
9846   echo "$as_me: failed program was:" >&5
9847   cat conftest.$ac_ext >&5
9848   for ac_dir in $ac_x_header_dirs; do
9849   if test -r "$ac_dir/X11/Intrinsic.h"; then
9850     ac_x_includes=$ac_dir
9851     break
9852   fi
9853 done
9854 fi
9855 rm -f conftest.err conftest.$ac_ext
9856 fi # $ac_x_includes = no
9857
9858 if test "$ac_x_libraries" = no; then
9859   # Check for the libraries.
9860   # See if we find them without any special options.
9861   # Don't add to $LIBS permanently.
9862   ac_save_LIBS=$LIBS
9863   LIBS="-lXt $LIBS"
9864   cat >conftest.$ac_ext <<_ACEOF
9865 #line 9865 "configure"
9866 #include "confdefs.h"
9867 #include <X11/Intrinsic.h>
9868 int
9869 main ()
9870 {
9871 XtMalloc (0)
9872   ;
9873   return 0;
9874 }
9875 _ACEOF
9876 rm -f conftest.$ac_objext conftest$ac_exeext
9877 if { (eval echo "$as_me:9877: \"$ac_link\"") >&5
9878   (eval $ac_link) 2>&5
9879   ac_status=$?
9880   echo "$as_me:9880: \$? = $ac_status" >&5
9881   (exit $ac_status); } &&
9882          { ac_try='test -s conftest$ac_exeext'
9883   { (eval echo "$as_me:9883: \"$ac_try\"") >&5
9884   (eval $ac_try) 2>&5
9885   ac_status=$?
9886   echo "$as_me:9886: \$? = $ac_status" >&5
9887   (exit $ac_status); }; }; then
9888   LIBS=$ac_save_LIBS
9889 # We can link X programs with no special library path.
9890 ac_x_libraries=
9891 else
9892   echo "$as_me: failed program was:" >&5
9893 cat conftest.$ac_ext >&5
9894 LIBS=$ac_save_LIBS
9895 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9896 do
9897   # Don't even attempt the hair of trying to link an X program!
9898   for ac_extension in a so sl dylib dll; do
9899     if test -r $ac_dir/libXt.$ac_extension; then
9900       ac_x_libraries=$ac_dir
9901       break 2
9902     fi
9903   done
9904 done
9905 fi
9906 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9907 fi # $ac_x_libraries = no
9908
9909 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9910   # Didn't find X anywhere.  Cache the known absence of X.
9911   ac_cv_have_x="have_x=no"
9912 else
9913   # Record where we found X for the cache.
9914   ac_cv_have_x="have_x=yes \
9915                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9916 fi
9917 fi
9918
9919   fi
9920   eval "$ac_cv_have_x"
9921 fi # $with_x != no
9922
9923 if test "$have_x" != yes; then
9924   echo "$as_me:9924: result: $have_x" >&5
9925 echo "${ECHO_T}$have_x" >&6
9926   no_x=yes
9927 else
9928   # If each of the values was on the command line, it overrides each guess.
9929   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9930   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9931   # Update the cache value to reflect the command line values.
9932   ac_cv_have_x="have_x=yes \
9933                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9934   echo "$as_me:9934: result: libraries $x_libraries, headers $x_includes" >&5
9935 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9936 fi
9937
9938 if test "$no_x" = yes; then
9939   # Not all programs may use this symbol, but it does not hurt to define it.
9940
9941 cat >>confdefs.h <<\EOF
9942 #define X_DISPLAY_MISSING 1
9943 EOF
9944
9945   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9946 else
9947   if test -n "$x_includes"; then
9948     X_CFLAGS="$X_CFLAGS -I$x_includes"
9949   fi
9950
9951   # It would also be nice to do this for all -L options, not just this one.
9952   if test -n "$x_libraries"; then
9953     X_LIBS="$X_LIBS -L$x_libraries"
9954     # For Solaris; some versions of Sun CC require a space after -R and
9955     # others require no space.  Words are not sufficient . . . .
9956     case `(uname -sr) 2>/dev/null` in
9957     "SunOS 5"*)
9958       echo "$as_me:9958: checking whether -R must be followed by a space" >&5
9959 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9960       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9961       cat >conftest.$ac_ext <<_ACEOF
9962 #line 9962 "configure"
9963 #include "confdefs.h"
9964
9965 int
9966 main ()
9967 {
9968
9969   ;
9970   return 0;
9971 }
9972 _ACEOF
9973 rm -f conftest.$ac_objext conftest$ac_exeext
9974 if { (eval echo "$as_me:9974: \"$ac_link\"") >&5
9975   (eval $ac_link) 2>&5
9976   ac_status=$?
9977   echo "$as_me:9977: \$? = $ac_status" >&5
9978   (exit $ac_status); } &&
9979          { ac_try='test -s conftest$ac_exeext'
9980   { (eval echo "$as_me:9980: \"$ac_try\"") >&5
9981   (eval $ac_try) 2>&5
9982   ac_status=$?
9983   echo "$as_me:9983: \$? = $ac_status" >&5
9984   (exit $ac_status); }; }; then
9985   ac_R_nospace=yes
9986 else
9987   echo "$as_me: failed program was:" >&5
9988 cat conftest.$ac_ext >&5
9989 ac_R_nospace=no
9990 fi
9991 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9992       if test $ac_R_nospace = yes; then
9993         echo "$as_me:9993: result: no" >&5
9994 echo "${ECHO_T}no" >&6
9995         X_LIBS="$X_LIBS -R$x_libraries"
9996       else
9997         LIBS="$ac_xsave_LIBS -R $x_libraries"
9998         cat >conftest.$ac_ext <<_ACEOF
9999 #line 9999 "configure"
10000 #include "confdefs.h"
10001
10002 int
10003 main ()
10004 {
10005
10006   ;
10007   return 0;
10008 }
10009 _ACEOF
10010 rm -f conftest.$ac_objext conftest$ac_exeext
10011 if { (eval echo "$as_me:10011: \"$ac_link\"") >&5
10012   (eval $ac_link) 2>&5
10013   ac_status=$?
10014   echo "$as_me:10014: \$? = $ac_status" >&5
10015   (exit $ac_status); } &&
10016          { ac_try='test -s conftest$ac_exeext'
10017   { (eval echo "$as_me:10017: \"$ac_try\"") >&5
10018   (eval $ac_try) 2>&5
10019   ac_status=$?
10020   echo "$as_me:10020: \$? = $ac_status" >&5
10021   (exit $ac_status); }; }; then
10022   ac_R_space=yes
10023 else
10024   echo "$as_me: failed program was:" >&5
10025 cat conftest.$ac_ext >&5
10026 ac_R_space=no
10027 fi
10028 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10029         if test $ac_R_space = yes; then
10030           echo "$as_me:10030: result: yes" >&5
10031 echo "${ECHO_T}yes" >&6
10032           X_LIBS="$X_LIBS -R $x_libraries"
10033         else
10034           echo "$as_me:10034: result: neither works" >&5
10035 echo "${ECHO_T}neither works" >&6
10036         fi
10037       fi
10038       LIBS=$ac_xsave_LIBS
10039     esac
10040   fi
10041
10042   # Check for system-dependent libraries X programs must link with.
10043   # Do this before checking for the system-independent R6 libraries
10044   # (-lICE), since we may need -lsocket or whatever for X linking.
10045
10046   if test "$ISC" = yes; then
10047     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10048   else
10049     # Martyn Johnson says this is needed for Ultrix, if the X
10050     # libraries were built with DECnet support.  And Karl Berry says
10051     # the Alpha needs dnet_stub (dnet does not exist).
10052     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10053     cat >conftest.$ac_ext <<_ACEOF
10054 #line 10054 "configure"
10055 #include "confdefs.h"
10056
10057 /* Override any gcc2 internal prototype to avoid an error.  */
10058 #ifdef __cplusplus
10059 extern "C"
10060 #endif
10061 /* We use char because int might match the return type of a gcc2
10062    builtin and then its argument prototype would still apply.  */
10063 char XOpenDisplay ();
10064 int
10065 main ()
10066 {
10067 XOpenDisplay ();
10068   ;
10069   return 0;
10070 }
10071 _ACEOF
10072 rm -f conftest.$ac_objext conftest$ac_exeext
10073 if { (eval echo "$as_me:10073: \"$ac_link\"") >&5
10074   (eval $ac_link) 2>&5
10075   ac_status=$?
10076   echo "$as_me:10076: \$? = $ac_status" >&5
10077   (exit $ac_status); } &&
10078          { ac_try='test -s conftest$ac_exeext'
10079   { (eval echo "$as_me:10079: \"$ac_try\"") >&5
10080   (eval $ac_try) 2>&5
10081   ac_status=$?
10082   echo "$as_me:10082: \$? = $ac_status" >&5
10083   (exit $ac_status); }; }; then
10084   :
10085 else
10086   echo "$as_me: failed program was:" >&5
10087 cat conftest.$ac_ext >&5
10088 echo "$as_me:10088: checking for dnet_ntoa in -ldnet" >&5
10089 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10090 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10091   echo $ECHO_N "(cached) $ECHO_C" >&6
10092 else
10093   ac_check_lib_save_LIBS=$LIBS
10094 LIBS="-ldnet  $LIBS"
10095 cat >conftest.$ac_ext <<_ACEOF
10096 #line 10096 "configure"
10097 #include "confdefs.h"
10098
10099 /* Override any gcc2 internal prototype to avoid an error.  */
10100 #ifdef __cplusplus
10101 extern "C"
10102 #endif
10103 /* We use char because int might match the return type of a gcc2
10104    builtin and then its argument prototype would still apply.  */
10105 char dnet_ntoa ();
10106 int
10107 main ()
10108 {
10109 dnet_ntoa ();
10110   ;
10111   return 0;
10112 }
10113 _ACEOF
10114 rm -f conftest.$ac_objext conftest$ac_exeext
10115 if { (eval echo "$as_me:10115: \"$ac_link\"") >&5
10116   (eval $ac_link) 2>&5
10117   ac_status=$?
10118   echo "$as_me:10118: \$? = $ac_status" >&5
10119   (exit $ac_status); } &&
10120          { ac_try='test -s conftest$ac_exeext'
10121   { (eval echo "$as_me:10121: \"$ac_try\"") >&5
10122   (eval $ac_try) 2>&5
10123   ac_status=$?
10124   echo "$as_me:10124: \$? = $ac_status" >&5
10125   (exit $ac_status); }; }; then
10126   ac_cv_lib_dnet_dnet_ntoa=yes
10127 else
10128   echo "$as_me: failed program was:" >&5
10129 cat conftest.$ac_ext >&5
10130 ac_cv_lib_dnet_dnet_ntoa=no
10131 fi
10132 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10133 LIBS=$ac_check_lib_save_LIBS
10134 fi
10135 echo "$as_me:10135: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10136 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10137 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10138   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10139 fi
10140
10141     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10142       echo "$as_me:10142: checking for dnet_ntoa in -ldnet_stub" >&5
10143 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10144 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10145   echo $ECHO_N "(cached) $ECHO_C" >&6
10146 else
10147   ac_check_lib_save_LIBS=$LIBS
10148 LIBS="-ldnet_stub  $LIBS"
10149 cat >conftest.$ac_ext <<_ACEOF
10150 #line 10150 "configure"
10151 #include "confdefs.h"
10152
10153 /* Override any gcc2 internal prototype to avoid an error.  */
10154 #ifdef __cplusplus
10155 extern "C"
10156 #endif
10157 /* We use char because int might match the return type of a gcc2
10158    builtin and then its argument prototype would still apply.  */
10159 char dnet_ntoa ();
10160 int
10161 main ()
10162 {
10163 dnet_ntoa ();
10164   ;
10165   return 0;
10166 }
10167 _ACEOF
10168 rm -f conftest.$ac_objext conftest$ac_exeext
10169 if { (eval echo "$as_me:10169: \"$ac_link\"") >&5
10170   (eval $ac_link) 2>&5
10171   ac_status=$?
10172   echo "$as_me:10172: \$? = $ac_status" >&5
10173   (exit $ac_status); } &&
10174          { ac_try='test -s conftest$ac_exeext'
10175   { (eval echo "$as_me:10175: \"$ac_try\"") >&5
10176   (eval $ac_try) 2>&5
10177   ac_status=$?
10178   echo "$as_me:10178: \$? = $ac_status" >&5
10179   (exit $ac_status); }; }; then
10180   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10181 else
10182   echo "$as_me: failed program was:" >&5
10183 cat conftest.$ac_ext >&5
10184 ac_cv_lib_dnet_stub_dnet_ntoa=no
10185 fi
10186 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10187 LIBS=$ac_check_lib_save_LIBS
10188 fi
10189 echo "$as_me:10189: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10190 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10191 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10192   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10193 fi
10194
10195     fi
10196 fi
10197 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10198     LIBS="$ac_xsave_LIBS"
10199
10200     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10201     # to get the SysV transport functions.
10202     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10203     # needs -lnsl.
10204     # The nsl library prevents programs from opening the X display
10205     # on Irix 5.2, according to T.E. Dickey.
10206     # The functions gethostbyname, getservbyname, and inet_addr are
10207     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10208     echo "$as_me:10208: checking for gethostbyname" >&5
10209 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10210 if test "${ac_cv_func_gethostbyname+set}" = set; then
10211   echo $ECHO_N "(cached) $ECHO_C" >&6
10212 else
10213   cat >conftest.$ac_ext <<_ACEOF
10214 #line 10214 "configure"
10215 #include "confdefs.h"
10216 /* System header to define __stub macros and hopefully few prototypes,
10217     which can conflict with char gethostbyname (); below.  */
10218 #include <assert.h>
10219 /* Override any gcc2 internal prototype to avoid an error.  */
10220 #ifdef __cplusplus
10221 extern "C"
10222 #endif
10223 /* We use char because int might match the return type of a gcc2
10224    builtin and then its argument prototype would still apply.  */
10225 char gethostbyname ();
10226 char (*f) ();
10227
10228 int
10229 main ()
10230 {
10231 /* The GNU C library defines this for functions which it implements
10232     to always fail with ENOSYS.  Some functions are actually named
10233     something starting with __ and the normal name is an alias.  */
10234 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10235 choke me
10236 #else
10237 f = gethostbyname;
10238 #endif
10239
10240   ;
10241   return 0;
10242 }
10243 _ACEOF
10244 rm -f conftest.$ac_objext conftest$ac_exeext
10245 if { (eval echo "$as_me:10245: \"$ac_link\"") >&5
10246   (eval $ac_link) 2>&5
10247   ac_status=$?
10248   echo "$as_me:10248: \$? = $ac_status" >&5
10249   (exit $ac_status); } &&
10250          { ac_try='test -s conftest$ac_exeext'
10251   { (eval echo "$as_me:10251: \"$ac_try\"") >&5
10252   (eval $ac_try) 2>&5
10253   ac_status=$?
10254   echo "$as_me:10254: \$? = $ac_status" >&5
10255   (exit $ac_status); }; }; then
10256   ac_cv_func_gethostbyname=yes
10257 else
10258   echo "$as_me: failed program was:" >&5
10259 cat conftest.$ac_ext >&5
10260 ac_cv_func_gethostbyname=no
10261 fi
10262 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10263 fi
10264 echo "$as_me:10264: result: $ac_cv_func_gethostbyname" >&5
10265 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10266
10267     if test $ac_cv_func_gethostbyname = no; then
10268       echo "$as_me:10268: checking for gethostbyname in -lnsl" >&5
10269 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10270 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10271   echo $ECHO_N "(cached) $ECHO_C" >&6
10272 else
10273   ac_check_lib_save_LIBS=$LIBS
10274 LIBS="-lnsl  $LIBS"
10275 cat >conftest.$ac_ext <<_ACEOF
10276 #line 10276 "configure"
10277 #include "confdefs.h"
10278
10279 /* Override any gcc2 internal prototype to avoid an error.  */
10280 #ifdef __cplusplus
10281 extern "C"
10282 #endif
10283 /* We use char because int might match the return type of a gcc2
10284    builtin and then its argument prototype would still apply.  */
10285 char gethostbyname ();
10286 int
10287 main ()
10288 {
10289 gethostbyname ();
10290   ;
10291   return 0;
10292 }
10293 _ACEOF
10294 rm -f conftest.$ac_objext conftest$ac_exeext
10295 if { (eval echo "$as_me:10295: \"$ac_link\"") >&5
10296   (eval $ac_link) 2>&5
10297   ac_status=$?
10298   echo "$as_me:10298: \$? = $ac_status" >&5
10299   (exit $ac_status); } &&
10300          { ac_try='test -s conftest$ac_exeext'
10301   { (eval echo "$as_me:10301: \"$ac_try\"") >&5
10302   (eval $ac_try) 2>&5
10303   ac_status=$?
10304   echo "$as_me:10304: \$? = $ac_status" >&5
10305   (exit $ac_status); }; }; then
10306   ac_cv_lib_nsl_gethostbyname=yes
10307 else
10308   echo "$as_me: failed program was:" >&5
10309 cat conftest.$ac_ext >&5
10310 ac_cv_lib_nsl_gethostbyname=no
10311 fi
10312 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10313 LIBS=$ac_check_lib_save_LIBS
10314 fi
10315 echo "$as_me:10315: result: $ac_cv_lib_nsl_gethostbyname" >&5
10316 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10317 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10318   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10319 fi
10320
10321       if test $ac_cv_lib_nsl_gethostbyname = no; then
10322         echo "$as_me:10322: checking for gethostbyname in -lbsd" >&5
10323 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10324 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10325   echo $ECHO_N "(cached) $ECHO_C" >&6
10326 else
10327   ac_check_lib_save_LIBS=$LIBS
10328 LIBS="-lbsd  $LIBS"
10329 cat >conftest.$ac_ext <<_ACEOF
10330 #line 10330 "configure"
10331 #include "confdefs.h"
10332
10333 /* Override any gcc2 internal prototype to avoid an error.  */
10334 #ifdef __cplusplus
10335 extern "C"
10336 #endif
10337 /* We use char because int might match the return type of a gcc2
10338    builtin and then its argument prototype would still apply.  */
10339 char gethostbyname ();
10340 int
10341 main ()
10342 {
10343 gethostbyname ();
10344   ;
10345   return 0;
10346 }
10347 _ACEOF
10348 rm -f conftest.$ac_objext conftest$ac_exeext
10349 if { (eval echo "$as_me:10349: \"$ac_link\"") >&5
10350   (eval $ac_link) 2>&5
10351   ac_status=$?
10352   echo "$as_me:10352: \$? = $ac_status" >&5
10353   (exit $ac_status); } &&
10354          { ac_try='test -s conftest$ac_exeext'
10355   { (eval echo "$as_me:10355: \"$ac_try\"") >&5
10356   (eval $ac_try) 2>&5
10357   ac_status=$?
10358   echo "$as_me:10358: \$? = $ac_status" >&5
10359   (exit $ac_status); }; }; then
10360   ac_cv_lib_bsd_gethostbyname=yes
10361 else
10362   echo "$as_me: failed program was:" >&5
10363 cat conftest.$ac_ext >&5
10364 ac_cv_lib_bsd_gethostbyname=no
10365 fi
10366 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10367 LIBS=$ac_check_lib_save_LIBS
10368 fi
10369 echo "$as_me:10369: result: $ac_cv_lib_bsd_gethostbyname" >&5
10370 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10371 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10372   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10373 fi
10374
10375       fi
10376     fi
10377
10378     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10379     # socket/setsockopt and other routines are undefined under SCO ODT
10380     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10381     # on later versions), says Simon Leinen: it contains gethostby*
10382     # variants that don't use the nameserver (or something).  -lsocket
10383     # must be given before -lnsl if both are needed.  We assume that
10384     # if connect needs -lnsl, so does gethostbyname.
10385     echo "$as_me:10385: checking for connect" >&5
10386 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10387 if test "${ac_cv_func_connect+set}" = set; then
10388   echo $ECHO_N "(cached) $ECHO_C" >&6
10389 else
10390   cat >conftest.$ac_ext <<_ACEOF
10391 #line 10391 "configure"
10392 #include "confdefs.h"
10393 /* System header to define __stub macros and hopefully few prototypes,
10394     which can conflict with char connect (); below.  */
10395 #include <assert.h>
10396 /* Override any gcc2 internal prototype to avoid an error.  */
10397 #ifdef __cplusplus
10398 extern "C"
10399 #endif
10400 /* We use char because int might match the return type of a gcc2
10401    builtin and then its argument prototype would still apply.  */
10402 char connect ();
10403 char (*f) ();
10404
10405 int
10406 main ()
10407 {
10408 /* The GNU C library defines this for functions which it implements
10409     to always fail with ENOSYS.  Some functions are actually named
10410     something starting with __ and the normal name is an alias.  */
10411 #if defined (__stub_connect) || defined (__stub___connect)
10412 choke me
10413 #else
10414 f = connect;
10415 #endif
10416
10417   ;
10418   return 0;
10419 }
10420 _ACEOF
10421 rm -f conftest.$ac_objext conftest$ac_exeext
10422 if { (eval echo "$as_me:10422: \"$ac_link\"") >&5
10423   (eval $ac_link) 2>&5
10424   ac_status=$?
10425   echo "$as_me:10425: \$? = $ac_status" >&5
10426   (exit $ac_status); } &&
10427          { ac_try='test -s conftest$ac_exeext'
10428   { (eval echo "$as_me:10428: \"$ac_try\"") >&5
10429   (eval $ac_try) 2>&5
10430   ac_status=$?
10431   echo "$as_me:10431: \$? = $ac_status" >&5
10432   (exit $ac_status); }; }; then
10433   ac_cv_func_connect=yes
10434 else
10435   echo "$as_me: failed program was:" >&5
10436 cat conftest.$ac_ext >&5
10437 ac_cv_func_connect=no
10438 fi
10439 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10440 fi
10441 echo "$as_me:10441: result: $ac_cv_func_connect" >&5
10442 echo "${ECHO_T}$ac_cv_func_connect" >&6
10443
10444     if test $ac_cv_func_connect = no; then
10445       echo "$as_me:10445: checking for connect in -lsocket" >&5
10446 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10447 if test "${ac_cv_lib_socket_connect+set}" = set; then
10448   echo $ECHO_N "(cached) $ECHO_C" >&6
10449 else
10450   ac_check_lib_save_LIBS=$LIBS
10451 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10452 cat >conftest.$ac_ext <<_ACEOF
10453 #line 10453 "configure"
10454 #include "confdefs.h"
10455
10456 /* Override any gcc2 internal prototype to avoid an error.  */
10457 #ifdef __cplusplus
10458 extern "C"
10459 #endif
10460 /* We use char because int might match the return type of a gcc2
10461    builtin and then its argument prototype would still apply.  */
10462 char connect ();
10463 int
10464 main ()
10465 {
10466 connect ();
10467   ;
10468   return 0;
10469 }
10470 _ACEOF
10471 rm -f conftest.$ac_objext conftest$ac_exeext
10472 if { (eval echo "$as_me:10472: \"$ac_link\"") >&5
10473   (eval $ac_link) 2>&5
10474   ac_status=$?
10475   echo "$as_me:10475: \$? = $ac_status" >&5
10476   (exit $ac_status); } &&
10477          { ac_try='test -s conftest$ac_exeext'
10478   { (eval echo "$as_me:10478: \"$ac_try\"") >&5
10479   (eval $ac_try) 2>&5
10480   ac_status=$?
10481   echo "$as_me:10481: \$? = $ac_status" >&5
10482   (exit $ac_status); }; }; then
10483   ac_cv_lib_socket_connect=yes
10484 else
10485   echo "$as_me: failed program was:" >&5
10486 cat conftest.$ac_ext >&5
10487 ac_cv_lib_socket_connect=no
10488 fi
10489 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10490 LIBS=$ac_check_lib_save_LIBS
10491 fi
10492 echo "$as_me:10492: result: $ac_cv_lib_socket_connect" >&5
10493 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10494 if test $ac_cv_lib_socket_connect = yes; then
10495   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10496 fi
10497
10498     fi
10499
10500     # Guillermo Gomez says -lposix is necessary on A/UX.
10501     echo "$as_me:10501: checking for remove" >&5
10502 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10503 if test "${ac_cv_func_remove+set}" = set; then
10504   echo $ECHO_N "(cached) $ECHO_C" >&6
10505 else
10506   cat >conftest.$ac_ext <<_ACEOF
10507 #line 10507 "configure"
10508 #include "confdefs.h"
10509 /* System header to define __stub macros and hopefully few prototypes,
10510     which can conflict with char remove (); below.  */
10511 #include <assert.h>
10512 /* Override any gcc2 internal prototype to avoid an error.  */
10513 #ifdef __cplusplus
10514 extern "C"
10515 #endif
10516 /* We use char because int might match the return type of a gcc2
10517    builtin and then its argument prototype would still apply.  */
10518 char remove ();
10519 char (*f) ();
10520
10521 int
10522 main ()
10523 {
10524 /* The GNU C library defines this for functions which it implements
10525     to always fail with ENOSYS.  Some functions are actually named
10526     something starting with __ and the normal name is an alias.  */
10527 #if defined (__stub_remove) || defined (__stub___remove)
10528 choke me
10529 #else
10530 f = remove;
10531 #endif
10532
10533   ;
10534   return 0;
10535 }
10536 _ACEOF
10537 rm -f conftest.$ac_objext conftest$ac_exeext
10538 if { (eval echo "$as_me:10538: \"$ac_link\"") >&5
10539   (eval $ac_link) 2>&5
10540   ac_status=$?
10541   echo "$as_me:10541: \$? = $ac_status" >&5
10542   (exit $ac_status); } &&
10543          { ac_try='test -s conftest$ac_exeext'
10544   { (eval echo "$as_me:10544: \"$ac_try\"") >&5
10545   (eval $ac_try) 2>&5
10546   ac_status=$?
10547   echo "$as_me:10547: \$? = $ac_status" >&5
10548   (exit $ac_status); }; }; then
10549   ac_cv_func_remove=yes
10550 else
10551   echo "$as_me: failed program was:" >&5
10552 cat conftest.$ac_ext >&5
10553 ac_cv_func_remove=no
10554 fi
10555 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10556 fi
10557 echo "$as_me:10557: result: $ac_cv_func_remove" >&5
10558 echo "${ECHO_T}$ac_cv_func_remove" >&6
10559
10560     if test $ac_cv_func_remove = no; then
10561       echo "$as_me:10561: checking for remove in -lposix" >&5
10562 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10563 if test "${ac_cv_lib_posix_remove+set}" = set; then
10564   echo $ECHO_N "(cached) $ECHO_C" >&6
10565 else
10566   ac_check_lib_save_LIBS=$LIBS
10567 LIBS="-lposix  $LIBS"
10568 cat >conftest.$ac_ext <<_ACEOF
10569 #line 10569 "configure"
10570 #include "confdefs.h"
10571
10572 /* Override any gcc2 internal prototype to avoid an error.  */
10573 #ifdef __cplusplus
10574 extern "C"
10575 #endif
10576 /* We use char because int might match the return type of a gcc2
10577    builtin and then its argument prototype would still apply.  */
10578 char remove ();
10579 int
10580 main ()
10581 {
10582 remove ();
10583   ;
10584   return 0;
10585 }
10586 _ACEOF
10587 rm -f conftest.$ac_objext conftest$ac_exeext
10588 if { (eval echo "$as_me:10588: \"$ac_link\"") >&5
10589   (eval $ac_link) 2>&5
10590   ac_status=$?
10591   echo "$as_me:10591: \$? = $ac_status" >&5
10592   (exit $ac_status); } &&
10593          { ac_try='test -s conftest$ac_exeext'
10594   { (eval echo "$as_me:10594: \"$ac_try\"") >&5
10595   (eval $ac_try) 2>&5
10596   ac_status=$?
10597   echo "$as_me:10597: \$? = $ac_status" >&5
10598   (exit $ac_status); }; }; then
10599   ac_cv_lib_posix_remove=yes
10600 else
10601   echo "$as_me: failed program was:" >&5
10602 cat conftest.$ac_ext >&5
10603 ac_cv_lib_posix_remove=no
10604 fi
10605 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10606 LIBS=$ac_check_lib_save_LIBS
10607 fi
10608 echo "$as_me:10608: result: $ac_cv_lib_posix_remove" >&5
10609 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10610 if test $ac_cv_lib_posix_remove = yes; then
10611   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10612 fi
10613
10614     fi
10615
10616     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10617     echo "$as_me:10617: checking for shmat" >&5
10618 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10619 if test "${ac_cv_func_shmat+set}" = set; then
10620   echo $ECHO_N "(cached) $ECHO_C" >&6
10621 else
10622   cat >conftest.$ac_ext <<_ACEOF
10623 #line 10623 "configure"
10624 #include "confdefs.h"
10625 /* System header to define __stub macros and hopefully few prototypes,
10626     which can conflict with char shmat (); below.  */
10627 #include <assert.h>
10628 /* Override any gcc2 internal prototype to avoid an error.  */
10629 #ifdef __cplusplus
10630 extern "C"
10631 #endif
10632 /* We use char because int might match the return type of a gcc2
10633    builtin and then its argument prototype would still apply.  */
10634 char shmat ();
10635 char (*f) ();
10636
10637 int
10638 main ()
10639 {
10640 /* The GNU C library defines this for functions which it implements
10641     to always fail with ENOSYS.  Some functions are actually named
10642     something starting with __ and the normal name is an alias.  */
10643 #if defined (__stub_shmat) || defined (__stub___shmat)
10644 choke me
10645 #else
10646 f = shmat;
10647 #endif
10648
10649   ;
10650   return 0;
10651 }
10652 _ACEOF
10653 rm -f conftest.$ac_objext conftest$ac_exeext
10654 if { (eval echo "$as_me:10654: \"$ac_link\"") >&5
10655   (eval $ac_link) 2>&5
10656   ac_status=$?
10657   echo "$as_me:10657: \$? = $ac_status" >&5
10658   (exit $ac_status); } &&
10659          { ac_try='test -s conftest$ac_exeext'
10660   { (eval echo "$as_me:10660: \"$ac_try\"") >&5
10661   (eval $ac_try) 2>&5
10662   ac_status=$?
10663   echo "$as_me:10663: \$? = $ac_status" >&5
10664   (exit $ac_status); }; }; then
10665   ac_cv_func_shmat=yes
10666 else
10667   echo "$as_me: failed program was:" >&5
10668 cat conftest.$ac_ext >&5
10669 ac_cv_func_shmat=no
10670 fi
10671 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10672 fi
10673 echo "$as_me:10673: result: $ac_cv_func_shmat" >&5
10674 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10675
10676     if test $ac_cv_func_shmat = no; then
10677       echo "$as_me:10677: checking for shmat in -lipc" >&5
10678 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10679 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10680   echo $ECHO_N "(cached) $ECHO_C" >&6
10681 else
10682   ac_check_lib_save_LIBS=$LIBS
10683 LIBS="-lipc  $LIBS"
10684 cat >conftest.$ac_ext <<_ACEOF
10685 #line 10685 "configure"
10686 #include "confdefs.h"
10687
10688 /* Override any gcc2 internal prototype to avoid an error.  */
10689 #ifdef __cplusplus
10690 extern "C"
10691 #endif
10692 /* We use char because int might match the return type of a gcc2
10693    builtin and then its argument prototype would still apply.  */
10694 char shmat ();
10695 int
10696 main ()
10697 {
10698 shmat ();
10699   ;
10700   return 0;
10701 }
10702 _ACEOF
10703 rm -f conftest.$ac_objext conftest$ac_exeext
10704 if { (eval echo "$as_me:10704: \"$ac_link\"") >&5
10705   (eval $ac_link) 2>&5
10706   ac_status=$?
10707   echo "$as_me:10707: \$? = $ac_status" >&5
10708   (exit $ac_status); } &&
10709          { ac_try='test -s conftest$ac_exeext'
10710   { (eval echo "$as_me:10710: \"$ac_try\"") >&5
10711   (eval $ac_try) 2>&5
10712   ac_status=$?
10713   echo "$as_me:10713: \$? = $ac_status" >&5
10714   (exit $ac_status); }; }; then
10715   ac_cv_lib_ipc_shmat=yes
10716 else
10717   echo "$as_me: failed program was:" >&5
10718 cat conftest.$ac_ext >&5
10719 ac_cv_lib_ipc_shmat=no
10720 fi
10721 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10722 LIBS=$ac_check_lib_save_LIBS
10723 fi
10724 echo "$as_me:10724: result: $ac_cv_lib_ipc_shmat" >&5
10725 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10726 if test $ac_cv_lib_ipc_shmat = yes; then
10727   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10728 fi
10729
10730     fi
10731   fi
10732
10733   # Check for libraries that X11R6 Xt/Xaw programs need.
10734   ac_save_LDFLAGS=$LDFLAGS
10735   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10736   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10737   # check for ICE first), but we must link in the order -lSM -lICE or
10738   # we get undefined symbols.  So assume we have SM if we have ICE.
10739   # These have to be linked with before -lX11, unlike the other
10740   # libraries we check for below, so use a different variable.
10741   # John Interrante, Karl Berry
10742   echo "$as_me:10742: checking for IceConnectionNumber in -lICE" >&5
10743 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10744 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10745   echo $ECHO_N "(cached) $ECHO_C" >&6
10746 else
10747   ac_check_lib_save_LIBS=$LIBS
10748 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10749 cat >conftest.$ac_ext <<_ACEOF
10750 #line 10750 "configure"
10751 #include "confdefs.h"
10752
10753 /* Override any gcc2 internal prototype to avoid an error.  */
10754 #ifdef __cplusplus
10755 extern "C"
10756 #endif
10757 /* We use char because int might match the return type of a gcc2
10758    builtin and then its argument prototype would still apply.  */
10759 char IceConnectionNumber ();
10760 int
10761 main ()
10762 {
10763 IceConnectionNumber ();
10764   ;
10765   return 0;
10766 }
10767 _ACEOF
10768 rm -f conftest.$ac_objext conftest$ac_exeext
10769 if { (eval echo "$as_me:10769: \"$ac_link\"") >&5
10770   (eval $ac_link) 2>&5
10771   ac_status=$?
10772   echo "$as_me:10772: \$? = $ac_status" >&5
10773   (exit $ac_status); } &&
10774          { ac_try='test -s conftest$ac_exeext'
10775   { (eval echo "$as_me:10775: \"$ac_try\"") >&5
10776   (eval $ac_try) 2>&5
10777   ac_status=$?
10778   echo "$as_me:10778: \$? = $ac_status" >&5
10779   (exit $ac_status); }; }; then
10780   ac_cv_lib_ICE_IceConnectionNumber=yes
10781 else
10782   echo "$as_me: failed program was:" >&5
10783 cat conftest.$ac_ext >&5
10784 ac_cv_lib_ICE_IceConnectionNumber=no
10785 fi
10786 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10787 LIBS=$ac_check_lib_save_LIBS
10788 fi
10789 echo "$as_me:10789: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10790 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10791 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10792   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10793 fi
10794
10795   LDFLAGS=$ac_save_LDFLAGS
10796
10797 fi
10798
10799 cf_x_athena=${cf_x_athena:-Xaw}
10800
10801 echo "$as_me:10801: checking if you want to link with Xaw 3d library" >&5
10802 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10803 withval=
10804
10805 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10806 if test "${with_Xaw3d+set}" = set; then
10807   withval="$with_Xaw3d"
10808
10809 fi;
10810 if test "$withval" = yes ; then
10811         cf_x_athena=Xaw3d
10812         echo "$as_me:10812: result: yes" >&5
10813 echo "${ECHO_T}yes" >&6
10814 else
10815         echo "$as_me:10815: result: no" >&5
10816 echo "${ECHO_T}no" >&6
10817 fi
10818
10819 echo "$as_me:10819: checking if you want to link with neXT Athena library" >&5
10820 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10821 withval=
10822
10823 # Check whether --with-neXtaw or --without-neXtaw was given.
10824 if test "${with_neXtaw+set}" = set; then
10825   withval="$with_neXtaw"
10826
10827 fi;
10828 if test "$withval" = yes ; then
10829         cf_x_athena=neXtaw
10830         echo "$as_me:10830: result: yes" >&5
10831 echo "${ECHO_T}yes" >&6
10832 else
10833         echo "$as_me:10833: result: no" >&5
10834 echo "${ECHO_T}no" >&6
10835 fi
10836
10837 echo "$as_me:10837: checking if you want to link with Athena-Plus library" >&5
10838 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10839 withval=
10840
10841 # Check whether --with-XawPlus or --without-XawPlus was given.
10842 if test "${with_XawPlus+set}" = set; then
10843   withval="$with_XawPlus"
10844
10845 fi;
10846 if test "$withval" = yes ; then
10847         cf_x_athena=XawPlus
10848         echo "$as_me:10848: result: yes" >&5
10849 echo "${ECHO_T}yes" >&6
10850 else
10851         echo "$as_me:10851: result: no" >&5
10852 echo "${ECHO_T}no" >&6
10853 fi
10854
10855 cf_x_athena_lib=""
10856
10857 if test "$PKG_CONFIG" != none ; then
10858         cf_athena_list=
10859         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10860         for cf_athena_pkg in \
10861                 $cf_athena_list \
10862                 ${cf_x_athena} \
10863                 ${cf_x_athena}-devel \
10864                 lib${cf_x_athena} \
10865                 lib${cf_x_athena}-devel
10866         do
10867
10868 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10869         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10870
10871 echo "${as_me:-configure}:10871: testing found package $cf_athena_pkg ..." 1>&5
10872
10873         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10874         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10875         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10876
10877 echo "${as_me:-configure}:10877: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10878
10879         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10880
10881 echo "${as_me:-configure}:10881: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10882
10883 cf_fix_cppflags=no
10884 cf_new_cflags=
10885 cf_new_cppflags=
10886 cf_new_extra_cppflags=
10887
10888 for cf_add_cflags in $cf_pkgconfig_incs
10889 do
10890 case $cf_fix_cppflags in
10891 no)
10892         case $cf_add_cflags in #(vi
10893         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10894                 case $cf_add_cflags in
10895                 -D*)
10896                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10897
10898                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10899                                 && test -z "${cf_tst_cflags}" \
10900                                 && cf_fix_cppflags=yes
10901
10902                         if test $cf_fix_cppflags = yes ; then
10903                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10904                                 continue
10905                         elif test "${cf_tst_cflags}" = "\"'" ; then
10906                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10907                                 continue
10908                         fi
10909                         ;;
10910                 esac
10911                 case "$CPPFLAGS" in
10912                 *$cf_add_cflags) #(vi
10913                         ;;
10914                 *) #(vi
10915                         case $cf_add_cflags in #(vi
10916                         -D*)
10917                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10918
10919 CPPFLAGS=`echo "$CPPFLAGS" | \
10920         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10921                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10922
10923                                 ;;
10924                         esac
10925                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10926                         ;;
10927                 esac
10928                 ;;
10929         *)
10930                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10931                 ;;
10932         esac
10933         ;;
10934 yes)
10935         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10936
10937         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10938
10939         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10940                 && test -z "${cf_tst_cflags}" \
10941                 && cf_fix_cppflags=no
10942         ;;
10943 esac
10944 done
10945
10946 if test -n "$cf_new_cflags" ; then
10947
10948         CFLAGS="$CFLAGS $cf_new_cflags"
10949 fi
10950
10951 if test -n "$cf_new_cppflags" ; then
10952
10953         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10954 fi
10955
10956 if test -n "$cf_new_extra_cppflags" ; then
10957
10958         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10959 fi
10960
10961         LIBS="$cf_pkgconfig_libs $LIBS"
10962
10963                         cf_x_athena_lib="$cf_pkgconfig_libs"
10964
10965 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10966
10967                         cat >>confdefs.h <<EOF
10968 #define $cf_x_athena_LIBS 1
10969 EOF
10970
10971 echo "$as_me:10971: checking for usable $cf_x_athena/Xmu package" >&5
10972 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10973 if test "${cf_cv_xaw_compat+set}" = set; then
10974   echo $ECHO_N "(cached) $ECHO_C" >&6
10975 else
10976
10977 cat >conftest.$ac_ext <<_ACEOF
10978 #line 10978 "configure"
10979 #include "confdefs.h"
10980
10981 #include <X11/Xmu/CharSet.h>
10982
10983 int
10984 main ()
10985 {
10986
10987 int check = XmuCompareISOLatin1("big", "small")
10988
10989   ;
10990   return 0;
10991 }
10992 _ACEOF
10993 rm -f conftest.$ac_objext conftest$ac_exeext
10994 if { (eval echo "$as_me:10994: \"$ac_link\"") >&5
10995   (eval $ac_link) 2>&5
10996   ac_status=$?
10997   echo "$as_me:10997: \$? = $ac_status" >&5
10998   (exit $ac_status); } &&
10999          { ac_try='test -s conftest$ac_exeext'
11000   { (eval echo "$as_me:11000: \"$ac_try\"") >&5
11001   (eval $ac_try) 2>&5
11002   ac_status=$?
11003   echo "$as_me:11003: \$? = $ac_status" >&5
11004   (exit $ac_status); }; }; then
11005   cf_cv_xaw_compat=yes
11006 else
11007   echo "$as_me: failed program was:" >&5
11008 cat conftest.$ac_ext >&5
11009 cf_cv_xaw_compat=no
11010 fi
11011 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11012 fi
11013 echo "$as_me:11013: result: $cf_cv_xaw_compat" >&5
11014 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11015
11016                         if test "$cf_cv_xaw_compat" = no
11017                         then
11018                                 # workaround for broken ".pc" files...
11019                                 case "$cf_x_athena_lib" in #(vi
11020                                 *-lXmu*) #(vi
11021                                         ;;
11022                                 *)
11023                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11024
11025 echo "${as_me:-configure}:11025: testing work around broken package ..." 1>&5
11026
11027 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11028         test -n "$verbose" && echo "    found package xmu" 1>&6
11029
11030 echo "${as_me:-configure}:11030: testing found package xmu ..." 1>&5
11031
11032         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11033         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11034         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11035
11036 echo "${as_me:-configure}:11036: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11037
11038         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11039
11040 echo "${as_me:-configure}:11040: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11041
11042 cf_fix_cppflags=no
11043 cf_new_cflags=
11044 cf_new_cppflags=
11045 cf_new_extra_cppflags=
11046
11047 for cf_add_cflags in $cf_pkgconfig_incs
11048 do
11049 case $cf_fix_cppflags in
11050 no)
11051         case $cf_add_cflags in #(vi
11052         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11053                 case $cf_add_cflags in
11054                 -D*)
11055                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11056
11057                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11058                                 && test -z "${cf_tst_cflags}" \
11059                                 && cf_fix_cppflags=yes
11060
11061                         if test $cf_fix_cppflags = yes ; then
11062                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11063                                 continue
11064                         elif test "${cf_tst_cflags}" = "\"'" ; then
11065                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11066                                 continue
11067                         fi
11068                         ;;
11069                 esac
11070                 case "$CPPFLAGS" in
11071                 *$cf_add_cflags) #(vi
11072                         ;;
11073                 *) #(vi
11074                         case $cf_add_cflags in #(vi
11075                         -D*)
11076                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11077
11078 CPPFLAGS=`echo "$CPPFLAGS" | \
11079         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11080                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11081
11082                                 ;;
11083                         esac
11084                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11085                         ;;
11086                 esac
11087                 ;;
11088         *)
11089                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11090                 ;;
11091         esac
11092         ;;
11093 yes)
11094         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11095
11096         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11097
11098         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11099                 && test -z "${cf_tst_cflags}" \
11100                 && cf_fix_cppflags=no
11101         ;;
11102 esac
11103 done
11104
11105 if test -n "$cf_new_cflags" ; then
11106
11107         CFLAGS="$CFLAGS $cf_new_cflags"
11108 fi
11109
11110 if test -n "$cf_new_cppflags" ; then
11111
11112         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11113 fi
11114
11115 if test -n "$cf_new_extra_cppflags" ; then
11116
11117         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11118 fi
11119
11120         LIBS="$cf_pkgconfig_libs $LIBS"
11121         :
11122 else
11123
11124 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11125
11126 echo "${as_me:-configure}:11126: testing ...before $LIBS ..." 1>&5
11127
11128 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lXmu ," -e 's/  / /g'`
11129 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11130
11131 echo "${as_me:-configure}:11131: testing ...after  $LIBS ..." 1>&5
11132
11133 fi
11134
11135                                         ;;
11136                                 esac
11137                         fi
11138
11139                         break
11140 else
11141         :
11142 fi
11143
11144         done
11145 fi
11146
11147 if test -z "$cf_x_athena_lib" ; then
11148
11149 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11150         test -n "$verbose" && echo "    found package Xext" 1>&6
11151
11152 echo "${as_me:-configure}:11152: testing found package Xext ..." 1>&5
11153
11154         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11155         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11156         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11157
11158 echo "${as_me:-configure}:11158: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11159
11160         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11161
11162 echo "${as_me:-configure}:11162: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11163
11164 cf_fix_cppflags=no
11165 cf_new_cflags=
11166 cf_new_cppflags=
11167 cf_new_extra_cppflags=
11168
11169 for cf_add_cflags in $cf_pkgconfig_incs
11170 do
11171 case $cf_fix_cppflags in
11172 no)
11173         case $cf_add_cflags in #(vi
11174         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11175                 case $cf_add_cflags in
11176                 -D*)
11177                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11178
11179                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11180                                 && test -z "${cf_tst_cflags}" \
11181                                 && cf_fix_cppflags=yes
11182
11183                         if test $cf_fix_cppflags = yes ; then
11184                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11185                                 continue
11186                         elif test "${cf_tst_cflags}" = "\"'" ; then
11187                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11188                                 continue
11189                         fi
11190                         ;;
11191                 esac
11192                 case "$CPPFLAGS" in
11193                 *$cf_add_cflags) #(vi
11194                         ;;
11195                 *) #(vi
11196                         case $cf_add_cflags in #(vi
11197                         -D*)
11198                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11199
11200 CPPFLAGS=`echo "$CPPFLAGS" | \
11201         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11202                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11203
11204                                 ;;
11205                         esac
11206                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11207                         ;;
11208                 esac
11209                 ;;
11210         *)
11211                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11212                 ;;
11213         esac
11214         ;;
11215 yes)
11216         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11217
11218         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11219
11220         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11221                 && test -z "${cf_tst_cflags}" \
11222                 && cf_fix_cppflags=no
11223         ;;
11224 esac
11225 done
11226
11227 if test -n "$cf_new_cflags" ; then
11228
11229         CFLAGS="$CFLAGS $cf_new_cflags"
11230 fi
11231
11232 if test -n "$cf_new_cppflags" ; then
11233
11234         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11235 fi
11236
11237 if test -n "$cf_new_extra_cppflags" ; then
11238
11239         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11240 fi
11241
11242         LIBS="$cf_pkgconfig_libs $LIBS"
11243         :
11244 else
11245
11246         echo "$as_me:11246: checking for XextCreateExtension in -lXext" >&5
11247 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11248 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11249   echo $ECHO_N "(cached) $ECHO_C" >&6
11250 else
11251   ac_check_lib_save_LIBS=$LIBS
11252 LIBS="-lXext  $LIBS"
11253 cat >conftest.$ac_ext <<_ACEOF
11254 #line 11254 "configure"
11255 #include "confdefs.h"
11256
11257 /* Override any gcc2 internal prototype to avoid an error.  */
11258 #ifdef __cplusplus
11259 extern "C"
11260 #endif
11261 /* We use char because int might match the return type of a gcc2
11262    builtin and then its argument prototype would still apply.  */
11263 char XextCreateExtension ();
11264 int
11265 main ()
11266 {
11267 XextCreateExtension ();
11268   ;
11269   return 0;
11270 }
11271 _ACEOF
11272 rm -f conftest.$ac_objext conftest$ac_exeext
11273 if { (eval echo "$as_me:11273: \"$ac_link\"") >&5
11274   (eval $ac_link) 2>&5
11275   ac_status=$?
11276   echo "$as_me:11276: \$? = $ac_status" >&5
11277   (exit $ac_status); } &&
11278          { ac_try='test -s conftest$ac_exeext'
11279   { (eval echo "$as_me:11279: \"$ac_try\"") >&5
11280   (eval $ac_try) 2>&5
11281   ac_status=$?
11282   echo "$as_me:11282: \$? = $ac_status" >&5
11283   (exit $ac_status); }; }; then
11284   ac_cv_lib_Xext_XextCreateExtension=yes
11285 else
11286   echo "$as_me: failed program was:" >&5
11287 cat conftest.$ac_ext >&5
11288 ac_cv_lib_Xext_XextCreateExtension=no
11289 fi
11290 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11291 LIBS=$ac_check_lib_save_LIBS
11292 fi
11293 echo "$as_me:11293: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11294 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11295 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11296   LIBS="-lXext $LIBS"
11297 fi
11298
11299 fi
11300
11301 cf_have_X_LIBS=no
11302
11303 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11304         test -n "$verbose" && echo "    found package xt" 1>&6
11305
11306 echo "${as_me:-configure}:11306: testing found package xt ..." 1>&5
11307
11308         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11309         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11310         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11311
11312 echo "${as_me:-configure}:11312: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11313
11314         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11315
11316 echo "${as_me:-configure}:11316: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11317
11318 cf_fix_cppflags=no
11319 cf_new_cflags=
11320 cf_new_cppflags=
11321 cf_new_extra_cppflags=
11322
11323 for cf_add_cflags in $cf_pkgconfig_incs
11324 do
11325 case $cf_fix_cppflags in
11326 no)
11327         case $cf_add_cflags in #(vi
11328         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11329                 case $cf_add_cflags in
11330                 -D*)
11331                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11332
11333                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11334                                 && test -z "${cf_tst_cflags}" \
11335                                 && cf_fix_cppflags=yes
11336
11337                         if test $cf_fix_cppflags = yes ; then
11338                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11339                                 continue
11340                         elif test "${cf_tst_cflags}" = "\"'" ; then
11341                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11342                                 continue
11343                         fi
11344                         ;;
11345                 esac
11346                 case "$CPPFLAGS" in
11347                 *$cf_add_cflags) #(vi
11348                         ;;
11349                 *) #(vi
11350                         case $cf_add_cflags in #(vi
11351                         -D*)
11352                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11353
11354 CPPFLAGS=`echo "$CPPFLAGS" | \
11355         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11356                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11357
11358                                 ;;
11359                         esac
11360                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11361                         ;;
11362                 esac
11363                 ;;
11364         *)
11365                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11366                 ;;
11367         esac
11368         ;;
11369 yes)
11370         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11371
11372         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11373
11374         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11375                 && test -z "${cf_tst_cflags}" \
11376                 && cf_fix_cppflags=no
11377         ;;
11378 esac
11379 done
11380
11381 if test -n "$cf_new_cflags" ; then
11382
11383         CFLAGS="$CFLAGS $cf_new_cflags"
11384 fi
11385
11386 if test -n "$cf_new_cppflags" ; then
11387
11388         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11389 fi
11390
11391 if test -n "$cf_new_extra_cppflags" ; then
11392
11393         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11394 fi
11395
11396         LIBS="$cf_pkgconfig_libs $LIBS"
11397
11398         case "x$LIBS" in #(vi
11399         *-lX11*) #(vi
11400                 ;;
11401         *)
11402 # we have an "xt" package, but it may omit Xt's dependency on X11
11403 echo "$as_me:11403: checking for usable X dependency" >&5
11404 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11405 if test "${cf_cv_xt_x11_compat+set}" = set; then
11406   echo $ECHO_N "(cached) $ECHO_C" >&6
11407 else
11408
11409 cat >conftest.$ac_ext <<_ACEOF
11410 #line 11410 "configure"
11411 #include "confdefs.h"
11412
11413 #include <X11/Xlib.h>
11414
11415 int
11416 main ()
11417 {
11418
11419         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11420         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11421         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11422         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11423
11424   ;
11425   return 0;
11426 }
11427 _ACEOF
11428 rm -f conftest.$ac_objext conftest$ac_exeext
11429 if { (eval echo "$as_me:11429: \"$ac_link\"") >&5
11430   (eval $ac_link) 2>&5
11431   ac_status=$?
11432   echo "$as_me:11432: \$? = $ac_status" >&5
11433   (exit $ac_status); } &&
11434          { ac_try='test -s conftest$ac_exeext'
11435   { (eval echo "$as_me:11435: \"$ac_try\"") >&5
11436   (eval $ac_try) 2>&5
11437   ac_status=$?
11438   echo "$as_me:11438: \$? = $ac_status" >&5
11439   (exit $ac_status); }; }; then
11440   cf_cv_xt_x11_compat=yes
11441 else
11442   echo "$as_me: failed program was:" >&5
11443 cat conftest.$ac_ext >&5
11444 cf_cv_xt_x11_compat=no
11445 fi
11446 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11447 fi
11448 echo "$as_me:11448: result: $cf_cv_xt_x11_compat" >&5
11449 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11450                 if test "$cf_cv_xt_x11_compat" = no
11451                 then
11452                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11453
11454 echo "${as_me:-configure}:11454: testing work around broken X11 dependency ..." 1>&5
11455
11456                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11457
11458 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11459         test -n "$verbose" && echo "    found package x11" 1>&6
11460
11461 echo "${as_me:-configure}:11461: testing found package x11 ..." 1>&5
11462
11463         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11464         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11465         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11466
11467 echo "${as_me:-configure}:11467: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11468
11469         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11470
11471 echo "${as_me:-configure}:11471: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11472
11473 cf_fix_cppflags=no
11474 cf_new_cflags=
11475 cf_new_cppflags=
11476 cf_new_extra_cppflags=
11477
11478 for cf_add_cflags in $cf_pkgconfig_incs
11479 do
11480 case $cf_fix_cppflags in
11481 no)
11482         case $cf_add_cflags in #(vi
11483         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11484                 case $cf_add_cflags in
11485                 -D*)
11486                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11487
11488                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11489                                 && test -z "${cf_tst_cflags}" \
11490                                 && cf_fix_cppflags=yes
11491
11492                         if test $cf_fix_cppflags = yes ; then
11493                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11494                                 continue
11495                         elif test "${cf_tst_cflags}" = "\"'" ; then
11496                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11497                                 continue
11498                         fi
11499                         ;;
11500                 esac
11501                 case "$CPPFLAGS" in
11502                 *$cf_add_cflags) #(vi
11503                         ;;
11504                 *) #(vi
11505                         case $cf_add_cflags in #(vi
11506                         -D*)
11507                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11508
11509 CPPFLAGS=`echo "$CPPFLAGS" | \
11510         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11511                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11512
11513                                 ;;
11514                         esac
11515                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11516                         ;;
11517                 esac
11518                 ;;
11519         *)
11520                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11521                 ;;
11522         esac
11523         ;;
11524 yes)
11525         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11526
11527         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11528
11529         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11530                 && test -z "${cf_tst_cflags}" \
11531                 && cf_fix_cppflags=no
11532         ;;
11533 esac
11534 done
11535
11536 if test -n "$cf_new_cflags" ; then
11537
11538         CFLAGS="$CFLAGS $cf_new_cflags"
11539 fi
11540
11541 if test -n "$cf_new_cppflags" ; then
11542
11543         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11544 fi
11545
11546 if test -n "$cf_new_extra_cppflags" ; then
11547
11548         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11549 fi
11550
11551         LIBS="$cf_pkgconfig_libs $LIBS"
11552         :
11553 else
11554
11555 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11556
11557 echo "${as_me:-configure}:11557: testing ...before $LIBS ..." 1>&5
11558
11559 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lX11 ," -e 's/  / /g'`
11560 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11561
11562 echo "${as_me:-configure}:11562: testing ...after  $LIBS ..." 1>&5
11563
11564 fi
11565
11566                 fi
11567                 ;;
11568         esac
11569
11570 echo "$as_me:11570: checking for usable X Toolkit package" >&5
11571 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11572 if test "${cf_cv_xt_ice_compat+set}" = set; then
11573   echo $ECHO_N "(cached) $ECHO_C" >&6
11574 else
11575
11576 cat >conftest.$ac_ext <<_ACEOF
11577 #line 11577 "configure"
11578 #include "confdefs.h"
11579
11580 #include <X11/Shell.h>
11581
11582 int
11583 main ()
11584 {
11585 int num = IceConnectionNumber(0)
11586
11587   ;
11588   return 0;
11589 }
11590 _ACEOF
11591 rm -f conftest.$ac_objext conftest$ac_exeext
11592 if { (eval echo "$as_me:11592: \"$ac_link\"") >&5
11593   (eval $ac_link) 2>&5
11594   ac_status=$?
11595   echo "$as_me:11595: \$? = $ac_status" >&5
11596   (exit $ac_status); } &&
11597          { ac_try='test -s conftest$ac_exeext'
11598   { (eval echo "$as_me:11598: \"$ac_try\"") >&5
11599   (eval $ac_try) 2>&5
11600   ac_status=$?
11601   echo "$as_me:11601: \$? = $ac_status" >&5
11602   (exit $ac_status); }; }; then
11603   cf_cv_xt_ice_compat=yes
11604 else
11605   echo "$as_me: failed program was:" >&5
11606 cat conftest.$ac_ext >&5
11607 cf_cv_xt_ice_compat=no
11608 fi
11609 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11610 fi
11611 echo "$as_me:11611: result: $cf_cv_xt_ice_compat" >&5
11612 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11613
11614         if test "$cf_cv_xt_ice_compat" = no
11615         then
11616                 # workaround for broken ".pc" files used for X Toolkit.
11617                 case "x$X_PRE_LIBS" in #(vi
11618                 *-lICE*)
11619                         case "x$LIBS" in #(vi
11620                         *-lICE*) #(vi
11621                                 ;;
11622                         *)
11623                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11624
11625 echo "${as_me:-configure}:11625: testing work around broken ICE dependency ..." 1>&5
11626
11627 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11628         test -n "$verbose" && echo "    found package ice" 1>&6
11629
11630 echo "${as_me:-configure}:11630: testing found package ice ..." 1>&5
11631
11632         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11633         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11634         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11635
11636 echo "${as_me:-configure}:11636: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11637
11638         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11639
11640 echo "${as_me:-configure}:11640: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11641
11642 cf_fix_cppflags=no
11643 cf_new_cflags=
11644 cf_new_cppflags=
11645 cf_new_extra_cppflags=
11646
11647 for cf_add_cflags in $cf_pkgconfig_incs
11648 do
11649 case $cf_fix_cppflags in
11650 no)
11651         case $cf_add_cflags in #(vi
11652         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11653                 case $cf_add_cflags in
11654                 -D*)
11655                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11656
11657                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11658                                 && test -z "${cf_tst_cflags}" \
11659                                 && cf_fix_cppflags=yes
11660
11661                         if test $cf_fix_cppflags = yes ; then
11662                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11663                                 continue
11664                         elif test "${cf_tst_cflags}" = "\"'" ; then
11665                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11666                                 continue
11667                         fi
11668                         ;;
11669                 esac
11670                 case "$CPPFLAGS" in
11671                 *$cf_add_cflags) #(vi
11672                         ;;
11673                 *) #(vi
11674                         case $cf_add_cflags in #(vi
11675                         -D*)
11676                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11677
11678 CPPFLAGS=`echo "$CPPFLAGS" | \
11679         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11680                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11681
11682                                 ;;
11683                         esac
11684                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11685                         ;;
11686                 esac
11687                 ;;
11688         *)
11689                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11690                 ;;
11691         esac
11692         ;;
11693 yes)
11694         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11695
11696         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11697
11698         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11699                 && test -z "${cf_tst_cflags}" \
11700                 && cf_fix_cppflags=no
11701         ;;
11702 esac
11703 done
11704
11705 if test -n "$cf_new_cflags" ; then
11706
11707         CFLAGS="$CFLAGS $cf_new_cflags"
11708 fi
11709
11710 if test -n "$cf_new_cppflags" ; then
11711
11712         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11713 fi
11714
11715 if test -n "$cf_new_extra_cppflags" ; then
11716
11717         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11718 fi
11719
11720         LIBS="$cf_pkgconfig_libs $LIBS"
11721
11722 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11723         test -n "$verbose" && echo "    found package sm" 1>&6
11724
11725 echo "${as_me:-configure}:11725: testing found package sm ..." 1>&5
11726
11727         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11728         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11729         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11730
11731 echo "${as_me:-configure}:11731: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11732
11733         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11734
11735 echo "${as_me:-configure}:11735: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11736
11737 cf_fix_cppflags=no
11738 cf_new_cflags=
11739 cf_new_cppflags=
11740 cf_new_extra_cppflags=
11741
11742 for cf_add_cflags in $cf_pkgconfig_incs
11743 do
11744 case $cf_fix_cppflags in
11745 no)
11746         case $cf_add_cflags in #(vi
11747         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11748                 case $cf_add_cflags in
11749                 -D*)
11750                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11751
11752                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11753                                 && test -z "${cf_tst_cflags}" \
11754                                 && cf_fix_cppflags=yes
11755
11756                         if test $cf_fix_cppflags = yes ; then
11757                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11758                                 continue
11759                         elif test "${cf_tst_cflags}" = "\"'" ; then
11760                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11761                                 continue
11762                         fi
11763                         ;;
11764                 esac
11765                 case "$CPPFLAGS" in
11766                 *$cf_add_cflags) #(vi
11767                         ;;
11768                 *) #(vi
11769                         case $cf_add_cflags in #(vi
11770                         -D*)
11771                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11772
11773 CPPFLAGS=`echo "$CPPFLAGS" | \
11774         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11775                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11776
11777                                 ;;
11778                         esac
11779                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11780                         ;;
11781                 esac
11782                 ;;
11783         *)
11784                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11785                 ;;
11786         esac
11787         ;;
11788 yes)
11789         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11790
11791         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11792
11793         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11794                 && test -z "${cf_tst_cflags}" \
11795                 && cf_fix_cppflags=no
11796         ;;
11797 esac
11798 done
11799
11800 if test -n "$cf_new_cflags" ; then
11801
11802         CFLAGS="$CFLAGS $cf_new_cflags"
11803 fi
11804
11805 if test -n "$cf_new_cppflags" ; then
11806
11807         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11808 fi
11809
11810 if test -n "$cf_new_extra_cppflags" ; then
11811
11812         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11813 fi
11814
11815         LIBS="$cf_pkgconfig_libs $LIBS"
11816         :
11817 else
11818         :
11819 fi
11820
11821 else
11822
11823 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11824
11825 echo "${as_me:-configure}:11825: testing ...before $LIBS ..." 1>&5
11826
11827 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/  / /g'`
11828 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11829
11830 echo "${as_me:-configure}:11830: testing ...after  $LIBS ..." 1>&5
11831
11832 fi
11833
11834                                 ;;
11835                         esac
11836                         ;;
11837                 esac
11838         fi
11839
11840         cf_have_X_LIBS=yes
11841
11842 else
11843
11844         LDFLAGS="$X_LIBS $LDFLAGS"
11845
11846 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11847
11848 echo "${as_me:-configure}:11848: testing checking additions to CFLAGS ..." 1>&5
11849
11850 cf_check_cflags="$CFLAGS"
11851 cf_check_cppflags="$CPPFLAGS"
11852
11853 cf_fix_cppflags=no
11854 cf_new_cflags=
11855 cf_new_cppflags=
11856 cf_new_extra_cppflags=
11857
11858 for cf_add_cflags in $X_CFLAGS
11859 do
11860 case $cf_fix_cppflags in
11861 no)
11862         case $cf_add_cflags in #(vi
11863         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11864                 case $cf_add_cflags in
11865                 -D*)
11866                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11867
11868                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11869                                 && test -z "${cf_tst_cflags}" \
11870                                 && cf_fix_cppflags=yes
11871
11872                         if test $cf_fix_cppflags = yes ; then
11873                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11874                                 continue
11875                         elif test "${cf_tst_cflags}" = "\"'" ; then
11876                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11877                                 continue
11878                         fi
11879                         ;;
11880                 esac
11881                 case "$CPPFLAGS" in
11882                 *$cf_add_cflags) #(vi
11883                         ;;
11884                 *) #(vi
11885                         case $cf_add_cflags in #(vi
11886                         -D*)
11887                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11888
11889 CPPFLAGS=`echo "$CPPFLAGS" | \
11890         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11891                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11892
11893                                 ;;
11894                         esac
11895                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11896                         ;;
11897                 esac
11898                 ;;
11899         *)
11900                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11901                 ;;
11902         esac
11903         ;;
11904 yes)
11905         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11906
11907         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11908
11909         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11910                 && test -z "${cf_tst_cflags}" \
11911                 && cf_fix_cppflags=no
11912         ;;
11913 esac
11914 done
11915
11916 if test -n "$cf_new_cflags" ; then
11917         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11918
11919 echo "${as_me:-configure}:11919: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11920
11921         CFLAGS="$CFLAGS $cf_new_cflags"
11922 fi
11923
11924 if test -n "$cf_new_cppflags" ; then
11925         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11926
11927 echo "${as_me:-configure}:11927: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11928
11929         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11930 fi
11931
11932 if test -n "$cf_new_extra_cppflags" ; then
11933         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11934
11935 echo "${as_me:-configure}:11935: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11936
11937         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11938 fi
11939
11940 if test "$cf_check_cflags" != "$CFLAGS" ; then
11941 cat >conftest.$ac_ext <<_ACEOF
11942 #line 11942 "configure"
11943 #include "confdefs.h"
11944 #include <stdio.h>
11945 int
11946 main ()
11947 {
11948 printf("Hello world");
11949   ;
11950   return 0;
11951 }
11952 _ACEOF
11953 rm -f conftest.$ac_objext conftest$ac_exeext
11954 if { (eval echo "$as_me:11954: \"$ac_link\"") >&5
11955   (eval $ac_link) 2>&5
11956   ac_status=$?
11957   echo "$as_me:11957: \$? = $ac_status" >&5
11958   (exit $ac_status); } &&
11959          { ac_try='test -s conftest$ac_exeext'
11960   { (eval echo "$as_me:11960: \"$ac_try\"") >&5
11961   (eval $ac_try) 2>&5
11962   ac_status=$?
11963   echo "$as_me:11963: \$? = $ac_status" >&5
11964   (exit $ac_status); }; }; then
11965   :
11966 else
11967   echo "$as_me: failed program was:" >&5
11968 cat conftest.$ac_ext >&5
11969 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
11970
11971 echo "${as_me:-configure}:11971: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
11972
11973          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
11974                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
11975
11976 echo "${as_me:-configure}:11976: testing but keeping change to \$CPPFLAGS ..." 1>&5
11977
11978          fi
11979          CFLAGS="$cf_check_flags"
11980 fi
11981 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11982 fi
11983
11984         echo "$as_me:11984: checking for XOpenDisplay" >&5
11985 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
11986 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
11987   echo $ECHO_N "(cached) $ECHO_C" >&6
11988 else
11989   cat >conftest.$ac_ext <<_ACEOF
11990 #line 11990 "configure"
11991 #include "confdefs.h"
11992 /* System header to define __stub macros and hopefully few prototypes,
11993     which can conflict with char XOpenDisplay (); below.  */
11994 #include <assert.h>
11995 /* Override any gcc2 internal prototype to avoid an error.  */
11996 #ifdef __cplusplus
11997 extern "C"
11998 #endif
11999 /* We use char because int might match the return type of a gcc2
12000    builtin and then its argument prototype would still apply.  */
12001 char XOpenDisplay ();
12002 char (*f) ();
12003
12004 int
12005 main ()
12006 {
12007 /* The GNU C library defines this for functions which it implements
12008     to always fail with ENOSYS.  Some functions are actually named
12009     something starting with __ and the normal name is an alias.  */
12010 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12011 choke me
12012 #else
12013 f = XOpenDisplay;
12014 #endif
12015
12016   ;
12017   return 0;
12018 }
12019 _ACEOF
12020 rm -f conftest.$ac_objext conftest$ac_exeext
12021 if { (eval echo "$as_me:12021: \"$ac_link\"") >&5
12022   (eval $ac_link) 2>&5
12023   ac_status=$?
12024   echo "$as_me:12024: \$? = $ac_status" >&5
12025   (exit $ac_status); } &&
12026          { ac_try='test -s conftest$ac_exeext'
12027   { (eval echo "$as_me:12027: \"$ac_try\"") >&5
12028   (eval $ac_try) 2>&5
12029   ac_status=$?
12030   echo "$as_me:12030: \$? = $ac_status" >&5
12031   (exit $ac_status); }; }; then
12032   ac_cv_func_XOpenDisplay=yes
12033 else
12034   echo "$as_me: failed program was:" >&5
12035 cat conftest.$ac_ext >&5
12036 ac_cv_func_XOpenDisplay=no
12037 fi
12038 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12039 fi
12040 echo "$as_me:12040: result: $ac_cv_func_XOpenDisplay" >&5
12041 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12042 if test $ac_cv_func_XOpenDisplay = yes; then
12043   :
12044 else
12045
12046         echo "$as_me:12046: checking for XOpenDisplay in -lX11" >&5
12047 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12048 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12049   echo $ECHO_N "(cached) $ECHO_C" >&6
12050 else
12051   ac_check_lib_save_LIBS=$LIBS
12052 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12053 cat >conftest.$ac_ext <<_ACEOF
12054 #line 12054 "configure"
12055 #include "confdefs.h"
12056
12057 /* Override any gcc2 internal prototype to avoid an error.  */
12058 #ifdef __cplusplus
12059 extern "C"
12060 #endif
12061 /* We use char because int might match the return type of a gcc2
12062    builtin and then its argument prototype would still apply.  */
12063 char XOpenDisplay ();
12064 int
12065 main ()
12066 {
12067 XOpenDisplay ();
12068   ;
12069   return 0;
12070 }
12071 _ACEOF
12072 rm -f conftest.$ac_objext conftest$ac_exeext
12073 if { (eval echo "$as_me:12073: \"$ac_link\"") >&5
12074   (eval $ac_link) 2>&5
12075   ac_status=$?
12076   echo "$as_me:12076: \$? = $ac_status" >&5
12077   (exit $ac_status); } &&
12078          { ac_try='test -s conftest$ac_exeext'
12079   { (eval echo "$as_me:12079: \"$ac_try\"") >&5
12080   (eval $ac_try) 2>&5
12081   ac_status=$?
12082   echo "$as_me:12082: \$? = $ac_status" >&5
12083   (exit $ac_status); }; }; then
12084   ac_cv_lib_X11_XOpenDisplay=yes
12085 else
12086   echo "$as_me: failed program was:" >&5
12087 cat conftest.$ac_ext >&5
12088 ac_cv_lib_X11_XOpenDisplay=no
12089 fi
12090 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12091 LIBS=$ac_check_lib_save_LIBS
12092 fi
12093 echo "$as_me:12093: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12094 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12095 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12096   LIBS="-lX11 $LIBS"
12097 fi
12098
12099 fi
12100
12101         echo "$as_me:12101: checking for XtAppInitialize" >&5
12102 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12103 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12104   echo $ECHO_N "(cached) $ECHO_C" >&6
12105 else
12106   cat >conftest.$ac_ext <<_ACEOF
12107 #line 12107 "configure"
12108 #include "confdefs.h"
12109 /* System header to define __stub macros and hopefully few prototypes,
12110     which can conflict with char XtAppInitialize (); below.  */
12111 #include <assert.h>
12112 /* Override any gcc2 internal prototype to avoid an error.  */
12113 #ifdef __cplusplus
12114 extern "C"
12115 #endif
12116 /* We use char because int might match the return type of a gcc2
12117    builtin and then its argument prototype would still apply.  */
12118 char XtAppInitialize ();
12119 char (*f) ();
12120
12121 int
12122 main ()
12123 {
12124 /* The GNU C library defines this for functions which it implements
12125     to always fail with ENOSYS.  Some functions are actually named
12126     something starting with __ and the normal name is an alias.  */
12127 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12128 choke me
12129 #else
12130 f = XtAppInitialize;
12131 #endif
12132
12133   ;
12134   return 0;
12135 }
12136 _ACEOF
12137 rm -f conftest.$ac_objext conftest$ac_exeext
12138 if { (eval echo "$as_me:12138: \"$ac_link\"") >&5
12139   (eval $ac_link) 2>&5
12140   ac_status=$?
12141   echo "$as_me:12141: \$? = $ac_status" >&5
12142   (exit $ac_status); } &&
12143          { ac_try='test -s conftest$ac_exeext'
12144   { (eval echo "$as_me:12144: \"$ac_try\"") >&5
12145   (eval $ac_try) 2>&5
12146   ac_status=$?
12147   echo "$as_me:12147: \$? = $ac_status" >&5
12148   (exit $ac_status); }; }; then
12149   ac_cv_func_XtAppInitialize=yes
12150 else
12151   echo "$as_me: failed program was:" >&5
12152 cat conftest.$ac_ext >&5
12153 ac_cv_func_XtAppInitialize=no
12154 fi
12155 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12156 fi
12157 echo "$as_me:12157: result: $ac_cv_func_XtAppInitialize" >&5
12158 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12159 if test $ac_cv_func_XtAppInitialize = yes; then
12160   :
12161 else
12162
12163         echo "$as_me:12163: checking for XtAppInitialize in -lXt" >&5
12164 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12165 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12166   echo $ECHO_N "(cached) $ECHO_C" >&6
12167 else
12168   ac_check_lib_save_LIBS=$LIBS
12169 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12170 cat >conftest.$ac_ext <<_ACEOF
12171 #line 12171 "configure"
12172 #include "confdefs.h"
12173
12174 /* Override any gcc2 internal prototype to avoid an error.  */
12175 #ifdef __cplusplus
12176 extern "C"
12177 #endif
12178 /* We use char because int might match the return type of a gcc2
12179    builtin and then its argument prototype would still apply.  */
12180 char XtAppInitialize ();
12181 int
12182 main ()
12183 {
12184 XtAppInitialize ();
12185   ;
12186   return 0;
12187 }
12188 _ACEOF
12189 rm -f conftest.$ac_objext conftest$ac_exeext
12190 if { (eval echo "$as_me:12190: \"$ac_link\"") >&5
12191   (eval $ac_link) 2>&5
12192   ac_status=$?
12193   echo "$as_me:12193: \$? = $ac_status" >&5
12194   (exit $ac_status); } &&
12195          { ac_try='test -s conftest$ac_exeext'
12196   { (eval echo "$as_me:12196: \"$ac_try\"") >&5
12197   (eval $ac_try) 2>&5
12198   ac_status=$?
12199   echo "$as_me:12199: \$? = $ac_status" >&5
12200   (exit $ac_status); }; }; then
12201   ac_cv_lib_Xt_XtAppInitialize=yes
12202 else
12203   echo "$as_me: failed program was:" >&5
12204 cat conftest.$ac_ext >&5
12205 ac_cv_lib_Xt_XtAppInitialize=no
12206 fi
12207 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12208 LIBS=$ac_check_lib_save_LIBS
12209 fi
12210 echo "$as_me:12210: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12211 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12212 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12213   cat >>confdefs.h <<\EOF
12214 #define HAVE_LIBXT 1
12215 EOF
12216
12217                  cf_have_X_LIBS=Xt
12218                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12219 fi
12220
12221 fi
12222
12223 fi
12224
12225 if test $cf_have_X_LIBS = no ; then
12226         { echo "$as_me:12226: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12227 test program.  You will have to check and add the proper libraries by hand
12228 to makefile." >&5
12229 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12230 test program.  You will have to check and add the proper libraries by hand
12231 to makefile." >&2;}
12232 fi
12233
12234 cf_x_athena_root=$cf_x_athena
12235 cf_x_athena_inc=""
12236
12237 for cf_path in default \
12238         /usr/contrib/X11R6 \
12239         /usr/contrib/X11R5 \
12240         /usr/lib/X11R5 \
12241         /usr/local
12242 do
12243         if test -z "$cf_x_athena_inc" ; then
12244                 cf_save="$CPPFLAGS"
12245                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12246                 if test $cf_path != default ; then
12247                         CPPFLAGS="$cf_save -I$cf_path/include"
12248                         echo "$as_me:12248: checking for $cf_test in $cf_path" >&5
12249 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12250                 else
12251                         echo "$as_me:12251: checking for $cf_test" >&5
12252 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12253                 fi
12254                 cat >conftest.$ac_ext <<_ACEOF
12255 #line 12255 "configure"
12256 #include "confdefs.h"
12257
12258 #include <X11/Intrinsic.h>
12259 #include <$cf_test>
12260 int
12261 main ()
12262 {
12263
12264   ;
12265   return 0;
12266 }
12267 _ACEOF
12268 rm -f conftest.$ac_objext
12269 if { (eval echo "$as_me:12269: \"$ac_compile\"") >&5
12270   (eval $ac_compile) 2>&5
12271   ac_status=$?
12272   echo "$as_me:12272: \$? = $ac_status" >&5
12273   (exit $ac_status); } &&
12274          { ac_try='test -s conftest.$ac_objext'
12275   { (eval echo "$as_me:12275: \"$ac_try\"") >&5
12276   (eval $ac_try) 2>&5
12277   ac_status=$?
12278   echo "$as_me:12278: \$? = $ac_status" >&5
12279   (exit $ac_status); }; }; then
12280   cf_result=yes
12281 else
12282   echo "$as_me: failed program was:" >&5
12283 cat conftest.$ac_ext >&5
12284 cf_result=no
12285 fi
12286 rm -f conftest.$ac_objext conftest.$ac_ext
12287                 echo "$as_me:12287: result: $cf_result" >&5
12288 echo "${ECHO_T}$cf_result" >&6
12289                 if test "$cf_result" = yes ; then
12290                         cf_x_athena_inc=$cf_path
12291                         break
12292                 else
12293                         CPPFLAGS="$cf_save"
12294                 fi
12295         fi
12296 done
12297
12298 if test -z "$cf_x_athena_inc" ; then
12299         { echo "$as_me:12299: WARNING: Unable to successfully find Athena header files with test program" >&5
12300 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12301 elif test "$cf_x_athena_inc" != default ; then
12302         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12303 fi
12304
12305 cf_x_athena_root=$cf_x_athena
12306 cf_x_athena_lib=""
12307
12308 for cf_path in default \
12309         /usr/contrib/X11R6 \
12310         /usr/contrib/X11R5 \
12311         /usr/lib/X11R5 \
12312         /usr/local
12313 do
12314         for cf_lib in \
12315                 ${cf_x_athena_root} \
12316                 ${cf_x_athena_root}7 \
12317                 ${cf_x_athena_root}6
12318         do
12319         for cf_libs in \
12320                 "-l$cf_lib -lXmu" \
12321                 "-l$cf_lib -lXpm -lXmu" \
12322                 "-l${cf_lib}_s -lXmu_s"
12323         do
12324                 if test -z "$cf_x_athena_lib" ; then
12325                         cf_save="$LIBS"
12326                         cf_test=XawSimpleMenuAddGlobalActions
12327                         if test $cf_path != default ; then
12328                                 LIBS="-L$cf_path/lib $cf_libs $LIBS"
12329                                 echo "$as_me:12329: checking for $cf_libs in $cf_path" >&5
12330 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12331                         else
12332                                 LIBS="$cf_libs $LIBS"
12333                                 echo "$as_me:12333: checking for $cf_test in $cf_libs" >&5
12334 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12335                         fi
12336                         cat >conftest.$ac_ext <<_ACEOF
12337 #line 12337 "configure"
12338 #include "confdefs.h"
12339
12340 #include <X11/Intrinsic.h>
12341 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12342
12343 int
12344 main ()
12345 {
12346
12347 $cf_test((XtAppContext) 0)
12348   ;
12349   return 0;
12350 }
12351 _ACEOF
12352 rm -f conftest.$ac_objext conftest$ac_exeext
12353 if { (eval echo "$as_me:12353: \"$ac_link\"") >&5
12354   (eval $ac_link) 2>&5
12355   ac_status=$?
12356   echo "$as_me:12356: \$? = $ac_status" >&5
12357   (exit $ac_status); } &&
12358          { ac_try='test -s conftest$ac_exeext'
12359   { (eval echo "$as_me:12359: \"$ac_try\"") >&5
12360   (eval $ac_try) 2>&5
12361   ac_status=$?
12362   echo "$as_me:12362: \$? = $ac_status" >&5
12363   (exit $ac_status); }; }; then
12364   cf_result=yes
12365 else
12366   echo "$as_me: failed program was:" >&5
12367 cat conftest.$ac_ext >&5
12368 cf_result=no
12369 fi
12370 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12371                         echo "$as_me:12371: result: $cf_result" >&5
12372 echo "${ECHO_T}$cf_result" >&6
12373                         if test "$cf_result" = yes ; then
12374                                 cf_x_athena_lib="$cf_libs"
12375                                 break
12376                         fi
12377                         LIBS="$cf_save"
12378                 fi
12379         done # cf_libs
12380                 test -n "$cf_x_athena_lib" && break
12381         done # cf_lib
12382 done
12383
12384 if test -z "$cf_x_athena_lib" ; then
12385         { { echo "$as_me:12385: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12386 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12387    { (exit 1); exit 1; }; }
12388 fi
12389
12390 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12391
12392 cat >>confdefs.h <<EOF
12393 #define $cf_x_athena_LIBS 1
12394 EOF
12395
12396 fi
12397
12398 for ac_prog in xcurses-config
12399 do
12400   # Extract the first word of "$ac_prog", so it can be a program name with args.
12401 set dummy $ac_prog; ac_word=$2
12402 echo "$as_me:12402: checking for $ac_word" >&5
12403 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12404 if test "${ac_cv_path_XCURSES_CONFIG+set}" = set; then
12405   echo $ECHO_N "(cached) $ECHO_C" >&6
12406 else
12407   case $XCURSES_CONFIG in
12408   [\\/]* | ?:[\\/]*)
12409   ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a path.
12410   ;;
12411   *)
12412   ac_save_IFS=$IFS; IFS=$ac_path_separator
12413 ac_dummy="$PATH"
12414 for ac_dir in $ac_dummy; do
12415   IFS=$ac_save_IFS
12416   test -z "$ac_dir" && ac_dir=.
12417   if $as_executable_p "$ac_dir/$ac_word"; then
12418    ac_cv_path_XCURSES_CONFIG="$ac_dir/$ac_word"
12419    echo "$as_me:12419: found $ac_dir/$ac_word" >&5
12420    break
12421 fi
12422 done
12423
12424   ;;
12425 esac
12426 fi
12427 XCURSES_CONFIG=$ac_cv_path_XCURSES_CONFIG
12428
12429 if test -n "$XCURSES_CONFIG"; then
12430   echo "$as_me:12430: result: $XCURSES_CONFIG" >&5
12431 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12432 else
12433   echo "$as_me:12433: result: no" >&5
12434 echo "${ECHO_T}no" >&6
12435 fi
12436
12437   test -n "$XCURSES_CONFIG" && break
12438 done
12439 test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none"
12440
12441 if test "$XCURSES_CONFIG" != none ; then
12442
12443 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12444 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
12445
12446 cf_cv_lib_XCurses=yes
12447
12448 else
12449
12450 LDFLAGS="$LDFLAGS $X_LIBS"
12451
12452 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12453
12454 echo "${as_me:-configure}:12454: testing checking additions to CFLAGS ..." 1>&5
12455
12456 cf_check_cflags="$CFLAGS"
12457 cf_check_cppflags="$CPPFLAGS"
12458
12459 cf_fix_cppflags=no
12460 cf_new_cflags=
12461 cf_new_cppflags=
12462 cf_new_extra_cppflags=
12463
12464 for cf_add_cflags in $X_CFLAGS
12465 do
12466 case $cf_fix_cppflags in
12467 no)
12468         case $cf_add_cflags in #(vi
12469         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12470                 case $cf_add_cflags in
12471                 -D*)
12472                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12473
12474                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12475                                 && test -z "${cf_tst_cflags}" \
12476                                 && cf_fix_cppflags=yes
12477
12478                         if test $cf_fix_cppflags = yes ; then
12479                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12480                                 continue
12481                         elif test "${cf_tst_cflags}" = "\"'" ; then
12482                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12483                                 continue
12484                         fi
12485                         ;;
12486                 esac
12487                 case "$CPPFLAGS" in
12488                 *$cf_add_cflags) #(vi
12489                         ;;
12490                 *) #(vi
12491                         case $cf_add_cflags in #(vi
12492                         -D*)
12493                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12494
12495 CPPFLAGS=`echo "$CPPFLAGS" | \
12496         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12497                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12498
12499                                 ;;
12500                         esac
12501                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12502                         ;;
12503                 esac
12504                 ;;
12505         *)
12506                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12507                 ;;
12508         esac
12509         ;;
12510 yes)
12511         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12512
12513         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12514
12515         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12516                 && test -z "${cf_tst_cflags}" \
12517                 && cf_fix_cppflags=no
12518         ;;
12519 esac
12520 done
12521
12522 if test -n "$cf_new_cflags" ; then
12523         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12524
12525 echo "${as_me:-configure}:12525: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12526
12527         CFLAGS="$CFLAGS $cf_new_cflags"
12528 fi
12529
12530 if test -n "$cf_new_cppflags" ; then
12531         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12532
12533 echo "${as_me:-configure}:12533: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12534
12535         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12536 fi
12537
12538 if test -n "$cf_new_extra_cppflags" ; then
12539         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12540
12541 echo "${as_me:-configure}:12541: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12542
12543         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12544 fi
12545
12546 if test "$cf_check_cflags" != "$CFLAGS" ; then
12547 cat >conftest.$ac_ext <<_ACEOF
12548 #line 12548 "configure"
12549 #include "confdefs.h"
12550 #include <stdio.h>
12551 int
12552 main ()
12553 {
12554 printf("Hello world");
12555   ;
12556   return 0;
12557 }
12558 _ACEOF
12559 rm -f conftest.$ac_objext conftest$ac_exeext
12560 if { (eval echo "$as_me:12560: \"$ac_link\"") >&5
12561   (eval $ac_link) 2>&5
12562   ac_status=$?
12563   echo "$as_me:12563: \$? = $ac_status" >&5
12564   (exit $ac_status); } &&
12565          { ac_try='test -s conftest$ac_exeext'
12566   { (eval echo "$as_me:12566: \"$ac_try\"") >&5
12567   (eval $ac_try) 2>&5
12568   ac_status=$?
12569   echo "$as_me:12569: \$? = $ac_status" >&5
12570   (exit $ac_status); }; }; then
12571   :
12572 else
12573   echo "$as_me: failed program was:" >&5
12574 cat conftest.$ac_ext >&5
12575 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12576
12577 echo "${as_me:-configure}:12577: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12578
12579          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
12580                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12581
12582 echo "${as_me:-configure}:12582: testing but keeping change to \$CPPFLAGS ..." 1>&5
12583
12584          fi
12585          CFLAGS="$cf_check_flags"
12586 fi
12587 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12588 fi
12589
12590 echo "$as_me:12590: checking for XOpenDisplay in -lX11" >&5
12591 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12592 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12593   echo $ECHO_N "(cached) $ECHO_C" >&6
12594 else
12595   ac_check_lib_save_LIBS=$LIBS
12596 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12597 cat >conftest.$ac_ext <<_ACEOF
12598 #line 12598 "configure"
12599 #include "confdefs.h"
12600
12601 /* Override any gcc2 internal prototype to avoid an error.  */
12602 #ifdef __cplusplus
12603 extern "C"
12604 #endif
12605 /* We use char because int might match the return type of a gcc2
12606    builtin and then its argument prototype would still apply.  */
12607 char XOpenDisplay ();
12608 int
12609 main ()
12610 {
12611 XOpenDisplay ();
12612   ;
12613   return 0;
12614 }
12615 _ACEOF
12616 rm -f conftest.$ac_objext conftest$ac_exeext
12617 if { (eval echo "$as_me:12617: \"$ac_link\"") >&5
12618   (eval $ac_link) 2>&5
12619   ac_status=$?
12620   echo "$as_me:12620: \$? = $ac_status" >&5
12621   (exit $ac_status); } &&
12622          { ac_try='test -s conftest$ac_exeext'
12623   { (eval echo "$as_me:12623: \"$ac_try\"") >&5
12624   (eval $ac_try) 2>&5
12625   ac_status=$?
12626   echo "$as_me:12626: \$? = $ac_status" >&5
12627   (exit $ac_status); }; }; then
12628   ac_cv_lib_X11_XOpenDisplay=yes
12629 else
12630   echo "$as_me: failed program was:" >&5
12631 cat conftest.$ac_ext >&5
12632 ac_cv_lib_X11_XOpenDisplay=no
12633 fi
12634 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12635 LIBS=$ac_check_lib_save_LIBS
12636 fi
12637 echo "$as_me:12637: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12638 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12639 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12640   LIBS="-lX11 $LIBS"
12641 fi
12642
12643 echo "$as_me:12643: checking for XCurses library" >&5
12644 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
12645 if test "${cf_cv_lib_XCurses+set}" = set; then
12646   echo $ECHO_N "(cached) $ECHO_C" >&6
12647 else
12648
12649 LIBS="-lXCurses $LIBS"
12650 cat >conftest.$ac_ext <<_ACEOF
12651 #line 12651 "configure"
12652 #include "confdefs.h"
12653
12654 #include <xcurses.h>
12655 char *XCursesProgramName = "test";
12656
12657 int
12658 main ()
12659 {
12660 XCursesExit();
12661   ;
12662   return 0;
12663 }
12664 _ACEOF
12665 rm -f conftest.$ac_objext conftest$ac_exeext
12666 if { (eval echo "$as_me:12666: \"$ac_link\"") >&5
12667   (eval $ac_link) 2>&5
12668   ac_status=$?
12669   echo "$as_me:12669: \$? = $ac_status" >&5
12670   (exit $ac_status); } &&
12671          { ac_try='test -s conftest$ac_exeext'
12672   { (eval echo "$as_me:12672: \"$ac_try\"") >&5
12673   (eval $ac_try) 2>&5
12674   ac_status=$?
12675   echo "$as_me:12675: \$? = $ac_status" >&5
12676   (exit $ac_status); }; }; then
12677   cf_cv_lib_XCurses=yes
12678 else
12679   echo "$as_me: failed program was:" >&5
12680 cat conftest.$ac_ext >&5
12681 cf_cv_lib_XCurses=no
12682 fi
12683 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12684
12685 fi
12686 echo "$as_me:12686: result: $cf_cv_lib_XCurses" >&5
12687 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
12688
12689 fi
12690
12691 if test $cf_cv_lib_XCurses = yes ; then
12692         cat >>confdefs.h <<\EOF
12693 #define UNIX 1
12694 EOF
12695
12696         cat >>confdefs.h <<\EOF
12697 #define XCURSES 1
12698 EOF
12699
12700         echo "$as_me:12700: checking for xcurses.h" >&5
12701 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
12702 if test "${ac_cv_header_xcurses_h+set}" = set; then
12703   echo $ECHO_N "(cached) $ECHO_C" >&6
12704 else
12705   cat >conftest.$ac_ext <<_ACEOF
12706 #line 12706 "configure"
12707 #include "confdefs.h"
12708 #include <xcurses.h>
12709 _ACEOF
12710 if { (eval echo "$as_me:12710: \"$ac_cpp conftest.$ac_ext\"") >&5
12711   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12712   ac_status=$?
12713   egrep -v '^ *\+' conftest.er1 >conftest.err
12714   rm -f conftest.er1
12715   cat conftest.err >&5
12716   echo "$as_me:12716: \$? = $ac_status" >&5
12717   (exit $ac_status); } >/dev/null; then
12718   if test -s conftest.err; then
12719     ac_cpp_err=$ac_c_preproc_warn_flag
12720   else
12721     ac_cpp_err=
12722   fi
12723 else
12724   ac_cpp_err=yes
12725 fi
12726 if test -z "$ac_cpp_err"; then
12727   ac_cv_header_xcurses_h=yes
12728 else
12729   echo "$as_me: failed program was:" >&5
12730   cat conftest.$ac_ext >&5
12731   ac_cv_header_xcurses_h=no
12732 fi
12733 rm -f conftest.err conftest.$ac_ext
12734 fi
12735 echo "$as_me:12735: result: $ac_cv_header_xcurses_h" >&5
12736 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
12737 if test $ac_cv_header_xcurses_h = yes; then
12738   cat >>confdefs.h <<\EOF
12739 #define HAVE_XCURSES 1
12740 EOF
12741
12742 fi
12743
12744 else
12745         { { echo "$as_me:12745: error: Cannot link with XCurses" >&5
12746 echo "$as_me: error: Cannot link with XCurses" >&2;}
12747    { (exit 1); exit 1; }; }
12748 fi
12749
12750         ;;
12751 esac
12752
12753 case $cf_cv_screen in #(vi
12754 pdcurses) #(vi
12755         ;;
12756 *)
12757         # look for curses-related libraries
12758
12759 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
12760 echo "$as_me:12760: checking for new_panel in -lpanel$cf_cv_libtype" >&5
12761 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
12762 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12763   echo $ECHO_N "(cached) $ECHO_C" >&6
12764 else
12765   ac_check_lib_save_LIBS=$LIBS
12766 LIBS="-lpanel$cf_cv_libtype  $LIBS"
12767 cat >conftest.$ac_ext <<_ACEOF
12768 #line 12768 "configure"
12769 #include "confdefs.h"
12770
12771 /* Override any gcc2 internal prototype to avoid an error.  */
12772 #ifdef __cplusplus
12773 extern "C"
12774 #endif
12775 /* We use char because int might match the return type of a gcc2
12776    builtin and then its argument prototype would still apply.  */
12777 char new_panel ();
12778 int
12779 main ()
12780 {
12781 new_panel ();
12782   ;
12783   return 0;
12784 }
12785 _ACEOF
12786 rm -f conftest.$ac_objext conftest$ac_exeext
12787 if { (eval echo "$as_me:12787: \"$ac_link\"") >&5
12788   (eval $ac_link) 2>&5
12789   ac_status=$?
12790   echo "$as_me:12790: \$? = $ac_status" >&5
12791   (exit $ac_status); } &&
12792          { ac_try='test -s conftest$ac_exeext'
12793   { (eval echo "$as_me:12793: \"$ac_try\"") >&5
12794   (eval $ac_try) 2>&5
12795   ac_status=$?
12796   echo "$as_me:12796: \$? = $ac_status" >&5
12797   (exit $ac_status); }; }; then
12798   eval "$as_ac_Lib=yes"
12799 else
12800   echo "$as_me: failed program was:" >&5
12801 cat conftest.$ac_ext >&5
12802 eval "$as_ac_Lib=no"
12803 fi
12804 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12805 LIBS=$ac_check_lib_save_LIBS
12806 fi
12807 echo "$as_me:12807: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12808 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12809 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12810   cat >>confdefs.h <<EOF
12811 #define `echo "HAVE_LIBpanel$cf_cv_libtype" | $as_tr_cpp` 1
12812 EOF
12813
12814   LIBS="-lpanel$cf_cv_libtype $LIBS"
12815
12816 fi
12817
12818 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
12819 echo "$as_me:12819: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
12820 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
12821 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12822   echo $ECHO_N "(cached) $ECHO_C" >&6
12823 else
12824   ac_check_lib_save_LIBS=$LIBS
12825 LIBS="-lmenu$cf_cv_libtype  $LIBS"
12826 cat >conftest.$ac_ext <<_ACEOF
12827 #line 12827 "configure"
12828 #include "confdefs.h"
12829
12830 /* Override any gcc2 internal prototype to avoid an error.  */
12831 #ifdef __cplusplus
12832 extern "C"
12833 #endif
12834 /* We use char because int might match the return type of a gcc2
12835    builtin and then its argument prototype would still apply.  */
12836 char menu_driver ();
12837 int
12838 main ()
12839 {
12840 menu_driver ();
12841   ;
12842   return 0;
12843 }
12844 _ACEOF
12845 rm -f conftest.$ac_objext conftest$ac_exeext
12846 if { (eval echo "$as_me:12846: \"$ac_link\"") >&5
12847   (eval $ac_link) 2>&5
12848   ac_status=$?
12849   echo "$as_me:12849: \$? = $ac_status" >&5
12850   (exit $ac_status); } &&
12851          { ac_try='test -s conftest$ac_exeext'
12852   { (eval echo "$as_me:12852: \"$ac_try\"") >&5
12853   (eval $ac_try) 2>&5
12854   ac_status=$?
12855   echo "$as_me:12855: \$? = $ac_status" >&5
12856   (exit $ac_status); }; }; then
12857   eval "$as_ac_Lib=yes"
12858 else
12859   echo "$as_me: failed program was:" >&5
12860 cat conftest.$ac_ext >&5
12861 eval "$as_ac_Lib=no"
12862 fi
12863 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12864 LIBS=$ac_check_lib_save_LIBS
12865 fi
12866 echo "$as_me:12866: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12867 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12868 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12869   cat >>confdefs.h <<EOF
12870 #define `echo "HAVE_LIBmenu$cf_cv_libtype" | $as_tr_cpp` 1
12871 EOF
12872
12873   LIBS="-lmenu$cf_cv_libtype $LIBS"
12874
12875 fi
12876
12877 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
12878 echo "$as_me:12878: checking for form_driver in -lform$cf_cv_libtype" >&5
12879 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
12880 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12881   echo $ECHO_N "(cached) $ECHO_C" >&6
12882 else
12883   ac_check_lib_save_LIBS=$LIBS
12884 LIBS="-lform$cf_cv_libtype  $LIBS"
12885 cat >conftest.$ac_ext <<_ACEOF
12886 #line 12886 "configure"
12887 #include "confdefs.h"
12888
12889 /* Override any gcc2 internal prototype to avoid an error.  */
12890 #ifdef __cplusplus
12891 extern "C"
12892 #endif
12893 /* We use char because int might match the return type of a gcc2
12894    builtin and then its argument prototype would still apply.  */
12895 char form_driver ();
12896 int
12897 main ()
12898 {
12899 form_driver ();
12900   ;
12901   return 0;
12902 }
12903 _ACEOF
12904 rm -f conftest.$ac_objext conftest$ac_exeext
12905 if { (eval echo "$as_me:12905: \"$ac_link\"") >&5
12906   (eval $ac_link) 2>&5
12907   ac_status=$?
12908   echo "$as_me:12908: \$? = $ac_status" >&5
12909   (exit $ac_status); } &&
12910          { ac_try='test -s conftest$ac_exeext'
12911   { (eval echo "$as_me:12911: \"$ac_try\"") >&5
12912   (eval $ac_try) 2>&5
12913   ac_status=$?
12914   echo "$as_me:12914: \$? = $ac_status" >&5
12915   (exit $ac_status); }; }; then
12916   eval "$as_ac_Lib=yes"
12917 else
12918   echo "$as_me: failed program was:" >&5
12919 cat conftest.$ac_ext >&5
12920 eval "$as_ac_Lib=no"
12921 fi
12922 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12923 LIBS=$ac_check_lib_save_LIBS
12924 fi
12925 echo "$as_me:12925: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12926 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12927 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12928   cat >>confdefs.h <<EOF
12929 #define `echo "HAVE_LIBform$cf_cv_libtype" | $as_tr_cpp` 1
12930 EOF
12931
12932   LIBS="-lform$cf_cv_libtype $LIBS"
12933
12934 fi
12935
12936         # look for curses-related headers
12937
12938 for ac_header in \
12939                 nc_alloc.h \
12940                 nomacros.h \
12941                 form.h \
12942                 menu.h \
12943                 panel.h \
12944                 term_entry.h \
12945
12946 do
12947 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12948 echo "$as_me:12948: checking for $ac_header" >&5
12949 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12950 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12951   echo $ECHO_N "(cached) $ECHO_C" >&6
12952 else
12953   cat >conftest.$ac_ext <<_ACEOF
12954 #line 12954 "configure"
12955 #include "confdefs.h"
12956 #include <$ac_header>
12957 _ACEOF
12958 if { (eval echo "$as_me:12958: \"$ac_cpp conftest.$ac_ext\"") >&5
12959   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12960   ac_status=$?
12961   egrep -v '^ *\+' conftest.er1 >conftest.err
12962   rm -f conftest.er1
12963   cat conftest.err >&5
12964   echo "$as_me:12964: \$? = $ac_status" >&5
12965   (exit $ac_status); } >/dev/null; then
12966   if test -s conftest.err; then
12967     ac_cpp_err=$ac_c_preproc_warn_flag
12968   else
12969     ac_cpp_err=
12970   fi
12971 else
12972   ac_cpp_err=yes
12973 fi
12974 if test -z "$ac_cpp_err"; then
12975   eval "$as_ac_Header=yes"
12976 else
12977   echo "$as_me: failed program was:" >&5
12978   cat conftest.$ac_ext >&5
12979   eval "$as_ac_Header=no"
12980 fi
12981 rm -f conftest.err conftest.$ac_ext
12982 fi
12983 echo "$as_me:12983: result: `eval echo '${'$as_ac_Header'}'`" >&5
12984 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12985 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12986   cat >>confdefs.h <<EOF
12987 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12988 EOF
12989
12990 fi
12991 done
12992
12993         ;;
12994 esac
12995
12996 echo "$as_me:12996: checking return type of signal handlers" >&5
12997 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
12998 if test "${ac_cv_type_signal+set}" = set; then
12999   echo $ECHO_N "(cached) $ECHO_C" >&6
13000 else
13001   cat >conftest.$ac_ext <<_ACEOF
13002 #line 13002 "configure"
13003 #include "confdefs.h"
13004 #include <sys/types.h>
13005 #include <signal.h>
13006 #ifdef signal
13007 # undef signal
13008 #endif
13009 #ifdef __cplusplus
13010 extern "C" void (*signal (int, void (*)(int)))(int);
13011 #else
13012 void (*signal ()) ();
13013 #endif
13014
13015 int
13016 main ()
13017 {
13018 int i;
13019   ;
13020   return 0;
13021 }
13022 _ACEOF
13023 rm -f conftest.$ac_objext
13024 if { (eval echo "$as_me:13024: \"$ac_compile\"") >&5
13025   (eval $ac_compile) 2>&5
13026   ac_status=$?
13027   echo "$as_me:13027: \$? = $ac_status" >&5
13028   (exit $ac_status); } &&
13029          { ac_try='test -s conftest.$ac_objext'
13030   { (eval echo "$as_me:13030: \"$ac_try\"") >&5
13031   (eval $ac_try) 2>&5
13032   ac_status=$?
13033   echo "$as_me:13033: \$? = $ac_status" >&5
13034   (exit $ac_status); }; }; then
13035   ac_cv_type_signal=void
13036 else
13037   echo "$as_me: failed program was:" >&5
13038 cat conftest.$ac_ext >&5
13039 ac_cv_type_signal=int
13040 fi
13041 rm -f conftest.$ac_objext conftest.$ac_ext
13042 fi
13043 echo "$as_me:13043: result: $ac_cv_type_signal" >&5
13044 echo "${ECHO_T}$ac_cv_type_signal" >&6
13045
13046 cat >>confdefs.h <<EOF
13047 #define RETSIGTYPE $ac_cv_type_signal
13048 EOF
13049
13050 echo "$as_me:13050: checking for ANSI C header files" >&5
13051 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13052 if test "${ac_cv_header_stdc+set}" = set; then
13053   echo $ECHO_N "(cached) $ECHO_C" >&6
13054 else
13055   cat >conftest.$ac_ext <<_ACEOF
13056 #line 13056 "configure"
13057 #include "confdefs.h"
13058 #include <stdlib.h>
13059 #include <stdarg.h>
13060 #include <string.h>
13061 #include <float.h>
13062
13063 _ACEOF
13064 if { (eval echo "$as_me:13064: \"$ac_cpp conftest.$ac_ext\"") >&5
13065   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13066   ac_status=$?
13067   egrep -v '^ *\+' conftest.er1 >conftest.err
13068   rm -f conftest.er1
13069   cat conftest.err >&5
13070   echo "$as_me:13070: \$? = $ac_status" >&5
13071   (exit $ac_status); } >/dev/null; then
13072   if test -s conftest.err; then
13073     ac_cpp_err=$ac_c_preproc_warn_flag
13074   else
13075     ac_cpp_err=
13076   fi
13077 else
13078   ac_cpp_err=yes
13079 fi
13080 if test -z "$ac_cpp_err"; then
13081   ac_cv_header_stdc=yes
13082 else
13083   echo "$as_me: failed program was:" >&5
13084   cat conftest.$ac_ext >&5
13085   ac_cv_header_stdc=no
13086 fi
13087 rm -f conftest.err conftest.$ac_ext
13088
13089 if test $ac_cv_header_stdc = yes; then
13090   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13091   cat >conftest.$ac_ext <<_ACEOF
13092 #line 13092 "configure"
13093 #include "confdefs.h"
13094 #include <string.h>
13095
13096 _ACEOF
13097 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13098   egrep "memchr" >/dev/null 2>&1; then
13099   :
13100 else
13101   ac_cv_header_stdc=no
13102 fi
13103 rm -rf conftest*
13104
13105 fi
13106
13107 if test $ac_cv_header_stdc = yes; then
13108   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13109   cat >conftest.$ac_ext <<_ACEOF
13110 #line 13110 "configure"
13111 #include "confdefs.h"
13112 #include <stdlib.h>
13113
13114 _ACEOF
13115 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13116   egrep "free" >/dev/null 2>&1; then
13117   :
13118 else
13119   ac_cv_header_stdc=no
13120 fi
13121 rm -rf conftest*
13122
13123 fi
13124
13125 if test $ac_cv_header_stdc = yes; then
13126   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13127   if test "$cross_compiling" = yes; then
13128   :
13129 else
13130   cat >conftest.$ac_ext <<_ACEOF
13131 #line 13131 "configure"
13132 #include "confdefs.h"
13133 #include <ctype.h>
13134 #if ((' ' & 0x0FF) == 0x020)
13135 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13136 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13137 #else
13138 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13139                      || ('j' <= (c) && (c) <= 'r') \
13140                      || ('s' <= (c) && (c) <= 'z'))
13141 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13142 #endif
13143
13144 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13145 int
13146 main ()
13147 {
13148   int i;
13149   for (i = 0; i < 256; i++)
13150     if (XOR (islower (i), ISLOWER (i))
13151         || toupper (i) != TOUPPER (i))
13152       $ac_main_return(2);
13153   $ac_main_return (0);
13154 }
13155 _ACEOF
13156 rm -f conftest$ac_exeext
13157 if { (eval echo "$as_me:13157: \"$ac_link\"") >&5
13158   (eval $ac_link) 2>&5
13159   ac_status=$?
13160   echo "$as_me:13160: \$? = $ac_status" >&5
13161   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13162   { (eval echo "$as_me:13162: \"$ac_try\"") >&5
13163   (eval $ac_try) 2>&5
13164   ac_status=$?
13165   echo "$as_me:13165: \$? = $ac_status" >&5
13166   (exit $ac_status); }; }; then
13167   :
13168 else
13169   echo "$as_me: program exited with status $ac_status" >&5
13170 echo "$as_me: failed program was:" >&5
13171 cat conftest.$ac_ext >&5
13172 ac_cv_header_stdc=no
13173 fi
13174 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13175 fi
13176 fi
13177 fi
13178 echo "$as_me:13178: result: $ac_cv_header_stdc" >&5
13179 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13180 if test $ac_cv_header_stdc = yes; then
13181
13182 cat >>confdefs.h <<\EOF
13183 #define STDC_HEADERS 1
13184 EOF
13185
13186 fi
13187
13188 echo "$as_me:13188: checking whether time.h and sys/time.h may both be included" >&5
13189 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13190 if test "${ac_cv_header_time+set}" = set; then
13191   echo $ECHO_N "(cached) $ECHO_C" >&6
13192 else
13193   cat >conftest.$ac_ext <<_ACEOF
13194 #line 13194 "configure"
13195 #include "confdefs.h"
13196 #include <sys/types.h>
13197 #include <sys/time.h>
13198 #include <time.h>
13199
13200 int
13201 main ()
13202 {
13203 if ((struct tm *) 0)
13204 return 0;
13205   ;
13206   return 0;
13207 }
13208 _ACEOF
13209 rm -f conftest.$ac_objext
13210 if { (eval echo "$as_me:13210: \"$ac_compile\"") >&5
13211   (eval $ac_compile) 2>&5
13212   ac_status=$?
13213   echo "$as_me:13213: \$? = $ac_status" >&5
13214   (exit $ac_status); } &&
13215          { ac_try='test -s conftest.$ac_objext'
13216   { (eval echo "$as_me:13216: \"$ac_try\"") >&5
13217   (eval $ac_try) 2>&5
13218   ac_status=$?
13219   echo "$as_me:13219: \$? = $ac_status" >&5
13220   (exit $ac_status); }; }; then
13221   ac_cv_header_time=yes
13222 else
13223   echo "$as_me: failed program was:" >&5
13224 cat conftest.$ac_ext >&5
13225 ac_cv_header_time=no
13226 fi
13227 rm -f conftest.$ac_objext conftest.$ac_ext
13228 fi
13229 echo "$as_me:13229: result: $ac_cv_header_time" >&5
13230 echo "${ECHO_T}$ac_cv_header_time" >&6
13231 if test $ac_cv_header_time = yes; then
13232
13233 cat >>confdefs.h <<\EOF
13234 #define TIME_WITH_SYS_TIME 1
13235 EOF
13236
13237 fi
13238
13239 for ac_header in \
13240 getopt.h \
13241 locale.h \
13242 math.h \
13243 stdarg.h \
13244 sys/ioctl.h \
13245 sys/select.h \
13246 sys/time.h \
13247 termios.h \
13248 unistd.h \
13249
13250 do
13251 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13252 echo "$as_me:13252: checking for $ac_header" >&5
13253 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13254 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13255   echo $ECHO_N "(cached) $ECHO_C" >&6
13256 else
13257   cat >conftest.$ac_ext <<_ACEOF
13258 #line 13258 "configure"
13259 #include "confdefs.h"
13260 #include <$ac_header>
13261 _ACEOF
13262 if { (eval echo "$as_me:13262: \"$ac_cpp conftest.$ac_ext\"") >&5
13263   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13264   ac_status=$?
13265   egrep -v '^ *\+' conftest.er1 >conftest.err
13266   rm -f conftest.er1
13267   cat conftest.err >&5
13268   echo "$as_me:13268: \$? = $ac_status" >&5
13269   (exit $ac_status); } >/dev/null; then
13270   if test -s conftest.err; then
13271     ac_cpp_err=$ac_c_preproc_warn_flag
13272   else
13273     ac_cpp_err=
13274   fi
13275 else
13276   ac_cpp_err=yes
13277 fi
13278 if test -z "$ac_cpp_err"; then
13279   eval "$as_ac_Header=yes"
13280 else
13281   echo "$as_me: failed program was:" >&5
13282   cat conftest.$ac_ext >&5
13283   eval "$as_ac_Header=no"
13284 fi
13285 rm -f conftest.err conftest.$ac_ext
13286 fi
13287 echo "$as_me:13287: result: `eval echo '${'$as_ac_Header'}'`" >&5
13288 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13289 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13290   cat >>confdefs.h <<EOF
13291 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13292 EOF
13293
13294 fi
13295 done
13296
13297 for ac_header in unistd.h getopt.h
13298 do
13299 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13300 echo "$as_me:13300: checking for $ac_header" >&5
13301 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13302 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13303   echo $ECHO_N "(cached) $ECHO_C" >&6
13304 else
13305   cat >conftest.$ac_ext <<_ACEOF
13306 #line 13306 "configure"
13307 #include "confdefs.h"
13308 #include <$ac_header>
13309 _ACEOF
13310 if { (eval echo "$as_me:13310: \"$ac_cpp conftest.$ac_ext\"") >&5
13311   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13312   ac_status=$?
13313   egrep -v '^ *\+' conftest.er1 >conftest.err
13314   rm -f conftest.er1
13315   cat conftest.err >&5
13316   echo "$as_me:13316: \$? = $ac_status" >&5
13317   (exit $ac_status); } >/dev/null; then
13318   if test -s conftest.err; then
13319     ac_cpp_err=$ac_c_preproc_warn_flag
13320   else
13321     ac_cpp_err=
13322   fi
13323 else
13324   ac_cpp_err=yes
13325 fi
13326 if test -z "$ac_cpp_err"; then
13327   eval "$as_ac_Header=yes"
13328 else
13329   echo "$as_me: failed program was:" >&5
13330   cat conftest.$ac_ext >&5
13331   eval "$as_ac_Header=no"
13332 fi
13333 rm -f conftest.err conftest.$ac_ext
13334 fi
13335 echo "$as_me:13335: result: `eval echo '${'$as_ac_Header'}'`" >&5
13336 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13337 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13338   cat >>confdefs.h <<EOF
13339 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13340 EOF
13341
13342 fi
13343 done
13344
13345 echo "$as_me:13345: checking for header declaring getopt variables" >&5
13346 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13347 if test "${cf_cv_getopt_header+set}" = set; then
13348   echo $ECHO_N "(cached) $ECHO_C" >&6
13349 else
13350
13351 cf_cv_getopt_header=none
13352 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13353 do
13354 cat >conftest.$ac_ext <<_ACEOF
13355 #line 13355 "configure"
13356 #include "confdefs.h"
13357
13358 #include <$cf_header>
13359 int
13360 main ()
13361 {
13362 int x = optind; char *y = optarg
13363   ;
13364   return 0;
13365 }
13366 _ACEOF
13367 rm -f conftest.$ac_objext
13368 if { (eval echo "$as_me:13368: \"$ac_compile\"") >&5
13369   (eval $ac_compile) 2>&5
13370   ac_status=$?
13371   echo "$as_me:13371: \$? = $ac_status" >&5
13372   (exit $ac_status); } &&
13373          { ac_try='test -s conftest.$ac_objext'
13374   { (eval echo "$as_me:13374: \"$ac_try\"") >&5
13375   (eval $ac_try) 2>&5
13376   ac_status=$?
13377   echo "$as_me:13377: \$? = $ac_status" >&5
13378   (exit $ac_status); }; }; then
13379   cf_cv_getopt_header=$cf_header
13380  break
13381 else
13382   echo "$as_me: failed program was:" >&5
13383 cat conftest.$ac_ext >&5
13384 fi
13385 rm -f conftest.$ac_objext conftest.$ac_ext
13386 done
13387
13388 fi
13389 echo "$as_me:13389: result: $cf_cv_getopt_header" >&5
13390 echo "${ECHO_T}$cf_cv_getopt_header" >&6
13391 if test $cf_cv_getopt_header != none ; then
13392         cat >>confdefs.h <<\EOF
13393 #define HAVE_GETOPT_HEADER 1
13394 EOF
13395
13396 fi
13397
13398 for ac_func in \
13399 gettimeofday \
13400 strdup \
13401
13402 do
13403 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13404 echo "$as_me:13404: checking for $ac_func" >&5
13405 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13406 if eval "test \"\${$as_ac_var+set}\" = set"; then
13407   echo $ECHO_N "(cached) $ECHO_C" >&6
13408 else
13409   cat >conftest.$ac_ext <<_ACEOF
13410 #line 13410 "configure"
13411 #include "confdefs.h"
13412 /* System header to define __stub macros and hopefully few prototypes,
13413     which can conflict with char $ac_func (); below.  */
13414 #include <assert.h>
13415 /* Override any gcc2 internal prototype to avoid an error.  */
13416 #ifdef __cplusplus
13417 extern "C"
13418 #endif
13419 /* We use char because int might match the return type of a gcc2
13420    builtin and then its argument prototype would still apply.  */
13421 char $ac_func ();
13422 char (*f) ();
13423
13424 int
13425 main ()
13426 {
13427 /* The GNU C library defines this for functions which it implements
13428     to always fail with ENOSYS.  Some functions are actually named
13429     something starting with __ and the normal name is an alias.  */
13430 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13431 choke me
13432 #else
13433 f = $ac_func;
13434 #endif
13435
13436   ;
13437   return 0;
13438 }
13439 _ACEOF
13440 rm -f conftest.$ac_objext conftest$ac_exeext
13441 if { (eval echo "$as_me:13441: \"$ac_link\"") >&5
13442   (eval $ac_link) 2>&5
13443   ac_status=$?
13444   echo "$as_me:13444: \$? = $ac_status" >&5
13445   (exit $ac_status); } &&
13446          { ac_try='test -s conftest$ac_exeext'
13447   { (eval echo "$as_me:13447: \"$ac_try\"") >&5
13448   (eval $ac_try) 2>&5
13449   ac_status=$?
13450   echo "$as_me:13450: \$? = $ac_status" >&5
13451   (exit $ac_status); }; }; then
13452   eval "$as_ac_var=yes"
13453 else
13454   echo "$as_me: failed program was:" >&5
13455 cat conftest.$ac_ext >&5
13456 eval "$as_ac_var=no"
13457 fi
13458 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13459 fi
13460 echo "$as_me:13460: result: `eval echo '${'$as_ac_var'}'`" >&5
13461 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13462 if test `eval echo '${'$as_ac_var'}'` = yes; then
13463   cat >>confdefs.h <<EOF
13464 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13465 EOF
13466
13467 fi
13468 done
13469
13470 if test "$cf_enable_widec" = yes; then
13471
13472 for ac_func in \
13473 mblen \
13474 mbrlen \
13475 mbrtowc \
13476 mbsrtowcs \
13477 mbstowcs \
13478 mbtowc \
13479 wcsrtombs \
13480 wcstombs \
13481
13482 do
13483 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13484 echo "$as_me:13484: checking for $ac_func" >&5
13485 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13486 if eval "test \"\${$as_ac_var+set}\" = set"; then
13487   echo $ECHO_N "(cached) $ECHO_C" >&6
13488 else
13489   cat >conftest.$ac_ext <<_ACEOF
13490 #line 13490 "configure"
13491 #include "confdefs.h"
13492 /* System header to define __stub macros and hopefully few prototypes,
13493     which can conflict with char $ac_func (); below.  */
13494 #include <assert.h>
13495 /* Override any gcc2 internal prototype to avoid an error.  */
13496 #ifdef __cplusplus
13497 extern "C"
13498 #endif
13499 /* We use char because int might match the return type of a gcc2
13500    builtin and then its argument prototype would still apply.  */
13501 char $ac_func ();
13502 char (*f) ();
13503
13504 int
13505 main ()
13506 {
13507 /* The GNU C library defines this for functions which it implements
13508     to always fail with ENOSYS.  Some functions are actually named
13509     something starting with __ and the normal name is an alias.  */
13510 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13511 choke me
13512 #else
13513 f = $ac_func;
13514 #endif
13515
13516   ;
13517   return 0;
13518 }
13519 _ACEOF
13520 rm -f conftest.$ac_objext conftest$ac_exeext
13521 if { (eval echo "$as_me:13521: \"$ac_link\"") >&5
13522   (eval $ac_link) 2>&5
13523   ac_status=$?
13524   echo "$as_me:13524: \$? = $ac_status" >&5
13525   (exit $ac_status); } &&
13526          { ac_try='test -s conftest$ac_exeext'
13527   { (eval echo "$as_me:13527: \"$ac_try\"") >&5
13528   (eval $ac_try) 2>&5
13529   ac_status=$?
13530   echo "$as_me:13530: \$? = $ac_status" >&5
13531   (exit $ac_status); }; }; then
13532   eval "$as_ac_var=yes"
13533 else
13534   echo "$as_me: failed program was:" >&5
13535 cat conftest.$ac_ext >&5
13536 eval "$as_ac_var=no"
13537 fi
13538 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13539 fi
13540 echo "$as_me:13540: result: `eval echo '${'$as_ac_var'}'`" >&5
13541 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13542 if test `eval echo '${'$as_ac_var'}'` = yes; then
13543   cat >>confdefs.h <<EOF
13544 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13545 EOF
13546
13547 fi
13548 done
13549
13550 fi
13551
13552 echo "$as_me:13552: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
13553 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
13554 if test "${cf_cv_need_xopen_extension+set}" = set; then
13555   echo $ECHO_N "(cached) $ECHO_C" >&6
13556 else
13557
13558 cat >conftest.$ac_ext <<_ACEOF
13559 #line 13559 "configure"
13560 #include "confdefs.h"
13561
13562 #include <stdlib.h>
13563 #include <${cf_cv_ncurses_header:-curses.h}>
13564 int
13565 main ()
13566 {
13567
13568 #if defined(NCURSES_VERSION_PATCH)
13569 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
13570         make an error
13571 #endif
13572 #endif
13573         long x = winnstr(stdscr, "", 0);
13574         int x1, y1;
13575         getbegyx(stdscr, y1, x1)
13576   ;
13577   return 0;
13578 }
13579 _ACEOF
13580 rm -f conftest.$ac_objext conftest$ac_exeext
13581 if { (eval echo "$as_me:13581: \"$ac_link\"") >&5
13582   (eval $ac_link) 2>&5
13583   ac_status=$?
13584   echo "$as_me:13584: \$? = $ac_status" >&5
13585   (exit $ac_status); } &&
13586          { ac_try='test -s conftest$ac_exeext'
13587   { (eval echo "$as_me:13587: \"$ac_try\"") >&5
13588   (eval $ac_try) 2>&5
13589   ac_status=$?
13590   echo "$as_me:13590: \$? = $ac_status" >&5
13591   (exit $ac_status); }; }; then
13592   cf_cv_need_xopen_extension=no
13593 else
13594   echo "$as_me: failed program was:" >&5
13595 cat conftest.$ac_ext >&5
13596 cat >conftest.$ac_ext <<_ACEOF
13597 #line 13597 "configure"
13598 #include "confdefs.h"
13599
13600 #define _XOPEN_SOURCE_EXTENDED
13601 #include <stdlib.h>
13602 #include <${cf_cv_ncurses_header:-curses.h}>
13603 int
13604 main ()
13605 {
13606
13607 #ifdef NCURSES_VERSION
13608         cchar_t check;
13609         int check2 = curs_set((int)sizeof(check));
13610 #endif
13611         long x = winnstr(stdscr, "", 0);
13612         int x1, y1;
13613         getbegyx(stdscr, y1, x1)
13614   ;
13615   return 0;
13616 }
13617 _ACEOF
13618 rm -f conftest.$ac_objext conftest$ac_exeext
13619 if { (eval echo "$as_me:13619: \"$ac_link\"") >&5
13620   (eval $ac_link) 2>&5
13621   ac_status=$?
13622   echo "$as_me:13622: \$? = $ac_status" >&5
13623   (exit $ac_status); } &&
13624          { ac_try='test -s conftest$ac_exeext'
13625   { (eval echo "$as_me:13625: \"$ac_try\"") >&5
13626   (eval $ac_try) 2>&5
13627   ac_status=$?
13628   echo "$as_me:13628: \$? = $ac_status" >&5
13629   (exit $ac_status); }; }; then
13630   cf_cv_need_xopen_extension=yes
13631 else
13632   echo "$as_me: failed program was:" >&5
13633 cat conftest.$ac_ext >&5
13634 cf_cv_need_xopen_extension=unknown
13635 fi
13636 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13637 fi
13638 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13639 fi
13640 echo "$as_me:13640: result: $cf_cv_need_xopen_extension" >&5
13641 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
13642 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
13643
13644 echo "$as_me:13644: checking for term.h" >&5
13645 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
13646 if test "${cf_cv_term_header+set}" = set; then
13647   echo $ECHO_N "(cached) $ECHO_C" >&6
13648 else
13649
13650 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
13651 # for <term.h> if we do not find the variant.
13652
13653 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
13654
13655 case ${cf_cv_ncurses_header:-curses.h} in #(vi
13656 */*)
13657         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
13658         cf_header_list="$cf_header_item $cf_header_list"
13659         ;;
13660 esac
13661
13662 for cf_header in $cf_header_list
13663 do
13664         cat >conftest.$ac_ext <<_ACEOF
13665 #line 13665 "configure"
13666 #include "confdefs.h"
13667
13668 #include <${cf_cv_ncurses_header:-curses.h}>
13669 #include <${cf_header}>
13670 int
13671 main ()
13672 {
13673 WINDOW *x
13674   ;
13675   return 0;
13676 }
13677 _ACEOF
13678 rm -f conftest.$ac_objext
13679 if { (eval echo "$as_me:13679: \"$ac_compile\"") >&5
13680   (eval $ac_compile) 2>&5
13681   ac_status=$?
13682   echo "$as_me:13682: \$? = $ac_status" >&5
13683   (exit $ac_status); } &&
13684          { ac_try='test -s conftest.$ac_objext'
13685   { (eval echo "$as_me:13685: \"$ac_try\"") >&5
13686   (eval $ac_try) 2>&5
13687   ac_status=$?
13688   echo "$as_me:13688: \$? = $ac_status" >&5
13689   (exit $ac_status); }; }; then
13690   cf_cv_term_header=$cf_header
13691          break
13692 else
13693   echo "$as_me: failed program was:" >&5
13694 cat conftest.$ac_ext >&5
13695 cf_cv_term_header=no
13696 fi
13697 rm -f conftest.$ac_objext conftest.$ac_ext
13698 done
13699
13700 case $cf_cv_term_header in #(vi
13701 no)
13702         # If curses is ncurses, some packagers still mess it up by trying to make
13703         # us use GNU termcap.  This handles the most common case.
13704         for cf_header in ncurses/term.h ncursesw/term.h
13705         do
13706                 cat >conftest.$ac_ext <<_ACEOF
13707 #line 13707 "configure"
13708 #include "confdefs.h"
13709
13710 #include <${cf_cv_ncurses_header:-curses.h}>
13711 #ifdef NCURSES_VERSION
13712 #include <${cf_header}>
13713 #else
13714 make an error
13715 #endif
13716 int
13717 main ()
13718 {
13719 WINDOW *x
13720   ;
13721   return 0;
13722 }
13723 _ACEOF
13724 rm -f conftest.$ac_objext
13725 if { (eval echo "$as_me:13725: \"$ac_compile\"") >&5
13726   (eval $ac_compile) 2>&5
13727   ac_status=$?
13728   echo "$as_me:13728: \$? = $ac_status" >&5
13729   (exit $ac_status); } &&
13730          { ac_try='test -s conftest.$ac_objext'
13731   { (eval echo "$as_me:13731: \"$ac_try\"") >&5
13732   (eval $ac_try) 2>&5
13733   ac_status=$?
13734   echo "$as_me:13734: \$? = $ac_status" >&5
13735   (exit $ac_status); }; }; then
13736   cf_cv_term_header=$cf_header
13737                          break
13738 else
13739   echo "$as_me: failed program was:" >&5
13740 cat conftest.$ac_ext >&5
13741 cf_cv_term_header=no
13742 fi
13743 rm -f conftest.$ac_objext conftest.$ac_ext
13744         done
13745         ;;
13746 esac
13747
13748 fi
13749 echo "$as_me:13749: result: $cf_cv_term_header" >&5
13750 echo "${ECHO_T}$cf_cv_term_header" >&6
13751
13752 case $cf_cv_term_header in #(vi
13753 term.h) #(vi
13754         cat >>confdefs.h <<\EOF
13755 #define HAVE_TERM_H 1
13756 EOF
13757
13758         ;;
13759 ncurses/term.h) #(vi
13760         cat >>confdefs.h <<\EOF
13761 #define HAVE_NCURSES_TERM_H 1
13762 EOF
13763
13764         ;;
13765 ncursesw/term.h)
13766         cat >>confdefs.h <<\EOF
13767 #define HAVE_NCURSESW_TERM_H 1
13768 EOF
13769
13770         ;;
13771 esac
13772
13773 echo "$as_me:13773: checking for unctrl.h" >&5
13774 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
13775 if test "${cf_cv_unctrl_header+set}" = set; then
13776   echo $ECHO_N "(cached) $ECHO_C" >&6
13777 else
13778
13779 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
13780 # for <unctrl.h> if we do not find the variant.
13781
13782 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
13783
13784 case ${cf_cv_ncurses_header:-curses.h} in #(vi
13785 */*)
13786         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
13787         cf_header_list="$cf_header_item $cf_header_list"
13788         ;;
13789 esac
13790
13791 for cf_header in $cf_header_list
13792 do
13793         cat >conftest.$ac_ext <<_ACEOF
13794 #line 13794 "configure"
13795 #include "confdefs.h"
13796
13797 #include <${cf_cv_ncurses_header:-curses.h}>
13798 #include <${cf_header}>
13799 int
13800 main ()
13801 {
13802 WINDOW *x
13803   ;
13804   return 0;
13805 }
13806 _ACEOF
13807 rm -f conftest.$ac_objext
13808 if { (eval echo "$as_me:13808: \"$ac_compile\"") >&5
13809   (eval $ac_compile) 2>&5
13810   ac_status=$?
13811   echo "$as_me:13811: \$? = $ac_status" >&5
13812   (exit $ac_status); } &&
13813          { ac_try='test -s conftest.$ac_objext'
13814   { (eval echo "$as_me:13814: \"$ac_try\"") >&5
13815   (eval $ac_try) 2>&5
13816   ac_status=$?
13817   echo "$as_me:13817: \$? = $ac_status" >&5
13818   (exit $ac_status); }; }; then
13819   cf_cv_unctrl_header=$cf_header
13820          break
13821 else
13822   echo "$as_me: failed program was:" >&5
13823 cat conftest.$ac_ext >&5
13824 cf_cv_unctrl_header=no
13825 fi
13826 rm -f conftest.$ac_objext conftest.$ac_ext
13827 done
13828
13829 case $cf_cv_unctrl_header in #(vi
13830 no)
13831         { echo "$as_me:13831: WARNING: unctrl.h header not found" >&5
13832 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
13833         ;;
13834 esac
13835
13836 fi
13837 echo "$as_me:13837: result: $cf_cv_unctrl_header" >&5
13838 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
13839
13840 case $cf_cv_unctrl_header in #(vi
13841 unctrl.h) #(vi
13842         cat >>confdefs.h <<\EOF
13843 #define HAVE_UNCTRL_H 1
13844 EOF
13845
13846         ;;
13847 ncurses/unctrl.h) #(vi
13848         cat >>confdefs.h <<\EOF
13849 #define HAVE_NCURSES_UNCTRL_H 1
13850 EOF
13851
13852         ;;
13853 ncursesw/unctrl.h)
13854         cat >>confdefs.h <<\EOF
13855 #define HAVE_NCURSESW_UNCTRL_H 1
13856 EOF
13857
13858         ;;
13859 esac
13860
13861 for cf_func in \
13862 assume_default_colors \
13863 chgat \
13864 color_set \
13865 filter \
13866 getbegx \
13867 getcurx \
13868 getmaxx \
13869 getnstr \
13870 getparx \
13871 getwin \
13872 mvvline \
13873 mvwvline \
13874 napms \
13875 putwin \
13876 resize_term \
13877 resizeterm \
13878 ripoffline \
13879 scr_dump \
13880 setupterm \
13881 slk_color \
13882 slk_init \
13883 termattrs \
13884 tgetent \
13885 tigetnum \
13886 tigetstr \
13887 typeahead \
13888 use_default_colors \
13889 use_screen \
13890 use_window \
13891 vsscanf \
13892 vw_printw \
13893 wchgat \
13894 winsstr \
13895 wresize \
13896 wsyncdown \
13897
13898 do
13899
13900 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13901
13902         echo "$as_me:13902: checking for ${cf_func}" >&5
13903 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
13904
13905 echo "${as_me:-configure}:13905: testing ${cf_func} ..." 1>&5
13906
13907         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
13908   echo $ECHO_N "(cached) $ECHO_C" >&6
13909 else
13910
13911                 eval cf_result='$ac_cv_func_'$cf_func
13912                 if test ".$cf_result" != ".no"; then
13913                         cat >conftest.$ac_ext <<_ACEOF
13914 #line 13914 "configure"
13915 #include "confdefs.h"
13916
13917 #ifdef HAVE_XCURSES
13918 #include <xcurses.h>
13919 char * XCursesProgramName = "test";
13920 #else
13921 #include <${cf_cv_ncurses_header:-curses.h}>
13922 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13923 #include <ncursesw/term.h>
13924 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13925 #include <ncurses/term.h>
13926 #elif defined(HAVE_TERM_H)
13927 #include <term.h>
13928 #endif
13929 #endif
13930
13931 int
13932 main ()
13933 {
13934
13935 #ifndef ${cf_func}
13936 long foo = (long)(&${cf_func});
13937 if (foo + 1234 > 5678)
13938         ${cf_cv_main_return:-return}(foo);
13939 #endif
13940
13941   ;
13942   return 0;
13943 }
13944 _ACEOF
13945 rm -f conftest.$ac_objext conftest$ac_exeext
13946 if { (eval echo "$as_me:13946: \"$ac_link\"") >&5
13947   (eval $ac_link) 2>&5
13948   ac_status=$?
13949   echo "$as_me:13949: \$? = $ac_status" >&5
13950   (exit $ac_status); } &&
13951          { ac_try='test -s conftest$ac_exeext'
13952   { (eval echo "$as_me:13952: \"$ac_try\"") >&5
13953   (eval $ac_try) 2>&5
13954   ac_status=$?
13955   echo "$as_me:13955: \$? = $ac_status" >&5
13956   (exit $ac_status); }; }; then
13957   cf_result=yes
13958 else
13959   echo "$as_me: failed program was:" >&5
13960 cat conftest.$ac_ext >&5
13961 cf_result=no
13962 fi
13963 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13964                 fi
13965                 eval 'cf_cv_func_'$cf_func'=$cf_result'
13966
13967 fi
13968
13969         # use the computed/retrieved cache-value:
13970         eval 'cf_result=$cf_cv_func_'$cf_func
13971         echo "$as_me:13971: result: $cf_result" >&5
13972 echo "${ECHO_T}$cf_result" >&6
13973         if test $cf_result != no; then
13974                 cat >>confdefs.h <<EOF
13975 #define HAVE_${cf_tr_func} 1
13976 EOF
13977
13978         fi
13979 done
13980
13981 for cf_func in tputs
13982 do
13983
13984 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13985
13986         echo "$as_me:13986: checking for ${cf_func}" >&5
13987 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
13988
13989 echo "${as_me:-configure}:13989: testing ${cf_func} ..." 1>&5
13990
13991         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
13992   echo $ECHO_N "(cached) $ECHO_C" >&6
13993 else
13994
13995                 eval cf_result='$ac_cv_func_'$cf_func
13996                 if test ".$cf_result" != ".no"; then
13997                         cat >conftest.$ac_ext <<_ACEOF
13998 #line 13998 "configure"
13999 #include "confdefs.h"
14000
14001 #ifdef HAVE_XCURSES
14002 #include <xcurses.h>
14003 char * XCursesProgramName = "test";
14004 #else
14005 #include <${cf_cv_ncurses_header:-curses.h}>
14006 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14007 #include <ncursesw/term.h>
14008 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14009 #include <ncurses/term.h>
14010 #elif defined(HAVE_TERM_H)
14011 #include <term.h>
14012 #endif
14013 #endif
14014
14015 int
14016 main ()
14017 {
14018
14019 #ifndef ${cf_func}
14020 long foo = (long)(&${cf_func});
14021 if (foo + 1234 > 5678)
14022         ${cf_cv_main_return:-return}(foo);
14023 #endif
14024
14025   ;
14026   return 0;
14027 }
14028 _ACEOF
14029 rm -f conftest.$ac_objext conftest$ac_exeext
14030 if { (eval echo "$as_me:14030: \"$ac_link\"") >&5
14031   (eval $ac_link) 2>&5
14032   ac_status=$?
14033   echo "$as_me:14033: \$? = $ac_status" >&5
14034   (exit $ac_status); } &&
14035          { ac_try='test -s conftest$ac_exeext'
14036   { (eval echo "$as_me:14036: \"$ac_try\"") >&5
14037   (eval $ac_try) 2>&5
14038   ac_status=$?
14039   echo "$as_me:14039: \$? = $ac_status" >&5
14040   (exit $ac_status); }; }; then
14041   cf_result=yes
14042 else
14043   echo "$as_me: failed program was:" >&5
14044 cat conftest.$ac_ext >&5
14045 cf_result=no
14046 fi
14047 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14048                 fi
14049                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14050
14051 fi
14052
14053         # use the computed/retrieved cache-value:
14054         eval 'cf_result=$cf_cv_func_'$cf_func
14055         echo "$as_me:14055: result: $cf_result" >&5
14056 echo "${ECHO_T}$cf_result" >&6
14057         if test $cf_result != no; then
14058                 cat >>confdefs.h <<EOF
14059 #define HAVE_${cf_tr_func} 1
14060 EOF
14061
14062         fi
14063 done
14064
14065 if test x$cf_cv_func_tputs = xyes
14066 then
14067         cf_done=no
14068         for cf_arg in int char
14069         do
14070                 for cf_ret in int void
14071                 do
14072                         if test $cf_ret = void
14073                         then
14074                                 cf_return="/* nothing */"
14075                         else
14076                                 cf_return="return value"
14077                         fi
14078                         cat >conftest.$ac_ext <<_ACEOF
14079 #line 14079 "configure"
14080 #include "confdefs.h"
14081
14082 #include <${cf_cv_ncurses_header:-curses.h}>
14083 #include <$cf_cv_term_header>
14084
14085 static $cf_ret outc($cf_arg value) { $cf_return; }
14086
14087 int
14088 main ()
14089 {
14090
14091         tputs("hello", 0, outc);
14092         ${cf_cv_main_return:-return}(0);
14093
14094   ;
14095   return 0;
14096 }
14097 _ACEOF
14098 rm -f conftest.$ac_objext
14099 if { (eval echo "$as_me:14099: \"$ac_compile\"") >&5
14100   (eval $ac_compile) 2>&5
14101   ac_status=$?
14102   echo "$as_me:14102: \$? = $ac_status" >&5
14103   (exit $ac_status); } &&
14104          { ac_try='test -s conftest.$ac_objext'
14105   { (eval echo "$as_me:14105: \"$ac_try\"") >&5
14106   (eval $ac_try) 2>&5
14107   ac_status=$?
14108   echo "$as_me:14108: \$? = $ac_status" >&5
14109   (exit $ac_status); }; }; then
14110
14111                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14112
14113 echo "${as_me:-configure}:14113: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14114
14115                 cat >>confdefs.h <<EOF
14116 #define TPUTS_ARG               $cf_arg
14117 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14118 #define TPUTS_RETURN(value)     $cf_return
14119 EOF
14120                 cf_done=yes
14121                 break
14122
14123 else
14124   echo "$as_me: failed program was:" >&5
14125 cat conftest.$ac_ext >&5
14126 fi
14127 rm -f conftest.$ac_objext conftest.$ac_ext
14128                 done
14129                 test $cf_done = yes && break
14130         done
14131 fi
14132
14133 echo "$as_me:14133: checking for ncurses extended functions" >&5
14134 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14135 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14136   echo $ECHO_N "(cached) $ECHO_C" >&6
14137 else
14138
14139 cat >conftest.$ac_ext <<_ACEOF
14140 #line 14140 "configure"
14141 #include "confdefs.h"
14142
14143 #include <${cf_cv_ncurses_header:-curses.h}>
14144 int
14145 main ()
14146 {
14147
14148 int x = NCURSES_EXT_FUNCS
14149
14150   ;
14151   return 0;
14152 }
14153 _ACEOF
14154 rm -f conftest.$ac_objext
14155 if { (eval echo "$as_me:14155: \"$ac_compile\"") >&5
14156   (eval $ac_compile) 2>&5
14157   ac_status=$?
14158   echo "$as_me:14158: \$? = $ac_status" >&5
14159   (exit $ac_status); } &&
14160          { ac_try='test -s conftest.$ac_objext'
14161   { (eval echo "$as_me:14161: \"$ac_try\"") >&5
14162   (eval $ac_try) 2>&5
14163   ac_status=$?
14164   echo "$as_me:14164: \$? = $ac_status" >&5
14165   (exit $ac_status); }; }; then
14166   cf_cv_ncurses_ext_funcs=defined
14167 else
14168   echo "$as_me: failed program was:" >&5
14169 cat conftest.$ac_ext >&5
14170
14171 cat >conftest.$ac_ext <<_ACEOF
14172 #line 14172 "configure"
14173 #include "confdefs.h"
14174
14175 #include <${cf_cv_ncurses_header:-curses.h}>
14176 int
14177 main ()
14178 {
14179
14180         (void) assume_default_colors (0, 0);
14181         (void) curses_version ();
14182         (void) define_key (0, 0);
14183         (void) is_term_resized (0, 0);
14184         (void) key_defined (0);
14185         (void) keybound (0, 0);
14186         (void) keyok (0, 0);
14187         (void) resize_term (0, 0);
14188         (void) resizeterm (0, 0);
14189         (void) use_default_colors ();
14190         (void) use_extended_names (0);
14191         (void) wresize (0, 0, 0);
14192   ;
14193   return 0;
14194 }
14195 _ACEOF
14196 rm -f conftest.$ac_objext conftest$ac_exeext
14197 if { (eval echo "$as_me:14197: \"$ac_link\"") >&5
14198   (eval $ac_link) 2>&5
14199   ac_status=$?
14200   echo "$as_me:14200: \$? = $ac_status" >&5
14201   (exit $ac_status); } &&
14202          { ac_try='test -s conftest$ac_exeext'
14203   { (eval echo "$as_me:14203: \"$ac_try\"") >&5
14204   (eval $ac_try) 2>&5
14205   ac_status=$?
14206   echo "$as_me:14206: \$? = $ac_status" >&5
14207   (exit $ac_status); }; }; then
14208   cf_cv_ncurses_ext_funcs=yes
14209 else
14210   echo "$as_me: failed program was:" >&5
14211 cat conftest.$ac_ext >&5
14212 cf_cv_ncurses_ext_funcs=no
14213 fi
14214 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14215
14216 fi
14217 rm -f conftest.$ac_objext conftest.$ac_ext
14218
14219 fi
14220 echo "$as_me:14220: result: $cf_cv_ncurses_ext_funcs" >&5
14221 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14222 test "$cf_cv_ncurses_ext_funcs" = yes && cat >>confdefs.h <<\EOF
14223 #define NCURSES_EXT_FUNCS 1
14224 EOF
14225
14226 if test "$cf_enable_widec" = yes
14227 then
14228         # workaround for systems with ncurses before 20111029, due to change of
14229         # feature test macro from _XPG5 to _XOPEN_SOURCE
14230         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14231         then
14232                 cf_define_xpg5=no
14233                 echo "$as_me:14233: checking if _XPG5 should be defined to enable wide-characters" >&5
14234 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14235
14236                 cat >conftest.$ac_ext <<_ACEOF
14237 #line 14237 "configure"
14238 #include "confdefs.h"
14239
14240 #include <${cf_cv_ncurses_header:-curses.h}>
14241 int
14242 main ()
14243 {
14244 int x = _XPG5
14245   ;
14246   return 0;
14247 }
14248 _ACEOF
14249 rm -f conftest.$ac_objext
14250 if { (eval echo "$as_me:14250: \"$ac_compile\"") >&5
14251   (eval $ac_compile) 2>&5
14252   ac_status=$?
14253   echo "$as_me:14253: \$? = $ac_status" >&5
14254   (exit $ac_status); } &&
14255          { ac_try='test -s conftest.$ac_objext'
14256   { (eval echo "$as_me:14256: \"$ac_try\"") >&5
14257   (eval $ac_try) 2>&5
14258   ac_status=$?
14259   echo "$as_me:14259: \$? = $ac_status" >&5
14260   (exit $ac_status); }; }; then
14261   :
14262 else
14263   echo "$as_me: failed program was:" >&5
14264 cat conftest.$ac_ext >&5
14265 cf_save_cppflags="$CPPFLAGS"
14266                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14267                          cat >conftest.$ac_ext <<_ACEOF
14268 #line 14268 "configure"
14269 #include "confdefs.h"
14270
14271 #include <${cf_cv_ncurses_header:-curses.h}>
14272 int
14273 main ()
14274 {
14275 int x = _XPG5
14276   ;
14277   return 0;
14278 }
14279 _ACEOF
14280 rm -f conftest.$ac_objext
14281 if { (eval echo "$as_me:14281: \"$ac_compile\"") >&5
14282   (eval $ac_compile) 2>&5
14283   ac_status=$?
14284   echo "$as_me:14284: \$? = $ac_status" >&5
14285   (exit $ac_status); } &&
14286          { ac_try='test -s conftest.$ac_objext'
14287   { (eval echo "$as_me:14287: \"$ac_try\"") >&5
14288   (eval $ac_try) 2>&5
14289   ac_status=$?
14290   echo "$as_me:14290: \$? = $ac_status" >&5
14291   (exit $ac_status); }; }; then
14292   cf_define_xpg5=yes
14293 else
14294   echo "$as_me: failed program was:" >&5
14295 cat conftest.$ac_ext >&5
14296 fi
14297 rm -f conftest.$ac_objext conftest.$ac_ext
14298                          CPPFLAGS="$cf_save_cppflags"
14299 fi
14300 rm -f conftest.$ac_objext conftest.$ac_ext
14301                 echo "$as_me:14301: result: $cf_define_xpg5" >&5
14302 echo "${ECHO_T}$cf_define_xpg5" >&6
14303
14304                 if test "$cf_define_xpg5" = yes
14305                 then
14306                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14307                 fi
14308         fi
14309
14310         echo "$as_me:14310: checking for wide-character functions" >&5
14311 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14312 if test "${cf_cv_widechar_funcs+set}" = set; then
14313   echo $ECHO_N "(cached) $ECHO_C" >&6
14314 else
14315
14316         cat >conftest.$ac_ext <<_ACEOF
14317 #line 14317 "configure"
14318 #include "confdefs.h"
14319
14320 #include <${cf_cv_ncurses_header:-curses.h}>
14321 int
14322 main ()
14323 {
14324
14325                 static wchar_t src_wchar[2];
14326                 static cchar_t dst_cchar;
14327                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
14328
14329   ;
14330   return 0;
14331 }
14332 _ACEOF
14333 rm -f conftest.$ac_objext conftest$ac_exeext
14334 if { (eval echo "$as_me:14334: \"$ac_link\"") >&5
14335   (eval $ac_link) 2>&5
14336   ac_status=$?
14337   echo "$as_me:14337: \$? = $ac_status" >&5
14338   (exit $ac_status); } &&
14339          { ac_try='test -s conftest$ac_exeext'
14340   { (eval echo "$as_me:14340: \"$ac_try\"") >&5
14341   (eval $ac_try) 2>&5
14342   ac_status=$?
14343   echo "$as_me:14343: \$? = $ac_status" >&5
14344   (exit $ac_status); }; }; then
14345   cf_cv_widechar_funcs=yes
14346 else
14347   echo "$as_me: failed program was:" >&5
14348 cat conftest.$ac_ext >&5
14349 cf_cv_widechar_funcs=no
14350 fi
14351 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14352
14353 fi
14354 echo "$as_me:14354: result: $cf_cv_widechar_funcs" >&5
14355 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
14356         if test "$cf_cv_widechar_funcs" != no ; then
14357                 cat >>confdefs.h <<\EOF
14358 #define USE_WIDEC_SUPPORT 1
14359 EOF
14360
14361         else
14362                 cat >>confdefs.h <<\EOF
14363 #define USE_WIDEC_SUPPORT 0
14364 EOF
14365
14366         fi
14367 else
14368         cat >>confdefs.h <<\EOF
14369 #define USE_WIDEC_SUPPORT 0
14370 EOF
14371
14372 fi
14373
14374 echo "$as_me:14374: checking if sys/time.h works with sys/select.h" >&5
14375 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
14376 if test "${cf_cv_sys_time_select+set}" = set; then
14377   echo $ECHO_N "(cached) $ECHO_C" >&6
14378 else
14379
14380 cat >conftest.$ac_ext <<_ACEOF
14381 #line 14381 "configure"
14382 #include "confdefs.h"
14383
14384 #include <sys/types.h>
14385 #ifdef HAVE_SYS_TIME_H
14386 #include <sys/time.h>
14387 #endif
14388 #ifdef HAVE_SYS_SELECT_H
14389 #include <sys/select.h>
14390 #endif
14391
14392 int
14393 main ()
14394 {
14395
14396   ;
14397   return 0;
14398 }
14399 _ACEOF
14400 rm -f conftest.$ac_objext
14401 if { (eval echo "$as_me:14401: \"$ac_compile\"") >&5
14402   (eval $ac_compile) 2>&5
14403   ac_status=$?
14404   echo "$as_me:14404: \$? = $ac_status" >&5
14405   (exit $ac_status); } &&
14406          { ac_try='test -s conftest.$ac_objext'
14407   { (eval echo "$as_me:14407: \"$ac_try\"") >&5
14408   (eval $ac_try) 2>&5
14409   ac_status=$?
14410   echo "$as_me:14410: \$? = $ac_status" >&5
14411   (exit $ac_status); }; }; then
14412   cf_cv_sys_time_select=yes
14413 else
14414   echo "$as_me: failed program was:" >&5
14415 cat conftest.$ac_ext >&5
14416 cf_cv_sys_time_select=no
14417 fi
14418 rm -f conftest.$ac_objext conftest.$ac_ext
14419
14420 fi
14421
14422 echo "$as_me:14422: result: $cf_cv_sys_time_select" >&5
14423 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
14424 test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF
14425 #define HAVE_SYS_TIME_SELECT 1
14426 EOF
14427
14428 echo "$as_me:14428: checking for function curses_version" >&5
14429 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
14430 if test "${cf_cv_func_curses_version+set}" = set; then
14431   echo $ECHO_N "(cached) $ECHO_C" >&6
14432 else
14433
14434 if test "$cross_compiling" = yes; then
14435   cf_cv_func_curses_version=unknown
14436 else
14437   cat >conftest.$ac_ext <<_ACEOF
14438 #line 14438 "configure"
14439 #include "confdefs.h"
14440
14441 #include <${cf_cv_ncurses_header:-curses.h}>
14442 int main()
14443 {
14444         char temp[1024];
14445         sprintf(temp, "%s\n", curses_version());
14446         ${cf_cv_main_return:-return}(0);
14447 }
14448
14449 _ACEOF
14450 rm -f conftest$ac_exeext
14451 if { (eval echo "$as_me:14451: \"$ac_link\"") >&5
14452   (eval $ac_link) 2>&5
14453   ac_status=$?
14454   echo "$as_me:14454: \$? = $ac_status" >&5
14455   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14456   { (eval echo "$as_me:14456: \"$ac_try\"") >&5
14457   (eval $ac_try) 2>&5
14458   ac_status=$?
14459   echo "$as_me:14459: \$? = $ac_status" >&5
14460   (exit $ac_status); }; }; then
14461   cf_cv_func_curses_version=yes
14462
14463 else
14464   echo "$as_me: program exited with status $ac_status" >&5
14465 echo "$as_me: failed program was:" >&5
14466 cat conftest.$ac_ext >&5
14467 cf_cv_func_curses_version=no
14468
14469 fi
14470 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14471 fi
14472 rm -f core
14473 fi
14474 echo "$as_me:14474: result: $cf_cv_func_curses_version" >&5
14475 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
14476 test "$cf_cv_func_curses_version" = yes && cat >>confdefs.h <<\EOF
14477 #define HAVE_CURSES_VERSION 1
14478 EOF
14479
14480 echo "$as_me:14480: checking for ncurses wrap-prefix" >&5
14481 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
14482
14483 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
14484 if test "${with_ncurses_wrap_prefix+set}" = set; then
14485   withval="$with_ncurses_wrap_prefix"
14486   NCURSES_WRAP_PREFIX=$withval
14487 else
14488   NCURSES_WRAP_PREFIX=_nc_
14489 fi;
14490 echo "$as_me:14490: result: $NCURSES_WRAP_PREFIX" >&5
14491 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14492
14493 echo "$as_me:14493: checking for alternate character set array" >&5
14494 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
14495 if test "${cf_cv_curses_acs_map+set}" = set; then
14496   echo $ECHO_N "(cached) $ECHO_C" >&6
14497 else
14498
14499 cf_cv_curses_acs_map=unknown
14500 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
14501 do
14502 cat >conftest.$ac_ext <<_ACEOF
14503 #line 14503 "configure"
14504 #include "confdefs.h"
14505
14506 #include <${cf_cv_ncurses_header:-curses.h}>
14507
14508 int
14509 main ()
14510 {
14511
14512 $name['k'] = ACS_PLUS
14513
14514   ;
14515   return 0;
14516 }
14517 _ACEOF
14518 rm -f conftest.$ac_objext conftest$ac_exeext
14519 if { (eval echo "$as_me:14519: \"$ac_link\"") >&5
14520   (eval $ac_link) 2>&5
14521   ac_status=$?
14522   echo "$as_me:14522: \$? = $ac_status" >&5
14523   (exit $ac_status); } &&
14524          { ac_try='test -s conftest$ac_exeext'
14525   { (eval echo "$as_me:14525: \"$ac_try\"") >&5
14526   (eval $ac_try) 2>&5
14527   ac_status=$?
14528   echo "$as_me:14528: \$? = $ac_status" >&5
14529   (exit $ac_status); }; }; then
14530   cf_cv_curses_acs_map=$name; break
14531 else
14532   echo "$as_me: failed program was:" >&5
14533 cat conftest.$ac_ext >&5
14534 fi
14535 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14536 done
14537
14538 fi
14539 echo "$as_me:14539: result: $cf_cv_curses_acs_map" >&5
14540 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
14541
14542 test "$cf_cv_curses_acs_map" != unknown && cat >>confdefs.h <<EOF
14543 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
14544 EOF
14545
14546 if test "$cf_enable_widec" = yes; then
14547
14548 echo "$as_me:14548: checking for wide alternate character set array" >&5
14549 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
14550 if test "${cf_cv_curses_wacs_map+set}" = set; then
14551   echo $ECHO_N "(cached) $ECHO_C" >&6
14552 else
14553
14554         cf_cv_curses_wacs_map=unknown
14555         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
14556         do
14557         cat >conftest.$ac_ext <<_ACEOF
14558 #line 14558 "configure"
14559 #include "confdefs.h"
14560
14561 #ifndef _XOPEN_SOURCE_EXTENDED
14562 #define _XOPEN_SOURCE_EXTENDED
14563 #endif
14564 #include <${cf_cv_ncurses_header:-curses.h}>
14565 int
14566 main ()
14567 {
14568 void *foo = &($name['k'])
14569   ;
14570   return 0;
14571 }
14572 _ACEOF
14573 rm -f conftest.$ac_objext conftest$ac_exeext
14574 if { (eval echo "$as_me:14574: \"$ac_link\"") >&5
14575   (eval $ac_link) 2>&5
14576   ac_status=$?
14577   echo "$as_me:14577: \$? = $ac_status" >&5
14578   (exit $ac_status); } &&
14579          { ac_try='test -s conftest$ac_exeext'
14580   { (eval echo "$as_me:14580: \"$ac_try\"") >&5
14581   (eval $ac_try) 2>&5
14582   ac_status=$?
14583   echo "$as_me:14583: \$? = $ac_status" >&5
14584   (exit $ac_status); }; }; then
14585   cf_cv_curses_wacs_map=$name
14586          break
14587 else
14588   echo "$as_me: failed program was:" >&5
14589 cat conftest.$ac_ext >&5
14590 fi
14591 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14592         done
14593 fi
14594 echo "$as_me:14594: result: $cf_cv_curses_wacs_map" >&5
14595 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
14596
14597 test "$cf_cv_curses_wacs_map" != unknown && cat >>confdefs.h <<EOF
14598 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
14599 EOF
14600
14601 echo "$as_me:14601: checking for wide alternate character constants" >&5
14602 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
14603 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
14604   echo $ECHO_N "(cached) $ECHO_C" >&6
14605 else
14606
14607 cf_cv_curses_wacs_symbols=no
14608 if test "$cf_cv_curses_wacs_map" != unknown
14609 then
14610         cat >conftest.$ac_ext <<_ACEOF
14611 #line 14611 "configure"
14612 #include "confdefs.h"
14613
14614 #ifndef _XOPEN_SOURCE_EXTENDED
14615 #define _XOPEN_SOURCE_EXTENDED
14616 #endif
14617 #include <${cf_cv_ncurses_header:-curses.h}>
14618 int
14619 main ()
14620 {
14621 cchar_t *foo = WACS_PLUS;
14622          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
14623   ;
14624   return 0;
14625 }
14626 _ACEOF
14627 rm -f conftest.$ac_objext conftest$ac_exeext
14628 if { (eval echo "$as_me:14628: \"$ac_link\"") >&5
14629   (eval $ac_link) 2>&5
14630   ac_status=$?
14631   echo "$as_me:14631: \$? = $ac_status" >&5
14632   (exit $ac_status); } &&
14633          { ac_try='test -s conftest$ac_exeext'
14634   { (eval echo "$as_me:14634: \"$ac_try\"") >&5
14635   (eval $ac_try) 2>&5
14636   ac_status=$?
14637   echo "$as_me:14637: \$? = $ac_status" >&5
14638   (exit $ac_status); }; }; then
14639   cf_cv_curses_wacs_symbols=yes
14640 else
14641   echo "$as_me: failed program was:" >&5
14642 cat conftest.$ac_ext >&5
14643 fi
14644 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14645 else
14646         cat >conftest.$ac_ext <<_ACEOF
14647 #line 14647 "configure"
14648 #include "confdefs.h"
14649
14650 #ifndef _XOPEN_SOURCE_EXTENDED
14651 #define _XOPEN_SOURCE_EXTENDED
14652 #endif
14653 #include <${cf_cv_ncurses_header:-curses.h}>
14654 int
14655 main ()
14656 {
14657 cchar_t *foo = WACS_PLUS
14658   ;
14659   return 0;
14660 }
14661 _ACEOF
14662 rm -f conftest.$ac_objext conftest$ac_exeext
14663 if { (eval echo "$as_me:14663: \"$ac_link\"") >&5
14664   (eval $ac_link) 2>&5
14665   ac_status=$?
14666   echo "$as_me:14666: \$? = $ac_status" >&5
14667   (exit $ac_status); } &&
14668          { ac_try='test -s conftest$ac_exeext'
14669   { (eval echo "$as_me:14669: \"$ac_try\"") >&5
14670   (eval $ac_try) 2>&5
14671   ac_status=$?
14672   echo "$as_me:14672: \$? = $ac_status" >&5
14673   (exit $ac_status); }; }; then
14674   cf_cv_curses_wacs_symbols=yes
14675 else
14676   echo "$as_me: failed program was:" >&5
14677 cat conftest.$ac_ext >&5
14678 fi
14679 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14680 fi
14681
14682 fi
14683 echo "$as_me:14683: result: $cf_cv_curses_wacs_symbols" >&5
14684 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
14685
14686 test "$cf_cv_curses_wacs_symbols" != no && cat >>confdefs.h <<\EOF
14687 #define CURSES_WACS_SYMBOLS 1
14688 EOF
14689
14690 fi
14691
14692 echo "$as_me:14692: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14693 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14694 cat >conftest.$ac_ext <<_ACEOF
14695 #line 14695 "configure"
14696 #include "confdefs.h"
14697
14698 #ifndef _XOPEN_SOURCE_EXTENDED
14699 #define _XOPEN_SOURCE_EXTENDED
14700 #endif
14701 #include <${cf_cv_ncurses_header:-curses.h}>
14702 int
14703 main ()
14704 {
14705
14706 attr_t foo
14707
14708   ;
14709   return 0;
14710 }
14711 _ACEOF
14712 rm -f conftest.$ac_objext
14713 if { (eval echo "$as_me:14713: \"$ac_compile\"") >&5
14714   (eval $ac_compile) 2>&5
14715   ac_status=$?
14716   echo "$as_me:14716: \$? = $ac_status" >&5
14717   (exit $ac_status); } &&
14718          { ac_try='test -s conftest.$ac_objext'
14719   { (eval echo "$as_me:14719: \"$ac_try\"") >&5
14720   (eval $ac_try) 2>&5
14721   ac_status=$?
14722   echo "$as_me:14722: \$? = $ac_status" >&5
14723   (exit $ac_status); }; }; then
14724   cf_result=yes
14725 else
14726   echo "$as_me: failed program was:" >&5
14727 cat conftest.$ac_ext >&5
14728 cf_result=no
14729 fi
14730 rm -f conftest.$ac_objext conftest.$ac_ext
14731 echo "$as_me:14731: result: $cf_result" >&5
14732 echo "${ECHO_T}$cf_result" >&6
14733 if test $cf_result = yes ; then
14734
14735 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14736
14737         cat >>confdefs.h <<EOF
14738 #define $cf_result 1
14739 EOF
14740
14741 else
14742         cat >>confdefs.h <<EOF
14743 #define attr_t long
14744 EOF
14745
14746 fi
14747
14748 if test "$cf_enable_widec" = yes; then
14749
14750 # This is needed on Tru64 5.0 to declare mbstate_t
14751 echo "$as_me:14751: checking if we must include wchar.h to declare mbstate_t" >&5
14752 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
14753 if test "${cf_cv_mbstate_t+set}" = set; then
14754   echo $ECHO_N "(cached) $ECHO_C" >&6
14755 else
14756
14757 cat >conftest.$ac_ext <<_ACEOF
14758 #line 14758 "configure"
14759 #include "confdefs.h"
14760
14761 #include <stdlib.h>
14762 #include <stdarg.h>
14763 #include <stdio.h>
14764 #ifdef HAVE_LIBUTF8_H
14765 #include <libutf8.h>
14766 #endif
14767 int
14768 main ()
14769 {
14770 mbstate_t state
14771   ;
14772   return 0;
14773 }
14774 _ACEOF
14775 rm -f conftest.$ac_objext
14776 if { (eval echo "$as_me:14776: \"$ac_compile\"") >&5
14777   (eval $ac_compile) 2>&5
14778   ac_status=$?
14779   echo "$as_me:14779: \$? = $ac_status" >&5
14780   (exit $ac_status); } &&
14781          { ac_try='test -s conftest.$ac_objext'
14782   { (eval echo "$as_me:14782: \"$ac_try\"") >&5
14783   (eval $ac_try) 2>&5
14784   ac_status=$?
14785   echo "$as_me:14785: \$? = $ac_status" >&5
14786   (exit $ac_status); }; }; then
14787   cf_cv_mbstate_t=no
14788 else
14789   echo "$as_me: failed program was:" >&5
14790 cat conftest.$ac_ext >&5
14791 cat >conftest.$ac_ext <<_ACEOF
14792 #line 14792 "configure"
14793 #include "confdefs.h"
14794
14795 #include <stdlib.h>
14796 #include <stdarg.h>
14797 #include <stdio.h>
14798 #include <wchar.h>
14799 #ifdef HAVE_LIBUTF8_H
14800 #include <libutf8.h>
14801 #endif
14802 int
14803 main ()
14804 {
14805 mbstate_t value
14806   ;
14807   return 0;
14808 }
14809 _ACEOF
14810 rm -f conftest.$ac_objext
14811 if { (eval echo "$as_me:14811: \"$ac_compile\"") >&5
14812   (eval $ac_compile) 2>&5
14813   ac_status=$?
14814   echo "$as_me:14814: \$? = $ac_status" >&5
14815   (exit $ac_status); } &&
14816          { ac_try='test -s conftest.$ac_objext'
14817   { (eval echo "$as_me:14817: \"$ac_try\"") >&5
14818   (eval $ac_try) 2>&5
14819   ac_status=$?
14820   echo "$as_me:14820: \$? = $ac_status" >&5
14821   (exit $ac_status); }; }; then
14822   cf_cv_mbstate_t=yes
14823 else
14824   echo "$as_me: failed program was:" >&5
14825 cat conftest.$ac_ext >&5
14826 cf_cv_mbstate_t=unknown
14827 fi
14828 rm -f conftest.$ac_objext conftest.$ac_ext
14829 fi
14830 rm -f conftest.$ac_objext conftest.$ac_ext
14831 fi
14832 echo "$as_me:14832: result: $cf_cv_mbstate_t" >&5
14833 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
14834
14835 if test "$cf_cv_mbstate_t" = yes ; then
14836         cat >>confdefs.h <<\EOF
14837 #define NEED_WCHAR_H 1
14838 EOF
14839
14840         NEED_WCHAR_H=1
14841 fi
14842
14843 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
14844 if test "$cf_cv_mbstate_t" = unknown ; then
14845         NCURSES_MBSTATE_T=1
14846 fi
14847
14848 # if we find mbstate_t in either place, use substitution to provide a fallback.
14849 if test "$cf_cv_mbstate_t" != unknown ; then
14850         NCURSES_OK_MBSTATE_T=1
14851 fi
14852
14853 # This is needed on Tru64 5.0 to declare wchar_t
14854 echo "$as_me:14854: checking if we must include wchar.h to declare wchar_t" >&5
14855 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
14856 if test "${cf_cv_wchar_t+set}" = set; then
14857   echo $ECHO_N "(cached) $ECHO_C" >&6
14858 else
14859
14860 cat >conftest.$ac_ext <<_ACEOF
14861 #line 14861 "configure"
14862 #include "confdefs.h"
14863
14864 #include <stdlib.h>
14865 #include <stdarg.h>
14866 #include <stdio.h>
14867 #ifdef HAVE_LIBUTF8_H
14868 #include <libutf8.h>
14869 #endif
14870 int
14871 main ()
14872 {
14873 wchar_t state
14874   ;
14875   return 0;
14876 }
14877 _ACEOF
14878 rm -f conftest.$ac_objext
14879 if { (eval echo "$as_me:14879: \"$ac_compile\"") >&5
14880   (eval $ac_compile) 2>&5
14881   ac_status=$?
14882   echo "$as_me:14882: \$? = $ac_status" >&5
14883   (exit $ac_status); } &&
14884          { ac_try='test -s conftest.$ac_objext'
14885   { (eval echo "$as_me:14885: \"$ac_try\"") >&5
14886   (eval $ac_try) 2>&5
14887   ac_status=$?
14888   echo "$as_me:14888: \$? = $ac_status" >&5
14889   (exit $ac_status); }; }; then
14890   cf_cv_wchar_t=no
14891 else
14892   echo "$as_me: failed program was:" >&5
14893 cat conftest.$ac_ext >&5
14894 cat >conftest.$ac_ext <<_ACEOF
14895 #line 14895 "configure"
14896 #include "confdefs.h"
14897
14898 #include <stdlib.h>
14899 #include <stdarg.h>
14900 #include <stdio.h>
14901 #include <wchar.h>
14902 #ifdef HAVE_LIBUTF8_H
14903 #include <libutf8.h>
14904 #endif
14905 int
14906 main ()
14907 {
14908 wchar_t value
14909   ;
14910   return 0;
14911 }
14912 _ACEOF
14913 rm -f conftest.$ac_objext
14914 if { (eval echo "$as_me:14914: \"$ac_compile\"") >&5
14915   (eval $ac_compile) 2>&5
14916   ac_status=$?
14917   echo "$as_me:14917: \$? = $ac_status" >&5
14918   (exit $ac_status); } &&
14919          { ac_try='test -s conftest.$ac_objext'
14920   { (eval echo "$as_me:14920: \"$ac_try\"") >&5
14921   (eval $ac_try) 2>&5
14922   ac_status=$?
14923   echo "$as_me:14923: \$? = $ac_status" >&5
14924   (exit $ac_status); }; }; then
14925   cf_cv_wchar_t=yes
14926 else
14927   echo "$as_me: failed program was:" >&5
14928 cat conftest.$ac_ext >&5
14929 cf_cv_wchar_t=unknown
14930 fi
14931 rm -f conftest.$ac_objext conftest.$ac_ext
14932 fi
14933 rm -f conftest.$ac_objext conftest.$ac_ext
14934 fi
14935 echo "$as_me:14935: result: $cf_cv_wchar_t" >&5
14936 echo "${ECHO_T}$cf_cv_wchar_t" >&6
14937
14938 if test "$cf_cv_wchar_t" = yes ; then
14939         cat >>confdefs.h <<\EOF
14940 #define NEED_WCHAR_H 1
14941 EOF
14942
14943         NEED_WCHAR_H=1
14944 fi
14945
14946 # if we do not find wchar_t in either place, use substitution to provide a fallback.
14947 if test "$cf_cv_wchar_t" = unknown ; then
14948         NCURSES_WCHAR_T=1
14949 fi
14950
14951 # if we find wchar_t in either place, use substitution to provide a fallback.
14952 if test "$cf_cv_wchar_t" != unknown ; then
14953         NCURSES_OK_WCHAR_T=1
14954 fi
14955
14956 # This is needed on Tru64 5.0 to declare wint_t
14957 echo "$as_me:14957: checking if we must include wchar.h to declare wint_t" >&5
14958 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
14959 if test "${cf_cv_wint_t+set}" = set; then
14960   echo $ECHO_N "(cached) $ECHO_C" >&6
14961 else
14962
14963 cat >conftest.$ac_ext <<_ACEOF
14964 #line 14964 "configure"
14965 #include "confdefs.h"
14966
14967 #include <stdlib.h>
14968 #include <stdarg.h>
14969 #include <stdio.h>
14970 #ifdef HAVE_LIBUTF8_H
14971 #include <libutf8.h>
14972 #endif
14973 int
14974 main ()
14975 {
14976 wint_t state
14977   ;
14978   return 0;
14979 }
14980 _ACEOF
14981 rm -f conftest.$ac_objext
14982 if { (eval echo "$as_me:14982: \"$ac_compile\"") >&5
14983   (eval $ac_compile) 2>&5
14984   ac_status=$?
14985   echo "$as_me:14985: \$? = $ac_status" >&5
14986   (exit $ac_status); } &&
14987          { ac_try='test -s conftest.$ac_objext'
14988   { (eval echo "$as_me:14988: \"$ac_try\"") >&5
14989   (eval $ac_try) 2>&5
14990   ac_status=$?
14991   echo "$as_me:14991: \$? = $ac_status" >&5
14992   (exit $ac_status); }; }; then
14993   cf_cv_wint_t=no
14994 else
14995   echo "$as_me: failed program was:" >&5
14996 cat conftest.$ac_ext >&5
14997 cat >conftest.$ac_ext <<_ACEOF
14998 #line 14998 "configure"
14999 #include "confdefs.h"
15000
15001 #include <stdlib.h>
15002 #include <stdarg.h>
15003 #include <stdio.h>
15004 #include <wchar.h>
15005 #ifdef HAVE_LIBUTF8_H
15006 #include <libutf8.h>
15007 #endif
15008 int
15009 main ()
15010 {
15011 wint_t value
15012   ;
15013   return 0;
15014 }
15015 _ACEOF
15016 rm -f conftest.$ac_objext
15017 if { (eval echo "$as_me:15017: \"$ac_compile\"") >&5
15018   (eval $ac_compile) 2>&5
15019   ac_status=$?
15020   echo "$as_me:15020: \$? = $ac_status" >&5
15021   (exit $ac_status); } &&
15022          { ac_try='test -s conftest.$ac_objext'
15023   { (eval echo "$as_me:15023: \"$ac_try\"") >&5
15024   (eval $ac_try) 2>&5
15025   ac_status=$?
15026   echo "$as_me:15026: \$? = $ac_status" >&5
15027   (exit $ac_status); }; }; then
15028   cf_cv_wint_t=yes
15029 else
15030   echo "$as_me: failed program was:" >&5
15031 cat conftest.$ac_ext >&5
15032 cf_cv_wint_t=unknown
15033 fi
15034 rm -f conftest.$ac_objext conftest.$ac_ext
15035 fi
15036 rm -f conftest.$ac_objext conftest.$ac_ext
15037 fi
15038 echo "$as_me:15038: result: $cf_cv_wint_t" >&5
15039 echo "${ECHO_T}$cf_cv_wint_t" >&6
15040
15041 if test "$cf_cv_wint_t" = yes ; then
15042         cat >>confdefs.h <<\EOF
15043 #define NEED_WCHAR_H 1
15044 EOF
15045
15046         NEED_WCHAR_H=1
15047 fi
15048
15049 # if we do not find wint_t in either place, use substitution to provide a fallback.
15050 if test "$cf_cv_wint_t" = unknown ; then
15051         NCURSES_WINT_T=1
15052 fi
15053
15054 # if we find wint_t in either place, use substitution to provide a fallback.
15055 if test "$cf_cv_wint_t" != unknown ; then
15056         NCURSES_OK_WINT_T=1
15057 fi
15058
15059         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15060
15061 echo "$as_me:15061: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15062 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15063 cat >conftest.$ac_ext <<_ACEOF
15064 #line 15064 "configure"
15065 #include "confdefs.h"
15066
15067 #ifndef _XOPEN_SOURCE_EXTENDED
15068 #define _XOPEN_SOURCE_EXTENDED
15069 #endif
15070 #include <${cf_cv_ncurses_header:-curses.h}>
15071 int
15072 main ()
15073 {
15074
15075 mbstate_t foo
15076
15077   ;
15078   return 0;
15079 }
15080 _ACEOF
15081 rm -f conftest.$ac_objext
15082 if { (eval echo "$as_me:15082: \"$ac_compile\"") >&5
15083   (eval $ac_compile) 2>&5
15084   ac_status=$?
15085   echo "$as_me:15085: \$? = $ac_status" >&5
15086   (exit $ac_status); } &&
15087          { ac_try='test -s conftest.$ac_objext'
15088   { (eval echo "$as_me:15088: \"$ac_try\"") >&5
15089   (eval $ac_try) 2>&5
15090   ac_status=$?
15091   echo "$as_me:15091: \$? = $ac_status" >&5
15092   (exit $ac_status); }; }; then
15093   cf_result=yes
15094 else
15095   echo "$as_me: failed program was:" >&5
15096 cat conftest.$ac_ext >&5
15097 cf_result=no
15098 fi
15099 rm -f conftest.$ac_objext conftest.$ac_ext
15100 echo "$as_me:15100: result: $cf_result" >&5
15101 echo "${ECHO_T}$cf_result" >&6
15102 if test $cf_result = yes ; then
15103
15104 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15105
15106         cat >>confdefs.h <<EOF
15107 #define $cf_result 1
15108 EOF
15109
15110 else
15111         cat >>confdefs.h <<EOF
15112 #define mbstate_t long
15113 EOF
15114
15115 fi
15116
15117         fi
15118
15119         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
15120
15121 echo "$as_me:15121: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15122 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15123 cat >conftest.$ac_ext <<_ACEOF
15124 #line 15124 "configure"
15125 #include "confdefs.h"
15126
15127 #ifndef _XOPEN_SOURCE_EXTENDED
15128 #define _XOPEN_SOURCE_EXTENDED
15129 #endif
15130 #include <${cf_cv_ncurses_header:-curses.h}>
15131 int
15132 main ()
15133 {
15134
15135 wchar_t foo
15136
15137   ;
15138   return 0;
15139 }
15140 _ACEOF
15141 rm -f conftest.$ac_objext
15142 if { (eval echo "$as_me:15142: \"$ac_compile\"") >&5
15143   (eval $ac_compile) 2>&5
15144   ac_status=$?
15145   echo "$as_me:15145: \$? = $ac_status" >&5
15146   (exit $ac_status); } &&
15147          { ac_try='test -s conftest.$ac_objext'
15148   { (eval echo "$as_me:15148: \"$ac_try\"") >&5
15149   (eval $ac_try) 2>&5
15150   ac_status=$?
15151   echo "$as_me:15151: \$? = $ac_status" >&5
15152   (exit $ac_status); }; }; then
15153   cf_result=yes
15154 else
15155   echo "$as_me: failed program was:" >&5
15156 cat conftest.$ac_ext >&5
15157 cf_result=no
15158 fi
15159 rm -f conftest.$ac_objext conftest.$ac_ext
15160 echo "$as_me:15160: result: $cf_result" >&5
15161 echo "${ECHO_T}$cf_result" >&6
15162 if test $cf_result = yes ; then
15163
15164 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15165
15166         cat >>confdefs.h <<EOF
15167 #define $cf_result 1
15168 EOF
15169
15170 else
15171         cat >>confdefs.h <<EOF
15172 #define wchar_t long
15173 EOF
15174
15175 fi
15176
15177         fi
15178
15179         if test "$NCURSES_OK_WINT_T" = 0 ; then
15180
15181 echo "$as_me:15181: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15182 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15183 cat >conftest.$ac_ext <<_ACEOF
15184 #line 15184 "configure"
15185 #include "confdefs.h"
15186
15187 #ifndef _XOPEN_SOURCE_EXTENDED
15188 #define _XOPEN_SOURCE_EXTENDED
15189 #endif
15190 #include <${cf_cv_ncurses_header:-curses.h}>
15191 int
15192 main ()
15193 {
15194
15195 wint_t foo
15196
15197   ;
15198   return 0;
15199 }
15200 _ACEOF
15201 rm -f conftest.$ac_objext
15202 if { (eval echo "$as_me:15202: \"$ac_compile\"") >&5
15203   (eval $ac_compile) 2>&5
15204   ac_status=$?
15205   echo "$as_me:15205: \$? = $ac_status" >&5
15206   (exit $ac_status); } &&
15207          { ac_try='test -s conftest.$ac_objext'
15208   { (eval echo "$as_me:15208: \"$ac_try\"") >&5
15209   (eval $ac_try) 2>&5
15210   ac_status=$?
15211   echo "$as_me:15211: \$? = $ac_status" >&5
15212   (exit $ac_status); }; }; then
15213   cf_result=yes
15214 else
15215   echo "$as_me: failed program was:" >&5
15216 cat conftest.$ac_ext >&5
15217 cf_result=no
15218 fi
15219 rm -f conftest.$ac_objext conftest.$ac_ext
15220 echo "$as_me:15220: result: $cf_result" >&5
15221 echo "${ECHO_T}$cf_result" >&6
15222 if test $cf_result = yes ; then
15223
15224 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15225
15226         cat >>confdefs.h <<EOF
15227 #define $cf_result 1
15228 EOF
15229
15230 else
15231         cat >>confdefs.h <<EOF
15232 #define wint_t long
15233 EOF
15234
15235 fi
15236
15237         fi
15238 fi
15239
15240 echo "$as_me:15240: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15241 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15242
15243 cat >conftest.$ac_ext <<_ACEOF
15244 #line 15244 "configure"
15245 #include "confdefs.h"
15246
15247 #ifdef HAVE_XCURSES
15248 #include <xcurses.h>
15249 char * XCursesProgramName = "test";
15250 #else
15251 #include <${cf_cv_ncurses_header:-curses.h}>
15252 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15253 #include <ncursesw/term.h>
15254 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15255 #include <ncurses/term.h>
15256 #elif defined(HAVE_TERM_H)
15257 #include <term.h>
15258 #endif
15259 #endif
15260
15261 int
15262 main ()
15263 {
15264
15265 void *foo = &(boolnames)
15266
15267   ;
15268   return 0;
15269 }
15270 _ACEOF
15271 rm -f conftest.$ac_objext
15272 if { (eval echo "$as_me:15272: \"$ac_compile\"") >&5
15273   (eval $ac_compile) 2>&5
15274   ac_status=$?
15275   echo "$as_me:15275: \$? = $ac_status" >&5
15276   (exit $ac_status); } &&
15277          { ac_try='test -s conftest.$ac_objext'
15278   { (eval echo "$as_me:15278: \"$ac_try\"") >&5
15279   (eval $ac_try) 2>&5
15280   ac_status=$?
15281   echo "$as_me:15281: \$? = $ac_status" >&5
15282   (exit $ac_status); }; }; then
15283   cf_result=yes
15284 else
15285   echo "$as_me: failed program was:" >&5
15286 cat conftest.$ac_ext >&5
15287 cf_result=no
15288 fi
15289 rm -f conftest.$ac_objext conftest.$ac_ext
15290 echo "$as_me:15290: result: $cf_result" >&5
15291 echo "${ECHO_T}$cf_result" >&6
15292
15293 if test $cf_result = yes ; then
15294
15295 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15296
15297         cat >>confdefs.h <<EOF
15298 #define $cf_result 1
15299 EOF
15300
15301 else
15302         echo "$as_me:15302: checking for data boolnames in library" >&5
15303 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
15304         # BSD linkers insist on making weak linkage, but resolve at runtime.
15305         if test "$cross_compiling" = yes; then
15306
15307         # cross-compiling
15308         cat >conftest.$ac_ext <<_ACEOF
15309 #line 15309 "configure"
15310 #include "confdefs.h"
15311
15312 #ifdef HAVE_XCURSES
15313 #include <xcurses.h>
15314 char * XCursesProgramName = "test";
15315 #else
15316 #include <${cf_cv_ncurses_header:-curses.h}>
15317 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15318 #include <ncursesw/term.h>
15319 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15320 #include <ncurses/term.h>
15321 #elif defined(HAVE_TERM_H)
15322 #include <term.h>
15323 #endif
15324 #endif
15325
15326 extern char boolnames;
15327 int
15328 main ()
15329 {
15330
15331         do {
15332                 void *foo = &(boolnames);
15333                 ${cf_cv_main_return:-return}(foo == 0);
15334         } while (0)
15335
15336   ;
15337   return 0;
15338 }
15339 _ACEOF
15340 rm -f conftest.$ac_objext conftest$ac_exeext
15341 if { (eval echo "$as_me:15341: \"$ac_link\"") >&5
15342   (eval $ac_link) 2>&5
15343   ac_status=$?
15344   echo "$as_me:15344: \$? = $ac_status" >&5
15345   (exit $ac_status); } &&
15346          { ac_try='test -s conftest$ac_exeext'
15347   { (eval echo "$as_me:15347: \"$ac_try\"") >&5
15348   (eval $ac_try) 2>&5
15349   ac_status=$?
15350   echo "$as_me:15350: \$? = $ac_status" >&5
15351   (exit $ac_status); }; }; then
15352   cf_result=yes
15353 else
15354   echo "$as_me: failed program was:" >&5
15355 cat conftest.$ac_ext >&5
15356 cf_result=no
15357 fi
15358 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15359
15360 else
15361   cat >conftest.$ac_ext <<_ACEOF
15362 #line 15362 "configure"
15363 #include "confdefs.h"
15364
15365 #ifdef HAVE_XCURSES
15366 #include <xcurses.h>
15367 char * XCursesProgramName = "test";
15368 #else
15369 #include <${cf_cv_ncurses_header:-curses.h}>
15370 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15371 #include <ncursesw/term.h>
15372 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15373 #include <ncurses/term.h>
15374 #elif defined(HAVE_TERM_H)
15375 #include <term.h>
15376 #endif
15377 #endif
15378
15379 extern char boolnames;
15380 int main(void)
15381 {
15382         void *foo = &(boolnames);
15383         ${cf_cv_main_return:-return}(foo == 0);
15384 }
15385 _ACEOF
15386 rm -f conftest$ac_exeext
15387 if { (eval echo "$as_me:15387: \"$ac_link\"") >&5
15388   (eval $ac_link) 2>&5
15389   ac_status=$?
15390   echo "$as_me:15390: \$? = $ac_status" >&5
15391   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15392   { (eval echo "$as_me:15392: \"$ac_try\"") >&5
15393   (eval $ac_try) 2>&5
15394   ac_status=$?
15395   echo "$as_me:15395: \$? = $ac_status" >&5
15396   (exit $ac_status); }; }; then
15397   cf_result=yes
15398 else
15399   echo "$as_me: program exited with status $ac_status" >&5
15400 echo "$as_me: failed program was:" >&5
15401 cat conftest.$ac_ext >&5
15402 cf_result=no
15403 fi
15404 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15405 fi
15406         echo "$as_me:15406: result: $cf_result" >&5
15407 echo "${ECHO_T}$cf_result" >&6
15408         if test $cf_result = yes ; then
15409
15410 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15411
15412                 cat >>confdefs.h <<EOF
15413 #define $cf_result 1
15414 EOF
15415
15416         fi
15417 fi
15418
15419 echo "$as_me:15419: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15420 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15421
15422 cat >conftest.$ac_ext <<_ACEOF
15423 #line 15423 "configure"
15424 #include "confdefs.h"
15425
15426 #ifdef HAVE_XCURSES
15427 #include <xcurses.h>
15428 char * XCursesProgramName = "test";
15429 #else
15430 #include <${cf_cv_ncurses_header:-curses.h}>
15431 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15432 #include <ncursesw/term.h>
15433 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15434 #include <ncurses/term.h>
15435 #elif defined(HAVE_TERM_H)
15436 #include <term.h>
15437 #endif
15438 #endif
15439
15440 int
15441 main ()
15442 {
15443
15444 void *foo = &(boolfnames)
15445
15446   ;
15447   return 0;
15448 }
15449 _ACEOF
15450 rm -f conftest.$ac_objext
15451 if { (eval echo "$as_me:15451: \"$ac_compile\"") >&5
15452   (eval $ac_compile) 2>&5
15453   ac_status=$?
15454   echo "$as_me:15454: \$? = $ac_status" >&5
15455   (exit $ac_status); } &&
15456          { ac_try='test -s conftest.$ac_objext'
15457   { (eval echo "$as_me:15457: \"$ac_try\"") >&5
15458   (eval $ac_try) 2>&5
15459   ac_status=$?
15460   echo "$as_me:15460: \$? = $ac_status" >&5
15461   (exit $ac_status); }; }; then
15462   cf_result=yes
15463 else
15464   echo "$as_me: failed program was:" >&5
15465 cat conftest.$ac_ext >&5
15466 cf_result=no
15467 fi
15468 rm -f conftest.$ac_objext conftest.$ac_ext
15469 echo "$as_me:15469: result: $cf_result" >&5
15470 echo "${ECHO_T}$cf_result" >&6
15471
15472 if test $cf_result = yes ; then
15473
15474 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15475
15476         cat >>confdefs.h <<EOF
15477 #define $cf_result 1
15478 EOF
15479
15480 else
15481         echo "$as_me:15481: checking for data boolfnames in library" >&5
15482 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
15483         # BSD linkers insist on making weak linkage, but resolve at runtime.
15484         if test "$cross_compiling" = yes; then
15485
15486         # cross-compiling
15487         cat >conftest.$ac_ext <<_ACEOF
15488 #line 15488 "configure"
15489 #include "confdefs.h"
15490
15491 #ifdef HAVE_XCURSES
15492 #include <xcurses.h>
15493 char * XCursesProgramName = "test";
15494 #else
15495 #include <${cf_cv_ncurses_header:-curses.h}>
15496 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15497 #include <ncursesw/term.h>
15498 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15499 #include <ncurses/term.h>
15500 #elif defined(HAVE_TERM_H)
15501 #include <term.h>
15502 #endif
15503 #endif
15504
15505 extern char boolfnames;
15506 int
15507 main ()
15508 {
15509
15510         do {
15511                 void *foo = &(boolfnames);
15512                 ${cf_cv_main_return:-return}(foo == 0);
15513         } while (0)
15514
15515   ;
15516   return 0;
15517 }
15518 _ACEOF
15519 rm -f conftest.$ac_objext conftest$ac_exeext
15520 if { (eval echo "$as_me:15520: \"$ac_link\"") >&5
15521   (eval $ac_link) 2>&5
15522   ac_status=$?
15523   echo "$as_me:15523: \$? = $ac_status" >&5
15524   (exit $ac_status); } &&
15525          { ac_try='test -s conftest$ac_exeext'
15526   { (eval echo "$as_me:15526: \"$ac_try\"") >&5
15527   (eval $ac_try) 2>&5
15528   ac_status=$?
15529   echo "$as_me:15529: \$? = $ac_status" >&5
15530   (exit $ac_status); }; }; then
15531   cf_result=yes
15532 else
15533   echo "$as_me: failed program was:" >&5
15534 cat conftest.$ac_ext >&5
15535 cf_result=no
15536 fi
15537 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15538
15539 else
15540   cat >conftest.$ac_ext <<_ACEOF
15541 #line 15541 "configure"
15542 #include "confdefs.h"
15543
15544 #ifdef HAVE_XCURSES
15545 #include <xcurses.h>
15546 char * XCursesProgramName = "test";
15547 #else
15548 #include <${cf_cv_ncurses_header:-curses.h}>
15549 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15550 #include <ncursesw/term.h>
15551 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15552 #include <ncurses/term.h>
15553 #elif defined(HAVE_TERM_H)
15554 #include <term.h>
15555 #endif
15556 #endif
15557
15558 extern char boolfnames;
15559 int main(void)
15560 {
15561         void *foo = &(boolfnames);
15562         ${cf_cv_main_return:-return}(foo == 0);
15563 }
15564 _ACEOF
15565 rm -f conftest$ac_exeext
15566 if { (eval echo "$as_me:15566: \"$ac_link\"") >&5
15567   (eval $ac_link) 2>&5
15568   ac_status=$?
15569   echo "$as_me:15569: \$? = $ac_status" >&5
15570   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15571   { (eval echo "$as_me:15571: \"$ac_try\"") >&5
15572   (eval $ac_try) 2>&5
15573   ac_status=$?
15574   echo "$as_me:15574: \$? = $ac_status" >&5
15575   (exit $ac_status); }; }; then
15576   cf_result=yes
15577 else
15578   echo "$as_me: program exited with status $ac_status" >&5
15579 echo "$as_me: failed program was:" >&5
15580 cat conftest.$ac_ext >&5
15581 cf_result=no
15582 fi
15583 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15584 fi
15585         echo "$as_me:15585: result: $cf_result" >&5
15586 echo "${ECHO_T}$cf_result" >&6
15587         if test $cf_result = yes ; then
15588
15589 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15590
15591                 cat >>confdefs.h <<EOF
15592 #define $cf_result 1
15593 EOF
15594
15595         fi
15596 fi
15597
15598 LD_RPATH_OPT=
15599 echo "$as_me:15599: checking for an rpath option" >&5
15600 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
15601 case $cf_cv_system_name in #(vi
15602 irix*) #(vi
15603         if test "$GCC" = yes; then
15604                 LD_RPATH_OPT="-Wl,-rpath,"
15605         else
15606                 LD_RPATH_OPT="-rpath "
15607         fi
15608         ;;
15609 linux*|gnu*|k*bsd*-gnu) #(vi
15610         LD_RPATH_OPT="-Wl,-rpath,"
15611         ;;
15612 openbsd[2-9].*|mirbsd*) #(vi
15613         LD_RPATH_OPT="-Wl,-rpath,"
15614         ;;
15615 dragonfly*|freebsd*) #(vi
15616         LD_RPATH_OPT="-rpath "
15617         ;;
15618 netbsd*) #(vi
15619         LD_RPATH_OPT="-Wl,-rpath,"
15620         ;;
15621 osf*|mls+*) #(vi
15622         LD_RPATH_OPT="-rpath "
15623         ;;
15624 solaris2*) #(vi
15625         LD_RPATH_OPT="-R"
15626         ;;
15627 *)
15628         ;;
15629 esac
15630 echo "$as_me:15630: result: $LD_RPATH_OPT" >&5
15631 echo "${ECHO_T}$LD_RPATH_OPT" >&6
15632
15633 case "x$LD_RPATH_OPT" in #(vi
15634 x-R*)
15635         echo "$as_me:15635: checking if we need a space after rpath option" >&5
15636 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
15637         cf_save_LIBS="$LIBS"
15638         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
15639         cat >conftest.$ac_ext <<_ACEOF
15640 #line 15640 "configure"
15641 #include "confdefs.h"
15642
15643 int
15644 main ()
15645 {
15646
15647   ;
15648   return 0;
15649 }
15650 _ACEOF
15651 rm -f conftest.$ac_objext conftest$ac_exeext
15652 if { (eval echo "$as_me:15652: \"$ac_link\"") >&5
15653   (eval $ac_link) 2>&5
15654   ac_status=$?
15655   echo "$as_me:15655: \$? = $ac_status" >&5
15656   (exit $ac_status); } &&
15657          { ac_try='test -s conftest$ac_exeext'
15658   { (eval echo "$as_me:15658: \"$ac_try\"") >&5
15659   (eval $ac_try) 2>&5
15660   ac_status=$?
15661   echo "$as_me:15661: \$? = $ac_status" >&5
15662   (exit $ac_status); }; }; then
15663   cf_rpath_space=no
15664 else
15665   echo "$as_me: failed program was:" >&5
15666 cat conftest.$ac_ext >&5
15667 cf_rpath_space=yes
15668 fi
15669 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15670         LIBS="$cf_save_LIBS"
15671         echo "$as_me:15671: result: $cf_rpath_space" >&5
15672 echo "${ECHO_T}$cf_rpath_space" >&6
15673         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
15674         ;;
15675 esac
15676
15677 echo "$as_me:15677: checking if rpath-hack should be disabled" >&5
15678 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
15679
15680 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
15681 if test "${enable_rpath_hack+set}" = set; then
15682   enableval="$enable_rpath_hack"
15683   test "$enableval" != no && enableval=yes
15684   if test "$enableval" != "yes" ; then
15685     cf_disable_rpath_hack=yes
15686   else
15687     cf_disable_rpath_hack=no
15688   fi
15689 else
15690   enableval=yes
15691   cf_disable_rpath_hack=no
15692
15693 fi;
15694 echo "$as_me:15694: result: $cf_disable_rpath_hack" >&5
15695 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
15696 if test "$cf_disable_rpath_hack" = no ; then
15697
15698 echo "$as_me:15698: checking for updated LDFLAGS" >&5
15699 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
15700 if test -n "$LD_RPATH_OPT" ; then
15701         echo "$as_me:15701: result: maybe" >&5
15702 echo "${ECHO_T}maybe" >&6
15703
15704         for ac_prog in ldd
15705 do
15706   # Extract the first word of "$ac_prog", so it can be a program name with args.
15707 set dummy $ac_prog; ac_word=$2
15708 echo "$as_me:15708: checking for $ac_word" >&5
15709 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15710 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
15711   echo $ECHO_N "(cached) $ECHO_C" >&6
15712 else
15713   if test -n "$cf_ldd_prog"; then
15714   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
15715 else
15716   ac_save_IFS=$IFS; IFS=$ac_path_separator
15717 ac_dummy="$PATH"
15718 for ac_dir in $ac_dummy; do
15719   IFS=$ac_save_IFS
15720   test -z "$ac_dir" && ac_dir=.
15721   $as_executable_p "$ac_dir/$ac_word" || continue
15722 ac_cv_prog_cf_ldd_prog="$ac_prog"
15723 echo "$as_me:15723: found $ac_dir/$ac_word" >&5
15724 break
15725 done
15726
15727 fi
15728 fi
15729 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
15730 if test -n "$cf_ldd_prog"; then
15731   echo "$as_me:15731: result: $cf_ldd_prog" >&5
15732 echo "${ECHO_T}$cf_ldd_prog" >&6
15733 else
15734   echo "$as_me:15734: result: no" >&5
15735 echo "${ECHO_T}no" >&6
15736 fi
15737
15738   test -n "$cf_ldd_prog" && break
15739 done
15740 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
15741
15742         cf_rpath_list="/usr/lib /lib"
15743         if test "$cf_ldd_prog" != no
15744         then
15745                 cf_rpath_oops=
15746
15747 cat >conftest.$ac_ext <<_ACEOF
15748 #line 15748 "configure"
15749 #include "confdefs.h"
15750 #include <stdio.h>
15751 int
15752 main ()
15753 {
15754 printf("Hello");
15755   ;
15756   return 0;
15757 }
15758 _ACEOF
15759 rm -f conftest.$ac_objext conftest$ac_exeext
15760 if { (eval echo "$as_me:15760: \"$ac_link\"") >&5
15761   (eval $ac_link) 2>&5
15762   ac_status=$?
15763   echo "$as_me:15763: \$? = $ac_status" >&5
15764   (exit $ac_status); } &&
15765          { ac_try='test -s conftest$ac_exeext'
15766   { (eval echo "$as_me:15766: \"$ac_try\"") >&5
15767   (eval $ac_try) 2>&5
15768   ac_status=$?
15769   echo "$as_me:15769: \$? = $ac_status" >&5
15770   (exit $ac_status); }; }; then
15771   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u`
15772                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort -u`
15773 else
15774   echo "$as_me: failed program was:" >&5
15775 cat conftest.$ac_ext >&5
15776 fi
15777 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15778
15779                 # If we passed the link-test, but get a "not found" on a given library,
15780                 # this could be due to inept reconfiguration of gcc to make it only
15781                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
15782                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
15783                 # /usr/local libraries.
15784                 if test -n "$cf_rpath_oops"
15785                 then
15786                         for cf_rpath_src in $cf_rpath_oops
15787                         do
15788                                 for cf_rpath_dir in \
15789                                         /usr/local \
15790                                         /usr/pkg \
15791                                         /opt/sfw
15792                                 do
15793                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
15794                                         then
15795                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
15796
15797 echo "${as_me:-configure}:15797: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
15798
15799                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
15800                                                 break
15801                                         fi
15802                                 done
15803                         done
15804                 fi
15805         fi
15806
15807         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
15808
15809 echo "${as_me:-configure}:15809: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
15810
15811 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
15812
15813 echo "${as_me:-configure}:15813: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
15814
15815 cf_rpath_dst=
15816 for cf_rpath_src in $LDFLAGS
15817 do
15818         case $cf_rpath_src in #(vi
15819         -L*) #(vi
15820
15821                 # check if this refers to a directory which we will ignore
15822                 cf_rpath_skip=no
15823                 if test -n "$cf_rpath_list"
15824                 then
15825                         for cf_rpath_item in $cf_rpath_list
15826                         do
15827                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
15828                                 then
15829                                         cf_rpath_skip=yes
15830                                         break
15831                                 fi
15832                         done
15833                 fi
15834
15835                 if test "$cf_rpath_skip" = no
15836                 then
15837                         # transform the option
15838                         if test "$LD_RPATH_OPT" = "-R " ; then
15839                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
15840                         else
15841                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
15842                         fi
15843
15844                         # if we have not already added this, add it now
15845                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
15846                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
15847                         then
15848                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
15849
15850 echo "${as_me:-configure}:15850: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
15851
15852                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
15853                         fi
15854                 fi
15855                 ;;
15856         esac
15857         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
15858 done
15859 LDFLAGS=$cf_rpath_dst
15860
15861 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
15862
15863 echo "${as_me:-configure}:15863: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
15864
15865 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
15866
15867 echo "${as_me:-configure}:15867: testing ...checking LIBS $LIBS ..." 1>&5
15868
15869 cf_rpath_dst=
15870 for cf_rpath_src in $LIBS
15871 do
15872         case $cf_rpath_src in #(vi
15873         -L*) #(vi
15874
15875                 # check if this refers to a directory which we will ignore
15876                 cf_rpath_skip=no
15877                 if test -n "$cf_rpath_list"
15878                 then
15879                         for cf_rpath_item in $cf_rpath_list
15880                         do
15881                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
15882                                 then
15883                                         cf_rpath_skip=yes
15884                                         break
15885                                 fi
15886                         done
15887                 fi
15888
15889                 if test "$cf_rpath_skip" = no
15890                 then
15891                         # transform the option
15892                         if test "$LD_RPATH_OPT" = "-R " ; then
15893                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
15894                         else
15895                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
15896                         fi
15897
15898                         # if we have not already added this, add it now
15899                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
15900                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
15901                         then
15902                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
15903
15904 echo "${as_me:-configure}:15904: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
15905
15906                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
15907                         fi
15908                 fi
15909                 ;;
15910         esac
15911         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
15912 done
15913 LIBS=$cf_rpath_dst
15914
15915 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
15916
15917 echo "${as_me:-configure}:15917: testing ...checked LIBS $LIBS ..." 1>&5
15918
15919         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
15920
15921 echo "${as_me:-configure}:15921: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
15922
15923 fi
15924
15925 fi
15926
15927 TEST_ARGS="$LIBS"
15928 LIBS=
15929
15930 ac_config_files="$ac_config_files Makefile"
15931 ac_config_commands="$ac_config_commands default"
15932 cat >confcache <<\_ACEOF
15933 # This file is a shell script that caches the results of configure
15934 # tests run on this system so they can be shared between configure
15935 # scripts and configure runs, see configure's option --config-cache.
15936 # It is not useful on other systems.  If it contains results you don't
15937 # want to keep, you may remove or edit it.
15938 #
15939 # config.status only pays attention to the cache file if you give it
15940 # the --recheck option to rerun configure.
15941 #
15942 # `ac_cv_env_foo' variables (set or unset) will be overriden when
15943 # loading this file, other *unset* `ac_cv_foo' will be assigned the
15944 # following values.
15945
15946 _ACEOF
15947
15948 # The following way of writing the cache mishandles newlines in values,
15949 # but we know of no workaround that is simple, portable, and efficient.
15950 # So, don't put newlines in cache variables' values.
15951 # Ultrix sh set writes to stderr and can't be redirected directly,
15952 # and sets the high bit in the cache file unless we assign to the vars.
15953 {
15954   (set) 2>&1 |
15955     case `(ac_space=' '; set | grep ac_space) 2>&1` in
15956     *ac_space=\ *)
15957       # `set' does not quote correctly, so add quotes (double-quote
15958       # substitution turns \\\\ into \\, and sed turns \\ into \).
15959       sed -n \
15960         "s/'/'\\\\''/g;
15961           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
15962       ;;
15963     *)
15964       # `set' quotes correctly as required by POSIX, so do not add quotes.
15965       sed -n \
15966         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
15967       ;;
15968     esac;
15969 } |
15970   sed '
15971      t clear
15972      : clear
15973      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
15974      t end
15975      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
15976      : end' >>confcache
15977 if cmp -s $cache_file confcache; then :; else
15978   if test -w $cache_file; then
15979     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
15980     cat confcache >$cache_file
15981   else
15982     echo "not updating unwritable cache $cache_file"
15983   fi
15984 fi
15985 rm -f confcache
15986
15987 test "x$prefix" = xNONE && prefix=$ac_default_prefix
15988 # Let make expand exec_prefix.
15989 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
15990
15991 # VPATH may cause trouble with some makes, so we remove $(srcdir),
15992 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
15993 # trailing colons and then remove the whole line if VPATH becomes empty
15994 # (actually we leave an empty line to preserve line numbers).
15995 if test "x$srcdir" = x.; then
15996   ac_vpsub='/^[         ]*VPATH[        ]*=/{
15997 s/:*\$(srcdir):*/:/;
15998 s/:*\${srcdir}:*/:/;
15999 s/:*@srcdir@:*/:/;
16000 s/^\([^=]*=[    ]*\):*/\1/;
16001 s/:*$//;
16002 s/^[^=]*=[      ]*$//;
16003 }'
16004 fi
16005
16006 DEFS=-DHAVE_CONFIG_H
16007
16008 : ${CONFIG_STATUS=./config.status}
16009 ac_clean_files_save=$ac_clean_files
16010 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16011 { echo "$as_me:16011: creating $CONFIG_STATUS" >&5
16012 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16013 cat >$CONFIG_STATUS <<_ACEOF
16014 #! $SHELL
16015 # Generated automatically by configure.
16016 # Run this file to recreate the current configuration.
16017 # Compiler output produced by configure, useful for debugging
16018 # configure, is in config.log if it exists.
16019
16020 debug=false
16021 SHELL=\${CONFIG_SHELL-$SHELL}
16022 ac_cs_invocation="\$0 \$@"
16023
16024 _ACEOF
16025
16026 cat >>$CONFIG_STATUS <<\_ACEOF
16027 # Be Bourne compatible
16028 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16029   emulate sh
16030   NULLCMD=:
16031 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16032   set -o posix
16033 fi
16034
16035 # Name of the executable.
16036 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16037
16038 if expr a : '\(a\)' >/dev/null 2>&1; then
16039   as_expr=expr
16040 else
16041   as_expr=false
16042 fi
16043
16044 rm -f conf$$ conf$$.exe conf$$.file
16045 echo >conf$$.file
16046 if ln -s conf$$.file conf$$ 2>/dev/null; then
16047   # We could just check for DJGPP; but this test a) works b) is more generic
16048   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16049   if test -f conf$$.exe; then
16050     # Don't use ln at all; we don't have any links
16051     as_ln_s='cp -p'
16052   else
16053     as_ln_s='ln -s'
16054   fi
16055 elif ln conf$$.file conf$$ 2>/dev/null; then
16056   as_ln_s=ln
16057 else
16058   as_ln_s='cp -p'
16059 fi
16060 rm -f conf$$ conf$$.exe conf$$.file
16061
16062 as_executable_p="test -f"
16063
16064 # Support unset when possible.
16065 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16066   as_unset=unset
16067 else
16068   as_unset=false
16069 fi
16070
16071 # NLS nuisances.
16072 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16073 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16074 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16075 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16076 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16077 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16078 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16079 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16080
16081 # IFS
16082 # We need space, tab and new line, in precisely that order.
16083 as_nl='
16084 '
16085 IFS="   $as_nl"
16086
16087 # CDPATH.
16088 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16089
16090 exec 6>&1
16091
16092 _ACEOF
16093
16094 # Files that config.status was made for.
16095 if test -n "$ac_config_files"; then
16096   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16097 fi
16098
16099 if test -n "$ac_config_headers"; then
16100   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16101 fi
16102
16103 if test -n "$ac_config_links"; then
16104   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16105 fi
16106
16107 if test -n "$ac_config_commands"; then
16108   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16109 fi
16110
16111 cat >>$CONFIG_STATUS <<\EOF
16112
16113 ac_cs_usage="\
16114 \`$as_me' instantiates files from templates according to the
16115 current configuration.
16116
16117 Usage: $0 [OPTIONS] [FILE]...
16118
16119   -h, --help       print this help, then exit
16120   -V, --version    print version number, then exit
16121   -d, --debug      don't remove temporary files
16122       --recheck    update $as_me by reconfiguring in the same conditions
16123   --file=FILE[:TEMPLATE]
16124                    instantiate the configuration file FILE
16125   --header=FILE[:TEMPLATE]
16126                    instantiate the configuration header FILE
16127
16128 Configuration files:
16129 $config_files
16130
16131 Configuration headers:
16132 $config_headers
16133
16134 Configuration commands:
16135 $config_commands
16136
16137 Report bugs to <dickey@invisible-island.net>."
16138 EOF
16139
16140 cat >>$CONFIG_STATUS <<EOF
16141 ac_cs_version="\\
16142 config.status
16143 configured by $0, generated by GNU Autoconf 2.52.20101002,
16144   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16145
16146 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16147 Free Software Foundation, Inc.
16148 This config.status script is free software; the Free Software Foundation
16149 gives unlimited permission to copy, distribute and modify it."
16150 srcdir=$srcdir
16151 INSTALL="$INSTALL"
16152 EOF
16153
16154 cat >>$CONFIG_STATUS <<\EOF
16155 # If no file are specified by the user, then we need to provide default
16156 # value.  By we need to know if files were specified by the user.
16157 ac_need_defaults=:
16158 while test $# != 0
16159 do
16160   case $1 in
16161   --*=*)
16162     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16163     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16164     shift
16165     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16166     shift
16167     ;;
16168   -*);;
16169   *) # This is not an option, so the user has probably given explicit
16170      # arguments.
16171      ac_need_defaults=false;;
16172   esac
16173
16174   case $1 in
16175   # Handling of the options.
16176 EOF
16177 cat >>$CONFIG_STATUS <<EOF
16178   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16179     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16180     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16181 EOF
16182 cat >>$CONFIG_STATUS <<\EOF
16183   --version | --vers* | -V )
16184     echo "$ac_cs_version"; exit 0 ;;
16185   --he | --h)
16186     # Conflict between --help and --header
16187     { { echo "$as_me:16187: error: ambiguous option: $1
16188 Try \`$0 --help' for more information." >&5
16189 echo "$as_me: error: ambiguous option: $1
16190 Try \`$0 --help' for more information." >&2;}
16191    { (exit 1); exit 1; }; };;
16192   --help | --hel | -h )
16193     echo "$ac_cs_usage"; exit 0 ;;
16194   --debug | --d* | -d )
16195     debug=: ;;
16196   --file | --fil | --fi | --f )
16197     shift
16198     CONFIG_FILES="$CONFIG_FILES $1"
16199     ac_need_defaults=false;;
16200   --header | --heade | --head | --hea )
16201     shift
16202     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16203     ac_need_defaults=false;;
16204
16205   # This is an error.
16206   -*) { { echo "$as_me:16206: error: unrecognized option: $1
16207 Try \`$0 --help' for more information." >&5
16208 echo "$as_me: error: unrecognized option: $1
16209 Try \`$0 --help' for more information." >&2;}
16210    { (exit 1); exit 1; }; } ;;
16211
16212   *) ac_config_targets="$ac_config_targets $1" ;;
16213
16214   esac
16215   shift
16216 done
16217
16218 exec 5>>config.log
16219 cat >&5 << _ACEOF
16220
16221 ## ----------------------- ##
16222 ## Running config.status.  ##
16223 ## ----------------------- ##
16224
16225 This file was extended by $as_me 2.52.20101002, executed with
16226   CONFIG_FILES    = $CONFIG_FILES
16227   CONFIG_HEADERS  = $CONFIG_HEADERS
16228   CONFIG_LINKS    = $CONFIG_LINKS
16229   CONFIG_COMMANDS = $CONFIG_COMMANDS
16230   > $ac_cs_invocation
16231 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16232
16233 _ACEOF
16234 EOF
16235
16236 cat >>$CONFIG_STATUS <<EOF
16237 #
16238 # INIT-COMMANDS section.
16239 #
16240
16241 AWK="$AWK"
16242 ECHO_LD="$ECHO_LD"
16243
16244 EOF
16245
16246 cat >>$CONFIG_STATUS <<\EOF
16247 for ac_config_target in $ac_config_targets
16248 do
16249   case "$ac_config_target" in
16250   # Handling of arguments.
16251   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16252   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16253   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
16254   *) { { echo "$as_me:16254: error: invalid argument: $ac_config_target" >&5
16255 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16256    { (exit 1); exit 1; }; };;
16257   esac
16258 done
16259
16260 # If the user did not use the arguments to specify the items to instantiate,
16261 # then the envvar interface is used.  Set only those that are not.
16262 # We use the long form for the default assignment because of an extremely
16263 # bizarre bug on SunOS 4.1.3.
16264 if $ac_need_defaults; then
16265   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16266   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16267   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16268 fi
16269
16270 # Create a temporary directory, and hook for its removal unless debugging.
16271 $debug ||
16272 {
16273   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16274   trap '{ (exit 1); exit 1; }' 1 2 13 15
16275 }
16276
16277 # Create a (secure) tmp directory for tmp files.
16278 : ${TMPDIR=/tmp}
16279 {
16280   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16281   test -n "$tmp" && test -d "$tmp"
16282 }  ||
16283 {
16284   tmp=$TMPDIR/cs$$-$RANDOM
16285   (umask 077 && mkdir $tmp)
16286 } ||
16287 {
16288    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16289    { (exit 1); exit 1; }
16290 }
16291
16292 EOF
16293
16294 cat >>$CONFIG_STATUS <<EOF
16295
16296 #
16297 # CONFIG_FILES section.
16298 #
16299
16300 # No need to generate the scripts if there are no CONFIG_FILES.
16301 # This happens for instance when ./config.status config.h
16302 if test -n "\$CONFIG_FILES"; then
16303   # Protect against being on the right side of a sed subst in config.status.
16304   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
16305    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
16306 s,@SHELL@,$SHELL,;t t
16307 s,@exec_prefix@,$exec_prefix,;t t
16308 s,@prefix@,$prefix,;t t
16309 s,@program_transform_name@,$program_transform_name,;t t
16310 s,@bindir@,$bindir,;t t
16311 s,@sbindir@,$sbindir,;t t
16312 s,@libexecdir@,$libexecdir,;t t
16313 s,@datadir@,$datadir,;t t
16314 s,@sysconfdir@,$sysconfdir,;t t
16315 s,@sharedstatedir@,$sharedstatedir,;t t
16316 s,@localstatedir@,$localstatedir,;t t
16317 s,@libdir@,$libdir,;t t
16318 s,@includedir@,$includedir,;t t
16319 s,@oldincludedir@,$oldincludedir,;t t
16320 s,@infodir@,$infodir,;t t
16321 s,@mandir@,$mandir,;t t
16322 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
16323 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
16324 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
16325 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
16326 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
16327 s,@build_alias@,$build_alias,;t t
16328 s,@host_alias@,$host_alias,;t t
16329 s,@target_alias@,$target_alias,;t t
16330 s,@ECHO_C@,$ECHO_C,;t t
16331 s,@ECHO_N@,$ECHO_N,;t t
16332 s,@ECHO_T@,$ECHO_T,;t t
16333 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
16334 s,@DEFS@,$DEFS,;t t
16335 s,@LIBS@,$LIBS,;t t
16336 s,@build@,$build,;t t
16337 s,@build_cpu@,$build_cpu,;t t
16338 s,@build_vendor@,$build_vendor,;t t
16339 s,@build_os@,$build_os,;t t
16340 s,@host@,$host,;t t
16341 s,@host_cpu@,$host_cpu,;t t
16342 s,@host_vendor@,$host_vendor,;t t
16343 s,@host_os@,$host_os,;t t
16344 s,@SET_MAKE@,$SET_MAKE,;t t
16345 s,@CC@,$CC,;t t
16346 s,@CFLAGS@,$CFLAGS,;t t
16347 s,@LDFLAGS@,$LDFLAGS,;t t
16348 s,@CPPFLAGS@,$CPPFLAGS,;t t
16349 s,@ac_ct_CC@,$ac_ct_CC,;t t
16350 s,@EXEEXT@,$EXEEXT,;t t
16351 s,@OBJEXT@,$OBJEXT,;t t
16352 s,@CPP@,$CPP,;t t
16353 s,@AWK@,$AWK,;t t
16354 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
16355 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
16356 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
16357 s,@LINT@,$LINT,;t t
16358 s,@LINT_OPTS@,$LINT_OPTS,;t t
16359 s,@CTAGS@,$CTAGS,;t t
16360 s,@ETAGS@,$ETAGS,;t t
16361 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
16362 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
16363 s,@MATH_LIB@,$MATH_LIB,;t t
16364 s,@top_builddir@,$top_builddir,;t t
16365 s,@CC_G_OPT@,$CC_G_OPT,;t t
16366 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
16367 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
16368 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
16369 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
16370 s,@LD@,$LD,;t t
16371 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
16372 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
16373 s,@LD_MODEL@,$LD_MODEL,;t t
16374 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
16375 s,@LIBTOOL@,$LIBTOOL,;t t
16376 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
16377 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
16378 s,@LIB_LINK@,$LIB_LINK,;t t
16379 s,@LINK_TESTS@,$LINK_TESTS,;t t
16380 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
16381 s,@PTHREAD@,$PTHREAD,;t t
16382 s,@TEST_ARGS@,$TEST_ARGS,;t t
16383 s,@TEST_DEPS@,$TEST_DEPS,;t t
16384 s,@TEST_LIBS@,$TEST_LIBS,;t t
16385 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
16386 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
16387 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
16388 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
16389 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
16390 s,@ECHO_LT@,$ECHO_LT,;t t
16391 s,@ECHO_LD@,$ECHO_LD,;t t
16392 s,@RULE_CC@,$RULE_CC,;t t
16393 s,@SHOW_CC@,$SHOW_CC,;t t
16394 s,@ECHO_CC@,$ECHO_CC,;t t
16395 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
16396 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
16397 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
16398 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
16399 s,@X_CFLAGS@,$X_CFLAGS,;t t
16400 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
16401 s,@X_LIBS@,$X_LIBS,;t t
16402 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
16403 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
16404 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
16405 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
16406 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
16407 CEOF
16408
16409 EOF
16410
16411   cat >>$CONFIG_STATUS <<\EOF
16412   # Split the substitutions into bite-sized pieces for seds with
16413   # small command number limits, like on Digital OSF/1 and HP-UX.
16414   ac_max_sed_lines=48
16415   ac_sed_frag=1 # Number of current file.
16416   ac_beg=1 # First line for current file.
16417   ac_end=$ac_max_sed_lines # Line after last line for current file.
16418   ac_more_lines=:
16419   ac_sed_cmds=
16420   while $ac_more_lines; do
16421     if test $ac_beg -gt 1; then
16422       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16423     else
16424       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16425     fi
16426     if test ! -s $tmp/subs.frag; then
16427       ac_more_lines=false
16428     else
16429       # The purpose of the label and of the branching condition is to
16430       # speed up the sed processing (if there are no `@' at all, there
16431       # is no need to browse any of the substitutions).
16432       # These are the two extra sed commands mentioned above.
16433       (echo ':t
16434   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
16435       if test -z "$ac_sed_cmds"; then
16436         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
16437       else
16438         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
16439       fi
16440       ac_sed_frag=`expr $ac_sed_frag + 1`
16441       ac_beg=$ac_end
16442       ac_end=`expr $ac_end + $ac_max_sed_lines`
16443     fi
16444   done
16445   if test -z "$ac_sed_cmds"; then
16446     ac_sed_cmds=cat
16447   fi
16448 fi # test -n "$CONFIG_FILES"
16449
16450 EOF
16451 cat >>$CONFIG_STATUS <<\EOF
16452 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
16453   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16454   case $ac_file in
16455   - | *:- | *:-:* ) # input from stdin
16456         cat >$tmp/stdin
16457         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16458         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16459   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16460         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16461   * )   ac_file_in=$ac_file.in ;;
16462   esac
16463
16464   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
16465   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16466          X"$ac_file" : 'X\(//\)[^/]' \| \
16467          X"$ac_file" : 'X\(//\)$' \| \
16468          X"$ac_file" : 'X\(/\)' \| \
16469          .     : '\(.\)' 2>/dev/null ||
16470 echo X"$ac_file" |
16471     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16472           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16473           /^X\(\/\/\)$/{ s//\1/; q; }
16474           /^X\(\/\).*/{ s//\1/; q; }
16475           s/.*/./; q'`
16476   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16477     { case "$ac_dir" in
16478   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16479   *)                      as_incr_dir=.;;
16480 esac
16481 as_dummy="$ac_dir"
16482 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16483   case $as_mkdir_dir in
16484     # Skip DOS drivespec
16485     ?:) as_incr_dir=$as_mkdir_dir ;;
16486     *)
16487       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16488       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16489     ;;
16490   esac
16491 done; }
16492
16493     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
16494     # A "../" for each directory in $ac_dir_suffix.
16495     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
16496   else
16497     ac_dir_suffix= ac_dots=
16498   fi
16499
16500   case $srcdir in
16501   .)  ac_srcdir=.
16502       if test -z "$ac_dots"; then
16503          ac_top_srcdir=.
16504       else
16505          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
16506       fi ;;
16507   [\\/]* | ?:[\\/]* )
16508       ac_srcdir=$srcdir$ac_dir_suffix;
16509       ac_top_srcdir=$srcdir ;;
16510   *) # Relative path.
16511     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
16512     ac_top_srcdir=$ac_dots$srcdir ;;
16513   esac
16514
16515   case $INSTALL in
16516   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
16517   *) ac_INSTALL=$ac_dots$INSTALL ;;
16518   esac
16519
16520   if test x"$ac_file" != x-; then
16521     { echo "$as_me:16521: creating $ac_file" >&5
16522 echo "$as_me: creating $ac_file" >&6;}
16523     rm -f "$ac_file"
16524   fi
16525   # Let's still pretend it is `configure' which instantiates (i.e., don't
16526   # use $as_me), people would be surprised to read:
16527   #    /* config.h.  Generated automatically by config.status.  */
16528   configure_input="Generated automatically from `echo $ac_file_in |
16529                                                  sed 's,.*/,,'` by configure."
16530
16531   # First look for the input files in the build tree, otherwise in the
16532   # src tree.
16533   ac_file_inputs=`IFS=:
16534     for f in $ac_file_in; do
16535       case $f in
16536       -) echo $tmp/stdin ;;
16537       [\\/$]*)
16538          # Absolute (can't be DOS-style, as IFS=:)
16539          test -f "$f" || { { echo "$as_me:16539: error: cannot find input file: $f" >&5
16540 echo "$as_me: error: cannot find input file: $f" >&2;}
16541    { (exit 1); exit 1; }; }
16542          echo $f;;
16543       *) # Relative
16544          if test -f "$f"; then
16545            # Build tree
16546            echo $f
16547          elif test -f "$srcdir/$f"; then
16548            # Source tree
16549            echo $srcdir/$f
16550          else
16551            # /dev/null tree
16552            { { echo "$as_me:16552: error: cannot find input file: $f" >&5
16553 echo "$as_me: error: cannot find input file: $f" >&2;}
16554    { (exit 1); exit 1; }; }
16555          fi;;
16556       esac
16557     done` || { (exit 1); exit 1; }
16558 EOF
16559 cat >>$CONFIG_STATUS <<EOF
16560   sed "$ac_vpsub
16561 $extrasub
16562 EOF
16563 cat >>$CONFIG_STATUS <<\EOF
16564 :t
16565 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
16566 s,@configure_input@,$configure_input,;t t
16567 s,@srcdir@,$ac_srcdir,;t t
16568 s,@top_srcdir@,$ac_top_srcdir,;t t
16569 s,@INSTALL@,$ac_INSTALL,;t t
16570 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
16571   rm -f $tmp/stdin
16572   if test x"$ac_file" != x-; then
16573     mv $tmp/out $ac_file
16574   else
16575     cat $tmp/out
16576     rm -f $tmp/out
16577   fi
16578
16579 done
16580 EOF
16581 cat >>$CONFIG_STATUS <<\EOF
16582
16583 #
16584 # CONFIG_HEADER section.
16585 #
16586
16587 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
16588 # NAME is the cpp macro being defined and VALUE is the value it is being given.
16589 #
16590 # ac_d sets the value in "#define NAME VALUE" lines.
16591 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
16592 ac_dB='[        ].*$,\1#\2'
16593 ac_dC=' '
16594 ac_dD=',;t'
16595 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
16596 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16597 ac_iB='\([      ]\),\1#\2define\3'
16598 ac_iC=' '
16599 ac_iD='\4,;t'
16600 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16601 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16602 ac_uB='$,\1#\2define\3'
16603 ac_uC=' '
16604 ac_uD=',;t'
16605
16606 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
16607   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16608   case $ac_file in
16609   - | *:- | *:-:* ) # input from stdin
16610         cat >$tmp/stdin
16611         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16612         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16613   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16614         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16615   * )   ac_file_in=$ac_file.in ;;
16616   esac
16617
16618   test x"$ac_file" != x- && { echo "$as_me:16618: creating $ac_file" >&5
16619 echo "$as_me: creating $ac_file" >&6;}
16620
16621   # First look for the input files in the build tree, otherwise in the
16622   # src tree.
16623   ac_file_inputs=`IFS=:
16624     for f in $ac_file_in; do
16625       case $f in
16626       -) echo $tmp/stdin ;;
16627       [\\/$]*)
16628          # Absolute (can't be DOS-style, as IFS=:)
16629          test -f "$f" || { { echo "$as_me:16629: error: cannot find input file: $f" >&5
16630 echo "$as_me: error: cannot find input file: $f" >&2;}
16631    { (exit 1); exit 1; }; }
16632          echo $f;;
16633       *) # Relative
16634          if test -f "$f"; then
16635            # Build tree
16636            echo $f
16637          elif test -f "$srcdir/$f"; then
16638            # Source tree
16639            echo $srcdir/$f
16640          else
16641            # /dev/null tree
16642            { { echo "$as_me:16642: error: cannot find input file: $f" >&5
16643 echo "$as_me: error: cannot find input file: $f" >&2;}
16644    { (exit 1); exit 1; }; }
16645          fi;;
16646       esac
16647     done` || { (exit 1); exit 1; }
16648   # Remove the trailing spaces.
16649   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
16650
16651 EOF
16652
16653 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
16654 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
16655 # be either 'cat' or 'sort'.
16656 cat confdefs.h | uniq >conftest.vals
16657
16658 # Break up conftest.vals because some shells have a limit on
16659 # the size of here documents, and old seds have small limits too.
16660
16661 rm -f conftest.tail
16662 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
16663 while grep . conftest.vals >/dev/null
16664 do
16665   # Write chunks of a limited-size here document to conftest.frag.
16666   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
16667   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
16668   echo 'CEOF' >> $CONFIG_STATUS
16669   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
16670   rm -f conftest.vals
16671   mv conftest.tail conftest.vals
16672 done
16673 rm -f conftest.vals
16674
16675 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
16676 # marker @DEFS@.
16677 echo '  cat >> conftest.edit <<CEOF
16678 /@DEFS@/r conftest.frag
16679 /@DEFS@/d
16680 CEOF
16681 sed -f conftest.edit $tmp/in > $tmp/out
16682 rm -f $tmp/in
16683 mv $tmp/out $tmp/in
16684 rm -f conftest.edit conftest.frag
16685 ' >> $CONFIG_STATUS
16686
16687 cat >>$CONFIG_STATUS <<\EOF
16688   # Let's still pretend it is `configure' which instantiates (i.e., don't
16689   # use $as_me), people would be surprised to read:
16690   #    /* config.h.  Generated automatically by config.status.  */
16691   if test x"$ac_file" = x-; then
16692     echo "/* Generated automatically by configure.  */" >$tmp/config.h
16693   else
16694     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
16695   fi
16696   cat $tmp/in >>$tmp/config.h
16697   rm -f $tmp/in
16698   if test x"$ac_file" != x-; then
16699     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
16700       { echo "$as_me:16700: $ac_file is unchanged" >&5
16701 echo "$as_me: $ac_file is unchanged" >&6;}
16702     else
16703       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16704          X"$ac_file" : 'X\(//\)[^/]' \| \
16705          X"$ac_file" : 'X\(//\)$' \| \
16706          X"$ac_file" : 'X\(/\)' \| \
16707          .     : '\(.\)' 2>/dev/null ||
16708 echo X"$ac_file" |
16709     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16710           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16711           /^X\(\/\/\)$/{ s//\1/; q; }
16712           /^X\(\/\).*/{ s//\1/; q; }
16713           s/.*/./; q'`
16714       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16715         { case "$ac_dir" in
16716   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16717   *)                      as_incr_dir=.;;
16718 esac
16719 as_dummy="$ac_dir"
16720 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16721   case $as_mkdir_dir in
16722     # Skip DOS drivespec
16723     ?:) as_incr_dir=$as_mkdir_dir ;;
16724     *)
16725       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16726       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16727     ;;
16728   esac
16729 done; }
16730
16731       fi
16732       rm -f $ac_file
16733       mv $tmp/config.h $ac_file
16734     fi
16735   else
16736     cat $tmp/config.h
16737     rm -f $tmp/config.h
16738   fi
16739 done
16740 EOF
16741 cat >>$CONFIG_STATUS <<\EOF
16742 #
16743 # CONFIG_COMMANDS section.
16744 #
16745 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
16746   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
16747   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
16748
16749   case $ac_dest in
16750     default )
16751
16752 for cf_dir in .
16753 do
16754         if test ! -d $srcdir/$cf_dir; then
16755                 continue
16756         elif test -f $srcdir/$cf_dir/programs; then
16757                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
16758         fi
16759 done
16760
16761         cat >>Makefile <<TEST_EOF
16762
16763 # These rules are generated so we do not rely on suffix rules, which do not
16764 # work consistently for different make-programs (the '\$(MODEL)/' confuses
16765 # some, and the '\$x' confuses others).
16766 TEST_EOF
16767
16768 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
16769 for N in $LIST
16770 do
16771         cat >>Makefile <<TEST_EOF
16772
16773 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
16774         \$(srcdir)/test.priv.h \\
16775         ncurses_cfg.h
16776         @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
16777 TEST_EOF
16778 done
16779
16780 if test -f ../config.guess && test -f ../config.sub
16781 then
16782         cat >>Makefile <<TEST_EOF
16783
16784 # if we used CF_INHERIT for getting these files, we can remove them
16785 distclean::
16786         rm -f config.guess config.sub
16787 TEST_EOF
16788 fi
16789  ;;
16790   esac
16791 done
16792 EOF
16793
16794 cat >>$CONFIG_STATUS <<\EOF
16795
16796 { (exit 0); exit 0; }
16797 EOF
16798 chmod +x $CONFIG_STATUS
16799 ac_clean_files=$ac_clean_files_save
16800
16801 # configure is writing to config.log, and then calls config.status.
16802 # config.status does its own redirection, appending to config.log.
16803 # Unfortunately, on DOS this fails, as config.log is still kept open
16804 # by configure, so config.status won't be able to write to it; its
16805 # output is simply discarded.  So we exec the FD to /dev/null,
16806 # effectively closing config.log, so it can be properly (re)opened and
16807 # appended to by config.status.  When coming back to configure, we
16808 # need to make the FD available again.
16809 if test "$no_create" != yes; then
16810   ac_cs_success=:
16811   exec 5>/dev/null
16812   $SHELL $CONFIG_STATUS || ac_cs_success=false
16813   exec 5>>config.log
16814   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
16815   # would make configure fail if this is the last instruction.
16816   $ac_cs_success || { (exit 1); exit 1; }
16817 fi
16818