]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.9 - patch 20140503
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20121002.
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 Packages:
650   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
651   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
652
653 Optional Features:
654   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
655   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
656
657 General Options:
658   --with-pkg-config{=path} enable/disable use of pkg-config
659   --disable-echo          do not display "compiling" commands
660 Curses Version-dependent Options:
661   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
662   --disable-widec         disable checks for wide-character functions
663   --with-curses-dir=DIR   directory in which (n)curses is installed
664   --with-ncursesw         use wide ncurses-libraries
665   --with-ncurses          use ncurses-libraries
666   --with-pdcurses         compile/link with pdcurses X11 library
667   --with-curses-colr      compile/link with HPUX 10.x color-curses
668   --with-curses-5lib      compile/link with SunOS 5lib curses
669   --with-Xaw3d            link with Xaw 3d library
670   --with-neXtaw           link with neXT Athena library
671   --with-XawPlus          link with Athena-Plus library
672   --with-x                use the X Window System
673 Testing/development Options:
674   --enable-warnings       test: turn on gcc compiler warnings
675   --with-dmalloc          test: use Gray Watson's dmalloc library
676   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
677   --with-valgrind         test: use valgrind
678   --disable-leaks         test: free permanent memory, analyze leaks
679   --disable-rpath-hack    don't add rpath options for additional libraries
680
681 Some influential environment variables:
682   CC          C compiler command
683   CFLAGS      C compiler flags
684   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
685               nonstandard directory <lib dir>
686   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
687               headers in a nonstandard directory <include dir>
688   CPP         C preprocessor
689
690 Use these variables to override the choices made by `configure' or to help
691 it to find libraries and programs with nonstandard names/locations.
692
693 EOF
694 fi
695
696 if test "$ac_init_help" = "recursive"; then
697   # If there are subdirs, report their specific --help.
698   ac_popdir=`pwd`
699   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
700     cd $ac_subdir
701     # A "../" for each directory in /$ac_subdir.
702     ac_dots=`echo $ac_subdir |
703              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
704
705     case $srcdir in
706     .) # No --srcdir option.  We are building in place.
707       ac_sub_srcdir=$srcdir ;;
708     [\\/]* | ?:[\\/]* ) # Absolute path.
709       ac_sub_srcdir=$srcdir/$ac_subdir ;;
710     *) # Relative path.
711       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
712     esac
713
714     # Check for guested configure; otherwise get Cygnus style configure.
715     if test -f $ac_sub_srcdir/configure.gnu; then
716       echo
717       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
718     elif test -f $ac_sub_srcdir/configure; then
719       echo
720       $SHELL $ac_sub_srcdir/configure  --help=recursive
721     elif test -f $ac_sub_srcdir/configure.ac ||
722            test -f $ac_sub_srcdir/configure.in; then
723       echo
724       $ac_configure --help
725     else
726       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
727     fi
728     cd $ac_popdir
729   done
730 fi
731
732 test -n "$ac_init_help" && exit 0
733 if $ac_init_version; then
734   cat <<\EOF
735
736 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
737 Free Software Foundation, Inc.
738 This configure script is free software; the Free Software Foundation
739 gives unlimited permission to copy, distribute and modify it.
740 EOF
741   exit 0
742 fi
743 exec 5>config.log
744 cat >&5 <<EOF
745 This file contains any messages produced by compilers while
746 running configure, to aid debugging if configure makes a mistake.
747
748 It was created by $as_me, which was
749 generated by GNU Autoconf 2.52.20121002.  Invocation command line was
750
751   $ $0 $@
752
753 EOF
754 {
755 cat <<_ASUNAME
756 ## ---------- ##
757 ## Platform.  ##
758 ## ---------- ##
759
760 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
761 uname -m = `(uname -m) 2>/dev/null || echo unknown`
762 uname -r = `(uname -r) 2>/dev/null || echo unknown`
763 uname -s = `(uname -s) 2>/dev/null || echo unknown`
764 uname -v = `(uname -v) 2>/dev/null || echo unknown`
765
766 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
767 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
768
769 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
770 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
771 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
772 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
773 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
774 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
775 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
776
777 PATH = $PATH
778
779 _ASUNAME
780 } >&5
781
782 cat >&5 <<EOF
783 ## ------------ ##
784 ## Core tests.  ##
785 ## ------------ ##
786
787 EOF
788
789 # Keep a trace of the command line.
790 # Strip out --no-create and --no-recursion so they do not pile up.
791 # Also quote any args containing shell meta-characters.
792 ac_configure_args=
793 ac_sep=
794 for ac_arg
795 do
796   case $ac_arg in
797   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
798   | --no-cr | --no-c) ;;
799   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
800   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
801   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
802     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
803     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
804     ac_sep=" " ;;
805   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
806      ac_sep=" " ;;
807   esac
808   # Get rid of the leading space.
809 done
810
811 # When interrupted or exit'd, cleanup temporary files, and complete
812 # config.log.  We remove comments because anyway the quotes in there
813 # would cause problems or look ugly.
814 trap 'exit_status=$?
815   # Save into config.log some information that might help in debugging.
816   echo >&5
817   echo "## ----------------- ##" >&5
818   echo "## Cache variables.  ##" >&5
819   echo "## ----------------- ##" >&5
820   echo >&5
821   # The following way of writing the cache mishandles newlines in values,
822 {
823   (set) 2>&1 |
824     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
825     *ac_space=\ *)
826       sed -n \
827         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
828           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
829       ;;
830     *)
831       sed -n \
832         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
833       ;;
834     esac;
835 } >&5
836   sed "/^$/d" confdefs.h >conftest.log
837   if test -s conftest.log; then
838     echo >&5
839     echo "## ------------ ##" >&5
840     echo "## confdefs.h.  ##" >&5
841     echo "## ------------ ##" >&5
842     echo >&5
843     cat conftest.log >&5
844   fi
845   (echo; echo) >&5
846   test "$ac_signal" != 0 &&
847     echo "$as_me: caught signal $ac_signal" >&5
848   echo "$as_me: exit $exit_status" >&5
849   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
850     exit $exit_status
851      ' 0
852 for ac_signal in 1 2 13 15; do
853   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
854 done
855 ac_signal=0
856
857 # confdefs.h avoids OS command line length limits that DEFS can exceed.
858 rm -rf conftest* confdefs.h
859 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
860 echo >confdefs.h
861
862 # Let the site file select an alternate cache file if it wants to.
863 # Prefer explicitly selected file to automatically selected ones.
864 if test -z "$CONFIG_SITE"; then
865   if test "x$prefix" != xNONE; then
866     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
867   else
868     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
869   fi
870 fi
871 for ac_site_file in $CONFIG_SITE; do
872   if test -r "$ac_site_file"; then
873     { echo "$as_me:873: loading site script $ac_site_file" >&5
874 echo "$as_me: loading site script $ac_site_file" >&6;}
875     cat "$ac_site_file" >&5
876     . "$ac_site_file"
877   fi
878 done
879
880 if test -r "$cache_file"; then
881   # Some versions of bash will fail to source /dev/null (special
882   # files actually), so we avoid doing that.
883   if test -f "$cache_file"; then
884     { echo "$as_me:884: loading cache $cache_file" >&5
885 echo "$as_me: loading cache $cache_file" >&6;}
886     case $cache_file in
887       [\\/]* | ?:[\\/]* ) . $cache_file;;
888       *)                      . ./$cache_file;;
889     esac
890   fi
891 else
892   { echo "$as_me:892: creating cache $cache_file" >&5
893 echo "$as_me: creating cache $cache_file" >&6;}
894   >$cache_file
895 fi
896
897 # Check that the precious variables saved in the cache have kept the same
898 # value.
899 ac_cache_corrupted=false
900 for ac_var in `(set) 2>&1 |
901                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
902   eval ac_old_set=\$ac_cv_env_${ac_var}_set
903   eval ac_new_set=\$ac_env_${ac_var}_set
904   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
905   eval ac_new_val="\$ac_env_${ac_var}_value"
906   case $ac_old_set,$ac_new_set in
907     set,)
908       { echo "$as_me:908: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
909 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
910       ac_cache_corrupted=: ;;
911     ,set)
912       { echo "$as_me:912: error: \`$ac_var' was not set in the previous run" >&5
913 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
914       ac_cache_corrupted=: ;;
915     ,);;
916     *)
917       if test "x$ac_old_val" != "x$ac_new_val"; then
918         { echo "$as_me:918: error: \`$ac_var' has changed since the previous run:" >&5
919 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
920         { echo "$as_me:920:   former value:  $ac_old_val" >&5
921 echo "$as_me:   former value:  $ac_old_val" >&2;}
922         { echo "$as_me:922:   current value: $ac_new_val" >&5
923 echo "$as_me:   current value: $ac_new_val" >&2;}
924         ac_cache_corrupted=:
925       fi;;
926   esac
927   # Pass precious variables to config.status.  It doesn't matter if
928   # we pass some twice (in addition to the command line arguments).
929   if test "$ac_new_set" = set; then
930     case $ac_new_val in
931     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
932       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
933       ac_configure_args="$ac_configure_args '$ac_arg'"
934       ;;
935     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
936        ;;
937     esac
938   fi
939 done
940 if $ac_cache_corrupted; then
941   { echo "$as_me:941: error: changes in the environment can compromise the build" >&5
942 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
943   { { echo "$as_me:943: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
944 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
945    { (exit 1); exit 1; }; }
946 fi
947
948 ac_ext=c
949 ac_cpp='$CPP $CPPFLAGS'
950 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
951 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
952 ac_compiler_gnu=$ac_cv_c_compiler_gnu
953 ac_main_return=return
954
955 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
956   *c*,-n*) ECHO_N= ECHO_C='
957 ' ECHO_T='      ' ;;
958   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
959   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
960 esac
961 echo "#! $SHELL" >conftest.sh
962 echo  "exit 0"   >>conftest.sh
963 chmod +x conftest.sh
964 if { (echo "$as_me:964: PATH=\".;.\"; conftest.sh") >&5
965   (PATH=".;."; conftest.sh) 2>&5
966   ac_status=$?
967   echo "$as_me:967: \$? = $ac_status" >&5
968   (exit $ac_status); }; then
969   ac_path_separator=';'
970 else
971   ac_path_separator=:
972 fi
973 PATH_SEPARATOR="$ac_path_separator"
974 rm -f conftest.sh
975
976 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
977
978 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
979
980 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
981
982 ac_aux_dir=
983 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
984   if test -f $ac_dir/install-sh; then
985     ac_aux_dir=$ac_dir
986     ac_install_sh="$ac_aux_dir/install-sh -c"
987     break
988   elif test -f $ac_dir/install.sh; then
989     ac_aux_dir=$ac_dir
990     ac_install_sh="$ac_aux_dir/install.sh -c"
991     break
992   elif test -f $ac_dir/shtool; then
993     ac_aux_dir=$ac_dir
994     ac_install_sh="$ac_aux_dir/shtool install -c"
995     break
996   fi
997 done
998 if test -z "$ac_aux_dir"; then
999   { { echo "$as_me:999: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1000 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1001    { (exit 1); exit 1; }; }
1002 fi
1003 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1004 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1005 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1006
1007 # Make sure we can run config.sub.
1008 $ac_config_sub sun4 >/dev/null 2>&1 ||
1009   { { echo "$as_me:1009: error: cannot run $ac_config_sub" >&5
1010 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1011    { (exit 1); exit 1; }; }
1012
1013 echo "$as_me:1013: checking build system type" >&5
1014 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1015 if test "${ac_cv_build+set}" = set; then
1016   echo $ECHO_N "(cached) $ECHO_C" >&6
1017 else
1018   ac_cv_build_alias=$build_alias
1019 test -z "$ac_cv_build_alias" &&
1020   ac_cv_build_alias=`$ac_config_guess`
1021 test -z "$ac_cv_build_alias" &&
1022   { { echo "$as_me:1022: error: cannot guess build type; you must specify one" >&5
1023 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1024    { (exit 1); exit 1; }; }
1025 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1026   { { echo "$as_me:1026: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1027 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1028    { (exit 1); exit 1; }; }
1029
1030 fi
1031 echo "$as_me:1031: result: $ac_cv_build" >&5
1032 echo "${ECHO_T}$ac_cv_build" >&6
1033 build=$ac_cv_build
1034 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1035 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1036 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1037
1038 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1039         echo "$as_me:1039: checking host system type" >&5
1040 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1041 if test "${ac_cv_host+set}" = set; then
1042   echo $ECHO_N "(cached) $ECHO_C" >&6
1043 else
1044   ac_cv_host_alias=$host_alias
1045 test -z "$ac_cv_host_alias" &&
1046   ac_cv_host_alias=$ac_cv_build_alias
1047 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1048   { { echo "$as_me:1048: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1049 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1050    { (exit 1); exit 1; }; }
1051
1052 fi
1053 echo "$as_me:1053: result: $ac_cv_host" >&5
1054 echo "${ECHO_T}$ac_cv_host" >&6
1055 host=$ac_cv_host
1056 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1057 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1058 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1059
1060         system_name="$host_os"
1061 else
1062         system_name="`(uname -s -r) 2>/dev/null`"
1063         if test -z "$system_name" ; then
1064                 system_name="`(hostname) 2>/dev/null`"
1065         fi
1066 fi
1067 test -n "$system_name" &&
1068 cat >>confdefs.h <<EOF
1069 #define SYSTEM_NAME "$system_name"
1070 EOF
1071
1072 if test "${cf_cv_system_name+set}" = set; then
1073   echo $ECHO_N "(cached) $ECHO_C" >&6
1074 else
1075   cf_cv_system_name="$system_name"
1076 fi
1077
1078 test -z "$system_name" && system_name="$cf_cv_system_name"
1079 test -n "$cf_cv_system_name" && echo "$as_me:1079: result: Configuring for $cf_cv_system_name" >&5
1080 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1081
1082 if test ".$system_name" != ".$cf_cv_system_name" ; then
1083         echo "$as_me:1083: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1084 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1085         { { echo "$as_me:1085: error: \"Please remove config.cache and try again.\"" >&5
1086 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1087    { (exit 1); exit 1; }; }
1088 fi
1089
1090 test "$program_prefix" != NONE &&
1091   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1092 # Use a double $ so make ignores it.
1093 test "$program_suffix" != NONE &&
1094   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1095 # Double any \ or $.  echo might interpret backslashes.
1096 # By default was `s,x,x', remove it if useless.
1097 cat <<\_ACEOF >conftest.sed
1098 s/[\\$]/&&/g;s/;s,x,x,$//
1099 _ACEOF
1100 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1101 rm conftest.sed
1102
1103 echo "$as_me:1103: checking whether ${MAKE-make} sets \${MAKE}" >&5
1104 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1105 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1106 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1107   echo $ECHO_N "(cached) $ECHO_C" >&6
1108 else
1109   cat >conftest.make <<\EOF
1110 all:
1111         @echo 'ac_maketemp="${MAKE}"'
1112 EOF
1113 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1114 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1115 if test -n "$ac_maketemp"; then
1116   eval ac_cv_prog_make_${ac_make}_set=yes
1117 else
1118   eval ac_cv_prog_make_${ac_make}_set=no
1119 fi
1120 rm -f conftest.make
1121 fi
1122 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1123   echo "$as_me:1123: result: yes" >&5
1124 echo "${ECHO_T}yes" >&6
1125   SET_MAKE=
1126 else
1127   echo "$as_me:1127: result: no" >&5
1128 echo "${ECHO_T}no" >&6
1129   SET_MAKE="MAKE=${MAKE-make}"
1130 fi
1131
1132 ac_ext=c
1133 ac_cpp='$CPP $CPPFLAGS'
1134 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1135 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1136 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1137 ac_main_return=return
1138 if test -n "$ac_tool_prefix"; then
1139   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1140 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1141 echo "$as_me:1141: checking for $ac_word" >&5
1142 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1143 if test "${ac_cv_prog_CC+set}" = set; then
1144   echo $ECHO_N "(cached) $ECHO_C" >&6
1145 else
1146   if test -n "$CC"; then
1147   ac_cv_prog_CC="$CC" # Let the user override the test.
1148 else
1149   ac_save_IFS=$IFS; IFS=$ac_path_separator
1150 ac_dummy="$PATH"
1151 for ac_dir in $ac_dummy; do
1152   IFS=$ac_save_IFS
1153   test -z "$ac_dir" && ac_dir=.
1154   $as_executable_p "$ac_dir/$ac_word" || continue
1155 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1156 echo "$as_me:1156: found $ac_dir/$ac_word" >&5
1157 break
1158 done
1159
1160 fi
1161 fi
1162 CC=$ac_cv_prog_CC
1163 if test -n "$CC"; then
1164   echo "$as_me:1164: result: $CC" >&5
1165 echo "${ECHO_T}$CC" >&6
1166 else
1167   echo "$as_me:1167: result: no" >&5
1168 echo "${ECHO_T}no" >&6
1169 fi
1170
1171 fi
1172 if test -z "$ac_cv_prog_CC"; then
1173   ac_ct_CC=$CC
1174   # Extract the first word of "gcc", so it can be a program name with args.
1175 set dummy gcc; ac_word=$2
1176 echo "$as_me:1176: checking for $ac_word" >&5
1177 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1178 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1179   echo $ECHO_N "(cached) $ECHO_C" >&6
1180 else
1181   if test -n "$ac_ct_CC"; then
1182   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1183 else
1184   ac_save_IFS=$IFS; IFS=$ac_path_separator
1185 ac_dummy="$PATH"
1186 for ac_dir in $ac_dummy; do
1187   IFS=$ac_save_IFS
1188   test -z "$ac_dir" && ac_dir=.
1189   $as_executable_p "$ac_dir/$ac_word" || continue
1190 ac_cv_prog_ac_ct_CC="gcc"
1191 echo "$as_me:1191: found $ac_dir/$ac_word" >&5
1192 break
1193 done
1194
1195 fi
1196 fi
1197 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1198 if test -n "$ac_ct_CC"; then
1199   echo "$as_me:1199: result: $ac_ct_CC" >&5
1200 echo "${ECHO_T}$ac_ct_CC" >&6
1201 else
1202   echo "$as_me:1202: result: no" >&5
1203 echo "${ECHO_T}no" >&6
1204 fi
1205
1206   CC=$ac_ct_CC
1207 else
1208   CC="$ac_cv_prog_CC"
1209 fi
1210
1211 if test -z "$CC"; then
1212   if test -n "$ac_tool_prefix"; then
1213   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1214 set dummy ${ac_tool_prefix}cc; ac_word=$2
1215 echo "$as_me:1215: checking for $ac_word" >&5
1216 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1217 if test "${ac_cv_prog_CC+set}" = set; then
1218   echo $ECHO_N "(cached) $ECHO_C" >&6
1219 else
1220   if test -n "$CC"; then
1221   ac_cv_prog_CC="$CC" # Let the user override the test.
1222 else
1223   ac_save_IFS=$IFS; IFS=$ac_path_separator
1224 ac_dummy="$PATH"
1225 for ac_dir in $ac_dummy; do
1226   IFS=$ac_save_IFS
1227   test -z "$ac_dir" && ac_dir=.
1228   $as_executable_p "$ac_dir/$ac_word" || continue
1229 ac_cv_prog_CC="${ac_tool_prefix}cc"
1230 echo "$as_me:1230: found $ac_dir/$ac_word" >&5
1231 break
1232 done
1233
1234 fi
1235 fi
1236 CC=$ac_cv_prog_CC
1237 if test -n "$CC"; then
1238   echo "$as_me:1238: result: $CC" >&5
1239 echo "${ECHO_T}$CC" >&6
1240 else
1241   echo "$as_me:1241: result: no" >&5
1242 echo "${ECHO_T}no" >&6
1243 fi
1244
1245 fi
1246 if test -z "$ac_cv_prog_CC"; then
1247   ac_ct_CC=$CC
1248   # Extract the first word of "cc", so it can be a program name with args.
1249 set dummy cc; ac_word=$2
1250 echo "$as_me:1250: checking for $ac_word" >&5
1251 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1252 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1253   echo $ECHO_N "(cached) $ECHO_C" >&6
1254 else
1255   if test -n "$ac_ct_CC"; then
1256   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1257 else
1258   ac_save_IFS=$IFS; IFS=$ac_path_separator
1259 ac_dummy="$PATH"
1260 for ac_dir in $ac_dummy; do
1261   IFS=$ac_save_IFS
1262   test -z "$ac_dir" && ac_dir=.
1263   $as_executable_p "$ac_dir/$ac_word" || continue
1264 ac_cv_prog_ac_ct_CC="cc"
1265 echo "$as_me:1265: found $ac_dir/$ac_word" >&5
1266 break
1267 done
1268
1269 fi
1270 fi
1271 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1272 if test -n "$ac_ct_CC"; then
1273   echo "$as_me:1273: result: $ac_ct_CC" >&5
1274 echo "${ECHO_T}$ac_ct_CC" >&6
1275 else
1276   echo "$as_me:1276: result: no" >&5
1277 echo "${ECHO_T}no" >&6
1278 fi
1279
1280   CC=$ac_ct_CC
1281 else
1282   CC="$ac_cv_prog_CC"
1283 fi
1284
1285 fi
1286 if test -z "$CC"; then
1287   # Extract the first word of "cc", so it can be a program name with args.
1288 set dummy cc; ac_word=$2
1289 echo "$as_me:1289: checking for $ac_word" >&5
1290 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1291 if test "${ac_cv_prog_CC+set}" = set; then
1292   echo $ECHO_N "(cached) $ECHO_C" >&6
1293 else
1294   if test -n "$CC"; then
1295   ac_cv_prog_CC="$CC" # Let the user override the test.
1296 else
1297   ac_prog_rejected=no
1298   ac_save_IFS=$IFS; IFS=$ac_path_separator
1299 ac_dummy="$PATH"
1300 for ac_dir in $ac_dummy; do
1301   IFS=$ac_save_IFS
1302   test -z "$ac_dir" && ac_dir=.
1303   $as_executable_p "$ac_dir/$ac_word" || continue
1304 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1305   ac_prog_rejected=yes
1306   continue
1307 fi
1308 ac_cv_prog_CC="cc"
1309 echo "$as_me:1309: found $ac_dir/$ac_word" >&5
1310 break
1311 done
1312
1313 if test $ac_prog_rejected = yes; then
1314   # We found a bogon in the path, so make sure we never use it.
1315   set dummy $ac_cv_prog_CC
1316   shift
1317   if test $# != 0; then
1318     # We chose a different compiler from the bogus one.
1319     # However, it has the same basename, so the bogon will be chosen
1320     # first if we set CC to just the basename; use the full file name.
1321     shift
1322     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1323     shift
1324     ac_cv_prog_CC="$@"
1325   fi
1326 fi
1327 fi
1328 fi
1329 CC=$ac_cv_prog_CC
1330 if test -n "$CC"; then
1331   echo "$as_me:1331: result: $CC" >&5
1332 echo "${ECHO_T}$CC" >&6
1333 else
1334   echo "$as_me:1334: result: no" >&5
1335 echo "${ECHO_T}no" >&6
1336 fi
1337
1338 fi
1339 if test -z "$CC"; then
1340   if test -n "$ac_tool_prefix"; then
1341   for ac_prog in cl
1342   do
1343     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1344 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1345 echo "$as_me:1345: checking for $ac_word" >&5
1346 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1347 if test "${ac_cv_prog_CC+set}" = set; then
1348   echo $ECHO_N "(cached) $ECHO_C" >&6
1349 else
1350   if test -n "$CC"; then
1351   ac_cv_prog_CC="$CC" # Let the user override the test.
1352 else
1353   ac_save_IFS=$IFS; IFS=$ac_path_separator
1354 ac_dummy="$PATH"
1355 for ac_dir in $ac_dummy; do
1356   IFS=$ac_save_IFS
1357   test -z "$ac_dir" && ac_dir=.
1358   $as_executable_p "$ac_dir/$ac_word" || continue
1359 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1360 echo "$as_me:1360: found $ac_dir/$ac_word" >&5
1361 break
1362 done
1363
1364 fi
1365 fi
1366 CC=$ac_cv_prog_CC
1367 if test -n "$CC"; then
1368   echo "$as_me:1368: result: $CC" >&5
1369 echo "${ECHO_T}$CC" >&6
1370 else
1371   echo "$as_me:1371: result: no" >&5
1372 echo "${ECHO_T}no" >&6
1373 fi
1374
1375     test -n "$CC" && break
1376   done
1377 fi
1378 if test -z "$CC"; then
1379   ac_ct_CC=$CC
1380   for ac_prog in cl
1381 do
1382   # Extract the first word of "$ac_prog", so it can be a program name with args.
1383 set dummy $ac_prog; ac_word=$2
1384 echo "$as_me:1384: checking for $ac_word" >&5
1385 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1386 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1387   echo $ECHO_N "(cached) $ECHO_C" >&6
1388 else
1389   if test -n "$ac_ct_CC"; then
1390   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1391 else
1392   ac_save_IFS=$IFS; IFS=$ac_path_separator
1393 ac_dummy="$PATH"
1394 for ac_dir in $ac_dummy; do
1395   IFS=$ac_save_IFS
1396   test -z "$ac_dir" && ac_dir=.
1397   $as_executable_p "$ac_dir/$ac_word" || continue
1398 ac_cv_prog_ac_ct_CC="$ac_prog"
1399 echo "$as_me:1399: found $ac_dir/$ac_word" >&5
1400 break
1401 done
1402
1403 fi
1404 fi
1405 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1406 if test -n "$ac_ct_CC"; then
1407   echo "$as_me:1407: result: $ac_ct_CC" >&5
1408 echo "${ECHO_T}$ac_ct_CC" >&6
1409 else
1410   echo "$as_me:1410: result: no" >&5
1411 echo "${ECHO_T}no" >&6
1412 fi
1413
1414   test -n "$ac_ct_CC" && break
1415 done
1416
1417   CC=$ac_ct_CC
1418 fi
1419
1420 fi
1421
1422 test -z "$CC" && { { echo "$as_me:1422: error: no acceptable cc found in \$PATH" >&5
1423 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1424    { (exit 1); exit 1; }; }
1425
1426 # Provide some information about the compiler.
1427 echo "$as_me:1427:" \
1428      "checking for C compiler version" >&5
1429 ac_compiler=`set X $ac_compile; echo $2`
1430 { (eval echo "$as_me:1430: \"$ac_compiler --version </dev/null >&5\"") >&5
1431   (eval $ac_compiler --version </dev/null >&5) 2>&5
1432   ac_status=$?
1433   echo "$as_me:1433: \$? = $ac_status" >&5
1434   (exit $ac_status); }
1435 { (eval echo "$as_me:1435: \"$ac_compiler -v </dev/null >&5\"") >&5
1436   (eval $ac_compiler -v </dev/null >&5) 2>&5
1437   ac_status=$?
1438   echo "$as_me:1438: \$? = $ac_status" >&5
1439   (exit $ac_status); }
1440 { (eval echo "$as_me:1440: \"$ac_compiler -V </dev/null >&5\"") >&5
1441   (eval $ac_compiler -V </dev/null >&5) 2>&5
1442   ac_status=$?
1443   echo "$as_me:1443: \$? = $ac_status" >&5
1444   (exit $ac_status); }
1445
1446 cat >conftest.$ac_ext <<_ACEOF
1447 #line 1447 "configure"
1448 #include "confdefs.h"
1449
1450 int
1451 main ()
1452 {
1453
1454   ;
1455   return 0;
1456 }
1457 _ACEOF
1458 ac_clean_files_save=$ac_clean_files
1459 ac_clean_files="$ac_clean_files a.out a.exe"
1460 # Try to create an executable without -o first, disregard a.out.
1461 # It will help us diagnose broken compilers, and finding out an intuition
1462 # of exeext.
1463 echo "$as_me:1463: checking for C compiler default output" >&5
1464 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1465 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1466 if { (eval echo "$as_me:1466: \"$ac_link_default\"") >&5
1467   (eval $ac_link_default) 2>&5
1468   ac_status=$?
1469   echo "$as_me:1469: \$? = $ac_status" >&5
1470   (exit $ac_status); }; then
1471   # Find the output, starting from the most likely.  This scheme is
1472 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1473 # resort.
1474 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1475                 ls a.out conftest 2>/dev/null;
1476                 ls a.* conftest.* 2>/dev/null`; do
1477   case $ac_file in
1478     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1479     a.out ) # We found the default executable, but exeext='' is most
1480             # certainly right.
1481             break;;
1482     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1483           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1484           export ac_cv_exeext
1485           break;;
1486     * ) break;;
1487   esac
1488 done
1489 else
1490   echo "$as_me: failed program was:" >&5
1491 cat conftest.$ac_ext >&5
1492 { { echo "$as_me:1492: error: C compiler cannot create executables" >&5
1493 echo "$as_me: error: C compiler cannot create executables" >&2;}
1494    { (exit 77); exit 77; }; }
1495 fi
1496
1497 ac_exeext=$ac_cv_exeext
1498 echo "$as_me:1498: result: $ac_file" >&5
1499 echo "${ECHO_T}$ac_file" >&6
1500
1501 # Check the compiler produces executables we can run.  If not, either
1502 # the compiler is broken, or we cross compile.
1503 echo "$as_me:1503: checking whether the C compiler works" >&5
1504 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1505 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1506 # If not cross compiling, check that we can run a simple program.
1507 if test "$cross_compiling" != yes; then
1508   if { ac_try='./$ac_file'
1509   { (eval echo "$as_me:1509: \"$ac_try\"") >&5
1510   (eval $ac_try) 2>&5
1511   ac_status=$?
1512   echo "$as_me:1512: \$? = $ac_status" >&5
1513   (exit $ac_status); }; }; then
1514     cross_compiling=no
1515   else
1516     if test "$cross_compiling" = maybe; then
1517         cross_compiling=yes
1518     else
1519         { { echo "$as_me:1519: error: cannot run C compiled programs.
1520 If you meant to cross compile, use \`--host'." >&5
1521 echo "$as_me: error: cannot run C compiled programs.
1522 If you meant to cross compile, use \`--host'." >&2;}
1523    { (exit 1); exit 1; }; }
1524     fi
1525   fi
1526 fi
1527 echo "$as_me:1527: result: yes" >&5
1528 echo "${ECHO_T}yes" >&6
1529
1530 rm -f a.out a.exe conftest$ac_cv_exeext
1531 ac_clean_files=$ac_clean_files_save
1532 # Check the compiler produces executables we can run.  If not, either
1533 # the compiler is broken, or we cross compile.
1534 echo "$as_me:1534: checking whether we are cross compiling" >&5
1535 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1536 echo "$as_me:1536: result: $cross_compiling" >&5
1537 echo "${ECHO_T}$cross_compiling" >&6
1538
1539 echo "$as_me:1539: checking for executable suffix" >&5
1540 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1541 if { (eval echo "$as_me:1541: \"$ac_link\"") >&5
1542   (eval $ac_link) 2>&5
1543   ac_status=$?
1544   echo "$as_me:1544: \$? = $ac_status" >&5
1545   (exit $ac_status); }; then
1546   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1547 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1548 # work properly (i.e., refer to `conftest.exe'), while it won't with
1549 # `rm'.
1550 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1551   case $ac_file in
1552     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1553     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1554           export ac_cv_exeext
1555           break;;
1556     * ) break;;
1557   esac
1558 done
1559 else
1560   { { echo "$as_me:1560: error: cannot compute EXEEXT: cannot compile and link" >&5
1561 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1562    { (exit 1); exit 1; }; }
1563 fi
1564
1565 rm -f conftest$ac_cv_exeext
1566 echo "$as_me:1566: result: $ac_cv_exeext" >&5
1567 echo "${ECHO_T}$ac_cv_exeext" >&6
1568
1569 rm -f conftest.$ac_ext
1570 EXEEXT=$ac_cv_exeext
1571 ac_exeext=$EXEEXT
1572 echo "$as_me:1572: checking for object suffix" >&5
1573 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1574 if test "${ac_cv_objext+set}" = set; then
1575   echo $ECHO_N "(cached) $ECHO_C" >&6
1576 else
1577   cat >conftest.$ac_ext <<_ACEOF
1578 #line 1578 "configure"
1579 #include "confdefs.h"
1580
1581 int
1582 main ()
1583 {
1584
1585   ;
1586   return 0;
1587 }
1588 _ACEOF
1589 rm -f conftest.o conftest.obj
1590 if { (eval echo "$as_me:1590: \"$ac_compile\"") >&5
1591   (eval $ac_compile) 2>&5
1592   ac_status=$?
1593   echo "$as_me:1593: \$? = $ac_status" >&5
1594   (exit $ac_status); }; then
1595   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1596   case $ac_file in
1597     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1598     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1599        break;;
1600   esac
1601 done
1602 else
1603   echo "$as_me: failed program was:" >&5
1604 cat conftest.$ac_ext >&5
1605 { { echo "$as_me:1605: error: cannot compute OBJEXT: cannot compile" >&5
1606 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1607    { (exit 1); exit 1; }; }
1608 fi
1609
1610 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1611 fi
1612 echo "$as_me:1612: result: $ac_cv_objext" >&5
1613 echo "${ECHO_T}$ac_cv_objext" >&6
1614 OBJEXT=$ac_cv_objext
1615 ac_objext=$OBJEXT
1616 echo "$as_me:1616: checking whether we are using the GNU C compiler" >&5
1617 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1618 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1619   echo $ECHO_N "(cached) $ECHO_C" >&6
1620 else
1621   cat >conftest.$ac_ext <<_ACEOF
1622 #line 1622 "configure"
1623 #include "confdefs.h"
1624
1625 int
1626 main ()
1627 {
1628 #ifndef __GNUC__
1629        choke me
1630 #endif
1631
1632   ;
1633   return 0;
1634 }
1635 _ACEOF
1636 rm -f conftest.$ac_objext
1637 if { (eval echo "$as_me:1637: \"$ac_compile\"") >&5
1638   (eval $ac_compile) 2>&5
1639   ac_status=$?
1640   echo "$as_me:1640: \$? = $ac_status" >&5
1641   (exit $ac_status); } &&
1642          { ac_try='test -s conftest.$ac_objext'
1643   { (eval echo "$as_me:1643: \"$ac_try\"") >&5
1644   (eval $ac_try) 2>&5
1645   ac_status=$?
1646   echo "$as_me:1646: \$? = $ac_status" >&5
1647   (exit $ac_status); }; }; then
1648   ac_compiler_gnu=yes
1649 else
1650   echo "$as_me: failed program was:" >&5
1651 cat conftest.$ac_ext >&5
1652 ac_compiler_gnu=no
1653 fi
1654 rm -f conftest.$ac_objext conftest.$ac_ext
1655 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1656
1657 fi
1658 echo "$as_me:1658: result: $ac_cv_c_compiler_gnu" >&5
1659 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1660 GCC=`test $ac_compiler_gnu = yes && echo yes`
1661 ac_test_CFLAGS=${CFLAGS+set}
1662 ac_save_CFLAGS=$CFLAGS
1663 CFLAGS="-g"
1664 echo "$as_me:1664: checking whether $CC accepts -g" >&5
1665 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1666 if test "${ac_cv_prog_cc_g+set}" = set; then
1667   echo $ECHO_N "(cached) $ECHO_C" >&6
1668 else
1669   cat >conftest.$ac_ext <<_ACEOF
1670 #line 1670 "configure"
1671 #include "confdefs.h"
1672
1673 int
1674 main ()
1675 {
1676
1677   ;
1678   return 0;
1679 }
1680 _ACEOF
1681 rm -f conftest.$ac_objext
1682 if { (eval echo "$as_me:1682: \"$ac_compile\"") >&5
1683   (eval $ac_compile) 2>&5
1684   ac_status=$?
1685   echo "$as_me:1685: \$? = $ac_status" >&5
1686   (exit $ac_status); } &&
1687          { ac_try='test -s conftest.$ac_objext'
1688   { (eval echo "$as_me:1688: \"$ac_try\"") >&5
1689   (eval $ac_try) 2>&5
1690   ac_status=$?
1691   echo "$as_me:1691: \$? = $ac_status" >&5
1692   (exit $ac_status); }; }; then
1693   ac_cv_prog_cc_g=yes
1694 else
1695   echo "$as_me: failed program was:" >&5
1696 cat conftest.$ac_ext >&5
1697 ac_cv_prog_cc_g=no
1698 fi
1699 rm -f conftest.$ac_objext conftest.$ac_ext
1700 fi
1701 echo "$as_me:1701: result: $ac_cv_prog_cc_g" >&5
1702 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1703 if test "$ac_test_CFLAGS" = set; then
1704   CFLAGS=$ac_save_CFLAGS
1705 elif test $ac_cv_prog_cc_g = yes; then
1706   if test "$GCC" = yes; then
1707     CFLAGS="-g -O2"
1708   else
1709     CFLAGS="-g"
1710   fi
1711 else
1712   if test "$GCC" = yes; then
1713     CFLAGS="-O2"
1714   else
1715     CFLAGS=
1716   fi
1717 fi
1718 # Some people use a C++ compiler to compile C.  Since we use `exit',
1719 # in C++ we need to declare it.  In case someone uses the same compiler
1720 # for both compiling C and C++ we need to have the C++ compiler decide
1721 # the declaration of exit, since it's the most demanding environment.
1722 cat >conftest.$ac_ext <<_ACEOF
1723 #ifndef __cplusplus
1724   choke me
1725 #endif
1726 _ACEOF
1727 rm -f conftest.$ac_objext
1728 if { (eval echo "$as_me:1728: \"$ac_compile\"") >&5
1729   (eval $ac_compile) 2>&5
1730   ac_status=$?
1731   echo "$as_me:1731: \$? = $ac_status" >&5
1732   (exit $ac_status); } &&
1733          { ac_try='test -s conftest.$ac_objext'
1734   { (eval echo "$as_me:1734: \"$ac_try\"") >&5
1735   (eval $ac_try) 2>&5
1736   ac_status=$?
1737   echo "$as_me:1737: \$? = $ac_status" >&5
1738   (exit $ac_status); }; }; then
1739   for ac_declaration in \
1740    ''\
1741    '#include <stdlib.h>' \
1742    'extern "C" void std::exit (int) throw (); using std::exit;' \
1743    'extern "C" void std::exit (int); using std::exit;' \
1744    'extern "C" void exit (int) throw ();' \
1745    'extern "C" void exit (int);' \
1746    'void exit (int);'
1747 do
1748   cat >conftest.$ac_ext <<_ACEOF
1749 #line 1749 "configure"
1750 #include "confdefs.h"
1751 #include <stdlib.h>
1752 $ac_declaration
1753 int
1754 main ()
1755 {
1756 exit (42);
1757   ;
1758   return 0;
1759 }
1760 _ACEOF
1761 rm -f conftest.$ac_objext
1762 if { (eval echo "$as_me:1762: \"$ac_compile\"") >&5
1763   (eval $ac_compile) 2>&5
1764   ac_status=$?
1765   echo "$as_me:1765: \$? = $ac_status" >&5
1766   (exit $ac_status); } &&
1767          { ac_try='test -s conftest.$ac_objext'
1768   { (eval echo "$as_me:1768: \"$ac_try\"") >&5
1769   (eval $ac_try) 2>&5
1770   ac_status=$?
1771   echo "$as_me:1771: \$? = $ac_status" >&5
1772   (exit $ac_status); }; }; then
1773   :
1774 else
1775   echo "$as_me: failed program was:" >&5
1776 cat conftest.$ac_ext >&5
1777 continue
1778 fi
1779 rm -f conftest.$ac_objext conftest.$ac_ext
1780   cat >conftest.$ac_ext <<_ACEOF
1781 #line 1781 "configure"
1782 #include "confdefs.h"
1783 $ac_declaration
1784 int
1785 main ()
1786 {
1787 exit (42);
1788   ;
1789   return 0;
1790 }
1791 _ACEOF
1792 rm -f conftest.$ac_objext
1793 if { (eval echo "$as_me:1793: \"$ac_compile\"") >&5
1794   (eval $ac_compile) 2>&5
1795   ac_status=$?
1796   echo "$as_me:1796: \$? = $ac_status" >&5
1797   (exit $ac_status); } &&
1798          { ac_try='test -s conftest.$ac_objext'
1799   { (eval echo "$as_me:1799: \"$ac_try\"") >&5
1800   (eval $ac_try) 2>&5
1801   ac_status=$?
1802   echo "$as_me:1802: \$? = $ac_status" >&5
1803   (exit $ac_status); }; }; then
1804   break
1805 else
1806   echo "$as_me: failed program was:" >&5
1807 cat conftest.$ac_ext >&5
1808 fi
1809 rm -f conftest.$ac_objext conftest.$ac_ext
1810 done
1811 rm -rf conftest*
1812 if test -n "$ac_declaration"; then
1813   echo '#ifdef __cplusplus' >>confdefs.h
1814   echo $ac_declaration      >>confdefs.h
1815   echo '#endif'             >>confdefs.h
1816 fi
1817
1818 else
1819   echo "$as_me: failed program was:" >&5
1820 cat conftest.$ac_ext >&5
1821 fi
1822 rm -f conftest.$ac_objext conftest.$ac_ext
1823 ac_ext=c
1824 ac_cpp='$CPP $CPPFLAGS'
1825 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1826 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1827 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1828 ac_main_return=return
1829
1830 GCC_VERSION=none
1831 if test "$GCC" = yes ; then
1832         echo "$as_me:1832: checking version of $CC" >&5
1833 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1834         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1835         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1836         echo "$as_me:1836: result: $GCC_VERSION" >&5
1837 echo "${ECHO_T}$GCC_VERSION" >&6
1838 fi
1839
1840 echo "$as_me:1840: checking for $CC option to accept ANSI C" >&5
1841 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1842 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1843   echo $ECHO_N "(cached) $ECHO_C" >&6
1844 else
1845   ac_cv_prog_cc_stdc=no
1846 ac_save_CC=$CC
1847 cat >conftest.$ac_ext <<_ACEOF
1848 #line 1848 "configure"
1849 #include "confdefs.h"
1850 #include <stdarg.h>
1851 #include <stdio.h>
1852 #include <sys/types.h>
1853 #include <sys/stat.h>
1854 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1855 struct buf { int x; };
1856 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1857 static char *e (p, i)
1858      char **p;
1859      int i;
1860 {
1861   return p[i];
1862 }
1863 static char *f (char * (*g) (char **, int), char **p, ...)
1864 {
1865   char *s;
1866   va_list v;
1867   va_start (v,p);
1868   s = g (p, va_arg (v,int));
1869   va_end (v);
1870   return s;
1871 }
1872 int test (int i, double x);
1873 struct s1 {int (*f) (int a);};
1874 struct s2 {int (*f) (double a);};
1875 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1876 int argc;
1877 char **argv;
1878 int
1879 main ()
1880 {
1881 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1882   ;
1883   return 0;
1884 }
1885 _ACEOF
1886 # Don't try gcc -ansi; that turns off useful extensions and
1887 # breaks some systems' header files.
1888 # AIX                   -qlanglvl=ansi
1889 # Ultrix and OSF/1      -std1
1890 # HP-UX 10.20 and later -Ae
1891 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1892 # SVR4                  -Xc -D__EXTENSIONS__
1893 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1894 do
1895   CC="$ac_save_CC $ac_arg"
1896   rm -f conftest.$ac_objext
1897 if { (eval echo "$as_me:1897: \"$ac_compile\"") >&5
1898   (eval $ac_compile) 2>&5
1899   ac_status=$?
1900   echo "$as_me:1900: \$? = $ac_status" >&5
1901   (exit $ac_status); } &&
1902          { ac_try='test -s conftest.$ac_objext'
1903   { (eval echo "$as_me:1903: \"$ac_try\"") >&5
1904   (eval $ac_try) 2>&5
1905   ac_status=$?
1906   echo "$as_me:1906: \$? = $ac_status" >&5
1907   (exit $ac_status); }; }; then
1908   ac_cv_prog_cc_stdc=$ac_arg
1909 break
1910 else
1911   echo "$as_me: failed program was:" >&5
1912 cat conftest.$ac_ext >&5
1913 fi
1914 rm -f conftest.$ac_objext
1915 done
1916 rm -f conftest.$ac_ext conftest.$ac_objext
1917 CC=$ac_save_CC
1918
1919 fi
1920
1921 case "x$ac_cv_prog_cc_stdc" in
1922   x|xno)
1923     echo "$as_me:1923: result: none needed" >&5
1924 echo "${ECHO_T}none needed" >&6 ;;
1925   *)
1926     echo "$as_me:1926: result: $ac_cv_prog_cc_stdc" >&5
1927 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1928     CC="$CC $ac_cv_prog_cc_stdc" ;;
1929 esac
1930
1931 # This should have been defined by AC_PROG_CC
1932 : ${CC:=cc}
1933
1934 echo "$as_me:1934: checking \$CC variable" >&5
1935 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1936 case "$CC" in #(vi
1937 *[\ \   ]-[IUD]*)
1938         echo "$as_me:1938: result: broken" >&5
1939 echo "${ECHO_T}broken" >&6
1940         { echo "$as_me:1940: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1941 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1942         # humor him...
1943         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
1944         CC=`echo "$CC" | sed -e 's/[    ].*//'`
1945
1946 cf_fix_cppflags=no
1947 cf_new_cflags=
1948 cf_new_cppflags=
1949 cf_new_extra_cppflags=
1950
1951 for cf_add_cflags in $cf_flags
1952 do
1953 case $cf_fix_cppflags in
1954 no)
1955         case $cf_add_cflags in #(vi
1956         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1957                 case $cf_add_cflags in
1958                 -D*)
1959                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1960
1961                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1962                                 && test -z "${cf_tst_cflags}" \
1963                                 && cf_fix_cppflags=yes
1964
1965                         if test $cf_fix_cppflags = yes ; then
1966                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1967                                 continue
1968                         elif test "${cf_tst_cflags}" = "\"'" ; then
1969                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1970                                 continue
1971                         fi
1972                         ;;
1973                 esac
1974                 case "$CPPFLAGS" in
1975                 *$cf_add_cflags) #(vi
1976                         ;;
1977                 *) #(vi
1978                         case $cf_add_cflags in #(vi
1979                         -D*)
1980                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1981
1982 CPPFLAGS=`echo "$CPPFLAGS" | \
1983         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1984                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1985
1986                                 ;;
1987                         esac
1988                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1989                         ;;
1990                 esac
1991                 ;;
1992         *)
1993                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1994                 ;;
1995         esac
1996         ;;
1997 yes)
1998         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1999
2000         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2001
2002         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2003                 && test -z "${cf_tst_cflags}" \
2004                 && cf_fix_cppflags=no
2005         ;;
2006 esac
2007 done
2008
2009 if test -n "$cf_new_cflags" ; then
2010
2011         CFLAGS="$CFLAGS $cf_new_cflags"
2012 fi
2013
2014 if test -n "$cf_new_cppflags" ; then
2015
2016         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2017 fi
2018
2019 if test -n "$cf_new_extra_cppflags" ; then
2020
2021         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2022 fi
2023
2024         ;;
2025 *)
2026         echo "$as_me:2026: result: ok" >&5
2027 echo "${ECHO_T}ok" >&6
2028         ;;
2029 esac
2030
2031 ac_ext=c
2032 ac_cpp='$CPP $CPPFLAGS'
2033 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2034 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2035 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2036 ac_main_return=return
2037 echo "$as_me:2037: checking how to run the C preprocessor" >&5
2038 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2039 # On Suns, sometimes $CPP names a directory.
2040 if test -n "$CPP" && test -d "$CPP"; then
2041   CPP=
2042 fi
2043 if test -z "$CPP"; then
2044   if test "${ac_cv_prog_CPP+set}" = set; then
2045   echo $ECHO_N "(cached) $ECHO_C" >&6
2046 else
2047       # Double quotes because CPP needs to be expanded
2048     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2049     do
2050       ac_preproc_ok=false
2051 for ac_c_preproc_warn_flag in '' yes
2052 do
2053   # Use a header file that comes with gcc, so configuring glibc
2054   # with a fresh cross-compiler works.
2055   # On the NeXT, cc -E runs the code through the compiler's parser,
2056   # not just through cpp. "Syntax error" is here to catch this case.
2057   cat >conftest.$ac_ext <<_ACEOF
2058 #line 2058 "configure"
2059 #include "confdefs.h"
2060 #include <assert.h>
2061                      Syntax error
2062 _ACEOF
2063 if { (eval echo "$as_me:2063: \"$ac_cpp conftest.$ac_ext\"") >&5
2064   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2065   ac_status=$?
2066   egrep -v '^ *\+' conftest.er1 >conftest.err
2067   rm -f conftest.er1
2068   cat conftest.err >&5
2069   echo "$as_me:2069: \$? = $ac_status" >&5
2070   (exit $ac_status); } >/dev/null; then
2071   if test -s conftest.err; then
2072     ac_cpp_err=$ac_c_preproc_warn_flag
2073   else
2074     ac_cpp_err=
2075   fi
2076 else
2077   ac_cpp_err=yes
2078 fi
2079 if test -z "$ac_cpp_err"; then
2080   :
2081 else
2082   echo "$as_me: failed program was:" >&5
2083   cat conftest.$ac_ext >&5
2084   # Broken: fails on valid input.
2085 continue
2086 fi
2087 rm -f conftest.err conftest.$ac_ext
2088
2089   # OK, works on sane cases.  Now check whether non-existent headers
2090   # can be detected and how.
2091   cat >conftest.$ac_ext <<_ACEOF
2092 #line 2092 "configure"
2093 #include "confdefs.h"
2094 #include <ac_nonexistent.h>
2095 _ACEOF
2096 if { (eval echo "$as_me:2096: \"$ac_cpp conftest.$ac_ext\"") >&5
2097   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2098   ac_status=$?
2099   egrep -v '^ *\+' conftest.er1 >conftest.err
2100   rm -f conftest.er1
2101   cat conftest.err >&5
2102   echo "$as_me:2102: \$? = $ac_status" >&5
2103   (exit $ac_status); } >/dev/null; then
2104   if test -s conftest.err; then
2105     ac_cpp_err=$ac_c_preproc_warn_flag
2106   else
2107     ac_cpp_err=
2108   fi
2109 else
2110   ac_cpp_err=yes
2111 fi
2112 if test -z "$ac_cpp_err"; then
2113   # Broken: success on invalid input.
2114 continue
2115 else
2116   echo "$as_me: failed program was:" >&5
2117   cat conftest.$ac_ext >&5
2118   # Passes both tests.
2119 ac_preproc_ok=:
2120 break
2121 fi
2122 rm -f conftest.err conftest.$ac_ext
2123
2124 done
2125 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2126 rm -f conftest.err conftest.$ac_ext
2127 if $ac_preproc_ok; then
2128   break
2129 fi
2130
2131     done
2132     ac_cv_prog_CPP=$CPP
2133
2134 fi
2135   CPP=$ac_cv_prog_CPP
2136 else
2137   ac_cv_prog_CPP=$CPP
2138 fi
2139 echo "$as_me:2139: result: $CPP" >&5
2140 echo "${ECHO_T}$CPP" >&6
2141 ac_preproc_ok=false
2142 for ac_c_preproc_warn_flag in '' yes
2143 do
2144   # Use a header file that comes with gcc, so configuring glibc
2145   # with a fresh cross-compiler works.
2146   # On the NeXT, cc -E runs the code through the compiler's parser,
2147   # not just through cpp. "Syntax error" is here to catch this case.
2148   cat >conftest.$ac_ext <<_ACEOF
2149 #line 2149 "configure"
2150 #include "confdefs.h"
2151 #include <assert.h>
2152                      Syntax error
2153 _ACEOF
2154 if { (eval echo "$as_me:2154: \"$ac_cpp conftest.$ac_ext\"") >&5
2155   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2156   ac_status=$?
2157   egrep -v '^ *\+' conftest.er1 >conftest.err
2158   rm -f conftest.er1
2159   cat conftest.err >&5
2160   echo "$as_me:2160: \$? = $ac_status" >&5
2161   (exit $ac_status); } >/dev/null; then
2162   if test -s conftest.err; then
2163     ac_cpp_err=$ac_c_preproc_warn_flag
2164   else
2165     ac_cpp_err=
2166   fi
2167 else
2168   ac_cpp_err=yes
2169 fi
2170 if test -z "$ac_cpp_err"; then
2171   :
2172 else
2173   echo "$as_me: failed program was:" >&5
2174   cat conftest.$ac_ext >&5
2175   # Broken: fails on valid input.
2176 continue
2177 fi
2178 rm -f conftest.err conftest.$ac_ext
2179
2180   # OK, works on sane cases.  Now check whether non-existent headers
2181   # can be detected and how.
2182   cat >conftest.$ac_ext <<_ACEOF
2183 #line 2183 "configure"
2184 #include "confdefs.h"
2185 #include <ac_nonexistent.h>
2186 _ACEOF
2187 if { (eval echo "$as_me:2187: \"$ac_cpp conftest.$ac_ext\"") >&5
2188   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2189   ac_status=$?
2190   egrep -v '^ *\+' conftest.er1 >conftest.err
2191   rm -f conftest.er1
2192   cat conftest.err >&5
2193   echo "$as_me:2193: \$? = $ac_status" >&5
2194   (exit $ac_status); } >/dev/null; then
2195   if test -s conftest.err; then
2196     ac_cpp_err=$ac_c_preproc_warn_flag
2197   else
2198     ac_cpp_err=
2199   fi
2200 else
2201   ac_cpp_err=yes
2202 fi
2203 if test -z "$ac_cpp_err"; then
2204   # Broken: success on invalid input.
2205 continue
2206 else
2207   echo "$as_me: failed program was:" >&5
2208   cat conftest.$ac_ext >&5
2209   # Passes both tests.
2210 ac_preproc_ok=:
2211 break
2212 fi
2213 rm -f conftest.err conftest.$ac_ext
2214
2215 done
2216 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2217 rm -f conftest.err conftest.$ac_ext
2218 if $ac_preproc_ok; then
2219   :
2220 else
2221   { { echo "$as_me:2221: error: C preprocessor \"$CPP\" fails sanity check" >&5
2222 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2223    { (exit 1); exit 1; }; }
2224 fi
2225
2226 ac_ext=c
2227 ac_cpp='$CPP $CPPFLAGS'
2228 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2229 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2230 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2231 ac_main_return=return
2232
2233 for ac_prog in mawk gawk nawk awk
2234 do
2235   # Extract the first word of "$ac_prog", so it can be a program name with args.
2236 set dummy $ac_prog; ac_word=$2
2237 echo "$as_me:2237: checking for $ac_word" >&5
2238 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2239 if test "${ac_cv_prog_AWK+set}" = set; then
2240   echo $ECHO_N "(cached) $ECHO_C" >&6
2241 else
2242   if test -n "$AWK"; then
2243   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2244 else
2245   ac_save_IFS=$IFS; IFS=$ac_path_separator
2246 ac_dummy="$PATH"
2247 for ac_dir in $ac_dummy; do
2248   IFS=$ac_save_IFS
2249   test -z "$ac_dir" && ac_dir=.
2250   $as_executable_p "$ac_dir/$ac_word" || continue
2251 ac_cv_prog_AWK="$ac_prog"
2252 echo "$as_me:2252: found $ac_dir/$ac_word" >&5
2253 break
2254 done
2255
2256 fi
2257 fi
2258 AWK=$ac_cv_prog_AWK
2259 if test -n "$AWK"; then
2260   echo "$as_me:2260: result: $AWK" >&5
2261 echo "${ECHO_T}$AWK" >&6
2262 else
2263   echo "$as_me:2263: result: no" >&5
2264 echo "${ECHO_T}no" >&6
2265 fi
2266
2267   test -n "$AWK" && break
2268 done
2269
2270 # Find a good install program.  We prefer a C program (faster),
2271 # so one script is as good as another.  But avoid the broken or
2272 # incompatible versions:
2273 # SysV /etc/install, /usr/sbin/install
2274 # SunOS /usr/etc/install
2275 # IRIX /sbin/install
2276 # AIX /bin/install
2277 # AmigaOS /C/install, which installs bootblocks on floppy discs
2278 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2279 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2280 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2281 # ./install, which can be erroneously created by make from ./install.sh.
2282 echo "$as_me:2282: checking for a BSD compatible install" >&5
2283 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2284 if test -z "$INSTALL"; then
2285 if test "${ac_cv_path_install+set}" = set; then
2286   echo $ECHO_N "(cached) $ECHO_C" >&6
2287 else
2288     ac_save_IFS=$IFS; IFS=$ac_path_separator
2289   for ac_dir in $PATH; do
2290     IFS=$ac_save_IFS
2291     # Account for people who put trailing slashes in PATH elements.
2292     case $ac_dir/ in
2293     / | ./ | .// | /cC/* \
2294     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2295     | /usr/ucb/* ) ;;
2296     *)
2297       # OSF1 and SCO ODT 3.0 have their own names for install.
2298       # Don't use installbsd from OSF since it installs stuff as root
2299       # by default.
2300       for ac_prog in ginstall scoinst install; do
2301         if $as_executable_p "$ac_dir/$ac_prog"; then
2302           if test $ac_prog = install &&
2303             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2304             # AIX install.  It has an incompatible calling convention.
2305             :
2306           elif test $ac_prog = install &&
2307             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2308             # program-specific install script used by HP pwplus--don't use.
2309             :
2310           else
2311             ac_cv_path_install="$ac_dir/$ac_prog -c"
2312             break 2
2313           fi
2314         fi
2315       done
2316       ;;
2317     esac
2318   done
2319
2320 fi
2321   if test "${ac_cv_path_install+set}" = set; then
2322     INSTALL=$ac_cv_path_install
2323   else
2324     # As a last resort, use the slow shell script.  We don't cache a
2325     # path for INSTALL within a source directory, because that will
2326     # break other packages using the cache if that directory is
2327     # removed, or if the path is relative.
2328     INSTALL=$ac_install_sh
2329   fi
2330 fi
2331 echo "$as_me:2331: result: $INSTALL" >&5
2332 echo "${ECHO_T}$INSTALL" >&6
2333
2334 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2335 # It thinks the first close brace ends the variable substitution.
2336 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2337
2338 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2339
2340 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2341
2342 case $INSTALL in
2343 /*)
2344   ;;
2345 *)
2346   cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2347   test -z "$cf_dir" && cf_dir=.
2348   INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2349   ;;
2350 esac
2351
2352 for ac_prog in tdlint lint alint splint lclint
2353 do
2354   # Extract the first word of "$ac_prog", so it can be a program name with args.
2355 set dummy $ac_prog; ac_word=$2
2356 echo "$as_me:2356: checking for $ac_word" >&5
2357 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2358 if test "${ac_cv_prog_LINT+set}" = set; then
2359   echo $ECHO_N "(cached) $ECHO_C" >&6
2360 else
2361   if test -n "$LINT"; then
2362   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2363 else
2364   ac_save_IFS=$IFS; IFS=$ac_path_separator
2365 ac_dummy="$PATH"
2366 for ac_dir in $ac_dummy; do
2367   IFS=$ac_save_IFS
2368   test -z "$ac_dir" && ac_dir=.
2369   $as_executable_p "$ac_dir/$ac_word" || continue
2370 ac_cv_prog_LINT="$ac_prog"
2371 echo "$as_me:2371: found $ac_dir/$ac_word" >&5
2372 break
2373 done
2374
2375 fi
2376 fi
2377 LINT=$ac_cv_prog_LINT
2378 if test -n "$LINT"; then
2379   echo "$as_me:2379: result: $LINT" >&5
2380 echo "${ECHO_T}$LINT" >&6
2381 else
2382   echo "$as_me:2382: result: no" >&5
2383 echo "${ECHO_T}no" >&6
2384 fi
2385
2386   test -n "$LINT" && break
2387 done
2388
2389 echo "$as_me:2389: checking if filesystem supports mixed-case filenames" >&5
2390 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2391 if test "${cf_cv_mixedcase+set}" = set; then
2392   echo $ECHO_N "(cached) $ECHO_C" >&6
2393 else
2394
2395 if test "$cross_compiling" = yes ; then
2396         case $target_alias in #(vi
2397         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) #(vi
2398                 cf_cv_mixedcase=no
2399                 ;;
2400         *)
2401                 cf_cv_mixedcase=yes
2402                 ;;
2403         esac
2404 else
2405         rm -f conftest CONFTEST
2406         echo test >conftest
2407         if test -f CONFTEST ; then
2408                 cf_cv_mixedcase=no
2409         else
2410                 cf_cv_mixedcase=yes
2411         fi
2412         rm -f conftest CONFTEST
2413 fi
2414
2415 fi
2416 echo "$as_me:2416: result: $cf_cv_mixedcase" >&5
2417 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2418 test "$cf_cv_mixedcase" = yes &&
2419 cat >>confdefs.h <<\EOF
2420 #define MIXEDCASE_FILENAMES 1
2421 EOF
2422
2423 for ac_prog in exctags ctags
2424 do
2425   # Extract the first word of "$ac_prog", so it can be a program name with args.
2426 set dummy $ac_prog; ac_word=$2
2427 echo "$as_me:2427: checking for $ac_word" >&5
2428 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2429 if test "${ac_cv_prog_CTAGS+set}" = set; then
2430   echo $ECHO_N "(cached) $ECHO_C" >&6
2431 else
2432   if test -n "$CTAGS"; then
2433   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2434 else
2435   ac_save_IFS=$IFS; IFS=$ac_path_separator
2436 ac_dummy="$PATH"
2437 for ac_dir in $ac_dummy; do
2438   IFS=$ac_save_IFS
2439   test -z "$ac_dir" && ac_dir=.
2440   $as_executable_p "$ac_dir/$ac_word" || continue
2441 ac_cv_prog_CTAGS="$ac_prog"
2442 echo "$as_me:2442: found $ac_dir/$ac_word" >&5
2443 break
2444 done
2445
2446 fi
2447 fi
2448 CTAGS=$ac_cv_prog_CTAGS
2449 if test -n "$CTAGS"; then
2450   echo "$as_me:2450: result: $CTAGS" >&5
2451 echo "${ECHO_T}$CTAGS" >&6
2452 else
2453   echo "$as_me:2453: result: no" >&5
2454 echo "${ECHO_T}no" >&6
2455 fi
2456
2457   test -n "$CTAGS" && break
2458 done
2459
2460 for ac_prog in exetags etags
2461 do
2462   # Extract the first word of "$ac_prog", so it can be a program name with args.
2463 set dummy $ac_prog; ac_word=$2
2464 echo "$as_me:2464: checking for $ac_word" >&5
2465 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2466 if test "${ac_cv_prog_ETAGS+set}" = set; then
2467   echo $ECHO_N "(cached) $ECHO_C" >&6
2468 else
2469   if test -n "$ETAGS"; then
2470   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2471 else
2472   ac_save_IFS=$IFS; IFS=$ac_path_separator
2473 ac_dummy="$PATH"
2474 for ac_dir in $ac_dummy; do
2475   IFS=$ac_save_IFS
2476   test -z "$ac_dir" && ac_dir=.
2477   $as_executable_p "$ac_dir/$ac_word" || continue
2478 ac_cv_prog_ETAGS="$ac_prog"
2479 echo "$as_me:2479: found $ac_dir/$ac_word" >&5
2480 break
2481 done
2482
2483 fi
2484 fi
2485 ETAGS=$ac_cv_prog_ETAGS
2486 if test -n "$ETAGS"; then
2487   echo "$as_me:2487: result: $ETAGS" >&5
2488 echo "${ECHO_T}$ETAGS" >&6
2489 else
2490   echo "$as_me:2490: result: no" >&5
2491 echo "${ECHO_T}no" >&6
2492 fi
2493
2494   test -n "$ETAGS" && break
2495 done
2496
2497 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2498 set dummy ${CTAGS:-ctags}; ac_word=$2
2499 echo "$as_me:2499: checking for $ac_word" >&5
2500 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2501 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2502   echo $ECHO_N "(cached) $ECHO_C" >&6
2503 else
2504   if test -n "$MAKE_LOWER_TAGS"; then
2505   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2506 else
2507   ac_save_IFS=$IFS; IFS=$ac_path_separator
2508 ac_dummy="$PATH"
2509 for ac_dir in $ac_dummy; do
2510   IFS=$ac_save_IFS
2511   test -z "$ac_dir" && ac_dir=.
2512   $as_executable_p "$ac_dir/$ac_word" || continue
2513 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2514 echo "$as_me:2514: found $ac_dir/$ac_word" >&5
2515 break
2516 done
2517
2518   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2519 fi
2520 fi
2521 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2522 if test -n "$MAKE_LOWER_TAGS"; then
2523   echo "$as_me:2523: result: $MAKE_LOWER_TAGS" >&5
2524 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2525 else
2526   echo "$as_me:2526: result: no" >&5
2527 echo "${ECHO_T}no" >&6
2528 fi
2529
2530 if test "$cf_cv_mixedcase" = yes ; then
2531         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2532 set dummy ${ETAGS:-etags}; ac_word=$2
2533 echo "$as_me:2533: checking for $ac_word" >&5
2534 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2535 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2536   echo $ECHO_N "(cached) $ECHO_C" >&6
2537 else
2538   if test -n "$MAKE_UPPER_TAGS"; then
2539   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2540 else
2541   ac_save_IFS=$IFS; IFS=$ac_path_separator
2542 ac_dummy="$PATH"
2543 for ac_dir in $ac_dummy; do
2544   IFS=$ac_save_IFS
2545   test -z "$ac_dir" && ac_dir=.
2546   $as_executable_p "$ac_dir/$ac_word" || continue
2547 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2548 echo "$as_me:2548: found $ac_dir/$ac_word" >&5
2549 break
2550 done
2551
2552   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2553 fi
2554 fi
2555 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2556 if test -n "$MAKE_UPPER_TAGS"; then
2557   echo "$as_me:2557: result: $MAKE_UPPER_TAGS" >&5
2558 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2559 else
2560   echo "$as_me:2560: result: no" >&5
2561 echo "${ECHO_T}no" >&6
2562 fi
2563
2564 else
2565         MAKE_UPPER_TAGS=no
2566 fi
2567
2568 if test "$MAKE_UPPER_TAGS" = yes ; then
2569         MAKE_UPPER_TAGS=
2570 else
2571         MAKE_UPPER_TAGS="#"
2572 fi
2573
2574 if test "$MAKE_LOWER_TAGS" = yes ; then
2575         MAKE_LOWER_TAGS=
2576 else
2577         MAKE_LOWER_TAGS="#"
2578 fi
2579
2580 echo "$as_me:2580: checking if -lm needed for math functions" >&5
2581 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2582 if test "${cf_cv_need_libm+set}" = set; then
2583   echo $ECHO_N "(cached) $ECHO_C" >&6
2584 else
2585
2586         cat >conftest.$ac_ext <<_ACEOF
2587 #line 2587 "configure"
2588 #include "confdefs.h"
2589
2590         #include <stdio.h>
2591         #include <math.h>
2592
2593 int
2594 main ()
2595 {
2596 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2597   ;
2598   return 0;
2599 }
2600 _ACEOF
2601 rm -f conftest.$ac_objext conftest$ac_exeext
2602 if { (eval echo "$as_me:2602: \"$ac_link\"") >&5
2603   (eval $ac_link) 2>&5
2604   ac_status=$?
2605   echo "$as_me:2605: \$? = $ac_status" >&5
2606   (exit $ac_status); } &&
2607          { ac_try='test -s conftest$ac_exeext'
2608   { (eval echo "$as_me:2608: \"$ac_try\"") >&5
2609   (eval $ac_try) 2>&5
2610   ac_status=$?
2611   echo "$as_me:2611: \$? = $ac_status" >&5
2612   (exit $ac_status); }; }; then
2613   cf_cv_need_libm=no
2614 else
2615   echo "$as_me: failed program was:" >&5
2616 cat conftest.$ac_ext >&5
2617 cf_cv_need_libm=yes
2618 fi
2619 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2620 fi
2621 echo "$as_me:2621: result: $cf_cv_need_libm" >&5
2622 echo "${ECHO_T}$cf_cv_need_libm" >&6
2623 if test "$cf_cv_need_libm" = yes
2624 then
2625 MATH_LIB=-lm
2626 fi
2627
2628 top_builddir=`pwd`
2629
2630 CC_G_OPT="-g"
2631 CC_SHARED_OPTS=unknown
2632 CPPFLAGS="$CPPFLAGS"
2633 DFT_DEP_SUFFIX=""
2634 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2635 DFT_UPR_MODEL="NORMAL"
2636 LD="ld"
2637 LDFLAGS_SHARED=""
2638 LDFLAGS_STATIC=""
2639 LD_MODEL=""
2640 LD_SHARED_OPTS=""
2641 LIBTOOL=""
2642 LIB_CLEAN=""
2643 LIB_COMPILE=""
2644 LIB_LINK='${CC}'
2645 LINK_TESTS=""
2646 LOCAL_LDFLAGS=""
2647 PTHREAD="-lm"
2648 TEST_ARGS=""
2649 TEST_DEPS=""
2650 TEST_LIBS=""
2651 TINFO_LDFLAGS=''
2652 TINFO_LIBS='$(LIBS_CURSES)'
2653 cf_cv_abi_version=""
2654 cf_cv_rel_version=""
2655 includesubdir=""
2656
2657 cf_cv_screen=curses
2658 cf_cv_libtype=
2659
2660 if test "$GCC" = yes
2661 then
2662 cat > conftest.i <<EOF
2663 #ifndef GCC_PRINTF
2664 #define GCC_PRINTF 0
2665 #endif
2666 #ifndef GCC_SCANF
2667 #define GCC_SCANF 0
2668 #endif
2669 #ifndef GCC_NORETURN
2670 #define GCC_NORETURN /* nothing */
2671 #endif
2672 #ifndef GCC_UNUSED
2673 #define GCC_UNUSED /* nothing */
2674 #endif
2675 EOF
2676 if test "$GCC" = yes
2677 then
2678         { echo "$as_me:2678: checking for $CC __attribute__ directives..." >&5
2679 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2680 cat > conftest.$ac_ext <<EOF
2681 #line 2681 "${as_me:-configure}"
2682 #include "confdefs.h"
2683 #include "conftest.h"
2684 #include "conftest.i"
2685 #if     GCC_PRINTF
2686 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2687 #else
2688 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2689 #endif
2690 #if     GCC_SCANF
2691 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2692 #else
2693 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2694 #endif
2695 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2696 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2697 extern void foo(void) GCC_NORETURN;
2698 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2699 EOF
2700         cf_printf_attribute=no
2701         cf_scanf_attribute=no
2702         for cf_attribute in scanf printf unused noreturn
2703         do
2704
2705 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2706
2707                 cf_directive="__attribute__(($cf_attribute))"
2708                 echo "checking for $CC $cf_directive" 1>&5
2709
2710                 case $cf_attribute in #(vi
2711                 printf) #(vi
2712                         cf_printf_attribute=yes
2713                         cat >conftest.h <<EOF
2714 #define GCC_$cf_ATTRIBUTE 1
2715 EOF
2716                         ;;
2717                 scanf) #(vi
2718                         cf_scanf_attribute=yes
2719                         cat >conftest.h <<EOF
2720 #define GCC_$cf_ATTRIBUTE 1
2721 EOF
2722                         ;;
2723                 *) #(vi
2724                         cat >conftest.h <<EOF
2725 #define GCC_$cf_ATTRIBUTE $cf_directive
2726 EOF
2727                         ;;
2728                 esac
2729
2730                 if { (eval echo "$as_me:2730: \"$ac_compile\"") >&5
2731   (eval $ac_compile) 2>&5
2732   ac_status=$?
2733   echo "$as_me:2733: \$? = $ac_status" >&5
2734   (exit $ac_status); }; then
2735                         test -n "$verbose" && echo "$as_me:2735: result: ... $cf_attribute" >&5
2736 echo "${ECHO_T}... $cf_attribute" >&6
2737                         cat conftest.h >>confdefs.h
2738                         case $cf_attribute in #(vi
2739                         noreturn) #(vi
2740
2741 cat >>confdefs.h <<EOF
2742 #define GCC_NORETURN $cf_directive
2743 EOF
2744
2745                                 ;;
2746                         printf) #(vi
2747                                 cf_value='/* nothing */'
2748                                 if test "$cf_printf_attribute" != no ; then
2749                                         cf_value='__attribute__((format(printf,fmt,var)))'
2750
2751 cat >>confdefs.h <<\EOF
2752 #define GCC_PRINTF 1
2753 EOF
2754
2755                                 fi
2756
2757 cat >>confdefs.h <<EOF
2758 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2759 EOF
2760
2761                                 ;;
2762                         scanf) #(vi
2763                                 cf_value='/* nothing */'
2764                                 if test "$cf_scanf_attribute" != no ; then
2765                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2766
2767 cat >>confdefs.h <<\EOF
2768 #define GCC_SCANF 1
2769 EOF
2770
2771                                 fi
2772
2773 cat >>confdefs.h <<EOF
2774 #define GCC_SCANFLIKE(fmt,var) $cf_value
2775 EOF
2776
2777                                 ;;
2778                         unused) #(vi
2779
2780 cat >>confdefs.h <<EOF
2781 #define GCC_UNUSED $cf_directive
2782 EOF
2783
2784                                 ;;
2785                         esac
2786                 fi
2787         done
2788 else
2789         fgrep define conftest.i >>confdefs.h
2790 fi
2791 rm -rf conftest*
2792 fi
2793
2794 cf_XOPEN_SOURCE=500
2795 cf_POSIX_C_SOURCE=199506L
2796 cf_xopen_source=
2797
2798 case $host_os in #(vi
2799 aix[4-7]*) #(vi
2800         cf_xopen_source="-D_ALL_SOURCE"
2801         ;;
2802 cygwin|msys) #(vi
2803         cf_XOPEN_SOURCE=600
2804         ;;
2805 darwin[0-8].*) #(vi
2806         cf_xopen_source="-D_APPLE_C_SOURCE"
2807         ;;
2808 darwin*) #(vi
2809         cf_xopen_source="-D_DARWIN_C_SOURCE"
2810         cf_XOPEN_SOURCE=
2811         ;;
2812 freebsd*|dragonfly*) #(vi
2813         # 5.x headers associate
2814         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2815         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2816         cf_POSIX_C_SOURCE=200112L
2817         cf_XOPEN_SOURCE=600
2818         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2819         ;;
2820 hpux11*) #(vi
2821         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2822         ;;
2823 hpux*) #(vi
2824         cf_xopen_source="-D_HPUX_SOURCE"
2825         ;;
2826 irix[56].*) #(vi
2827         cf_xopen_source="-D_SGI_SOURCE"
2828         cf_XOPEN_SOURCE=
2829         ;;
2830 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
2831
2832 echo "$as_me:2832: checking if we must define _GNU_SOURCE" >&5
2833 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2834 if test "${cf_cv_gnu_source+set}" = set; then
2835   echo $ECHO_N "(cached) $ECHO_C" >&6
2836 else
2837
2838 cat >conftest.$ac_ext <<_ACEOF
2839 #line 2839 "configure"
2840 #include "confdefs.h"
2841 #include <sys/types.h>
2842 int
2843 main ()
2844 {
2845
2846 #ifndef _XOPEN_SOURCE
2847 make an error
2848 #endif
2849   ;
2850   return 0;
2851 }
2852 _ACEOF
2853 rm -f conftest.$ac_objext
2854 if { (eval echo "$as_me:2854: \"$ac_compile\"") >&5
2855   (eval $ac_compile) 2>&5
2856   ac_status=$?
2857   echo "$as_me:2857: \$? = $ac_status" >&5
2858   (exit $ac_status); } &&
2859          { ac_try='test -s conftest.$ac_objext'
2860   { (eval echo "$as_me:2860: \"$ac_try\"") >&5
2861   (eval $ac_try) 2>&5
2862   ac_status=$?
2863   echo "$as_me:2863: \$? = $ac_status" >&5
2864   (exit $ac_status); }; }; then
2865   cf_cv_gnu_source=no
2866 else
2867   echo "$as_me: failed program was:" >&5
2868 cat conftest.$ac_ext >&5
2869 cf_save="$CPPFLAGS"
2870          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2871          cat >conftest.$ac_ext <<_ACEOF
2872 #line 2872 "configure"
2873 #include "confdefs.h"
2874 #include <sys/types.h>
2875 int
2876 main ()
2877 {
2878
2879 #ifdef _XOPEN_SOURCE
2880 make an error
2881 #endif
2882   ;
2883   return 0;
2884 }
2885 _ACEOF
2886 rm -f conftest.$ac_objext
2887 if { (eval echo "$as_me:2887: \"$ac_compile\"") >&5
2888   (eval $ac_compile) 2>&5
2889   ac_status=$?
2890   echo "$as_me:2890: \$? = $ac_status" >&5
2891   (exit $ac_status); } &&
2892          { ac_try='test -s conftest.$ac_objext'
2893   { (eval echo "$as_me:2893: \"$ac_try\"") >&5
2894   (eval $ac_try) 2>&5
2895   ac_status=$?
2896   echo "$as_me:2896: \$? = $ac_status" >&5
2897   (exit $ac_status); }; }; then
2898   cf_cv_gnu_source=no
2899 else
2900   echo "$as_me: failed program was:" >&5
2901 cat conftest.$ac_ext >&5
2902 cf_cv_gnu_source=yes
2903 fi
2904 rm -f conftest.$ac_objext conftest.$ac_ext
2905         CPPFLAGS="$cf_save"
2906
2907 fi
2908 rm -f conftest.$ac_objext conftest.$ac_ext
2909
2910 fi
2911 echo "$as_me:2911: result: $cf_cv_gnu_source" >&5
2912 echo "${ECHO_T}$cf_cv_gnu_source" >&6
2913 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2914
2915         ;;
2916 mirbsd*) #(vi
2917         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
2918         cf_XOPEN_SOURCE=
2919
2920 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2921
2922 cf_save_CFLAGS="$CFLAGS"
2923 cf_save_CPPFLAGS="$CPPFLAGS"
2924
2925 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2926         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2927                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2928
2929 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2930         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2931                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2932
2933 echo "$as_me:2933: checking if we should define _POSIX_C_SOURCE" >&5
2934 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
2935 if test "${cf_cv_posix_c_source+set}" = set; then
2936   echo $ECHO_N "(cached) $ECHO_C" >&6
2937 else
2938
2939 echo "${as_me:-configure}:2939: testing if the symbol is already defined go no further ..." 1>&5
2940
2941         cat >conftest.$ac_ext <<_ACEOF
2942 #line 2942 "configure"
2943 #include "confdefs.h"
2944 #include <sys/types.h>
2945 int
2946 main ()
2947 {
2948
2949 #ifndef _POSIX_C_SOURCE
2950 make an error
2951 #endif
2952   ;
2953   return 0;
2954 }
2955 _ACEOF
2956 rm -f conftest.$ac_objext
2957 if { (eval echo "$as_me:2957: \"$ac_compile\"") >&5
2958   (eval $ac_compile) 2>&5
2959   ac_status=$?
2960   echo "$as_me:2960: \$? = $ac_status" >&5
2961   (exit $ac_status); } &&
2962          { ac_try='test -s conftest.$ac_objext'
2963   { (eval echo "$as_me:2963: \"$ac_try\"") >&5
2964   (eval $ac_try) 2>&5
2965   ac_status=$?
2966   echo "$as_me:2966: \$? = $ac_status" >&5
2967   (exit $ac_status); }; }; then
2968   cf_cv_posix_c_source=no
2969 else
2970   echo "$as_me: failed program was:" >&5
2971 cat conftest.$ac_ext >&5
2972 cf_want_posix_source=no
2973          case .$cf_POSIX_C_SOURCE in #(vi
2974          .[12]??*) #(vi
2975                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2976                 ;;
2977          .2) #(vi
2978                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2979                 cf_want_posix_source=yes
2980                 ;;
2981          .*)
2982                 cf_want_posix_source=yes
2983                 ;;
2984          esac
2985          if test "$cf_want_posix_source" = yes ; then
2986                 cat >conftest.$ac_ext <<_ACEOF
2987 #line 2987 "configure"
2988 #include "confdefs.h"
2989 #include <sys/types.h>
2990 int
2991 main ()
2992 {
2993
2994 #ifdef _POSIX_SOURCE
2995 make an error
2996 #endif
2997   ;
2998   return 0;
2999 }
3000 _ACEOF
3001 rm -f conftest.$ac_objext
3002 if { (eval echo "$as_me:3002: \"$ac_compile\"") >&5
3003   (eval $ac_compile) 2>&5
3004   ac_status=$?
3005   echo "$as_me:3005: \$? = $ac_status" >&5
3006   (exit $ac_status); } &&
3007          { ac_try='test -s conftest.$ac_objext'
3008   { (eval echo "$as_me:3008: \"$ac_try\"") >&5
3009   (eval $ac_try) 2>&5
3010   ac_status=$?
3011   echo "$as_me:3011: \$? = $ac_status" >&5
3012   (exit $ac_status); }; }; then
3013   :
3014 else
3015   echo "$as_me: failed program was:" >&5
3016 cat conftest.$ac_ext >&5
3017 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3018 fi
3019 rm -f conftest.$ac_objext conftest.$ac_ext
3020          fi
3021
3022 echo "${as_me:-configure}:3022: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3023
3024          CFLAGS="$cf_trim_CFLAGS"
3025          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3026
3027 echo "${as_me:-configure}:3027: testing if the second compile does not leave our definition intact error ..." 1>&5
3028
3029          cat >conftest.$ac_ext <<_ACEOF
3030 #line 3030 "configure"
3031 #include "confdefs.h"
3032 #include <sys/types.h>
3033 int
3034 main ()
3035 {
3036
3037 #ifndef _POSIX_C_SOURCE
3038 make an error
3039 #endif
3040   ;
3041   return 0;
3042 }
3043 _ACEOF
3044 rm -f conftest.$ac_objext
3045 if { (eval echo "$as_me:3045: \"$ac_compile\"") >&5
3046   (eval $ac_compile) 2>&5
3047   ac_status=$?
3048   echo "$as_me:3048: \$? = $ac_status" >&5
3049   (exit $ac_status); } &&
3050          { ac_try='test -s conftest.$ac_objext'
3051   { (eval echo "$as_me:3051: \"$ac_try\"") >&5
3052   (eval $ac_try) 2>&5
3053   ac_status=$?
3054   echo "$as_me:3054: \$? = $ac_status" >&5
3055   (exit $ac_status); }; }; then
3056   :
3057 else
3058   echo "$as_me: failed program was:" >&5
3059 cat conftest.$ac_ext >&5
3060 cf_cv_posix_c_source=no
3061 fi
3062 rm -f conftest.$ac_objext conftest.$ac_ext
3063          CFLAGS="$cf_save_CFLAGS"
3064          CPPFLAGS="$cf_save_CPPFLAGS"
3065
3066 fi
3067 rm -f conftest.$ac_objext conftest.$ac_ext
3068
3069 fi
3070 echo "$as_me:3070: result: $cf_cv_posix_c_source" >&5
3071 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3072
3073 if test "$cf_cv_posix_c_source" != no ; then
3074         CFLAGS="$cf_trim_CFLAGS"
3075         CPPFLAGS="$cf_trim_CPPFLAGS"
3076
3077 cf_fix_cppflags=no
3078 cf_new_cflags=
3079 cf_new_cppflags=
3080 cf_new_extra_cppflags=
3081
3082 for cf_add_cflags in $cf_cv_posix_c_source
3083 do
3084 case $cf_fix_cppflags in
3085 no)
3086         case $cf_add_cflags in #(vi
3087         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3088                 case $cf_add_cflags in
3089                 -D*)
3090                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3091
3092                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3093                                 && test -z "${cf_tst_cflags}" \
3094                                 && cf_fix_cppflags=yes
3095
3096                         if test $cf_fix_cppflags = yes ; then
3097                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3098                                 continue
3099                         elif test "${cf_tst_cflags}" = "\"'" ; then
3100                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3101                                 continue
3102                         fi
3103                         ;;
3104                 esac
3105                 case "$CPPFLAGS" in
3106                 *$cf_add_cflags) #(vi
3107                         ;;
3108                 *) #(vi
3109                         case $cf_add_cflags in #(vi
3110                         -D*)
3111                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3112
3113 CPPFLAGS=`echo "$CPPFLAGS" | \
3114         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3115                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3116
3117                                 ;;
3118                         esac
3119                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3120                         ;;
3121                 esac
3122                 ;;
3123         *)
3124                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3125                 ;;
3126         esac
3127         ;;
3128 yes)
3129         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3130
3131         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3132
3133         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3134                 && test -z "${cf_tst_cflags}" \
3135                 && cf_fix_cppflags=no
3136         ;;
3137 esac
3138 done
3139
3140 if test -n "$cf_new_cflags" ; then
3141
3142         CFLAGS="$CFLAGS $cf_new_cflags"
3143 fi
3144
3145 if test -n "$cf_new_cppflags" ; then
3146
3147         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3148 fi
3149
3150 if test -n "$cf_new_extra_cppflags" ; then
3151
3152         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3153 fi
3154
3155 fi
3156
3157         ;;
3158 netbsd*) #(vi
3159         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3160         ;;
3161 openbsd[4-9]*) #(vi
3162         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3163         cf_xopen_source="-D_BSD_SOURCE"
3164         cf_XOPEN_SOURCE=600
3165         ;;
3166 openbsd*) #(vi
3167         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3168         ;;
3169 osf[45]*) #(vi
3170         cf_xopen_source="-D_OSF_SOURCE"
3171         ;;
3172 nto-qnx*) #(vi
3173         cf_xopen_source="-D_QNX_SOURCE"
3174         ;;
3175 sco*) #(vi
3176         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3177         ;;
3178 solaris2.*) #(vi
3179         cf_xopen_source="-D__EXTENSIONS__"
3180         cf_cv_xopen_source=broken
3181         ;;
3182 *)
3183
3184 echo "$as_me:3184: checking if we should define _XOPEN_SOURCE" >&5
3185 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3186 if test "${cf_cv_xopen_source+set}" = set; then
3187   echo $ECHO_N "(cached) $ECHO_C" >&6
3188 else
3189
3190         cat >conftest.$ac_ext <<_ACEOF
3191 #line 3191 "configure"
3192 #include "confdefs.h"
3193
3194 #include <stdlib.h>
3195 #include <string.h>
3196 #include <sys/types.h>
3197
3198 int
3199 main ()
3200 {
3201
3202 #ifndef _XOPEN_SOURCE
3203 make an error
3204 #endif
3205   ;
3206   return 0;
3207 }
3208 _ACEOF
3209 rm -f conftest.$ac_objext
3210 if { (eval echo "$as_me:3210: \"$ac_compile\"") >&5
3211   (eval $ac_compile) 2>&5
3212   ac_status=$?
3213   echo "$as_me:3213: \$? = $ac_status" >&5
3214   (exit $ac_status); } &&
3215          { ac_try='test -s conftest.$ac_objext'
3216   { (eval echo "$as_me:3216: \"$ac_try\"") >&5
3217   (eval $ac_try) 2>&5
3218   ac_status=$?
3219   echo "$as_me:3219: \$? = $ac_status" >&5
3220   (exit $ac_status); }; }; then
3221   cf_cv_xopen_source=no
3222 else
3223   echo "$as_me: failed program was:" >&5
3224 cat conftest.$ac_ext >&5
3225 cf_save="$CPPFLAGS"
3226          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3227          cat >conftest.$ac_ext <<_ACEOF
3228 #line 3228 "configure"
3229 #include "confdefs.h"
3230
3231 #include <stdlib.h>
3232 #include <string.h>
3233 #include <sys/types.h>
3234
3235 int
3236 main ()
3237 {
3238
3239 #ifdef _XOPEN_SOURCE
3240 make an error
3241 #endif
3242   ;
3243   return 0;
3244 }
3245 _ACEOF
3246 rm -f conftest.$ac_objext
3247 if { (eval echo "$as_me:3247: \"$ac_compile\"") >&5
3248   (eval $ac_compile) 2>&5
3249   ac_status=$?
3250   echo "$as_me:3250: \$? = $ac_status" >&5
3251   (exit $ac_status); } &&
3252          { ac_try='test -s conftest.$ac_objext'
3253   { (eval echo "$as_me:3253: \"$ac_try\"") >&5
3254   (eval $ac_try) 2>&5
3255   ac_status=$?
3256   echo "$as_me:3256: \$? = $ac_status" >&5
3257   (exit $ac_status); }; }; then
3258   cf_cv_xopen_source=no
3259 else
3260   echo "$as_me: failed program was:" >&5
3261 cat conftest.$ac_ext >&5
3262 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3263 fi
3264 rm -f conftest.$ac_objext conftest.$ac_ext
3265         CPPFLAGS="$cf_save"
3266
3267 fi
3268 rm -f conftest.$ac_objext conftest.$ac_ext
3269
3270 fi
3271 echo "$as_me:3271: result: $cf_cv_xopen_source" >&5
3272 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3273
3274 if test "$cf_cv_xopen_source" != no ; then
3275
3276 CFLAGS=`echo "$CFLAGS" | \
3277         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3278                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3279
3280 CPPFLAGS=`echo "$CPPFLAGS" | \
3281         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3282                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3283
3284         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3285
3286 cf_fix_cppflags=no
3287 cf_new_cflags=
3288 cf_new_cppflags=
3289 cf_new_extra_cppflags=
3290
3291 for cf_add_cflags in $cf_temp_xopen_source
3292 do
3293 case $cf_fix_cppflags in
3294 no)
3295         case $cf_add_cflags in #(vi
3296         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3297                 case $cf_add_cflags in
3298                 -D*)
3299                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3300
3301                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3302                                 && test -z "${cf_tst_cflags}" \
3303                                 && cf_fix_cppflags=yes
3304
3305                         if test $cf_fix_cppflags = yes ; then
3306                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3307                                 continue
3308                         elif test "${cf_tst_cflags}" = "\"'" ; then
3309                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3310                                 continue
3311                         fi
3312                         ;;
3313                 esac
3314                 case "$CPPFLAGS" in
3315                 *$cf_add_cflags) #(vi
3316                         ;;
3317                 *) #(vi
3318                         case $cf_add_cflags in #(vi
3319                         -D*)
3320                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3321
3322 CPPFLAGS=`echo "$CPPFLAGS" | \
3323         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3324                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3325
3326                                 ;;
3327                         esac
3328                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3329                         ;;
3330                 esac
3331                 ;;
3332         *)
3333                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3334                 ;;
3335         esac
3336         ;;
3337 yes)
3338         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3339
3340         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3341
3342         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3343                 && test -z "${cf_tst_cflags}" \
3344                 && cf_fix_cppflags=no
3345         ;;
3346 esac
3347 done
3348
3349 if test -n "$cf_new_cflags" ; then
3350
3351         CFLAGS="$CFLAGS $cf_new_cflags"
3352 fi
3353
3354 if test -n "$cf_new_cppflags" ; then
3355
3356         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3357 fi
3358
3359 if test -n "$cf_new_extra_cppflags" ; then
3360
3361         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3362 fi
3363
3364 fi
3365
3366 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3367
3368 cf_save_CFLAGS="$CFLAGS"
3369 cf_save_CPPFLAGS="$CPPFLAGS"
3370
3371 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3372         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3373                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3374
3375 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3376         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3377                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3378
3379 echo "$as_me:3379: checking if we should define _POSIX_C_SOURCE" >&5
3380 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3381 if test "${cf_cv_posix_c_source+set}" = set; then
3382   echo $ECHO_N "(cached) $ECHO_C" >&6
3383 else
3384
3385 echo "${as_me:-configure}:3385: testing if the symbol is already defined go no further ..." 1>&5
3386
3387         cat >conftest.$ac_ext <<_ACEOF
3388 #line 3388 "configure"
3389 #include "confdefs.h"
3390 #include <sys/types.h>
3391 int
3392 main ()
3393 {
3394
3395 #ifndef _POSIX_C_SOURCE
3396 make an error
3397 #endif
3398   ;
3399   return 0;
3400 }
3401 _ACEOF
3402 rm -f conftest.$ac_objext
3403 if { (eval echo "$as_me:3403: \"$ac_compile\"") >&5
3404   (eval $ac_compile) 2>&5
3405   ac_status=$?
3406   echo "$as_me:3406: \$? = $ac_status" >&5
3407   (exit $ac_status); } &&
3408          { ac_try='test -s conftest.$ac_objext'
3409   { (eval echo "$as_me:3409: \"$ac_try\"") >&5
3410   (eval $ac_try) 2>&5
3411   ac_status=$?
3412   echo "$as_me:3412: \$? = $ac_status" >&5
3413   (exit $ac_status); }; }; then
3414   cf_cv_posix_c_source=no
3415 else
3416   echo "$as_me: failed program was:" >&5
3417 cat conftest.$ac_ext >&5
3418 cf_want_posix_source=no
3419          case .$cf_POSIX_C_SOURCE in #(vi
3420          .[12]??*) #(vi
3421                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3422                 ;;
3423          .2) #(vi
3424                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3425                 cf_want_posix_source=yes
3426                 ;;
3427          .*)
3428                 cf_want_posix_source=yes
3429                 ;;
3430          esac
3431          if test "$cf_want_posix_source" = yes ; then
3432                 cat >conftest.$ac_ext <<_ACEOF
3433 #line 3433 "configure"
3434 #include "confdefs.h"
3435 #include <sys/types.h>
3436 int
3437 main ()
3438 {
3439
3440 #ifdef _POSIX_SOURCE
3441 make an error
3442 #endif
3443   ;
3444   return 0;
3445 }
3446 _ACEOF
3447 rm -f conftest.$ac_objext
3448 if { (eval echo "$as_me:3448: \"$ac_compile\"") >&5
3449   (eval $ac_compile) 2>&5
3450   ac_status=$?
3451   echo "$as_me:3451: \$? = $ac_status" >&5
3452   (exit $ac_status); } &&
3453          { ac_try='test -s conftest.$ac_objext'
3454   { (eval echo "$as_me:3454: \"$ac_try\"") >&5
3455   (eval $ac_try) 2>&5
3456   ac_status=$?
3457   echo "$as_me:3457: \$? = $ac_status" >&5
3458   (exit $ac_status); }; }; then
3459   :
3460 else
3461   echo "$as_me: failed program was:" >&5
3462 cat conftest.$ac_ext >&5
3463 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3464 fi
3465 rm -f conftest.$ac_objext conftest.$ac_ext
3466          fi
3467
3468 echo "${as_me:-configure}:3468: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3469
3470          CFLAGS="$cf_trim_CFLAGS"
3471          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3472
3473 echo "${as_me:-configure}:3473: testing if the second compile does not leave our definition intact error ..." 1>&5
3474
3475          cat >conftest.$ac_ext <<_ACEOF
3476 #line 3476 "configure"
3477 #include "confdefs.h"
3478 #include <sys/types.h>
3479 int
3480 main ()
3481 {
3482
3483 #ifndef _POSIX_C_SOURCE
3484 make an error
3485 #endif
3486   ;
3487   return 0;
3488 }
3489 _ACEOF
3490 rm -f conftest.$ac_objext
3491 if { (eval echo "$as_me:3491: \"$ac_compile\"") >&5
3492   (eval $ac_compile) 2>&5
3493   ac_status=$?
3494   echo "$as_me:3494: \$? = $ac_status" >&5
3495   (exit $ac_status); } &&
3496          { ac_try='test -s conftest.$ac_objext'
3497   { (eval echo "$as_me:3497: \"$ac_try\"") >&5
3498   (eval $ac_try) 2>&5
3499   ac_status=$?
3500   echo "$as_me:3500: \$? = $ac_status" >&5
3501   (exit $ac_status); }; }; then
3502   :
3503 else
3504   echo "$as_me: failed program was:" >&5
3505 cat conftest.$ac_ext >&5
3506 cf_cv_posix_c_source=no
3507 fi
3508 rm -f conftest.$ac_objext conftest.$ac_ext
3509          CFLAGS="$cf_save_CFLAGS"
3510          CPPFLAGS="$cf_save_CPPFLAGS"
3511
3512 fi
3513 rm -f conftest.$ac_objext conftest.$ac_ext
3514
3515 fi
3516 echo "$as_me:3516: result: $cf_cv_posix_c_source" >&5
3517 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3518
3519 if test "$cf_cv_posix_c_source" != no ; then
3520         CFLAGS="$cf_trim_CFLAGS"
3521         CPPFLAGS="$cf_trim_CPPFLAGS"
3522
3523 cf_fix_cppflags=no
3524 cf_new_cflags=
3525 cf_new_cppflags=
3526 cf_new_extra_cppflags=
3527
3528 for cf_add_cflags in $cf_cv_posix_c_source
3529 do
3530 case $cf_fix_cppflags in
3531 no)
3532         case $cf_add_cflags in #(vi
3533         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3534                 case $cf_add_cflags in
3535                 -D*)
3536                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3537
3538                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3539                                 && test -z "${cf_tst_cflags}" \
3540                                 && cf_fix_cppflags=yes
3541
3542                         if test $cf_fix_cppflags = yes ; then
3543                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3544                                 continue
3545                         elif test "${cf_tst_cflags}" = "\"'" ; then
3546                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3547                                 continue
3548                         fi
3549                         ;;
3550                 esac
3551                 case "$CPPFLAGS" in
3552                 *$cf_add_cflags) #(vi
3553                         ;;
3554                 *) #(vi
3555                         case $cf_add_cflags in #(vi
3556                         -D*)
3557                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3558
3559 CPPFLAGS=`echo "$CPPFLAGS" | \
3560         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3561                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3562
3563                                 ;;
3564                         esac
3565                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3566                         ;;
3567                 esac
3568                 ;;
3569         *)
3570                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3571                 ;;
3572         esac
3573         ;;
3574 yes)
3575         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3576
3577         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3578
3579         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3580                 && test -z "${cf_tst_cflags}" \
3581                 && cf_fix_cppflags=no
3582         ;;
3583 esac
3584 done
3585
3586 if test -n "$cf_new_cflags" ; then
3587
3588         CFLAGS="$CFLAGS $cf_new_cflags"
3589 fi
3590
3591 if test -n "$cf_new_cppflags" ; then
3592
3593         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3594 fi
3595
3596 if test -n "$cf_new_extra_cppflags" ; then
3597
3598         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3599 fi
3600
3601 fi
3602
3603         ;;
3604 esac
3605
3606 if test -n "$cf_xopen_source" ; then
3607
3608 cf_fix_cppflags=no
3609 cf_new_cflags=
3610 cf_new_cppflags=
3611 cf_new_extra_cppflags=
3612
3613 for cf_add_cflags in $cf_xopen_source
3614 do
3615 case $cf_fix_cppflags in
3616 no)
3617         case $cf_add_cflags in #(vi
3618         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3619                 case $cf_add_cflags in
3620                 -D*)
3621                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3622
3623                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3624                                 && test -z "${cf_tst_cflags}" \
3625                                 && cf_fix_cppflags=yes
3626
3627                         if test $cf_fix_cppflags = yes ; then
3628                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3629                                 continue
3630                         elif test "${cf_tst_cflags}" = "\"'" ; then
3631                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3632                                 continue
3633                         fi
3634                         ;;
3635                 esac
3636                 case "$CPPFLAGS" in
3637                 *$cf_add_cflags) #(vi
3638                         ;;
3639                 *) #(vi
3640                         case $cf_add_cflags in #(vi
3641                         -D*)
3642                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3643
3644 CPPFLAGS=`echo "$CPPFLAGS" | \
3645         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3646                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3647
3648                                 ;;
3649                         esac
3650                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3651                         ;;
3652                 esac
3653                 ;;
3654         *)
3655                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3656                 ;;
3657         esac
3658         ;;
3659 yes)
3660         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3661
3662         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3663
3664         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3665                 && test -z "${cf_tst_cflags}" \
3666                 && cf_fix_cppflags=no
3667         ;;
3668 esac
3669 done
3670
3671 if test -n "$cf_new_cflags" ; then
3672
3673         CFLAGS="$CFLAGS $cf_new_cflags"
3674 fi
3675
3676 if test -n "$cf_new_cppflags" ; then
3677
3678         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3679 fi
3680
3681 if test -n "$cf_new_extra_cppflags" ; then
3682
3683         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3684 fi
3685
3686 fi
3687
3688 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3689         echo "$as_me:3689: checking if _XOPEN_SOURCE really is set" >&5
3690 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3691         cat >conftest.$ac_ext <<_ACEOF
3692 #line 3692 "configure"
3693 #include "confdefs.h"
3694 #include <stdlib.h>
3695 int
3696 main ()
3697 {
3698
3699 #ifndef _XOPEN_SOURCE
3700 make an error
3701 #endif
3702   ;
3703   return 0;
3704 }
3705 _ACEOF
3706 rm -f conftest.$ac_objext
3707 if { (eval echo "$as_me:3707: \"$ac_compile\"") >&5
3708   (eval $ac_compile) 2>&5
3709   ac_status=$?
3710   echo "$as_me:3710: \$? = $ac_status" >&5
3711   (exit $ac_status); } &&
3712          { ac_try='test -s conftest.$ac_objext'
3713   { (eval echo "$as_me:3713: \"$ac_try\"") >&5
3714   (eval $ac_try) 2>&5
3715   ac_status=$?
3716   echo "$as_me:3716: \$? = $ac_status" >&5
3717   (exit $ac_status); }; }; then
3718   cf_XOPEN_SOURCE_set=yes
3719 else
3720   echo "$as_me: failed program was:" >&5
3721 cat conftest.$ac_ext >&5
3722 cf_XOPEN_SOURCE_set=no
3723 fi
3724 rm -f conftest.$ac_objext conftest.$ac_ext
3725         echo "$as_me:3725: result: $cf_XOPEN_SOURCE_set" >&5
3726 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3727         if test $cf_XOPEN_SOURCE_set = yes
3728         then
3729                 cat >conftest.$ac_ext <<_ACEOF
3730 #line 3730 "configure"
3731 #include "confdefs.h"
3732 #include <stdlib.h>
3733 int
3734 main ()
3735 {
3736
3737 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3738 make an error
3739 #endif
3740   ;
3741   return 0;
3742 }
3743 _ACEOF
3744 rm -f conftest.$ac_objext
3745 if { (eval echo "$as_me:3745: \"$ac_compile\"") >&5
3746   (eval $ac_compile) 2>&5
3747   ac_status=$?
3748   echo "$as_me:3748: \$? = $ac_status" >&5
3749   (exit $ac_status); } &&
3750          { ac_try='test -s conftest.$ac_objext'
3751   { (eval echo "$as_me:3751: \"$ac_try\"") >&5
3752   (eval $ac_try) 2>&5
3753   ac_status=$?
3754   echo "$as_me:3754: \$? = $ac_status" >&5
3755   (exit $ac_status); }; }; then
3756   cf_XOPEN_SOURCE_set_ok=yes
3757 else
3758   echo "$as_me: failed program was:" >&5
3759 cat conftest.$ac_ext >&5
3760 cf_XOPEN_SOURCE_set_ok=no
3761 fi
3762 rm -f conftest.$ac_objext conftest.$ac_ext
3763                 if test $cf_XOPEN_SOURCE_set_ok = no
3764                 then
3765                         { echo "$as_me:3765: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3766 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3767                 fi
3768         else
3769
3770 echo "$as_me:3770: checking if we should define _XOPEN_SOURCE" >&5
3771 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3772 if test "${cf_cv_xopen_source+set}" = set; then
3773   echo $ECHO_N "(cached) $ECHO_C" >&6
3774 else
3775
3776         cat >conftest.$ac_ext <<_ACEOF
3777 #line 3777 "configure"
3778 #include "confdefs.h"
3779
3780 #include <stdlib.h>
3781 #include <string.h>
3782 #include <sys/types.h>
3783
3784 int
3785 main ()
3786 {
3787
3788 #ifndef _XOPEN_SOURCE
3789 make an error
3790 #endif
3791   ;
3792   return 0;
3793 }
3794 _ACEOF
3795 rm -f conftest.$ac_objext
3796 if { (eval echo "$as_me:3796: \"$ac_compile\"") >&5
3797   (eval $ac_compile) 2>&5
3798   ac_status=$?
3799   echo "$as_me:3799: \$? = $ac_status" >&5
3800   (exit $ac_status); } &&
3801          { ac_try='test -s conftest.$ac_objext'
3802   { (eval echo "$as_me:3802: \"$ac_try\"") >&5
3803   (eval $ac_try) 2>&5
3804   ac_status=$?
3805   echo "$as_me:3805: \$? = $ac_status" >&5
3806   (exit $ac_status); }; }; then
3807   cf_cv_xopen_source=no
3808 else
3809   echo "$as_me: failed program was:" >&5
3810 cat conftest.$ac_ext >&5
3811 cf_save="$CPPFLAGS"
3812          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3813          cat >conftest.$ac_ext <<_ACEOF
3814 #line 3814 "configure"
3815 #include "confdefs.h"
3816
3817 #include <stdlib.h>
3818 #include <string.h>
3819 #include <sys/types.h>
3820
3821 int
3822 main ()
3823 {
3824
3825 #ifdef _XOPEN_SOURCE
3826 make an error
3827 #endif
3828   ;
3829   return 0;
3830 }
3831 _ACEOF
3832 rm -f conftest.$ac_objext
3833 if { (eval echo "$as_me:3833: \"$ac_compile\"") >&5
3834   (eval $ac_compile) 2>&5
3835   ac_status=$?
3836   echo "$as_me:3836: \$? = $ac_status" >&5
3837   (exit $ac_status); } &&
3838          { ac_try='test -s conftest.$ac_objext'
3839   { (eval echo "$as_me:3839: \"$ac_try\"") >&5
3840   (eval $ac_try) 2>&5
3841   ac_status=$?
3842   echo "$as_me:3842: \$? = $ac_status" >&5
3843   (exit $ac_status); }; }; then
3844   cf_cv_xopen_source=no
3845 else
3846   echo "$as_me: failed program was:" >&5
3847 cat conftest.$ac_ext >&5
3848 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3849 fi
3850 rm -f conftest.$ac_objext conftest.$ac_ext
3851         CPPFLAGS="$cf_save"
3852
3853 fi
3854 rm -f conftest.$ac_objext conftest.$ac_ext
3855
3856 fi
3857 echo "$as_me:3857: result: $cf_cv_xopen_source" >&5
3858 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3859
3860 if test "$cf_cv_xopen_source" != no ; then
3861
3862 CFLAGS=`echo "$CFLAGS" | \
3863         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3864                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3865
3866 CPPFLAGS=`echo "$CPPFLAGS" | \
3867         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3868                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3869
3870         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3871
3872 cf_fix_cppflags=no
3873 cf_new_cflags=
3874 cf_new_cppflags=
3875 cf_new_extra_cppflags=
3876
3877 for cf_add_cflags in $cf_temp_xopen_source
3878 do
3879 case $cf_fix_cppflags in
3880 no)
3881         case $cf_add_cflags in #(vi
3882         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3883                 case $cf_add_cflags in
3884                 -D*)
3885                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3886
3887                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3888                                 && test -z "${cf_tst_cflags}" \
3889                                 && cf_fix_cppflags=yes
3890
3891                         if test $cf_fix_cppflags = yes ; then
3892                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3893                                 continue
3894                         elif test "${cf_tst_cflags}" = "\"'" ; then
3895                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3896                                 continue
3897                         fi
3898                         ;;
3899                 esac
3900                 case "$CPPFLAGS" in
3901                 *$cf_add_cflags) #(vi
3902                         ;;
3903                 *) #(vi
3904                         case $cf_add_cflags in #(vi
3905                         -D*)
3906                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3907
3908 CPPFLAGS=`echo "$CPPFLAGS" | \
3909         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3910                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3911
3912                                 ;;
3913                         esac
3914                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3915                         ;;
3916                 esac
3917                 ;;
3918         *)
3919                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3920                 ;;
3921         esac
3922         ;;
3923 yes)
3924         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3925
3926         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3927
3928         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3929                 && test -z "${cf_tst_cflags}" \
3930                 && cf_fix_cppflags=no
3931         ;;
3932 esac
3933 done
3934
3935 if test -n "$cf_new_cflags" ; then
3936
3937         CFLAGS="$CFLAGS $cf_new_cflags"
3938 fi
3939
3940 if test -n "$cf_new_cppflags" ; then
3941
3942         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3943 fi
3944
3945 if test -n "$cf_new_extra_cppflags" ; then
3946
3947         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3948 fi
3949
3950 fi
3951
3952         fi
3953 fi
3954
3955 echo "$as_me:3955: checking for signal global datatype" >&5
3956 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
3957 if test "${cf_cv_sig_atomic_t+set}" = set; then
3958   echo $ECHO_N "(cached) $ECHO_C" >&6
3959 else
3960
3961         for cf_type in \
3962                 "volatile sig_atomic_t" \
3963                 "sig_atomic_t" \
3964                 "int"
3965         do
3966         cat >conftest.$ac_ext <<_ACEOF
3967 #line 3967 "configure"
3968 #include "confdefs.h"
3969
3970 #include <sys/types.h>
3971 #include <signal.h>
3972 #include <stdio.h>
3973
3974 extern $cf_type x;
3975 $cf_type x;
3976 static void handler(int sig)
3977 {
3978         x = 5;
3979 }
3980 int
3981 main ()
3982 {
3983 signal(SIGINT, handler);
3984                  x = 1
3985   ;
3986   return 0;
3987 }
3988 _ACEOF
3989 rm -f conftest.$ac_objext
3990 if { (eval echo "$as_me:3990: \"$ac_compile\"") >&5
3991   (eval $ac_compile) 2>&5
3992   ac_status=$?
3993   echo "$as_me:3993: \$? = $ac_status" >&5
3994   (exit $ac_status); } &&
3995          { ac_try='test -s conftest.$ac_objext'
3996   { (eval echo "$as_me:3996: \"$ac_try\"") >&5
3997   (eval $ac_try) 2>&5
3998   ac_status=$?
3999   echo "$as_me:3999: \$? = $ac_status" >&5
4000   (exit $ac_status); }; }; then
4001   cf_cv_sig_atomic_t=$cf_type
4002 else
4003   echo "$as_me: failed program was:" >&5
4004 cat conftest.$ac_ext >&5
4005 cf_cv_sig_atomic_t=no
4006 fi
4007 rm -f conftest.$ac_objext conftest.$ac_ext
4008                 test "$cf_cv_sig_atomic_t" != no && break
4009         done
4010
4011 fi
4012
4013 echo "$as_me:4013: result: $cf_cv_sig_atomic_t" >&5
4014 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4015 test "$cf_cv_sig_atomic_t" != no &&
4016 cat >>confdefs.h <<EOF
4017 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4018 EOF
4019
4020 echo "$as_me:4020: checking if you want to use pkg-config" >&5
4021 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4022
4023 # Check whether --with-pkg-config or --without-pkg-config was given.
4024 if test "${with_pkg_config+set}" = set; then
4025   withval="$with_pkg_config"
4026   cf_pkg_config=$withval
4027 else
4028   cf_pkg_config=yes
4029 fi;
4030 echo "$as_me:4030: result: $cf_pkg_config" >&5
4031 echo "${ECHO_T}$cf_pkg_config" >&6
4032
4033 case $cf_pkg_config in #(vi
4034 no) #(vi
4035         PKG_CONFIG=none
4036         ;;
4037 yes) #(vi
4038
4039 if test -n "$ac_tool_prefix"; then
4040   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4041 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4042 echo "$as_me:4042: checking for $ac_word" >&5
4043 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4044 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4045   echo $ECHO_N "(cached) $ECHO_C" >&6
4046 else
4047   case $PKG_CONFIG in
4048   [\\/]* | ?:[\\/]*)
4049   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4050   ;;
4051   *)
4052   ac_save_IFS=$IFS; IFS=$ac_path_separator
4053 ac_dummy="$PATH"
4054 for ac_dir in $ac_dummy; do
4055   IFS=$ac_save_IFS
4056   test -z "$ac_dir" && ac_dir=.
4057   if $as_executable_p "$ac_dir/$ac_word"; then
4058    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4059    echo "$as_me:4059: found $ac_dir/$ac_word" >&5
4060    break
4061 fi
4062 done
4063
4064   ;;
4065 esac
4066 fi
4067 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4068
4069 if test -n "$PKG_CONFIG"; then
4070   echo "$as_me:4070: result: $PKG_CONFIG" >&5
4071 echo "${ECHO_T}$PKG_CONFIG" >&6
4072 else
4073   echo "$as_me:4073: result: no" >&5
4074 echo "${ECHO_T}no" >&6
4075 fi
4076
4077 fi
4078 if test -z "$ac_cv_path_PKG_CONFIG"; then
4079   ac_pt_PKG_CONFIG=$PKG_CONFIG
4080   # Extract the first word of "pkg-config", so it can be a program name with args.
4081 set dummy pkg-config; ac_word=$2
4082 echo "$as_me:4082: checking for $ac_word" >&5
4083 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4084 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4085   echo $ECHO_N "(cached) $ECHO_C" >&6
4086 else
4087   case $ac_pt_PKG_CONFIG in
4088   [\\/]* | ?:[\\/]*)
4089   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4090   ;;
4091   *)
4092   ac_save_IFS=$IFS; IFS=$ac_path_separator
4093 ac_dummy="$PATH"
4094 for ac_dir in $ac_dummy; do
4095   IFS=$ac_save_IFS
4096   test -z "$ac_dir" && ac_dir=.
4097   if $as_executable_p "$ac_dir/$ac_word"; then
4098    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4099    echo "$as_me:4099: found $ac_dir/$ac_word" >&5
4100    break
4101 fi
4102 done
4103
4104   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4105   ;;
4106 esac
4107 fi
4108 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4109
4110 if test -n "$ac_pt_PKG_CONFIG"; then
4111   echo "$as_me:4111: result: $ac_pt_PKG_CONFIG" >&5
4112 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4113 else
4114   echo "$as_me:4114: result: no" >&5
4115 echo "${ECHO_T}no" >&6
4116 fi
4117
4118   PKG_CONFIG=$ac_pt_PKG_CONFIG
4119 else
4120   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4121 fi
4122
4123         ;;
4124 *)
4125         PKG_CONFIG=$withval
4126         ;;
4127 esac
4128
4129 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4130 if test "$PKG_CONFIG" != none ; then
4131
4132 if test "x$prefix" != xNONE; then
4133   cf_path_syntax="$prefix"
4134 else
4135   cf_path_syntax="$ac_default_prefix"
4136 fi
4137
4138 case ".$PKG_CONFIG" in #(vi
4139 .\$\(*\)*|.\'*\'*) #(vi
4140   ;;
4141 ..|./*|.\\*) #(vi
4142   ;;
4143 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
4144   ;;
4145 .\${*prefix}*|.\${*dir}*) #(vi
4146   eval PKG_CONFIG="$PKG_CONFIG"
4147   case ".$PKG_CONFIG" in #(vi
4148   .NONE/*)
4149     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4150     ;;
4151   esac
4152   ;; #(vi
4153 .no|.NONE/*)
4154   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4155   ;;
4156 *)
4157   { { echo "$as_me:4157: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4158 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4159    { (exit 1); exit 1; }; }
4160   ;;
4161 esac
4162
4163 fi
4164
4165 echo "$as_me:4165: checking if you want to see long compiling messages" >&5
4166 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4167
4168 # Check whether --enable-echo or --disable-echo was given.
4169 if test "${enable_echo+set}" = set; then
4170   enableval="$enable_echo"
4171   test "$enableval" != no && enableval=yes
4172   if test "$enableval" != "yes" ; then
4173
4174     ECHO_LT='--silent'
4175     ECHO_LD='@echo linking $@;'
4176     RULE_CC='@echo compiling $<'
4177     SHOW_CC='@echo compiling $@'
4178     ECHO_CC='@'
4179
4180   else
4181
4182     ECHO_LT=''
4183     ECHO_LD=''
4184     RULE_CC=''
4185     SHOW_CC=''
4186     ECHO_CC=''
4187
4188   fi
4189 else
4190   enableval=yes
4191
4192     ECHO_LT=''
4193     ECHO_LD=''
4194     RULE_CC=''
4195     SHOW_CC=''
4196     ECHO_CC=''
4197
4198 fi;
4199 echo "$as_me:4199: result: $enableval" >&5
4200 echo "${ECHO_T}$enableval" >&6
4201
4202 echo "$as_me:4202: checking for ncurses wrap-prefix" >&5
4203 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4204
4205 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4206 if test "${with_ncurses_wrap_prefix+set}" = set; then
4207   withval="$with_ncurses_wrap_prefix"
4208   NCURSES_WRAP_PREFIX=$withval
4209 else
4210   NCURSES_WRAP_PREFIX=_nc_
4211 fi;
4212 echo "$as_me:4212: result: $NCURSES_WRAP_PREFIX" >&5
4213 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4214
4215 echo "$as_me:4215: checking if you want to check for wide-character functions" >&5
4216 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4217
4218 # Check whether --enable-widec or --disable-widec was given.
4219 if test "${enable_widec+set}" = set; then
4220   enableval="$enable_widec"
4221   test "$enableval" != no && enableval=yes
4222   if test "$enableval" != "yes" ; then
4223     cf_enable_widec=no
4224   else
4225     cf_enable_widec=yes
4226   fi
4227 else
4228   enableval=yes
4229   cf_enable_widec=yes
4230
4231 fi;
4232 echo "$as_me:4232: result: $cf_enable_widec" >&5
4233 echo "${ECHO_T}$cf_enable_widec" >&6
4234
4235 echo "$as_me:4235: checking for specific curses-directory" >&5
4236 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4237
4238 # Check whether --with-curses-dir or --without-curses-dir was given.
4239 if test "${with_curses_dir+set}" = set; then
4240   withval="$with_curses_dir"
4241   cf_cv_curses_dir=$withval
4242 else
4243   cf_cv_curses_dir=no
4244 fi;
4245 echo "$as_me:4245: result: $cf_cv_curses_dir" >&5
4246 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4247
4248 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4249 then
4250
4251 if test "x$prefix" != xNONE; then
4252   cf_path_syntax="$prefix"
4253 else
4254   cf_path_syntax="$ac_default_prefix"
4255 fi
4256
4257 case ".$withval" in #(vi
4258 .\$\(*\)*|.\'*\'*) #(vi
4259   ;;
4260 ..|./*|.\\*) #(vi
4261   ;;
4262 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
4263   ;;
4264 .\${*prefix}*|.\${*dir}*) #(vi
4265   eval withval="$withval"
4266   case ".$withval" in #(vi
4267   .NONE/*)
4268     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4269     ;;
4270   esac
4271   ;; #(vi
4272 .no|.NONE/*)
4273   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4274   ;;
4275 *)
4276   { { echo "$as_me:4276: error: expected a pathname, not \"$withval\"" >&5
4277 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4278    { (exit 1); exit 1; }; }
4279   ;;
4280 esac
4281
4282         if test -d "$cf_cv_curses_dir"
4283         then
4284
4285 if test -n "$cf_cv_curses_dir/include" ; then
4286   for cf_add_incdir in $cf_cv_curses_dir/include
4287   do
4288         while test $cf_add_incdir != /usr/include
4289         do
4290           if test -d $cf_add_incdir
4291           then
4292                 cf_have_incdir=no
4293                 if test -n "$CFLAGS$CPPFLAGS" ; then
4294                   # a loop is needed to ensure we can add subdirs of existing dirs
4295                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4296                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4297                           cf_have_incdir=yes; break
4298                         fi
4299                   done
4300                 fi
4301
4302                 if test "$cf_have_incdir" = no ; then
4303                   if test "$cf_add_incdir" = /usr/local/include ; then
4304                         if test "$GCC" = yes
4305                         then
4306                           cf_save_CPPFLAGS=$CPPFLAGS
4307                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4308                           cat >conftest.$ac_ext <<_ACEOF
4309 #line 4309 "configure"
4310 #include "confdefs.h"
4311 #include <stdio.h>
4312 int
4313 main ()
4314 {
4315 printf("Hello")
4316   ;
4317   return 0;
4318 }
4319 _ACEOF
4320 rm -f conftest.$ac_objext
4321 if { (eval echo "$as_me:4321: \"$ac_compile\"") >&5
4322   (eval $ac_compile) 2>&5
4323   ac_status=$?
4324   echo "$as_me:4324: \$? = $ac_status" >&5
4325   (exit $ac_status); } &&
4326          { ac_try='test -s conftest.$ac_objext'
4327   { (eval echo "$as_me:4327: \"$ac_try\"") >&5
4328   (eval $ac_try) 2>&5
4329   ac_status=$?
4330   echo "$as_me:4330: \$? = $ac_status" >&5
4331   (exit $ac_status); }; }; then
4332   :
4333 else
4334   echo "$as_me: failed program was:" >&5
4335 cat conftest.$ac_ext >&5
4336 cf_have_incdir=yes
4337 fi
4338 rm -f conftest.$ac_objext conftest.$ac_ext
4339                           CPPFLAGS=$cf_save_CPPFLAGS
4340                         fi
4341                   fi
4342                 fi
4343
4344                 if test "$cf_have_incdir" = no ; then
4345                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4346
4347 echo "${as_me:-configure}:4347: testing adding $cf_add_incdir to include-path ..." 1>&5
4348
4349                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4350
4351                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4352                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4353                   cf_add_incdir="$cf_top_incdir"
4354                 else
4355                   break
4356                 fi
4357           fi
4358         done
4359   done
4360 fi
4361
4362 if test -n "$cf_cv_curses_dir/lib" ; then
4363   for cf_add_libdir in $cf_cv_curses_dir/lib
4364   do
4365     if test $cf_add_libdir = /usr/lib ; then
4366       :
4367     elif test -d $cf_add_libdir
4368     then
4369       cf_have_libdir=no
4370       if test -n "$LDFLAGS$LIBS" ; then
4371         # a loop is needed to ensure we can add subdirs of existing dirs
4372         for cf_test_libdir in $LDFLAGS $LIBS ; do
4373           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4374             cf_have_libdir=yes; break
4375           fi
4376         done
4377       fi
4378       if test "$cf_have_libdir" = no ; then
4379         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4380
4381 echo "${as_me:-configure}:4381: testing adding $cf_add_libdir to library-path ..." 1>&5
4382
4383         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4384       fi
4385     fi
4386   done
4387 fi
4388
4389         fi
4390 fi
4391
4392 cf_cv_screen=curses
4393
4394 echo "$as_me:4394: checking for specified curses library type" >&5
4395 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4396
4397 # Check whether --with-ncursesw or --without-ncursesw was given.
4398 if test "${with_ncursesw+set}" = set; then
4399   withval="$with_ncursesw"
4400   cf_cv_screen=ncursesw
4401 else
4402
4403 # Check whether --with-ncurses or --without-ncurses was given.
4404 if test "${with_ncurses+set}" = set; then
4405   withval="$with_ncurses"
4406   cf_cv_screen=ncurses
4407 else
4408
4409 # Check whether --with-pdcurses or --without-pdcurses was given.
4410 if test "${with_pdcurses+set}" = set; then
4411   withval="$with_pdcurses"
4412   cf_cv_screen=pdcurses
4413 else
4414
4415 # Check whether --with-curses-colr or --without-curses-colr was given.
4416 if test "${with_curses_colr+set}" = set; then
4417   withval="$with_curses_colr"
4418   cf_cv_screen=curses_colr
4419 else
4420
4421 # Check whether --with-curses-5lib or --without-curses-5lib was given.
4422 if test "${with_curses_5lib+set}" = set; then
4423   withval="$with_curses_5lib"
4424   cf_cv_screen=curses_5lib
4425 fi;
4426 fi;
4427 fi;
4428 fi;
4429 fi;
4430
4431 echo "$as_me:4431: result: $cf_cv_screen" >&5
4432 echo "${ECHO_T}$cf_cv_screen" >&6
4433
4434 case $cf_cv_screen in #(vi
4435 curses|curses_*) #(vi
4436
4437 echo "$as_me:4437: checking for extra include directories" >&5
4438 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4439 if test "${cf_cv_curses_incdir+set}" = set; then
4440   echo $ECHO_N "(cached) $ECHO_C" >&6
4441 else
4442
4443 cf_cv_curses_incdir=no
4444 case $host_os in #(vi
4445 hpux10.*) #(vi
4446         if test "x$cf_cv_screen" = "xcurses_colr"
4447         then
4448                 test -d /usr/include/curses_colr && \
4449                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
4450         fi
4451         ;;
4452 sunos3*|sunos4*)
4453         if test "x$cf_cv_screen" = "xcurses_5lib"
4454         then
4455                 test -d /usr/5lib && \
4456                 test -d /usr/5include && \
4457                 cf_cv_curses_incdir="-I/usr/5include"
4458         fi
4459         ;;
4460 esac
4461
4462 fi
4463 echo "$as_me:4463: result: $cf_cv_curses_incdir" >&5
4464 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4465 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4466
4467 echo "$as_me:4467: checking if we have identified curses headers" >&5
4468 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4469 if test "${cf_cv_ncurses_header+set}" = set; then
4470   echo $ECHO_N "(cached) $ECHO_C" >&6
4471 else
4472
4473 cf_cv_ncurses_header=none
4474 for cf_header in  \
4475         ncurses.h \
4476         curses.h ncurses/ncurses.h ncurses/curses.h
4477 do
4478 cat >conftest.$ac_ext <<_ACEOF
4479 #line 4479 "configure"
4480 #include "confdefs.h"
4481 #include <${cf_header}>
4482 int
4483 main ()
4484 {
4485 initscr(); tgoto("?", 0,0)
4486   ;
4487   return 0;
4488 }
4489 _ACEOF
4490 rm -f conftest.$ac_objext
4491 if { (eval echo "$as_me:4491: \"$ac_compile\"") >&5
4492   (eval $ac_compile) 2>&5
4493   ac_status=$?
4494   echo "$as_me:4494: \$? = $ac_status" >&5
4495   (exit $ac_status); } &&
4496          { ac_try='test -s conftest.$ac_objext'
4497   { (eval echo "$as_me:4497: \"$ac_try\"") >&5
4498   (eval $ac_try) 2>&5
4499   ac_status=$?
4500   echo "$as_me:4500: \$? = $ac_status" >&5
4501   (exit $ac_status); }; }; then
4502   cf_cv_ncurses_header=$cf_header; break
4503 else
4504   echo "$as_me: failed program was:" >&5
4505 cat conftest.$ac_ext >&5
4506 fi
4507 rm -f conftest.$ac_objext conftest.$ac_ext
4508 done
4509
4510 fi
4511 echo "$as_me:4511: result: $cf_cv_ncurses_header" >&5
4512 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4513
4514 if test "$cf_cv_ncurses_header" = none ; then
4515         { { echo "$as_me:4515: error: No curses header-files found" >&5
4516 echo "$as_me: error: No curses header-files found" >&2;}
4517    { (exit 1); exit 1; }; }
4518 fi
4519
4520 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4521
4522 for ac_header in $cf_cv_ncurses_header
4523 do
4524 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4525 echo "$as_me:4525: checking for $ac_header" >&5
4526 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4527 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4528   echo $ECHO_N "(cached) $ECHO_C" >&6
4529 else
4530   cat >conftest.$ac_ext <<_ACEOF
4531 #line 4531 "configure"
4532 #include "confdefs.h"
4533 #include <$ac_header>
4534 _ACEOF
4535 if { (eval echo "$as_me:4535: \"$ac_cpp conftest.$ac_ext\"") >&5
4536   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4537   ac_status=$?
4538   egrep -v '^ *\+' conftest.er1 >conftest.err
4539   rm -f conftest.er1
4540   cat conftest.err >&5
4541   echo "$as_me:4541: \$? = $ac_status" >&5
4542   (exit $ac_status); } >/dev/null; then
4543   if test -s conftest.err; then
4544     ac_cpp_err=$ac_c_preproc_warn_flag
4545   else
4546     ac_cpp_err=
4547   fi
4548 else
4549   ac_cpp_err=yes
4550 fi
4551 if test -z "$ac_cpp_err"; then
4552   eval "$as_ac_Header=yes"
4553 else
4554   echo "$as_me: failed program was:" >&5
4555   cat conftest.$ac_ext >&5
4556   eval "$as_ac_Header=no"
4557 fi
4558 rm -f conftest.err conftest.$ac_ext
4559 fi
4560 echo "$as_me:4560: result: `eval echo '${'$as_ac_Header'}'`" >&5
4561 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4562 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4563   cat >>confdefs.h <<EOF
4564 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4565 EOF
4566
4567 fi
4568 done
4569
4570 echo "$as_me:4570: checking for terminfo header" >&5
4571 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4572 if test "${cf_cv_term_header+set}" = set; then
4573   echo $ECHO_N "(cached) $ECHO_C" >&6
4574 else
4575
4576 case ${cf_cv_ncurses_header} in #(vi
4577 */ncurses.h|*/ncursesw.h) #(vi
4578         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4579         ;;
4580 *)
4581         cf_term_header=term.h
4582         ;;
4583 esac
4584
4585 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4586 do
4587 cat >conftest.$ac_ext <<_ACEOF
4588 #line 4588 "configure"
4589 #include "confdefs.h"
4590 #include <stdio.h>
4591 #include <${cf_cv_ncurses_header:-curses.h}>
4592 #include <$cf_test>
4593
4594 int
4595 main ()
4596 {
4597 int x = auto_left_margin
4598   ;
4599   return 0;
4600 }
4601 _ACEOF
4602 rm -f conftest.$ac_objext
4603 if { (eval echo "$as_me:4603: \"$ac_compile\"") >&5
4604   (eval $ac_compile) 2>&5
4605   ac_status=$?
4606   echo "$as_me:4606: \$? = $ac_status" >&5
4607   (exit $ac_status); } &&
4608          { ac_try='test -s conftest.$ac_objext'
4609   { (eval echo "$as_me:4609: \"$ac_try\"") >&5
4610   (eval $ac_try) 2>&5
4611   ac_status=$?
4612   echo "$as_me:4612: \$? = $ac_status" >&5
4613   (exit $ac_status); }; }; then
4614
4615         cf_cv_term_header="$cf_test"
4616 else
4617   echo "$as_me: failed program was:" >&5
4618 cat conftest.$ac_ext >&5
4619
4620         cf_cv_term_header=unknown
4621
4622 fi
4623 rm -f conftest.$ac_objext conftest.$ac_ext
4624         test "$cf_cv_term_header" != unknown && break
4625 done
4626
4627 fi
4628 echo "$as_me:4628: result: $cf_cv_term_header" >&5
4629 echo "${ECHO_T}$cf_cv_term_header" >&6
4630
4631 # Set definitions to allow ifdef'ing to accommodate subdirectories
4632
4633 case $cf_cv_term_header in # (vi
4634 *term.h)
4635
4636 cat >>confdefs.h <<\EOF
4637 #define HAVE_TERM_H 1
4638 EOF
4639
4640         ;;
4641 esac
4642
4643 case $cf_cv_term_header in # (vi
4644 ncurses/term.h) #(vi
4645
4646 cat >>confdefs.h <<\EOF
4647 #define HAVE_NCURSES_TERM_H 1
4648 EOF
4649
4650         ;;
4651 ncursesw/term.h)
4652
4653 cat >>confdefs.h <<\EOF
4654 #define HAVE_NCURSESW_TERM_H 1
4655 EOF
4656
4657         ;;
4658 esac
4659
4660 echo "$as_me:4660: checking for ncurses version" >&5
4661 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4662 if test "${cf_cv_ncurses_version+set}" = set; then
4663   echo $ECHO_N "(cached) $ECHO_C" >&6
4664 else
4665
4666         cf_cv_ncurses_version=no
4667         cf_tempfile=out$$
4668         rm -f $cf_tempfile
4669         if test "$cross_compiling" = yes; then
4670
4671         # This will not work if the preprocessor splits the line after the
4672         # Autoconf token.  The 'unproto' program does that.
4673         cat > conftest.$ac_ext <<EOF
4674 #include <${cf_cv_ncurses_header:-curses.h}>
4675 #undef Autoconf
4676 #ifdef NCURSES_VERSION
4677 Autoconf NCURSES_VERSION
4678 #else
4679 #ifdef __NCURSES_H
4680 Autoconf "old"
4681 #endif
4682 ;
4683 #endif
4684 EOF
4685         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4686         { (eval echo "$as_me:4686: \"$cf_try\"") >&5
4687   (eval $cf_try) 2>&5
4688   ac_status=$?
4689   echo "$as_me:4689: \$? = $ac_status" >&5
4690   (exit $ac_status); }
4691         if test -f conftest.out ; then
4692                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4693                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4694                 rm -f conftest.out
4695         fi
4696
4697 else
4698   cat >conftest.$ac_ext <<_ACEOF
4699 #line 4699 "configure"
4700 #include "confdefs.h"
4701
4702 #include <${cf_cv_ncurses_header:-curses.h}>
4703 #include <stdio.h>
4704 int main()
4705 {
4706         FILE *fp = fopen("$cf_tempfile", "w");
4707 #ifdef NCURSES_VERSION
4708 # ifdef NCURSES_VERSION_PATCH
4709         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4710 # else
4711         fprintf(fp, "%s\n", NCURSES_VERSION);
4712 # endif
4713 #else
4714 # ifdef __NCURSES_H
4715         fprintf(fp, "old\n");
4716 # else
4717         make an error
4718 # endif
4719 #endif
4720         ${cf_cv_main_return:-return}(0);
4721 }
4722 _ACEOF
4723 rm -f conftest$ac_exeext
4724 if { (eval echo "$as_me:4724: \"$ac_link\"") >&5
4725   (eval $ac_link) 2>&5
4726   ac_status=$?
4727   echo "$as_me:4727: \$? = $ac_status" >&5
4728   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4729   { (eval echo "$as_me:4729: \"$ac_try\"") >&5
4730   (eval $ac_try) 2>&5
4731   ac_status=$?
4732   echo "$as_me:4732: \$? = $ac_status" >&5
4733   (exit $ac_status); }; }; then
4734
4735         cf_cv_ncurses_version=`cat $cf_tempfile`
4736 else
4737   echo "$as_me: program exited with status $ac_status" >&5
4738 echo "$as_me: failed program was:" >&5
4739 cat conftest.$ac_ext >&5
4740 fi
4741 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4742 fi
4743         rm -f $cf_tempfile
4744
4745 fi
4746 echo "$as_me:4746: result: $cf_cv_ncurses_version" >&5
4747 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4748 test "$cf_cv_ncurses_version" = no ||
4749 cat >>confdefs.h <<\EOF
4750 #define NCURSES 1
4751 EOF
4752
4753 echo "$as_me:4753: checking if we have identified curses libraries" >&5
4754 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
4755 cat >conftest.$ac_ext <<_ACEOF
4756 #line 4756 "configure"
4757 #include "confdefs.h"
4758 #include <${cf_cv_ncurses_header:-curses.h}>
4759 int
4760 main ()
4761 {
4762 initscr(); tgoto("?", 0,0)
4763   ;
4764   return 0;
4765 }
4766 _ACEOF
4767 rm -f conftest.$ac_objext conftest$ac_exeext
4768 if { (eval echo "$as_me:4768: \"$ac_link\"") >&5
4769   (eval $ac_link) 2>&5
4770   ac_status=$?
4771   echo "$as_me:4771: \$? = $ac_status" >&5
4772   (exit $ac_status); } &&
4773          { ac_try='test -s conftest$ac_exeext'
4774   { (eval echo "$as_me:4774: \"$ac_try\"") >&5
4775   (eval $ac_try) 2>&5
4776   ac_status=$?
4777   echo "$as_me:4777: \$? = $ac_status" >&5
4778   (exit $ac_status); }; }; then
4779   cf_result=yes
4780 else
4781   echo "$as_me: failed program was:" >&5
4782 cat conftest.$ac_ext >&5
4783 cf_result=no
4784 fi
4785 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4786 echo "$as_me:4786: result: $cf_result" >&5
4787 echo "${ECHO_T}$cf_result" >&6
4788
4789 if test "$cf_result" = no ; then
4790 case $host_os in #(vi
4791 freebsd*) #(vi
4792     echo "$as_me:4792: checking for tgoto in -lmytinfo" >&5
4793 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4794 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4795   echo $ECHO_N "(cached) $ECHO_C" >&6
4796 else
4797   ac_check_lib_save_LIBS=$LIBS
4798 LIBS="-lmytinfo  $LIBS"
4799 cat >conftest.$ac_ext <<_ACEOF
4800 #line 4800 "configure"
4801 #include "confdefs.h"
4802
4803 /* Override any gcc2 internal prototype to avoid an error.  */
4804 #ifdef __cplusplus
4805 extern "C"
4806 #endif
4807 /* We use char because int might match the return type of a gcc2
4808    builtin and then its argument prototype would still apply.  */
4809 char tgoto ();
4810 int
4811 main ()
4812 {
4813 tgoto ();
4814   ;
4815   return 0;
4816 }
4817 _ACEOF
4818 rm -f conftest.$ac_objext conftest$ac_exeext
4819 if { (eval echo "$as_me:4819: \"$ac_link\"") >&5
4820   (eval $ac_link) 2>&5
4821   ac_status=$?
4822   echo "$as_me:4822: \$? = $ac_status" >&5
4823   (exit $ac_status); } &&
4824          { ac_try='test -s conftest$ac_exeext'
4825   { (eval echo "$as_me:4825: \"$ac_try\"") >&5
4826   (eval $ac_try) 2>&5
4827   ac_status=$?
4828   echo "$as_me:4828: \$? = $ac_status" >&5
4829   (exit $ac_status); }; }; then
4830   ac_cv_lib_mytinfo_tgoto=yes
4831 else
4832   echo "$as_me: failed program was:" >&5
4833 cat conftest.$ac_ext >&5
4834 ac_cv_lib_mytinfo_tgoto=no
4835 fi
4836 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4837 LIBS=$ac_check_lib_save_LIBS
4838 fi
4839 echo "$as_me:4839: result: $ac_cv_lib_mytinfo_tgoto" >&5
4840 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4841 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4842   LIBS="-lmytinfo $LIBS"
4843 fi
4844
4845     ;;
4846 hpux10.*) #(vi
4847         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
4848         # next (1998), and xcurses "newer" (2000).  There is no header file for
4849         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
4850         # term.h) for cur_colr
4851         if test "x$cf_cv_screen" = "xcurses_colr"
4852         then
4853                 echo "$as_me:4853: checking for initscr in -lcur_colr" >&5
4854 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
4855 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
4856   echo $ECHO_N "(cached) $ECHO_C" >&6
4857 else
4858   ac_check_lib_save_LIBS=$LIBS
4859 LIBS="-lcur_colr  $LIBS"
4860 cat >conftest.$ac_ext <<_ACEOF
4861 #line 4861 "configure"
4862 #include "confdefs.h"
4863
4864 /* Override any gcc2 internal prototype to avoid an error.  */
4865 #ifdef __cplusplus
4866 extern "C"
4867 #endif
4868 /* We use char because int might match the return type of a gcc2
4869    builtin and then its argument prototype would still apply.  */
4870 char initscr ();
4871 int
4872 main ()
4873 {
4874 initscr ();
4875   ;
4876   return 0;
4877 }
4878 _ACEOF
4879 rm -f conftest.$ac_objext conftest$ac_exeext
4880 if { (eval echo "$as_me:4880: \"$ac_link\"") >&5
4881   (eval $ac_link) 2>&5
4882   ac_status=$?
4883   echo "$as_me:4883: \$? = $ac_status" >&5
4884   (exit $ac_status); } &&
4885          { ac_try='test -s conftest$ac_exeext'
4886   { (eval echo "$as_me:4886: \"$ac_try\"") >&5
4887   (eval $ac_try) 2>&5
4888   ac_status=$?
4889   echo "$as_me:4889: \$? = $ac_status" >&5
4890   (exit $ac_status); }; }; then
4891   ac_cv_lib_cur_colr_initscr=yes
4892 else
4893   echo "$as_me: failed program was:" >&5
4894 cat conftest.$ac_ext >&5
4895 ac_cv_lib_cur_colr_initscr=no
4896 fi
4897 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4898 LIBS=$ac_check_lib_save_LIBS
4899 fi
4900 echo "$as_me:4900: result: $ac_cv_lib_cur_colr_initscr" >&5
4901 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
4902 if test $ac_cv_lib_cur_colr_initscr = yes; then
4903
4904                         LIBS="-lcur_colr $LIBS"
4905                         ac_cv_func_initscr=yes
4906
4907 else
4908
4909                 echo "$as_me:4909: checking for initscr in -lHcurses" >&5
4910 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
4911 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
4912   echo $ECHO_N "(cached) $ECHO_C" >&6
4913 else
4914   ac_check_lib_save_LIBS=$LIBS
4915 LIBS="-lHcurses  $LIBS"
4916 cat >conftest.$ac_ext <<_ACEOF
4917 #line 4917 "configure"
4918 #include "confdefs.h"
4919
4920 /* Override any gcc2 internal prototype to avoid an error.  */
4921 #ifdef __cplusplus
4922 extern "C"
4923 #endif
4924 /* We use char because int might match the return type of a gcc2
4925    builtin and then its argument prototype would still apply.  */
4926 char initscr ();
4927 int
4928 main ()
4929 {
4930 initscr ();
4931   ;
4932   return 0;
4933 }
4934 _ACEOF
4935 rm -f conftest.$ac_objext conftest$ac_exeext
4936 if { (eval echo "$as_me:4936: \"$ac_link\"") >&5
4937   (eval $ac_link) 2>&5
4938   ac_status=$?
4939   echo "$as_me:4939: \$? = $ac_status" >&5
4940   (exit $ac_status); } &&
4941          { ac_try='test -s conftest$ac_exeext'
4942   { (eval echo "$as_me:4942: \"$ac_try\"") >&5
4943   (eval $ac_try) 2>&5
4944   ac_status=$?
4945   echo "$as_me:4945: \$? = $ac_status" >&5
4946   (exit $ac_status); }; }; then
4947   ac_cv_lib_Hcurses_initscr=yes
4948 else
4949   echo "$as_me: failed program was:" >&5
4950 cat conftest.$ac_ext >&5
4951 ac_cv_lib_Hcurses_initscr=no
4952 fi
4953 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4954 LIBS=$ac_check_lib_save_LIBS
4955 fi
4956 echo "$as_me:4956: result: $ac_cv_lib_Hcurses_initscr" >&5
4957 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
4958 if test $ac_cv_lib_Hcurses_initscr = yes; then
4959
4960                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
4961                         LIBS="-lHcurses $LIBS"
4962                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
4963                         ac_cv_func_initscr=yes
4964
4965 fi
4966
4967 fi
4968
4969         fi
4970         ;;
4971 linux*)
4972         case `arch 2>/dev/null` in
4973         x86_64)
4974                 if test -d /lib64
4975                 then
4976
4977 if test -n "/lib64" ; then
4978   for cf_add_libdir in /lib64
4979   do
4980     if test $cf_add_libdir = /usr/lib ; then
4981       :
4982     elif test -d $cf_add_libdir
4983     then
4984       cf_have_libdir=no
4985       if test -n "$LDFLAGS$LIBS" ; then
4986         # a loop is needed to ensure we can add subdirs of existing dirs
4987         for cf_test_libdir in $LDFLAGS $LIBS ; do
4988           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4989             cf_have_libdir=yes; break
4990           fi
4991         done
4992       fi
4993       if test "$cf_have_libdir" = no ; then
4994         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4995
4996 echo "${as_me:-configure}:4996: testing adding $cf_add_libdir to library-path ..." 1>&5
4997
4998         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4999       fi
5000     fi
5001   done
5002 fi
5003
5004                 else
5005
5006 if test -n "/lib" ; then
5007   for cf_add_libdir in /lib
5008   do
5009     if test $cf_add_libdir = /usr/lib ; then
5010       :
5011     elif test -d $cf_add_libdir
5012     then
5013       cf_have_libdir=no
5014       if test -n "$LDFLAGS$LIBS" ; then
5015         # a loop is needed to ensure we can add subdirs of existing dirs
5016         for cf_test_libdir in $LDFLAGS $LIBS ; do
5017           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5018             cf_have_libdir=yes; break
5019           fi
5020         done
5021       fi
5022       if test "$cf_have_libdir" = no ; then
5023         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5024
5025 echo "${as_me:-configure}:5025: testing adding $cf_add_libdir to library-path ..." 1>&5
5026
5027         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5028       fi
5029     fi
5030   done
5031 fi
5032
5033                 fi
5034                 ;;
5035         *)
5036
5037 if test -n "/lib" ; then
5038   for cf_add_libdir in /lib
5039   do
5040     if test $cf_add_libdir = /usr/lib ; then
5041       :
5042     elif test -d $cf_add_libdir
5043     then
5044       cf_have_libdir=no
5045       if test -n "$LDFLAGS$LIBS" ; then
5046         # a loop is needed to ensure we can add subdirs of existing dirs
5047         for cf_test_libdir in $LDFLAGS $LIBS ; do
5048           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5049             cf_have_libdir=yes; break
5050           fi
5051         done
5052       fi
5053       if test "$cf_have_libdir" = no ; then
5054         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5055
5056 echo "${as_me:-configure}:5056: testing adding $cf_add_libdir to library-path ..." 1>&5
5057
5058         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5059       fi
5060     fi
5061   done
5062 fi
5063
5064                 ;;
5065         esac
5066         ;;
5067 sunos3*|sunos4*)
5068         if test "x$cf_cv_screen" = "xcurses_5lib"
5069         then
5070                 if test -d /usr/5lib ; then
5071
5072 if test -n "/usr/5lib" ; then
5073   for cf_add_libdir in /usr/5lib
5074   do
5075     if test $cf_add_libdir = /usr/lib ; then
5076       :
5077     elif test -d $cf_add_libdir
5078     then
5079       cf_have_libdir=no
5080       if test -n "$LDFLAGS$LIBS" ; then
5081         # a loop is needed to ensure we can add subdirs of existing dirs
5082         for cf_test_libdir in $LDFLAGS $LIBS ; do
5083           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5084             cf_have_libdir=yes; break
5085           fi
5086         done
5087       fi
5088       if test "$cf_have_libdir" = no ; then
5089         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5090
5091 echo "${as_me:-configure}:5091: testing adding $cf_add_libdir to library-path ..." 1>&5
5092
5093         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5094       fi
5095     fi
5096   done
5097 fi
5098
5099                         LIBS="-lcurses -ltermcap $LIBS"
5100                 fi
5101     fi
5102     ac_cv_func_initscr=yes
5103     ;;
5104 esac
5105
5106 if test ".$ac_cv_func_initscr" != .yes ; then
5107         cf_save_LIBS="$LIBS"
5108
5109         if test ".${cf_cv_ncurses_version:-no}" != .no
5110         then
5111                 cf_check_list="ncurses curses cursesX"
5112         else
5113                 cf_check_list="cursesX curses ncurses"
5114         fi
5115
5116         # Check for library containing tgoto.  Do this before curses library
5117         # because it may be needed to link the test-case for initscr.
5118         if test "x$cf_term_lib" = x
5119         then
5120                 echo "$as_me:5120: checking for tgoto" >&5
5121 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5122 if test "${ac_cv_func_tgoto+set}" = set; then
5123   echo $ECHO_N "(cached) $ECHO_C" >&6
5124 else
5125   cat >conftest.$ac_ext <<_ACEOF
5126 #line 5126 "configure"
5127 #include "confdefs.h"
5128 /* System header to define __stub macros and hopefully few prototypes,
5129     which can conflict with char tgoto (); below.  */
5130 #include <assert.h>
5131 /* Override any gcc2 internal prototype to avoid an error.  */
5132 #ifdef __cplusplus
5133 extern "C"
5134 #endif
5135 /* We use char because int might match the return type of a gcc2
5136    builtin and then its argument prototype would still apply.  */
5137 char tgoto ();
5138 char (*f) ();
5139
5140 int
5141 main ()
5142 {
5143 /* The GNU C library defines this for functions which it implements
5144     to always fail with ENOSYS.  Some functions are actually named
5145     something starting with __ and the normal name is an alias.  */
5146 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5147 choke me
5148 #else
5149 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5150 #endif
5151
5152   ;
5153   return 0;
5154 }
5155 _ACEOF
5156 rm -f conftest.$ac_objext conftest$ac_exeext
5157 if { (eval echo "$as_me:5157: \"$ac_link\"") >&5
5158   (eval $ac_link) 2>&5
5159   ac_status=$?
5160   echo "$as_me:5160: \$? = $ac_status" >&5
5161   (exit $ac_status); } &&
5162          { ac_try='test -s conftest$ac_exeext'
5163   { (eval echo "$as_me:5163: \"$ac_try\"") >&5
5164   (eval $ac_try) 2>&5
5165   ac_status=$?
5166   echo "$as_me:5166: \$? = $ac_status" >&5
5167   (exit $ac_status); }; }; then
5168   ac_cv_func_tgoto=yes
5169 else
5170   echo "$as_me: failed program was:" >&5
5171 cat conftest.$ac_ext >&5
5172 ac_cv_func_tgoto=no
5173 fi
5174 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5175 fi
5176 echo "$as_me:5176: result: $ac_cv_func_tgoto" >&5
5177 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5178 if test $ac_cv_func_tgoto = yes; then
5179   cf_term_lib=predefined
5180 else
5181
5182                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5183                         do
5184                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5185 echo "$as_me:5185: checking for tgoto in -l$cf_term_lib" >&5
5186 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5187 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5188   echo $ECHO_N "(cached) $ECHO_C" >&6
5189 else
5190   ac_check_lib_save_LIBS=$LIBS
5191 LIBS="-l$cf_term_lib  $LIBS"
5192 cat >conftest.$ac_ext <<_ACEOF
5193 #line 5193 "configure"
5194 #include "confdefs.h"
5195
5196 /* Override any gcc2 internal prototype to avoid an error.  */
5197 #ifdef __cplusplus
5198 extern "C"
5199 #endif
5200 /* We use char because int might match the return type of a gcc2
5201    builtin and then its argument prototype would still apply.  */
5202 char tgoto ();
5203 int
5204 main ()
5205 {
5206 tgoto ();
5207   ;
5208   return 0;
5209 }
5210 _ACEOF
5211 rm -f conftest.$ac_objext conftest$ac_exeext
5212 if { (eval echo "$as_me:5212: \"$ac_link\"") >&5
5213   (eval $ac_link) 2>&5
5214   ac_status=$?
5215   echo "$as_me:5215: \$? = $ac_status" >&5
5216   (exit $ac_status); } &&
5217          { ac_try='test -s conftest$ac_exeext'
5218   { (eval echo "$as_me:5218: \"$ac_try\"") >&5
5219   (eval $ac_try) 2>&5
5220   ac_status=$?
5221   echo "$as_me:5221: \$? = $ac_status" >&5
5222   (exit $ac_status); }; }; then
5223   eval "$as_ac_Lib=yes"
5224 else
5225   echo "$as_me: failed program was:" >&5
5226 cat conftest.$ac_ext >&5
5227 eval "$as_ac_Lib=no"
5228 fi
5229 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5230 LIBS=$ac_check_lib_save_LIBS
5231 fi
5232 echo "$as_me:5232: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5233 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5234 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5235   break
5236 fi
5237
5238                         done
5239
5240 fi
5241
5242         fi
5243
5244         # Check for library containing initscr
5245         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5246         if test "x$cf_curs_lib" = x
5247         then
5248                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5249                 do
5250                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5251 echo "$as_me:5251: checking for initscr in -l$cf_curs_lib" >&5
5252 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5253 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5254   echo $ECHO_N "(cached) $ECHO_C" >&6
5255 else
5256   ac_check_lib_save_LIBS=$LIBS
5257 LIBS="-l$cf_curs_lib  $LIBS"
5258 cat >conftest.$ac_ext <<_ACEOF
5259 #line 5259 "configure"
5260 #include "confdefs.h"
5261
5262 /* Override any gcc2 internal prototype to avoid an error.  */
5263 #ifdef __cplusplus
5264 extern "C"
5265 #endif
5266 /* We use char because int might match the return type of a gcc2
5267    builtin and then its argument prototype would still apply.  */
5268 char initscr ();
5269 int
5270 main ()
5271 {
5272 initscr ();
5273   ;
5274   return 0;
5275 }
5276 _ACEOF
5277 rm -f conftest.$ac_objext conftest$ac_exeext
5278 if { (eval echo "$as_me:5278: \"$ac_link\"") >&5
5279   (eval $ac_link) 2>&5
5280   ac_status=$?
5281   echo "$as_me:5281: \$? = $ac_status" >&5
5282   (exit $ac_status); } &&
5283          { ac_try='test -s conftest$ac_exeext'
5284   { (eval echo "$as_me:5284: \"$ac_try\"") >&5
5285   (eval $ac_try) 2>&5
5286   ac_status=$?
5287   echo "$as_me:5287: \$? = $ac_status" >&5
5288   (exit $ac_status); }; }; then
5289   eval "$as_ac_Lib=yes"
5290 else
5291   echo "$as_me: failed program was:" >&5
5292 cat conftest.$ac_ext >&5
5293 eval "$as_ac_Lib=no"
5294 fi
5295 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5296 LIBS=$ac_check_lib_save_LIBS
5297 fi
5298 echo "$as_me:5298: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5299 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5300 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5301   break
5302 fi
5303
5304                 done
5305         fi
5306         test $cf_curs_lib = unknown && { { echo "$as_me:5306: error: no curses library found" >&5
5307 echo "$as_me: error: no curses library found" >&2;}
5308    { (exit 1); exit 1; }; }
5309
5310         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5311         if test "$cf_term_lib" = unknown ; then
5312                 echo "$as_me:5312: checking if we can link with $cf_curs_lib library" >&5
5313 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5314                 cat >conftest.$ac_ext <<_ACEOF
5315 #line 5315 "configure"
5316 #include "confdefs.h"
5317 #include <${cf_cv_ncurses_header:-curses.h}>
5318 int
5319 main ()
5320 {
5321 initscr()
5322   ;
5323   return 0;
5324 }
5325 _ACEOF
5326 rm -f conftest.$ac_objext conftest$ac_exeext
5327 if { (eval echo "$as_me:5327: \"$ac_link\"") >&5
5328   (eval $ac_link) 2>&5
5329   ac_status=$?
5330   echo "$as_me:5330: \$? = $ac_status" >&5
5331   (exit $ac_status); } &&
5332          { ac_try='test -s conftest$ac_exeext'
5333   { (eval echo "$as_me:5333: \"$ac_try\"") >&5
5334   (eval $ac_try) 2>&5
5335   ac_status=$?
5336   echo "$as_me:5336: \$? = $ac_status" >&5
5337   (exit $ac_status); }; }; then
5338   cf_result=yes
5339 else
5340   echo "$as_me: failed program was:" >&5
5341 cat conftest.$ac_ext >&5
5342 cf_result=no
5343 fi
5344 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5345                 echo "$as_me:5345: result: $cf_result" >&5
5346 echo "${ECHO_T}$cf_result" >&6
5347                 test $cf_result = no && { { echo "$as_me:5347: error: Cannot link curses library" >&5
5348 echo "$as_me: error: Cannot link curses library" >&2;}
5349    { (exit 1); exit 1; }; }
5350         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5351                 :
5352         elif test "$cf_term_lib" != predefined ; then
5353                 echo "$as_me:5353: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5354 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5355                 cat >conftest.$ac_ext <<_ACEOF
5356 #line 5356 "configure"
5357 #include "confdefs.h"
5358 #include <${cf_cv_ncurses_header:-curses.h}>
5359 int
5360 main ()
5361 {
5362 initscr(); tgoto((char *)0, 0, 0);
5363   ;
5364   return 0;
5365 }
5366 _ACEOF
5367 rm -f conftest.$ac_objext conftest$ac_exeext
5368 if { (eval echo "$as_me:5368: \"$ac_link\"") >&5
5369   (eval $ac_link) 2>&5
5370   ac_status=$?
5371   echo "$as_me:5371: \$? = $ac_status" >&5
5372   (exit $ac_status); } &&
5373          { ac_try='test -s conftest$ac_exeext'
5374   { (eval echo "$as_me:5374: \"$ac_try\"") >&5
5375   (eval $ac_try) 2>&5
5376   ac_status=$?
5377   echo "$as_me:5377: \$? = $ac_status" >&5
5378   (exit $ac_status); }; }; then
5379   cf_result=no
5380 else
5381   echo "$as_me: failed program was:" >&5
5382 cat conftest.$ac_ext >&5
5383
5384                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5385                         cat >conftest.$ac_ext <<_ACEOF
5386 #line 5386 "configure"
5387 #include "confdefs.h"
5388 #include <${cf_cv_ncurses_header:-curses.h}>
5389 int
5390 main ()
5391 {
5392 initscr()
5393   ;
5394   return 0;
5395 }
5396 _ACEOF
5397 rm -f conftest.$ac_objext conftest$ac_exeext
5398 if { (eval echo "$as_me:5398: \"$ac_link\"") >&5
5399   (eval $ac_link) 2>&5
5400   ac_status=$?
5401   echo "$as_me:5401: \$? = $ac_status" >&5
5402   (exit $ac_status); } &&
5403          { ac_try='test -s conftest$ac_exeext'
5404   { (eval echo "$as_me:5404: \"$ac_try\"") >&5
5405   (eval $ac_try) 2>&5
5406   ac_status=$?
5407   echo "$as_me:5407: \$? = $ac_status" >&5
5408   (exit $ac_status); }; }; then
5409   cf_result=yes
5410 else
5411   echo "$as_me: failed program was:" >&5
5412 cat conftest.$ac_ext >&5
5413 cf_result=error
5414 fi
5415 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5416
5417 fi
5418 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5419                 echo "$as_me:5419: result: $cf_result" >&5
5420 echo "${ECHO_T}$cf_result" >&6
5421         fi
5422 fi
5423 fi
5424
5425         ;;
5426 ncurses) #(vi
5427
5428 cf_ncuconfig_root=ncurses
5429
5430 echo "Looking for ${cf_ncuconfig_root}-config"
5431
5432 if test -n "$ac_tool_prefix"; then
5433   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5434   do
5435     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5436 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5437 echo "$as_me:5437: checking for $ac_word" >&5
5438 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5439 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5440   echo $ECHO_N "(cached) $ECHO_C" >&6
5441 else
5442   if test -n "$NCURSES_CONFIG"; then
5443   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5444 else
5445   ac_save_IFS=$IFS; IFS=$ac_path_separator
5446 ac_dummy="$PATH"
5447 for ac_dir in $ac_dummy; do
5448   IFS=$ac_save_IFS
5449   test -z "$ac_dir" && ac_dir=.
5450   $as_executable_p "$ac_dir/$ac_word" || continue
5451 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5452 echo "$as_me:5452: found $ac_dir/$ac_word" >&5
5453 break
5454 done
5455
5456 fi
5457 fi
5458 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5459 if test -n "$NCURSES_CONFIG"; then
5460   echo "$as_me:5460: result: $NCURSES_CONFIG" >&5
5461 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5462 else
5463   echo "$as_me:5463: result: no" >&5
5464 echo "${ECHO_T}no" >&6
5465 fi
5466
5467     test -n "$NCURSES_CONFIG" && break
5468   done
5469 fi
5470 if test -z "$NCURSES_CONFIG"; then
5471   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5472   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5473 do
5474   # Extract the first word of "$ac_prog", so it can be a program name with args.
5475 set dummy $ac_prog; ac_word=$2
5476 echo "$as_me:5476: checking for $ac_word" >&5
5477 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5478 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5479   echo $ECHO_N "(cached) $ECHO_C" >&6
5480 else
5481   if test -n "$ac_ct_NCURSES_CONFIG"; then
5482   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5483 else
5484   ac_save_IFS=$IFS; IFS=$ac_path_separator
5485 ac_dummy="$PATH"
5486 for ac_dir in $ac_dummy; do
5487   IFS=$ac_save_IFS
5488   test -z "$ac_dir" && ac_dir=.
5489   $as_executable_p "$ac_dir/$ac_word" || continue
5490 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5491 echo "$as_me:5491: found $ac_dir/$ac_word" >&5
5492 break
5493 done
5494
5495 fi
5496 fi
5497 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5498 if test -n "$ac_ct_NCURSES_CONFIG"; then
5499   echo "$as_me:5499: result: $ac_ct_NCURSES_CONFIG" >&5
5500 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5501 else
5502   echo "$as_me:5502: result: no" >&5
5503 echo "${ECHO_T}no" >&6
5504 fi
5505
5506   test -n "$ac_ct_NCURSES_CONFIG" && break
5507 done
5508 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5509
5510   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5511 fi
5512
5513 if test "$NCURSES_CONFIG" != none ; then
5514
5515 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5516 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
5517
5518 # even with config script, some packages use no-override for curses.h
5519
5520 echo "$as_me:5520: checking if we have identified curses headers" >&5
5521 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5522 if test "${cf_cv_ncurses_header+set}" = set; then
5523   echo $ECHO_N "(cached) $ECHO_C" >&6
5524 else
5525
5526 cf_cv_ncurses_header=none
5527 for cf_header in  \
5528     ncurses/ncurses.h \
5529         ncurses/curses.h \
5530         ncurses.h \
5531         curses.h
5532 do
5533 cat >conftest.$ac_ext <<_ACEOF
5534 #line 5534 "configure"
5535 #include "confdefs.h"
5536 #include <${cf_header}>
5537 int
5538 main ()
5539 {
5540 initscr(); tgoto("?", 0,0)
5541   ;
5542   return 0;
5543 }
5544 _ACEOF
5545 rm -f conftest.$ac_objext
5546 if { (eval echo "$as_me:5546: \"$ac_compile\"") >&5
5547   (eval $ac_compile) 2>&5
5548   ac_status=$?
5549   echo "$as_me:5549: \$? = $ac_status" >&5
5550   (exit $ac_status); } &&
5551          { ac_try='test -s conftest.$ac_objext'
5552   { (eval echo "$as_me:5552: \"$ac_try\"") >&5
5553   (eval $ac_try) 2>&5
5554   ac_status=$?
5555   echo "$as_me:5555: \$? = $ac_status" >&5
5556   (exit $ac_status); }; }; then
5557   cf_cv_ncurses_header=$cf_header; break
5558 else
5559   echo "$as_me: failed program was:" >&5
5560 cat conftest.$ac_ext >&5
5561 fi
5562 rm -f conftest.$ac_objext conftest.$ac_ext
5563 done
5564
5565 fi
5566 echo "$as_me:5566: result: $cf_cv_ncurses_header" >&5
5567 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5568
5569 if test "$cf_cv_ncurses_header" = none ; then
5570         { { echo "$as_me:5570: error: No curses header-files found" >&5
5571 echo "$as_me: error: No curses header-files found" >&2;}
5572    { (exit 1); exit 1; }; }
5573 fi
5574
5575 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5576
5577 for ac_header in $cf_cv_ncurses_header
5578 do
5579 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5580 echo "$as_me:5580: checking for $ac_header" >&5
5581 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5582 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5583   echo $ECHO_N "(cached) $ECHO_C" >&6
5584 else
5585   cat >conftest.$ac_ext <<_ACEOF
5586 #line 5586 "configure"
5587 #include "confdefs.h"
5588 #include <$ac_header>
5589 _ACEOF
5590 if { (eval echo "$as_me:5590: \"$ac_cpp conftest.$ac_ext\"") >&5
5591   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5592   ac_status=$?
5593   egrep -v '^ *\+' conftest.er1 >conftest.err
5594   rm -f conftest.er1
5595   cat conftest.err >&5
5596   echo "$as_me:5596: \$? = $ac_status" >&5
5597   (exit $ac_status); } >/dev/null; then
5598   if test -s conftest.err; then
5599     ac_cpp_err=$ac_c_preproc_warn_flag
5600   else
5601     ac_cpp_err=
5602   fi
5603 else
5604   ac_cpp_err=yes
5605 fi
5606 if test -z "$ac_cpp_err"; then
5607   eval "$as_ac_Header=yes"
5608 else
5609   echo "$as_me: failed program was:" >&5
5610   cat conftest.$ac_ext >&5
5611   eval "$as_ac_Header=no"
5612 fi
5613 rm -f conftest.err conftest.$ac_ext
5614 fi
5615 echo "$as_me:5615: result: `eval echo '${'$as_ac_Header'}'`" >&5
5616 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5617 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5618   cat >>confdefs.h <<EOF
5619 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5620 EOF
5621
5622 fi
5623 done
5624
5625 cat >>confdefs.h <<\EOF
5626 #define NCURSES 1
5627 EOF
5628
5629 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5630
5631 cat >>confdefs.h <<EOF
5632 #define $cf_nculib_ROOT 1
5633 EOF
5634
5635 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5636
5637 else
5638
5639 cf_ncuhdr_root=ncurses
5640
5641 test -n "$cf_cv_curses_dir" && \
5642 test "$cf_cv_curses_dir" != "no" && { \
5643
5644 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5645   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5646   do
5647         while test $cf_add_incdir != /usr/include
5648         do
5649           if test -d $cf_add_incdir
5650           then
5651                 cf_have_incdir=no
5652                 if test -n "$CFLAGS$CPPFLAGS" ; then
5653                   # a loop is needed to ensure we can add subdirs of existing dirs
5654                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5655                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5656                           cf_have_incdir=yes; break
5657                         fi
5658                   done
5659                 fi
5660
5661                 if test "$cf_have_incdir" = no ; then
5662                   if test "$cf_add_incdir" = /usr/local/include ; then
5663                         if test "$GCC" = yes
5664                         then
5665                           cf_save_CPPFLAGS=$CPPFLAGS
5666                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5667                           cat >conftest.$ac_ext <<_ACEOF
5668 #line 5668 "configure"
5669 #include "confdefs.h"
5670 #include <stdio.h>
5671 int
5672 main ()
5673 {
5674 printf("Hello")
5675   ;
5676   return 0;
5677 }
5678 _ACEOF
5679 rm -f conftest.$ac_objext
5680 if { (eval echo "$as_me:5680: \"$ac_compile\"") >&5
5681   (eval $ac_compile) 2>&5
5682   ac_status=$?
5683   echo "$as_me:5683: \$? = $ac_status" >&5
5684   (exit $ac_status); } &&
5685          { ac_try='test -s conftest.$ac_objext'
5686   { (eval echo "$as_me:5686: \"$ac_try\"") >&5
5687   (eval $ac_try) 2>&5
5688   ac_status=$?
5689   echo "$as_me:5689: \$? = $ac_status" >&5
5690   (exit $ac_status); }; }; then
5691   :
5692 else
5693   echo "$as_me: failed program was:" >&5
5694 cat conftest.$ac_ext >&5
5695 cf_have_incdir=yes
5696 fi
5697 rm -f conftest.$ac_objext conftest.$ac_ext
5698                           CPPFLAGS=$cf_save_CPPFLAGS
5699                         fi
5700                   fi
5701                 fi
5702
5703                 if test "$cf_have_incdir" = no ; then
5704                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5705
5706 echo "${as_me:-configure}:5706: testing adding $cf_add_incdir to include-path ..." 1>&5
5707
5708                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5709
5710                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5711                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5712                   cf_add_incdir="$cf_top_incdir"
5713                 else
5714                   break
5715                 fi
5716           fi
5717         done
5718   done
5719 fi
5720
5721 }
5722
5723 echo "$as_me:5723: checking for $cf_ncuhdr_root header in include-path" >&5
5724 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5725 if test "${cf_cv_ncurses_h+set}" = set; then
5726   echo $ECHO_N "(cached) $ECHO_C" >&6
5727 else
5728
5729         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5730         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5731         for cf_header in $cf_header_list
5732         do
5733
5734         cat >conftest.$ac_ext <<_ACEOF
5735 #line 5735 "configure"
5736 #include "confdefs.h"
5737
5738 #include <$cf_header>
5739 int
5740 main ()
5741 {
5742
5743 #ifdef NCURSES_VERSION
5744
5745 printf("%s\n", NCURSES_VERSION);
5746 #else
5747 #ifdef __NCURSES_H
5748 printf("old\n");
5749 #else
5750         make an error
5751 #endif
5752 #endif
5753
5754   ;
5755   return 0;
5756 }
5757 _ACEOF
5758 rm -f conftest.$ac_objext
5759 if { (eval echo "$as_me:5759: \"$ac_compile\"") >&5
5760   (eval $ac_compile) 2>&5
5761   ac_status=$?
5762   echo "$as_me:5762: \$? = $ac_status" >&5
5763   (exit $ac_status); } &&
5764          { ac_try='test -s conftest.$ac_objext'
5765   { (eval echo "$as_me:5765: \"$ac_try\"") >&5
5766   (eval $ac_try) 2>&5
5767   ac_status=$?
5768   echo "$as_me:5768: \$? = $ac_status" >&5
5769   (exit $ac_status); }; }; then
5770   cf_cv_ncurses_h=$cf_header
5771
5772 else
5773   echo "$as_me: failed program was:" >&5
5774 cat conftest.$ac_ext >&5
5775 cf_cv_ncurses_h=no
5776 fi
5777 rm -f conftest.$ac_objext conftest.$ac_ext
5778
5779                 test "$cf_cv_ncurses_h" != no && break
5780         done
5781
5782 fi
5783 echo "$as_me:5783: result: $cf_cv_ncurses_h" >&5
5784 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5785
5786 if test "$cf_cv_ncurses_h" != no ; then
5787         cf_cv_ncurses_header=$cf_cv_ncurses_h
5788 else
5789
5790 echo "$as_me:5790: checking for $cf_ncuhdr_root include-path" >&5
5791 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5792 if test "${cf_cv_ncurses_h2+set}" = set; then
5793   echo $ECHO_N "(cached) $ECHO_C" >&6
5794 else
5795
5796         test -n "$verbose" && echo
5797
5798 cf_search=
5799
5800 # collect the current set of include-directories from compiler flags
5801 cf_header_path_list=""
5802 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5803         for cf_header_path in $CPPFLAGS $CFLAGS
5804         do
5805                 case $cf_header_path in #(vi
5806                 -I*)
5807                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5808
5809 test "x$cf_header_path" != "xNONE" && \
5810 test -d "$cf_header_path" && \
5811  {
5812         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5813         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5814         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5815         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5816         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5817         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"
5818 }
5819
5820                         cf_header_path_list="$cf_header_path_list $cf_search"
5821                         ;;
5822                 esac
5823         done
5824 fi
5825
5826 # add the variations for the package we are looking for
5827
5828 cf_search=
5829
5830 test "x/usr" != "x$prefix" && \
5831 test -d "/usr" && \
5832 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
5833         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
5834         test -d /usr/include &&          cf_search="$cf_search /usr/include"
5835         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
5836         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
5837         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
5838         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5839 }
5840
5841 test "x$prefix" != "xNONE" && \
5842 test -d "$prefix" && \
5843  {
5844         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5845         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5846         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5847         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5848         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5849         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5850 }
5851
5852 test "x/usr/local" != "x$prefix" && \
5853 test -d "/usr/local" && \
5854 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
5855         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
5856         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
5857         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
5858         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
5859         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
5860         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5861 }
5862
5863 test "x/opt" != "x$prefix" && \
5864 test -d "/opt" && \
5865 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
5866         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
5867         test -d /opt/include &&          cf_search="$cf_search /opt/include"
5868         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
5869         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
5870         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
5871         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5872 }
5873
5874 test "x$HOME" != "x$prefix" && \
5875 test -d "$HOME" && \
5876 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
5877         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
5878         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
5879         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
5880         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
5881         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
5882         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5883 }
5884
5885 test "$includedir" != NONE && \
5886 test "$includedir" != "/usr/include" && \
5887 test -d "$includedir" && {
5888         test -d $includedir &&    cf_search="$cf_search $includedir"
5889         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5890 }
5891
5892 test "$oldincludedir" != NONE && \
5893 test "$oldincludedir" != "/usr/include" && \
5894 test -d "$oldincludedir" && {
5895         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5896         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5897 }
5898
5899 cf_search="$cf_search $cf_header_path_list"
5900
5901         test -n "$verbose" && echo search path $cf_search
5902         cf_save2_CPPFLAGS="$CPPFLAGS"
5903         for cf_incdir in $cf_search
5904         do
5905
5906 if test -n "$cf_incdir" ; then
5907   for cf_add_incdir in $cf_incdir
5908   do
5909         while test $cf_add_incdir != /usr/include
5910         do
5911           if test -d $cf_add_incdir
5912           then
5913                 cf_have_incdir=no
5914                 if test -n "$CFLAGS$CPPFLAGS" ; then
5915                   # a loop is needed to ensure we can add subdirs of existing dirs
5916                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5917                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5918                           cf_have_incdir=yes; break
5919                         fi
5920                   done
5921                 fi
5922
5923                 if test "$cf_have_incdir" = no ; then
5924                   if test "$cf_add_incdir" = /usr/local/include ; then
5925                         if test "$GCC" = yes
5926                         then
5927                           cf_save_CPPFLAGS=$CPPFLAGS
5928                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5929                           cat >conftest.$ac_ext <<_ACEOF
5930 #line 5930 "configure"
5931 #include "confdefs.h"
5932 #include <stdio.h>
5933 int
5934 main ()
5935 {
5936 printf("Hello")
5937   ;
5938   return 0;
5939 }
5940 _ACEOF
5941 rm -f conftest.$ac_objext
5942 if { (eval echo "$as_me:5942: \"$ac_compile\"") >&5
5943   (eval $ac_compile) 2>&5
5944   ac_status=$?
5945   echo "$as_me:5945: \$? = $ac_status" >&5
5946   (exit $ac_status); } &&
5947          { ac_try='test -s conftest.$ac_objext'
5948   { (eval echo "$as_me:5948: \"$ac_try\"") >&5
5949   (eval $ac_try) 2>&5
5950   ac_status=$?
5951   echo "$as_me:5951: \$? = $ac_status" >&5
5952   (exit $ac_status); }; }; then
5953   :
5954 else
5955   echo "$as_me: failed program was:" >&5
5956 cat conftest.$ac_ext >&5
5957 cf_have_incdir=yes
5958 fi
5959 rm -f conftest.$ac_objext conftest.$ac_ext
5960                           CPPFLAGS=$cf_save_CPPFLAGS
5961                         fi
5962                   fi
5963                 fi
5964
5965                 if test "$cf_have_incdir" = no ; then
5966                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5967
5968 echo "${as_me:-configure}:5968: testing adding $cf_add_incdir to include-path ..." 1>&5
5969
5970                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5971
5972                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5973                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5974                   cf_add_incdir="$cf_top_incdir"
5975                 else
5976                   break
5977                 fi
5978           fi
5979         done
5980   done
5981 fi
5982
5983                 for cf_header in \
5984                         ncurses.h \
5985                         curses.h
5986                 do
5987
5988         cat >conftest.$ac_ext <<_ACEOF
5989 #line 5989 "configure"
5990 #include "confdefs.h"
5991
5992 #include <$cf_header>
5993 int
5994 main ()
5995 {
5996
5997 #ifdef NCURSES_VERSION
5998
5999 printf("%s\n", NCURSES_VERSION);
6000 #else
6001 #ifdef __NCURSES_H
6002 printf("old\n");
6003 #else
6004         make an error
6005 #endif
6006 #endif
6007
6008   ;
6009   return 0;
6010 }
6011 _ACEOF
6012 rm -f conftest.$ac_objext
6013 if { (eval echo "$as_me:6013: \"$ac_compile\"") >&5
6014   (eval $ac_compile) 2>&5
6015   ac_status=$?
6016   echo "$as_me:6016: \$? = $ac_status" >&5
6017   (exit $ac_status); } &&
6018          { ac_try='test -s conftest.$ac_objext'
6019   { (eval echo "$as_me:6019: \"$ac_try\"") >&5
6020   (eval $ac_try) 2>&5
6021   ac_status=$?
6022   echo "$as_me:6022: \$? = $ac_status" >&5
6023   (exit $ac_status); }; }; then
6024   cf_cv_ncurses_h2=$cf_header
6025
6026 else
6027   echo "$as_me: failed program was:" >&5
6028 cat conftest.$ac_ext >&5
6029 cf_cv_ncurses_h2=no
6030 fi
6031 rm -f conftest.$ac_objext conftest.$ac_ext
6032
6033                         if test "$cf_cv_ncurses_h2" != no ; then
6034                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6035                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6036                                 break
6037                         fi
6038                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6039                 done
6040                 CPPFLAGS="$cf_save2_CPPFLAGS"
6041                 test "$cf_cv_ncurses_h2" != no && break
6042         done
6043         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6043: error: not found" >&5
6044 echo "$as_me: error: not found" >&2;}
6045    { (exit 1); exit 1; }; }
6046
6047 fi
6048 echo "$as_me:6048: result: $cf_cv_ncurses_h2" >&5
6049 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6050
6051         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6052         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6053         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6054                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6055         fi
6056
6057 if test -n "$cf_1st_incdir" ; then
6058   for cf_add_incdir in $cf_1st_incdir
6059   do
6060         while test $cf_add_incdir != /usr/include
6061         do
6062           if test -d $cf_add_incdir
6063           then
6064                 cf_have_incdir=no
6065                 if test -n "$CFLAGS$CPPFLAGS" ; then
6066                   # a loop is needed to ensure we can add subdirs of existing dirs
6067                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6068                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6069                           cf_have_incdir=yes; break
6070                         fi
6071                   done
6072                 fi
6073
6074                 if test "$cf_have_incdir" = no ; then
6075                   if test "$cf_add_incdir" = /usr/local/include ; then
6076                         if test "$GCC" = yes
6077                         then
6078                           cf_save_CPPFLAGS=$CPPFLAGS
6079                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6080                           cat >conftest.$ac_ext <<_ACEOF
6081 #line 6081 "configure"
6082 #include "confdefs.h"
6083 #include <stdio.h>
6084 int
6085 main ()
6086 {
6087 printf("Hello")
6088   ;
6089   return 0;
6090 }
6091 _ACEOF
6092 rm -f conftest.$ac_objext
6093 if { (eval echo "$as_me:6093: \"$ac_compile\"") >&5
6094   (eval $ac_compile) 2>&5
6095   ac_status=$?
6096   echo "$as_me:6096: \$? = $ac_status" >&5
6097   (exit $ac_status); } &&
6098          { ac_try='test -s conftest.$ac_objext'
6099   { (eval echo "$as_me:6099: \"$ac_try\"") >&5
6100   (eval $ac_try) 2>&5
6101   ac_status=$?
6102   echo "$as_me:6102: \$? = $ac_status" >&5
6103   (exit $ac_status); }; }; then
6104   :
6105 else
6106   echo "$as_me: failed program was:" >&5
6107 cat conftest.$ac_ext >&5
6108 cf_have_incdir=yes
6109 fi
6110 rm -f conftest.$ac_objext conftest.$ac_ext
6111                           CPPFLAGS=$cf_save_CPPFLAGS
6112                         fi
6113                   fi
6114                 fi
6115
6116                 if test "$cf_have_incdir" = no ; then
6117                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6118
6119 echo "${as_me:-configure}:6119: testing adding $cf_add_incdir to include-path ..." 1>&5
6120
6121                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6122
6123                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6124                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6125                   cf_add_incdir="$cf_top_incdir"
6126                 else
6127                   break
6128                 fi
6129           fi
6130         done
6131   done
6132 fi
6133
6134 fi
6135
6136 # Set definitions to allow ifdef'ing for ncurses.h
6137
6138 case $cf_cv_ncurses_header in # (vi
6139 *ncurses.h)
6140
6141 cat >>confdefs.h <<\EOF
6142 #define HAVE_NCURSES_H 1
6143 EOF
6144
6145         ;;
6146 esac
6147
6148 case $cf_cv_ncurses_header in # (vi
6149 ncurses/curses.h|ncurses/ncurses.h)
6150
6151 cat >>confdefs.h <<\EOF
6152 #define HAVE_NCURSES_NCURSES_H 1
6153 EOF
6154
6155         ;;
6156 ncursesw/curses.h|ncursesw/ncurses.h)
6157
6158 cat >>confdefs.h <<\EOF
6159 #define HAVE_NCURSESW_NCURSES_H 1
6160 EOF
6161
6162         ;;
6163 esac
6164
6165 echo "$as_me:6165: checking for terminfo header" >&5
6166 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6167 if test "${cf_cv_term_header+set}" = set; then
6168   echo $ECHO_N "(cached) $ECHO_C" >&6
6169 else
6170
6171 case ${cf_cv_ncurses_header} in #(vi
6172 */ncurses.h|*/ncursesw.h) #(vi
6173         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6174         ;;
6175 *)
6176         cf_term_header=term.h
6177         ;;
6178 esac
6179
6180 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6181 do
6182 cat >conftest.$ac_ext <<_ACEOF
6183 #line 6183 "configure"
6184 #include "confdefs.h"
6185 #include <stdio.h>
6186 #include <${cf_cv_ncurses_header:-curses.h}>
6187 #include <$cf_test>
6188
6189 int
6190 main ()
6191 {
6192 int x = auto_left_margin
6193   ;
6194   return 0;
6195 }
6196 _ACEOF
6197 rm -f conftest.$ac_objext
6198 if { (eval echo "$as_me:6198: \"$ac_compile\"") >&5
6199   (eval $ac_compile) 2>&5
6200   ac_status=$?
6201   echo "$as_me:6201: \$? = $ac_status" >&5
6202   (exit $ac_status); } &&
6203          { ac_try='test -s conftest.$ac_objext'
6204   { (eval echo "$as_me:6204: \"$ac_try\"") >&5
6205   (eval $ac_try) 2>&5
6206   ac_status=$?
6207   echo "$as_me:6207: \$? = $ac_status" >&5
6208   (exit $ac_status); }; }; then
6209
6210         cf_cv_term_header="$cf_test"
6211 else
6212   echo "$as_me: failed program was:" >&5
6213 cat conftest.$ac_ext >&5
6214
6215         cf_cv_term_header=unknown
6216
6217 fi
6218 rm -f conftest.$ac_objext conftest.$ac_ext
6219         test "$cf_cv_term_header" != unknown && break
6220 done
6221
6222 fi
6223 echo "$as_me:6223: result: $cf_cv_term_header" >&5
6224 echo "${ECHO_T}$cf_cv_term_header" >&6
6225
6226 # Set definitions to allow ifdef'ing to accommodate subdirectories
6227
6228 case $cf_cv_term_header in # (vi
6229 *term.h)
6230
6231 cat >>confdefs.h <<\EOF
6232 #define HAVE_TERM_H 1
6233 EOF
6234
6235         ;;
6236 esac
6237
6238 case $cf_cv_term_header in # (vi
6239 ncurses/term.h) #(vi
6240
6241 cat >>confdefs.h <<\EOF
6242 #define HAVE_NCURSES_TERM_H 1
6243 EOF
6244
6245         ;;
6246 ncursesw/term.h)
6247
6248 cat >>confdefs.h <<\EOF
6249 #define HAVE_NCURSESW_TERM_H 1
6250 EOF
6251
6252         ;;
6253 esac
6254
6255 # some applications need this, but should check for NCURSES_VERSION
6256
6257 cat >>confdefs.h <<\EOF
6258 #define NCURSES 1
6259 EOF
6260
6261 echo "$as_me:6261: checking for ncurses version" >&5
6262 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6263 if test "${cf_cv_ncurses_version+set}" = set; then
6264   echo $ECHO_N "(cached) $ECHO_C" >&6
6265 else
6266
6267         cf_cv_ncurses_version=no
6268         cf_tempfile=out$$
6269         rm -f $cf_tempfile
6270         if test "$cross_compiling" = yes; then
6271
6272         # This will not work if the preprocessor splits the line after the
6273         # Autoconf token.  The 'unproto' program does that.
6274         cat > conftest.$ac_ext <<EOF
6275 #include <${cf_cv_ncurses_header:-curses.h}>
6276 #undef Autoconf
6277 #ifdef NCURSES_VERSION
6278 Autoconf NCURSES_VERSION
6279 #else
6280 #ifdef __NCURSES_H
6281 Autoconf "old"
6282 #endif
6283 ;
6284 #endif
6285 EOF
6286         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6287         { (eval echo "$as_me:6287: \"$cf_try\"") >&5
6288   (eval $cf_try) 2>&5
6289   ac_status=$?
6290   echo "$as_me:6290: \$? = $ac_status" >&5
6291   (exit $ac_status); }
6292         if test -f conftest.out ; then
6293                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6294                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6295                 rm -f conftest.out
6296         fi
6297
6298 else
6299   cat >conftest.$ac_ext <<_ACEOF
6300 #line 6300 "configure"
6301 #include "confdefs.h"
6302
6303 #include <${cf_cv_ncurses_header:-curses.h}>
6304 #include <stdio.h>
6305 int main()
6306 {
6307         FILE *fp = fopen("$cf_tempfile", "w");
6308 #ifdef NCURSES_VERSION
6309 # ifdef NCURSES_VERSION_PATCH
6310         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6311 # else
6312         fprintf(fp, "%s\n", NCURSES_VERSION);
6313 # endif
6314 #else
6315 # ifdef __NCURSES_H
6316         fprintf(fp, "old\n");
6317 # else
6318         make an error
6319 # endif
6320 #endif
6321         ${cf_cv_main_return:-return}(0);
6322 }
6323 _ACEOF
6324 rm -f conftest$ac_exeext
6325 if { (eval echo "$as_me:6325: \"$ac_link\"") >&5
6326   (eval $ac_link) 2>&5
6327   ac_status=$?
6328   echo "$as_me:6328: \$? = $ac_status" >&5
6329   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6330   { (eval echo "$as_me:6330: \"$ac_try\"") >&5
6331   (eval $ac_try) 2>&5
6332   ac_status=$?
6333   echo "$as_me:6333: \$? = $ac_status" >&5
6334   (exit $ac_status); }; }; then
6335
6336         cf_cv_ncurses_version=`cat $cf_tempfile`
6337 else
6338   echo "$as_me: program exited with status $ac_status" >&5
6339 echo "$as_me: failed program was:" >&5
6340 cat conftest.$ac_ext >&5
6341 fi
6342 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6343 fi
6344         rm -f $cf_tempfile
6345
6346 fi
6347 echo "$as_me:6347: result: $cf_cv_ncurses_version" >&5
6348 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6349 test "$cf_cv_ncurses_version" = no ||
6350 cat >>confdefs.h <<\EOF
6351 #define NCURSES 1
6352 EOF
6353
6354 cf_nculib_root=ncurses
6355         # This works, except for the special case where we find gpm, but
6356         # ncurses is in a nonstandard location via $LIBS, and we really want
6357         # to link gpm.
6358 cf_ncurses_LIBS=""
6359 cf_ncurses_SAVE="$LIBS"
6360 echo "$as_me:6360: checking for Gpm_Open in -lgpm" >&5
6361 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6362 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6363   echo $ECHO_N "(cached) $ECHO_C" >&6
6364 else
6365   ac_check_lib_save_LIBS=$LIBS
6366 LIBS="-lgpm  $LIBS"
6367 cat >conftest.$ac_ext <<_ACEOF
6368 #line 6368 "configure"
6369 #include "confdefs.h"
6370
6371 /* Override any gcc2 internal prototype to avoid an error.  */
6372 #ifdef __cplusplus
6373 extern "C"
6374 #endif
6375 /* We use char because int might match the return type of a gcc2
6376    builtin and then its argument prototype would still apply.  */
6377 char Gpm_Open ();
6378 int
6379 main ()
6380 {
6381 Gpm_Open ();
6382   ;
6383   return 0;
6384 }
6385 _ACEOF
6386 rm -f conftest.$ac_objext conftest$ac_exeext
6387 if { (eval echo "$as_me:6387: \"$ac_link\"") >&5
6388   (eval $ac_link) 2>&5
6389   ac_status=$?
6390   echo "$as_me:6390: \$? = $ac_status" >&5
6391   (exit $ac_status); } &&
6392          { ac_try='test -s conftest$ac_exeext'
6393   { (eval echo "$as_me:6393: \"$ac_try\"") >&5
6394   (eval $ac_try) 2>&5
6395   ac_status=$?
6396   echo "$as_me:6396: \$? = $ac_status" >&5
6397   (exit $ac_status); }; }; then
6398   ac_cv_lib_gpm_Gpm_Open=yes
6399 else
6400   echo "$as_me: failed program was:" >&5
6401 cat conftest.$ac_ext >&5
6402 ac_cv_lib_gpm_Gpm_Open=no
6403 fi
6404 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6405 LIBS=$ac_check_lib_save_LIBS
6406 fi
6407 echo "$as_me:6407: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6408 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6409 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6410   echo "$as_me:6410: checking for initscr in -lgpm" >&5
6411 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6412 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6413   echo $ECHO_N "(cached) $ECHO_C" >&6
6414 else
6415   ac_check_lib_save_LIBS=$LIBS
6416 LIBS="-lgpm  $LIBS"
6417 cat >conftest.$ac_ext <<_ACEOF
6418 #line 6418 "configure"
6419 #include "confdefs.h"
6420
6421 /* Override any gcc2 internal prototype to avoid an error.  */
6422 #ifdef __cplusplus
6423 extern "C"
6424 #endif
6425 /* We use char because int might match the return type of a gcc2
6426    builtin and then its argument prototype would still apply.  */
6427 char initscr ();
6428 int
6429 main ()
6430 {
6431 initscr ();
6432   ;
6433   return 0;
6434 }
6435 _ACEOF
6436 rm -f conftest.$ac_objext conftest$ac_exeext
6437 if { (eval echo "$as_me:6437: \"$ac_link\"") >&5
6438   (eval $ac_link) 2>&5
6439   ac_status=$?
6440   echo "$as_me:6440: \$? = $ac_status" >&5
6441   (exit $ac_status); } &&
6442          { ac_try='test -s conftest$ac_exeext'
6443   { (eval echo "$as_me:6443: \"$ac_try\"") >&5
6444   (eval $ac_try) 2>&5
6445   ac_status=$?
6446   echo "$as_me:6446: \$? = $ac_status" >&5
6447   (exit $ac_status); }; }; then
6448   ac_cv_lib_gpm_initscr=yes
6449 else
6450   echo "$as_me: failed program was:" >&5
6451 cat conftest.$ac_ext >&5
6452 ac_cv_lib_gpm_initscr=no
6453 fi
6454 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6455 LIBS=$ac_check_lib_save_LIBS
6456 fi
6457 echo "$as_me:6457: result: $ac_cv_lib_gpm_initscr" >&5
6458 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6459 if test $ac_cv_lib_gpm_initscr = yes; then
6460   LIBS="$cf_ncurses_SAVE"
6461 else
6462   cf_ncurses_LIBS="-lgpm"
6463 fi
6464
6465 fi
6466
6467 case $host_os in #(vi
6468 freebsd*)
6469         # This is only necessary if you are linking against an obsolete
6470         # version of ncurses (but it should do no harm, since it's static).
6471         if test "$cf_nculib_root" = ncurses ; then
6472                 echo "$as_me:6472: checking for tgoto in -lmytinfo" >&5
6473 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6474 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6475   echo $ECHO_N "(cached) $ECHO_C" >&6
6476 else
6477   ac_check_lib_save_LIBS=$LIBS
6478 LIBS="-lmytinfo  $LIBS"
6479 cat >conftest.$ac_ext <<_ACEOF
6480 #line 6480 "configure"
6481 #include "confdefs.h"
6482
6483 /* Override any gcc2 internal prototype to avoid an error.  */
6484 #ifdef __cplusplus
6485 extern "C"
6486 #endif
6487 /* We use char because int might match the return type of a gcc2
6488    builtin and then its argument prototype would still apply.  */
6489 char tgoto ();
6490 int
6491 main ()
6492 {
6493 tgoto ();
6494   ;
6495   return 0;
6496 }
6497 _ACEOF
6498 rm -f conftest.$ac_objext conftest$ac_exeext
6499 if { (eval echo "$as_me:6499: \"$ac_link\"") >&5
6500   (eval $ac_link) 2>&5
6501   ac_status=$?
6502   echo "$as_me:6502: \$? = $ac_status" >&5
6503   (exit $ac_status); } &&
6504          { ac_try='test -s conftest$ac_exeext'
6505   { (eval echo "$as_me:6505: \"$ac_try\"") >&5
6506   (eval $ac_try) 2>&5
6507   ac_status=$?
6508   echo "$as_me:6508: \$? = $ac_status" >&5
6509   (exit $ac_status); }; }; then
6510   ac_cv_lib_mytinfo_tgoto=yes
6511 else
6512   echo "$as_me: failed program was:" >&5
6513 cat conftest.$ac_ext >&5
6514 ac_cv_lib_mytinfo_tgoto=no
6515 fi
6516 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6517 LIBS=$ac_check_lib_save_LIBS
6518 fi
6519 echo "$as_me:6519: result: $ac_cv_lib_mytinfo_tgoto" >&5
6520 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6521 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6522   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6523 fi
6524
6525         fi
6526         ;;
6527 esac
6528
6529 LIBS="$cf_ncurses_LIBS $LIBS"
6530
6531 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6532 then
6533         LIBS="-l$cf_nculib_root $LIBS"
6534 else
6535
6536         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6537         cf_libdir=""
6538         echo "$as_me:6538: checking for initscr" >&5
6539 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6540 if test "${ac_cv_func_initscr+set}" = set; then
6541   echo $ECHO_N "(cached) $ECHO_C" >&6
6542 else
6543   cat >conftest.$ac_ext <<_ACEOF
6544 #line 6544 "configure"
6545 #include "confdefs.h"
6546 /* System header to define __stub macros and hopefully few prototypes,
6547     which can conflict with char initscr (); below.  */
6548 #include <assert.h>
6549 /* Override any gcc2 internal prototype to avoid an error.  */
6550 #ifdef __cplusplus
6551 extern "C"
6552 #endif
6553 /* We use char because int might match the return type of a gcc2
6554    builtin and then its argument prototype would still apply.  */
6555 char initscr ();
6556 char (*f) ();
6557
6558 int
6559 main ()
6560 {
6561 /* The GNU C library defines this for functions which it implements
6562     to always fail with ENOSYS.  Some functions are actually named
6563     something starting with __ and the normal name is an alias.  */
6564 #if defined (__stub_initscr) || defined (__stub___initscr)
6565 choke me
6566 #else
6567 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6568 #endif
6569
6570   ;
6571   return 0;
6572 }
6573 _ACEOF
6574 rm -f conftest.$ac_objext conftest$ac_exeext
6575 if { (eval echo "$as_me:6575: \"$ac_link\"") >&5
6576   (eval $ac_link) 2>&5
6577   ac_status=$?
6578   echo "$as_me:6578: \$? = $ac_status" >&5
6579   (exit $ac_status); } &&
6580          { ac_try='test -s conftest$ac_exeext'
6581   { (eval echo "$as_me:6581: \"$ac_try\"") >&5
6582   (eval $ac_try) 2>&5
6583   ac_status=$?
6584   echo "$as_me:6584: \$? = $ac_status" >&5
6585   (exit $ac_status); }; }; then
6586   ac_cv_func_initscr=yes
6587 else
6588   echo "$as_me: failed program was:" >&5
6589 cat conftest.$ac_ext >&5
6590 ac_cv_func_initscr=no
6591 fi
6592 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6593 fi
6594 echo "$as_me:6594: result: $ac_cv_func_initscr" >&5
6595 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6596 if test $ac_cv_func_initscr = yes; then
6597   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6598 else
6599
6600                 cf_save_LIBS="$LIBS"
6601                 echo "$as_me:6601: checking for initscr in -l$cf_nculib_root" >&5
6602 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6603                 LIBS="-l$cf_nculib_root $LIBS"
6604                 cat >conftest.$ac_ext <<_ACEOF
6605 #line 6605 "configure"
6606 #include "confdefs.h"
6607 #include <${cf_cv_ncurses_header:-curses.h}>
6608 int
6609 main ()
6610 {
6611 initscr()
6612   ;
6613   return 0;
6614 }
6615 _ACEOF
6616 rm -f conftest.$ac_objext conftest$ac_exeext
6617 if { (eval echo "$as_me:6617: \"$ac_link\"") >&5
6618   (eval $ac_link) 2>&5
6619   ac_status=$?
6620   echo "$as_me:6620: \$? = $ac_status" >&5
6621   (exit $ac_status); } &&
6622          { ac_try='test -s conftest$ac_exeext'
6623   { (eval echo "$as_me:6623: \"$ac_try\"") >&5
6624   (eval $ac_try) 2>&5
6625   ac_status=$?
6626   echo "$as_me:6626: \$? = $ac_status" >&5
6627   (exit $ac_status); }; }; then
6628   echo "$as_me:6628: result: yes" >&5
6629 echo "${ECHO_T}yes" >&6
6630                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6631
6632 else
6633   echo "$as_me: failed program was:" >&5
6634 cat conftest.$ac_ext >&5
6635 echo "$as_me:6635: result: no" >&5
6636 echo "${ECHO_T}no" >&6
6637
6638 cf_search=
6639 cf_library_path_list=""
6640 if test -n "${LDFLAGS}${LIBS}" ; then
6641         for cf_library_path in $LDFLAGS $LIBS
6642         do
6643                 case $cf_library_path in #(vi
6644                 -L*)
6645                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6646
6647 test "x$cf_library_path" != "xNONE" && \
6648 test -d "$cf_library_path" && \
6649  {
6650         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6651         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6652         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6653         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6654         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6655         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"
6656 }
6657
6658                         cf_library_path_list="$cf_library_path_list $cf_search"
6659                         ;;
6660                 esac
6661         done
6662 fi
6663
6664 cf_search=
6665
6666 test "x/usr" != "x$prefix" && \
6667 test -d "/usr" && \
6668 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
6669         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6670         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6671         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
6672         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
6673         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
6674         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
6675 }
6676
6677 test "x$prefix" != "xNONE" && \
6678 test -d "$prefix" && \
6679  {
6680         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6681         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6682         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6683         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6684         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6685         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6686 }
6687
6688 test "x/usr/local" != "x$prefix" && \
6689 test -d "/usr/local" && \
6690 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
6691         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6692         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6693         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
6694         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
6695         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
6696         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
6697 }
6698
6699 test "x/opt" != "x$prefix" && \
6700 test -d "/opt" && \
6701 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
6702         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6703         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6704         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
6705         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
6706         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
6707         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
6708 }
6709
6710 test "x$HOME" != "x$prefix" && \
6711 test -d "$HOME" && \
6712 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
6713         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6714         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6715         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
6716         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
6717         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
6718         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
6719 }
6720
6721 cf_search="$cf_library_path_list $cf_search"
6722
6723                         for cf_libdir in $cf_search
6724                         do
6725                                 echo "$as_me:6725: checking for -l$cf_nculib_root in $cf_libdir" >&5
6726 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6727                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6728                                 cat >conftest.$ac_ext <<_ACEOF
6729 #line 6729 "configure"
6730 #include "confdefs.h"
6731 #include <${cf_cv_ncurses_header:-curses.h}>
6732 int
6733 main ()
6734 {
6735 initscr()
6736   ;
6737   return 0;
6738 }
6739 _ACEOF
6740 rm -f conftest.$ac_objext conftest$ac_exeext
6741 if { (eval echo "$as_me:6741: \"$ac_link\"") >&5
6742   (eval $ac_link) 2>&5
6743   ac_status=$?
6744   echo "$as_me:6744: \$? = $ac_status" >&5
6745   (exit $ac_status); } &&
6746          { ac_try='test -s conftest$ac_exeext'
6747   { (eval echo "$as_me:6747: \"$ac_try\"") >&5
6748   (eval $ac_try) 2>&5
6749   ac_status=$?
6750   echo "$as_me:6750: \$? = $ac_status" >&5
6751   (exit $ac_status); }; }; then
6752   echo "$as_me:6752: result: yes" >&5
6753 echo "${ECHO_T}yes" >&6
6754                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6755                                          break
6756 else
6757   echo "$as_me: failed program was:" >&5
6758 cat conftest.$ac_ext >&5
6759 echo "$as_me:6759: result: no" >&5
6760 echo "${ECHO_T}no" >&6
6761                                          LIBS="$cf_save_LIBS"
6762 fi
6763 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6764                         done
6765
6766 fi
6767 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6768
6769 fi
6770
6771 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6772
6773 if test $cf_found_library = no ; then
6774         { { echo "$as_me:6774: error: Cannot link $cf_nculib_root library" >&5
6775 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6776    { (exit 1); exit 1; }; }
6777 fi
6778
6779 fi
6780
6781 if test -n "$cf_ncurses_LIBS" ; then
6782         echo "$as_me:6782: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6783 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6784         cf_ncurses_SAVE="$LIBS"
6785         for p in $cf_ncurses_LIBS ; do
6786                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6787                 if test "$q" != "$LIBS" ; then
6788                         LIBS="$q"
6789                 fi
6790         done
6791         cat >conftest.$ac_ext <<_ACEOF
6792 #line 6792 "configure"
6793 #include "confdefs.h"
6794 #include <${cf_cv_ncurses_header:-curses.h}>
6795 int
6796 main ()
6797 {
6798 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6799   ;
6800   return 0;
6801 }
6802 _ACEOF
6803 rm -f conftest.$ac_objext conftest$ac_exeext
6804 if { (eval echo "$as_me:6804: \"$ac_link\"") >&5
6805   (eval $ac_link) 2>&5
6806   ac_status=$?
6807   echo "$as_me:6807: \$? = $ac_status" >&5
6808   (exit $ac_status); } &&
6809          { ac_try='test -s conftest$ac_exeext'
6810   { (eval echo "$as_me:6810: \"$ac_try\"") >&5
6811   (eval $ac_try) 2>&5
6812   ac_status=$?
6813   echo "$as_me:6813: \$? = $ac_status" >&5
6814   (exit $ac_status); }; }; then
6815   echo "$as_me:6815: result: yes" >&5
6816 echo "${ECHO_T}yes" >&6
6817 else
6818   echo "$as_me: failed program was:" >&5
6819 cat conftest.$ac_ext >&5
6820 echo "$as_me:6820: result: no" >&5
6821 echo "${ECHO_T}no" >&6
6822                  LIBS="$cf_ncurses_SAVE"
6823 fi
6824 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6825 fi
6826
6827 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6828
6829 cat >>confdefs.h <<EOF
6830 #define $cf_nculib_ROOT 1
6831 EOF
6832
6833 fi
6834
6835         ;;
6836 ncursesw) #(vi
6837
6838 echo "$as_me:6838: checking for multibyte character support" >&5
6839 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6840 if test "${cf_cv_utf8_lib+set}" = set; then
6841   echo $ECHO_N "(cached) $ECHO_C" >&6
6842 else
6843
6844         cf_save_LIBS="$LIBS"
6845         cat >conftest.$ac_ext <<_ACEOF
6846 #line 6846 "configure"
6847 #include "confdefs.h"
6848
6849 #include <stdlib.h>
6850 int
6851 main ()
6852 {
6853 putwc(0,0);
6854   ;
6855   return 0;
6856 }
6857 _ACEOF
6858 rm -f conftest.$ac_objext conftest$ac_exeext
6859 if { (eval echo "$as_me:6859: \"$ac_link\"") >&5
6860   (eval $ac_link) 2>&5
6861   ac_status=$?
6862   echo "$as_me:6862: \$? = $ac_status" >&5
6863   (exit $ac_status); } &&
6864          { ac_try='test -s conftest$ac_exeext'
6865   { (eval echo "$as_me:6865: \"$ac_try\"") >&5
6866   (eval $ac_try) 2>&5
6867   ac_status=$?
6868   echo "$as_me:6868: \$? = $ac_status" >&5
6869   (exit $ac_status); }; }; then
6870   cf_cv_utf8_lib=yes
6871 else
6872   echo "$as_me: failed program was:" >&5
6873 cat conftest.$ac_ext >&5
6874
6875 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6876 # will be set on completion of the AC_TRY_LINK below.
6877 cf_cv_header_path_utf8=
6878 cf_cv_library_path_utf8=
6879
6880 echo "${as_me:-configure}:6880: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6881
6882 cf_save_LIBS="$LIBS"
6883
6884 cat >conftest.$ac_ext <<_ACEOF
6885 #line 6885 "configure"
6886 #include "confdefs.h"
6887
6888 #include <libutf8.h>
6889 int
6890 main ()
6891 {
6892 putwc(0,0);
6893   ;
6894   return 0;
6895 }
6896 _ACEOF
6897 rm -f conftest.$ac_objext conftest$ac_exeext
6898 if { (eval echo "$as_me:6898: \"$ac_link\"") >&5
6899   (eval $ac_link) 2>&5
6900   ac_status=$?
6901   echo "$as_me:6901: \$? = $ac_status" >&5
6902   (exit $ac_status); } &&
6903          { ac_try='test -s conftest$ac_exeext'
6904   { (eval echo "$as_me:6904: \"$ac_try\"") >&5
6905   (eval $ac_try) 2>&5
6906   ac_status=$?
6907   echo "$as_me:6907: \$? = $ac_status" >&5
6908   (exit $ac_status); }; }; then
6909
6910         cf_cv_find_linkage_utf8=yes
6911         cf_cv_header_path_utf8=/usr/include
6912         cf_cv_library_path_utf8=/usr/lib
6913
6914 else
6915   echo "$as_me: failed program was:" >&5
6916 cat conftest.$ac_ext >&5
6917
6918 LIBS="-lutf8  $cf_save_LIBS"
6919
6920 cat >conftest.$ac_ext <<_ACEOF
6921 #line 6921 "configure"
6922 #include "confdefs.h"
6923
6924 #include <libutf8.h>
6925 int
6926 main ()
6927 {
6928 putwc(0,0);
6929   ;
6930   return 0;
6931 }
6932 _ACEOF
6933 rm -f conftest.$ac_objext conftest$ac_exeext
6934 if { (eval echo "$as_me:6934: \"$ac_link\"") >&5
6935   (eval $ac_link) 2>&5
6936   ac_status=$?
6937   echo "$as_me:6937: \$? = $ac_status" >&5
6938   (exit $ac_status); } &&
6939          { ac_try='test -s conftest$ac_exeext'
6940   { (eval echo "$as_me:6940: \"$ac_try\"") >&5
6941   (eval $ac_try) 2>&5
6942   ac_status=$?
6943   echo "$as_me:6943: \$? = $ac_status" >&5
6944   (exit $ac_status); }; }; then
6945
6946         cf_cv_find_linkage_utf8=yes
6947         cf_cv_header_path_utf8=/usr/include
6948         cf_cv_library_path_utf8=/usr/lib
6949         cf_cv_library_file_utf8="-lutf8"
6950
6951 else
6952   echo "$as_me: failed program was:" >&5
6953 cat conftest.$ac_ext >&5
6954
6955         cf_cv_find_linkage_utf8=no
6956         LIBS="$cf_save_LIBS"
6957
6958     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
6959
6960 echo "${as_me:-configure}:6960: testing find linkage for utf8 library ..." 1>&5
6961
6962 echo "${as_me:-configure}:6962: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6963
6964     cf_save_CPPFLAGS="$CPPFLAGS"
6965     cf_test_CPPFLAGS="$CPPFLAGS"
6966
6967 cf_search=
6968
6969 # collect the current set of include-directories from compiler flags
6970 cf_header_path_list=""
6971 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6972         for cf_header_path in $CPPFLAGS $CFLAGS
6973         do
6974                 case $cf_header_path in #(vi
6975                 -I*)
6976                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6977
6978 test "x$cf_header_path" != "xNONE" && \
6979 test -d "$cf_header_path" && \
6980  {
6981         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6982         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6983         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6984         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6985         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6986         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6987 }
6988
6989                         cf_header_path_list="$cf_header_path_list $cf_search"
6990                         ;;
6991                 esac
6992         done
6993 fi
6994
6995 # add the variations for the package we are looking for
6996
6997 cf_search=
6998
6999 test "x/usr" != "x$prefix" && \
7000 test -d "/usr" && \
7001 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
7002         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7003         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7004         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
7005         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
7006         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
7007         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
7008 }
7009
7010 test "x$prefix" != "xNONE" && \
7011 test -d "$prefix" && \
7012  {
7013         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7014         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7015         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7016         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7017         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7018         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7019 }
7020
7021 test "x/usr/local" != "x$prefix" && \
7022 test -d "/usr/local" && \
7023 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
7024         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
7025         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
7026         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
7027         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
7028         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
7029         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
7030 }
7031
7032 test "x/opt" != "x$prefix" && \
7033 test -d "/opt" && \
7034 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
7035         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
7036         test -d /opt/include &&          cf_search="$cf_search /opt/include"
7037         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
7038         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
7039         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
7040         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
7041 }
7042
7043 test "x$HOME" != "x$prefix" && \
7044 test -d "$HOME" && \
7045 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
7046         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
7047         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
7048         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
7049         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
7050         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
7051         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
7052 }
7053
7054 test "$includedir" != NONE && \
7055 test "$includedir" != "/usr/include" && \
7056 test -d "$includedir" && {
7057         test -d $includedir &&    cf_search="$cf_search $includedir"
7058         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7059 }
7060
7061 test "$oldincludedir" != NONE && \
7062 test "$oldincludedir" != "/usr/include" && \
7063 test -d "$oldincludedir" && {
7064         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7065         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7066 }
7067
7068 cf_search="$cf_search $cf_header_path_list"
7069
7070     for cf_cv_header_path_utf8 in $cf_search
7071     do
7072       if test -d $cf_cv_header_path_utf8 ; then
7073         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7074
7075 echo "${as_me:-configure}:7075: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7076
7077         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
7078         cat >conftest.$ac_ext <<_ACEOF
7079 #line 7079 "configure"
7080 #include "confdefs.h"
7081
7082 #include <libutf8.h>
7083 int
7084 main ()
7085 {
7086 putwc(0,0);
7087   ;
7088   return 0;
7089 }
7090 _ACEOF
7091 rm -f conftest.$ac_objext
7092 if { (eval echo "$as_me:7092: \"$ac_compile\"") >&5
7093   (eval $ac_compile) 2>&5
7094   ac_status=$?
7095   echo "$as_me:7095: \$? = $ac_status" >&5
7096   (exit $ac_status); } &&
7097          { ac_try='test -s conftest.$ac_objext'
7098   { (eval echo "$as_me:7098: \"$ac_try\"") >&5
7099   (eval $ac_try) 2>&5
7100   ac_status=$?
7101   echo "$as_me:7101: \$? = $ac_status" >&5
7102   (exit $ac_status); }; }; then
7103
7104             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7105
7106 echo "${as_me:-configure}:7106: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7107
7108             cf_cv_find_linkage_utf8=maybe
7109             cf_test_CPPFLAGS="$CPPFLAGS"
7110             break
7111 else
7112   echo "$as_me: failed program was:" >&5
7113 cat conftest.$ac_ext >&5
7114
7115             CPPFLAGS="$cf_save_CPPFLAGS"
7116
7117 fi
7118 rm -f conftest.$ac_objext conftest.$ac_ext
7119       fi
7120     done
7121
7122     if test "$cf_cv_find_linkage_utf8" = maybe ; then
7123
7124 echo "${as_me:-configure}:7124: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7125
7126       cf_save_LIBS="$LIBS"
7127       cf_save_LDFLAGS="$LDFLAGS"
7128
7129       if test "$cf_cv_find_linkage_utf8" != yes ; then
7130
7131 cf_search=
7132 cf_library_path_list=""
7133 if test -n "${LDFLAGS}${LIBS}" ; then
7134         for cf_library_path in $LDFLAGS $LIBS
7135         do
7136                 case $cf_library_path in #(vi
7137                 -L*)
7138                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7139
7140 test "x$cf_library_path" != "xNONE" && \
7141 test -d "$cf_library_path" && \
7142  {
7143         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7144         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7145         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7146         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7147         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7148         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7149 }
7150
7151                         cf_library_path_list="$cf_library_path_list $cf_search"
7152                         ;;
7153                 esac
7154         done
7155 fi
7156
7157 cf_search=
7158
7159 test "x/usr" != "x$prefix" && \
7160 test -d "/usr" && \
7161 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
7162         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7163         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7164         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
7165         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
7166         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
7167         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
7168 }
7169
7170 test "x$prefix" != "xNONE" && \
7171 test -d "$prefix" && \
7172  {
7173         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7174         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7175         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7176         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7177         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7178         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7179 }
7180
7181 test "x/usr/local" != "x$prefix" && \
7182 test -d "/usr/local" && \
7183 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
7184         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7185         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7186         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
7187         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
7188         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
7189         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
7190 }
7191
7192 test "x/opt" != "x$prefix" && \
7193 test -d "/opt" && \
7194 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
7195         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7196         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7197         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
7198         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
7199         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
7200         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
7201 }
7202
7203 test "x$HOME" != "x$prefix" && \
7204 test -d "$HOME" && \
7205 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
7206         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7207         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7208         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
7209         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
7210         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
7211         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
7212 }
7213
7214 cf_search="$cf_library_path_list $cf_search"
7215
7216         for cf_cv_library_path_utf8 in $cf_search
7217         do
7218           if test -d $cf_cv_library_path_utf8 ; then
7219             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
7220
7221 echo "${as_me:-configure}:7221: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7222
7223             CPPFLAGS="$cf_test_CPPFLAGS"
7224             LIBS="-lutf8  $cf_save_LIBS"
7225             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7226             cat >conftest.$ac_ext <<_ACEOF
7227 #line 7227 "configure"
7228 #include "confdefs.h"
7229
7230 #include <libutf8.h>
7231 int
7232 main ()
7233 {
7234 putwc(0,0);
7235   ;
7236   return 0;
7237 }
7238 _ACEOF
7239 rm -f conftest.$ac_objext conftest$ac_exeext
7240 if { (eval echo "$as_me:7240: \"$ac_link\"") >&5
7241   (eval $ac_link) 2>&5
7242   ac_status=$?
7243   echo "$as_me:7243: \$? = $ac_status" >&5
7244   (exit $ac_status); } &&
7245          { ac_try='test -s conftest$ac_exeext'
7246   { (eval echo "$as_me:7246: \"$ac_try\"") >&5
7247   (eval $ac_try) 2>&5
7248   ac_status=$?
7249   echo "$as_me:7249: \$? = $ac_status" >&5
7250   (exit $ac_status); }; }; then
7251
7252                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7253
7254 echo "${as_me:-configure}:7254: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7255
7256                 cf_cv_find_linkage_utf8=yes
7257                 cf_cv_library_file_utf8="-lutf8"
7258                 break
7259 else
7260   echo "$as_me: failed program was:" >&5
7261 cat conftest.$ac_ext >&5
7262
7263                 CPPFLAGS="$cf_save_CPPFLAGS"
7264                 LIBS="$cf_save_LIBS"
7265                 LDFLAGS="$cf_save_LDFLAGS"
7266
7267 fi
7268 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7269           fi
7270         done
7271         CPPFLAGS="$cf_save_CPPFLAGS"
7272         LDFLAGS="$cf_save_LDFLAGS"
7273       fi
7274
7275     else
7276       cf_cv_find_linkage_utf8=no
7277     fi
7278
7279 fi
7280 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7281
7282 fi
7283 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7284
7285 LIBS="$cf_save_LIBS"
7286
7287 if test "$cf_cv_find_linkage_utf8" = yes ; then
7288 cf_cv_utf8_lib=add-on
7289 else
7290 cf_cv_utf8_lib=no
7291 fi
7292
7293 fi
7294 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7295 fi
7296 echo "$as_me:7296: result: $cf_cv_utf8_lib" >&5
7297 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7298
7299 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7300 # ncurses/ncursesw:
7301 if test "$cf_cv_utf8_lib" = "add-on" ; then
7302
7303 cat >>confdefs.h <<\EOF
7304 #define HAVE_LIBUTF8_H 1
7305 EOF
7306
7307 if test -n "$cf_cv_header_path_utf8" ; then
7308   for cf_add_incdir in $cf_cv_header_path_utf8
7309   do
7310         while test $cf_add_incdir != /usr/include
7311         do
7312           if test -d $cf_add_incdir
7313           then
7314                 cf_have_incdir=no
7315                 if test -n "$CFLAGS$CPPFLAGS" ; then
7316                   # a loop is needed to ensure we can add subdirs of existing dirs
7317                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7318                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7319                           cf_have_incdir=yes; break
7320                         fi
7321                   done
7322                 fi
7323
7324                 if test "$cf_have_incdir" = no ; then
7325                   if test "$cf_add_incdir" = /usr/local/include ; then
7326                         if test "$GCC" = yes
7327                         then
7328                           cf_save_CPPFLAGS=$CPPFLAGS
7329                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7330                           cat >conftest.$ac_ext <<_ACEOF
7331 #line 7331 "configure"
7332 #include "confdefs.h"
7333 #include <stdio.h>
7334 int
7335 main ()
7336 {
7337 printf("Hello")
7338   ;
7339   return 0;
7340 }
7341 _ACEOF
7342 rm -f conftest.$ac_objext
7343 if { (eval echo "$as_me:7343: \"$ac_compile\"") >&5
7344   (eval $ac_compile) 2>&5
7345   ac_status=$?
7346   echo "$as_me:7346: \$? = $ac_status" >&5
7347   (exit $ac_status); } &&
7348          { ac_try='test -s conftest.$ac_objext'
7349   { (eval echo "$as_me:7349: \"$ac_try\"") >&5
7350   (eval $ac_try) 2>&5
7351   ac_status=$?
7352   echo "$as_me:7352: \$? = $ac_status" >&5
7353   (exit $ac_status); }; }; then
7354   :
7355 else
7356   echo "$as_me: failed program was:" >&5
7357 cat conftest.$ac_ext >&5
7358 cf_have_incdir=yes
7359 fi
7360 rm -f conftest.$ac_objext conftest.$ac_ext
7361                           CPPFLAGS=$cf_save_CPPFLAGS
7362                         fi
7363                   fi
7364                 fi
7365
7366                 if test "$cf_have_incdir" = no ; then
7367                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7368
7369 echo "${as_me:-configure}:7369: testing adding $cf_add_incdir to include-path ..." 1>&5
7370
7371                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7372
7373                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7374                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7375                   cf_add_incdir="$cf_top_incdir"
7376                 else
7377                   break
7378                 fi
7379           fi
7380         done
7381   done
7382 fi
7383
7384 if test -n "$cf_cv_library_path_utf8" ; then
7385   for cf_add_libdir in $cf_cv_library_path_utf8
7386   do
7387     if test $cf_add_libdir = /usr/lib ; then
7388       :
7389     elif test -d $cf_add_libdir
7390     then
7391       cf_have_libdir=no
7392       if test -n "$LDFLAGS$LIBS" ; then
7393         # a loop is needed to ensure we can add subdirs of existing dirs
7394         for cf_test_libdir in $LDFLAGS $LIBS ; do
7395           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7396             cf_have_libdir=yes; break
7397           fi
7398         done
7399       fi
7400       if test "$cf_have_libdir" = no ; then
7401         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7402
7403 echo "${as_me:-configure}:7403: testing adding $cf_add_libdir to library-path ..." 1>&5
7404
7405         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7406       fi
7407     fi
7408   done
7409 fi
7410
7411         LIBS="$cf_cv_library_file_utf8 $LIBS"
7412 fi
7413
7414 cf_ncuconfig_root=ncursesw
7415
7416 echo "Looking for ${cf_ncuconfig_root}-config"
7417
7418 if test -n "$ac_tool_prefix"; then
7419   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7420   do
7421     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7422 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7423 echo "$as_me:7423: checking for $ac_word" >&5
7424 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7425 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7426   echo $ECHO_N "(cached) $ECHO_C" >&6
7427 else
7428   if test -n "$NCURSES_CONFIG"; then
7429   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7430 else
7431   ac_save_IFS=$IFS; IFS=$ac_path_separator
7432 ac_dummy="$PATH"
7433 for ac_dir in $ac_dummy; do
7434   IFS=$ac_save_IFS
7435   test -z "$ac_dir" && ac_dir=.
7436   $as_executable_p "$ac_dir/$ac_word" || continue
7437 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7438 echo "$as_me:7438: found $ac_dir/$ac_word" >&5
7439 break
7440 done
7441
7442 fi
7443 fi
7444 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7445 if test -n "$NCURSES_CONFIG"; then
7446   echo "$as_me:7446: result: $NCURSES_CONFIG" >&5
7447 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7448 else
7449   echo "$as_me:7449: result: no" >&5
7450 echo "${ECHO_T}no" >&6
7451 fi
7452
7453     test -n "$NCURSES_CONFIG" && break
7454   done
7455 fi
7456 if test -z "$NCURSES_CONFIG"; then
7457   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7458   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7459 do
7460   # Extract the first word of "$ac_prog", so it can be a program name with args.
7461 set dummy $ac_prog; ac_word=$2
7462 echo "$as_me:7462: checking for $ac_word" >&5
7463 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7464 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7465   echo $ECHO_N "(cached) $ECHO_C" >&6
7466 else
7467   if test -n "$ac_ct_NCURSES_CONFIG"; then
7468   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7469 else
7470   ac_save_IFS=$IFS; IFS=$ac_path_separator
7471 ac_dummy="$PATH"
7472 for ac_dir in $ac_dummy; do
7473   IFS=$ac_save_IFS
7474   test -z "$ac_dir" && ac_dir=.
7475   $as_executable_p "$ac_dir/$ac_word" || continue
7476 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7477 echo "$as_me:7477: found $ac_dir/$ac_word" >&5
7478 break
7479 done
7480
7481 fi
7482 fi
7483 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7484 if test -n "$ac_ct_NCURSES_CONFIG"; then
7485   echo "$as_me:7485: result: $ac_ct_NCURSES_CONFIG" >&5
7486 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7487 else
7488   echo "$as_me:7488: result: no" >&5
7489 echo "${ECHO_T}no" >&6
7490 fi
7491
7492   test -n "$ac_ct_NCURSES_CONFIG" && break
7493 done
7494 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7495
7496   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7497 fi
7498
7499 if test "$NCURSES_CONFIG" != none ; then
7500
7501 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7502 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
7503
7504 # even with config script, some packages use no-override for curses.h
7505
7506 echo "$as_me:7506: checking if we have identified curses headers" >&5
7507 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7508 if test "${cf_cv_ncurses_header+set}" = set; then
7509   echo $ECHO_N "(cached) $ECHO_C" >&6
7510 else
7511
7512 cf_cv_ncurses_header=none
7513 for cf_header in  \
7514     ncursesw/ncurses.h \
7515         ncursesw/curses.h \
7516         ncurses.h \
7517         curses.h
7518 do
7519 cat >conftest.$ac_ext <<_ACEOF
7520 #line 7520 "configure"
7521 #include "confdefs.h"
7522 #include <${cf_header}>
7523 int
7524 main ()
7525 {
7526 initscr(); tgoto("?", 0,0)
7527   ;
7528   return 0;
7529 }
7530 _ACEOF
7531 rm -f conftest.$ac_objext
7532 if { (eval echo "$as_me:7532: \"$ac_compile\"") >&5
7533   (eval $ac_compile) 2>&5
7534   ac_status=$?
7535   echo "$as_me:7535: \$? = $ac_status" >&5
7536   (exit $ac_status); } &&
7537          { ac_try='test -s conftest.$ac_objext'
7538   { (eval echo "$as_me:7538: \"$ac_try\"") >&5
7539   (eval $ac_try) 2>&5
7540   ac_status=$?
7541   echo "$as_me:7541: \$? = $ac_status" >&5
7542   (exit $ac_status); }; }; then
7543   cf_cv_ncurses_header=$cf_header; break
7544 else
7545   echo "$as_me: failed program was:" >&5
7546 cat conftest.$ac_ext >&5
7547 fi
7548 rm -f conftest.$ac_objext conftest.$ac_ext
7549 done
7550
7551 fi
7552 echo "$as_me:7552: result: $cf_cv_ncurses_header" >&5
7553 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7554
7555 if test "$cf_cv_ncurses_header" = none ; then
7556         { { echo "$as_me:7556: error: No curses header-files found" >&5
7557 echo "$as_me: error: No curses header-files found" >&2;}
7558    { (exit 1); exit 1; }; }
7559 fi
7560
7561 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7562
7563 for ac_header in $cf_cv_ncurses_header
7564 do
7565 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7566 echo "$as_me:7566: checking for $ac_header" >&5
7567 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7568 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7569   echo $ECHO_N "(cached) $ECHO_C" >&6
7570 else
7571   cat >conftest.$ac_ext <<_ACEOF
7572 #line 7572 "configure"
7573 #include "confdefs.h"
7574 #include <$ac_header>
7575 _ACEOF
7576 if { (eval echo "$as_me:7576: \"$ac_cpp conftest.$ac_ext\"") >&5
7577   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7578   ac_status=$?
7579   egrep -v '^ *\+' conftest.er1 >conftest.err
7580   rm -f conftest.er1
7581   cat conftest.err >&5
7582   echo "$as_me:7582: \$? = $ac_status" >&5
7583   (exit $ac_status); } >/dev/null; then
7584   if test -s conftest.err; then
7585     ac_cpp_err=$ac_c_preproc_warn_flag
7586   else
7587     ac_cpp_err=
7588   fi
7589 else
7590   ac_cpp_err=yes
7591 fi
7592 if test -z "$ac_cpp_err"; then
7593   eval "$as_ac_Header=yes"
7594 else
7595   echo "$as_me: failed program was:" >&5
7596   cat conftest.$ac_ext >&5
7597   eval "$as_ac_Header=no"
7598 fi
7599 rm -f conftest.err conftest.$ac_ext
7600 fi
7601 echo "$as_me:7601: result: `eval echo '${'$as_ac_Header'}'`" >&5
7602 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7603 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7604   cat >>confdefs.h <<EOF
7605 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7606 EOF
7607
7608 fi
7609 done
7610
7611 cat >>confdefs.h <<\EOF
7612 #define NCURSES 1
7613 EOF
7614
7615 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7616
7617 cat >>confdefs.h <<EOF
7618 #define $cf_nculib_ROOT 1
7619 EOF
7620
7621 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7622
7623 else
7624
7625 cf_ncuhdr_root=ncursesw
7626
7627 test -n "$cf_cv_curses_dir" && \
7628 test "$cf_cv_curses_dir" != "no" && { \
7629
7630 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7631   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7632   do
7633         while test $cf_add_incdir != /usr/include
7634         do
7635           if test -d $cf_add_incdir
7636           then
7637                 cf_have_incdir=no
7638                 if test -n "$CFLAGS$CPPFLAGS" ; then
7639                   # a loop is needed to ensure we can add subdirs of existing dirs
7640                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7641                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7642                           cf_have_incdir=yes; break
7643                         fi
7644                   done
7645                 fi
7646
7647                 if test "$cf_have_incdir" = no ; then
7648                   if test "$cf_add_incdir" = /usr/local/include ; then
7649                         if test "$GCC" = yes
7650                         then
7651                           cf_save_CPPFLAGS=$CPPFLAGS
7652                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7653                           cat >conftest.$ac_ext <<_ACEOF
7654 #line 7654 "configure"
7655 #include "confdefs.h"
7656 #include <stdio.h>
7657 int
7658 main ()
7659 {
7660 printf("Hello")
7661   ;
7662   return 0;
7663 }
7664 _ACEOF
7665 rm -f conftest.$ac_objext
7666 if { (eval echo "$as_me:7666: \"$ac_compile\"") >&5
7667   (eval $ac_compile) 2>&5
7668   ac_status=$?
7669   echo "$as_me:7669: \$? = $ac_status" >&5
7670   (exit $ac_status); } &&
7671          { ac_try='test -s conftest.$ac_objext'
7672   { (eval echo "$as_me:7672: \"$ac_try\"") >&5
7673   (eval $ac_try) 2>&5
7674   ac_status=$?
7675   echo "$as_me:7675: \$? = $ac_status" >&5
7676   (exit $ac_status); }; }; then
7677   :
7678 else
7679   echo "$as_me: failed program was:" >&5
7680 cat conftest.$ac_ext >&5
7681 cf_have_incdir=yes
7682 fi
7683 rm -f conftest.$ac_objext conftest.$ac_ext
7684                           CPPFLAGS=$cf_save_CPPFLAGS
7685                         fi
7686                   fi
7687                 fi
7688
7689                 if test "$cf_have_incdir" = no ; then
7690                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7691
7692 echo "${as_me:-configure}:7692: testing adding $cf_add_incdir to include-path ..." 1>&5
7693
7694                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7695
7696                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7697                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7698                   cf_add_incdir="$cf_top_incdir"
7699                 else
7700                   break
7701                 fi
7702           fi
7703         done
7704   done
7705 fi
7706
7707 }
7708
7709 echo "$as_me:7709: checking for $cf_ncuhdr_root header in include-path" >&5
7710 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7711 if test "${cf_cv_ncurses_h+set}" = set; then
7712   echo $ECHO_N "(cached) $ECHO_C" >&6
7713 else
7714
7715         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7716         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7717         for cf_header in $cf_header_list
7718         do
7719
7720         cat >conftest.$ac_ext <<_ACEOF
7721 #line 7721 "configure"
7722 #include "confdefs.h"
7723
7724 #define _XOPEN_SOURCE_EXTENDED
7725 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7726 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7727
7728 #include <$cf_header>
7729 int
7730 main ()
7731 {
7732
7733 #ifdef NCURSES_VERSION
7734
7735 #ifndef WACS_BSSB
7736         make an error
7737 #endif
7738
7739 printf("%s\n", NCURSES_VERSION);
7740 #else
7741 #ifdef __NCURSES_H
7742 printf("old\n");
7743 #else
7744         make an error
7745 #endif
7746 #endif
7747
7748   ;
7749   return 0;
7750 }
7751 _ACEOF
7752 rm -f conftest.$ac_objext
7753 if { (eval echo "$as_me:7753: \"$ac_compile\"") >&5
7754   (eval $ac_compile) 2>&5
7755   ac_status=$?
7756   echo "$as_me:7756: \$? = $ac_status" >&5
7757   (exit $ac_status); } &&
7758          { ac_try='test -s conftest.$ac_objext'
7759   { (eval echo "$as_me:7759: \"$ac_try\"") >&5
7760   (eval $ac_try) 2>&5
7761   ac_status=$?
7762   echo "$as_me:7762: \$? = $ac_status" >&5
7763   (exit $ac_status); }; }; then
7764   cf_cv_ncurses_h=$cf_header
7765
7766 else
7767   echo "$as_me: failed program was:" >&5
7768 cat conftest.$ac_ext >&5
7769 cf_cv_ncurses_h=no
7770 fi
7771 rm -f conftest.$ac_objext conftest.$ac_ext
7772
7773                 test "$cf_cv_ncurses_h" != no && break
7774         done
7775
7776 fi
7777 echo "$as_me:7777: result: $cf_cv_ncurses_h" >&5
7778 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7779
7780 if test "$cf_cv_ncurses_h" != no ; then
7781         cf_cv_ncurses_header=$cf_cv_ncurses_h
7782 else
7783
7784 echo "$as_me:7784: checking for $cf_ncuhdr_root include-path" >&5
7785 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7786 if test "${cf_cv_ncurses_h2+set}" = set; then
7787   echo $ECHO_N "(cached) $ECHO_C" >&6
7788 else
7789
7790         test -n "$verbose" && echo
7791
7792 cf_search=
7793
7794 # collect the current set of include-directories from compiler flags
7795 cf_header_path_list=""
7796 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7797         for cf_header_path in $CPPFLAGS $CFLAGS
7798         do
7799                 case $cf_header_path in #(vi
7800                 -I*)
7801                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7802
7803 test "x$cf_header_path" != "xNONE" && \
7804 test -d "$cf_header_path" && \
7805  {
7806         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7807         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7808         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7809         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7810         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7811         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"
7812 }
7813
7814                         cf_header_path_list="$cf_header_path_list $cf_search"
7815                         ;;
7816                 esac
7817         done
7818 fi
7819
7820 # add the variations for the package we are looking for
7821
7822 cf_search=
7823
7824 test "x/usr" != "x$prefix" && \
7825 test -d "/usr" && \
7826 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
7827         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7828         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7829         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
7830         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
7831         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
7832         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7833 }
7834
7835 test "x$prefix" != "xNONE" && \
7836 test -d "$prefix" && \
7837  {
7838         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7839         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7840         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7841         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7842         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7843         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7844 }
7845
7846 test "x/usr/local" != "x$prefix" && \
7847 test -d "/usr/local" && \
7848 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
7849         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
7850         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
7851         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
7852         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
7853         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
7854         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7855 }
7856
7857 test "x/opt" != "x$prefix" && \
7858 test -d "/opt" && \
7859 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
7860         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
7861         test -d /opt/include &&          cf_search="$cf_search /opt/include"
7862         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
7863         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
7864         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
7865         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7866 }
7867
7868 test "x$HOME" != "x$prefix" && \
7869 test -d "$HOME" && \
7870 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
7871         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
7872         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
7873         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
7874         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
7875         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
7876         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7877 }
7878
7879 test "$includedir" != NONE && \
7880 test "$includedir" != "/usr/include" && \
7881 test -d "$includedir" && {
7882         test -d $includedir &&    cf_search="$cf_search $includedir"
7883         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7884 }
7885
7886 test "$oldincludedir" != NONE && \
7887 test "$oldincludedir" != "/usr/include" && \
7888 test -d "$oldincludedir" && {
7889         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7890         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7891 }
7892
7893 cf_search="$cf_search $cf_header_path_list"
7894
7895         test -n "$verbose" && echo search path $cf_search
7896         cf_save2_CPPFLAGS="$CPPFLAGS"
7897         for cf_incdir in $cf_search
7898         do
7899
7900 if test -n "$cf_incdir" ; then
7901   for cf_add_incdir in $cf_incdir
7902   do
7903         while test $cf_add_incdir != /usr/include
7904         do
7905           if test -d $cf_add_incdir
7906           then
7907                 cf_have_incdir=no
7908                 if test -n "$CFLAGS$CPPFLAGS" ; then
7909                   # a loop is needed to ensure we can add subdirs of existing dirs
7910                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7911                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7912                           cf_have_incdir=yes; break
7913                         fi
7914                   done
7915                 fi
7916
7917                 if test "$cf_have_incdir" = no ; then
7918                   if test "$cf_add_incdir" = /usr/local/include ; then
7919                         if test "$GCC" = yes
7920                         then
7921                           cf_save_CPPFLAGS=$CPPFLAGS
7922                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7923                           cat >conftest.$ac_ext <<_ACEOF
7924 #line 7924 "configure"
7925 #include "confdefs.h"
7926 #include <stdio.h>
7927 int
7928 main ()
7929 {
7930 printf("Hello")
7931   ;
7932   return 0;
7933 }
7934 _ACEOF
7935 rm -f conftest.$ac_objext
7936 if { (eval echo "$as_me:7936: \"$ac_compile\"") >&5
7937   (eval $ac_compile) 2>&5
7938   ac_status=$?
7939   echo "$as_me:7939: \$? = $ac_status" >&5
7940   (exit $ac_status); } &&
7941          { ac_try='test -s conftest.$ac_objext'
7942   { (eval echo "$as_me:7942: \"$ac_try\"") >&5
7943   (eval $ac_try) 2>&5
7944   ac_status=$?
7945   echo "$as_me:7945: \$? = $ac_status" >&5
7946   (exit $ac_status); }; }; then
7947   :
7948 else
7949   echo "$as_me: failed program was:" >&5
7950 cat conftest.$ac_ext >&5
7951 cf_have_incdir=yes
7952 fi
7953 rm -f conftest.$ac_objext conftest.$ac_ext
7954                           CPPFLAGS=$cf_save_CPPFLAGS
7955                         fi
7956                   fi
7957                 fi
7958
7959                 if test "$cf_have_incdir" = no ; then
7960                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7961
7962 echo "${as_me:-configure}:7962: testing adding $cf_add_incdir to include-path ..." 1>&5
7963
7964                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7965
7966                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7967                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7968                   cf_add_incdir="$cf_top_incdir"
7969                 else
7970                   break
7971                 fi
7972           fi
7973         done
7974   done
7975 fi
7976
7977                 for cf_header in \
7978                         ncurses.h \
7979                         curses.h
7980                 do
7981
7982         cat >conftest.$ac_ext <<_ACEOF
7983 #line 7983 "configure"
7984 #include "confdefs.h"
7985
7986 #include <$cf_header>
7987 int
7988 main ()
7989 {
7990
7991 #ifdef NCURSES_VERSION
7992
7993 printf("%s\n", NCURSES_VERSION);
7994 #else
7995 #ifdef __NCURSES_H
7996 printf("old\n");
7997 #else
7998         make an error
7999 #endif
8000 #endif
8001
8002   ;
8003   return 0;
8004 }
8005 _ACEOF
8006 rm -f conftest.$ac_objext
8007 if { (eval echo "$as_me:8007: \"$ac_compile\"") >&5
8008   (eval $ac_compile) 2>&5
8009   ac_status=$?
8010   echo "$as_me:8010: \$? = $ac_status" >&5
8011   (exit $ac_status); } &&
8012          { ac_try='test -s conftest.$ac_objext'
8013   { (eval echo "$as_me:8013: \"$ac_try\"") >&5
8014   (eval $ac_try) 2>&5
8015   ac_status=$?
8016   echo "$as_me:8016: \$? = $ac_status" >&5
8017   (exit $ac_status); }; }; then
8018   cf_cv_ncurses_h2=$cf_header
8019
8020 else
8021   echo "$as_me: failed program was:" >&5
8022 cat conftest.$ac_ext >&5
8023 cf_cv_ncurses_h2=no
8024 fi
8025 rm -f conftest.$ac_objext conftest.$ac_ext
8026
8027                         if test "$cf_cv_ncurses_h2" != no ; then
8028                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8029                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8030                                 break
8031                         fi
8032                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8033                 done
8034                 CPPFLAGS="$cf_save2_CPPFLAGS"
8035                 test "$cf_cv_ncurses_h2" != no && break
8036         done
8037         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8037: error: not found" >&5
8038 echo "$as_me: error: not found" >&2;}
8039    { (exit 1); exit 1; }; }
8040
8041 fi
8042 echo "$as_me:8042: result: $cf_cv_ncurses_h2" >&5
8043 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8044
8045         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8046         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8047         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8048                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8049         fi
8050
8051 if test -n "$cf_1st_incdir" ; then
8052   for cf_add_incdir in $cf_1st_incdir
8053   do
8054         while test $cf_add_incdir != /usr/include
8055         do
8056           if test -d $cf_add_incdir
8057           then
8058                 cf_have_incdir=no
8059                 if test -n "$CFLAGS$CPPFLAGS" ; then
8060                   # a loop is needed to ensure we can add subdirs of existing dirs
8061                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8062                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8063                           cf_have_incdir=yes; break
8064                         fi
8065                   done
8066                 fi
8067
8068                 if test "$cf_have_incdir" = no ; then
8069                   if test "$cf_add_incdir" = /usr/local/include ; then
8070                         if test "$GCC" = yes
8071                         then
8072                           cf_save_CPPFLAGS=$CPPFLAGS
8073                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8074                           cat >conftest.$ac_ext <<_ACEOF
8075 #line 8075 "configure"
8076 #include "confdefs.h"
8077 #include <stdio.h>
8078 int
8079 main ()
8080 {
8081 printf("Hello")
8082   ;
8083   return 0;
8084 }
8085 _ACEOF
8086 rm -f conftest.$ac_objext
8087 if { (eval echo "$as_me:8087: \"$ac_compile\"") >&5
8088   (eval $ac_compile) 2>&5
8089   ac_status=$?
8090   echo "$as_me:8090: \$? = $ac_status" >&5
8091   (exit $ac_status); } &&
8092          { ac_try='test -s conftest.$ac_objext'
8093   { (eval echo "$as_me:8093: \"$ac_try\"") >&5
8094   (eval $ac_try) 2>&5
8095   ac_status=$?
8096   echo "$as_me:8096: \$? = $ac_status" >&5
8097   (exit $ac_status); }; }; then
8098   :
8099 else
8100   echo "$as_me: failed program was:" >&5
8101 cat conftest.$ac_ext >&5
8102 cf_have_incdir=yes
8103 fi
8104 rm -f conftest.$ac_objext conftest.$ac_ext
8105                           CPPFLAGS=$cf_save_CPPFLAGS
8106                         fi
8107                   fi
8108                 fi
8109
8110                 if test "$cf_have_incdir" = no ; then
8111                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8112
8113 echo "${as_me:-configure}:8113: testing adding $cf_add_incdir to include-path ..." 1>&5
8114
8115                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8116
8117                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8118                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8119                   cf_add_incdir="$cf_top_incdir"
8120                 else
8121                   break
8122                 fi
8123           fi
8124         done
8125   done
8126 fi
8127
8128 fi
8129
8130 # Set definitions to allow ifdef'ing for ncurses.h
8131
8132 case $cf_cv_ncurses_header in # (vi
8133 *ncurses.h)
8134
8135 cat >>confdefs.h <<\EOF
8136 #define HAVE_NCURSES_H 1
8137 EOF
8138
8139         ;;
8140 esac
8141
8142 case $cf_cv_ncurses_header in # (vi
8143 ncurses/curses.h|ncurses/ncurses.h)
8144
8145 cat >>confdefs.h <<\EOF
8146 #define HAVE_NCURSES_NCURSES_H 1
8147 EOF
8148
8149         ;;
8150 ncursesw/curses.h|ncursesw/ncurses.h)
8151
8152 cat >>confdefs.h <<\EOF
8153 #define HAVE_NCURSESW_NCURSES_H 1
8154 EOF
8155
8156         ;;
8157 esac
8158
8159 echo "$as_me:8159: checking for terminfo header" >&5
8160 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8161 if test "${cf_cv_term_header+set}" = set; then
8162   echo $ECHO_N "(cached) $ECHO_C" >&6
8163 else
8164
8165 case ${cf_cv_ncurses_header} in #(vi
8166 */ncurses.h|*/ncursesw.h) #(vi
8167         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8168         ;;
8169 *)
8170         cf_term_header=term.h
8171         ;;
8172 esac
8173
8174 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8175 do
8176 cat >conftest.$ac_ext <<_ACEOF
8177 #line 8177 "configure"
8178 #include "confdefs.h"
8179 #include <stdio.h>
8180 #include <${cf_cv_ncurses_header:-curses.h}>
8181 #include <$cf_test>
8182
8183 int
8184 main ()
8185 {
8186 int x = auto_left_margin
8187   ;
8188   return 0;
8189 }
8190 _ACEOF
8191 rm -f conftest.$ac_objext
8192 if { (eval echo "$as_me:8192: \"$ac_compile\"") >&5
8193   (eval $ac_compile) 2>&5
8194   ac_status=$?
8195   echo "$as_me:8195: \$? = $ac_status" >&5
8196   (exit $ac_status); } &&
8197          { ac_try='test -s conftest.$ac_objext'
8198   { (eval echo "$as_me:8198: \"$ac_try\"") >&5
8199   (eval $ac_try) 2>&5
8200   ac_status=$?
8201   echo "$as_me:8201: \$? = $ac_status" >&5
8202   (exit $ac_status); }; }; then
8203
8204         cf_cv_term_header="$cf_test"
8205 else
8206   echo "$as_me: failed program was:" >&5
8207 cat conftest.$ac_ext >&5
8208
8209         cf_cv_term_header=unknown
8210
8211 fi
8212 rm -f conftest.$ac_objext conftest.$ac_ext
8213         test "$cf_cv_term_header" != unknown && break
8214 done
8215
8216 fi
8217 echo "$as_me:8217: result: $cf_cv_term_header" >&5
8218 echo "${ECHO_T}$cf_cv_term_header" >&6
8219
8220 # Set definitions to allow ifdef'ing to accommodate subdirectories
8221
8222 case $cf_cv_term_header in # (vi
8223 *term.h)
8224
8225 cat >>confdefs.h <<\EOF
8226 #define HAVE_TERM_H 1
8227 EOF
8228
8229         ;;
8230 esac
8231
8232 case $cf_cv_term_header in # (vi
8233 ncurses/term.h) #(vi
8234
8235 cat >>confdefs.h <<\EOF
8236 #define HAVE_NCURSES_TERM_H 1
8237 EOF
8238
8239         ;;
8240 ncursesw/term.h)
8241
8242 cat >>confdefs.h <<\EOF
8243 #define HAVE_NCURSESW_TERM_H 1
8244 EOF
8245
8246         ;;
8247 esac
8248
8249 # some applications need this, but should check for NCURSES_VERSION
8250
8251 cat >>confdefs.h <<\EOF
8252 #define NCURSES 1
8253 EOF
8254
8255 echo "$as_me:8255: checking for ncurses version" >&5
8256 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8257 if test "${cf_cv_ncurses_version+set}" = set; then
8258   echo $ECHO_N "(cached) $ECHO_C" >&6
8259 else
8260
8261         cf_cv_ncurses_version=no
8262         cf_tempfile=out$$
8263         rm -f $cf_tempfile
8264         if test "$cross_compiling" = yes; then
8265
8266         # This will not work if the preprocessor splits the line after the
8267         # Autoconf token.  The 'unproto' program does that.
8268         cat > conftest.$ac_ext <<EOF
8269 #include <${cf_cv_ncurses_header:-curses.h}>
8270 #undef Autoconf
8271 #ifdef NCURSES_VERSION
8272 Autoconf NCURSES_VERSION
8273 #else
8274 #ifdef __NCURSES_H
8275 Autoconf "old"
8276 #endif
8277 ;
8278 #endif
8279 EOF
8280         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8281         { (eval echo "$as_me:8281: \"$cf_try\"") >&5
8282   (eval $cf_try) 2>&5
8283   ac_status=$?
8284   echo "$as_me:8284: \$? = $ac_status" >&5
8285   (exit $ac_status); }
8286         if test -f conftest.out ; then
8287                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8288                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8289                 rm -f conftest.out
8290         fi
8291
8292 else
8293   cat >conftest.$ac_ext <<_ACEOF
8294 #line 8294 "configure"
8295 #include "confdefs.h"
8296
8297 #include <${cf_cv_ncurses_header:-curses.h}>
8298 #include <stdio.h>
8299 int main()
8300 {
8301         FILE *fp = fopen("$cf_tempfile", "w");
8302 #ifdef NCURSES_VERSION
8303 # ifdef NCURSES_VERSION_PATCH
8304         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8305 # else
8306         fprintf(fp, "%s\n", NCURSES_VERSION);
8307 # endif
8308 #else
8309 # ifdef __NCURSES_H
8310         fprintf(fp, "old\n");
8311 # else
8312         make an error
8313 # endif
8314 #endif
8315         ${cf_cv_main_return:-return}(0);
8316 }
8317 _ACEOF
8318 rm -f conftest$ac_exeext
8319 if { (eval echo "$as_me:8319: \"$ac_link\"") >&5
8320   (eval $ac_link) 2>&5
8321   ac_status=$?
8322   echo "$as_me:8322: \$? = $ac_status" >&5
8323   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8324   { (eval echo "$as_me:8324: \"$ac_try\"") >&5
8325   (eval $ac_try) 2>&5
8326   ac_status=$?
8327   echo "$as_me:8327: \$? = $ac_status" >&5
8328   (exit $ac_status); }; }; then
8329
8330         cf_cv_ncurses_version=`cat $cf_tempfile`
8331 else
8332   echo "$as_me: program exited with status $ac_status" >&5
8333 echo "$as_me: failed program was:" >&5
8334 cat conftest.$ac_ext >&5
8335 fi
8336 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8337 fi
8338         rm -f $cf_tempfile
8339
8340 fi
8341 echo "$as_me:8341: result: $cf_cv_ncurses_version" >&5
8342 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8343 test "$cf_cv_ncurses_version" = no ||
8344 cat >>confdefs.h <<\EOF
8345 #define NCURSES 1
8346 EOF
8347
8348 cf_nculib_root=ncursesw
8349         # This works, except for the special case where we find gpm, but
8350         # ncurses is in a nonstandard location via $LIBS, and we really want
8351         # to link gpm.
8352 cf_ncurses_LIBS=""
8353 cf_ncurses_SAVE="$LIBS"
8354 echo "$as_me:8354: checking for Gpm_Open in -lgpm" >&5
8355 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8356 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8357   echo $ECHO_N "(cached) $ECHO_C" >&6
8358 else
8359   ac_check_lib_save_LIBS=$LIBS
8360 LIBS="-lgpm  $LIBS"
8361 cat >conftest.$ac_ext <<_ACEOF
8362 #line 8362 "configure"
8363 #include "confdefs.h"
8364
8365 /* Override any gcc2 internal prototype to avoid an error.  */
8366 #ifdef __cplusplus
8367 extern "C"
8368 #endif
8369 /* We use char because int might match the return type of a gcc2
8370    builtin and then its argument prototype would still apply.  */
8371 char Gpm_Open ();
8372 int
8373 main ()
8374 {
8375 Gpm_Open ();
8376   ;
8377   return 0;
8378 }
8379 _ACEOF
8380 rm -f conftest.$ac_objext conftest$ac_exeext
8381 if { (eval echo "$as_me:8381: \"$ac_link\"") >&5
8382   (eval $ac_link) 2>&5
8383   ac_status=$?
8384   echo "$as_me:8384: \$? = $ac_status" >&5
8385   (exit $ac_status); } &&
8386          { ac_try='test -s conftest$ac_exeext'
8387   { (eval echo "$as_me:8387: \"$ac_try\"") >&5
8388   (eval $ac_try) 2>&5
8389   ac_status=$?
8390   echo "$as_me:8390: \$? = $ac_status" >&5
8391   (exit $ac_status); }; }; then
8392   ac_cv_lib_gpm_Gpm_Open=yes
8393 else
8394   echo "$as_me: failed program was:" >&5
8395 cat conftest.$ac_ext >&5
8396 ac_cv_lib_gpm_Gpm_Open=no
8397 fi
8398 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8399 LIBS=$ac_check_lib_save_LIBS
8400 fi
8401 echo "$as_me:8401: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8402 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8403 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8404   echo "$as_me:8404: checking for initscr in -lgpm" >&5
8405 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8406 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8407   echo $ECHO_N "(cached) $ECHO_C" >&6
8408 else
8409   ac_check_lib_save_LIBS=$LIBS
8410 LIBS="-lgpm  $LIBS"
8411 cat >conftest.$ac_ext <<_ACEOF
8412 #line 8412 "configure"
8413 #include "confdefs.h"
8414
8415 /* Override any gcc2 internal prototype to avoid an error.  */
8416 #ifdef __cplusplus
8417 extern "C"
8418 #endif
8419 /* We use char because int might match the return type of a gcc2
8420    builtin and then its argument prototype would still apply.  */
8421 char initscr ();
8422 int
8423 main ()
8424 {
8425 initscr ();
8426   ;
8427   return 0;
8428 }
8429 _ACEOF
8430 rm -f conftest.$ac_objext conftest$ac_exeext
8431 if { (eval echo "$as_me:8431: \"$ac_link\"") >&5
8432   (eval $ac_link) 2>&5
8433   ac_status=$?
8434   echo "$as_me:8434: \$? = $ac_status" >&5
8435   (exit $ac_status); } &&
8436          { ac_try='test -s conftest$ac_exeext'
8437   { (eval echo "$as_me:8437: \"$ac_try\"") >&5
8438   (eval $ac_try) 2>&5
8439   ac_status=$?
8440   echo "$as_me:8440: \$? = $ac_status" >&5
8441   (exit $ac_status); }; }; then
8442   ac_cv_lib_gpm_initscr=yes
8443 else
8444   echo "$as_me: failed program was:" >&5
8445 cat conftest.$ac_ext >&5
8446 ac_cv_lib_gpm_initscr=no
8447 fi
8448 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8449 LIBS=$ac_check_lib_save_LIBS
8450 fi
8451 echo "$as_me:8451: result: $ac_cv_lib_gpm_initscr" >&5
8452 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8453 if test $ac_cv_lib_gpm_initscr = yes; then
8454   LIBS="$cf_ncurses_SAVE"
8455 else
8456   cf_ncurses_LIBS="-lgpm"
8457 fi
8458
8459 fi
8460
8461 case $host_os in #(vi
8462 freebsd*)
8463         # This is only necessary if you are linking against an obsolete
8464         # version of ncurses (but it should do no harm, since it's static).
8465         if test "$cf_nculib_root" = ncurses ; then
8466                 echo "$as_me:8466: checking for tgoto in -lmytinfo" >&5
8467 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8468 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8469   echo $ECHO_N "(cached) $ECHO_C" >&6
8470 else
8471   ac_check_lib_save_LIBS=$LIBS
8472 LIBS="-lmytinfo  $LIBS"
8473 cat >conftest.$ac_ext <<_ACEOF
8474 #line 8474 "configure"
8475 #include "confdefs.h"
8476
8477 /* Override any gcc2 internal prototype to avoid an error.  */
8478 #ifdef __cplusplus
8479 extern "C"
8480 #endif
8481 /* We use char because int might match the return type of a gcc2
8482    builtin and then its argument prototype would still apply.  */
8483 char tgoto ();
8484 int
8485 main ()
8486 {
8487 tgoto ();
8488   ;
8489   return 0;
8490 }
8491 _ACEOF
8492 rm -f conftest.$ac_objext conftest$ac_exeext
8493 if { (eval echo "$as_me:8493: \"$ac_link\"") >&5
8494   (eval $ac_link) 2>&5
8495   ac_status=$?
8496   echo "$as_me:8496: \$? = $ac_status" >&5
8497   (exit $ac_status); } &&
8498          { ac_try='test -s conftest$ac_exeext'
8499   { (eval echo "$as_me:8499: \"$ac_try\"") >&5
8500   (eval $ac_try) 2>&5
8501   ac_status=$?
8502   echo "$as_me:8502: \$? = $ac_status" >&5
8503   (exit $ac_status); }; }; then
8504   ac_cv_lib_mytinfo_tgoto=yes
8505 else
8506   echo "$as_me: failed program was:" >&5
8507 cat conftest.$ac_ext >&5
8508 ac_cv_lib_mytinfo_tgoto=no
8509 fi
8510 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8511 LIBS=$ac_check_lib_save_LIBS
8512 fi
8513 echo "$as_me:8513: result: $ac_cv_lib_mytinfo_tgoto" >&5
8514 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8515 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8516   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8517 fi
8518
8519         fi
8520         ;;
8521 esac
8522
8523 LIBS="$cf_ncurses_LIBS $LIBS"
8524
8525 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8526 then
8527         LIBS="-l$cf_nculib_root $LIBS"
8528 else
8529
8530         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8531         cf_libdir=""
8532         echo "$as_me:8532: checking for initscr" >&5
8533 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8534 if test "${ac_cv_func_initscr+set}" = set; then
8535   echo $ECHO_N "(cached) $ECHO_C" >&6
8536 else
8537   cat >conftest.$ac_ext <<_ACEOF
8538 #line 8538 "configure"
8539 #include "confdefs.h"
8540 /* System header to define __stub macros and hopefully few prototypes,
8541     which can conflict with char initscr (); below.  */
8542 #include <assert.h>
8543 /* Override any gcc2 internal prototype to avoid an error.  */
8544 #ifdef __cplusplus
8545 extern "C"
8546 #endif
8547 /* We use char because int might match the return type of a gcc2
8548    builtin and then its argument prototype would still apply.  */
8549 char initscr ();
8550 char (*f) ();
8551
8552 int
8553 main ()
8554 {
8555 /* The GNU C library defines this for functions which it implements
8556     to always fail with ENOSYS.  Some functions are actually named
8557     something starting with __ and the normal name is an alias.  */
8558 #if defined (__stub_initscr) || defined (__stub___initscr)
8559 choke me
8560 #else
8561 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8562 #endif
8563
8564   ;
8565   return 0;
8566 }
8567 _ACEOF
8568 rm -f conftest.$ac_objext conftest$ac_exeext
8569 if { (eval echo "$as_me:8569: \"$ac_link\"") >&5
8570   (eval $ac_link) 2>&5
8571   ac_status=$?
8572   echo "$as_me:8572: \$? = $ac_status" >&5
8573   (exit $ac_status); } &&
8574          { ac_try='test -s conftest$ac_exeext'
8575   { (eval echo "$as_me:8575: \"$ac_try\"") >&5
8576   (eval $ac_try) 2>&5
8577   ac_status=$?
8578   echo "$as_me:8578: \$? = $ac_status" >&5
8579   (exit $ac_status); }; }; then
8580   ac_cv_func_initscr=yes
8581 else
8582   echo "$as_me: failed program was:" >&5
8583 cat conftest.$ac_ext >&5
8584 ac_cv_func_initscr=no
8585 fi
8586 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8587 fi
8588 echo "$as_me:8588: result: $ac_cv_func_initscr" >&5
8589 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8590 if test $ac_cv_func_initscr = yes; then
8591   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8592 else
8593
8594                 cf_save_LIBS="$LIBS"
8595                 echo "$as_me:8595: checking for initscr in -l$cf_nculib_root" >&5
8596 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8597                 LIBS="-l$cf_nculib_root $LIBS"
8598                 cat >conftest.$ac_ext <<_ACEOF
8599 #line 8599 "configure"
8600 #include "confdefs.h"
8601 #include <${cf_cv_ncurses_header:-curses.h}>
8602 int
8603 main ()
8604 {
8605 initscr()
8606   ;
8607   return 0;
8608 }
8609 _ACEOF
8610 rm -f conftest.$ac_objext conftest$ac_exeext
8611 if { (eval echo "$as_me:8611: \"$ac_link\"") >&5
8612   (eval $ac_link) 2>&5
8613   ac_status=$?
8614   echo "$as_me:8614: \$? = $ac_status" >&5
8615   (exit $ac_status); } &&
8616          { ac_try='test -s conftest$ac_exeext'
8617   { (eval echo "$as_me:8617: \"$ac_try\"") >&5
8618   (eval $ac_try) 2>&5
8619   ac_status=$?
8620   echo "$as_me:8620: \$? = $ac_status" >&5
8621   (exit $ac_status); }; }; then
8622   echo "$as_me:8622: result: yes" >&5
8623 echo "${ECHO_T}yes" >&6
8624                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8625
8626 else
8627   echo "$as_me: failed program was:" >&5
8628 cat conftest.$ac_ext >&5
8629 echo "$as_me:8629: result: no" >&5
8630 echo "${ECHO_T}no" >&6
8631
8632 cf_search=
8633 cf_library_path_list=""
8634 if test -n "${LDFLAGS}${LIBS}" ; then
8635         for cf_library_path in $LDFLAGS $LIBS
8636         do
8637                 case $cf_library_path in #(vi
8638                 -L*)
8639                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8640
8641 test "x$cf_library_path" != "xNONE" && \
8642 test -d "$cf_library_path" && \
8643  {
8644         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8645         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8646         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8647         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8648         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8649         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"
8650 }
8651
8652                         cf_library_path_list="$cf_library_path_list $cf_search"
8653                         ;;
8654                 esac
8655         done
8656 fi
8657
8658 cf_search=
8659
8660 test "x/usr" != "x$prefix" && \
8661 test -d "/usr" && \
8662 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
8663         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
8664         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
8665         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
8666         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
8667         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
8668         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
8669 }
8670
8671 test "x$prefix" != "xNONE" && \
8672 test -d "$prefix" && \
8673  {
8674         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8675         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8676         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8677         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8678         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8679         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8680 }
8681
8682 test "x/usr/local" != "x$prefix" && \
8683 test -d "/usr/local" && \
8684 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
8685         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
8686         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
8687         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
8688         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
8689         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
8690         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
8691 }
8692
8693 test "x/opt" != "x$prefix" && \
8694 test -d "/opt" && \
8695 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
8696         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
8697         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
8698         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
8699         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
8700         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
8701         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
8702 }
8703
8704 test "x$HOME" != "x$prefix" && \
8705 test -d "$HOME" && \
8706 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
8707         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
8708         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
8709         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
8710         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
8711         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
8712         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
8713 }
8714
8715 cf_search="$cf_library_path_list $cf_search"
8716
8717                         for cf_libdir in $cf_search
8718                         do
8719                                 echo "$as_me:8719: checking for -l$cf_nculib_root in $cf_libdir" >&5
8720 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8721                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8722                                 cat >conftest.$ac_ext <<_ACEOF
8723 #line 8723 "configure"
8724 #include "confdefs.h"
8725 #include <${cf_cv_ncurses_header:-curses.h}>
8726 int
8727 main ()
8728 {
8729 initscr()
8730   ;
8731   return 0;
8732 }
8733 _ACEOF
8734 rm -f conftest.$ac_objext conftest$ac_exeext
8735 if { (eval echo "$as_me:8735: \"$ac_link\"") >&5
8736   (eval $ac_link) 2>&5
8737   ac_status=$?
8738   echo "$as_me:8738: \$? = $ac_status" >&5
8739   (exit $ac_status); } &&
8740          { ac_try='test -s conftest$ac_exeext'
8741   { (eval echo "$as_me:8741: \"$ac_try\"") >&5
8742   (eval $ac_try) 2>&5
8743   ac_status=$?
8744   echo "$as_me:8744: \$? = $ac_status" >&5
8745   (exit $ac_status); }; }; then
8746   echo "$as_me:8746: result: yes" >&5
8747 echo "${ECHO_T}yes" >&6
8748                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8749                                          break
8750 else
8751   echo "$as_me: failed program was:" >&5
8752 cat conftest.$ac_ext >&5
8753 echo "$as_me:8753: result: no" >&5
8754 echo "${ECHO_T}no" >&6
8755                                          LIBS="$cf_save_LIBS"
8756 fi
8757 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8758                         done
8759
8760 fi
8761 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8762
8763 fi
8764
8765 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8766
8767 if test $cf_found_library = no ; then
8768         { { echo "$as_me:8768: error: Cannot link $cf_nculib_root library" >&5
8769 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8770    { (exit 1); exit 1; }; }
8771 fi
8772
8773 fi
8774
8775 if test -n "$cf_ncurses_LIBS" ; then
8776         echo "$as_me:8776: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8777 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8778         cf_ncurses_SAVE="$LIBS"
8779         for p in $cf_ncurses_LIBS ; do
8780                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8781                 if test "$q" != "$LIBS" ; then
8782                         LIBS="$q"
8783                 fi
8784         done
8785         cat >conftest.$ac_ext <<_ACEOF
8786 #line 8786 "configure"
8787 #include "confdefs.h"
8788 #include <${cf_cv_ncurses_header:-curses.h}>
8789 int
8790 main ()
8791 {
8792 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8793   ;
8794   return 0;
8795 }
8796 _ACEOF
8797 rm -f conftest.$ac_objext conftest$ac_exeext
8798 if { (eval echo "$as_me:8798: \"$ac_link\"") >&5
8799   (eval $ac_link) 2>&5
8800   ac_status=$?
8801   echo "$as_me:8801: \$? = $ac_status" >&5
8802   (exit $ac_status); } &&
8803          { ac_try='test -s conftest$ac_exeext'
8804   { (eval echo "$as_me:8804: \"$ac_try\"") >&5
8805   (eval $ac_try) 2>&5
8806   ac_status=$?
8807   echo "$as_me:8807: \$? = $ac_status" >&5
8808   (exit $ac_status); }; }; then
8809   echo "$as_me:8809: result: yes" >&5
8810 echo "${ECHO_T}yes" >&6
8811 else
8812   echo "$as_me: failed program was:" >&5
8813 cat conftest.$ac_ext >&5
8814 echo "$as_me:8814: result: no" >&5
8815 echo "${ECHO_T}no" >&6
8816                  LIBS="$cf_ncurses_SAVE"
8817 fi
8818 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8819 fi
8820
8821 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8822
8823 cat >>confdefs.h <<EOF
8824 #define $cf_nculib_ROOT 1
8825 EOF
8826
8827 fi
8828
8829         ;;
8830 pdcurses)
8831         echo "$as_me:8831: checking for X" >&5
8832 echo $ECHO_N "checking for X... $ECHO_C" >&6
8833
8834 # Check whether --with-x or --without-x was given.
8835 if test "${with_x+set}" = set; then
8836   withval="$with_x"
8837
8838 fi;
8839 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
8840 if test "x$with_x" = xno; then
8841   # The user explicitly disabled X.
8842   have_x=disabled
8843 else
8844   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
8845     # Both variables are already set.
8846     have_x=yes
8847   else
8848     if test "${ac_cv_have_x+set}" = set; then
8849   echo $ECHO_N "(cached) $ECHO_C" >&6
8850 else
8851   # One or both of the vars are not set, and there is no cached value.
8852 ac_x_includes=no ac_x_libraries=no
8853 rm -fr conftest.dir
8854 if mkdir conftest.dir; then
8855   cd conftest.dir
8856   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
8857   cat >Imakefile <<'EOF'
8858 acfindx:
8859         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
8860 EOF
8861   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
8862     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
8863     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
8864     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
8865     for ac_extension in a so sl dylib dll; do
8866       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
8867          test -f $ac_im_libdir/libX11.$ac_extension; then
8868         ac_im_usrlibdir=$ac_im_libdir; break
8869       fi
8870     done
8871     # Screen out bogus values from the imake configuration.  They are
8872     # bogus both because they are the default anyway, and because
8873     # using them would break gcc on systems where it needs fixed includes.
8874     case $ac_im_incroot in
8875         /usr/include) ;;
8876         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
8877     esac
8878     case $ac_im_usrlibdir in
8879         /usr/lib | /lib) ;;
8880         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
8881     esac
8882   fi
8883   cd ..
8884   rm -fr conftest.dir
8885 fi
8886
8887 # Standard set of common directories for X headers.
8888 # Check X11 before X11Rn because it is often a symlink to the current release.
8889 ac_x_header_dirs='
8890 /usr/X11/include
8891 /usr/X11R6/include
8892 /usr/X11R5/include
8893 /usr/X11R4/include
8894
8895 /usr/include/X11
8896 /usr/include/X11R6
8897 /usr/include/X11R5
8898 /usr/include/X11R4
8899
8900 /usr/local/X11/include
8901 /usr/local/X11R6/include
8902 /usr/local/X11R5/include
8903 /usr/local/X11R4/include
8904
8905 /usr/local/include/X11
8906 /usr/local/include/X11R6
8907 /usr/local/include/X11R5
8908 /usr/local/include/X11R4
8909
8910 /usr/X386/include
8911 /usr/x386/include
8912 /usr/XFree86/include/X11
8913
8914 /usr/include
8915 /usr/local/include
8916 /usr/unsupported/include
8917 /usr/athena/include
8918 /usr/local/x11r5/include
8919 /usr/lpp/Xamples/include
8920
8921 /usr/openwin/include
8922 /usr/openwin/share/include'
8923
8924 if test "$ac_x_includes" = no; then
8925   # Guess where to find include files, by looking for Intrinsic.h.
8926   # First, try using that file with no special directory specified.
8927   cat >conftest.$ac_ext <<_ACEOF
8928 #line 8928 "configure"
8929 #include "confdefs.h"
8930 #include <X11/Intrinsic.h>
8931 _ACEOF
8932 if { (eval echo "$as_me:8932: \"$ac_cpp conftest.$ac_ext\"") >&5
8933   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8934   ac_status=$?
8935   egrep -v '^ *\+' conftest.er1 >conftest.err
8936   rm -f conftest.er1
8937   cat conftest.err >&5
8938   echo "$as_me:8938: \$? = $ac_status" >&5
8939   (exit $ac_status); } >/dev/null; then
8940   if test -s conftest.err; then
8941     ac_cpp_err=$ac_c_preproc_warn_flag
8942   else
8943     ac_cpp_err=
8944   fi
8945 else
8946   ac_cpp_err=yes
8947 fi
8948 if test -z "$ac_cpp_err"; then
8949   # We can compile using X headers with no special include directory.
8950 ac_x_includes=
8951 else
8952   echo "$as_me: failed program was:" >&5
8953   cat conftest.$ac_ext >&5
8954   for ac_dir in $ac_x_header_dirs; do
8955   if test -r "$ac_dir/X11/Intrinsic.h"; then
8956     ac_x_includes=$ac_dir
8957     break
8958   fi
8959 done
8960 fi
8961 rm -f conftest.err conftest.$ac_ext
8962 fi # $ac_x_includes = no
8963
8964 if test "$ac_x_libraries" = no; then
8965   # Check for the libraries.
8966   # See if we find them without any special options.
8967   # Don't add to $LIBS permanently.
8968   ac_save_LIBS=$LIBS
8969   LIBS="-lXt $LIBS"
8970   cat >conftest.$ac_ext <<_ACEOF
8971 #line 8971 "configure"
8972 #include "confdefs.h"
8973 #include <X11/Intrinsic.h>
8974 int
8975 main ()
8976 {
8977 XtMalloc (0)
8978   ;
8979   return 0;
8980 }
8981 _ACEOF
8982 rm -f conftest.$ac_objext conftest$ac_exeext
8983 if { (eval echo "$as_me:8983: \"$ac_link\"") >&5
8984   (eval $ac_link) 2>&5
8985   ac_status=$?
8986   echo "$as_me:8986: \$? = $ac_status" >&5
8987   (exit $ac_status); } &&
8988          { ac_try='test -s conftest$ac_exeext'
8989   { (eval echo "$as_me:8989: \"$ac_try\"") >&5
8990   (eval $ac_try) 2>&5
8991   ac_status=$?
8992   echo "$as_me:8992: \$? = $ac_status" >&5
8993   (exit $ac_status); }; }; then
8994   LIBS=$ac_save_LIBS
8995 # We can link X programs with no special library path.
8996 ac_x_libraries=
8997 else
8998   echo "$as_me: failed program was:" >&5
8999 cat conftest.$ac_ext >&5
9000 LIBS=$ac_save_LIBS
9001 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9002 do
9003   # Don't even attempt the hair of trying to link an X program!
9004   for ac_extension in a so sl dylib dll; do
9005     if test -r $ac_dir/libXt.$ac_extension; then
9006       ac_x_libraries=$ac_dir
9007       break 2
9008     fi
9009   done
9010 done
9011 fi
9012 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9013 fi # $ac_x_libraries = no
9014
9015 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9016   # Didn't find X anywhere.  Cache the known absence of X.
9017   ac_cv_have_x="have_x=no"
9018 else
9019   # Record where we found X for the cache.
9020   ac_cv_have_x="have_x=yes \
9021                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9022 fi
9023 fi
9024
9025   fi
9026   eval "$ac_cv_have_x"
9027 fi # $with_x != no
9028
9029 if test "$have_x" != yes; then
9030   echo "$as_me:9030: result: $have_x" >&5
9031 echo "${ECHO_T}$have_x" >&6
9032   no_x=yes
9033 else
9034   # If each of the values was on the command line, it overrides each guess.
9035   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9036   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9037   # Update the cache value to reflect the command line values.
9038   ac_cv_have_x="have_x=yes \
9039                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9040   echo "$as_me:9040: result: libraries $x_libraries, headers $x_includes" >&5
9041 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9042 fi
9043
9044 if test "$no_x" = yes; then
9045   # Not all programs may use this symbol, but it does not hurt to define it.
9046
9047 cat >>confdefs.h <<\EOF
9048 #define X_DISPLAY_MISSING 1
9049 EOF
9050
9051   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9052 else
9053   if test -n "$x_includes"; then
9054     X_CFLAGS="$X_CFLAGS -I$x_includes"
9055   fi
9056
9057   # It would also be nice to do this for all -L options, not just this one.
9058   if test -n "$x_libraries"; then
9059     X_LIBS="$X_LIBS -L$x_libraries"
9060     # For Solaris; some versions of Sun CC require a space after -R and
9061     # others require no space.  Words are not sufficient . . . .
9062     case `(uname -sr) 2>/dev/null` in
9063     "SunOS 5"*)
9064       echo "$as_me:9064: checking whether -R must be followed by a space" >&5
9065 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9066       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9067       cat >conftest.$ac_ext <<_ACEOF
9068 #line 9068 "configure"
9069 #include "confdefs.h"
9070
9071 int
9072 main ()
9073 {
9074
9075   ;
9076   return 0;
9077 }
9078 _ACEOF
9079 rm -f conftest.$ac_objext conftest$ac_exeext
9080 if { (eval echo "$as_me:9080: \"$ac_link\"") >&5
9081   (eval $ac_link) 2>&5
9082   ac_status=$?
9083   echo "$as_me:9083: \$? = $ac_status" >&5
9084   (exit $ac_status); } &&
9085          { ac_try='test -s conftest$ac_exeext'
9086   { (eval echo "$as_me:9086: \"$ac_try\"") >&5
9087   (eval $ac_try) 2>&5
9088   ac_status=$?
9089   echo "$as_me:9089: \$? = $ac_status" >&5
9090   (exit $ac_status); }; }; then
9091   ac_R_nospace=yes
9092 else
9093   echo "$as_me: failed program was:" >&5
9094 cat conftest.$ac_ext >&5
9095 ac_R_nospace=no
9096 fi
9097 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9098       if test $ac_R_nospace = yes; then
9099         echo "$as_me:9099: result: no" >&5
9100 echo "${ECHO_T}no" >&6
9101         X_LIBS="$X_LIBS -R$x_libraries"
9102       else
9103         LIBS="$ac_xsave_LIBS -R $x_libraries"
9104         cat >conftest.$ac_ext <<_ACEOF
9105 #line 9105 "configure"
9106 #include "confdefs.h"
9107
9108 int
9109 main ()
9110 {
9111
9112   ;
9113   return 0;
9114 }
9115 _ACEOF
9116 rm -f conftest.$ac_objext conftest$ac_exeext
9117 if { (eval echo "$as_me:9117: \"$ac_link\"") >&5
9118   (eval $ac_link) 2>&5
9119   ac_status=$?
9120   echo "$as_me:9120: \$? = $ac_status" >&5
9121   (exit $ac_status); } &&
9122          { ac_try='test -s conftest$ac_exeext'
9123   { (eval echo "$as_me:9123: \"$ac_try\"") >&5
9124   (eval $ac_try) 2>&5
9125   ac_status=$?
9126   echo "$as_me:9126: \$? = $ac_status" >&5
9127   (exit $ac_status); }; }; then
9128   ac_R_space=yes
9129 else
9130   echo "$as_me: failed program was:" >&5
9131 cat conftest.$ac_ext >&5
9132 ac_R_space=no
9133 fi
9134 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9135         if test $ac_R_space = yes; then
9136           echo "$as_me:9136: result: yes" >&5
9137 echo "${ECHO_T}yes" >&6
9138           X_LIBS="$X_LIBS -R $x_libraries"
9139         else
9140           echo "$as_me:9140: result: neither works" >&5
9141 echo "${ECHO_T}neither works" >&6
9142         fi
9143       fi
9144       LIBS=$ac_xsave_LIBS
9145     esac
9146   fi
9147
9148   # Check for system-dependent libraries X programs must link with.
9149   # Do this before checking for the system-independent R6 libraries
9150   # (-lICE), since we may need -lsocket or whatever for X linking.
9151
9152   if test "$ISC" = yes; then
9153     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9154   else
9155     # Martyn Johnson says this is needed for Ultrix, if the X
9156     # libraries were built with DECnet support.  And Karl Berry says
9157     # the Alpha needs dnet_stub (dnet does not exist).
9158     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9159     cat >conftest.$ac_ext <<_ACEOF
9160 #line 9160 "configure"
9161 #include "confdefs.h"
9162
9163 /* Override any gcc2 internal prototype to avoid an error.  */
9164 #ifdef __cplusplus
9165 extern "C"
9166 #endif
9167 /* We use char because int might match the return type of a gcc2
9168    builtin and then its argument prototype would still apply.  */
9169 char XOpenDisplay ();
9170 int
9171 main ()
9172 {
9173 XOpenDisplay ();
9174   ;
9175   return 0;
9176 }
9177 _ACEOF
9178 rm -f conftest.$ac_objext conftest$ac_exeext
9179 if { (eval echo "$as_me:9179: \"$ac_link\"") >&5
9180   (eval $ac_link) 2>&5
9181   ac_status=$?
9182   echo "$as_me:9182: \$? = $ac_status" >&5
9183   (exit $ac_status); } &&
9184          { ac_try='test -s conftest$ac_exeext'
9185   { (eval echo "$as_me:9185: \"$ac_try\"") >&5
9186   (eval $ac_try) 2>&5
9187   ac_status=$?
9188   echo "$as_me:9188: \$? = $ac_status" >&5
9189   (exit $ac_status); }; }; then
9190   :
9191 else
9192   echo "$as_me: failed program was:" >&5
9193 cat conftest.$ac_ext >&5
9194 echo "$as_me:9194: checking for dnet_ntoa in -ldnet" >&5
9195 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9196 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9197   echo $ECHO_N "(cached) $ECHO_C" >&6
9198 else
9199   ac_check_lib_save_LIBS=$LIBS
9200 LIBS="-ldnet  $LIBS"
9201 cat >conftest.$ac_ext <<_ACEOF
9202 #line 9202 "configure"
9203 #include "confdefs.h"
9204
9205 /* Override any gcc2 internal prototype to avoid an error.  */
9206 #ifdef __cplusplus
9207 extern "C"
9208 #endif
9209 /* We use char because int might match the return type of a gcc2
9210    builtin and then its argument prototype would still apply.  */
9211 char dnet_ntoa ();
9212 int
9213 main ()
9214 {
9215 dnet_ntoa ();
9216   ;
9217   return 0;
9218 }
9219 _ACEOF
9220 rm -f conftest.$ac_objext conftest$ac_exeext
9221 if { (eval echo "$as_me:9221: \"$ac_link\"") >&5
9222   (eval $ac_link) 2>&5
9223   ac_status=$?
9224   echo "$as_me:9224: \$? = $ac_status" >&5
9225   (exit $ac_status); } &&
9226          { ac_try='test -s conftest$ac_exeext'
9227   { (eval echo "$as_me:9227: \"$ac_try\"") >&5
9228   (eval $ac_try) 2>&5
9229   ac_status=$?
9230   echo "$as_me:9230: \$? = $ac_status" >&5
9231   (exit $ac_status); }; }; then
9232   ac_cv_lib_dnet_dnet_ntoa=yes
9233 else
9234   echo "$as_me: failed program was:" >&5
9235 cat conftest.$ac_ext >&5
9236 ac_cv_lib_dnet_dnet_ntoa=no
9237 fi
9238 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9239 LIBS=$ac_check_lib_save_LIBS
9240 fi
9241 echo "$as_me:9241: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9242 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9243 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9244   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9245 fi
9246
9247     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9248       echo "$as_me:9248: checking for dnet_ntoa in -ldnet_stub" >&5
9249 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9250 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9251   echo $ECHO_N "(cached) $ECHO_C" >&6
9252 else
9253   ac_check_lib_save_LIBS=$LIBS
9254 LIBS="-ldnet_stub  $LIBS"
9255 cat >conftest.$ac_ext <<_ACEOF
9256 #line 9256 "configure"
9257 #include "confdefs.h"
9258
9259 /* Override any gcc2 internal prototype to avoid an error.  */
9260 #ifdef __cplusplus
9261 extern "C"
9262 #endif
9263 /* We use char because int might match the return type of a gcc2
9264    builtin and then its argument prototype would still apply.  */
9265 char dnet_ntoa ();
9266 int
9267 main ()
9268 {
9269 dnet_ntoa ();
9270   ;
9271   return 0;
9272 }
9273 _ACEOF
9274 rm -f conftest.$ac_objext conftest$ac_exeext
9275 if { (eval echo "$as_me:9275: \"$ac_link\"") >&5
9276   (eval $ac_link) 2>&5
9277   ac_status=$?
9278   echo "$as_me:9278: \$? = $ac_status" >&5
9279   (exit $ac_status); } &&
9280          { ac_try='test -s conftest$ac_exeext'
9281   { (eval echo "$as_me:9281: \"$ac_try\"") >&5
9282   (eval $ac_try) 2>&5
9283   ac_status=$?
9284   echo "$as_me:9284: \$? = $ac_status" >&5
9285   (exit $ac_status); }; }; then
9286   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9287 else
9288   echo "$as_me: failed program was:" >&5
9289 cat conftest.$ac_ext >&5
9290 ac_cv_lib_dnet_stub_dnet_ntoa=no
9291 fi
9292 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9293 LIBS=$ac_check_lib_save_LIBS
9294 fi
9295 echo "$as_me:9295: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9296 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9297 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9298   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9299 fi
9300
9301     fi
9302 fi
9303 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9304     LIBS="$ac_xsave_LIBS"
9305
9306     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9307     # to get the SysV transport functions.
9308     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9309     # needs -lnsl.
9310     # The nsl library prevents programs from opening the X display
9311     # on Irix 5.2, according to T.E. Dickey.
9312     # The functions gethostbyname, getservbyname, and inet_addr are
9313     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9314     echo "$as_me:9314: checking for gethostbyname" >&5
9315 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9316 if test "${ac_cv_func_gethostbyname+set}" = set; then
9317   echo $ECHO_N "(cached) $ECHO_C" >&6
9318 else
9319   cat >conftest.$ac_ext <<_ACEOF
9320 #line 9320 "configure"
9321 #include "confdefs.h"
9322 /* System header to define __stub macros and hopefully few prototypes,
9323     which can conflict with char gethostbyname (); below.  */
9324 #include <assert.h>
9325 /* Override any gcc2 internal prototype to avoid an error.  */
9326 #ifdef __cplusplus
9327 extern "C"
9328 #endif
9329 /* We use char because int might match the return type of a gcc2
9330    builtin and then its argument prototype would still apply.  */
9331 char gethostbyname ();
9332 char (*f) ();
9333
9334 int
9335 main ()
9336 {
9337 /* The GNU C library defines this for functions which it implements
9338     to always fail with ENOSYS.  Some functions are actually named
9339     something starting with __ and the normal name is an alias.  */
9340 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9341 choke me
9342 #else
9343 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9344 #endif
9345
9346   ;
9347   return 0;
9348 }
9349 _ACEOF
9350 rm -f conftest.$ac_objext conftest$ac_exeext
9351 if { (eval echo "$as_me:9351: \"$ac_link\"") >&5
9352   (eval $ac_link) 2>&5
9353   ac_status=$?
9354   echo "$as_me:9354: \$? = $ac_status" >&5
9355   (exit $ac_status); } &&
9356          { ac_try='test -s conftest$ac_exeext'
9357   { (eval echo "$as_me:9357: \"$ac_try\"") >&5
9358   (eval $ac_try) 2>&5
9359   ac_status=$?
9360   echo "$as_me:9360: \$? = $ac_status" >&5
9361   (exit $ac_status); }; }; then
9362   ac_cv_func_gethostbyname=yes
9363 else
9364   echo "$as_me: failed program was:" >&5
9365 cat conftest.$ac_ext >&5
9366 ac_cv_func_gethostbyname=no
9367 fi
9368 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9369 fi
9370 echo "$as_me:9370: result: $ac_cv_func_gethostbyname" >&5
9371 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9372
9373     if test $ac_cv_func_gethostbyname = no; then
9374       echo "$as_me:9374: checking for gethostbyname in -lnsl" >&5
9375 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9376 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9377   echo $ECHO_N "(cached) $ECHO_C" >&6
9378 else
9379   ac_check_lib_save_LIBS=$LIBS
9380 LIBS="-lnsl  $LIBS"
9381 cat >conftest.$ac_ext <<_ACEOF
9382 #line 9382 "configure"
9383 #include "confdefs.h"
9384
9385 /* Override any gcc2 internal prototype to avoid an error.  */
9386 #ifdef __cplusplus
9387 extern "C"
9388 #endif
9389 /* We use char because int might match the return type of a gcc2
9390    builtin and then its argument prototype would still apply.  */
9391 char gethostbyname ();
9392 int
9393 main ()
9394 {
9395 gethostbyname ();
9396   ;
9397   return 0;
9398 }
9399 _ACEOF
9400 rm -f conftest.$ac_objext conftest$ac_exeext
9401 if { (eval echo "$as_me:9401: \"$ac_link\"") >&5
9402   (eval $ac_link) 2>&5
9403   ac_status=$?
9404   echo "$as_me:9404: \$? = $ac_status" >&5
9405   (exit $ac_status); } &&
9406          { ac_try='test -s conftest$ac_exeext'
9407   { (eval echo "$as_me:9407: \"$ac_try\"") >&5
9408   (eval $ac_try) 2>&5
9409   ac_status=$?
9410   echo "$as_me:9410: \$? = $ac_status" >&5
9411   (exit $ac_status); }; }; then
9412   ac_cv_lib_nsl_gethostbyname=yes
9413 else
9414   echo "$as_me: failed program was:" >&5
9415 cat conftest.$ac_ext >&5
9416 ac_cv_lib_nsl_gethostbyname=no
9417 fi
9418 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9419 LIBS=$ac_check_lib_save_LIBS
9420 fi
9421 echo "$as_me:9421: result: $ac_cv_lib_nsl_gethostbyname" >&5
9422 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9423 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9424   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9425 fi
9426
9427       if test $ac_cv_lib_nsl_gethostbyname = no; then
9428         echo "$as_me:9428: checking for gethostbyname in -lbsd" >&5
9429 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9430 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9431   echo $ECHO_N "(cached) $ECHO_C" >&6
9432 else
9433   ac_check_lib_save_LIBS=$LIBS
9434 LIBS="-lbsd  $LIBS"
9435 cat >conftest.$ac_ext <<_ACEOF
9436 #line 9436 "configure"
9437 #include "confdefs.h"
9438
9439 /* Override any gcc2 internal prototype to avoid an error.  */
9440 #ifdef __cplusplus
9441 extern "C"
9442 #endif
9443 /* We use char because int might match the return type of a gcc2
9444    builtin and then its argument prototype would still apply.  */
9445 char gethostbyname ();
9446 int
9447 main ()
9448 {
9449 gethostbyname ();
9450   ;
9451   return 0;
9452 }
9453 _ACEOF
9454 rm -f conftest.$ac_objext conftest$ac_exeext
9455 if { (eval echo "$as_me:9455: \"$ac_link\"") >&5
9456   (eval $ac_link) 2>&5
9457   ac_status=$?
9458   echo "$as_me:9458: \$? = $ac_status" >&5
9459   (exit $ac_status); } &&
9460          { ac_try='test -s conftest$ac_exeext'
9461   { (eval echo "$as_me:9461: \"$ac_try\"") >&5
9462   (eval $ac_try) 2>&5
9463   ac_status=$?
9464   echo "$as_me:9464: \$? = $ac_status" >&5
9465   (exit $ac_status); }; }; then
9466   ac_cv_lib_bsd_gethostbyname=yes
9467 else
9468   echo "$as_me: failed program was:" >&5
9469 cat conftest.$ac_ext >&5
9470 ac_cv_lib_bsd_gethostbyname=no
9471 fi
9472 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9473 LIBS=$ac_check_lib_save_LIBS
9474 fi
9475 echo "$as_me:9475: result: $ac_cv_lib_bsd_gethostbyname" >&5
9476 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
9477 if test $ac_cv_lib_bsd_gethostbyname = yes; then
9478   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
9479 fi
9480
9481       fi
9482     fi
9483
9484     # lieder@skyler.mavd.honeywell.com says without -lsocket,
9485     # socket/setsockopt and other routines are undefined under SCO ODT
9486     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
9487     # on later versions), says Simon Leinen: it contains gethostby*
9488     # variants that don't use the nameserver (or something).  -lsocket
9489     # must be given before -lnsl if both are needed.  We assume that
9490     # if connect needs -lnsl, so does gethostbyname.
9491     echo "$as_me:9491: checking for connect" >&5
9492 echo $ECHO_N "checking for connect... $ECHO_C" >&6
9493 if test "${ac_cv_func_connect+set}" = set; then
9494   echo $ECHO_N "(cached) $ECHO_C" >&6
9495 else
9496   cat >conftest.$ac_ext <<_ACEOF
9497 #line 9497 "configure"
9498 #include "confdefs.h"
9499 /* System header to define __stub macros and hopefully few prototypes,
9500     which can conflict with char connect (); below.  */
9501 #include <assert.h>
9502 /* Override any gcc2 internal prototype to avoid an error.  */
9503 #ifdef __cplusplus
9504 extern "C"
9505 #endif
9506 /* We use char because int might match the return type of a gcc2
9507    builtin and then its argument prototype would still apply.  */
9508 char connect ();
9509 char (*f) ();
9510
9511 int
9512 main ()
9513 {
9514 /* The GNU C library defines this for functions which it implements
9515     to always fail with ENOSYS.  Some functions are actually named
9516     something starting with __ and the normal name is an alias.  */
9517 #if defined (__stub_connect) || defined (__stub___connect)
9518 choke me
9519 #else
9520 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9521 #endif
9522
9523   ;
9524   return 0;
9525 }
9526 _ACEOF
9527 rm -f conftest.$ac_objext conftest$ac_exeext
9528 if { (eval echo "$as_me:9528: \"$ac_link\"") >&5
9529   (eval $ac_link) 2>&5
9530   ac_status=$?
9531   echo "$as_me:9531: \$? = $ac_status" >&5
9532   (exit $ac_status); } &&
9533          { ac_try='test -s conftest$ac_exeext'
9534   { (eval echo "$as_me:9534: \"$ac_try\"") >&5
9535   (eval $ac_try) 2>&5
9536   ac_status=$?
9537   echo "$as_me:9537: \$? = $ac_status" >&5
9538   (exit $ac_status); }; }; then
9539   ac_cv_func_connect=yes
9540 else
9541   echo "$as_me: failed program was:" >&5
9542 cat conftest.$ac_ext >&5
9543 ac_cv_func_connect=no
9544 fi
9545 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9546 fi
9547 echo "$as_me:9547: result: $ac_cv_func_connect" >&5
9548 echo "${ECHO_T}$ac_cv_func_connect" >&6
9549
9550     if test $ac_cv_func_connect = no; then
9551       echo "$as_me:9551: checking for connect in -lsocket" >&5
9552 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
9553 if test "${ac_cv_lib_socket_connect+set}" = set; then
9554   echo $ECHO_N "(cached) $ECHO_C" >&6
9555 else
9556   ac_check_lib_save_LIBS=$LIBS
9557 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
9558 cat >conftest.$ac_ext <<_ACEOF
9559 #line 9559 "configure"
9560 #include "confdefs.h"
9561
9562 /* Override any gcc2 internal prototype to avoid an error.  */
9563 #ifdef __cplusplus
9564 extern "C"
9565 #endif
9566 /* We use char because int might match the return type of a gcc2
9567    builtin and then its argument prototype would still apply.  */
9568 char connect ();
9569 int
9570 main ()
9571 {
9572 connect ();
9573   ;
9574   return 0;
9575 }
9576 _ACEOF
9577 rm -f conftest.$ac_objext conftest$ac_exeext
9578 if { (eval echo "$as_me:9578: \"$ac_link\"") >&5
9579   (eval $ac_link) 2>&5
9580   ac_status=$?
9581   echo "$as_me:9581: \$? = $ac_status" >&5
9582   (exit $ac_status); } &&
9583          { ac_try='test -s conftest$ac_exeext'
9584   { (eval echo "$as_me:9584: \"$ac_try\"") >&5
9585   (eval $ac_try) 2>&5
9586   ac_status=$?
9587   echo "$as_me:9587: \$? = $ac_status" >&5
9588   (exit $ac_status); }; }; then
9589   ac_cv_lib_socket_connect=yes
9590 else
9591   echo "$as_me: failed program was:" >&5
9592 cat conftest.$ac_ext >&5
9593 ac_cv_lib_socket_connect=no
9594 fi
9595 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9596 LIBS=$ac_check_lib_save_LIBS
9597 fi
9598 echo "$as_me:9598: result: $ac_cv_lib_socket_connect" >&5
9599 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
9600 if test $ac_cv_lib_socket_connect = yes; then
9601   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
9602 fi
9603
9604     fi
9605
9606     # Guillermo Gomez says -lposix is necessary on A/UX.
9607     echo "$as_me:9607: checking for remove" >&5
9608 echo $ECHO_N "checking for remove... $ECHO_C" >&6
9609 if test "${ac_cv_func_remove+set}" = set; then
9610   echo $ECHO_N "(cached) $ECHO_C" >&6
9611 else
9612   cat >conftest.$ac_ext <<_ACEOF
9613 #line 9613 "configure"
9614 #include "confdefs.h"
9615 /* System header to define __stub macros and hopefully few prototypes,
9616     which can conflict with char remove (); below.  */
9617 #include <assert.h>
9618 /* Override any gcc2 internal prototype to avoid an error.  */
9619 #ifdef __cplusplus
9620 extern "C"
9621 #endif
9622 /* We use char because int might match the return type of a gcc2
9623    builtin and then its argument prototype would still apply.  */
9624 char remove ();
9625 char (*f) ();
9626
9627 int
9628 main ()
9629 {
9630 /* The GNU C library defines this for functions which it implements
9631     to always fail with ENOSYS.  Some functions are actually named
9632     something starting with __ and the normal name is an alias.  */
9633 #if defined (__stub_remove) || defined (__stub___remove)
9634 choke me
9635 #else
9636 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9637 #endif
9638
9639   ;
9640   return 0;
9641 }
9642 _ACEOF
9643 rm -f conftest.$ac_objext conftest$ac_exeext
9644 if { (eval echo "$as_me:9644: \"$ac_link\"") >&5
9645   (eval $ac_link) 2>&5
9646   ac_status=$?
9647   echo "$as_me:9647: \$? = $ac_status" >&5
9648   (exit $ac_status); } &&
9649          { ac_try='test -s conftest$ac_exeext'
9650   { (eval echo "$as_me:9650: \"$ac_try\"") >&5
9651   (eval $ac_try) 2>&5
9652   ac_status=$?
9653   echo "$as_me:9653: \$? = $ac_status" >&5
9654   (exit $ac_status); }; }; then
9655   ac_cv_func_remove=yes
9656 else
9657   echo "$as_me: failed program was:" >&5
9658 cat conftest.$ac_ext >&5
9659 ac_cv_func_remove=no
9660 fi
9661 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9662 fi
9663 echo "$as_me:9663: result: $ac_cv_func_remove" >&5
9664 echo "${ECHO_T}$ac_cv_func_remove" >&6
9665
9666     if test $ac_cv_func_remove = no; then
9667       echo "$as_me:9667: checking for remove in -lposix" >&5
9668 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
9669 if test "${ac_cv_lib_posix_remove+set}" = set; then
9670   echo $ECHO_N "(cached) $ECHO_C" >&6
9671 else
9672   ac_check_lib_save_LIBS=$LIBS
9673 LIBS="-lposix  $LIBS"
9674 cat >conftest.$ac_ext <<_ACEOF
9675 #line 9675 "configure"
9676 #include "confdefs.h"
9677
9678 /* Override any gcc2 internal prototype to avoid an error.  */
9679 #ifdef __cplusplus
9680 extern "C"
9681 #endif
9682 /* We use char because int might match the return type of a gcc2
9683    builtin and then its argument prototype would still apply.  */
9684 char remove ();
9685 int
9686 main ()
9687 {
9688 remove ();
9689   ;
9690   return 0;
9691 }
9692 _ACEOF
9693 rm -f conftest.$ac_objext conftest$ac_exeext
9694 if { (eval echo "$as_me:9694: \"$ac_link\"") >&5
9695   (eval $ac_link) 2>&5
9696   ac_status=$?
9697   echo "$as_me:9697: \$? = $ac_status" >&5
9698   (exit $ac_status); } &&
9699          { ac_try='test -s conftest$ac_exeext'
9700   { (eval echo "$as_me:9700: \"$ac_try\"") >&5
9701   (eval $ac_try) 2>&5
9702   ac_status=$?
9703   echo "$as_me:9703: \$? = $ac_status" >&5
9704   (exit $ac_status); }; }; then
9705   ac_cv_lib_posix_remove=yes
9706 else
9707   echo "$as_me: failed program was:" >&5
9708 cat conftest.$ac_ext >&5
9709 ac_cv_lib_posix_remove=no
9710 fi
9711 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9712 LIBS=$ac_check_lib_save_LIBS
9713 fi
9714 echo "$as_me:9714: result: $ac_cv_lib_posix_remove" >&5
9715 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
9716 if test $ac_cv_lib_posix_remove = yes; then
9717   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
9718 fi
9719
9720     fi
9721
9722     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
9723     echo "$as_me:9723: checking for shmat" >&5
9724 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
9725 if test "${ac_cv_func_shmat+set}" = set; then
9726   echo $ECHO_N "(cached) $ECHO_C" >&6
9727 else
9728   cat >conftest.$ac_ext <<_ACEOF
9729 #line 9729 "configure"
9730 #include "confdefs.h"
9731 /* System header to define __stub macros and hopefully few prototypes,
9732     which can conflict with char shmat (); below.  */
9733 #include <assert.h>
9734 /* Override any gcc2 internal prototype to avoid an error.  */
9735 #ifdef __cplusplus
9736 extern "C"
9737 #endif
9738 /* We use char because int might match the return type of a gcc2
9739    builtin and then its argument prototype would still apply.  */
9740 char shmat ();
9741 char (*f) ();
9742
9743 int
9744 main ()
9745 {
9746 /* The GNU C library defines this for functions which it implements
9747     to always fail with ENOSYS.  Some functions are actually named
9748     something starting with __ and the normal name is an alias.  */
9749 #if defined (__stub_shmat) || defined (__stub___shmat)
9750 choke me
9751 #else
9752 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9753 #endif
9754
9755   ;
9756   return 0;
9757 }
9758 _ACEOF
9759 rm -f conftest.$ac_objext conftest$ac_exeext
9760 if { (eval echo "$as_me:9760: \"$ac_link\"") >&5
9761   (eval $ac_link) 2>&5
9762   ac_status=$?
9763   echo "$as_me:9763: \$? = $ac_status" >&5
9764   (exit $ac_status); } &&
9765          { ac_try='test -s conftest$ac_exeext'
9766   { (eval echo "$as_me:9766: \"$ac_try\"") >&5
9767   (eval $ac_try) 2>&5
9768   ac_status=$?
9769   echo "$as_me:9769: \$? = $ac_status" >&5
9770   (exit $ac_status); }; }; then
9771   ac_cv_func_shmat=yes
9772 else
9773   echo "$as_me: failed program was:" >&5
9774 cat conftest.$ac_ext >&5
9775 ac_cv_func_shmat=no
9776 fi
9777 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9778 fi
9779 echo "$as_me:9779: result: $ac_cv_func_shmat" >&5
9780 echo "${ECHO_T}$ac_cv_func_shmat" >&6
9781
9782     if test $ac_cv_func_shmat = no; then
9783       echo "$as_me:9783: checking for shmat in -lipc" >&5
9784 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
9785 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
9786   echo $ECHO_N "(cached) $ECHO_C" >&6
9787 else
9788   ac_check_lib_save_LIBS=$LIBS
9789 LIBS="-lipc  $LIBS"
9790 cat >conftest.$ac_ext <<_ACEOF
9791 #line 9791 "configure"
9792 #include "confdefs.h"
9793
9794 /* Override any gcc2 internal prototype to avoid an error.  */
9795 #ifdef __cplusplus
9796 extern "C"
9797 #endif
9798 /* We use char because int might match the return type of a gcc2
9799    builtin and then its argument prototype would still apply.  */
9800 char shmat ();
9801 int
9802 main ()
9803 {
9804 shmat ();
9805   ;
9806   return 0;
9807 }
9808 _ACEOF
9809 rm -f conftest.$ac_objext conftest$ac_exeext
9810 if { (eval echo "$as_me:9810: \"$ac_link\"") >&5
9811   (eval $ac_link) 2>&5
9812   ac_status=$?
9813   echo "$as_me:9813: \$? = $ac_status" >&5
9814   (exit $ac_status); } &&
9815          { ac_try='test -s conftest$ac_exeext'
9816   { (eval echo "$as_me:9816: \"$ac_try\"") >&5
9817   (eval $ac_try) 2>&5
9818   ac_status=$?
9819   echo "$as_me:9819: \$? = $ac_status" >&5
9820   (exit $ac_status); }; }; then
9821   ac_cv_lib_ipc_shmat=yes
9822 else
9823   echo "$as_me: failed program was:" >&5
9824 cat conftest.$ac_ext >&5
9825 ac_cv_lib_ipc_shmat=no
9826 fi
9827 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9828 LIBS=$ac_check_lib_save_LIBS
9829 fi
9830 echo "$as_me:9830: result: $ac_cv_lib_ipc_shmat" >&5
9831 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
9832 if test $ac_cv_lib_ipc_shmat = yes; then
9833   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
9834 fi
9835
9836     fi
9837   fi
9838
9839   # Check for libraries that X11R6 Xt/Xaw programs need.
9840   ac_save_LDFLAGS=$LDFLAGS
9841   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
9842   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
9843   # check for ICE first), but we must link in the order -lSM -lICE or
9844   # we get undefined symbols.  So assume we have SM if we have ICE.
9845   # These have to be linked with before -lX11, unlike the other
9846   # libraries we check for below, so use a different variable.
9847   # John Interrante, Karl Berry
9848   echo "$as_me:9848: checking for IceConnectionNumber in -lICE" >&5
9849 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
9850 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
9851   echo $ECHO_N "(cached) $ECHO_C" >&6
9852 else
9853   ac_check_lib_save_LIBS=$LIBS
9854 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
9855 cat >conftest.$ac_ext <<_ACEOF
9856 #line 9856 "configure"
9857 #include "confdefs.h"
9858
9859 /* Override any gcc2 internal prototype to avoid an error.  */
9860 #ifdef __cplusplus
9861 extern "C"
9862 #endif
9863 /* We use char because int might match the return type of a gcc2
9864    builtin and then its argument prototype would still apply.  */
9865 char IceConnectionNumber ();
9866 int
9867 main ()
9868 {
9869 IceConnectionNumber ();
9870   ;
9871   return 0;
9872 }
9873 _ACEOF
9874 rm -f conftest.$ac_objext conftest$ac_exeext
9875 if { (eval echo "$as_me:9875: \"$ac_link\"") >&5
9876   (eval $ac_link) 2>&5
9877   ac_status=$?
9878   echo "$as_me:9878: \$? = $ac_status" >&5
9879   (exit $ac_status); } &&
9880          { ac_try='test -s conftest$ac_exeext'
9881   { (eval echo "$as_me:9881: \"$ac_try\"") >&5
9882   (eval $ac_try) 2>&5
9883   ac_status=$?
9884   echo "$as_me:9884: \$? = $ac_status" >&5
9885   (exit $ac_status); }; }; then
9886   ac_cv_lib_ICE_IceConnectionNumber=yes
9887 else
9888   echo "$as_me: failed program was:" >&5
9889 cat conftest.$ac_ext >&5
9890 ac_cv_lib_ICE_IceConnectionNumber=no
9891 fi
9892 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9893 LIBS=$ac_check_lib_save_LIBS
9894 fi
9895 echo "$as_me:9895: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
9896 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
9897 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
9898   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
9899 fi
9900
9901   LDFLAGS=$ac_save_LDFLAGS
9902
9903 fi
9904
9905 cf_x_athena=${cf_x_athena:-Xaw}
9906
9907 echo "$as_me:9907: checking if you want to link with Xaw 3d library" >&5
9908 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
9909 withval=
9910
9911 # Check whether --with-Xaw3d or --without-Xaw3d was given.
9912 if test "${with_Xaw3d+set}" = set; then
9913   withval="$with_Xaw3d"
9914
9915 fi;
9916 if test "$withval" = yes ; then
9917         cf_x_athena=Xaw3d
9918         echo "$as_me:9918: result: yes" >&5
9919 echo "${ECHO_T}yes" >&6
9920 else
9921         echo "$as_me:9921: result: no" >&5
9922 echo "${ECHO_T}no" >&6
9923 fi
9924
9925 echo "$as_me:9925: checking if you want to link with neXT Athena library" >&5
9926 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
9927 withval=
9928
9929 # Check whether --with-neXtaw or --without-neXtaw was given.
9930 if test "${with_neXtaw+set}" = set; then
9931   withval="$with_neXtaw"
9932
9933 fi;
9934 if test "$withval" = yes ; then
9935         cf_x_athena=neXtaw
9936         echo "$as_me:9936: result: yes" >&5
9937 echo "${ECHO_T}yes" >&6
9938 else
9939         echo "$as_me:9939: result: no" >&5
9940 echo "${ECHO_T}no" >&6
9941 fi
9942
9943 echo "$as_me:9943: checking if you want to link with Athena-Plus library" >&5
9944 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
9945 withval=
9946
9947 # Check whether --with-XawPlus or --without-XawPlus was given.
9948 if test "${with_XawPlus+set}" = set; then
9949   withval="$with_XawPlus"
9950
9951 fi;
9952 if test "$withval" = yes ; then
9953         cf_x_athena=XawPlus
9954         echo "$as_me:9954: result: yes" >&5
9955 echo "${ECHO_T}yes" >&6
9956 else
9957         echo "$as_me:9957: result: no" >&5
9958 echo "${ECHO_T}no" >&6
9959 fi
9960
9961 cf_x_athena_lib=""
9962
9963 if test "$PKG_CONFIG" != none ; then
9964         cf_athena_list=
9965         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
9966         for cf_athena_pkg in \
9967                 $cf_athena_list \
9968                 ${cf_x_athena} \
9969                 ${cf_x_athena}-devel \
9970                 lib${cf_x_athena} \
9971                 lib${cf_x_athena}-devel
9972         do
9973
9974 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
9975         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
9976
9977 echo "${as_me:-configure}:9977: testing found package $cf_athena_pkg ..." 1>&5
9978
9979         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
9980         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
9981         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
9982
9983 echo "${as_me:-configure}:9983: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
9984
9985         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
9986
9987 echo "${as_me:-configure}:9987: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
9988
9989 cf_fix_cppflags=no
9990 cf_new_cflags=
9991 cf_new_cppflags=
9992 cf_new_extra_cppflags=
9993
9994 for cf_add_cflags in $cf_pkgconfig_incs
9995 do
9996 case $cf_fix_cppflags in
9997 no)
9998         case $cf_add_cflags in #(vi
9999         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10000                 case $cf_add_cflags in
10001                 -D*)
10002                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10003
10004                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10005                                 && test -z "${cf_tst_cflags}" \
10006                                 && cf_fix_cppflags=yes
10007
10008                         if test $cf_fix_cppflags = yes ; then
10009                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10010                                 continue
10011                         elif test "${cf_tst_cflags}" = "\"'" ; then
10012                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10013                                 continue
10014                         fi
10015                         ;;
10016                 esac
10017                 case "$CPPFLAGS" in
10018                 *$cf_add_cflags) #(vi
10019                         ;;
10020                 *) #(vi
10021                         case $cf_add_cflags in #(vi
10022                         -D*)
10023                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10024
10025 CPPFLAGS=`echo "$CPPFLAGS" | \
10026         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10027                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10028
10029                                 ;;
10030                         esac
10031                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10032                         ;;
10033                 esac
10034                 ;;
10035         *)
10036                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10037                 ;;
10038         esac
10039         ;;
10040 yes)
10041         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10042
10043         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10044
10045         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10046                 && test -z "${cf_tst_cflags}" \
10047                 && cf_fix_cppflags=no
10048         ;;
10049 esac
10050 done
10051
10052 if test -n "$cf_new_cflags" ; then
10053
10054         CFLAGS="$CFLAGS $cf_new_cflags"
10055 fi
10056
10057 if test -n "$cf_new_cppflags" ; then
10058
10059         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10060 fi
10061
10062 if test -n "$cf_new_extra_cppflags" ; then
10063
10064         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10065 fi
10066
10067         LIBS="$cf_pkgconfig_libs $LIBS"
10068
10069                         cf_x_athena_lib="$cf_pkgconfig_libs"
10070
10071 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10072
10073                         cat >>confdefs.h <<EOF
10074 #define $cf_x_athena_LIBS 1
10075 EOF
10076
10077         for cf_trim_lib in Xmu Xt X11
10078         do
10079                 case "$LIBS" in
10080                 *-l$cf_trim_lib\ *-l$cf_trim_lib*)
10081                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10082                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10083
10084 echo "${as_me:-configure}:10084: testing ..trimmed $LIBS ..." 1>&5
10085
10086                         ;;
10087                 esac
10088         done
10089
10090 echo "$as_me:10090: checking for usable $cf_x_athena/Xmu package" >&5
10091 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10092 if test "${cf_cv_xaw_compat+set}" = set; then
10093   echo $ECHO_N "(cached) $ECHO_C" >&6
10094 else
10095
10096 cat >conftest.$ac_ext <<_ACEOF
10097 #line 10097 "configure"
10098 #include "confdefs.h"
10099
10100 #include <X11/Xmu/CharSet.h>
10101
10102 int
10103 main ()
10104 {
10105
10106 int check = XmuCompareISOLatin1("big", "small")
10107
10108   ;
10109   return 0;
10110 }
10111 _ACEOF
10112 rm -f conftest.$ac_objext conftest$ac_exeext
10113 if { (eval echo "$as_me:10113: \"$ac_link\"") >&5
10114   (eval $ac_link) 2>&5
10115   ac_status=$?
10116   echo "$as_me:10116: \$? = $ac_status" >&5
10117   (exit $ac_status); } &&
10118          { ac_try='test -s conftest$ac_exeext'
10119   { (eval echo "$as_me:10119: \"$ac_try\"") >&5
10120   (eval $ac_try) 2>&5
10121   ac_status=$?
10122   echo "$as_me:10122: \$? = $ac_status" >&5
10123   (exit $ac_status); }; }; then
10124   cf_cv_xaw_compat=yes
10125 else
10126   echo "$as_me: failed program was:" >&5
10127 cat conftest.$ac_ext >&5
10128 cf_cv_xaw_compat=no
10129 fi
10130 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10131 fi
10132 echo "$as_me:10132: result: $cf_cv_xaw_compat" >&5
10133 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10134
10135                         if test "$cf_cv_xaw_compat" = no
10136                         then
10137                                 # workaround for broken ".pc" files...
10138                                 case "$cf_x_athena_lib" in #(vi
10139                                 *-lXmu*) #(vi
10140                                         ;;
10141                                 *)
10142                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10143
10144 echo "${as_me:-configure}:10144: testing work around broken package ..." 1>&5
10145
10146                                         cf_save_xmu="$LIBS"
10147                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
10148
10149 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10150         test -n "$verbose" && echo "    found package xmu" 1>&6
10151
10152 echo "${as_me:-configure}:10152: testing found package xmu ..." 1>&5
10153
10154         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10155         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10156         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10157
10158 echo "${as_me:-configure}:10158: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10159
10160         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10161
10162 echo "${as_me:-configure}:10162: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10163
10164 cf_fix_cppflags=no
10165 cf_new_cflags=
10166 cf_new_cppflags=
10167 cf_new_extra_cppflags=
10168
10169 for cf_add_cflags in $cf_pkgconfig_incs
10170 do
10171 case $cf_fix_cppflags in
10172 no)
10173         case $cf_add_cflags in #(vi
10174         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10175                 case $cf_add_cflags in
10176                 -D*)
10177                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10178
10179                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10180                                 && test -z "${cf_tst_cflags}" \
10181                                 && cf_fix_cppflags=yes
10182
10183                         if test $cf_fix_cppflags = yes ; then
10184                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10185                                 continue
10186                         elif test "${cf_tst_cflags}" = "\"'" ; then
10187                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10188                                 continue
10189                         fi
10190                         ;;
10191                 esac
10192                 case "$CPPFLAGS" in
10193                 *$cf_add_cflags) #(vi
10194                         ;;
10195                 *) #(vi
10196                         case $cf_add_cflags in #(vi
10197                         -D*)
10198                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10199
10200 CPPFLAGS=`echo "$CPPFLAGS" | \
10201         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10202                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10203
10204                                 ;;
10205                         esac
10206                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10207                         ;;
10208                 esac
10209                 ;;
10210         *)
10211                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10212                 ;;
10213         esac
10214         ;;
10215 yes)
10216         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10217
10218         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10219
10220         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10221                 && test -z "${cf_tst_cflags}" \
10222                 && cf_fix_cppflags=no
10223         ;;
10224 esac
10225 done
10226
10227 if test -n "$cf_new_cflags" ; then
10228
10229         CFLAGS="$CFLAGS $cf_new_cflags"
10230 fi
10231
10232 if test -n "$cf_new_cppflags" ; then
10233
10234         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10235 fi
10236
10237 if test -n "$cf_new_extra_cppflags" ; then
10238
10239         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10240 fi
10241
10242         LIBS="$cf_pkgconfig_libs $LIBS"
10243
10244                                                         LIBS="$cf_save_xmu"
10245
10246 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10247
10248 echo "${as_me:-configure}:10248: testing ...before $LIBS ..." 1>&5
10249
10250 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
10251 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10252
10253 echo "${as_me:-configure}:10253: testing ...after  $LIBS ..." 1>&5
10254
10255 else
10256         cf_pkgconfig_incs=
10257         cf_pkgconfig_libs=
10258
10259 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10260
10261 echo "${as_me:-configure}:10261: testing ...before $LIBS ..." 1>&5
10262
10263 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
10264 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10265
10266 echo "${as_me:-configure}:10266: testing ...after  $LIBS ..." 1>&5
10267
10268 fi
10269
10270         for cf_trim_lib in Xmu Xt X11
10271         do
10272                 case "$LIBS" in
10273                 *-l$cf_trim_lib\ *-l$cf_trim_lib*)
10274                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10275                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10276
10277 echo "${as_me:-configure}:10277: testing ..trimmed $LIBS ..." 1>&5
10278
10279                         ;;
10280                 esac
10281         done
10282
10283                                         ;;
10284                                 esac
10285                         fi
10286
10287                         break
10288 else
10289         cf_pkgconfig_incs=
10290         cf_pkgconfig_libs=
10291         :
10292 fi
10293
10294         done
10295 fi
10296
10297 if test -z "$cf_x_athena_lib" ; then
10298
10299 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10300         test -n "$verbose" && echo "    found package Xext" 1>&6
10301
10302 echo "${as_me:-configure}:10302: testing found package Xext ..." 1>&5
10303
10304         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10305         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10306         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10307
10308 echo "${as_me:-configure}:10308: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10309
10310         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10311
10312 echo "${as_me:-configure}:10312: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10313
10314 cf_fix_cppflags=no
10315 cf_new_cflags=
10316 cf_new_cppflags=
10317 cf_new_extra_cppflags=
10318
10319 for cf_add_cflags in $cf_pkgconfig_incs
10320 do
10321 case $cf_fix_cppflags in
10322 no)
10323         case $cf_add_cflags in #(vi
10324         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10325                 case $cf_add_cflags in
10326                 -D*)
10327                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10328
10329                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10330                                 && test -z "${cf_tst_cflags}" \
10331                                 && cf_fix_cppflags=yes
10332
10333                         if test $cf_fix_cppflags = yes ; then
10334                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10335                                 continue
10336                         elif test "${cf_tst_cflags}" = "\"'" ; then
10337                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10338                                 continue
10339                         fi
10340                         ;;
10341                 esac
10342                 case "$CPPFLAGS" in
10343                 *$cf_add_cflags) #(vi
10344                         ;;
10345                 *) #(vi
10346                         case $cf_add_cflags in #(vi
10347                         -D*)
10348                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10349
10350 CPPFLAGS=`echo "$CPPFLAGS" | \
10351         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10352                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10353
10354                                 ;;
10355                         esac
10356                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10357                         ;;
10358                 esac
10359                 ;;
10360         *)
10361                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10362                 ;;
10363         esac
10364         ;;
10365 yes)
10366         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10367
10368         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10369
10370         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10371                 && test -z "${cf_tst_cflags}" \
10372                 && cf_fix_cppflags=no
10373         ;;
10374 esac
10375 done
10376
10377 if test -n "$cf_new_cflags" ; then
10378
10379         CFLAGS="$CFLAGS $cf_new_cflags"
10380 fi
10381
10382 if test -n "$cf_new_cppflags" ; then
10383
10384         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10385 fi
10386
10387 if test -n "$cf_new_extra_cppflags" ; then
10388
10389         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10390 fi
10391
10392         LIBS="$cf_pkgconfig_libs $LIBS"
10393         :
10394 else
10395         cf_pkgconfig_incs=
10396         cf_pkgconfig_libs=
10397
10398         echo "$as_me:10398: checking for XextCreateExtension in -lXext" >&5
10399 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10400 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10401   echo $ECHO_N "(cached) $ECHO_C" >&6
10402 else
10403   ac_check_lib_save_LIBS=$LIBS
10404 LIBS="-lXext  $LIBS"
10405 cat >conftest.$ac_ext <<_ACEOF
10406 #line 10406 "configure"
10407 #include "confdefs.h"
10408
10409 /* Override any gcc2 internal prototype to avoid an error.  */
10410 #ifdef __cplusplus
10411 extern "C"
10412 #endif
10413 /* We use char because int might match the return type of a gcc2
10414    builtin and then its argument prototype would still apply.  */
10415 char XextCreateExtension ();
10416 int
10417 main ()
10418 {
10419 XextCreateExtension ();
10420   ;
10421   return 0;
10422 }
10423 _ACEOF
10424 rm -f conftest.$ac_objext conftest$ac_exeext
10425 if { (eval echo "$as_me:10425: \"$ac_link\"") >&5
10426   (eval $ac_link) 2>&5
10427   ac_status=$?
10428   echo "$as_me:10428: \$? = $ac_status" >&5
10429   (exit $ac_status); } &&
10430          { ac_try='test -s conftest$ac_exeext'
10431   { (eval echo "$as_me:10431: \"$ac_try\"") >&5
10432   (eval $ac_try) 2>&5
10433   ac_status=$?
10434   echo "$as_me:10434: \$? = $ac_status" >&5
10435   (exit $ac_status); }; }; then
10436   ac_cv_lib_Xext_XextCreateExtension=yes
10437 else
10438   echo "$as_me: failed program was:" >&5
10439 cat conftest.$ac_ext >&5
10440 ac_cv_lib_Xext_XextCreateExtension=no
10441 fi
10442 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10443 LIBS=$ac_check_lib_save_LIBS
10444 fi
10445 echo "$as_me:10445: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
10446 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
10447 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
10448   LIBS="-lXext $LIBS"
10449 fi
10450
10451 fi
10452
10453 cf_have_X_LIBS=no
10454
10455 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
10456         test -n "$verbose" && echo "    found package xt" 1>&6
10457
10458 echo "${as_me:-configure}:10458: testing found package xt ..." 1>&5
10459
10460         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
10461         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
10462         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
10463
10464 echo "${as_me:-configure}:10464: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10465
10466         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
10467
10468 echo "${as_me:-configure}:10468: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
10469
10470 cf_fix_cppflags=no
10471 cf_new_cflags=
10472 cf_new_cppflags=
10473 cf_new_extra_cppflags=
10474
10475 for cf_add_cflags in $cf_pkgconfig_incs
10476 do
10477 case $cf_fix_cppflags in
10478 no)
10479         case $cf_add_cflags in #(vi
10480         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10481                 case $cf_add_cflags in
10482                 -D*)
10483                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10484
10485                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10486                                 && test -z "${cf_tst_cflags}" \
10487                                 && cf_fix_cppflags=yes
10488
10489                         if test $cf_fix_cppflags = yes ; then
10490                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10491                                 continue
10492                         elif test "${cf_tst_cflags}" = "\"'" ; then
10493                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10494                                 continue
10495                         fi
10496                         ;;
10497                 esac
10498                 case "$CPPFLAGS" in
10499                 *$cf_add_cflags) #(vi
10500                         ;;
10501                 *) #(vi
10502                         case $cf_add_cflags in #(vi
10503                         -D*)
10504                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10505
10506 CPPFLAGS=`echo "$CPPFLAGS" | \
10507         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10508                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10509
10510                                 ;;
10511                         esac
10512                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10513                         ;;
10514                 esac
10515                 ;;
10516         *)
10517                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10518                 ;;
10519         esac
10520         ;;
10521 yes)
10522         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10523
10524         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10525
10526         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10527                 && test -z "${cf_tst_cflags}" \
10528                 && cf_fix_cppflags=no
10529         ;;
10530 esac
10531 done
10532
10533 if test -n "$cf_new_cflags" ; then
10534
10535         CFLAGS="$CFLAGS $cf_new_cflags"
10536 fi
10537
10538 if test -n "$cf_new_cppflags" ; then
10539
10540         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10541 fi
10542
10543 if test -n "$cf_new_extra_cppflags" ; then
10544
10545         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10546 fi
10547
10548         LIBS="$cf_pkgconfig_libs $LIBS"
10549
10550         case "x$LIBS" in #(vi
10551         *-lX11*) #(vi
10552                 ;;
10553         *)
10554 # we have an "xt" package, but it may omit Xt's dependency on X11
10555 echo "$as_me:10555: checking for usable X dependency" >&5
10556 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
10557 if test "${cf_cv_xt_x11_compat+set}" = set; then
10558   echo $ECHO_N "(cached) $ECHO_C" >&6
10559 else
10560
10561 cat >conftest.$ac_ext <<_ACEOF
10562 #line 10562 "configure"
10563 #include "confdefs.h"
10564
10565 #include <X11/Xlib.h>
10566
10567 int
10568 main ()
10569 {
10570
10571         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
10572         int rc2 = XClearWindow((Display*) 0, (Window) 0);
10573         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
10574         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
10575
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   cf_cv_xt_x11_compat=yes
10593 else
10594   echo "$as_me: failed program was:" >&5
10595 cat conftest.$ac_ext >&5
10596 cf_cv_xt_x11_compat=no
10597 fi
10598 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10599 fi
10600 echo "$as_me:10600: result: $cf_cv_xt_x11_compat" >&5
10601 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
10602                 if test "$cf_cv_xt_x11_compat" = no
10603                 then
10604                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
10605
10606 echo "${as_me:-configure}:10606: testing work around broken X11 dependency ..." 1>&5
10607
10608                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
10609
10610 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
10611         test -n "$verbose" && echo "    found package x11" 1>&6
10612
10613 echo "${as_me:-configure}:10613: testing found package x11 ..." 1>&5
10614
10615         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
10616         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
10617         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
10618
10619 echo "${as_me:-configure}:10619: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10620
10621         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
10622
10623 echo "${as_me:-configure}:10623: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
10624
10625 cf_fix_cppflags=no
10626 cf_new_cflags=
10627 cf_new_cppflags=
10628 cf_new_extra_cppflags=
10629
10630 for cf_add_cflags in $cf_pkgconfig_incs
10631 do
10632 case $cf_fix_cppflags in
10633 no)
10634         case $cf_add_cflags in #(vi
10635         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10636                 case $cf_add_cflags in
10637                 -D*)
10638                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10639
10640                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10641                                 && test -z "${cf_tst_cflags}" \
10642                                 && cf_fix_cppflags=yes
10643
10644                         if test $cf_fix_cppflags = yes ; then
10645                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10646                                 continue
10647                         elif test "${cf_tst_cflags}" = "\"'" ; then
10648                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10649                                 continue
10650                         fi
10651                         ;;
10652                 esac
10653                 case "$CPPFLAGS" in
10654                 *$cf_add_cflags) #(vi
10655                         ;;
10656                 *) #(vi
10657                         case $cf_add_cflags in #(vi
10658                         -D*)
10659                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10660
10661 CPPFLAGS=`echo "$CPPFLAGS" | \
10662         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10663                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10664
10665                                 ;;
10666                         esac
10667                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10668                         ;;
10669                 esac
10670                 ;;
10671         *)
10672                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10673                 ;;
10674         esac
10675         ;;
10676 yes)
10677         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10678
10679         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10680
10681         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10682                 && test -z "${cf_tst_cflags}" \
10683                 && cf_fix_cppflags=no
10684         ;;
10685 esac
10686 done
10687
10688 if test -n "$cf_new_cflags" ; then
10689
10690         CFLAGS="$CFLAGS $cf_new_cflags"
10691 fi
10692
10693 if test -n "$cf_new_cppflags" ; then
10694
10695         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10696 fi
10697
10698 if test -n "$cf_new_extra_cppflags" ; then
10699
10700         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10701 fi
10702
10703         LIBS="$cf_pkgconfig_libs $LIBS"
10704         :
10705 else
10706         cf_pkgconfig_incs=
10707         cf_pkgconfig_libs=
10708
10709 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10710
10711 echo "${as_me:-configure}:10711: testing ...before $LIBS ..." 1>&5
10712
10713 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
10714 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10715
10716 echo "${as_me:-configure}:10716: testing ...after  $LIBS ..." 1>&5
10717
10718 fi
10719
10720                 fi
10721                 ;;
10722         esac
10723
10724 echo "$as_me:10724: checking for usable X Toolkit package" >&5
10725 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
10726 if test "${cf_cv_xt_ice_compat+set}" = set; then
10727   echo $ECHO_N "(cached) $ECHO_C" >&6
10728 else
10729
10730 cat >conftest.$ac_ext <<_ACEOF
10731 #line 10731 "configure"
10732 #include "confdefs.h"
10733
10734 #include <X11/Shell.h>
10735
10736 int
10737 main ()
10738 {
10739 int num = IceConnectionNumber(0)
10740
10741   ;
10742   return 0;
10743 }
10744 _ACEOF
10745 rm -f conftest.$ac_objext conftest$ac_exeext
10746 if { (eval echo "$as_me:10746: \"$ac_link\"") >&5
10747   (eval $ac_link) 2>&5
10748   ac_status=$?
10749   echo "$as_me:10749: \$? = $ac_status" >&5
10750   (exit $ac_status); } &&
10751          { ac_try='test -s conftest$ac_exeext'
10752   { (eval echo "$as_me:10752: \"$ac_try\"") >&5
10753   (eval $ac_try) 2>&5
10754   ac_status=$?
10755   echo "$as_me:10755: \$? = $ac_status" >&5
10756   (exit $ac_status); }; }; then
10757   cf_cv_xt_ice_compat=yes
10758 else
10759   echo "$as_me: failed program was:" >&5
10760 cat conftest.$ac_ext >&5
10761 cf_cv_xt_ice_compat=no
10762 fi
10763 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10764 fi
10765 echo "$as_me:10765: result: $cf_cv_xt_ice_compat" >&5
10766 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
10767
10768         if test "$cf_cv_xt_ice_compat" = no
10769         then
10770                 # workaround for broken ".pc" files used for X Toolkit.
10771                 case "x$X_PRE_LIBS" in #(vi
10772                 *-lICE*)
10773                         case "x$LIBS" in #(vi
10774                         *-lICE*) #(vi
10775                                 ;;
10776                         *)
10777                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
10778
10779 echo "${as_me:-configure}:10779: testing work around broken ICE dependency ..." 1>&5
10780
10781 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
10782         test -n "$verbose" && echo "    found package ice" 1>&6
10783
10784 echo "${as_me:-configure}:10784: testing found package ice ..." 1>&5
10785
10786         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
10787         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
10788         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
10789
10790 echo "${as_me:-configure}:10790: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10791
10792         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
10793
10794 echo "${as_me:-configure}:10794: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
10795
10796 cf_fix_cppflags=no
10797 cf_new_cflags=
10798 cf_new_cppflags=
10799 cf_new_extra_cppflags=
10800
10801 for cf_add_cflags in $cf_pkgconfig_incs
10802 do
10803 case $cf_fix_cppflags in
10804 no)
10805         case $cf_add_cflags in #(vi
10806         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10807                 case $cf_add_cflags in
10808                 -D*)
10809                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10810
10811                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10812                                 && test -z "${cf_tst_cflags}" \
10813                                 && cf_fix_cppflags=yes
10814
10815                         if test $cf_fix_cppflags = yes ; then
10816                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10817                                 continue
10818                         elif test "${cf_tst_cflags}" = "\"'" ; then
10819                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10820                                 continue
10821                         fi
10822                         ;;
10823                 esac
10824                 case "$CPPFLAGS" in
10825                 *$cf_add_cflags) #(vi
10826                         ;;
10827                 *) #(vi
10828                         case $cf_add_cflags in #(vi
10829                         -D*)
10830                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10831
10832 CPPFLAGS=`echo "$CPPFLAGS" | \
10833         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10834                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10835
10836                                 ;;
10837                         esac
10838                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10839                         ;;
10840                 esac
10841                 ;;
10842         *)
10843                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10844                 ;;
10845         esac
10846         ;;
10847 yes)
10848         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10849
10850         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10851
10852         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10853                 && test -z "${cf_tst_cflags}" \
10854                 && cf_fix_cppflags=no
10855         ;;
10856 esac
10857 done
10858
10859 if test -n "$cf_new_cflags" ; then
10860
10861         CFLAGS="$CFLAGS $cf_new_cflags"
10862 fi
10863
10864 if test -n "$cf_new_cppflags" ; then
10865
10866         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10867 fi
10868
10869 if test -n "$cf_new_extra_cppflags" ; then
10870
10871         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10872 fi
10873
10874         LIBS="$cf_pkgconfig_libs $LIBS"
10875
10876 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
10877         test -n "$verbose" && echo "    found package sm" 1>&6
10878
10879 echo "${as_me:-configure}:10879: testing found package sm ..." 1>&5
10880
10881         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
10882         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
10883         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
10884
10885 echo "${as_me:-configure}:10885: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10886
10887         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
10888
10889 echo "${as_me:-configure}:10889: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
10890
10891 cf_fix_cppflags=no
10892 cf_new_cflags=
10893 cf_new_cppflags=
10894 cf_new_extra_cppflags=
10895
10896 for cf_add_cflags in $cf_pkgconfig_incs
10897 do
10898 case $cf_fix_cppflags in
10899 no)
10900         case $cf_add_cflags in #(vi
10901         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10902                 case $cf_add_cflags in
10903                 -D*)
10904                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10905
10906                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10907                                 && test -z "${cf_tst_cflags}" \
10908                                 && cf_fix_cppflags=yes
10909
10910                         if test $cf_fix_cppflags = yes ; then
10911                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10912                                 continue
10913                         elif test "${cf_tst_cflags}" = "\"'" ; then
10914                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10915                                 continue
10916                         fi
10917                         ;;
10918                 esac
10919                 case "$CPPFLAGS" in
10920                 *$cf_add_cflags) #(vi
10921                         ;;
10922                 *) #(vi
10923                         case $cf_add_cflags in #(vi
10924                         -D*)
10925                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10926
10927 CPPFLAGS=`echo "$CPPFLAGS" | \
10928         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10929                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10930
10931                                 ;;
10932                         esac
10933                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10934                         ;;
10935                 esac
10936                 ;;
10937         *)
10938                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10939                 ;;
10940         esac
10941         ;;
10942 yes)
10943         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10944
10945         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10946
10947         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10948                 && test -z "${cf_tst_cflags}" \
10949                 && cf_fix_cppflags=no
10950         ;;
10951 esac
10952 done
10953
10954 if test -n "$cf_new_cflags" ; then
10955
10956         CFLAGS="$CFLAGS $cf_new_cflags"
10957 fi
10958
10959 if test -n "$cf_new_cppflags" ; then
10960
10961         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10962 fi
10963
10964 if test -n "$cf_new_extra_cppflags" ; then
10965
10966         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10967 fi
10968
10969         LIBS="$cf_pkgconfig_libs $LIBS"
10970         :
10971 else
10972         cf_pkgconfig_incs=
10973         cf_pkgconfig_libs=
10974         :
10975 fi
10976
10977 else
10978         cf_pkgconfig_incs=
10979         cf_pkgconfig_libs=
10980
10981 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10982
10983 echo "${as_me:-configure}:10983: testing ...before $LIBS ..." 1>&5
10984
10985 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
10986 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10987
10988 echo "${as_me:-configure}:10988: testing ...after  $LIBS ..." 1>&5
10989
10990 fi
10991
10992                                 ;;
10993                         esac
10994                         ;;
10995                 esac
10996         fi
10997
10998         cf_have_X_LIBS=yes
10999
11000 else
11001         cf_pkgconfig_incs=
11002         cf_pkgconfig_libs=
11003
11004         LDFLAGS="$X_LIBS $LDFLAGS"
11005
11006 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11007
11008 echo "${as_me:-configure}:11008: testing checking additions to CFLAGS ..." 1>&5
11009
11010 cf_check_cflags="$CFLAGS"
11011 cf_check_cppflags="$CPPFLAGS"
11012
11013 cf_fix_cppflags=no
11014 cf_new_cflags=
11015 cf_new_cppflags=
11016 cf_new_extra_cppflags=
11017
11018 for cf_add_cflags in $X_CFLAGS
11019 do
11020 case $cf_fix_cppflags in
11021 no)
11022         case $cf_add_cflags in #(vi
11023         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11024                 case $cf_add_cflags in
11025                 -D*)
11026                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11027
11028                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11029                                 && test -z "${cf_tst_cflags}" \
11030                                 && cf_fix_cppflags=yes
11031
11032                         if test $cf_fix_cppflags = yes ; then
11033                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11034                                 continue
11035                         elif test "${cf_tst_cflags}" = "\"'" ; then
11036                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11037                                 continue
11038                         fi
11039                         ;;
11040                 esac
11041                 case "$CPPFLAGS" in
11042                 *$cf_add_cflags) #(vi
11043                         ;;
11044                 *) #(vi
11045                         case $cf_add_cflags in #(vi
11046                         -D*)
11047                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11048
11049 CPPFLAGS=`echo "$CPPFLAGS" | \
11050         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11051                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11052
11053                                 ;;
11054                         esac
11055                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11056                         ;;
11057                 esac
11058                 ;;
11059         *)
11060                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11061                 ;;
11062         esac
11063         ;;
11064 yes)
11065         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11066
11067         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11068
11069         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11070                 && test -z "${cf_tst_cflags}" \
11071                 && cf_fix_cppflags=no
11072         ;;
11073 esac
11074 done
11075
11076 if test -n "$cf_new_cflags" ; then
11077         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11078
11079 echo "${as_me:-configure}:11079: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11080
11081         CFLAGS="$CFLAGS $cf_new_cflags"
11082 fi
11083
11084 if test -n "$cf_new_cppflags" ; then
11085         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11086
11087 echo "${as_me:-configure}:11087: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11088
11089         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11090 fi
11091
11092 if test -n "$cf_new_extra_cppflags" ; then
11093         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11094
11095 echo "${as_me:-configure}:11095: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11096
11097         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11098 fi
11099
11100 if test "$cf_check_cflags" != "$CFLAGS" ; then
11101 cat >conftest.$ac_ext <<_ACEOF
11102 #line 11102 "configure"
11103 #include "confdefs.h"
11104 #include <stdio.h>
11105 int
11106 main ()
11107 {
11108 printf("Hello world");
11109   ;
11110   return 0;
11111 }
11112 _ACEOF
11113 rm -f conftest.$ac_objext conftest$ac_exeext
11114 if { (eval echo "$as_me:11114: \"$ac_link\"") >&5
11115   (eval $ac_link) 2>&5
11116   ac_status=$?
11117   echo "$as_me:11117: \$? = $ac_status" >&5
11118   (exit $ac_status); } &&
11119          { ac_try='test -s conftest$ac_exeext'
11120   { (eval echo "$as_me:11120: \"$ac_try\"") >&5
11121   (eval $ac_try) 2>&5
11122   ac_status=$?
11123   echo "$as_me:11123: \$? = $ac_status" >&5
11124   (exit $ac_status); }; }; then
11125   :
11126 else
11127   echo "$as_me: failed program was:" >&5
11128 cat conftest.$ac_ext >&5
11129 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
11130
11131 echo "${as_me:-configure}:11131: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
11132
11133          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
11134                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
11135
11136 echo "${as_me:-configure}:11136: testing but keeping change to \$CPPFLAGS ..." 1>&5
11137
11138          fi
11139          CFLAGS="$cf_check_flags"
11140 fi
11141 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11142 fi
11143
11144         echo "$as_me:11144: checking for XOpenDisplay" >&5
11145 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
11146 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
11147   echo $ECHO_N "(cached) $ECHO_C" >&6
11148 else
11149   cat >conftest.$ac_ext <<_ACEOF
11150 #line 11150 "configure"
11151 #include "confdefs.h"
11152 /* System header to define __stub macros and hopefully few prototypes,
11153     which can conflict with char XOpenDisplay (); below.  */
11154 #include <assert.h>
11155 /* Override any gcc2 internal prototype to avoid an error.  */
11156 #ifdef __cplusplus
11157 extern "C"
11158 #endif
11159 /* We use char because int might match the return type of a gcc2
11160    builtin and then its argument prototype would still apply.  */
11161 char XOpenDisplay ();
11162 char (*f) ();
11163
11164 int
11165 main ()
11166 {
11167 /* The GNU C library defines this for functions which it implements
11168     to always fail with ENOSYS.  Some functions are actually named
11169     something starting with __ and the normal name is an alias.  */
11170 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
11171 choke me
11172 #else
11173 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11174 #endif
11175
11176   ;
11177   return 0;
11178 }
11179 _ACEOF
11180 rm -f conftest.$ac_objext conftest$ac_exeext
11181 if { (eval echo "$as_me:11181: \"$ac_link\"") >&5
11182   (eval $ac_link) 2>&5
11183   ac_status=$?
11184   echo "$as_me:11184: \$? = $ac_status" >&5
11185   (exit $ac_status); } &&
11186          { ac_try='test -s conftest$ac_exeext'
11187   { (eval echo "$as_me:11187: \"$ac_try\"") >&5
11188   (eval $ac_try) 2>&5
11189   ac_status=$?
11190   echo "$as_me:11190: \$? = $ac_status" >&5
11191   (exit $ac_status); }; }; then
11192   ac_cv_func_XOpenDisplay=yes
11193 else
11194   echo "$as_me: failed program was:" >&5
11195 cat conftest.$ac_ext >&5
11196 ac_cv_func_XOpenDisplay=no
11197 fi
11198 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11199 fi
11200 echo "$as_me:11200: result: $ac_cv_func_XOpenDisplay" >&5
11201 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
11202 if test $ac_cv_func_XOpenDisplay = yes; then
11203   :
11204 else
11205
11206         echo "$as_me:11206: checking for XOpenDisplay in -lX11" >&5
11207 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
11208 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
11209   echo $ECHO_N "(cached) $ECHO_C" >&6
11210 else
11211   ac_check_lib_save_LIBS=$LIBS
11212 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11213 cat >conftest.$ac_ext <<_ACEOF
11214 #line 11214 "configure"
11215 #include "confdefs.h"
11216
11217 /* Override any gcc2 internal prototype to avoid an error.  */
11218 #ifdef __cplusplus
11219 extern "C"
11220 #endif
11221 /* We use char because int might match the return type of a gcc2
11222    builtin and then its argument prototype would still apply.  */
11223 char XOpenDisplay ();
11224 int
11225 main ()
11226 {
11227 XOpenDisplay ();
11228   ;
11229   return 0;
11230 }
11231 _ACEOF
11232 rm -f conftest.$ac_objext conftest$ac_exeext
11233 if { (eval echo "$as_me:11233: \"$ac_link\"") >&5
11234   (eval $ac_link) 2>&5
11235   ac_status=$?
11236   echo "$as_me:11236: \$? = $ac_status" >&5
11237   (exit $ac_status); } &&
11238          { ac_try='test -s conftest$ac_exeext'
11239   { (eval echo "$as_me:11239: \"$ac_try\"") >&5
11240   (eval $ac_try) 2>&5
11241   ac_status=$?
11242   echo "$as_me:11242: \$? = $ac_status" >&5
11243   (exit $ac_status); }; }; then
11244   ac_cv_lib_X11_XOpenDisplay=yes
11245 else
11246   echo "$as_me: failed program was:" >&5
11247 cat conftest.$ac_ext >&5
11248 ac_cv_lib_X11_XOpenDisplay=no
11249 fi
11250 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11251 LIBS=$ac_check_lib_save_LIBS
11252 fi
11253 echo "$as_me:11253: result: $ac_cv_lib_X11_XOpenDisplay" >&5
11254 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
11255 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
11256   LIBS="-lX11 $LIBS"
11257 fi
11258
11259 fi
11260
11261         echo "$as_me:11261: checking for XtAppInitialize" >&5
11262 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
11263 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
11264   echo $ECHO_N "(cached) $ECHO_C" >&6
11265 else
11266   cat >conftest.$ac_ext <<_ACEOF
11267 #line 11267 "configure"
11268 #include "confdefs.h"
11269 /* System header to define __stub macros and hopefully few prototypes,
11270     which can conflict with char XtAppInitialize (); below.  */
11271 #include <assert.h>
11272 /* Override any gcc2 internal prototype to avoid an error.  */
11273 #ifdef __cplusplus
11274 extern "C"
11275 #endif
11276 /* We use char because int might match the return type of a gcc2
11277    builtin and then its argument prototype would still apply.  */
11278 char XtAppInitialize ();
11279 char (*f) ();
11280
11281 int
11282 main ()
11283 {
11284 /* The GNU C library defines this for functions which it implements
11285     to always fail with ENOSYS.  Some functions are actually named
11286     something starting with __ and the normal name is an alias.  */
11287 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
11288 choke me
11289 #else
11290 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11291 #endif
11292
11293   ;
11294   return 0;
11295 }
11296 _ACEOF
11297 rm -f conftest.$ac_objext conftest$ac_exeext
11298 if { (eval echo "$as_me:11298: \"$ac_link\"") >&5
11299   (eval $ac_link) 2>&5
11300   ac_status=$?
11301   echo "$as_me:11301: \$? = $ac_status" >&5
11302   (exit $ac_status); } &&
11303          { ac_try='test -s conftest$ac_exeext'
11304   { (eval echo "$as_me:11304: \"$ac_try\"") >&5
11305   (eval $ac_try) 2>&5
11306   ac_status=$?
11307   echo "$as_me:11307: \$? = $ac_status" >&5
11308   (exit $ac_status); }; }; then
11309   ac_cv_func_XtAppInitialize=yes
11310 else
11311   echo "$as_me: failed program was:" >&5
11312 cat conftest.$ac_ext >&5
11313 ac_cv_func_XtAppInitialize=no
11314 fi
11315 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11316 fi
11317 echo "$as_me:11317: result: $ac_cv_func_XtAppInitialize" >&5
11318 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
11319 if test $ac_cv_func_XtAppInitialize = yes; then
11320   :
11321 else
11322
11323         echo "$as_me:11323: checking for XtAppInitialize in -lXt" >&5
11324 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
11325 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
11326   echo $ECHO_N "(cached) $ECHO_C" >&6
11327 else
11328   ac_check_lib_save_LIBS=$LIBS
11329 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11330 cat >conftest.$ac_ext <<_ACEOF
11331 #line 11331 "configure"
11332 #include "confdefs.h"
11333
11334 /* Override any gcc2 internal prototype to avoid an error.  */
11335 #ifdef __cplusplus
11336 extern "C"
11337 #endif
11338 /* We use char because int might match the return type of a gcc2
11339    builtin and then its argument prototype would still apply.  */
11340 char XtAppInitialize ();
11341 int
11342 main ()
11343 {
11344 XtAppInitialize ();
11345   ;
11346   return 0;
11347 }
11348 _ACEOF
11349 rm -f conftest.$ac_objext conftest$ac_exeext
11350 if { (eval echo "$as_me:11350: \"$ac_link\"") >&5
11351   (eval $ac_link) 2>&5
11352   ac_status=$?
11353   echo "$as_me:11353: \$? = $ac_status" >&5
11354   (exit $ac_status); } &&
11355          { ac_try='test -s conftest$ac_exeext'
11356   { (eval echo "$as_me:11356: \"$ac_try\"") >&5
11357   (eval $ac_try) 2>&5
11358   ac_status=$?
11359   echo "$as_me:11359: \$? = $ac_status" >&5
11360   (exit $ac_status); }; }; then
11361   ac_cv_lib_Xt_XtAppInitialize=yes
11362 else
11363   echo "$as_me: failed program was:" >&5
11364 cat conftest.$ac_ext >&5
11365 ac_cv_lib_Xt_XtAppInitialize=no
11366 fi
11367 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11368 LIBS=$ac_check_lib_save_LIBS
11369 fi
11370 echo "$as_me:11370: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
11371 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
11372 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
11373
11374 cat >>confdefs.h <<\EOF
11375 #define HAVE_LIBXT 1
11376 EOF
11377
11378                  cf_have_X_LIBS=Xt
11379                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
11380 fi
11381
11382 fi
11383
11384 fi
11385
11386 if test $cf_have_X_LIBS = no ; then
11387         { echo "$as_me:11387: WARNING: Unable to successfully link X Toolkit library (-lXt) with
11388 test program.  You will have to check and add the proper libraries by hand
11389 to makefile." >&5
11390 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
11391 test program.  You will have to check and add the proper libraries by hand
11392 to makefile." >&2;}
11393 fi
11394
11395 cf_x_athena_root=$cf_x_athena
11396 cf_x_athena_inc=""
11397
11398 for cf_path in default \
11399         /usr/contrib/X11R6 \
11400         /usr/contrib/X11R5 \
11401         /usr/lib/X11R5 \
11402         /usr/local
11403 do
11404         if test -z "$cf_x_athena_inc" ; then
11405                 cf_save="$CPPFLAGS"
11406                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
11407                 if test $cf_path != default ; then
11408                         CPPFLAGS="$cf_save -I$cf_path/include"
11409                         echo "$as_me:11409: checking for $cf_test in $cf_path" >&5
11410 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
11411                 else
11412                         echo "$as_me:11412: checking for $cf_test" >&5
11413 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
11414                 fi
11415                 cat >conftest.$ac_ext <<_ACEOF
11416 #line 11416 "configure"
11417 #include "confdefs.h"
11418
11419 #include <X11/Intrinsic.h>
11420 #include <$cf_test>
11421 int
11422 main ()
11423 {
11424
11425   ;
11426   return 0;
11427 }
11428 _ACEOF
11429 rm -f conftest.$ac_objext
11430 if { (eval echo "$as_me:11430: \"$ac_compile\"") >&5
11431   (eval $ac_compile) 2>&5
11432   ac_status=$?
11433   echo "$as_me:11433: \$? = $ac_status" >&5
11434   (exit $ac_status); } &&
11435          { ac_try='test -s conftest.$ac_objext'
11436   { (eval echo "$as_me:11436: \"$ac_try\"") >&5
11437   (eval $ac_try) 2>&5
11438   ac_status=$?
11439   echo "$as_me:11439: \$? = $ac_status" >&5
11440   (exit $ac_status); }; }; then
11441   cf_result=yes
11442 else
11443   echo "$as_me: failed program was:" >&5
11444 cat conftest.$ac_ext >&5
11445 cf_result=no
11446 fi
11447 rm -f conftest.$ac_objext conftest.$ac_ext
11448                 echo "$as_me:11448: result: $cf_result" >&5
11449 echo "${ECHO_T}$cf_result" >&6
11450                 if test "$cf_result" = yes ; then
11451                         cf_x_athena_inc=$cf_path
11452                         break
11453                 else
11454                         CPPFLAGS="$cf_save"
11455                 fi
11456         fi
11457 done
11458
11459 if test -z "$cf_x_athena_inc" ; then
11460         { echo "$as_me:11460: WARNING: Unable to successfully find Athena header files with test program" >&5
11461 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
11462 elif test "$cf_x_athena_inc" != default ; then
11463         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
11464 fi
11465
11466 cf_x_athena_root=$cf_x_athena
11467 cf_x_athena_lib=""
11468
11469 for cf_path in default \
11470         /usr/contrib/X11R6 \
11471         /usr/contrib/X11R5 \
11472         /usr/lib/X11R5 \
11473         /usr/local
11474 do
11475         for cf_lib in \
11476                 ${cf_x_athena_root} \
11477                 ${cf_x_athena_root}7 \
11478                 ${cf_x_athena_root}6
11479         do
11480         for cf_libs in \
11481                 "-l$cf_lib -lXmu" \
11482                 "-l$cf_lib -lXpm -lXmu" \
11483                 "-l${cf_lib}_s -lXmu_s"
11484         do
11485                 if test -z "$cf_x_athena_lib" ; then
11486                         cf_save="$LIBS"
11487                         cf_test=XawSimpleMenuAddGlobalActions
11488                         if test $cf_path != default ; then
11489                                 LIBS="-L$cf_path/lib $cf_libs $LIBS"
11490                                 echo "$as_me:11490: checking for $cf_libs in $cf_path" >&5
11491 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
11492                         else
11493                                 LIBS="$cf_libs $LIBS"
11494                                 echo "$as_me:11494: checking for $cf_test in $cf_libs" >&5
11495 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
11496                         fi
11497                         cat >conftest.$ac_ext <<_ACEOF
11498 #line 11498 "configure"
11499 #include "confdefs.h"
11500
11501 #include <X11/Intrinsic.h>
11502 #include <X11/$cf_x_athena_root/SimpleMenu.h>
11503
11504 int
11505 main ()
11506 {
11507
11508 $cf_test((XtAppContext) 0)
11509   ;
11510   return 0;
11511 }
11512 _ACEOF
11513 rm -f conftest.$ac_objext conftest$ac_exeext
11514 if { (eval echo "$as_me:11514: \"$ac_link\"") >&5
11515   (eval $ac_link) 2>&5
11516   ac_status=$?
11517   echo "$as_me:11517: \$? = $ac_status" >&5
11518   (exit $ac_status); } &&
11519          { ac_try='test -s conftest$ac_exeext'
11520   { (eval echo "$as_me:11520: \"$ac_try\"") >&5
11521   (eval $ac_try) 2>&5
11522   ac_status=$?
11523   echo "$as_me:11523: \$? = $ac_status" >&5
11524   (exit $ac_status); }; }; then
11525   cf_result=yes
11526 else
11527   echo "$as_me: failed program was:" >&5
11528 cat conftest.$ac_ext >&5
11529 cf_result=no
11530 fi
11531 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11532                         echo "$as_me:11532: result: $cf_result" >&5
11533 echo "${ECHO_T}$cf_result" >&6
11534                         if test "$cf_result" = yes ; then
11535                                 cf_x_athena_lib="$cf_libs"
11536                                 break
11537                         fi
11538                         LIBS="$cf_save"
11539                 fi
11540         done # cf_libs
11541                 test -n "$cf_x_athena_lib" && break
11542         done # cf_lib
11543 done
11544
11545 if test -z "$cf_x_athena_lib" ; then
11546         { { echo "$as_me:11546: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
11547 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
11548    { (exit 1); exit 1; }; }
11549 fi
11550
11551 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11552
11553 cat >>confdefs.h <<EOF
11554 #define $cf_x_athena_LIBS 1
11555 EOF
11556
11557 fi
11558
11559 if test -n "$ac_tool_prefix"; then
11560   for ac_prog in xcurses-config
11561   do
11562     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
11563 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
11564 echo "$as_me:11564: checking for $ac_word" >&5
11565 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11566 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
11567   echo $ECHO_N "(cached) $ECHO_C" >&6
11568 else
11569   if test -n "$XCURSES_CONFIG"; then
11570   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
11571 else
11572   ac_save_IFS=$IFS; IFS=$ac_path_separator
11573 ac_dummy="$PATH"
11574 for ac_dir in $ac_dummy; do
11575   IFS=$ac_save_IFS
11576   test -z "$ac_dir" && ac_dir=.
11577   $as_executable_p "$ac_dir/$ac_word" || continue
11578 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
11579 echo "$as_me:11579: found $ac_dir/$ac_word" >&5
11580 break
11581 done
11582
11583 fi
11584 fi
11585 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
11586 if test -n "$XCURSES_CONFIG"; then
11587   echo "$as_me:11587: result: $XCURSES_CONFIG" >&5
11588 echo "${ECHO_T}$XCURSES_CONFIG" >&6
11589 else
11590   echo "$as_me:11590: result: no" >&5
11591 echo "${ECHO_T}no" >&6
11592 fi
11593
11594     test -n "$XCURSES_CONFIG" && break
11595   done
11596 fi
11597 if test -z "$XCURSES_CONFIG"; then
11598   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
11599   for ac_prog in xcurses-config
11600 do
11601   # Extract the first word of "$ac_prog", so it can be a program name with args.
11602 set dummy $ac_prog; ac_word=$2
11603 echo "$as_me:11603: checking for $ac_word" >&5
11604 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11605 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
11606   echo $ECHO_N "(cached) $ECHO_C" >&6
11607 else
11608   if test -n "$ac_ct_XCURSES_CONFIG"; then
11609   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
11610 else
11611   ac_save_IFS=$IFS; IFS=$ac_path_separator
11612 ac_dummy="$PATH"
11613 for ac_dir in $ac_dummy; do
11614   IFS=$ac_save_IFS
11615   test -z "$ac_dir" && ac_dir=.
11616   $as_executable_p "$ac_dir/$ac_word" || continue
11617 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
11618 echo "$as_me:11618: found $ac_dir/$ac_word" >&5
11619 break
11620 done
11621
11622 fi
11623 fi
11624 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
11625 if test -n "$ac_ct_XCURSES_CONFIG"; then
11626   echo "$as_me:11626: result: $ac_ct_XCURSES_CONFIG" >&5
11627 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
11628 else
11629   echo "$as_me:11629: result: no" >&5
11630 echo "${ECHO_T}no" >&6
11631 fi
11632
11633   test -n "$ac_ct_XCURSES_CONFIG" && break
11634 done
11635 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
11636
11637   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
11638 fi
11639
11640 if test "$XCURSES_CONFIG" != none ; then
11641
11642 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
11643 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
11644
11645 cf_cv_lib_XCurses=yes
11646
11647 else
11648
11649 LDFLAGS="$LDFLAGS $X_LIBS"
11650
11651 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11652
11653 echo "${as_me:-configure}:11653: testing checking additions to CFLAGS ..." 1>&5
11654
11655 cf_check_cflags="$CFLAGS"
11656 cf_check_cppflags="$CPPFLAGS"
11657
11658 cf_fix_cppflags=no
11659 cf_new_cflags=
11660 cf_new_cppflags=
11661 cf_new_extra_cppflags=
11662
11663 for cf_add_cflags in $X_CFLAGS
11664 do
11665 case $cf_fix_cppflags in
11666 no)
11667         case $cf_add_cflags in #(vi
11668         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11669                 case $cf_add_cflags in
11670                 -D*)
11671                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11672
11673                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11674                                 && test -z "${cf_tst_cflags}" \
11675                                 && cf_fix_cppflags=yes
11676
11677                         if test $cf_fix_cppflags = yes ; then
11678                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11679                                 continue
11680                         elif test "${cf_tst_cflags}" = "\"'" ; then
11681                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11682                                 continue
11683                         fi
11684                         ;;
11685                 esac
11686                 case "$CPPFLAGS" in
11687                 *$cf_add_cflags) #(vi
11688                         ;;
11689                 *) #(vi
11690                         case $cf_add_cflags in #(vi
11691                         -D*)
11692                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11693
11694 CPPFLAGS=`echo "$CPPFLAGS" | \
11695         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11696                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11697
11698                                 ;;
11699                         esac
11700                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11701                         ;;
11702                 esac
11703                 ;;
11704         *)
11705                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11706                 ;;
11707         esac
11708         ;;
11709 yes)
11710         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11711
11712         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11713
11714         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11715                 && test -z "${cf_tst_cflags}" \
11716                 && cf_fix_cppflags=no
11717         ;;
11718 esac
11719 done
11720
11721 if test -n "$cf_new_cflags" ; then
11722         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11723
11724 echo "${as_me:-configure}:11724: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11725
11726         CFLAGS="$CFLAGS $cf_new_cflags"
11727 fi
11728
11729 if test -n "$cf_new_cppflags" ; then
11730         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11731
11732 echo "${as_me:-configure}:11732: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11733
11734         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11735 fi
11736
11737 if test -n "$cf_new_extra_cppflags" ; then
11738         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11739
11740 echo "${as_me:-configure}:11740: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11741
11742         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11743 fi
11744
11745 if test "$cf_check_cflags" != "$CFLAGS" ; then
11746 cat >conftest.$ac_ext <<_ACEOF
11747 #line 11747 "configure"
11748 #include "confdefs.h"
11749 #include <stdio.h>
11750 int
11751 main ()
11752 {
11753 printf("Hello world");
11754   ;
11755   return 0;
11756 }
11757 _ACEOF
11758 rm -f conftest.$ac_objext conftest$ac_exeext
11759 if { (eval echo "$as_me:11759: \"$ac_link\"") >&5
11760   (eval $ac_link) 2>&5
11761   ac_status=$?
11762   echo "$as_me:11762: \$? = $ac_status" >&5
11763   (exit $ac_status); } &&
11764          { ac_try='test -s conftest$ac_exeext'
11765   { (eval echo "$as_me:11765: \"$ac_try\"") >&5
11766   (eval $ac_try) 2>&5
11767   ac_status=$?
11768   echo "$as_me:11768: \$? = $ac_status" >&5
11769   (exit $ac_status); }; }; then
11770   :
11771 else
11772   echo "$as_me: failed program was:" >&5
11773 cat conftest.$ac_ext >&5
11774 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
11775
11776 echo "${as_me:-configure}:11776: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
11777
11778          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
11779                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
11780
11781 echo "${as_me:-configure}:11781: testing but keeping change to \$CPPFLAGS ..." 1>&5
11782
11783          fi
11784          CFLAGS="$cf_check_flags"
11785 fi
11786 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11787 fi
11788
11789 echo "$as_me:11789: checking for XOpenDisplay in -lX11" >&5
11790 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
11791 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
11792   echo $ECHO_N "(cached) $ECHO_C" >&6
11793 else
11794   ac_check_lib_save_LIBS=$LIBS
11795 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11796 cat >conftest.$ac_ext <<_ACEOF
11797 #line 11797 "configure"
11798 #include "confdefs.h"
11799
11800 /* Override any gcc2 internal prototype to avoid an error.  */
11801 #ifdef __cplusplus
11802 extern "C"
11803 #endif
11804 /* We use char because int might match the return type of a gcc2
11805    builtin and then its argument prototype would still apply.  */
11806 char XOpenDisplay ();
11807 int
11808 main ()
11809 {
11810 XOpenDisplay ();
11811   ;
11812   return 0;
11813 }
11814 _ACEOF
11815 rm -f conftest.$ac_objext conftest$ac_exeext
11816 if { (eval echo "$as_me:11816: \"$ac_link\"") >&5
11817   (eval $ac_link) 2>&5
11818   ac_status=$?
11819   echo "$as_me:11819: \$? = $ac_status" >&5
11820   (exit $ac_status); } &&
11821          { ac_try='test -s conftest$ac_exeext'
11822   { (eval echo "$as_me:11822: \"$ac_try\"") >&5
11823   (eval $ac_try) 2>&5
11824   ac_status=$?
11825   echo "$as_me:11825: \$? = $ac_status" >&5
11826   (exit $ac_status); }; }; then
11827   ac_cv_lib_X11_XOpenDisplay=yes
11828 else
11829   echo "$as_me: failed program was:" >&5
11830 cat conftest.$ac_ext >&5
11831 ac_cv_lib_X11_XOpenDisplay=no
11832 fi
11833 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11834 LIBS=$ac_check_lib_save_LIBS
11835 fi
11836 echo "$as_me:11836: result: $ac_cv_lib_X11_XOpenDisplay" >&5
11837 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
11838 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
11839   LIBS="-lX11 $LIBS"
11840 fi
11841
11842 echo "$as_me:11842: checking for XCurses library" >&5
11843 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
11844 if test "${cf_cv_lib_XCurses+set}" = set; then
11845   echo $ECHO_N "(cached) $ECHO_C" >&6
11846 else
11847
11848 LIBS="-lXCurses $LIBS"
11849 cat >conftest.$ac_ext <<_ACEOF
11850 #line 11850 "configure"
11851 #include "confdefs.h"
11852
11853 #include <xcurses.h>
11854 char *XCursesProgramName = "test";
11855
11856 int
11857 main ()
11858 {
11859 XCursesExit();
11860   ;
11861   return 0;
11862 }
11863 _ACEOF
11864 rm -f conftest.$ac_objext conftest$ac_exeext
11865 if { (eval echo "$as_me:11865: \"$ac_link\"") >&5
11866   (eval $ac_link) 2>&5
11867   ac_status=$?
11868   echo "$as_me:11868: \$? = $ac_status" >&5
11869   (exit $ac_status); } &&
11870          { ac_try='test -s conftest$ac_exeext'
11871   { (eval echo "$as_me:11871: \"$ac_try\"") >&5
11872   (eval $ac_try) 2>&5
11873   ac_status=$?
11874   echo "$as_me:11874: \$? = $ac_status" >&5
11875   (exit $ac_status); }; }; then
11876   cf_cv_lib_XCurses=yes
11877 else
11878   echo "$as_me: failed program was:" >&5
11879 cat conftest.$ac_ext >&5
11880 cf_cv_lib_XCurses=no
11881 fi
11882 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11883
11884 fi
11885 echo "$as_me:11885: result: $cf_cv_lib_XCurses" >&5
11886 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
11887
11888 fi
11889
11890 if test $cf_cv_lib_XCurses = yes ; then
11891
11892 cat >>confdefs.h <<\EOF
11893 #define UNIX 1
11894 EOF
11895
11896 cat >>confdefs.h <<\EOF
11897 #define XCURSES 1
11898 EOF
11899
11900         echo "$as_me:11900: checking for xcurses.h" >&5
11901 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
11902 if test "${ac_cv_header_xcurses_h+set}" = set; then
11903   echo $ECHO_N "(cached) $ECHO_C" >&6
11904 else
11905   cat >conftest.$ac_ext <<_ACEOF
11906 #line 11906 "configure"
11907 #include "confdefs.h"
11908 #include <xcurses.h>
11909 _ACEOF
11910 if { (eval echo "$as_me:11910: \"$ac_cpp conftest.$ac_ext\"") >&5
11911   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11912   ac_status=$?
11913   egrep -v '^ *\+' conftest.er1 >conftest.err
11914   rm -f conftest.er1
11915   cat conftest.err >&5
11916   echo "$as_me:11916: \$? = $ac_status" >&5
11917   (exit $ac_status); } >/dev/null; then
11918   if test -s conftest.err; then
11919     ac_cpp_err=$ac_c_preproc_warn_flag
11920   else
11921     ac_cpp_err=
11922   fi
11923 else
11924   ac_cpp_err=yes
11925 fi
11926 if test -z "$ac_cpp_err"; then
11927   ac_cv_header_xcurses_h=yes
11928 else
11929   echo "$as_me: failed program was:" >&5
11930   cat conftest.$ac_ext >&5
11931   ac_cv_header_xcurses_h=no
11932 fi
11933 rm -f conftest.err conftest.$ac_ext
11934 fi
11935 echo "$as_me:11935: result: $ac_cv_header_xcurses_h" >&5
11936 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
11937 if test $ac_cv_header_xcurses_h = yes; then
11938
11939 cat >>confdefs.h <<\EOF
11940 #define HAVE_XCURSES 1
11941 EOF
11942
11943 fi
11944
11945 else
11946         { { echo "$as_me:11946: error: Cannot link with XCurses" >&5
11947 echo "$as_me: error: Cannot link with XCurses" >&2;}
11948    { (exit 1); exit 1; }; }
11949 fi
11950
11951         ;;
11952 esac
11953
11954 case $cf_cv_screen in
11955 curses|curses_*)
11956
11957 echo "$as_me:11957: checking for NetBSD form.h" >&5
11958 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
11959 if test "${cf_cv_netbsd_form_h+set}" = set; then
11960   echo $ECHO_N "(cached) $ECHO_C" >&6
11961 else
11962
11963 cat >conftest.$ac_ext <<_ACEOF
11964 #line 11964 "configure"
11965 #include "confdefs.h"
11966
11967 #include <${cf_cv_ncurses_header:-curses.h}>
11968 #include <form.h>
11969
11970 int
11971 main ()
11972 {
11973
11974         FORM *form;
11975         int y = current_field(form)->cursor_ypos;
11976         int x = current_field(form)->cursor_xpos;
11977
11978   ;
11979   return 0;
11980 }
11981 _ACEOF
11982 rm -f conftest.$ac_objext
11983 if { (eval echo "$as_me:11983: \"$ac_compile\"") >&5
11984   (eval $ac_compile) 2>&5
11985   ac_status=$?
11986   echo "$as_me:11986: \$? = $ac_status" >&5
11987   (exit $ac_status); } &&
11988          { ac_try='test -s conftest.$ac_objext'
11989   { (eval echo "$as_me:11989: \"$ac_try\"") >&5
11990   (eval $ac_try) 2>&5
11991   ac_status=$?
11992   echo "$as_me:11992: \$? = $ac_status" >&5
11993   (exit $ac_status); }; }; then
11994   cf_cv_netbsd_form_h=yes
11995
11996 else
11997   echo "$as_me: failed program was:" >&5
11998 cat conftest.$ac_ext >&5
11999 cf_cv_netbsd_form_h=no
12000 fi
12001 rm -f conftest.$ac_objext conftest.$ac_ext
12002
12003 fi
12004 echo "$as_me:12004: result: $cf_cv_netbsd_form_h" >&5
12005 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
12006
12007 test "$cf_cv_netbsd_form_h" = yes &&
12008 cat >>confdefs.h <<\EOF
12009 #define HAVE_NETBSD_FORM_H 1
12010 EOF
12011
12012 echo "$as_me:12012: checking for NetBSD menu.h" >&5
12013 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
12014 if test "${cf_cv_netbsd_menu_h+set}" = set; then
12015   echo $ECHO_N "(cached) $ECHO_C" >&6
12016 else
12017
12018 cat >conftest.$ac_ext <<_ACEOF
12019 #line 12019 "configure"
12020 #include "confdefs.h"
12021
12022 #include <${cf_cv_ncurses_header:-curses.h}>
12023 #include <menu.h>
12024
12025 int
12026 main ()
12027 {
12028
12029         MENU *menu;
12030         int y = menu->max_item_width;
12031
12032   ;
12033   return 0;
12034 }
12035 _ACEOF
12036 rm -f conftest.$ac_objext
12037 if { (eval echo "$as_me:12037: \"$ac_compile\"") >&5
12038   (eval $ac_compile) 2>&5
12039   ac_status=$?
12040   echo "$as_me:12040: \$? = $ac_status" >&5
12041   (exit $ac_status); } &&
12042          { ac_try='test -s conftest.$ac_objext'
12043   { (eval echo "$as_me:12043: \"$ac_try\"") >&5
12044   (eval $ac_try) 2>&5
12045   ac_status=$?
12046   echo "$as_me:12046: \$? = $ac_status" >&5
12047   (exit $ac_status); }; }; then
12048   cf_cv_netbsd_menu_h=yes
12049
12050 else
12051   echo "$as_me: failed program was:" >&5
12052 cat conftest.$ac_ext >&5
12053 cf_cv_netbsd_menu_h=no
12054 fi
12055 rm -f conftest.$ac_objext conftest.$ac_ext
12056
12057 fi
12058 echo "$as_me:12058: result: $cf_cv_netbsd_menu_h" >&5
12059 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
12060
12061 test "$cf_cv_netbsd_menu_h" = yes &&
12062 cat >>confdefs.h <<\EOF
12063 #define HAVE_NETBSD_MENU_H 1
12064 EOF
12065
12066         ;;
12067 ncursesw)
12068         cf_cv_libtype=w
12069         ;;
12070 esac
12071
12072 case $cf_cv_screen in #(vi
12073 pdcurses) #(vi
12074         ;;
12075 *)
12076         # look for curses-related libraries
12077         : ${cf_panel_lib:=panel}
12078         : ${cf_menu_lib:=menu}
12079         : ${cf_form_lib:=form}
12080
12081 as_ac_Lib=`echo "ac_cv_lib_$cf_panel_lib$cf_cv_libtype''_new_panel" | $as_tr_sh`
12082 echo "$as_me:12082: checking for new_panel in -l$cf_panel_lib$cf_cv_libtype" >&5
12083 echo $ECHO_N "checking for new_panel in -l$cf_panel_lib$cf_cv_libtype... $ECHO_C" >&6
12084 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12085   echo $ECHO_N "(cached) $ECHO_C" >&6
12086 else
12087   ac_check_lib_save_LIBS=$LIBS
12088 LIBS="-l$cf_panel_lib$cf_cv_libtype  $LIBS"
12089 cat >conftest.$ac_ext <<_ACEOF
12090 #line 12090 "configure"
12091 #include "confdefs.h"
12092
12093 /* Override any gcc2 internal prototype to avoid an error.  */
12094 #ifdef __cplusplus
12095 extern "C"
12096 #endif
12097 /* We use char because int might match the return type of a gcc2
12098    builtin and then its argument prototype would still apply.  */
12099 char new_panel ();
12100 int
12101 main ()
12102 {
12103 new_panel ();
12104   ;
12105   return 0;
12106 }
12107 _ACEOF
12108 rm -f conftest.$ac_objext conftest$ac_exeext
12109 if { (eval echo "$as_me:12109: \"$ac_link\"") >&5
12110   (eval $ac_link) 2>&5
12111   ac_status=$?
12112   echo "$as_me:12112: \$? = $ac_status" >&5
12113   (exit $ac_status); } &&
12114          { ac_try='test -s conftest$ac_exeext'
12115   { (eval echo "$as_me:12115: \"$ac_try\"") >&5
12116   (eval $ac_try) 2>&5
12117   ac_status=$?
12118   echo "$as_me:12118: \$? = $ac_status" >&5
12119   (exit $ac_status); }; }; then
12120   eval "$as_ac_Lib=yes"
12121 else
12122   echo "$as_me: failed program was:" >&5
12123 cat conftest.$ac_ext >&5
12124 eval "$as_ac_Lib=no"
12125 fi
12126 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12127 LIBS=$ac_check_lib_save_LIBS
12128 fi
12129 echo "$as_me:12129: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12130 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12131 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12132   cat >>confdefs.h <<EOF
12133 #define `echo "HAVE_LIB$cf_panel_lib$cf_cv_libtype" | $as_tr_cpp` 1
12134 EOF
12135
12136   LIBS="-l$cf_panel_lib$cf_cv_libtype $LIBS"
12137
12138 fi
12139
12140 as_ac_Lib=`echo "ac_cv_lib_$cf_menu_lib$cf_cv_libtype''_menu_driver" | $as_tr_sh`
12141 echo "$as_me:12141: checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype" >&5
12142 echo $ECHO_N "checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype... $ECHO_C" >&6
12143 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12144   echo $ECHO_N "(cached) $ECHO_C" >&6
12145 else
12146   ac_check_lib_save_LIBS=$LIBS
12147 LIBS="-l$cf_menu_lib$cf_cv_libtype  $LIBS"
12148 cat >conftest.$ac_ext <<_ACEOF
12149 #line 12149 "configure"
12150 #include "confdefs.h"
12151
12152 /* Override any gcc2 internal prototype to avoid an error.  */
12153 #ifdef __cplusplus
12154 extern "C"
12155 #endif
12156 /* We use char because int might match the return type of a gcc2
12157    builtin and then its argument prototype would still apply.  */
12158 char menu_driver ();
12159 int
12160 main ()
12161 {
12162 menu_driver ();
12163   ;
12164   return 0;
12165 }
12166 _ACEOF
12167 rm -f conftest.$ac_objext conftest$ac_exeext
12168 if { (eval echo "$as_me:12168: \"$ac_link\"") >&5
12169   (eval $ac_link) 2>&5
12170   ac_status=$?
12171   echo "$as_me:12171: \$? = $ac_status" >&5
12172   (exit $ac_status); } &&
12173          { ac_try='test -s conftest$ac_exeext'
12174   { (eval echo "$as_me:12174: \"$ac_try\"") >&5
12175   (eval $ac_try) 2>&5
12176   ac_status=$?
12177   echo "$as_me:12177: \$? = $ac_status" >&5
12178   (exit $ac_status); }; }; then
12179   eval "$as_ac_Lib=yes"
12180 else
12181   echo "$as_me: failed program was:" >&5
12182 cat conftest.$ac_ext >&5
12183 eval "$as_ac_Lib=no"
12184 fi
12185 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12186 LIBS=$ac_check_lib_save_LIBS
12187 fi
12188 echo "$as_me:12188: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12189 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12190 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12191   cat >>confdefs.h <<EOF
12192 #define `echo "HAVE_LIB$cf_menu_lib$cf_cv_libtype" | $as_tr_cpp` 1
12193 EOF
12194
12195   LIBS="-l$cf_menu_lib$cf_cv_libtype $LIBS"
12196
12197 fi
12198
12199 as_ac_Lib=`echo "ac_cv_lib_$cf_form_lib$cf_cv_libtype''_form_driver" | $as_tr_sh`
12200 echo "$as_me:12200: checking for form_driver in -l$cf_form_lib$cf_cv_libtype" >&5
12201 echo $ECHO_N "checking for form_driver in -l$cf_form_lib$cf_cv_libtype... $ECHO_C" >&6
12202 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12203   echo $ECHO_N "(cached) $ECHO_C" >&6
12204 else
12205   ac_check_lib_save_LIBS=$LIBS
12206 LIBS="-l$cf_form_lib$cf_cv_libtype  $LIBS"
12207 cat >conftest.$ac_ext <<_ACEOF
12208 #line 12208 "configure"
12209 #include "confdefs.h"
12210
12211 /* Override any gcc2 internal prototype to avoid an error.  */
12212 #ifdef __cplusplus
12213 extern "C"
12214 #endif
12215 /* We use char because int might match the return type of a gcc2
12216    builtin and then its argument prototype would still apply.  */
12217 char form_driver ();
12218 int
12219 main ()
12220 {
12221 form_driver ();
12222   ;
12223   return 0;
12224 }
12225 _ACEOF
12226 rm -f conftest.$ac_objext conftest$ac_exeext
12227 if { (eval echo "$as_me:12227: \"$ac_link\"") >&5
12228   (eval $ac_link) 2>&5
12229   ac_status=$?
12230   echo "$as_me:12230: \$? = $ac_status" >&5
12231   (exit $ac_status); } &&
12232          { ac_try='test -s conftest$ac_exeext'
12233   { (eval echo "$as_me:12233: \"$ac_try\"") >&5
12234   (eval $ac_try) 2>&5
12235   ac_status=$?
12236   echo "$as_me:12236: \$? = $ac_status" >&5
12237   (exit $ac_status); }; }; then
12238   eval "$as_ac_Lib=yes"
12239 else
12240   echo "$as_me: failed program was:" >&5
12241 cat conftest.$ac_ext >&5
12242 eval "$as_ac_Lib=no"
12243 fi
12244 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12245 LIBS=$ac_check_lib_save_LIBS
12246 fi
12247 echo "$as_me:12247: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12248 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12249 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12250   cat >>confdefs.h <<EOF
12251 #define `echo "HAVE_LIB$cf_form_lib$cf_cv_libtype" | $as_tr_cpp` 1
12252 EOF
12253
12254   LIBS="-l$cf_form_lib$cf_cv_libtype $LIBS"
12255
12256 fi
12257
12258         # look for curses-related headers
12259
12260 for ac_header in \
12261                 nc_alloc.h \
12262                 nomacros.h \
12263                 form.h \
12264                 menu.h \
12265                 panel.h \
12266                 term_entry.h \
12267
12268 do
12269 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12270 echo "$as_me:12270: checking for $ac_header" >&5
12271 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12272 if eval "test \"\${$as_ac_Header+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 #include <$ac_header>
12279 _ACEOF
12280 if { (eval echo "$as_me:12280: \"$ac_cpp conftest.$ac_ext\"") >&5
12281   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12282   ac_status=$?
12283   egrep -v '^ *\+' conftest.er1 >conftest.err
12284   rm -f conftest.er1
12285   cat conftest.err >&5
12286   echo "$as_me:12286: \$? = $ac_status" >&5
12287   (exit $ac_status); } >/dev/null; then
12288   if test -s conftest.err; then
12289     ac_cpp_err=$ac_c_preproc_warn_flag
12290   else
12291     ac_cpp_err=
12292   fi
12293 else
12294   ac_cpp_err=yes
12295 fi
12296 if test -z "$ac_cpp_err"; then
12297   eval "$as_ac_Header=yes"
12298 else
12299   echo "$as_me: failed program was:" >&5
12300   cat conftest.$ac_ext >&5
12301   eval "$as_ac_Header=no"
12302 fi
12303 rm -f conftest.err conftest.$ac_ext
12304 fi
12305 echo "$as_me:12305: result: `eval echo '${'$as_ac_Header'}'`" >&5
12306 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12307 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12308   cat >>confdefs.h <<EOF
12309 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12310 EOF
12311
12312 fi
12313 done
12314
12315         ;;
12316 esac
12317
12318 echo "$as_me:12318: checking for ANSI C header files" >&5
12319 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
12320 if test "${ac_cv_header_stdc+set}" = set; then
12321   echo $ECHO_N "(cached) $ECHO_C" >&6
12322 else
12323   cat >conftest.$ac_ext <<_ACEOF
12324 #line 12324 "configure"
12325 #include "confdefs.h"
12326 #include <stdlib.h>
12327 #include <stdarg.h>
12328 #include <string.h>
12329 #include <float.h>
12330
12331 _ACEOF
12332 if { (eval echo "$as_me:12332: \"$ac_cpp conftest.$ac_ext\"") >&5
12333   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12334   ac_status=$?
12335   egrep -v '^ *\+' conftest.er1 >conftest.err
12336   rm -f conftest.er1
12337   cat conftest.err >&5
12338   echo "$as_me:12338: \$? = $ac_status" >&5
12339   (exit $ac_status); } >/dev/null; then
12340   if test -s conftest.err; then
12341     ac_cpp_err=$ac_c_preproc_warn_flag
12342   else
12343     ac_cpp_err=
12344   fi
12345 else
12346   ac_cpp_err=yes
12347 fi
12348 if test -z "$ac_cpp_err"; then
12349   ac_cv_header_stdc=yes
12350 else
12351   echo "$as_me: failed program was:" >&5
12352   cat conftest.$ac_ext >&5
12353   ac_cv_header_stdc=no
12354 fi
12355 rm -f conftest.err conftest.$ac_ext
12356
12357 if test $ac_cv_header_stdc = yes; then
12358   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12359   cat >conftest.$ac_ext <<_ACEOF
12360 #line 12360 "configure"
12361 #include "confdefs.h"
12362 #include <string.h>
12363
12364 _ACEOF
12365 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12366   egrep "memchr" >/dev/null 2>&1; then
12367   :
12368 else
12369   ac_cv_header_stdc=no
12370 fi
12371 rm -rf conftest*
12372
12373 fi
12374
12375 if test $ac_cv_header_stdc = yes; then
12376   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12377   cat >conftest.$ac_ext <<_ACEOF
12378 #line 12378 "configure"
12379 #include "confdefs.h"
12380 #include <stdlib.h>
12381
12382 _ACEOF
12383 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12384   egrep "free" >/dev/null 2>&1; then
12385   :
12386 else
12387   ac_cv_header_stdc=no
12388 fi
12389 rm -rf conftest*
12390
12391 fi
12392
12393 if test $ac_cv_header_stdc = yes; then
12394   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12395   if test "$cross_compiling" = yes; then
12396   :
12397 else
12398   cat >conftest.$ac_ext <<_ACEOF
12399 #line 12399 "configure"
12400 #include "confdefs.h"
12401 #include <ctype.h>
12402 #if ((' ' & 0x0FF) == 0x020)
12403 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12404 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12405 #else
12406 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
12407                      || ('j' <= (c) && (c) <= 'r') \
12408                      || ('s' <= (c) && (c) <= 'z'))
12409 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
12410 #endif
12411
12412 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12413 int
12414 main ()
12415 {
12416   int i;
12417   for (i = 0; i < 256; i++)
12418     if (XOR (islower (i), ISLOWER (i))
12419         || toupper (i) != TOUPPER (i))
12420       $ac_main_return(2);
12421   $ac_main_return (0);
12422 }
12423 _ACEOF
12424 rm -f conftest$ac_exeext
12425 if { (eval echo "$as_me:12425: \"$ac_link\"") >&5
12426   (eval $ac_link) 2>&5
12427   ac_status=$?
12428   echo "$as_me:12428: \$? = $ac_status" >&5
12429   (exit $ac_status); } && { ac_try='./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   :
12436 else
12437   echo "$as_me: program exited with status $ac_status" >&5
12438 echo "$as_me: failed program was:" >&5
12439 cat conftest.$ac_ext >&5
12440 ac_cv_header_stdc=no
12441 fi
12442 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12443 fi
12444 fi
12445 fi
12446 echo "$as_me:12446: result: $ac_cv_header_stdc" >&5
12447 echo "${ECHO_T}$ac_cv_header_stdc" >&6
12448 if test $ac_cv_header_stdc = yes; then
12449
12450 cat >>confdefs.h <<\EOF
12451 #define STDC_HEADERS 1
12452 EOF
12453
12454 fi
12455
12456 echo "$as_me:12456: checking whether time.h and sys/time.h may both be included" >&5
12457 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
12458 if test "${ac_cv_header_time+set}" = set; then
12459   echo $ECHO_N "(cached) $ECHO_C" >&6
12460 else
12461   cat >conftest.$ac_ext <<_ACEOF
12462 #line 12462 "configure"
12463 #include "confdefs.h"
12464 #include <sys/types.h>
12465 #include <sys/time.h>
12466 #include <time.h>
12467
12468 int
12469 main ()
12470 {
12471 if ((struct tm *) 0)
12472 return 0;
12473   ;
12474   return 0;
12475 }
12476 _ACEOF
12477 rm -f conftest.$ac_objext
12478 if { (eval echo "$as_me:12478: \"$ac_compile\"") >&5
12479   (eval $ac_compile) 2>&5
12480   ac_status=$?
12481   echo "$as_me:12481: \$? = $ac_status" >&5
12482   (exit $ac_status); } &&
12483          { ac_try='test -s conftest.$ac_objext'
12484   { (eval echo "$as_me:12484: \"$ac_try\"") >&5
12485   (eval $ac_try) 2>&5
12486   ac_status=$?
12487   echo "$as_me:12487: \$? = $ac_status" >&5
12488   (exit $ac_status); }; }; then
12489   ac_cv_header_time=yes
12490 else
12491   echo "$as_me: failed program was:" >&5
12492 cat conftest.$ac_ext >&5
12493 ac_cv_header_time=no
12494 fi
12495 rm -f conftest.$ac_objext conftest.$ac_ext
12496 fi
12497 echo "$as_me:12497: result: $ac_cv_header_time" >&5
12498 echo "${ECHO_T}$ac_cv_header_time" >&6
12499 if test $ac_cv_header_time = yes; then
12500
12501 cat >>confdefs.h <<\EOF
12502 #define TIME_WITH_SYS_TIME 1
12503 EOF
12504
12505 fi
12506
12507 for ac_header in \
12508 getopt.h \
12509 locale.h \
12510 math.h \
12511 stdarg.h \
12512 sys/ioctl.h \
12513 sys/select.h \
12514 sys/time.h \
12515 termios.h \
12516 unistd.h \
12517
12518 do
12519 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12520 echo "$as_me:12520: checking for $ac_header" >&5
12521 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12522 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12523   echo $ECHO_N "(cached) $ECHO_C" >&6
12524 else
12525   cat >conftest.$ac_ext <<_ACEOF
12526 #line 12526 "configure"
12527 #include "confdefs.h"
12528 #include <$ac_header>
12529 _ACEOF
12530 if { (eval echo "$as_me:12530: \"$ac_cpp conftest.$ac_ext\"") >&5
12531   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12532   ac_status=$?
12533   egrep -v '^ *\+' conftest.er1 >conftest.err
12534   rm -f conftest.er1
12535   cat conftest.err >&5
12536   echo "$as_me:12536: \$? = $ac_status" >&5
12537   (exit $ac_status); } >/dev/null; then
12538   if test -s conftest.err; then
12539     ac_cpp_err=$ac_c_preproc_warn_flag
12540   else
12541     ac_cpp_err=
12542   fi
12543 else
12544   ac_cpp_err=yes
12545 fi
12546 if test -z "$ac_cpp_err"; then
12547   eval "$as_ac_Header=yes"
12548 else
12549   echo "$as_me: failed program was:" >&5
12550   cat conftest.$ac_ext >&5
12551   eval "$as_ac_Header=no"
12552 fi
12553 rm -f conftest.err conftest.$ac_ext
12554 fi
12555 echo "$as_me:12555: result: `eval echo '${'$as_ac_Header'}'`" >&5
12556 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12557 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12558   cat >>confdefs.h <<EOF
12559 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12560 EOF
12561
12562 fi
12563 done
12564
12565 for ac_header in unistd.h getopt.h
12566 do
12567 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12568 echo "$as_me:12568: checking for $ac_header" >&5
12569 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12570 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12571   echo $ECHO_N "(cached) $ECHO_C" >&6
12572 else
12573   cat >conftest.$ac_ext <<_ACEOF
12574 #line 12574 "configure"
12575 #include "confdefs.h"
12576 #include <$ac_header>
12577 _ACEOF
12578 if { (eval echo "$as_me:12578: \"$ac_cpp conftest.$ac_ext\"") >&5
12579   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12580   ac_status=$?
12581   egrep -v '^ *\+' conftest.er1 >conftest.err
12582   rm -f conftest.er1
12583   cat conftest.err >&5
12584   echo "$as_me:12584: \$? = $ac_status" >&5
12585   (exit $ac_status); } >/dev/null; then
12586   if test -s conftest.err; then
12587     ac_cpp_err=$ac_c_preproc_warn_flag
12588   else
12589     ac_cpp_err=
12590   fi
12591 else
12592   ac_cpp_err=yes
12593 fi
12594 if test -z "$ac_cpp_err"; then
12595   eval "$as_ac_Header=yes"
12596 else
12597   echo "$as_me: failed program was:" >&5
12598   cat conftest.$ac_ext >&5
12599   eval "$as_ac_Header=no"
12600 fi
12601 rm -f conftest.err conftest.$ac_ext
12602 fi
12603 echo "$as_me:12603: result: `eval echo '${'$as_ac_Header'}'`" >&5
12604 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12605 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12606   cat >>confdefs.h <<EOF
12607 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12608 EOF
12609
12610 fi
12611 done
12612
12613 echo "$as_me:12613: checking for header declaring getopt variables" >&5
12614 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
12615 if test "${cf_cv_getopt_header+set}" = set; then
12616   echo $ECHO_N "(cached) $ECHO_C" >&6
12617 else
12618
12619 cf_cv_getopt_header=none
12620 for cf_header in stdio.h stdlib.h unistd.h getopt.h
12621 do
12622 cat >conftest.$ac_ext <<_ACEOF
12623 #line 12623 "configure"
12624 #include "confdefs.h"
12625
12626 #include <$cf_header>
12627 int
12628 main ()
12629 {
12630 int x = optind; char *y = optarg
12631   ;
12632   return 0;
12633 }
12634 _ACEOF
12635 rm -f conftest.$ac_objext
12636 if { (eval echo "$as_me:12636: \"$ac_compile\"") >&5
12637   (eval $ac_compile) 2>&5
12638   ac_status=$?
12639   echo "$as_me:12639: \$? = $ac_status" >&5
12640   (exit $ac_status); } &&
12641          { ac_try='test -s conftest.$ac_objext'
12642   { (eval echo "$as_me:12642: \"$ac_try\"") >&5
12643   (eval $ac_try) 2>&5
12644   ac_status=$?
12645   echo "$as_me:12645: \$? = $ac_status" >&5
12646   (exit $ac_status); }; }; then
12647   cf_cv_getopt_header=$cf_header
12648  break
12649 else
12650   echo "$as_me: failed program was:" >&5
12651 cat conftest.$ac_ext >&5
12652 fi
12653 rm -f conftest.$ac_objext conftest.$ac_ext
12654 done
12655
12656 fi
12657 echo "$as_me:12657: result: $cf_cv_getopt_header" >&5
12658 echo "${ECHO_T}$cf_cv_getopt_header" >&6
12659 if test $cf_cv_getopt_header != none ; then
12660
12661 cat >>confdefs.h <<\EOF
12662 #define HAVE_GETOPT_HEADER 1
12663 EOF
12664
12665 fi
12666
12667 for ac_func in \
12668 gettimeofday \
12669
12670 do
12671 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
12672 echo "$as_me:12672: checking for $ac_func" >&5
12673 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
12674 if eval "test \"\${$as_ac_var+set}\" = set"; then
12675   echo $ECHO_N "(cached) $ECHO_C" >&6
12676 else
12677   cat >conftest.$ac_ext <<_ACEOF
12678 #line 12678 "configure"
12679 #include "confdefs.h"
12680 /* System header to define __stub macros and hopefully few prototypes,
12681     which can conflict with char $ac_func (); below.  */
12682 #include <assert.h>
12683 /* Override any gcc2 internal prototype to avoid an error.  */
12684 #ifdef __cplusplus
12685 extern "C"
12686 #endif
12687 /* We use char because int might match the return type of a gcc2
12688    builtin and then its argument prototype would still apply.  */
12689 char $ac_func ();
12690 char (*f) ();
12691
12692 int
12693 main ()
12694 {
12695 /* The GNU C library defines this for functions which it implements
12696     to always fail with ENOSYS.  Some functions are actually named
12697     something starting with __ and the normal name is an alias.  */
12698 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12699 choke me
12700 #else
12701 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12702 #endif
12703
12704   ;
12705   return 0;
12706 }
12707 _ACEOF
12708 rm -f conftest.$ac_objext conftest$ac_exeext
12709 if { (eval echo "$as_me:12709: \"$ac_link\"") >&5
12710   (eval $ac_link) 2>&5
12711   ac_status=$?
12712   echo "$as_me:12712: \$? = $ac_status" >&5
12713   (exit $ac_status); } &&
12714          { ac_try='test -s conftest$ac_exeext'
12715   { (eval echo "$as_me:12715: \"$ac_try\"") >&5
12716   (eval $ac_try) 2>&5
12717   ac_status=$?
12718   echo "$as_me:12718: \$? = $ac_status" >&5
12719   (exit $ac_status); }; }; then
12720   eval "$as_ac_var=yes"
12721 else
12722   echo "$as_me: failed program was:" >&5
12723 cat conftest.$ac_ext >&5
12724 eval "$as_ac_var=no"
12725 fi
12726 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12727 fi
12728 echo "$as_me:12728: result: `eval echo '${'$as_ac_var'}'`" >&5
12729 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
12730 if test `eval echo '${'$as_ac_var'}'` = yes; then
12731   cat >>confdefs.h <<EOF
12732 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
12733 EOF
12734
12735 fi
12736 done
12737
12738 if test "$cf_enable_widec" = yes; then
12739
12740 for ac_func in \
12741 mblen \
12742 mbrlen \
12743 mbrtowc \
12744 mbsrtowcs \
12745 mbstowcs \
12746 mbtowc \
12747 wcsrtombs \
12748 wcstombs \
12749
12750 do
12751 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
12752 echo "$as_me:12752: checking for $ac_func" >&5
12753 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
12754 if eval "test \"\${$as_ac_var+set}\" = set"; then
12755   echo $ECHO_N "(cached) $ECHO_C" >&6
12756 else
12757   cat >conftest.$ac_ext <<_ACEOF
12758 #line 12758 "configure"
12759 #include "confdefs.h"
12760 /* System header to define __stub macros and hopefully few prototypes,
12761     which can conflict with char $ac_func (); below.  */
12762 #include <assert.h>
12763 /* Override any gcc2 internal prototype to avoid an error.  */
12764 #ifdef __cplusplus
12765 extern "C"
12766 #endif
12767 /* We use char because int might match the return type of a gcc2
12768    builtin and then its argument prototype would still apply.  */
12769 char $ac_func ();
12770 char (*f) ();
12771
12772 int
12773 main ()
12774 {
12775 /* The GNU C library defines this for functions which it implements
12776     to always fail with ENOSYS.  Some functions are actually named
12777     something starting with __ and the normal name is an alias.  */
12778 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12779 choke me
12780 #else
12781 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12782 #endif
12783
12784   ;
12785   return 0;
12786 }
12787 _ACEOF
12788 rm -f conftest.$ac_objext conftest$ac_exeext
12789 if { (eval echo "$as_me:12789: \"$ac_link\"") >&5
12790   (eval $ac_link) 2>&5
12791   ac_status=$?
12792   echo "$as_me:12792: \$? = $ac_status" >&5
12793   (exit $ac_status); } &&
12794          { ac_try='test -s conftest$ac_exeext'
12795   { (eval echo "$as_me:12795: \"$ac_try\"") >&5
12796   (eval $ac_try) 2>&5
12797   ac_status=$?
12798   echo "$as_me:12798: \$? = $ac_status" >&5
12799   (exit $ac_status); }; }; then
12800   eval "$as_ac_var=yes"
12801 else
12802   echo "$as_me: failed program was:" >&5
12803 cat conftest.$ac_ext >&5
12804 eval "$as_ac_var=no"
12805 fi
12806 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12807 fi
12808 echo "$as_me:12808: result: `eval echo '${'$as_ac_var'}'`" >&5
12809 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
12810 if test `eval echo '${'$as_ac_var'}'` = yes; then
12811   cat >>confdefs.h <<EOF
12812 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
12813 EOF
12814
12815 fi
12816 done
12817
12818 fi
12819
12820 echo "$as_me:12820: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
12821 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
12822 if test "${cf_cv_need_xopen_extension+set}" = set; then
12823   echo $ECHO_N "(cached) $ECHO_C" >&6
12824 else
12825
12826 cat >conftest.$ac_ext <<_ACEOF
12827 #line 12827 "configure"
12828 #include "confdefs.h"
12829
12830 #include <stdlib.h>
12831 #include <${cf_cv_ncurses_header:-curses.h}>
12832 int
12833 main ()
12834 {
12835
12836 #if defined(NCURSES_VERSION_PATCH)
12837 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
12838         make an error
12839 #endif
12840 #endif
12841         long x = winnstr(stdscr, "", 0);
12842         int x1, y1;
12843         getbegyx(stdscr, y1, x1)
12844   ;
12845   return 0;
12846 }
12847 _ACEOF
12848 rm -f conftest.$ac_objext conftest$ac_exeext
12849 if { (eval echo "$as_me:12849: \"$ac_link\"") >&5
12850   (eval $ac_link) 2>&5
12851   ac_status=$?
12852   echo "$as_me:12852: \$? = $ac_status" >&5
12853   (exit $ac_status); } &&
12854          { ac_try='test -s conftest$ac_exeext'
12855   { (eval echo "$as_me:12855: \"$ac_try\"") >&5
12856   (eval $ac_try) 2>&5
12857   ac_status=$?
12858   echo "$as_me:12858: \$? = $ac_status" >&5
12859   (exit $ac_status); }; }; then
12860   cf_cv_need_xopen_extension=no
12861 else
12862   echo "$as_me: failed program was:" >&5
12863 cat conftest.$ac_ext >&5
12864 cat >conftest.$ac_ext <<_ACEOF
12865 #line 12865 "configure"
12866 #include "confdefs.h"
12867
12868 #define _XOPEN_SOURCE_EXTENDED
12869 #include <stdlib.h>
12870 #include <${cf_cv_ncurses_header:-curses.h}>
12871 int
12872 main ()
12873 {
12874
12875 #ifdef NCURSES_VERSION
12876         cchar_t check;
12877         int check2 = curs_set((int)sizeof(check));
12878 #endif
12879         long x = winnstr(stdscr, "", 0);
12880         int x1, y1;
12881         getbegyx(stdscr, y1, x1)
12882   ;
12883   return 0;
12884 }
12885 _ACEOF
12886 rm -f conftest.$ac_objext conftest$ac_exeext
12887 if { (eval echo "$as_me:12887: \"$ac_link\"") >&5
12888   (eval $ac_link) 2>&5
12889   ac_status=$?
12890   echo "$as_me:12890: \$? = $ac_status" >&5
12891   (exit $ac_status); } &&
12892          { ac_try='test -s conftest$ac_exeext'
12893   { (eval echo "$as_me:12893: \"$ac_try\"") >&5
12894   (eval $ac_try) 2>&5
12895   ac_status=$?
12896   echo "$as_me:12896: \$? = $ac_status" >&5
12897   (exit $ac_status); }; }; then
12898   cf_cv_need_xopen_extension=yes
12899 else
12900   echo "$as_me: failed program was:" >&5
12901 cat conftest.$ac_ext >&5
12902 cf_cv_need_xopen_extension=unknown
12903 fi
12904 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12905 fi
12906 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12907 fi
12908 echo "$as_me:12908: result: $cf_cv_need_xopen_extension" >&5
12909 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
12910 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
12911
12912 echo "$as_me:12912: checking for term.h" >&5
12913 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
12914 if test "${cf_cv_term_header+set}" = set; then
12915   echo $ECHO_N "(cached) $ECHO_C" >&6
12916 else
12917
12918 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
12919 # for <term.h> if we do not find the variant.
12920
12921 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
12922
12923 case ${cf_cv_ncurses_header:-curses.h} in #(vi
12924 */*)
12925         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
12926         cf_header_list="$cf_header_item $cf_header_list"
12927         ;;
12928 esac
12929
12930 for cf_header in $cf_header_list
12931 do
12932         cat >conftest.$ac_ext <<_ACEOF
12933 #line 12933 "configure"
12934 #include "confdefs.h"
12935
12936 #include <${cf_cv_ncurses_header:-curses.h}>
12937 #include <${cf_header}>
12938 int
12939 main ()
12940 {
12941 WINDOW *x
12942   ;
12943   return 0;
12944 }
12945 _ACEOF
12946 rm -f conftest.$ac_objext
12947 if { (eval echo "$as_me:12947: \"$ac_compile\"") >&5
12948   (eval $ac_compile) 2>&5
12949   ac_status=$?
12950   echo "$as_me:12950: \$? = $ac_status" >&5
12951   (exit $ac_status); } &&
12952          { ac_try='test -s conftest.$ac_objext'
12953   { (eval echo "$as_me:12953: \"$ac_try\"") >&5
12954   (eval $ac_try) 2>&5
12955   ac_status=$?
12956   echo "$as_me:12956: \$? = $ac_status" >&5
12957   (exit $ac_status); }; }; then
12958   cf_cv_term_header=$cf_header
12959          break
12960 else
12961   echo "$as_me: failed program was:" >&5
12962 cat conftest.$ac_ext >&5
12963 cf_cv_term_header=no
12964 fi
12965 rm -f conftest.$ac_objext conftest.$ac_ext
12966 done
12967
12968 case $cf_cv_term_header in #(vi
12969 no)
12970         # If curses is ncurses, some packagers still mess it up by trying to make
12971         # us use GNU termcap.  This handles the most common case.
12972         for cf_header in ncurses/term.h ncursesw/term.h
12973         do
12974                 cat >conftest.$ac_ext <<_ACEOF
12975 #line 12975 "configure"
12976 #include "confdefs.h"
12977
12978 #include <${cf_cv_ncurses_header:-curses.h}>
12979 #ifdef NCURSES_VERSION
12980 #include <${cf_header}>
12981 #else
12982 make an error
12983 #endif
12984 int
12985 main ()
12986 {
12987 WINDOW *x
12988   ;
12989   return 0;
12990 }
12991 _ACEOF
12992 rm -f conftest.$ac_objext
12993 if { (eval echo "$as_me:12993: \"$ac_compile\"") >&5
12994   (eval $ac_compile) 2>&5
12995   ac_status=$?
12996   echo "$as_me:12996: \$? = $ac_status" >&5
12997   (exit $ac_status); } &&
12998          { ac_try='test -s conftest.$ac_objext'
12999   { (eval echo "$as_me:12999: \"$ac_try\"") >&5
13000   (eval $ac_try) 2>&5
13001   ac_status=$?
13002   echo "$as_me:13002: \$? = $ac_status" >&5
13003   (exit $ac_status); }; }; then
13004   cf_cv_term_header=$cf_header
13005                          break
13006 else
13007   echo "$as_me: failed program was:" >&5
13008 cat conftest.$ac_ext >&5
13009 cf_cv_term_header=no
13010 fi
13011 rm -f conftest.$ac_objext conftest.$ac_ext
13012         done
13013         ;;
13014 esac
13015
13016 fi
13017 echo "$as_me:13017: result: $cf_cv_term_header" >&5
13018 echo "${ECHO_T}$cf_cv_term_header" >&6
13019
13020 case $cf_cv_term_header in #(vi
13021 term.h) #(vi
13022
13023 cat >>confdefs.h <<\EOF
13024 #define HAVE_TERM_H 1
13025 EOF
13026
13027         ;;
13028 ncurses/term.h) #(vi
13029
13030 cat >>confdefs.h <<\EOF
13031 #define HAVE_NCURSES_TERM_H 1
13032 EOF
13033
13034         ;;
13035 ncursesw/term.h)
13036
13037 cat >>confdefs.h <<\EOF
13038 #define HAVE_NCURSESW_TERM_H 1
13039 EOF
13040
13041         ;;
13042 esac
13043
13044 echo "$as_me:13044: checking for unctrl.h" >&5
13045 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
13046 if test "${cf_cv_unctrl_header+set}" = set; then
13047   echo $ECHO_N "(cached) $ECHO_C" >&6
13048 else
13049
13050 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
13051 # for <unctrl.h> if we do not find the variant.
13052
13053 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
13054
13055 case ${cf_cv_ncurses_header:-curses.h} in #(vi
13056 */*)
13057         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
13058         cf_header_list="$cf_header_item $cf_header_list"
13059         ;;
13060 esac
13061
13062 for cf_header in $cf_header_list
13063 do
13064         cat >conftest.$ac_ext <<_ACEOF
13065 #line 13065 "configure"
13066 #include "confdefs.h"
13067
13068 #include <${cf_cv_ncurses_header:-curses.h}>
13069 #include <${cf_header}>
13070 int
13071 main ()
13072 {
13073 WINDOW *x
13074   ;
13075   return 0;
13076 }
13077 _ACEOF
13078 rm -f conftest.$ac_objext
13079 if { (eval echo "$as_me:13079: \"$ac_compile\"") >&5
13080   (eval $ac_compile) 2>&5
13081   ac_status=$?
13082   echo "$as_me:13082: \$? = $ac_status" >&5
13083   (exit $ac_status); } &&
13084          { ac_try='test -s conftest.$ac_objext'
13085   { (eval echo "$as_me:13085: \"$ac_try\"") >&5
13086   (eval $ac_try) 2>&5
13087   ac_status=$?
13088   echo "$as_me:13088: \$? = $ac_status" >&5
13089   (exit $ac_status); }; }; then
13090   cf_cv_unctrl_header=$cf_header
13091          break
13092 else
13093   echo "$as_me: failed program was:" >&5
13094 cat conftest.$ac_ext >&5
13095 cf_cv_unctrl_header=no
13096 fi
13097 rm -f conftest.$ac_objext conftest.$ac_ext
13098 done
13099
13100 fi
13101 echo "$as_me:13101: result: $cf_cv_unctrl_header" >&5
13102 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
13103
13104 case $cf_cv_unctrl_header in #(vi
13105 no)
13106         { echo "$as_me:13106: WARNING: unctrl.h header not found" >&5
13107 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
13108         ;;
13109 esac
13110
13111 case $cf_cv_unctrl_header in #(vi
13112 unctrl.h) #(vi
13113
13114 cat >>confdefs.h <<\EOF
13115 #define HAVE_UNCTRL_H 1
13116 EOF
13117
13118         ;;
13119 ncurses/unctrl.h) #(vi
13120
13121 cat >>confdefs.h <<\EOF
13122 #define HAVE_NCURSES_UNCTRL_H 1
13123 EOF
13124
13125         ;;
13126 ncursesw/unctrl.h)
13127
13128 cat >>confdefs.h <<\EOF
13129 #define HAVE_NCURSESW_UNCTRL_H 1
13130 EOF
13131
13132         ;;
13133 esac
13134
13135 for cf_func in \
13136 assume_default_colors \
13137 chgat \
13138 color_set \
13139 filter \
13140 getbegx \
13141 getcurx \
13142 getmaxx \
13143 getnstr \
13144 getparx \
13145 getwin \
13146 mvvline \
13147 mvwvline \
13148 napms \
13149 putwin \
13150 resize_term \
13151 resizeterm \
13152 ripoffline \
13153 scr_dump \
13154 setupterm \
13155 slk_color \
13156 slk_init \
13157 termattrs \
13158 tgetent \
13159 tigetnum \
13160 tigetstr \
13161 typeahead \
13162 use_default_colors \
13163 use_screen \
13164 use_window \
13165 vsscanf \
13166 vw_printw \
13167 wchgat \
13168 winsstr \
13169 wresize \
13170 wsyncdown \
13171
13172 do
13173
13174 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13175
13176         echo "$as_me:13176: checking for ${cf_func}" >&5
13177 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
13178
13179 echo "${as_me:-configure}:13179: testing ${cf_func} ..." 1>&5
13180
13181         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
13182   echo $ECHO_N "(cached) $ECHO_C" >&6
13183 else
13184
13185                 eval cf_result='$ac_cv_func_'$cf_func
13186                 if test ".$cf_result" != ".no"; then
13187                         cat >conftest.$ac_ext <<_ACEOF
13188 #line 13188 "configure"
13189 #include "confdefs.h"
13190
13191 #ifdef HAVE_XCURSES
13192 #include <xcurses.h>
13193 char * XCursesProgramName = "test";
13194 #else
13195 #include <${cf_cv_ncurses_header:-curses.h}>
13196 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13197 #include <ncursesw/term.h>
13198 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13199 #include <ncurses/term.h>
13200 #elif defined(HAVE_TERM_H)
13201 #include <term.h>
13202 #endif
13203 #endif
13204
13205 int
13206 main ()
13207 {
13208
13209 #ifndef ${cf_func}
13210 long foo = (long)(&${cf_func});
13211 if (foo + 1234 > 5678)
13212         ${cf_cv_main_return:-return}(foo);
13213 #endif
13214
13215   ;
13216   return 0;
13217 }
13218 _ACEOF
13219 rm -f conftest.$ac_objext conftest$ac_exeext
13220 if { (eval echo "$as_me:13220: \"$ac_link\"") >&5
13221   (eval $ac_link) 2>&5
13222   ac_status=$?
13223   echo "$as_me:13223: \$? = $ac_status" >&5
13224   (exit $ac_status); } &&
13225          { ac_try='test -s conftest$ac_exeext'
13226   { (eval echo "$as_me:13226: \"$ac_try\"") >&5
13227   (eval $ac_try) 2>&5
13228   ac_status=$?
13229   echo "$as_me:13229: \$? = $ac_status" >&5
13230   (exit $ac_status); }; }; then
13231   cf_result=yes
13232 else
13233   echo "$as_me: failed program was:" >&5
13234 cat conftest.$ac_ext >&5
13235 cf_result=no
13236 fi
13237 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13238                 fi
13239                 eval 'cf_cv_func_'$cf_func'=$cf_result'
13240
13241 fi
13242
13243         # use the computed/retrieved cache-value:
13244         eval 'cf_result=$cf_cv_func_'$cf_func
13245         echo "$as_me:13245: result: $cf_result" >&5
13246 echo "${ECHO_T}$cf_result" >&6
13247         if test $cf_result != no; then
13248                 cat >>confdefs.h <<EOF
13249 #define HAVE_${cf_tr_func} 1
13250 EOF
13251
13252         fi
13253 done
13254
13255 for cf_func in tputs
13256 do
13257
13258 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13259
13260         echo "$as_me:13260: checking for ${cf_func}" >&5
13261 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
13262
13263 echo "${as_me:-configure}:13263: testing ${cf_func} ..." 1>&5
13264
13265         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
13266   echo $ECHO_N "(cached) $ECHO_C" >&6
13267 else
13268
13269                 eval cf_result='$ac_cv_func_'$cf_func
13270                 if test ".$cf_result" != ".no"; then
13271                         cat >conftest.$ac_ext <<_ACEOF
13272 #line 13272 "configure"
13273 #include "confdefs.h"
13274
13275 #ifdef HAVE_XCURSES
13276 #include <xcurses.h>
13277 char * XCursesProgramName = "test";
13278 #else
13279 #include <${cf_cv_ncurses_header:-curses.h}>
13280 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13281 #include <ncursesw/term.h>
13282 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13283 #include <ncurses/term.h>
13284 #elif defined(HAVE_TERM_H)
13285 #include <term.h>
13286 #endif
13287 #endif
13288
13289 int
13290 main ()
13291 {
13292
13293 #ifndef ${cf_func}
13294 long foo = (long)(&${cf_func});
13295 if (foo + 1234 > 5678)
13296         ${cf_cv_main_return:-return}(foo);
13297 #endif
13298
13299   ;
13300   return 0;
13301 }
13302 _ACEOF
13303 rm -f conftest.$ac_objext conftest$ac_exeext
13304 if { (eval echo "$as_me:13304: \"$ac_link\"") >&5
13305   (eval $ac_link) 2>&5
13306   ac_status=$?
13307   echo "$as_me:13307: \$? = $ac_status" >&5
13308   (exit $ac_status); } &&
13309          { ac_try='test -s conftest$ac_exeext'
13310   { (eval echo "$as_me:13310: \"$ac_try\"") >&5
13311   (eval $ac_try) 2>&5
13312   ac_status=$?
13313   echo "$as_me:13313: \$? = $ac_status" >&5
13314   (exit $ac_status); }; }; then
13315   cf_result=yes
13316 else
13317   echo "$as_me: failed program was:" >&5
13318 cat conftest.$ac_ext >&5
13319 cf_result=no
13320 fi
13321 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13322                 fi
13323                 eval 'cf_cv_func_'$cf_func'=$cf_result'
13324
13325 fi
13326
13327         # use the computed/retrieved cache-value:
13328         eval 'cf_result=$cf_cv_func_'$cf_func
13329         echo "$as_me:13329: result: $cf_result" >&5
13330 echo "${ECHO_T}$cf_result" >&6
13331         if test $cf_result != no; then
13332                 cat >>confdefs.h <<EOF
13333 #define HAVE_${cf_tr_func} 1
13334 EOF
13335
13336         fi
13337 done
13338
13339 if test x$cf_cv_func_tputs = xyes
13340 then
13341         cf_done=no
13342         for cf_arg in int char
13343         do
13344                 for cf_ret in int void
13345                 do
13346                         if test $cf_ret = void
13347                         then
13348                                 cf_return="/* nothing */"
13349                         else
13350                                 cf_return="return value"
13351                         fi
13352                         cat >conftest.$ac_ext <<_ACEOF
13353 #line 13353 "configure"
13354 #include "confdefs.h"
13355
13356 #include <${cf_cv_ncurses_header:-curses.h}>
13357 #include <$cf_cv_term_header>
13358
13359 static $cf_ret outc($cf_arg value) { $cf_return; }
13360
13361 int
13362 main ()
13363 {
13364
13365         tputs("hello", 0, outc);
13366         ${cf_cv_main_return:-return}(0);
13367
13368   ;
13369   return 0;
13370 }
13371 _ACEOF
13372 rm -f conftest.$ac_objext
13373 if { (eval echo "$as_me:13373: \"$ac_compile\"") >&5
13374   (eval $ac_compile) 2>&5
13375   ac_status=$?
13376   echo "$as_me:13376: \$? = $ac_status" >&5
13377   (exit $ac_status); } &&
13378          { ac_try='test -s conftest.$ac_objext'
13379   { (eval echo "$as_me:13379: \"$ac_try\"") >&5
13380   (eval $ac_try) 2>&5
13381   ac_status=$?
13382   echo "$as_me:13382: \$? = $ac_status" >&5
13383   (exit $ac_status); }; }; then
13384
13385                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
13386
13387 echo "${as_me:-configure}:13387: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
13388
13389                 cat >>confdefs.h <<EOF
13390 #define TPUTS_ARG               $cf_arg
13391 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
13392 #define TPUTS_RETURN(value)     $cf_return
13393 EOF
13394                 cf_done=yes
13395                 break
13396
13397 else
13398   echo "$as_me: failed program was:" >&5
13399 cat conftest.$ac_ext >&5
13400 fi
13401 rm -f conftest.$ac_objext conftest.$ac_ext
13402                 done
13403                 test $cf_done = yes && break
13404         done
13405 fi
13406
13407 echo "$as_me:13407: checking for ncurses extended functions" >&5
13408 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
13409 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
13410   echo $ECHO_N "(cached) $ECHO_C" >&6
13411 else
13412
13413 cat >conftest.$ac_ext <<_ACEOF
13414 #line 13414 "configure"
13415 #include "confdefs.h"
13416
13417 #include <${cf_cv_ncurses_header:-curses.h}>
13418 int
13419 main ()
13420 {
13421
13422 int x = NCURSES_EXT_FUNCS
13423
13424   ;
13425   return 0;
13426 }
13427 _ACEOF
13428 rm -f conftest.$ac_objext
13429 if { (eval echo "$as_me:13429: \"$ac_compile\"") >&5
13430   (eval $ac_compile) 2>&5
13431   ac_status=$?
13432   echo "$as_me:13432: \$? = $ac_status" >&5
13433   (exit $ac_status); } &&
13434          { ac_try='test -s conftest.$ac_objext'
13435   { (eval echo "$as_me:13435: \"$ac_try\"") >&5
13436   (eval $ac_try) 2>&5
13437   ac_status=$?
13438   echo "$as_me:13438: \$? = $ac_status" >&5
13439   (exit $ac_status); }; }; then
13440   cf_cv_ncurses_ext_funcs=defined
13441 else
13442   echo "$as_me: failed program was:" >&5
13443 cat conftest.$ac_ext >&5
13444
13445 cat >conftest.$ac_ext <<_ACEOF
13446 #line 13446 "configure"
13447 #include "confdefs.h"
13448
13449 #include <${cf_cv_ncurses_header:-curses.h}>
13450 int
13451 main ()
13452 {
13453
13454         (void) assume_default_colors (0, 0);
13455         (void) curses_version ();
13456         (void) define_key (0, 0);
13457         (void) is_term_resized (0, 0);
13458         (void) key_defined (0);
13459         (void) keybound (0, 0);
13460         (void) keyok (0, 0);
13461         (void) resize_term (0, 0);
13462         (void) resizeterm (0, 0);
13463         (void) use_default_colors ();
13464         (void) use_extended_names (0);
13465         (void) wresize (0, 0, 0);
13466   ;
13467   return 0;
13468 }
13469 _ACEOF
13470 rm -f conftest.$ac_objext conftest$ac_exeext
13471 if { (eval echo "$as_me:13471: \"$ac_link\"") >&5
13472   (eval $ac_link) 2>&5
13473   ac_status=$?
13474   echo "$as_me:13474: \$? = $ac_status" >&5
13475   (exit $ac_status); } &&
13476          { ac_try='test -s conftest$ac_exeext'
13477   { (eval echo "$as_me:13477: \"$ac_try\"") >&5
13478   (eval $ac_try) 2>&5
13479   ac_status=$?
13480   echo "$as_me:13480: \$? = $ac_status" >&5
13481   (exit $ac_status); }; }; then
13482   cf_cv_ncurses_ext_funcs=yes
13483 else
13484   echo "$as_me: failed program was:" >&5
13485 cat conftest.$ac_ext >&5
13486 cf_cv_ncurses_ext_funcs=no
13487 fi
13488 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13489
13490 fi
13491 rm -f conftest.$ac_objext conftest.$ac_ext
13492
13493 fi
13494 echo "$as_me:13494: result: $cf_cv_ncurses_ext_funcs" >&5
13495 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
13496 test "$cf_cv_ncurses_ext_funcs" = yes &&
13497 cat >>confdefs.h <<\EOF
13498 #define NCURSES_EXT_FUNCS 1
13499 EOF
13500
13501 if test "$cf_enable_widec" = yes
13502 then
13503         # workaround for systems with ncurses before 20111029, due to change of
13504         # feature test macro from _XPG5 to _XOPEN_SOURCE
13505         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
13506         then
13507                 cf_define_xpg5=no
13508                 echo "$as_me:13508: checking if _XPG5 should be defined to enable wide-characters" >&5
13509 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
13510
13511                 cat >conftest.$ac_ext <<_ACEOF
13512 #line 13512 "configure"
13513 #include "confdefs.h"
13514
13515 #include <${cf_cv_ncurses_header:-curses.h}>
13516 int
13517 main ()
13518 {
13519 int x = _XPG5
13520   ;
13521   return 0;
13522 }
13523 _ACEOF
13524 rm -f conftest.$ac_objext
13525 if { (eval echo "$as_me:13525: \"$ac_compile\"") >&5
13526   (eval $ac_compile) 2>&5
13527   ac_status=$?
13528   echo "$as_me:13528: \$? = $ac_status" >&5
13529   (exit $ac_status); } &&
13530          { ac_try='test -s conftest.$ac_objext'
13531   { (eval echo "$as_me:13531: \"$ac_try\"") >&5
13532   (eval $ac_try) 2>&5
13533   ac_status=$?
13534   echo "$as_me:13534: \$? = $ac_status" >&5
13535   (exit $ac_status); }; }; then
13536   :
13537 else
13538   echo "$as_me: failed program was:" >&5
13539 cat conftest.$ac_ext >&5
13540 cf_save_cppflags="$CPPFLAGS"
13541                          CPPFLAGS="$CPPFLAGS -D_XPG5"
13542                          cat >conftest.$ac_ext <<_ACEOF
13543 #line 13543 "configure"
13544 #include "confdefs.h"
13545
13546 #include <${cf_cv_ncurses_header:-curses.h}>
13547 int
13548 main ()
13549 {
13550 int x = _XPG5
13551   ;
13552   return 0;
13553 }
13554 _ACEOF
13555 rm -f conftest.$ac_objext
13556 if { (eval echo "$as_me:13556: \"$ac_compile\"") >&5
13557   (eval $ac_compile) 2>&5
13558   ac_status=$?
13559   echo "$as_me:13559: \$? = $ac_status" >&5
13560   (exit $ac_status); } &&
13561          { ac_try='test -s conftest.$ac_objext'
13562   { (eval echo "$as_me:13562: \"$ac_try\"") >&5
13563   (eval $ac_try) 2>&5
13564   ac_status=$?
13565   echo "$as_me:13565: \$? = $ac_status" >&5
13566   (exit $ac_status); }; }; then
13567   cf_define_xpg5=yes
13568 else
13569   echo "$as_me: failed program was:" >&5
13570 cat conftest.$ac_ext >&5
13571 fi
13572 rm -f conftest.$ac_objext conftest.$ac_ext
13573                          CPPFLAGS="$cf_save_cppflags"
13574 fi
13575 rm -f conftest.$ac_objext conftest.$ac_ext
13576                 echo "$as_me:13576: result: $cf_define_xpg5" >&5
13577 echo "${ECHO_T}$cf_define_xpg5" >&6
13578
13579                 if test "$cf_define_xpg5" = yes
13580                 then
13581                         CPPFLAGS="$CPPFLAGS -D_XPG5"
13582                 fi
13583         fi
13584
13585         echo "$as_me:13585: checking for wide-character functions" >&5
13586 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
13587 if test "${cf_cv_widechar_funcs+set}" = set; then
13588   echo $ECHO_N "(cached) $ECHO_C" >&6
13589 else
13590
13591         cat >conftest.$ac_ext <<_ACEOF
13592 #line 13592 "configure"
13593 #include "confdefs.h"
13594
13595 #include <${cf_cv_ncurses_header:-curses.h}>
13596 int
13597 main ()
13598 {
13599
13600                 static wchar_t src_wchar[2];
13601                 static cchar_t dst_cchar;
13602                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
13603
13604   ;
13605   return 0;
13606 }
13607 _ACEOF
13608 rm -f conftest.$ac_objext conftest$ac_exeext
13609 if { (eval echo "$as_me:13609: \"$ac_link\"") >&5
13610   (eval $ac_link) 2>&5
13611   ac_status=$?
13612   echo "$as_me:13612: \$? = $ac_status" >&5
13613   (exit $ac_status); } &&
13614          { ac_try='test -s conftest$ac_exeext'
13615   { (eval echo "$as_me:13615: \"$ac_try\"") >&5
13616   (eval $ac_try) 2>&5
13617   ac_status=$?
13618   echo "$as_me:13618: \$? = $ac_status" >&5
13619   (exit $ac_status); }; }; then
13620   cf_cv_widechar_funcs=yes
13621 else
13622   echo "$as_me: failed program was:" >&5
13623 cat conftest.$ac_ext >&5
13624 cf_cv_widechar_funcs=no
13625 fi
13626 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13627
13628 fi
13629 echo "$as_me:13629: result: $cf_cv_widechar_funcs" >&5
13630 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
13631         if test "$cf_cv_widechar_funcs" != no ; then
13632
13633 cat >>confdefs.h <<\EOF
13634 #define USE_WIDEC_SUPPORT 1
13635 EOF
13636
13637         else
13638                 cat >>confdefs.h <<\EOF
13639 #define USE_WIDEC_SUPPORT 0
13640 EOF
13641
13642         fi
13643 else
13644         cat >>confdefs.h <<\EOF
13645 #define USE_WIDEC_SUPPORT 0
13646 EOF
13647
13648 fi
13649
13650 echo "$as_me:13650: checking if sys/time.h works with sys/select.h" >&5
13651 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
13652 if test "${cf_cv_sys_time_select+set}" = set; then
13653   echo $ECHO_N "(cached) $ECHO_C" >&6
13654 else
13655
13656 cat >conftest.$ac_ext <<_ACEOF
13657 #line 13657 "configure"
13658 #include "confdefs.h"
13659
13660 #include <sys/types.h>
13661 #ifdef HAVE_SYS_TIME_H
13662 #include <sys/time.h>
13663 #endif
13664 #ifdef HAVE_SYS_SELECT_H
13665 #include <sys/select.h>
13666 #endif
13667
13668 int
13669 main ()
13670 {
13671
13672   ;
13673   return 0;
13674 }
13675 _ACEOF
13676 rm -f conftest.$ac_objext
13677 if { (eval echo "$as_me:13677: \"$ac_compile\"") >&5
13678   (eval $ac_compile) 2>&5
13679   ac_status=$?
13680   echo "$as_me:13680: \$? = $ac_status" >&5
13681   (exit $ac_status); } &&
13682          { ac_try='test -s conftest.$ac_objext'
13683   { (eval echo "$as_me:13683: \"$ac_try\"") >&5
13684   (eval $ac_try) 2>&5
13685   ac_status=$?
13686   echo "$as_me:13686: \$? = $ac_status" >&5
13687   (exit $ac_status); }; }; then
13688   cf_cv_sys_time_select=yes
13689 else
13690   echo "$as_me: failed program was:" >&5
13691 cat conftest.$ac_ext >&5
13692 cf_cv_sys_time_select=no
13693 fi
13694 rm -f conftest.$ac_objext conftest.$ac_ext
13695
13696 fi
13697
13698 echo "$as_me:13698: result: $cf_cv_sys_time_select" >&5
13699 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
13700 test "$cf_cv_sys_time_select" = yes &&
13701 cat >>confdefs.h <<\EOF
13702 #define HAVE_SYS_TIME_SELECT 1
13703 EOF
13704
13705 echo "$as_me:13705: checking for function curses_version" >&5
13706 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
13707 if test "${cf_cv_func_curses_version+set}" = set; then
13708   echo $ECHO_N "(cached) $ECHO_C" >&6
13709 else
13710
13711 if test "$cross_compiling" = yes; then
13712   cf_cv_func_curses_version=unknown
13713 else
13714   cat >conftest.$ac_ext <<_ACEOF
13715 #line 13715 "configure"
13716 #include "confdefs.h"
13717
13718 #include <${cf_cv_ncurses_header:-curses.h}>
13719 int main()
13720 {
13721         char temp[1024];
13722         sprintf(temp, "%s\n", curses_version());
13723         ${cf_cv_main_return:-return}(0);
13724 }
13725
13726 _ACEOF
13727 rm -f conftest$ac_exeext
13728 if { (eval echo "$as_me:13728: \"$ac_link\"") >&5
13729   (eval $ac_link) 2>&5
13730   ac_status=$?
13731   echo "$as_me:13731: \$? = $ac_status" >&5
13732   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13733   { (eval echo "$as_me:13733: \"$ac_try\"") >&5
13734   (eval $ac_try) 2>&5
13735   ac_status=$?
13736   echo "$as_me:13736: \$? = $ac_status" >&5
13737   (exit $ac_status); }; }; then
13738   cf_cv_func_curses_version=yes
13739
13740 else
13741   echo "$as_me: program exited with status $ac_status" >&5
13742 echo "$as_me: failed program was:" >&5
13743 cat conftest.$ac_ext >&5
13744 cf_cv_func_curses_version=no
13745
13746 fi
13747 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13748 fi
13749 rm -f core
13750 fi
13751 echo "$as_me:13751: result: $cf_cv_func_curses_version" >&5
13752 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
13753 test "$cf_cv_func_curses_version" = yes &&
13754 cat >>confdefs.h <<\EOF
13755 #define HAVE_CURSES_VERSION 1
13756 EOF
13757
13758 echo "$as_me:13758: checking for alternate character set array" >&5
13759 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
13760 if test "${cf_cv_curses_acs_map+set}" = set; then
13761   echo $ECHO_N "(cached) $ECHO_C" >&6
13762 else
13763
13764 cf_cv_curses_acs_map=unknown
13765 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
13766 do
13767 cat >conftest.$ac_ext <<_ACEOF
13768 #line 13768 "configure"
13769 #include "confdefs.h"
13770
13771 #include <${cf_cv_ncurses_header:-curses.h}>
13772
13773 int
13774 main ()
13775 {
13776
13777 $name['k'] = ACS_PLUS
13778
13779   ;
13780   return 0;
13781 }
13782 _ACEOF
13783 rm -f conftest.$ac_objext conftest$ac_exeext
13784 if { (eval echo "$as_me:13784: \"$ac_link\"") >&5
13785   (eval $ac_link) 2>&5
13786   ac_status=$?
13787   echo "$as_me:13787: \$? = $ac_status" >&5
13788   (exit $ac_status); } &&
13789          { ac_try='test -s conftest$ac_exeext'
13790   { (eval echo "$as_me:13790: \"$ac_try\"") >&5
13791   (eval $ac_try) 2>&5
13792   ac_status=$?
13793   echo "$as_me:13793: \$? = $ac_status" >&5
13794   (exit $ac_status); }; }; then
13795   cf_cv_curses_acs_map=$name; break
13796 else
13797   echo "$as_me: failed program was:" >&5
13798 cat conftest.$ac_ext >&5
13799 fi
13800 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13801 done
13802
13803 fi
13804 echo "$as_me:13804: result: $cf_cv_curses_acs_map" >&5
13805 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
13806
13807 test "$cf_cv_curses_acs_map" != unknown &&
13808 cat >>confdefs.h <<EOF
13809 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
13810 EOF
13811
13812 if test "$cf_enable_widec" = yes; then
13813
13814 echo "$as_me:13814: checking for wide alternate character set array" >&5
13815 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
13816 if test "${cf_cv_curses_wacs_map+set}" = set; then
13817   echo $ECHO_N "(cached) $ECHO_C" >&6
13818 else
13819
13820         cf_cv_curses_wacs_map=unknown
13821         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
13822         do
13823         cat >conftest.$ac_ext <<_ACEOF
13824 #line 13824 "configure"
13825 #include "confdefs.h"
13826
13827 #ifndef _XOPEN_SOURCE_EXTENDED
13828 #define _XOPEN_SOURCE_EXTENDED
13829 #endif
13830 #include <${cf_cv_ncurses_header:-curses.h}>
13831 int
13832 main ()
13833 {
13834 void *foo = &($name['k'])
13835   ;
13836   return 0;
13837 }
13838 _ACEOF
13839 rm -f conftest.$ac_objext conftest$ac_exeext
13840 if { (eval echo "$as_me:13840: \"$ac_link\"") >&5
13841   (eval $ac_link) 2>&5
13842   ac_status=$?
13843   echo "$as_me:13843: \$? = $ac_status" >&5
13844   (exit $ac_status); } &&
13845          { ac_try='test -s conftest$ac_exeext'
13846   { (eval echo "$as_me:13846: \"$ac_try\"") >&5
13847   (eval $ac_try) 2>&5
13848   ac_status=$?
13849   echo "$as_me:13849: \$? = $ac_status" >&5
13850   (exit $ac_status); }; }; then
13851   cf_cv_curses_wacs_map=$name
13852          break
13853 else
13854   echo "$as_me: failed program was:" >&5
13855 cat conftest.$ac_ext >&5
13856 fi
13857 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13858         done
13859 fi
13860 echo "$as_me:13860: result: $cf_cv_curses_wacs_map" >&5
13861 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
13862
13863 test "$cf_cv_curses_wacs_map" != unknown &&
13864 cat >>confdefs.h <<EOF
13865 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
13866 EOF
13867
13868 echo "$as_me:13868: checking for wide alternate character constants" >&5
13869 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
13870 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
13871   echo $ECHO_N "(cached) $ECHO_C" >&6
13872 else
13873
13874 cf_cv_curses_wacs_symbols=no
13875 if test "$cf_cv_curses_wacs_map" != unknown
13876 then
13877         cat >conftest.$ac_ext <<_ACEOF
13878 #line 13878 "configure"
13879 #include "confdefs.h"
13880
13881 #ifndef _XOPEN_SOURCE_EXTENDED
13882 #define _XOPEN_SOURCE_EXTENDED
13883 #endif
13884 #include <${cf_cv_ncurses_header:-curses.h}>
13885 int
13886 main ()
13887 {
13888 cchar_t *foo = WACS_PLUS;
13889          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
13890   ;
13891   return 0;
13892 }
13893 _ACEOF
13894 rm -f conftest.$ac_objext conftest$ac_exeext
13895 if { (eval echo "$as_me:13895: \"$ac_link\"") >&5
13896   (eval $ac_link) 2>&5
13897   ac_status=$?
13898   echo "$as_me:13898: \$? = $ac_status" >&5
13899   (exit $ac_status); } &&
13900          { ac_try='test -s conftest$ac_exeext'
13901   { (eval echo "$as_me:13901: \"$ac_try\"") >&5
13902   (eval $ac_try) 2>&5
13903   ac_status=$?
13904   echo "$as_me:13904: \$? = $ac_status" >&5
13905   (exit $ac_status); }; }; then
13906   cf_cv_curses_wacs_symbols=yes
13907 else
13908   echo "$as_me: failed program was:" >&5
13909 cat conftest.$ac_ext >&5
13910 fi
13911 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13912 else
13913         cat >conftest.$ac_ext <<_ACEOF
13914 #line 13914 "configure"
13915 #include "confdefs.h"
13916
13917 #ifndef _XOPEN_SOURCE_EXTENDED
13918 #define _XOPEN_SOURCE_EXTENDED
13919 #endif
13920 #include <${cf_cv_ncurses_header:-curses.h}>
13921 int
13922 main ()
13923 {
13924 cchar_t *foo = WACS_PLUS
13925   ;
13926   return 0;
13927 }
13928 _ACEOF
13929 rm -f conftest.$ac_objext conftest$ac_exeext
13930 if { (eval echo "$as_me:13930: \"$ac_link\"") >&5
13931   (eval $ac_link) 2>&5
13932   ac_status=$?
13933   echo "$as_me:13933: \$? = $ac_status" >&5
13934   (exit $ac_status); } &&
13935          { ac_try='test -s conftest$ac_exeext'
13936   { (eval echo "$as_me:13936: \"$ac_try\"") >&5
13937   (eval $ac_try) 2>&5
13938   ac_status=$?
13939   echo "$as_me:13939: \$? = $ac_status" >&5
13940   (exit $ac_status); }; }; then
13941   cf_cv_curses_wacs_symbols=yes
13942 else
13943   echo "$as_me: failed program was:" >&5
13944 cat conftest.$ac_ext >&5
13945 fi
13946 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13947 fi
13948
13949 fi
13950 echo "$as_me:13950: result: $cf_cv_curses_wacs_symbols" >&5
13951 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
13952
13953 test "$cf_cv_curses_wacs_symbols" != no &&
13954 cat >>confdefs.h <<\EOF
13955 #define CURSES_WACS_SYMBOLS 1
13956 EOF
13957
13958 fi
13959
13960 echo "$as_me:13960: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
13961 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
13962 cat >conftest.$ac_ext <<_ACEOF
13963 #line 13963 "configure"
13964 #include "confdefs.h"
13965
13966 #ifndef _XOPEN_SOURCE_EXTENDED
13967 #define _XOPEN_SOURCE_EXTENDED
13968 #endif
13969 #include <${cf_cv_ncurses_header:-curses.h}>
13970 int
13971 main ()
13972 {
13973
13974 attr_t foo
13975
13976   ;
13977   return 0;
13978 }
13979 _ACEOF
13980 rm -f conftest.$ac_objext
13981 if { (eval echo "$as_me:13981: \"$ac_compile\"") >&5
13982   (eval $ac_compile) 2>&5
13983   ac_status=$?
13984   echo "$as_me:13984: \$? = $ac_status" >&5
13985   (exit $ac_status); } &&
13986          { ac_try='test -s conftest.$ac_objext'
13987   { (eval echo "$as_me:13987: \"$ac_try\"") >&5
13988   (eval $ac_try) 2>&5
13989   ac_status=$?
13990   echo "$as_me:13990: \$? = $ac_status" >&5
13991   (exit $ac_status); }; }; then
13992   cf_result=yes
13993 else
13994   echo "$as_me: failed program was:" >&5
13995 cat conftest.$ac_ext >&5
13996 cf_result=no
13997 fi
13998 rm -f conftest.$ac_objext conftest.$ac_ext
13999 echo "$as_me:13999: result: $cf_result" >&5
14000 echo "${ECHO_T}$cf_result" >&6
14001 if test $cf_result = yes ; then
14002
14003 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14004
14005 cat >>confdefs.h <<EOF
14006 #define $cf_result 1
14007 EOF
14008
14009 else
14010
14011 cat >>confdefs.h <<EOF
14012 #define attr_t long
14013 EOF
14014
14015 fi
14016
14017 if test "$cf_enable_widec" = yes; then
14018
14019 # This is needed on Tru64 5.0 to declare mbstate_t
14020 echo "$as_me:14020: checking if we must include wchar.h to declare mbstate_t" >&5
14021 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
14022 if test "${cf_cv_mbstate_t+set}" = set; then
14023   echo $ECHO_N "(cached) $ECHO_C" >&6
14024 else
14025
14026 cat >conftest.$ac_ext <<_ACEOF
14027 #line 14027 "configure"
14028 #include "confdefs.h"
14029
14030 #include <stdlib.h>
14031 #include <stdarg.h>
14032 #include <stdio.h>
14033 #ifdef HAVE_LIBUTF8_H
14034 #include <libutf8.h>
14035 #endif
14036 int
14037 main ()
14038 {
14039 mbstate_t state
14040   ;
14041   return 0;
14042 }
14043 _ACEOF
14044 rm -f conftest.$ac_objext
14045 if { (eval echo "$as_me:14045: \"$ac_compile\"") >&5
14046   (eval $ac_compile) 2>&5
14047   ac_status=$?
14048   echo "$as_me:14048: \$? = $ac_status" >&5
14049   (exit $ac_status); } &&
14050          { ac_try='test -s conftest.$ac_objext'
14051   { (eval echo "$as_me:14051: \"$ac_try\"") >&5
14052   (eval $ac_try) 2>&5
14053   ac_status=$?
14054   echo "$as_me:14054: \$? = $ac_status" >&5
14055   (exit $ac_status); }; }; then
14056   cf_cv_mbstate_t=no
14057 else
14058   echo "$as_me: failed program was:" >&5
14059 cat conftest.$ac_ext >&5
14060 cat >conftest.$ac_ext <<_ACEOF
14061 #line 14061 "configure"
14062 #include "confdefs.h"
14063
14064 #include <stdlib.h>
14065 #include <stdarg.h>
14066 #include <stdio.h>
14067 #include <wchar.h>
14068 #ifdef HAVE_LIBUTF8_H
14069 #include <libutf8.h>
14070 #endif
14071 int
14072 main ()
14073 {
14074 mbstate_t value
14075   ;
14076   return 0;
14077 }
14078 _ACEOF
14079 rm -f conftest.$ac_objext
14080 if { (eval echo "$as_me:14080: \"$ac_compile\"") >&5
14081   (eval $ac_compile) 2>&5
14082   ac_status=$?
14083   echo "$as_me:14083: \$? = $ac_status" >&5
14084   (exit $ac_status); } &&
14085          { ac_try='test -s conftest.$ac_objext'
14086   { (eval echo "$as_me:14086: \"$ac_try\"") >&5
14087   (eval $ac_try) 2>&5
14088   ac_status=$?
14089   echo "$as_me:14089: \$? = $ac_status" >&5
14090   (exit $ac_status); }; }; then
14091   cf_cv_mbstate_t=yes
14092 else
14093   echo "$as_me: failed program was:" >&5
14094 cat conftest.$ac_ext >&5
14095 cf_cv_mbstate_t=unknown
14096 fi
14097 rm -f conftest.$ac_objext conftest.$ac_ext
14098 fi
14099 rm -f conftest.$ac_objext conftest.$ac_ext
14100 fi
14101 echo "$as_me:14101: result: $cf_cv_mbstate_t" >&5
14102 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
14103
14104 if test "$cf_cv_mbstate_t" = yes ; then
14105
14106 cat >>confdefs.h <<\EOF
14107 #define NEED_WCHAR_H 1
14108 EOF
14109
14110         NEED_WCHAR_H=1
14111 fi
14112
14113 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
14114 if test "$cf_cv_mbstate_t" = unknown ; then
14115         NCURSES_MBSTATE_T=1
14116 fi
14117
14118 # if we find mbstate_t in either place, use substitution to provide a fallback.
14119 if test "$cf_cv_mbstate_t" != unknown ; then
14120         NCURSES_OK_MBSTATE_T=1
14121 fi
14122
14123 # This is needed on Tru64 5.0 to declare wchar_t
14124 echo "$as_me:14124: checking if we must include wchar.h to declare wchar_t" >&5
14125 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
14126 if test "${cf_cv_wchar_t+set}" = set; then
14127   echo $ECHO_N "(cached) $ECHO_C" >&6
14128 else
14129
14130 cat >conftest.$ac_ext <<_ACEOF
14131 #line 14131 "configure"
14132 #include "confdefs.h"
14133
14134 #include <stdlib.h>
14135 #include <stdarg.h>
14136 #include <stdio.h>
14137 #ifdef HAVE_LIBUTF8_H
14138 #include <libutf8.h>
14139 #endif
14140 int
14141 main ()
14142 {
14143 wchar_t state
14144   ;
14145   return 0;
14146 }
14147 _ACEOF
14148 rm -f conftest.$ac_objext
14149 if { (eval echo "$as_me:14149: \"$ac_compile\"") >&5
14150   (eval $ac_compile) 2>&5
14151   ac_status=$?
14152   echo "$as_me:14152: \$? = $ac_status" >&5
14153   (exit $ac_status); } &&
14154          { ac_try='test -s conftest.$ac_objext'
14155   { (eval echo "$as_me:14155: \"$ac_try\"") >&5
14156   (eval $ac_try) 2>&5
14157   ac_status=$?
14158   echo "$as_me:14158: \$? = $ac_status" >&5
14159   (exit $ac_status); }; }; then
14160   cf_cv_wchar_t=no
14161 else
14162   echo "$as_me: failed program was:" >&5
14163 cat conftest.$ac_ext >&5
14164 cat >conftest.$ac_ext <<_ACEOF
14165 #line 14165 "configure"
14166 #include "confdefs.h"
14167
14168 #include <stdlib.h>
14169 #include <stdarg.h>
14170 #include <stdio.h>
14171 #include <wchar.h>
14172 #ifdef HAVE_LIBUTF8_H
14173 #include <libutf8.h>
14174 #endif
14175 int
14176 main ()
14177 {
14178 wchar_t value
14179   ;
14180   return 0;
14181 }
14182 _ACEOF
14183 rm -f conftest.$ac_objext
14184 if { (eval echo "$as_me:14184: \"$ac_compile\"") >&5
14185   (eval $ac_compile) 2>&5
14186   ac_status=$?
14187   echo "$as_me:14187: \$? = $ac_status" >&5
14188   (exit $ac_status); } &&
14189          { ac_try='test -s conftest.$ac_objext'
14190   { (eval echo "$as_me:14190: \"$ac_try\"") >&5
14191   (eval $ac_try) 2>&5
14192   ac_status=$?
14193   echo "$as_me:14193: \$? = $ac_status" >&5
14194   (exit $ac_status); }; }; then
14195   cf_cv_wchar_t=yes
14196 else
14197   echo "$as_me: failed program was:" >&5
14198 cat conftest.$ac_ext >&5
14199 cf_cv_wchar_t=unknown
14200 fi
14201 rm -f conftest.$ac_objext conftest.$ac_ext
14202 fi
14203 rm -f conftest.$ac_objext conftest.$ac_ext
14204 fi
14205 echo "$as_me:14205: result: $cf_cv_wchar_t" >&5
14206 echo "${ECHO_T}$cf_cv_wchar_t" >&6
14207
14208 if test "$cf_cv_wchar_t" = yes ; then
14209
14210 cat >>confdefs.h <<\EOF
14211 #define NEED_WCHAR_H 1
14212 EOF
14213
14214         NEED_WCHAR_H=1
14215 fi
14216
14217 # if we do not find wchar_t in either place, use substitution to provide a fallback.
14218 if test "$cf_cv_wchar_t" = unknown ; then
14219         NCURSES_WCHAR_T=1
14220 fi
14221
14222 # if we find wchar_t in either place, use substitution to provide a fallback.
14223 if test "$cf_cv_wchar_t" != unknown ; then
14224         NCURSES_OK_WCHAR_T=1
14225 fi
14226
14227 # This is needed on Tru64 5.0 to declare wint_t
14228 echo "$as_me:14228: checking if we must include wchar.h to declare wint_t" >&5
14229 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
14230 if test "${cf_cv_wint_t+set}" = set; then
14231   echo $ECHO_N "(cached) $ECHO_C" >&6
14232 else
14233
14234 cat >conftest.$ac_ext <<_ACEOF
14235 #line 14235 "configure"
14236 #include "confdefs.h"
14237
14238 #include <stdlib.h>
14239 #include <stdarg.h>
14240 #include <stdio.h>
14241 #ifdef HAVE_LIBUTF8_H
14242 #include <libutf8.h>
14243 #endif
14244 int
14245 main ()
14246 {
14247 wint_t state
14248   ;
14249   return 0;
14250 }
14251 _ACEOF
14252 rm -f conftest.$ac_objext
14253 if { (eval echo "$as_me:14253: \"$ac_compile\"") >&5
14254   (eval $ac_compile) 2>&5
14255   ac_status=$?
14256   echo "$as_me:14256: \$? = $ac_status" >&5
14257   (exit $ac_status); } &&
14258          { ac_try='test -s conftest.$ac_objext'
14259   { (eval echo "$as_me:14259: \"$ac_try\"") >&5
14260   (eval $ac_try) 2>&5
14261   ac_status=$?
14262   echo "$as_me:14262: \$? = $ac_status" >&5
14263   (exit $ac_status); }; }; then
14264   cf_cv_wint_t=no
14265 else
14266   echo "$as_me: failed program was:" >&5
14267 cat conftest.$ac_ext >&5
14268 cat >conftest.$ac_ext <<_ACEOF
14269 #line 14269 "configure"
14270 #include "confdefs.h"
14271
14272 #include <stdlib.h>
14273 #include <stdarg.h>
14274 #include <stdio.h>
14275 #include <wchar.h>
14276 #ifdef HAVE_LIBUTF8_H
14277 #include <libutf8.h>
14278 #endif
14279 int
14280 main ()
14281 {
14282 wint_t value
14283   ;
14284   return 0;
14285 }
14286 _ACEOF
14287 rm -f conftest.$ac_objext
14288 if { (eval echo "$as_me:14288: \"$ac_compile\"") >&5
14289   (eval $ac_compile) 2>&5
14290   ac_status=$?
14291   echo "$as_me:14291: \$? = $ac_status" >&5
14292   (exit $ac_status); } &&
14293          { ac_try='test -s conftest.$ac_objext'
14294   { (eval echo "$as_me:14294: \"$ac_try\"") >&5
14295   (eval $ac_try) 2>&5
14296   ac_status=$?
14297   echo "$as_me:14297: \$? = $ac_status" >&5
14298   (exit $ac_status); }; }; then
14299   cf_cv_wint_t=yes
14300 else
14301   echo "$as_me: failed program was:" >&5
14302 cat conftest.$ac_ext >&5
14303 cf_cv_wint_t=unknown
14304 fi
14305 rm -f conftest.$ac_objext conftest.$ac_ext
14306 fi
14307 rm -f conftest.$ac_objext conftest.$ac_ext
14308 fi
14309 echo "$as_me:14309: result: $cf_cv_wint_t" >&5
14310 echo "${ECHO_T}$cf_cv_wint_t" >&6
14311
14312 if test "$cf_cv_wint_t" = yes ; then
14313
14314 cat >>confdefs.h <<\EOF
14315 #define NEED_WCHAR_H 1
14316 EOF
14317
14318         NEED_WCHAR_H=1
14319 fi
14320
14321 # if we do not find wint_t in either place, use substitution to provide a fallback.
14322 if test "$cf_cv_wint_t" = unknown ; then
14323         NCURSES_WINT_T=1
14324 fi
14325
14326 # if we find wint_t in either place, use substitution to provide a fallback.
14327 if test "$cf_cv_wint_t" != unknown ; then
14328         NCURSES_OK_WINT_T=1
14329 fi
14330
14331         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
14332
14333 echo "$as_me:14333: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14334 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14335 cat >conftest.$ac_ext <<_ACEOF
14336 #line 14336 "configure"
14337 #include "confdefs.h"
14338
14339 #ifndef _XOPEN_SOURCE_EXTENDED
14340 #define _XOPEN_SOURCE_EXTENDED
14341 #endif
14342 #include <${cf_cv_ncurses_header:-curses.h}>
14343 int
14344 main ()
14345 {
14346
14347 mbstate_t foo
14348
14349   ;
14350   return 0;
14351 }
14352 _ACEOF
14353 rm -f conftest.$ac_objext
14354 if { (eval echo "$as_me:14354: \"$ac_compile\"") >&5
14355   (eval $ac_compile) 2>&5
14356   ac_status=$?
14357   echo "$as_me:14357: \$? = $ac_status" >&5
14358   (exit $ac_status); } &&
14359          { ac_try='test -s conftest.$ac_objext'
14360   { (eval echo "$as_me:14360: \"$ac_try\"") >&5
14361   (eval $ac_try) 2>&5
14362   ac_status=$?
14363   echo "$as_me:14363: \$? = $ac_status" >&5
14364   (exit $ac_status); }; }; then
14365   cf_result=yes
14366 else
14367   echo "$as_me: failed program was:" >&5
14368 cat conftest.$ac_ext >&5
14369 cf_result=no
14370 fi
14371 rm -f conftest.$ac_objext conftest.$ac_ext
14372 echo "$as_me:14372: result: $cf_result" >&5
14373 echo "${ECHO_T}$cf_result" >&6
14374 if test $cf_result = yes ; then
14375
14376 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14377
14378 cat >>confdefs.h <<EOF
14379 #define $cf_result 1
14380 EOF
14381
14382 else
14383
14384 cat >>confdefs.h <<EOF
14385 #define mbstate_t long
14386 EOF
14387
14388 fi
14389
14390         fi
14391
14392         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
14393
14394 echo "$as_me:14394: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14395 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14396 cat >conftest.$ac_ext <<_ACEOF
14397 #line 14397 "configure"
14398 #include "confdefs.h"
14399
14400 #ifndef _XOPEN_SOURCE_EXTENDED
14401 #define _XOPEN_SOURCE_EXTENDED
14402 #endif
14403 #include <${cf_cv_ncurses_header:-curses.h}>
14404 int
14405 main ()
14406 {
14407
14408 wchar_t foo
14409
14410   ;
14411   return 0;
14412 }
14413 _ACEOF
14414 rm -f conftest.$ac_objext
14415 if { (eval echo "$as_me:14415: \"$ac_compile\"") >&5
14416   (eval $ac_compile) 2>&5
14417   ac_status=$?
14418   echo "$as_me:14418: \$? = $ac_status" >&5
14419   (exit $ac_status); } &&
14420          { ac_try='test -s conftest.$ac_objext'
14421   { (eval echo "$as_me:14421: \"$ac_try\"") >&5
14422   (eval $ac_try) 2>&5
14423   ac_status=$?
14424   echo "$as_me:14424: \$? = $ac_status" >&5
14425   (exit $ac_status); }; }; then
14426   cf_result=yes
14427 else
14428   echo "$as_me: failed program was:" >&5
14429 cat conftest.$ac_ext >&5
14430 cf_result=no
14431 fi
14432 rm -f conftest.$ac_objext conftest.$ac_ext
14433 echo "$as_me:14433: result: $cf_result" >&5
14434 echo "${ECHO_T}$cf_result" >&6
14435 if test $cf_result = yes ; then
14436
14437 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14438
14439 cat >>confdefs.h <<EOF
14440 #define $cf_result 1
14441 EOF
14442
14443 else
14444
14445 cat >>confdefs.h <<EOF
14446 #define wchar_t long
14447 EOF
14448
14449 fi
14450
14451         fi
14452
14453         if test "$NCURSES_OK_WINT_T" = 0 ; then
14454
14455 echo "$as_me:14455: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14456 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14457 cat >conftest.$ac_ext <<_ACEOF
14458 #line 14458 "configure"
14459 #include "confdefs.h"
14460
14461 #ifndef _XOPEN_SOURCE_EXTENDED
14462 #define _XOPEN_SOURCE_EXTENDED
14463 #endif
14464 #include <${cf_cv_ncurses_header:-curses.h}>
14465 int
14466 main ()
14467 {
14468
14469 wint_t foo
14470
14471   ;
14472   return 0;
14473 }
14474 _ACEOF
14475 rm -f conftest.$ac_objext
14476 if { (eval echo "$as_me:14476: \"$ac_compile\"") >&5
14477   (eval $ac_compile) 2>&5
14478   ac_status=$?
14479   echo "$as_me:14479: \$? = $ac_status" >&5
14480   (exit $ac_status); } &&
14481          { ac_try='test -s conftest.$ac_objext'
14482   { (eval echo "$as_me:14482: \"$ac_try\"") >&5
14483   (eval $ac_try) 2>&5
14484   ac_status=$?
14485   echo "$as_me:14485: \$? = $ac_status" >&5
14486   (exit $ac_status); }; }; then
14487   cf_result=yes
14488 else
14489   echo "$as_me: failed program was:" >&5
14490 cat conftest.$ac_ext >&5
14491 cf_result=no
14492 fi
14493 rm -f conftest.$ac_objext conftest.$ac_ext
14494 echo "$as_me:14494: result: $cf_result" >&5
14495 echo "${ECHO_T}$cf_result" >&6
14496 if test $cf_result = yes ; then
14497
14498 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14499
14500 cat >>confdefs.h <<EOF
14501 #define $cf_result 1
14502 EOF
14503
14504 else
14505
14506 cat >>confdefs.h <<EOF
14507 #define wint_t long
14508 EOF
14509
14510 fi
14511
14512         fi
14513 fi
14514
14515 echo "$as_me:14515: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
14516 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14517
14518 cat >conftest.$ac_ext <<_ACEOF
14519 #line 14519 "configure"
14520 #include "confdefs.h"
14521
14522 #ifdef HAVE_XCURSES
14523 #include <xcurses.h>
14524 char * XCursesProgramName = "test";
14525 #else
14526 #include <${cf_cv_ncurses_header:-curses.h}>
14527 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14528 #include <ncursesw/term.h>
14529 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14530 #include <ncurses/term.h>
14531 #elif defined(HAVE_TERM_H)
14532 #include <term.h>
14533 #endif
14534 #endif
14535
14536 int
14537 main ()
14538 {
14539
14540 void *foo = &(boolnames)
14541
14542   ;
14543   return 0;
14544 }
14545 _ACEOF
14546 rm -f conftest.$ac_objext
14547 if { (eval echo "$as_me:14547: \"$ac_compile\"") >&5
14548   (eval $ac_compile) 2>&5
14549   ac_status=$?
14550   echo "$as_me:14550: \$? = $ac_status" >&5
14551   (exit $ac_status); } &&
14552          { ac_try='test -s conftest.$ac_objext'
14553   { (eval echo "$as_me:14553: \"$ac_try\"") >&5
14554   (eval $ac_try) 2>&5
14555   ac_status=$?
14556   echo "$as_me:14556: \$? = $ac_status" >&5
14557   (exit $ac_status); }; }; then
14558   cf_result=yes
14559 else
14560   echo "$as_me: failed program was:" >&5
14561 cat conftest.$ac_ext >&5
14562 cf_result=no
14563 fi
14564 rm -f conftest.$ac_objext conftest.$ac_ext
14565 echo "$as_me:14565: result: $cf_result" >&5
14566 echo "${ECHO_T}$cf_result" >&6
14567
14568 if test $cf_result = yes ; then
14569
14570 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14571
14572         cat >>confdefs.h <<EOF
14573 #define $cf_result 1
14574 EOF
14575
14576 else
14577         echo "$as_me:14577: checking for data boolnames in library" >&5
14578 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
14579         # BSD linkers insist on making weak linkage, but resolve at runtime.
14580         if test "$cross_compiling" = yes; then
14581
14582         # cross-compiling
14583         cat >conftest.$ac_ext <<_ACEOF
14584 #line 14584 "configure"
14585 #include "confdefs.h"
14586
14587 #ifdef HAVE_XCURSES
14588 #include <xcurses.h>
14589 char * XCursesProgramName = "test";
14590 #else
14591 #include <${cf_cv_ncurses_header:-curses.h}>
14592 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14593 #include <ncursesw/term.h>
14594 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14595 #include <ncurses/term.h>
14596 #elif defined(HAVE_TERM_H)
14597 #include <term.h>
14598 #endif
14599 #endif
14600
14601 extern char boolnames;
14602 int
14603 main ()
14604 {
14605
14606         do {
14607                 void *foo = &(boolnames);
14608                 ${cf_cv_main_return:-return}(foo == 0);
14609         } while (0)
14610
14611   ;
14612   return 0;
14613 }
14614 _ACEOF
14615 rm -f conftest.$ac_objext conftest$ac_exeext
14616 if { (eval echo "$as_me:14616: \"$ac_link\"") >&5
14617   (eval $ac_link) 2>&5
14618   ac_status=$?
14619   echo "$as_me:14619: \$? = $ac_status" >&5
14620   (exit $ac_status); } &&
14621          { ac_try='test -s conftest$ac_exeext'
14622   { (eval echo "$as_me:14622: \"$ac_try\"") >&5
14623   (eval $ac_try) 2>&5
14624   ac_status=$?
14625   echo "$as_me:14625: \$? = $ac_status" >&5
14626   (exit $ac_status); }; }; then
14627   cf_result=yes
14628 else
14629   echo "$as_me: failed program was:" >&5
14630 cat conftest.$ac_ext >&5
14631 cf_result=no
14632 fi
14633 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14634
14635 else
14636   cat >conftest.$ac_ext <<_ACEOF
14637 #line 14637 "configure"
14638 #include "confdefs.h"
14639
14640 #ifdef HAVE_XCURSES
14641 #include <xcurses.h>
14642 char * XCursesProgramName = "test";
14643 #else
14644 #include <${cf_cv_ncurses_header:-curses.h}>
14645 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14646 #include <ncursesw/term.h>
14647 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14648 #include <ncurses/term.h>
14649 #elif defined(HAVE_TERM_H)
14650 #include <term.h>
14651 #endif
14652 #endif
14653
14654 extern char boolnames;
14655 int main(void)
14656 {
14657         void *foo = &(boolnames);
14658         ${cf_cv_main_return:-return}(foo == 0);
14659 }
14660 _ACEOF
14661 rm -f conftest$ac_exeext
14662 if { (eval echo "$as_me:14662: \"$ac_link\"") >&5
14663   (eval $ac_link) 2>&5
14664   ac_status=$?
14665   echo "$as_me:14665: \$? = $ac_status" >&5
14666   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14667   { (eval echo "$as_me:14667: \"$ac_try\"") >&5
14668   (eval $ac_try) 2>&5
14669   ac_status=$?
14670   echo "$as_me:14670: \$? = $ac_status" >&5
14671   (exit $ac_status); }; }; then
14672   cf_result=yes
14673 else
14674   echo "$as_me: program exited with status $ac_status" >&5
14675 echo "$as_me: failed program was:" >&5
14676 cat conftest.$ac_ext >&5
14677 cf_result=no
14678 fi
14679 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14680 fi
14681         echo "$as_me:14681: result: $cf_result" >&5
14682 echo "${ECHO_T}$cf_result" >&6
14683         if test $cf_result = yes ; then
14684
14685 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14686
14687                 cat >>confdefs.h <<EOF
14688 #define $cf_result 1
14689 EOF
14690
14691         fi
14692 fi
14693
14694 echo "$as_me:14694: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
14695 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14696
14697 cat >conftest.$ac_ext <<_ACEOF
14698 #line 14698 "configure"
14699 #include "confdefs.h"
14700
14701 #ifdef HAVE_XCURSES
14702 #include <xcurses.h>
14703 char * XCursesProgramName = "test";
14704 #else
14705 #include <${cf_cv_ncurses_header:-curses.h}>
14706 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14707 #include <ncursesw/term.h>
14708 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14709 #include <ncurses/term.h>
14710 #elif defined(HAVE_TERM_H)
14711 #include <term.h>
14712 #endif
14713 #endif
14714
14715 int
14716 main ()
14717 {
14718
14719 void *foo = &(boolfnames)
14720
14721   ;
14722   return 0;
14723 }
14724 _ACEOF
14725 rm -f conftest.$ac_objext
14726 if { (eval echo "$as_me:14726: \"$ac_compile\"") >&5
14727   (eval $ac_compile) 2>&5
14728   ac_status=$?
14729   echo "$as_me:14729: \$? = $ac_status" >&5
14730   (exit $ac_status); } &&
14731          { ac_try='test -s conftest.$ac_objext'
14732   { (eval echo "$as_me:14732: \"$ac_try\"") >&5
14733   (eval $ac_try) 2>&5
14734   ac_status=$?
14735   echo "$as_me:14735: \$? = $ac_status" >&5
14736   (exit $ac_status); }; }; then
14737   cf_result=yes
14738 else
14739   echo "$as_me: failed program was:" >&5
14740 cat conftest.$ac_ext >&5
14741 cf_result=no
14742 fi
14743 rm -f conftest.$ac_objext conftest.$ac_ext
14744 echo "$as_me:14744: result: $cf_result" >&5
14745 echo "${ECHO_T}$cf_result" >&6
14746
14747 if test $cf_result = yes ; then
14748
14749 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14750
14751         cat >>confdefs.h <<EOF
14752 #define $cf_result 1
14753 EOF
14754
14755 else
14756         echo "$as_me:14756: checking for data boolfnames in library" >&5
14757 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
14758         # BSD linkers insist on making weak linkage, but resolve at runtime.
14759         if test "$cross_compiling" = yes; then
14760
14761         # cross-compiling
14762         cat >conftest.$ac_ext <<_ACEOF
14763 #line 14763 "configure"
14764 #include "confdefs.h"
14765
14766 #ifdef HAVE_XCURSES
14767 #include <xcurses.h>
14768 char * XCursesProgramName = "test";
14769 #else
14770 #include <${cf_cv_ncurses_header:-curses.h}>
14771 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14772 #include <ncursesw/term.h>
14773 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14774 #include <ncurses/term.h>
14775 #elif defined(HAVE_TERM_H)
14776 #include <term.h>
14777 #endif
14778 #endif
14779
14780 extern char boolfnames;
14781 int
14782 main ()
14783 {
14784
14785         do {
14786                 void *foo = &(boolfnames);
14787                 ${cf_cv_main_return:-return}(foo == 0);
14788         } while (0)
14789
14790   ;
14791   return 0;
14792 }
14793 _ACEOF
14794 rm -f conftest.$ac_objext conftest$ac_exeext
14795 if { (eval echo "$as_me:14795: \"$ac_link\"") >&5
14796   (eval $ac_link) 2>&5
14797   ac_status=$?
14798   echo "$as_me:14798: \$? = $ac_status" >&5
14799   (exit $ac_status); } &&
14800          { ac_try='test -s conftest$ac_exeext'
14801   { (eval echo "$as_me:14801: \"$ac_try\"") >&5
14802   (eval $ac_try) 2>&5
14803   ac_status=$?
14804   echo "$as_me:14804: \$? = $ac_status" >&5
14805   (exit $ac_status); }; }; then
14806   cf_result=yes
14807 else
14808   echo "$as_me: failed program was:" >&5
14809 cat conftest.$ac_ext >&5
14810 cf_result=no
14811 fi
14812 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14813
14814 else
14815   cat >conftest.$ac_ext <<_ACEOF
14816 #line 14816 "configure"
14817 #include "confdefs.h"
14818
14819 #ifdef HAVE_XCURSES
14820 #include <xcurses.h>
14821 char * XCursesProgramName = "test";
14822 #else
14823 #include <${cf_cv_ncurses_header:-curses.h}>
14824 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14825 #include <ncursesw/term.h>
14826 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14827 #include <ncurses/term.h>
14828 #elif defined(HAVE_TERM_H)
14829 #include <term.h>
14830 #endif
14831 #endif
14832
14833 extern char boolfnames;
14834 int main(void)
14835 {
14836         void *foo = &(boolfnames);
14837         ${cf_cv_main_return:-return}(foo == 0);
14838 }
14839 _ACEOF
14840 rm -f conftest$ac_exeext
14841 if { (eval echo "$as_me:14841: \"$ac_link\"") >&5
14842   (eval $ac_link) 2>&5
14843   ac_status=$?
14844   echo "$as_me:14844: \$? = $ac_status" >&5
14845   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14846   { (eval echo "$as_me:14846: \"$ac_try\"") >&5
14847   (eval $ac_try) 2>&5
14848   ac_status=$?
14849   echo "$as_me:14849: \$? = $ac_status" >&5
14850   (exit $ac_status); }; }; then
14851   cf_result=yes
14852 else
14853   echo "$as_me: program exited with status $ac_status" >&5
14854 echo "$as_me: failed program was:" >&5
14855 cat conftest.$ac_ext >&5
14856 cf_result=no
14857 fi
14858 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14859 fi
14860         echo "$as_me:14860: result: $cf_result" >&5
14861 echo "${ECHO_T}$cf_result" >&6
14862         if test $cf_result = yes ; then
14863
14864 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14865
14866                 cat >>confdefs.h <<EOF
14867 #define $cf_result 1
14868 EOF
14869
14870         fi
14871 fi
14872
14873 if ( test "$GCC" = yes || test "$GXX" = yes )
14874 then
14875 echo "$as_me:14875: checking if you want to turn on gcc warnings" >&5
14876 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
14877
14878 # Check whether --enable-warnings or --disable-warnings was given.
14879 if test "${enable_warnings+set}" = set; then
14880   enableval="$enable_warnings"
14881   test "$enableval" != yes && enableval=no
14882   if test "$enableval" != "no" ; then
14883     with_warnings=yes
14884   else
14885     with_warnings=no
14886   fi
14887 else
14888   enableval=no
14889   with_warnings=no
14890
14891 fi;
14892 echo "$as_me:14892: result: $with_warnings" >&5
14893 echo "${ECHO_T}$with_warnings" >&6
14894 if test "$with_warnings" = "yes"
14895 then
14896
14897 if test "$GCC" = yes
14898 then
14899 cat > conftest.i <<EOF
14900 #ifndef GCC_PRINTF
14901 #define GCC_PRINTF 0
14902 #endif
14903 #ifndef GCC_SCANF
14904 #define GCC_SCANF 0
14905 #endif
14906 #ifndef GCC_NORETURN
14907 #define GCC_NORETURN /* nothing */
14908 #endif
14909 #ifndef GCC_UNUSED
14910 #define GCC_UNUSED /* nothing */
14911 #endif
14912 EOF
14913 if test "$GCC" = yes
14914 then
14915         { echo "$as_me:14915: checking for $CC __attribute__ directives..." >&5
14916 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
14917 cat > conftest.$ac_ext <<EOF
14918 #line 14918 "${as_me:-configure}"
14919 #include "confdefs.h"
14920 #include "conftest.h"
14921 #include "conftest.i"
14922 #if     GCC_PRINTF
14923 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
14924 #else
14925 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
14926 #endif
14927 #if     GCC_SCANF
14928 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
14929 #else
14930 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
14931 #endif
14932 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
14933 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
14934 extern void foo(void) GCC_NORETURN;
14935 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
14936 EOF
14937         cf_printf_attribute=no
14938         cf_scanf_attribute=no
14939         for cf_attribute in scanf printf unused noreturn
14940         do
14941
14942 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14943
14944                 cf_directive="__attribute__(($cf_attribute))"
14945                 echo "checking for $CC $cf_directive" 1>&5
14946
14947                 case $cf_attribute in #(vi
14948                 printf) #(vi
14949                         cf_printf_attribute=yes
14950                         cat >conftest.h <<EOF
14951 #define GCC_$cf_ATTRIBUTE 1
14952 EOF
14953                         ;;
14954                 scanf) #(vi
14955                         cf_scanf_attribute=yes
14956                         cat >conftest.h <<EOF
14957 #define GCC_$cf_ATTRIBUTE 1
14958 EOF
14959                         ;;
14960                 *) #(vi
14961                         cat >conftest.h <<EOF
14962 #define GCC_$cf_ATTRIBUTE $cf_directive
14963 EOF
14964                         ;;
14965                 esac
14966
14967                 if { (eval echo "$as_me:14967: \"$ac_compile\"") >&5
14968   (eval $ac_compile) 2>&5
14969   ac_status=$?
14970   echo "$as_me:14970: \$? = $ac_status" >&5
14971   (exit $ac_status); }; then
14972                         test -n "$verbose" && echo "$as_me:14972: result: ... $cf_attribute" >&5
14973 echo "${ECHO_T}... $cf_attribute" >&6
14974                         cat conftest.h >>confdefs.h
14975                         case $cf_attribute in #(vi
14976                         noreturn) #(vi
14977
14978 cat >>confdefs.h <<EOF
14979 #define GCC_NORETURN $cf_directive
14980 EOF
14981
14982                                 ;;
14983                         printf) #(vi
14984                                 cf_value='/* nothing */'
14985                                 if test "$cf_printf_attribute" != no ; then
14986                                         cf_value='__attribute__((format(printf,fmt,var)))'
14987
14988 cat >>confdefs.h <<\EOF
14989 #define GCC_PRINTF 1
14990 EOF
14991
14992                                 fi
14993
14994 cat >>confdefs.h <<EOF
14995 #define GCC_PRINTFLIKE(fmt,var) $cf_value
14996 EOF
14997
14998                                 ;;
14999                         scanf) #(vi
15000                                 cf_value='/* nothing */'
15001                                 if test "$cf_scanf_attribute" != no ; then
15002                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15003
15004 cat >>confdefs.h <<\EOF
15005 #define GCC_SCANF 1
15006 EOF
15007
15008                                 fi
15009
15010 cat >>confdefs.h <<EOF
15011 #define GCC_SCANFLIKE(fmt,var) $cf_value
15012 EOF
15013
15014                                 ;;
15015                         unused) #(vi
15016
15017 cat >>confdefs.h <<EOF
15018 #define GCC_UNUSED $cf_directive
15019 EOF
15020
15021                                 ;;
15022                         esac
15023                 fi
15024         done
15025 else
15026         fgrep define conftest.i >>confdefs.h
15027 fi
15028 rm -rf conftest*
15029 fi
15030
15031 INTEL_COMPILER=no
15032
15033 if test "$GCC" = yes ; then
15034         case $host_os in
15035         linux*|gnu*)
15036                 echo "$as_me:15036: checking if this is really Intel C compiler" >&5
15037 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
15038                 cf_save_CFLAGS="$CFLAGS"
15039                 CFLAGS="$CFLAGS -no-gcc"
15040                 cat >conftest.$ac_ext <<_ACEOF
15041 #line 15041 "configure"
15042 #include "confdefs.h"
15043
15044 int
15045 main ()
15046 {
15047
15048 #ifdef __INTEL_COMPILER
15049 #else
15050 make an error
15051 #endif
15052
15053   ;
15054   return 0;
15055 }
15056 _ACEOF
15057 rm -f conftest.$ac_objext
15058 if { (eval echo "$as_me:15058: \"$ac_compile\"") >&5
15059   (eval $ac_compile) 2>&5
15060   ac_status=$?
15061   echo "$as_me:15061: \$? = $ac_status" >&5
15062   (exit $ac_status); } &&
15063          { ac_try='test -s conftest.$ac_objext'
15064   { (eval echo "$as_me:15064: \"$ac_try\"") >&5
15065   (eval $ac_try) 2>&5
15066   ac_status=$?
15067   echo "$as_me:15067: \$? = $ac_status" >&5
15068   (exit $ac_status); }; }; then
15069   INTEL_COMPILER=yes
15070 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
15071
15072 else
15073   echo "$as_me: failed program was:" >&5
15074 cat conftest.$ac_ext >&5
15075 fi
15076 rm -f conftest.$ac_objext conftest.$ac_ext
15077                 CFLAGS="$cf_save_CFLAGS"
15078                 echo "$as_me:15078: result: $INTEL_COMPILER" >&5
15079 echo "${ECHO_T}$INTEL_COMPILER" >&6
15080                 ;;
15081         esac
15082 fi
15083
15084 CLANG_COMPILER=no
15085
15086 if test "$GCC" = yes ; then
15087         echo "$as_me:15087: checking if this is really Clang C compiler" >&5
15088 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
15089         cf_save_CFLAGS="$CFLAGS"
15090         CFLAGS="$CFLAGS -Qunused-arguments"
15091         cat >conftest.$ac_ext <<_ACEOF
15092 #line 15092 "configure"
15093 #include "confdefs.h"
15094
15095 int
15096 main ()
15097 {
15098
15099 #ifdef __clang__
15100 #else
15101 make an error
15102 #endif
15103
15104   ;
15105   return 0;
15106 }
15107 _ACEOF
15108 rm -f conftest.$ac_objext
15109 if { (eval echo "$as_me:15109: \"$ac_compile\"") >&5
15110   (eval $ac_compile) 2>&5
15111   ac_status=$?
15112   echo "$as_me:15112: \$? = $ac_status" >&5
15113   (exit $ac_status); } &&
15114          { ac_try='test -s conftest.$ac_objext'
15115   { (eval echo "$as_me:15115: \"$ac_try\"") >&5
15116   (eval $ac_try) 2>&5
15117   ac_status=$?
15118   echo "$as_me:15118: \$? = $ac_status" >&5
15119   (exit $ac_status); }; }; then
15120   CLANG_COMPILER=yes
15121 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
15122
15123 else
15124   echo "$as_me: failed program was:" >&5
15125 cat conftest.$ac_ext >&5
15126 fi
15127 rm -f conftest.$ac_objext conftest.$ac_ext
15128         CFLAGS="$cf_save_CFLAGS"
15129         echo "$as_me:15129: result: $CLANG_COMPILER" >&5
15130 echo "${ECHO_T}$CLANG_COMPILER" >&6
15131 fi
15132
15133 cat > conftest.$ac_ext <<EOF
15134 #line 15134 "${as_me:-configure}"
15135 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15136 EOF
15137
15138 if test "$INTEL_COMPILER" = yes
15139 then
15140 # The "-wdXXX" options suppress warnings:
15141 # remark #1419: external declaration in primary source file
15142 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15143 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15144 # remark #193: zero used for undefined preprocessing identifier
15145 # remark #593: variable "curs_sb_left_arrow" was set but never used
15146 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15147 # remark #869: parameter "tw" was never referenced
15148 # remark #981: operands are evaluated in unspecified order
15149 # warning #279: controlling expression is constant
15150
15151         { echo "$as_me:15151: checking for $CC warning options..." >&5
15152 echo "$as_me: checking for $CC warning options..." >&6;}
15153         cf_save_CFLAGS="$CFLAGS"
15154         EXTRA_CFLAGS="-Wall"
15155         for cf_opt in \
15156                 wd1419 \
15157                 wd1683 \
15158                 wd1684 \
15159                 wd193 \
15160                 wd593 \
15161                 wd279 \
15162                 wd810 \
15163                 wd869 \
15164                 wd981
15165         do
15166                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15167                 if { (eval echo "$as_me:15167: \"$ac_compile\"") >&5
15168   (eval $ac_compile) 2>&5
15169   ac_status=$?
15170   echo "$as_me:15170: \$? = $ac_status" >&5
15171   (exit $ac_status); }; then
15172                         test -n "$verbose" && echo "$as_me:15172: result: ... -$cf_opt" >&5
15173 echo "${ECHO_T}... -$cf_opt" >&6
15174                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15175                 fi
15176         done
15177         CFLAGS="$cf_save_CFLAGS"
15178
15179 elif test "$GCC" = yes
15180 then
15181         { echo "$as_me:15181: checking for $CC warning options..." >&5
15182 echo "$as_me: checking for $CC warning options..." >&6;}
15183         cf_save_CFLAGS="$CFLAGS"
15184         EXTRA_CFLAGS=
15185         cf_warn_CONST=""
15186         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15187         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15188         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15189         for cf_opt in W Wall \
15190                 Wbad-function-cast \
15191                 Wcast-align \
15192                 Wcast-qual \
15193                 Wdeclaration-after-statement \
15194                 Wextra \
15195                 Winline \
15196                 Wmissing-declarations \
15197                 Wmissing-prototypes \
15198                 Wnested-externs \
15199                 Wpointer-arith \
15200                 Wshadow \
15201                 Wstrict-prototypes \
15202                 Wundef $cf_gcc_warnings $cf_warn_CONST
15203         do
15204                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15205                 if { (eval echo "$as_me:15205: \"$ac_compile\"") >&5
15206   (eval $ac_compile) 2>&5
15207   ac_status=$?
15208   echo "$as_me:15208: \$? = $ac_status" >&5
15209   (exit $ac_status); }; then
15210                         test -n "$verbose" && echo "$as_me:15210: result: ... -$cf_opt" >&5
15211 echo "${ECHO_T}... -$cf_opt" >&6
15212                         case $cf_opt in #(vi
15213                         Wcast-qual) #(vi
15214                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
15215                                 ;;
15216                         Winline) #(vi
15217                                 case $GCC_VERSION in
15218                                 [34].*)
15219                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15220
15221 echo "${as_me:-configure}:15221: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15222
15223                                         continue;;
15224                                 esac
15225                                 ;;
15226                         Wpointer-arith) #(vi
15227                                 case $GCC_VERSION in
15228                                 [12].*)
15229                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15230
15231 echo "${as_me:-configure}:15231: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15232
15233                                         continue;;
15234                                 esac
15235                                 ;;
15236                         esac
15237                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15238                 fi
15239         done
15240         CFLAGS="$cf_save_CFLAGS"
15241 fi
15242 rm -rf conftest*
15243
15244 fi
15245 fi
15246
15247 echo "$as_me:15247: checking if you want to use dmalloc for testing" >&5
15248 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
15249
15250 # Check whether --with-dmalloc or --without-dmalloc was given.
15251 if test "${with_dmalloc+set}" = set; then
15252   withval="$with_dmalloc"
15253
15254 cat >>confdefs.h <<EOF
15255 #define USE_DMALLOC 1
15256 EOF
15257
15258         : ${with_cflags:=-g}
15259         : ${with_no_leaks:=yes}
15260          with_dmalloc=yes
15261 else
15262   with_dmalloc=
15263 fi;
15264 echo "$as_me:15264: result: ${with_dmalloc:-no}" >&5
15265 echo "${ECHO_T}${with_dmalloc:-no}" >&6
15266
15267 case .$with_cflags in #(vi
15268 .*-g*)
15269         case .$CFLAGS in #(vi
15270         .*-g*) #(vi
15271                 ;;
15272         *)
15273
15274 cf_fix_cppflags=no
15275 cf_new_cflags=
15276 cf_new_cppflags=
15277 cf_new_extra_cppflags=
15278
15279 for cf_add_cflags in -g
15280 do
15281 case $cf_fix_cppflags in
15282 no)
15283         case $cf_add_cflags in #(vi
15284         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
15285                 case $cf_add_cflags in
15286                 -D*)
15287                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15288
15289                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15290                                 && test -z "${cf_tst_cflags}" \
15291                                 && cf_fix_cppflags=yes
15292
15293                         if test $cf_fix_cppflags = yes ; then
15294                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15295                                 continue
15296                         elif test "${cf_tst_cflags}" = "\"'" ; then
15297                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15298                                 continue
15299                         fi
15300                         ;;
15301                 esac
15302                 case "$CPPFLAGS" in
15303                 *$cf_add_cflags) #(vi
15304                         ;;
15305                 *) #(vi
15306                         case $cf_add_cflags in #(vi
15307                         -D*)
15308                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15309
15310 CPPFLAGS=`echo "$CPPFLAGS" | \
15311         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15312                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15313
15314                                 ;;
15315                         esac
15316                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
15317                         ;;
15318                 esac
15319                 ;;
15320         *)
15321                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
15322                 ;;
15323         esac
15324         ;;
15325 yes)
15326         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15327
15328         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15329
15330         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15331                 && test -z "${cf_tst_cflags}" \
15332                 && cf_fix_cppflags=no
15333         ;;
15334 esac
15335 done
15336
15337 if test -n "$cf_new_cflags" ; then
15338
15339         CFLAGS="$CFLAGS $cf_new_cflags"
15340 fi
15341
15342 if test -n "$cf_new_cppflags" ; then
15343
15344         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
15345 fi
15346
15347 if test -n "$cf_new_extra_cppflags" ; then
15348
15349         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
15350 fi
15351
15352                 ;;
15353         esac
15354         ;;
15355 esac
15356
15357 if test "$with_dmalloc" = yes ; then
15358         echo "$as_me:15358: checking for dmalloc.h" >&5
15359 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
15360 if test "${ac_cv_header_dmalloc_h+set}" = set; then
15361   echo $ECHO_N "(cached) $ECHO_C" >&6
15362 else
15363   cat >conftest.$ac_ext <<_ACEOF
15364 #line 15364 "configure"
15365 #include "confdefs.h"
15366 #include <dmalloc.h>
15367 _ACEOF
15368 if { (eval echo "$as_me:15368: \"$ac_cpp conftest.$ac_ext\"") >&5
15369   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15370   ac_status=$?
15371   egrep -v '^ *\+' conftest.er1 >conftest.err
15372   rm -f conftest.er1
15373   cat conftest.err >&5
15374   echo "$as_me:15374: \$? = $ac_status" >&5
15375   (exit $ac_status); } >/dev/null; then
15376   if test -s conftest.err; then
15377     ac_cpp_err=$ac_c_preproc_warn_flag
15378   else
15379     ac_cpp_err=
15380   fi
15381 else
15382   ac_cpp_err=yes
15383 fi
15384 if test -z "$ac_cpp_err"; then
15385   ac_cv_header_dmalloc_h=yes
15386 else
15387   echo "$as_me: failed program was:" >&5
15388   cat conftest.$ac_ext >&5
15389   ac_cv_header_dmalloc_h=no
15390 fi
15391 rm -f conftest.err conftest.$ac_ext
15392 fi
15393 echo "$as_me:15393: result: $ac_cv_header_dmalloc_h" >&5
15394 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
15395 if test $ac_cv_header_dmalloc_h = yes; then
15396
15397 echo "$as_me:15397: checking for dmalloc_debug in -ldmalloc" >&5
15398 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
15399 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
15400   echo $ECHO_N "(cached) $ECHO_C" >&6
15401 else
15402   ac_check_lib_save_LIBS=$LIBS
15403 LIBS="-ldmalloc  $LIBS"
15404 cat >conftest.$ac_ext <<_ACEOF
15405 #line 15405 "configure"
15406 #include "confdefs.h"
15407
15408 /* Override any gcc2 internal prototype to avoid an error.  */
15409 #ifdef __cplusplus
15410 extern "C"
15411 #endif
15412 /* We use char because int might match the return type of a gcc2
15413    builtin and then its argument prototype would still apply.  */
15414 char dmalloc_debug ();
15415 int
15416 main ()
15417 {
15418 dmalloc_debug ();
15419   ;
15420   return 0;
15421 }
15422 _ACEOF
15423 rm -f conftest.$ac_objext conftest$ac_exeext
15424 if { (eval echo "$as_me:15424: \"$ac_link\"") >&5
15425   (eval $ac_link) 2>&5
15426   ac_status=$?
15427   echo "$as_me:15427: \$? = $ac_status" >&5
15428   (exit $ac_status); } &&
15429          { ac_try='test -s conftest$ac_exeext'
15430   { (eval echo "$as_me:15430: \"$ac_try\"") >&5
15431   (eval $ac_try) 2>&5
15432   ac_status=$?
15433   echo "$as_me:15433: \$? = $ac_status" >&5
15434   (exit $ac_status); }; }; then
15435   ac_cv_lib_dmalloc_dmalloc_debug=yes
15436 else
15437   echo "$as_me: failed program was:" >&5
15438 cat conftest.$ac_ext >&5
15439 ac_cv_lib_dmalloc_dmalloc_debug=no
15440 fi
15441 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15442 LIBS=$ac_check_lib_save_LIBS
15443 fi
15444 echo "$as_me:15444: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
15445 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
15446 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
15447   cat >>confdefs.h <<EOF
15448 #define HAVE_LIBDMALLOC 1
15449 EOF
15450
15451   LIBS="-ldmalloc $LIBS"
15452
15453 fi
15454
15455 fi
15456
15457 fi
15458
15459 echo "$as_me:15459: checking if you want to use dbmalloc for testing" >&5
15460 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
15461
15462 # Check whether --with-dbmalloc or --without-dbmalloc was given.
15463 if test "${with_dbmalloc+set}" = set; then
15464   withval="$with_dbmalloc"
15465
15466 cat >>confdefs.h <<EOF
15467 #define USE_DBMALLOC 1
15468 EOF
15469
15470         : ${with_cflags:=-g}
15471         : ${with_no_leaks:=yes}
15472          with_dbmalloc=yes
15473 else
15474   with_dbmalloc=
15475 fi;
15476 echo "$as_me:15476: result: ${with_dbmalloc:-no}" >&5
15477 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
15478
15479 case .$with_cflags in #(vi
15480 .*-g*)
15481         case .$CFLAGS in #(vi
15482         .*-g*) #(vi
15483                 ;;
15484         *)
15485
15486 cf_fix_cppflags=no
15487 cf_new_cflags=
15488 cf_new_cppflags=
15489 cf_new_extra_cppflags=
15490
15491 for cf_add_cflags in -g
15492 do
15493 case $cf_fix_cppflags in
15494 no)
15495         case $cf_add_cflags in #(vi
15496         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
15497                 case $cf_add_cflags in
15498                 -D*)
15499                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15500
15501                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15502                                 && test -z "${cf_tst_cflags}" \
15503                                 && cf_fix_cppflags=yes
15504
15505                         if test $cf_fix_cppflags = yes ; then
15506                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15507                                 continue
15508                         elif test "${cf_tst_cflags}" = "\"'" ; then
15509                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15510                                 continue
15511                         fi
15512                         ;;
15513                 esac
15514                 case "$CPPFLAGS" in
15515                 *$cf_add_cflags) #(vi
15516                         ;;
15517                 *) #(vi
15518                         case $cf_add_cflags in #(vi
15519                         -D*)
15520                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15521
15522 CPPFLAGS=`echo "$CPPFLAGS" | \
15523         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15524                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15525
15526                                 ;;
15527                         esac
15528                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
15529                         ;;
15530                 esac
15531                 ;;
15532         *)
15533                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
15534                 ;;
15535         esac
15536         ;;
15537 yes)
15538         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15539
15540         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15541
15542         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15543                 && test -z "${cf_tst_cflags}" \
15544                 && cf_fix_cppflags=no
15545         ;;
15546 esac
15547 done
15548
15549 if test -n "$cf_new_cflags" ; then
15550
15551         CFLAGS="$CFLAGS $cf_new_cflags"
15552 fi
15553
15554 if test -n "$cf_new_cppflags" ; then
15555
15556         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
15557 fi
15558
15559 if test -n "$cf_new_extra_cppflags" ; then
15560
15561         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
15562 fi
15563
15564                 ;;
15565         esac
15566         ;;
15567 esac
15568
15569 if test "$with_dbmalloc" = yes ; then
15570         echo "$as_me:15570: checking for dbmalloc.h" >&5
15571 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
15572 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
15573   echo $ECHO_N "(cached) $ECHO_C" >&6
15574 else
15575   cat >conftest.$ac_ext <<_ACEOF
15576 #line 15576 "configure"
15577 #include "confdefs.h"
15578 #include <dbmalloc.h>
15579 _ACEOF
15580 if { (eval echo "$as_me:15580: \"$ac_cpp conftest.$ac_ext\"") >&5
15581   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15582   ac_status=$?
15583   egrep -v '^ *\+' conftest.er1 >conftest.err
15584   rm -f conftest.er1
15585   cat conftest.err >&5
15586   echo "$as_me:15586: \$? = $ac_status" >&5
15587   (exit $ac_status); } >/dev/null; then
15588   if test -s conftest.err; then
15589     ac_cpp_err=$ac_c_preproc_warn_flag
15590   else
15591     ac_cpp_err=
15592   fi
15593 else
15594   ac_cpp_err=yes
15595 fi
15596 if test -z "$ac_cpp_err"; then
15597   ac_cv_header_dbmalloc_h=yes
15598 else
15599   echo "$as_me: failed program was:" >&5
15600   cat conftest.$ac_ext >&5
15601   ac_cv_header_dbmalloc_h=no
15602 fi
15603 rm -f conftest.err conftest.$ac_ext
15604 fi
15605 echo "$as_me:15605: result: $ac_cv_header_dbmalloc_h" >&5
15606 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
15607 if test $ac_cv_header_dbmalloc_h = yes; then
15608
15609 echo "$as_me:15609: checking for debug_malloc in -ldbmalloc" >&5
15610 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
15611 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
15612   echo $ECHO_N "(cached) $ECHO_C" >&6
15613 else
15614   ac_check_lib_save_LIBS=$LIBS
15615 LIBS="-ldbmalloc  $LIBS"
15616 cat >conftest.$ac_ext <<_ACEOF
15617 #line 15617 "configure"
15618 #include "confdefs.h"
15619
15620 /* Override any gcc2 internal prototype to avoid an error.  */
15621 #ifdef __cplusplus
15622 extern "C"
15623 #endif
15624 /* We use char because int might match the return type of a gcc2
15625    builtin and then its argument prototype would still apply.  */
15626 char debug_malloc ();
15627 int
15628 main ()
15629 {
15630 debug_malloc ();
15631   ;
15632   return 0;
15633 }
15634 _ACEOF
15635 rm -f conftest.$ac_objext conftest$ac_exeext
15636 if { (eval echo "$as_me:15636: \"$ac_link\"") >&5
15637   (eval $ac_link) 2>&5
15638   ac_status=$?
15639   echo "$as_me:15639: \$? = $ac_status" >&5
15640   (exit $ac_status); } &&
15641          { ac_try='test -s conftest$ac_exeext'
15642   { (eval echo "$as_me:15642: \"$ac_try\"") >&5
15643   (eval $ac_try) 2>&5
15644   ac_status=$?
15645   echo "$as_me:15645: \$? = $ac_status" >&5
15646   (exit $ac_status); }; }; then
15647   ac_cv_lib_dbmalloc_debug_malloc=yes
15648 else
15649   echo "$as_me: failed program was:" >&5
15650 cat conftest.$ac_ext >&5
15651 ac_cv_lib_dbmalloc_debug_malloc=no
15652 fi
15653 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15654 LIBS=$ac_check_lib_save_LIBS
15655 fi
15656 echo "$as_me:15656: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
15657 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
15658 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
15659   cat >>confdefs.h <<EOF
15660 #define HAVE_LIBDBMALLOC 1
15661 EOF
15662
15663   LIBS="-ldbmalloc $LIBS"
15664
15665 fi
15666
15667 fi
15668
15669 fi
15670
15671 echo "$as_me:15671: checking if you want to use valgrind for testing" >&5
15672 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
15673
15674 # Check whether --with-valgrind or --without-valgrind was given.
15675 if test "${with_valgrind+set}" = set; then
15676   withval="$with_valgrind"
15677
15678 cat >>confdefs.h <<EOF
15679 #define USE_VALGRIND 1
15680 EOF
15681
15682         : ${with_cflags:=-g}
15683         : ${with_no_leaks:=yes}
15684          with_valgrind=yes
15685 else
15686   with_valgrind=
15687 fi;
15688 echo "$as_me:15688: result: ${with_valgrind:-no}" >&5
15689 echo "${ECHO_T}${with_valgrind:-no}" >&6
15690
15691 case .$with_cflags in #(vi
15692 .*-g*)
15693         case .$CFLAGS in #(vi
15694         .*-g*) #(vi
15695                 ;;
15696         *)
15697
15698 cf_fix_cppflags=no
15699 cf_new_cflags=
15700 cf_new_cppflags=
15701 cf_new_extra_cppflags=
15702
15703 for cf_add_cflags in -g
15704 do
15705 case $cf_fix_cppflags in
15706 no)
15707         case $cf_add_cflags in #(vi
15708         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
15709                 case $cf_add_cflags in
15710                 -D*)
15711                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15712
15713                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15714                                 && test -z "${cf_tst_cflags}" \
15715                                 && cf_fix_cppflags=yes
15716
15717                         if test $cf_fix_cppflags = yes ; then
15718                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15719                                 continue
15720                         elif test "${cf_tst_cflags}" = "\"'" ; then
15721                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15722                                 continue
15723                         fi
15724                         ;;
15725                 esac
15726                 case "$CPPFLAGS" in
15727                 *$cf_add_cflags) #(vi
15728                         ;;
15729                 *) #(vi
15730                         case $cf_add_cflags in #(vi
15731                         -D*)
15732                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15733
15734 CPPFLAGS=`echo "$CPPFLAGS" | \
15735         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15736                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15737
15738                                 ;;
15739                         esac
15740                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
15741                         ;;
15742                 esac
15743                 ;;
15744         *)
15745                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
15746                 ;;
15747         esac
15748         ;;
15749 yes)
15750         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15751
15752         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15753
15754         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15755                 && test -z "${cf_tst_cflags}" \
15756                 && cf_fix_cppflags=no
15757         ;;
15758 esac
15759 done
15760
15761 if test -n "$cf_new_cflags" ; then
15762
15763         CFLAGS="$CFLAGS $cf_new_cflags"
15764 fi
15765
15766 if test -n "$cf_new_cppflags" ; then
15767
15768         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
15769 fi
15770
15771 if test -n "$cf_new_extra_cppflags" ; then
15772
15773         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
15774 fi
15775
15776                 ;;
15777         esac
15778         ;;
15779 esac
15780
15781 echo "$as_me:15781: checking if you want to perform memory-leak testing" >&5
15782 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
15783
15784 # Check whether --enable-leaks or --disable-leaks was given.
15785 if test "${enable_leaks+set}" = set; then
15786   enableval="$enable_leaks"
15787   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
15788 else
15789   : ${with_no_leaks:=no}
15790 fi;
15791 echo "$as_me:15791: result: $with_no_leaks" >&5
15792 echo "${ECHO_T}$with_no_leaks" >&6
15793
15794 if test "$with_no_leaks" = yes ; then
15795
15796 cat >>confdefs.h <<\EOF
15797 #define NO_LEAKS 1
15798 EOF
15799
15800 cat >>confdefs.h <<\EOF
15801 #define YY_NO_LEAKS 1
15802 EOF
15803
15804 fi
15805
15806 LD_RPATH_OPT=
15807 echo "$as_me:15807: checking for an rpath option" >&5
15808 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
15809 case $cf_cv_system_name in #(vi
15810 irix*) #(vi
15811         if test "$GCC" = yes; then
15812                 LD_RPATH_OPT="-Wl,-rpath,"
15813         else
15814                 LD_RPATH_OPT="-rpath "
15815         fi
15816         ;;
15817 linux*|gnu*|k*bsd*-gnu) #(vi
15818         LD_RPATH_OPT="-Wl,-rpath,"
15819         ;;
15820 openbsd[2-9].*|mirbsd*) #(vi
15821         LD_RPATH_OPT="-Wl,-rpath,"
15822         ;;
15823 dragonfly*|freebsd*) #(vi
15824         LD_RPATH_OPT="-rpath "
15825         ;;
15826 netbsd*) #(vi
15827         LD_RPATH_OPT="-Wl,-rpath,"
15828         ;;
15829 osf*|mls+*) #(vi
15830         LD_RPATH_OPT="-rpath "
15831         ;;
15832 solaris2*) #(vi
15833         LD_RPATH_OPT="-R"
15834         ;;
15835 *)
15836         ;;
15837 esac
15838 echo "$as_me:15838: result: $LD_RPATH_OPT" >&5
15839 echo "${ECHO_T}$LD_RPATH_OPT" >&6
15840
15841 case "x$LD_RPATH_OPT" in #(vi
15842 x-R*)
15843         echo "$as_me:15843: checking if we need a space after rpath option" >&5
15844 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
15845         cf_save_LIBS="$LIBS"
15846         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
15847         cat >conftest.$ac_ext <<_ACEOF
15848 #line 15848 "configure"
15849 #include "confdefs.h"
15850
15851 int
15852 main ()
15853 {
15854
15855   ;
15856   return 0;
15857 }
15858 _ACEOF
15859 rm -f conftest.$ac_objext conftest$ac_exeext
15860 if { (eval echo "$as_me:15860: \"$ac_link\"") >&5
15861   (eval $ac_link) 2>&5
15862   ac_status=$?
15863   echo "$as_me:15863: \$? = $ac_status" >&5
15864   (exit $ac_status); } &&
15865          { ac_try='test -s conftest$ac_exeext'
15866   { (eval echo "$as_me:15866: \"$ac_try\"") >&5
15867   (eval $ac_try) 2>&5
15868   ac_status=$?
15869   echo "$as_me:15869: \$? = $ac_status" >&5
15870   (exit $ac_status); }; }; then
15871   cf_rpath_space=no
15872 else
15873   echo "$as_me: failed program was:" >&5
15874 cat conftest.$ac_ext >&5
15875 cf_rpath_space=yes
15876 fi
15877 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15878         LIBS="$cf_save_LIBS"
15879         echo "$as_me:15879: result: $cf_rpath_space" >&5
15880 echo "${ECHO_T}$cf_rpath_space" >&6
15881         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
15882         ;;
15883 esac
15884
15885 echo "$as_me:15885: checking if rpath-hack should be disabled" >&5
15886 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
15887
15888 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
15889 if test "${enable_rpath_hack+set}" = set; then
15890   enableval="$enable_rpath_hack"
15891   test "$enableval" != no && enableval=yes
15892   if test "$enableval" != "yes" ; then
15893     cf_disable_rpath_hack=yes
15894   else
15895     cf_disable_rpath_hack=no
15896   fi
15897 else
15898   enableval=yes
15899   cf_disable_rpath_hack=no
15900
15901 fi;
15902 echo "$as_me:15902: result: $cf_disable_rpath_hack" >&5
15903 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
15904 if test "$cf_disable_rpath_hack" = no ; then
15905
15906 echo "$as_me:15906: checking for updated LDFLAGS" >&5
15907 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
15908 if test -n "$LD_RPATH_OPT" ; then
15909         echo "$as_me:15909: result: maybe" >&5
15910 echo "${ECHO_T}maybe" >&6
15911
15912         for ac_prog in ldd
15913 do
15914   # Extract the first word of "$ac_prog", so it can be a program name with args.
15915 set dummy $ac_prog; ac_word=$2
15916 echo "$as_me:15916: checking for $ac_word" >&5
15917 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15918 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
15919   echo $ECHO_N "(cached) $ECHO_C" >&6
15920 else
15921   if test -n "$cf_ldd_prog"; then
15922   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
15923 else
15924   ac_save_IFS=$IFS; IFS=$ac_path_separator
15925 ac_dummy="$PATH"
15926 for ac_dir in $ac_dummy; do
15927   IFS=$ac_save_IFS
15928   test -z "$ac_dir" && ac_dir=.
15929   $as_executable_p "$ac_dir/$ac_word" || continue
15930 ac_cv_prog_cf_ldd_prog="$ac_prog"
15931 echo "$as_me:15931: found $ac_dir/$ac_word" >&5
15932 break
15933 done
15934
15935 fi
15936 fi
15937 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
15938 if test -n "$cf_ldd_prog"; then
15939   echo "$as_me:15939: result: $cf_ldd_prog" >&5
15940 echo "${ECHO_T}$cf_ldd_prog" >&6
15941 else
15942   echo "$as_me:15942: result: no" >&5
15943 echo "${ECHO_T}no" >&6
15944 fi
15945
15946   test -n "$cf_ldd_prog" && break
15947 done
15948 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
15949
15950         cf_rpath_list="/usr/lib /lib"
15951         if test "$cf_ldd_prog" != no
15952         then
15953                 cf_rpath_oops=
15954
15955 cat >conftest.$ac_ext <<_ACEOF
15956 #line 15956 "configure"
15957 #include "confdefs.h"
15958 #include <stdio.h>
15959 int
15960 main ()
15961 {
15962 printf("Hello");
15963   ;
15964   return 0;
15965 }
15966 _ACEOF
15967 rm -f conftest.$ac_objext conftest$ac_exeext
15968 if { (eval echo "$as_me:15968: \"$ac_link\"") >&5
15969   (eval $ac_link) 2>&5
15970   ac_status=$?
15971   echo "$as_me:15971: \$? = $ac_status" >&5
15972   (exit $ac_status); } &&
15973          { ac_try='test -s conftest$ac_exeext'
15974   { (eval echo "$as_me:15974: \"$ac_try\"") >&5
15975   (eval $ac_try) 2>&5
15976   ac_status=$?
15977   echo "$as_me:15977: \$? = $ac_status" >&5
15978   (exit $ac_status); }; }; then
15979   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
15980                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
15981 else
15982   echo "$as_me: failed program was:" >&5
15983 cat conftest.$ac_ext >&5
15984 fi
15985 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15986
15987                 # If we passed the link-test, but get a "not found" on a given library,
15988                 # this could be due to inept reconfiguration of gcc to make it only
15989                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
15990                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
15991                 # /usr/local libraries.
15992                 if test -n "$cf_rpath_oops"
15993                 then
15994                         for cf_rpath_src in $cf_rpath_oops
15995                         do
15996                                 for cf_rpath_dir in \
15997                                         /usr/local \
15998                                         /usr/pkg \
15999                                         /opt/sfw
16000                                 do
16001                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
16002                                         then
16003                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
16004
16005 echo "${as_me:-configure}:16005: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
16006
16007                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
16008                                                 break
16009                                         fi
16010                                 done
16011                         done
16012                 fi
16013         fi
16014
16015         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16016
16017 echo "${as_me:-configure}:16017: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16018
16019 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
16020
16021 echo "${as_me:-configure}:16021: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
16022
16023 cf_rpath_dst=
16024 for cf_rpath_src in $LDFLAGS
16025 do
16026         case $cf_rpath_src in #(vi
16027         -L*) #(vi
16028
16029                 # check if this refers to a directory which we will ignore
16030                 cf_rpath_skip=no
16031                 if test -n "$cf_rpath_list"
16032                 then
16033                         for cf_rpath_item in $cf_rpath_list
16034                         do
16035                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16036                                 then
16037                                         cf_rpath_skip=yes
16038                                         break
16039                                 fi
16040                         done
16041                 fi
16042
16043                 if test "$cf_rpath_skip" = no
16044                 then
16045                         # transform the option
16046                         if test "$LD_RPATH_OPT" = "-R " ; then
16047                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16048                         else
16049                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16050                         fi
16051
16052                         # if we have not already added this, add it now
16053                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16054                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16055                         then
16056                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16057
16058 echo "${as_me:-configure}:16058: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16059
16060                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16061                         fi
16062                 fi
16063                 ;;
16064         esac
16065         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16066 done
16067 LDFLAGS=$cf_rpath_dst
16068
16069 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
16070
16071 echo "${as_me:-configure}:16071: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
16072
16073 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
16074
16075 echo "${as_me:-configure}:16075: testing ...checking LIBS $LIBS ..." 1>&5
16076
16077 cf_rpath_dst=
16078 for cf_rpath_src in $LIBS
16079 do
16080         case $cf_rpath_src in #(vi
16081         -L*) #(vi
16082
16083                 # check if this refers to a directory which we will ignore
16084                 cf_rpath_skip=no
16085                 if test -n "$cf_rpath_list"
16086                 then
16087                         for cf_rpath_item in $cf_rpath_list
16088                         do
16089                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16090                                 then
16091                                         cf_rpath_skip=yes
16092                                         break
16093                                 fi
16094                         done
16095                 fi
16096
16097                 if test "$cf_rpath_skip" = no
16098                 then
16099                         # transform the option
16100                         if test "$LD_RPATH_OPT" = "-R " ; then
16101                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16102                         else
16103                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16104                         fi
16105
16106                         # if we have not already added this, add it now
16107                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16108                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16109                         then
16110                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16111
16112 echo "${as_me:-configure}:16112: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16113
16114                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16115                         fi
16116                 fi
16117                 ;;
16118         esac
16119         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16120 done
16121 LIBS=$cf_rpath_dst
16122
16123 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
16124
16125 echo "${as_me:-configure}:16125: testing ...checked LIBS $LIBS ..." 1>&5
16126
16127         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16128
16129 echo "${as_me:-configure}:16129: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16130
16131 else
16132         echo "$as_me:16132: result: no" >&5
16133 echo "${ECHO_T}no" >&6
16134 fi
16135
16136 fi
16137
16138 TEST_ARGS="$LIBS"
16139 LIBS=
16140
16141 ac_config_files="$ac_config_files Makefile"
16142 ac_config_commands="$ac_config_commands default"
16143 cat >confcache <<\_ACEOF
16144 # This file is a shell script that caches the results of configure
16145 # tests run on this system so they can be shared between configure
16146 # scripts and configure runs, see configure's option --config-cache.
16147 # It is not useful on other systems.  If it contains results you don't
16148 # want to keep, you may remove or edit it.
16149 #
16150 # config.status only pays attention to the cache file if you give it
16151 # the --recheck option to rerun configure.
16152 #
16153 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16154 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16155 # following values.
16156
16157 _ACEOF
16158
16159 # The following way of writing the cache mishandles newlines in values,
16160 # but we know of no workaround that is simple, portable, and efficient.
16161 # So, don't put newlines in cache variables' values.
16162 # Ultrix sh set writes to stderr and can't be redirected directly,
16163 # and sets the high bit in the cache file unless we assign to the vars.
16164 {
16165   (set) 2>&1 |
16166     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16167     *ac_space=\ *)
16168       # `set' does not quote correctly, so add quotes (double-quote
16169       # substitution turns \\\\ into \\, and sed turns \\ into \).
16170       sed -n \
16171         "s/'/'\\\\''/g;
16172           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16173       ;;
16174     *)
16175       # `set' quotes correctly as required by POSIX, so do not add quotes.
16176       sed -n \
16177         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16178       ;;
16179     esac;
16180 } |
16181   sed '
16182      t clear
16183      : clear
16184      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16185      t end
16186      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16187      : end' >>confcache
16188 if cmp -s $cache_file confcache; then :; else
16189   if test -w $cache_file; then
16190     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16191     cat confcache >$cache_file
16192   else
16193     echo "not updating unwritable cache $cache_file"
16194   fi
16195 fi
16196 rm -f confcache
16197
16198 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16199 # Let make expand exec_prefix.
16200 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16201
16202 # VPATH may cause trouble with some makes, so we remove $(srcdir),
16203 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
16204 # trailing colons and then remove the whole line if VPATH becomes empty
16205 # (actually we leave an empty line to preserve line numbers).
16206 if test "x$srcdir" = x.; then
16207   ac_vpsub='/^[         ]*VPATH[        ]*=/{
16208 s/:*\$(srcdir):*/:/;
16209 s/:*\${srcdir}:*/:/;
16210 s/:*@srcdir@:*/:/;
16211 s/^\([^=]*=[    ]*\):*/\1/;
16212 s/:*$//;
16213 s/^[^=]*=[      ]*$//;
16214 }'
16215 fi
16216
16217 DEFS=-DHAVE_CONFIG_H
16218
16219 : ${CONFIG_STATUS=./config.status}
16220 ac_clean_files_save=$ac_clean_files
16221 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16222 { echo "$as_me:16222: creating $CONFIG_STATUS" >&5
16223 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16224 cat >$CONFIG_STATUS <<_ACEOF
16225 #! $SHELL
16226 # Generated automatically by configure.
16227 # Run this file to recreate the current configuration.
16228 # Compiler output produced by configure, useful for debugging
16229 # configure, is in config.log if it exists.
16230
16231 debug=false
16232 SHELL=\${CONFIG_SHELL-$SHELL}
16233 ac_cs_invocation="\$0 \$@"
16234
16235 _ACEOF
16236
16237 cat >>$CONFIG_STATUS <<\_ACEOF
16238 # Be Bourne compatible
16239 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16240   emulate sh
16241   NULLCMD=:
16242 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16243   set -o posix
16244 fi
16245
16246 # Name of the executable.
16247 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16248
16249 if expr a : '\(a\)' >/dev/null 2>&1; then
16250   as_expr=expr
16251 else
16252   as_expr=false
16253 fi
16254
16255 rm -f conf$$ conf$$.exe conf$$.file
16256 echo >conf$$.file
16257 if ln -s conf$$.file conf$$ 2>/dev/null; then
16258   # We could just check for DJGPP; but this test a) works b) is more generic
16259   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16260   if test -f conf$$.exe; then
16261     # Don't use ln at all; we don't have any links
16262     as_ln_s='cp -p'
16263   else
16264     as_ln_s='ln -s'
16265   fi
16266 elif ln conf$$.file conf$$ 2>/dev/null; then
16267   as_ln_s=ln
16268 else
16269   as_ln_s='cp -p'
16270 fi
16271 rm -f conf$$ conf$$.exe conf$$.file
16272
16273 as_executable_p="test -f"
16274
16275 # Support unset when possible.
16276 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16277   as_unset=unset
16278 else
16279   as_unset=false
16280 fi
16281
16282 # NLS nuisances.
16283 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16284 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16285 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16286 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16287 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16288 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16289 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16290 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16291
16292 # IFS
16293 # We need space, tab and new line, in precisely that order.
16294 as_nl='
16295 '
16296 IFS="   $as_nl"
16297
16298 # CDPATH.
16299 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16300
16301 exec 6>&1
16302
16303 _ACEOF
16304
16305 # Files that config.status was made for.
16306 if test -n "$ac_config_files"; then
16307   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16308 fi
16309
16310 if test -n "$ac_config_headers"; then
16311   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16312 fi
16313
16314 if test -n "$ac_config_links"; then
16315   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16316 fi
16317
16318 if test -n "$ac_config_commands"; then
16319   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16320 fi
16321
16322 cat >>$CONFIG_STATUS <<\EOF
16323
16324 ac_cs_usage="\
16325 \`$as_me' instantiates files from templates according to the
16326 current configuration.
16327
16328 Usage: $0 [OPTIONS] [FILE]...
16329
16330   -h, --help       print this help, then exit
16331   -V, --version    print version number, then exit
16332   -d, --debug      don't remove temporary files
16333       --recheck    update $as_me by reconfiguring in the same conditions
16334   --file=FILE[:TEMPLATE]
16335                    instantiate the configuration file FILE
16336   --header=FILE[:TEMPLATE]
16337                    instantiate the configuration header FILE
16338
16339 Configuration files:
16340 $config_files
16341
16342 Configuration headers:
16343 $config_headers
16344
16345 Configuration commands:
16346 $config_commands
16347
16348 Report bugs to <dickey@invisible-island.net>."
16349 EOF
16350
16351 cat >>$CONFIG_STATUS <<EOF
16352 ac_cs_version="\\
16353 config.status
16354 configured by $0, generated by GNU Autoconf 2.52.20121002,
16355   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16356
16357 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16358 Free Software Foundation, Inc.
16359 This config.status script is free software; the Free Software Foundation
16360 gives unlimited permission to copy, distribute and modify it."
16361 srcdir=$srcdir
16362 INSTALL="$INSTALL"
16363 EOF
16364
16365 cat >>$CONFIG_STATUS <<\EOF
16366 # If no file are specified by the user, then we need to provide default
16367 # value.  By we need to know if files were specified by the user.
16368 ac_need_defaults=:
16369 while test $# != 0
16370 do
16371   case $1 in
16372   --*=*)
16373     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16374     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16375     shift
16376     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16377     shift
16378     ;;
16379   -*);;
16380   *) # This is not an option, so the user has probably given explicit
16381      # arguments.
16382      ac_need_defaults=false;;
16383   esac
16384
16385   case $1 in
16386   # Handling of the options.
16387 EOF
16388 cat >>$CONFIG_STATUS <<EOF
16389   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16390     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16391     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16392 EOF
16393 cat >>$CONFIG_STATUS <<\EOF
16394   --version | --vers* | -V )
16395     echo "$ac_cs_version"; exit 0 ;;
16396   --he | --h)
16397     # Conflict between --help and --header
16398     { { echo "$as_me:16398: error: ambiguous option: $1
16399 Try \`$0 --help' for more information." >&5
16400 echo "$as_me: error: ambiguous option: $1
16401 Try \`$0 --help' for more information." >&2;}
16402    { (exit 1); exit 1; }; };;
16403   --help | --hel | -h )
16404     echo "$ac_cs_usage"; exit 0 ;;
16405   --debug | --d* | -d )
16406     debug=: ;;
16407   --file | --fil | --fi | --f )
16408     shift
16409     CONFIG_FILES="$CONFIG_FILES $1"
16410     ac_need_defaults=false;;
16411   --header | --heade | --head | --hea )
16412     shift
16413     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16414     ac_need_defaults=false;;
16415
16416   # This is an error.
16417   -*) { { echo "$as_me:16417: error: unrecognized option: $1
16418 Try \`$0 --help' for more information." >&5
16419 echo "$as_me: error: unrecognized option: $1
16420 Try \`$0 --help' for more information." >&2;}
16421    { (exit 1); exit 1; }; } ;;
16422
16423   *) ac_config_targets="$ac_config_targets $1" ;;
16424
16425   esac
16426   shift
16427 done
16428
16429 exec 5>>config.log
16430 cat >&5 << _ACEOF
16431
16432 ## ----------------------- ##
16433 ## Running config.status.  ##
16434 ## ----------------------- ##
16435
16436 This file was extended by $as_me 2.52.20121002, executed with
16437   CONFIG_FILES    = $CONFIG_FILES
16438   CONFIG_HEADERS  = $CONFIG_HEADERS
16439   CONFIG_LINKS    = $CONFIG_LINKS
16440   CONFIG_COMMANDS = $CONFIG_COMMANDS
16441   > $ac_cs_invocation
16442 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16443
16444 _ACEOF
16445 EOF
16446
16447 cat >>$CONFIG_STATUS <<EOF
16448 #
16449 # INIT-COMMANDS section.
16450 #
16451
16452 AWK="$AWK"
16453 ECHO_CC="$ECHO_CC"
16454 ECHO_LD="$ECHO_LD"
16455 SHOW_CC="$SHOW_LD"
16456
16457 EOF
16458
16459 cat >>$CONFIG_STATUS <<\EOF
16460 for ac_config_target in $ac_config_targets
16461 do
16462   case "$ac_config_target" in
16463   # Handling of arguments.
16464   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16465   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16466   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
16467   *) { { echo "$as_me:16467: error: invalid argument: $ac_config_target" >&5
16468 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16469    { (exit 1); exit 1; }; };;
16470   esac
16471 done
16472
16473 # If the user did not use the arguments to specify the items to instantiate,
16474 # then the envvar interface is used.  Set only those that are not.
16475 # We use the long form for the default assignment because of an extremely
16476 # bizarre bug on SunOS 4.1.3.
16477 if $ac_need_defaults; then
16478   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16479   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16480   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16481 fi
16482
16483 # Create a temporary directory, and hook for its removal unless debugging.
16484 $debug ||
16485 {
16486   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16487   trap '{ (exit 1); exit 1; }' 1 2 13 15
16488 }
16489
16490 # Create a (secure) tmp directory for tmp files.
16491 : ${TMPDIR=/tmp}
16492 {
16493   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16494   test -n "$tmp" && test -d "$tmp"
16495 }  ||
16496 {
16497   tmp=$TMPDIR/cs$$-$RANDOM
16498   (umask 077 && mkdir $tmp)
16499 } ||
16500 {
16501    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16502    { (exit 1); exit 1; }
16503 }
16504
16505 EOF
16506
16507 cat >>$CONFIG_STATUS <<EOF
16508
16509 #
16510 # CONFIG_FILES section.
16511 #
16512
16513 # No need to generate the scripts if there are no CONFIG_FILES.
16514 # This happens for instance when ./config.status config.h
16515 if test -n "\$CONFIG_FILES"; then
16516   # Protect against being on the right side of a sed subst in config.status.
16517   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
16518    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
16519 s,@SHELL@,$SHELL,;t t
16520 s,@exec_prefix@,$exec_prefix,;t t
16521 s,@prefix@,$prefix,;t t
16522 s,@program_transform_name@,$program_transform_name,;t t
16523 s,@bindir@,$bindir,;t t
16524 s,@sbindir@,$sbindir,;t t
16525 s,@libexecdir@,$libexecdir,;t t
16526 s,@datarootdir@,$datarootdir,;t t
16527 s,@datadir@,$datadir,;t t
16528 s,@sysconfdir@,$sysconfdir,;t t
16529 s,@sharedstatedir@,$sharedstatedir,;t t
16530 s,@localstatedir@,$localstatedir,;t t
16531 s,@libdir@,$libdir,;t t
16532 s,@includedir@,$includedir,;t t
16533 s,@oldincludedir@,$oldincludedir,;t t
16534 s,@infodir@,$infodir,;t t
16535 s,@mandir@,$mandir,;t t
16536 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
16537 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
16538 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
16539 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
16540 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
16541 s,@build_alias@,$build_alias,;t t
16542 s,@host_alias@,$host_alias,;t t
16543 s,@target_alias@,$target_alias,;t t
16544 s,@ECHO_C@,$ECHO_C,;t t
16545 s,@ECHO_N@,$ECHO_N,;t t
16546 s,@ECHO_T@,$ECHO_T,;t t
16547 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
16548 s,@DEFS@,$DEFS,;t t
16549 s,@LIBS@,$LIBS,;t t
16550 s,@build@,$build,;t t
16551 s,@build_cpu@,$build_cpu,;t t
16552 s,@build_vendor@,$build_vendor,;t t
16553 s,@build_os@,$build_os,;t t
16554 s,@host@,$host,;t t
16555 s,@host_cpu@,$host_cpu,;t t
16556 s,@host_vendor@,$host_vendor,;t t
16557 s,@host_os@,$host_os,;t t
16558 s,@SET_MAKE@,$SET_MAKE,;t t
16559 s,@CC@,$CC,;t t
16560 s,@CFLAGS@,$CFLAGS,;t t
16561 s,@LDFLAGS@,$LDFLAGS,;t t
16562 s,@CPPFLAGS@,$CPPFLAGS,;t t
16563 s,@ac_ct_CC@,$ac_ct_CC,;t t
16564 s,@EXEEXT@,$EXEEXT,;t t
16565 s,@OBJEXT@,$OBJEXT,;t t
16566 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
16567 s,@CPP@,$CPP,;t t
16568 s,@AWK@,$AWK,;t t
16569 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
16570 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
16571 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
16572 s,@LINT@,$LINT,;t t
16573 s,@LINT_OPTS@,$LINT_OPTS,;t t
16574 s,@CTAGS@,$CTAGS,;t t
16575 s,@ETAGS@,$ETAGS,;t t
16576 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
16577 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
16578 s,@MATH_LIB@,$MATH_LIB,;t t
16579 s,@top_builddir@,$top_builddir,;t t
16580 s,@CC_G_OPT@,$CC_G_OPT,;t t
16581 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
16582 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
16583 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
16584 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
16585 s,@LD@,$LD,;t t
16586 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
16587 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
16588 s,@LD_MODEL@,$LD_MODEL,;t t
16589 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
16590 s,@LIBTOOL@,$LIBTOOL,;t t
16591 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
16592 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
16593 s,@LIB_LINK@,$LIB_LINK,;t t
16594 s,@LINK_TESTS@,$LINK_TESTS,;t t
16595 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
16596 s,@PTHREAD@,$PTHREAD,;t t
16597 s,@TEST_ARGS@,$TEST_ARGS,;t t
16598 s,@TEST_DEPS@,$TEST_DEPS,;t t
16599 s,@TEST_LIBS@,$TEST_LIBS,;t t
16600 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
16601 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
16602 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
16603 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
16604 s,@includesubdir@,$includesubdir,;t t
16605 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
16606 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
16607 s,@ECHO_LT@,$ECHO_LT,;t t
16608 s,@ECHO_LD@,$ECHO_LD,;t t
16609 s,@RULE_CC@,$RULE_CC,;t t
16610 s,@SHOW_CC@,$SHOW_CC,;t t
16611 s,@ECHO_CC@,$ECHO_CC,;t t
16612 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
16613 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
16614 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
16615 s,@X_CFLAGS@,$X_CFLAGS,;t t
16616 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
16617 s,@X_LIBS@,$X_LIBS,;t t
16618 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
16619 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
16620 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
16621 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
16622 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
16623 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
16624 CEOF
16625
16626 EOF
16627
16628   cat >>$CONFIG_STATUS <<\EOF
16629   # Split the substitutions into bite-sized pieces for seds with
16630   # small command number limits, like on Digital OSF/1 and HP-UX.
16631   ac_max_sed_lines=48
16632   ac_sed_frag=1 # Number of current file.
16633   ac_beg=1 # First line for current file.
16634   ac_end=$ac_max_sed_lines # Line after last line for current file.
16635   ac_more_lines=:
16636   ac_sed_cmds=
16637   while $ac_more_lines; do
16638     if test $ac_beg -gt 1; then
16639       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16640     else
16641       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16642     fi
16643     if test ! -s $tmp/subs.frag; then
16644       ac_more_lines=false
16645     else
16646       # The purpose of the label and of the branching condition is to
16647       # speed up the sed processing (if there are no `@' at all, there
16648       # is no need to browse any of the substitutions).
16649       # These are the two extra sed commands mentioned above.
16650       (echo ':t
16651   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
16652       if test -z "$ac_sed_cmds"; then
16653         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
16654       else
16655         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
16656       fi
16657       ac_sed_frag=`expr $ac_sed_frag + 1`
16658       ac_beg=$ac_end
16659       ac_end=`expr $ac_end + $ac_max_sed_lines`
16660     fi
16661   done
16662   if test -z "$ac_sed_cmds"; then
16663     ac_sed_cmds=cat
16664   fi
16665 fi # test -n "$CONFIG_FILES"
16666
16667 EOF
16668 cat >>$CONFIG_STATUS <<\EOF
16669 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
16670   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16671   case $ac_file in
16672   - | *:- | *:-:* ) # input from stdin
16673         cat >$tmp/stdin
16674         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16675         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16676   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16677         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16678   * )   ac_file_in=$ac_file.in ;;
16679   esac
16680
16681   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
16682   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16683          X"$ac_file" : 'X\(//\)[^/]' \| \
16684          X"$ac_file" : 'X\(//\)$' \| \
16685          X"$ac_file" : 'X\(/\)' \| \
16686          .     : '\(.\)' 2>/dev/null ||
16687 echo X"$ac_file" |
16688     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16689           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16690           /^X\(\/\/\)$/{ s//\1/; q; }
16691           /^X\(\/\).*/{ s//\1/; q; }
16692           s/.*/./; q'`
16693   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16694     { case "$ac_dir" in
16695   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16696   *)                      as_incr_dir=.;;
16697 esac
16698 as_dummy="$ac_dir"
16699 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16700   case $as_mkdir_dir in
16701     # Skip DOS drivespec
16702     ?:) as_incr_dir=$as_mkdir_dir ;;
16703     *)
16704       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16705       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16706     ;;
16707   esac
16708 done; }
16709
16710     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
16711     # A "../" for each directory in $ac_dir_suffix.
16712     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
16713   else
16714     ac_dir_suffix= ac_dots=
16715   fi
16716
16717   case $srcdir in
16718   .)  ac_srcdir=.
16719       if test -z "$ac_dots"; then
16720          ac_top_srcdir=.
16721       else
16722          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
16723       fi ;;
16724   [\\/]* | ?:[\\/]* )
16725       ac_srcdir=$srcdir$ac_dir_suffix;
16726       ac_top_srcdir=$srcdir ;;
16727   *) # Relative path.
16728     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
16729     ac_top_srcdir=$ac_dots$srcdir ;;
16730   esac
16731
16732   case $INSTALL in
16733   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
16734   *) ac_INSTALL=$ac_dots$INSTALL ;;
16735   esac
16736
16737   if test x"$ac_file" != x-; then
16738     { echo "$as_me:16738: creating $ac_file" >&5
16739 echo "$as_me: creating $ac_file" >&6;}
16740     rm -f "$ac_file"
16741   fi
16742   # Let's still pretend it is `configure' which instantiates (i.e., don't
16743   # use $as_me), people would be surprised to read:
16744   #    /* config.h.  Generated automatically by config.status.  */
16745   configure_input="Generated automatically from `echo $ac_file_in |
16746                                                  sed 's,.*/,,'` by configure."
16747
16748   # First look for the input files in the build tree, otherwise in the
16749   # src tree.
16750   ac_file_inputs=`IFS=:
16751     for f in $ac_file_in; do
16752       case $f in
16753       -) echo $tmp/stdin ;;
16754       [\\/$]*)
16755          # Absolute (can't be DOS-style, as IFS=:)
16756          test -f "$f" || { { echo "$as_me:16756: error: cannot find input file: $f" >&5
16757 echo "$as_me: error: cannot find input file: $f" >&2;}
16758    { (exit 1); exit 1; }; }
16759          echo $f;;
16760       *) # Relative
16761          if test -f "$f"; then
16762            # Build tree
16763            echo $f
16764          elif test -f "$srcdir/$f"; then
16765            # Source tree
16766            echo $srcdir/$f
16767          else
16768            # /dev/null tree
16769            { { echo "$as_me:16769: error: cannot find input file: $f" >&5
16770 echo "$as_me: error: cannot find input file: $f" >&2;}
16771    { (exit 1); exit 1; }; }
16772          fi;;
16773       esac
16774     done` || { (exit 1); exit 1; }
16775 EOF
16776 cat >>$CONFIG_STATUS <<\EOF
16777   ac_warn_datarootdir=no
16778   if test x"$ac_file" != x-; then
16779     for ac_item in $ac_file_inputs
16780     do
16781       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
16782       if test -n "$ac_seen"; then
16783         ac_used=`grep '@datarootdir@' $ac_item`
16784         if test -z "$ac_used"; then
16785           { echo "$as_me:16785: WARNING: datarootdir was used implicitly but not set:
16786 $ac_seen" >&5
16787 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
16788 $ac_seen" >&2;}
16789           ac_warn_datarootdir=yes
16790         fi
16791       fi
16792       ac_seen=`grep '${datarootdir}' $ac_item`
16793       if test -n "$ac_seen"; then
16794         { echo "$as_me:16794: WARNING: datarootdir was used explicitly but not set:
16795 $ac_seen" >&5
16796 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
16797 $ac_seen" >&2;}
16798         ac_warn_datarootdir=yes
16799       fi
16800     done
16801   fi
16802
16803 if test "x$ac_warn_datarootdir" = xyes; then
16804   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
16805 fi
16806
16807 EOF
16808 cat >>$CONFIG_STATUS <<EOF
16809   sed "$ac_vpsub
16810 $extrasub
16811 EOF
16812 cat >>$CONFIG_STATUS <<\EOF
16813 :t
16814 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
16815 s,@configure_input@,$configure_input,;t t
16816 s,@srcdir@,$ac_srcdir,;t t
16817 s,@top_srcdir@,$ac_top_srcdir,;t t
16818 s,@INSTALL@,$ac_INSTALL,;t t
16819 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
16820   rm -f $tmp/stdin
16821   if test x"$ac_file" != x-; then
16822     cp $tmp/out $ac_file
16823
16824     for ac_name in prefix exec_prefix datarootdir
16825     do
16826         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
16827         if test -n "$ac_seen"; then
16828             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
16829             if test -z "$ac_init"; then
16830               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
16831               { echo "$as_me:16831: WARNING: Variable $ac_name is used but was not set:
16832 $ac_seen" >&5
16833 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
16834 $ac_seen" >&2;}
16835             fi
16836         fi
16837     done
16838     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
16839     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
16840     if test -s $tmp/out; then
16841       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
16842       { echo "$as_me:16842: WARNING: Some variables may not be substituted:
16843 $ac_seen" >&5
16844 echo "$as_me: WARNING: Some variables may not be substituted:
16845 $ac_seen" >&2;}
16846     fi
16847   else
16848     cat $tmp/out
16849   fi
16850   rm -f $tmp/out
16851
16852 done
16853 EOF
16854 cat >>$CONFIG_STATUS <<\EOF
16855
16856 #
16857 # CONFIG_HEADER section.
16858 #
16859
16860 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
16861 # NAME is the cpp macro being defined and VALUE is the value it is being given.
16862 #
16863 # ac_d sets the value in "#define NAME VALUE" lines.
16864 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
16865 ac_dB='[        ].*$,\1#\2'
16866 ac_dC=' '
16867 ac_dD=',;t'
16868 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
16869 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16870 ac_iB='\([      ]\),\1#\2define\3'
16871 ac_iC=' '
16872 ac_iD='\4,;t'
16873 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16874 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16875 ac_uB='$,\1#\2define\3'
16876 ac_uC=' '
16877 ac_uD=',;t'
16878
16879 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
16880   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16881   case $ac_file in
16882   - | *:- | *:-:* ) # input from stdin
16883         cat >$tmp/stdin
16884         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16885         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16886   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16887         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16888   * )   ac_file_in=$ac_file.in ;;
16889   esac
16890
16891   test x"$ac_file" != x- && { echo "$as_me:16891: creating $ac_file" >&5
16892 echo "$as_me: creating $ac_file" >&6;}
16893
16894   # First look for the input files in the build tree, otherwise in the
16895   # src tree.
16896   ac_file_inputs=`IFS=:
16897     for f in $ac_file_in; do
16898       case $f in
16899       -) echo $tmp/stdin ;;
16900       [\\/$]*)
16901          # Absolute (can't be DOS-style, as IFS=:)
16902          test -f "$f" || { { echo "$as_me:16902: error: cannot find input file: $f" >&5
16903 echo "$as_me: error: cannot find input file: $f" >&2;}
16904    { (exit 1); exit 1; }; }
16905          echo $f;;
16906       *) # Relative
16907          if test -f "$f"; then
16908            # Build tree
16909            echo $f
16910          elif test -f "$srcdir/$f"; then
16911            # Source tree
16912            echo $srcdir/$f
16913          else
16914            # /dev/null tree
16915            { { echo "$as_me:16915: error: cannot find input file: $f" >&5
16916 echo "$as_me: error: cannot find input file: $f" >&2;}
16917    { (exit 1); exit 1; }; }
16918          fi;;
16919       esac
16920     done` || { (exit 1); exit 1; }
16921   # Remove the trailing spaces.
16922   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
16923
16924 EOF
16925
16926 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
16927 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
16928 # be either 'cat' or 'sort'.
16929 cat confdefs.h | uniq >conftest.vals
16930
16931 # Break up conftest.vals because some shells have a limit on
16932 # the size of here documents, and old seds have small limits too.
16933
16934 rm -f conftest.tail
16935 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
16936 while grep . conftest.vals >/dev/null
16937 do
16938   # Write chunks of a limited-size here document to conftest.frag.
16939   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
16940   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
16941   echo 'CEOF' >> $CONFIG_STATUS
16942   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
16943   rm -f conftest.vals
16944   mv conftest.tail conftest.vals
16945 done
16946 rm -f conftest.vals
16947
16948 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
16949 # marker @DEFS@.
16950 echo '  cat >> conftest.edit <<CEOF
16951 /@DEFS@/r conftest.frag
16952 /@DEFS@/d
16953 CEOF
16954 sed -f conftest.edit $tmp/in > $tmp/out
16955 rm -f $tmp/in
16956 mv $tmp/out $tmp/in
16957 rm -f conftest.edit conftest.frag
16958 ' >> $CONFIG_STATUS
16959
16960 cat >>$CONFIG_STATUS <<\EOF
16961   # Let's still pretend it is `configure' which instantiates (i.e., don't
16962   # use $as_me), people would be surprised to read:
16963   #    /* config.h.  Generated automatically by config.status.  */
16964   if test x"$ac_file" = x-; then
16965     echo "/* Generated automatically by configure.  */" >$tmp/config.h
16966   else
16967     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
16968   fi
16969   cat $tmp/in >>$tmp/config.h
16970   rm -f $tmp/in
16971   if test x"$ac_file" != x-; then
16972     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
16973       { echo "$as_me:16973: $ac_file is unchanged" >&5
16974 echo "$as_me: $ac_file is unchanged" >&6;}
16975     else
16976       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16977          X"$ac_file" : 'X\(//\)[^/]' \| \
16978          X"$ac_file" : 'X\(//\)$' \| \
16979          X"$ac_file" : 'X\(/\)' \| \
16980          .     : '\(.\)' 2>/dev/null ||
16981 echo X"$ac_file" |
16982     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16983           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16984           /^X\(\/\/\)$/{ s//\1/; q; }
16985           /^X\(\/\).*/{ s//\1/; q; }
16986           s/.*/./; q'`
16987       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16988         { case "$ac_dir" in
16989   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16990   *)                      as_incr_dir=.;;
16991 esac
16992 as_dummy="$ac_dir"
16993 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16994   case $as_mkdir_dir in
16995     # Skip DOS drivespec
16996     ?:) as_incr_dir=$as_mkdir_dir ;;
16997     *)
16998       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16999       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17000     ;;
17001   esac
17002 done; }
17003
17004       fi
17005       rm -f $ac_file
17006       mv $tmp/config.h $ac_file
17007     fi
17008   else
17009     cat $tmp/config.h
17010     rm -f $tmp/config.h
17011   fi
17012 done
17013 EOF
17014 cat >>$CONFIG_STATUS <<\EOF
17015 #
17016 # CONFIG_COMMANDS section.
17017 #
17018 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17019   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17020   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17021
17022   case $ac_dest in
17023     default )
17024
17025 for cf_dir in .
17026 do
17027         if test ! -d $srcdir/$cf_dir; then
17028                 continue
17029         elif test -f $srcdir/$cf_dir/programs; then
17030                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
17031         fi
17032 done
17033
17034         cat >>Makefile <<TEST_EOF
17035
17036 # These rules are generated so we do not rely on suffix rules, which do not
17037 # work consistently for different make-programs (the '\$(MODEL)/' confuses
17038 # some, and the '\$x' confuses others).
17039 TEST_EOF
17040
17041 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
17042 for N in $LIST
17043 do
17044         cat >>Makefile <<TEST_EOF
17045
17046 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
17047         \$(srcdir)/test.priv.h \\
17048         ncurses_cfg.h
17049         $SHOW_CC
17050         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
17051 TEST_EOF
17052 done
17053
17054 if test -f ../config.guess && test -f ../config.sub
17055 then
17056         cat >>Makefile <<TEST_EOF
17057
17058 # if we used CF_INHERIT for getting these files, we can remove them
17059 distclean::
17060         rm -f config.guess config.sub
17061 TEST_EOF
17062 fi
17063  ;;
17064   esac
17065 done
17066 EOF
17067
17068 cat >>$CONFIG_STATUS <<\EOF
17069
17070 { (exit 0); exit 0; }
17071 EOF
17072 chmod +x $CONFIG_STATUS
17073 ac_clean_files=$ac_clean_files_save
17074
17075 # configure is writing to config.log, and then calls config.status.
17076 # config.status does its own redirection, appending to config.log.
17077 # Unfortunately, on DOS this fails, as config.log is still kept open
17078 # by configure, so config.status won't be able to write to it; its
17079 # output is simply discarded.  So we exec the FD to /dev/null,
17080 # effectively closing config.log, so it can be properly (re)opened and
17081 # appended to by config.status.  When coming back to configure, we
17082 # need to make the FD available again.
17083 if test "$no_create" != yes; then
17084   ac_cs_success=:
17085   exec 5>/dev/null
17086   $SHELL $CONFIG_STATUS || ac_cs_success=false
17087   exec 5>>config.log
17088   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17089   # would make configure fail if this is the last instruction.
17090   $ac_cs_success || { (exit 1); exit 1; }
17091 fi
17092