]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.9 - patch 20120811
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20120811.
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 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${datarootdir}/info'
146 mandir='${datarootdir}/man'
147
148 # Identity of this package.
149 PACKAGE_NAME=
150 PACKAGE_TARNAME=
151 PACKAGE_VERSION=
152 PACKAGE_STRING=
153 PACKAGE_BUGREPORT=
154
155 ac_prev=
156 for ac_option
157 do
158   # If the previous option needs an argument, assign it.
159   if test -n "$ac_prev"; then
160     eval "$ac_prev=\$ac_option"
161     ac_prev=
162     continue
163   fi
164
165   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
166
167   # Accept the important Cygnus configure options, so we can diagnose typos.
168
169   case $ac_option in
170
171   -bindir | --bindir | --bindi | --bind | --bin | --bi)
172     ac_prev=bindir ;;
173   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
174     bindir=$ac_optarg ;;
175
176   -build | --build | --buil | --bui | --bu)
177     ac_prev=build_alias ;;
178   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
179     build_alias=$ac_optarg ;;
180
181   -cache-file | --cache-file | --cache-fil | --cache-fi \
182   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
183     ac_prev=cache_file ;;
184   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
185   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
186     cache_file=$ac_optarg ;;
187
188   --config-cache | -C)
189     cache_file=config.cache ;;
190
191   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
192     ac_prev=datadir ;;
193   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
194   | --da=*)
195     datadir=$ac_optarg ;;
196
197   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
198   | --dataroo | --dataro | --datar)
199     ac_prev=datarootdir ;;
200   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
201   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
202     datarootdir=$ac_optarg ;;
203
204   -disable-* | --disable-*)
205     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
206     # Reject names that are not valid shell variable names.
207     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
208       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
209    { (exit 1); exit 1; }; }
210     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
211     eval "enable_$ac_feature=no" ;;
212
213   -enable-* | --enable-*)
214     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
215     # Reject names that are not valid shell variable names.
216     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
217       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
218    { (exit 1); exit 1; }; }
219     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
220     case $ac_option in
221       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
222       *) ac_optarg=yes ;;
223     esac
224     eval "enable_$ac_feature='$ac_optarg'" ;;
225
226   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
227   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
228   | --exec | --exe | --ex)
229     ac_prev=exec_prefix ;;
230   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
231   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
232   | --exec=* | --exe=* | --ex=*)
233     exec_prefix=$ac_optarg ;;
234
235   -gas | --gas | --ga | --g)
236     # Obsolete; use --with-gas.
237     with_gas=yes ;;
238
239   -help | --help | --hel | --he | -h)
240     ac_init_help=long ;;
241   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
242     ac_init_help=recursive ;;
243   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
244     ac_init_help=short ;;
245
246   -host | --host | --hos | --ho)
247     ac_prev=host_alias ;;
248   -host=* | --host=* | --hos=* | --ho=*)
249     host_alias=$ac_optarg ;;
250
251   -includedir | --includedir | --includedi | --included | --include \
252   | --includ | --inclu | --incl | --inc)
253     ac_prev=includedir ;;
254   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
255   | --includ=* | --inclu=* | --incl=* | --inc=*)
256     includedir=$ac_optarg ;;
257
258   -infodir | --infodir | --infodi | --infod | --info | --inf)
259     ac_prev=infodir ;;
260   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
261     infodir=$ac_optarg ;;
262
263   -libdir | --libdir | --libdi | --libd)
264     ac_prev=libdir ;;
265   -libdir=* | --libdir=* | --libdi=* | --libd=*)
266     libdir=$ac_optarg ;;
267
268   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
269   | --libexe | --libex | --libe)
270     ac_prev=libexecdir ;;
271   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
272   | --libexe=* | --libex=* | --libe=*)
273     libexecdir=$ac_optarg ;;
274
275   -localstatedir | --localstatedir | --localstatedi | --localstated \
276   | --localstate | --localstat | --localsta | --localst \
277   | --locals | --local | --loca | --loc | --lo)
278     ac_prev=localstatedir ;;
279   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
280   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
281   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
282     localstatedir=$ac_optarg ;;
283
284   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
285     ac_prev=mandir ;;
286   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
287     mandir=$ac_optarg ;;
288
289   -nfp | --nfp | --nf)
290     # Obsolete; use --without-fp.
291     with_fp=no ;;
292
293   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
294   | --no-cr | --no-c)
295     no_create=yes ;;
296
297   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
298   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
299     no_recursion=yes ;;
300
301   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
302   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
303   | --oldin | --oldi | --old | --ol | --o)
304     ac_prev=oldincludedir ;;
305   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
306   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
307   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
308     oldincludedir=$ac_optarg ;;
309
310   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
311     ac_prev=prefix ;;
312   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
313     prefix=$ac_optarg ;;
314
315   -program-prefix | --program-prefix | --program-prefi | --program-pref \
316   | --program-pre | --program-pr | --program-p)
317     ac_prev=program_prefix ;;
318   -program-prefix=* | --program-prefix=* | --program-prefi=* \
319   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
320     program_prefix=$ac_optarg ;;
321
322   -program-suffix | --program-suffix | --program-suffi | --program-suff \
323   | --program-suf | --program-su | --program-s)
324     ac_prev=program_suffix ;;
325   -program-suffix=* | --program-suffix=* | --program-suffi=* \
326   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
327     program_suffix=$ac_optarg ;;
328
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     ac_prev=program_transform_name ;;
337   -program-transform-name=* | --program-transform-name=* \
338   | --program-transform-nam=* | --program-transform-na=* \
339   | --program-transform-n=* | --program-transform-=* \
340   | --program-transform=* | --program-transfor=* \
341   | --program-transfo=* | --program-transf=* \
342   | --program-trans=* | --program-tran=* \
343   | --progr-tra=* | --program-tr=* | --program-t=*)
344     program_transform_name=$ac_optarg ;;
345
346   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
347   | -silent | --silent | --silen | --sile | --sil)
348     silent=yes ;;
349
350   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
351     ac_prev=sbindir ;;
352   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
353   | --sbi=* | --sb=*)
354     sbindir=$ac_optarg ;;
355
356   -sharedstatedir | --sharedstatedir | --sharedstatedi \
357   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
358   | --sharedst | --shareds | --shared | --share | --shar \
359   | --sha | --sh)
360     ac_prev=sharedstatedir ;;
361   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
362   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
363   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
364   | --sha=* | --sh=*)
365     sharedstatedir=$ac_optarg ;;
366
367   -site | --site | --sit)
368     ac_prev=site ;;
369   -site=* | --site=* | --sit=*)
370     site=$ac_optarg ;;
371
372   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
373     ac_prev=srcdir ;;
374   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
375     srcdir=$ac_optarg ;;
376
377   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
378   | --syscon | --sysco | --sysc | --sys | --sy)
379     ac_prev=sysconfdir ;;
380   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
381   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
382     sysconfdir=$ac_optarg ;;
383
384   -target | --target | --targe | --targ | --tar | --ta | --t)
385     ac_prev=target_alias ;;
386   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
387     target_alias=$ac_optarg ;;
388
389   -v | -verbose | --verbose | --verbos | --verbo | --verb)
390     verbose=yes ;;
391
392   -version | --version | --versio | --versi | --vers | -V)
393     ac_init_version=: ;;
394
395   -with-* | --with-*)
396     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
397     # Reject names that are not valid shell variable names.
398     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
399       { echo "$as_me: error: invalid package name: $ac_package" >&2
400    { (exit 1); exit 1; }; }
401     ac_package=`echo $ac_package| sed 's/-/_/g'`
402     case $ac_option in
403       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
404       *) ac_optarg=yes ;;
405     esac
406     eval "with_$ac_package='$ac_optarg'" ;;
407
408   -without-* | --without-*)
409     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
410     # Reject names that are not valid shell variable names.
411     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
412       { echo "$as_me: error: invalid package name: $ac_package" >&2
413    { (exit 1); exit 1; }; }
414     ac_package=`echo $ac_package | sed 's/-/_/g'`
415     eval "with_$ac_package=no" ;;
416
417   --x)
418     # Obsolete; use --with-x.
419     with_x=yes ;;
420
421   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
422   | --x-incl | --x-inc | --x-in | --x-i)
423     ac_prev=x_includes ;;
424   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
425   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
426     x_includes=$ac_optarg ;;
427
428   -x-libraries | --x-libraries | --x-librarie | --x-librari \
429   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
430     ac_prev=x_libraries ;;
431   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
432   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
433     x_libraries=$ac_optarg ;;
434
435   -*) { echo "$as_me: error: unrecognized option: $ac_option
436 Try \`$0 --help' for more information." >&2
437    { (exit 1); exit 1; }; }
438     ;;
439
440   *=*)
441     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
442     # Reject names that are not valid shell variable names.
443     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
444       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
445    { (exit 1); exit 1; }; }
446     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
447     eval "$ac_envvar='$ac_optarg'"
448     export $ac_envvar ;;
449
450   *)
451     # FIXME: should be removed in autoconf 3.0.
452     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
453     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
454       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
455     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
456     ;;
457
458   esac
459 done
460
461 if test -n "$ac_prev"; then
462   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
463   { echo "$as_me: error: missing argument to $ac_option" >&2
464    { (exit 1); exit 1; }; }
465 fi
466
467 # Be sure to have absolute paths.
468 for ac_var in exec_prefix prefix
469 do
470   eval ac_val=$`echo $ac_var`
471   case $ac_val in
472     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
473     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
474    { (exit 1); exit 1; }; };;
475   esac
476 done
477
478 # Be sure to have absolute paths.
479 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
480               localstatedir libdir includedir oldincludedir infodir mandir
481 do
482   eval ac_val=$`echo $ac_var`
483   case $ac_val in
484     [\\/$]* | ?:[\\/]* ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # There might be people who depend on the old broken behavior: `$host'
491 # used to hold the argument of --host etc.
492 build=$build_alias
493 host=$host_alias
494 target=$target_alias
495
496 # FIXME: should be removed in autoconf 3.0.
497 if test "x$host_alias" != x; then
498   if test "x$build_alias" = x; then
499     cross_compiling=maybe
500     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
501     If a cross compiler is detected then cross compile mode will be used." >&2
502   elif test "x$build_alias" != "x$host_alias"; then
503     cross_compiling=yes
504   fi
505 fi
506
507 ac_tool_prefix=
508 test -n "$host_alias" && ac_tool_prefix=$host_alias-
509
510 test "$silent" = yes && exec 6>/dev/null
511
512 # Find the source files, if location was not specified.
513 if test -z "$srcdir"; then
514   ac_srcdir_defaulted=yes
515   # Try the directory containing this script, then its parent.
516   ac_prog=$0
517   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
518   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
519   srcdir=$ac_confdir
520   if test ! -r $srcdir/$ac_unique_file; then
521     srcdir=..
522   fi
523 else
524   ac_srcdir_defaulted=no
525 fi
526 if test ! -r $srcdir/$ac_unique_file; then
527   if test "$ac_srcdir_defaulted" = yes; then
528     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
529    { (exit 1); exit 1; }; }
530   else
531     { echo "$as_me: error: cannot find sources in $srcdir" >&2
532    { (exit 1); exit 1; }; }
533   fi
534 fi
535 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
536 ac_env_build_alias_set=${build_alias+set}
537 ac_env_build_alias_value=$build_alias
538 ac_cv_env_build_alias_set=${build_alias+set}
539 ac_cv_env_build_alias_value=$build_alias
540 ac_env_host_alias_set=${host_alias+set}
541 ac_env_host_alias_value=$host_alias
542 ac_cv_env_host_alias_set=${host_alias+set}
543 ac_cv_env_host_alias_value=$host_alias
544 ac_env_target_alias_set=${target_alias+set}
545 ac_env_target_alias_value=$target_alias
546 ac_cv_env_target_alias_set=${target_alias+set}
547 ac_cv_env_target_alias_value=$target_alias
548 ac_env_CC_set=${CC+set}
549 ac_env_CC_value=$CC
550 ac_cv_env_CC_set=${CC+set}
551 ac_cv_env_CC_value=$CC
552 ac_env_CFLAGS_set=${CFLAGS+set}
553 ac_env_CFLAGS_value=$CFLAGS
554 ac_cv_env_CFLAGS_set=${CFLAGS+set}
555 ac_cv_env_CFLAGS_value=$CFLAGS
556 ac_env_LDFLAGS_set=${LDFLAGS+set}
557 ac_env_LDFLAGS_value=$LDFLAGS
558 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
559 ac_cv_env_LDFLAGS_value=$LDFLAGS
560 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
561 ac_env_CPPFLAGS_value=$CPPFLAGS
562 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
563 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
564 ac_env_CPP_set=${CPP+set}
565 ac_env_CPP_value=$CPP
566 ac_cv_env_CPP_set=${CPP+set}
567 ac_cv_env_CPP_value=$CPP
568
569 #
570 # Report the --help message.
571 #
572 if test "$ac_init_help" = "long"; then
573   # Omit some internal or obsolete options to make the list less imposing.
574   # This message is too long to be a string in the A/UX 3.1 sh.
575   cat <<EOF
576 \`configure' configures this package to adapt to many kinds of systems.
577
578 Usage: $0 [OPTION]... [VAR=VALUE]...
579
580 To assign environment variables (e.g., CC, CFLAGS...), specify them as
581 VAR=VALUE.  See below for descriptions of some of the useful variables.
582
583 Defaults for the options are specified in brackets.
584
585 Configuration:
586   -h, --help              display this help and exit
587       --help=short        display options specific to this package
588       --help=recursive    display the short help of all the included packages
589   -V, --version           display version information and exit
590   -q, --quiet, --silent   do not print \`checking...' messages
591       --cache-file=FILE   cache test results in FILE [disabled]
592   -C, --config-cache      alias for \`--cache-file=config.cache'
593   -n, --no-create         do not create output files
594       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
595
596 EOF
597
598   cat <<EOF
599 Installation directories:
600   --prefix=PREFIX         install architecture-independent files in PREFIX
601                           [$ac_default_prefix]
602   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
603                           [PREFIX]
604
605 By default, \`make install' will install all the files in
606 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
607 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
608 for instance \`--prefix=\$HOME'.
609
610 For better control, use the options below.
611
612 Fine tuning of the installation directories:
613   --bindir=DIR            user executables [EPREFIX/bin]
614   --sbindir=DIR           system admin executables [EPREFIX/sbin]
615   --libexecdir=DIR        program executables [EPREFIX/libexec]
616   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
617   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
618   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
619   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
620   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
621   --libdir=DIR            object code libraries [EPREFIX/lib]
622   --includedir=DIR        C header files [PREFIX/include]
623   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
624   --infodir=DIR           info documentation [DATAROOTDIR/info]
625   --mandir=DIR            man documentation [DATAROOTDIR/man]
626 EOF
627
628   cat <<\EOF
629
630 Program names:
631   --program-prefix=PREFIX            prepend PREFIX to installed program names
632   --program-suffix=SUFFIX            append SUFFIX to installed program names
633   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
634
635 X features:
636   --x-includes=DIR    X include files are in DIR
637   --x-libraries=DIR   X library files are in DIR
638
639 System types:
640   --build=BUILD           configure for building on BUILD [guessed]
641   --host=HOST       build programs to run on HOST [BUILD]
642 EOF
643 fi
644
645 if test -n "$ac_init_help"; then
646
647   cat <<\EOF
648
649 Optional Features:
650   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
651   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
652
653 Optional Packages:
654   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
655   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
656
657   --disable-echo          display "compiling" commands
658   --enable-warnings       test: turn on gcc compiler warnings
659   --with-dmalloc          test: use Gray Watson's dmalloc library
660   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
661   --with-valgrind         test: use valgrind
662   --disable-leaks         test: free permanent memory, analyze leaks
663   --disable-widec           disable checks for wide-character functions
664   --with-curses-dir=DIR   directory in which (n)curses is installed
665   --with-ncursesw         use wide ncurses-libraries
666   --with-ncurses          use ncurses-libraries
667   --with-pdcurses         compile/link with pdcurses X11 library
668   --with-curses-colr      compile/link with HPUX 10.x color-curses
669   --with-curses-5lib      compile/link with SunOS 5lib curses
670   --with-Xaw3d            link with Xaw 3d library
671   --with-neXtaw           link with neXT Athena library
672   --with-XawPlus          link with Athena-Plus library
673   --with-pkg-config{=path} enable/disable use of pkg-config
674   --with-x                use the X Window System
675   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
676   --disable-rpath-hack    don't add rpath options for additional libraries
677
678 Some influential environment variables:
679   CC          C compiler command
680   CFLAGS      C compiler flags
681   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
682               nonstandard directory <lib dir>
683   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
684               headers in a nonstandard directory <include dir>
685   CPP         C preprocessor
686
687 Use these variables to override the choices made by `configure' or to help
688 it to find libraries and programs with nonstandard names/locations.
689
690 EOF
691 fi
692
693 if test "$ac_init_help" = "recursive"; then
694   # If there are subdirs, report their specific --help.
695   ac_popdir=`pwd`
696   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
697     cd $ac_subdir
698     # A "../" for each directory in /$ac_subdir.
699     ac_dots=`echo $ac_subdir |
700              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
701
702     case $srcdir in
703     .) # No --srcdir option.  We are building in place.
704       ac_sub_srcdir=$srcdir ;;
705     [\\/]* | ?:[\\/]* ) # Absolute path.
706       ac_sub_srcdir=$srcdir/$ac_subdir ;;
707     *) # Relative path.
708       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
709     esac
710
711     # Check for guested configure; otherwise get Cygnus style configure.
712     if test -f $ac_sub_srcdir/configure.gnu; then
713       echo
714       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
715     elif test -f $ac_sub_srcdir/configure; then
716       echo
717       $SHELL $ac_sub_srcdir/configure  --help=recursive
718     elif test -f $ac_sub_srcdir/configure.ac ||
719            test -f $ac_sub_srcdir/configure.in; then
720       echo
721       $ac_configure --help
722     else
723       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
724     fi
725     cd $ac_popdir
726   done
727 fi
728
729 test -n "$ac_init_help" && exit 0
730 if $ac_init_version; then
731   cat <<\EOF
732
733 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
734 Free Software Foundation, Inc.
735 This configure script is free software; the Free Software Foundation
736 gives unlimited permission to copy, distribute and modify it.
737 EOF
738   exit 0
739 fi
740 exec 5>config.log
741 cat >&5 <<EOF
742 This file contains any messages produced by compilers while
743 running configure, to aid debugging if configure makes a mistake.
744
745 It was created by $as_me, which was
746 generated by GNU Autoconf 2.52.20120811.  Invocation command line was
747
748   $ $0 $@
749
750 EOF
751 {
752 cat <<_ASUNAME
753 ## ---------- ##
754 ## Platform.  ##
755 ## ---------- ##
756
757 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
758 uname -m = `(uname -m) 2>/dev/null || echo unknown`
759 uname -r = `(uname -r) 2>/dev/null || echo unknown`
760 uname -s = `(uname -s) 2>/dev/null || echo unknown`
761 uname -v = `(uname -v) 2>/dev/null || echo unknown`
762
763 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
764 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
765
766 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
767 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
768 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
769 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
770 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
771 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
772 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
773
774 PATH = $PATH
775
776 _ASUNAME
777 } >&5
778
779 cat >&5 <<EOF
780 ## ------------ ##
781 ## Core tests.  ##
782 ## ------------ ##
783
784 EOF
785
786 # Keep a trace of the command line.
787 # Strip out --no-create and --no-recursion so they do not pile up.
788 # Also quote any args containing shell meta-characters.
789 ac_configure_args=
790 ac_sep=
791 for ac_arg
792 do
793   case $ac_arg in
794   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
795   | --no-cr | --no-c) ;;
796   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
797   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
798   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
799     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
800     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
801     ac_sep=" " ;;
802   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
803      ac_sep=" " ;;
804   esac
805   # Get rid of the leading space.
806 done
807
808 # When interrupted or exit'd, cleanup temporary files, and complete
809 # config.log.  We remove comments because anyway the quotes in there
810 # would cause problems or look ugly.
811 trap 'exit_status=$?
812   # Save into config.log some information that might help in debugging.
813   echo >&5
814   echo "## ----------------- ##" >&5
815   echo "## Cache variables.  ##" >&5
816   echo "## ----------------- ##" >&5
817   echo >&5
818   # The following way of writing the cache mishandles newlines in values,
819 {
820   (set) 2>&1 |
821     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
822     *ac_space=\ *)
823       sed -n \
824         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
825           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
826       ;;
827     *)
828       sed -n \
829         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
830       ;;
831     esac;
832 } >&5
833   sed "/^$/d" confdefs.h >conftest.log
834   if test -s conftest.log; then
835     echo >&5
836     echo "## ------------ ##" >&5
837     echo "## confdefs.h.  ##" >&5
838     echo "## ------------ ##" >&5
839     echo >&5
840     cat conftest.log >&5
841   fi
842   (echo; echo) >&5
843   test "$ac_signal" != 0 &&
844     echo "$as_me: caught signal $ac_signal" >&5
845   echo "$as_me: exit $exit_status" >&5
846   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
847     exit $exit_status
848      ' 0
849 for ac_signal in 1 2 13 15; do
850   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
851 done
852 ac_signal=0
853
854 # confdefs.h avoids OS command line length limits that DEFS can exceed.
855 rm -rf conftest* confdefs.h
856 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
857 echo >confdefs.h
858
859 # Let the site file select an alternate cache file if it wants to.
860 # Prefer explicitly selected file to automatically selected ones.
861 if test -z "$CONFIG_SITE"; then
862   if test "x$prefix" != xNONE; then
863     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
864   else
865     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
866   fi
867 fi
868 for ac_site_file in $CONFIG_SITE; do
869   if test -r "$ac_site_file"; then
870     { echo "$as_me:870: loading site script $ac_site_file" >&5
871 echo "$as_me: loading site script $ac_site_file" >&6;}
872     cat "$ac_site_file" >&5
873     . "$ac_site_file"
874   fi
875 done
876
877 if test -r "$cache_file"; then
878   # Some versions of bash will fail to source /dev/null (special
879   # files actually), so we avoid doing that.
880   if test -f "$cache_file"; then
881     { echo "$as_me:881: loading cache $cache_file" >&5
882 echo "$as_me: loading cache $cache_file" >&6;}
883     case $cache_file in
884       [\\/]* | ?:[\\/]* ) . $cache_file;;
885       *)                      . ./$cache_file;;
886     esac
887   fi
888 else
889   { echo "$as_me:889: creating cache $cache_file" >&5
890 echo "$as_me: creating cache $cache_file" >&6;}
891   >$cache_file
892 fi
893
894 # Check that the precious variables saved in the cache have kept the same
895 # value.
896 ac_cache_corrupted=false
897 for ac_var in `(set) 2>&1 |
898                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
899   eval ac_old_set=\$ac_cv_env_${ac_var}_set
900   eval ac_new_set=\$ac_env_${ac_var}_set
901   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
902   eval ac_new_val="\$ac_env_${ac_var}_value"
903   case $ac_old_set,$ac_new_set in
904     set,)
905       { echo "$as_me:905: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
906 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
907       ac_cache_corrupted=: ;;
908     ,set)
909       { echo "$as_me:909: error: \`$ac_var' was not set in the previous run" >&5
910 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
911       ac_cache_corrupted=: ;;
912     ,);;
913     *)
914       if test "x$ac_old_val" != "x$ac_new_val"; then
915         { echo "$as_me:915: error: \`$ac_var' has changed since the previous run:" >&5
916 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
917         { echo "$as_me:917:   former value:  $ac_old_val" >&5
918 echo "$as_me:   former value:  $ac_old_val" >&2;}
919         { echo "$as_me:919:   current value: $ac_new_val" >&5
920 echo "$as_me:   current value: $ac_new_val" >&2;}
921         ac_cache_corrupted=:
922       fi;;
923   esac
924   # Pass precious variables to config.status.  It doesn't matter if
925   # we pass some twice (in addition to the command line arguments).
926   if test "$ac_new_set" = set; then
927     case $ac_new_val in
928     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
929       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
930       ac_configure_args="$ac_configure_args '$ac_arg'"
931       ;;
932     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
933        ;;
934     esac
935   fi
936 done
937 if $ac_cache_corrupted; then
938   { echo "$as_me:938: error: changes in the environment can compromise the build" >&5
939 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
940   { { echo "$as_me:940: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
941 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
942    { (exit 1); exit 1; }; }
943 fi
944
945 ac_ext=c
946 ac_cpp='$CPP $CPPFLAGS'
947 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
948 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
949 ac_compiler_gnu=$ac_cv_c_compiler_gnu
950 ac_main_return=return
951
952 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
953   *c*,-n*) ECHO_N= ECHO_C='
954 ' ECHO_T='      ' ;;
955   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
956   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
957 esac
958 echo "#! $SHELL" >conftest.sh
959 echo  "exit 0"   >>conftest.sh
960 chmod +x conftest.sh
961 if { (echo "$as_me:961: PATH=\".;.\"; conftest.sh") >&5
962   (PATH=".;."; conftest.sh) 2>&5
963   ac_status=$?
964   echo "$as_me:964: \$? = $ac_status" >&5
965   (exit $ac_status); }; then
966   ac_path_separator=';'
967 else
968   ac_path_separator=:
969 fi
970 PATH_SEPARATOR="$ac_path_separator"
971 rm -f conftest.sh
972
973 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
974
975 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
976
977 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
978
979 ac_aux_dir=
980 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
981   if test -f $ac_dir/install-sh; then
982     ac_aux_dir=$ac_dir
983     ac_install_sh="$ac_aux_dir/install-sh -c"
984     break
985   elif test -f $ac_dir/install.sh; then
986     ac_aux_dir=$ac_dir
987     ac_install_sh="$ac_aux_dir/install.sh -c"
988     break
989   elif test -f $ac_dir/shtool; then
990     ac_aux_dir=$ac_dir
991     ac_install_sh="$ac_aux_dir/shtool install -c"
992     break
993   fi
994 done
995 if test -z "$ac_aux_dir"; then
996   { { echo "$as_me:996: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
997 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
998    { (exit 1); exit 1; }; }
999 fi
1000 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1001 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1002 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1003
1004 # Make sure we can run config.sub.
1005 $ac_config_sub sun4 >/dev/null 2>&1 ||
1006   { { echo "$as_me:1006: error: cannot run $ac_config_sub" >&5
1007 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1008    { (exit 1); exit 1; }; }
1009
1010 echo "$as_me:1010: checking build system type" >&5
1011 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1012 if test "${ac_cv_build+set}" = set; then
1013   echo $ECHO_N "(cached) $ECHO_C" >&6
1014 else
1015   ac_cv_build_alias=$build_alias
1016 test -z "$ac_cv_build_alias" &&
1017   ac_cv_build_alias=`$ac_config_guess`
1018 test -z "$ac_cv_build_alias" &&
1019   { { echo "$as_me:1019: error: cannot guess build type; you must specify one" >&5
1020 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1021    { (exit 1); exit 1; }; }
1022 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1023   { { echo "$as_me:1023: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1024 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1025    { (exit 1); exit 1; }; }
1026
1027 fi
1028 echo "$as_me:1028: result: $ac_cv_build" >&5
1029 echo "${ECHO_T}$ac_cv_build" >&6
1030 build=$ac_cv_build
1031 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1032 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1033 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1034
1035 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1036         echo "$as_me:1036: checking host system type" >&5
1037 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1038 if test "${ac_cv_host+set}" = set; then
1039   echo $ECHO_N "(cached) $ECHO_C" >&6
1040 else
1041   ac_cv_host_alias=$host_alias
1042 test -z "$ac_cv_host_alias" &&
1043   ac_cv_host_alias=$ac_cv_build_alias
1044 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1045   { { echo "$as_me:1045: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1046 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1047    { (exit 1); exit 1; }; }
1048
1049 fi
1050 echo "$as_me:1050: result: $ac_cv_host" >&5
1051 echo "${ECHO_T}$ac_cv_host" >&6
1052 host=$ac_cv_host
1053 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1054 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1055 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1056
1057         system_name="$host_os"
1058 else
1059         system_name="`(uname -s -r) 2>/dev/null`"
1060         if test -z "$system_name" ; then
1061                 system_name="`(hostname) 2>/dev/null`"
1062         fi
1063 fi
1064 test -n "$system_name" && cat >>confdefs.h <<EOF
1065 #define SYSTEM_NAME "$system_name"
1066 EOF
1067
1068 if test "${cf_cv_system_name+set}" = set; then
1069   echo $ECHO_N "(cached) $ECHO_C" >&6
1070 else
1071   cf_cv_system_name="$system_name"
1072 fi
1073
1074 test -z "$system_name" && system_name="$cf_cv_system_name"
1075 test -n "$cf_cv_system_name" && echo "$as_me:1075: result: Configuring for $cf_cv_system_name" >&5
1076 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1077
1078 if test ".$system_name" != ".$cf_cv_system_name" ; then
1079         echo "$as_me:1079: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1080 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1081         { { echo "$as_me:1081: error: \"Please remove config.cache and try again.\"" >&5
1082 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1083    { (exit 1); exit 1; }; }
1084 fi
1085
1086 test "$program_prefix" != NONE &&
1087   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1088 # Use a double $ so make ignores it.
1089 test "$program_suffix" != NONE &&
1090   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1091 # Double any \ or $.  echo might interpret backslashes.
1092 # By default was `s,x,x', remove it if useless.
1093 cat <<\_ACEOF >conftest.sed
1094 s/[\\$]/&&/g;s/;s,x,x,$//
1095 _ACEOF
1096 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1097 rm conftest.sed
1098
1099 echo "$as_me:1099: checking whether ${MAKE-make} sets \${MAKE}" >&5
1100 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1101 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1102 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1103   echo $ECHO_N "(cached) $ECHO_C" >&6
1104 else
1105   cat >conftest.make <<\EOF
1106 all:
1107         @echo 'ac_maketemp="${MAKE}"'
1108 EOF
1109 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1110 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1111 if test -n "$ac_maketemp"; then
1112   eval ac_cv_prog_make_${ac_make}_set=yes
1113 else
1114   eval ac_cv_prog_make_${ac_make}_set=no
1115 fi
1116 rm -f conftest.make
1117 fi
1118 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1119   echo "$as_me:1119: result: yes" >&5
1120 echo "${ECHO_T}yes" >&6
1121   SET_MAKE=
1122 else
1123   echo "$as_me:1123: result: no" >&5
1124 echo "${ECHO_T}no" >&6
1125   SET_MAKE="MAKE=${MAKE-make}"
1126 fi
1127
1128 ac_ext=c
1129 ac_cpp='$CPP $CPPFLAGS'
1130 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1131 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1132 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1133 ac_main_return=return
1134 if test -n "$ac_tool_prefix"; then
1135   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1136 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1137 echo "$as_me:1137: checking for $ac_word" >&5
1138 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1139 if test "${ac_cv_prog_CC+set}" = set; then
1140   echo $ECHO_N "(cached) $ECHO_C" >&6
1141 else
1142   if test -n "$CC"; then
1143   ac_cv_prog_CC="$CC" # Let the user override the test.
1144 else
1145   ac_save_IFS=$IFS; IFS=$ac_path_separator
1146 ac_dummy="$PATH"
1147 for ac_dir in $ac_dummy; do
1148   IFS=$ac_save_IFS
1149   test -z "$ac_dir" && ac_dir=.
1150   $as_executable_p "$ac_dir/$ac_word" || continue
1151 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1152 echo "$as_me:1152: found $ac_dir/$ac_word" >&5
1153 break
1154 done
1155
1156 fi
1157 fi
1158 CC=$ac_cv_prog_CC
1159 if test -n "$CC"; then
1160   echo "$as_me:1160: result: $CC" >&5
1161 echo "${ECHO_T}$CC" >&6
1162 else
1163   echo "$as_me:1163: result: no" >&5
1164 echo "${ECHO_T}no" >&6
1165 fi
1166
1167 fi
1168 if test -z "$ac_cv_prog_CC"; then
1169   ac_ct_CC=$CC
1170   # Extract the first word of "gcc", so it can be a program name with args.
1171 set dummy gcc; ac_word=$2
1172 echo "$as_me:1172: checking for $ac_word" >&5
1173 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1174 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1175   echo $ECHO_N "(cached) $ECHO_C" >&6
1176 else
1177   if test -n "$ac_ct_CC"; then
1178   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1179 else
1180   ac_save_IFS=$IFS; IFS=$ac_path_separator
1181 ac_dummy="$PATH"
1182 for ac_dir in $ac_dummy; do
1183   IFS=$ac_save_IFS
1184   test -z "$ac_dir" && ac_dir=.
1185   $as_executable_p "$ac_dir/$ac_word" || continue
1186 ac_cv_prog_ac_ct_CC="gcc"
1187 echo "$as_me:1187: found $ac_dir/$ac_word" >&5
1188 break
1189 done
1190
1191 fi
1192 fi
1193 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1194 if test -n "$ac_ct_CC"; then
1195   echo "$as_me:1195: result: $ac_ct_CC" >&5
1196 echo "${ECHO_T}$ac_ct_CC" >&6
1197 else
1198   echo "$as_me:1198: result: no" >&5
1199 echo "${ECHO_T}no" >&6
1200 fi
1201
1202   CC=$ac_ct_CC
1203 else
1204   CC="$ac_cv_prog_CC"
1205 fi
1206
1207 if test -z "$CC"; then
1208   if test -n "$ac_tool_prefix"; then
1209   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1210 set dummy ${ac_tool_prefix}cc; ac_word=$2
1211 echo "$as_me:1211: checking for $ac_word" >&5
1212 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1213 if test "${ac_cv_prog_CC+set}" = set; then
1214   echo $ECHO_N "(cached) $ECHO_C" >&6
1215 else
1216   if test -n "$CC"; then
1217   ac_cv_prog_CC="$CC" # Let the user override the test.
1218 else
1219   ac_save_IFS=$IFS; IFS=$ac_path_separator
1220 ac_dummy="$PATH"
1221 for ac_dir in $ac_dummy; do
1222   IFS=$ac_save_IFS
1223   test -z "$ac_dir" && ac_dir=.
1224   $as_executable_p "$ac_dir/$ac_word" || continue
1225 ac_cv_prog_CC="${ac_tool_prefix}cc"
1226 echo "$as_me:1226: found $ac_dir/$ac_word" >&5
1227 break
1228 done
1229
1230 fi
1231 fi
1232 CC=$ac_cv_prog_CC
1233 if test -n "$CC"; then
1234   echo "$as_me:1234: result: $CC" >&5
1235 echo "${ECHO_T}$CC" >&6
1236 else
1237   echo "$as_me:1237: result: no" >&5
1238 echo "${ECHO_T}no" >&6
1239 fi
1240
1241 fi
1242 if test -z "$ac_cv_prog_CC"; then
1243   ac_ct_CC=$CC
1244   # Extract the first word of "cc", so it can be a program name with args.
1245 set dummy cc; ac_word=$2
1246 echo "$as_me:1246: checking for $ac_word" >&5
1247 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1248 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1249   echo $ECHO_N "(cached) $ECHO_C" >&6
1250 else
1251   if test -n "$ac_ct_CC"; then
1252   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1253 else
1254   ac_save_IFS=$IFS; IFS=$ac_path_separator
1255 ac_dummy="$PATH"
1256 for ac_dir in $ac_dummy; do
1257   IFS=$ac_save_IFS
1258   test -z "$ac_dir" && ac_dir=.
1259   $as_executable_p "$ac_dir/$ac_word" || continue
1260 ac_cv_prog_ac_ct_CC="cc"
1261 echo "$as_me:1261: found $ac_dir/$ac_word" >&5
1262 break
1263 done
1264
1265 fi
1266 fi
1267 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1268 if test -n "$ac_ct_CC"; then
1269   echo "$as_me:1269: result: $ac_ct_CC" >&5
1270 echo "${ECHO_T}$ac_ct_CC" >&6
1271 else
1272   echo "$as_me:1272: result: no" >&5
1273 echo "${ECHO_T}no" >&6
1274 fi
1275
1276   CC=$ac_ct_CC
1277 else
1278   CC="$ac_cv_prog_CC"
1279 fi
1280
1281 fi
1282 if test -z "$CC"; then
1283   # Extract the first word of "cc", so it can be a program name with args.
1284 set dummy cc; ac_word=$2
1285 echo "$as_me:1285: checking for $ac_word" >&5
1286 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1287 if test "${ac_cv_prog_CC+set}" = set; then
1288   echo $ECHO_N "(cached) $ECHO_C" >&6
1289 else
1290   if test -n "$CC"; then
1291   ac_cv_prog_CC="$CC" # Let the user override the test.
1292 else
1293   ac_prog_rejected=no
1294   ac_save_IFS=$IFS; IFS=$ac_path_separator
1295 ac_dummy="$PATH"
1296 for ac_dir in $ac_dummy; do
1297   IFS=$ac_save_IFS
1298   test -z "$ac_dir" && ac_dir=.
1299   $as_executable_p "$ac_dir/$ac_word" || continue
1300 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1301   ac_prog_rejected=yes
1302   continue
1303 fi
1304 ac_cv_prog_CC="cc"
1305 echo "$as_me:1305: found $ac_dir/$ac_word" >&5
1306 break
1307 done
1308
1309 if test $ac_prog_rejected = yes; then
1310   # We found a bogon in the path, so make sure we never use it.
1311   set dummy $ac_cv_prog_CC
1312   shift
1313   if test $# != 0; then
1314     # We chose a different compiler from the bogus one.
1315     # However, it has the same basename, so the bogon will be chosen
1316     # first if we set CC to just the basename; use the full file name.
1317     shift
1318     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1319     shift
1320     ac_cv_prog_CC="$@"
1321   fi
1322 fi
1323 fi
1324 fi
1325 CC=$ac_cv_prog_CC
1326 if test -n "$CC"; then
1327   echo "$as_me:1327: result: $CC" >&5
1328 echo "${ECHO_T}$CC" >&6
1329 else
1330   echo "$as_me:1330: result: no" >&5
1331 echo "${ECHO_T}no" >&6
1332 fi
1333
1334 fi
1335 if test -z "$CC"; then
1336   if test -n "$ac_tool_prefix"; then
1337   for ac_prog in cl
1338   do
1339     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1340 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1341 echo "$as_me:1341: checking for $ac_word" >&5
1342 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1343 if test "${ac_cv_prog_CC+set}" = set; then
1344   echo $ECHO_N "(cached) $ECHO_C" >&6
1345 else
1346   if test -n "$CC"; then
1347   ac_cv_prog_CC="$CC" # Let the user override the test.
1348 else
1349   ac_save_IFS=$IFS; IFS=$ac_path_separator
1350 ac_dummy="$PATH"
1351 for ac_dir in $ac_dummy; do
1352   IFS=$ac_save_IFS
1353   test -z "$ac_dir" && ac_dir=.
1354   $as_executable_p "$ac_dir/$ac_word" || continue
1355 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1356 echo "$as_me:1356: found $ac_dir/$ac_word" >&5
1357 break
1358 done
1359
1360 fi
1361 fi
1362 CC=$ac_cv_prog_CC
1363 if test -n "$CC"; then
1364   echo "$as_me:1364: result: $CC" >&5
1365 echo "${ECHO_T}$CC" >&6
1366 else
1367   echo "$as_me:1367: result: no" >&5
1368 echo "${ECHO_T}no" >&6
1369 fi
1370
1371     test -n "$CC" && break
1372   done
1373 fi
1374 if test -z "$CC"; then
1375   ac_ct_CC=$CC
1376   for ac_prog in cl
1377 do
1378   # Extract the first word of "$ac_prog", so it can be a program name with args.
1379 set dummy $ac_prog; ac_word=$2
1380 echo "$as_me:1380: checking for $ac_word" >&5
1381 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1382 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1383   echo $ECHO_N "(cached) $ECHO_C" >&6
1384 else
1385   if test -n "$ac_ct_CC"; then
1386   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1387 else
1388   ac_save_IFS=$IFS; IFS=$ac_path_separator
1389 ac_dummy="$PATH"
1390 for ac_dir in $ac_dummy; do
1391   IFS=$ac_save_IFS
1392   test -z "$ac_dir" && ac_dir=.
1393   $as_executable_p "$ac_dir/$ac_word" || continue
1394 ac_cv_prog_ac_ct_CC="$ac_prog"
1395 echo "$as_me:1395: found $ac_dir/$ac_word" >&5
1396 break
1397 done
1398
1399 fi
1400 fi
1401 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1402 if test -n "$ac_ct_CC"; then
1403   echo "$as_me:1403: result: $ac_ct_CC" >&5
1404 echo "${ECHO_T}$ac_ct_CC" >&6
1405 else
1406   echo "$as_me:1406: result: no" >&5
1407 echo "${ECHO_T}no" >&6
1408 fi
1409
1410   test -n "$ac_ct_CC" && break
1411 done
1412
1413   CC=$ac_ct_CC
1414 fi
1415
1416 fi
1417
1418 test -z "$CC" && { { echo "$as_me:1418: error: no acceptable cc found in \$PATH" >&5
1419 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1420    { (exit 1); exit 1; }; }
1421
1422 # Provide some information about the compiler.
1423 echo "$as_me:1423:" \
1424      "checking for C compiler version" >&5
1425 ac_compiler=`set X $ac_compile; echo $2`
1426 { (eval echo "$as_me:1426: \"$ac_compiler --version </dev/null >&5\"") >&5
1427   (eval $ac_compiler --version </dev/null >&5) 2>&5
1428   ac_status=$?
1429   echo "$as_me:1429: \$? = $ac_status" >&5
1430   (exit $ac_status); }
1431 { (eval echo "$as_me:1431: \"$ac_compiler -v </dev/null >&5\"") >&5
1432   (eval $ac_compiler -v </dev/null >&5) 2>&5
1433   ac_status=$?
1434   echo "$as_me:1434: \$? = $ac_status" >&5
1435   (exit $ac_status); }
1436 { (eval echo "$as_me:1436: \"$ac_compiler -V </dev/null >&5\"") >&5
1437   (eval $ac_compiler -V </dev/null >&5) 2>&5
1438   ac_status=$?
1439   echo "$as_me:1439: \$? = $ac_status" >&5
1440   (exit $ac_status); }
1441
1442 cat >conftest.$ac_ext <<_ACEOF
1443 #line 1443 "configure"
1444 #include "confdefs.h"
1445
1446 int
1447 main ()
1448 {
1449
1450   ;
1451   return 0;
1452 }
1453 _ACEOF
1454 ac_clean_files_save=$ac_clean_files
1455 ac_clean_files="$ac_clean_files a.out a.exe"
1456 # Try to create an executable without -o first, disregard a.out.
1457 # It will help us diagnose broken compilers, and finding out an intuition
1458 # of exeext.
1459 echo "$as_me:1459: checking for C compiler default output" >&5
1460 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1461 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1462 if { (eval echo "$as_me:1462: \"$ac_link_default\"") >&5
1463   (eval $ac_link_default) 2>&5
1464   ac_status=$?
1465   echo "$as_me:1465: \$? = $ac_status" >&5
1466   (exit $ac_status); }; then
1467   # Find the output, starting from the most likely.  This scheme is
1468 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1469 # resort.
1470 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1471                 ls a.out conftest 2>/dev/null;
1472                 ls a.* conftest.* 2>/dev/null`; do
1473   case $ac_file in
1474     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1475     a.out ) # We found the default executable, but exeext='' is most
1476             # certainly right.
1477             break;;
1478     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1479           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1480           export ac_cv_exeext
1481           break;;
1482     * ) break;;
1483   esac
1484 done
1485 else
1486   echo "$as_me: failed program was:" >&5
1487 cat conftest.$ac_ext >&5
1488 { { echo "$as_me:1488: error: C compiler cannot create executables" >&5
1489 echo "$as_me: error: C compiler cannot create executables" >&2;}
1490    { (exit 77); exit 77; }; }
1491 fi
1492
1493 ac_exeext=$ac_cv_exeext
1494 echo "$as_me:1494: result: $ac_file" >&5
1495 echo "${ECHO_T}$ac_file" >&6
1496
1497 # Check the compiler produces executables we can run.  If not, either
1498 # the compiler is broken, or we cross compile.
1499 echo "$as_me:1499: checking whether the C compiler works" >&5
1500 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1501 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1502 # If not cross compiling, check that we can run a simple program.
1503 if test "$cross_compiling" != yes; then
1504   if { ac_try='./$ac_file'
1505   { (eval echo "$as_me:1505: \"$ac_try\"") >&5
1506   (eval $ac_try) 2>&5
1507   ac_status=$?
1508   echo "$as_me:1508: \$? = $ac_status" >&5
1509   (exit $ac_status); }; }; then
1510     cross_compiling=no
1511   else
1512     if test "$cross_compiling" = maybe; then
1513         cross_compiling=yes
1514     else
1515         { { echo "$as_me:1515: error: cannot run C compiled programs.
1516 If you meant to cross compile, use \`--host'." >&5
1517 echo "$as_me: error: cannot run C compiled programs.
1518 If you meant to cross compile, use \`--host'." >&2;}
1519    { (exit 1); exit 1; }; }
1520     fi
1521   fi
1522 fi
1523 echo "$as_me:1523: result: yes" >&5
1524 echo "${ECHO_T}yes" >&6
1525
1526 rm -f a.out a.exe conftest$ac_cv_exeext
1527 ac_clean_files=$ac_clean_files_save
1528 # Check the compiler produces executables we can run.  If not, either
1529 # the compiler is broken, or we cross compile.
1530 echo "$as_me:1530: checking whether we are cross compiling" >&5
1531 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1532 echo "$as_me:1532: result: $cross_compiling" >&5
1533 echo "${ECHO_T}$cross_compiling" >&6
1534
1535 echo "$as_me:1535: checking for executable suffix" >&5
1536 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1537 if { (eval echo "$as_me:1537: \"$ac_link\"") >&5
1538   (eval $ac_link) 2>&5
1539   ac_status=$?
1540   echo "$as_me:1540: \$? = $ac_status" >&5
1541   (exit $ac_status); }; then
1542   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1543 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1544 # work properly (i.e., refer to `conftest.exe'), while it won't with
1545 # `rm'.
1546 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1547   case $ac_file in
1548     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1549     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1550           export ac_cv_exeext
1551           break;;
1552     * ) break;;
1553   esac
1554 done
1555 else
1556   { { echo "$as_me:1556: error: cannot compute EXEEXT: cannot compile and link" >&5
1557 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1558    { (exit 1); exit 1; }; }
1559 fi
1560
1561 rm -f conftest$ac_cv_exeext
1562 echo "$as_me:1562: result: $ac_cv_exeext" >&5
1563 echo "${ECHO_T}$ac_cv_exeext" >&6
1564
1565 rm -f conftest.$ac_ext
1566 EXEEXT=$ac_cv_exeext
1567 ac_exeext=$EXEEXT
1568 echo "$as_me:1568: checking for object suffix" >&5
1569 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1570 if test "${ac_cv_objext+set}" = set; then
1571   echo $ECHO_N "(cached) $ECHO_C" >&6
1572 else
1573   cat >conftest.$ac_ext <<_ACEOF
1574 #line 1574 "configure"
1575 #include "confdefs.h"
1576
1577 int
1578 main ()
1579 {
1580
1581   ;
1582   return 0;
1583 }
1584 _ACEOF
1585 rm -f conftest.o conftest.obj
1586 if { (eval echo "$as_me:1586: \"$ac_compile\"") >&5
1587   (eval $ac_compile) 2>&5
1588   ac_status=$?
1589   echo "$as_me:1589: \$? = $ac_status" >&5
1590   (exit $ac_status); }; then
1591   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1592   case $ac_file in
1593     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1594     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1595        break;;
1596   esac
1597 done
1598 else
1599   echo "$as_me: failed program was:" >&5
1600 cat conftest.$ac_ext >&5
1601 { { echo "$as_me:1601: error: cannot compute OBJEXT: cannot compile" >&5
1602 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1603    { (exit 1); exit 1; }; }
1604 fi
1605
1606 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1607 fi
1608 echo "$as_me:1608: result: $ac_cv_objext" >&5
1609 echo "${ECHO_T}$ac_cv_objext" >&6
1610 OBJEXT=$ac_cv_objext
1611 ac_objext=$OBJEXT
1612 echo "$as_me:1612: checking whether we are using the GNU C compiler" >&5
1613 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1614 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1615   echo $ECHO_N "(cached) $ECHO_C" >&6
1616 else
1617   cat >conftest.$ac_ext <<_ACEOF
1618 #line 1618 "configure"
1619 #include "confdefs.h"
1620
1621 int
1622 main ()
1623 {
1624 #ifndef __GNUC__
1625        choke me
1626 #endif
1627
1628   ;
1629   return 0;
1630 }
1631 _ACEOF
1632 rm -f conftest.$ac_objext
1633 if { (eval echo "$as_me:1633: \"$ac_compile\"") >&5
1634   (eval $ac_compile) 2>&5
1635   ac_status=$?
1636   echo "$as_me:1636: \$? = $ac_status" >&5
1637   (exit $ac_status); } &&
1638          { ac_try='test -s conftest.$ac_objext'
1639   { (eval echo "$as_me:1639: \"$ac_try\"") >&5
1640   (eval $ac_try) 2>&5
1641   ac_status=$?
1642   echo "$as_me:1642: \$? = $ac_status" >&5
1643   (exit $ac_status); }; }; then
1644   ac_compiler_gnu=yes
1645 else
1646   echo "$as_me: failed program was:" >&5
1647 cat conftest.$ac_ext >&5
1648 ac_compiler_gnu=no
1649 fi
1650 rm -f conftest.$ac_objext conftest.$ac_ext
1651 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1652
1653 fi
1654 echo "$as_me:1654: result: $ac_cv_c_compiler_gnu" >&5
1655 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1656 GCC=`test $ac_compiler_gnu = yes && echo yes`
1657 ac_test_CFLAGS=${CFLAGS+set}
1658 ac_save_CFLAGS=$CFLAGS
1659 CFLAGS="-g"
1660 echo "$as_me:1660: checking whether $CC accepts -g" >&5
1661 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1662 if test "${ac_cv_prog_cc_g+set}" = set; then
1663   echo $ECHO_N "(cached) $ECHO_C" >&6
1664 else
1665   cat >conftest.$ac_ext <<_ACEOF
1666 #line 1666 "configure"
1667 #include "confdefs.h"
1668
1669 int
1670 main ()
1671 {
1672
1673   ;
1674   return 0;
1675 }
1676 _ACEOF
1677 rm -f conftest.$ac_objext
1678 if { (eval echo "$as_me:1678: \"$ac_compile\"") >&5
1679   (eval $ac_compile) 2>&5
1680   ac_status=$?
1681   echo "$as_me:1681: \$? = $ac_status" >&5
1682   (exit $ac_status); } &&
1683          { ac_try='test -s conftest.$ac_objext'
1684   { (eval echo "$as_me:1684: \"$ac_try\"") >&5
1685   (eval $ac_try) 2>&5
1686   ac_status=$?
1687   echo "$as_me:1687: \$? = $ac_status" >&5
1688   (exit $ac_status); }; }; then
1689   ac_cv_prog_cc_g=yes
1690 else
1691   echo "$as_me: failed program was:" >&5
1692 cat conftest.$ac_ext >&5
1693 ac_cv_prog_cc_g=no
1694 fi
1695 rm -f conftest.$ac_objext conftest.$ac_ext
1696 fi
1697 echo "$as_me:1697: result: $ac_cv_prog_cc_g" >&5
1698 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1699 if test "$ac_test_CFLAGS" = set; then
1700   CFLAGS=$ac_save_CFLAGS
1701 elif test $ac_cv_prog_cc_g = yes; then
1702   if test "$GCC" = yes; then
1703     CFLAGS="-g -O2"
1704   else
1705     CFLAGS="-g"
1706   fi
1707 else
1708   if test "$GCC" = yes; then
1709     CFLAGS="-O2"
1710   else
1711     CFLAGS=
1712   fi
1713 fi
1714 # Some people use a C++ compiler to compile C.  Since we use `exit',
1715 # in C++ we need to declare it.  In case someone uses the same compiler
1716 # for both compiling C and C++ we need to have the C++ compiler decide
1717 # the declaration of exit, since it's the most demanding environment.
1718 cat >conftest.$ac_ext <<_ACEOF
1719 #ifndef __cplusplus
1720   choke me
1721 #endif
1722 _ACEOF
1723 rm -f conftest.$ac_objext
1724 if { (eval echo "$as_me:1724: \"$ac_compile\"") >&5
1725   (eval $ac_compile) 2>&5
1726   ac_status=$?
1727   echo "$as_me:1727: \$? = $ac_status" >&5
1728   (exit $ac_status); } &&
1729          { ac_try='test -s conftest.$ac_objext'
1730   { (eval echo "$as_me:1730: \"$ac_try\"") >&5
1731   (eval $ac_try) 2>&5
1732   ac_status=$?
1733   echo "$as_me:1733: \$? = $ac_status" >&5
1734   (exit $ac_status); }; }; then
1735   for ac_declaration in \
1736    ''\
1737    '#include <stdlib.h>' \
1738    'extern "C" void std::exit (int) throw (); using std::exit;' \
1739    'extern "C" void std::exit (int); using std::exit;' \
1740    'extern "C" void exit (int) throw ();' \
1741    'extern "C" void exit (int);' \
1742    'void exit (int);'
1743 do
1744   cat >conftest.$ac_ext <<_ACEOF
1745 #line 1745 "configure"
1746 #include "confdefs.h"
1747 #include <stdlib.h>
1748 $ac_declaration
1749 int
1750 main ()
1751 {
1752 exit (42);
1753   ;
1754   return 0;
1755 }
1756 _ACEOF
1757 rm -f conftest.$ac_objext
1758 if { (eval echo "$as_me:1758: \"$ac_compile\"") >&5
1759   (eval $ac_compile) 2>&5
1760   ac_status=$?
1761   echo "$as_me:1761: \$? = $ac_status" >&5
1762   (exit $ac_status); } &&
1763          { ac_try='test -s conftest.$ac_objext'
1764   { (eval echo "$as_me:1764: \"$ac_try\"") >&5
1765   (eval $ac_try) 2>&5
1766   ac_status=$?
1767   echo "$as_me:1767: \$? = $ac_status" >&5
1768   (exit $ac_status); }; }; then
1769   :
1770 else
1771   echo "$as_me: failed program was:" >&5
1772 cat conftest.$ac_ext >&5
1773 continue
1774 fi
1775 rm -f conftest.$ac_objext conftest.$ac_ext
1776   cat >conftest.$ac_ext <<_ACEOF
1777 #line 1777 "configure"
1778 #include "confdefs.h"
1779 $ac_declaration
1780 int
1781 main ()
1782 {
1783 exit (42);
1784   ;
1785   return 0;
1786 }
1787 _ACEOF
1788 rm -f conftest.$ac_objext
1789 if { (eval echo "$as_me:1789: \"$ac_compile\"") >&5
1790   (eval $ac_compile) 2>&5
1791   ac_status=$?
1792   echo "$as_me:1792: \$? = $ac_status" >&5
1793   (exit $ac_status); } &&
1794          { ac_try='test -s conftest.$ac_objext'
1795   { (eval echo "$as_me:1795: \"$ac_try\"") >&5
1796   (eval $ac_try) 2>&5
1797   ac_status=$?
1798   echo "$as_me:1798: \$? = $ac_status" >&5
1799   (exit $ac_status); }; }; then
1800   break
1801 else
1802   echo "$as_me: failed program was:" >&5
1803 cat conftest.$ac_ext >&5
1804 fi
1805 rm -f conftest.$ac_objext conftest.$ac_ext
1806 done
1807 rm -rf conftest*
1808 if test -n "$ac_declaration"; then
1809   echo '#ifdef __cplusplus' >>confdefs.h
1810   echo $ac_declaration      >>confdefs.h
1811   echo '#endif'             >>confdefs.h
1812 fi
1813
1814 else
1815   echo "$as_me: failed program was:" >&5
1816 cat conftest.$ac_ext >&5
1817 fi
1818 rm -f conftest.$ac_objext conftest.$ac_ext
1819 ac_ext=c
1820 ac_cpp='$CPP $CPPFLAGS'
1821 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1822 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1823 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1824 ac_main_return=return
1825
1826 ac_ext=c
1827 ac_cpp='$CPP $CPPFLAGS'
1828 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1829 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1830 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1831 ac_main_return=return
1832 echo "$as_me:1832: checking how to run the C preprocessor" >&5
1833 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1834 # On Suns, sometimes $CPP names a directory.
1835 if test -n "$CPP" && test -d "$CPP"; then
1836   CPP=
1837 fi
1838 if test -z "$CPP"; then
1839   if test "${ac_cv_prog_CPP+set}" = set; then
1840   echo $ECHO_N "(cached) $ECHO_C" >&6
1841 else
1842       # Double quotes because CPP needs to be expanded
1843     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1844     do
1845       ac_preproc_ok=false
1846 for ac_c_preproc_warn_flag in '' yes
1847 do
1848   # Use a header file that comes with gcc, so configuring glibc
1849   # with a fresh cross-compiler works.
1850   # On the NeXT, cc -E runs the code through the compiler's parser,
1851   # not just through cpp. "Syntax error" is here to catch this case.
1852   cat >conftest.$ac_ext <<_ACEOF
1853 #line 1853 "configure"
1854 #include "confdefs.h"
1855 #include <assert.h>
1856                      Syntax error
1857 _ACEOF
1858 if { (eval echo "$as_me:1858: \"$ac_cpp conftest.$ac_ext\"") >&5
1859   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1860   ac_status=$?
1861   egrep -v '^ *\+' conftest.er1 >conftest.err
1862   rm -f conftest.er1
1863   cat conftest.err >&5
1864   echo "$as_me:1864: \$? = $ac_status" >&5
1865   (exit $ac_status); } >/dev/null; then
1866   if test -s conftest.err; then
1867     ac_cpp_err=$ac_c_preproc_warn_flag
1868   else
1869     ac_cpp_err=
1870   fi
1871 else
1872   ac_cpp_err=yes
1873 fi
1874 if test -z "$ac_cpp_err"; then
1875   :
1876 else
1877   echo "$as_me: failed program was:" >&5
1878   cat conftest.$ac_ext >&5
1879   # Broken: fails on valid input.
1880 continue
1881 fi
1882 rm -f conftest.err conftest.$ac_ext
1883
1884   # OK, works on sane cases.  Now check whether non-existent headers
1885   # can be detected and how.
1886   cat >conftest.$ac_ext <<_ACEOF
1887 #line 1887 "configure"
1888 #include "confdefs.h"
1889 #include <ac_nonexistent.h>
1890 _ACEOF
1891 if { (eval echo "$as_me:1891: \"$ac_cpp conftest.$ac_ext\"") >&5
1892   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1893   ac_status=$?
1894   egrep -v '^ *\+' conftest.er1 >conftest.err
1895   rm -f conftest.er1
1896   cat conftest.err >&5
1897   echo "$as_me:1897: \$? = $ac_status" >&5
1898   (exit $ac_status); } >/dev/null; then
1899   if test -s conftest.err; then
1900     ac_cpp_err=$ac_c_preproc_warn_flag
1901   else
1902     ac_cpp_err=
1903   fi
1904 else
1905   ac_cpp_err=yes
1906 fi
1907 if test -z "$ac_cpp_err"; then
1908   # Broken: success on invalid input.
1909 continue
1910 else
1911   echo "$as_me: failed program was:" >&5
1912   cat conftest.$ac_ext >&5
1913   # Passes both tests.
1914 ac_preproc_ok=:
1915 break
1916 fi
1917 rm -f conftest.err conftest.$ac_ext
1918
1919 done
1920 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
1921 rm -f conftest.err conftest.$ac_ext
1922 if $ac_preproc_ok; then
1923   break
1924 fi
1925
1926     done
1927     ac_cv_prog_CPP=$CPP
1928
1929 fi
1930   CPP=$ac_cv_prog_CPP
1931 else
1932   ac_cv_prog_CPP=$CPP
1933 fi
1934 echo "$as_me:1934: result: $CPP" >&5
1935 echo "${ECHO_T}$CPP" >&6
1936 ac_preproc_ok=false
1937 for ac_c_preproc_warn_flag in '' yes
1938 do
1939   # Use a header file that comes with gcc, so configuring glibc
1940   # with a fresh cross-compiler works.
1941   # On the NeXT, cc -E runs the code through the compiler's parser,
1942   # not just through cpp. "Syntax error" is here to catch this case.
1943   cat >conftest.$ac_ext <<_ACEOF
1944 #line 1944 "configure"
1945 #include "confdefs.h"
1946 #include <assert.h>
1947                      Syntax error
1948 _ACEOF
1949 if { (eval echo "$as_me:1949: \"$ac_cpp conftest.$ac_ext\"") >&5
1950   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1951   ac_status=$?
1952   egrep -v '^ *\+' conftest.er1 >conftest.err
1953   rm -f conftest.er1
1954   cat conftest.err >&5
1955   echo "$as_me:1955: \$? = $ac_status" >&5
1956   (exit $ac_status); } >/dev/null; then
1957   if test -s conftest.err; then
1958     ac_cpp_err=$ac_c_preproc_warn_flag
1959   else
1960     ac_cpp_err=
1961   fi
1962 else
1963   ac_cpp_err=yes
1964 fi
1965 if test -z "$ac_cpp_err"; then
1966   :
1967 else
1968   echo "$as_me: failed program was:" >&5
1969   cat conftest.$ac_ext >&5
1970   # Broken: fails on valid input.
1971 continue
1972 fi
1973 rm -f conftest.err conftest.$ac_ext
1974
1975   # OK, works on sane cases.  Now check whether non-existent headers
1976   # can be detected and how.
1977   cat >conftest.$ac_ext <<_ACEOF
1978 #line 1978 "configure"
1979 #include "confdefs.h"
1980 #include <ac_nonexistent.h>
1981 _ACEOF
1982 if { (eval echo "$as_me:1982: \"$ac_cpp conftest.$ac_ext\"") >&5
1983   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1984   ac_status=$?
1985   egrep -v '^ *\+' conftest.er1 >conftest.err
1986   rm -f conftest.er1
1987   cat conftest.err >&5
1988   echo "$as_me:1988: \$? = $ac_status" >&5
1989   (exit $ac_status); } >/dev/null; then
1990   if test -s conftest.err; then
1991     ac_cpp_err=$ac_c_preproc_warn_flag
1992   else
1993     ac_cpp_err=
1994   fi
1995 else
1996   ac_cpp_err=yes
1997 fi
1998 if test -z "$ac_cpp_err"; then
1999   # Broken: success on invalid input.
2000 continue
2001 else
2002   echo "$as_me: failed program was:" >&5
2003   cat conftest.$ac_ext >&5
2004   # Passes both tests.
2005 ac_preproc_ok=:
2006 break
2007 fi
2008 rm -f conftest.err conftest.$ac_ext
2009
2010 done
2011 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2012 rm -f conftest.err conftest.$ac_ext
2013 if $ac_preproc_ok; then
2014   :
2015 else
2016   { { echo "$as_me:2016: error: C preprocessor \"$CPP\" fails sanity check" >&5
2017 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2018    { (exit 1); exit 1; }; }
2019 fi
2020
2021 ac_ext=c
2022 ac_cpp='$CPP $CPPFLAGS'
2023 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2024 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2025 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2026 ac_main_return=return
2027
2028 for ac_prog in mawk gawk nawk awk
2029 do
2030   # Extract the first word of "$ac_prog", so it can be a program name with args.
2031 set dummy $ac_prog; ac_word=$2
2032 echo "$as_me:2032: checking for $ac_word" >&5
2033 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2034 if test "${ac_cv_prog_AWK+set}" = set; then
2035   echo $ECHO_N "(cached) $ECHO_C" >&6
2036 else
2037   if test -n "$AWK"; then
2038   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2039 else
2040   ac_save_IFS=$IFS; IFS=$ac_path_separator
2041 ac_dummy="$PATH"
2042 for ac_dir in $ac_dummy; do
2043   IFS=$ac_save_IFS
2044   test -z "$ac_dir" && ac_dir=.
2045   $as_executable_p "$ac_dir/$ac_word" || continue
2046 ac_cv_prog_AWK="$ac_prog"
2047 echo "$as_me:2047: found $ac_dir/$ac_word" >&5
2048 break
2049 done
2050
2051 fi
2052 fi
2053 AWK=$ac_cv_prog_AWK
2054 if test -n "$AWK"; then
2055   echo "$as_me:2055: result: $AWK" >&5
2056 echo "${ECHO_T}$AWK" >&6
2057 else
2058   echo "$as_me:2058: result: no" >&5
2059 echo "${ECHO_T}no" >&6
2060 fi
2061
2062   test -n "$AWK" && break
2063 done
2064
2065 # Find a good install program.  We prefer a C program (faster),
2066 # so one script is as good as another.  But avoid the broken or
2067 # incompatible versions:
2068 # SysV /etc/install, /usr/sbin/install
2069 # SunOS /usr/etc/install
2070 # IRIX /sbin/install
2071 # AIX /bin/install
2072 # AmigaOS /C/install, which installs bootblocks on floppy discs
2073 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2074 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2075 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2076 # ./install, which can be erroneously created by make from ./install.sh.
2077 echo "$as_me:2077: checking for a BSD compatible install" >&5
2078 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2079 if test -z "$INSTALL"; then
2080 if test "${ac_cv_path_install+set}" = set; then
2081   echo $ECHO_N "(cached) $ECHO_C" >&6
2082 else
2083     ac_save_IFS=$IFS; IFS=$ac_path_separator
2084   for ac_dir in $PATH; do
2085     IFS=$ac_save_IFS
2086     # Account for people who put trailing slashes in PATH elements.
2087     case $ac_dir/ in
2088     / | ./ | .// | /cC/* \
2089     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2090     | /usr/ucb/* ) ;;
2091     *)
2092       # OSF1 and SCO ODT 3.0 have their own names for install.
2093       # Don't use installbsd from OSF since it installs stuff as root
2094       # by default.
2095       for ac_prog in ginstall scoinst install; do
2096         if $as_executable_p "$ac_dir/$ac_prog"; then
2097           if test $ac_prog = install &&
2098             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2099             # AIX install.  It has an incompatible calling convention.
2100             :
2101           elif test $ac_prog = install &&
2102             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2103             # program-specific install script used by HP pwplus--don't use.
2104             :
2105           else
2106             ac_cv_path_install="$ac_dir/$ac_prog -c"
2107             break 2
2108           fi
2109         fi
2110       done
2111       ;;
2112     esac
2113   done
2114
2115 fi
2116   if test "${ac_cv_path_install+set}" = set; then
2117     INSTALL=$ac_cv_path_install
2118   else
2119     # As a last resort, use the slow shell script.  We don't cache a
2120     # path for INSTALL within a source directory, because that will
2121     # break other packages using the cache if that directory is
2122     # removed, or if the path is relative.
2123     INSTALL=$ac_install_sh
2124   fi
2125 fi
2126 echo "$as_me:2126: result: $INSTALL" >&5
2127 echo "${ECHO_T}$INSTALL" >&6
2128
2129 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2130 # It thinks the first close brace ends the variable substitution.
2131 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2132
2133 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2134
2135 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2136
2137 case $INSTALL in
2138 /*)
2139   ;;
2140 *)
2141   cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2142   test -z "$cf_dir" && cf_dir=.
2143   INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2144   ;;
2145 esac
2146
2147 for ac_prog in tdlint lint alint splint lclint
2148 do
2149   # Extract the first word of "$ac_prog", so it can be a program name with args.
2150 set dummy $ac_prog; ac_word=$2
2151 echo "$as_me:2151: checking for $ac_word" >&5
2152 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2153 if test "${ac_cv_prog_LINT+set}" = set; then
2154   echo $ECHO_N "(cached) $ECHO_C" >&6
2155 else
2156   if test -n "$LINT"; then
2157   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2158 else
2159   ac_save_IFS=$IFS; IFS=$ac_path_separator
2160 ac_dummy="$PATH"
2161 for ac_dir in $ac_dummy; do
2162   IFS=$ac_save_IFS
2163   test -z "$ac_dir" && ac_dir=.
2164   $as_executable_p "$ac_dir/$ac_word" || continue
2165 ac_cv_prog_LINT="$ac_prog"
2166 echo "$as_me:2166: found $ac_dir/$ac_word" >&5
2167 break
2168 done
2169
2170 fi
2171 fi
2172 LINT=$ac_cv_prog_LINT
2173 if test -n "$LINT"; then
2174   echo "$as_me:2174: result: $LINT" >&5
2175 echo "${ECHO_T}$LINT" >&6
2176 else
2177   echo "$as_me:2177: result: no" >&5
2178 echo "${ECHO_T}no" >&6
2179 fi
2180
2181   test -n "$LINT" && break
2182 done
2183
2184 echo "$as_me:2184: checking if filesystem supports mixed-case filenames" >&5
2185 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2186 if test "${cf_cv_mixedcase+set}" = set; then
2187   echo $ECHO_N "(cached) $ECHO_C" >&6
2188 else
2189
2190 if test "$cross_compiling" = yes ; then
2191         case $target_alias in #(vi
2192         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
2193                 cf_cv_mixedcase=no
2194                 ;;
2195         *)
2196                 cf_cv_mixedcase=yes
2197                 ;;
2198         esac
2199 else
2200         rm -f conftest CONFTEST
2201         echo test >conftest
2202         if test -f CONFTEST ; then
2203                 cf_cv_mixedcase=no
2204         else
2205                 cf_cv_mixedcase=yes
2206         fi
2207         rm -f conftest CONFTEST
2208 fi
2209
2210 fi
2211 echo "$as_me:2211: result: $cf_cv_mixedcase" >&5
2212 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2213 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
2214 #define MIXEDCASE_FILENAMES 1
2215 EOF
2216
2217 for ac_prog in exctags ctags
2218 do
2219   # Extract the first word of "$ac_prog", so it can be a program name with args.
2220 set dummy $ac_prog; ac_word=$2
2221 echo "$as_me:2221: checking for $ac_word" >&5
2222 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2223 if test "${ac_cv_prog_CTAGS+set}" = set; then
2224   echo $ECHO_N "(cached) $ECHO_C" >&6
2225 else
2226   if test -n "$CTAGS"; then
2227   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2228 else
2229   ac_save_IFS=$IFS; IFS=$ac_path_separator
2230 ac_dummy="$PATH"
2231 for ac_dir in $ac_dummy; do
2232   IFS=$ac_save_IFS
2233   test -z "$ac_dir" && ac_dir=.
2234   $as_executable_p "$ac_dir/$ac_word" || continue
2235 ac_cv_prog_CTAGS="$ac_prog"
2236 echo "$as_me:2236: found $ac_dir/$ac_word" >&5
2237 break
2238 done
2239
2240 fi
2241 fi
2242 CTAGS=$ac_cv_prog_CTAGS
2243 if test -n "$CTAGS"; then
2244   echo "$as_me:2244: result: $CTAGS" >&5
2245 echo "${ECHO_T}$CTAGS" >&6
2246 else
2247   echo "$as_me:2247: result: no" >&5
2248 echo "${ECHO_T}no" >&6
2249 fi
2250
2251   test -n "$CTAGS" && break
2252 done
2253
2254 for ac_prog in exetags etags
2255 do
2256   # Extract the first word of "$ac_prog", so it can be a program name with args.
2257 set dummy $ac_prog; ac_word=$2
2258 echo "$as_me:2258: checking for $ac_word" >&5
2259 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2260 if test "${ac_cv_prog_ETAGS+set}" = set; then
2261   echo $ECHO_N "(cached) $ECHO_C" >&6
2262 else
2263   if test -n "$ETAGS"; then
2264   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2265 else
2266   ac_save_IFS=$IFS; IFS=$ac_path_separator
2267 ac_dummy="$PATH"
2268 for ac_dir in $ac_dummy; do
2269   IFS=$ac_save_IFS
2270   test -z "$ac_dir" && ac_dir=.
2271   $as_executable_p "$ac_dir/$ac_word" || continue
2272 ac_cv_prog_ETAGS="$ac_prog"
2273 echo "$as_me:2273: found $ac_dir/$ac_word" >&5
2274 break
2275 done
2276
2277 fi
2278 fi
2279 ETAGS=$ac_cv_prog_ETAGS
2280 if test -n "$ETAGS"; then
2281   echo "$as_me:2281: result: $ETAGS" >&5
2282 echo "${ECHO_T}$ETAGS" >&6
2283 else
2284   echo "$as_me:2284: result: no" >&5
2285 echo "${ECHO_T}no" >&6
2286 fi
2287
2288   test -n "$ETAGS" && break
2289 done
2290
2291 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2292 set dummy ${CTAGS:-ctags}; ac_word=$2
2293 echo "$as_me:2293: checking for $ac_word" >&5
2294 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2295 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2296   echo $ECHO_N "(cached) $ECHO_C" >&6
2297 else
2298   if test -n "$MAKE_LOWER_TAGS"; then
2299   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2300 else
2301   ac_save_IFS=$IFS; IFS=$ac_path_separator
2302 ac_dummy="$PATH"
2303 for ac_dir in $ac_dummy; do
2304   IFS=$ac_save_IFS
2305   test -z "$ac_dir" && ac_dir=.
2306   $as_executable_p "$ac_dir/$ac_word" || continue
2307 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2308 echo "$as_me:2308: found $ac_dir/$ac_word" >&5
2309 break
2310 done
2311
2312   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2313 fi
2314 fi
2315 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2316 if test -n "$MAKE_LOWER_TAGS"; then
2317   echo "$as_me:2317: result: $MAKE_LOWER_TAGS" >&5
2318 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2319 else
2320   echo "$as_me:2320: result: no" >&5
2321 echo "${ECHO_T}no" >&6
2322 fi
2323
2324 if test "$cf_cv_mixedcase" = yes ; then
2325         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2326 set dummy ${ETAGS:-etags}; ac_word=$2
2327 echo "$as_me:2327: checking for $ac_word" >&5
2328 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2329 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2330   echo $ECHO_N "(cached) $ECHO_C" >&6
2331 else
2332   if test -n "$MAKE_UPPER_TAGS"; then
2333   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2334 else
2335   ac_save_IFS=$IFS; IFS=$ac_path_separator
2336 ac_dummy="$PATH"
2337 for ac_dir in $ac_dummy; do
2338   IFS=$ac_save_IFS
2339   test -z "$ac_dir" && ac_dir=.
2340   $as_executable_p "$ac_dir/$ac_word" || continue
2341 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2342 echo "$as_me:2342: found $ac_dir/$ac_word" >&5
2343 break
2344 done
2345
2346   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2347 fi
2348 fi
2349 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2350 if test -n "$MAKE_UPPER_TAGS"; then
2351   echo "$as_me:2351: result: $MAKE_UPPER_TAGS" >&5
2352 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2353 else
2354   echo "$as_me:2354: result: no" >&5
2355 echo "${ECHO_T}no" >&6
2356 fi
2357
2358 else
2359         MAKE_UPPER_TAGS=no
2360 fi
2361
2362 if test "$MAKE_UPPER_TAGS" = yes ; then
2363         MAKE_UPPER_TAGS=
2364 else
2365         MAKE_UPPER_TAGS="#"
2366 fi
2367
2368 if test "$MAKE_LOWER_TAGS" = yes ; then
2369         MAKE_LOWER_TAGS=
2370 else
2371         MAKE_LOWER_TAGS="#"
2372 fi
2373
2374 echo "$as_me:2374: checking if -lm needed for math functions" >&5
2375 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2376 if test "${cf_cv_need_libm+set}" = set; then
2377   echo $ECHO_N "(cached) $ECHO_C" >&6
2378 else
2379
2380         cat >conftest.$ac_ext <<_ACEOF
2381 #line 2381 "configure"
2382 #include "confdefs.h"
2383
2384         #include <stdio.h>
2385         #include <math.h>
2386
2387 int
2388 main ()
2389 {
2390 double x = rand(); printf("result = %g\n", sin(x))
2391   ;
2392   return 0;
2393 }
2394 _ACEOF
2395 rm -f conftest.$ac_objext conftest$ac_exeext
2396 if { (eval echo "$as_me:2396: \"$ac_link\"") >&5
2397   (eval $ac_link) 2>&5
2398   ac_status=$?
2399   echo "$as_me:2399: \$? = $ac_status" >&5
2400   (exit $ac_status); } &&
2401          { ac_try='test -s conftest$ac_exeext'
2402   { (eval echo "$as_me:2402: \"$ac_try\"") >&5
2403   (eval $ac_try) 2>&5
2404   ac_status=$?
2405   echo "$as_me:2405: \$? = $ac_status" >&5
2406   (exit $ac_status); }; }; then
2407   cf_cv_need_libm=no
2408 else
2409   echo "$as_me: failed program was:" >&5
2410 cat conftest.$ac_ext >&5
2411 cf_cv_need_libm=yes
2412 fi
2413 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2414 fi
2415 echo "$as_me:2415: result: $cf_cv_need_libm" >&5
2416 echo "${ECHO_T}$cf_cv_need_libm" >&6
2417 if test "$cf_cv_need_libm" = yes
2418 then
2419 MATH_LIB=-lm
2420 fi
2421
2422 top_builddir=`pwd`
2423
2424 CC_G_OPT="-g"
2425 CC_SHARED_OPTS=unknown
2426 CPPFLAGS="$CPPFLAGS"
2427 DFT_DEP_SUFFIX=""
2428 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2429 DFT_UPR_MODEL="NORMAL"
2430 LD="ld"
2431 LDFLAGS_SHARED=""
2432 LDFLAGS_STATIC=""
2433 LD_MODEL=""
2434 LD_SHARED_OPTS=""
2435 LIBTOOL=""
2436 LIB_CLEAN=""
2437 LIB_COMPILE=""
2438 LIB_LINK='${CC}'
2439 LINK_TESTS=""
2440 LOCAL_LDFLAGS=""
2441 PTHREAD="-lm"
2442 TEST_ARGS=""
2443 TEST_DEPS=""
2444 TEST_LIBS=""
2445 TINFO_LDFLAGS=''
2446 TINFO_LIBS='$(LIBS_CURSES)'
2447 cf_cv_abi_version=""
2448 cf_cv_rel_version=""
2449
2450 cf_cv_screen=curses
2451 cf_cv_libtype=
2452
2453 # This should have been defined by AC_PROG_CC
2454 : ${CC:=cc}
2455
2456 # Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
2457 # into CC.  This will not help with broken scripts that wrap the compiler with
2458 # options, but eliminates a more common category of user confusion.
2459 echo "$as_me:2459: checking \$CC variable" >&5
2460 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2461 case "$CC" in #(vi
2462 *[\ \   ]-[IUD]*)
2463         echo "$as_me:2463: result: broken" >&5
2464 echo "${ECHO_T}broken" >&6
2465         { echo "$as_me:2465: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2466 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2467         # humor him...
2468         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
2469         CC=`echo "$CC" | sed -e 's/[    ].*//'`
2470
2471 cf_fix_cppflags=no
2472 cf_new_cflags=
2473 cf_new_cppflags=
2474 cf_new_extra_cppflags=
2475
2476 for cf_add_cflags in $cf_flags
2477 do
2478 case $cf_fix_cppflags in
2479 no)
2480         case $cf_add_cflags in #(vi
2481         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2482                 case $cf_add_cflags in
2483                 -D*)
2484                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2485
2486                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2487                                 && test -z "${cf_tst_cflags}" \
2488                                 && cf_fix_cppflags=yes
2489
2490                         if test $cf_fix_cppflags = yes ; then
2491                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2492                                 continue
2493                         elif test "${cf_tst_cflags}" = "\"'" ; then
2494                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2495                                 continue
2496                         fi
2497                         ;;
2498                 esac
2499                 case "$CPPFLAGS" in
2500                 *$cf_add_cflags) #(vi
2501                         ;;
2502                 *) #(vi
2503                         case $cf_add_cflags in #(vi
2504                         -D*)
2505                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2506
2507 CPPFLAGS=`echo "$CPPFLAGS" | \
2508         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2509                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2510
2511                                 ;;
2512                         esac
2513                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2514                         ;;
2515                 esac
2516                 ;;
2517         *)
2518                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2519                 ;;
2520         esac
2521         ;;
2522 yes)
2523         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2524
2525         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2526
2527         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2528                 && test -z "${cf_tst_cflags}" \
2529                 && cf_fix_cppflags=no
2530         ;;
2531 esac
2532 done
2533
2534 if test -n "$cf_new_cflags" ; then
2535
2536         CFLAGS="$CFLAGS $cf_new_cflags"
2537 fi
2538
2539 if test -n "$cf_new_cppflags" ; then
2540
2541         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2542 fi
2543
2544 if test -n "$cf_new_extra_cppflags" ; then
2545
2546         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2547 fi
2548
2549         ;;
2550 *)
2551         echo "$as_me:2551: result: ok" >&5
2552 echo "${ECHO_T}ok" >&6
2553         ;;
2554 esac
2555
2556 echo "$as_me:2556: checking for ${CC:-cc} option to accept ANSI C" >&5
2557 echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6
2558 if test "${cf_cv_ansi_cc+set}" = set; then
2559   echo $ECHO_N "(cached) $ECHO_C" >&6
2560 else
2561
2562 cf_cv_ansi_cc=no
2563 cf_save_CFLAGS="$CFLAGS"
2564 cf_save_CPPFLAGS="$CPPFLAGS"
2565 # Don't try gcc -ansi; that turns off useful extensions and
2566 # breaks some systems' header files.
2567 # AIX                   -qlanglvl=ansi
2568 # Ultrix and OSF/1      -std1
2569 # HP-UX                 -Aa -D_HPUX_SOURCE
2570 # SVR4                  -Xc
2571 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
2572 for cf_arg in "-DCC_HAS_PROTOS" \
2573         "" \
2574         -qlanglvl=ansi \
2575         -std1 \
2576         -Ae \
2577         "-Aa -D_HPUX_SOURCE" \
2578         -Xc
2579 do
2580
2581 cf_fix_cppflags=no
2582 cf_new_cflags=
2583 cf_new_cppflags=
2584 cf_new_extra_cppflags=
2585
2586 for cf_add_cflags in $cf_arg
2587 do
2588 case $cf_fix_cppflags in
2589 no)
2590         case $cf_add_cflags in #(vi
2591         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2592                 case $cf_add_cflags in
2593                 -D*)
2594                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2595
2596                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2597                                 && test -z "${cf_tst_cflags}" \
2598                                 && cf_fix_cppflags=yes
2599
2600                         if test $cf_fix_cppflags = yes ; then
2601                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2602                                 continue
2603                         elif test "${cf_tst_cflags}" = "\"'" ; then
2604                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2605                                 continue
2606                         fi
2607                         ;;
2608                 esac
2609                 case "$CPPFLAGS" in
2610                 *$cf_add_cflags) #(vi
2611                         ;;
2612                 *) #(vi
2613                         case $cf_add_cflags in #(vi
2614                         -D*)
2615                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2616
2617 CPPFLAGS=`echo "$CPPFLAGS" | \
2618         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2619                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2620
2621                                 ;;
2622                         esac
2623                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2624                         ;;
2625                 esac
2626                 ;;
2627         *)
2628                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2629                 ;;
2630         esac
2631         ;;
2632 yes)
2633         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2634
2635         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2636
2637         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2638                 && test -z "${cf_tst_cflags}" \
2639                 && cf_fix_cppflags=no
2640         ;;
2641 esac
2642 done
2643
2644 if test -n "$cf_new_cflags" ; then
2645
2646         CFLAGS="$CFLAGS $cf_new_cflags"
2647 fi
2648
2649 if test -n "$cf_new_cppflags" ; then
2650
2651         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2652 fi
2653
2654 if test -n "$cf_new_extra_cppflags" ; then
2655
2656         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2657 fi
2658
2659         cat >conftest.$ac_ext <<_ACEOF
2660 #line 2660 "configure"
2661 #include "confdefs.h"
2662
2663 #ifndef CC_HAS_PROTOS
2664 #if !defined(__STDC__) || (__STDC__ != 1)
2665 choke me
2666 #endif
2667 #endif
2668
2669 int
2670 main ()
2671 {
2672
2673         int test (int i, double x);
2674         struct s1 {int (*f) (int a);};
2675         struct s2 {int (*f) (double a);};
2676   ;
2677   return 0;
2678 }
2679 _ACEOF
2680 rm -f conftest.$ac_objext
2681 if { (eval echo "$as_me:2681: \"$ac_compile\"") >&5
2682   (eval $ac_compile) 2>&5
2683   ac_status=$?
2684   echo "$as_me:2684: \$? = $ac_status" >&5
2685   (exit $ac_status); } &&
2686          { ac_try='test -s conftest.$ac_objext'
2687   { (eval echo "$as_me:2687: \"$ac_try\"") >&5
2688   (eval $ac_try) 2>&5
2689   ac_status=$?
2690   echo "$as_me:2690: \$? = $ac_status" >&5
2691   (exit $ac_status); }; }; then
2692   cf_cv_ansi_cc="$cf_arg"; break
2693 else
2694   echo "$as_me: failed program was:" >&5
2695 cat conftest.$ac_ext >&5
2696 fi
2697 rm -f conftest.$ac_objext conftest.$ac_ext
2698 done
2699 CFLAGS="$cf_save_CFLAGS"
2700 CPPFLAGS="$cf_save_CPPFLAGS"
2701
2702 fi
2703 echo "$as_me:2703: result: $cf_cv_ansi_cc" >&5
2704 echo "${ECHO_T}$cf_cv_ansi_cc" >&6
2705
2706 if test "$cf_cv_ansi_cc" != "no"; then
2707 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
2708
2709 cf_fix_cppflags=no
2710 cf_new_cflags=
2711 cf_new_cppflags=
2712 cf_new_extra_cppflags=
2713
2714 for cf_add_cflags in $cf_cv_ansi_cc
2715 do
2716 case $cf_fix_cppflags in
2717 no)
2718         case $cf_add_cflags in #(vi
2719         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2720                 case $cf_add_cflags in
2721                 -D*)
2722                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2723
2724                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2725                                 && test -z "${cf_tst_cflags}" \
2726                                 && cf_fix_cppflags=yes
2727
2728                         if test $cf_fix_cppflags = yes ; then
2729                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2730                                 continue
2731                         elif test "${cf_tst_cflags}" = "\"'" ; then
2732                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2733                                 continue
2734                         fi
2735                         ;;
2736                 esac
2737                 case "$CPPFLAGS" in
2738                 *$cf_add_cflags) #(vi
2739                         ;;
2740                 *) #(vi
2741                         case $cf_add_cflags in #(vi
2742                         -D*)
2743                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2744
2745 CPPFLAGS=`echo "$CPPFLAGS" | \
2746         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2747                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2748
2749                                 ;;
2750                         esac
2751                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2752                         ;;
2753                 esac
2754                 ;;
2755         *)
2756                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2757                 ;;
2758         esac
2759         ;;
2760 yes)
2761         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2762
2763         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2764
2765         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2766                 && test -z "${cf_tst_cflags}" \
2767                 && cf_fix_cppflags=no
2768         ;;
2769 esac
2770 done
2771
2772 if test -n "$cf_new_cflags" ; then
2773
2774         CFLAGS="$CFLAGS $cf_new_cflags"
2775 fi
2776
2777 if test -n "$cf_new_cppflags" ; then
2778
2779         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2780 fi
2781
2782 if test -n "$cf_new_extra_cppflags" ; then
2783
2784         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2785 fi
2786
2787 else
2788         cat >>confdefs.h <<\EOF
2789 #define CC_HAS_PROTOS 1
2790 EOF
2791
2792 fi
2793 fi
2794
2795 if test "$cf_cv_ansi_cc" = "no"; then
2796         { { echo "$as_me:2796: error: Your compiler does not appear to recognize prototypes.
2797 You have the following choices:
2798         a. adjust your compiler options
2799         b. get an up-to-date compiler
2800         c. use a wrapper such as unproto" >&5
2801 echo "$as_me: error: Your compiler does not appear to recognize prototypes.
2802 You have the following choices:
2803         a. adjust your compiler options
2804         b. get an up-to-date compiler
2805         c. use a wrapper such as unproto" >&2;}
2806    { (exit 1); exit 1; }; }
2807 fi
2808
2809 if test "$GCC" = yes
2810 then
2811 cat > conftest.i <<EOF
2812 #ifndef GCC_PRINTF
2813 #define GCC_PRINTF 0
2814 #endif
2815 #ifndef GCC_SCANF
2816 #define GCC_SCANF 0
2817 #endif
2818 #ifndef GCC_NORETURN
2819 #define GCC_NORETURN /* nothing */
2820 #endif
2821 #ifndef GCC_UNUSED
2822 #define GCC_UNUSED /* nothing */
2823 #endif
2824 EOF
2825 if test "$GCC" = yes
2826 then
2827         { echo "$as_me:2827: checking for $CC __attribute__ directives..." >&5
2828 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2829 cat > conftest.$ac_ext <<EOF
2830 #line 2830 "${as_me:-configure}"
2831 #include "confdefs.h"
2832 #include "conftest.h"
2833 #include "conftest.i"
2834 #if     GCC_PRINTF
2835 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2836 #else
2837 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2838 #endif
2839 #if     GCC_SCANF
2840 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2841 #else
2842 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2843 #endif
2844 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2845 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2846 extern void foo(void) GCC_NORETURN;
2847 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2848 EOF
2849         cf_printf_attribute=no
2850         cf_scanf_attribute=no
2851         for cf_attribute in scanf printf unused noreturn
2852         do
2853
2854 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2855
2856                 cf_directive="__attribute__(($cf_attribute))"
2857                 echo "checking for $CC $cf_directive" 1>&5
2858
2859                 case $cf_attribute in #(vi
2860                 printf) #(vi
2861                         cf_printf_attribute=yes
2862                         cat >conftest.h <<EOF
2863 #define GCC_$cf_ATTRIBUTE 1
2864 EOF
2865                         ;;
2866                 scanf) #(vi
2867                         cf_scanf_attribute=yes
2868                         cat >conftest.h <<EOF
2869 #define GCC_$cf_ATTRIBUTE 1
2870 EOF
2871                         ;;
2872                 *) #(vi
2873                         cat >conftest.h <<EOF
2874 #define GCC_$cf_ATTRIBUTE $cf_directive
2875 EOF
2876                         ;;
2877                 esac
2878
2879                 if { (eval echo "$as_me:2879: \"$ac_compile\"") >&5
2880   (eval $ac_compile) 2>&5
2881   ac_status=$?
2882   echo "$as_me:2882: \$? = $ac_status" >&5
2883   (exit $ac_status); }; then
2884                         test -n "$verbose" && echo "$as_me:2884: result: ... $cf_attribute" >&5
2885 echo "${ECHO_T}... $cf_attribute" >&6
2886                         cat conftest.h >>confdefs.h
2887                         case $cf_attribute in #(vi
2888                         printf) #(vi
2889                                 if test "$cf_printf_attribute" = no ; then
2890                                         cat >>confdefs.h <<EOF
2891 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
2892 EOF
2893                                 else
2894                                         cat >>confdefs.h <<EOF
2895 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2896 EOF
2897                                 fi
2898                                 ;;
2899                         scanf) #(vi
2900                                 if test "$cf_scanf_attribute" = no ; then
2901                                         cat >>confdefs.h <<EOF
2902 #define GCC_SCANFLIKE(fmt,var) /* nothing */
2903 EOF
2904                                 else
2905                                         cat >>confdefs.h <<EOF
2906 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2907 EOF
2908                                 fi
2909                                 ;;
2910                         esac
2911                 fi
2912         done
2913 else
2914         fgrep define conftest.i >>confdefs.h
2915 fi
2916 rm -rf conftest*
2917 fi
2918
2919 cf_XOPEN_SOURCE=500
2920 cf_POSIX_C_SOURCE=199506L
2921 cf_xopen_source=
2922
2923 case $host_os in #(vi
2924 aix[4-7]*) #(vi
2925         cf_xopen_source="-D_ALL_SOURCE"
2926         ;;
2927 cygwin) #(vi
2928         cf_XOPEN_SOURCE=600
2929         ;;
2930 darwin[0-8].*) #(vi
2931         cf_xopen_source="-D_APPLE_C_SOURCE"
2932         ;;
2933 darwin*) #(vi
2934         cf_xopen_source="-D_DARWIN_C_SOURCE"
2935         cf_XOPEN_SOURCE=
2936         ;;
2937 freebsd*|dragonfly*) #(vi
2938         # 5.x headers associate
2939         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2940         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2941         cf_POSIX_C_SOURCE=200112L
2942         cf_XOPEN_SOURCE=600
2943         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2944         ;;
2945 hpux11*) #(vi
2946         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2947         ;;
2948 hpux*) #(vi
2949         cf_xopen_source="-D_HPUX_SOURCE"
2950         ;;
2951 irix[56].*) #(vi
2952         cf_xopen_source="-D_SGI_SOURCE"
2953         cf_XOPEN_SOURCE=
2954         ;;
2955 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
2956
2957 echo "$as_me:2957: checking if we must define _GNU_SOURCE" >&5
2958 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2959 if test "${cf_cv_gnu_source+set}" = set; then
2960   echo $ECHO_N "(cached) $ECHO_C" >&6
2961 else
2962
2963 cat >conftest.$ac_ext <<_ACEOF
2964 #line 2964 "configure"
2965 #include "confdefs.h"
2966 #include <sys/types.h>
2967 int
2968 main ()
2969 {
2970
2971 #ifndef _XOPEN_SOURCE
2972 make an error
2973 #endif
2974   ;
2975   return 0;
2976 }
2977 _ACEOF
2978 rm -f conftest.$ac_objext
2979 if { (eval echo "$as_me:2979: \"$ac_compile\"") >&5
2980   (eval $ac_compile) 2>&5
2981   ac_status=$?
2982   echo "$as_me:2982: \$? = $ac_status" >&5
2983   (exit $ac_status); } &&
2984          { ac_try='test -s conftest.$ac_objext'
2985   { (eval echo "$as_me:2985: \"$ac_try\"") >&5
2986   (eval $ac_try) 2>&5
2987   ac_status=$?
2988   echo "$as_me:2988: \$? = $ac_status" >&5
2989   (exit $ac_status); }; }; then
2990   cf_cv_gnu_source=no
2991 else
2992   echo "$as_me: failed program was:" >&5
2993 cat conftest.$ac_ext >&5
2994 cf_save="$CPPFLAGS"
2995          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2996          cat >conftest.$ac_ext <<_ACEOF
2997 #line 2997 "configure"
2998 #include "confdefs.h"
2999 #include <sys/types.h>
3000 int
3001 main ()
3002 {
3003
3004 #ifdef _XOPEN_SOURCE
3005 make an error
3006 #endif
3007   ;
3008   return 0;
3009 }
3010 _ACEOF
3011 rm -f conftest.$ac_objext
3012 if { (eval echo "$as_me:3012: \"$ac_compile\"") >&5
3013   (eval $ac_compile) 2>&5
3014   ac_status=$?
3015   echo "$as_me:3015: \$? = $ac_status" >&5
3016   (exit $ac_status); } &&
3017          { ac_try='test -s conftest.$ac_objext'
3018   { (eval echo "$as_me:3018: \"$ac_try\"") >&5
3019   (eval $ac_try) 2>&5
3020   ac_status=$?
3021   echo "$as_me:3021: \$? = $ac_status" >&5
3022   (exit $ac_status); }; }; then
3023   cf_cv_gnu_source=no
3024 else
3025   echo "$as_me: failed program was:" >&5
3026 cat conftest.$ac_ext >&5
3027 cf_cv_gnu_source=yes
3028 fi
3029 rm -f conftest.$ac_objext conftest.$ac_ext
3030         CPPFLAGS="$cf_save"
3031
3032 fi
3033 rm -f conftest.$ac_objext conftest.$ac_ext
3034
3035 fi
3036 echo "$as_me:3036: result: $cf_cv_gnu_source" >&5
3037 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3038 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3039
3040         ;;
3041 mirbsd*) #(vi
3042         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3043         cf_XOPEN_SOURCE=
3044
3045 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3046
3047 cf_save_CFLAGS="$CFLAGS"
3048 cf_save_CPPFLAGS="$CPPFLAGS"
3049
3050 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3051         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3052                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3053
3054 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3055         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3056                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3057
3058 echo "$as_me:3058: checking if we should define _POSIX_C_SOURCE" >&5
3059 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3060 if test "${cf_cv_posix_c_source+set}" = set; then
3061   echo $ECHO_N "(cached) $ECHO_C" >&6
3062 else
3063
3064 echo "${as_me:-configure}:3064: testing if the symbol is already defined go no further ..." 1>&5
3065
3066         cat >conftest.$ac_ext <<_ACEOF
3067 #line 3067 "configure"
3068 #include "confdefs.h"
3069 #include <sys/types.h>
3070 int
3071 main ()
3072 {
3073
3074 #ifndef _POSIX_C_SOURCE
3075 make an error
3076 #endif
3077   ;
3078   return 0;
3079 }
3080 _ACEOF
3081 rm -f conftest.$ac_objext
3082 if { (eval echo "$as_me:3082: \"$ac_compile\"") >&5
3083   (eval $ac_compile) 2>&5
3084   ac_status=$?
3085   echo "$as_me:3085: \$? = $ac_status" >&5
3086   (exit $ac_status); } &&
3087          { ac_try='test -s conftest.$ac_objext'
3088   { (eval echo "$as_me:3088: \"$ac_try\"") >&5
3089   (eval $ac_try) 2>&5
3090   ac_status=$?
3091   echo "$as_me:3091: \$? = $ac_status" >&5
3092   (exit $ac_status); }; }; then
3093   cf_cv_posix_c_source=no
3094 else
3095   echo "$as_me: failed program was:" >&5
3096 cat conftest.$ac_ext >&5
3097 cf_want_posix_source=no
3098          case .$cf_POSIX_C_SOURCE in #(vi
3099          .[12]??*) #(vi
3100                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3101                 ;;
3102          .2) #(vi
3103                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3104                 cf_want_posix_source=yes
3105                 ;;
3106          .*)
3107                 cf_want_posix_source=yes
3108                 ;;
3109          esac
3110          if test "$cf_want_posix_source" = yes ; then
3111                 cat >conftest.$ac_ext <<_ACEOF
3112 #line 3112 "configure"
3113 #include "confdefs.h"
3114 #include <sys/types.h>
3115 int
3116 main ()
3117 {
3118
3119 #ifdef _POSIX_SOURCE
3120 make an error
3121 #endif
3122   ;
3123   return 0;
3124 }
3125 _ACEOF
3126 rm -f conftest.$ac_objext
3127 if { (eval echo "$as_me:3127: \"$ac_compile\"") >&5
3128   (eval $ac_compile) 2>&5
3129   ac_status=$?
3130   echo "$as_me:3130: \$? = $ac_status" >&5
3131   (exit $ac_status); } &&
3132          { ac_try='test -s conftest.$ac_objext'
3133   { (eval echo "$as_me:3133: \"$ac_try\"") >&5
3134   (eval $ac_try) 2>&5
3135   ac_status=$?
3136   echo "$as_me:3136: \$? = $ac_status" >&5
3137   (exit $ac_status); }; }; then
3138   :
3139 else
3140   echo "$as_me: failed program was:" >&5
3141 cat conftest.$ac_ext >&5
3142 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3143 fi
3144 rm -f conftest.$ac_objext conftest.$ac_ext
3145          fi
3146
3147 echo "${as_me:-configure}:3147: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3148
3149          CFLAGS="$cf_trim_CFLAGS"
3150          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3151
3152 echo "${as_me:-configure}:3152: testing if the second compile does not leave our definition intact error ..." 1>&5
3153
3154          cat >conftest.$ac_ext <<_ACEOF
3155 #line 3155 "configure"
3156 #include "confdefs.h"
3157 #include <sys/types.h>
3158 int
3159 main ()
3160 {
3161
3162 #ifndef _POSIX_C_SOURCE
3163 make an error
3164 #endif
3165   ;
3166   return 0;
3167 }
3168 _ACEOF
3169 rm -f conftest.$ac_objext
3170 if { (eval echo "$as_me:3170: \"$ac_compile\"") >&5
3171   (eval $ac_compile) 2>&5
3172   ac_status=$?
3173   echo "$as_me:3173: \$? = $ac_status" >&5
3174   (exit $ac_status); } &&
3175          { ac_try='test -s conftest.$ac_objext'
3176   { (eval echo "$as_me:3176: \"$ac_try\"") >&5
3177   (eval $ac_try) 2>&5
3178   ac_status=$?
3179   echo "$as_me:3179: \$? = $ac_status" >&5
3180   (exit $ac_status); }; }; then
3181   :
3182 else
3183   echo "$as_me: failed program was:" >&5
3184 cat conftest.$ac_ext >&5
3185 cf_cv_posix_c_source=no
3186 fi
3187 rm -f conftest.$ac_objext conftest.$ac_ext
3188          CFLAGS="$cf_save_CFLAGS"
3189          CPPFLAGS="$cf_save_CPPFLAGS"
3190
3191 fi
3192 rm -f conftest.$ac_objext conftest.$ac_ext
3193
3194 fi
3195 echo "$as_me:3195: result: $cf_cv_posix_c_source" >&5
3196 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3197
3198 if test "$cf_cv_posix_c_source" != no ; then
3199         CFLAGS="$cf_trim_CFLAGS"
3200         CPPFLAGS="$cf_trim_CPPFLAGS"
3201
3202 cf_fix_cppflags=no
3203 cf_new_cflags=
3204 cf_new_cppflags=
3205 cf_new_extra_cppflags=
3206
3207 for cf_add_cflags in $cf_cv_posix_c_source
3208 do
3209 case $cf_fix_cppflags in
3210 no)
3211         case $cf_add_cflags in #(vi
3212         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3213                 case $cf_add_cflags in
3214                 -D*)
3215                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3216
3217                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3218                                 && test -z "${cf_tst_cflags}" \
3219                                 && cf_fix_cppflags=yes
3220
3221                         if test $cf_fix_cppflags = yes ; then
3222                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3223                                 continue
3224                         elif test "${cf_tst_cflags}" = "\"'" ; then
3225                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3226                                 continue
3227                         fi
3228                         ;;
3229                 esac
3230                 case "$CPPFLAGS" in
3231                 *$cf_add_cflags) #(vi
3232                         ;;
3233                 *) #(vi
3234                         case $cf_add_cflags in #(vi
3235                         -D*)
3236                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3237
3238 CPPFLAGS=`echo "$CPPFLAGS" | \
3239         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3240                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3241
3242                                 ;;
3243                         esac
3244                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3245                         ;;
3246                 esac
3247                 ;;
3248         *)
3249                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3250                 ;;
3251         esac
3252         ;;
3253 yes)
3254         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3255
3256         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3257
3258         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3259                 && test -z "${cf_tst_cflags}" \
3260                 && cf_fix_cppflags=no
3261         ;;
3262 esac
3263 done
3264
3265 if test -n "$cf_new_cflags" ; then
3266
3267         CFLAGS="$CFLAGS $cf_new_cflags"
3268 fi
3269
3270 if test -n "$cf_new_cppflags" ; then
3271
3272         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3273 fi
3274
3275 if test -n "$cf_new_extra_cppflags" ; then
3276
3277         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3278 fi
3279
3280 fi
3281
3282         ;;
3283 netbsd*) #(vi
3284         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3285         ;;
3286 openbsd[4-9]*) #(vi
3287         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3288         cf_xopen_source="-D_BSD_SOURCE"
3289         cf_XOPEN_SOURCE=600
3290         ;;
3291 openbsd*) #(vi
3292         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3293         ;;
3294 osf[45]*) #(vi
3295         cf_xopen_source="-D_OSF_SOURCE"
3296         ;;
3297 nto-qnx*) #(vi
3298         cf_xopen_source="-D_QNX_SOURCE"
3299         ;;
3300 sco*) #(vi
3301         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3302         ;;
3303 solaris2.*) #(vi
3304         cf_xopen_source="-D__EXTENSIONS__"
3305         ;;
3306 *)
3307
3308 echo "$as_me:3308: checking if we should define _XOPEN_SOURCE" >&5
3309 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3310 if test "${cf_cv_xopen_source+set}" = set; then
3311   echo $ECHO_N "(cached) $ECHO_C" >&6
3312 else
3313
3314         cat >conftest.$ac_ext <<_ACEOF
3315 #line 3315 "configure"
3316 #include "confdefs.h"
3317
3318 #include <stdlib.h>
3319 #include <string.h>
3320 #include <sys/types.h>
3321
3322 int
3323 main ()
3324 {
3325
3326 #ifndef _XOPEN_SOURCE
3327 make an error
3328 #endif
3329   ;
3330   return 0;
3331 }
3332 _ACEOF
3333 rm -f conftest.$ac_objext
3334 if { (eval echo "$as_me:3334: \"$ac_compile\"") >&5
3335   (eval $ac_compile) 2>&5
3336   ac_status=$?
3337   echo "$as_me:3337: \$? = $ac_status" >&5
3338   (exit $ac_status); } &&
3339          { ac_try='test -s conftest.$ac_objext'
3340   { (eval echo "$as_me:3340: \"$ac_try\"") >&5
3341   (eval $ac_try) 2>&5
3342   ac_status=$?
3343   echo "$as_me:3343: \$? = $ac_status" >&5
3344   (exit $ac_status); }; }; then
3345   cf_cv_xopen_source=no
3346 else
3347   echo "$as_me: failed program was:" >&5
3348 cat conftest.$ac_ext >&5
3349 cf_save="$CPPFLAGS"
3350          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3351          cat >conftest.$ac_ext <<_ACEOF
3352 #line 3352 "configure"
3353 #include "confdefs.h"
3354
3355 #include <stdlib.h>
3356 #include <string.h>
3357 #include <sys/types.h>
3358
3359 int
3360 main ()
3361 {
3362
3363 #ifdef _XOPEN_SOURCE
3364 make an error
3365 #endif
3366   ;
3367   return 0;
3368 }
3369 _ACEOF
3370 rm -f conftest.$ac_objext
3371 if { (eval echo "$as_me:3371: \"$ac_compile\"") >&5
3372   (eval $ac_compile) 2>&5
3373   ac_status=$?
3374   echo "$as_me:3374: \$? = $ac_status" >&5
3375   (exit $ac_status); } &&
3376          { ac_try='test -s conftest.$ac_objext'
3377   { (eval echo "$as_me:3377: \"$ac_try\"") >&5
3378   (eval $ac_try) 2>&5
3379   ac_status=$?
3380   echo "$as_me:3380: \$? = $ac_status" >&5
3381   (exit $ac_status); }; }; then
3382   cf_cv_xopen_source=no
3383 else
3384   echo "$as_me: failed program was:" >&5
3385 cat conftest.$ac_ext >&5
3386 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3387 fi
3388 rm -f conftest.$ac_objext conftest.$ac_ext
3389         CPPFLAGS="$cf_save"
3390
3391 fi
3392 rm -f conftest.$ac_objext conftest.$ac_ext
3393
3394 fi
3395 echo "$as_me:3395: result: $cf_cv_xopen_source" >&5
3396 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3397
3398 if test "$cf_cv_xopen_source" != no ; then
3399
3400 CFLAGS=`echo "$CFLAGS" | \
3401         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3402                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3403
3404 CPPFLAGS=`echo "$CPPFLAGS" | \
3405         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3406                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3407
3408         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3409
3410 cf_fix_cppflags=no
3411 cf_new_cflags=
3412 cf_new_cppflags=
3413 cf_new_extra_cppflags=
3414
3415 for cf_add_cflags in $cf_temp_xopen_source
3416 do
3417 case $cf_fix_cppflags in
3418 no)
3419         case $cf_add_cflags in #(vi
3420         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3421                 case $cf_add_cflags in
3422                 -D*)
3423                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3424
3425                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3426                                 && test -z "${cf_tst_cflags}" \
3427                                 && cf_fix_cppflags=yes
3428
3429                         if test $cf_fix_cppflags = yes ; then
3430                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3431                                 continue
3432                         elif test "${cf_tst_cflags}" = "\"'" ; then
3433                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3434                                 continue
3435                         fi
3436                         ;;
3437                 esac
3438                 case "$CPPFLAGS" in
3439                 *$cf_add_cflags) #(vi
3440                         ;;
3441                 *) #(vi
3442                         case $cf_add_cflags in #(vi
3443                         -D*)
3444                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3445
3446 CPPFLAGS=`echo "$CPPFLAGS" | \
3447         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3448                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3449
3450                                 ;;
3451                         esac
3452                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3453                         ;;
3454                 esac
3455                 ;;
3456         *)
3457                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3458                 ;;
3459         esac
3460         ;;
3461 yes)
3462         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3463
3464         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3465
3466         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3467                 && test -z "${cf_tst_cflags}" \
3468                 && cf_fix_cppflags=no
3469         ;;
3470 esac
3471 done
3472
3473 if test -n "$cf_new_cflags" ; then
3474
3475         CFLAGS="$CFLAGS $cf_new_cflags"
3476 fi
3477
3478 if test -n "$cf_new_cppflags" ; then
3479
3480         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3481 fi
3482
3483 if test -n "$cf_new_extra_cppflags" ; then
3484
3485         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3486 fi
3487
3488 fi
3489
3490 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3491
3492 cf_save_CFLAGS="$CFLAGS"
3493 cf_save_CPPFLAGS="$CPPFLAGS"
3494
3495 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3496         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3497                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3498
3499 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3500         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3501                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3502
3503 echo "$as_me:3503: checking if we should define _POSIX_C_SOURCE" >&5
3504 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3505 if test "${cf_cv_posix_c_source+set}" = set; then
3506   echo $ECHO_N "(cached) $ECHO_C" >&6
3507 else
3508
3509 echo "${as_me:-configure}:3509: testing if the symbol is already defined go no further ..." 1>&5
3510
3511         cat >conftest.$ac_ext <<_ACEOF
3512 #line 3512 "configure"
3513 #include "confdefs.h"
3514 #include <sys/types.h>
3515 int
3516 main ()
3517 {
3518
3519 #ifndef _POSIX_C_SOURCE
3520 make an error
3521 #endif
3522   ;
3523   return 0;
3524 }
3525 _ACEOF
3526 rm -f conftest.$ac_objext
3527 if { (eval echo "$as_me:3527: \"$ac_compile\"") >&5
3528   (eval $ac_compile) 2>&5
3529   ac_status=$?
3530   echo "$as_me:3530: \$? = $ac_status" >&5
3531   (exit $ac_status); } &&
3532          { ac_try='test -s conftest.$ac_objext'
3533   { (eval echo "$as_me:3533: \"$ac_try\"") >&5
3534   (eval $ac_try) 2>&5
3535   ac_status=$?
3536   echo "$as_me:3536: \$? = $ac_status" >&5
3537   (exit $ac_status); }; }; then
3538   cf_cv_posix_c_source=no
3539 else
3540   echo "$as_me: failed program was:" >&5
3541 cat conftest.$ac_ext >&5
3542 cf_want_posix_source=no
3543          case .$cf_POSIX_C_SOURCE in #(vi
3544          .[12]??*) #(vi
3545                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3546                 ;;
3547          .2) #(vi
3548                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3549                 cf_want_posix_source=yes
3550                 ;;
3551          .*)
3552                 cf_want_posix_source=yes
3553                 ;;
3554          esac
3555          if test "$cf_want_posix_source" = yes ; then
3556                 cat >conftest.$ac_ext <<_ACEOF
3557 #line 3557 "configure"
3558 #include "confdefs.h"
3559 #include <sys/types.h>
3560 int
3561 main ()
3562 {
3563
3564 #ifdef _POSIX_SOURCE
3565 make an error
3566 #endif
3567   ;
3568   return 0;
3569 }
3570 _ACEOF
3571 rm -f conftest.$ac_objext
3572 if { (eval echo "$as_me:3572: \"$ac_compile\"") >&5
3573   (eval $ac_compile) 2>&5
3574   ac_status=$?
3575   echo "$as_me:3575: \$? = $ac_status" >&5
3576   (exit $ac_status); } &&
3577          { ac_try='test -s conftest.$ac_objext'
3578   { (eval echo "$as_me:3578: \"$ac_try\"") >&5
3579   (eval $ac_try) 2>&5
3580   ac_status=$?
3581   echo "$as_me:3581: \$? = $ac_status" >&5
3582   (exit $ac_status); }; }; then
3583   :
3584 else
3585   echo "$as_me: failed program was:" >&5
3586 cat conftest.$ac_ext >&5
3587 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3588 fi
3589 rm -f conftest.$ac_objext conftest.$ac_ext
3590          fi
3591
3592 echo "${as_me:-configure}:3592: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3593
3594          CFLAGS="$cf_trim_CFLAGS"
3595          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3596
3597 echo "${as_me:-configure}:3597: testing if the second compile does not leave our definition intact error ..." 1>&5
3598
3599          cat >conftest.$ac_ext <<_ACEOF
3600 #line 3600 "configure"
3601 #include "confdefs.h"
3602 #include <sys/types.h>
3603 int
3604 main ()
3605 {
3606
3607 #ifndef _POSIX_C_SOURCE
3608 make an error
3609 #endif
3610   ;
3611   return 0;
3612 }
3613 _ACEOF
3614 rm -f conftest.$ac_objext
3615 if { (eval echo "$as_me:3615: \"$ac_compile\"") >&5
3616   (eval $ac_compile) 2>&5
3617   ac_status=$?
3618   echo "$as_me:3618: \$? = $ac_status" >&5
3619   (exit $ac_status); } &&
3620          { ac_try='test -s conftest.$ac_objext'
3621   { (eval echo "$as_me:3621: \"$ac_try\"") >&5
3622   (eval $ac_try) 2>&5
3623   ac_status=$?
3624   echo "$as_me:3624: \$? = $ac_status" >&5
3625   (exit $ac_status); }; }; then
3626   :
3627 else
3628   echo "$as_me: failed program was:" >&5
3629 cat conftest.$ac_ext >&5
3630 cf_cv_posix_c_source=no
3631 fi
3632 rm -f conftest.$ac_objext conftest.$ac_ext
3633          CFLAGS="$cf_save_CFLAGS"
3634          CPPFLAGS="$cf_save_CPPFLAGS"
3635
3636 fi
3637 rm -f conftest.$ac_objext conftest.$ac_ext
3638
3639 fi
3640 echo "$as_me:3640: result: $cf_cv_posix_c_source" >&5
3641 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3642
3643 if test "$cf_cv_posix_c_source" != no ; then
3644         CFLAGS="$cf_trim_CFLAGS"
3645         CPPFLAGS="$cf_trim_CPPFLAGS"
3646
3647 cf_fix_cppflags=no
3648 cf_new_cflags=
3649 cf_new_cppflags=
3650 cf_new_extra_cppflags=
3651
3652 for cf_add_cflags in $cf_cv_posix_c_source
3653 do
3654 case $cf_fix_cppflags in
3655 no)
3656         case $cf_add_cflags in #(vi
3657         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3658                 case $cf_add_cflags in
3659                 -D*)
3660                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3661
3662                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3663                                 && test -z "${cf_tst_cflags}" \
3664                                 && cf_fix_cppflags=yes
3665
3666                         if test $cf_fix_cppflags = yes ; then
3667                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3668                                 continue
3669                         elif test "${cf_tst_cflags}" = "\"'" ; then
3670                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3671                                 continue
3672                         fi
3673                         ;;
3674                 esac
3675                 case "$CPPFLAGS" in
3676                 *$cf_add_cflags) #(vi
3677                         ;;
3678                 *) #(vi
3679                         case $cf_add_cflags in #(vi
3680                         -D*)
3681                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3682
3683 CPPFLAGS=`echo "$CPPFLAGS" | \
3684         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3685                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3686
3687                                 ;;
3688                         esac
3689                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3690                         ;;
3691                 esac
3692                 ;;
3693         *)
3694                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3695                 ;;
3696         esac
3697         ;;
3698 yes)
3699         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3700
3701         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3702
3703         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3704                 && test -z "${cf_tst_cflags}" \
3705                 && cf_fix_cppflags=no
3706         ;;
3707 esac
3708 done
3709
3710 if test -n "$cf_new_cflags" ; then
3711
3712         CFLAGS="$CFLAGS $cf_new_cflags"
3713 fi
3714
3715 if test -n "$cf_new_cppflags" ; then
3716
3717         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3718 fi
3719
3720 if test -n "$cf_new_extra_cppflags" ; then
3721
3722         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3723 fi
3724
3725 fi
3726
3727         ;;
3728 esac
3729
3730 if test -n "$cf_xopen_source" ; then
3731
3732 cf_fix_cppflags=no
3733 cf_new_cflags=
3734 cf_new_cppflags=
3735 cf_new_extra_cppflags=
3736
3737 for cf_add_cflags in $cf_xopen_source
3738 do
3739 case $cf_fix_cppflags in
3740 no)
3741         case $cf_add_cflags in #(vi
3742         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3743                 case $cf_add_cflags in
3744                 -D*)
3745                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3746
3747                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3748                                 && test -z "${cf_tst_cflags}" \
3749                                 && cf_fix_cppflags=yes
3750
3751                         if test $cf_fix_cppflags = yes ; then
3752                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3753                                 continue
3754                         elif test "${cf_tst_cflags}" = "\"'" ; then
3755                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3756                                 continue
3757                         fi
3758                         ;;
3759                 esac
3760                 case "$CPPFLAGS" in
3761                 *$cf_add_cflags) #(vi
3762                         ;;
3763                 *) #(vi
3764                         case $cf_add_cflags in #(vi
3765                         -D*)
3766                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3767
3768 CPPFLAGS=`echo "$CPPFLAGS" | \
3769         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3770                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3771
3772                                 ;;
3773                         esac
3774                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3775                         ;;
3776                 esac
3777                 ;;
3778         *)
3779                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3780                 ;;
3781         esac
3782         ;;
3783 yes)
3784         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3785
3786         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3787
3788         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3789                 && test -z "${cf_tst_cflags}" \
3790                 && cf_fix_cppflags=no
3791         ;;
3792 esac
3793 done
3794
3795 if test -n "$cf_new_cflags" ; then
3796
3797         CFLAGS="$CFLAGS $cf_new_cflags"
3798 fi
3799
3800 if test -n "$cf_new_cppflags" ; then
3801
3802         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3803 fi
3804
3805 if test -n "$cf_new_extra_cppflags" ; then
3806
3807         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3808 fi
3809
3810 fi
3811
3812 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3813         echo "$as_me:3813: checking if _XOPEN_SOURCE really is set" >&5
3814 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3815         cat >conftest.$ac_ext <<_ACEOF
3816 #line 3816 "configure"
3817 #include "confdefs.h"
3818 #include <stdlib.h>
3819 int
3820 main ()
3821 {
3822
3823 #ifndef _XOPEN_SOURCE
3824 make an error
3825 #endif
3826   ;
3827   return 0;
3828 }
3829 _ACEOF
3830 rm -f conftest.$ac_objext
3831 if { (eval echo "$as_me:3831: \"$ac_compile\"") >&5
3832   (eval $ac_compile) 2>&5
3833   ac_status=$?
3834   echo "$as_me:3834: \$? = $ac_status" >&5
3835   (exit $ac_status); } &&
3836          { ac_try='test -s conftest.$ac_objext'
3837   { (eval echo "$as_me:3837: \"$ac_try\"") >&5
3838   (eval $ac_try) 2>&5
3839   ac_status=$?
3840   echo "$as_me:3840: \$? = $ac_status" >&5
3841   (exit $ac_status); }; }; then
3842   cf_XOPEN_SOURCE_set=yes
3843 else
3844   echo "$as_me: failed program was:" >&5
3845 cat conftest.$ac_ext >&5
3846 cf_XOPEN_SOURCE_set=no
3847 fi
3848 rm -f conftest.$ac_objext conftest.$ac_ext
3849         echo "$as_me:3849: result: $cf_XOPEN_SOURCE_set" >&5
3850 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3851         if test $cf_XOPEN_SOURCE_set = yes
3852         then
3853                 cat >conftest.$ac_ext <<_ACEOF
3854 #line 3854 "configure"
3855 #include "confdefs.h"
3856 #include <stdlib.h>
3857 int
3858 main ()
3859 {
3860
3861 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3862 make an error
3863 #endif
3864   ;
3865   return 0;
3866 }
3867 _ACEOF
3868 rm -f conftest.$ac_objext
3869 if { (eval echo "$as_me:3869: \"$ac_compile\"") >&5
3870   (eval $ac_compile) 2>&5
3871   ac_status=$?
3872   echo "$as_me:3872: \$? = $ac_status" >&5
3873   (exit $ac_status); } &&
3874          { ac_try='test -s conftest.$ac_objext'
3875   { (eval echo "$as_me:3875: \"$ac_try\"") >&5
3876   (eval $ac_try) 2>&5
3877   ac_status=$?
3878   echo "$as_me:3878: \$? = $ac_status" >&5
3879   (exit $ac_status); }; }; then
3880   cf_XOPEN_SOURCE_set_ok=yes
3881 else
3882   echo "$as_me: failed program was:" >&5
3883 cat conftest.$ac_ext >&5
3884 cf_XOPEN_SOURCE_set_ok=no
3885 fi
3886 rm -f conftest.$ac_objext conftest.$ac_ext
3887                 if test $cf_XOPEN_SOURCE_set_ok = no
3888                 then
3889                         { echo "$as_me:3889: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3890 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3891                 fi
3892         else
3893
3894 echo "$as_me:3894: checking if we should define _XOPEN_SOURCE" >&5
3895 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3896 if test "${cf_cv_xopen_source+set}" = set; then
3897   echo $ECHO_N "(cached) $ECHO_C" >&6
3898 else
3899
3900         cat >conftest.$ac_ext <<_ACEOF
3901 #line 3901 "configure"
3902 #include "confdefs.h"
3903
3904 #include <stdlib.h>
3905 #include <string.h>
3906 #include <sys/types.h>
3907
3908 int
3909 main ()
3910 {
3911
3912 #ifndef _XOPEN_SOURCE
3913 make an error
3914 #endif
3915   ;
3916   return 0;
3917 }
3918 _ACEOF
3919 rm -f conftest.$ac_objext
3920 if { (eval echo "$as_me:3920: \"$ac_compile\"") >&5
3921   (eval $ac_compile) 2>&5
3922   ac_status=$?
3923   echo "$as_me:3923: \$? = $ac_status" >&5
3924   (exit $ac_status); } &&
3925          { ac_try='test -s conftest.$ac_objext'
3926   { (eval echo "$as_me:3926: \"$ac_try\"") >&5
3927   (eval $ac_try) 2>&5
3928   ac_status=$?
3929   echo "$as_me:3929: \$? = $ac_status" >&5
3930   (exit $ac_status); }; }; then
3931   cf_cv_xopen_source=no
3932 else
3933   echo "$as_me: failed program was:" >&5
3934 cat conftest.$ac_ext >&5
3935 cf_save="$CPPFLAGS"
3936          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3937          cat >conftest.$ac_ext <<_ACEOF
3938 #line 3938 "configure"
3939 #include "confdefs.h"
3940
3941 #include <stdlib.h>
3942 #include <string.h>
3943 #include <sys/types.h>
3944
3945 int
3946 main ()
3947 {
3948
3949 #ifdef _XOPEN_SOURCE
3950 make an error
3951 #endif
3952   ;
3953   return 0;
3954 }
3955 _ACEOF
3956 rm -f conftest.$ac_objext
3957 if { (eval echo "$as_me:3957: \"$ac_compile\"") >&5
3958   (eval $ac_compile) 2>&5
3959   ac_status=$?
3960   echo "$as_me:3960: \$? = $ac_status" >&5
3961   (exit $ac_status); } &&
3962          { ac_try='test -s conftest.$ac_objext'
3963   { (eval echo "$as_me:3963: \"$ac_try\"") >&5
3964   (eval $ac_try) 2>&5
3965   ac_status=$?
3966   echo "$as_me:3966: \$? = $ac_status" >&5
3967   (exit $ac_status); }; }; then
3968   cf_cv_xopen_source=no
3969 else
3970   echo "$as_me: failed program was:" >&5
3971 cat conftest.$ac_ext >&5
3972 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3973 fi
3974 rm -f conftest.$ac_objext conftest.$ac_ext
3975         CPPFLAGS="$cf_save"
3976
3977 fi
3978 rm -f conftest.$ac_objext conftest.$ac_ext
3979
3980 fi
3981 echo "$as_me:3981: result: $cf_cv_xopen_source" >&5
3982 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3983
3984 if test "$cf_cv_xopen_source" != no ; then
3985
3986 CFLAGS=`echo "$CFLAGS" | \
3987         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3988                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3989
3990 CPPFLAGS=`echo "$CPPFLAGS" | \
3991         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3992                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3993
3994         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3995
3996 cf_fix_cppflags=no
3997 cf_new_cflags=
3998 cf_new_cppflags=
3999 cf_new_extra_cppflags=
4000
4001 for cf_add_cflags in $cf_temp_xopen_source
4002 do
4003 case $cf_fix_cppflags in
4004 no)
4005         case $cf_add_cflags in #(vi
4006         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4007                 case $cf_add_cflags in
4008                 -D*)
4009                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4010
4011                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4012                                 && test -z "${cf_tst_cflags}" \
4013                                 && cf_fix_cppflags=yes
4014
4015                         if test $cf_fix_cppflags = yes ; then
4016                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4017                                 continue
4018                         elif test "${cf_tst_cflags}" = "\"'" ; then
4019                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4020                                 continue
4021                         fi
4022                         ;;
4023                 esac
4024                 case "$CPPFLAGS" in
4025                 *$cf_add_cflags) #(vi
4026                         ;;
4027                 *) #(vi
4028                         case $cf_add_cflags in #(vi
4029                         -D*)
4030                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4031
4032 CPPFLAGS=`echo "$CPPFLAGS" | \
4033         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4034                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4035
4036                                 ;;
4037                         esac
4038                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4039                         ;;
4040                 esac
4041                 ;;
4042         *)
4043                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4044                 ;;
4045         esac
4046         ;;
4047 yes)
4048         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4049
4050         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4051
4052         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4053                 && test -z "${cf_tst_cflags}" \
4054                 && cf_fix_cppflags=no
4055         ;;
4056 esac
4057 done
4058
4059 if test -n "$cf_new_cflags" ; then
4060
4061         CFLAGS="$CFLAGS $cf_new_cflags"
4062 fi
4063
4064 if test -n "$cf_new_cppflags" ; then
4065
4066         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4067 fi
4068
4069 if test -n "$cf_new_extra_cppflags" ; then
4070
4071         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4072 fi
4073
4074 fi
4075
4076         fi
4077 fi
4078
4079 echo "$as_me:4079: checking for $CC option to accept ANSI C" >&5
4080 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
4081 if test "${ac_cv_prog_cc_stdc+set}" = set; then
4082   echo $ECHO_N "(cached) $ECHO_C" >&6
4083 else
4084   ac_cv_prog_cc_stdc=no
4085 ac_save_CC=$CC
4086 cat >conftest.$ac_ext <<_ACEOF
4087 #line 4087 "configure"
4088 #include "confdefs.h"
4089 #include <stdarg.h>
4090 #include <stdio.h>
4091 #include <sys/types.h>
4092 #include <sys/stat.h>
4093 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4094 struct buf { int x; };
4095 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4096 static char *e (p, i)
4097      char **p;
4098      int i;
4099 {
4100   return p[i];
4101 }
4102 static char *f (char * (*g) (char **, int), char **p, ...)
4103 {
4104   char *s;
4105   va_list v;
4106   va_start (v,p);
4107   s = g (p, va_arg (v,int));
4108   va_end (v);
4109   return s;
4110 }
4111 int test (int i, double x);
4112 struct s1 {int (*f) (int a);};
4113 struct s2 {int (*f) (double a);};
4114 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4115 int argc;
4116 char **argv;
4117 int
4118 main ()
4119 {
4120 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4121   ;
4122   return 0;
4123 }
4124 _ACEOF
4125 # Don't try gcc -ansi; that turns off useful extensions and
4126 # breaks some systems' header files.
4127 # AIX                   -qlanglvl=ansi
4128 # Ultrix and OSF/1      -std1
4129 # HP-UX 10.20 and later -Ae
4130 # HP-UX older versions  -Aa -D_HPUX_SOURCE
4131 # SVR4                  -Xc -D__EXTENSIONS__
4132 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4133 do
4134   CC="$ac_save_CC $ac_arg"
4135   rm -f conftest.$ac_objext
4136 if { (eval echo "$as_me:4136: \"$ac_compile\"") >&5
4137   (eval $ac_compile) 2>&5
4138   ac_status=$?
4139   echo "$as_me:4139: \$? = $ac_status" >&5
4140   (exit $ac_status); } &&
4141          { ac_try='test -s conftest.$ac_objext'
4142   { (eval echo "$as_me:4142: \"$ac_try\"") >&5
4143   (eval $ac_try) 2>&5
4144   ac_status=$?
4145   echo "$as_me:4145: \$? = $ac_status" >&5
4146   (exit $ac_status); }; }; then
4147   ac_cv_prog_cc_stdc=$ac_arg
4148 break
4149 else
4150   echo "$as_me: failed program was:" >&5
4151 cat conftest.$ac_ext >&5
4152 fi
4153 rm -f conftest.$ac_objext
4154 done
4155 rm -f conftest.$ac_ext conftest.$ac_objext
4156 CC=$ac_save_CC
4157
4158 fi
4159
4160 case "x$ac_cv_prog_cc_stdc" in
4161   x|xno)
4162     echo "$as_me:4162: result: none needed" >&5
4163 echo "${ECHO_T}none needed" >&6 ;;
4164   *)
4165     echo "$as_me:4165: result: $ac_cv_prog_cc_stdc" >&5
4166 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
4167     CC="$CC $ac_cv_prog_cc_stdc" ;;
4168 esac
4169
4170 echo "$as_me:4170: checking for an ANSI C-conforming const" >&5
4171 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
4172 if test "${ac_cv_c_const+set}" = set; then
4173   echo $ECHO_N "(cached) $ECHO_C" >&6
4174 else
4175   cat >conftest.$ac_ext <<_ACEOF
4176 #line 4176 "configure"
4177 #include "confdefs.h"
4178
4179 int
4180 main ()
4181 {
4182 /* FIXME: Include the comments suggested by Paul. */
4183 #ifndef __cplusplus
4184   /* Ultrix mips cc rejects this.  */
4185   typedef int charset[2];
4186   const charset x;
4187   /* SunOS 4.1.1 cc rejects this.  */
4188   char const *const *ccp;
4189   char **p;
4190   /* NEC SVR4.0.2 mips cc rejects this.  */
4191   struct point {int x, y;};
4192   static struct point const zero = {0,0};
4193   /* AIX XL C 1.02.0.0 rejects this.
4194      It does not let you subtract one const X* pointer from another in
4195      an arm of an if-expression whose if-part is not a constant
4196      expression */
4197   const char *g = "string";
4198   ccp = &g + (g ? g-g : 0);
4199   /* HPUX 7.0 cc rejects these. */
4200   ++ccp;
4201   p = (char**) ccp;
4202   ccp = (char const *const *) p;
4203   { /* SCO 3.2v4 cc rejects this.  */
4204     char *t;
4205     char const *s = 0 ? (char *) 0 : (char const *) 0;
4206
4207     *t++ = 0;
4208   }
4209   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
4210     int x[] = {25, 17};
4211     const int *foo = &x[0];
4212     ++foo;
4213   }
4214   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
4215     typedef const int *iptr;
4216     iptr p = 0;
4217     ++p;
4218   }
4219   { /* AIX XL C 1.02.0.0 rejects this saying
4220        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
4221     struct s { int j; const int *ap[3]; };
4222     struct s *b; b->j = 5;
4223   }
4224   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
4225     const int foo = 10;
4226   }
4227 #endif
4228
4229   ;
4230   return 0;
4231 }
4232 _ACEOF
4233 rm -f conftest.$ac_objext
4234 if { (eval echo "$as_me:4234: \"$ac_compile\"") >&5
4235   (eval $ac_compile) 2>&5
4236   ac_status=$?
4237   echo "$as_me:4237: \$? = $ac_status" >&5
4238   (exit $ac_status); } &&
4239          { ac_try='test -s conftest.$ac_objext'
4240   { (eval echo "$as_me:4240: \"$ac_try\"") >&5
4241   (eval $ac_try) 2>&5
4242   ac_status=$?
4243   echo "$as_me:4243: \$? = $ac_status" >&5
4244   (exit $ac_status); }; }; then
4245   ac_cv_c_const=yes
4246 else
4247   echo "$as_me: failed program was:" >&5
4248 cat conftest.$ac_ext >&5
4249 ac_cv_c_const=no
4250 fi
4251 rm -f conftest.$ac_objext conftest.$ac_ext
4252 fi
4253 echo "$as_me:4253: result: $ac_cv_c_const" >&5
4254 echo "${ECHO_T}$ac_cv_c_const" >&6
4255 if test $ac_cv_c_const = no; then
4256
4257 cat >>confdefs.h <<\EOF
4258 #define const
4259 EOF
4260
4261 fi
4262
4263 echo "$as_me:4263: checking for signal global datatype" >&5
4264 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4265 if test "${cf_cv_sig_atomic_t+set}" = set; then
4266   echo $ECHO_N "(cached) $ECHO_C" >&6
4267 else
4268
4269         for cf_type in \
4270                 "volatile sig_atomic_t" \
4271                 "sig_atomic_t" \
4272                 "int"
4273         do
4274         cat >conftest.$ac_ext <<_ACEOF
4275 #line 4275 "configure"
4276 #include "confdefs.h"
4277
4278 #include <sys/types.h>
4279 #include <signal.h>
4280 #include <stdio.h>
4281
4282 extern $cf_type x;
4283 $cf_type x;
4284 static void handler(int sig)
4285 {
4286         x = 5;
4287 }
4288 int
4289 main ()
4290 {
4291 signal(SIGINT, handler);
4292                  x = 1
4293   ;
4294   return 0;
4295 }
4296 _ACEOF
4297 rm -f conftest.$ac_objext
4298 if { (eval echo "$as_me:4298: \"$ac_compile\"") >&5
4299   (eval $ac_compile) 2>&5
4300   ac_status=$?
4301   echo "$as_me:4301: \$? = $ac_status" >&5
4302   (exit $ac_status); } &&
4303          { ac_try='test -s conftest.$ac_objext'
4304   { (eval echo "$as_me:4304: \"$ac_try\"") >&5
4305   (eval $ac_try) 2>&5
4306   ac_status=$?
4307   echo "$as_me:4307: \$? = $ac_status" >&5
4308   (exit $ac_status); }; }; then
4309   cf_cv_sig_atomic_t=$cf_type
4310 else
4311   echo "$as_me: failed program was:" >&5
4312 cat conftest.$ac_ext >&5
4313 cf_cv_sig_atomic_t=no
4314 fi
4315 rm -f conftest.$ac_objext conftest.$ac_ext
4316                 test "$cf_cv_sig_atomic_t" != no && break
4317         done
4318
4319 fi
4320
4321 echo "$as_me:4321: result: $cf_cv_sig_atomic_t" >&5
4322 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4323 test "$cf_cv_sig_atomic_t" != no && cat >>confdefs.h <<EOF
4324 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4325 EOF
4326
4327 echo "$as_me:4327: checking if you want to see long compiling messages" >&5
4328 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4329
4330 # Check whether --enable-echo or --disable-echo was given.
4331 if test "${enable_echo+set}" = set; then
4332   enableval="$enable_echo"
4333   test "$enableval" != no && enableval=yes
4334   if test "$enableval" != "yes" ; then
4335
4336     ECHO_LT='--silent'
4337     ECHO_LD='@echo linking $@;'
4338     RULE_CC='@echo compiling $<'
4339     SHOW_CC='@echo compiling $@'
4340     ECHO_CC='@'
4341
4342   else
4343
4344     ECHO_LT=''
4345     ECHO_LD=''
4346     RULE_CC=''
4347     SHOW_CC=''
4348     ECHO_CC=''
4349
4350   fi
4351 else
4352   enableval=yes
4353
4354     ECHO_LT=''
4355     ECHO_LD=''
4356     RULE_CC=''
4357     SHOW_CC=''
4358     ECHO_CC=''
4359
4360 fi;
4361 echo "$as_me:4361: result: $enableval" >&5
4362 echo "${ECHO_T}$enableval" >&6
4363
4364 GCC_VERSION=none
4365 if test "$GCC" = yes ; then
4366         echo "$as_me:4366: checking version of $CC" >&5
4367 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
4368         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
4369         test -z "$GCC_VERSION" && GCC_VERSION=unknown
4370         echo "$as_me:4370: result: $GCC_VERSION" >&5
4371 echo "${ECHO_T}$GCC_VERSION" >&6
4372 fi
4373
4374 if ( test "$GCC" = yes || test "$GXX" = yes )
4375 then
4376 echo "$as_me:4376: checking if you want to turn on gcc warnings" >&5
4377 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
4378
4379 # Check whether --enable-warnings or --disable-warnings was given.
4380 if test "${enable_warnings+set}" = set; then
4381   enableval="$enable_warnings"
4382   test "$enableval" != yes && enableval=no
4383   if test "$enableval" != "no" ; then
4384     with_warnings=yes
4385   else
4386     with_warnings=no
4387   fi
4388 else
4389   enableval=no
4390   with_warnings=no
4391
4392 fi;
4393 echo "$as_me:4393: result: $with_warnings" >&5
4394 echo "${ECHO_T}$with_warnings" >&6
4395 if test "$with_warnings" = "yes"
4396 then
4397
4398 if test "$GCC" = yes
4399 then
4400 cat > conftest.i <<EOF
4401 #ifndef GCC_PRINTF
4402 #define GCC_PRINTF 0
4403 #endif
4404 #ifndef GCC_SCANF
4405 #define GCC_SCANF 0
4406 #endif
4407 #ifndef GCC_NORETURN
4408 #define GCC_NORETURN /* nothing */
4409 #endif
4410 #ifndef GCC_UNUSED
4411 #define GCC_UNUSED /* nothing */
4412 #endif
4413 EOF
4414 if test "$GCC" = yes
4415 then
4416         { echo "$as_me:4416: checking for $CC __attribute__ directives..." >&5
4417 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
4418 cat > conftest.$ac_ext <<EOF
4419 #line 4419 "${as_me:-configure}"
4420 #include "confdefs.h"
4421 #include "conftest.h"
4422 #include "conftest.i"
4423 #if     GCC_PRINTF
4424 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
4425 #else
4426 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
4427 #endif
4428 #if     GCC_SCANF
4429 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
4430 #else
4431 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
4432 #endif
4433 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
4434 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
4435 extern void foo(void) GCC_NORETURN;
4436 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
4437 EOF
4438         cf_printf_attribute=no
4439         cf_scanf_attribute=no
4440         for cf_attribute in scanf printf unused noreturn
4441         do
4442
4443 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4444
4445                 cf_directive="__attribute__(($cf_attribute))"
4446                 echo "checking for $CC $cf_directive" 1>&5
4447
4448                 case $cf_attribute in #(vi
4449                 printf) #(vi
4450                         cf_printf_attribute=yes
4451                         cat >conftest.h <<EOF
4452 #define GCC_$cf_ATTRIBUTE 1
4453 EOF
4454                         ;;
4455                 scanf) #(vi
4456                         cf_scanf_attribute=yes
4457                         cat >conftest.h <<EOF
4458 #define GCC_$cf_ATTRIBUTE 1
4459 EOF
4460                         ;;
4461                 *) #(vi
4462                         cat >conftest.h <<EOF
4463 #define GCC_$cf_ATTRIBUTE $cf_directive
4464 EOF
4465                         ;;
4466                 esac
4467
4468                 if { (eval echo "$as_me:4468: \"$ac_compile\"") >&5
4469   (eval $ac_compile) 2>&5
4470   ac_status=$?
4471   echo "$as_me:4471: \$? = $ac_status" >&5
4472   (exit $ac_status); }; then
4473                         test -n "$verbose" && echo "$as_me:4473: result: ... $cf_attribute" >&5
4474 echo "${ECHO_T}... $cf_attribute" >&6
4475                         cat conftest.h >>confdefs.h
4476                         case $cf_attribute in #(vi
4477                         printf) #(vi
4478                                 if test "$cf_printf_attribute" = no ; then
4479                                         cat >>confdefs.h <<EOF
4480 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
4481 EOF
4482                                 else
4483                                         cat >>confdefs.h <<EOF
4484 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
4485 EOF
4486                                 fi
4487                                 ;;
4488                         scanf) #(vi
4489                                 if test "$cf_scanf_attribute" = no ; then
4490                                         cat >>confdefs.h <<EOF
4491 #define GCC_SCANFLIKE(fmt,var) /* nothing */
4492 EOF
4493                                 else
4494                                         cat >>confdefs.h <<EOF
4495 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
4496 EOF
4497                                 fi
4498                                 ;;
4499                         esac
4500                 fi
4501         done
4502 else
4503         fgrep define conftest.i >>confdefs.h
4504 fi
4505 rm -rf conftest*
4506 fi
4507
4508 INTEL_COMPILER=no
4509
4510 if test "$GCC" = yes ; then
4511         case $host_os in
4512         linux*|gnu*)
4513                 echo "$as_me:4513: checking if this is really Intel C compiler" >&5
4514 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
4515                 cf_save_CFLAGS="$CFLAGS"
4516                 CFLAGS="$CFLAGS -no-gcc"
4517                 cat >conftest.$ac_ext <<_ACEOF
4518 #line 4518 "configure"
4519 #include "confdefs.h"
4520
4521 int
4522 main ()
4523 {
4524
4525 #ifdef __INTEL_COMPILER
4526 #else
4527 make an error
4528 #endif
4529
4530   ;
4531   return 0;
4532 }
4533 _ACEOF
4534 rm -f conftest.$ac_objext
4535 if { (eval echo "$as_me:4535: \"$ac_compile\"") >&5
4536   (eval $ac_compile) 2>&5
4537   ac_status=$?
4538   echo "$as_me:4538: \$? = $ac_status" >&5
4539   (exit $ac_status); } &&
4540          { ac_try='test -s conftest.$ac_objext'
4541   { (eval echo "$as_me:4541: \"$ac_try\"") >&5
4542   (eval $ac_try) 2>&5
4543   ac_status=$?
4544   echo "$as_me:4544: \$? = $ac_status" >&5
4545   (exit $ac_status); }; }; then
4546   INTEL_COMPILER=yes
4547 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
4548
4549 else
4550   echo "$as_me: failed program was:" >&5
4551 cat conftest.$ac_ext >&5
4552 fi
4553 rm -f conftest.$ac_objext conftest.$ac_ext
4554                 CFLAGS="$cf_save_CFLAGS"
4555                 echo "$as_me:4555: result: $INTEL_COMPILER" >&5
4556 echo "${ECHO_T}$INTEL_COMPILER" >&6
4557                 ;;
4558         esac
4559 fi
4560
4561 CLANG_COMPILER=no
4562
4563 if test "$GCC" = yes ; then
4564         echo "$as_me:4564: checking if this is really Clang C compiler" >&5
4565 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
4566         cf_save_CFLAGS="$CFLAGS"
4567         CFLAGS="$CFLAGS -Qunused-arguments"
4568         cat >conftest.$ac_ext <<_ACEOF
4569 #line 4569 "configure"
4570 #include "confdefs.h"
4571
4572 int
4573 main ()
4574 {
4575
4576 #ifdef __clang__
4577 #else
4578 make an error
4579 #endif
4580
4581   ;
4582   return 0;
4583 }
4584 _ACEOF
4585 rm -f conftest.$ac_objext
4586 if { (eval echo "$as_me:4586: \"$ac_compile\"") >&5
4587   (eval $ac_compile) 2>&5
4588   ac_status=$?
4589   echo "$as_me:4589: \$? = $ac_status" >&5
4590   (exit $ac_status); } &&
4591          { ac_try='test -s conftest.$ac_objext'
4592   { (eval echo "$as_me:4592: \"$ac_try\"") >&5
4593   (eval $ac_try) 2>&5
4594   ac_status=$?
4595   echo "$as_me:4595: \$? = $ac_status" >&5
4596   (exit $ac_status); }; }; then
4597   CLANG_COMPILER=yes
4598 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
4599
4600 else
4601   echo "$as_me: failed program was:" >&5
4602 cat conftest.$ac_ext >&5
4603 fi
4604 rm -f conftest.$ac_objext conftest.$ac_ext
4605         CFLAGS="$cf_save_CFLAGS"
4606         echo "$as_me:4606: result: $CLANG_COMPILER" >&5
4607 echo "${ECHO_T}$CLANG_COMPILER" >&6
4608 fi
4609
4610 cat > conftest.$ac_ext <<EOF
4611 #line 4611 "${as_me:-configure}"
4612 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
4613 EOF
4614
4615 if test "$INTEL_COMPILER" = yes
4616 then
4617 # The "-wdXXX" options suppress warnings:
4618 # remark #1419: external declaration in primary source file
4619 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
4620 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
4621 # remark #193: zero used for undefined preprocessing identifier
4622 # remark #593: variable "curs_sb_left_arrow" was set but never used
4623 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
4624 # remark #869: parameter "tw" was never referenced
4625 # remark #981: operands are evaluated in unspecified order
4626 # warning #279: controlling expression is constant
4627
4628         { echo "$as_me:4628: checking for $CC warning options..." >&5
4629 echo "$as_me: checking for $CC warning options..." >&6;}
4630         cf_save_CFLAGS="$CFLAGS"
4631         EXTRA_CFLAGS="-Wall"
4632         for cf_opt in \
4633                 wd1419 \
4634                 wd1683 \
4635                 wd1684 \
4636                 wd193 \
4637                 wd593 \
4638                 wd279 \
4639                 wd810 \
4640                 wd869 \
4641                 wd981
4642         do
4643                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
4644                 if { (eval echo "$as_me:4644: \"$ac_compile\"") >&5
4645   (eval $ac_compile) 2>&5
4646   ac_status=$?
4647   echo "$as_me:4647: \$? = $ac_status" >&5
4648   (exit $ac_status); }; then
4649                         test -n "$verbose" && echo "$as_me:4649: result: ... -$cf_opt" >&5
4650 echo "${ECHO_T}... -$cf_opt" >&6
4651                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
4652                 fi
4653         done
4654         CFLAGS="$cf_save_CFLAGS"
4655
4656 elif test "$GCC" = yes
4657 then
4658         { echo "$as_me:4658: checking for $CC warning options..." >&5
4659 echo "$as_me: checking for $CC warning options..." >&6;}
4660         cf_save_CFLAGS="$CFLAGS"
4661         EXTRA_CFLAGS=
4662         cf_warn_CONST=""
4663         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
4664         for cf_opt in W Wall \
4665                 Wbad-function-cast \
4666                 Wcast-align \
4667                 Wcast-qual \
4668                 Winline \
4669                 Wmissing-declarations \
4670                 Wmissing-prototypes \
4671                 Wnested-externs \
4672                 Wpointer-arith \
4673                 Wshadow \
4674                 Wstrict-prototypes \
4675                 Wundef $cf_warn_CONST
4676         do
4677                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
4678                 if { (eval echo "$as_me:4678: \"$ac_compile\"") >&5
4679   (eval $ac_compile) 2>&5
4680   ac_status=$?
4681   echo "$as_me:4681: \$? = $ac_status" >&5
4682   (exit $ac_status); }; then
4683                         test -n "$verbose" && echo "$as_me:4683: result: ... -$cf_opt" >&5
4684 echo "${ECHO_T}... -$cf_opt" >&6
4685                         case $cf_opt in #(vi
4686                         Wcast-qual) #(vi
4687                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
4688                                 ;;
4689                         Winline) #(vi
4690                                 case $GCC_VERSION in
4691                                 [34].*)
4692                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
4693
4694 echo "${as_me:-configure}:4694: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
4695
4696                                         continue;;
4697                                 esac
4698                                 ;;
4699                         Wpointer-arith) #(vi
4700                                 case $GCC_VERSION in
4701                                 [12].*)
4702                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
4703
4704 echo "${as_me:-configure}:4704: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
4705
4706                                         continue;;
4707                                 esac
4708                                 ;;
4709                         esac
4710                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
4711                 fi
4712         done
4713         CFLAGS="$cf_save_CFLAGS"
4714 fi
4715 rm -rf conftest*
4716
4717 fi
4718 fi
4719
4720 echo "$as_me:4720: checking if you want to use dmalloc for testing" >&5
4721 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
4722
4723 # Check whether --with-dmalloc or --without-dmalloc was given.
4724 if test "${with_dmalloc+set}" = set; then
4725   withval="$with_dmalloc"
4726   cat >>confdefs.h <<\EOF
4727 #define USE_DMALLOC 1
4728 EOF
4729
4730         : ${with_cflags:=-g}
4731         : ${with_no_leaks:=yes}
4732          with_dmalloc=yes
4733 else
4734   with_dmalloc=
4735 fi;
4736 echo "$as_me:4736: result: ${with_dmalloc:-no}" >&5
4737 echo "${ECHO_T}${with_dmalloc:-no}" >&6
4738
4739 case .$with_cflags in #(vi
4740 .*-g*)
4741         case .$CFLAGS in #(vi
4742         .*-g*) #(vi
4743                 ;;
4744         *)
4745
4746 cf_fix_cppflags=no
4747 cf_new_cflags=
4748 cf_new_cppflags=
4749 cf_new_extra_cppflags=
4750
4751 for cf_add_cflags in -g
4752 do
4753 case $cf_fix_cppflags in
4754 no)
4755         case $cf_add_cflags in #(vi
4756         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4757                 case $cf_add_cflags in
4758                 -D*)
4759                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4760
4761                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4762                                 && test -z "${cf_tst_cflags}" \
4763                                 && cf_fix_cppflags=yes
4764
4765                         if test $cf_fix_cppflags = yes ; then
4766                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4767                                 continue
4768                         elif test "${cf_tst_cflags}" = "\"'" ; then
4769                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4770                                 continue
4771                         fi
4772                         ;;
4773                 esac
4774                 case "$CPPFLAGS" in
4775                 *$cf_add_cflags) #(vi
4776                         ;;
4777                 *) #(vi
4778                         case $cf_add_cflags in #(vi
4779                         -D*)
4780                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4781
4782 CPPFLAGS=`echo "$CPPFLAGS" | \
4783         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4784                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4785
4786                                 ;;
4787                         esac
4788                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4789                         ;;
4790                 esac
4791                 ;;
4792         *)
4793                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4794                 ;;
4795         esac
4796         ;;
4797 yes)
4798         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4799
4800         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4801
4802         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4803                 && test -z "${cf_tst_cflags}" \
4804                 && cf_fix_cppflags=no
4805         ;;
4806 esac
4807 done
4808
4809 if test -n "$cf_new_cflags" ; then
4810
4811         CFLAGS="$CFLAGS $cf_new_cflags"
4812 fi
4813
4814 if test -n "$cf_new_cppflags" ; then
4815
4816         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4817 fi
4818
4819 if test -n "$cf_new_extra_cppflags" ; then
4820
4821         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4822 fi
4823
4824                 ;;
4825         esac
4826         ;;
4827 esac
4828
4829 if test "$with_dmalloc" = yes ; then
4830         echo "$as_me:4830: checking for dmalloc.h" >&5
4831 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
4832 if test "${ac_cv_header_dmalloc_h+set}" = set; then
4833   echo $ECHO_N "(cached) $ECHO_C" >&6
4834 else
4835   cat >conftest.$ac_ext <<_ACEOF
4836 #line 4836 "configure"
4837 #include "confdefs.h"
4838 #include <dmalloc.h>
4839 _ACEOF
4840 if { (eval echo "$as_me:4840: \"$ac_cpp conftest.$ac_ext\"") >&5
4841   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4842   ac_status=$?
4843   egrep -v '^ *\+' conftest.er1 >conftest.err
4844   rm -f conftest.er1
4845   cat conftest.err >&5
4846   echo "$as_me:4846: \$? = $ac_status" >&5
4847   (exit $ac_status); } >/dev/null; then
4848   if test -s conftest.err; then
4849     ac_cpp_err=$ac_c_preproc_warn_flag
4850   else
4851     ac_cpp_err=
4852   fi
4853 else
4854   ac_cpp_err=yes
4855 fi
4856 if test -z "$ac_cpp_err"; then
4857   ac_cv_header_dmalloc_h=yes
4858 else
4859   echo "$as_me: failed program was:" >&5
4860   cat conftest.$ac_ext >&5
4861   ac_cv_header_dmalloc_h=no
4862 fi
4863 rm -f conftest.err conftest.$ac_ext
4864 fi
4865 echo "$as_me:4865: result: $ac_cv_header_dmalloc_h" >&5
4866 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
4867 if test $ac_cv_header_dmalloc_h = yes; then
4868
4869 echo "$as_me:4869: checking for dmalloc_debug in -ldmalloc" >&5
4870 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
4871 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
4872   echo $ECHO_N "(cached) $ECHO_C" >&6
4873 else
4874   ac_check_lib_save_LIBS=$LIBS
4875 LIBS="-ldmalloc  $LIBS"
4876 cat >conftest.$ac_ext <<_ACEOF
4877 #line 4877 "configure"
4878 #include "confdefs.h"
4879
4880 /* Override any gcc2 internal prototype to avoid an error.  */
4881 #ifdef __cplusplus
4882 extern "C"
4883 #endif
4884 /* We use char because int might match the return type of a gcc2
4885    builtin and then its argument prototype would still apply.  */
4886 char dmalloc_debug ();
4887 int
4888 main ()
4889 {
4890 dmalloc_debug ();
4891   ;
4892   return 0;
4893 }
4894 _ACEOF
4895 rm -f conftest.$ac_objext conftest$ac_exeext
4896 if { (eval echo "$as_me:4896: \"$ac_link\"") >&5
4897   (eval $ac_link) 2>&5
4898   ac_status=$?
4899   echo "$as_me:4899: \$? = $ac_status" >&5
4900   (exit $ac_status); } &&
4901          { ac_try='test -s conftest$ac_exeext'
4902   { (eval echo "$as_me:4902: \"$ac_try\"") >&5
4903   (eval $ac_try) 2>&5
4904   ac_status=$?
4905   echo "$as_me:4905: \$? = $ac_status" >&5
4906   (exit $ac_status); }; }; then
4907   ac_cv_lib_dmalloc_dmalloc_debug=yes
4908 else
4909   echo "$as_me: failed program was:" >&5
4910 cat conftest.$ac_ext >&5
4911 ac_cv_lib_dmalloc_dmalloc_debug=no
4912 fi
4913 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4914 LIBS=$ac_check_lib_save_LIBS
4915 fi
4916 echo "$as_me:4916: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
4917 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
4918 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
4919   cat >>confdefs.h <<EOF
4920 #define HAVE_LIBDMALLOC 1
4921 EOF
4922
4923   LIBS="-ldmalloc $LIBS"
4924
4925 fi
4926
4927 fi
4928
4929 fi
4930
4931 echo "$as_me:4931: checking if you want to use dbmalloc for testing" >&5
4932 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
4933
4934 # Check whether --with-dbmalloc or --without-dbmalloc was given.
4935 if test "${with_dbmalloc+set}" = set; then
4936   withval="$with_dbmalloc"
4937   cat >>confdefs.h <<\EOF
4938 #define USE_DBMALLOC 1
4939 EOF
4940
4941         : ${with_cflags:=-g}
4942         : ${with_no_leaks:=yes}
4943          with_dbmalloc=yes
4944 else
4945   with_dbmalloc=
4946 fi;
4947 echo "$as_me:4947: result: ${with_dbmalloc:-no}" >&5
4948 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
4949
4950 case .$with_cflags in #(vi
4951 .*-g*)
4952         case .$CFLAGS in #(vi
4953         .*-g*) #(vi
4954                 ;;
4955         *)
4956
4957 cf_fix_cppflags=no
4958 cf_new_cflags=
4959 cf_new_cppflags=
4960 cf_new_extra_cppflags=
4961
4962 for cf_add_cflags in -g
4963 do
4964 case $cf_fix_cppflags in
4965 no)
4966         case $cf_add_cflags in #(vi
4967         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4968                 case $cf_add_cflags in
4969                 -D*)
4970                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4971
4972                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4973                                 && test -z "${cf_tst_cflags}" \
4974                                 && cf_fix_cppflags=yes
4975
4976                         if test $cf_fix_cppflags = yes ; then
4977                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4978                                 continue
4979                         elif test "${cf_tst_cflags}" = "\"'" ; then
4980                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4981                                 continue
4982                         fi
4983                         ;;
4984                 esac
4985                 case "$CPPFLAGS" in
4986                 *$cf_add_cflags) #(vi
4987                         ;;
4988                 *) #(vi
4989                         case $cf_add_cflags in #(vi
4990                         -D*)
4991                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4992
4993 CPPFLAGS=`echo "$CPPFLAGS" | \
4994         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4995                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4996
4997                                 ;;
4998                         esac
4999                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
5000                         ;;
5001                 esac
5002                 ;;
5003         *)
5004                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
5005                 ;;
5006         esac
5007         ;;
5008 yes)
5009         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5010
5011         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5012
5013         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
5014                 && test -z "${cf_tst_cflags}" \
5015                 && cf_fix_cppflags=no
5016         ;;
5017 esac
5018 done
5019
5020 if test -n "$cf_new_cflags" ; then
5021
5022         CFLAGS="$CFLAGS $cf_new_cflags"
5023 fi
5024
5025 if test -n "$cf_new_cppflags" ; then
5026
5027         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
5028 fi
5029
5030 if test -n "$cf_new_extra_cppflags" ; then
5031
5032         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
5033 fi
5034
5035                 ;;
5036         esac
5037         ;;
5038 esac
5039
5040 if test "$with_dbmalloc" = yes ; then
5041         echo "$as_me:5041: checking for dbmalloc.h" >&5
5042 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
5043 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
5044   echo $ECHO_N "(cached) $ECHO_C" >&6
5045 else
5046   cat >conftest.$ac_ext <<_ACEOF
5047 #line 5047 "configure"
5048 #include "confdefs.h"
5049 #include <dbmalloc.h>
5050 _ACEOF
5051 if { (eval echo "$as_me:5051: \"$ac_cpp conftest.$ac_ext\"") >&5
5052   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5053   ac_status=$?
5054   egrep -v '^ *\+' conftest.er1 >conftest.err
5055   rm -f conftest.er1
5056   cat conftest.err >&5
5057   echo "$as_me:5057: \$? = $ac_status" >&5
5058   (exit $ac_status); } >/dev/null; then
5059   if test -s conftest.err; then
5060     ac_cpp_err=$ac_c_preproc_warn_flag
5061   else
5062     ac_cpp_err=
5063   fi
5064 else
5065   ac_cpp_err=yes
5066 fi
5067 if test -z "$ac_cpp_err"; then
5068   ac_cv_header_dbmalloc_h=yes
5069 else
5070   echo "$as_me: failed program was:" >&5
5071   cat conftest.$ac_ext >&5
5072   ac_cv_header_dbmalloc_h=no
5073 fi
5074 rm -f conftest.err conftest.$ac_ext
5075 fi
5076 echo "$as_me:5076: result: $ac_cv_header_dbmalloc_h" >&5
5077 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
5078 if test $ac_cv_header_dbmalloc_h = yes; then
5079
5080 echo "$as_me:5080: checking for debug_malloc in -ldbmalloc" >&5
5081 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
5082 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
5083   echo $ECHO_N "(cached) $ECHO_C" >&6
5084 else
5085   ac_check_lib_save_LIBS=$LIBS
5086 LIBS="-ldbmalloc  $LIBS"
5087 cat >conftest.$ac_ext <<_ACEOF
5088 #line 5088 "configure"
5089 #include "confdefs.h"
5090
5091 /* Override any gcc2 internal prototype to avoid an error.  */
5092 #ifdef __cplusplus
5093 extern "C"
5094 #endif
5095 /* We use char because int might match the return type of a gcc2
5096    builtin and then its argument prototype would still apply.  */
5097 char debug_malloc ();
5098 int
5099 main ()
5100 {
5101 debug_malloc ();
5102   ;
5103   return 0;
5104 }
5105 _ACEOF
5106 rm -f conftest.$ac_objext conftest$ac_exeext
5107 if { (eval echo "$as_me:5107: \"$ac_link\"") >&5
5108   (eval $ac_link) 2>&5
5109   ac_status=$?
5110   echo "$as_me:5110: \$? = $ac_status" >&5
5111   (exit $ac_status); } &&
5112          { ac_try='test -s conftest$ac_exeext'
5113   { (eval echo "$as_me:5113: \"$ac_try\"") >&5
5114   (eval $ac_try) 2>&5
5115   ac_status=$?
5116   echo "$as_me:5116: \$? = $ac_status" >&5
5117   (exit $ac_status); }; }; then
5118   ac_cv_lib_dbmalloc_debug_malloc=yes
5119 else
5120   echo "$as_me: failed program was:" >&5
5121 cat conftest.$ac_ext >&5
5122 ac_cv_lib_dbmalloc_debug_malloc=no
5123 fi
5124 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5125 LIBS=$ac_check_lib_save_LIBS
5126 fi
5127 echo "$as_me:5127: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
5128 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
5129 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
5130   cat >>confdefs.h <<EOF
5131 #define HAVE_LIBDBMALLOC 1
5132 EOF
5133
5134   LIBS="-ldbmalloc $LIBS"
5135
5136 fi
5137
5138 fi
5139
5140 fi
5141
5142 echo "$as_me:5142: checking if you want to use valgrind for testing" >&5
5143 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
5144
5145 # Check whether --with-valgrind or --without-valgrind was given.
5146 if test "${with_valgrind+set}" = set; then
5147   withval="$with_valgrind"
5148   cat >>confdefs.h <<\EOF
5149 #define USE_VALGRIND 1
5150 EOF
5151
5152         : ${with_cflags:=-g}
5153         : ${with_no_leaks:=yes}
5154          with_valgrind=yes
5155 else
5156   with_valgrind=
5157 fi;
5158 echo "$as_me:5158: result: ${with_valgrind:-no}" >&5
5159 echo "${ECHO_T}${with_valgrind:-no}" >&6
5160
5161 case .$with_cflags in #(vi
5162 .*-g*)
5163         case .$CFLAGS in #(vi
5164         .*-g*) #(vi
5165                 ;;
5166         *)
5167
5168 cf_fix_cppflags=no
5169 cf_new_cflags=
5170 cf_new_cppflags=
5171 cf_new_extra_cppflags=
5172
5173 for cf_add_cflags in -g
5174 do
5175 case $cf_fix_cppflags in
5176 no)
5177         case $cf_add_cflags in #(vi
5178         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
5179                 case $cf_add_cflags in
5180                 -D*)
5181                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5182
5183                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
5184                                 && test -z "${cf_tst_cflags}" \
5185                                 && cf_fix_cppflags=yes
5186
5187                         if test $cf_fix_cppflags = yes ; then
5188                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5189                                 continue
5190                         elif test "${cf_tst_cflags}" = "\"'" ; then
5191                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5192                                 continue
5193                         fi
5194                         ;;
5195                 esac
5196                 case "$CPPFLAGS" in
5197                 *$cf_add_cflags) #(vi
5198                         ;;
5199                 *) #(vi
5200                         case $cf_add_cflags in #(vi
5201                         -D*)
5202                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5203
5204 CPPFLAGS=`echo "$CPPFLAGS" | \
5205         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5206                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5207
5208                                 ;;
5209                         esac
5210                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
5211                         ;;
5212                 esac
5213                 ;;
5214         *)
5215                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
5216                 ;;
5217         esac
5218         ;;
5219 yes)
5220         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5221
5222         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5223
5224         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
5225                 && test -z "${cf_tst_cflags}" \
5226                 && cf_fix_cppflags=no
5227         ;;
5228 esac
5229 done
5230
5231 if test -n "$cf_new_cflags" ; then
5232
5233         CFLAGS="$CFLAGS $cf_new_cflags"
5234 fi
5235
5236 if test -n "$cf_new_cppflags" ; then
5237
5238         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
5239 fi
5240
5241 if test -n "$cf_new_extra_cppflags" ; then
5242
5243         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
5244 fi
5245
5246                 ;;
5247         esac
5248         ;;
5249 esac
5250
5251 echo "$as_me:5251: checking if you want to perform memory-leak testing" >&5
5252 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
5253
5254 # Check whether --enable-leaks or --disable-leaks was given.
5255 if test "${enable_leaks+set}" = set; then
5256   enableval="$enable_leaks"
5257   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
5258 else
5259   : ${with_no_leaks:=no}
5260 fi;
5261 echo "$as_me:5261: result: $with_no_leaks" >&5
5262 echo "${ECHO_T}$with_no_leaks" >&6
5263
5264 if test "$with_no_leaks" = yes ; then
5265         cat >>confdefs.h <<\EOF
5266 #define NO_LEAKS 1
5267 EOF
5268
5269         cat >>confdefs.h <<\EOF
5270 #define YY_NO_LEAKS 1
5271 EOF
5272
5273 fi
5274
5275 echo "$as_me:5275: checking if you want to check for wide-character functions" >&5
5276 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5277
5278 # Check whether --enable-widec or --disable-widec was given.
5279 if test "${enable_widec+set}" = set; then
5280   enableval="$enable_widec"
5281   test "$enableval" != no && enableval=yes
5282   if test "$enableval" != "yes" ; then
5283     cf_enable_widec=no
5284   else
5285     cf_enable_widec=yes
5286   fi
5287 else
5288   enableval=yes
5289   cf_enable_widec=yes
5290
5291 fi;
5292 echo "$as_me:5292: result: $cf_enable_widec" >&5
5293 echo "${ECHO_T}$cf_enable_widec" >&6
5294
5295 echo "$as_me:5295: checking for specific curses-directory" >&5
5296 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5297
5298 # Check whether --with-curses-dir or --without-curses-dir was given.
5299 if test "${with_curses_dir+set}" = set; then
5300   withval="$with_curses_dir"
5301   cf_cv_curses_dir=$withval
5302 else
5303   cf_cv_curses_dir=no
5304 fi;
5305 echo "$as_me:5305: result: $cf_cv_curses_dir" >&5
5306 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5307
5308 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5309 then
5310
5311 if test "x$prefix" != xNONE; then
5312   cf_path_syntax="$prefix"
5313 else
5314   cf_path_syntax="$ac_default_prefix"
5315 fi
5316
5317 case ".$withval" in #(vi
5318 .\$\(*\)*|.\'*\'*) #(vi
5319   ;;
5320 ..|./*|.\\*) #(vi
5321   ;;
5322 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
5323   ;;
5324 .\${*prefix}*|.\${*dir}*) #(vi
5325   eval withval="$withval"
5326   case ".$withval" in #(vi
5327   .NONE/*)
5328     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5329     ;;
5330   esac
5331   ;; #(vi
5332 .no|.NONE/*)
5333   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5334   ;;
5335 *)
5336   { { echo "$as_me:5336: error: expected a pathname, not \"$withval\"" >&5
5337 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5338    { (exit 1); exit 1; }; }
5339   ;;
5340 esac
5341
5342         if test -d "$cf_cv_curses_dir"
5343         then
5344
5345 if test -n "$cf_cv_curses_dir/include" ; then
5346   for cf_add_incdir in $cf_cv_curses_dir/include
5347   do
5348         while test $cf_add_incdir != /usr/include
5349         do
5350           if test -d $cf_add_incdir
5351           then
5352                 cf_have_incdir=no
5353                 if test -n "$CFLAGS$CPPFLAGS" ; then
5354                   # a loop is needed to ensure we can add subdirs of existing dirs
5355                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5356                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5357                           cf_have_incdir=yes; break
5358                         fi
5359                   done
5360                 fi
5361
5362                 if test "$cf_have_incdir" = no ; then
5363                   if test "$cf_add_incdir" = /usr/local/include ; then
5364                         if test "$GCC" = yes
5365                         then
5366                           cf_save_CPPFLAGS=$CPPFLAGS
5367                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5368                           cat >conftest.$ac_ext <<_ACEOF
5369 #line 5369 "configure"
5370 #include "confdefs.h"
5371 #include <stdio.h>
5372 int
5373 main ()
5374 {
5375 printf("Hello")
5376   ;
5377   return 0;
5378 }
5379 _ACEOF
5380 rm -f conftest.$ac_objext
5381 if { (eval echo "$as_me:5381: \"$ac_compile\"") >&5
5382   (eval $ac_compile) 2>&5
5383   ac_status=$?
5384   echo "$as_me:5384: \$? = $ac_status" >&5
5385   (exit $ac_status); } &&
5386          { ac_try='test -s conftest.$ac_objext'
5387   { (eval echo "$as_me:5387: \"$ac_try\"") >&5
5388   (eval $ac_try) 2>&5
5389   ac_status=$?
5390   echo "$as_me:5390: \$? = $ac_status" >&5
5391   (exit $ac_status); }; }; then
5392   :
5393 else
5394   echo "$as_me: failed program was:" >&5
5395 cat conftest.$ac_ext >&5
5396 cf_have_incdir=yes
5397 fi
5398 rm -f conftest.$ac_objext conftest.$ac_ext
5399                           CPPFLAGS=$cf_save_CPPFLAGS
5400                         fi
5401                   fi
5402                 fi
5403
5404                 if test "$cf_have_incdir" = no ; then
5405                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5406
5407 echo "${as_me:-configure}:5407: testing adding $cf_add_incdir to include-path ..." 1>&5
5408
5409                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5410
5411                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5412                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5413                   cf_add_incdir="$cf_top_incdir"
5414                 else
5415                   break
5416                 fi
5417           fi
5418         done
5419   done
5420 fi
5421
5422 if test -n "$cf_cv_curses_dir/lib" ; then
5423   for cf_add_libdir in $cf_cv_curses_dir/lib
5424   do
5425     if test $cf_add_libdir = /usr/lib ; then
5426       :
5427     elif test -d $cf_add_libdir
5428     then
5429       cf_have_libdir=no
5430       if test -n "$LDFLAGS$LIBS" ; then
5431         # a loop is needed to ensure we can add subdirs of existing dirs
5432         for cf_test_libdir in $LDFLAGS $LIBS ; do
5433           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5434             cf_have_libdir=yes; break
5435           fi
5436         done
5437       fi
5438       if test "$cf_have_libdir" = no ; then
5439         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5440
5441 echo "${as_me:-configure}:5441: testing adding $cf_add_libdir to library-path ..." 1>&5
5442
5443         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5444       fi
5445     fi
5446   done
5447 fi
5448
5449         fi
5450 fi
5451
5452 cf_cv_screen=curses
5453
5454 echo "$as_me:5454: checking for specified curses library type" >&5
5455 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5456
5457 # Check whether --with-ncursesw or --without-ncursesw was given.
5458 if test "${with_ncursesw+set}" = set; then
5459   withval="$with_ncursesw"
5460   cf_cv_screen=ncursesw
5461 else
5462
5463 # Check whether --with-ncurses or --without-ncurses was given.
5464 if test "${with_ncurses+set}" = set; then
5465   withval="$with_ncurses"
5466   cf_cv_screen=ncurses
5467 else
5468
5469 # Check whether --with-pdcurses or --without-pdcurses was given.
5470 if test "${with_pdcurses+set}" = set; then
5471   withval="$with_pdcurses"
5472   cf_cv_screen=pdcurses
5473 else
5474
5475 # Check whether --with-curses-colr or --without-curses-colr was given.
5476 if test "${with_curses_colr+set}" = set; then
5477   withval="$with_curses_colr"
5478   cf_cv_screen=curses_colr
5479 else
5480
5481 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5482 if test "${with_curses_5lib+set}" = set; then
5483   withval="$with_curses_5lib"
5484   cf_cv_screen=curses_5lib
5485 fi;
5486 fi;
5487 fi;
5488 fi;
5489 fi;
5490
5491 echo "$as_me:5491: result: $cf_cv_screen" >&5
5492 echo "${ECHO_T}$cf_cv_screen" >&6
5493
5494 case $cf_cv_screen in #(vi
5495 curses|curses_*) #(vi
5496
5497 echo "$as_me:5497: checking for extra include directories" >&5
5498 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5499 if test "${cf_cv_curses_incdir+set}" = set; then
5500   echo $ECHO_N "(cached) $ECHO_C" >&6
5501 else
5502
5503 cf_cv_curses_incdir=no
5504 case $host_os in #(vi
5505 hpux10.*) #(vi
5506         if test "x$cf_cv_screen" = "xcurses_colr"
5507         then
5508                 test -d /usr/include/curses_colr && \
5509                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5510         fi
5511         ;;
5512 sunos3*|sunos4*)
5513         if test "x$cf_cv_screen" = "xcurses_5lib"
5514         then
5515                 test -d /usr/5lib && \
5516                 test -d /usr/5include && \
5517                 cf_cv_curses_incdir="-I/usr/5include"
5518         fi
5519         ;;
5520 esac
5521
5522 fi
5523 echo "$as_me:5523: result: $cf_cv_curses_incdir" >&5
5524 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5525 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
5526
5527 echo "$as_me:5527: checking if we have identified curses headers" >&5
5528 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5529 if test "${cf_cv_ncurses_header+set}" = set; then
5530   echo $ECHO_N "(cached) $ECHO_C" >&6
5531 else
5532
5533 cf_cv_ncurses_header=none
5534 for cf_header in  \
5535         ncurses.h \
5536         curses.h ncurses/ncurses.h ncurses/curses.h
5537 do
5538 cat >conftest.$ac_ext <<_ACEOF
5539 #line 5539 "configure"
5540 #include "confdefs.h"
5541 #include <${cf_header}>
5542 int
5543 main ()
5544 {
5545 initscr(); tgoto("?", 0,0)
5546   ;
5547   return 0;
5548 }
5549 _ACEOF
5550 rm -f conftest.$ac_objext
5551 if { (eval echo "$as_me:5551: \"$ac_compile\"") >&5
5552   (eval $ac_compile) 2>&5
5553   ac_status=$?
5554   echo "$as_me:5554: \$? = $ac_status" >&5
5555   (exit $ac_status); } &&
5556          { ac_try='test -s conftest.$ac_objext'
5557   { (eval echo "$as_me:5557: \"$ac_try\"") >&5
5558   (eval $ac_try) 2>&5
5559   ac_status=$?
5560   echo "$as_me:5560: \$? = $ac_status" >&5
5561   (exit $ac_status); }; }; then
5562   cf_cv_ncurses_header=$cf_header; break
5563 else
5564   echo "$as_me: failed program was:" >&5
5565 cat conftest.$ac_ext >&5
5566 fi
5567 rm -f conftest.$ac_objext conftest.$ac_ext
5568 done
5569
5570 fi
5571 echo "$as_me:5571: result: $cf_cv_ncurses_header" >&5
5572 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5573
5574 if test "$cf_cv_ncurses_header" = none ; then
5575         { { echo "$as_me:5575: error: No curses header-files found" >&5
5576 echo "$as_me: error: No curses header-files found" >&2;}
5577    { (exit 1); exit 1; }; }
5578 fi
5579
5580 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5581
5582 for ac_header in $cf_cv_ncurses_header
5583 do
5584 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5585 echo "$as_me:5585: checking for $ac_header" >&5
5586 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5587 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5588   echo $ECHO_N "(cached) $ECHO_C" >&6
5589 else
5590   cat >conftest.$ac_ext <<_ACEOF
5591 #line 5591 "configure"
5592 #include "confdefs.h"
5593 #include <$ac_header>
5594 _ACEOF
5595 if { (eval echo "$as_me:5595: \"$ac_cpp conftest.$ac_ext\"") >&5
5596   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5597   ac_status=$?
5598   egrep -v '^ *\+' conftest.er1 >conftest.err
5599   rm -f conftest.er1
5600   cat conftest.err >&5
5601   echo "$as_me:5601: \$? = $ac_status" >&5
5602   (exit $ac_status); } >/dev/null; then
5603   if test -s conftest.err; then
5604     ac_cpp_err=$ac_c_preproc_warn_flag
5605   else
5606     ac_cpp_err=
5607   fi
5608 else
5609   ac_cpp_err=yes
5610 fi
5611 if test -z "$ac_cpp_err"; then
5612   eval "$as_ac_Header=yes"
5613 else
5614   echo "$as_me: failed program was:" >&5
5615   cat conftest.$ac_ext >&5
5616   eval "$as_ac_Header=no"
5617 fi
5618 rm -f conftest.err conftest.$ac_ext
5619 fi
5620 echo "$as_me:5620: result: `eval echo '${'$as_ac_Header'}'`" >&5
5621 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5622 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5623   cat >>confdefs.h <<EOF
5624 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5625 EOF
5626
5627 fi
5628 done
5629
5630 echo "$as_me:5630: checking for terminfo header" >&5
5631 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5632 if test "${cf_cv_term_header+set}" = set; then
5633   echo $ECHO_N "(cached) $ECHO_C" >&6
5634 else
5635
5636 case ${cf_cv_ncurses_header} in #(vi
5637 */ncurses.h|*/ncursesw.h) #(vi
5638         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5639         ;;
5640 *)
5641         cf_term_header=term.h
5642         ;;
5643 esac
5644
5645 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5646 do
5647 cat >conftest.$ac_ext <<_ACEOF
5648 #line 5648 "configure"
5649 #include "confdefs.h"
5650 #include <stdio.h>
5651 #include <${cf_cv_ncurses_header:-curses.h}>
5652 #include <$cf_test>
5653
5654 int
5655 main ()
5656 {
5657 int x = auto_left_margin
5658   ;
5659   return 0;
5660 }
5661 _ACEOF
5662 rm -f conftest.$ac_objext
5663 if { (eval echo "$as_me:5663: \"$ac_compile\"") >&5
5664   (eval $ac_compile) 2>&5
5665   ac_status=$?
5666   echo "$as_me:5666: \$? = $ac_status" >&5
5667   (exit $ac_status); } &&
5668          { ac_try='test -s conftest.$ac_objext'
5669   { (eval echo "$as_me:5669: \"$ac_try\"") >&5
5670   (eval $ac_try) 2>&5
5671   ac_status=$?
5672   echo "$as_me:5672: \$? = $ac_status" >&5
5673   (exit $ac_status); }; }; then
5674
5675         cf_cv_term_header="$cf_test"
5676 else
5677   echo "$as_me: failed program was:" >&5
5678 cat conftest.$ac_ext >&5
5679
5680         cf_cv_term_header=unknown
5681
5682 fi
5683 rm -f conftest.$ac_objext conftest.$ac_ext
5684         test "$cf_cv_term_header" != unknown && break
5685 done
5686
5687 fi
5688 echo "$as_me:5688: result: $cf_cv_term_header" >&5
5689 echo "${ECHO_T}$cf_cv_term_header" >&6
5690
5691 # Set definitions to allow ifdef'ing to accommodate subdirectories
5692
5693 case $cf_cv_term_header in # (vi
5694 *term.h)
5695         cat >>confdefs.h <<\EOF
5696 #define HAVE_TERM_H 1
5697 EOF
5698
5699         ;;
5700 esac
5701
5702 case $cf_cv_term_header in # (vi
5703 ncurses/term.h) #(vi
5704         cat >>confdefs.h <<\EOF
5705 #define HAVE_NCURSES_TERM_H 1
5706 EOF
5707
5708         ;;
5709 ncursesw/term.h)
5710         cat >>confdefs.h <<\EOF
5711 #define HAVE_NCURSESW_TERM_H 1
5712 EOF
5713
5714         ;;
5715 esac
5716
5717 echo "$as_me:5717: checking for ncurses version" >&5
5718 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5719 if test "${cf_cv_ncurses_version+set}" = set; then
5720   echo $ECHO_N "(cached) $ECHO_C" >&6
5721 else
5722
5723         cf_cv_ncurses_version=no
5724         cf_tempfile=out$$
5725         rm -f $cf_tempfile
5726         if test "$cross_compiling" = yes; then
5727
5728         # This will not work if the preprocessor splits the line after the
5729         # Autoconf token.  The 'unproto' program does that.
5730         cat > conftest.$ac_ext <<EOF
5731 #include <${cf_cv_ncurses_header:-curses.h}>
5732 #undef Autoconf
5733 #ifdef NCURSES_VERSION
5734 Autoconf NCURSES_VERSION
5735 #else
5736 #ifdef __NCURSES_H
5737 Autoconf "old"
5738 #endif
5739 ;
5740 #endif
5741 EOF
5742         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5743         { (eval echo "$as_me:5743: \"$cf_try\"") >&5
5744   (eval $cf_try) 2>&5
5745   ac_status=$?
5746   echo "$as_me:5746: \$? = $ac_status" >&5
5747   (exit $ac_status); }
5748         if test -f conftest.out ; then
5749                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5750                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5751                 rm -f conftest.out
5752         fi
5753
5754 else
5755   cat >conftest.$ac_ext <<_ACEOF
5756 #line 5756 "configure"
5757 #include "confdefs.h"
5758
5759 #include <${cf_cv_ncurses_header:-curses.h}>
5760 #include <stdio.h>
5761 int main()
5762 {
5763         FILE *fp = fopen("$cf_tempfile", "w");
5764 #ifdef NCURSES_VERSION
5765 # ifdef NCURSES_VERSION_PATCH
5766         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5767 # else
5768         fprintf(fp, "%s\n", NCURSES_VERSION);
5769 # endif
5770 #else
5771 # ifdef __NCURSES_H
5772         fprintf(fp, "old\n");
5773 # else
5774         make an error
5775 # endif
5776 #endif
5777         ${cf_cv_main_return:-return}(0);
5778 }
5779 _ACEOF
5780 rm -f conftest$ac_exeext
5781 if { (eval echo "$as_me:5781: \"$ac_link\"") >&5
5782   (eval $ac_link) 2>&5
5783   ac_status=$?
5784   echo "$as_me:5784: \$? = $ac_status" >&5
5785   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5786   { (eval echo "$as_me:5786: \"$ac_try\"") >&5
5787   (eval $ac_try) 2>&5
5788   ac_status=$?
5789   echo "$as_me:5789: \$? = $ac_status" >&5
5790   (exit $ac_status); }; }; then
5791
5792         cf_cv_ncurses_version=`cat $cf_tempfile`
5793 else
5794   echo "$as_me: program exited with status $ac_status" >&5
5795 echo "$as_me: failed program was:" >&5
5796 cat conftest.$ac_ext >&5
5797 fi
5798 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5799 fi
5800         rm -f $cf_tempfile
5801
5802 fi
5803 echo "$as_me:5803: result: $cf_cv_ncurses_version" >&5
5804 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5805 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
5806 #define NCURSES 1
5807 EOF
5808
5809 echo "$as_me:5809: checking if we have identified curses libraries" >&5
5810 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5811 cat >conftest.$ac_ext <<_ACEOF
5812 #line 5812 "configure"
5813 #include "confdefs.h"
5814 #include <${cf_cv_ncurses_header:-curses.h}>
5815 int
5816 main ()
5817 {
5818 initscr(); tgoto("?", 0,0)
5819   ;
5820   return 0;
5821 }
5822 _ACEOF
5823 rm -f conftest.$ac_objext conftest$ac_exeext
5824 if { (eval echo "$as_me:5824: \"$ac_link\"") >&5
5825   (eval $ac_link) 2>&5
5826   ac_status=$?
5827   echo "$as_me:5827: \$? = $ac_status" >&5
5828   (exit $ac_status); } &&
5829          { ac_try='test -s conftest$ac_exeext'
5830   { (eval echo "$as_me:5830: \"$ac_try\"") >&5
5831   (eval $ac_try) 2>&5
5832   ac_status=$?
5833   echo "$as_me:5833: \$? = $ac_status" >&5
5834   (exit $ac_status); }; }; then
5835   cf_result=yes
5836 else
5837   echo "$as_me: failed program was:" >&5
5838 cat conftest.$ac_ext >&5
5839 cf_result=no
5840 fi
5841 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5842 echo "$as_me:5842: result: $cf_result" >&5
5843 echo "${ECHO_T}$cf_result" >&6
5844
5845 if test "$cf_result" = no ; then
5846 case $host_os in #(vi
5847 freebsd*) #(vi
5848     echo "$as_me:5848: checking for tgoto in -lmytinfo" >&5
5849 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5850 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5851   echo $ECHO_N "(cached) $ECHO_C" >&6
5852 else
5853   ac_check_lib_save_LIBS=$LIBS
5854 LIBS="-lmytinfo  $LIBS"
5855 cat >conftest.$ac_ext <<_ACEOF
5856 #line 5856 "configure"
5857 #include "confdefs.h"
5858
5859 /* Override any gcc2 internal prototype to avoid an error.  */
5860 #ifdef __cplusplus
5861 extern "C"
5862 #endif
5863 /* We use char because int might match the return type of a gcc2
5864    builtin and then its argument prototype would still apply.  */
5865 char tgoto ();
5866 int
5867 main ()
5868 {
5869 tgoto ();
5870   ;
5871   return 0;
5872 }
5873 _ACEOF
5874 rm -f conftest.$ac_objext conftest$ac_exeext
5875 if { (eval echo "$as_me:5875: \"$ac_link\"") >&5
5876   (eval $ac_link) 2>&5
5877   ac_status=$?
5878   echo "$as_me:5878: \$? = $ac_status" >&5
5879   (exit $ac_status); } &&
5880          { ac_try='test -s conftest$ac_exeext'
5881   { (eval echo "$as_me:5881: \"$ac_try\"") >&5
5882   (eval $ac_try) 2>&5
5883   ac_status=$?
5884   echo "$as_me:5884: \$? = $ac_status" >&5
5885   (exit $ac_status); }; }; then
5886   ac_cv_lib_mytinfo_tgoto=yes
5887 else
5888   echo "$as_me: failed program was:" >&5
5889 cat conftest.$ac_ext >&5
5890 ac_cv_lib_mytinfo_tgoto=no
5891 fi
5892 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5893 LIBS=$ac_check_lib_save_LIBS
5894 fi
5895 echo "$as_me:5895: result: $ac_cv_lib_mytinfo_tgoto" >&5
5896 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5897 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5898   LIBS="-lmytinfo $LIBS"
5899 fi
5900
5901     ;;
5902 hpux10.*) #(vi
5903         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5904         # next (1998), and xcurses "newer" (2000).  There is no header file for
5905         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5906         # term.h) for cur_colr
5907         if test "x$cf_cv_screen" = "xcurses_colr"
5908         then
5909                 echo "$as_me:5909: checking for initscr in -lcur_colr" >&5
5910 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5911 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5912   echo $ECHO_N "(cached) $ECHO_C" >&6
5913 else
5914   ac_check_lib_save_LIBS=$LIBS
5915 LIBS="-lcur_colr  $LIBS"
5916 cat >conftest.$ac_ext <<_ACEOF
5917 #line 5917 "configure"
5918 #include "confdefs.h"
5919
5920 /* Override any gcc2 internal prototype to avoid an error.  */
5921 #ifdef __cplusplus
5922 extern "C"
5923 #endif
5924 /* We use char because int might match the return type of a gcc2
5925    builtin and then its argument prototype would still apply.  */
5926 char initscr ();
5927 int
5928 main ()
5929 {
5930 initscr ();
5931   ;
5932   return 0;
5933 }
5934 _ACEOF
5935 rm -f conftest.$ac_objext conftest$ac_exeext
5936 if { (eval echo "$as_me:5936: \"$ac_link\"") >&5
5937   (eval $ac_link) 2>&5
5938   ac_status=$?
5939   echo "$as_me:5939: \$? = $ac_status" >&5
5940   (exit $ac_status); } &&
5941          { ac_try='test -s conftest$ac_exeext'
5942   { (eval echo "$as_me:5942: \"$ac_try\"") >&5
5943   (eval $ac_try) 2>&5
5944   ac_status=$?
5945   echo "$as_me:5945: \$? = $ac_status" >&5
5946   (exit $ac_status); }; }; then
5947   ac_cv_lib_cur_colr_initscr=yes
5948 else
5949   echo "$as_me: failed program was:" >&5
5950 cat conftest.$ac_ext >&5
5951 ac_cv_lib_cur_colr_initscr=no
5952 fi
5953 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5954 LIBS=$ac_check_lib_save_LIBS
5955 fi
5956 echo "$as_me:5956: result: $ac_cv_lib_cur_colr_initscr" >&5
5957 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5958 if test $ac_cv_lib_cur_colr_initscr = yes; then
5959
5960                         LIBS="-lcur_colr $LIBS"
5961                         ac_cv_func_initscr=yes
5962
5963 else
5964
5965                 echo "$as_me:5965: checking for initscr in -lHcurses" >&5
5966 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5967 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5968   echo $ECHO_N "(cached) $ECHO_C" >&6
5969 else
5970   ac_check_lib_save_LIBS=$LIBS
5971 LIBS="-lHcurses  $LIBS"
5972 cat >conftest.$ac_ext <<_ACEOF
5973 #line 5973 "configure"
5974 #include "confdefs.h"
5975
5976 /* Override any gcc2 internal prototype to avoid an error.  */
5977 #ifdef __cplusplus
5978 extern "C"
5979 #endif
5980 /* We use char because int might match the return type of a gcc2
5981    builtin and then its argument prototype would still apply.  */
5982 char initscr ();
5983 int
5984 main ()
5985 {
5986 initscr ();
5987   ;
5988   return 0;
5989 }
5990 _ACEOF
5991 rm -f conftest.$ac_objext conftest$ac_exeext
5992 if { (eval echo "$as_me:5992: \"$ac_link\"") >&5
5993   (eval $ac_link) 2>&5
5994   ac_status=$?
5995   echo "$as_me:5995: \$? = $ac_status" >&5
5996   (exit $ac_status); } &&
5997          { ac_try='test -s conftest$ac_exeext'
5998   { (eval echo "$as_me:5998: \"$ac_try\"") >&5
5999   (eval $ac_try) 2>&5
6000   ac_status=$?
6001   echo "$as_me:6001: \$? = $ac_status" >&5
6002   (exit $ac_status); }; }; then
6003   ac_cv_lib_Hcurses_initscr=yes
6004 else
6005   echo "$as_me: failed program was:" >&5
6006 cat conftest.$ac_ext >&5
6007 ac_cv_lib_Hcurses_initscr=no
6008 fi
6009 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6010 LIBS=$ac_check_lib_save_LIBS
6011 fi
6012 echo "$as_me:6012: result: $ac_cv_lib_Hcurses_initscr" >&5
6013 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6014 if test $ac_cv_lib_Hcurses_initscr = yes; then
6015
6016                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6017                         LIBS="-lHcurses $LIBS"
6018                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
6019                         ac_cv_func_initscr=yes
6020
6021 fi
6022
6023 fi
6024
6025         fi
6026     ;;
6027 linux*)
6028         case `arch 2>/dev/null` in
6029         x86_64)
6030                 if test -d /lib64
6031                 then
6032
6033 if test -n "/lib64" ; then
6034   for cf_add_libdir in /lib64
6035   do
6036     if test $cf_add_libdir = /usr/lib ; then
6037       :
6038     elif test -d $cf_add_libdir
6039     then
6040       cf_have_libdir=no
6041       if test -n "$LDFLAGS$LIBS" ; then
6042         # a loop is needed to ensure we can add subdirs of existing dirs
6043         for cf_test_libdir in $LDFLAGS $LIBS ; do
6044           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6045             cf_have_libdir=yes; break
6046           fi
6047         done
6048       fi
6049       if test "$cf_have_libdir" = no ; then
6050         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6051
6052 echo "${as_me:-configure}:6052: testing adding $cf_add_libdir to library-path ..." 1>&5
6053
6054         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6055       fi
6056     fi
6057   done
6058 fi
6059
6060                 else
6061
6062 if test -n "/lib" ; then
6063   for cf_add_libdir in /lib
6064   do
6065     if test $cf_add_libdir = /usr/lib ; then
6066       :
6067     elif test -d $cf_add_libdir
6068     then
6069       cf_have_libdir=no
6070       if test -n "$LDFLAGS$LIBS" ; then
6071         # a loop is needed to ensure we can add subdirs of existing dirs
6072         for cf_test_libdir in $LDFLAGS $LIBS ; do
6073           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6074             cf_have_libdir=yes; break
6075           fi
6076         done
6077       fi
6078       if test "$cf_have_libdir" = no ; then
6079         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6080
6081 echo "${as_me:-configure}:6081: testing adding $cf_add_libdir to library-path ..." 1>&5
6082
6083         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6084       fi
6085     fi
6086   done
6087 fi
6088
6089                 fi
6090                 ;;
6091         *)
6092
6093 if test -n "/lib" ; then
6094   for cf_add_libdir in /lib
6095   do
6096     if test $cf_add_libdir = /usr/lib ; then
6097       :
6098     elif test -d $cf_add_libdir
6099     then
6100       cf_have_libdir=no
6101       if test -n "$LDFLAGS$LIBS" ; then
6102         # a loop is needed to ensure we can add subdirs of existing dirs
6103         for cf_test_libdir in $LDFLAGS $LIBS ; do
6104           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6105             cf_have_libdir=yes; break
6106           fi
6107         done
6108       fi
6109       if test "$cf_have_libdir" = no ; then
6110         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6111
6112 echo "${as_me:-configure}:6112: testing adding $cf_add_libdir to library-path ..." 1>&5
6113
6114         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6115       fi
6116     fi
6117   done
6118 fi
6119
6120                 ;;
6121         esac
6122     ;;
6123 sunos3*|sunos4*)
6124         if test "x$cf_cv_screen" = "xcurses_5lib"
6125         then
6126                 if test -d /usr/5lib ; then
6127
6128 if test -n "/usr/5lib" ; then
6129   for cf_add_libdir in /usr/5lib
6130   do
6131     if test $cf_add_libdir = /usr/lib ; then
6132       :
6133     elif test -d $cf_add_libdir
6134     then
6135       cf_have_libdir=no
6136       if test -n "$LDFLAGS$LIBS" ; then
6137         # a loop is needed to ensure we can add subdirs of existing dirs
6138         for cf_test_libdir in $LDFLAGS $LIBS ; do
6139           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6140             cf_have_libdir=yes; break
6141           fi
6142         done
6143       fi
6144       if test "$cf_have_libdir" = no ; then
6145         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6146
6147 echo "${as_me:-configure}:6147: testing adding $cf_add_libdir to library-path ..." 1>&5
6148
6149         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6150       fi
6151     fi
6152   done
6153 fi
6154
6155                         LIBS="-lcurses -ltermcap $LIBS"
6156                 fi
6157     fi
6158     ac_cv_func_initscr=yes
6159     ;;
6160 esac
6161
6162 if test ".$ac_cv_func_initscr" != .yes ; then
6163     cf_save_LIBS="$LIBS"
6164     cf_term_lib=""
6165     cf_curs_lib=""
6166
6167     if test ".${cf_cv_ncurses_version:-no}" != .no
6168     then
6169         cf_check_list="ncurses curses cursesX"
6170     else
6171         cf_check_list="cursesX curses ncurses"
6172     fi
6173
6174     # Check for library containing tgoto.  Do this before curses library
6175     # because it may be needed to link the test-case for initscr.
6176     echo "$as_me:6176: checking for tgoto" >&5
6177 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6178 if test "${ac_cv_func_tgoto+set}" = set; then
6179   echo $ECHO_N "(cached) $ECHO_C" >&6
6180 else
6181   cat >conftest.$ac_ext <<_ACEOF
6182 #line 6182 "configure"
6183 #include "confdefs.h"
6184 /* System header to define __stub macros and hopefully few prototypes,
6185     which can conflict with char tgoto (); below.  */
6186 #include <assert.h>
6187 /* Override any gcc2 internal prototype to avoid an error.  */
6188 #ifdef __cplusplus
6189 extern "C"
6190 #endif
6191 /* We use char because int might match the return type of a gcc2
6192    builtin and then its argument prototype would still apply.  */
6193 char tgoto ();
6194 char (*f) ();
6195
6196 int
6197 main ()
6198 {
6199 /* The GNU C library defines this for functions which it implements
6200     to always fail with ENOSYS.  Some functions are actually named
6201     something starting with __ and the normal name is an alias.  */
6202 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6203 choke me
6204 #else
6205 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6206 #endif
6207
6208   ;
6209   return 0;
6210 }
6211 _ACEOF
6212 rm -f conftest.$ac_objext conftest$ac_exeext
6213 if { (eval echo "$as_me:6213: \"$ac_link\"") >&5
6214   (eval $ac_link) 2>&5
6215   ac_status=$?
6216   echo "$as_me:6216: \$? = $ac_status" >&5
6217   (exit $ac_status); } &&
6218          { ac_try='test -s conftest$ac_exeext'
6219   { (eval echo "$as_me:6219: \"$ac_try\"") >&5
6220   (eval $ac_try) 2>&5
6221   ac_status=$?
6222   echo "$as_me:6222: \$? = $ac_status" >&5
6223   (exit $ac_status); }; }; then
6224   ac_cv_func_tgoto=yes
6225 else
6226   echo "$as_me: failed program was:" >&5
6227 cat conftest.$ac_ext >&5
6228 ac_cv_func_tgoto=no
6229 fi
6230 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6231 fi
6232 echo "$as_me:6232: result: $ac_cv_func_tgoto" >&5
6233 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6234 if test $ac_cv_func_tgoto = yes; then
6235   cf_term_lib=predefined
6236 else
6237
6238         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6239         do
6240             as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6241 echo "$as_me:6241: checking for tgoto in -l$cf_term_lib" >&5
6242 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6243 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6244   echo $ECHO_N "(cached) $ECHO_C" >&6
6245 else
6246   ac_check_lib_save_LIBS=$LIBS
6247 LIBS="-l$cf_term_lib  $LIBS"
6248 cat >conftest.$ac_ext <<_ACEOF
6249 #line 6249 "configure"
6250 #include "confdefs.h"
6251
6252 /* Override any gcc2 internal prototype to avoid an error.  */
6253 #ifdef __cplusplus
6254 extern "C"
6255 #endif
6256 /* We use char because int might match the return type of a gcc2
6257    builtin and then its argument prototype would still apply.  */
6258 char tgoto ();
6259 int
6260 main ()
6261 {
6262 tgoto ();
6263   ;
6264   return 0;
6265 }
6266 _ACEOF
6267 rm -f conftest.$ac_objext conftest$ac_exeext
6268 if { (eval echo "$as_me:6268: \"$ac_link\"") >&5
6269   (eval $ac_link) 2>&5
6270   ac_status=$?
6271   echo "$as_me:6271: \$? = $ac_status" >&5
6272   (exit $ac_status); } &&
6273          { ac_try='test -s conftest$ac_exeext'
6274   { (eval echo "$as_me:6274: \"$ac_try\"") >&5
6275   (eval $ac_try) 2>&5
6276   ac_status=$?
6277   echo "$as_me:6277: \$? = $ac_status" >&5
6278   (exit $ac_status); }; }; then
6279   eval "$as_ac_Lib=yes"
6280 else
6281   echo "$as_me: failed program was:" >&5
6282 cat conftest.$ac_ext >&5
6283 eval "$as_ac_Lib=no"
6284 fi
6285 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6286 LIBS=$ac_check_lib_save_LIBS
6287 fi
6288 echo "$as_me:6288: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6289 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6290 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6291   break
6292 fi
6293
6294         done
6295
6296 fi
6297
6298     # Check for library containing initscr
6299     test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6300         for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6301     do
6302         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
6303 echo "$as_me:6303: checking for initscr in -l$cf_curs_lib" >&5
6304 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
6305 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6306   echo $ECHO_N "(cached) $ECHO_C" >&6
6307 else
6308   ac_check_lib_save_LIBS=$LIBS
6309 LIBS="-l$cf_curs_lib  $LIBS"
6310 cat >conftest.$ac_ext <<_ACEOF
6311 #line 6311 "configure"
6312 #include "confdefs.h"
6313
6314 /* Override any gcc2 internal prototype to avoid an error.  */
6315 #ifdef __cplusplus
6316 extern "C"
6317 #endif
6318 /* We use char because int might match the return type of a gcc2
6319    builtin and then its argument prototype would still apply.  */
6320 char initscr ();
6321 int
6322 main ()
6323 {
6324 initscr ();
6325   ;
6326   return 0;
6327 }
6328 _ACEOF
6329 rm -f conftest.$ac_objext conftest$ac_exeext
6330 if { (eval echo "$as_me:6330: \"$ac_link\"") >&5
6331   (eval $ac_link) 2>&5
6332   ac_status=$?
6333   echo "$as_me:6333: \$? = $ac_status" >&5
6334   (exit $ac_status); } &&
6335          { ac_try='test -s conftest$ac_exeext'
6336   { (eval echo "$as_me:6336: \"$ac_try\"") >&5
6337   (eval $ac_try) 2>&5
6338   ac_status=$?
6339   echo "$as_me:6339: \$? = $ac_status" >&5
6340   (exit $ac_status); }; }; then
6341   eval "$as_ac_Lib=yes"
6342 else
6343   echo "$as_me: failed program was:" >&5
6344 cat conftest.$ac_ext >&5
6345 eval "$as_ac_Lib=no"
6346 fi
6347 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6348 LIBS=$ac_check_lib_save_LIBS
6349 fi
6350 echo "$as_me:6350: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6351 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6352 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6353   break
6354 fi
6355
6356     done
6357     test $cf_curs_lib = unknown && { { echo "$as_me:6357: error: no curses library found" >&5
6358 echo "$as_me: error: no curses library found" >&2;}
6359    { (exit 1); exit 1; }; }
6360
6361     LIBS="-l$cf_curs_lib $cf_save_LIBS"
6362     if test "$cf_term_lib" = unknown ; then
6363         echo "$as_me:6363: checking if we can link with $cf_curs_lib library" >&5
6364 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6365         cat >conftest.$ac_ext <<_ACEOF
6366 #line 6366 "configure"
6367 #include "confdefs.h"
6368 #include <${cf_cv_ncurses_header:-curses.h}>
6369 int
6370 main ()
6371 {
6372 initscr()
6373   ;
6374   return 0;
6375 }
6376 _ACEOF
6377 rm -f conftest.$ac_objext conftest$ac_exeext
6378 if { (eval echo "$as_me:6378: \"$ac_link\"") >&5
6379   (eval $ac_link) 2>&5
6380   ac_status=$?
6381   echo "$as_me:6381: \$? = $ac_status" >&5
6382   (exit $ac_status); } &&
6383          { ac_try='test -s conftest$ac_exeext'
6384   { (eval echo "$as_me:6384: \"$ac_try\"") >&5
6385   (eval $ac_try) 2>&5
6386   ac_status=$?
6387   echo "$as_me:6387: \$? = $ac_status" >&5
6388   (exit $ac_status); }; }; then
6389   cf_result=yes
6390 else
6391   echo "$as_me: failed program was:" >&5
6392 cat conftest.$ac_ext >&5
6393 cf_result=no
6394 fi
6395 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6396         echo "$as_me:6396: result: $cf_result" >&5
6397 echo "${ECHO_T}$cf_result" >&6
6398         test $cf_result = no && { { echo "$as_me:6398: error: Cannot link curses library" >&5
6399 echo "$as_me: error: Cannot link curses library" >&2;}
6400    { (exit 1); exit 1; }; }
6401     elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6402         :
6403     elif test "$cf_term_lib" != predefined ; then
6404         echo "$as_me:6404: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6405 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6406         cat >conftest.$ac_ext <<_ACEOF
6407 #line 6407 "configure"
6408 #include "confdefs.h"
6409 #include <${cf_cv_ncurses_header:-curses.h}>
6410 int
6411 main ()
6412 {
6413 initscr(); tgoto((char *)0, 0, 0);
6414   ;
6415   return 0;
6416 }
6417 _ACEOF
6418 rm -f conftest.$ac_objext conftest$ac_exeext
6419 if { (eval echo "$as_me:6419: \"$ac_link\"") >&5
6420   (eval $ac_link) 2>&5
6421   ac_status=$?
6422   echo "$as_me:6422: \$? = $ac_status" >&5
6423   (exit $ac_status); } &&
6424          { ac_try='test -s conftest$ac_exeext'
6425   { (eval echo "$as_me:6425: \"$ac_try\"") >&5
6426   (eval $ac_try) 2>&5
6427   ac_status=$?
6428   echo "$as_me:6428: \$? = $ac_status" >&5
6429   (exit $ac_status); }; }; then
6430   cf_result=no
6431 else
6432   echo "$as_me: failed program was:" >&5
6433 cat conftest.$ac_ext >&5
6434
6435             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6436             cat >conftest.$ac_ext <<_ACEOF
6437 #line 6437 "configure"
6438 #include "confdefs.h"
6439 #include <${cf_cv_ncurses_header:-curses.h}>
6440 int
6441 main ()
6442 {
6443 initscr()
6444   ;
6445   return 0;
6446 }
6447 _ACEOF
6448 rm -f conftest.$ac_objext conftest$ac_exeext
6449 if { (eval echo "$as_me:6449: \"$ac_link\"") >&5
6450   (eval $ac_link) 2>&5
6451   ac_status=$?
6452   echo "$as_me:6452: \$? = $ac_status" >&5
6453   (exit $ac_status); } &&
6454          { ac_try='test -s conftest$ac_exeext'
6455   { (eval echo "$as_me:6455: \"$ac_try\"") >&5
6456   (eval $ac_try) 2>&5
6457   ac_status=$?
6458   echo "$as_me:6458: \$? = $ac_status" >&5
6459   (exit $ac_status); }; }; then
6460   cf_result=yes
6461 else
6462   echo "$as_me: failed program was:" >&5
6463 cat conftest.$ac_ext >&5
6464 cf_result=error
6465 fi
6466 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6467
6468 fi
6469 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6470         echo "$as_me:6470: result: $cf_result" >&5
6471 echo "${ECHO_T}$cf_result" >&6
6472     fi
6473 fi
6474 fi
6475
6476         ;;
6477 ncurses) #(vi
6478
6479 cf_ncuconfig_root=ncurses
6480
6481 echo "Looking for ${cf_ncuconfig_root}-config"
6482
6483 if test -n "$ac_tool_prefix"; then
6484   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6485   do
6486     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6487 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6488 echo "$as_me:6488: checking for $ac_word" >&5
6489 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6490 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6491   echo $ECHO_N "(cached) $ECHO_C" >&6
6492 else
6493   if test -n "$NCURSES_CONFIG"; then
6494   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6495 else
6496   ac_save_IFS=$IFS; IFS=$ac_path_separator
6497 ac_dummy="$PATH"
6498 for ac_dir in $ac_dummy; do
6499   IFS=$ac_save_IFS
6500   test -z "$ac_dir" && ac_dir=.
6501   $as_executable_p "$ac_dir/$ac_word" || continue
6502 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6503 echo "$as_me:6503: found $ac_dir/$ac_word" >&5
6504 break
6505 done
6506
6507 fi
6508 fi
6509 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6510 if test -n "$NCURSES_CONFIG"; then
6511   echo "$as_me:6511: result: $NCURSES_CONFIG" >&5
6512 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6513 else
6514   echo "$as_me:6514: result: no" >&5
6515 echo "${ECHO_T}no" >&6
6516 fi
6517
6518     test -n "$NCURSES_CONFIG" && break
6519   done
6520 fi
6521 if test -z "$NCURSES_CONFIG"; then
6522   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6523   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6524 do
6525   # Extract the first word of "$ac_prog", so it can be a program name with args.
6526 set dummy $ac_prog; ac_word=$2
6527 echo "$as_me:6527: checking for $ac_word" >&5
6528 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6529 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6530   echo $ECHO_N "(cached) $ECHO_C" >&6
6531 else
6532   if test -n "$ac_ct_NCURSES_CONFIG"; then
6533   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6534 else
6535   ac_save_IFS=$IFS; IFS=$ac_path_separator
6536 ac_dummy="$PATH"
6537 for ac_dir in $ac_dummy; do
6538   IFS=$ac_save_IFS
6539   test -z "$ac_dir" && ac_dir=.
6540   $as_executable_p "$ac_dir/$ac_word" || continue
6541 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6542 echo "$as_me:6542: found $ac_dir/$ac_word" >&5
6543 break
6544 done
6545
6546 fi
6547 fi
6548 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6549 if test -n "$ac_ct_NCURSES_CONFIG"; then
6550   echo "$as_me:6550: result: $ac_ct_NCURSES_CONFIG" >&5
6551 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6552 else
6553   echo "$as_me:6553: result: no" >&5
6554 echo "${ECHO_T}no" >&6
6555 fi
6556
6557   test -n "$ac_ct_NCURSES_CONFIG" && break
6558 done
6559 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6560
6561   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6562 fi
6563
6564 if test "$NCURSES_CONFIG" != none ; then
6565
6566 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6567 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
6568
6569 # even with config script, some packages use no-override for curses.h
6570
6571 echo "$as_me:6571: checking if we have identified curses headers" >&5
6572 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6573 if test "${cf_cv_ncurses_header+set}" = set; then
6574   echo $ECHO_N "(cached) $ECHO_C" >&6
6575 else
6576
6577 cf_cv_ncurses_header=none
6578 for cf_header in  \
6579     ncurses/ncurses.h \
6580         ncurses/curses.h \
6581         ncurses.h \
6582         curses.h
6583 do
6584 cat >conftest.$ac_ext <<_ACEOF
6585 #line 6585 "configure"
6586 #include "confdefs.h"
6587 #include <${cf_header}>
6588 int
6589 main ()
6590 {
6591 initscr(); tgoto("?", 0,0)
6592   ;
6593   return 0;
6594 }
6595 _ACEOF
6596 rm -f conftest.$ac_objext
6597 if { (eval echo "$as_me:6597: \"$ac_compile\"") >&5
6598   (eval $ac_compile) 2>&5
6599   ac_status=$?
6600   echo "$as_me:6600: \$? = $ac_status" >&5
6601   (exit $ac_status); } &&
6602          { ac_try='test -s conftest.$ac_objext'
6603   { (eval echo "$as_me:6603: \"$ac_try\"") >&5
6604   (eval $ac_try) 2>&5
6605   ac_status=$?
6606   echo "$as_me:6606: \$? = $ac_status" >&5
6607   (exit $ac_status); }; }; then
6608   cf_cv_ncurses_header=$cf_header; break
6609 else
6610   echo "$as_me: failed program was:" >&5
6611 cat conftest.$ac_ext >&5
6612 fi
6613 rm -f conftest.$ac_objext conftest.$ac_ext
6614 done
6615
6616 fi
6617 echo "$as_me:6617: result: $cf_cv_ncurses_header" >&5
6618 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6619
6620 if test "$cf_cv_ncurses_header" = none ; then
6621         { { echo "$as_me:6621: error: No curses header-files found" >&5
6622 echo "$as_me: error: No curses header-files found" >&2;}
6623    { (exit 1); exit 1; }; }
6624 fi
6625
6626 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6627
6628 for ac_header in $cf_cv_ncurses_header
6629 do
6630 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6631 echo "$as_me:6631: checking for $ac_header" >&5
6632 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6633 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6634   echo $ECHO_N "(cached) $ECHO_C" >&6
6635 else
6636   cat >conftest.$ac_ext <<_ACEOF
6637 #line 6637 "configure"
6638 #include "confdefs.h"
6639 #include <$ac_header>
6640 _ACEOF
6641 if { (eval echo "$as_me:6641: \"$ac_cpp conftest.$ac_ext\"") >&5
6642   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6643   ac_status=$?
6644   egrep -v '^ *\+' conftest.er1 >conftest.err
6645   rm -f conftest.er1
6646   cat conftest.err >&5
6647   echo "$as_me:6647: \$? = $ac_status" >&5
6648   (exit $ac_status); } >/dev/null; then
6649   if test -s conftest.err; then
6650     ac_cpp_err=$ac_c_preproc_warn_flag
6651   else
6652     ac_cpp_err=
6653   fi
6654 else
6655   ac_cpp_err=yes
6656 fi
6657 if test -z "$ac_cpp_err"; then
6658   eval "$as_ac_Header=yes"
6659 else
6660   echo "$as_me: failed program was:" >&5
6661   cat conftest.$ac_ext >&5
6662   eval "$as_ac_Header=no"
6663 fi
6664 rm -f conftest.err conftest.$ac_ext
6665 fi
6666 echo "$as_me:6666: result: `eval echo '${'$as_ac_Header'}'`" >&5
6667 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6668 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6669   cat >>confdefs.h <<EOF
6670 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6671 EOF
6672
6673 fi
6674 done
6675
6676 cat >>confdefs.h <<\EOF
6677 #define NCURSES 1
6678 EOF
6679
6680 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6681
6682 cat >>confdefs.h <<EOF
6683 #define $cf_nculib_ROOT 1
6684 EOF
6685
6686 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6687
6688 else
6689
6690 cf_ncuhdr_root=ncurses
6691
6692 test -n "$cf_cv_curses_dir" && \
6693 test "$cf_cv_curses_dir" != "no" && { \
6694
6695 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6696   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6697   do
6698         while test $cf_add_incdir != /usr/include
6699         do
6700           if test -d $cf_add_incdir
6701           then
6702                 cf_have_incdir=no
6703                 if test -n "$CFLAGS$CPPFLAGS" ; then
6704                   # a loop is needed to ensure we can add subdirs of existing dirs
6705                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6706                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6707                           cf_have_incdir=yes; break
6708                         fi
6709                   done
6710                 fi
6711
6712                 if test "$cf_have_incdir" = no ; then
6713                   if test "$cf_add_incdir" = /usr/local/include ; then
6714                         if test "$GCC" = yes
6715                         then
6716                           cf_save_CPPFLAGS=$CPPFLAGS
6717                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6718                           cat >conftest.$ac_ext <<_ACEOF
6719 #line 6719 "configure"
6720 #include "confdefs.h"
6721 #include <stdio.h>
6722 int
6723 main ()
6724 {
6725 printf("Hello")
6726   ;
6727   return 0;
6728 }
6729 _ACEOF
6730 rm -f conftest.$ac_objext
6731 if { (eval echo "$as_me:6731: \"$ac_compile\"") >&5
6732   (eval $ac_compile) 2>&5
6733   ac_status=$?
6734   echo "$as_me:6734: \$? = $ac_status" >&5
6735   (exit $ac_status); } &&
6736          { ac_try='test -s conftest.$ac_objext'
6737   { (eval echo "$as_me:6737: \"$ac_try\"") >&5
6738   (eval $ac_try) 2>&5
6739   ac_status=$?
6740   echo "$as_me:6740: \$? = $ac_status" >&5
6741   (exit $ac_status); }; }; then
6742   :
6743 else
6744   echo "$as_me: failed program was:" >&5
6745 cat conftest.$ac_ext >&5
6746 cf_have_incdir=yes
6747 fi
6748 rm -f conftest.$ac_objext conftest.$ac_ext
6749                           CPPFLAGS=$cf_save_CPPFLAGS
6750                         fi
6751                   fi
6752                 fi
6753
6754                 if test "$cf_have_incdir" = no ; then
6755                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6756
6757 echo "${as_me:-configure}:6757: testing adding $cf_add_incdir to include-path ..." 1>&5
6758
6759                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6760
6761                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6762                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6763                   cf_add_incdir="$cf_top_incdir"
6764                 else
6765                   break
6766                 fi
6767           fi
6768         done
6769   done
6770 fi
6771
6772 }
6773
6774 echo "$as_me:6774: checking for $cf_ncuhdr_root header in include-path" >&5
6775 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6776 if test "${cf_cv_ncurses_h+set}" = set; then
6777   echo $ECHO_N "(cached) $ECHO_C" >&6
6778 else
6779
6780         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6781         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6782         for cf_header in $cf_header_list
6783         do
6784
6785         cat >conftest.$ac_ext <<_ACEOF
6786 #line 6786 "configure"
6787 #include "confdefs.h"
6788
6789 #include <$cf_header>
6790 int
6791 main ()
6792 {
6793
6794 #ifdef NCURSES_VERSION
6795
6796 printf("%s\n", NCURSES_VERSION);
6797 #else
6798 #ifdef __NCURSES_H
6799 printf("old\n");
6800 #else
6801         make an error
6802 #endif
6803 #endif
6804
6805   ;
6806   return 0;
6807 }
6808 _ACEOF
6809 rm -f conftest.$ac_objext
6810 if { (eval echo "$as_me:6810: \"$ac_compile\"") >&5
6811   (eval $ac_compile) 2>&5
6812   ac_status=$?
6813   echo "$as_me:6813: \$? = $ac_status" >&5
6814   (exit $ac_status); } &&
6815          { ac_try='test -s conftest.$ac_objext'
6816   { (eval echo "$as_me:6816: \"$ac_try\"") >&5
6817   (eval $ac_try) 2>&5
6818   ac_status=$?
6819   echo "$as_me:6819: \$? = $ac_status" >&5
6820   (exit $ac_status); }; }; then
6821   cf_cv_ncurses_h=$cf_header
6822
6823 else
6824   echo "$as_me: failed program was:" >&5
6825 cat conftest.$ac_ext >&5
6826 cf_cv_ncurses_h=no
6827 fi
6828 rm -f conftest.$ac_objext conftest.$ac_ext
6829
6830                 test "$cf_cv_ncurses_h" != no && break
6831         done
6832
6833 fi
6834 echo "$as_me:6834: result: $cf_cv_ncurses_h" >&5
6835 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6836
6837 if test "$cf_cv_ncurses_h" != no ; then
6838         cf_cv_ncurses_header=$cf_cv_ncurses_h
6839 else
6840
6841 echo "$as_me:6841: checking for $cf_ncuhdr_root include-path" >&5
6842 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6843 if test "${cf_cv_ncurses_h2+set}" = set; then
6844   echo $ECHO_N "(cached) $ECHO_C" >&6
6845 else
6846
6847         test -n "$verbose" && echo
6848
6849 cf_search=
6850
6851 # collect the current set of include-directories from compiler flags
6852 cf_header_path_list=""
6853 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6854         for cf_header_path in $CPPFLAGS $CFLAGS
6855         do
6856                 case $cf_header_path in #(vi
6857                 -I*)
6858                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6859
6860 test "$cf_header_path" != "NONE" && \
6861 test -d "$cf_header_path" && \
6862  {
6863         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6864         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6865         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6866         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6867         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6868         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"
6869 }
6870
6871                         cf_header_path_list="$cf_header_path_list $cf_search"
6872                         ;;
6873                 esac
6874         done
6875 fi
6876
6877 # add the variations for the package we are looking for
6878
6879 cf_search=
6880
6881 test "/usr" != "$prefix" && \
6882 test -d "/usr" && \
6883 (test $prefix = NONE || test "/usr" != "$prefix") && {
6884         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6885         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6886         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
6887         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
6888         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
6889         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6890 }
6891
6892 test "$prefix" != "NONE" && \
6893 test -d "$prefix" && \
6894  {
6895         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6896         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6897         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6898         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6899         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6900         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6901 }
6902
6903 test "/usr/local" != "$prefix" && \
6904 test -d "/usr/local" && \
6905 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6906         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
6907         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
6908         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
6909         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
6910         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
6911         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6912 }
6913
6914 test "/opt" != "$prefix" && \
6915 test -d "/opt" && \
6916 (test $prefix = NONE || test "/opt" != "$prefix") && {
6917         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
6918         test -d /opt/include &&          cf_search="$cf_search /opt/include"
6919         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
6920         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
6921         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
6922         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6923 }
6924
6925 test "$HOME" != "$prefix" && \
6926 test -d "$HOME" && \
6927 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6928         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
6929         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
6930         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
6931         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
6932         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
6933         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6934 }
6935
6936 test "$includedir" != NONE && \
6937 test "$includedir" != "/usr/include" && \
6938 test -d "$includedir" && {
6939         test -d $includedir &&    cf_search="$cf_search $includedir"
6940         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6941 }
6942
6943 test "$oldincludedir" != NONE && \
6944 test "$oldincludedir" != "/usr/include" && \
6945 test -d "$oldincludedir" && {
6946         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6947         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6948 }
6949
6950 cf_search="$cf_search $cf_header_path_list"
6951
6952         test -n "$verbose" && echo search path $cf_search
6953         cf_save2_CPPFLAGS="$CPPFLAGS"
6954         for cf_incdir in $cf_search
6955         do
6956
6957 if test -n "$cf_incdir" ; then
6958   for cf_add_incdir in $cf_incdir
6959   do
6960         while test $cf_add_incdir != /usr/include
6961         do
6962           if test -d $cf_add_incdir
6963           then
6964                 cf_have_incdir=no
6965                 if test -n "$CFLAGS$CPPFLAGS" ; then
6966                   # a loop is needed to ensure we can add subdirs of existing dirs
6967                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6968                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6969                           cf_have_incdir=yes; break
6970                         fi
6971                   done
6972                 fi
6973
6974                 if test "$cf_have_incdir" = no ; then
6975                   if test "$cf_add_incdir" = /usr/local/include ; then
6976                         if test "$GCC" = yes
6977                         then
6978                           cf_save_CPPFLAGS=$CPPFLAGS
6979                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6980                           cat >conftest.$ac_ext <<_ACEOF
6981 #line 6981 "configure"
6982 #include "confdefs.h"
6983 #include <stdio.h>
6984 int
6985 main ()
6986 {
6987 printf("Hello")
6988   ;
6989   return 0;
6990 }
6991 _ACEOF
6992 rm -f conftest.$ac_objext
6993 if { (eval echo "$as_me:6993: \"$ac_compile\"") >&5
6994   (eval $ac_compile) 2>&5
6995   ac_status=$?
6996   echo "$as_me:6996: \$? = $ac_status" >&5
6997   (exit $ac_status); } &&
6998          { ac_try='test -s conftest.$ac_objext'
6999   { (eval echo "$as_me:6999: \"$ac_try\"") >&5
7000   (eval $ac_try) 2>&5
7001   ac_status=$?
7002   echo "$as_me:7002: \$? = $ac_status" >&5
7003   (exit $ac_status); }; }; then
7004   :
7005 else
7006   echo "$as_me: failed program was:" >&5
7007 cat conftest.$ac_ext >&5
7008 cf_have_incdir=yes
7009 fi
7010 rm -f conftest.$ac_objext conftest.$ac_ext
7011                           CPPFLAGS=$cf_save_CPPFLAGS
7012                         fi
7013                   fi
7014                 fi
7015
7016                 if test "$cf_have_incdir" = no ; then
7017                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7018
7019 echo "${as_me:-configure}:7019: testing adding $cf_add_incdir to include-path ..." 1>&5
7020
7021                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7022
7023                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7024                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7025                   cf_add_incdir="$cf_top_incdir"
7026                 else
7027                   break
7028                 fi
7029           fi
7030         done
7031   done
7032 fi
7033
7034                 for cf_header in \
7035                         ncurses.h \
7036                         curses.h
7037                 do
7038
7039         cat >conftest.$ac_ext <<_ACEOF
7040 #line 7040 "configure"
7041 #include "confdefs.h"
7042
7043 #include <$cf_header>
7044 int
7045 main ()
7046 {
7047
7048 #ifdef NCURSES_VERSION
7049
7050 printf("%s\n", NCURSES_VERSION);
7051 #else
7052 #ifdef __NCURSES_H
7053 printf("old\n");
7054 #else
7055         make an error
7056 #endif
7057 #endif
7058
7059   ;
7060   return 0;
7061 }
7062 _ACEOF
7063 rm -f conftest.$ac_objext
7064 if { (eval echo "$as_me:7064: \"$ac_compile\"") >&5
7065   (eval $ac_compile) 2>&5
7066   ac_status=$?
7067   echo "$as_me:7067: \$? = $ac_status" >&5
7068   (exit $ac_status); } &&
7069          { ac_try='test -s conftest.$ac_objext'
7070   { (eval echo "$as_me:7070: \"$ac_try\"") >&5
7071   (eval $ac_try) 2>&5
7072   ac_status=$?
7073   echo "$as_me:7073: \$? = $ac_status" >&5
7074   (exit $ac_status); }; }; then
7075   cf_cv_ncurses_h2=$cf_header
7076
7077 else
7078   echo "$as_me: failed program was:" >&5
7079 cat conftest.$ac_ext >&5
7080 cf_cv_ncurses_h2=no
7081 fi
7082 rm -f conftest.$ac_objext conftest.$ac_ext
7083
7084                         if test "$cf_cv_ncurses_h2" != no ; then
7085                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7086                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7087                                 break
7088                         fi
7089                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7090                 done
7091                 CPPFLAGS="$cf_save2_CPPFLAGS"
7092                 test "$cf_cv_ncurses_h2" != no && break
7093         done
7094         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7094: error: not found" >&5
7095 echo "$as_me: error: not found" >&2;}
7096    { (exit 1); exit 1; }; }
7097
7098 fi
7099 echo "$as_me:7099: result: $cf_cv_ncurses_h2" >&5
7100 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7101
7102         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7103         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7104         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7105                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7106         fi
7107
7108 if test -n "$cf_1st_incdir" ; then
7109   for cf_add_incdir in $cf_1st_incdir
7110   do
7111         while test $cf_add_incdir != /usr/include
7112         do
7113           if test -d $cf_add_incdir
7114           then
7115                 cf_have_incdir=no
7116                 if test -n "$CFLAGS$CPPFLAGS" ; then
7117                   # a loop is needed to ensure we can add subdirs of existing dirs
7118                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7119                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7120                           cf_have_incdir=yes; break
7121                         fi
7122                   done
7123                 fi
7124
7125                 if test "$cf_have_incdir" = no ; then
7126                   if test "$cf_add_incdir" = /usr/local/include ; then
7127                         if test "$GCC" = yes
7128                         then
7129                           cf_save_CPPFLAGS=$CPPFLAGS
7130                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7131                           cat >conftest.$ac_ext <<_ACEOF
7132 #line 7132 "configure"
7133 #include "confdefs.h"
7134 #include <stdio.h>
7135 int
7136 main ()
7137 {
7138 printf("Hello")
7139   ;
7140   return 0;
7141 }
7142 _ACEOF
7143 rm -f conftest.$ac_objext
7144 if { (eval echo "$as_me:7144: \"$ac_compile\"") >&5
7145   (eval $ac_compile) 2>&5
7146   ac_status=$?
7147   echo "$as_me:7147: \$? = $ac_status" >&5
7148   (exit $ac_status); } &&
7149          { ac_try='test -s conftest.$ac_objext'
7150   { (eval echo "$as_me:7150: \"$ac_try\"") >&5
7151   (eval $ac_try) 2>&5
7152   ac_status=$?
7153   echo "$as_me:7153: \$? = $ac_status" >&5
7154   (exit $ac_status); }; }; then
7155   :
7156 else
7157   echo "$as_me: failed program was:" >&5
7158 cat conftest.$ac_ext >&5
7159 cf_have_incdir=yes
7160 fi
7161 rm -f conftest.$ac_objext conftest.$ac_ext
7162                           CPPFLAGS=$cf_save_CPPFLAGS
7163                         fi
7164                   fi
7165                 fi
7166
7167                 if test "$cf_have_incdir" = no ; then
7168                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7169
7170 echo "${as_me:-configure}:7170: testing adding $cf_add_incdir to include-path ..." 1>&5
7171
7172                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7173
7174                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7175                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7176                   cf_add_incdir="$cf_top_incdir"
7177                 else
7178                   break
7179                 fi
7180           fi
7181         done
7182   done
7183 fi
7184
7185 fi
7186
7187 # Set definitions to allow ifdef'ing for ncurses.h
7188
7189 case $cf_cv_ncurses_header in # (vi
7190 *ncurses.h)
7191         cat >>confdefs.h <<\EOF
7192 #define HAVE_NCURSES_H 1
7193 EOF
7194
7195         ;;
7196 esac
7197
7198 case $cf_cv_ncurses_header in # (vi
7199 ncurses/curses.h|ncurses/ncurses.h)
7200         cat >>confdefs.h <<\EOF
7201 #define HAVE_NCURSES_NCURSES_H 1
7202 EOF
7203
7204         ;;
7205 ncursesw/curses.h|ncursesw/ncurses.h)
7206         cat >>confdefs.h <<\EOF
7207 #define HAVE_NCURSESW_NCURSES_H 1
7208 EOF
7209
7210         ;;
7211 esac
7212
7213 echo "$as_me:7213: checking for terminfo header" >&5
7214 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7215 if test "${cf_cv_term_header+set}" = set; then
7216   echo $ECHO_N "(cached) $ECHO_C" >&6
7217 else
7218
7219 case ${cf_cv_ncurses_header} in #(vi
7220 */ncurses.h|*/ncursesw.h) #(vi
7221         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7222         ;;
7223 *)
7224         cf_term_header=term.h
7225         ;;
7226 esac
7227
7228 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7229 do
7230 cat >conftest.$ac_ext <<_ACEOF
7231 #line 7231 "configure"
7232 #include "confdefs.h"
7233 #include <stdio.h>
7234 #include <${cf_cv_ncurses_header:-curses.h}>
7235 #include <$cf_test>
7236
7237 int
7238 main ()
7239 {
7240 int x = auto_left_margin
7241   ;
7242   return 0;
7243 }
7244 _ACEOF
7245 rm -f conftest.$ac_objext
7246 if { (eval echo "$as_me:7246: \"$ac_compile\"") >&5
7247   (eval $ac_compile) 2>&5
7248   ac_status=$?
7249   echo "$as_me:7249: \$? = $ac_status" >&5
7250   (exit $ac_status); } &&
7251          { ac_try='test -s conftest.$ac_objext'
7252   { (eval echo "$as_me:7252: \"$ac_try\"") >&5
7253   (eval $ac_try) 2>&5
7254   ac_status=$?
7255   echo "$as_me:7255: \$? = $ac_status" >&5
7256   (exit $ac_status); }; }; then
7257
7258         cf_cv_term_header="$cf_test"
7259 else
7260   echo "$as_me: failed program was:" >&5
7261 cat conftest.$ac_ext >&5
7262
7263         cf_cv_term_header=unknown
7264
7265 fi
7266 rm -f conftest.$ac_objext conftest.$ac_ext
7267         test "$cf_cv_term_header" != unknown && break
7268 done
7269
7270 fi
7271 echo "$as_me:7271: result: $cf_cv_term_header" >&5
7272 echo "${ECHO_T}$cf_cv_term_header" >&6
7273
7274 # Set definitions to allow ifdef'ing to accommodate subdirectories
7275
7276 case $cf_cv_term_header in # (vi
7277 *term.h)
7278         cat >>confdefs.h <<\EOF
7279 #define HAVE_TERM_H 1
7280 EOF
7281
7282         ;;
7283 esac
7284
7285 case $cf_cv_term_header in # (vi
7286 ncurses/term.h) #(vi
7287         cat >>confdefs.h <<\EOF
7288 #define HAVE_NCURSES_TERM_H 1
7289 EOF
7290
7291         ;;
7292 ncursesw/term.h)
7293         cat >>confdefs.h <<\EOF
7294 #define HAVE_NCURSESW_TERM_H 1
7295 EOF
7296
7297         ;;
7298 esac
7299
7300 # some applications need this, but should check for NCURSES_VERSION
7301 cat >>confdefs.h <<\EOF
7302 #define NCURSES 1
7303 EOF
7304
7305 echo "$as_me:7305: checking for ncurses version" >&5
7306 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7307 if test "${cf_cv_ncurses_version+set}" = set; then
7308   echo $ECHO_N "(cached) $ECHO_C" >&6
7309 else
7310
7311         cf_cv_ncurses_version=no
7312         cf_tempfile=out$$
7313         rm -f $cf_tempfile
7314         if test "$cross_compiling" = yes; then
7315
7316         # This will not work if the preprocessor splits the line after the
7317         # Autoconf token.  The 'unproto' program does that.
7318         cat > conftest.$ac_ext <<EOF
7319 #include <${cf_cv_ncurses_header:-curses.h}>
7320 #undef Autoconf
7321 #ifdef NCURSES_VERSION
7322 Autoconf NCURSES_VERSION
7323 #else
7324 #ifdef __NCURSES_H
7325 Autoconf "old"
7326 #endif
7327 ;
7328 #endif
7329 EOF
7330         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7331         { (eval echo "$as_me:7331: \"$cf_try\"") >&5
7332   (eval $cf_try) 2>&5
7333   ac_status=$?
7334   echo "$as_me:7334: \$? = $ac_status" >&5
7335   (exit $ac_status); }
7336         if test -f conftest.out ; then
7337                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7338                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7339                 rm -f conftest.out
7340         fi
7341
7342 else
7343   cat >conftest.$ac_ext <<_ACEOF
7344 #line 7344 "configure"
7345 #include "confdefs.h"
7346
7347 #include <${cf_cv_ncurses_header:-curses.h}>
7348 #include <stdio.h>
7349 int main()
7350 {
7351         FILE *fp = fopen("$cf_tempfile", "w");
7352 #ifdef NCURSES_VERSION
7353 # ifdef NCURSES_VERSION_PATCH
7354         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7355 # else
7356         fprintf(fp, "%s\n", NCURSES_VERSION);
7357 # endif
7358 #else
7359 # ifdef __NCURSES_H
7360         fprintf(fp, "old\n");
7361 # else
7362         make an error
7363 # endif
7364 #endif
7365         ${cf_cv_main_return:-return}(0);
7366 }
7367 _ACEOF
7368 rm -f conftest$ac_exeext
7369 if { (eval echo "$as_me:7369: \"$ac_link\"") >&5
7370   (eval $ac_link) 2>&5
7371   ac_status=$?
7372   echo "$as_me:7372: \$? = $ac_status" >&5
7373   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7374   { (eval echo "$as_me:7374: \"$ac_try\"") >&5
7375   (eval $ac_try) 2>&5
7376   ac_status=$?
7377   echo "$as_me:7377: \$? = $ac_status" >&5
7378   (exit $ac_status); }; }; then
7379
7380         cf_cv_ncurses_version=`cat $cf_tempfile`
7381 else
7382   echo "$as_me: program exited with status $ac_status" >&5
7383 echo "$as_me: failed program was:" >&5
7384 cat conftest.$ac_ext >&5
7385 fi
7386 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7387 fi
7388         rm -f $cf_tempfile
7389
7390 fi
7391 echo "$as_me:7391: result: $cf_cv_ncurses_version" >&5
7392 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7393 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
7394 #define NCURSES 1
7395 EOF
7396
7397 cf_nculib_root=ncurses
7398         # This works, except for the special case where we find gpm, but
7399         # ncurses is in a nonstandard location via $LIBS, and we really want
7400         # to link gpm.
7401 cf_ncurses_LIBS=""
7402 cf_ncurses_SAVE="$LIBS"
7403 echo "$as_me:7403: checking for Gpm_Open in -lgpm" >&5
7404 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7405 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7406   echo $ECHO_N "(cached) $ECHO_C" >&6
7407 else
7408   ac_check_lib_save_LIBS=$LIBS
7409 LIBS="-lgpm  $LIBS"
7410 cat >conftest.$ac_ext <<_ACEOF
7411 #line 7411 "configure"
7412 #include "confdefs.h"
7413
7414 /* Override any gcc2 internal prototype to avoid an error.  */
7415 #ifdef __cplusplus
7416 extern "C"
7417 #endif
7418 /* We use char because int might match the return type of a gcc2
7419    builtin and then its argument prototype would still apply.  */
7420 char Gpm_Open ();
7421 int
7422 main ()
7423 {
7424 Gpm_Open ();
7425   ;
7426   return 0;
7427 }
7428 _ACEOF
7429 rm -f conftest.$ac_objext conftest$ac_exeext
7430 if { (eval echo "$as_me:7430: \"$ac_link\"") >&5
7431   (eval $ac_link) 2>&5
7432   ac_status=$?
7433   echo "$as_me:7433: \$? = $ac_status" >&5
7434   (exit $ac_status); } &&
7435          { ac_try='test -s conftest$ac_exeext'
7436   { (eval echo "$as_me:7436: \"$ac_try\"") >&5
7437   (eval $ac_try) 2>&5
7438   ac_status=$?
7439   echo "$as_me:7439: \$? = $ac_status" >&5
7440   (exit $ac_status); }; }; then
7441   ac_cv_lib_gpm_Gpm_Open=yes
7442 else
7443   echo "$as_me: failed program was:" >&5
7444 cat conftest.$ac_ext >&5
7445 ac_cv_lib_gpm_Gpm_Open=no
7446 fi
7447 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7448 LIBS=$ac_check_lib_save_LIBS
7449 fi
7450 echo "$as_me:7450: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7451 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7452 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7453   echo "$as_me:7453: checking for initscr in -lgpm" >&5
7454 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7455 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7456   echo $ECHO_N "(cached) $ECHO_C" >&6
7457 else
7458   ac_check_lib_save_LIBS=$LIBS
7459 LIBS="-lgpm  $LIBS"
7460 cat >conftest.$ac_ext <<_ACEOF
7461 #line 7461 "configure"
7462 #include "confdefs.h"
7463
7464 /* Override any gcc2 internal prototype to avoid an error.  */
7465 #ifdef __cplusplus
7466 extern "C"
7467 #endif
7468 /* We use char because int might match the return type of a gcc2
7469    builtin and then its argument prototype would still apply.  */
7470 char initscr ();
7471 int
7472 main ()
7473 {
7474 initscr ();
7475   ;
7476   return 0;
7477 }
7478 _ACEOF
7479 rm -f conftest.$ac_objext conftest$ac_exeext
7480 if { (eval echo "$as_me:7480: \"$ac_link\"") >&5
7481   (eval $ac_link) 2>&5
7482   ac_status=$?
7483   echo "$as_me:7483: \$? = $ac_status" >&5
7484   (exit $ac_status); } &&
7485          { ac_try='test -s conftest$ac_exeext'
7486   { (eval echo "$as_me:7486: \"$ac_try\"") >&5
7487   (eval $ac_try) 2>&5
7488   ac_status=$?
7489   echo "$as_me:7489: \$? = $ac_status" >&5
7490   (exit $ac_status); }; }; then
7491   ac_cv_lib_gpm_initscr=yes
7492 else
7493   echo "$as_me: failed program was:" >&5
7494 cat conftest.$ac_ext >&5
7495 ac_cv_lib_gpm_initscr=no
7496 fi
7497 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7498 LIBS=$ac_check_lib_save_LIBS
7499 fi
7500 echo "$as_me:7500: result: $ac_cv_lib_gpm_initscr" >&5
7501 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7502 if test $ac_cv_lib_gpm_initscr = yes; then
7503   LIBS="$cf_ncurses_SAVE"
7504 else
7505   cf_ncurses_LIBS="-lgpm"
7506 fi
7507
7508 fi
7509
7510 case $host_os in #(vi
7511 freebsd*)
7512         # This is only necessary if you are linking against an obsolete
7513         # version of ncurses (but it should do no harm, since it's static).
7514         if test "$cf_nculib_root" = ncurses ; then
7515                 echo "$as_me:7515: checking for tgoto in -lmytinfo" >&5
7516 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7517 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7518   echo $ECHO_N "(cached) $ECHO_C" >&6
7519 else
7520   ac_check_lib_save_LIBS=$LIBS
7521 LIBS="-lmytinfo  $LIBS"
7522 cat >conftest.$ac_ext <<_ACEOF
7523 #line 7523 "configure"
7524 #include "confdefs.h"
7525
7526 /* Override any gcc2 internal prototype to avoid an error.  */
7527 #ifdef __cplusplus
7528 extern "C"
7529 #endif
7530 /* We use char because int might match the return type of a gcc2
7531    builtin and then its argument prototype would still apply.  */
7532 char tgoto ();
7533 int
7534 main ()
7535 {
7536 tgoto ();
7537   ;
7538   return 0;
7539 }
7540 _ACEOF
7541 rm -f conftest.$ac_objext conftest$ac_exeext
7542 if { (eval echo "$as_me:7542: \"$ac_link\"") >&5
7543   (eval $ac_link) 2>&5
7544   ac_status=$?
7545   echo "$as_me:7545: \$? = $ac_status" >&5
7546   (exit $ac_status); } &&
7547          { ac_try='test -s conftest$ac_exeext'
7548   { (eval echo "$as_me:7548: \"$ac_try\"") >&5
7549   (eval $ac_try) 2>&5
7550   ac_status=$?
7551   echo "$as_me:7551: \$? = $ac_status" >&5
7552   (exit $ac_status); }; }; then
7553   ac_cv_lib_mytinfo_tgoto=yes
7554 else
7555   echo "$as_me: failed program was:" >&5
7556 cat conftest.$ac_ext >&5
7557 ac_cv_lib_mytinfo_tgoto=no
7558 fi
7559 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7560 LIBS=$ac_check_lib_save_LIBS
7561 fi
7562 echo "$as_me:7562: result: $ac_cv_lib_mytinfo_tgoto" >&5
7563 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7564 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7565   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7566 fi
7567
7568         fi
7569         ;;
7570 esac
7571
7572 LIBS="$cf_ncurses_LIBS $LIBS"
7573
7574 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7575 then
7576         LIBS="-l$cf_nculib_root $LIBS"
7577 else
7578
7579         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7580         cf_libdir=""
7581         echo "$as_me:7581: checking for initscr" >&5
7582 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7583 if test "${ac_cv_func_initscr+set}" = set; then
7584   echo $ECHO_N "(cached) $ECHO_C" >&6
7585 else
7586   cat >conftest.$ac_ext <<_ACEOF
7587 #line 7587 "configure"
7588 #include "confdefs.h"
7589 /* System header to define __stub macros and hopefully few prototypes,
7590     which can conflict with char initscr (); below.  */
7591 #include <assert.h>
7592 /* Override any gcc2 internal prototype to avoid an error.  */
7593 #ifdef __cplusplus
7594 extern "C"
7595 #endif
7596 /* We use char because int might match the return type of a gcc2
7597    builtin and then its argument prototype would still apply.  */
7598 char initscr ();
7599 char (*f) ();
7600
7601 int
7602 main ()
7603 {
7604 /* The GNU C library defines this for functions which it implements
7605     to always fail with ENOSYS.  Some functions are actually named
7606     something starting with __ and the normal name is an alias.  */
7607 #if defined (__stub_initscr) || defined (__stub___initscr)
7608 choke me
7609 #else
7610 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7611 #endif
7612
7613   ;
7614   return 0;
7615 }
7616 _ACEOF
7617 rm -f conftest.$ac_objext conftest$ac_exeext
7618 if { (eval echo "$as_me:7618: \"$ac_link\"") >&5
7619   (eval $ac_link) 2>&5
7620   ac_status=$?
7621   echo "$as_me:7621: \$? = $ac_status" >&5
7622   (exit $ac_status); } &&
7623          { ac_try='test -s conftest$ac_exeext'
7624   { (eval echo "$as_me:7624: \"$ac_try\"") >&5
7625   (eval $ac_try) 2>&5
7626   ac_status=$?
7627   echo "$as_me:7627: \$? = $ac_status" >&5
7628   (exit $ac_status); }; }; then
7629   ac_cv_func_initscr=yes
7630 else
7631   echo "$as_me: failed program was:" >&5
7632 cat conftest.$ac_ext >&5
7633 ac_cv_func_initscr=no
7634 fi
7635 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7636 fi
7637 echo "$as_me:7637: result: $ac_cv_func_initscr" >&5
7638 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7639 if test $ac_cv_func_initscr = yes; then
7640   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7641 else
7642
7643                 cf_save_LIBS="$LIBS"
7644                 echo "$as_me:7644: checking for initscr in -l$cf_nculib_root" >&5
7645 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7646                 LIBS="-l$cf_nculib_root $LIBS"
7647                 cat >conftest.$ac_ext <<_ACEOF
7648 #line 7648 "configure"
7649 #include "confdefs.h"
7650 #include <${cf_cv_ncurses_header:-curses.h}>
7651 int
7652 main ()
7653 {
7654 initscr()
7655   ;
7656   return 0;
7657 }
7658 _ACEOF
7659 rm -f conftest.$ac_objext conftest$ac_exeext
7660 if { (eval echo "$as_me:7660: \"$ac_link\"") >&5
7661   (eval $ac_link) 2>&5
7662   ac_status=$?
7663   echo "$as_me:7663: \$? = $ac_status" >&5
7664   (exit $ac_status); } &&
7665          { ac_try='test -s conftest$ac_exeext'
7666   { (eval echo "$as_me:7666: \"$ac_try\"") >&5
7667   (eval $ac_try) 2>&5
7668   ac_status=$?
7669   echo "$as_me:7669: \$? = $ac_status" >&5
7670   (exit $ac_status); }; }; then
7671   echo "$as_me:7671: result: yes" >&5
7672 echo "${ECHO_T}yes" >&6
7673                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7674
7675 else
7676   echo "$as_me: failed program was:" >&5
7677 cat conftest.$ac_ext >&5
7678 echo "$as_me:7678: result: no" >&5
7679 echo "${ECHO_T}no" >&6
7680
7681 cf_search=
7682 cf_library_path_list=""
7683 if test -n "${LDFLAGS}${LIBS}" ; then
7684         for cf_library_path in $LDFLAGS $LIBS
7685         do
7686                 case $cf_library_path in #(vi
7687                 -L*)
7688                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7689
7690 test "$cf_library_path" != "NONE" && \
7691 test -d "$cf_library_path" && \
7692  {
7693         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7694         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7695         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7696         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7697         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7698         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"
7699 }
7700
7701                         cf_library_path_list="$cf_library_path_list $cf_search"
7702                         ;;
7703                 esac
7704         done
7705 fi
7706
7707 cf_search=
7708
7709 test "/usr" != "$prefix" && \
7710 test -d "/usr" && \
7711 (test $prefix = NONE || test "/usr" != "$prefix") && {
7712         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7713         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7714         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
7715         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
7716         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
7717         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
7718 }
7719
7720 test "$prefix" != "NONE" && \
7721 test -d "$prefix" && \
7722  {
7723         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7724         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7725         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7726         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7727         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7728         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7729 }
7730
7731 test "/usr/local" != "$prefix" && \
7732 test -d "/usr/local" && \
7733 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7734         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7735         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7736         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
7737         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
7738         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
7739         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
7740 }
7741
7742 test "/opt" != "$prefix" && \
7743 test -d "/opt" && \
7744 (test $prefix = NONE || test "/opt" != "$prefix") && {
7745         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7746         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7747         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
7748         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
7749         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
7750         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
7751 }
7752
7753 test "$HOME" != "$prefix" && \
7754 test -d "$HOME" && \
7755 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7756         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7757         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7758         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
7759         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
7760         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
7761         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
7762 }
7763
7764 cf_search="$cf_library_path_list $cf_search"
7765
7766                         for cf_libdir in $cf_search
7767                         do
7768                                 echo "$as_me:7768: checking for -l$cf_nculib_root in $cf_libdir" >&5
7769 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7770                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7771                                 cat >conftest.$ac_ext <<_ACEOF
7772 #line 7772 "configure"
7773 #include "confdefs.h"
7774 #include <${cf_cv_ncurses_header:-curses.h}>
7775 int
7776 main ()
7777 {
7778 initscr()
7779   ;
7780   return 0;
7781 }
7782 _ACEOF
7783 rm -f conftest.$ac_objext conftest$ac_exeext
7784 if { (eval echo "$as_me:7784: \"$ac_link\"") >&5
7785   (eval $ac_link) 2>&5
7786   ac_status=$?
7787   echo "$as_me:7787: \$? = $ac_status" >&5
7788   (exit $ac_status); } &&
7789          { ac_try='test -s conftest$ac_exeext'
7790   { (eval echo "$as_me:7790: \"$ac_try\"") >&5
7791   (eval $ac_try) 2>&5
7792   ac_status=$?
7793   echo "$as_me:7793: \$? = $ac_status" >&5
7794   (exit $ac_status); }; }; then
7795   echo "$as_me:7795: result: yes" >&5
7796 echo "${ECHO_T}yes" >&6
7797                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7798                                          break
7799 else
7800   echo "$as_me: failed program was:" >&5
7801 cat conftest.$ac_ext >&5
7802 echo "$as_me:7802: result: no" >&5
7803 echo "${ECHO_T}no" >&6
7804                                          LIBS="$cf_save_LIBS"
7805 fi
7806 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7807                         done
7808
7809 fi
7810 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7811
7812 fi
7813
7814 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7815
7816 if test $cf_found_library = no ; then
7817         { { echo "$as_me:7817: error: Cannot link $cf_nculib_root library" >&5
7818 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7819    { (exit 1); exit 1; }; }
7820 fi
7821
7822 fi
7823
7824 if test -n "$cf_ncurses_LIBS" ; then
7825         echo "$as_me:7825: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7826 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7827         cf_ncurses_SAVE="$LIBS"
7828         for p in $cf_ncurses_LIBS ; do
7829                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7830                 if test "$q" != "$LIBS" ; then
7831                         LIBS="$q"
7832                 fi
7833         done
7834         cat >conftest.$ac_ext <<_ACEOF
7835 #line 7835 "configure"
7836 #include "confdefs.h"
7837 #include <${cf_cv_ncurses_header:-curses.h}>
7838 int
7839 main ()
7840 {
7841 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7842   ;
7843   return 0;
7844 }
7845 _ACEOF
7846 rm -f conftest.$ac_objext conftest$ac_exeext
7847 if { (eval echo "$as_me:7847: \"$ac_link\"") >&5
7848   (eval $ac_link) 2>&5
7849   ac_status=$?
7850   echo "$as_me:7850: \$? = $ac_status" >&5
7851   (exit $ac_status); } &&
7852          { ac_try='test -s conftest$ac_exeext'
7853   { (eval echo "$as_me:7853: \"$ac_try\"") >&5
7854   (eval $ac_try) 2>&5
7855   ac_status=$?
7856   echo "$as_me:7856: \$? = $ac_status" >&5
7857   (exit $ac_status); }; }; then
7858   echo "$as_me:7858: result: yes" >&5
7859 echo "${ECHO_T}yes" >&6
7860 else
7861   echo "$as_me: failed program was:" >&5
7862 cat conftest.$ac_ext >&5
7863 echo "$as_me:7863: result: no" >&5
7864 echo "${ECHO_T}no" >&6
7865                  LIBS="$cf_ncurses_SAVE"
7866 fi
7867 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7868 fi
7869
7870 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7871
7872 cat >>confdefs.h <<EOF
7873 #define $cf_nculib_ROOT 1
7874 EOF
7875
7876 fi
7877
7878         ;;
7879 ncursesw) #(vi
7880
7881 echo "$as_me:7881: checking for multibyte character support" >&5
7882 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7883 if test "${cf_cv_utf8_lib+set}" = set; then
7884   echo $ECHO_N "(cached) $ECHO_C" >&6
7885 else
7886
7887         cf_save_LIBS="$LIBS"
7888         cat >conftest.$ac_ext <<_ACEOF
7889 #line 7889 "configure"
7890 #include "confdefs.h"
7891
7892 #include <stdlib.h>
7893 int
7894 main ()
7895 {
7896 putwc(0,0);
7897   ;
7898   return 0;
7899 }
7900 _ACEOF
7901 rm -f conftest.$ac_objext conftest$ac_exeext
7902 if { (eval echo "$as_me:7902: \"$ac_link\"") >&5
7903   (eval $ac_link) 2>&5
7904   ac_status=$?
7905   echo "$as_me:7905: \$? = $ac_status" >&5
7906   (exit $ac_status); } &&
7907          { ac_try='test -s conftest$ac_exeext'
7908   { (eval echo "$as_me:7908: \"$ac_try\"") >&5
7909   (eval $ac_try) 2>&5
7910   ac_status=$?
7911   echo "$as_me:7911: \$? = $ac_status" >&5
7912   (exit $ac_status); }; }; then
7913   cf_cv_utf8_lib=yes
7914 else
7915   echo "$as_me: failed program was:" >&5
7916 cat conftest.$ac_ext >&5
7917
7918 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7919 # will be set on completion of the AC_TRY_LINK below.
7920 cf_cv_header_path_utf8=
7921 cf_cv_library_path_utf8=
7922
7923 echo "${as_me:-configure}:7923: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7924
7925 cf_save_LIBS="$LIBS"
7926
7927 cat >conftest.$ac_ext <<_ACEOF
7928 #line 7928 "configure"
7929 #include "confdefs.h"
7930
7931 #include <libutf8.h>
7932 int
7933 main ()
7934 {
7935 putwc(0,0);
7936   ;
7937   return 0;
7938 }
7939 _ACEOF
7940 rm -f conftest.$ac_objext conftest$ac_exeext
7941 if { (eval echo "$as_me:7941: \"$ac_link\"") >&5
7942   (eval $ac_link) 2>&5
7943   ac_status=$?
7944   echo "$as_me:7944: \$? = $ac_status" >&5
7945   (exit $ac_status); } &&
7946          { ac_try='test -s conftest$ac_exeext'
7947   { (eval echo "$as_me:7947: \"$ac_try\"") >&5
7948   (eval $ac_try) 2>&5
7949   ac_status=$?
7950   echo "$as_me:7950: \$? = $ac_status" >&5
7951   (exit $ac_status); }; }; then
7952
7953         cf_cv_find_linkage_utf8=yes
7954         cf_cv_header_path_utf8=/usr/include
7955         cf_cv_library_path_utf8=/usr/lib
7956
7957 else
7958   echo "$as_me: failed program was:" >&5
7959 cat conftest.$ac_ext >&5
7960
7961 LIBS="-lutf8  $cf_save_LIBS"
7962
7963 cat >conftest.$ac_ext <<_ACEOF
7964 #line 7964 "configure"
7965 #include "confdefs.h"
7966
7967 #include <libutf8.h>
7968 int
7969 main ()
7970 {
7971 putwc(0,0);
7972   ;
7973   return 0;
7974 }
7975 _ACEOF
7976 rm -f conftest.$ac_objext conftest$ac_exeext
7977 if { (eval echo "$as_me:7977: \"$ac_link\"") >&5
7978   (eval $ac_link) 2>&5
7979   ac_status=$?
7980   echo "$as_me:7980: \$? = $ac_status" >&5
7981   (exit $ac_status); } &&
7982          { ac_try='test -s conftest$ac_exeext'
7983   { (eval echo "$as_me:7983: \"$ac_try\"") >&5
7984   (eval $ac_try) 2>&5
7985   ac_status=$?
7986   echo "$as_me:7986: \$? = $ac_status" >&5
7987   (exit $ac_status); }; }; then
7988
7989         cf_cv_find_linkage_utf8=yes
7990         cf_cv_header_path_utf8=/usr/include
7991         cf_cv_library_path_utf8=/usr/lib
7992         cf_cv_library_file_utf8="-lutf8"
7993
7994 else
7995   echo "$as_me: failed program was:" >&5
7996 cat conftest.$ac_ext >&5
7997
7998         cf_cv_find_linkage_utf8=no
7999         LIBS="$cf_save_LIBS"
8000
8001     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
8002
8003 echo "${as_me:-configure}:8003: testing find linkage for utf8 library ..." 1>&5
8004
8005 echo "${as_me:-configure}:8005: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
8006
8007     cf_save_CPPFLAGS="$CPPFLAGS"
8008     cf_test_CPPFLAGS="$CPPFLAGS"
8009
8010 cf_search=
8011
8012 # collect the current set of include-directories from compiler flags
8013 cf_header_path_list=""
8014 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8015         for cf_header_path in $CPPFLAGS $CFLAGS
8016         do
8017                 case $cf_header_path in #(vi
8018                 -I*)
8019                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8020
8021 test "$cf_header_path" != "NONE" && \
8022 test -d "$cf_header_path" && \
8023  {
8024         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8025         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8026         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
8027         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
8028         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
8029         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
8030 }
8031
8032                         cf_header_path_list="$cf_header_path_list $cf_search"
8033                         ;;
8034                 esac
8035         done
8036 fi
8037
8038 # add the variations for the package we are looking for
8039
8040 cf_search=
8041
8042 test "/usr" != "$prefix" && \
8043 test -d "/usr" && \
8044 (test $prefix = NONE || test "/usr" != "$prefix") && {
8045         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
8046         test -d /usr/include &&          cf_search="$cf_search /usr/include"
8047         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
8048         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
8049         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
8050         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
8051 }
8052
8053 test "$prefix" != "NONE" && \
8054 test -d "$prefix" && \
8055  {
8056         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8057         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8058         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
8059         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
8060         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
8061         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
8062 }
8063
8064 test "/usr/local" != "$prefix" && \
8065 test -d "/usr/local" && \
8066 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8067         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
8068         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
8069         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
8070         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
8071         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
8072         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
8073 }
8074
8075 test "/opt" != "$prefix" && \
8076 test -d "/opt" && \
8077 (test $prefix = NONE || test "/opt" != "$prefix") && {
8078         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
8079         test -d /opt/include &&          cf_search="$cf_search /opt/include"
8080         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
8081         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
8082         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
8083         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
8084 }
8085
8086 test "$HOME" != "$prefix" && \
8087 test -d "$HOME" && \
8088 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8089         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
8090         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
8091         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
8092         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
8093         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
8094         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
8095 }
8096
8097 test "$includedir" != NONE && \
8098 test "$includedir" != "/usr/include" && \
8099 test -d "$includedir" && {
8100         test -d $includedir &&    cf_search="$cf_search $includedir"
8101         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
8102 }
8103
8104 test "$oldincludedir" != NONE && \
8105 test "$oldincludedir" != "/usr/include" && \
8106 test -d "$oldincludedir" && {
8107         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8108         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
8109 }
8110
8111 cf_search="$cf_search $cf_header_path_list"
8112
8113     for cf_cv_header_path_utf8 in $cf_search
8114     do
8115       if test -d $cf_cv_header_path_utf8 ; then
8116         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
8117
8118 echo "${as_me:-configure}:8118: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
8119
8120         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
8121         cat >conftest.$ac_ext <<_ACEOF
8122 #line 8122 "configure"
8123 #include "confdefs.h"
8124
8125 #include <libutf8.h>
8126 int
8127 main ()
8128 {
8129 putwc(0,0);
8130   ;
8131   return 0;
8132 }
8133 _ACEOF
8134 rm -f conftest.$ac_objext
8135 if { (eval echo "$as_me:8135: \"$ac_compile\"") >&5
8136   (eval $ac_compile) 2>&5
8137   ac_status=$?
8138   echo "$as_me:8138: \$? = $ac_status" >&5
8139   (exit $ac_status); } &&
8140          { ac_try='test -s conftest.$ac_objext'
8141   { (eval echo "$as_me:8141: \"$ac_try\"") >&5
8142   (eval $ac_try) 2>&5
8143   ac_status=$?
8144   echo "$as_me:8144: \$? = $ac_status" >&5
8145   (exit $ac_status); }; }; then
8146
8147             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
8148
8149 echo "${as_me:-configure}:8149: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
8150
8151             cf_cv_find_linkage_utf8=maybe
8152             cf_test_CPPFLAGS="$CPPFLAGS"
8153             break
8154 else
8155   echo "$as_me: failed program was:" >&5
8156 cat conftest.$ac_ext >&5
8157
8158             CPPFLAGS="$cf_save_CPPFLAGS"
8159
8160 fi
8161 rm -f conftest.$ac_objext conftest.$ac_ext
8162       fi
8163     done
8164
8165     if test "$cf_cv_find_linkage_utf8" = maybe ; then
8166
8167 echo "${as_me:-configure}:8167: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
8168
8169       cf_save_LIBS="$LIBS"
8170       cf_save_LDFLAGS="$LDFLAGS"
8171
8172       if test "$cf_cv_find_linkage_utf8" != yes ; then
8173
8174 cf_search=
8175 cf_library_path_list=""
8176 if test -n "${LDFLAGS}${LIBS}" ; then
8177         for cf_library_path in $LDFLAGS $LIBS
8178         do
8179                 case $cf_library_path in #(vi
8180                 -L*)
8181                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8182
8183 test "$cf_library_path" != "NONE" && \
8184 test -d "$cf_library_path" && \
8185  {
8186         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8187         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8188         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
8189         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
8190         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
8191         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
8192 }
8193
8194                         cf_library_path_list="$cf_library_path_list $cf_search"
8195                         ;;
8196                 esac
8197         done
8198 fi
8199
8200 cf_search=
8201
8202 test "/usr" != "$prefix" && \
8203 test -d "/usr" && \
8204 (test $prefix = NONE || test "/usr" != "$prefix") && {
8205         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
8206         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
8207         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
8208         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
8209         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
8210         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
8211 }
8212
8213 test "$prefix" != "NONE" && \
8214 test -d "$prefix" && \
8215  {
8216         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8217         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8218         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
8219         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
8220         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
8221         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
8222 }
8223
8224 test "/usr/local" != "$prefix" && \
8225 test -d "/usr/local" && \
8226 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8227         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
8228         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
8229         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
8230         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
8231         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
8232         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
8233 }
8234
8235 test "/opt" != "$prefix" && \
8236 test -d "/opt" && \
8237 (test $prefix = NONE || test "/opt" != "$prefix") && {
8238         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
8239         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
8240         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
8241         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
8242         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
8243         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
8244 }
8245
8246 test "$HOME" != "$prefix" && \
8247 test -d "$HOME" && \
8248 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8249         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
8250         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
8251         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
8252         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
8253         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
8254         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
8255 }
8256
8257 cf_search="$cf_library_path_list $cf_search"
8258
8259         for cf_cv_library_path_utf8 in $cf_search
8260         do
8261           if test -d $cf_cv_library_path_utf8 ; then
8262             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
8263
8264 echo "${as_me:-configure}:8264: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
8265
8266             CPPFLAGS="$cf_test_CPPFLAGS"
8267             LIBS="-lutf8  $cf_save_LIBS"
8268             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
8269             cat >conftest.$ac_ext <<_ACEOF
8270 #line 8270 "configure"
8271 #include "confdefs.h"
8272
8273 #include <libutf8.h>
8274 int
8275 main ()
8276 {
8277 putwc(0,0);
8278   ;
8279   return 0;
8280 }
8281 _ACEOF
8282 rm -f conftest.$ac_objext conftest$ac_exeext
8283 if { (eval echo "$as_me:8283: \"$ac_link\"") >&5
8284   (eval $ac_link) 2>&5
8285   ac_status=$?
8286   echo "$as_me:8286: \$? = $ac_status" >&5
8287   (exit $ac_status); } &&
8288          { ac_try='test -s conftest$ac_exeext'
8289   { (eval echo "$as_me:8289: \"$ac_try\"") >&5
8290   (eval $ac_try) 2>&5
8291   ac_status=$?
8292   echo "$as_me:8292: \$? = $ac_status" >&5
8293   (exit $ac_status); }; }; then
8294
8295                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
8296
8297 echo "${as_me:-configure}:8297: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
8298
8299                 cf_cv_find_linkage_utf8=yes
8300                 cf_cv_library_file_utf8="-lutf8"
8301                 break
8302 else
8303   echo "$as_me: failed program was:" >&5
8304 cat conftest.$ac_ext >&5
8305
8306                 CPPFLAGS="$cf_save_CPPFLAGS"
8307                 LIBS="$cf_save_LIBS"
8308                 LDFLAGS="$cf_save_LDFLAGS"
8309
8310 fi
8311 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8312           fi
8313         done
8314         CPPFLAGS="$cf_save_CPPFLAGS"
8315         LDFLAGS="$cf_save_LDFLAGS"
8316       fi
8317
8318     else
8319       cf_cv_find_linkage_utf8=no
8320     fi
8321
8322 fi
8323 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8324
8325 fi
8326 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8327
8328 LIBS="$cf_save_LIBS"
8329
8330 if test "$cf_cv_find_linkage_utf8" = yes ; then
8331 cf_cv_utf8_lib=add-on
8332 else
8333 cf_cv_utf8_lib=no
8334 fi
8335
8336 fi
8337 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8338 fi
8339 echo "$as_me:8339: result: $cf_cv_utf8_lib" >&5
8340 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
8341
8342 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
8343 # ncurses/ncursesw:
8344 if test "$cf_cv_utf8_lib" = "add-on" ; then
8345         cat >>confdefs.h <<\EOF
8346 #define HAVE_LIBUTF8_H 1
8347 EOF
8348
8349 if test -n "$cf_cv_header_path_utf8" ; then
8350   for cf_add_incdir in $cf_cv_header_path_utf8
8351   do
8352         while test $cf_add_incdir != /usr/include
8353         do
8354           if test -d $cf_add_incdir
8355           then
8356                 cf_have_incdir=no
8357                 if test -n "$CFLAGS$CPPFLAGS" ; then
8358                   # a loop is needed to ensure we can add subdirs of existing dirs
8359                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8360                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8361                           cf_have_incdir=yes; break
8362                         fi
8363                   done
8364                 fi
8365
8366                 if test "$cf_have_incdir" = no ; then
8367                   if test "$cf_add_incdir" = /usr/local/include ; then
8368                         if test "$GCC" = yes
8369                         then
8370                           cf_save_CPPFLAGS=$CPPFLAGS
8371                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8372                           cat >conftest.$ac_ext <<_ACEOF
8373 #line 8373 "configure"
8374 #include "confdefs.h"
8375 #include <stdio.h>
8376 int
8377 main ()
8378 {
8379 printf("Hello")
8380   ;
8381   return 0;
8382 }
8383 _ACEOF
8384 rm -f conftest.$ac_objext
8385 if { (eval echo "$as_me:8385: \"$ac_compile\"") >&5
8386   (eval $ac_compile) 2>&5
8387   ac_status=$?
8388   echo "$as_me:8388: \$? = $ac_status" >&5
8389   (exit $ac_status); } &&
8390          { ac_try='test -s conftest.$ac_objext'
8391   { (eval echo "$as_me:8391: \"$ac_try\"") >&5
8392   (eval $ac_try) 2>&5
8393   ac_status=$?
8394   echo "$as_me:8394: \$? = $ac_status" >&5
8395   (exit $ac_status); }; }; then
8396   :
8397 else
8398   echo "$as_me: failed program was:" >&5
8399 cat conftest.$ac_ext >&5
8400 cf_have_incdir=yes
8401 fi
8402 rm -f conftest.$ac_objext conftest.$ac_ext
8403                           CPPFLAGS=$cf_save_CPPFLAGS
8404                         fi
8405                   fi
8406                 fi
8407
8408                 if test "$cf_have_incdir" = no ; then
8409                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8410
8411 echo "${as_me:-configure}:8411: testing adding $cf_add_incdir to include-path ..." 1>&5
8412
8413                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8414
8415                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8416                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8417                   cf_add_incdir="$cf_top_incdir"
8418                 else
8419                   break
8420                 fi
8421           fi
8422         done
8423   done
8424 fi
8425
8426 if test -n "$cf_cv_library_path_utf8" ; then
8427   for cf_add_libdir in $cf_cv_library_path_utf8
8428   do
8429     if test $cf_add_libdir = /usr/lib ; then
8430       :
8431     elif test -d $cf_add_libdir
8432     then
8433       cf_have_libdir=no
8434       if test -n "$LDFLAGS$LIBS" ; then
8435         # a loop is needed to ensure we can add subdirs of existing dirs
8436         for cf_test_libdir in $LDFLAGS $LIBS ; do
8437           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
8438             cf_have_libdir=yes; break
8439           fi
8440         done
8441       fi
8442       if test "$cf_have_libdir" = no ; then
8443         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
8444
8445 echo "${as_me:-configure}:8445: testing adding $cf_add_libdir to library-path ..." 1>&5
8446
8447         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
8448       fi
8449     fi
8450   done
8451 fi
8452
8453         LIBS="$cf_cv_library_file_utf8 $LIBS"
8454 fi
8455
8456 cf_ncuconfig_root=ncursesw
8457
8458 echo "Looking for ${cf_ncuconfig_root}-config"
8459
8460 if test -n "$ac_tool_prefix"; then
8461   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8462   do
8463     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8464 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8465 echo "$as_me:8465: checking for $ac_word" >&5
8466 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8467 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8468   echo $ECHO_N "(cached) $ECHO_C" >&6
8469 else
8470   if test -n "$NCURSES_CONFIG"; then
8471   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8472 else
8473   ac_save_IFS=$IFS; IFS=$ac_path_separator
8474 ac_dummy="$PATH"
8475 for ac_dir in $ac_dummy; do
8476   IFS=$ac_save_IFS
8477   test -z "$ac_dir" && ac_dir=.
8478   $as_executable_p "$ac_dir/$ac_word" || continue
8479 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8480 echo "$as_me:8480: found $ac_dir/$ac_word" >&5
8481 break
8482 done
8483
8484 fi
8485 fi
8486 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8487 if test -n "$NCURSES_CONFIG"; then
8488   echo "$as_me:8488: result: $NCURSES_CONFIG" >&5
8489 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8490 else
8491   echo "$as_me:8491: result: no" >&5
8492 echo "${ECHO_T}no" >&6
8493 fi
8494
8495     test -n "$NCURSES_CONFIG" && break
8496   done
8497 fi
8498 if test -z "$NCURSES_CONFIG"; then
8499   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8500   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8501 do
8502   # Extract the first word of "$ac_prog", so it can be a program name with args.
8503 set dummy $ac_prog; ac_word=$2
8504 echo "$as_me:8504: checking for $ac_word" >&5
8505 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8506 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8507   echo $ECHO_N "(cached) $ECHO_C" >&6
8508 else
8509   if test -n "$ac_ct_NCURSES_CONFIG"; then
8510   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8511 else
8512   ac_save_IFS=$IFS; IFS=$ac_path_separator
8513 ac_dummy="$PATH"
8514 for ac_dir in $ac_dummy; do
8515   IFS=$ac_save_IFS
8516   test -z "$ac_dir" && ac_dir=.
8517   $as_executable_p "$ac_dir/$ac_word" || continue
8518 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8519 echo "$as_me:8519: found $ac_dir/$ac_word" >&5
8520 break
8521 done
8522
8523 fi
8524 fi
8525 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8526 if test -n "$ac_ct_NCURSES_CONFIG"; then
8527   echo "$as_me:8527: result: $ac_ct_NCURSES_CONFIG" >&5
8528 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8529 else
8530   echo "$as_me:8530: result: no" >&5
8531 echo "${ECHO_T}no" >&6
8532 fi
8533
8534   test -n "$ac_ct_NCURSES_CONFIG" && break
8535 done
8536 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8537
8538   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8539 fi
8540
8541 if test "$NCURSES_CONFIG" != none ; then
8542
8543 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8544 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
8545
8546 # even with config script, some packages use no-override for curses.h
8547
8548 echo "$as_me:8548: checking if we have identified curses headers" >&5
8549 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8550 if test "${cf_cv_ncurses_header+set}" = set; then
8551   echo $ECHO_N "(cached) $ECHO_C" >&6
8552 else
8553
8554 cf_cv_ncurses_header=none
8555 for cf_header in  \
8556     ncursesw/ncurses.h \
8557         ncursesw/curses.h \
8558         ncurses.h \
8559         curses.h
8560 do
8561 cat >conftest.$ac_ext <<_ACEOF
8562 #line 8562 "configure"
8563 #include "confdefs.h"
8564 #include <${cf_header}>
8565 int
8566 main ()
8567 {
8568 initscr(); tgoto("?", 0,0)
8569   ;
8570   return 0;
8571 }
8572 _ACEOF
8573 rm -f conftest.$ac_objext
8574 if { (eval echo "$as_me:8574: \"$ac_compile\"") >&5
8575   (eval $ac_compile) 2>&5
8576   ac_status=$?
8577   echo "$as_me:8577: \$? = $ac_status" >&5
8578   (exit $ac_status); } &&
8579          { ac_try='test -s conftest.$ac_objext'
8580   { (eval echo "$as_me:8580: \"$ac_try\"") >&5
8581   (eval $ac_try) 2>&5
8582   ac_status=$?
8583   echo "$as_me:8583: \$? = $ac_status" >&5
8584   (exit $ac_status); }; }; then
8585   cf_cv_ncurses_header=$cf_header; break
8586 else
8587   echo "$as_me: failed program was:" >&5
8588 cat conftest.$ac_ext >&5
8589 fi
8590 rm -f conftest.$ac_objext conftest.$ac_ext
8591 done
8592
8593 fi
8594 echo "$as_me:8594: result: $cf_cv_ncurses_header" >&5
8595 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8596
8597 if test "$cf_cv_ncurses_header" = none ; then
8598         { { echo "$as_me:8598: error: No curses header-files found" >&5
8599 echo "$as_me: error: No curses header-files found" >&2;}
8600    { (exit 1); exit 1; }; }
8601 fi
8602
8603 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8604
8605 for ac_header in $cf_cv_ncurses_header
8606 do
8607 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8608 echo "$as_me:8608: checking for $ac_header" >&5
8609 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8610 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8611   echo $ECHO_N "(cached) $ECHO_C" >&6
8612 else
8613   cat >conftest.$ac_ext <<_ACEOF
8614 #line 8614 "configure"
8615 #include "confdefs.h"
8616 #include <$ac_header>
8617 _ACEOF
8618 if { (eval echo "$as_me:8618: \"$ac_cpp conftest.$ac_ext\"") >&5
8619   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8620   ac_status=$?
8621   egrep -v '^ *\+' conftest.er1 >conftest.err
8622   rm -f conftest.er1
8623   cat conftest.err >&5
8624   echo "$as_me:8624: \$? = $ac_status" >&5
8625   (exit $ac_status); } >/dev/null; then
8626   if test -s conftest.err; then
8627     ac_cpp_err=$ac_c_preproc_warn_flag
8628   else
8629     ac_cpp_err=
8630   fi
8631 else
8632   ac_cpp_err=yes
8633 fi
8634 if test -z "$ac_cpp_err"; then
8635   eval "$as_ac_Header=yes"
8636 else
8637   echo "$as_me: failed program was:" >&5
8638   cat conftest.$ac_ext >&5
8639   eval "$as_ac_Header=no"
8640 fi
8641 rm -f conftest.err conftest.$ac_ext
8642 fi
8643 echo "$as_me:8643: result: `eval echo '${'$as_ac_Header'}'`" >&5
8644 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8645 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8646   cat >>confdefs.h <<EOF
8647 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8648 EOF
8649
8650 fi
8651 done
8652
8653 cat >>confdefs.h <<\EOF
8654 #define NCURSES 1
8655 EOF
8656
8657 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8658
8659 cat >>confdefs.h <<EOF
8660 #define $cf_nculib_ROOT 1
8661 EOF
8662
8663 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8664
8665 else
8666
8667 cf_ncuhdr_root=ncursesw
8668
8669 test -n "$cf_cv_curses_dir" && \
8670 test "$cf_cv_curses_dir" != "no" && { \
8671
8672 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8673   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8674   do
8675         while test $cf_add_incdir != /usr/include
8676         do
8677           if test -d $cf_add_incdir
8678           then
8679                 cf_have_incdir=no
8680                 if test -n "$CFLAGS$CPPFLAGS" ; then
8681                   # a loop is needed to ensure we can add subdirs of existing dirs
8682                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8683                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8684                           cf_have_incdir=yes; break
8685                         fi
8686                   done
8687                 fi
8688
8689                 if test "$cf_have_incdir" = no ; then
8690                   if test "$cf_add_incdir" = /usr/local/include ; then
8691                         if test "$GCC" = yes
8692                         then
8693                           cf_save_CPPFLAGS=$CPPFLAGS
8694                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8695                           cat >conftest.$ac_ext <<_ACEOF
8696 #line 8696 "configure"
8697 #include "confdefs.h"
8698 #include <stdio.h>
8699 int
8700 main ()
8701 {
8702 printf("Hello")
8703   ;
8704   return 0;
8705 }
8706 _ACEOF
8707 rm -f conftest.$ac_objext
8708 if { (eval echo "$as_me:8708: \"$ac_compile\"") >&5
8709   (eval $ac_compile) 2>&5
8710   ac_status=$?
8711   echo "$as_me:8711: \$? = $ac_status" >&5
8712   (exit $ac_status); } &&
8713          { ac_try='test -s conftest.$ac_objext'
8714   { (eval echo "$as_me:8714: \"$ac_try\"") >&5
8715   (eval $ac_try) 2>&5
8716   ac_status=$?
8717   echo "$as_me:8717: \$? = $ac_status" >&5
8718   (exit $ac_status); }; }; then
8719   :
8720 else
8721   echo "$as_me: failed program was:" >&5
8722 cat conftest.$ac_ext >&5
8723 cf_have_incdir=yes
8724 fi
8725 rm -f conftest.$ac_objext conftest.$ac_ext
8726                           CPPFLAGS=$cf_save_CPPFLAGS
8727                         fi
8728                   fi
8729                 fi
8730
8731                 if test "$cf_have_incdir" = no ; then
8732                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8733
8734 echo "${as_me:-configure}:8734: testing adding $cf_add_incdir to include-path ..." 1>&5
8735
8736                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8737
8738                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8739                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8740                   cf_add_incdir="$cf_top_incdir"
8741                 else
8742                   break
8743                 fi
8744           fi
8745         done
8746   done
8747 fi
8748
8749 }
8750
8751 echo "$as_me:8751: checking for $cf_ncuhdr_root header in include-path" >&5
8752 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8753 if test "${cf_cv_ncurses_h+set}" = set; then
8754   echo $ECHO_N "(cached) $ECHO_C" >&6
8755 else
8756
8757         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8758         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8759         for cf_header in $cf_header_list
8760         do
8761
8762         cat >conftest.$ac_ext <<_ACEOF
8763 #line 8763 "configure"
8764 #include "confdefs.h"
8765
8766 #define _XOPEN_SOURCE_EXTENDED
8767 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8768 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8769
8770 #include <$cf_header>
8771 int
8772 main ()
8773 {
8774
8775 #ifdef NCURSES_VERSION
8776
8777 #ifndef WACS_BSSB
8778         make an error
8779 #endif
8780
8781 printf("%s\n", NCURSES_VERSION);
8782 #else
8783 #ifdef __NCURSES_H
8784 printf("old\n");
8785 #else
8786         make an error
8787 #endif
8788 #endif
8789
8790   ;
8791   return 0;
8792 }
8793 _ACEOF
8794 rm -f conftest.$ac_objext
8795 if { (eval echo "$as_me:8795: \"$ac_compile\"") >&5
8796   (eval $ac_compile) 2>&5
8797   ac_status=$?
8798   echo "$as_me:8798: \$? = $ac_status" >&5
8799   (exit $ac_status); } &&
8800          { ac_try='test -s conftest.$ac_objext'
8801   { (eval echo "$as_me:8801: \"$ac_try\"") >&5
8802   (eval $ac_try) 2>&5
8803   ac_status=$?
8804   echo "$as_me:8804: \$? = $ac_status" >&5
8805   (exit $ac_status); }; }; then
8806   cf_cv_ncurses_h=$cf_header
8807
8808 else
8809   echo "$as_me: failed program was:" >&5
8810 cat conftest.$ac_ext >&5
8811 cf_cv_ncurses_h=no
8812 fi
8813 rm -f conftest.$ac_objext conftest.$ac_ext
8814
8815                 test "$cf_cv_ncurses_h" != no && break
8816         done
8817
8818 fi
8819 echo "$as_me:8819: result: $cf_cv_ncurses_h" >&5
8820 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8821
8822 if test "$cf_cv_ncurses_h" != no ; then
8823         cf_cv_ncurses_header=$cf_cv_ncurses_h
8824 else
8825
8826 echo "$as_me:8826: checking for $cf_ncuhdr_root include-path" >&5
8827 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8828 if test "${cf_cv_ncurses_h2+set}" = set; then
8829   echo $ECHO_N "(cached) $ECHO_C" >&6
8830 else
8831
8832         test -n "$verbose" && echo
8833
8834 cf_search=
8835
8836 # collect the current set of include-directories from compiler flags
8837 cf_header_path_list=""
8838 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8839         for cf_header_path in $CPPFLAGS $CFLAGS
8840         do
8841                 case $cf_header_path in #(vi
8842                 -I*)
8843                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8844
8845 test "$cf_header_path" != "NONE" && \
8846 test -d "$cf_header_path" && \
8847  {
8848         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8849         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8850         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8851         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8852         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8853         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"
8854 }
8855
8856                         cf_header_path_list="$cf_header_path_list $cf_search"
8857                         ;;
8858                 esac
8859         done
8860 fi
8861
8862 # add the variations for the package we are looking for
8863
8864 cf_search=
8865
8866 test "/usr" != "$prefix" && \
8867 test -d "/usr" && \
8868 (test $prefix = NONE || test "/usr" != "$prefix") && {
8869         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
8870         test -d /usr/include &&          cf_search="$cf_search /usr/include"
8871         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
8872         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
8873         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
8874         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8875 }
8876
8877 test "$prefix" != "NONE" && \
8878 test -d "$prefix" && \
8879  {
8880         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8881         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8882         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8883         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8884         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8885         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8886 }
8887
8888 test "/usr/local" != "$prefix" && \
8889 test -d "/usr/local" && \
8890 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8891         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
8892         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
8893         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
8894         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
8895         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
8896         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8897 }
8898
8899 test "/opt" != "$prefix" && \
8900 test -d "/opt" && \
8901 (test $prefix = NONE || test "/opt" != "$prefix") && {
8902         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
8903         test -d /opt/include &&          cf_search="$cf_search /opt/include"
8904         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
8905         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
8906         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
8907         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8908 }
8909
8910 test "$HOME" != "$prefix" && \
8911 test -d "$HOME" && \
8912 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8913         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
8914         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
8915         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
8916         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
8917         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
8918         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8919 }
8920
8921 test "$includedir" != NONE && \
8922 test "$includedir" != "/usr/include" && \
8923 test -d "$includedir" && {
8924         test -d $includedir &&    cf_search="$cf_search $includedir"
8925         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8926 }
8927
8928 test "$oldincludedir" != NONE && \
8929 test "$oldincludedir" != "/usr/include" && \
8930 test -d "$oldincludedir" && {
8931         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8932         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8933 }
8934
8935 cf_search="$cf_search $cf_header_path_list"
8936
8937         test -n "$verbose" && echo search path $cf_search
8938         cf_save2_CPPFLAGS="$CPPFLAGS"
8939         for cf_incdir in $cf_search
8940         do
8941
8942 if test -n "$cf_incdir" ; then
8943   for cf_add_incdir in $cf_incdir
8944   do
8945         while test $cf_add_incdir != /usr/include
8946         do
8947           if test -d $cf_add_incdir
8948           then
8949                 cf_have_incdir=no
8950                 if test -n "$CFLAGS$CPPFLAGS" ; then
8951                   # a loop is needed to ensure we can add subdirs of existing dirs
8952                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8953                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8954                           cf_have_incdir=yes; break
8955                         fi
8956                   done
8957                 fi
8958
8959                 if test "$cf_have_incdir" = no ; then
8960                   if test "$cf_add_incdir" = /usr/local/include ; then
8961                         if test "$GCC" = yes
8962                         then
8963                           cf_save_CPPFLAGS=$CPPFLAGS
8964                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8965                           cat >conftest.$ac_ext <<_ACEOF
8966 #line 8966 "configure"
8967 #include "confdefs.h"
8968 #include <stdio.h>
8969 int
8970 main ()
8971 {
8972 printf("Hello")
8973   ;
8974   return 0;
8975 }
8976 _ACEOF
8977 rm -f conftest.$ac_objext
8978 if { (eval echo "$as_me:8978: \"$ac_compile\"") >&5
8979   (eval $ac_compile) 2>&5
8980   ac_status=$?
8981   echo "$as_me:8981: \$? = $ac_status" >&5
8982   (exit $ac_status); } &&
8983          { ac_try='test -s conftest.$ac_objext'
8984   { (eval echo "$as_me:8984: \"$ac_try\"") >&5
8985   (eval $ac_try) 2>&5
8986   ac_status=$?
8987   echo "$as_me:8987: \$? = $ac_status" >&5
8988   (exit $ac_status); }; }; then
8989   :
8990 else
8991   echo "$as_me: failed program was:" >&5
8992 cat conftest.$ac_ext >&5
8993 cf_have_incdir=yes
8994 fi
8995 rm -f conftest.$ac_objext conftest.$ac_ext
8996                           CPPFLAGS=$cf_save_CPPFLAGS
8997                         fi
8998                   fi
8999                 fi
9000
9001                 if test "$cf_have_incdir" = no ; then
9002                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9003
9004 echo "${as_me:-configure}:9004: testing adding $cf_add_incdir to include-path ..." 1>&5
9005
9006                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9007
9008                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9009                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9010                   cf_add_incdir="$cf_top_incdir"
9011                 else
9012                   break
9013                 fi
9014           fi
9015         done
9016   done
9017 fi
9018
9019                 for cf_header in \
9020                         ncurses.h \
9021                         curses.h
9022                 do
9023
9024         cat >conftest.$ac_ext <<_ACEOF
9025 #line 9025 "configure"
9026 #include "confdefs.h"
9027
9028 #include <$cf_header>
9029 int
9030 main ()
9031 {
9032
9033 #ifdef NCURSES_VERSION
9034
9035 printf("%s\n", NCURSES_VERSION);
9036 #else
9037 #ifdef __NCURSES_H
9038 printf("old\n");
9039 #else
9040         make an error
9041 #endif
9042 #endif
9043
9044   ;
9045   return 0;
9046 }
9047 _ACEOF
9048 rm -f conftest.$ac_objext
9049 if { (eval echo "$as_me:9049: \"$ac_compile\"") >&5
9050   (eval $ac_compile) 2>&5
9051   ac_status=$?
9052   echo "$as_me:9052: \$? = $ac_status" >&5
9053   (exit $ac_status); } &&
9054          { ac_try='test -s conftest.$ac_objext'
9055   { (eval echo "$as_me:9055: \"$ac_try\"") >&5
9056   (eval $ac_try) 2>&5
9057   ac_status=$?
9058   echo "$as_me:9058: \$? = $ac_status" >&5
9059   (exit $ac_status); }; }; then
9060   cf_cv_ncurses_h2=$cf_header
9061
9062 else
9063   echo "$as_me: failed program was:" >&5
9064 cat conftest.$ac_ext >&5
9065 cf_cv_ncurses_h2=no
9066 fi
9067 rm -f conftest.$ac_objext conftest.$ac_ext
9068
9069                         if test "$cf_cv_ncurses_h2" != no ; then
9070                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9071                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9072                                 break
9073                         fi
9074                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9075                 done
9076                 CPPFLAGS="$cf_save2_CPPFLAGS"
9077                 test "$cf_cv_ncurses_h2" != no && break
9078         done
9079         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9079: error: not found" >&5
9080 echo "$as_me: error: not found" >&2;}
9081    { (exit 1); exit 1; }; }
9082
9083 fi
9084 echo "$as_me:9084: result: $cf_cv_ncurses_h2" >&5
9085 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9086
9087         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9088         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9089         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9090                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9091         fi
9092
9093 if test -n "$cf_1st_incdir" ; then
9094   for cf_add_incdir in $cf_1st_incdir
9095   do
9096         while test $cf_add_incdir != /usr/include
9097         do
9098           if test -d $cf_add_incdir
9099           then
9100                 cf_have_incdir=no
9101                 if test -n "$CFLAGS$CPPFLAGS" ; then
9102                   # a loop is needed to ensure we can add subdirs of existing dirs
9103                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9104                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9105                           cf_have_incdir=yes; break
9106                         fi
9107                   done
9108                 fi
9109
9110                 if test "$cf_have_incdir" = no ; then
9111                   if test "$cf_add_incdir" = /usr/local/include ; then
9112                         if test "$GCC" = yes
9113                         then
9114                           cf_save_CPPFLAGS=$CPPFLAGS
9115                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9116                           cat >conftest.$ac_ext <<_ACEOF
9117 #line 9117 "configure"
9118 #include "confdefs.h"
9119 #include <stdio.h>
9120 int
9121 main ()
9122 {
9123 printf("Hello")
9124   ;
9125   return 0;
9126 }
9127 _ACEOF
9128 rm -f conftest.$ac_objext
9129 if { (eval echo "$as_me:9129: \"$ac_compile\"") >&5
9130   (eval $ac_compile) 2>&5
9131   ac_status=$?
9132   echo "$as_me:9132: \$? = $ac_status" >&5
9133   (exit $ac_status); } &&
9134          { ac_try='test -s conftest.$ac_objext'
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   :
9141 else
9142   echo "$as_me: failed program was:" >&5
9143 cat conftest.$ac_ext >&5
9144 cf_have_incdir=yes
9145 fi
9146 rm -f conftest.$ac_objext conftest.$ac_ext
9147                           CPPFLAGS=$cf_save_CPPFLAGS
9148                         fi
9149                   fi
9150                 fi
9151
9152                 if test "$cf_have_incdir" = no ; then
9153                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9154
9155 echo "${as_me:-configure}:9155: testing adding $cf_add_incdir to include-path ..." 1>&5
9156
9157                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9158
9159                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9160                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9161                   cf_add_incdir="$cf_top_incdir"
9162                 else
9163                   break
9164                 fi
9165           fi
9166         done
9167   done
9168 fi
9169
9170 fi
9171
9172 # Set definitions to allow ifdef'ing for ncurses.h
9173
9174 case $cf_cv_ncurses_header in # (vi
9175 *ncurses.h)
9176         cat >>confdefs.h <<\EOF
9177 #define HAVE_NCURSES_H 1
9178 EOF
9179
9180         ;;
9181 esac
9182
9183 case $cf_cv_ncurses_header in # (vi
9184 ncurses/curses.h|ncurses/ncurses.h)
9185         cat >>confdefs.h <<\EOF
9186 #define HAVE_NCURSES_NCURSES_H 1
9187 EOF
9188
9189         ;;
9190 ncursesw/curses.h|ncursesw/ncurses.h)
9191         cat >>confdefs.h <<\EOF
9192 #define HAVE_NCURSESW_NCURSES_H 1
9193 EOF
9194
9195         ;;
9196 esac
9197
9198 echo "$as_me:9198: checking for terminfo header" >&5
9199 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9200 if test "${cf_cv_term_header+set}" = set; then
9201   echo $ECHO_N "(cached) $ECHO_C" >&6
9202 else
9203
9204 case ${cf_cv_ncurses_header} in #(vi
9205 */ncurses.h|*/ncursesw.h) #(vi
9206         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9207         ;;
9208 *)
9209         cf_term_header=term.h
9210         ;;
9211 esac
9212
9213 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9214 do
9215 cat >conftest.$ac_ext <<_ACEOF
9216 #line 9216 "configure"
9217 #include "confdefs.h"
9218 #include <stdio.h>
9219 #include <${cf_cv_ncurses_header:-curses.h}>
9220 #include <$cf_test>
9221
9222 int
9223 main ()
9224 {
9225 int x = auto_left_margin
9226   ;
9227   return 0;
9228 }
9229 _ACEOF
9230 rm -f conftest.$ac_objext
9231 if { (eval echo "$as_me:9231: \"$ac_compile\"") >&5
9232   (eval $ac_compile) 2>&5
9233   ac_status=$?
9234   echo "$as_me:9234: \$? = $ac_status" >&5
9235   (exit $ac_status); } &&
9236          { ac_try='test -s conftest.$ac_objext'
9237   { (eval echo "$as_me:9237: \"$ac_try\"") >&5
9238   (eval $ac_try) 2>&5
9239   ac_status=$?
9240   echo "$as_me:9240: \$? = $ac_status" >&5
9241   (exit $ac_status); }; }; then
9242
9243         cf_cv_term_header="$cf_test"
9244 else
9245   echo "$as_me: failed program was:" >&5
9246 cat conftest.$ac_ext >&5
9247
9248         cf_cv_term_header=unknown
9249
9250 fi
9251 rm -f conftest.$ac_objext conftest.$ac_ext
9252         test "$cf_cv_term_header" != unknown && break
9253 done
9254
9255 fi
9256 echo "$as_me:9256: result: $cf_cv_term_header" >&5
9257 echo "${ECHO_T}$cf_cv_term_header" >&6
9258
9259 # Set definitions to allow ifdef'ing to accommodate subdirectories
9260
9261 case $cf_cv_term_header in # (vi
9262 *term.h)
9263         cat >>confdefs.h <<\EOF
9264 #define HAVE_TERM_H 1
9265 EOF
9266
9267         ;;
9268 esac
9269
9270 case $cf_cv_term_header in # (vi
9271 ncurses/term.h) #(vi
9272         cat >>confdefs.h <<\EOF
9273 #define HAVE_NCURSES_TERM_H 1
9274 EOF
9275
9276         ;;
9277 ncursesw/term.h)
9278         cat >>confdefs.h <<\EOF
9279 #define HAVE_NCURSESW_TERM_H 1
9280 EOF
9281
9282         ;;
9283 esac
9284
9285 # some applications need this, but should check for NCURSES_VERSION
9286 cat >>confdefs.h <<\EOF
9287 #define NCURSES 1
9288 EOF
9289
9290 echo "$as_me:9290: checking for ncurses version" >&5
9291 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9292 if test "${cf_cv_ncurses_version+set}" = set; then
9293   echo $ECHO_N "(cached) $ECHO_C" >&6
9294 else
9295
9296         cf_cv_ncurses_version=no
9297         cf_tempfile=out$$
9298         rm -f $cf_tempfile
9299         if test "$cross_compiling" = yes; then
9300
9301         # This will not work if the preprocessor splits the line after the
9302         # Autoconf token.  The 'unproto' program does that.
9303         cat > conftest.$ac_ext <<EOF
9304 #include <${cf_cv_ncurses_header:-curses.h}>
9305 #undef Autoconf
9306 #ifdef NCURSES_VERSION
9307 Autoconf NCURSES_VERSION
9308 #else
9309 #ifdef __NCURSES_H
9310 Autoconf "old"
9311 #endif
9312 ;
9313 #endif
9314 EOF
9315         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9316         { (eval echo "$as_me:9316: \"$cf_try\"") >&5
9317   (eval $cf_try) 2>&5
9318   ac_status=$?
9319   echo "$as_me:9319: \$? = $ac_status" >&5
9320   (exit $ac_status); }
9321         if test -f conftest.out ; then
9322                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9323                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9324                 rm -f conftest.out
9325         fi
9326
9327 else
9328   cat >conftest.$ac_ext <<_ACEOF
9329 #line 9329 "configure"
9330 #include "confdefs.h"
9331
9332 #include <${cf_cv_ncurses_header:-curses.h}>
9333 #include <stdio.h>
9334 int main()
9335 {
9336         FILE *fp = fopen("$cf_tempfile", "w");
9337 #ifdef NCURSES_VERSION
9338 # ifdef NCURSES_VERSION_PATCH
9339         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9340 # else
9341         fprintf(fp, "%s\n", NCURSES_VERSION);
9342 # endif
9343 #else
9344 # ifdef __NCURSES_H
9345         fprintf(fp, "old\n");
9346 # else
9347         make an error
9348 # endif
9349 #endif
9350         ${cf_cv_main_return:-return}(0);
9351 }
9352 _ACEOF
9353 rm -f conftest$ac_exeext
9354 if { (eval echo "$as_me:9354: \"$ac_link\"") >&5
9355   (eval $ac_link) 2>&5
9356   ac_status=$?
9357   echo "$as_me:9357: \$? = $ac_status" >&5
9358   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9359   { (eval echo "$as_me:9359: \"$ac_try\"") >&5
9360   (eval $ac_try) 2>&5
9361   ac_status=$?
9362   echo "$as_me:9362: \$? = $ac_status" >&5
9363   (exit $ac_status); }; }; then
9364
9365         cf_cv_ncurses_version=`cat $cf_tempfile`
9366 else
9367   echo "$as_me: program exited with status $ac_status" >&5
9368 echo "$as_me: failed program was:" >&5
9369 cat conftest.$ac_ext >&5
9370 fi
9371 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9372 fi
9373         rm -f $cf_tempfile
9374
9375 fi
9376 echo "$as_me:9376: result: $cf_cv_ncurses_version" >&5
9377 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9378 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
9379 #define NCURSES 1
9380 EOF
9381
9382 cf_nculib_root=ncursesw
9383         # This works, except for the special case where we find gpm, but
9384         # ncurses is in a nonstandard location via $LIBS, and we really want
9385         # to link gpm.
9386 cf_ncurses_LIBS=""
9387 cf_ncurses_SAVE="$LIBS"
9388 echo "$as_me:9388: checking for Gpm_Open in -lgpm" >&5
9389 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9390 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9391   echo $ECHO_N "(cached) $ECHO_C" >&6
9392 else
9393   ac_check_lib_save_LIBS=$LIBS
9394 LIBS="-lgpm  $LIBS"
9395 cat >conftest.$ac_ext <<_ACEOF
9396 #line 9396 "configure"
9397 #include "confdefs.h"
9398
9399 /* Override any gcc2 internal prototype to avoid an error.  */
9400 #ifdef __cplusplus
9401 extern "C"
9402 #endif
9403 /* We use char because int might match the return type of a gcc2
9404    builtin and then its argument prototype would still apply.  */
9405 char Gpm_Open ();
9406 int
9407 main ()
9408 {
9409 Gpm_Open ();
9410   ;
9411   return 0;
9412 }
9413 _ACEOF
9414 rm -f conftest.$ac_objext conftest$ac_exeext
9415 if { (eval echo "$as_me:9415: \"$ac_link\"") >&5
9416   (eval $ac_link) 2>&5
9417   ac_status=$?
9418   echo "$as_me:9418: \$? = $ac_status" >&5
9419   (exit $ac_status); } &&
9420          { ac_try='test -s conftest$ac_exeext'
9421   { (eval echo "$as_me:9421: \"$ac_try\"") >&5
9422   (eval $ac_try) 2>&5
9423   ac_status=$?
9424   echo "$as_me:9424: \$? = $ac_status" >&5
9425   (exit $ac_status); }; }; then
9426   ac_cv_lib_gpm_Gpm_Open=yes
9427 else
9428   echo "$as_me: failed program was:" >&5
9429 cat conftest.$ac_ext >&5
9430 ac_cv_lib_gpm_Gpm_Open=no
9431 fi
9432 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9433 LIBS=$ac_check_lib_save_LIBS
9434 fi
9435 echo "$as_me:9435: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9436 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9437 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9438   echo "$as_me:9438: checking for initscr in -lgpm" >&5
9439 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9440 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9441   echo $ECHO_N "(cached) $ECHO_C" >&6
9442 else
9443   ac_check_lib_save_LIBS=$LIBS
9444 LIBS="-lgpm  $LIBS"
9445 cat >conftest.$ac_ext <<_ACEOF
9446 #line 9446 "configure"
9447 #include "confdefs.h"
9448
9449 /* Override any gcc2 internal prototype to avoid an error.  */
9450 #ifdef __cplusplus
9451 extern "C"
9452 #endif
9453 /* We use char because int might match the return type of a gcc2
9454    builtin and then its argument prototype would still apply.  */
9455 char initscr ();
9456 int
9457 main ()
9458 {
9459 initscr ();
9460   ;
9461   return 0;
9462 }
9463 _ACEOF
9464 rm -f conftest.$ac_objext conftest$ac_exeext
9465 if { (eval echo "$as_me:9465: \"$ac_link\"") >&5
9466   (eval $ac_link) 2>&5
9467   ac_status=$?
9468   echo "$as_me:9468: \$? = $ac_status" >&5
9469   (exit $ac_status); } &&
9470          { ac_try='test -s conftest$ac_exeext'
9471   { (eval echo "$as_me:9471: \"$ac_try\"") >&5
9472   (eval $ac_try) 2>&5
9473   ac_status=$?
9474   echo "$as_me:9474: \$? = $ac_status" >&5
9475   (exit $ac_status); }; }; then
9476   ac_cv_lib_gpm_initscr=yes
9477 else
9478   echo "$as_me: failed program was:" >&5
9479 cat conftest.$ac_ext >&5
9480 ac_cv_lib_gpm_initscr=no
9481 fi
9482 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9483 LIBS=$ac_check_lib_save_LIBS
9484 fi
9485 echo "$as_me:9485: result: $ac_cv_lib_gpm_initscr" >&5
9486 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9487 if test $ac_cv_lib_gpm_initscr = yes; then
9488   LIBS="$cf_ncurses_SAVE"
9489 else
9490   cf_ncurses_LIBS="-lgpm"
9491 fi
9492
9493 fi
9494
9495 case $host_os in #(vi
9496 freebsd*)
9497         # This is only necessary if you are linking against an obsolete
9498         # version of ncurses (but it should do no harm, since it's static).
9499         if test "$cf_nculib_root" = ncurses ; then
9500                 echo "$as_me:9500: checking for tgoto in -lmytinfo" >&5
9501 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9502 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9503   echo $ECHO_N "(cached) $ECHO_C" >&6
9504 else
9505   ac_check_lib_save_LIBS=$LIBS
9506 LIBS="-lmytinfo  $LIBS"
9507 cat >conftest.$ac_ext <<_ACEOF
9508 #line 9508 "configure"
9509 #include "confdefs.h"
9510
9511 /* Override any gcc2 internal prototype to avoid an error.  */
9512 #ifdef __cplusplus
9513 extern "C"
9514 #endif
9515 /* We use char because int might match the return type of a gcc2
9516    builtin and then its argument prototype would still apply.  */
9517 char tgoto ();
9518 int
9519 main ()
9520 {
9521 tgoto ();
9522   ;
9523   return 0;
9524 }
9525 _ACEOF
9526 rm -f conftest.$ac_objext conftest$ac_exeext
9527 if { (eval echo "$as_me:9527: \"$ac_link\"") >&5
9528   (eval $ac_link) 2>&5
9529   ac_status=$?
9530   echo "$as_me:9530: \$? = $ac_status" >&5
9531   (exit $ac_status); } &&
9532          { ac_try='test -s conftest$ac_exeext'
9533   { (eval echo "$as_me:9533: \"$ac_try\"") >&5
9534   (eval $ac_try) 2>&5
9535   ac_status=$?
9536   echo "$as_me:9536: \$? = $ac_status" >&5
9537   (exit $ac_status); }; }; then
9538   ac_cv_lib_mytinfo_tgoto=yes
9539 else
9540   echo "$as_me: failed program was:" >&5
9541 cat conftest.$ac_ext >&5
9542 ac_cv_lib_mytinfo_tgoto=no
9543 fi
9544 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9545 LIBS=$ac_check_lib_save_LIBS
9546 fi
9547 echo "$as_me:9547: result: $ac_cv_lib_mytinfo_tgoto" >&5
9548 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9549 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9550   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9551 fi
9552
9553         fi
9554         ;;
9555 esac
9556
9557 LIBS="$cf_ncurses_LIBS $LIBS"
9558
9559 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9560 then
9561         LIBS="-l$cf_nculib_root $LIBS"
9562 else
9563
9564         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9565         cf_libdir=""
9566         echo "$as_me:9566: checking for initscr" >&5
9567 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9568 if test "${ac_cv_func_initscr+set}" = set; then
9569   echo $ECHO_N "(cached) $ECHO_C" >&6
9570 else
9571   cat >conftest.$ac_ext <<_ACEOF
9572 #line 9572 "configure"
9573 #include "confdefs.h"
9574 /* System header to define __stub macros and hopefully few prototypes,
9575     which can conflict with char initscr (); below.  */
9576 #include <assert.h>
9577 /* Override any gcc2 internal prototype to avoid an error.  */
9578 #ifdef __cplusplus
9579 extern "C"
9580 #endif
9581 /* We use char because int might match the return type of a gcc2
9582    builtin and then its argument prototype would still apply.  */
9583 char initscr ();
9584 char (*f) ();
9585
9586 int
9587 main ()
9588 {
9589 /* The GNU C library defines this for functions which it implements
9590     to always fail with ENOSYS.  Some functions are actually named
9591     something starting with __ and the normal name is an alias.  */
9592 #if defined (__stub_initscr) || defined (__stub___initscr)
9593 choke me
9594 #else
9595 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9596 #endif
9597
9598   ;
9599   return 0;
9600 }
9601 _ACEOF
9602 rm -f conftest.$ac_objext conftest$ac_exeext
9603 if { (eval echo "$as_me:9603: \"$ac_link\"") >&5
9604   (eval $ac_link) 2>&5
9605   ac_status=$?
9606   echo "$as_me:9606: \$? = $ac_status" >&5
9607   (exit $ac_status); } &&
9608          { ac_try='test -s conftest$ac_exeext'
9609   { (eval echo "$as_me:9609: \"$ac_try\"") >&5
9610   (eval $ac_try) 2>&5
9611   ac_status=$?
9612   echo "$as_me:9612: \$? = $ac_status" >&5
9613   (exit $ac_status); }; }; then
9614   ac_cv_func_initscr=yes
9615 else
9616   echo "$as_me: failed program was:" >&5
9617 cat conftest.$ac_ext >&5
9618 ac_cv_func_initscr=no
9619 fi
9620 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9621 fi
9622 echo "$as_me:9622: result: $ac_cv_func_initscr" >&5
9623 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9624 if test $ac_cv_func_initscr = yes; then
9625   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9626 else
9627
9628                 cf_save_LIBS="$LIBS"
9629                 echo "$as_me:9629: checking for initscr in -l$cf_nculib_root" >&5
9630 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9631                 LIBS="-l$cf_nculib_root $LIBS"
9632                 cat >conftest.$ac_ext <<_ACEOF
9633 #line 9633 "configure"
9634 #include "confdefs.h"
9635 #include <${cf_cv_ncurses_header:-curses.h}>
9636 int
9637 main ()
9638 {
9639 initscr()
9640   ;
9641   return 0;
9642 }
9643 _ACEOF
9644 rm -f conftest.$ac_objext conftest$ac_exeext
9645 if { (eval echo "$as_me:9645: \"$ac_link\"") >&5
9646   (eval $ac_link) 2>&5
9647   ac_status=$?
9648   echo "$as_me:9648: \$? = $ac_status" >&5
9649   (exit $ac_status); } &&
9650          { ac_try='test -s conftest$ac_exeext'
9651   { (eval echo "$as_me:9651: \"$ac_try\"") >&5
9652   (eval $ac_try) 2>&5
9653   ac_status=$?
9654   echo "$as_me:9654: \$? = $ac_status" >&5
9655   (exit $ac_status); }; }; then
9656   echo "$as_me:9656: result: yes" >&5
9657 echo "${ECHO_T}yes" >&6
9658                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9659
9660 else
9661   echo "$as_me: failed program was:" >&5
9662 cat conftest.$ac_ext >&5
9663 echo "$as_me:9663: result: no" >&5
9664 echo "${ECHO_T}no" >&6
9665
9666 cf_search=
9667 cf_library_path_list=""
9668 if test -n "${LDFLAGS}${LIBS}" ; then
9669         for cf_library_path in $LDFLAGS $LIBS
9670         do
9671                 case $cf_library_path in #(vi
9672                 -L*)
9673                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9674
9675 test "$cf_library_path" != "NONE" && \
9676 test -d "$cf_library_path" && \
9677  {
9678         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9679         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9680         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9681         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9682         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9683         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"
9684 }
9685
9686                         cf_library_path_list="$cf_library_path_list $cf_search"
9687                         ;;
9688                 esac
9689         done
9690 fi
9691
9692 cf_search=
9693
9694 test "/usr" != "$prefix" && \
9695 test -d "/usr" && \
9696 (test $prefix = NONE || test "/usr" != "$prefix") && {
9697         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
9698         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
9699         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
9700         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
9701         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
9702         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
9703 }
9704
9705 test "$prefix" != "NONE" && \
9706 test -d "$prefix" && \
9707  {
9708         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9709         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9710         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9711         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9712         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9713         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9714 }
9715
9716 test "/usr/local" != "$prefix" && \
9717 test -d "/usr/local" && \
9718 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
9719         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
9720         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
9721         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
9722         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
9723         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
9724         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
9725 }
9726
9727 test "/opt" != "$prefix" && \
9728 test -d "/opt" && \
9729 (test $prefix = NONE || test "/opt" != "$prefix") && {
9730         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
9731         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
9732         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
9733         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
9734         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
9735         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
9736 }
9737
9738 test "$HOME" != "$prefix" && \
9739 test -d "$HOME" && \
9740 (test $prefix = NONE || test "$HOME" != "$prefix") && {
9741         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
9742         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
9743         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
9744         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
9745         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
9746         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
9747 }
9748
9749 cf_search="$cf_library_path_list $cf_search"
9750
9751                         for cf_libdir in $cf_search
9752                         do
9753                                 echo "$as_me:9753: checking for -l$cf_nculib_root in $cf_libdir" >&5
9754 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9755                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9756                                 cat >conftest.$ac_ext <<_ACEOF
9757 #line 9757 "configure"
9758 #include "confdefs.h"
9759 #include <${cf_cv_ncurses_header:-curses.h}>
9760 int
9761 main ()
9762 {
9763 initscr()
9764   ;
9765   return 0;
9766 }
9767 _ACEOF
9768 rm -f conftest.$ac_objext conftest$ac_exeext
9769 if { (eval echo "$as_me:9769: \"$ac_link\"") >&5
9770   (eval $ac_link) 2>&5
9771   ac_status=$?
9772   echo "$as_me:9772: \$? = $ac_status" >&5
9773   (exit $ac_status); } &&
9774          { ac_try='test -s conftest$ac_exeext'
9775   { (eval echo "$as_me:9775: \"$ac_try\"") >&5
9776   (eval $ac_try) 2>&5
9777   ac_status=$?
9778   echo "$as_me:9778: \$? = $ac_status" >&5
9779   (exit $ac_status); }; }; then
9780   echo "$as_me:9780: result: yes" >&5
9781 echo "${ECHO_T}yes" >&6
9782                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9783                                          break
9784 else
9785   echo "$as_me: failed program was:" >&5
9786 cat conftest.$ac_ext >&5
9787 echo "$as_me:9787: result: no" >&5
9788 echo "${ECHO_T}no" >&6
9789                                          LIBS="$cf_save_LIBS"
9790 fi
9791 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9792                         done
9793
9794 fi
9795 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9796
9797 fi
9798
9799 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9800
9801 if test $cf_found_library = no ; then
9802         { { echo "$as_me:9802: error: Cannot link $cf_nculib_root library" >&5
9803 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9804    { (exit 1); exit 1; }; }
9805 fi
9806
9807 fi
9808
9809 if test -n "$cf_ncurses_LIBS" ; then
9810         echo "$as_me:9810: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9811 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9812         cf_ncurses_SAVE="$LIBS"
9813         for p in $cf_ncurses_LIBS ; do
9814                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9815                 if test "$q" != "$LIBS" ; then
9816                         LIBS="$q"
9817                 fi
9818         done
9819         cat >conftest.$ac_ext <<_ACEOF
9820 #line 9820 "configure"
9821 #include "confdefs.h"
9822 #include <${cf_cv_ncurses_header:-curses.h}>
9823 int
9824 main ()
9825 {
9826 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9827   ;
9828   return 0;
9829 }
9830 _ACEOF
9831 rm -f conftest.$ac_objext conftest$ac_exeext
9832 if { (eval echo "$as_me:9832: \"$ac_link\"") >&5
9833   (eval $ac_link) 2>&5
9834   ac_status=$?
9835   echo "$as_me:9835: \$? = $ac_status" >&5
9836   (exit $ac_status); } &&
9837          { ac_try='test -s conftest$ac_exeext'
9838   { (eval echo "$as_me:9838: \"$ac_try\"") >&5
9839   (eval $ac_try) 2>&5
9840   ac_status=$?
9841   echo "$as_me:9841: \$? = $ac_status" >&5
9842   (exit $ac_status); }; }; then
9843   echo "$as_me:9843: result: yes" >&5
9844 echo "${ECHO_T}yes" >&6
9845 else
9846   echo "$as_me: failed program was:" >&5
9847 cat conftest.$ac_ext >&5
9848 echo "$as_me:9848: result: no" >&5
9849 echo "${ECHO_T}no" >&6
9850                  LIBS="$cf_ncurses_SAVE"
9851 fi
9852 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9853 fi
9854
9855 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9856
9857 cat >>confdefs.h <<EOF
9858 #define $cf_nculib_ROOT 1
9859 EOF
9860
9861 fi
9862
9863         ;;
9864 pdcurses)
9865
9866 echo "$as_me:9866: checking if you want to use pkg-config" >&5
9867 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
9868
9869 # Check whether --with-pkg-config or --without-pkg-config was given.
9870 if test "${with_pkg_config+set}" = set; then
9871   withval="$with_pkg_config"
9872   cf_pkg_config=$withval
9873 else
9874   cf_pkg_config=yes
9875 fi;
9876 echo "$as_me:9876: result: $cf_pkg_config" >&5
9877 echo "${ECHO_T}$cf_pkg_config" >&6
9878
9879 case $cf_pkg_config in #(vi
9880 no) #(vi
9881         PKG_CONFIG=none
9882         ;;
9883 yes) #(vi
9884
9885 if test -n "$ac_tool_prefix"; then
9886   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
9887 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
9888 echo "$as_me:9888: checking for $ac_word" >&5
9889 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9890 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
9891   echo $ECHO_N "(cached) $ECHO_C" >&6
9892 else
9893   case $PKG_CONFIG in
9894   [\\/]* | ?:[\\/]*)
9895   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
9896   ;;
9897   *)
9898   ac_save_IFS=$IFS; IFS=$ac_path_separator
9899 ac_dummy="$PATH"
9900 for ac_dir in $ac_dummy; do
9901   IFS=$ac_save_IFS
9902   test -z "$ac_dir" && ac_dir=.
9903   if $as_executable_p "$ac_dir/$ac_word"; then
9904    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
9905    echo "$as_me:9905: found $ac_dir/$ac_word" >&5
9906    break
9907 fi
9908 done
9909
9910   ;;
9911 esac
9912 fi
9913 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
9914
9915 if test -n "$PKG_CONFIG"; then
9916   echo "$as_me:9916: result: $PKG_CONFIG" >&5
9917 echo "${ECHO_T}$PKG_CONFIG" >&6
9918 else
9919   echo "$as_me:9919: result: no" >&5
9920 echo "${ECHO_T}no" >&6
9921 fi
9922
9923 fi
9924 if test -z "$ac_cv_path_PKG_CONFIG"; then
9925   ac_pt_PKG_CONFIG=$PKG_CONFIG
9926   # Extract the first word of "pkg-config", so it can be a program name with args.
9927 set dummy pkg-config; ac_word=$2
9928 echo "$as_me:9928: checking for $ac_word" >&5
9929 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9930 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
9931   echo $ECHO_N "(cached) $ECHO_C" >&6
9932 else
9933   case $ac_pt_PKG_CONFIG in
9934   [\\/]* | ?:[\\/]*)
9935   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
9936   ;;
9937   *)
9938   ac_save_IFS=$IFS; IFS=$ac_path_separator
9939 ac_dummy="$PATH"
9940 for ac_dir in $ac_dummy; do
9941   IFS=$ac_save_IFS
9942   test -z "$ac_dir" && ac_dir=.
9943   if $as_executable_p "$ac_dir/$ac_word"; then
9944    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
9945    echo "$as_me:9945: found $ac_dir/$ac_word" >&5
9946    break
9947 fi
9948 done
9949
9950   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
9951   ;;
9952 esac
9953 fi
9954 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
9955
9956 if test -n "$ac_pt_PKG_CONFIG"; then
9957   echo "$as_me:9957: result: $ac_pt_PKG_CONFIG" >&5
9958 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
9959 else
9960   echo "$as_me:9960: result: no" >&5
9961 echo "${ECHO_T}no" >&6
9962 fi
9963
9964   PKG_CONFIG=$ac_pt_PKG_CONFIG
9965 else
9966   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
9967 fi
9968
9969         ;;
9970 *)
9971         PKG_CONFIG=$withval
9972         ;;
9973 esac
9974
9975 test -z "$PKG_CONFIG" && PKG_CONFIG=none
9976 if test "$PKG_CONFIG" != none ; then
9977
9978 if test "x$prefix" != xNONE; then
9979   cf_path_syntax="$prefix"
9980 else
9981   cf_path_syntax="$ac_default_prefix"
9982 fi
9983
9984 case ".$PKG_CONFIG" in #(vi
9985 .\$\(*\)*|.\'*\'*) #(vi
9986   ;;
9987 ..|./*|.\\*) #(vi
9988   ;;
9989 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
9990   ;;
9991 .\${*prefix}*|.\${*dir}*) #(vi
9992   eval PKG_CONFIG="$PKG_CONFIG"
9993   case ".$PKG_CONFIG" in #(vi
9994   .NONE/*)
9995     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
9996     ;;
9997   esac
9998   ;; #(vi
9999 .no|.NONE/*)
10000   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
10001   ;;
10002 *)
10003   { { echo "$as_me:10003: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
10004 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
10005    { (exit 1); exit 1; }; }
10006   ;;
10007 esac
10008
10009 fi
10010
10011 echo "$as_me:10011: checking for X" >&5
10012 echo $ECHO_N "checking for X... $ECHO_C" >&6
10013
10014 # Check whether --with-x or --without-x was given.
10015 if test "${with_x+set}" = set; then
10016   withval="$with_x"
10017
10018 fi;
10019 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
10020 if test "x$with_x" = xno; then
10021   # The user explicitly disabled X.
10022   have_x=disabled
10023 else
10024   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
10025     # Both variables are already set.
10026     have_x=yes
10027   else
10028     if test "${ac_cv_have_x+set}" = set; then
10029   echo $ECHO_N "(cached) $ECHO_C" >&6
10030 else
10031   # One or both of the vars are not set, and there is no cached value.
10032 ac_x_includes=no ac_x_libraries=no
10033 rm -fr conftest.dir
10034 if mkdir conftest.dir; then
10035   cd conftest.dir
10036   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
10037   cat >Imakefile <<'EOF'
10038 acfindx:
10039         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
10040 EOF
10041   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
10042     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
10043     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
10044     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
10045     for ac_extension in a so sl dylib dll; do
10046       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
10047          test -f $ac_im_libdir/libX11.$ac_extension; then
10048         ac_im_usrlibdir=$ac_im_libdir; break
10049       fi
10050     done
10051     # Screen out bogus values from the imake configuration.  They are
10052     # bogus both because they are the default anyway, and because
10053     # using them would break gcc on systems where it needs fixed includes.
10054     case $ac_im_incroot in
10055         /usr/include) ;;
10056         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
10057     esac
10058     case $ac_im_usrlibdir in
10059         /usr/lib | /lib) ;;
10060         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
10061     esac
10062   fi
10063   cd ..
10064   rm -fr conftest.dir
10065 fi
10066
10067 # Standard set of common directories for X headers.
10068 # Check X11 before X11Rn because it is often a symlink to the current release.
10069 ac_x_header_dirs='
10070 /usr/X11/include
10071 /usr/X11R6/include
10072 /usr/X11R5/include
10073 /usr/X11R4/include
10074
10075 /usr/include/X11
10076 /usr/include/X11R6
10077 /usr/include/X11R5
10078 /usr/include/X11R4
10079
10080 /usr/local/X11/include
10081 /usr/local/X11R6/include
10082 /usr/local/X11R5/include
10083 /usr/local/X11R4/include
10084
10085 /usr/local/include/X11
10086 /usr/local/include/X11R6
10087 /usr/local/include/X11R5
10088 /usr/local/include/X11R4
10089
10090 /usr/X386/include
10091 /usr/x386/include
10092 /usr/XFree86/include/X11
10093
10094 /usr/include
10095 /usr/local/include
10096 /usr/unsupported/include
10097 /usr/athena/include
10098 /usr/local/x11r5/include
10099 /usr/lpp/Xamples/include
10100
10101 /usr/openwin/include
10102 /usr/openwin/share/include'
10103
10104 if test "$ac_x_includes" = no; then
10105   # Guess where to find include files, by looking for Intrinsic.h.
10106   # First, try using that file with no special directory specified.
10107   cat >conftest.$ac_ext <<_ACEOF
10108 #line 10108 "configure"
10109 #include "confdefs.h"
10110 #include <X11/Intrinsic.h>
10111 _ACEOF
10112 if { (eval echo "$as_me:10112: \"$ac_cpp conftest.$ac_ext\"") >&5
10113   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10114   ac_status=$?
10115   egrep -v '^ *\+' conftest.er1 >conftest.err
10116   rm -f conftest.er1
10117   cat conftest.err >&5
10118   echo "$as_me:10118: \$? = $ac_status" >&5
10119   (exit $ac_status); } >/dev/null; then
10120   if test -s conftest.err; then
10121     ac_cpp_err=$ac_c_preproc_warn_flag
10122   else
10123     ac_cpp_err=
10124   fi
10125 else
10126   ac_cpp_err=yes
10127 fi
10128 if test -z "$ac_cpp_err"; then
10129   # We can compile using X headers with no special include directory.
10130 ac_x_includes=
10131 else
10132   echo "$as_me: failed program was:" >&5
10133   cat conftest.$ac_ext >&5
10134   for ac_dir in $ac_x_header_dirs; do
10135   if test -r "$ac_dir/X11/Intrinsic.h"; then
10136     ac_x_includes=$ac_dir
10137     break
10138   fi
10139 done
10140 fi
10141 rm -f conftest.err conftest.$ac_ext
10142 fi # $ac_x_includes = no
10143
10144 if test "$ac_x_libraries" = no; then
10145   # Check for the libraries.
10146   # See if we find them without any special options.
10147   # Don't add to $LIBS permanently.
10148   ac_save_LIBS=$LIBS
10149   LIBS="-lXt $LIBS"
10150   cat >conftest.$ac_ext <<_ACEOF
10151 #line 10151 "configure"
10152 #include "confdefs.h"
10153 #include <X11/Intrinsic.h>
10154 int
10155 main ()
10156 {
10157 XtMalloc (0)
10158   ;
10159   return 0;
10160 }
10161 _ACEOF
10162 rm -f conftest.$ac_objext conftest$ac_exeext
10163 if { (eval echo "$as_me:10163: \"$ac_link\"") >&5
10164   (eval $ac_link) 2>&5
10165   ac_status=$?
10166   echo "$as_me:10166: \$? = $ac_status" >&5
10167   (exit $ac_status); } &&
10168          { ac_try='test -s conftest$ac_exeext'
10169   { (eval echo "$as_me:10169: \"$ac_try\"") >&5
10170   (eval $ac_try) 2>&5
10171   ac_status=$?
10172   echo "$as_me:10172: \$? = $ac_status" >&5
10173   (exit $ac_status); }; }; then
10174   LIBS=$ac_save_LIBS
10175 # We can link X programs with no special library path.
10176 ac_x_libraries=
10177 else
10178   echo "$as_me: failed program was:" >&5
10179 cat conftest.$ac_ext >&5
10180 LIBS=$ac_save_LIBS
10181 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
10182 do
10183   # Don't even attempt the hair of trying to link an X program!
10184   for ac_extension in a so sl dylib dll; do
10185     if test -r $ac_dir/libXt.$ac_extension; then
10186       ac_x_libraries=$ac_dir
10187       break 2
10188     fi
10189   done
10190 done
10191 fi
10192 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10193 fi # $ac_x_libraries = no
10194
10195 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
10196   # Didn't find X anywhere.  Cache the known absence of X.
10197   ac_cv_have_x="have_x=no"
10198 else
10199   # Record where we found X for the cache.
10200   ac_cv_have_x="have_x=yes \
10201                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
10202 fi
10203 fi
10204
10205   fi
10206   eval "$ac_cv_have_x"
10207 fi # $with_x != no
10208
10209 if test "$have_x" != yes; then
10210   echo "$as_me:10210: result: $have_x" >&5
10211 echo "${ECHO_T}$have_x" >&6
10212   no_x=yes
10213 else
10214   # If each of the values was on the command line, it overrides each guess.
10215   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
10216   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
10217   # Update the cache value to reflect the command line values.
10218   ac_cv_have_x="have_x=yes \
10219                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
10220   echo "$as_me:10220: result: libraries $x_libraries, headers $x_includes" >&5
10221 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
10222 fi
10223
10224 if test "$no_x" = yes; then
10225   # Not all programs may use this symbol, but it does not hurt to define it.
10226
10227 cat >>confdefs.h <<\EOF
10228 #define X_DISPLAY_MISSING 1
10229 EOF
10230
10231   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
10232 else
10233   if test -n "$x_includes"; then
10234     X_CFLAGS="$X_CFLAGS -I$x_includes"
10235   fi
10236
10237   # It would also be nice to do this for all -L options, not just this one.
10238   if test -n "$x_libraries"; then
10239     X_LIBS="$X_LIBS -L$x_libraries"
10240     # For Solaris; some versions of Sun CC require a space after -R and
10241     # others require no space.  Words are not sufficient . . . .
10242     case `(uname -sr) 2>/dev/null` in
10243     "SunOS 5"*)
10244       echo "$as_me:10244: checking whether -R must be followed by a space" >&5
10245 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
10246       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
10247       cat >conftest.$ac_ext <<_ACEOF
10248 #line 10248 "configure"
10249 #include "confdefs.h"
10250
10251 int
10252 main ()
10253 {
10254
10255   ;
10256   return 0;
10257 }
10258 _ACEOF
10259 rm -f conftest.$ac_objext conftest$ac_exeext
10260 if { (eval echo "$as_me:10260: \"$ac_link\"") >&5
10261   (eval $ac_link) 2>&5
10262   ac_status=$?
10263   echo "$as_me:10263: \$? = $ac_status" >&5
10264   (exit $ac_status); } &&
10265          { ac_try='test -s conftest$ac_exeext'
10266   { (eval echo "$as_me:10266: \"$ac_try\"") >&5
10267   (eval $ac_try) 2>&5
10268   ac_status=$?
10269   echo "$as_me:10269: \$? = $ac_status" >&5
10270   (exit $ac_status); }; }; then
10271   ac_R_nospace=yes
10272 else
10273   echo "$as_me: failed program was:" >&5
10274 cat conftest.$ac_ext >&5
10275 ac_R_nospace=no
10276 fi
10277 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10278       if test $ac_R_nospace = yes; then
10279         echo "$as_me:10279: result: no" >&5
10280 echo "${ECHO_T}no" >&6
10281         X_LIBS="$X_LIBS -R$x_libraries"
10282       else
10283         LIBS="$ac_xsave_LIBS -R $x_libraries"
10284         cat >conftest.$ac_ext <<_ACEOF
10285 #line 10285 "configure"
10286 #include "confdefs.h"
10287
10288 int
10289 main ()
10290 {
10291
10292   ;
10293   return 0;
10294 }
10295 _ACEOF
10296 rm -f conftest.$ac_objext conftest$ac_exeext
10297 if { (eval echo "$as_me:10297: \"$ac_link\"") >&5
10298   (eval $ac_link) 2>&5
10299   ac_status=$?
10300   echo "$as_me:10300: \$? = $ac_status" >&5
10301   (exit $ac_status); } &&
10302          { ac_try='test -s conftest$ac_exeext'
10303   { (eval echo "$as_me:10303: \"$ac_try\"") >&5
10304   (eval $ac_try) 2>&5
10305   ac_status=$?
10306   echo "$as_me:10306: \$? = $ac_status" >&5
10307   (exit $ac_status); }; }; then
10308   ac_R_space=yes
10309 else
10310   echo "$as_me: failed program was:" >&5
10311 cat conftest.$ac_ext >&5
10312 ac_R_space=no
10313 fi
10314 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10315         if test $ac_R_space = yes; then
10316           echo "$as_me:10316: result: yes" >&5
10317 echo "${ECHO_T}yes" >&6
10318           X_LIBS="$X_LIBS -R $x_libraries"
10319         else
10320           echo "$as_me:10320: result: neither works" >&5
10321 echo "${ECHO_T}neither works" >&6
10322         fi
10323       fi
10324       LIBS=$ac_xsave_LIBS
10325     esac
10326   fi
10327
10328   # Check for system-dependent libraries X programs must link with.
10329   # Do this before checking for the system-independent R6 libraries
10330   # (-lICE), since we may need -lsocket or whatever for X linking.
10331
10332   if test "$ISC" = yes; then
10333     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10334   else
10335     # Martyn Johnson says this is needed for Ultrix, if the X
10336     # libraries were built with DECnet support.  And Karl Berry says
10337     # the Alpha needs dnet_stub (dnet does not exist).
10338     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10339     cat >conftest.$ac_ext <<_ACEOF
10340 #line 10340 "configure"
10341 #include "confdefs.h"
10342
10343 /* Override any gcc2 internal prototype to avoid an error.  */
10344 #ifdef __cplusplus
10345 extern "C"
10346 #endif
10347 /* We use char because int might match the return type of a gcc2
10348    builtin and then its argument prototype would still apply.  */
10349 char XOpenDisplay ();
10350 int
10351 main ()
10352 {
10353 XOpenDisplay ();
10354   ;
10355   return 0;
10356 }
10357 _ACEOF
10358 rm -f conftest.$ac_objext conftest$ac_exeext
10359 if { (eval echo "$as_me:10359: \"$ac_link\"") >&5
10360   (eval $ac_link) 2>&5
10361   ac_status=$?
10362   echo "$as_me:10362: \$? = $ac_status" >&5
10363   (exit $ac_status); } &&
10364          { ac_try='test -s conftest$ac_exeext'
10365   { (eval echo "$as_me:10365: \"$ac_try\"") >&5
10366   (eval $ac_try) 2>&5
10367   ac_status=$?
10368   echo "$as_me:10368: \$? = $ac_status" >&5
10369   (exit $ac_status); }; }; then
10370   :
10371 else
10372   echo "$as_me: failed program was:" >&5
10373 cat conftest.$ac_ext >&5
10374 echo "$as_me:10374: checking for dnet_ntoa in -ldnet" >&5
10375 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10376 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10377   echo $ECHO_N "(cached) $ECHO_C" >&6
10378 else
10379   ac_check_lib_save_LIBS=$LIBS
10380 LIBS="-ldnet  $LIBS"
10381 cat >conftest.$ac_ext <<_ACEOF
10382 #line 10382 "configure"
10383 #include "confdefs.h"
10384
10385 /* Override any gcc2 internal prototype to avoid an error.  */
10386 #ifdef __cplusplus
10387 extern "C"
10388 #endif
10389 /* We use char because int might match the return type of a gcc2
10390    builtin and then its argument prototype would still apply.  */
10391 char dnet_ntoa ();
10392 int
10393 main ()
10394 {
10395 dnet_ntoa ();
10396   ;
10397   return 0;
10398 }
10399 _ACEOF
10400 rm -f conftest.$ac_objext conftest$ac_exeext
10401 if { (eval echo "$as_me:10401: \"$ac_link\"") >&5
10402   (eval $ac_link) 2>&5
10403   ac_status=$?
10404   echo "$as_me:10404: \$? = $ac_status" >&5
10405   (exit $ac_status); } &&
10406          { ac_try='test -s conftest$ac_exeext'
10407   { (eval echo "$as_me:10407: \"$ac_try\"") >&5
10408   (eval $ac_try) 2>&5
10409   ac_status=$?
10410   echo "$as_me:10410: \$? = $ac_status" >&5
10411   (exit $ac_status); }; }; then
10412   ac_cv_lib_dnet_dnet_ntoa=yes
10413 else
10414   echo "$as_me: failed program was:" >&5
10415 cat conftest.$ac_ext >&5
10416 ac_cv_lib_dnet_dnet_ntoa=no
10417 fi
10418 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10419 LIBS=$ac_check_lib_save_LIBS
10420 fi
10421 echo "$as_me:10421: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10422 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10423 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10424   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10425 fi
10426
10427     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10428       echo "$as_me:10428: checking for dnet_ntoa in -ldnet_stub" >&5
10429 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10430 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10431   echo $ECHO_N "(cached) $ECHO_C" >&6
10432 else
10433   ac_check_lib_save_LIBS=$LIBS
10434 LIBS="-ldnet_stub  $LIBS"
10435 cat >conftest.$ac_ext <<_ACEOF
10436 #line 10436 "configure"
10437 #include "confdefs.h"
10438
10439 /* Override any gcc2 internal prototype to avoid an error.  */
10440 #ifdef __cplusplus
10441 extern "C"
10442 #endif
10443 /* We use char because int might match the return type of a gcc2
10444    builtin and then its argument prototype would still apply.  */
10445 char dnet_ntoa ();
10446 int
10447 main ()
10448 {
10449 dnet_ntoa ();
10450   ;
10451   return 0;
10452 }
10453 _ACEOF
10454 rm -f conftest.$ac_objext conftest$ac_exeext
10455 if { (eval echo "$as_me:10455: \"$ac_link\"") >&5
10456   (eval $ac_link) 2>&5
10457   ac_status=$?
10458   echo "$as_me:10458: \$? = $ac_status" >&5
10459   (exit $ac_status); } &&
10460          { ac_try='test -s conftest$ac_exeext'
10461   { (eval echo "$as_me:10461: \"$ac_try\"") >&5
10462   (eval $ac_try) 2>&5
10463   ac_status=$?
10464   echo "$as_me:10464: \$? = $ac_status" >&5
10465   (exit $ac_status); }; }; then
10466   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10467 else
10468   echo "$as_me: failed program was:" >&5
10469 cat conftest.$ac_ext >&5
10470 ac_cv_lib_dnet_stub_dnet_ntoa=no
10471 fi
10472 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10473 LIBS=$ac_check_lib_save_LIBS
10474 fi
10475 echo "$as_me:10475: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10476 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10477 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10478   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10479 fi
10480
10481     fi
10482 fi
10483 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10484     LIBS="$ac_xsave_LIBS"
10485
10486     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10487     # to get the SysV transport functions.
10488     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10489     # needs -lnsl.
10490     # The nsl library prevents programs from opening the X display
10491     # on Irix 5.2, according to T.E. Dickey.
10492     # The functions gethostbyname, getservbyname, and inet_addr are
10493     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10494     echo "$as_me:10494: checking for gethostbyname" >&5
10495 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10496 if test "${ac_cv_func_gethostbyname+set}" = set; then
10497   echo $ECHO_N "(cached) $ECHO_C" >&6
10498 else
10499   cat >conftest.$ac_ext <<_ACEOF
10500 #line 10500 "configure"
10501 #include "confdefs.h"
10502 /* System header to define __stub macros and hopefully few prototypes,
10503     which can conflict with char gethostbyname (); below.  */
10504 #include <assert.h>
10505 /* Override any gcc2 internal prototype to avoid an error.  */
10506 #ifdef __cplusplus
10507 extern "C"
10508 #endif
10509 /* We use char because int might match the return type of a gcc2
10510    builtin and then its argument prototype would still apply.  */
10511 char gethostbyname ();
10512 char (*f) ();
10513
10514 int
10515 main ()
10516 {
10517 /* The GNU C library defines this for functions which it implements
10518     to always fail with ENOSYS.  Some functions are actually named
10519     something starting with __ and the normal name is an alias.  */
10520 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10521 choke me
10522 #else
10523 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10524 #endif
10525
10526   ;
10527   return 0;
10528 }
10529 _ACEOF
10530 rm -f conftest.$ac_objext conftest$ac_exeext
10531 if { (eval echo "$as_me:10531: \"$ac_link\"") >&5
10532   (eval $ac_link) 2>&5
10533   ac_status=$?
10534   echo "$as_me:10534: \$? = $ac_status" >&5
10535   (exit $ac_status); } &&
10536          { ac_try='test -s conftest$ac_exeext'
10537   { (eval echo "$as_me:10537: \"$ac_try\"") >&5
10538   (eval $ac_try) 2>&5
10539   ac_status=$?
10540   echo "$as_me:10540: \$? = $ac_status" >&5
10541   (exit $ac_status); }; }; then
10542   ac_cv_func_gethostbyname=yes
10543 else
10544   echo "$as_me: failed program was:" >&5
10545 cat conftest.$ac_ext >&5
10546 ac_cv_func_gethostbyname=no
10547 fi
10548 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10549 fi
10550 echo "$as_me:10550: result: $ac_cv_func_gethostbyname" >&5
10551 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10552
10553     if test $ac_cv_func_gethostbyname = no; then
10554       echo "$as_me:10554: checking for gethostbyname in -lnsl" >&5
10555 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10556 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10557   echo $ECHO_N "(cached) $ECHO_C" >&6
10558 else
10559   ac_check_lib_save_LIBS=$LIBS
10560 LIBS="-lnsl  $LIBS"
10561 cat >conftest.$ac_ext <<_ACEOF
10562 #line 10562 "configure"
10563 #include "confdefs.h"
10564
10565 /* Override any gcc2 internal prototype to avoid an error.  */
10566 #ifdef __cplusplus
10567 extern "C"
10568 #endif
10569 /* We use char because int might match the return type of a gcc2
10570    builtin and then its argument prototype would still apply.  */
10571 char gethostbyname ();
10572 int
10573 main ()
10574 {
10575 gethostbyname ();
10576   ;
10577   return 0;
10578 }
10579 _ACEOF
10580 rm -f conftest.$ac_objext conftest$ac_exeext
10581 if { (eval echo "$as_me:10581: \"$ac_link\"") >&5
10582   (eval $ac_link) 2>&5
10583   ac_status=$?
10584   echo "$as_me:10584: \$? = $ac_status" >&5
10585   (exit $ac_status); } &&
10586          { ac_try='test -s conftest$ac_exeext'
10587   { (eval echo "$as_me:10587: \"$ac_try\"") >&5
10588   (eval $ac_try) 2>&5
10589   ac_status=$?
10590   echo "$as_me:10590: \$? = $ac_status" >&5
10591   (exit $ac_status); }; }; then
10592   ac_cv_lib_nsl_gethostbyname=yes
10593 else
10594   echo "$as_me: failed program was:" >&5
10595 cat conftest.$ac_ext >&5
10596 ac_cv_lib_nsl_gethostbyname=no
10597 fi
10598 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10599 LIBS=$ac_check_lib_save_LIBS
10600 fi
10601 echo "$as_me:10601: result: $ac_cv_lib_nsl_gethostbyname" >&5
10602 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10603 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10604   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10605 fi
10606
10607       if test $ac_cv_lib_nsl_gethostbyname = no; then
10608         echo "$as_me:10608: checking for gethostbyname in -lbsd" >&5
10609 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10610 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10611   echo $ECHO_N "(cached) $ECHO_C" >&6
10612 else
10613   ac_check_lib_save_LIBS=$LIBS
10614 LIBS="-lbsd  $LIBS"
10615 cat >conftest.$ac_ext <<_ACEOF
10616 #line 10616 "configure"
10617 #include "confdefs.h"
10618
10619 /* Override any gcc2 internal prototype to avoid an error.  */
10620 #ifdef __cplusplus
10621 extern "C"
10622 #endif
10623 /* We use char because int might match the return type of a gcc2
10624    builtin and then its argument prototype would still apply.  */
10625 char gethostbyname ();
10626 int
10627 main ()
10628 {
10629 gethostbyname ();
10630   ;
10631   return 0;
10632 }
10633 _ACEOF
10634 rm -f conftest.$ac_objext conftest$ac_exeext
10635 if { (eval echo "$as_me:10635: \"$ac_link\"") >&5
10636   (eval $ac_link) 2>&5
10637   ac_status=$?
10638   echo "$as_me:10638: \$? = $ac_status" >&5
10639   (exit $ac_status); } &&
10640          { ac_try='test -s conftest$ac_exeext'
10641   { (eval echo "$as_me:10641: \"$ac_try\"") >&5
10642   (eval $ac_try) 2>&5
10643   ac_status=$?
10644   echo "$as_me:10644: \$? = $ac_status" >&5
10645   (exit $ac_status); }; }; then
10646   ac_cv_lib_bsd_gethostbyname=yes
10647 else
10648   echo "$as_me: failed program was:" >&5
10649 cat conftest.$ac_ext >&5
10650 ac_cv_lib_bsd_gethostbyname=no
10651 fi
10652 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10653 LIBS=$ac_check_lib_save_LIBS
10654 fi
10655 echo "$as_me:10655: result: $ac_cv_lib_bsd_gethostbyname" >&5
10656 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10657 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10658   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10659 fi
10660
10661       fi
10662     fi
10663
10664     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10665     # socket/setsockopt and other routines are undefined under SCO ODT
10666     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10667     # on later versions), says Simon Leinen: it contains gethostby*
10668     # variants that don't use the nameserver (or something).  -lsocket
10669     # must be given before -lnsl if both are needed.  We assume that
10670     # if connect needs -lnsl, so does gethostbyname.
10671     echo "$as_me:10671: checking for connect" >&5
10672 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10673 if test "${ac_cv_func_connect+set}" = set; then
10674   echo $ECHO_N "(cached) $ECHO_C" >&6
10675 else
10676   cat >conftest.$ac_ext <<_ACEOF
10677 #line 10677 "configure"
10678 #include "confdefs.h"
10679 /* System header to define __stub macros and hopefully few prototypes,
10680     which can conflict with char connect (); below.  */
10681 #include <assert.h>
10682 /* Override any gcc2 internal prototype to avoid an error.  */
10683 #ifdef __cplusplus
10684 extern "C"
10685 #endif
10686 /* We use char because int might match the return type of a gcc2
10687    builtin and then its argument prototype would still apply.  */
10688 char connect ();
10689 char (*f) ();
10690
10691 int
10692 main ()
10693 {
10694 /* The GNU C library defines this for functions which it implements
10695     to always fail with ENOSYS.  Some functions are actually named
10696     something starting with __ and the normal name is an alias.  */
10697 #if defined (__stub_connect) || defined (__stub___connect)
10698 choke me
10699 #else
10700 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10701 #endif
10702
10703   ;
10704   return 0;
10705 }
10706 _ACEOF
10707 rm -f conftest.$ac_objext conftest$ac_exeext
10708 if { (eval echo "$as_me:10708: \"$ac_link\"") >&5
10709   (eval $ac_link) 2>&5
10710   ac_status=$?
10711   echo "$as_me:10711: \$? = $ac_status" >&5
10712   (exit $ac_status); } &&
10713          { ac_try='test -s conftest$ac_exeext'
10714   { (eval echo "$as_me:10714: \"$ac_try\"") >&5
10715   (eval $ac_try) 2>&5
10716   ac_status=$?
10717   echo "$as_me:10717: \$? = $ac_status" >&5
10718   (exit $ac_status); }; }; then
10719   ac_cv_func_connect=yes
10720 else
10721   echo "$as_me: failed program was:" >&5
10722 cat conftest.$ac_ext >&5
10723 ac_cv_func_connect=no
10724 fi
10725 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10726 fi
10727 echo "$as_me:10727: result: $ac_cv_func_connect" >&5
10728 echo "${ECHO_T}$ac_cv_func_connect" >&6
10729
10730     if test $ac_cv_func_connect = no; then
10731       echo "$as_me:10731: checking for connect in -lsocket" >&5
10732 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10733 if test "${ac_cv_lib_socket_connect+set}" = set; then
10734   echo $ECHO_N "(cached) $ECHO_C" >&6
10735 else
10736   ac_check_lib_save_LIBS=$LIBS
10737 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10738 cat >conftest.$ac_ext <<_ACEOF
10739 #line 10739 "configure"
10740 #include "confdefs.h"
10741
10742 /* Override any gcc2 internal prototype to avoid an error.  */
10743 #ifdef __cplusplus
10744 extern "C"
10745 #endif
10746 /* We use char because int might match the return type of a gcc2
10747    builtin and then its argument prototype would still apply.  */
10748 char connect ();
10749 int
10750 main ()
10751 {
10752 connect ();
10753   ;
10754   return 0;
10755 }
10756 _ACEOF
10757 rm -f conftest.$ac_objext conftest$ac_exeext
10758 if { (eval echo "$as_me:10758: \"$ac_link\"") >&5
10759   (eval $ac_link) 2>&5
10760   ac_status=$?
10761   echo "$as_me:10761: \$? = $ac_status" >&5
10762   (exit $ac_status); } &&
10763          { ac_try='test -s conftest$ac_exeext'
10764   { (eval echo "$as_me:10764: \"$ac_try\"") >&5
10765   (eval $ac_try) 2>&5
10766   ac_status=$?
10767   echo "$as_me:10767: \$? = $ac_status" >&5
10768   (exit $ac_status); }; }; then
10769   ac_cv_lib_socket_connect=yes
10770 else
10771   echo "$as_me: failed program was:" >&5
10772 cat conftest.$ac_ext >&5
10773 ac_cv_lib_socket_connect=no
10774 fi
10775 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10776 LIBS=$ac_check_lib_save_LIBS
10777 fi
10778 echo "$as_me:10778: result: $ac_cv_lib_socket_connect" >&5
10779 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10780 if test $ac_cv_lib_socket_connect = yes; then
10781   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10782 fi
10783
10784     fi
10785
10786     # Guillermo Gomez says -lposix is necessary on A/UX.
10787     echo "$as_me:10787: checking for remove" >&5
10788 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10789 if test "${ac_cv_func_remove+set}" = set; then
10790   echo $ECHO_N "(cached) $ECHO_C" >&6
10791 else
10792   cat >conftest.$ac_ext <<_ACEOF
10793 #line 10793 "configure"
10794 #include "confdefs.h"
10795 /* System header to define __stub macros and hopefully few prototypes,
10796     which can conflict with char remove (); below.  */
10797 #include <assert.h>
10798 /* Override any gcc2 internal prototype to avoid an error.  */
10799 #ifdef __cplusplus
10800 extern "C"
10801 #endif
10802 /* We use char because int might match the return type of a gcc2
10803    builtin and then its argument prototype would still apply.  */
10804 char remove ();
10805 char (*f) ();
10806
10807 int
10808 main ()
10809 {
10810 /* The GNU C library defines this for functions which it implements
10811     to always fail with ENOSYS.  Some functions are actually named
10812     something starting with __ and the normal name is an alias.  */
10813 #if defined (__stub_remove) || defined (__stub___remove)
10814 choke me
10815 #else
10816 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10817 #endif
10818
10819   ;
10820   return 0;
10821 }
10822 _ACEOF
10823 rm -f conftest.$ac_objext conftest$ac_exeext
10824 if { (eval echo "$as_me:10824: \"$ac_link\"") >&5
10825   (eval $ac_link) 2>&5
10826   ac_status=$?
10827   echo "$as_me:10827: \$? = $ac_status" >&5
10828   (exit $ac_status); } &&
10829          { ac_try='test -s conftest$ac_exeext'
10830   { (eval echo "$as_me:10830: \"$ac_try\"") >&5
10831   (eval $ac_try) 2>&5
10832   ac_status=$?
10833   echo "$as_me:10833: \$? = $ac_status" >&5
10834   (exit $ac_status); }; }; then
10835   ac_cv_func_remove=yes
10836 else
10837   echo "$as_me: failed program was:" >&5
10838 cat conftest.$ac_ext >&5
10839 ac_cv_func_remove=no
10840 fi
10841 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10842 fi
10843 echo "$as_me:10843: result: $ac_cv_func_remove" >&5
10844 echo "${ECHO_T}$ac_cv_func_remove" >&6
10845
10846     if test $ac_cv_func_remove = no; then
10847       echo "$as_me:10847: checking for remove in -lposix" >&5
10848 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10849 if test "${ac_cv_lib_posix_remove+set}" = set; then
10850   echo $ECHO_N "(cached) $ECHO_C" >&6
10851 else
10852   ac_check_lib_save_LIBS=$LIBS
10853 LIBS="-lposix  $LIBS"
10854 cat >conftest.$ac_ext <<_ACEOF
10855 #line 10855 "configure"
10856 #include "confdefs.h"
10857
10858 /* Override any gcc2 internal prototype to avoid an error.  */
10859 #ifdef __cplusplus
10860 extern "C"
10861 #endif
10862 /* We use char because int might match the return type of a gcc2
10863    builtin and then its argument prototype would still apply.  */
10864 char remove ();
10865 int
10866 main ()
10867 {
10868 remove ();
10869   ;
10870   return 0;
10871 }
10872 _ACEOF
10873 rm -f conftest.$ac_objext conftest$ac_exeext
10874 if { (eval echo "$as_me:10874: \"$ac_link\"") >&5
10875   (eval $ac_link) 2>&5
10876   ac_status=$?
10877   echo "$as_me:10877: \$? = $ac_status" >&5
10878   (exit $ac_status); } &&
10879          { ac_try='test -s conftest$ac_exeext'
10880   { (eval echo "$as_me:10880: \"$ac_try\"") >&5
10881   (eval $ac_try) 2>&5
10882   ac_status=$?
10883   echo "$as_me:10883: \$? = $ac_status" >&5
10884   (exit $ac_status); }; }; then
10885   ac_cv_lib_posix_remove=yes
10886 else
10887   echo "$as_me: failed program was:" >&5
10888 cat conftest.$ac_ext >&5
10889 ac_cv_lib_posix_remove=no
10890 fi
10891 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10892 LIBS=$ac_check_lib_save_LIBS
10893 fi
10894 echo "$as_me:10894: result: $ac_cv_lib_posix_remove" >&5
10895 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10896 if test $ac_cv_lib_posix_remove = yes; then
10897   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10898 fi
10899
10900     fi
10901
10902     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10903     echo "$as_me:10903: checking for shmat" >&5
10904 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10905 if test "${ac_cv_func_shmat+set}" = set; then
10906   echo $ECHO_N "(cached) $ECHO_C" >&6
10907 else
10908   cat >conftest.$ac_ext <<_ACEOF
10909 #line 10909 "configure"
10910 #include "confdefs.h"
10911 /* System header to define __stub macros and hopefully few prototypes,
10912     which can conflict with char shmat (); below.  */
10913 #include <assert.h>
10914 /* Override any gcc2 internal prototype to avoid an error.  */
10915 #ifdef __cplusplus
10916 extern "C"
10917 #endif
10918 /* We use char because int might match the return type of a gcc2
10919    builtin and then its argument prototype would still apply.  */
10920 char shmat ();
10921 char (*f) ();
10922
10923 int
10924 main ()
10925 {
10926 /* The GNU C library defines this for functions which it implements
10927     to always fail with ENOSYS.  Some functions are actually named
10928     something starting with __ and the normal name is an alias.  */
10929 #if defined (__stub_shmat) || defined (__stub___shmat)
10930 choke me
10931 #else
10932 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10933 #endif
10934
10935   ;
10936   return 0;
10937 }
10938 _ACEOF
10939 rm -f conftest.$ac_objext conftest$ac_exeext
10940 if { (eval echo "$as_me:10940: \"$ac_link\"") >&5
10941   (eval $ac_link) 2>&5
10942   ac_status=$?
10943   echo "$as_me:10943: \$? = $ac_status" >&5
10944   (exit $ac_status); } &&
10945          { ac_try='test -s conftest$ac_exeext'
10946   { (eval echo "$as_me:10946: \"$ac_try\"") >&5
10947   (eval $ac_try) 2>&5
10948   ac_status=$?
10949   echo "$as_me:10949: \$? = $ac_status" >&5
10950   (exit $ac_status); }; }; then
10951   ac_cv_func_shmat=yes
10952 else
10953   echo "$as_me: failed program was:" >&5
10954 cat conftest.$ac_ext >&5
10955 ac_cv_func_shmat=no
10956 fi
10957 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10958 fi
10959 echo "$as_me:10959: result: $ac_cv_func_shmat" >&5
10960 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10961
10962     if test $ac_cv_func_shmat = no; then
10963       echo "$as_me:10963: checking for shmat in -lipc" >&5
10964 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10965 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10966   echo $ECHO_N "(cached) $ECHO_C" >&6
10967 else
10968   ac_check_lib_save_LIBS=$LIBS
10969 LIBS="-lipc  $LIBS"
10970 cat >conftest.$ac_ext <<_ACEOF
10971 #line 10971 "configure"
10972 #include "confdefs.h"
10973
10974 /* Override any gcc2 internal prototype to avoid an error.  */
10975 #ifdef __cplusplus
10976 extern "C"
10977 #endif
10978 /* We use char because int might match the return type of a gcc2
10979    builtin and then its argument prototype would still apply.  */
10980 char shmat ();
10981 int
10982 main ()
10983 {
10984 shmat ();
10985   ;
10986   return 0;
10987 }
10988 _ACEOF
10989 rm -f conftest.$ac_objext conftest$ac_exeext
10990 if { (eval echo "$as_me:10990: \"$ac_link\"") >&5
10991   (eval $ac_link) 2>&5
10992   ac_status=$?
10993   echo "$as_me:10993: \$? = $ac_status" >&5
10994   (exit $ac_status); } &&
10995          { ac_try='test -s conftest$ac_exeext'
10996   { (eval echo "$as_me:10996: \"$ac_try\"") >&5
10997   (eval $ac_try) 2>&5
10998   ac_status=$?
10999   echo "$as_me:10999: \$? = $ac_status" >&5
11000   (exit $ac_status); }; }; then
11001   ac_cv_lib_ipc_shmat=yes
11002 else
11003   echo "$as_me: failed program was:" >&5
11004 cat conftest.$ac_ext >&5
11005 ac_cv_lib_ipc_shmat=no
11006 fi
11007 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11008 LIBS=$ac_check_lib_save_LIBS
11009 fi
11010 echo "$as_me:11010: result: $ac_cv_lib_ipc_shmat" >&5
11011 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
11012 if test $ac_cv_lib_ipc_shmat = yes; then
11013   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
11014 fi
11015
11016     fi
11017   fi
11018
11019   # Check for libraries that X11R6 Xt/Xaw programs need.
11020   ac_save_LDFLAGS=$LDFLAGS
11021   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
11022   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
11023   # check for ICE first), but we must link in the order -lSM -lICE or
11024   # we get undefined symbols.  So assume we have SM if we have ICE.
11025   # These have to be linked with before -lX11, unlike the other
11026   # libraries we check for below, so use a different variable.
11027   # John Interrante, Karl Berry
11028   echo "$as_me:11028: checking for IceConnectionNumber in -lICE" >&5
11029 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
11030 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
11031   echo $ECHO_N "(cached) $ECHO_C" >&6
11032 else
11033   ac_check_lib_save_LIBS=$LIBS
11034 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
11035 cat >conftest.$ac_ext <<_ACEOF
11036 #line 11036 "configure"
11037 #include "confdefs.h"
11038
11039 /* Override any gcc2 internal prototype to avoid an error.  */
11040 #ifdef __cplusplus
11041 extern "C"
11042 #endif
11043 /* We use char because int might match the return type of a gcc2
11044    builtin and then its argument prototype would still apply.  */
11045 char IceConnectionNumber ();
11046 int
11047 main ()
11048 {
11049 IceConnectionNumber ();
11050   ;
11051   return 0;
11052 }
11053 _ACEOF
11054 rm -f conftest.$ac_objext conftest$ac_exeext
11055 if { (eval echo "$as_me:11055: \"$ac_link\"") >&5
11056   (eval $ac_link) 2>&5
11057   ac_status=$?
11058   echo "$as_me:11058: \$? = $ac_status" >&5
11059   (exit $ac_status); } &&
11060          { ac_try='test -s conftest$ac_exeext'
11061   { (eval echo "$as_me:11061: \"$ac_try\"") >&5
11062   (eval $ac_try) 2>&5
11063   ac_status=$?
11064   echo "$as_me:11064: \$? = $ac_status" >&5
11065   (exit $ac_status); }; }; then
11066   ac_cv_lib_ICE_IceConnectionNumber=yes
11067 else
11068   echo "$as_me: failed program was:" >&5
11069 cat conftest.$ac_ext >&5
11070 ac_cv_lib_ICE_IceConnectionNumber=no
11071 fi
11072 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11073 LIBS=$ac_check_lib_save_LIBS
11074 fi
11075 echo "$as_me:11075: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
11076 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
11077 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
11078   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
11079 fi
11080
11081   LDFLAGS=$ac_save_LDFLAGS
11082
11083 fi
11084
11085 cf_x_athena=${cf_x_athena:-Xaw}
11086
11087 echo "$as_me:11087: checking if you want to link with Xaw 3d library" >&5
11088 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
11089 withval=
11090
11091 # Check whether --with-Xaw3d or --without-Xaw3d was given.
11092 if test "${with_Xaw3d+set}" = set; then
11093   withval="$with_Xaw3d"
11094
11095 fi;
11096 if test "$withval" = yes ; then
11097         cf_x_athena=Xaw3d
11098         echo "$as_me:11098: result: yes" >&5
11099 echo "${ECHO_T}yes" >&6
11100 else
11101         echo "$as_me:11101: result: no" >&5
11102 echo "${ECHO_T}no" >&6
11103 fi
11104
11105 echo "$as_me:11105: checking if you want to link with neXT Athena library" >&5
11106 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
11107 withval=
11108
11109 # Check whether --with-neXtaw or --without-neXtaw was given.
11110 if test "${with_neXtaw+set}" = set; then
11111   withval="$with_neXtaw"
11112
11113 fi;
11114 if test "$withval" = yes ; then
11115         cf_x_athena=neXtaw
11116         echo "$as_me:11116: result: yes" >&5
11117 echo "${ECHO_T}yes" >&6
11118 else
11119         echo "$as_me:11119: result: no" >&5
11120 echo "${ECHO_T}no" >&6
11121 fi
11122
11123 echo "$as_me:11123: checking if you want to link with Athena-Plus library" >&5
11124 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
11125 withval=
11126
11127 # Check whether --with-XawPlus or --without-XawPlus was given.
11128 if test "${with_XawPlus+set}" = set; then
11129   withval="$with_XawPlus"
11130
11131 fi;
11132 if test "$withval" = yes ; then
11133         cf_x_athena=XawPlus
11134         echo "$as_me:11134: result: yes" >&5
11135 echo "${ECHO_T}yes" >&6
11136 else
11137         echo "$as_me:11137: result: no" >&5
11138 echo "${ECHO_T}no" >&6
11139 fi
11140
11141 cf_x_athena_lib=""
11142
11143 if test "$PKG_CONFIG" != none ; then
11144         cf_athena_list=
11145         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
11146         for cf_athena_pkg in \
11147                 $cf_athena_list \
11148                 ${cf_x_athena} \
11149                 ${cf_x_athena}-devel \
11150                 lib${cf_x_athena} \
11151                 lib${cf_x_athena}-devel
11152         do
11153
11154 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
11155         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
11156
11157 echo "${as_me:-configure}:11157: testing found package $cf_athena_pkg ..." 1>&5
11158
11159         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
11160         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
11161         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
11162
11163 echo "${as_me:-configure}:11163: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11164
11165         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
11166
11167 echo "${as_me:-configure}:11167: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
11168
11169 cf_fix_cppflags=no
11170 cf_new_cflags=
11171 cf_new_cppflags=
11172 cf_new_extra_cppflags=
11173
11174 for cf_add_cflags in $cf_pkgconfig_incs
11175 do
11176 case $cf_fix_cppflags in
11177 no)
11178         case $cf_add_cflags in #(vi
11179         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11180                 case $cf_add_cflags in
11181                 -D*)
11182                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11183
11184                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11185                                 && test -z "${cf_tst_cflags}" \
11186                                 && cf_fix_cppflags=yes
11187
11188                         if test $cf_fix_cppflags = yes ; then
11189                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11190                                 continue
11191                         elif test "${cf_tst_cflags}" = "\"'" ; then
11192                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11193                                 continue
11194                         fi
11195                         ;;
11196                 esac
11197                 case "$CPPFLAGS" in
11198                 *$cf_add_cflags) #(vi
11199                         ;;
11200                 *) #(vi
11201                         case $cf_add_cflags in #(vi
11202                         -D*)
11203                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11204
11205 CPPFLAGS=`echo "$CPPFLAGS" | \
11206         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11207                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11208
11209                                 ;;
11210                         esac
11211                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11212                         ;;
11213                 esac
11214                 ;;
11215         *)
11216                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11217                 ;;
11218         esac
11219         ;;
11220 yes)
11221         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11222
11223         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11224
11225         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11226                 && test -z "${cf_tst_cflags}" \
11227                 && cf_fix_cppflags=no
11228         ;;
11229 esac
11230 done
11231
11232 if test -n "$cf_new_cflags" ; then
11233
11234         CFLAGS="$CFLAGS $cf_new_cflags"
11235 fi
11236
11237 if test -n "$cf_new_cppflags" ; then
11238
11239         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11240 fi
11241
11242 if test -n "$cf_new_extra_cppflags" ; then
11243
11244         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11245 fi
11246
11247         LIBS="$cf_pkgconfig_libs $LIBS"
11248
11249                         cf_x_athena_lib="$cf_pkgconfig_libs"
11250
11251 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11252
11253                         cat >>confdefs.h <<EOF
11254 #define $cf_x_athena_LIBS 1
11255 EOF
11256
11257 echo "$as_me:11257: checking for usable $cf_x_athena/Xmu package" >&5
11258 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
11259 if test "${cf_cv_xaw_compat+set}" = set; then
11260   echo $ECHO_N "(cached) $ECHO_C" >&6
11261 else
11262
11263 cat >conftest.$ac_ext <<_ACEOF
11264 #line 11264 "configure"
11265 #include "confdefs.h"
11266
11267 #include <X11/Xmu/CharSet.h>
11268
11269 int
11270 main ()
11271 {
11272
11273 int check = XmuCompareISOLatin1("big", "small")
11274
11275   ;
11276   return 0;
11277 }
11278 _ACEOF
11279 rm -f conftest.$ac_objext conftest$ac_exeext
11280 if { (eval echo "$as_me:11280: \"$ac_link\"") >&5
11281   (eval $ac_link) 2>&5
11282   ac_status=$?
11283   echo "$as_me:11283: \$? = $ac_status" >&5
11284   (exit $ac_status); } &&
11285          { ac_try='test -s conftest$ac_exeext'
11286   { (eval echo "$as_me:11286: \"$ac_try\"") >&5
11287   (eval $ac_try) 2>&5
11288   ac_status=$?
11289   echo "$as_me:11289: \$? = $ac_status" >&5
11290   (exit $ac_status); }; }; then
11291   cf_cv_xaw_compat=yes
11292 else
11293   echo "$as_me: failed program was:" >&5
11294 cat conftest.$ac_ext >&5
11295 cf_cv_xaw_compat=no
11296 fi
11297 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11298 fi
11299 echo "$as_me:11299: result: $cf_cv_xaw_compat" >&5
11300 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11301
11302                         if test "$cf_cv_xaw_compat" = no
11303                         then
11304                                 # workaround for broken ".pc" files...
11305                                 case "$cf_x_athena_lib" in #(vi
11306                                 *-lXmu*) #(vi
11307                                         ;;
11308                                 *)
11309                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11310
11311 echo "${as_me:-configure}:11311: testing work around broken package ..." 1>&5
11312
11313 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11314         test -n "$verbose" && echo "    found package xmu" 1>&6
11315
11316 echo "${as_me:-configure}:11316: testing found package xmu ..." 1>&5
11317
11318         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11319         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11320         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11321
11322 echo "${as_me:-configure}:11322: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11323
11324         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11325
11326 echo "${as_me:-configure}:11326: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11327
11328 cf_fix_cppflags=no
11329 cf_new_cflags=
11330 cf_new_cppflags=
11331 cf_new_extra_cppflags=
11332
11333 for cf_add_cflags in $cf_pkgconfig_incs
11334 do
11335 case $cf_fix_cppflags in
11336 no)
11337         case $cf_add_cflags in #(vi
11338         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11339                 case $cf_add_cflags in
11340                 -D*)
11341                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11342
11343                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11344                                 && test -z "${cf_tst_cflags}" \
11345                                 && cf_fix_cppflags=yes
11346
11347                         if test $cf_fix_cppflags = yes ; then
11348                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11349                                 continue
11350                         elif test "${cf_tst_cflags}" = "\"'" ; then
11351                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11352                                 continue
11353                         fi
11354                         ;;
11355                 esac
11356                 case "$CPPFLAGS" in
11357                 *$cf_add_cflags) #(vi
11358                         ;;
11359                 *) #(vi
11360                         case $cf_add_cflags in #(vi
11361                         -D*)
11362                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11363
11364 CPPFLAGS=`echo "$CPPFLAGS" | \
11365         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11366                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11367
11368                                 ;;
11369                         esac
11370                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11371                         ;;
11372                 esac
11373                 ;;
11374         *)
11375                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11376                 ;;
11377         esac
11378         ;;
11379 yes)
11380         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11381
11382         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11383
11384         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11385                 && test -z "${cf_tst_cflags}" \
11386                 && cf_fix_cppflags=no
11387         ;;
11388 esac
11389 done
11390
11391 if test -n "$cf_new_cflags" ; then
11392
11393         CFLAGS="$CFLAGS $cf_new_cflags"
11394 fi
11395
11396 if test -n "$cf_new_cppflags" ; then
11397
11398         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11399 fi
11400
11401 if test -n "$cf_new_extra_cppflags" ; then
11402
11403         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11404 fi
11405
11406         LIBS="$cf_pkgconfig_libs $LIBS"
11407         :
11408 else
11409
11410 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11411
11412 echo "${as_me:-configure}:11412: testing ...before $LIBS ..." 1>&5
11413
11414 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lXmu ," -e 's/  / /g'`
11415 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11416
11417 echo "${as_me:-configure}:11417: testing ...after  $LIBS ..." 1>&5
11418
11419 fi
11420
11421                                         ;;
11422                                 esac
11423                         fi
11424
11425                         break
11426 else
11427         :
11428 fi
11429
11430         done
11431 fi
11432
11433 if test -z "$cf_x_athena_lib" ; then
11434
11435 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11436         test -n "$verbose" && echo "    found package Xext" 1>&6
11437
11438 echo "${as_me:-configure}:11438: testing found package Xext ..." 1>&5
11439
11440         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11441         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11442         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11443
11444 echo "${as_me:-configure}:11444: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11445
11446         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11447
11448 echo "${as_me:-configure}:11448: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11449
11450 cf_fix_cppflags=no
11451 cf_new_cflags=
11452 cf_new_cppflags=
11453 cf_new_extra_cppflags=
11454
11455 for cf_add_cflags in $cf_pkgconfig_incs
11456 do
11457 case $cf_fix_cppflags in
11458 no)
11459         case $cf_add_cflags in #(vi
11460         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11461                 case $cf_add_cflags in
11462                 -D*)
11463                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11464
11465                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11466                                 && test -z "${cf_tst_cflags}" \
11467                                 && cf_fix_cppflags=yes
11468
11469                         if test $cf_fix_cppflags = yes ; then
11470                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11471                                 continue
11472                         elif test "${cf_tst_cflags}" = "\"'" ; then
11473                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11474                                 continue
11475                         fi
11476                         ;;
11477                 esac
11478                 case "$CPPFLAGS" in
11479                 *$cf_add_cflags) #(vi
11480                         ;;
11481                 *) #(vi
11482                         case $cf_add_cflags in #(vi
11483                         -D*)
11484                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11485
11486 CPPFLAGS=`echo "$CPPFLAGS" | \
11487         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11488                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11489
11490                                 ;;
11491                         esac
11492                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11493                         ;;
11494                 esac
11495                 ;;
11496         *)
11497                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11498                 ;;
11499         esac
11500         ;;
11501 yes)
11502         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11503
11504         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11505
11506         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11507                 && test -z "${cf_tst_cflags}" \
11508                 && cf_fix_cppflags=no
11509         ;;
11510 esac
11511 done
11512
11513 if test -n "$cf_new_cflags" ; then
11514
11515         CFLAGS="$CFLAGS $cf_new_cflags"
11516 fi
11517
11518 if test -n "$cf_new_cppflags" ; then
11519
11520         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11521 fi
11522
11523 if test -n "$cf_new_extra_cppflags" ; then
11524
11525         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11526 fi
11527
11528         LIBS="$cf_pkgconfig_libs $LIBS"
11529         :
11530 else
11531
11532         echo "$as_me:11532: checking for XextCreateExtension in -lXext" >&5
11533 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11534 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11535   echo $ECHO_N "(cached) $ECHO_C" >&6
11536 else
11537   ac_check_lib_save_LIBS=$LIBS
11538 LIBS="-lXext  $LIBS"
11539 cat >conftest.$ac_ext <<_ACEOF
11540 #line 11540 "configure"
11541 #include "confdefs.h"
11542
11543 /* Override any gcc2 internal prototype to avoid an error.  */
11544 #ifdef __cplusplus
11545 extern "C"
11546 #endif
11547 /* We use char because int might match the return type of a gcc2
11548    builtin and then its argument prototype would still apply.  */
11549 char XextCreateExtension ();
11550 int
11551 main ()
11552 {
11553 XextCreateExtension ();
11554   ;
11555   return 0;
11556 }
11557 _ACEOF
11558 rm -f conftest.$ac_objext conftest$ac_exeext
11559 if { (eval echo "$as_me:11559: \"$ac_link\"") >&5
11560   (eval $ac_link) 2>&5
11561   ac_status=$?
11562   echo "$as_me:11562: \$? = $ac_status" >&5
11563   (exit $ac_status); } &&
11564          { ac_try='test -s conftest$ac_exeext'
11565   { (eval echo "$as_me:11565: \"$ac_try\"") >&5
11566   (eval $ac_try) 2>&5
11567   ac_status=$?
11568   echo "$as_me:11568: \$? = $ac_status" >&5
11569   (exit $ac_status); }; }; then
11570   ac_cv_lib_Xext_XextCreateExtension=yes
11571 else
11572   echo "$as_me: failed program was:" >&5
11573 cat conftest.$ac_ext >&5
11574 ac_cv_lib_Xext_XextCreateExtension=no
11575 fi
11576 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11577 LIBS=$ac_check_lib_save_LIBS
11578 fi
11579 echo "$as_me:11579: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11580 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11581 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11582   LIBS="-lXext $LIBS"
11583 fi
11584
11585 fi
11586
11587 cf_have_X_LIBS=no
11588
11589 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11590         test -n "$verbose" && echo "    found package xt" 1>&6
11591
11592 echo "${as_me:-configure}:11592: testing found package xt ..." 1>&5
11593
11594         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11595         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11596         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11597
11598 echo "${as_me:-configure}:11598: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11599
11600         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11601
11602 echo "${as_me:-configure}:11602: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11603
11604 cf_fix_cppflags=no
11605 cf_new_cflags=
11606 cf_new_cppflags=
11607 cf_new_extra_cppflags=
11608
11609 for cf_add_cflags in $cf_pkgconfig_incs
11610 do
11611 case $cf_fix_cppflags in
11612 no)
11613         case $cf_add_cflags in #(vi
11614         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11615                 case $cf_add_cflags in
11616                 -D*)
11617                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11618
11619                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11620                                 && test -z "${cf_tst_cflags}" \
11621                                 && cf_fix_cppflags=yes
11622
11623                         if test $cf_fix_cppflags = yes ; then
11624                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11625                                 continue
11626                         elif test "${cf_tst_cflags}" = "\"'" ; then
11627                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11628                                 continue
11629                         fi
11630                         ;;
11631                 esac
11632                 case "$CPPFLAGS" in
11633                 *$cf_add_cflags) #(vi
11634                         ;;
11635                 *) #(vi
11636                         case $cf_add_cflags in #(vi
11637                         -D*)
11638                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11639
11640 CPPFLAGS=`echo "$CPPFLAGS" | \
11641         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11642                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11643
11644                                 ;;
11645                         esac
11646                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11647                         ;;
11648                 esac
11649                 ;;
11650         *)
11651                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11652                 ;;
11653         esac
11654         ;;
11655 yes)
11656         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11657
11658         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11659
11660         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11661                 && test -z "${cf_tst_cflags}" \
11662                 && cf_fix_cppflags=no
11663         ;;
11664 esac
11665 done
11666
11667 if test -n "$cf_new_cflags" ; then
11668
11669         CFLAGS="$CFLAGS $cf_new_cflags"
11670 fi
11671
11672 if test -n "$cf_new_cppflags" ; then
11673
11674         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11675 fi
11676
11677 if test -n "$cf_new_extra_cppflags" ; then
11678
11679         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11680 fi
11681
11682         LIBS="$cf_pkgconfig_libs $LIBS"
11683
11684         case "x$LIBS" in #(vi
11685         *-lX11*) #(vi
11686                 ;;
11687         *)
11688 # we have an "xt" package, but it may omit Xt's dependency on X11
11689 echo "$as_me:11689: checking for usable X dependency" >&5
11690 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11691 if test "${cf_cv_xt_x11_compat+set}" = set; then
11692   echo $ECHO_N "(cached) $ECHO_C" >&6
11693 else
11694
11695 cat >conftest.$ac_ext <<_ACEOF
11696 #line 11696 "configure"
11697 #include "confdefs.h"
11698
11699 #include <X11/Xlib.h>
11700
11701 int
11702 main ()
11703 {
11704
11705         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11706         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11707         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11708         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11709
11710   ;
11711   return 0;
11712 }
11713 _ACEOF
11714 rm -f conftest.$ac_objext conftest$ac_exeext
11715 if { (eval echo "$as_me:11715: \"$ac_link\"") >&5
11716   (eval $ac_link) 2>&5
11717   ac_status=$?
11718   echo "$as_me:11718: \$? = $ac_status" >&5
11719   (exit $ac_status); } &&
11720          { ac_try='test -s conftest$ac_exeext'
11721   { (eval echo "$as_me:11721: \"$ac_try\"") >&5
11722   (eval $ac_try) 2>&5
11723   ac_status=$?
11724   echo "$as_me:11724: \$? = $ac_status" >&5
11725   (exit $ac_status); }; }; then
11726   cf_cv_xt_x11_compat=yes
11727 else
11728   echo "$as_me: failed program was:" >&5
11729 cat conftest.$ac_ext >&5
11730 cf_cv_xt_x11_compat=no
11731 fi
11732 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11733 fi
11734 echo "$as_me:11734: result: $cf_cv_xt_x11_compat" >&5
11735 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11736                 if test "$cf_cv_xt_x11_compat" = no
11737                 then
11738                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11739
11740 echo "${as_me:-configure}:11740: testing work around broken X11 dependency ..." 1>&5
11741
11742                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11743
11744 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11745         test -n "$verbose" && echo "    found package x11" 1>&6
11746
11747 echo "${as_me:-configure}:11747: testing found package x11 ..." 1>&5
11748
11749         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11750         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11751         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11752
11753 echo "${as_me:-configure}:11753: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11754
11755         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11756
11757 echo "${as_me:-configure}:11757: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11758
11759 cf_fix_cppflags=no
11760 cf_new_cflags=
11761 cf_new_cppflags=
11762 cf_new_extra_cppflags=
11763
11764 for cf_add_cflags in $cf_pkgconfig_incs
11765 do
11766 case $cf_fix_cppflags in
11767 no)
11768         case $cf_add_cflags in #(vi
11769         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11770                 case $cf_add_cflags in
11771                 -D*)
11772                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11773
11774                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11775                                 && test -z "${cf_tst_cflags}" \
11776                                 && cf_fix_cppflags=yes
11777
11778                         if test $cf_fix_cppflags = yes ; then
11779                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11780                                 continue
11781                         elif test "${cf_tst_cflags}" = "\"'" ; then
11782                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11783                                 continue
11784                         fi
11785                         ;;
11786                 esac
11787                 case "$CPPFLAGS" in
11788                 *$cf_add_cflags) #(vi
11789                         ;;
11790                 *) #(vi
11791                         case $cf_add_cflags in #(vi
11792                         -D*)
11793                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11794
11795 CPPFLAGS=`echo "$CPPFLAGS" | \
11796         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11797                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11798
11799                                 ;;
11800                         esac
11801                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11802                         ;;
11803                 esac
11804                 ;;
11805         *)
11806                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11807                 ;;
11808         esac
11809         ;;
11810 yes)
11811         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11812
11813         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11814
11815         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11816                 && test -z "${cf_tst_cflags}" \
11817                 && cf_fix_cppflags=no
11818         ;;
11819 esac
11820 done
11821
11822 if test -n "$cf_new_cflags" ; then
11823
11824         CFLAGS="$CFLAGS $cf_new_cflags"
11825 fi
11826
11827 if test -n "$cf_new_cppflags" ; then
11828
11829         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11830 fi
11831
11832 if test -n "$cf_new_extra_cppflags" ; then
11833
11834         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11835 fi
11836
11837         LIBS="$cf_pkgconfig_libs $LIBS"
11838         :
11839 else
11840
11841 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11842
11843 echo "${as_me:-configure}:11843: testing ...before $LIBS ..." 1>&5
11844
11845 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lX11 ," -e 's/  / /g'`
11846 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11847
11848 echo "${as_me:-configure}:11848: testing ...after  $LIBS ..." 1>&5
11849
11850 fi
11851
11852                 fi
11853                 ;;
11854         esac
11855
11856 echo "$as_me:11856: checking for usable X Toolkit package" >&5
11857 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11858 if test "${cf_cv_xt_ice_compat+set}" = set; then
11859   echo $ECHO_N "(cached) $ECHO_C" >&6
11860 else
11861
11862 cat >conftest.$ac_ext <<_ACEOF
11863 #line 11863 "configure"
11864 #include "confdefs.h"
11865
11866 #include <X11/Shell.h>
11867
11868 int
11869 main ()
11870 {
11871 int num = IceConnectionNumber(0)
11872
11873   ;
11874   return 0;
11875 }
11876 _ACEOF
11877 rm -f conftest.$ac_objext conftest$ac_exeext
11878 if { (eval echo "$as_me:11878: \"$ac_link\"") >&5
11879   (eval $ac_link) 2>&5
11880   ac_status=$?
11881   echo "$as_me:11881: \$? = $ac_status" >&5
11882   (exit $ac_status); } &&
11883          { ac_try='test -s conftest$ac_exeext'
11884   { (eval echo "$as_me:11884: \"$ac_try\"") >&5
11885   (eval $ac_try) 2>&5
11886   ac_status=$?
11887   echo "$as_me:11887: \$? = $ac_status" >&5
11888   (exit $ac_status); }; }; then
11889   cf_cv_xt_ice_compat=yes
11890 else
11891   echo "$as_me: failed program was:" >&5
11892 cat conftest.$ac_ext >&5
11893 cf_cv_xt_ice_compat=no
11894 fi
11895 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11896 fi
11897 echo "$as_me:11897: result: $cf_cv_xt_ice_compat" >&5
11898 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11899
11900         if test "$cf_cv_xt_ice_compat" = no
11901         then
11902                 # workaround for broken ".pc" files used for X Toolkit.
11903                 case "x$X_PRE_LIBS" in #(vi
11904                 *-lICE*)
11905                         case "x$LIBS" in #(vi
11906                         *-lICE*) #(vi
11907                                 ;;
11908                         *)
11909                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11910
11911 echo "${as_me:-configure}:11911: testing work around broken ICE dependency ..." 1>&5
11912
11913 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11914         test -n "$verbose" && echo "    found package ice" 1>&6
11915
11916 echo "${as_me:-configure}:11916: testing found package ice ..." 1>&5
11917
11918         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11919         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11920         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11921
11922 echo "${as_me:-configure}:11922: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11923
11924         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11925
11926 echo "${as_me:-configure}:11926: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11927
11928 cf_fix_cppflags=no
11929 cf_new_cflags=
11930 cf_new_cppflags=
11931 cf_new_extra_cppflags=
11932
11933 for cf_add_cflags in $cf_pkgconfig_incs
11934 do
11935 case $cf_fix_cppflags in
11936 no)
11937         case $cf_add_cflags in #(vi
11938         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11939                 case $cf_add_cflags in
11940                 -D*)
11941                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11942
11943                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11944                                 && test -z "${cf_tst_cflags}" \
11945                                 && cf_fix_cppflags=yes
11946
11947                         if test $cf_fix_cppflags = yes ; then
11948                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11949                                 continue
11950                         elif test "${cf_tst_cflags}" = "\"'" ; then
11951                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11952                                 continue
11953                         fi
11954                         ;;
11955                 esac
11956                 case "$CPPFLAGS" in
11957                 *$cf_add_cflags) #(vi
11958                         ;;
11959                 *) #(vi
11960                         case $cf_add_cflags in #(vi
11961                         -D*)
11962                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11963
11964 CPPFLAGS=`echo "$CPPFLAGS" | \
11965         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11966                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11967
11968                                 ;;
11969                         esac
11970                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11971                         ;;
11972                 esac
11973                 ;;
11974         *)
11975                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11976                 ;;
11977         esac
11978         ;;
11979 yes)
11980         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11981
11982         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11983
11984         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11985                 && test -z "${cf_tst_cflags}" \
11986                 && cf_fix_cppflags=no
11987         ;;
11988 esac
11989 done
11990
11991 if test -n "$cf_new_cflags" ; then
11992
11993         CFLAGS="$CFLAGS $cf_new_cflags"
11994 fi
11995
11996 if test -n "$cf_new_cppflags" ; then
11997
11998         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11999 fi
12000
12001 if test -n "$cf_new_extra_cppflags" ; then
12002
12003         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12004 fi
12005
12006         LIBS="$cf_pkgconfig_libs $LIBS"
12007
12008 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12009         test -n "$verbose" && echo "    found package sm" 1>&6
12010
12011 echo "${as_me:-configure}:12011: testing found package sm ..." 1>&5
12012
12013         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12014         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12015         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12016
12017 echo "${as_me:-configure}:12017: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12018
12019         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12020
12021 echo "${as_me:-configure}:12021: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12022
12023 cf_fix_cppflags=no
12024 cf_new_cflags=
12025 cf_new_cppflags=
12026 cf_new_extra_cppflags=
12027
12028 for cf_add_cflags in $cf_pkgconfig_incs
12029 do
12030 case $cf_fix_cppflags in
12031 no)
12032         case $cf_add_cflags in #(vi
12033         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12034                 case $cf_add_cflags in
12035                 -D*)
12036                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12037
12038                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12039                                 && test -z "${cf_tst_cflags}" \
12040                                 && cf_fix_cppflags=yes
12041
12042                         if test $cf_fix_cppflags = yes ; then
12043                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12044                                 continue
12045                         elif test "${cf_tst_cflags}" = "\"'" ; then
12046                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12047                                 continue
12048                         fi
12049                         ;;
12050                 esac
12051                 case "$CPPFLAGS" in
12052                 *$cf_add_cflags) #(vi
12053                         ;;
12054                 *) #(vi
12055                         case $cf_add_cflags in #(vi
12056                         -D*)
12057                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12058
12059 CPPFLAGS=`echo "$CPPFLAGS" | \
12060         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12061                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12062
12063                                 ;;
12064                         esac
12065                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12066                         ;;
12067                 esac
12068                 ;;
12069         *)
12070                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12071                 ;;
12072         esac
12073         ;;
12074 yes)
12075         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12076
12077         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12078
12079         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12080                 && test -z "${cf_tst_cflags}" \
12081                 && cf_fix_cppflags=no
12082         ;;
12083 esac
12084 done
12085
12086 if test -n "$cf_new_cflags" ; then
12087
12088         CFLAGS="$CFLAGS $cf_new_cflags"
12089 fi
12090
12091 if test -n "$cf_new_cppflags" ; then
12092
12093         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12094 fi
12095
12096 if test -n "$cf_new_extra_cppflags" ; then
12097
12098         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12099 fi
12100
12101         LIBS="$cf_pkgconfig_libs $LIBS"
12102         :
12103 else
12104         :
12105 fi
12106
12107 else
12108
12109 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12110
12111 echo "${as_me:-configure}:12111: testing ...before $LIBS ..." 1>&5
12112
12113 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/  / /g'`
12114 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12115
12116 echo "${as_me:-configure}:12116: testing ...after  $LIBS ..." 1>&5
12117
12118 fi
12119
12120                                 ;;
12121                         esac
12122                         ;;
12123                 esac
12124         fi
12125
12126         cf_have_X_LIBS=yes
12127
12128 else
12129
12130         LDFLAGS="$X_LIBS $LDFLAGS"
12131
12132 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12133
12134 echo "${as_me:-configure}:12134: testing checking additions to CFLAGS ..." 1>&5
12135
12136 cf_check_cflags="$CFLAGS"
12137 cf_check_cppflags="$CPPFLAGS"
12138
12139 cf_fix_cppflags=no
12140 cf_new_cflags=
12141 cf_new_cppflags=
12142 cf_new_extra_cppflags=
12143
12144 for cf_add_cflags in $X_CFLAGS
12145 do
12146 case $cf_fix_cppflags in
12147 no)
12148         case $cf_add_cflags in #(vi
12149         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12150                 case $cf_add_cflags in
12151                 -D*)
12152                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12153
12154                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12155                                 && test -z "${cf_tst_cflags}" \
12156                                 && cf_fix_cppflags=yes
12157
12158                         if test $cf_fix_cppflags = yes ; then
12159                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12160                                 continue
12161                         elif test "${cf_tst_cflags}" = "\"'" ; then
12162                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12163                                 continue
12164                         fi
12165                         ;;
12166                 esac
12167                 case "$CPPFLAGS" in
12168                 *$cf_add_cflags) #(vi
12169                         ;;
12170                 *) #(vi
12171                         case $cf_add_cflags in #(vi
12172                         -D*)
12173                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12174
12175 CPPFLAGS=`echo "$CPPFLAGS" | \
12176         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12177                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12178
12179                                 ;;
12180                         esac
12181                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12182                         ;;
12183                 esac
12184                 ;;
12185         *)
12186                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12187                 ;;
12188         esac
12189         ;;
12190 yes)
12191         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12192
12193         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12194
12195         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12196                 && test -z "${cf_tst_cflags}" \
12197                 && cf_fix_cppflags=no
12198         ;;
12199 esac
12200 done
12201
12202 if test -n "$cf_new_cflags" ; then
12203         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12204
12205 echo "${as_me:-configure}:12205: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12206
12207         CFLAGS="$CFLAGS $cf_new_cflags"
12208 fi
12209
12210 if test -n "$cf_new_cppflags" ; then
12211         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12212
12213 echo "${as_me:-configure}:12213: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12214
12215         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12216 fi
12217
12218 if test -n "$cf_new_extra_cppflags" ; then
12219         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12220
12221 echo "${as_me:-configure}:12221: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12222
12223         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12224 fi
12225
12226 if test "$cf_check_cflags" != "$CFLAGS" ; then
12227 cat >conftest.$ac_ext <<_ACEOF
12228 #line 12228 "configure"
12229 #include "confdefs.h"
12230 #include <stdio.h>
12231 int
12232 main ()
12233 {
12234 printf("Hello world");
12235   ;
12236   return 0;
12237 }
12238 _ACEOF
12239 rm -f conftest.$ac_objext conftest$ac_exeext
12240 if { (eval echo "$as_me:12240: \"$ac_link\"") >&5
12241   (eval $ac_link) 2>&5
12242   ac_status=$?
12243   echo "$as_me:12243: \$? = $ac_status" >&5
12244   (exit $ac_status); } &&
12245          { ac_try='test -s conftest$ac_exeext'
12246   { (eval echo "$as_me:12246: \"$ac_try\"") >&5
12247   (eval $ac_try) 2>&5
12248   ac_status=$?
12249   echo "$as_me:12249: \$? = $ac_status" >&5
12250   (exit $ac_status); }; }; then
12251   :
12252 else
12253   echo "$as_me: failed program was:" >&5
12254 cat conftest.$ac_ext >&5
12255 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12256
12257 echo "${as_me:-configure}:12257: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12258
12259          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
12260                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12261
12262 echo "${as_me:-configure}:12262: testing but keeping change to \$CPPFLAGS ..." 1>&5
12263
12264          fi
12265          CFLAGS="$cf_check_flags"
12266 fi
12267 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12268 fi
12269
12270         echo "$as_me:12270: checking for XOpenDisplay" >&5
12271 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12272 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12273   echo $ECHO_N "(cached) $ECHO_C" >&6
12274 else
12275   cat >conftest.$ac_ext <<_ACEOF
12276 #line 12276 "configure"
12277 #include "confdefs.h"
12278 /* System header to define __stub macros and hopefully few prototypes,
12279     which can conflict with char XOpenDisplay (); below.  */
12280 #include <assert.h>
12281 /* Override any gcc2 internal prototype to avoid an error.  */
12282 #ifdef __cplusplus
12283 extern "C"
12284 #endif
12285 /* We use char because int might match the return type of a gcc2
12286    builtin and then its argument prototype would still apply.  */
12287 char XOpenDisplay ();
12288 char (*f) ();
12289
12290 int
12291 main ()
12292 {
12293 /* The GNU C library defines this for functions which it implements
12294     to always fail with ENOSYS.  Some functions are actually named
12295     something starting with __ and the normal name is an alias.  */
12296 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12297 choke me
12298 #else
12299 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12300 #endif
12301
12302   ;
12303   return 0;
12304 }
12305 _ACEOF
12306 rm -f conftest.$ac_objext conftest$ac_exeext
12307 if { (eval echo "$as_me:12307: \"$ac_link\"") >&5
12308   (eval $ac_link) 2>&5
12309   ac_status=$?
12310   echo "$as_me:12310: \$? = $ac_status" >&5
12311   (exit $ac_status); } &&
12312          { ac_try='test -s conftest$ac_exeext'
12313   { (eval echo "$as_me:12313: \"$ac_try\"") >&5
12314   (eval $ac_try) 2>&5
12315   ac_status=$?
12316   echo "$as_me:12316: \$? = $ac_status" >&5
12317   (exit $ac_status); }; }; then
12318   ac_cv_func_XOpenDisplay=yes
12319 else
12320   echo "$as_me: failed program was:" >&5
12321 cat conftest.$ac_ext >&5
12322 ac_cv_func_XOpenDisplay=no
12323 fi
12324 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12325 fi
12326 echo "$as_me:12326: result: $ac_cv_func_XOpenDisplay" >&5
12327 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12328 if test $ac_cv_func_XOpenDisplay = yes; then
12329   :
12330 else
12331
12332         echo "$as_me:12332: checking for XOpenDisplay in -lX11" >&5
12333 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12334 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12335   echo $ECHO_N "(cached) $ECHO_C" >&6
12336 else
12337   ac_check_lib_save_LIBS=$LIBS
12338 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12339 cat >conftest.$ac_ext <<_ACEOF
12340 #line 12340 "configure"
12341 #include "confdefs.h"
12342
12343 /* Override any gcc2 internal prototype to avoid an error.  */
12344 #ifdef __cplusplus
12345 extern "C"
12346 #endif
12347 /* We use char because int might match the return type of a gcc2
12348    builtin and then its argument prototype would still apply.  */
12349 char XOpenDisplay ();
12350 int
12351 main ()
12352 {
12353 XOpenDisplay ();
12354   ;
12355   return 0;
12356 }
12357 _ACEOF
12358 rm -f conftest.$ac_objext conftest$ac_exeext
12359 if { (eval echo "$as_me:12359: \"$ac_link\"") >&5
12360   (eval $ac_link) 2>&5
12361   ac_status=$?
12362   echo "$as_me:12362: \$? = $ac_status" >&5
12363   (exit $ac_status); } &&
12364          { ac_try='test -s conftest$ac_exeext'
12365   { (eval echo "$as_me:12365: \"$ac_try\"") >&5
12366   (eval $ac_try) 2>&5
12367   ac_status=$?
12368   echo "$as_me:12368: \$? = $ac_status" >&5
12369   (exit $ac_status); }; }; then
12370   ac_cv_lib_X11_XOpenDisplay=yes
12371 else
12372   echo "$as_me: failed program was:" >&5
12373 cat conftest.$ac_ext >&5
12374 ac_cv_lib_X11_XOpenDisplay=no
12375 fi
12376 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12377 LIBS=$ac_check_lib_save_LIBS
12378 fi
12379 echo "$as_me:12379: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12380 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12381 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12382   LIBS="-lX11 $LIBS"
12383 fi
12384
12385 fi
12386
12387         echo "$as_me:12387: checking for XtAppInitialize" >&5
12388 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12389 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12390   echo $ECHO_N "(cached) $ECHO_C" >&6
12391 else
12392   cat >conftest.$ac_ext <<_ACEOF
12393 #line 12393 "configure"
12394 #include "confdefs.h"
12395 /* System header to define __stub macros and hopefully few prototypes,
12396     which can conflict with char XtAppInitialize (); below.  */
12397 #include <assert.h>
12398 /* Override any gcc2 internal prototype to avoid an error.  */
12399 #ifdef __cplusplus
12400 extern "C"
12401 #endif
12402 /* We use char because int might match the return type of a gcc2
12403    builtin and then its argument prototype would still apply.  */
12404 char XtAppInitialize ();
12405 char (*f) ();
12406
12407 int
12408 main ()
12409 {
12410 /* The GNU C library defines this for functions which it implements
12411     to always fail with ENOSYS.  Some functions are actually named
12412     something starting with __ and the normal name is an alias.  */
12413 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12414 choke me
12415 #else
12416 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12417 #endif
12418
12419   ;
12420   return 0;
12421 }
12422 _ACEOF
12423 rm -f conftest.$ac_objext conftest$ac_exeext
12424 if { (eval echo "$as_me:12424: \"$ac_link\"") >&5
12425   (eval $ac_link) 2>&5
12426   ac_status=$?
12427   echo "$as_me:12427: \$? = $ac_status" >&5
12428   (exit $ac_status); } &&
12429          { ac_try='test -s conftest$ac_exeext'
12430   { (eval echo "$as_me:12430: \"$ac_try\"") >&5
12431   (eval $ac_try) 2>&5
12432   ac_status=$?
12433   echo "$as_me:12433: \$? = $ac_status" >&5
12434   (exit $ac_status); }; }; then
12435   ac_cv_func_XtAppInitialize=yes
12436 else
12437   echo "$as_me: failed program was:" >&5
12438 cat conftest.$ac_ext >&5
12439 ac_cv_func_XtAppInitialize=no
12440 fi
12441 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12442 fi
12443 echo "$as_me:12443: result: $ac_cv_func_XtAppInitialize" >&5
12444 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12445 if test $ac_cv_func_XtAppInitialize = yes; then
12446   :
12447 else
12448
12449         echo "$as_me:12449: checking for XtAppInitialize in -lXt" >&5
12450 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12451 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12452   echo $ECHO_N "(cached) $ECHO_C" >&6
12453 else
12454   ac_check_lib_save_LIBS=$LIBS
12455 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12456 cat >conftest.$ac_ext <<_ACEOF
12457 #line 12457 "configure"
12458 #include "confdefs.h"
12459
12460 /* Override any gcc2 internal prototype to avoid an error.  */
12461 #ifdef __cplusplus
12462 extern "C"
12463 #endif
12464 /* We use char because int might match the return type of a gcc2
12465    builtin and then its argument prototype would still apply.  */
12466 char XtAppInitialize ();
12467 int
12468 main ()
12469 {
12470 XtAppInitialize ();
12471   ;
12472   return 0;
12473 }
12474 _ACEOF
12475 rm -f conftest.$ac_objext conftest$ac_exeext
12476 if { (eval echo "$as_me:12476: \"$ac_link\"") >&5
12477   (eval $ac_link) 2>&5
12478   ac_status=$?
12479   echo "$as_me:12479: \$? = $ac_status" >&5
12480   (exit $ac_status); } &&
12481          { ac_try='test -s conftest$ac_exeext'
12482   { (eval echo "$as_me:12482: \"$ac_try\"") >&5
12483   (eval $ac_try) 2>&5
12484   ac_status=$?
12485   echo "$as_me:12485: \$? = $ac_status" >&5
12486   (exit $ac_status); }; }; then
12487   ac_cv_lib_Xt_XtAppInitialize=yes
12488 else
12489   echo "$as_me: failed program was:" >&5
12490 cat conftest.$ac_ext >&5
12491 ac_cv_lib_Xt_XtAppInitialize=no
12492 fi
12493 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12494 LIBS=$ac_check_lib_save_LIBS
12495 fi
12496 echo "$as_me:12496: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12497 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12498 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12499   cat >>confdefs.h <<\EOF
12500 #define HAVE_LIBXT 1
12501 EOF
12502
12503                  cf_have_X_LIBS=Xt
12504                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12505 fi
12506
12507 fi
12508
12509 fi
12510
12511 if test $cf_have_X_LIBS = no ; then
12512         { echo "$as_me:12512: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12513 test program.  You will have to check and add the proper libraries by hand
12514 to makefile." >&5
12515 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12516 test program.  You will have to check and add the proper libraries by hand
12517 to makefile." >&2;}
12518 fi
12519
12520 cf_x_athena_root=$cf_x_athena
12521 cf_x_athena_inc=""
12522
12523 for cf_path in default \
12524         /usr/contrib/X11R6 \
12525         /usr/contrib/X11R5 \
12526         /usr/lib/X11R5 \
12527         /usr/local
12528 do
12529         if test -z "$cf_x_athena_inc" ; then
12530                 cf_save="$CPPFLAGS"
12531                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12532                 if test $cf_path != default ; then
12533                         CPPFLAGS="$cf_save -I$cf_path/include"
12534                         echo "$as_me:12534: checking for $cf_test in $cf_path" >&5
12535 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12536                 else
12537                         echo "$as_me:12537: checking for $cf_test" >&5
12538 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12539                 fi
12540                 cat >conftest.$ac_ext <<_ACEOF
12541 #line 12541 "configure"
12542 #include "confdefs.h"
12543
12544 #include <X11/Intrinsic.h>
12545 #include <$cf_test>
12546 int
12547 main ()
12548 {
12549
12550   ;
12551   return 0;
12552 }
12553 _ACEOF
12554 rm -f conftest.$ac_objext
12555 if { (eval echo "$as_me:12555: \"$ac_compile\"") >&5
12556   (eval $ac_compile) 2>&5
12557   ac_status=$?
12558   echo "$as_me:12558: \$? = $ac_status" >&5
12559   (exit $ac_status); } &&
12560          { ac_try='test -s conftest.$ac_objext'
12561   { (eval echo "$as_me:12561: \"$ac_try\"") >&5
12562   (eval $ac_try) 2>&5
12563   ac_status=$?
12564   echo "$as_me:12564: \$? = $ac_status" >&5
12565   (exit $ac_status); }; }; then
12566   cf_result=yes
12567 else
12568   echo "$as_me: failed program was:" >&5
12569 cat conftest.$ac_ext >&5
12570 cf_result=no
12571 fi
12572 rm -f conftest.$ac_objext conftest.$ac_ext
12573                 echo "$as_me:12573: result: $cf_result" >&5
12574 echo "${ECHO_T}$cf_result" >&6
12575                 if test "$cf_result" = yes ; then
12576                         cf_x_athena_inc=$cf_path
12577                         break
12578                 else
12579                         CPPFLAGS="$cf_save"
12580                 fi
12581         fi
12582 done
12583
12584 if test -z "$cf_x_athena_inc" ; then
12585         { echo "$as_me:12585: WARNING: Unable to successfully find Athena header files with test program" >&5
12586 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12587 elif test "$cf_x_athena_inc" != default ; then
12588         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12589 fi
12590
12591 cf_x_athena_root=$cf_x_athena
12592 cf_x_athena_lib=""
12593
12594 for cf_path in default \
12595         /usr/contrib/X11R6 \
12596         /usr/contrib/X11R5 \
12597         /usr/lib/X11R5 \
12598         /usr/local
12599 do
12600         for cf_lib in \
12601                 ${cf_x_athena_root} \
12602                 ${cf_x_athena_root}7 \
12603                 ${cf_x_athena_root}6
12604         do
12605         for cf_libs in \
12606                 "-l$cf_lib -lXmu" \
12607                 "-l$cf_lib -lXpm -lXmu" \
12608                 "-l${cf_lib}_s -lXmu_s"
12609         do
12610                 if test -z "$cf_x_athena_lib" ; then
12611                         cf_save="$LIBS"
12612                         cf_test=XawSimpleMenuAddGlobalActions
12613                         if test $cf_path != default ; then
12614                                 LIBS="-L$cf_path/lib $cf_libs $LIBS"
12615                                 echo "$as_me:12615: checking for $cf_libs in $cf_path" >&5
12616 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12617                         else
12618                                 LIBS="$cf_libs $LIBS"
12619                                 echo "$as_me:12619: checking for $cf_test in $cf_libs" >&5
12620 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12621                         fi
12622                         cat >conftest.$ac_ext <<_ACEOF
12623 #line 12623 "configure"
12624 #include "confdefs.h"
12625
12626 #include <X11/Intrinsic.h>
12627 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12628
12629 int
12630 main ()
12631 {
12632
12633 $cf_test((XtAppContext) 0)
12634   ;
12635   return 0;
12636 }
12637 _ACEOF
12638 rm -f conftest.$ac_objext conftest$ac_exeext
12639 if { (eval echo "$as_me:12639: \"$ac_link\"") >&5
12640   (eval $ac_link) 2>&5
12641   ac_status=$?
12642   echo "$as_me:12642: \$? = $ac_status" >&5
12643   (exit $ac_status); } &&
12644          { ac_try='test -s conftest$ac_exeext'
12645   { (eval echo "$as_me:12645: \"$ac_try\"") >&5
12646   (eval $ac_try) 2>&5
12647   ac_status=$?
12648   echo "$as_me:12648: \$? = $ac_status" >&5
12649   (exit $ac_status); }; }; then
12650   cf_result=yes
12651 else
12652   echo "$as_me: failed program was:" >&5
12653 cat conftest.$ac_ext >&5
12654 cf_result=no
12655 fi
12656 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12657                         echo "$as_me:12657: result: $cf_result" >&5
12658 echo "${ECHO_T}$cf_result" >&6
12659                         if test "$cf_result" = yes ; then
12660                                 cf_x_athena_lib="$cf_libs"
12661                                 break
12662                         fi
12663                         LIBS="$cf_save"
12664                 fi
12665         done # cf_libs
12666                 test -n "$cf_x_athena_lib" && break
12667         done # cf_lib
12668 done
12669
12670 if test -z "$cf_x_athena_lib" ; then
12671         { { echo "$as_me:12671: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12672 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12673    { (exit 1); exit 1; }; }
12674 fi
12675
12676 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12677
12678 cat >>confdefs.h <<EOF
12679 #define $cf_x_athena_LIBS 1
12680 EOF
12681
12682 fi
12683
12684 if test -n "$ac_tool_prefix"; then
12685   for ac_prog in xcurses-config
12686   do
12687     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12688 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12689 echo "$as_me:12689: checking for $ac_word" >&5
12690 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12691 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12692   echo $ECHO_N "(cached) $ECHO_C" >&6
12693 else
12694   if test -n "$XCURSES_CONFIG"; then
12695   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12696 else
12697   ac_save_IFS=$IFS; IFS=$ac_path_separator
12698 ac_dummy="$PATH"
12699 for ac_dir in $ac_dummy; do
12700   IFS=$ac_save_IFS
12701   test -z "$ac_dir" && ac_dir=.
12702   $as_executable_p "$ac_dir/$ac_word" || continue
12703 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12704 echo "$as_me:12704: found $ac_dir/$ac_word" >&5
12705 break
12706 done
12707
12708 fi
12709 fi
12710 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12711 if test -n "$XCURSES_CONFIG"; then
12712   echo "$as_me:12712: result: $XCURSES_CONFIG" >&5
12713 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12714 else
12715   echo "$as_me:12715: result: no" >&5
12716 echo "${ECHO_T}no" >&6
12717 fi
12718
12719     test -n "$XCURSES_CONFIG" && break
12720   done
12721 fi
12722 if test -z "$XCURSES_CONFIG"; then
12723   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12724   for ac_prog in xcurses-config
12725 do
12726   # Extract the first word of "$ac_prog", so it can be a program name with args.
12727 set dummy $ac_prog; ac_word=$2
12728 echo "$as_me:12728: checking for $ac_word" >&5
12729 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12730 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12731   echo $ECHO_N "(cached) $ECHO_C" >&6
12732 else
12733   if test -n "$ac_ct_XCURSES_CONFIG"; then
12734   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12735 else
12736   ac_save_IFS=$IFS; IFS=$ac_path_separator
12737 ac_dummy="$PATH"
12738 for ac_dir in $ac_dummy; do
12739   IFS=$ac_save_IFS
12740   test -z "$ac_dir" && ac_dir=.
12741   $as_executable_p "$ac_dir/$ac_word" || continue
12742 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12743 echo "$as_me:12743: found $ac_dir/$ac_word" >&5
12744 break
12745 done
12746
12747 fi
12748 fi
12749 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12750 if test -n "$ac_ct_XCURSES_CONFIG"; then
12751   echo "$as_me:12751: result: $ac_ct_XCURSES_CONFIG" >&5
12752 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12753 else
12754   echo "$as_me:12754: result: no" >&5
12755 echo "${ECHO_T}no" >&6
12756 fi
12757
12758   test -n "$ac_ct_XCURSES_CONFIG" && break
12759 done
12760 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12761
12762   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12763 fi
12764
12765 if test "$XCURSES_CONFIG" != none ; then
12766
12767 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12768 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
12769
12770 cf_cv_lib_XCurses=yes
12771
12772 else
12773
12774 LDFLAGS="$LDFLAGS $X_LIBS"
12775
12776 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12777
12778 echo "${as_me:-configure}:12778: testing checking additions to CFLAGS ..." 1>&5
12779
12780 cf_check_cflags="$CFLAGS"
12781 cf_check_cppflags="$CPPFLAGS"
12782
12783 cf_fix_cppflags=no
12784 cf_new_cflags=
12785 cf_new_cppflags=
12786 cf_new_extra_cppflags=
12787
12788 for cf_add_cflags in $X_CFLAGS
12789 do
12790 case $cf_fix_cppflags in
12791 no)
12792         case $cf_add_cflags in #(vi
12793         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12794                 case $cf_add_cflags in
12795                 -D*)
12796                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12797
12798                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12799                                 && test -z "${cf_tst_cflags}" \
12800                                 && cf_fix_cppflags=yes
12801
12802                         if test $cf_fix_cppflags = yes ; then
12803                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12804                                 continue
12805                         elif test "${cf_tst_cflags}" = "\"'" ; then
12806                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12807                                 continue
12808                         fi
12809                         ;;
12810                 esac
12811                 case "$CPPFLAGS" in
12812                 *$cf_add_cflags) #(vi
12813                         ;;
12814                 *) #(vi
12815                         case $cf_add_cflags in #(vi
12816                         -D*)
12817                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12818
12819 CPPFLAGS=`echo "$CPPFLAGS" | \
12820         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12821                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12822
12823                                 ;;
12824                         esac
12825                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12826                         ;;
12827                 esac
12828                 ;;
12829         *)
12830                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12831                 ;;
12832         esac
12833         ;;
12834 yes)
12835         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12836
12837         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12838
12839         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12840                 && test -z "${cf_tst_cflags}" \
12841                 && cf_fix_cppflags=no
12842         ;;
12843 esac
12844 done
12845
12846 if test -n "$cf_new_cflags" ; then
12847         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12848
12849 echo "${as_me:-configure}:12849: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12850
12851         CFLAGS="$CFLAGS $cf_new_cflags"
12852 fi
12853
12854 if test -n "$cf_new_cppflags" ; then
12855         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12856
12857 echo "${as_me:-configure}:12857: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12858
12859         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12860 fi
12861
12862 if test -n "$cf_new_extra_cppflags" ; then
12863         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12864
12865 echo "${as_me:-configure}:12865: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12866
12867         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12868 fi
12869
12870 if test "$cf_check_cflags" != "$CFLAGS" ; then
12871 cat >conftest.$ac_ext <<_ACEOF
12872 #line 12872 "configure"
12873 #include "confdefs.h"
12874 #include <stdio.h>
12875 int
12876 main ()
12877 {
12878 printf("Hello world");
12879   ;
12880   return 0;
12881 }
12882 _ACEOF
12883 rm -f conftest.$ac_objext conftest$ac_exeext
12884 if { (eval echo "$as_me:12884: \"$ac_link\"") >&5
12885   (eval $ac_link) 2>&5
12886   ac_status=$?
12887   echo "$as_me:12887: \$? = $ac_status" >&5
12888   (exit $ac_status); } &&
12889          { ac_try='test -s conftest$ac_exeext'
12890   { (eval echo "$as_me:12890: \"$ac_try\"") >&5
12891   (eval $ac_try) 2>&5
12892   ac_status=$?
12893   echo "$as_me:12893: \$? = $ac_status" >&5
12894   (exit $ac_status); }; }; then
12895   :
12896 else
12897   echo "$as_me: failed program was:" >&5
12898 cat conftest.$ac_ext >&5
12899 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12900
12901 echo "${as_me:-configure}:12901: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12902
12903          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
12904                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12905
12906 echo "${as_me:-configure}:12906: testing but keeping change to \$CPPFLAGS ..." 1>&5
12907
12908          fi
12909          CFLAGS="$cf_check_flags"
12910 fi
12911 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12912 fi
12913
12914 echo "$as_me:12914: checking for XOpenDisplay in -lX11" >&5
12915 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12916 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12917   echo $ECHO_N "(cached) $ECHO_C" >&6
12918 else
12919   ac_check_lib_save_LIBS=$LIBS
12920 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12921 cat >conftest.$ac_ext <<_ACEOF
12922 #line 12922 "configure"
12923 #include "confdefs.h"
12924
12925 /* Override any gcc2 internal prototype to avoid an error.  */
12926 #ifdef __cplusplus
12927 extern "C"
12928 #endif
12929 /* We use char because int might match the return type of a gcc2
12930    builtin and then its argument prototype would still apply.  */
12931 char XOpenDisplay ();
12932 int
12933 main ()
12934 {
12935 XOpenDisplay ();
12936   ;
12937   return 0;
12938 }
12939 _ACEOF
12940 rm -f conftest.$ac_objext conftest$ac_exeext
12941 if { (eval echo "$as_me:12941: \"$ac_link\"") >&5
12942   (eval $ac_link) 2>&5
12943   ac_status=$?
12944   echo "$as_me:12944: \$? = $ac_status" >&5
12945   (exit $ac_status); } &&
12946          { ac_try='test -s conftest$ac_exeext'
12947   { (eval echo "$as_me:12947: \"$ac_try\"") >&5
12948   (eval $ac_try) 2>&5
12949   ac_status=$?
12950   echo "$as_me:12950: \$? = $ac_status" >&5
12951   (exit $ac_status); }; }; then
12952   ac_cv_lib_X11_XOpenDisplay=yes
12953 else
12954   echo "$as_me: failed program was:" >&5
12955 cat conftest.$ac_ext >&5
12956 ac_cv_lib_X11_XOpenDisplay=no
12957 fi
12958 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12959 LIBS=$ac_check_lib_save_LIBS
12960 fi
12961 echo "$as_me:12961: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12962 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12963 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12964   LIBS="-lX11 $LIBS"
12965 fi
12966
12967 echo "$as_me:12967: checking for XCurses library" >&5
12968 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
12969 if test "${cf_cv_lib_XCurses+set}" = set; then
12970   echo $ECHO_N "(cached) $ECHO_C" >&6
12971 else
12972
12973 LIBS="-lXCurses $LIBS"
12974 cat >conftest.$ac_ext <<_ACEOF
12975 #line 12975 "configure"
12976 #include "confdefs.h"
12977
12978 #include <xcurses.h>
12979 char *XCursesProgramName = "test";
12980
12981 int
12982 main ()
12983 {
12984 XCursesExit();
12985   ;
12986   return 0;
12987 }
12988 _ACEOF
12989 rm -f conftest.$ac_objext conftest$ac_exeext
12990 if { (eval echo "$as_me:12990: \"$ac_link\"") >&5
12991   (eval $ac_link) 2>&5
12992   ac_status=$?
12993   echo "$as_me:12993: \$? = $ac_status" >&5
12994   (exit $ac_status); } &&
12995          { ac_try='test -s conftest$ac_exeext'
12996   { (eval echo "$as_me:12996: \"$ac_try\"") >&5
12997   (eval $ac_try) 2>&5
12998   ac_status=$?
12999   echo "$as_me:12999: \$? = $ac_status" >&5
13000   (exit $ac_status); }; }; then
13001   cf_cv_lib_XCurses=yes
13002 else
13003   echo "$as_me: failed program was:" >&5
13004 cat conftest.$ac_ext >&5
13005 cf_cv_lib_XCurses=no
13006 fi
13007 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13008
13009 fi
13010 echo "$as_me:13010: result: $cf_cv_lib_XCurses" >&5
13011 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
13012
13013 fi
13014
13015 if test $cf_cv_lib_XCurses = yes ; then
13016         cat >>confdefs.h <<\EOF
13017 #define UNIX 1
13018 EOF
13019
13020         cat >>confdefs.h <<\EOF
13021 #define XCURSES 1
13022 EOF
13023
13024         echo "$as_me:13024: checking for xcurses.h" >&5
13025 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
13026 if test "${ac_cv_header_xcurses_h+set}" = set; then
13027   echo $ECHO_N "(cached) $ECHO_C" >&6
13028 else
13029   cat >conftest.$ac_ext <<_ACEOF
13030 #line 13030 "configure"
13031 #include "confdefs.h"
13032 #include <xcurses.h>
13033 _ACEOF
13034 if { (eval echo "$as_me:13034: \"$ac_cpp conftest.$ac_ext\"") >&5
13035   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13036   ac_status=$?
13037   egrep -v '^ *\+' conftest.er1 >conftest.err
13038   rm -f conftest.er1
13039   cat conftest.err >&5
13040   echo "$as_me:13040: \$? = $ac_status" >&5
13041   (exit $ac_status); } >/dev/null; then
13042   if test -s conftest.err; then
13043     ac_cpp_err=$ac_c_preproc_warn_flag
13044   else
13045     ac_cpp_err=
13046   fi
13047 else
13048   ac_cpp_err=yes
13049 fi
13050 if test -z "$ac_cpp_err"; then
13051   ac_cv_header_xcurses_h=yes
13052 else
13053   echo "$as_me: failed program was:" >&5
13054   cat conftest.$ac_ext >&5
13055   ac_cv_header_xcurses_h=no
13056 fi
13057 rm -f conftest.err conftest.$ac_ext
13058 fi
13059 echo "$as_me:13059: result: $ac_cv_header_xcurses_h" >&5
13060 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
13061 if test $ac_cv_header_xcurses_h = yes; then
13062   cat >>confdefs.h <<\EOF
13063 #define HAVE_XCURSES 1
13064 EOF
13065
13066 fi
13067
13068 else
13069         { { echo "$as_me:13069: error: Cannot link with XCurses" >&5
13070 echo "$as_me: error: Cannot link with XCurses" >&2;}
13071    { (exit 1); exit 1; }; }
13072 fi
13073
13074         ;;
13075 esac
13076
13077 case $cf_cv_screen in
13078 curses|curses_*)
13079
13080 echo "$as_me:13080: checking for NetBSD form.h" >&5
13081 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
13082 if test "${cf_cv_netbsd_form_h+set}" = set; then
13083   echo $ECHO_N "(cached) $ECHO_C" >&6
13084 else
13085
13086 cat >conftest.$ac_ext <<_ACEOF
13087 #line 13087 "configure"
13088 #include "confdefs.h"
13089
13090 #include <${cf_cv_ncurses_header:-curses.h}>
13091 #include <form.h>
13092
13093 int
13094 main ()
13095 {
13096
13097         FORM *form;
13098         int y = current_field(form)->cursor_ypos;
13099         int x = current_field(form)->cursor_xpos;
13100
13101   ;
13102   return 0;
13103 }
13104 _ACEOF
13105 rm -f conftest.$ac_objext
13106 if { (eval echo "$as_me:13106: \"$ac_compile\"") >&5
13107   (eval $ac_compile) 2>&5
13108   ac_status=$?
13109   echo "$as_me:13109: \$? = $ac_status" >&5
13110   (exit $ac_status); } &&
13111          { ac_try='test -s conftest.$ac_objext'
13112   { (eval echo "$as_me:13112: \"$ac_try\"") >&5
13113   (eval $ac_try) 2>&5
13114   ac_status=$?
13115   echo "$as_me:13115: \$? = $ac_status" >&5
13116   (exit $ac_status); }; }; then
13117   cf_cv_netbsd_form_h=yes
13118
13119 else
13120   echo "$as_me: failed program was:" >&5
13121 cat conftest.$ac_ext >&5
13122 cf_cv_netbsd_form_h=no
13123 fi
13124 rm -f conftest.$ac_objext conftest.$ac_ext
13125
13126 fi
13127 echo "$as_me:13127: result: $cf_cv_netbsd_form_h" >&5
13128 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13129
13130 test "$cf_cv_netbsd_form_h" = yes && cat >>confdefs.h <<\EOF
13131 #define HAVE_NETBSD_FORM_H 1
13132 EOF
13133
13134 echo "$as_me:13134: checking for NetBSD menu.h" >&5
13135 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13136 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13137   echo $ECHO_N "(cached) $ECHO_C" >&6
13138 else
13139
13140 cat >conftest.$ac_ext <<_ACEOF
13141 #line 13141 "configure"
13142 #include "confdefs.h"
13143
13144 #include <${cf_cv_ncurses_header:-curses.h}>
13145 #include <menu.h>
13146
13147 int
13148 main ()
13149 {
13150
13151         MENU *menu;
13152         int y = menu->max_item_width;
13153
13154   ;
13155   return 0;
13156 }
13157 _ACEOF
13158 rm -f conftest.$ac_objext
13159 if { (eval echo "$as_me:13159: \"$ac_compile\"") >&5
13160   (eval $ac_compile) 2>&5
13161   ac_status=$?
13162   echo "$as_me:13162: \$? = $ac_status" >&5
13163   (exit $ac_status); } &&
13164          { ac_try='test -s conftest.$ac_objext'
13165   { (eval echo "$as_me:13165: \"$ac_try\"") >&5
13166   (eval $ac_try) 2>&5
13167   ac_status=$?
13168   echo "$as_me:13168: \$? = $ac_status" >&5
13169   (exit $ac_status); }; }; then
13170   cf_cv_netbsd_menu_h=yes
13171
13172 else
13173   echo "$as_me: failed program was:" >&5
13174 cat conftest.$ac_ext >&5
13175 cf_cv_netbsd_menu_h=no
13176 fi
13177 rm -f conftest.$ac_objext conftest.$ac_ext
13178
13179 fi
13180 echo "$as_me:13180: result: $cf_cv_netbsd_menu_h" >&5
13181 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13182
13183 test "$cf_cv_netbsd_menu_h" = yes && cat >>confdefs.h <<\EOF
13184 #define HAVE_NETBSD_MENU_H 1
13185 EOF
13186
13187         ;;
13188 ncursesw)
13189         cf_cv_libtype=w
13190         ;;
13191 esac
13192
13193 case $cf_cv_screen in #(vi
13194 pdcurses) #(vi
13195         ;;
13196 *)
13197         # look for curses-related libraries
13198
13199 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13200 echo "$as_me:13200: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13201 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13202 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13203   echo $ECHO_N "(cached) $ECHO_C" >&6
13204 else
13205   ac_check_lib_save_LIBS=$LIBS
13206 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13207 cat >conftest.$ac_ext <<_ACEOF
13208 #line 13208 "configure"
13209 #include "confdefs.h"
13210
13211 /* Override any gcc2 internal prototype to avoid an error.  */
13212 #ifdef __cplusplus
13213 extern "C"
13214 #endif
13215 /* We use char because int might match the return type of a gcc2
13216    builtin and then its argument prototype would still apply.  */
13217 char new_panel ();
13218 int
13219 main ()
13220 {
13221 new_panel ();
13222   ;
13223   return 0;
13224 }
13225 _ACEOF
13226 rm -f conftest.$ac_objext conftest$ac_exeext
13227 if { (eval echo "$as_me:13227: \"$ac_link\"") >&5
13228   (eval $ac_link) 2>&5
13229   ac_status=$?
13230   echo "$as_me:13230: \$? = $ac_status" >&5
13231   (exit $ac_status); } &&
13232          { ac_try='test -s conftest$ac_exeext'
13233   { (eval echo "$as_me:13233: \"$ac_try\"") >&5
13234   (eval $ac_try) 2>&5
13235   ac_status=$?
13236   echo "$as_me:13236: \$? = $ac_status" >&5
13237   (exit $ac_status); }; }; then
13238   eval "$as_ac_Lib=yes"
13239 else
13240   echo "$as_me: failed program was:" >&5
13241 cat conftest.$ac_ext >&5
13242 eval "$as_ac_Lib=no"
13243 fi
13244 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13245 LIBS=$ac_check_lib_save_LIBS
13246 fi
13247 echo "$as_me:13247: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13248 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13249 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13250   cat >>confdefs.h <<EOF
13251 #define `echo "HAVE_LIBpanel$cf_cv_libtype" | $as_tr_cpp` 1
13252 EOF
13253
13254   LIBS="-lpanel$cf_cv_libtype $LIBS"
13255
13256 fi
13257
13258 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13259 echo "$as_me:13259: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13260 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13261 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13262   echo $ECHO_N "(cached) $ECHO_C" >&6
13263 else
13264   ac_check_lib_save_LIBS=$LIBS
13265 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13266 cat >conftest.$ac_ext <<_ACEOF
13267 #line 13267 "configure"
13268 #include "confdefs.h"
13269
13270 /* Override any gcc2 internal prototype to avoid an error.  */
13271 #ifdef __cplusplus
13272 extern "C"
13273 #endif
13274 /* We use char because int might match the return type of a gcc2
13275    builtin and then its argument prototype would still apply.  */
13276 char menu_driver ();
13277 int
13278 main ()
13279 {
13280 menu_driver ();
13281   ;
13282   return 0;
13283 }
13284 _ACEOF
13285 rm -f conftest.$ac_objext conftest$ac_exeext
13286 if { (eval echo "$as_me:13286: \"$ac_link\"") >&5
13287   (eval $ac_link) 2>&5
13288   ac_status=$?
13289   echo "$as_me:13289: \$? = $ac_status" >&5
13290   (exit $ac_status); } &&
13291          { ac_try='test -s conftest$ac_exeext'
13292   { (eval echo "$as_me:13292: \"$ac_try\"") >&5
13293   (eval $ac_try) 2>&5
13294   ac_status=$?
13295   echo "$as_me:13295: \$? = $ac_status" >&5
13296   (exit $ac_status); }; }; then
13297   eval "$as_ac_Lib=yes"
13298 else
13299   echo "$as_me: failed program was:" >&5
13300 cat conftest.$ac_ext >&5
13301 eval "$as_ac_Lib=no"
13302 fi
13303 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13304 LIBS=$ac_check_lib_save_LIBS
13305 fi
13306 echo "$as_me:13306: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13307 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13308 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13309   cat >>confdefs.h <<EOF
13310 #define `echo "HAVE_LIBmenu$cf_cv_libtype" | $as_tr_cpp` 1
13311 EOF
13312
13313   LIBS="-lmenu$cf_cv_libtype $LIBS"
13314
13315 fi
13316
13317 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13318 echo "$as_me:13318: checking for form_driver in -lform$cf_cv_libtype" >&5
13319 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13320 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13321   echo $ECHO_N "(cached) $ECHO_C" >&6
13322 else
13323   ac_check_lib_save_LIBS=$LIBS
13324 LIBS="-lform$cf_cv_libtype  $LIBS"
13325 cat >conftest.$ac_ext <<_ACEOF
13326 #line 13326 "configure"
13327 #include "confdefs.h"
13328
13329 /* Override any gcc2 internal prototype to avoid an error.  */
13330 #ifdef __cplusplus
13331 extern "C"
13332 #endif
13333 /* We use char because int might match the return type of a gcc2
13334    builtin and then its argument prototype would still apply.  */
13335 char form_driver ();
13336 int
13337 main ()
13338 {
13339 form_driver ();
13340   ;
13341   return 0;
13342 }
13343 _ACEOF
13344 rm -f conftest.$ac_objext conftest$ac_exeext
13345 if { (eval echo "$as_me:13345: \"$ac_link\"") >&5
13346   (eval $ac_link) 2>&5
13347   ac_status=$?
13348   echo "$as_me:13348: \$? = $ac_status" >&5
13349   (exit $ac_status); } &&
13350          { ac_try='test -s conftest$ac_exeext'
13351   { (eval echo "$as_me:13351: \"$ac_try\"") >&5
13352   (eval $ac_try) 2>&5
13353   ac_status=$?
13354   echo "$as_me:13354: \$? = $ac_status" >&5
13355   (exit $ac_status); }; }; then
13356   eval "$as_ac_Lib=yes"
13357 else
13358   echo "$as_me: failed program was:" >&5
13359 cat conftest.$ac_ext >&5
13360 eval "$as_ac_Lib=no"
13361 fi
13362 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13363 LIBS=$ac_check_lib_save_LIBS
13364 fi
13365 echo "$as_me:13365: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13366 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13367 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13368   cat >>confdefs.h <<EOF
13369 #define `echo "HAVE_LIBform$cf_cv_libtype" | $as_tr_cpp` 1
13370 EOF
13371
13372   LIBS="-lform$cf_cv_libtype $LIBS"
13373
13374 fi
13375
13376         # look for curses-related headers
13377
13378 for ac_header in \
13379                 nc_alloc.h \
13380                 nomacros.h \
13381                 form.h \
13382                 menu.h \
13383                 panel.h \
13384                 term_entry.h \
13385
13386 do
13387 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13388 echo "$as_me:13388: checking for $ac_header" >&5
13389 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13390 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13391   echo $ECHO_N "(cached) $ECHO_C" >&6
13392 else
13393   cat >conftest.$ac_ext <<_ACEOF
13394 #line 13394 "configure"
13395 #include "confdefs.h"
13396 #include <$ac_header>
13397 _ACEOF
13398 if { (eval echo "$as_me:13398: \"$ac_cpp conftest.$ac_ext\"") >&5
13399   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13400   ac_status=$?
13401   egrep -v '^ *\+' conftest.er1 >conftest.err
13402   rm -f conftest.er1
13403   cat conftest.err >&5
13404   echo "$as_me:13404: \$? = $ac_status" >&5
13405   (exit $ac_status); } >/dev/null; then
13406   if test -s conftest.err; then
13407     ac_cpp_err=$ac_c_preproc_warn_flag
13408   else
13409     ac_cpp_err=
13410   fi
13411 else
13412   ac_cpp_err=yes
13413 fi
13414 if test -z "$ac_cpp_err"; then
13415   eval "$as_ac_Header=yes"
13416 else
13417   echo "$as_me: failed program was:" >&5
13418   cat conftest.$ac_ext >&5
13419   eval "$as_ac_Header=no"
13420 fi
13421 rm -f conftest.err conftest.$ac_ext
13422 fi
13423 echo "$as_me:13423: result: `eval echo '${'$as_ac_Header'}'`" >&5
13424 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13425 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13426   cat >>confdefs.h <<EOF
13427 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13428 EOF
13429
13430 fi
13431 done
13432
13433         ;;
13434 esac
13435
13436 echo "$as_me:13436: checking return type of signal handlers" >&5
13437 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
13438 if test "${ac_cv_type_signal+set}" = set; then
13439   echo $ECHO_N "(cached) $ECHO_C" >&6
13440 else
13441   cat >conftest.$ac_ext <<_ACEOF
13442 #line 13442 "configure"
13443 #include "confdefs.h"
13444 #include <sys/types.h>
13445 #include <signal.h>
13446 #ifdef signal
13447 # undef signal
13448 #endif
13449 #ifdef __cplusplus
13450 extern "C" void (*signal (int, void (*)(int)))(int);
13451 #else
13452 void (*signal ()) ();
13453 #endif
13454
13455 int
13456 main ()
13457 {
13458 int i;
13459   ;
13460   return 0;
13461 }
13462 _ACEOF
13463 rm -f conftest.$ac_objext
13464 if { (eval echo "$as_me:13464: \"$ac_compile\"") >&5
13465   (eval $ac_compile) 2>&5
13466   ac_status=$?
13467   echo "$as_me:13467: \$? = $ac_status" >&5
13468   (exit $ac_status); } &&
13469          { ac_try='test -s conftest.$ac_objext'
13470   { (eval echo "$as_me:13470: \"$ac_try\"") >&5
13471   (eval $ac_try) 2>&5
13472   ac_status=$?
13473   echo "$as_me:13473: \$? = $ac_status" >&5
13474   (exit $ac_status); }; }; then
13475   ac_cv_type_signal=void
13476 else
13477   echo "$as_me: failed program was:" >&5
13478 cat conftest.$ac_ext >&5
13479 ac_cv_type_signal=int
13480 fi
13481 rm -f conftest.$ac_objext conftest.$ac_ext
13482 fi
13483 echo "$as_me:13483: result: $ac_cv_type_signal" >&5
13484 echo "${ECHO_T}$ac_cv_type_signal" >&6
13485
13486 cat >>confdefs.h <<EOF
13487 #define RETSIGTYPE $ac_cv_type_signal
13488 EOF
13489
13490 echo "$as_me:13490: checking for ANSI C header files" >&5
13491 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13492 if test "${ac_cv_header_stdc+set}" = set; then
13493   echo $ECHO_N "(cached) $ECHO_C" >&6
13494 else
13495   cat >conftest.$ac_ext <<_ACEOF
13496 #line 13496 "configure"
13497 #include "confdefs.h"
13498 #include <stdlib.h>
13499 #include <stdarg.h>
13500 #include <string.h>
13501 #include <float.h>
13502
13503 _ACEOF
13504 if { (eval echo "$as_me:13504: \"$ac_cpp conftest.$ac_ext\"") >&5
13505   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13506   ac_status=$?
13507   egrep -v '^ *\+' conftest.er1 >conftest.err
13508   rm -f conftest.er1
13509   cat conftest.err >&5
13510   echo "$as_me:13510: \$? = $ac_status" >&5
13511   (exit $ac_status); } >/dev/null; then
13512   if test -s conftest.err; then
13513     ac_cpp_err=$ac_c_preproc_warn_flag
13514   else
13515     ac_cpp_err=
13516   fi
13517 else
13518   ac_cpp_err=yes
13519 fi
13520 if test -z "$ac_cpp_err"; then
13521   ac_cv_header_stdc=yes
13522 else
13523   echo "$as_me: failed program was:" >&5
13524   cat conftest.$ac_ext >&5
13525   ac_cv_header_stdc=no
13526 fi
13527 rm -f conftest.err conftest.$ac_ext
13528
13529 if test $ac_cv_header_stdc = yes; then
13530   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13531   cat >conftest.$ac_ext <<_ACEOF
13532 #line 13532 "configure"
13533 #include "confdefs.h"
13534 #include <string.h>
13535
13536 _ACEOF
13537 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13538   egrep "memchr" >/dev/null 2>&1; then
13539   :
13540 else
13541   ac_cv_header_stdc=no
13542 fi
13543 rm -rf conftest*
13544
13545 fi
13546
13547 if test $ac_cv_header_stdc = yes; then
13548   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13549   cat >conftest.$ac_ext <<_ACEOF
13550 #line 13550 "configure"
13551 #include "confdefs.h"
13552 #include <stdlib.h>
13553
13554 _ACEOF
13555 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13556   egrep "free" >/dev/null 2>&1; then
13557   :
13558 else
13559   ac_cv_header_stdc=no
13560 fi
13561 rm -rf conftest*
13562
13563 fi
13564
13565 if test $ac_cv_header_stdc = yes; then
13566   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13567   if test "$cross_compiling" = yes; then
13568   :
13569 else
13570   cat >conftest.$ac_ext <<_ACEOF
13571 #line 13571 "configure"
13572 #include "confdefs.h"
13573 #include <ctype.h>
13574 #if ((' ' & 0x0FF) == 0x020)
13575 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13576 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13577 #else
13578 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13579                      || ('j' <= (c) && (c) <= 'r') \
13580                      || ('s' <= (c) && (c) <= 'z'))
13581 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13582 #endif
13583
13584 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13585 int
13586 main ()
13587 {
13588   int i;
13589   for (i = 0; i < 256; i++)
13590     if (XOR (islower (i), ISLOWER (i))
13591         || toupper (i) != TOUPPER (i))
13592       $ac_main_return(2);
13593   $ac_main_return (0);
13594 }
13595 _ACEOF
13596 rm -f conftest$ac_exeext
13597 if { (eval echo "$as_me:13597: \"$ac_link\"") >&5
13598   (eval $ac_link) 2>&5
13599   ac_status=$?
13600   echo "$as_me:13600: \$? = $ac_status" >&5
13601   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13602   { (eval echo "$as_me:13602: \"$ac_try\"") >&5
13603   (eval $ac_try) 2>&5
13604   ac_status=$?
13605   echo "$as_me:13605: \$? = $ac_status" >&5
13606   (exit $ac_status); }; }; then
13607   :
13608 else
13609   echo "$as_me: program exited with status $ac_status" >&5
13610 echo "$as_me: failed program was:" >&5
13611 cat conftest.$ac_ext >&5
13612 ac_cv_header_stdc=no
13613 fi
13614 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13615 fi
13616 fi
13617 fi
13618 echo "$as_me:13618: result: $ac_cv_header_stdc" >&5
13619 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13620 if test $ac_cv_header_stdc = yes; then
13621
13622 cat >>confdefs.h <<\EOF
13623 #define STDC_HEADERS 1
13624 EOF
13625
13626 fi
13627
13628 echo "$as_me:13628: checking whether time.h and sys/time.h may both be included" >&5
13629 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13630 if test "${ac_cv_header_time+set}" = set; then
13631   echo $ECHO_N "(cached) $ECHO_C" >&6
13632 else
13633   cat >conftest.$ac_ext <<_ACEOF
13634 #line 13634 "configure"
13635 #include "confdefs.h"
13636 #include <sys/types.h>
13637 #include <sys/time.h>
13638 #include <time.h>
13639
13640 int
13641 main ()
13642 {
13643 if ((struct tm *) 0)
13644 return 0;
13645   ;
13646   return 0;
13647 }
13648 _ACEOF
13649 rm -f conftest.$ac_objext
13650 if { (eval echo "$as_me:13650: \"$ac_compile\"") >&5
13651   (eval $ac_compile) 2>&5
13652   ac_status=$?
13653   echo "$as_me:13653: \$? = $ac_status" >&5
13654   (exit $ac_status); } &&
13655          { ac_try='test -s conftest.$ac_objext'
13656   { (eval echo "$as_me:13656: \"$ac_try\"") >&5
13657   (eval $ac_try) 2>&5
13658   ac_status=$?
13659   echo "$as_me:13659: \$? = $ac_status" >&5
13660   (exit $ac_status); }; }; then
13661   ac_cv_header_time=yes
13662 else
13663   echo "$as_me: failed program was:" >&5
13664 cat conftest.$ac_ext >&5
13665 ac_cv_header_time=no
13666 fi
13667 rm -f conftest.$ac_objext conftest.$ac_ext
13668 fi
13669 echo "$as_me:13669: result: $ac_cv_header_time" >&5
13670 echo "${ECHO_T}$ac_cv_header_time" >&6
13671 if test $ac_cv_header_time = yes; then
13672
13673 cat >>confdefs.h <<\EOF
13674 #define TIME_WITH_SYS_TIME 1
13675 EOF
13676
13677 fi
13678
13679 for ac_header in \
13680 getopt.h \
13681 locale.h \
13682 math.h \
13683 stdarg.h \
13684 sys/ioctl.h \
13685 sys/select.h \
13686 sys/time.h \
13687 termios.h \
13688 unistd.h \
13689
13690 do
13691 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13692 echo "$as_me:13692: checking for $ac_header" >&5
13693 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13694 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13695   echo $ECHO_N "(cached) $ECHO_C" >&6
13696 else
13697   cat >conftest.$ac_ext <<_ACEOF
13698 #line 13698 "configure"
13699 #include "confdefs.h"
13700 #include <$ac_header>
13701 _ACEOF
13702 if { (eval echo "$as_me:13702: \"$ac_cpp conftest.$ac_ext\"") >&5
13703   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13704   ac_status=$?
13705   egrep -v '^ *\+' conftest.er1 >conftest.err
13706   rm -f conftest.er1
13707   cat conftest.err >&5
13708   echo "$as_me:13708: \$? = $ac_status" >&5
13709   (exit $ac_status); } >/dev/null; then
13710   if test -s conftest.err; then
13711     ac_cpp_err=$ac_c_preproc_warn_flag
13712   else
13713     ac_cpp_err=
13714   fi
13715 else
13716   ac_cpp_err=yes
13717 fi
13718 if test -z "$ac_cpp_err"; then
13719   eval "$as_ac_Header=yes"
13720 else
13721   echo "$as_me: failed program was:" >&5
13722   cat conftest.$ac_ext >&5
13723   eval "$as_ac_Header=no"
13724 fi
13725 rm -f conftest.err conftest.$ac_ext
13726 fi
13727 echo "$as_me:13727: result: `eval echo '${'$as_ac_Header'}'`" >&5
13728 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13729 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13730   cat >>confdefs.h <<EOF
13731 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13732 EOF
13733
13734 fi
13735 done
13736
13737 for ac_header in unistd.h getopt.h
13738 do
13739 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13740 echo "$as_me:13740: checking for $ac_header" >&5
13741 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13742 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13743   echo $ECHO_N "(cached) $ECHO_C" >&6
13744 else
13745   cat >conftest.$ac_ext <<_ACEOF
13746 #line 13746 "configure"
13747 #include "confdefs.h"
13748 #include <$ac_header>
13749 _ACEOF
13750 if { (eval echo "$as_me:13750: \"$ac_cpp conftest.$ac_ext\"") >&5
13751   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13752   ac_status=$?
13753   egrep -v '^ *\+' conftest.er1 >conftest.err
13754   rm -f conftest.er1
13755   cat conftest.err >&5
13756   echo "$as_me:13756: \$? = $ac_status" >&5
13757   (exit $ac_status); } >/dev/null; then
13758   if test -s conftest.err; then
13759     ac_cpp_err=$ac_c_preproc_warn_flag
13760   else
13761     ac_cpp_err=
13762   fi
13763 else
13764   ac_cpp_err=yes
13765 fi
13766 if test -z "$ac_cpp_err"; then
13767   eval "$as_ac_Header=yes"
13768 else
13769   echo "$as_me: failed program was:" >&5
13770   cat conftest.$ac_ext >&5
13771   eval "$as_ac_Header=no"
13772 fi
13773 rm -f conftest.err conftest.$ac_ext
13774 fi
13775 echo "$as_me:13775: result: `eval echo '${'$as_ac_Header'}'`" >&5
13776 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13777 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13778   cat >>confdefs.h <<EOF
13779 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13780 EOF
13781
13782 fi
13783 done
13784
13785 echo "$as_me:13785: checking for header declaring getopt variables" >&5
13786 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13787 if test "${cf_cv_getopt_header+set}" = set; then
13788   echo $ECHO_N "(cached) $ECHO_C" >&6
13789 else
13790
13791 cf_cv_getopt_header=none
13792 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13793 do
13794 cat >conftest.$ac_ext <<_ACEOF
13795 #line 13795 "configure"
13796 #include "confdefs.h"
13797
13798 #include <$cf_header>
13799 int
13800 main ()
13801 {
13802 int x = optind; char *y = optarg
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_getopt_header=$cf_header
13820  break
13821 else
13822   echo "$as_me: failed program was:" >&5
13823 cat conftest.$ac_ext >&5
13824 fi
13825 rm -f conftest.$ac_objext conftest.$ac_ext
13826 done
13827
13828 fi
13829 echo "$as_me:13829: result: $cf_cv_getopt_header" >&5
13830 echo "${ECHO_T}$cf_cv_getopt_header" >&6
13831 if test $cf_cv_getopt_header != none ; then
13832         cat >>confdefs.h <<\EOF
13833 #define HAVE_GETOPT_HEADER 1
13834 EOF
13835
13836 fi
13837
13838 for ac_func in \
13839 gettimeofday \
13840 strdup \
13841
13842 do
13843 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13844 echo "$as_me:13844: checking for $ac_func" >&5
13845 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13846 if eval "test \"\${$as_ac_var+set}\" = set"; then
13847   echo $ECHO_N "(cached) $ECHO_C" >&6
13848 else
13849   cat >conftest.$ac_ext <<_ACEOF
13850 #line 13850 "configure"
13851 #include "confdefs.h"
13852 /* System header to define __stub macros and hopefully few prototypes,
13853     which can conflict with char $ac_func (); below.  */
13854 #include <assert.h>
13855 /* Override any gcc2 internal prototype to avoid an error.  */
13856 #ifdef __cplusplus
13857 extern "C"
13858 #endif
13859 /* We use char because int might match the return type of a gcc2
13860    builtin and then its argument prototype would still apply.  */
13861 char $ac_func ();
13862 char (*f) ();
13863
13864 int
13865 main ()
13866 {
13867 /* The GNU C library defines this for functions which it implements
13868     to always fail with ENOSYS.  Some functions are actually named
13869     something starting with __ and the normal name is an alias.  */
13870 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13871 choke me
13872 #else
13873 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13874 #endif
13875
13876   ;
13877   return 0;
13878 }
13879 _ACEOF
13880 rm -f conftest.$ac_objext conftest$ac_exeext
13881 if { (eval echo "$as_me:13881: \"$ac_link\"") >&5
13882   (eval $ac_link) 2>&5
13883   ac_status=$?
13884   echo "$as_me:13884: \$? = $ac_status" >&5
13885   (exit $ac_status); } &&
13886          { ac_try='test -s conftest$ac_exeext'
13887   { (eval echo "$as_me:13887: \"$ac_try\"") >&5
13888   (eval $ac_try) 2>&5
13889   ac_status=$?
13890   echo "$as_me:13890: \$? = $ac_status" >&5
13891   (exit $ac_status); }; }; then
13892   eval "$as_ac_var=yes"
13893 else
13894   echo "$as_me: failed program was:" >&5
13895 cat conftest.$ac_ext >&5
13896 eval "$as_ac_var=no"
13897 fi
13898 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13899 fi
13900 echo "$as_me:13900: result: `eval echo '${'$as_ac_var'}'`" >&5
13901 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13902 if test `eval echo '${'$as_ac_var'}'` = yes; then
13903   cat >>confdefs.h <<EOF
13904 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13905 EOF
13906
13907 fi
13908 done
13909
13910 if test "$cf_enable_widec" = yes; then
13911
13912 for ac_func in \
13913 mblen \
13914 mbrlen \
13915 mbrtowc \
13916 mbsrtowcs \
13917 mbstowcs \
13918 mbtowc \
13919 wcsrtombs \
13920 wcstombs \
13921
13922 do
13923 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13924 echo "$as_me:13924: checking for $ac_func" >&5
13925 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13926 if eval "test \"\${$as_ac_var+set}\" = set"; then
13927   echo $ECHO_N "(cached) $ECHO_C" >&6
13928 else
13929   cat >conftest.$ac_ext <<_ACEOF
13930 #line 13930 "configure"
13931 #include "confdefs.h"
13932 /* System header to define __stub macros and hopefully few prototypes,
13933     which can conflict with char $ac_func (); below.  */
13934 #include <assert.h>
13935 /* Override any gcc2 internal prototype to avoid an error.  */
13936 #ifdef __cplusplus
13937 extern "C"
13938 #endif
13939 /* We use char because int might match the return type of a gcc2
13940    builtin and then its argument prototype would still apply.  */
13941 char $ac_func ();
13942 char (*f) ();
13943
13944 int
13945 main ()
13946 {
13947 /* The GNU C library defines this for functions which it implements
13948     to always fail with ENOSYS.  Some functions are actually named
13949     something starting with __ and the normal name is an alias.  */
13950 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13951 choke me
13952 #else
13953 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13954 #endif
13955
13956   ;
13957   return 0;
13958 }
13959 _ACEOF
13960 rm -f conftest.$ac_objext conftest$ac_exeext
13961 if { (eval echo "$as_me:13961: \"$ac_link\"") >&5
13962   (eval $ac_link) 2>&5
13963   ac_status=$?
13964   echo "$as_me:13964: \$? = $ac_status" >&5
13965   (exit $ac_status); } &&
13966          { ac_try='test -s conftest$ac_exeext'
13967   { (eval echo "$as_me:13967: \"$ac_try\"") >&5
13968   (eval $ac_try) 2>&5
13969   ac_status=$?
13970   echo "$as_me:13970: \$? = $ac_status" >&5
13971   (exit $ac_status); }; }; then
13972   eval "$as_ac_var=yes"
13973 else
13974   echo "$as_me: failed program was:" >&5
13975 cat conftest.$ac_ext >&5
13976 eval "$as_ac_var=no"
13977 fi
13978 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13979 fi
13980 echo "$as_me:13980: result: `eval echo '${'$as_ac_var'}'`" >&5
13981 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13982 if test `eval echo '${'$as_ac_var'}'` = yes; then
13983   cat >>confdefs.h <<EOF
13984 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13985 EOF
13986
13987 fi
13988 done
13989
13990 fi
13991
13992 echo "$as_me:13992: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
13993 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
13994 if test "${cf_cv_need_xopen_extension+set}" = set; then
13995   echo $ECHO_N "(cached) $ECHO_C" >&6
13996 else
13997
13998 cat >conftest.$ac_ext <<_ACEOF
13999 #line 13999 "configure"
14000 #include "confdefs.h"
14001
14002 #include <stdlib.h>
14003 #include <${cf_cv_ncurses_header:-curses.h}>
14004 int
14005 main ()
14006 {
14007
14008 #if defined(NCURSES_VERSION_PATCH)
14009 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
14010         make an error
14011 #endif
14012 #endif
14013         long x = winnstr(stdscr, "", 0);
14014         int x1, y1;
14015         getbegyx(stdscr, y1, x1)
14016   ;
14017   return 0;
14018 }
14019 _ACEOF
14020 rm -f conftest.$ac_objext conftest$ac_exeext
14021 if { (eval echo "$as_me:14021: \"$ac_link\"") >&5
14022   (eval $ac_link) 2>&5
14023   ac_status=$?
14024   echo "$as_me:14024: \$? = $ac_status" >&5
14025   (exit $ac_status); } &&
14026          { ac_try='test -s conftest$ac_exeext'
14027   { (eval echo "$as_me:14027: \"$ac_try\"") >&5
14028   (eval $ac_try) 2>&5
14029   ac_status=$?
14030   echo "$as_me:14030: \$? = $ac_status" >&5
14031   (exit $ac_status); }; }; then
14032   cf_cv_need_xopen_extension=no
14033 else
14034   echo "$as_me: failed program was:" >&5
14035 cat conftest.$ac_ext >&5
14036 cat >conftest.$ac_ext <<_ACEOF
14037 #line 14037 "configure"
14038 #include "confdefs.h"
14039
14040 #define _XOPEN_SOURCE_EXTENDED
14041 #include <stdlib.h>
14042 #include <${cf_cv_ncurses_header:-curses.h}>
14043 int
14044 main ()
14045 {
14046
14047 #ifdef NCURSES_VERSION
14048         cchar_t check;
14049         int check2 = curs_set((int)sizeof(check));
14050 #endif
14051         long x = winnstr(stdscr, "", 0);
14052         int x1, y1;
14053         getbegyx(stdscr, y1, x1)
14054   ;
14055   return 0;
14056 }
14057 _ACEOF
14058 rm -f conftest.$ac_objext conftest$ac_exeext
14059 if { (eval echo "$as_me:14059: \"$ac_link\"") >&5
14060   (eval $ac_link) 2>&5
14061   ac_status=$?
14062   echo "$as_me:14062: \$? = $ac_status" >&5
14063   (exit $ac_status); } &&
14064          { ac_try='test -s conftest$ac_exeext'
14065   { (eval echo "$as_me:14065: \"$ac_try\"") >&5
14066   (eval $ac_try) 2>&5
14067   ac_status=$?
14068   echo "$as_me:14068: \$? = $ac_status" >&5
14069   (exit $ac_status); }; }; then
14070   cf_cv_need_xopen_extension=yes
14071 else
14072   echo "$as_me: failed program was:" >&5
14073 cat conftest.$ac_ext >&5
14074 cf_cv_need_xopen_extension=unknown
14075 fi
14076 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14077 fi
14078 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14079 fi
14080 echo "$as_me:14080: result: $cf_cv_need_xopen_extension" >&5
14081 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14082 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
14083
14084 echo "$as_me:14084: checking for term.h" >&5
14085 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14086 if test "${cf_cv_term_header+set}" = set; then
14087   echo $ECHO_N "(cached) $ECHO_C" >&6
14088 else
14089
14090 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14091 # for <term.h> if we do not find the variant.
14092
14093 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14094
14095 case ${cf_cv_ncurses_header:-curses.h} in #(vi
14096 */*)
14097         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14098         cf_header_list="$cf_header_item $cf_header_list"
14099         ;;
14100 esac
14101
14102 for cf_header in $cf_header_list
14103 do
14104         cat >conftest.$ac_ext <<_ACEOF
14105 #line 14105 "configure"
14106 #include "confdefs.h"
14107
14108 #include <${cf_cv_ncurses_header:-curses.h}>
14109 #include <${cf_header}>
14110 int
14111 main ()
14112 {
14113 WINDOW *x
14114   ;
14115   return 0;
14116 }
14117 _ACEOF
14118 rm -f conftest.$ac_objext
14119 if { (eval echo "$as_me:14119: \"$ac_compile\"") >&5
14120   (eval $ac_compile) 2>&5
14121   ac_status=$?
14122   echo "$as_me:14122: \$? = $ac_status" >&5
14123   (exit $ac_status); } &&
14124          { ac_try='test -s conftest.$ac_objext'
14125   { (eval echo "$as_me:14125: \"$ac_try\"") >&5
14126   (eval $ac_try) 2>&5
14127   ac_status=$?
14128   echo "$as_me:14128: \$? = $ac_status" >&5
14129   (exit $ac_status); }; }; then
14130   cf_cv_term_header=$cf_header
14131          break
14132 else
14133   echo "$as_me: failed program was:" >&5
14134 cat conftest.$ac_ext >&5
14135 cf_cv_term_header=no
14136 fi
14137 rm -f conftest.$ac_objext conftest.$ac_ext
14138 done
14139
14140 case $cf_cv_term_header in #(vi
14141 no)
14142         # If curses is ncurses, some packagers still mess it up by trying to make
14143         # us use GNU termcap.  This handles the most common case.
14144         for cf_header in ncurses/term.h ncursesw/term.h
14145         do
14146                 cat >conftest.$ac_ext <<_ACEOF
14147 #line 14147 "configure"
14148 #include "confdefs.h"
14149
14150 #include <${cf_cv_ncurses_header:-curses.h}>
14151 #ifdef NCURSES_VERSION
14152 #include <${cf_header}>
14153 #else
14154 make an error
14155 #endif
14156 int
14157 main ()
14158 {
14159 WINDOW *x
14160   ;
14161   return 0;
14162 }
14163 _ACEOF
14164 rm -f conftest.$ac_objext
14165 if { (eval echo "$as_me:14165: \"$ac_compile\"") >&5
14166   (eval $ac_compile) 2>&5
14167   ac_status=$?
14168   echo "$as_me:14168: \$? = $ac_status" >&5
14169   (exit $ac_status); } &&
14170          { ac_try='test -s conftest.$ac_objext'
14171   { (eval echo "$as_me:14171: \"$ac_try\"") >&5
14172   (eval $ac_try) 2>&5
14173   ac_status=$?
14174   echo "$as_me:14174: \$? = $ac_status" >&5
14175   (exit $ac_status); }; }; then
14176   cf_cv_term_header=$cf_header
14177                          break
14178 else
14179   echo "$as_me: failed program was:" >&5
14180 cat conftest.$ac_ext >&5
14181 cf_cv_term_header=no
14182 fi
14183 rm -f conftest.$ac_objext conftest.$ac_ext
14184         done
14185         ;;
14186 esac
14187
14188 fi
14189 echo "$as_me:14189: result: $cf_cv_term_header" >&5
14190 echo "${ECHO_T}$cf_cv_term_header" >&6
14191
14192 case $cf_cv_term_header in #(vi
14193 term.h) #(vi
14194         cat >>confdefs.h <<\EOF
14195 #define HAVE_TERM_H 1
14196 EOF
14197
14198         ;;
14199 ncurses/term.h) #(vi
14200         cat >>confdefs.h <<\EOF
14201 #define HAVE_NCURSES_TERM_H 1
14202 EOF
14203
14204         ;;
14205 ncursesw/term.h)
14206         cat >>confdefs.h <<\EOF
14207 #define HAVE_NCURSESW_TERM_H 1
14208 EOF
14209
14210         ;;
14211 esac
14212
14213 echo "$as_me:14213: checking for unctrl.h" >&5
14214 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14215 if test "${cf_cv_unctrl_header+set}" = set; then
14216   echo $ECHO_N "(cached) $ECHO_C" >&6
14217 else
14218
14219 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14220 # for <unctrl.h> if we do not find the variant.
14221
14222 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14223
14224 case ${cf_cv_ncurses_header:-curses.h} in #(vi
14225 */*)
14226         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14227         cf_header_list="$cf_header_item $cf_header_list"
14228         ;;
14229 esac
14230
14231 for cf_header in $cf_header_list
14232 do
14233         cat >conftest.$ac_ext <<_ACEOF
14234 #line 14234 "configure"
14235 #include "confdefs.h"
14236
14237 #include <${cf_cv_ncurses_header:-curses.h}>
14238 #include <${cf_header}>
14239 int
14240 main ()
14241 {
14242 WINDOW *x
14243   ;
14244   return 0;
14245 }
14246 _ACEOF
14247 rm -f conftest.$ac_objext
14248 if { (eval echo "$as_me:14248: \"$ac_compile\"") >&5
14249   (eval $ac_compile) 2>&5
14250   ac_status=$?
14251   echo "$as_me:14251: \$? = $ac_status" >&5
14252   (exit $ac_status); } &&
14253          { ac_try='test -s conftest.$ac_objext'
14254   { (eval echo "$as_me:14254: \"$ac_try\"") >&5
14255   (eval $ac_try) 2>&5
14256   ac_status=$?
14257   echo "$as_me:14257: \$? = $ac_status" >&5
14258   (exit $ac_status); }; }; then
14259   cf_cv_unctrl_header=$cf_header
14260          break
14261 else
14262   echo "$as_me: failed program was:" >&5
14263 cat conftest.$ac_ext >&5
14264 cf_cv_unctrl_header=no
14265 fi
14266 rm -f conftest.$ac_objext conftest.$ac_ext
14267 done
14268
14269 case $cf_cv_unctrl_header in #(vi
14270 no)
14271         { echo "$as_me:14271: WARNING: unctrl.h header not found" >&5
14272 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14273         ;;
14274 esac
14275
14276 fi
14277 echo "$as_me:14277: result: $cf_cv_unctrl_header" >&5
14278 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14279
14280 case $cf_cv_unctrl_header in #(vi
14281 unctrl.h) #(vi
14282         cat >>confdefs.h <<\EOF
14283 #define HAVE_UNCTRL_H 1
14284 EOF
14285
14286         ;;
14287 ncurses/unctrl.h) #(vi
14288         cat >>confdefs.h <<\EOF
14289 #define HAVE_NCURSES_UNCTRL_H 1
14290 EOF
14291
14292         ;;
14293 ncursesw/unctrl.h)
14294         cat >>confdefs.h <<\EOF
14295 #define HAVE_NCURSESW_UNCTRL_H 1
14296 EOF
14297
14298         ;;
14299 esac
14300
14301 for cf_func in \
14302 assume_default_colors \
14303 chgat \
14304 color_set \
14305 filter \
14306 getbegx \
14307 getcurx \
14308 getmaxx \
14309 getnstr \
14310 getparx \
14311 getwin \
14312 mvvline \
14313 mvwvline \
14314 napms \
14315 putwin \
14316 resize_term \
14317 resizeterm \
14318 ripoffline \
14319 scr_dump \
14320 setupterm \
14321 slk_color \
14322 slk_init \
14323 termattrs \
14324 tgetent \
14325 tigetnum \
14326 tigetstr \
14327 typeahead \
14328 use_default_colors \
14329 use_screen \
14330 use_window \
14331 vsscanf \
14332 vw_printw \
14333 wchgat \
14334 winsstr \
14335 wresize \
14336 wsyncdown \
14337
14338 do
14339
14340 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14341
14342         echo "$as_me:14342: checking for ${cf_func}" >&5
14343 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14344
14345 echo "${as_me:-configure}:14345: testing ${cf_func} ..." 1>&5
14346
14347         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14348   echo $ECHO_N "(cached) $ECHO_C" >&6
14349 else
14350
14351                 eval cf_result='$ac_cv_func_'$cf_func
14352                 if test ".$cf_result" != ".no"; then
14353                         cat >conftest.$ac_ext <<_ACEOF
14354 #line 14354 "configure"
14355 #include "confdefs.h"
14356
14357 #ifdef HAVE_XCURSES
14358 #include <xcurses.h>
14359 char * XCursesProgramName = "test";
14360 #else
14361 #include <${cf_cv_ncurses_header:-curses.h}>
14362 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14363 #include <ncursesw/term.h>
14364 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14365 #include <ncurses/term.h>
14366 #elif defined(HAVE_TERM_H)
14367 #include <term.h>
14368 #endif
14369 #endif
14370
14371 int
14372 main ()
14373 {
14374
14375 #ifndef ${cf_func}
14376 long foo = (long)(&${cf_func});
14377 if (foo + 1234 > 5678)
14378         ${cf_cv_main_return:-return}(foo);
14379 #endif
14380
14381   ;
14382   return 0;
14383 }
14384 _ACEOF
14385 rm -f conftest.$ac_objext conftest$ac_exeext
14386 if { (eval echo "$as_me:14386: \"$ac_link\"") >&5
14387   (eval $ac_link) 2>&5
14388   ac_status=$?
14389   echo "$as_me:14389: \$? = $ac_status" >&5
14390   (exit $ac_status); } &&
14391          { ac_try='test -s conftest$ac_exeext'
14392   { (eval echo "$as_me:14392: \"$ac_try\"") >&5
14393   (eval $ac_try) 2>&5
14394   ac_status=$?
14395   echo "$as_me:14395: \$? = $ac_status" >&5
14396   (exit $ac_status); }; }; then
14397   cf_result=yes
14398 else
14399   echo "$as_me: failed program was:" >&5
14400 cat conftest.$ac_ext >&5
14401 cf_result=no
14402 fi
14403 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14404                 fi
14405                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14406
14407 fi
14408
14409         # use the computed/retrieved cache-value:
14410         eval 'cf_result=$cf_cv_func_'$cf_func
14411         echo "$as_me:14411: result: $cf_result" >&5
14412 echo "${ECHO_T}$cf_result" >&6
14413         if test $cf_result != no; then
14414                 cat >>confdefs.h <<EOF
14415 #define HAVE_${cf_tr_func} 1
14416 EOF
14417
14418         fi
14419 done
14420
14421 for cf_func in tputs
14422 do
14423
14424 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14425
14426         echo "$as_me:14426: checking for ${cf_func}" >&5
14427 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14428
14429 echo "${as_me:-configure}:14429: testing ${cf_func} ..." 1>&5
14430
14431         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14432   echo $ECHO_N "(cached) $ECHO_C" >&6
14433 else
14434
14435                 eval cf_result='$ac_cv_func_'$cf_func
14436                 if test ".$cf_result" != ".no"; then
14437                         cat >conftest.$ac_ext <<_ACEOF
14438 #line 14438 "configure"
14439 #include "confdefs.h"
14440
14441 #ifdef HAVE_XCURSES
14442 #include <xcurses.h>
14443 char * XCursesProgramName = "test";
14444 #else
14445 #include <${cf_cv_ncurses_header:-curses.h}>
14446 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14447 #include <ncursesw/term.h>
14448 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14449 #include <ncurses/term.h>
14450 #elif defined(HAVE_TERM_H)
14451 #include <term.h>
14452 #endif
14453 #endif
14454
14455 int
14456 main ()
14457 {
14458
14459 #ifndef ${cf_func}
14460 long foo = (long)(&${cf_func});
14461 if (foo + 1234 > 5678)
14462         ${cf_cv_main_return:-return}(foo);
14463 #endif
14464
14465   ;
14466   return 0;
14467 }
14468 _ACEOF
14469 rm -f conftest.$ac_objext conftest$ac_exeext
14470 if { (eval echo "$as_me:14470: \"$ac_link\"") >&5
14471   (eval $ac_link) 2>&5
14472   ac_status=$?
14473   echo "$as_me:14473: \$? = $ac_status" >&5
14474   (exit $ac_status); } &&
14475          { ac_try='test -s conftest$ac_exeext'
14476   { (eval echo "$as_me:14476: \"$ac_try\"") >&5
14477   (eval $ac_try) 2>&5
14478   ac_status=$?
14479   echo "$as_me:14479: \$? = $ac_status" >&5
14480   (exit $ac_status); }; }; then
14481   cf_result=yes
14482 else
14483   echo "$as_me: failed program was:" >&5
14484 cat conftest.$ac_ext >&5
14485 cf_result=no
14486 fi
14487 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14488                 fi
14489                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14490
14491 fi
14492
14493         # use the computed/retrieved cache-value:
14494         eval 'cf_result=$cf_cv_func_'$cf_func
14495         echo "$as_me:14495: result: $cf_result" >&5
14496 echo "${ECHO_T}$cf_result" >&6
14497         if test $cf_result != no; then
14498                 cat >>confdefs.h <<EOF
14499 #define HAVE_${cf_tr_func} 1
14500 EOF
14501
14502         fi
14503 done
14504
14505 if test x$cf_cv_func_tputs = xyes
14506 then
14507         cf_done=no
14508         for cf_arg in int char
14509         do
14510                 for cf_ret in int void
14511                 do
14512                         if test $cf_ret = void
14513                         then
14514                                 cf_return="/* nothing */"
14515                         else
14516                                 cf_return="return value"
14517                         fi
14518                         cat >conftest.$ac_ext <<_ACEOF
14519 #line 14519 "configure"
14520 #include "confdefs.h"
14521
14522 #include <${cf_cv_ncurses_header:-curses.h}>
14523 #include <$cf_cv_term_header>
14524
14525 static $cf_ret outc($cf_arg value) { $cf_return; }
14526
14527 int
14528 main ()
14529 {
14530
14531         tputs("hello", 0, outc);
14532         ${cf_cv_main_return:-return}(0);
14533
14534   ;
14535   return 0;
14536 }
14537 _ACEOF
14538 rm -f conftest.$ac_objext
14539 if { (eval echo "$as_me:14539: \"$ac_compile\"") >&5
14540   (eval $ac_compile) 2>&5
14541   ac_status=$?
14542   echo "$as_me:14542: \$? = $ac_status" >&5
14543   (exit $ac_status); } &&
14544          { ac_try='test -s conftest.$ac_objext'
14545   { (eval echo "$as_me:14545: \"$ac_try\"") >&5
14546   (eval $ac_try) 2>&5
14547   ac_status=$?
14548   echo "$as_me:14548: \$? = $ac_status" >&5
14549   (exit $ac_status); }; }; then
14550
14551                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14552
14553 echo "${as_me:-configure}:14553: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14554
14555                 cat >>confdefs.h <<EOF
14556 #define TPUTS_ARG               $cf_arg
14557 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14558 #define TPUTS_RETURN(value)     $cf_return
14559 EOF
14560                 cf_done=yes
14561                 break
14562
14563 else
14564   echo "$as_me: failed program was:" >&5
14565 cat conftest.$ac_ext >&5
14566 fi
14567 rm -f conftest.$ac_objext conftest.$ac_ext
14568                 done
14569                 test $cf_done = yes && break
14570         done
14571 fi
14572
14573 echo "$as_me:14573: checking for ncurses extended functions" >&5
14574 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14575 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14576   echo $ECHO_N "(cached) $ECHO_C" >&6
14577 else
14578
14579 cat >conftest.$ac_ext <<_ACEOF
14580 #line 14580 "configure"
14581 #include "confdefs.h"
14582
14583 #include <${cf_cv_ncurses_header:-curses.h}>
14584 int
14585 main ()
14586 {
14587
14588 int x = NCURSES_EXT_FUNCS
14589
14590   ;
14591   return 0;
14592 }
14593 _ACEOF
14594 rm -f conftest.$ac_objext
14595 if { (eval echo "$as_me:14595: \"$ac_compile\"") >&5
14596   (eval $ac_compile) 2>&5
14597   ac_status=$?
14598   echo "$as_me:14598: \$? = $ac_status" >&5
14599   (exit $ac_status); } &&
14600          { ac_try='test -s conftest.$ac_objext'
14601   { (eval echo "$as_me:14601: \"$ac_try\"") >&5
14602   (eval $ac_try) 2>&5
14603   ac_status=$?
14604   echo "$as_me:14604: \$? = $ac_status" >&5
14605   (exit $ac_status); }; }; then
14606   cf_cv_ncurses_ext_funcs=defined
14607 else
14608   echo "$as_me: failed program was:" >&5
14609 cat conftest.$ac_ext >&5
14610
14611 cat >conftest.$ac_ext <<_ACEOF
14612 #line 14612 "configure"
14613 #include "confdefs.h"
14614
14615 #include <${cf_cv_ncurses_header:-curses.h}>
14616 int
14617 main ()
14618 {
14619
14620         (void) assume_default_colors (0, 0);
14621         (void) curses_version ();
14622         (void) define_key (0, 0);
14623         (void) is_term_resized (0, 0);
14624         (void) key_defined (0);
14625         (void) keybound (0, 0);
14626         (void) keyok (0, 0);
14627         (void) resize_term (0, 0);
14628         (void) resizeterm (0, 0);
14629         (void) use_default_colors ();
14630         (void) use_extended_names (0);
14631         (void) wresize (0, 0, 0);
14632   ;
14633   return 0;
14634 }
14635 _ACEOF
14636 rm -f conftest.$ac_objext conftest$ac_exeext
14637 if { (eval echo "$as_me:14637: \"$ac_link\"") >&5
14638   (eval $ac_link) 2>&5
14639   ac_status=$?
14640   echo "$as_me:14640: \$? = $ac_status" >&5
14641   (exit $ac_status); } &&
14642          { ac_try='test -s conftest$ac_exeext'
14643   { (eval echo "$as_me:14643: \"$ac_try\"") >&5
14644   (eval $ac_try) 2>&5
14645   ac_status=$?
14646   echo "$as_me:14646: \$? = $ac_status" >&5
14647   (exit $ac_status); }; }; then
14648   cf_cv_ncurses_ext_funcs=yes
14649 else
14650   echo "$as_me: failed program was:" >&5
14651 cat conftest.$ac_ext >&5
14652 cf_cv_ncurses_ext_funcs=no
14653 fi
14654 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14655
14656 fi
14657 rm -f conftest.$ac_objext conftest.$ac_ext
14658
14659 fi
14660 echo "$as_me:14660: result: $cf_cv_ncurses_ext_funcs" >&5
14661 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14662 test "$cf_cv_ncurses_ext_funcs" = yes && cat >>confdefs.h <<\EOF
14663 #define NCURSES_EXT_FUNCS 1
14664 EOF
14665
14666 if test "$cf_enable_widec" = yes
14667 then
14668         # workaround for systems with ncurses before 20111029, due to change of
14669         # feature test macro from _XPG5 to _XOPEN_SOURCE
14670         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14671         then
14672                 cf_define_xpg5=no
14673                 echo "$as_me:14673: checking if _XPG5 should be defined to enable wide-characters" >&5
14674 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14675
14676                 cat >conftest.$ac_ext <<_ACEOF
14677 #line 14677 "configure"
14678 #include "confdefs.h"
14679
14680 #include <${cf_cv_ncurses_header:-curses.h}>
14681 int
14682 main ()
14683 {
14684 int x = _XPG5
14685   ;
14686   return 0;
14687 }
14688 _ACEOF
14689 rm -f conftest.$ac_objext
14690 if { (eval echo "$as_me:14690: \"$ac_compile\"") >&5
14691   (eval $ac_compile) 2>&5
14692   ac_status=$?
14693   echo "$as_me:14693: \$? = $ac_status" >&5
14694   (exit $ac_status); } &&
14695          { ac_try='test -s conftest.$ac_objext'
14696   { (eval echo "$as_me:14696: \"$ac_try\"") >&5
14697   (eval $ac_try) 2>&5
14698   ac_status=$?
14699   echo "$as_me:14699: \$? = $ac_status" >&5
14700   (exit $ac_status); }; }; then
14701   :
14702 else
14703   echo "$as_me: failed program was:" >&5
14704 cat conftest.$ac_ext >&5
14705 cf_save_cppflags="$CPPFLAGS"
14706                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14707                          cat >conftest.$ac_ext <<_ACEOF
14708 #line 14708 "configure"
14709 #include "confdefs.h"
14710
14711 #include <${cf_cv_ncurses_header:-curses.h}>
14712 int
14713 main ()
14714 {
14715 int x = _XPG5
14716   ;
14717   return 0;
14718 }
14719 _ACEOF
14720 rm -f conftest.$ac_objext
14721 if { (eval echo "$as_me:14721: \"$ac_compile\"") >&5
14722   (eval $ac_compile) 2>&5
14723   ac_status=$?
14724   echo "$as_me:14724: \$? = $ac_status" >&5
14725   (exit $ac_status); } &&
14726          { ac_try='test -s conftest.$ac_objext'
14727   { (eval echo "$as_me:14727: \"$ac_try\"") >&5
14728   (eval $ac_try) 2>&5
14729   ac_status=$?
14730   echo "$as_me:14730: \$? = $ac_status" >&5
14731   (exit $ac_status); }; }; then
14732   cf_define_xpg5=yes
14733 else
14734   echo "$as_me: failed program was:" >&5
14735 cat conftest.$ac_ext >&5
14736 fi
14737 rm -f conftest.$ac_objext conftest.$ac_ext
14738                          CPPFLAGS="$cf_save_cppflags"
14739 fi
14740 rm -f conftest.$ac_objext conftest.$ac_ext
14741                 echo "$as_me:14741: result: $cf_define_xpg5" >&5
14742 echo "${ECHO_T}$cf_define_xpg5" >&6
14743
14744                 if test "$cf_define_xpg5" = yes
14745                 then
14746                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14747                 fi
14748         fi
14749
14750         echo "$as_me:14750: checking for wide-character functions" >&5
14751 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14752 if test "${cf_cv_widechar_funcs+set}" = set; then
14753   echo $ECHO_N "(cached) $ECHO_C" >&6
14754 else
14755
14756         cat >conftest.$ac_ext <<_ACEOF
14757 #line 14757 "configure"
14758 #include "confdefs.h"
14759
14760 #include <${cf_cv_ncurses_header:-curses.h}>
14761 int
14762 main ()
14763 {
14764
14765                 static wchar_t src_wchar[2];
14766                 static cchar_t dst_cchar;
14767                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
14768
14769   ;
14770   return 0;
14771 }
14772 _ACEOF
14773 rm -f conftest.$ac_objext conftest$ac_exeext
14774 if { (eval echo "$as_me:14774: \"$ac_link\"") >&5
14775   (eval $ac_link) 2>&5
14776   ac_status=$?
14777   echo "$as_me:14777: \$? = $ac_status" >&5
14778   (exit $ac_status); } &&
14779          { ac_try='test -s conftest$ac_exeext'
14780   { (eval echo "$as_me:14780: \"$ac_try\"") >&5
14781   (eval $ac_try) 2>&5
14782   ac_status=$?
14783   echo "$as_me:14783: \$? = $ac_status" >&5
14784   (exit $ac_status); }; }; then
14785   cf_cv_widechar_funcs=yes
14786 else
14787   echo "$as_me: failed program was:" >&5
14788 cat conftest.$ac_ext >&5
14789 cf_cv_widechar_funcs=no
14790 fi
14791 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14792
14793 fi
14794 echo "$as_me:14794: result: $cf_cv_widechar_funcs" >&5
14795 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
14796         if test "$cf_cv_widechar_funcs" != no ; then
14797                 cat >>confdefs.h <<\EOF
14798 #define USE_WIDEC_SUPPORT 1
14799 EOF
14800
14801         else
14802                 cat >>confdefs.h <<\EOF
14803 #define USE_WIDEC_SUPPORT 0
14804 EOF
14805
14806         fi
14807 else
14808         cat >>confdefs.h <<\EOF
14809 #define USE_WIDEC_SUPPORT 0
14810 EOF
14811
14812 fi
14813
14814 echo "$as_me:14814: checking if sys/time.h works with sys/select.h" >&5
14815 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
14816 if test "${cf_cv_sys_time_select+set}" = set; then
14817   echo $ECHO_N "(cached) $ECHO_C" >&6
14818 else
14819
14820 cat >conftest.$ac_ext <<_ACEOF
14821 #line 14821 "configure"
14822 #include "confdefs.h"
14823
14824 #include <sys/types.h>
14825 #ifdef HAVE_SYS_TIME_H
14826 #include <sys/time.h>
14827 #endif
14828 #ifdef HAVE_SYS_SELECT_H
14829 #include <sys/select.h>
14830 #endif
14831
14832 int
14833 main ()
14834 {
14835
14836   ;
14837   return 0;
14838 }
14839 _ACEOF
14840 rm -f conftest.$ac_objext
14841 if { (eval echo "$as_me:14841: \"$ac_compile\"") >&5
14842   (eval $ac_compile) 2>&5
14843   ac_status=$?
14844   echo "$as_me:14844: \$? = $ac_status" >&5
14845   (exit $ac_status); } &&
14846          { ac_try='test -s conftest.$ac_objext'
14847   { (eval echo "$as_me:14847: \"$ac_try\"") >&5
14848   (eval $ac_try) 2>&5
14849   ac_status=$?
14850   echo "$as_me:14850: \$? = $ac_status" >&5
14851   (exit $ac_status); }; }; then
14852   cf_cv_sys_time_select=yes
14853 else
14854   echo "$as_me: failed program was:" >&5
14855 cat conftest.$ac_ext >&5
14856 cf_cv_sys_time_select=no
14857 fi
14858 rm -f conftest.$ac_objext conftest.$ac_ext
14859
14860 fi
14861
14862 echo "$as_me:14862: result: $cf_cv_sys_time_select" >&5
14863 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
14864 test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF
14865 #define HAVE_SYS_TIME_SELECT 1
14866 EOF
14867
14868 echo "$as_me:14868: checking for function curses_version" >&5
14869 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
14870 if test "${cf_cv_func_curses_version+set}" = set; then
14871   echo $ECHO_N "(cached) $ECHO_C" >&6
14872 else
14873
14874 if test "$cross_compiling" = yes; then
14875   cf_cv_func_curses_version=unknown
14876 else
14877   cat >conftest.$ac_ext <<_ACEOF
14878 #line 14878 "configure"
14879 #include "confdefs.h"
14880
14881 #include <${cf_cv_ncurses_header:-curses.h}>
14882 int main()
14883 {
14884         char temp[1024];
14885         sprintf(temp, "%s\n", curses_version());
14886         ${cf_cv_main_return:-return}(0);
14887 }
14888
14889 _ACEOF
14890 rm -f conftest$ac_exeext
14891 if { (eval echo "$as_me:14891: \"$ac_link\"") >&5
14892   (eval $ac_link) 2>&5
14893   ac_status=$?
14894   echo "$as_me:14894: \$? = $ac_status" >&5
14895   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14896   { (eval echo "$as_me:14896: \"$ac_try\"") >&5
14897   (eval $ac_try) 2>&5
14898   ac_status=$?
14899   echo "$as_me:14899: \$? = $ac_status" >&5
14900   (exit $ac_status); }; }; then
14901   cf_cv_func_curses_version=yes
14902
14903 else
14904   echo "$as_me: program exited with status $ac_status" >&5
14905 echo "$as_me: failed program was:" >&5
14906 cat conftest.$ac_ext >&5
14907 cf_cv_func_curses_version=no
14908
14909 fi
14910 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14911 fi
14912 rm -f core
14913 fi
14914 echo "$as_me:14914: result: $cf_cv_func_curses_version" >&5
14915 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
14916 test "$cf_cv_func_curses_version" = yes && cat >>confdefs.h <<\EOF
14917 #define HAVE_CURSES_VERSION 1
14918 EOF
14919
14920 echo "$as_me:14920: checking for ncurses wrap-prefix" >&5
14921 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
14922
14923 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
14924 if test "${with_ncurses_wrap_prefix+set}" = set; then
14925   withval="$with_ncurses_wrap_prefix"
14926   NCURSES_WRAP_PREFIX=$withval
14927 else
14928   NCURSES_WRAP_PREFIX=_nc_
14929 fi;
14930 echo "$as_me:14930: result: $NCURSES_WRAP_PREFIX" >&5
14931 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14932
14933 echo "$as_me:14933: checking for alternate character set array" >&5
14934 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
14935 if test "${cf_cv_curses_acs_map+set}" = set; then
14936   echo $ECHO_N "(cached) $ECHO_C" >&6
14937 else
14938
14939 cf_cv_curses_acs_map=unknown
14940 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
14941 do
14942 cat >conftest.$ac_ext <<_ACEOF
14943 #line 14943 "configure"
14944 #include "confdefs.h"
14945
14946 #include <${cf_cv_ncurses_header:-curses.h}>
14947
14948 int
14949 main ()
14950 {
14951
14952 $name['k'] = ACS_PLUS
14953
14954   ;
14955   return 0;
14956 }
14957 _ACEOF
14958 rm -f conftest.$ac_objext conftest$ac_exeext
14959 if { (eval echo "$as_me:14959: \"$ac_link\"") >&5
14960   (eval $ac_link) 2>&5
14961   ac_status=$?
14962   echo "$as_me:14962: \$? = $ac_status" >&5
14963   (exit $ac_status); } &&
14964          { ac_try='test -s conftest$ac_exeext'
14965   { (eval echo "$as_me:14965: \"$ac_try\"") >&5
14966   (eval $ac_try) 2>&5
14967   ac_status=$?
14968   echo "$as_me:14968: \$? = $ac_status" >&5
14969   (exit $ac_status); }; }; then
14970   cf_cv_curses_acs_map=$name; break
14971 else
14972   echo "$as_me: failed program was:" >&5
14973 cat conftest.$ac_ext >&5
14974 fi
14975 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14976 done
14977
14978 fi
14979 echo "$as_me:14979: result: $cf_cv_curses_acs_map" >&5
14980 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
14981
14982 test "$cf_cv_curses_acs_map" != unknown && cat >>confdefs.h <<EOF
14983 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
14984 EOF
14985
14986 if test "$cf_enable_widec" = yes; then
14987
14988 echo "$as_me:14988: checking for wide alternate character set array" >&5
14989 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
14990 if test "${cf_cv_curses_wacs_map+set}" = set; then
14991   echo $ECHO_N "(cached) $ECHO_C" >&6
14992 else
14993
14994         cf_cv_curses_wacs_map=unknown
14995         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
14996         do
14997         cat >conftest.$ac_ext <<_ACEOF
14998 #line 14998 "configure"
14999 #include "confdefs.h"
15000
15001 #ifndef _XOPEN_SOURCE_EXTENDED
15002 #define _XOPEN_SOURCE_EXTENDED
15003 #endif
15004 #include <${cf_cv_ncurses_header:-curses.h}>
15005 int
15006 main ()
15007 {
15008 void *foo = &($name['k'])
15009   ;
15010   return 0;
15011 }
15012 _ACEOF
15013 rm -f conftest.$ac_objext conftest$ac_exeext
15014 if { (eval echo "$as_me:15014: \"$ac_link\"") >&5
15015   (eval $ac_link) 2>&5
15016   ac_status=$?
15017   echo "$as_me:15017: \$? = $ac_status" >&5
15018   (exit $ac_status); } &&
15019          { ac_try='test -s conftest$ac_exeext'
15020   { (eval echo "$as_me:15020: \"$ac_try\"") >&5
15021   (eval $ac_try) 2>&5
15022   ac_status=$?
15023   echo "$as_me:15023: \$? = $ac_status" >&5
15024   (exit $ac_status); }; }; then
15025   cf_cv_curses_wacs_map=$name
15026          break
15027 else
15028   echo "$as_me: failed program was:" >&5
15029 cat conftest.$ac_ext >&5
15030 fi
15031 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15032         done
15033 fi
15034 echo "$as_me:15034: result: $cf_cv_curses_wacs_map" >&5
15035 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
15036
15037 test "$cf_cv_curses_wacs_map" != unknown && cat >>confdefs.h <<EOF
15038 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
15039 EOF
15040
15041 echo "$as_me:15041: checking for wide alternate character constants" >&5
15042 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
15043 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
15044   echo $ECHO_N "(cached) $ECHO_C" >&6
15045 else
15046
15047 cf_cv_curses_wacs_symbols=no
15048 if test "$cf_cv_curses_wacs_map" != unknown
15049 then
15050         cat >conftest.$ac_ext <<_ACEOF
15051 #line 15051 "configure"
15052 #include "confdefs.h"
15053
15054 #ifndef _XOPEN_SOURCE_EXTENDED
15055 #define _XOPEN_SOURCE_EXTENDED
15056 #endif
15057 #include <${cf_cv_ncurses_header:-curses.h}>
15058 int
15059 main ()
15060 {
15061 cchar_t *foo = WACS_PLUS;
15062          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
15063   ;
15064   return 0;
15065 }
15066 _ACEOF
15067 rm -f conftest.$ac_objext conftest$ac_exeext
15068 if { (eval echo "$as_me:15068: \"$ac_link\"") >&5
15069   (eval $ac_link) 2>&5
15070   ac_status=$?
15071   echo "$as_me:15071: \$? = $ac_status" >&5
15072   (exit $ac_status); } &&
15073          { ac_try='test -s conftest$ac_exeext'
15074   { (eval echo "$as_me:15074: \"$ac_try\"") >&5
15075   (eval $ac_try) 2>&5
15076   ac_status=$?
15077   echo "$as_me:15077: \$? = $ac_status" >&5
15078   (exit $ac_status); }; }; then
15079   cf_cv_curses_wacs_symbols=yes
15080 else
15081   echo "$as_me: failed program was:" >&5
15082 cat conftest.$ac_ext >&5
15083 fi
15084 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15085 else
15086         cat >conftest.$ac_ext <<_ACEOF
15087 #line 15087 "configure"
15088 #include "confdefs.h"
15089
15090 #ifndef _XOPEN_SOURCE_EXTENDED
15091 #define _XOPEN_SOURCE_EXTENDED
15092 #endif
15093 #include <${cf_cv_ncurses_header:-curses.h}>
15094 int
15095 main ()
15096 {
15097 cchar_t *foo = WACS_PLUS
15098   ;
15099   return 0;
15100 }
15101 _ACEOF
15102 rm -f conftest.$ac_objext conftest$ac_exeext
15103 if { (eval echo "$as_me:15103: \"$ac_link\"") >&5
15104   (eval $ac_link) 2>&5
15105   ac_status=$?
15106   echo "$as_me:15106: \$? = $ac_status" >&5
15107   (exit $ac_status); } &&
15108          { ac_try='test -s conftest$ac_exeext'
15109   { (eval echo "$as_me:15109: \"$ac_try\"") >&5
15110   (eval $ac_try) 2>&5
15111   ac_status=$?
15112   echo "$as_me:15112: \$? = $ac_status" >&5
15113   (exit $ac_status); }; }; then
15114   cf_cv_curses_wacs_symbols=yes
15115 else
15116   echo "$as_me: failed program was:" >&5
15117 cat conftest.$ac_ext >&5
15118 fi
15119 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15120 fi
15121
15122 fi
15123 echo "$as_me:15123: result: $cf_cv_curses_wacs_symbols" >&5
15124 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15125
15126 test "$cf_cv_curses_wacs_symbols" != no && cat >>confdefs.h <<\EOF
15127 #define CURSES_WACS_SYMBOLS 1
15128 EOF
15129
15130 fi
15131
15132 echo "$as_me:15132: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15133 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15134 cat >conftest.$ac_ext <<_ACEOF
15135 #line 15135 "configure"
15136 #include "confdefs.h"
15137
15138 #ifndef _XOPEN_SOURCE_EXTENDED
15139 #define _XOPEN_SOURCE_EXTENDED
15140 #endif
15141 #include <${cf_cv_ncurses_header:-curses.h}>
15142 int
15143 main ()
15144 {
15145
15146 attr_t foo
15147
15148   ;
15149   return 0;
15150 }
15151 _ACEOF
15152 rm -f conftest.$ac_objext
15153 if { (eval echo "$as_me:15153: \"$ac_compile\"") >&5
15154   (eval $ac_compile) 2>&5
15155   ac_status=$?
15156   echo "$as_me:15156: \$? = $ac_status" >&5
15157   (exit $ac_status); } &&
15158          { ac_try='test -s conftest.$ac_objext'
15159   { (eval echo "$as_me:15159: \"$ac_try\"") >&5
15160   (eval $ac_try) 2>&5
15161   ac_status=$?
15162   echo "$as_me:15162: \$? = $ac_status" >&5
15163   (exit $ac_status); }; }; then
15164   cf_result=yes
15165 else
15166   echo "$as_me: failed program was:" >&5
15167 cat conftest.$ac_ext >&5
15168 cf_result=no
15169 fi
15170 rm -f conftest.$ac_objext conftest.$ac_ext
15171 echo "$as_me:15171: result: $cf_result" >&5
15172 echo "${ECHO_T}$cf_result" >&6
15173 if test $cf_result = yes ; then
15174
15175 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15176
15177         cat >>confdefs.h <<EOF
15178 #define $cf_result 1
15179 EOF
15180
15181 else
15182         cat >>confdefs.h <<EOF
15183 #define attr_t long
15184 EOF
15185
15186 fi
15187
15188 if test "$cf_enable_widec" = yes; then
15189
15190 # This is needed on Tru64 5.0 to declare mbstate_t
15191 echo "$as_me:15191: checking if we must include wchar.h to declare mbstate_t" >&5
15192 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15193 if test "${cf_cv_mbstate_t+set}" = set; then
15194   echo $ECHO_N "(cached) $ECHO_C" >&6
15195 else
15196
15197 cat >conftest.$ac_ext <<_ACEOF
15198 #line 15198 "configure"
15199 #include "confdefs.h"
15200
15201 #include <stdlib.h>
15202 #include <stdarg.h>
15203 #include <stdio.h>
15204 #ifdef HAVE_LIBUTF8_H
15205 #include <libutf8.h>
15206 #endif
15207 int
15208 main ()
15209 {
15210 mbstate_t state
15211   ;
15212   return 0;
15213 }
15214 _ACEOF
15215 rm -f conftest.$ac_objext
15216 if { (eval echo "$as_me:15216: \"$ac_compile\"") >&5
15217   (eval $ac_compile) 2>&5
15218   ac_status=$?
15219   echo "$as_me:15219: \$? = $ac_status" >&5
15220   (exit $ac_status); } &&
15221          { ac_try='test -s conftest.$ac_objext'
15222   { (eval echo "$as_me:15222: \"$ac_try\"") >&5
15223   (eval $ac_try) 2>&5
15224   ac_status=$?
15225   echo "$as_me:15225: \$? = $ac_status" >&5
15226   (exit $ac_status); }; }; then
15227   cf_cv_mbstate_t=no
15228 else
15229   echo "$as_me: failed program was:" >&5
15230 cat conftest.$ac_ext >&5
15231 cat >conftest.$ac_ext <<_ACEOF
15232 #line 15232 "configure"
15233 #include "confdefs.h"
15234
15235 #include <stdlib.h>
15236 #include <stdarg.h>
15237 #include <stdio.h>
15238 #include <wchar.h>
15239 #ifdef HAVE_LIBUTF8_H
15240 #include <libutf8.h>
15241 #endif
15242 int
15243 main ()
15244 {
15245 mbstate_t value
15246   ;
15247   return 0;
15248 }
15249 _ACEOF
15250 rm -f conftest.$ac_objext
15251 if { (eval echo "$as_me:15251: \"$ac_compile\"") >&5
15252   (eval $ac_compile) 2>&5
15253   ac_status=$?
15254   echo "$as_me:15254: \$? = $ac_status" >&5
15255   (exit $ac_status); } &&
15256          { ac_try='test -s conftest.$ac_objext'
15257   { (eval echo "$as_me:15257: \"$ac_try\"") >&5
15258   (eval $ac_try) 2>&5
15259   ac_status=$?
15260   echo "$as_me:15260: \$? = $ac_status" >&5
15261   (exit $ac_status); }; }; then
15262   cf_cv_mbstate_t=yes
15263 else
15264   echo "$as_me: failed program was:" >&5
15265 cat conftest.$ac_ext >&5
15266 cf_cv_mbstate_t=unknown
15267 fi
15268 rm -f conftest.$ac_objext conftest.$ac_ext
15269 fi
15270 rm -f conftest.$ac_objext conftest.$ac_ext
15271 fi
15272 echo "$as_me:15272: result: $cf_cv_mbstate_t" >&5
15273 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15274
15275 if test "$cf_cv_mbstate_t" = yes ; then
15276         cat >>confdefs.h <<\EOF
15277 #define NEED_WCHAR_H 1
15278 EOF
15279
15280         NEED_WCHAR_H=1
15281 fi
15282
15283 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15284 if test "$cf_cv_mbstate_t" = unknown ; then
15285         NCURSES_MBSTATE_T=1
15286 fi
15287
15288 # if we find mbstate_t in either place, use substitution to provide a fallback.
15289 if test "$cf_cv_mbstate_t" != unknown ; then
15290         NCURSES_OK_MBSTATE_T=1
15291 fi
15292
15293 # This is needed on Tru64 5.0 to declare wchar_t
15294 echo "$as_me:15294: checking if we must include wchar.h to declare wchar_t" >&5
15295 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15296 if test "${cf_cv_wchar_t+set}" = set; then
15297   echo $ECHO_N "(cached) $ECHO_C" >&6
15298 else
15299
15300 cat >conftest.$ac_ext <<_ACEOF
15301 #line 15301 "configure"
15302 #include "confdefs.h"
15303
15304 #include <stdlib.h>
15305 #include <stdarg.h>
15306 #include <stdio.h>
15307 #ifdef HAVE_LIBUTF8_H
15308 #include <libutf8.h>
15309 #endif
15310 int
15311 main ()
15312 {
15313 wchar_t state
15314   ;
15315   return 0;
15316 }
15317 _ACEOF
15318 rm -f conftest.$ac_objext
15319 if { (eval echo "$as_me:15319: \"$ac_compile\"") >&5
15320   (eval $ac_compile) 2>&5
15321   ac_status=$?
15322   echo "$as_me:15322: \$? = $ac_status" >&5
15323   (exit $ac_status); } &&
15324          { ac_try='test -s conftest.$ac_objext'
15325   { (eval echo "$as_me:15325: \"$ac_try\"") >&5
15326   (eval $ac_try) 2>&5
15327   ac_status=$?
15328   echo "$as_me:15328: \$? = $ac_status" >&5
15329   (exit $ac_status); }; }; then
15330   cf_cv_wchar_t=no
15331 else
15332   echo "$as_me: failed program was:" >&5
15333 cat conftest.$ac_ext >&5
15334 cat >conftest.$ac_ext <<_ACEOF
15335 #line 15335 "configure"
15336 #include "confdefs.h"
15337
15338 #include <stdlib.h>
15339 #include <stdarg.h>
15340 #include <stdio.h>
15341 #include <wchar.h>
15342 #ifdef HAVE_LIBUTF8_H
15343 #include <libutf8.h>
15344 #endif
15345 int
15346 main ()
15347 {
15348 wchar_t value
15349   ;
15350   return 0;
15351 }
15352 _ACEOF
15353 rm -f conftest.$ac_objext
15354 if { (eval echo "$as_me:15354: \"$ac_compile\"") >&5
15355   (eval $ac_compile) 2>&5
15356   ac_status=$?
15357   echo "$as_me:15357: \$? = $ac_status" >&5
15358   (exit $ac_status); } &&
15359          { ac_try='test -s conftest.$ac_objext'
15360   { (eval echo "$as_me:15360: \"$ac_try\"") >&5
15361   (eval $ac_try) 2>&5
15362   ac_status=$?
15363   echo "$as_me:15363: \$? = $ac_status" >&5
15364   (exit $ac_status); }; }; then
15365   cf_cv_wchar_t=yes
15366 else
15367   echo "$as_me: failed program was:" >&5
15368 cat conftest.$ac_ext >&5
15369 cf_cv_wchar_t=unknown
15370 fi
15371 rm -f conftest.$ac_objext conftest.$ac_ext
15372 fi
15373 rm -f conftest.$ac_objext conftest.$ac_ext
15374 fi
15375 echo "$as_me:15375: result: $cf_cv_wchar_t" >&5
15376 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15377
15378 if test "$cf_cv_wchar_t" = yes ; then
15379         cat >>confdefs.h <<\EOF
15380 #define NEED_WCHAR_H 1
15381 EOF
15382
15383         NEED_WCHAR_H=1
15384 fi
15385
15386 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15387 if test "$cf_cv_wchar_t" = unknown ; then
15388         NCURSES_WCHAR_T=1
15389 fi
15390
15391 # if we find wchar_t in either place, use substitution to provide a fallback.
15392 if test "$cf_cv_wchar_t" != unknown ; then
15393         NCURSES_OK_WCHAR_T=1
15394 fi
15395
15396 # This is needed on Tru64 5.0 to declare wint_t
15397 echo "$as_me:15397: checking if we must include wchar.h to declare wint_t" >&5
15398 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15399 if test "${cf_cv_wint_t+set}" = set; then
15400   echo $ECHO_N "(cached) $ECHO_C" >&6
15401 else
15402
15403 cat >conftest.$ac_ext <<_ACEOF
15404 #line 15404 "configure"
15405 #include "confdefs.h"
15406
15407 #include <stdlib.h>
15408 #include <stdarg.h>
15409 #include <stdio.h>
15410 #ifdef HAVE_LIBUTF8_H
15411 #include <libutf8.h>
15412 #endif
15413 int
15414 main ()
15415 {
15416 wint_t state
15417   ;
15418   return 0;
15419 }
15420 _ACEOF
15421 rm -f conftest.$ac_objext
15422 if { (eval echo "$as_me:15422: \"$ac_compile\"") >&5
15423   (eval $ac_compile) 2>&5
15424   ac_status=$?
15425   echo "$as_me:15425: \$? = $ac_status" >&5
15426   (exit $ac_status); } &&
15427          { ac_try='test -s conftest.$ac_objext'
15428   { (eval echo "$as_me:15428: \"$ac_try\"") >&5
15429   (eval $ac_try) 2>&5
15430   ac_status=$?
15431   echo "$as_me:15431: \$? = $ac_status" >&5
15432   (exit $ac_status); }; }; then
15433   cf_cv_wint_t=no
15434 else
15435   echo "$as_me: failed program was:" >&5
15436 cat conftest.$ac_ext >&5
15437 cat >conftest.$ac_ext <<_ACEOF
15438 #line 15438 "configure"
15439 #include "confdefs.h"
15440
15441 #include <stdlib.h>
15442 #include <stdarg.h>
15443 #include <stdio.h>
15444 #include <wchar.h>
15445 #ifdef HAVE_LIBUTF8_H
15446 #include <libutf8.h>
15447 #endif
15448 int
15449 main ()
15450 {
15451 wint_t value
15452   ;
15453   return 0;
15454 }
15455 _ACEOF
15456 rm -f conftest.$ac_objext
15457 if { (eval echo "$as_me:15457: \"$ac_compile\"") >&5
15458   (eval $ac_compile) 2>&5
15459   ac_status=$?
15460   echo "$as_me:15460: \$? = $ac_status" >&5
15461   (exit $ac_status); } &&
15462          { ac_try='test -s conftest.$ac_objext'
15463   { (eval echo "$as_me:15463: \"$ac_try\"") >&5
15464   (eval $ac_try) 2>&5
15465   ac_status=$?
15466   echo "$as_me:15466: \$? = $ac_status" >&5
15467   (exit $ac_status); }; }; then
15468   cf_cv_wint_t=yes
15469 else
15470   echo "$as_me: failed program was:" >&5
15471 cat conftest.$ac_ext >&5
15472 cf_cv_wint_t=unknown
15473 fi
15474 rm -f conftest.$ac_objext conftest.$ac_ext
15475 fi
15476 rm -f conftest.$ac_objext conftest.$ac_ext
15477 fi
15478 echo "$as_me:15478: result: $cf_cv_wint_t" >&5
15479 echo "${ECHO_T}$cf_cv_wint_t" >&6
15480
15481 if test "$cf_cv_wint_t" = yes ; then
15482         cat >>confdefs.h <<\EOF
15483 #define NEED_WCHAR_H 1
15484 EOF
15485
15486         NEED_WCHAR_H=1
15487 fi
15488
15489 # if we do not find wint_t in either place, use substitution to provide a fallback.
15490 if test "$cf_cv_wint_t" = unknown ; then
15491         NCURSES_WINT_T=1
15492 fi
15493
15494 # if we find wint_t in either place, use substitution to provide a fallback.
15495 if test "$cf_cv_wint_t" != unknown ; then
15496         NCURSES_OK_WINT_T=1
15497 fi
15498
15499         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15500
15501 echo "$as_me:15501: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15502 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15503 cat >conftest.$ac_ext <<_ACEOF
15504 #line 15504 "configure"
15505 #include "confdefs.h"
15506
15507 #ifndef _XOPEN_SOURCE_EXTENDED
15508 #define _XOPEN_SOURCE_EXTENDED
15509 #endif
15510 #include <${cf_cv_ncurses_header:-curses.h}>
15511 int
15512 main ()
15513 {
15514
15515 mbstate_t foo
15516
15517   ;
15518   return 0;
15519 }
15520 _ACEOF
15521 rm -f conftest.$ac_objext
15522 if { (eval echo "$as_me:15522: \"$ac_compile\"") >&5
15523   (eval $ac_compile) 2>&5
15524   ac_status=$?
15525   echo "$as_me:15525: \$? = $ac_status" >&5
15526   (exit $ac_status); } &&
15527          { ac_try='test -s conftest.$ac_objext'
15528   { (eval echo "$as_me:15528: \"$ac_try\"") >&5
15529   (eval $ac_try) 2>&5
15530   ac_status=$?
15531   echo "$as_me:15531: \$? = $ac_status" >&5
15532   (exit $ac_status); }; }; then
15533   cf_result=yes
15534 else
15535   echo "$as_me: failed program was:" >&5
15536 cat conftest.$ac_ext >&5
15537 cf_result=no
15538 fi
15539 rm -f conftest.$ac_objext conftest.$ac_ext
15540 echo "$as_me:15540: result: $cf_result" >&5
15541 echo "${ECHO_T}$cf_result" >&6
15542 if test $cf_result = yes ; then
15543
15544 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15545
15546         cat >>confdefs.h <<EOF
15547 #define $cf_result 1
15548 EOF
15549
15550 else
15551         cat >>confdefs.h <<EOF
15552 #define mbstate_t long
15553 EOF
15554
15555 fi
15556
15557         fi
15558
15559         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
15560
15561 echo "$as_me:15561: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15562 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15563 cat >conftest.$ac_ext <<_ACEOF
15564 #line 15564 "configure"
15565 #include "confdefs.h"
15566
15567 #ifndef _XOPEN_SOURCE_EXTENDED
15568 #define _XOPEN_SOURCE_EXTENDED
15569 #endif
15570 #include <${cf_cv_ncurses_header:-curses.h}>
15571 int
15572 main ()
15573 {
15574
15575 wchar_t foo
15576
15577   ;
15578   return 0;
15579 }
15580 _ACEOF
15581 rm -f conftest.$ac_objext
15582 if { (eval echo "$as_me:15582: \"$ac_compile\"") >&5
15583   (eval $ac_compile) 2>&5
15584   ac_status=$?
15585   echo "$as_me:15585: \$? = $ac_status" >&5
15586   (exit $ac_status); } &&
15587          { ac_try='test -s conftest.$ac_objext'
15588   { (eval echo "$as_me:15588: \"$ac_try\"") >&5
15589   (eval $ac_try) 2>&5
15590   ac_status=$?
15591   echo "$as_me:15591: \$? = $ac_status" >&5
15592   (exit $ac_status); }; }; then
15593   cf_result=yes
15594 else
15595   echo "$as_me: failed program was:" >&5
15596 cat conftest.$ac_ext >&5
15597 cf_result=no
15598 fi
15599 rm -f conftest.$ac_objext conftest.$ac_ext
15600 echo "$as_me:15600: result: $cf_result" >&5
15601 echo "${ECHO_T}$cf_result" >&6
15602 if test $cf_result = yes ; then
15603
15604 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15605
15606         cat >>confdefs.h <<EOF
15607 #define $cf_result 1
15608 EOF
15609
15610 else
15611         cat >>confdefs.h <<EOF
15612 #define wchar_t long
15613 EOF
15614
15615 fi
15616
15617         fi
15618
15619         if test "$NCURSES_OK_WINT_T" = 0 ; then
15620
15621 echo "$as_me:15621: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15622 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15623 cat >conftest.$ac_ext <<_ACEOF
15624 #line 15624 "configure"
15625 #include "confdefs.h"
15626
15627 #ifndef _XOPEN_SOURCE_EXTENDED
15628 #define _XOPEN_SOURCE_EXTENDED
15629 #endif
15630 #include <${cf_cv_ncurses_header:-curses.h}>
15631 int
15632 main ()
15633 {
15634
15635 wint_t foo
15636
15637   ;
15638   return 0;
15639 }
15640 _ACEOF
15641 rm -f conftest.$ac_objext
15642 if { (eval echo "$as_me:15642: \"$ac_compile\"") >&5
15643   (eval $ac_compile) 2>&5
15644   ac_status=$?
15645   echo "$as_me:15645: \$? = $ac_status" >&5
15646   (exit $ac_status); } &&
15647          { ac_try='test -s conftest.$ac_objext'
15648   { (eval echo "$as_me:15648: \"$ac_try\"") >&5
15649   (eval $ac_try) 2>&5
15650   ac_status=$?
15651   echo "$as_me:15651: \$? = $ac_status" >&5
15652   (exit $ac_status); }; }; then
15653   cf_result=yes
15654 else
15655   echo "$as_me: failed program was:" >&5
15656 cat conftest.$ac_ext >&5
15657 cf_result=no
15658 fi
15659 rm -f conftest.$ac_objext conftest.$ac_ext
15660 echo "$as_me:15660: result: $cf_result" >&5
15661 echo "${ECHO_T}$cf_result" >&6
15662 if test $cf_result = yes ; then
15663
15664 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15665
15666         cat >>confdefs.h <<EOF
15667 #define $cf_result 1
15668 EOF
15669
15670 else
15671         cat >>confdefs.h <<EOF
15672 #define wint_t long
15673 EOF
15674
15675 fi
15676
15677         fi
15678 fi
15679
15680 echo "$as_me:15680: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15681 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15682
15683 cat >conftest.$ac_ext <<_ACEOF
15684 #line 15684 "configure"
15685 #include "confdefs.h"
15686
15687 #ifdef HAVE_XCURSES
15688 #include <xcurses.h>
15689 char * XCursesProgramName = "test";
15690 #else
15691 #include <${cf_cv_ncurses_header:-curses.h}>
15692 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15693 #include <ncursesw/term.h>
15694 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15695 #include <ncurses/term.h>
15696 #elif defined(HAVE_TERM_H)
15697 #include <term.h>
15698 #endif
15699 #endif
15700
15701 int
15702 main ()
15703 {
15704
15705 void *foo = &(boolnames)
15706
15707   ;
15708   return 0;
15709 }
15710 _ACEOF
15711 rm -f conftest.$ac_objext
15712 if { (eval echo "$as_me:15712: \"$ac_compile\"") >&5
15713   (eval $ac_compile) 2>&5
15714   ac_status=$?
15715   echo "$as_me:15715: \$? = $ac_status" >&5
15716   (exit $ac_status); } &&
15717          { ac_try='test -s conftest.$ac_objext'
15718   { (eval echo "$as_me:15718: \"$ac_try\"") >&5
15719   (eval $ac_try) 2>&5
15720   ac_status=$?
15721   echo "$as_me:15721: \$? = $ac_status" >&5
15722   (exit $ac_status); }; }; then
15723   cf_result=yes
15724 else
15725   echo "$as_me: failed program was:" >&5
15726 cat conftest.$ac_ext >&5
15727 cf_result=no
15728 fi
15729 rm -f conftest.$ac_objext conftest.$ac_ext
15730 echo "$as_me:15730: result: $cf_result" >&5
15731 echo "${ECHO_T}$cf_result" >&6
15732
15733 if test $cf_result = yes ; then
15734
15735 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15736
15737         cat >>confdefs.h <<EOF
15738 #define $cf_result 1
15739 EOF
15740
15741 else
15742         echo "$as_me:15742: checking for data boolnames in library" >&5
15743 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
15744         # BSD linkers insist on making weak linkage, but resolve at runtime.
15745         if test "$cross_compiling" = yes; then
15746
15747         # cross-compiling
15748         cat >conftest.$ac_ext <<_ACEOF
15749 #line 15749 "configure"
15750 #include "confdefs.h"
15751
15752 #ifdef HAVE_XCURSES
15753 #include <xcurses.h>
15754 char * XCursesProgramName = "test";
15755 #else
15756 #include <${cf_cv_ncurses_header:-curses.h}>
15757 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15758 #include <ncursesw/term.h>
15759 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15760 #include <ncurses/term.h>
15761 #elif defined(HAVE_TERM_H)
15762 #include <term.h>
15763 #endif
15764 #endif
15765
15766 extern char boolnames;
15767 int
15768 main ()
15769 {
15770
15771         do {
15772                 void *foo = &(boolnames);
15773                 ${cf_cv_main_return:-return}(foo == 0);
15774         } while (0)
15775
15776   ;
15777   return 0;
15778 }
15779 _ACEOF
15780 rm -f conftest.$ac_objext conftest$ac_exeext
15781 if { (eval echo "$as_me:15781: \"$ac_link\"") >&5
15782   (eval $ac_link) 2>&5
15783   ac_status=$?
15784   echo "$as_me:15784: \$? = $ac_status" >&5
15785   (exit $ac_status); } &&
15786          { ac_try='test -s conftest$ac_exeext'
15787   { (eval echo "$as_me:15787: \"$ac_try\"") >&5
15788   (eval $ac_try) 2>&5
15789   ac_status=$?
15790   echo "$as_me:15790: \$? = $ac_status" >&5
15791   (exit $ac_status); }; }; then
15792   cf_result=yes
15793 else
15794   echo "$as_me: failed program was:" >&5
15795 cat conftest.$ac_ext >&5
15796 cf_result=no
15797 fi
15798 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15799
15800 else
15801   cat >conftest.$ac_ext <<_ACEOF
15802 #line 15802 "configure"
15803 #include "confdefs.h"
15804
15805 #ifdef HAVE_XCURSES
15806 #include <xcurses.h>
15807 char * XCursesProgramName = "test";
15808 #else
15809 #include <${cf_cv_ncurses_header:-curses.h}>
15810 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15811 #include <ncursesw/term.h>
15812 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15813 #include <ncurses/term.h>
15814 #elif defined(HAVE_TERM_H)
15815 #include <term.h>
15816 #endif
15817 #endif
15818
15819 extern char boolnames;
15820 int main(void)
15821 {
15822         void *foo = &(boolnames);
15823         ${cf_cv_main_return:-return}(foo == 0);
15824 }
15825 _ACEOF
15826 rm -f conftest$ac_exeext
15827 if { (eval echo "$as_me:15827: \"$ac_link\"") >&5
15828   (eval $ac_link) 2>&5
15829   ac_status=$?
15830   echo "$as_me:15830: \$? = $ac_status" >&5
15831   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15832   { (eval echo "$as_me:15832: \"$ac_try\"") >&5
15833   (eval $ac_try) 2>&5
15834   ac_status=$?
15835   echo "$as_me:15835: \$? = $ac_status" >&5
15836   (exit $ac_status); }; }; then
15837   cf_result=yes
15838 else
15839   echo "$as_me: program exited with status $ac_status" >&5
15840 echo "$as_me: failed program was:" >&5
15841 cat conftest.$ac_ext >&5
15842 cf_result=no
15843 fi
15844 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15845 fi
15846         echo "$as_me:15846: result: $cf_result" >&5
15847 echo "${ECHO_T}$cf_result" >&6
15848         if test $cf_result = yes ; then
15849
15850 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15851
15852                 cat >>confdefs.h <<EOF
15853 #define $cf_result 1
15854 EOF
15855
15856         fi
15857 fi
15858
15859 echo "$as_me:15859: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15860 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15861
15862 cat >conftest.$ac_ext <<_ACEOF
15863 #line 15863 "configure"
15864 #include "confdefs.h"
15865
15866 #ifdef HAVE_XCURSES
15867 #include <xcurses.h>
15868 char * XCursesProgramName = "test";
15869 #else
15870 #include <${cf_cv_ncurses_header:-curses.h}>
15871 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15872 #include <ncursesw/term.h>
15873 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15874 #include <ncurses/term.h>
15875 #elif defined(HAVE_TERM_H)
15876 #include <term.h>
15877 #endif
15878 #endif
15879
15880 int
15881 main ()
15882 {
15883
15884 void *foo = &(boolfnames)
15885
15886   ;
15887   return 0;
15888 }
15889 _ACEOF
15890 rm -f conftest.$ac_objext
15891 if { (eval echo "$as_me:15891: \"$ac_compile\"") >&5
15892   (eval $ac_compile) 2>&5
15893   ac_status=$?
15894   echo "$as_me:15894: \$? = $ac_status" >&5
15895   (exit $ac_status); } &&
15896          { ac_try='test -s conftest.$ac_objext'
15897   { (eval echo "$as_me:15897: \"$ac_try\"") >&5
15898   (eval $ac_try) 2>&5
15899   ac_status=$?
15900   echo "$as_me:15900: \$? = $ac_status" >&5
15901   (exit $ac_status); }; }; then
15902   cf_result=yes
15903 else
15904   echo "$as_me: failed program was:" >&5
15905 cat conftest.$ac_ext >&5
15906 cf_result=no
15907 fi
15908 rm -f conftest.$ac_objext conftest.$ac_ext
15909 echo "$as_me:15909: result: $cf_result" >&5
15910 echo "${ECHO_T}$cf_result" >&6
15911
15912 if test $cf_result = yes ; then
15913
15914 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15915
15916         cat >>confdefs.h <<EOF
15917 #define $cf_result 1
15918 EOF
15919
15920 else
15921         echo "$as_me:15921: checking for data boolfnames in library" >&5
15922 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
15923         # BSD linkers insist on making weak linkage, but resolve at runtime.
15924         if test "$cross_compiling" = yes; then
15925
15926         # cross-compiling
15927         cat >conftest.$ac_ext <<_ACEOF
15928 #line 15928 "configure"
15929 #include "confdefs.h"
15930
15931 #ifdef HAVE_XCURSES
15932 #include <xcurses.h>
15933 char * XCursesProgramName = "test";
15934 #else
15935 #include <${cf_cv_ncurses_header:-curses.h}>
15936 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15937 #include <ncursesw/term.h>
15938 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15939 #include <ncurses/term.h>
15940 #elif defined(HAVE_TERM_H)
15941 #include <term.h>
15942 #endif
15943 #endif
15944
15945 extern char boolfnames;
15946 int
15947 main ()
15948 {
15949
15950         do {
15951                 void *foo = &(boolfnames);
15952                 ${cf_cv_main_return:-return}(foo == 0);
15953         } while (0)
15954
15955   ;
15956   return 0;
15957 }
15958 _ACEOF
15959 rm -f conftest.$ac_objext conftest$ac_exeext
15960 if { (eval echo "$as_me:15960: \"$ac_link\"") >&5
15961   (eval $ac_link) 2>&5
15962   ac_status=$?
15963   echo "$as_me:15963: \$? = $ac_status" >&5
15964   (exit $ac_status); } &&
15965          { ac_try='test -s conftest$ac_exeext'
15966   { (eval echo "$as_me:15966: \"$ac_try\"") >&5
15967   (eval $ac_try) 2>&5
15968   ac_status=$?
15969   echo "$as_me:15969: \$? = $ac_status" >&5
15970   (exit $ac_status); }; }; then
15971   cf_result=yes
15972 else
15973   echo "$as_me: failed program was:" >&5
15974 cat conftest.$ac_ext >&5
15975 cf_result=no
15976 fi
15977 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15978
15979 else
15980   cat >conftest.$ac_ext <<_ACEOF
15981 #line 15981 "configure"
15982 #include "confdefs.h"
15983
15984 #ifdef HAVE_XCURSES
15985 #include <xcurses.h>
15986 char * XCursesProgramName = "test";
15987 #else
15988 #include <${cf_cv_ncurses_header:-curses.h}>
15989 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15990 #include <ncursesw/term.h>
15991 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15992 #include <ncurses/term.h>
15993 #elif defined(HAVE_TERM_H)
15994 #include <term.h>
15995 #endif
15996 #endif
15997
15998 extern char boolfnames;
15999 int main(void)
16000 {
16001         void *foo = &(boolfnames);
16002         ${cf_cv_main_return:-return}(foo == 0);
16003 }
16004 _ACEOF
16005 rm -f conftest$ac_exeext
16006 if { (eval echo "$as_me:16006: \"$ac_link\"") >&5
16007   (eval $ac_link) 2>&5
16008   ac_status=$?
16009   echo "$as_me:16009: \$? = $ac_status" >&5
16010   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16011   { (eval echo "$as_me:16011: \"$ac_try\"") >&5
16012   (eval $ac_try) 2>&5
16013   ac_status=$?
16014   echo "$as_me:16014: \$? = $ac_status" >&5
16015   (exit $ac_status); }; }; then
16016   cf_result=yes
16017 else
16018   echo "$as_me: program exited with status $ac_status" >&5
16019 echo "$as_me: failed program was:" >&5
16020 cat conftest.$ac_ext >&5
16021 cf_result=no
16022 fi
16023 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16024 fi
16025         echo "$as_me:16025: result: $cf_result" >&5
16026 echo "${ECHO_T}$cf_result" >&6
16027         if test $cf_result = yes ; then
16028
16029 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16030
16031                 cat >>confdefs.h <<EOF
16032 #define $cf_result 1
16033 EOF
16034
16035         fi
16036 fi
16037
16038 LD_RPATH_OPT=
16039 echo "$as_me:16039: checking for an rpath option" >&5
16040 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
16041 case $cf_cv_system_name in #(vi
16042 irix*) #(vi
16043         if test "$GCC" = yes; then
16044                 LD_RPATH_OPT="-Wl,-rpath,"
16045         else
16046                 LD_RPATH_OPT="-rpath "
16047         fi
16048         ;;
16049 linux*|gnu*|k*bsd*-gnu) #(vi
16050         LD_RPATH_OPT="-Wl,-rpath,"
16051         ;;
16052 openbsd[2-9].*|mirbsd*) #(vi
16053         LD_RPATH_OPT="-Wl,-rpath,"
16054         ;;
16055 dragonfly*|freebsd*) #(vi
16056         LD_RPATH_OPT="-rpath "
16057         ;;
16058 netbsd*) #(vi
16059         LD_RPATH_OPT="-Wl,-rpath,"
16060         ;;
16061 osf*|mls+*) #(vi
16062         LD_RPATH_OPT="-rpath "
16063         ;;
16064 solaris2*) #(vi
16065         LD_RPATH_OPT="-R"
16066         ;;
16067 *)
16068         ;;
16069 esac
16070 echo "$as_me:16070: result: $LD_RPATH_OPT" >&5
16071 echo "${ECHO_T}$LD_RPATH_OPT" >&6
16072
16073 case "x$LD_RPATH_OPT" in #(vi
16074 x-R*)
16075         echo "$as_me:16075: checking if we need a space after rpath option" >&5
16076 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
16077         cf_save_LIBS="$LIBS"
16078         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
16079         cat >conftest.$ac_ext <<_ACEOF
16080 #line 16080 "configure"
16081 #include "confdefs.h"
16082
16083 int
16084 main ()
16085 {
16086
16087   ;
16088   return 0;
16089 }
16090 _ACEOF
16091 rm -f conftest.$ac_objext conftest$ac_exeext
16092 if { (eval echo "$as_me:16092: \"$ac_link\"") >&5
16093   (eval $ac_link) 2>&5
16094   ac_status=$?
16095   echo "$as_me:16095: \$? = $ac_status" >&5
16096   (exit $ac_status); } &&
16097          { ac_try='test -s conftest$ac_exeext'
16098   { (eval echo "$as_me:16098: \"$ac_try\"") >&5
16099   (eval $ac_try) 2>&5
16100   ac_status=$?
16101   echo "$as_me:16101: \$? = $ac_status" >&5
16102   (exit $ac_status); }; }; then
16103   cf_rpath_space=no
16104 else
16105   echo "$as_me: failed program was:" >&5
16106 cat conftest.$ac_ext >&5
16107 cf_rpath_space=yes
16108 fi
16109 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16110         LIBS="$cf_save_LIBS"
16111         echo "$as_me:16111: result: $cf_rpath_space" >&5
16112 echo "${ECHO_T}$cf_rpath_space" >&6
16113         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
16114         ;;
16115 esac
16116
16117 echo "$as_me:16117: checking if rpath-hack should be disabled" >&5
16118 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
16119
16120 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
16121 if test "${enable_rpath_hack+set}" = set; then
16122   enableval="$enable_rpath_hack"
16123   test "$enableval" != no && enableval=yes
16124   if test "$enableval" != "yes" ; then
16125     cf_disable_rpath_hack=yes
16126   else
16127     cf_disable_rpath_hack=no
16128   fi
16129 else
16130   enableval=yes
16131   cf_disable_rpath_hack=no
16132
16133 fi;
16134 echo "$as_me:16134: result: $cf_disable_rpath_hack" >&5
16135 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
16136 if test "$cf_disable_rpath_hack" = no ; then
16137
16138 echo "$as_me:16138: checking for updated LDFLAGS" >&5
16139 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
16140 if test -n "$LD_RPATH_OPT" ; then
16141         echo "$as_me:16141: result: maybe" >&5
16142 echo "${ECHO_T}maybe" >&6
16143
16144         for ac_prog in ldd
16145 do
16146   # Extract the first word of "$ac_prog", so it can be a program name with args.
16147 set dummy $ac_prog; ac_word=$2
16148 echo "$as_me:16148: checking for $ac_word" >&5
16149 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16150 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
16151   echo $ECHO_N "(cached) $ECHO_C" >&6
16152 else
16153   if test -n "$cf_ldd_prog"; then
16154   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
16155 else
16156   ac_save_IFS=$IFS; IFS=$ac_path_separator
16157 ac_dummy="$PATH"
16158 for ac_dir in $ac_dummy; do
16159   IFS=$ac_save_IFS
16160   test -z "$ac_dir" && ac_dir=.
16161   $as_executable_p "$ac_dir/$ac_word" || continue
16162 ac_cv_prog_cf_ldd_prog="$ac_prog"
16163 echo "$as_me:16163: found $ac_dir/$ac_word" >&5
16164 break
16165 done
16166
16167 fi
16168 fi
16169 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
16170 if test -n "$cf_ldd_prog"; then
16171   echo "$as_me:16171: result: $cf_ldd_prog" >&5
16172 echo "${ECHO_T}$cf_ldd_prog" >&6
16173 else
16174   echo "$as_me:16174: result: no" >&5
16175 echo "${ECHO_T}no" >&6
16176 fi
16177
16178   test -n "$cf_ldd_prog" && break
16179 done
16180 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
16181
16182         cf_rpath_list="/usr/lib /lib"
16183         if test "$cf_ldd_prog" != no
16184         then
16185                 cf_rpath_oops=
16186
16187 cat >conftest.$ac_ext <<_ACEOF
16188 #line 16188 "configure"
16189 #include "confdefs.h"
16190 #include <stdio.h>
16191 int
16192 main ()
16193 {
16194 printf("Hello");
16195   ;
16196   return 0;
16197 }
16198 _ACEOF
16199 rm -f conftest.$ac_objext conftest$ac_exeext
16200 if { (eval echo "$as_me:16200: \"$ac_link\"") >&5
16201   (eval $ac_link) 2>&5
16202   ac_status=$?
16203   echo "$as_me:16203: \$? = $ac_status" >&5
16204   (exit $ac_status); } &&
16205          { ac_try='test -s conftest$ac_exeext'
16206   { (eval echo "$as_me:16206: \"$ac_try\"") >&5
16207   (eval $ac_try) 2>&5
16208   ac_status=$?
16209   echo "$as_me:16209: \$? = $ac_status" >&5
16210   (exit $ac_status); }; }; then
16211   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u`
16212                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort -u`
16213 else
16214   echo "$as_me: failed program was:" >&5
16215 cat conftest.$ac_ext >&5
16216 fi
16217 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16218
16219                 # If we passed the link-test, but get a "not found" on a given library,
16220                 # this could be due to inept reconfiguration of gcc to make it only
16221                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
16222                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
16223                 # /usr/local libraries.
16224                 if test -n "$cf_rpath_oops"
16225                 then
16226                         for cf_rpath_src in $cf_rpath_oops
16227                         do
16228                                 for cf_rpath_dir in \
16229                                         /usr/local \
16230                                         /usr/pkg \
16231                                         /opt/sfw
16232                                 do
16233                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
16234                                         then
16235                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
16236
16237 echo "${as_me:-configure}:16237: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
16238
16239                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
16240                                                 break
16241                                         fi
16242                                 done
16243                         done
16244                 fi
16245         fi
16246
16247         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16248
16249 echo "${as_me:-configure}:16249: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16250
16251 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
16252
16253 echo "${as_me:-configure}:16253: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
16254
16255 cf_rpath_dst=
16256 for cf_rpath_src in $LDFLAGS
16257 do
16258         case $cf_rpath_src in #(vi
16259         -L*) #(vi
16260
16261                 # check if this refers to a directory which we will ignore
16262                 cf_rpath_skip=no
16263                 if test -n "$cf_rpath_list"
16264                 then
16265                         for cf_rpath_item in $cf_rpath_list
16266                         do
16267                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16268                                 then
16269                                         cf_rpath_skip=yes
16270                                         break
16271                                 fi
16272                         done
16273                 fi
16274
16275                 if test "$cf_rpath_skip" = no
16276                 then
16277                         # transform the option
16278                         if test "$LD_RPATH_OPT" = "-R " ; then
16279                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16280                         else
16281                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16282                         fi
16283
16284                         # if we have not already added this, add it now
16285                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16286                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16287                         then
16288                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16289
16290 echo "${as_me:-configure}:16290: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16291
16292                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16293                         fi
16294                 fi
16295                 ;;
16296         esac
16297         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16298 done
16299 LDFLAGS=$cf_rpath_dst
16300
16301 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
16302
16303 echo "${as_me:-configure}:16303: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
16304
16305 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
16306
16307 echo "${as_me:-configure}:16307: testing ...checking LIBS $LIBS ..." 1>&5
16308
16309 cf_rpath_dst=
16310 for cf_rpath_src in $LIBS
16311 do
16312         case $cf_rpath_src in #(vi
16313         -L*) #(vi
16314
16315                 # check if this refers to a directory which we will ignore
16316                 cf_rpath_skip=no
16317                 if test -n "$cf_rpath_list"
16318                 then
16319                         for cf_rpath_item in $cf_rpath_list
16320                         do
16321                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16322                                 then
16323                                         cf_rpath_skip=yes
16324                                         break
16325                                 fi
16326                         done
16327                 fi
16328
16329                 if test "$cf_rpath_skip" = no
16330                 then
16331                         # transform the option
16332                         if test "$LD_RPATH_OPT" = "-R " ; then
16333                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16334                         else
16335                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16336                         fi
16337
16338                         # if we have not already added this, add it now
16339                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16340                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16341                         then
16342                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16343
16344 echo "${as_me:-configure}:16344: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16345
16346                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16347                         fi
16348                 fi
16349                 ;;
16350         esac
16351         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16352 done
16353 LIBS=$cf_rpath_dst
16354
16355 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
16356
16357 echo "${as_me:-configure}:16357: testing ...checked LIBS $LIBS ..." 1>&5
16358
16359         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16360
16361 echo "${as_me:-configure}:16361: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16362
16363 fi
16364
16365 fi
16366
16367 TEST_ARGS="$LIBS"
16368 LIBS=
16369
16370 ac_config_files="$ac_config_files Makefile"
16371 ac_config_commands="$ac_config_commands default"
16372 cat >confcache <<\_ACEOF
16373 # This file is a shell script that caches the results of configure
16374 # tests run on this system so they can be shared between configure
16375 # scripts and configure runs, see configure's option --config-cache.
16376 # It is not useful on other systems.  If it contains results you don't
16377 # want to keep, you may remove or edit it.
16378 #
16379 # config.status only pays attention to the cache file if you give it
16380 # the --recheck option to rerun configure.
16381 #
16382 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16383 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16384 # following values.
16385
16386 _ACEOF
16387
16388 # The following way of writing the cache mishandles newlines in values,
16389 # but we know of no workaround that is simple, portable, and efficient.
16390 # So, don't put newlines in cache variables' values.
16391 # Ultrix sh set writes to stderr and can't be redirected directly,
16392 # and sets the high bit in the cache file unless we assign to the vars.
16393 {
16394   (set) 2>&1 |
16395     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16396     *ac_space=\ *)
16397       # `set' does not quote correctly, so add quotes (double-quote
16398       # substitution turns \\\\ into \\, and sed turns \\ into \).
16399       sed -n \
16400         "s/'/'\\\\''/g;
16401           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16402       ;;
16403     *)
16404       # `set' quotes correctly as required by POSIX, so do not add quotes.
16405       sed -n \
16406         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16407       ;;
16408     esac;
16409 } |
16410   sed '
16411      t clear
16412      : clear
16413      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16414      t end
16415      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16416      : end' >>confcache
16417 if cmp -s $cache_file confcache; then :; else
16418   if test -w $cache_file; then
16419     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16420     cat confcache >$cache_file
16421   else
16422     echo "not updating unwritable cache $cache_file"
16423   fi
16424 fi
16425 rm -f confcache
16426
16427 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16428 # Let make expand exec_prefix.
16429 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16430
16431 # VPATH may cause trouble with some makes, so we remove $(srcdir),
16432 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
16433 # trailing colons and then remove the whole line if VPATH becomes empty
16434 # (actually we leave an empty line to preserve line numbers).
16435 if test "x$srcdir" = x.; then
16436   ac_vpsub='/^[         ]*VPATH[        ]*=/{
16437 s/:*\$(srcdir):*/:/;
16438 s/:*\${srcdir}:*/:/;
16439 s/:*@srcdir@:*/:/;
16440 s/^\([^=]*=[    ]*\):*/\1/;
16441 s/:*$//;
16442 s/^[^=]*=[      ]*$//;
16443 }'
16444 fi
16445
16446 DEFS=-DHAVE_CONFIG_H
16447
16448 : ${CONFIG_STATUS=./config.status}
16449 ac_clean_files_save=$ac_clean_files
16450 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16451 { echo "$as_me:16451: creating $CONFIG_STATUS" >&5
16452 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16453 cat >$CONFIG_STATUS <<_ACEOF
16454 #! $SHELL
16455 # Generated automatically by configure.
16456 # Run this file to recreate the current configuration.
16457 # Compiler output produced by configure, useful for debugging
16458 # configure, is in config.log if it exists.
16459
16460 debug=false
16461 SHELL=\${CONFIG_SHELL-$SHELL}
16462 ac_cs_invocation="\$0 \$@"
16463
16464 _ACEOF
16465
16466 cat >>$CONFIG_STATUS <<\_ACEOF
16467 # Be Bourne compatible
16468 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16469   emulate sh
16470   NULLCMD=:
16471 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16472   set -o posix
16473 fi
16474
16475 # Name of the executable.
16476 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16477
16478 if expr a : '\(a\)' >/dev/null 2>&1; then
16479   as_expr=expr
16480 else
16481   as_expr=false
16482 fi
16483
16484 rm -f conf$$ conf$$.exe conf$$.file
16485 echo >conf$$.file
16486 if ln -s conf$$.file conf$$ 2>/dev/null; then
16487   # We could just check for DJGPP; but this test a) works b) is more generic
16488   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16489   if test -f conf$$.exe; then
16490     # Don't use ln at all; we don't have any links
16491     as_ln_s='cp -p'
16492   else
16493     as_ln_s='ln -s'
16494   fi
16495 elif ln conf$$.file conf$$ 2>/dev/null; then
16496   as_ln_s=ln
16497 else
16498   as_ln_s='cp -p'
16499 fi
16500 rm -f conf$$ conf$$.exe conf$$.file
16501
16502 as_executable_p="test -f"
16503
16504 # Support unset when possible.
16505 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16506   as_unset=unset
16507 else
16508   as_unset=false
16509 fi
16510
16511 # NLS nuisances.
16512 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16513 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16514 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16515 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16516 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16517 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16518 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16519 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16520
16521 # IFS
16522 # We need space, tab and new line, in precisely that order.
16523 as_nl='
16524 '
16525 IFS="   $as_nl"
16526
16527 # CDPATH.
16528 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16529
16530 exec 6>&1
16531
16532 _ACEOF
16533
16534 # Files that config.status was made for.
16535 if test -n "$ac_config_files"; then
16536   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16537 fi
16538
16539 if test -n "$ac_config_headers"; then
16540   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16541 fi
16542
16543 if test -n "$ac_config_links"; then
16544   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16545 fi
16546
16547 if test -n "$ac_config_commands"; then
16548   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16549 fi
16550
16551 cat >>$CONFIG_STATUS <<\EOF
16552
16553 ac_cs_usage="\
16554 \`$as_me' instantiates files from templates according to the
16555 current configuration.
16556
16557 Usage: $0 [OPTIONS] [FILE]...
16558
16559   -h, --help       print this help, then exit
16560   -V, --version    print version number, then exit
16561   -d, --debug      don't remove temporary files
16562       --recheck    update $as_me by reconfiguring in the same conditions
16563   --file=FILE[:TEMPLATE]
16564                    instantiate the configuration file FILE
16565   --header=FILE[:TEMPLATE]
16566                    instantiate the configuration header FILE
16567
16568 Configuration files:
16569 $config_files
16570
16571 Configuration headers:
16572 $config_headers
16573
16574 Configuration commands:
16575 $config_commands
16576
16577 Report bugs to <dickey@invisible-island.net>."
16578 EOF
16579
16580 cat >>$CONFIG_STATUS <<EOF
16581 ac_cs_version="\\
16582 config.status
16583 configured by $0, generated by GNU Autoconf 2.52.20120811,
16584   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16585
16586 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16587 Free Software Foundation, Inc.
16588 This config.status script is free software; the Free Software Foundation
16589 gives unlimited permission to copy, distribute and modify it."
16590 srcdir=$srcdir
16591 INSTALL="$INSTALL"
16592 EOF
16593
16594 cat >>$CONFIG_STATUS <<\EOF
16595 # If no file are specified by the user, then we need to provide default
16596 # value.  By we need to know if files were specified by the user.
16597 ac_need_defaults=:
16598 while test $# != 0
16599 do
16600   case $1 in
16601   --*=*)
16602     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16603     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16604     shift
16605     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16606     shift
16607     ;;
16608   -*);;
16609   *) # This is not an option, so the user has probably given explicit
16610      # arguments.
16611      ac_need_defaults=false;;
16612   esac
16613
16614   case $1 in
16615   # Handling of the options.
16616 EOF
16617 cat >>$CONFIG_STATUS <<EOF
16618   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16619     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16620     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16621 EOF
16622 cat >>$CONFIG_STATUS <<\EOF
16623   --version | --vers* | -V )
16624     echo "$ac_cs_version"; exit 0 ;;
16625   --he | --h)
16626     # Conflict between --help and --header
16627     { { echo "$as_me:16627: error: ambiguous option: $1
16628 Try \`$0 --help' for more information." >&5
16629 echo "$as_me: error: ambiguous option: $1
16630 Try \`$0 --help' for more information." >&2;}
16631    { (exit 1); exit 1; }; };;
16632   --help | --hel | -h )
16633     echo "$ac_cs_usage"; exit 0 ;;
16634   --debug | --d* | -d )
16635     debug=: ;;
16636   --file | --fil | --fi | --f )
16637     shift
16638     CONFIG_FILES="$CONFIG_FILES $1"
16639     ac_need_defaults=false;;
16640   --header | --heade | --head | --hea )
16641     shift
16642     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16643     ac_need_defaults=false;;
16644
16645   # This is an error.
16646   -*) { { echo "$as_me:16646: error: unrecognized option: $1
16647 Try \`$0 --help' for more information." >&5
16648 echo "$as_me: error: unrecognized option: $1
16649 Try \`$0 --help' for more information." >&2;}
16650    { (exit 1); exit 1; }; } ;;
16651
16652   *) ac_config_targets="$ac_config_targets $1" ;;
16653
16654   esac
16655   shift
16656 done
16657
16658 exec 5>>config.log
16659 cat >&5 << _ACEOF
16660
16661 ## ----------------------- ##
16662 ## Running config.status.  ##
16663 ## ----------------------- ##
16664
16665 This file was extended by $as_me 2.52.20120811, executed with
16666   CONFIG_FILES    = $CONFIG_FILES
16667   CONFIG_HEADERS  = $CONFIG_HEADERS
16668   CONFIG_LINKS    = $CONFIG_LINKS
16669   CONFIG_COMMANDS = $CONFIG_COMMANDS
16670   > $ac_cs_invocation
16671 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16672
16673 _ACEOF
16674 EOF
16675
16676 cat >>$CONFIG_STATUS <<EOF
16677 #
16678 # INIT-COMMANDS section.
16679 #
16680
16681 AWK="$AWK"
16682 ECHO_CC="$ECHO_CC"
16683 ECHO_LD="$ECHO_LD"
16684 SHOW_CC="$SHOW_LD"
16685
16686 EOF
16687
16688 cat >>$CONFIG_STATUS <<\EOF
16689 for ac_config_target in $ac_config_targets
16690 do
16691   case "$ac_config_target" in
16692   # Handling of arguments.
16693   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16694   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16695   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
16696   *) { { echo "$as_me:16696: error: invalid argument: $ac_config_target" >&5
16697 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16698    { (exit 1); exit 1; }; };;
16699   esac
16700 done
16701
16702 # If the user did not use the arguments to specify the items to instantiate,
16703 # then the envvar interface is used.  Set only those that are not.
16704 # We use the long form for the default assignment because of an extremely
16705 # bizarre bug on SunOS 4.1.3.
16706 if $ac_need_defaults; then
16707   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16708   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16709   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16710 fi
16711
16712 # Create a temporary directory, and hook for its removal unless debugging.
16713 $debug ||
16714 {
16715   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16716   trap '{ (exit 1); exit 1; }' 1 2 13 15
16717 }
16718
16719 # Create a (secure) tmp directory for tmp files.
16720 : ${TMPDIR=/tmp}
16721 {
16722   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16723   test -n "$tmp" && test -d "$tmp"
16724 }  ||
16725 {
16726   tmp=$TMPDIR/cs$$-$RANDOM
16727   (umask 077 && mkdir $tmp)
16728 } ||
16729 {
16730    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16731    { (exit 1); exit 1; }
16732 }
16733
16734 EOF
16735
16736 cat >>$CONFIG_STATUS <<EOF
16737
16738 #
16739 # CONFIG_FILES section.
16740 #
16741
16742 # No need to generate the scripts if there are no CONFIG_FILES.
16743 # This happens for instance when ./config.status config.h
16744 if test -n "\$CONFIG_FILES"; then
16745   # Protect against being on the right side of a sed subst in config.status.
16746   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
16747    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
16748 s,@SHELL@,$SHELL,;t t
16749 s,@exec_prefix@,$exec_prefix,;t t
16750 s,@prefix@,$prefix,;t t
16751 s,@program_transform_name@,$program_transform_name,;t t
16752 s,@bindir@,$bindir,;t t
16753 s,@sbindir@,$sbindir,;t t
16754 s,@libexecdir@,$libexecdir,;t t
16755 s,@datarootdir@,$datarootdir,;t t
16756 s,@datadir@,$datadir,;t t
16757 s,@sysconfdir@,$sysconfdir,;t t
16758 s,@sharedstatedir@,$sharedstatedir,;t t
16759 s,@localstatedir@,$localstatedir,;t t
16760 s,@libdir@,$libdir,;t t
16761 s,@includedir@,$includedir,;t t
16762 s,@oldincludedir@,$oldincludedir,;t t
16763 s,@infodir@,$infodir,;t t
16764 s,@mandir@,$mandir,;t t
16765 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
16766 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
16767 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
16768 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
16769 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
16770 s,@build_alias@,$build_alias,;t t
16771 s,@host_alias@,$host_alias,;t t
16772 s,@target_alias@,$target_alias,;t t
16773 s,@ECHO_C@,$ECHO_C,;t t
16774 s,@ECHO_N@,$ECHO_N,;t t
16775 s,@ECHO_T@,$ECHO_T,;t t
16776 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
16777 s,@DEFS@,$DEFS,;t t
16778 s,@LIBS@,$LIBS,;t t
16779 s,@build@,$build,;t t
16780 s,@build_cpu@,$build_cpu,;t t
16781 s,@build_vendor@,$build_vendor,;t t
16782 s,@build_os@,$build_os,;t t
16783 s,@host@,$host,;t t
16784 s,@host_cpu@,$host_cpu,;t t
16785 s,@host_vendor@,$host_vendor,;t t
16786 s,@host_os@,$host_os,;t t
16787 s,@SET_MAKE@,$SET_MAKE,;t t
16788 s,@CC@,$CC,;t t
16789 s,@CFLAGS@,$CFLAGS,;t t
16790 s,@LDFLAGS@,$LDFLAGS,;t t
16791 s,@CPPFLAGS@,$CPPFLAGS,;t t
16792 s,@ac_ct_CC@,$ac_ct_CC,;t t
16793 s,@EXEEXT@,$EXEEXT,;t t
16794 s,@OBJEXT@,$OBJEXT,;t t
16795 s,@CPP@,$CPP,;t t
16796 s,@AWK@,$AWK,;t t
16797 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
16798 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
16799 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
16800 s,@LINT@,$LINT,;t t
16801 s,@LINT_OPTS@,$LINT_OPTS,;t t
16802 s,@CTAGS@,$CTAGS,;t t
16803 s,@ETAGS@,$ETAGS,;t t
16804 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
16805 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
16806 s,@MATH_LIB@,$MATH_LIB,;t t
16807 s,@top_builddir@,$top_builddir,;t t
16808 s,@CC_G_OPT@,$CC_G_OPT,;t t
16809 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
16810 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
16811 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
16812 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
16813 s,@LD@,$LD,;t t
16814 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
16815 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
16816 s,@LD_MODEL@,$LD_MODEL,;t t
16817 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
16818 s,@LIBTOOL@,$LIBTOOL,;t t
16819 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
16820 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
16821 s,@LIB_LINK@,$LIB_LINK,;t t
16822 s,@LINK_TESTS@,$LINK_TESTS,;t t
16823 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
16824 s,@PTHREAD@,$PTHREAD,;t t
16825 s,@TEST_ARGS@,$TEST_ARGS,;t t
16826 s,@TEST_DEPS@,$TEST_DEPS,;t t
16827 s,@TEST_LIBS@,$TEST_LIBS,;t t
16828 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
16829 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
16830 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
16831 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
16832 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
16833 s,@ECHO_LT@,$ECHO_LT,;t t
16834 s,@ECHO_LD@,$ECHO_LD,;t t
16835 s,@RULE_CC@,$RULE_CC,;t t
16836 s,@SHOW_CC@,$SHOW_CC,;t t
16837 s,@ECHO_CC@,$ECHO_CC,;t t
16838 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
16839 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
16840 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
16841 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
16842 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
16843 s,@X_CFLAGS@,$X_CFLAGS,;t t
16844 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
16845 s,@X_LIBS@,$X_LIBS,;t t
16846 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
16847 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
16848 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
16849 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
16850 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
16851 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
16852 CEOF
16853
16854 EOF
16855
16856   cat >>$CONFIG_STATUS <<\EOF
16857   # Split the substitutions into bite-sized pieces for seds with
16858   # small command number limits, like on Digital OSF/1 and HP-UX.
16859   ac_max_sed_lines=48
16860   ac_sed_frag=1 # Number of current file.
16861   ac_beg=1 # First line for current file.
16862   ac_end=$ac_max_sed_lines # Line after last line for current file.
16863   ac_more_lines=:
16864   ac_sed_cmds=
16865   while $ac_more_lines; do
16866     if test $ac_beg -gt 1; then
16867       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16868     else
16869       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16870     fi
16871     if test ! -s $tmp/subs.frag; then
16872       ac_more_lines=false
16873     else
16874       # The purpose of the label and of the branching condition is to
16875       # speed up the sed processing (if there are no `@' at all, there
16876       # is no need to browse any of the substitutions).
16877       # These are the two extra sed commands mentioned above.
16878       (echo ':t
16879   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
16880       if test -z "$ac_sed_cmds"; then
16881         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
16882       else
16883         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
16884       fi
16885       ac_sed_frag=`expr $ac_sed_frag + 1`
16886       ac_beg=$ac_end
16887       ac_end=`expr $ac_end + $ac_max_sed_lines`
16888     fi
16889   done
16890   if test -z "$ac_sed_cmds"; then
16891     ac_sed_cmds=cat
16892   fi
16893 fi # test -n "$CONFIG_FILES"
16894
16895 EOF
16896 cat >>$CONFIG_STATUS <<\EOF
16897 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
16898   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16899   case $ac_file in
16900   - | *:- | *:-:* ) # input from stdin
16901         cat >$tmp/stdin
16902         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16903         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16904   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16905         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16906   * )   ac_file_in=$ac_file.in ;;
16907   esac
16908
16909   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
16910   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16911          X"$ac_file" : 'X\(//\)[^/]' \| \
16912          X"$ac_file" : 'X\(//\)$' \| \
16913          X"$ac_file" : 'X\(/\)' \| \
16914          .     : '\(.\)' 2>/dev/null ||
16915 echo X"$ac_file" |
16916     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16917           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16918           /^X\(\/\/\)$/{ s//\1/; q; }
16919           /^X\(\/\).*/{ s//\1/; q; }
16920           s/.*/./; q'`
16921   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16922     { case "$ac_dir" in
16923   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16924   *)                      as_incr_dir=.;;
16925 esac
16926 as_dummy="$ac_dir"
16927 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16928   case $as_mkdir_dir in
16929     # Skip DOS drivespec
16930     ?:) as_incr_dir=$as_mkdir_dir ;;
16931     *)
16932       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16933       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16934     ;;
16935   esac
16936 done; }
16937
16938     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
16939     # A "../" for each directory in $ac_dir_suffix.
16940     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
16941   else
16942     ac_dir_suffix= ac_dots=
16943   fi
16944
16945   case $srcdir in
16946   .)  ac_srcdir=.
16947       if test -z "$ac_dots"; then
16948          ac_top_srcdir=.
16949       else
16950          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
16951       fi ;;
16952   [\\/]* | ?:[\\/]* )
16953       ac_srcdir=$srcdir$ac_dir_suffix;
16954       ac_top_srcdir=$srcdir ;;
16955   *) # Relative path.
16956     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
16957     ac_top_srcdir=$ac_dots$srcdir ;;
16958   esac
16959
16960   case $INSTALL in
16961   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
16962   *) ac_INSTALL=$ac_dots$INSTALL ;;
16963   esac
16964
16965   if test x"$ac_file" != x-; then
16966     { echo "$as_me:16966: creating $ac_file" >&5
16967 echo "$as_me: creating $ac_file" >&6;}
16968     rm -f "$ac_file"
16969   fi
16970   # Let's still pretend it is `configure' which instantiates (i.e., don't
16971   # use $as_me), people would be surprised to read:
16972   #    /* config.h.  Generated automatically by config.status.  */
16973   configure_input="Generated automatically from `echo $ac_file_in |
16974                                                  sed 's,.*/,,'` by configure."
16975
16976   # First look for the input files in the build tree, otherwise in the
16977   # src tree.
16978   ac_file_inputs=`IFS=:
16979     for f in $ac_file_in; do
16980       case $f in
16981       -) echo $tmp/stdin ;;
16982       [\\/$]*)
16983          # Absolute (can't be DOS-style, as IFS=:)
16984          test -f "$f" || { { echo "$as_me:16984: error: cannot find input file: $f" >&5
16985 echo "$as_me: error: cannot find input file: $f" >&2;}
16986    { (exit 1); exit 1; }; }
16987          echo $f;;
16988       *) # Relative
16989          if test -f "$f"; then
16990            # Build tree
16991            echo $f
16992          elif test -f "$srcdir/$f"; then
16993            # Source tree
16994            echo $srcdir/$f
16995          else
16996            # /dev/null tree
16997            { { echo "$as_me:16997: error: cannot find input file: $f" >&5
16998 echo "$as_me: error: cannot find input file: $f" >&2;}
16999    { (exit 1); exit 1; }; }
17000          fi;;
17001       esac
17002     done` || { (exit 1); exit 1; }
17003 EOF
17004 cat >>$CONFIG_STATUS <<EOF
17005   sed "$ac_vpsub
17006 $extrasub
17007 EOF
17008 cat >>$CONFIG_STATUS <<\EOF
17009 :t
17010 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17011 s,@configure_input@,$configure_input,;t t
17012 s,@srcdir@,$ac_srcdir,;t t
17013 s,@top_srcdir@,$ac_top_srcdir,;t t
17014 s,@INSTALL@,$ac_INSTALL,;t t
17015 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
17016   rm -f $tmp/stdin
17017   if test x"$ac_file" != x-; then
17018     mv $tmp/out $ac_file
17019   else
17020     cat $tmp/out
17021     rm -f $tmp/out
17022   fi
17023
17024 done
17025 EOF
17026 cat >>$CONFIG_STATUS <<\EOF
17027
17028 #
17029 # CONFIG_HEADER section.
17030 #
17031
17032 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17033 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17034 #
17035 # ac_d sets the value in "#define NAME VALUE" lines.
17036 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17037 ac_dB='[        ].*$,\1#\2'
17038 ac_dC=' '
17039 ac_dD=',;t'
17040 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17041 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17042 ac_iB='\([      ]\),\1#\2define\3'
17043 ac_iC=' '
17044 ac_iD='\4,;t'
17045 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17046 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17047 ac_uB='$,\1#\2define\3'
17048 ac_uC=' '
17049 ac_uD=',;t'
17050
17051 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
17052   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17053   case $ac_file in
17054   - | *:- | *:-:* ) # input from stdin
17055         cat >$tmp/stdin
17056         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17057         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17058   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17059         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17060   * )   ac_file_in=$ac_file.in ;;
17061   esac
17062
17063   test x"$ac_file" != x- && { echo "$as_me:17063: creating $ac_file" >&5
17064 echo "$as_me: creating $ac_file" >&6;}
17065
17066   # First look for the input files in the build tree, otherwise in the
17067   # src tree.
17068   ac_file_inputs=`IFS=:
17069     for f in $ac_file_in; do
17070       case $f in
17071       -) echo $tmp/stdin ;;
17072       [\\/$]*)
17073          # Absolute (can't be DOS-style, as IFS=:)
17074          test -f "$f" || { { echo "$as_me:17074: error: cannot find input file: $f" >&5
17075 echo "$as_me: error: cannot find input file: $f" >&2;}
17076    { (exit 1); exit 1; }; }
17077          echo $f;;
17078       *) # Relative
17079          if test -f "$f"; then
17080            # Build tree
17081            echo $f
17082          elif test -f "$srcdir/$f"; then
17083            # Source tree
17084            echo $srcdir/$f
17085          else
17086            # /dev/null tree
17087            { { echo "$as_me:17087: error: cannot find input file: $f" >&5
17088 echo "$as_me: error: cannot find input file: $f" >&2;}
17089    { (exit 1); exit 1; }; }
17090          fi;;
17091       esac
17092     done` || { (exit 1); exit 1; }
17093   # Remove the trailing spaces.
17094   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
17095
17096 EOF
17097
17098 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
17099 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
17100 # be either 'cat' or 'sort'.
17101 cat confdefs.h | uniq >conftest.vals
17102
17103 # Break up conftest.vals because some shells have a limit on
17104 # the size of here documents, and old seds have small limits too.
17105
17106 rm -f conftest.tail
17107 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
17108 while grep . conftest.vals >/dev/null
17109 do
17110   # Write chunks of a limited-size here document to conftest.frag.
17111   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
17112   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
17113   echo 'CEOF' >> $CONFIG_STATUS
17114   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17115   rm -f conftest.vals
17116   mv conftest.tail conftest.vals
17117 done
17118 rm -f conftest.vals
17119
17120 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
17121 # marker @DEFS@.
17122 echo '  cat >> conftest.edit <<CEOF
17123 /@DEFS@/r conftest.frag
17124 /@DEFS@/d
17125 CEOF
17126 sed -f conftest.edit $tmp/in > $tmp/out
17127 rm -f $tmp/in
17128 mv $tmp/out $tmp/in
17129 rm -f conftest.edit conftest.frag
17130 ' >> $CONFIG_STATUS
17131
17132 cat >>$CONFIG_STATUS <<\EOF
17133   # Let's still pretend it is `configure' which instantiates (i.e., don't
17134   # use $as_me), people would be surprised to read:
17135   #    /* config.h.  Generated automatically by config.status.  */
17136   if test x"$ac_file" = x-; then
17137     echo "/* Generated automatically by configure.  */" >$tmp/config.h
17138   else
17139     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
17140   fi
17141   cat $tmp/in >>$tmp/config.h
17142   rm -f $tmp/in
17143   if test x"$ac_file" != x-; then
17144     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
17145       { echo "$as_me:17145: $ac_file is unchanged" >&5
17146 echo "$as_me: $ac_file is unchanged" >&6;}
17147     else
17148       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17149          X"$ac_file" : 'X\(//\)[^/]' \| \
17150          X"$ac_file" : 'X\(//\)$' \| \
17151          X"$ac_file" : 'X\(/\)' \| \
17152          .     : '\(.\)' 2>/dev/null ||
17153 echo X"$ac_file" |
17154     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17155           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17156           /^X\(\/\/\)$/{ s//\1/; q; }
17157           /^X\(\/\).*/{ s//\1/; q; }
17158           s/.*/./; q'`
17159       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17160         { case "$ac_dir" in
17161   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17162   *)                      as_incr_dir=.;;
17163 esac
17164 as_dummy="$ac_dir"
17165 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17166   case $as_mkdir_dir in
17167     # Skip DOS drivespec
17168     ?:) as_incr_dir=$as_mkdir_dir ;;
17169     *)
17170       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17171       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17172     ;;
17173   esac
17174 done; }
17175
17176       fi
17177       rm -f $ac_file
17178       mv $tmp/config.h $ac_file
17179     fi
17180   else
17181     cat $tmp/config.h
17182     rm -f $tmp/config.h
17183   fi
17184 done
17185 EOF
17186 cat >>$CONFIG_STATUS <<\EOF
17187 #
17188 # CONFIG_COMMANDS section.
17189 #
17190 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17191   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17192   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17193
17194   case $ac_dest in
17195     default )
17196
17197 for cf_dir in .
17198 do
17199         if test ! -d $srcdir/$cf_dir; then
17200                 continue
17201         elif test -f $srcdir/$cf_dir/programs; then
17202                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
17203         fi
17204 done
17205
17206         cat >>Makefile <<TEST_EOF
17207
17208 # These rules are generated so we do not rely on suffix rules, which do not
17209 # work consistently for different make-programs (the '\$(MODEL)/' confuses
17210 # some, and the '\$x' confuses others).
17211 TEST_EOF
17212
17213 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
17214 for N in $LIST
17215 do
17216         cat >>Makefile <<TEST_EOF
17217
17218 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
17219         \$(srcdir)/test.priv.h \\
17220         ncurses_cfg.h
17221         $SHOW_CC
17222         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
17223 TEST_EOF
17224 done
17225
17226 if test -f ../config.guess && test -f ../config.sub
17227 then
17228         cat >>Makefile <<TEST_EOF
17229
17230 # if we used CF_INHERIT for getting these files, we can remove them
17231 distclean::
17232         rm -f config.guess config.sub
17233 TEST_EOF
17234 fi
17235  ;;
17236   esac
17237 done
17238 EOF
17239
17240 cat >>$CONFIG_STATUS <<\EOF
17241
17242 { (exit 0); exit 0; }
17243 EOF
17244 chmod +x $CONFIG_STATUS
17245 ac_clean_files=$ac_clean_files_save
17246
17247 # configure is writing to config.log, and then calls config.status.
17248 # config.status does its own redirection, appending to config.log.
17249 # Unfortunately, on DOS this fails, as config.log is still kept open
17250 # by configure, so config.status won't be able to write to it; its
17251 # output is simply discarded.  So we exec the FD to /dev/null,
17252 # effectively closing config.log, so it can be properly (re)opened and
17253 # appended to by config.status.  When coming back to configure, we
17254 # need to make the FD available again.
17255 if test "$no_create" != yes; then
17256   ac_cs_success=:
17257   exec 5>/dev/null
17258   $SHELL $CONFIG_STATUS || ac_cs_success=false
17259   exec 5>>config.log
17260   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17261   # would make configure fail if this is the last instruction.
17262   $ac_cs_success || { (exit 1); exit 1; }
17263 fi
17264