]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.9 - patch 20131027
[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         ;;
3181 *)
3182
3183 echo "$as_me:3183: checking if we should define _XOPEN_SOURCE" >&5
3184 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3185 if test "${cf_cv_xopen_source+set}" = set; then
3186   echo $ECHO_N "(cached) $ECHO_C" >&6
3187 else
3188
3189         cat >conftest.$ac_ext <<_ACEOF
3190 #line 3190 "configure"
3191 #include "confdefs.h"
3192
3193 #include <stdlib.h>
3194 #include <string.h>
3195 #include <sys/types.h>
3196
3197 int
3198 main ()
3199 {
3200
3201 #ifndef _XOPEN_SOURCE
3202 make an error
3203 #endif
3204   ;
3205   return 0;
3206 }
3207 _ACEOF
3208 rm -f conftest.$ac_objext
3209 if { (eval echo "$as_me:3209: \"$ac_compile\"") >&5
3210   (eval $ac_compile) 2>&5
3211   ac_status=$?
3212   echo "$as_me:3212: \$? = $ac_status" >&5
3213   (exit $ac_status); } &&
3214          { ac_try='test -s conftest.$ac_objext'
3215   { (eval echo "$as_me:3215: \"$ac_try\"") >&5
3216   (eval $ac_try) 2>&5
3217   ac_status=$?
3218   echo "$as_me:3218: \$? = $ac_status" >&5
3219   (exit $ac_status); }; }; then
3220   cf_cv_xopen_source=no
3221 else
3222   echo "$as_me: failed program was:" >&5
3223 cat conftest.$ac_ext >&5
3224 cf_save="$CPPFLAGS"
3225          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3226          cat >conftest.$ac_ext <<_ACEOF
3227 #line 3227 "configure"
3228 #include "confdefs.h"
3229
3230 #include <stdlib.h>
3231 #include <string.h>
3232 #include <sys/types.h>
3233
3234 int
3235 main ()
3236 {
3237
3238 #ifdef _XOPEN_SOURCE
3239 make an error
3240 #endif
3241   ;
3242   return 0;
3243 }
3244 _ACEOF
3245 rm -f conftest.$ac_objext
3246 if { (eval echo "$as_me:3246: \"$ac_compile\"") >&5
3247   (eval $ac_compile) 2>&5
3248   ac_status=$?
3249   echo "$as_me:3249: \$? = $ac_status" >&5
3250   (exit $ac_status); } &&
3251          { ac_try='test -s conftest.$ac_objext'
3252   { (eval echo "$as_me:3252: \"$ac_try\"") >&5
3253   (eval $ac_try) 2>&5
3254   ac_status=$?
3255   echo "$as_me:3255: \$? = $ac_status" >&5
3256   (exit $ac_status); }; }; then
3257   cf_cv_xopen_source=no
3258 else
3259   echo "$as_me: failed program was:" >&5
3260 cat conftest.$ac_ext >&5
3261 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3262 fi
3263 rm -f conftest.$ac_objext conftest.$ac_ext
3264         CPPFLAGS="$cf_save"
3265
3266 fi
3267 rm -f conftest.$ac_objext conftest.$ac_ext
3268
3269 fi
3270 echo "$as_me:3270: result: $cf_cv_xopen_source" >&5
3271 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3272
3273 if test "$cf_cv_xopen_source" != no ; then
3274
3275 CFLAGS=`echo "$CFLAGS" | \
3276         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3277                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3278
3279 CPPFLAGS=`echo "$CPPFLAGS" | \
3280         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3281                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3282
3283         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3284
3285 cf_fix_cppflags=no
3286 cf_new_cflags=
3287 cf_new_cppflags=
3288 cf_new_extra_cppflags=
3289
3290 for cf_add_cflags in $cf_temp_xopen_source
3291 do
3292 case $cf_fix_cppflags in
3293 no)
3294         case $cf_add_cflags in #(vi
3295         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3296                 case $cf_add_cflags in
3297                 -D*)
3298                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3299
3300                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3301                                 && test -z "${cf_tst_cflags}" \
3302                                 && cf_fix_cppflags=yes
3303
3304                         if test $cf_fix_cppflags = yes ; then
3305                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3306                                 continue
3307                         elif test "${cf_tst_cflags}" = "\"'" ; then
3308                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3309                                 continue
3310                         fi
3311                         ;;
3312                 esac
3313                 case "$CPPFLAGS" in
3314                 *$cf_add_cflags) #(vi
3315                         ;;
3316                 *) #(vi
3317                         case $cf_add_cflags in #(vi
3318                         -D*)
3319                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3320
3321 CPPFLAGS=`echo "$CPPFLAGS" | \
3322         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3323                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3324
3325                                 ;;
3326                         esac
3327                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3328                         ;;
3329                 esac
3330                 ;;
3331         *)
3332                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3333                 ;;
3334         esac
3335         ;;
3336 yes)
3337         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3338
3339         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3340
3341         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3342                 && test -z "${cf_tst_cflags}" \
3343                 && cf_fix_cppflags=no
3344         ;;
3345 esac
3346 done
3347
3348 if test -n "$cf_new_cflags" ; then
3349
3350         CFLAGS="$CFLAGS $cf_new_cflags"
3351 fi
3352
3353 if test -n "$cf_new_cppflags" ; then
3354
3355         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3356 fi
3357
3358 if test -n "$cf_new_extra_cppflags" ; then
3359
3360         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3361 fi
3362
3363 fi
3364
3365 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3366
3367 cf_save_CFLAGS="$CFLAGS"
3368 cf_save_CPPFLAGS="$CPPFLAGS"
3369
3370 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3371         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3372                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3373
3374 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3375         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3376                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3377
3378 echo "$as_me:3378: checking if we should define _POSIX_C_SOURCE" >&5
3379 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3380 if test "${cf_cv_posix_c_source+set}" = set; then
3381   echo $ECHO_N "(cached) $ECHO_C" >&6
3382 else
3383
3384 echo "${as_me:-configure}:3384: testing if the symbol is already defined go no further ..." 1>&5
3385
3386         cat >conftest.$ac_ext <<_ACEOF
3387 #line 3387 "configure"
3388 #include "confdefs.h"
3389 #include <sys/types.h>
3390 int
3391 main ()
3392 {
3393
3394 #ifndef _POSIX_C_SOURCE
3395 make an error
3396 #endif
3397   ;
3398   return 0;
3399 }
3400 _ACEOF
3401 rm -f conftest.$ac_objext
3402 if { (eval echo "$as_me:3402: \"$ac_compile\"") >&5
3403   (eval $ac_compile) 2>&5
3404   ac_status=$?
3405   echo "$as_me:3405: \$? = $ac_status" >&5
3406   (exit $ac_status); } &&
3407          { ac_try='test -s conftest.$ac_objext'
3408   { (eval echo "$as_me:3408: \"$ac_try\"") >&5
3409   (eval $ac_try) 2>&5
3410   ac_status=$?
3411   echo "$as_me:3411: \$? = $ac_status" >&5
3412   (exit $ac_status); }; }; then
3413   cf_cv_posix_c_source=no
3414 else
3415   echo "$as_me: failed program was:" >&5
3416 cat conftest.$ac_ext >&5
3417 cf_want_posix_source=no
3418          case .$cf_POSIX_C_SOURCE in #(vi
3419          .[12]??*) #(vi
3420                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3421                 ;;
3422          .2) #(vi
3423                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3424                 cf_want_posix_source=yes
3425                 ;;
3426          .*)
3427                 cf_want_posix_source=yes
3428                 ;;
3429          esac
3430          if test "$cf_want_posix_source" = yes ; then
3431                 cat >conftest.$ac_ext <<_ACEOF
3432 #line 3432 "configure"
3433 #include "confdefs.h"
3434 #include <sys/types.h>
3435 int
3436 main ()
3437 {
3438
3439 #ifdef _POSIX_SOURCE
3440 make an error
3441 #endif
3442   ;
3443   return 0;
3444 }
3445 _ACEOF
3446 rm -f conftest.$ac_objext
3447 if { (eval echo "$as_me:3447: \"$ac_compile\"") >&5
3448   (eval $ac_compile) 2>&5
3449   ac_status=$?
3450   echo "$as_me:3450: \$? = $ac_status" >&5
3451   (exit $ac_status); } &&
3452          { ac_try='test -s conftest.$ac_objext'
3453   { (eval echo "$as_me:3453: \"$ac_try\"") >&5
3454   (eval $ac_try) 2>&5
3455   ac_status=$?
3456   echo "$as_me:3456: \$? = $ac_status" >&5
3457   (exit $ac_status); }; }; then
3458   :
3459 else
3460   echo "$as_me: failed program was:" >&5
3461 cat conftest.$ac_ext >&5
3462 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3463 fi
3464 rm -f conftest.$ac_objext conftest.$ac_ext
3465          fi
3466
3467 echo "${as_me:-configure}:3467: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3468
3469          CFLAGS="$cf_trim_CFLAGS"
3470          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3471
3472 echo "${as_me:-configure}:3472: testing if the second compile does not leave our definition intact error ..." 1>&5
3473
3474          cat >conftest.$ac_ext <<_ACEOF
3475 #line 3475 "configure"
3476 #include "confdefs.h"
3477 #include <sys/types.h>
3478 int
3479 main ()
3480 {
3481
3482 #ifndef _POSIX_C_SOURCE
3483 make an error
3484 #endif
3485   ;
3486   return 0;
3487 }
3488 _ACEOF
3489 rm -f conftest.$ac_objext
3490 if { (eval echo "$as_me:3490: \"$ac_compile\"") >&5
3491   (eval $ac_compile) 2>&5
3492   ac_status=$?
3493   echo "$as_me:3493: \$? = $ac_status" >&5
3494   (exit $ac_status); } &&
3495          { ac_try='test -s conftest.$ac_objext'
3496   { (eval echo "$as_me:3496: \"$ac_try\"") >&5
3497   (eval $ac_try) 2>&5
3498   ac_status=$?
3499   echo "$as_me:3499: \$? = $ac_status" >&5
3500   (exit $ac_status); }; }; then
3501   :
3502 else
3503   echo "$as_me: failed program was:" >&5
3504 cat conftest.$ac_ext >&5
3505 cf_cv_posix_c_source=no
3506 fi
3507 rm -f conftest.$ac_objext conftest.$ac_ext
3508          CFLAGS="$cf_save_CFLAGS"
3509          CPPFLAGS="$cf_save_CPPFLAGS"
3510
3511 fi
3512 rm -f conftest.$ac_objext conftest.$ac_ext
3513
3514 fi
3515 echo "$as_me:3515: result: $cf_cv_posix_c_source" >&5
3516 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3517
3518 if test "$cf_cv_posix_c_source" != no ; then
3519         CFLAGS="$cf_trim_CFLAGS"
3520         CPPFLAGS="$cf_trim_CPPFLAGS"
3521
3522 cf_fix_cppflags=no
3523 cf_new_cflags=
3524 cf_new_cppflags=
3525 cf_new_extra_cppflags=
3526
3527 for cf_add_cflags in $cf_cv_posix_c_source
3528 do
3529 case $cf_fix_cppflags in
3530 no)
3531         case $cf_add_cflags in #(vi
3532         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3533                 case $cf_add_cflags in
3534                 -D*)
3535                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3536
3537                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3538                                 && test -z "${cf_tst_cflags}" \
3539                                 && cf_fix_cppflags=yes
3540
3541                         if test $cf_fix_cppflags = yes ; then
3542                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3543                                 continue
3544                         elif test "${cf_tst_cflags}" = "\"'" ; then
3545                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3546                                 continue
3547                         fi
3548                         ;;
3549                 esac
3550                 case "$CPPFLAGS" in
3551                 *$cf_add_cflags) #(vi
3552                         ;;
3553                 *) #(vi
3554                         case $cf_add_cflags in #(vi
3555                         -D*)
3556                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3557
3558 CPPFLAGS=`echo "$CPPFLAGS" | \
3559         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3560                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3561
3562                                 ;;
3563                         esac
3564                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3565                         ;;
3566                 esac
3567                 ;;
3568         *)
3569                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3570                 ;;
3571         esac
3572         ;;
3573 yes)
3574         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3575
3576         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3577
3578         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3579                 && test -z "${cf_tst_cflags}" \
3580                 && cf_fix_cppflags=no
3581         ;;
3582 esac
3583 done
3584
3585 if test -n "$cf_new_cflags" ; then
3586
3587         CFLAGS="$CFLAGS $cf_new_cflags"
3588 fi
3589
3590 if test -n "$cf_new_cppflags" ; then
3591
3592         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3593 fi
3594
3595 if test -n "$cf_new_extra_cppflags" ; then
3596
3597         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3598 fi
3599
3600 fi
3601
3602         ;;
3603 esac
3604
3605 if test -n "$cf_xopen_source" ; then
3606
3607 cf_fix_cppflags=no
3608 cf_new_cflags=
3609 cf_new_cppflags=
3610 cf_new_extra_cppflags=
3611
3612 for cf_add_cflags in $cf_xopen_source
3613 do
3614 case $cf_fix_cppflags in
3615 no)
3616         case $cf_add_cflags in #(vi
3617         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3618                 case $cf_add_cflags in
3619                 -D*)
3620                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3621
3622                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3623                                 && test -z "${cf_tst_cflags}" \
3624                                 && cf_fix_cppflags=yes
3625
3626                         if test $cf_fix_cppflags = yes ; then
3627                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3628                                 continue
3629                         elif test "${cf_tst_cflags}" = "\"'" ; then
3630                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3631                                 continue
3632                         fi
3633                         ;;
3634                 esac
3635                 case "$CPPFLAGS" in
3636                 *$cf_add_cflags) #(vi
3637                         ;;
3638                 *) #(vi
3639                         case $cf_add_cflags in #(vi
3640                         -D*)
3641                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3642
3643 CPPFLAGS=`echo "$CPPFLAGS" | \
3644         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3645                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3646
3647                                 ;;
3648                         esac
3649                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3650                         ;;
3651                 esac
3652                 ;;
3653         *)
3654                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3655                 ;;
3656         esac
3657         ;;
3658 yes)
3659         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3660
3661         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3662
3663         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3664                 && test -z "${cf_tst_cflags}" \
3665                 && cf_fix_cppflags=no
3666         ;;
3667 esac
3668 done
3669
3670 if test -n "$cf_new_cflags" ; then
3671
3672         CFLAGS="$CFLAGS $cf_new_cflags"
3673 fi
3674
3675 if test -n "$cf_new_cppflags" ; then
3676
3677         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3678 fi
3679
3680 if test -n "$cf_new_extra_cppflags" ; then
3681
3682         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3683 fi
3684
3685 fi
3686
3687 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3688         echo "$as_me:3688: checking if _XOPEN_SOURCE really is set" >&5
3689 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3690         cat >conftest.$ac_ext <<_ACEOF
3691 #line 3691 "configure"
3692 #include "confdefs.h"
3693 #include <stdlib.h>
3694 int
3695 main ()
3696 {
3697
3698 #ifndef _XOPEN_SOURCE
3699 make an error
3700 #endif
3701   ;
3702   return 0;
3703 }
3704 _ACEOF
3705 rm -f conftest.$ac_objext
3706 if { (eval echo "$as_me:3706: \"$ac_compile\"") >&5
3707   (eval $ac_compile) 2>&5
3708   ac_status=$?
3709   echo "$as_me:3709: \$? = $ac_status" >&5
3710   (exit $ac_status); } &&
3711          { ac_try='test -s conftest.$ac_objext'
3712   { (eval echo "$as_me:3712: \"$ac_try\"") >&5
3713   (eval $ac_try) 2>&5
3714   ac_status=$?
3715   echo "$as_me:3715: \$? = $ac_status" >&5
3716   (exit $ac_status); }; }; then
3717   cf_XOPEN_SOURCE_set=yes
3718 else
3719   echo "$as_me: failed program was:" >&5
3720 cat conftest.$ac_ext >&5
3721 cf_XOPEN_SOURCE_set=no
3722 fi
3723 rm -f conftest.$ac_objext conftest.$ac_ext
3724         echo "$as_me:3724: result: $cf_XOPEN_SOURCE_set" >&5
3725 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3726         if test $cf_XOPEN_SOURCE_set = yes
3727         then
3728                 cat >conftest.$ac_ext <<_ACEOF
3729 #line 3729 "configure"
3730 #include "confdefs.h"
3731 #include <stdlib.h>
3732 int
3733 main ()
3734 {
3735
3736 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3737 make an error
3738 #endif
3739   ;
3740   return 0;
3741 }
3742 _ACEOF
3743 rm -f conftest.$ac_objext
3744 if { (eval echo "$as_me:3744: \"$ac_compile\"") >&5
3745   (eval $ac_compile) 2>&5
3746   ac_status=$?
3747   echo "$as_me:3747: \$? = $ac_status" >&5
3748   (exit $ac_status); } &&
3749          { ac_try='test -s conftest.$ac_objext'
3750   { (eval echo "$as_me:3750: \"$ac_try\"") >&5
3751   (eval $ac_try) 2>&5
3752   ac_status=$?
3753   echo "$as_me:3753: \$? = $ac_status" >&5
3754   (exit $ac_status); }; }; then
3755   cf_XOPEN_SOURCE_set_ok=yes
3756 else
3757   echo "$as_me: failed program was:" >&5
3758 cat conftest.$ac_ext >&5
3759 cf_XOPEN_SOURCE_set_ok=no
3760 fi
3761 rm -f conftest.$ac_objext conftest.$ac_ext
3762                 if test $cf_XOPEN_SOURCE_set_ok = no
3763                 then
3764                         { echo "$as_me:3764: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3765 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3766                 fi
3767         else
3768
3769 echo "$as_me:3769: checking if we should define _XOPEN_SOURCE" >&5
3770 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3771 if test "${cf_cv_xopen_source+set}" = set; then
3772   echo $ECHO_N "(cached) $ECHO_C" >&6
3773 else
3774
3775         cat >conftest.$ac_ext <<_ACEOF
3776 #line 3776 "configure"
3777 #include "confdefs.h"
3778
3779 #include <stdlib.h>
3780 #include <string.h>
3781 #include <sys/types.h>
3782
3783 int
3784 main ()
3785 {
3786
3787 #ifndef _XOPEN_SOURCE
3788 make an error
3789 #endif
3790   ;
3791   return 0;
3792 }
3793 _ACEOF
3794 rm -f conftest.$ac_objext
3795 if { (eval echo "$as_me:3795: \"$ac_compile\"") >&5
3796   (eval $ac_compile) 2>&5
3797   ac_status=$?
3798   echo "$as_me:3798: \$? = $ac_status" >&5
3799   (exit $ac_status); } &&
3800          { ac_try='test -s conftest.$ac_objext'
3801   { (eval echo "$as_me:3801: \"$ac_try\"") >&5
3802   (eval $ac_try) 2>&5
3803   ac_status=$?
3804   echo "$as_me:3804: \$? = $ac_status" >&5
3805   (exit $ac_status); }; }; then
3806   cf_cv_xopen_source=no
3807 else
3808   echo "$as_me: failed program was:" >&5
3809 cat conftest.$ac_ext >&5
3810 cf_save="$CPPFLAGS"
3811          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3812          cat >conftest.$ac_ext <<_ACEOF
3813 #line 3813 "configure"
3814 #include "confdefs.h"
3815
3816 #include <stdlib.h>
3817 #include <string.h>
3818 #include <sys/types.h>
3819
3820 int
3821 main ()
3822 {
3823
3824 #ifdef _XOPEN_SOURCE
3825 make an error
3826 #endif
3827   ;
3828   return 0;
3829 }
3830 _ACEOF
3831 rm -f conftest.$ac_objext
3832 if { (eval echo "$as_me:3832: \"$ac_compile\"") >&5
3833   (eval $ac_compile) 2>&5
3834   ac_status=$?
3835   echo "$as_me:3835: \$? = $ac_status" >&5
3836   (exit $ac_status); } &&
3837          { ac_try='test -s conftest.$ac_objext'
3838   { (eval echo "$as_me:3838: \"$ac_try\"") >&5
3839   (eval $ac_try) 2>&5
3840   ac_status=$?
3841   echo "$as_me:3841: \$? = $ac_status" >&5
3842   (exit $ac_status); }; }; then
3843   cf_cv_xopen_source=no
3844 else
3845   echo "$as_me: failed program was:" >&5
3846 cat conftest.$ac_ext >&5
3847 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3848 fi
3849 rm -f conftest.$ac_objext conftest.$ac_ext
3850         CPPFLAGS="$cf_save"
3851
3852 fi
3853 rm -f conftest.$ac_objext conftest.$ac_ext
3854
3855 fi
3856 echo "$as_me:3856: result: $cf_cv_xopen_source" >&5
3857 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3858
3859 if test "$cf_cv_xopen_source" != no ; then
3860
3861 CFLAGS=`echo "$CFLAGS" | \
3862         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3863                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3864
3865 CPPFLAGS=`echo "$CPPFLAGS" | \
3866         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3867                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3868
3869         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3870
3871 cf_fix_cppflags=no
3872 cf_new_cflags=
3873 cf_new_cppflags=
3874 cf_new_extra_cppflags=
3875
3876 for cf_add_cflags in $cf_temp_xopen_source
3877 do
3878 case $cf_fix_cppflags in
3879 no)
3880         case $cf_add_cflags in #(vi
3881         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3882                 case $cf_add_cflags in
3883                 -D*)
3884                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3885
3886                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3887                                 && test -z "${cf_tst_cflags}" \
3888                                 && cf_fix_cppflags=yes
3889
3890                         if test $cf_fix_cppflags = yes ; then
3891                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3892                                 continue
3893                         elif test "${cf_tst_cflags}" = "\"'" ; then
3894                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3895                                 continue
3896                         fi
3897                         ;;
3898                 esac
3899                 case "$CPPFLAGS" in
3900                 *$cf_add_cflags) #(vi
3901                         ;;
3902                 *) #(vi
3903                         case $cf_add_cflags in #(vi
3904                         -D*)
3905                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3906
3907 CPPFLAGS=`echo "$CPPFLAGS" | \
3908         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3909                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3910
3911                                 ;;
3912                         esac
3913                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3914                         ;;
3915                 esac
3916                 ;;
3917         *)
3918                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3919                 ;;
3920         esac
3921         ;;
3922 yes)
3923         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3924
3925         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3926
3927         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3928                 && test -z "${cf_tst_cflags}" \
3929                 && cf_fix_cppflags=no
3930         ;;
3931 esac
3932 done
3933
3934 if test -n "$cf_new_cflags" ; then
3935
3936         CFLAGS="$CFLAGS $cf_new_cflags"
3937 fi
3938
3939 if test -n "$cf_new_cppflags" ; then
3940
3941         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3942 fi
3943
3944 if test -n "$cf_new_extra_cppflags" ; then
3945
3946         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3947 fi
3948
3949 fi
3950
3951         fi
3952 fi
3953
3954 echo "$as_me:3954: checking for signal global datatype" >&5
3955 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
3956 if test "${cf_cv_sig_atomic_t+set}" = set; then
3957   echo $ECHO_N "(cached) $ECHO_C" >&6
3958 else
3959
3960         for cf_type in \
3961                 "volatile sig_atomic_t" \
3962                 "sig_atomic_t" \
3963                 "int"
3964         do
3965         cat >conftest.$ac_ext <<_ACEOF
3966 #line 3966 "configure"
3967 #include "confdefs.h"
3968
3969 #include <sys/types.h>
3970 #include <signal.h>
3971 #include <stdio.h>
3972
3973 extern $cf_type x;
3974 $cf_type x;
3975 static void handler(int sig)
3976 {
3977         x = 5;
3978 }
3979 int
3980 main ()
3981 {
3982 signal(SIGINT, handler);
3983                  x = 1
3984   ;
3985   return 0;
3986 }
3987 _ACEOF
3988 rm -f conftest.$ac_objext
3989 if { (eval echo "$as_me:3989: \"$ac_compile\"") >&5
3990   (eval $ac_compile) 2>&5
3991   ac_status=$?
3992   echo "$as_me:3992: \$? = $ac_status" >&5
3993   (exit $ac_status); } &&
3994          { ac_try='test -s conftest.$ac_objext'
3995   { (eval echo "$as_me:3995: \"$ac_try\"") >&5
3996   (eval $ac_try) 2>&5
3997   ac_status=$?
3998   echo "$as_me:3998: \$? = $ac_status" >&5
3999   (exit $ac_status); }; }; then
4000   cf_cv_sig_atomic_t=$cf_type
4001 else
4002   echo "$as_me: failed program was:" >&5
4003 cat conftest.$ac_ext >&5
4004 cf_cv_sig_atomic_t=no
4005 fi
4006 rm -f conftest.$ac_objext conftest.$ac_ext
4007                 test "$cf_cv_sig_atomic_t" != no && break
4008         done
4009
4010 fi
4011
4012 echo "$as_me:4012: result: $cf_cv_sig_atomic_t" >&5
4013 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4014 test "$cf_cv_sig_atomic_t" != no &&
4015 cat >>confdefs.h <<EOF
4016 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4017 EOF
4018
4019 echo "$as_me:4019: checking if you want to use pkg-config" >&5
4020 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4021
4022 # Check whether --with-pkg-config or --without-pkg-config was given.
4023 if test "${with_pkg_config+set}" = set; then
4024   withval="$with_pkg_config"
4025   cf_pkg_config=$withval
4026 else
4027   cf_pkg_config=yes
4028 fi;
4029 echo "$as_me:4029: result: $cf_pkg_config" >&5
4030 echo "${ECHO_T}$cf_pkg_config" >&6
4031
4032 case $cf_pkg_config in #(vi
4033 no) #(vi
4034         PKG_CONFIG=none
4035         ;;
4036 yes) #(vi
4037
4038 if test -n "$ac_tool_prefix"; then
4039   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4040 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4041 echo "$as_me:4041: checking for $ac_word" >&5
4042 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4043 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4044   echo $ECHO_N "(cached) $ECHO_C" >&6
4045 else
4046   case $PKG_CONFIG in
4047   [\\/]* | ?:[\\/]*)
4048   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4049   ;;
4050   *)
4051   ac_save_IFS=$IFS; IFS=$ac_path_separator
4052 ac_dummy="$PATH"
4053 for ac_dir in $ac_dummy; do
4054   IFS=$ac_save_IFS
4055   test -z "$ac_dir" && ac_dir=.
4056   if $as_executable_p "$ac_dir/$ac_word"; then
4057    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4058    echo "$as_me:4058: found $ac_dir/$ac_word" >&5
4059    break
4060 fi
4061 done
4062
4063   ;;
4064 esac
4065 fi
4066 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4067
4068 if test -n "$PKG_CONFIG"; then
4069   echo "$as_me:4069: result: $PKG_CONFIG" >&5
4070 echo "${ECHO_T}$PKG_CONFIG" >&6
4071 else
4072   echo "$as_me:4072: result: no" >&5
4073 echo "${ECHO_T}no" >&6
4074 fi
4075
4076 fi
4077 if test -z "$ac_cv_path_PKG_CONFIG"; then
4078   ac_pt_PKG_CONFIG=$PKG_CONFIG
4079   # Extract the first word of "pkg-config", so it can be a program name with args.
4080 set dummy pkg-config; ac_word=$2
4081 echo "$as_me:4081: checking for $ac_word" >&5
4082 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4083 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4084   echo $ECHO_N "(cached) $ECHO_C" >&6
4085 else
4086   case $ac_pt_PKG_CONFIG in
4087   [\\/]* | ?:[\\/]*)
4088   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4089   ;;
4090   *)
4091   ac_save_IFS=$IFS; IFS=$ac_path_separator
4092 ac_dummy="$PATH"
4093 for ac_dir in $ac_dummy; do
4094   IFS=$ac_save_IFS
4095   test -z "$ac_dir" && ac_dir=.
4096   if $as_executable_p "$ac_dir/$ac_word"; then
4097    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4098    echo "$as_me:4098: found $ac_dir/$ac_word" >&5
4099    break
4100 fi
4101 done
4102
4103   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4104   ;;
4105 esac
4106 fi
4107 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4108
4109 if test -n "$ac_pt_PKG_CONFIG"; then
4110   echo "$as_me:4110: result: $ac_pt_PKG_CONFIG" >&5
4111 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4112 else
4113   echo "$as_me:4113: result: no" >&5
4114 echo "${ECHO_T}no" >&6
4115 fi
4116
4117   PKG_CONFIG=$ac_pt_PKG_CONFIG
4118 else
4119   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4120 fi
4121
4122         ;;
4123 *)
4124         PKG_CONFIG=$withval
4125         ;;
4126 esac
4127
4128 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4129 if test "$PKG_CONFIG" != none ; then
4130
4131 if test "x$prefix" != xNONE; then
4132   cf_path_syntax="$prefix"
4133 else
4134   cf_path_syntax="$ac_default_prefix"
4135 fi
4136
4137 case ".$PKG_CONFIG" in #(vi
4138 .\$\(*\)*|.\'*\'*) #(vi
4139   ;;
4140 ..|./*|.\\*) #(vi
4141   ;;
4142 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
4143   ;;
4144 .\${*prefix}*|.\${*dir}*) #(vi
4145   eval PKG_CONFIG="$PKG_CONFIG"
4146   case ".$PKG_CONFIG" in #(vi
4147   .NONE/*)
4148     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4149     ;;
4150   esac
4151   ;; #(vi
4152 .no|.NONE/*)
4153   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4154   ;;
4155 *)
4156   { { echo "$as_me:4156: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4157 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4158    { (exit 1); exit 1; }; }
4159   ;;
4160 esac
4161
4162 fi
4163
4164 echo "$as_me:4164: checking if you want to see long compiling messages" >&5
4165 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4166
4167 # Check whether --enable-echo or --disable-echo was given.
4168 if test "${enable_echo+set}" = set; then
4169   enableval="$enable_echo"
4170   test "$enableval" != no && enableval=yes
4171   if test "$enableval" != "yes" ; then
4172
4173     ECHO_LT='--silent'
4174     ECHO_LD='@echo linking $@;'
4175     RULE_CC='@echo compiling $<'
4176     SHOW_CC='@echo compiling $@'
4177     ECHO_CC='@'
4178
4179   else
4180
4181     ECHO_LT=''
4182     ECHO_LD=''
4183     RULE_CC=''
4184     SHOW_CC=''
4185     ECHO_CC=''
4186
4187   fi
4188 else
4189   enableval=yes
4190
4191     ECHO_LT=''
4192     ECHO_LD=''
4193     RULE_CC=''
4194     SHOW_CC=''
4195     ECHO_CC=''
4196
4197 fi;
4198 echo "$as_me:4198: result: $enableval" >&5
4199 echo "${ECHO_T}$enableval" >&6
4200
4201 echo "$as_me:4201: checking for ncurses wrap-prefix" >&5
4202 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4203
4204 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4205 if test "${with_ncurses_wrap_prefix+set}" = set; then
4206   withval="$with_ncurses_wrap_prefix"
4207   NCURSES_WRAP_PREFIX=$withval
4208 else
4209   NCURSES_WRAP_PREFIX=_nc_
4210 fi;
4211 echo "$as_me:4211: result: $NCURSES_WRAP_PREFIX" >&5
4212 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4213
4214 echo "$as_me:4214: checking if you want to check for wide-character functions" >&5
4215 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4216
4217 # Check whether --enable-widec or --disable-widec was given.
4218 if test "${enable_widec+set}" = set; then
4219   enableval="$enable_widec"
4220   test "$enableval" != no && enableval=yes
4221   if test "$enableval" != "yes" ; then
4222     cf_enable_widec=no
4223   else
4224     cf_enable_widec=yes
4225   fi
4226 else
4227   enableval=yes
4228   cf_enable_widec=yes
4229
4230 fi;
4231 echo "$as_me:4231: result: $cf_enable_widec" >&5
4232 echo "${ECHO_T}$cf_enable_widec" >&6
4233
4234 echo "$as_me:4234: checking for specific curses-directory" >&5
4235 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4236
4237 # Check whether --with-curses-dir or --without-curses-dir was given.
4238 if test "${with_curses_dir+set}" = set; then
4239   withval="$with_curses_dir"
4240   cf_cv_curses_dir=$withval
4241 else
4242   cf_cv_curses_dir=no
4243 fi;
4244 echo "$as_me:4244: result: $cf_cv_curses_dir" >&5
4245 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4246
4247 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4248 then
4249
4250 if test "x$prefix" != xNONE; then
4251   cf_path_syntax="$prefix"
4252 else
4253   cf_path_syntax="$ac_default_prefix"
4254 fi
4255
4256 case ".$withval" in #(vi
4257 .\$\(*\)*|.\'*\'*) #(vi
4258   ;;
4259 ..|./*|.\\*) #(vi
4260   ;;
4261 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
4262   ;;
4263 .\${*prefix}*|.\${*dir}*) #(vi
4264   eval withval="$withval"
4265   case ".$withval" in #(vi
4266   .NONE/*)
4267     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4268     ;;
4269   esac
4270   ;; #(vi
4271 .no|.NONE/*)
4272   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4273   ;;
4274 *)
4275   { { echo "$as_me:4275: error: expected a pathname, not \"$withval\"" >&5
4276 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4277    { (exit 1); exit 1; }; }
4278   ;;
4279 esac
4280
4281         if test -d "$cf_cv_curses_dir"
4282         then
4283
4284 if test -n "$cf_cv_curses_dir/include" ; then
4285   for cf_add_incdir in $cf_cv_curses_dir/include
4286   do
4287         while test $cf_add_incdir != /usr/include
4288         do
4289           if test -d $cf_add_incdir
4290           then
4291                 cf_have_incdir=no
4292                 if test -n "$CFLAGS$CPPFLAGS" ; then
4293                   # a loop is needed to ensure we can add subdirs of existing dirs
4294                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4295                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4296                           cf_have_incdir=yes; break
4297                         fi
4298                   done
4299                 fi
4300
4301                 if test "$cf_have_incdir" = no ; then
4302                   if test "$cf_add_incdir" = /usr/local/include ; then
4303                         if test "$GCC" = yes
4304                         then
4305                           cf_save_CPPFLAGS=$CPPFLAGS
4306                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4307                           cat >conftest.$ac_ext <<_ACEOF
4308 #line 4308 "configure"
4309 #include "confdefs.h"
4310 #include <stdio.h>
4311 int
4312 main ()
4313 {
4314 printf("Hello")
4315   ;
4316   return 0;
4317 }
4318 _ACEOF
4319 rm -f conftest.$ac_objext
4320 if { (eval echo "$as_me:4320: \"$ac_compile\"") >&5
4321   (eval $ac_compile) 2>&5
4322   ac_status=$?
4323   echo "$as_me:4323: \$? = $ac_status" >&5
4324   (exit $ac_status); } &&
4325          { ac_try='test -s conftest.$ac_objext'
4326   { (eval echo "$as_me:4326: \"$ac_try\"") >&5
4327   (eval $ac_try) 2>&5
4328   ac_status=$?
4329   echo "$as_me:4329: \$? = $ac_status" >&5
4330   (exit $ac_status); }; }; then
4331   :
4332 else
4333   echo "$as_me: failed program was:" >&5
4334 cat conftest.$ac_ext >&5
4335 cf_have_incdir=yes
4336 fi
4337 rm -f conftest.$ac_objext conftest.$ac_ext
4338                           CPPFLAGS=$cf_save_CPPFLAGS
4339                         fi
4340                   fi
4341                 fi
4342
4343                 if test "$cf_have_incdir" = no ; then
4344                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4345
4346 echo "${as_me:-configure}:4346: testing adding $cf_add_incdir to include-path ..." 1>&5
4347
4348                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4349
4350                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4351                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4352                   cf_add_incdir="$cf_top_incdir"
4353                 else
4354                   break
4355                 fi
4356           fi
4357         done
4358   done
4359 fi
4360
4361 if test -n "$cf_cv_curses_dir/lib" ; then
4362   for cf_add_libdir in $cf_cv_curses_dir/lib
4363   do
4364     if test $cf_add_libdir = /usr/lib ; then
4365       :
4366     elif test -d $cf_add_libdir
4367     then
4368       cf_have_libdir=no
4369       if test -n "$LDFLAGS$LIBS" ; then
4370         # a loop is needed to ensure we can add subdirs of existing dirs
4371         for cf_test_libdir in $LDFLAGS $LIBS ; do
4372           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4373             cf_have_libdir=yes; break
4374           fi
4375         done
4376       fi
4377       if test "$cf_have_libdir" = no ; then
4378         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4379
4380 echo "${as_me:-configure}:4380: testing adding $cf_add_libdir to library-path ..." 1>&5
4381
4382         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4383       fi
4384     fi
4385   done
4386 fi
4387
4388         fi
4389 fi
4390
4391 cf_cv_screen=curses
4392
4393 echo "$as_me:4393: checking for specified curses library type" >&5
4394 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4395
4396 # Check whether --with-ncursesw or --without-ncursesw was given.
4397 if test "${with_ncursesw+set}" = set; then
4398   withval="$with_ncursesw"
4399   cf_cv_screen=ncursesw
4400 else
4401
4402 # Check whether --with-ncurses or --without-ncurses was given.
4403 if test "${with_ncurses+set}" = set; then
4404   withval="$with_ncurses"
4405   cf_cv_screen=ncurses
4406 else
4407
4408 # Check whether --with-pdcurses or --without-pdcurses was given.
4409 if test "${with_pdcurses+set}" = set; then
4410   withval="$with_pdcurses"
4411   cf_cv_screen=pdcurses
4412 else
4413
4414 # Check whether --with-curses-colr or --without-curses-colr was given.
4415 if test "${with_curses_colr+set}" = set; then
4416   withval="$with_curses_colr"
4417   cf_cv_screen=curses_colr
4418 else
4419
4420 # Check whether --with-curses-5lib or --without-curses-5lib was given.
4421 if test "${with_curses_5lib+set}" = set; then
4422   withval="$with_curses_5lib"
4423   cf_cv_screen=curses_5lib
4424 fi;
4425 fi;
4426 fi;
4427 fi;
4428 fi;
4429
4430 echo "$as_me:4430: result: $cf_cv_screen" >&5
4431 echo "${ECHO_T}$cf_cv_screen" >&6
4432
4433 case $cf_cv_screen in #(vi
4434 curses|curses_*) #(vi
4435
4436 echo "$as_me:4436: checking for extra include directories" >&5
4437 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4438 if test "${cf_cv_curses_incdir+set}" = set; then
4439   echo $ECHO_N "(cached) $ECHO_C" >&6
4440 else
4441
4442 cf_cv_curses_incdir=no
4443 case $host_os in #(vi
4444 hpux10.*) #(vi
4445         if test "x$cf_cv_screen" = "xcurses_colr"
4446         then
4447                 test -d /usr/include/curses_colr && \
4448                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
4449         fi
4450         ;;
4451 sunos3*|sunos4*)
4452         if test "x$cf_cv_screen" = "xcurses_5lib"
4453         then
4454                 test -d /usr/5lib && \
4455                 test -d /usr/5include && \
4456                 cf_cv_curses_incdir="-I/usr/5include"
4457         fi
4458         ;;
4459 esac
4460
4461 fi
4462 echo "$as_me:4462: result: $cf_cv_curses_incdir" >&5
4463 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4464 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4465
4466 echo "$as_me:4466: checking if we have identified curses headers" >&5
4467 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4468 if test "${cf_cv_ncurses_header+set}" = set; then
4469   echo $ECHO_N "(cached) $ECHO_C" >&6
4470 else
4471
4472 cf_cv_ncurses_header=none
4473 for cf_header in  \
4474         ncurses.h \
4475         curses.h ncurses/ncurses.h ncurses/curses.h
4476 do
4477 cat >conftest.$ac_ext <<_ACEOF
4478 #line 4478 "configure"
4479 #include "confdefs.h"
4480 #include <${cf_header}>
4481 int
4482 main ()
4483 {
4484 initscr(); tgoto("?", 0,0)
4485   ;
4486   return 0;
4487 }
4488 _ACEOF
4489 rm -f conftest.$ac_objext
4490 if { (eval echo "$as_me:4490: \"$ac_compile\"") >&5
4491   (eval $ac_compile) 2>&5
4492   ac_status=$?
4493   echo "$as_me:4493: \$? = $ac_status" >&5
4494   (exit $ac_status); } &&
4495          { ac_try='test -s conftest.$ac_objext'
4496   { (eval echo "$as_me:4496: \"$ac_try\"") >&5
4497   (eval $ac_try) 2>&5
4498   ac_status=$?
4499   echo "$as_me:4499: \$? = $ac_status" >&5
4500   (exit $ac_status); }; }; then
4501   cf_cv_ncurses_header=$cf_header; break
4502 else
4503   echo "$as_me: failed program was:" >&5
4504 cat conftest.$ac_ext >&5
4505 fi
4506 rm -f conftest.$ac_objext conftest.$ac_ext
4507 done
4508
4509 fi
4510 echo "$as_me:4510: result: $cf_cv_ncurses_header" >&5
4511 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4512
4513 if test "$cf_cv_ncurses_header" = none ; then
4514         { { echo "$as_me:4514: error: No curses header-files found" >&5
4515 echo "$as_me: error: No curses header-files found" >&2;}
4516    { (exit 1); exit 1; }; }
4517 fi
4518
4519 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4520
4521 for ac_header in $cf_cv_ncurses_header
4522 do
4523 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4524 echo "$as_me:4524: checking for $ac_header" >&5
4525 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4526 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4527   echo $ECHO_N "(cached) $ECHO_C" >&6
4528 else
4529   cat >conftest.$ac_ext <<_ACEOF
4530 #line 4530 "configure"
4531 #include "confdefs.h"
4532 #include <$ac_header>
4533 _ACEOF
4534 if { (eval echo "$as_me:4534: \"$ac_cpp conftest.$ac_ext\"") >&5
4535   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4536   ac_status=$?
4537   egrep -v '^ *\+' conftest.er1 >conftest.err
4538   rm -f conftest.er1
4539   cat conftest.err >&5
4540   echo "$as_me:4540: \$? = $ac_status" >&5
4541   (exit $ac_status); } >/dev/null; then
4542   if test -s conftest.err; then
4543     ac_cpp_err=$ac_c_preproc_warn_flag
4544   else
4545     ac_cpp_err=
4546   fi
4547 else
4548   ac_cpp_err=yes
4549 fi
4550 if test -z "$ac_cpp_err"; then
4551   eval "$as_ac_Header=yes"
4552 else
4553   echo "$as_me: failed program was:" >&5
4554   cat conftest.$ac_ext >&5
4555   eval "$as_ac_Header=no"
4556 fi
4557 rm -f conftest.err conftest.$ac_ext
4558 fi
4559 echo "$as_me:4559: result: `eval echo '${'$as_ac_Header'}'`" >&5
4560 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4561 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4562   cat >>confdefs.h <<EOF
4563 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4564 EOF
4565
4566 fi
4567 done
4568
4569 echo "$as_me:4569: checking for terminfo header" >&5
4570 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4571 if test "${cf_cv_term_header+set}" = set; then
4572   echo $ECHO_N "(cached) $ECHO_C" >&6
4573 else
4574
4575 case ${cf_cv_ncurses_header} in #(vi
4576 */ncurses.h|*/ncursesw.h) #(vi
4577         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4578         ;;
4579 *)
4580         cf_term_header=term.h
4581         ;;
4582 esac
4583
4584 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4585 do
4586 cat >conftest.$ac_ext <<_ACEOF
4587 #line 4587 "configure"
4588 #include "confdefs.h"
4589 #include <stdio.h>
4590 #include <${cf_cv_ncurses_header:-curses.h}>
4591 #include <$cf_test>
4592
4593 int
4594 main ()
4595 {
4596 int x = auto_left_margin
4597   ;
4598   return 0;
4599 }
4600 _ACEOF
4601 rm -f conftest.$ac_objext
4602 if { (eval echo "$as_me:4602: \"$ac_compile\"") >&5
4603   (eval $ac_compile) 2>&5
4604   ac_status=$?
4605   echo "$as_me:4605: \$? = $ac_status" >&5
4606   (exit $ac_status); } &&
4607          { ac_try='test -s conftest.$ac_objext'
4608   { (eval echo "$as_me:4608: \"$ac_try\"") >&5
4609   (eval $ac_try) 2>&5
4610   ac_status=$?
4611   echo "$as_me:4611: \$? = $ac_status" >&5
4612   (exit $ac_status); }; }; then
4613
4614         cf_cv_term_header="$cf_test"
4615 else
4616   echo "$as_me: failed program was:" >&5
4617 cat conftest.$ac_ext >&5
4618
4619         cf_cv_term_header=unknown
4620
4621 fi
4622 rm -f conftest.$ac_objext conftest.$ac_ext
4623         test "$cf_cv_term_header" != unknown && break
4624 done
4625
4626 fi
4627 echo "$as_me:4627: result: $cf_cv_term_header" >&5
4628 echo "${ECHO_T}$cf_cv_term_header" >&6
4629
4630 # Set definitions to allow ifdef'ing to accommodate subdirectories
4631
4632 case $cf_cv_term_header in # (vi
4633 *term.h)
4634
4635 cat >>confdefs.h <<\EOF
4636 #define HAVE_TERM_H 1
4637 EOF
4638
4639         ;;
4640 esac
4641
4642 case $cf_cv_term_header in # (vi
4643 ncurses/term.h) #(vi
4644
4645 cat >>confdefs.h <<\EOF
4646 #define HAVE_NCURSES_TERM_H 1
4647 EOF
4648
4649         ;;
4650 ncursesw/term.h)
4651
4652 cat >>confdefs.h <<\EOF
4653 #define HAVE_NCURSESW_TERM_H 1
4654 EOF
4655
4656         ;;
4657 esac
4658
4659 echo "$as_me:4659: checking for ncurses version" >&5
4660 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4661 if test "${cf_cv_ncurses_version+set}" = set; then
4662   echo $ECHO_N "(cached) $ECHO_C" >&6
4663 else
4664
4665         cf_cv_ncurses_version=no
4666         cf_tempfile=out$$
4667         rm -f $cf_tempfile
4668         if test "$cross_compiling" = yes; then
4669
4670         # This will not work if the preprocessor splits the line after the
4671         # Autoconf token.  The 'unproto' program does that.
4672         cat > conftest.$ac_ext <<EOF
4673 #include <${cf_cv_ncurses_header:-curses.h}>
4674 #undef Autoconf
4675 #ifdef NCURSES_VERSION
4676 Autoconf NCURSES_VERSION
4677 #else
4678 #ifdef __NCURSES_H
4679 Autoconf "old"
4680 #endif
4681 ;
4682 #endif
4683 EOF
4684         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4685         { (eval echo "$as_me:4685: \"$cf_try\"") >&5
4686   (eval $cf_try) 2>&5
4687   ac_status=$?
4688   echo "$as_me:4688: \$? = $ac_status" >&5
4689   (exit $ac_status); }
4690         if test -f conftest.out ; then
4691                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4692                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4693                 rm -f conftest.out
4694         fi
4695
4696 else
4697   cat >conftest.$ac_ext <<_ACEOF
4698 #line 4698 "configure"
4699 #include "confdefs.h"
4700
4701 #include <${cf_cv_ncurses_header:-curses.h}>
4702 #include <stdio.h>
4703 int main()
4704 {
4705         FILE *fp = fopen("$cf_tempfile", "w");
4706 #ifdef NCURSES_VERSION
4707 # ifdef NCURSES_VERSION_PATCH
4708         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4709 # else
4710         fprintf(fp, "%s\n", NCURSES_VERSION);
4711 # endif
4712 #else
4713 # ifdef __NCURSES_H
4714         fprintf(fp, "old\n");
4715 # else
4716         make an error
4717 # endif
4718 #endif
4719         ${cf_cv_main_return:-return}(0);
4720 }
4721 _ACEOF
4722 rm -f conftest$ac_exeext
4723 if { (eval echo "$as_me:4723: \"$ac_link\"") >&5
4724   (eval $ac_link) 2>&5
4725   ac_status=$?
4726   echo "$as_me:4726: \$? = $ac_status" >&5
4727   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4728   { (eval echo "$as_me:4728: \"$ac_try\"") >&5
4729   (eval $ac_try) 2>&5
4730   ac_status=$?
4731   echo "$as_me:4731: \$? = $ac_status" >&5
4732   (exit $ac_status); }; }; then
4733
4734         cf_cv_ncurses_version=`cat $cf_tempfile`
4735 else
4736   echo "$as_me: program exited with status $ac_status" >&5
4737 echo "$as_me: failed program was:" >&5
4738 cat conftest.$ac_ext >&5
4739 fi
4740 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4741 fi
4742         rm -f $cf_tempfile
4743
4744 fi
4745 echo "$as_me:4745: result: $cf_cv_ncurses_version" >&5
4746 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4747 test "$cf_cv_ncurses_version" = no ||
4748 cat >>confdefs.h <<\EOF
4749 #define NCURSES 1
4750 EOF
4751
4752 echo "$as_me:4752: checking if we have identified curses libraries" >&5
4753 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
4754 cat >conftest.$ac_ext <<_ACEOF
4755 #line 4755 "configure"
4756 #include "confdefs.h"
4757 #include <${cf_cv_ncurses_header:-curses.h}>
4758 int
4759 main ()
4760 {
4761 initscr(); tgoto("?", 0,0)
4762   ;
4763   return 0;
4764 }
4765 _ACEOF
4766 rm -f conftest.$ac_objext conftest$ac_exeext
4767 if { (eval echo "$as_me:4767: \"$ac_link\"") >&5
4768   (eval $ac_link) 2>&5
4769   ac_status=$?
4770   echo "$as_me:4770: \$? = $ac_status" >&5
4771   (exit $ac_status); } &&
4772          { ac_try='test -s conftest$ac_exeext'
4773   { (eval echo "$as_me:4773: \"$ac_try\"") >&5
4774   (eval $ac_try) 2>&5
4775   ac_status=$?
4776   echo "$as_me:4776: \$? = $ac_status" >&5
4777   (exit $ac_status); }; }; then
4778   cf_result=yes
4779 else
4780   echo "$as_me: failed program was:" >&5
4781 cat conftest.$ac_ext >&5
4782 cf_result=no
4783 fi
4784 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4785 echo "$as_me:4785: result: $cf_result" >&5
4786 echo "${ECHO_T}$cf_result" >&6
4787
4788 if test "$cf_result" = no ; then
4789 case $host_os in #(vi
4790 freebsd*) #(vi
4791     echo "$as_me:4791: checking for tgoto in -lmytinfo" >&5
4792 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4793 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4794   echo $ECHO_N "(cached) $ECHO_C" >&6
4795 else
4796   ac_check_lib_save_LIBS=$LIBS
4797 LIBS="-lmytinfo  $LIBS"
4798 cat >conftest.$ac_ext <<_ACEOF
4799 #line 4799 "configure"
4800 #include "confdefs.h"
4801
4802 /* Override any gcc2 internal prototype to avoid an error.  */
4803 #ifdef __cplusplus
4804 extern "C"
4805 #endif
4806 /* We use char because int might match the return type of a gcc2
4807    builtin and then its argument prototype would still apply.  */
4808 char tgoto ();
4809 int
4810 main ()
4811 {
4812 tgoto ();
4813   ;
4814   return 0;
4815 }
4816 _ACEOF
4817 rm -f conftest.$ac_objext conftest$ac_exeext
4818 if { (eval echo "$as_me:4818: \"$ac_link\"") >&5
4819   (eval $ac_link) 2>&5
4820   ac_status=$?
4821   echo "$as_me:4821: \$? = $ac_status" >&5
4822   (exit $ac_status); } &&
4823          { ac_try='test -s conftest$ac_exeext'
4824   { (eval echo "$as_me:4824: \"$ac_try\"") >&5
4825   (eval $ac_try) 2>&5
4826   ac_status=$?
4827   echo "$as_me:4827: \$? = $ac_status" >&5
4828   (exit $ac_status); }; }; then
4829   ac_cv_lib_mytinfo_tgoto=yes
4830 else
4831   echo "$as_me: failed program was:" >&5
4832 cat conftest.$ac_ext >&5
4833 ac_cv_lib_mytinfo_tgoto=no
4834 fi
4835 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4836 LIBS=$ac_check_lib_save_LIBS
4837 fi
4838 echo "$as_me:4838: result: $ac_cv_lib_mytinfo_tgoto" >&5
4839 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4840 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4841   LIBS="-lmytinfo $LIBS"
4842 fi
4843
4844     ;;
4845 hpux10.*) #(vi
4846         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
4847         # next (1998), and xcurses "newer" (2000).  There is no header file for
4848         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
4849         # term.h) for cur_colr
4850         if test "x$cf_cv_screen" = "xcurses_colr"
4851         then
4852                 echo "$as_me:4852: checking for initscr in -lcur_colr" >&5
4853 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
4854 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
4855   echo $ECHO_N "(cached) $ECHO_C" >&6
4856 else
4857   ac_check_lib_save_LIBS=$LIBS
4858 LIBS="-lcur_colr  $LIBS"
4859 cat >conftest.$ac_ext <<_ACEOF
4860 #line 4860 "configure"
4861 #include "confdefs.h"
4862
4863 /* Override any gcc2 internal prototype to avoid an error.  */
4864 #ifdef __cplusplus
4865 extern "C"
4866 #endif
4867 /* We use char because int might match the return type of a gcc2
4868    builtin and then its argument prototype would still apply.  */
4869 char initscr ();
4870 int
4871 main ()
4872 {
4873 initscr ();
4874   ;
4875   return 0;
4876 }
4877 _ACEOF
4878 rm -f conftest.$ac_objext conftest$ac_exeext
4879 if { (eval echo "$as_me:4879: \"$ac_link\"") >&5
4880   (eval $ac_link) 2>&5
4881   ac_status=$?
4882   echo "$as_me:4882: \$? = $ac_status" >&5
4883   (exit $ac_status); } &&
4884          { ac_try='test -s conftest$ac_exeext'
4885   { (eval echo "$as_me:4885: \"$ac_try\"") >&5
4886   (eval $ac_try) 2>&5
4887   ac_status=$?
4888   echo "$as_me:4888: \$? = $ac_status" >&5
4889   (exit $ac_status); }; }; then
4890   ac_cv_lib_cur_colr_initscr=yes
4891 else
4892   echo "$as_me: failed program was:" >&5
4893 cat conftest.$ac_ext >&5
4894 ac_cv_lib_cur_colr_initscr=no
4895 fi
4896 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4897 LIBS=$ac_check_lib_save_LIBS
4898 fi
4899 echo "$as_me:4899: result: $ac_cv_lib_cur_colr_initscr" >&5
4900 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
4901 if test $ac_cv_lib_cur_colr_initscr = yes; then
4902
4903                         LIBS="-lcur_colr $LIBS"
4904                         ac_cv_func_initscr=yes
4905
4906 else
4907
4908                 echo "$as_me:4908: checking for initscr in -lHcurses" >&5
4909 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
4910 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
4911   echo $ECHO_N "(cached) $ECHO_C" >&6
4912 else
4913   ac_check_lib_save_LIBS=$LIBS
4914 LIBS="-lHcurses  $LIBS"
4915 cat >conftest.$ac_ext <<_ACEOF
4916 #line 4916 "configure"
4917 #include "confdefs.h"
4918
4919 /* Override any gcc2 internal prototype to avoid an error.  */
4920 #ifdef __cplusplus
4921 extern "C"
4922 #endif
4923 /* We use char because int might match the return type of a gcc2
4924    builtin and then its argument prototype would still apply.  */
4925 char initscr ();
4926 int
4927 main ()
4928 {
4929 initscr ();
4930   ;
4931   return 0;
4932 }
4933 _ACEOF
4934 rm -f conftest.$ac_objext conftest$ac_exeext
4935 if { (eval echo "$as_me:4935: \"$ac_link\"") >&5
4936   (eval $ac_link) 2>&5
4937   ac_status=$?
4938   echo "$as_me:4938: \$? = $ac_status" >&5
4939   (exit $ac_status); } &&
4940          { ac_try='test -s conftest$ac_exeext'
4941   { (eval echo "$as_me:4941: \"$ac_try\"") >&5
4942   (eval $ac_try) 2>&5
4943   ac_status=$?
4944   echo "$as_me:4944: \$? = $ac_status" >&5
4945   (exit $ac_status); }; }; then
4946   ac_cv_lib_Hcurses_initscr=yes
4947 else
4948   echo "$as_me: failed program was:" >&5
4949 cat conftest.$ac_ext >&5
4950 ac_cv_lib_Hcurses_initscr=no
4951 fi
4952 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4953 LIBS=$ac_check_lib_save_LIBS
4954 fi
4955 echo "$as_me:4955: result: $ac_cv_lib_Hcurses_initscr" >&5
4956 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
4957 if test $ac_cv_lib_Hcurses_initscr = yes; then
4958
4959                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
4960                         LIBS="-lHcurses $LIBS"
4961                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
4962                         ac_cv_func_initscr=yes
4963
4964 fi
4965
4966 fi
4967
4968         fi
4969         ;;
4970 linux*)
4971         case `arch 2>/dev/null` in
4972         x86_64)
4973                 if test -d /lib64
4974                 then
4975
4976 if test -n "/lib64" ; then
4977   for cf_add_libdir in /lib64
4978   do
4979     if test $cf_add_libdir = /usr/lib ; then
4980       :
4981     elif test -d $cf_add_libdir
4982     then
4983       cf_have_libdir=no
4984       if test -n "$LDFLAGS$LIBS" ; then
4985         # a loop is needed to ensure we can add subdirs of existing dirs
4986         for cf_test_libdir in $LDFLAGS $LIBS ; do
4987           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4988             cf_have_libdir=yes; break
4989           fi
4990         done
4991       fi
4992       if test "$cf_have_libdir" = no ; then
4993         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4994
4995 echo "${as_me:-configure}:4995: testing adding $cf_add_libdir to library-path ..." 1>&5
4996
4997         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4998       fi
4999     fi
5000   done
5001 fi
5002
5003                 else
5004
5005 if test -n "/lib" ; then
5006   for cf_add_libdir in /lib
5007   do
5008     if test $cf_add_libdir = /usr/lib ; then
5009       :
5010     elif test -d $cf_add_libdir
5011     then
5012       cf_have_libdir=no
5013       if test -n "$LDFLAGS$LIBS" ; then
5014         # a loop is needed to ensure we can add subdirs of existing dirs
5015         for cf_test_libdir in $LDFLAGS $LIBS ; do
5016           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5017             cf_have_libdir=yes; break
5018           fi
5019         done
5020       fi
5021       if test "$cf_have_libdir" = no ; then
5022         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5023
5024 echo "${as_me:-configure}:5024: testing adding $cf_add_libdir to library-path ..." 1>&5
5025
5026         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5027       fi
5028     fi
5029   done
5030 fi
5031
5032                 fi
5033                 ;;
5034         *)
5035
5036 if test -n "/lib" ; then
5037   for cf_add_libdir in /lib
5038   do
5039     if test $cf_add_libdir = /usr/lib ; then
5040       :
5041     elif test -d $cf_add_libdir
5042     then
5043       cf_have_libdir=no
5044       if test -n "$LDFLAGS$LIBS" ; then
5045         # a loop is needed to ensure we can add subdirs of existing dirs
5046         for cf_test_libdir in $LDFLAGS $LIBS ; do
5047           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5048             cf_have_libdir=yes; break
5049           fi
5050         done
5051       fi
5052       if test "$cf_have_libdir" = no ; then
5053         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5054
5055 echo "${as_me:-configure}:5055: testing adding $cf_add_libdir to library-path ..." 1>&5
5056
5057         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5058       fi
5059     fi
5060   done
5061 fi
5062
5063                 ;;
5064         esac
5065         ;;
5066 sunos3*|sunos4*)
5067         if test "x$cf_cv_screen" = "xcurses_5lib"
5068         then
5069                 if test -d /usr/5lib ; then
5070
5071 if test -n "/usr/5lib" ; then
5072   for cf_add_libdir in /usr/5lib
5073   do
5074     if test $cf_add_libdir = /usr/lib ; then
5075       :
5076     elif test -d $cf_add_libdir
5077     then
5078       cf_have_libdir=no
5079       if test -n "$LDFLAGS$LIBS" ; then
5080         # a loop is needed to ensure we can add subdirs of existing dirs
5081         for cf_test_libdir in $LDFLAGS $LIBS ; do
5082           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5083             cf_have_libdir=yes; break
5084           fi
5085         done
5086       fi
5087       if test "$cf_have_libdir" = no ; then
5088         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5089
5090 echo "${as_me:-configure}:5090: testing adding $cf_add_libdir to library-path ..." 1>&5
5091
5092         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5093       fi
5094     fi
5095   done
5096 fi
5097
5098                         LIBS="-lcurses -ltermcap $LIBS"
5099                 fi
5100     fi
5101     ac_cv_func_initscr=yes
5102     ;;
5103 esac
5104
5105 if test ".$ac_cv_func_initscr" != .yes ; then
5106         cf_save_LIBS="$LIBS"
5107
5108         if test ".${cf_cv_ncurses_version:-no}" != .no
5109         then
5110                 cf_check_list="ncurses curses cursesX"
5111         else
5112                 cf_check_list="cursesX curses ncurses"
5113         fi
5114
5115         # Check for library containing tgoto.  Do this before curses library
5116         # because it may be needed to link the test-case for initscr.
5117         if test "x$cf_term_lib" = x
5118         then
5119                 echo "$as_me:5119: checking for tgoto" >&5
5120 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5121 if test "${ac_cv_func_tgoto+set}" = set; then
5122   echo $ECHO_N "(cached) $ECHO_C" >&6
5123 else
5124   cat >conftest.$ac_ext <<_ACEOF
5125 #line 5125 "configure"
5126 #include "confdefs.h"
5127 /* System header to define __stub macros and hopefully few prototypes,
5128     which can conflict with char tgoto (); below.  */
5129 #include <assert.h>
5130 /* Override any gcc2 internal prototype to avoid an error.  */
5131 #ifdef __cplusplus
5132 extern "C"
5133 #endif
5134 /* We use char because int might match the return type of a gcc2
5135    builtin and then its argument prototype would still apply.  */
5136 char tgoto ();
5137 char (*f) ();
5138
5139 int
5140 main ()
5141 {
5142 /* The GNU C library defines this for functions which it implements
5143     to always fail with ENOSYS.  Some functions are actually named
5144     something starting with __ and the normal name is an alias.  */
5145 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5146 choke me
5147 #else
5148 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5149 #endif
5150
5151   ;
5152   return 0;
5153 }
5154 _ACEOF
5155 rm -f conftest.$ac_objext conftest$ac_exeext
5156 if { (eval echo "$as_me:5156: \"$ac_link\"") >&5
5157   (eval $ac_link) 2>&5
5158   ac_status=$?
5159   echo "$as_me:5159: \$? = $ac_status" >&5
5160   (exit $ac_status); } &&
5161          { ac_try='test -s conftest$ac_exeext'
5162   { (eval echo "$as_me:5162: \"$ac_try\"") >&5
5163   (eval $ac_try) 2>&5
5164   ac_status=$?
5165   echo "$as_me:5165: \$? = $ac_status" >&5
5166   (exit $ac_status); }; }; then
5167   ac_cv_func_tgoto=yes
5168 else
5169   echo "$as_me: failed program was:" >&5
5170 cat conftest.$ac_ext >&5
5171 ac_cv_func_tgoto=no
5172 fi
5173 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5174 fi
5175 echo "$as_me:5175: result: $ac_cv_func_tgoto" >&5
5176 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5177 if test $ac_cv_func_tgoto = yes; then
5178   cf_term_lib=predefined
5179 else
5180
5181                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5182                         do
5183                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5184 echo "$as_me:5184: checking for tgoto in -l$cf_term_lib" >&5
5185 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5186 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5187   echo $ECHO_N "(cached) $ECHO_C" >&6
5188 else
5189   ac_check_lib_save_LIBS=$LIBS
5190 LIBS="-l$cf_term_lib  $LIBS"
5191 cat >conftest.$ac_ext <<_ACEOF
5192 #line 5192 "configure"
5193 #include "confdefs.h"
5194
5195 /* Override any gcc2 internal prototype to avoid an error.  */
5196 #ifdef __cplusplus
5197 extern "C"
5198 #endif
5199 /* We use char because int might match the return type of a gcc2
5200    builtin and then its argument prototype would still apply.  */
5201 char tgoto ();
5202 int
5203 main ()
5204 {
5205 tgoto ();
5206   ;
5207   return 0;
5208 }
5209 _ACEOF
5210 rm -f conftest.$ac_objext conftest$ac_exeext
5211 if { (eval echo "$as_me:5211: \"$ac_link\"") >&5
5212   (eval $ac_link) 2>&5
5213   ac_status=$?
5214   echo "$as_me:5214: \$? = $ac_status" >&5
5215   (exit $ac_status); } &&
5216          { ac_try='test -s conftest$ac_exeext'
5217   { (eval echo "$as_me:5217: \"$ac_try\"") >&5
5218   (eval $ac_try) 2>&5
5219   ac_status=$?
5220   echo "$as_me:5220: \$? = $ac_status" >&5
5221   (exit $ac_status); }; }; then
5222   eval "$as_ac_Lib=yes"
5223 else
5224   echo "$as_me: failed program was:" >&5
5225 cat conftest.$ac_ext >&5
5226 eval "$as_ac_Lib=no"
5227 fi
5228 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5229 LIBS=$ac_check_lib_save_LIBS
5230 fi
5231 echo "$as_me:5231: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5232 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5233 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5234   break
5235 fi
5236
5237                         done
5238
5239 fi
5240
5241         fi
5242
5243         # Check for library containing initscr
5244         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5245         if test "x$cf_curs_lib" = x
5246         then
5247                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5248                 do
5249                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5250 echo "$as_me:5250: checking for initscr in -l$cf_curs_lib" >&5
5251 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5252 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5253   echo $ECHO_N "(cached) $ECHO_C" >&6
5254 else
5255   ac_check_lib_save_LIBS=$LIBS
5256 LIBS="-l$cf_curs_lib  $LIBS"
5257 cat >conftest.$ac_ext <<_ACEOF
5258 #line 5258 "configure"
5259 #include "confdefs.h"
5260
5261 /* Override any gcc2 internal prototype to avoid an error.  */
5262 #ifdef __cplusplus
5263 extern "C"
5264 #endif
5265 /* We use char because int might match the return type of a gcc2
5266    builtin and then its argument prototype would still apply.  */
5267 char initscr ();
5268 int
5269 main ()
5270 {
5271 initscr ();
5272   ;
5273   return 0;
5274 }
5275 _ACEOF
5276 rm -f conftest.$ac_objext conftest$ac_exeext
5277 if { (eval echo "$as_me:5277: \"$ac_link\"") >&5
5278   (eval $ac_link) 2>&5
5279   ac_status=$?
5280   echo "$as_me:5280: \$? = $ac_status" >&5
5281   (exit $ac_status); } &&
5282          { ac_try='test -s conftest$ac_exeext'
5283   { (eval echo "$as_me:5283: \"$ac_try\"") >&5
5284   (eval $ac_try) 2>&5
5285   ac_status=$?
5286   echo "$as_me:5286: \$? = $ac_status" >&5
5287   (exit $ac_status); }; }; then
5288   eval "$as_ac_Lib=yes"
5289 else
5290   echo "$as_me: failed program was:" >&5
5291 cat conftest.$ac_ext >&5
5292 eval "$as_ac_Lib=no"
5293 fi
5294 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5295 LIBS=$ac_check_lib_save_LIBS
5296 fi
5297 echo "$as_me:5297: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5298 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5299 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5300   break
5301 fi
5302
5303                 done
5304         fi
5305         test $cf_curs_lib = unknown && { { echo "$as_me:5305: error: no curses library found" >&5
5306 echo "$as_me: error: no curses library found" >&2;}
5307    { (exit 1); exit 1; }; }
5308
5309         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5310         if test "$cf_term_lib" = unknown ; then
5311                 echo "$as_me:5311: checking if we can link with $cf_curs_lib library" >&5
5312 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5313                 cat >conftest.$ac_ext <<_ACEOF
5314 #line 5314 "configure"
5315 #include "confdefs.h"
5316 #include <${cf_cv_ncurses_header:-curses.h}>
5317 int
5318 main ()
5319 {
5320 initscr()
5321   ;
5322   return 0;
5323 }
5324 _ACEOF
5325 rm -f conftest.$ac_objext conftest$ac_exeext
5326 if { (eval echo "$as_me:5326: \"$ac_link\"") >&5
5327   (eval $ac_link) 2>&5
5328   ac_status=$?
5329   echo "$as_me:5329: \$? = $ac_status" >&5
5330   (exit $ac_status); } &&
5331          { ac_try='test -s conftest$ac_exeext'
5332   { (eval echo "$as_me:5332: \"$ac_try\"") >&5
5333   (eval $ac_try) 2>&5
5334   ac_status=$?
5335   echo "$as_me:5335: \$? = $ac_status" >&5
5336   (exit $ac_status); }; }; then
5337   cf_result=yes
5338 else
5339   echo "$as_me: failed program was:" >&5
5340 cat conftest.$ac_ext >&5
5341 cf_result=no
5342 fi
5343 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5344                 echo "$as_me:5344: result: $cf_result" >&5
5345 echo "${ECHO_T}$cf_result" >&6
5346                 test $cf_result = no && { { echo "$as_me:5346: error: Cannot link curses library" >&5
5347 echo "$as_me: error: Cannot link curses library" >&2;}
5348    { (exit 1); exit 1; }; }
5349         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5350                 :
5351         elif test "$cf_term_lib" != predefined ; then
5352                 echo "$as_me:5352: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5353 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5354                 cat >conftest.$ac_ext <<_ACEOF
5355 #line 5355 "configure"
5356 #include "confdefs.h"
5357 #include <${cf_cv_ncurses_header:-curses.h}>
5358 int
5359 main ()
5360 {
5361 initscr(); tgoto((char *)0, 0, 0);
5362   ;
5363   return 0;
5364 }
5365 _ACEOF
5366 rm -f conftest.$ac_objext conftest$ac_exeext
5367 if { (eval echo "$as_me:5367: \"$ac_link\"") >&5
5368   (eval $ac_link) 2>&5
5369   ac_status=$?
5370   echo "$as_me:5370: \$? = $ac_status" >&5
5371   (exit $ac_status); } &&
5372          { ac_try='test -s conftest$ac_exeext'
5373   { (eval echo "$as_me:5373: \"$ac_try\"") >&5
5374   (eval $ac_try) 2>&5
5375   ac_status=$?
5376   echo "$as_me:5376: \$? = $ac_status" >&5
5377   (exit $ac_status); }; }; then
5378   cf_result=no
5379 else
5380   echo "$as_me: failed program was:" >&5
5381 cat conftest.$ac_ext >&5
5382
5383                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5384                         cat >conftest.$ac_ext <<_ACEOF
5385 #line 5385 "configure"
5386 #include "confdefs.h"
5387 #include <${cf_cv_ncurses_header:-curses.h}>
5388 int
5389 main ()
5390 {
5391 initscr()
5392   ;
5393   return 0;
5394 }
5395 _ACEOF
5396 rm -f conftest.$ac_objext conftest$ac_exeext
5397 if { (eval echo "$as_me:5397: \"$ac_link\"") >&5
5398   (eval $ac_link) 2>&5
5399   ac_status=$?
5400   echo "$as_me:5400: \$? = $ac_status" >&5
5401   (exit $ac_status); } &&
5402          { ac_try='test -s conftest$ac_exeext'
5403   { (eval echo "$as_me:5403: \"$ac_try\"") >&5
5404   (eval $ac_try) 2>&5
5405   ac_status=$?
5406   echo "$as_me:5406: \$? = $ac_status" >&5
5407   (exit $ac_status); }; }; then
5408   cf_result=yes
5409 else
5410   echo "$as_me: failed program was:" >&5
5411 cat conftest.$ac_ext >&5
5412 cf_result=error
5413 fi
5414 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5415
5416 fi
5417 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5418                 echo "$as_me:5418: result: $cf_result" >&5
5419 echo "${ECHO_T}$cf_result" >&6
5420         fi
5421 fi
5422 fi
5423
5424         ;;
5425 ncurses) #(vi
5426
5427 cf_ncuconfig_root=ncurses
5428
5429 echo "Looking for ${cf_ncuconfig_root}-config"
5430
5431 if test -n "$ac_tool_prefix"; then
5432   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5433   do
5434     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5435 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5436 echo "$as_me:5436: checking for $ac_word" >&5
5437 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5438 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5439   echo $ECHO_N "(cached) $ECHO_C" >&6
5440 else
5441   if test -n "$NCURSES_CONFIG"; then
5442   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5443 else
5444   ac_save_IFS=$IFS; IFS=$ac_path_separator
5445 ac_dummy="$PATH"
5446 for ac_dir in $ac_dummy; do
5447   IFS=$ac_save_IFS
5448   test -z "$ac_dir" && ac_dir=.
5449   $as_executable_p "$ac_dir/$ac_word" || continue
5450 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5451 echo "$as_me:5451: found $ac_dir/$ac_word" >&5
5452 break
5453 done
5454
5455 fi
5456 fi
5457 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5458 if test -n "$NCURSES_CONFIG"; then
5459   echo "$as_me:5459: result: $NCURSES_CONFIG" >&5
5460 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5461 else
5462   echo "$as_me:5462: result: no" >&5
5463 echo "${ECHO_T}no" >&6
5464 fi
5465
5466     test -n "$NCURSES_CONFIG" && break
5467   done
5468 fi
5469 if test -z "$NCURSES_CONFIG"; then
5470   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5471   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5472 do
5473   # Extract the first word of "$ac_prog", so it can be a program name with args.
5474 set dummy $ac_prog; ac_word=$2
5475 echo "$as_me:5475: checking for $ac_word" >&5
5476 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5477 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5478   echo $ECHO_N "(cached) $ECHO_C" >&6
5479 else
5480   if test -n "$ac_ct_NCURSES_CONFIG"; then
5481   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5482 else
5483   ac_save_IFS=$IFS; IFS=$ac_path_separator
5484 ac_dummy="$PATH"
5485 for ac_dir in $ac_dummy; do
5486   IFS=$ac_save_IFS
5487   test -z "$ac_dir" && ac_dir=.
5488   $as_executable_p "$ac_dir/$ac_word" || continue
5489 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5490 echo "$as_me:5490: found $ac_dir/$ac_word" >&5
5491 break
5492 done
5493
5494 fi
5495 fi
5496 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5497 if test -n "$ac_ct_NCURSES_CONFIG"; then
5498   echo "$as_me:5498: result: $ac_ct_NCURSES_CONFIG" >&5
5499 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5500 else
5501   echo "$as_me:5501: result: no" >&5
5502 echo "${ECHO_T}no" >&6
5503 fi
5504
5505   test -n "$ac_ct_NCURSES_CONFIG" && break
5506 done
5507 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5508
5509   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5510 fi
5511
5512 if test "$NCURSES_CONFIG" != none ; then
5513
5514 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5515 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
5516
5517 # even with config script, some packages use no-override for curses.h
5518
5519 echo "$as_me:5519: checking if we have identified curses headers" >&5
5520 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5521 if test "${cf_cv_ncurses_header+set}" = set; then
5522   echo $ECHO_N "(cached) $ECHO_C" >&6
5523 else
5524
5525 cf_cv_ncurses_header=none
5526 for cf_header in  \
5527     ncurses/ncurses.h \
5528         ncurses/curses.h \
5529         ncurses.h \
5530         curses.h
5531 do
5532 cat >conftest.$ac_ext <<_ACEOF
5533 #line 5533 "configure"
5534 #include "confdefs.h"
5535 #include <${cf_header}>
5536 int
5537 main ()
5538 {
5539 initscr(); tgoto("?", 0,0)
5540   ;
5541   return 0;
5542 }
5543 _ACEOF
5544 rm -f conftest.$ac_objext
5545 if { (eval echo "$as_me:5545: \"$ac_compile\"") >&5
5546   (eval $ac_compile) 2>&5
5547   ac_status=$?
5548   echo "$as_me:5548: \$? = $ac_status" >&5
5549   (exit $ac_status); } &&
5550          { ac_try='test -s conftest.$ac_objext'
5551   { (eval echo "$as_me:5551: \"$ac_try\"") >&5
5552   (eval $ac_try) 2>&5
5553   ac_status=$?
5554   echo "$as_me:5554: \$? = $ac_status" >&5
5555   (exit $ac_status); }; }; then
5556   cf_cv_ncurses_header=$cf_header; break
5557 else
5558   echo "$as_me: failed program was:" >&5
5559 cat conftest.$ac_ext >&5
5560 fi
5561 rm -f conftest.$ac_objext conftest.$ac_ext
5562 done
5563
5564 fi
5565 echo "$as_me:5565: result: $cf_cv_ncurses_header" >&5
5566 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5567
5568 if test "$cf_cv_ncurses_header" = none ; then
5569         { { echo "$as_me:5569: error: No curses header-files found" >&5
5570 echo "$as_me: error: No curses header-files found" >&2;}
5571    { (exit 1); exit 1; }; }
5572 fi
5573
5574 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5575
5576 for ac_header in $cf_cv_ncurses_header
5577 do
5578 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5579 echo "$as_me:5579: checking for $ac_header" >&5
5580 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5581 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5582   echo $ECHO_N "(cached) $ECHO_C" >&6
5583 else
5584   cat >conftest.$ac_ext <<_ACEOF
5585 #line 5585 "configure"
5586 #include "confdefs.h"
5587 #include <$ac_header>
5588 _ACEOF
5589 if { (eval echo "$as_me:5589: \"$ac_cpp conftest.$ac_ext\"") >&5
5590   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5591   ac_status=$?
5592   egrep -v '^ *\+' conftest.er1 >conftest.err
5593   rm -f conftest.er1
5594   cat conftest.err >&5
5595   echo "$as_me:5595: \$? = $ac_status" >&5
5596   (exit $ac_status); } >/dev/null; then
5597   if test -s conftest.err; then
5598     ac_cpp_err=$ac_c_preproc_warn_flag
5599   else
5600     ac_cpp_err=
5601   fi
5602 else
5603   ac_cpp_err=yes
5604 fi
5605 if test -z "$ac_cpp_err"; then
5606   eval "$as_ac_Header=yes"
5607 else
5608   echo "$as_me: failed program was:" >&5
5609   cat conftest.$ac_ext >&5
5610   eval "$as_ac_Header=no"
5611 fi
5612 rm -f conftest.err conftest.$ac_ext
5613 fi
5614 echo "$as_me:5614: result: `eval echo '${'$as_ac_Header'}'`" >&5
5615 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5616 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5617   cat >>confdefs.h <<EOF
5618 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5619 EOF
5620
5621 fi
5622 done
5623
5624 cat >>confdefs.h <<\EOF
5625 #define NCURSES 1
5626 EOF
5627
5628 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5629
5630 cat >>confdefs.h <<EOF
5631 #define $cf_nculib_ROOT 1
5632 EOF
5633
5634 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5635
5636 else
5637
5638 cf_ncuhdr_root=ncurses
5639
5640 test -n "$cf_cv_curses_dir" && \
5641 test "$cf_cv_curses_dir" != "no" && { \
5642
5643 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5644   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5645   do
5646         while test $cf_add_incdir != /usr/include
5647         do
5648           if test -d $cf_add_incdir
5649           then
5650                 cf_have_incdir=no
5651                 if test -n "$CFLAGS$CPPFLAGS" ; then
5652                   # a loop is needed to ensure we can add subdirs of existing dirs
5653                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5654                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5655                           cf_have_incdir=yes; break
5656                         fi
5657                   done
5658                 fi
5659
5660                 if test "$cf_have_incdir" = no ; then
5661                   if test "$cf_add_incdir" = /usr/local/include ; then
5662                         if test "$GCC" = yes
5663                         then
5664                           cf_save_CPPFLAGS=$CPPFLAGS
5665                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5666                           cat >conftest.$ac_ext <<_ACEOF
5667 #line 5667 "configure"
5668 #include "confdefs.h"
5669 #include <stdio.h>
5670 int
5671 main ()
5672 {
5673 printf("Hello")
5674   ;
5675   return 0;
5676 }
5677 _ACEOF
5678 rm -f conftest.$ac_objext
5679 if { (eval echo "$as_me:5679: \"$ac_compile\"") >&5
5680   (eval $ac_compile) 2>&5
5681   ac_status=$?
5682   echo "$as_me:5682: \$? = $ac_status" >&5
5683   (exit $ac_status); } &&
5684          { ac_try='test -s conftest.$ac_objext'
5685   { (eval echo "$as_me:5685: \"$ac_try\"") >&5
5686   (eval $ac_try) 2>&5
5687   ac_status=$?
5688   echo "$as_me:5688: \$? = $ac_status" >&5
5689   (exit $ac_status); }; }; then
5690   :
5691 else
5692   echo "$as_me: failed program was:" >&5
5693 cat conftest.$ac_ext >&5
5694 cf_have_incdir=yes
5695 fi
5696 rm -f conftest.$ac_objext conftest.$ac_ext
5697                           CPPFLAGS=$cf_save_CPPFLAGS
5698                         fi
5699                   fi
5700                 fi
5701
5702                 if test "$cf_have_incdir" = no ; then
5703                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5704
5705 echo "${as_me:-configure}:5705: testing adding $cf_add_incdir to include-path ..." 1>&5
5706
5707                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5708
5709                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5710                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5711                   cf_add_incdir="$cf_top_incdir"
5712                 else
5713                   break
5714                 fi
5715           fi
5716         done
5717   done
5718 fi
5719
5720 }
5721
5722 echo "$as_me:5722: checking for $cf_ncuhdr_root header in include-path" >&5
5723 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5724 if test "${cf_cv_ncurses_h+set}" = set; then
5725   echo $ECHO_N "(cached) $ECHO_C" >&6
5726 else
5727
5728         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5729         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5730         for cf_header in $cf_header_list
5731         do
5732
5733         cat >conftest.$ac_ext <<_ACEOF
5734 #line 5734 "configure"
5735 #include "confdefs.h"
5736
5737 #include <$cf_header>
5738 int
5739 main ()
5740 {
5741
5742 #ifdef NCURSES_VERSION
5743
5744 printf("%s\n", NCURSES_VERSION);
5745 #else
5746 #ifdef __NCURSES_H
5747 printf("old\n");
5748 #else
5749         make an error
5750 #endif
5751 #endif
5752
5753   ;
5754   return 0;
5755 }
5756 _ACEOF
5757 rm -f conftest.$ac_objext
5758 if { (eval echo "$as_me:5758: \"$ac_compile\"") >&5
5759   (eval $ac_compile) 2>&5
5760   ac_status=$?
5761   echo "$as_me:5761: \$? = $ac_status" >&5
5762   (exit $ac_status); } &&
5763          { ac_try='test -s conftest.$ac_objext'
5764   { (eval echo "$as_me:5764: \"$ac_try\"") >&5
5765   (eval $ac_try) 2>&5
5766   ac_status=$?
5767   echo "$as_me:5767: \$? = $ac_status" >&5
5768   (exit $ac_status); }; }; then
5769   cf_cv_ncurses_h=$cf_header
5770
5771 else
5772   echo "$as_me: failed program was:" >&5
5773 cat conftest.$ac_ext >&5
5774 cf_cv_ncurses_h=no
5775 fi
5776 rm -f conftest.$ac_objext conftest.$ac_ext
5777
5778                 test "$cf_cv_ncurses_h" != no && break
5779         done
5780
5781 fi
5782 echo "$as_me:5782: result: $cf_cv_ncurses_h" >&5
5783 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5784
5785 if test "$cf_cv_ncurses_h" != no ; then
5786         cf_cv_ncurses_header=$cf_cv_ncurses_h
5787 else
5788
5789 echo "$as_me:5789: checking for $cf_ncuhdr_root include-path" >&5
5790 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5791 if test "${cf_cv_ncurses_h2+set}" = set; then
5792   echo $ECHO_N "(cached) $ECHO_C" >&6
5793 else
5794
5795         test -n "$verbose" && echo
5796
5797 cf_search=
5798
5799 # collect the current set of include-directories from compiler flags
5800 cf_header_path_list=""
5801 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5802         for cf_header_path in $CPPFLAGS $CFLAGS
5803         do
5804                 case $cf_header_path in #(vi
5805                 -I*)
5806                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5807
5808 test "x$cf_header_path" != "xNONE" && \
5809 test -d "$cf_header_path" && \
5810  {
5811         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5812         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5813         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5814         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5815         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5816         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"
5817 }
5818
5819                         cf_header_path_list="$cf_header_path_list $cf_search"
5820                         ;;
5821                 esac
5822         done
5823 fi
5824
5825 # add the variations for the package we are looking for
5826
5827 cf_search=
5828
5829 test "x/usr" != "x$prefix" && \
5830 test -d "/usr" && \
5831 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
5832         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
5833         test -d /usr/include &&          cf_search="$cf_search /usr/include"
5834         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
5835         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
5836         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
5837         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5838 }
5839
5840 test "x$prefix" != "xNONE" && \
5841 test -d "$prefix" && \
5842  {
5843         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5844         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5845         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5846         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5847         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5848         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5849 }
5850
5851 test "x/usr/local" != "x$prefix" && \
5852 test -d "/usr/local" && \
5853 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
5854         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
5855         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
5856         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
5857         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
5858         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
5859         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5860 }
5861
5862 test "x/opt" != "x$prefix" && \
5863 test -d "/opt" && \
5864 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
5865         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
5866         test -d /opt/include &&          cf_search="$cf_search /opt/include"
5867         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
5868         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
5869         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
5870         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5871 }
5872
5873 test "x$HOME" != "x$prefix" && \
5874 test -d "$HOME" && \
5875 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
5876         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
5877         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
5878         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
5879         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
5880         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
5881         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5882 }
5883
5884 test "$includedir" != NONE && \
5885 test "$includedir" != "/usr/include" && \
5886 test -d "$includedir" && {
5887         test -d $includedir &&    cf_search="$cf_search $includedir"
5888         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5889 }
5890
5891 test "$oldincludedir" != NONE && \
5892 test "$oldincludedir" != "/usr/include" && \
5893 test -d "$oldincludedir" && {
5894         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5895         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5896 }
5897
5898 cf_search="$cf_search $cf_header_path_list"
5899
5900         test -n "$verbose" && echo search path $cf_search
5901         cf_save2_CPPFLAGS="$CPPFLAGS"
5902         for cf_incdir in $cf_search
5903         do
5904
5905 if test -n "$cf_incdir" ; then
5906   for cf_add_incdir in $cf_incdir
5907   do
5908         while test $cf_add_incdir != /usr/include
5909         do
5910           if test -d $cf_add_incdir
5911           then
5912                 cf_have_incdir=no
5913                 if test -n "$CFLAGS$CPPFLAGS" ; then
5914                   # a loop is needed to ensure we can add subdirs of existing dirs
5915                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5916                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5917                           cf_have_incdir=yes; break
5918                         fi
5919                   done
5920                 fi
5921
5922                 if test "$cf_have_incdir" = no ; then
5923                   if test "$cf_add_incdir" = /usr/local/include ; then
5924                         if test "$GCC" = yes
5925                         then
5926                           cf_save_CPPFLAGS=$CPPFLAGS
5927                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5928                           cat >conftest.$ac_ext <<_ACEOF
5929 #line 5929 "configure"
5930 #include "confdefs.h"
5931 #include <stdio.h>
5932 int
5933 main ()
5934 {
5935 printf("Hello")
5936   ;
5937   return 0;
5938 }
5939 _ACEOF
5940 rm -f conftest.$ac_objext
5941 if { (eval echo "$as_me:5941: \"$ac_compile\"") >&5
5942   (eval $ac_compile) 2>&5
5943   ac_status=$?
5944   echo "$as_me:5944: \$? = $ac_status" >&5
5945   (exit $ac_status); } &&
5946          { ac_try='test -s conftest.$ac_objext'
5947   { (eval echo "$as_me:5947: \"$ac_try\"") >&5
5948   (eval $ac_try) 2>&5
5949   ac_status=$?
5950   echo "$as_me:5950: \$? = $ac_status" >&5
5951   (exit $ac_status); }; }; then
5952   :
5953 else
5954   echo "$as_me: failed program was:" >&5
5955 cat conftest.$ac_ext >&5
5956 cf_have_incdir=yes
5957 fi
5958 rm -f conftest.$ac_objext conftest.$ac_ext
5959                           CPPFLAGS=$cf_save_CPPFLAGS
5960                         fi
5961                   fi
5962                 fi
5963
5964                 if test "$cf_have_incdir" = no ; then
5965                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5966
5967 echo "${as_me:-configure}:5967: testing adding $cf_add_incdir to include-path ..." 1>&5
5968
5969                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5970
5971                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5972                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5973                   cf_add_incdir="$cf_top_incdir"
5974                 else
5975                   break
5976                 fi
5977           fi
5978         done
5979   done
5980 fi
5981
5982                 for cf_header in \
5983                         ncurses.h \
5984                         curses.h
5985                 do
5986
5987         cat >conftest.$ac_ext <<_ACEOF
5988 #line 5988 "configure"
5989 #include "confdefs.h"
5990
5991 #include <$cf_header>
5992 int
5993 main ()
5994 {
5995
5996 #ifdef NCURSES_VERSION
5997
5998 printf("%s\n", NCURSES_VERSION);
5999 #else
6000 #ifdef __NCURSES_H
6001 printf("old\n");
6002 #else
6003         make an error
6004 #endif
6005 #endif
6006
6007   ;
6008   return 0;
6009 }
6010 _ACEOF
6011 rm -f conftest.$ac_objext
6012 if { (eval echo "$as_me:6012: \"$ac_compile\"") >&5
6013   (eval $ac_compile) 2>&5
6014   ac_status=$?
6015   echo "$as_me:6015: \$? = $ac_status" >&5
6016   (exit $ac_status); } &&
6017          { ac_try='test -s conftest.$ac_objext'
6018   { (eval echo "$as_me:6018: \"$ac_try\"") >&5
6019   (eval $ac_try) 2>&5
6020   ac_status=$?
6021   echo "$as_me:6021: \$? = $ac_status" >&5
6022   (exit $ac_status); }; }; then
6023   cf_cv_ncurses_h2=$cf_header
6024
6025 else
6026   echo "$as_me: failed program was:" >&5
6027 cat conftest.$ac_ext >&5
6028 cf_cv_ncurses_h2=no
6029 fi
6030 rm -f conftest.$ac_objext conftest.$ac_ext
6031
6032                         if test "$cf_cv_ncurses_h2" != no ; then
6033                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6034                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6035                                 break
6036                         fi
6037                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6038                 done
6039                 CPPFLAGS="$cf_save2_CPPFLAGS"
6040                 test "$cf_cv_ncurses_h2" != no && break
6041         done
6042         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6042: error: not found" >&5
6043 echo "$as_me: error: not found" >&2;}
6044    { (exit 1); exit 1; }; }
6045
6046 fi
6047 echo "$as_me:6047: result: $cf_cv_ncurses_h2" >&5
6048 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6049
6050         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6051         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6052         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6053                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6054         fi
6055
6056 if test -n "$cf_1st_incdir" ; then
6057   for cf_add_incdir in $cf_1st_incdir
6058   do
6059         while test $cf_add_incdir != /usr/include
6060         do
6061           if test -d $cf_add_incdir
6062           then
6063                 cf_have_incdir=no
6064                 if test -n "$CFLAGS$CPPFLAGS" ; then
6065                   # a loop is needed to ensure we can add subdirs of existing dirs
6066                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6067                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6068                           cf_have_incdir=yes; break
6069                         fi
6070                   done
6071                 fi
6072
6073                 if test "$cf_have_incdir" = no ; then
6074                   if test "$cf_add_incdir" = /usr/local/include ; then
6075                         if test "$GCC" = yes
6076                         then
6077                           cf_save_CPPFLAGS=$CPPFLAGS
6078                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6079                           cat >conftest.$ac_ext <<_ACEOF
6080 #line 6080 "configure"
6081 #include "confdefs.h"
6082 #include <stdio.h>
6083 int
6084 main ()
6085 {
6086 printf("Hello")
6087   ;
6088   return 0;
6089 }
6090 _ACEOF
6091 rm -f conftest.$ac_objext
6092 if { (eval echo "$as_me:6092: \"$ac_compile\"") >&5
6093   (eval $ac_compile) 2>&5
6094   ac_status=$?
6095   echo "$as_me:6095: \$? = $ac_status" >&5
6096   (exit $ac_status); } &&
6097          { ac_try='test -s conftest.$ac_objext'
6098   { (eval echo "$as_me:6098: \"$ac_try\"") >&5
6099   (eval $ac_try) 2>&5
6100   ac_status=$?
6101   echo "$as_me:6101: \$? = $ac_status" >&5
6102   (exit $ac_status); }; }; then
6103   :
6104 else
6105   echo "$as_me: failed program was:" >&5
6106 cat conftest.$ac_ext >&5
6107 cf_have_incdir=yes
6108 fi
6109 rm -f conftest.$ac_objext conftest.$ac_ext
6110                           CPPFLAGS=$cf_save_CPPFLAGS
6111                         fi
6112                   fi
6113                 fi
6114
6115                 if test "$cf_have_incdir" = no ; then
6116                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6117
6118 echo "${as_me:-configure}:6118: testing adding $cf_add_incdir to include-path ..." 1>&5
6119
6120                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6121
6122                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6123                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6124                   cf_add_incdir="$cf_top_incdir"
6125                 else
6126                   break
6127                 fi
6128           fi
6129         done
6130   done
6131 fi
6132
6133 fi
6134
6135 # Set definitions to allow ifdef'ing for ncurses.h
6136
6137 case $cf_cv_ncurses_header in # (vi
6138 *ncurses.h)
6139
6140 cat >>confdefs.h <<\EOF
6141 #define HAVE_NCURSES_H 1
6142 EOF
6143
6144         ;;
6145 esac
6146
6147 case $cf_cv_ncurses_header in # (vi
6148 ncurses/curses.h|ncurses/ncurses.h)
6149
6150 cat >>confdefs.h <<\EOF
6151 #define HAVE_NCURSES_NCURSES_H 1
6152 EOF
6153
6154         ;;
6155 ncursesw/curses.h|ncursesw/ncurses.h)
6156
6157 cat >>confdefs.h <<\EOF
6158 #define HAVE_NCURSESW_NCURSES_H 1
6159 EOF
6160
6161         ;;
6162 esac
6163
6164 echo "$as_me:6164: checking for terminfo header" >&5
6165 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6166 if test "${cf_cv_term_header+set}" = set; then
6167   echo $ECHO_N "(cached) $ECHO_C" >&6
6168 else
6169
6170 case ${cf_cv_ncurses_header} in #(vi
6171 */ncurses.h|*/ncursesw.h) #(vi
6172         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6173         ;;
6174 *)
6175         cf_term_header=term.h
6176         ;;
6177 esac
6178
6179 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6180 do
6181 cat >conftest.$ac_ext <<_ACEOF
6182 #line 6182 "configure"
6183 #include "confdefs.h"
6184 #include <stdio.h>
6185 #include <${cf_cv_ncurses_header:-curses.h}>
6186 #include <$cf_test>
6187
6188 int
6189 main ()
6190 {
6191 int x = auto_left_margin
6192   ;
6193   return 0;
6194 }
6195 _ACEOF
6196 rm -f conftest.$ac_objext
6197 if { (eval echo "$as_me:6197: \"$ac_compile\"") >&5
6198   (eval $ac_compile) 2>&5
6199   ac_status=$?
6200   echo "$as_me:6200: \$? = $ac_status" >&5
6201   (exit $ac_status); } &&
6202          { ac_try='test -s conftest.$ac_objext'
6203   { (eval echo "$as_me:6203: \"$ac_try\"") >&5
6204   (eval $ac_try) 2>&5
6205   ac_status=$?
6206   echo "$as_me:6206: \$? = $ac_status" >&5
6207   (exit $ac_status); }; }; then
6208
6209         cf_cv_term_header="$cf_test"
6210 else
6211   echo "$as_me: failed program was:" >&5
6212 cat conftest.$ac_ext >&5
6213
6214         cf_cv_term_header=unknown
6215
6216 fi
6217 rm -f conftest.$ac_objext conftest.$ac_ext
6218         test "$cf_cv_term_header" != unknown && break
6219 done
6220
6221 fi
6222 echo "$as_me:6222: result: $cf_cv_term_header" >&5
6223 echo "${ECHO_T}$cf_cv_term_header" >&6
6224
6225 # Set definitions to allow ifdef'ing to accommodate subdirectories
6226
6227 case $cf_cv_term_header in # (vi
6228 *term.h)
6229
6230 cat >>confdefs.h <<\EOF
6231 #define HAVE_TERM_H 1
6232 EOF
6233
6234         ;;
6235 esac
6236
6237 case $cf_cv_term_header in # (vi
6238 ncurses/term.h) #(vi
6239
6240 cat >>confdefs.h <<\EOF
6241 #define HAVE_NCURSES_TERM_H 1
6242 EOF
6243
6244         ;;
6245 ncursesw/term.h)
6246
6247 cat >>confdefs.h <<\EOF
6248 #define HAVE_NCURSESW_TERM_H 1
6249 EOF
6250
6251         ;;
6252 esac
6253
6254 # some applications need this, but should check for NCURSES_VERSION
6255
6256 cat >>confdefs.h <<\EOF
6257 #define NCURSES 1
6258 EOF
6259
6260 echo "$as_me:6260: checking for ncurses version" >&5
6261 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6262 if test "${cf_cv_ncurses_version+set}" = set; then
6263   echo $ECHO_N "(cached) $ECHO_C" >&6
6264 else
6265
6266         cf_cv_ncurses_version=no
6267         cf_tempfile=out$$
6268         rm -f $cf_tempfile
6269         if test "$cross_compiling" = yes; then
6270
6271         # This will not work if the preprocessor splits the line after the
6272         # Autoconf token.  The 'unproto' program does that.
6273         cat > conftest.$ac_ext <<EOF
6274 #include <${cf_cv_ncurses_header:-curses.h}>
6275 #undef Autoconf
6276 #ifdef NCURSES_VERSION
6277 Autoconf NCURSES_VERSION
6278 #else
6279 #ifdef __NCURSES_H
6280 Autoconf "old"
6281 #endif
6282 ;
6283 #endif
6284 EOF
6285         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6286         { (eval echo "$as_me:6286: \"$cf_try\"") >&5
6287   (eval $cf_try) 2>&5
6288   ac_status=$?
6289   echo "$as_me:6289: \$? = $ac_status" >&5
6290   (exit $ac_status); }
6291         if test -f conftest.out ; then
6292                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6293                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6294                 rm -f conftest.out
6295         fi
6296
6297 else
6298   cat >conftest.$ac_ext <<_ACEOF
6299 #line 6299 "configure"
6300 #include "confdefs.h"
6301
6302 #include <${cf_cv_ncurses_header:-curses.h}>
6303 #include <stdio.h>
6304 int main()
6305 {
6306         FILE *fp = fopen("$cf_tempfile", "w");
6307 #ifdef NCURSES_VERSION
6308 # ifdef NCURSES_VERSION_PATCH
6309         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6310 # else
6311         fprintf(fp, "%s\n", NCURSES_VERSION);
6312 # endif
6313 #else
6314 # ifdef __NCURSES_H
6315         fprintf(fp, "old\n");
6316 # else
6317         make an error
6318 # endif
6319 #endif
6320         ${cf_cv_main_return:-return}(0);
6321 }
6322 _ACEOF
6323 rm -f conftest$ac_exeext
6324 if { (eval echo "$as_me:6324: \"$ac_link\"") >&5
6325   (eval $ac_link) 2>&5
6326   ac_status=$?
6327   echo "$as_me:6327: \$? = $ac_status" >&5
6328   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6329   { (eval echo "$as_me:6329: \"$ac_try\"") >&5
6330   (eval $ac_try) 2>&5
6331   ac_status=$?
6332   echo "$as_me:6332: \$? = $ac_status" >&5
6333   (exit $ac_status); }; }; then
6334
6335         cf_cv_ncurses_version=`cat $cf_tempfile`
6336 else
6337   echo "$as_me: program exited with status $ac_status" >&5
6338 echo "$as_me: failed program was:" >&5
6339 cat conftest.$ac_ext >&5
6340 fi
6341 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6342 fi
6343         rm -f $cf_tempfile
6344
6345 fi
6346 echo "$as_me:6346: result: $cf_cv_ncurses_version" >&5
6347 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6348 test "$cf_cv_ncurses_version" = no ||
6349 cat >>confdefs.h <<\EOF
6350 #define NCURSES 1
6351 EOF
6352
6353 cf_nculib_root=ncurses
6354         # This works, except for the special case where we find gpm, but
6355         # ncurses is in a nonstandard location via $LIBS, and we really want
6356         # to link gpm.
6357 cf_ncurses_LIBS=""
6358 cf_ncurses_SAVE="$LIBS"
6359 echo "$as_me:6359: checking for Gpm_Open in -lgpm" >&5
6360 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6361 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6362   echo $ECHO_N "(cached) $ECHO_C" >&6
6363 else
6364   ac_check_lib_save_LIBS=$LIBS
6365 LIBS="-lgpm  $LIBS"
6366 cat >conftest.$ac_ext <<_ACEOF
6367 #line 6367 "configure"
6368 #include "confdefs.h"
6369
6370 /* Override any gcc2 internal prototype to avoid an error.  */
6371 #ifdef __cplusplus
6372 extern "C"
6373 #endif
6374 /* We use char because int might match the return type of a gcc2
6375    builtin and then its argument prototype would still apply.  */
6376 char Gpm_Open ();
6377 int
6378 main ()
6379 {
6380 Gpm_Open ();
6381   ;
6382   return 0;
6383 }
6384 _ACEOF
6385 rm -f conftest.$ac_objext conftest$ac_exeext
6386 if { (eval echo "$as_me:6386: \"$ac_link\"") >&5
6387   (eval $ac_link) 2>&5
6388   ac_status=$?
6389   echo "$as_me:6389: \$? = $ac_status" >&5
6390   (exit $ac_status); } &&
6391          { ac_try='test -s conftest$ac_exeext'
6392   { (eval echo "$as_me:6392: \"$ac_try\"") >&5
6393   (eval $ac_try) 2>&5
6394   ac_status=$?
6395   echo "$as_me:6395: \$? = $ac_status" >&5
6396   (exit $ac_status); }; }; then
6397   ac_cv_lib_gpm_Gpm_Open=yes
6398 else
6399   echo "$as_me: failed program was:" >&5
6400 cat conftest.$ac_ext >&5
6401 ac_cv_lib_gpm_Gpm_Open=no
6402 fi
6403 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6404 LIBS=$ac_check_lib_save_LIBS
6405 fi
6406 echo "$as_me:6406: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6407 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6408 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6409   echo "$as_me:6409: checking for initscr in -lgpm" >&5
6410 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6411 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6412   echo $ECHO_N "(cached) $ECHO_C" >&6
6413 else
6414   ac_check_lib_save_LIBS=$LIBS
6415 LIBS="-lgpm  $LIBS"
6416 cat >conftest.$ac_ext <<_ACEOF
6417 #line 6417 "configure"
6418 #include "confdefs.h"
6419
6420 /* Override any gcc2 internal prototype to avoid an error.  */
6421 #ifdef __cplusplus
6422 extern "C"
6423 #endif
6424 /* We use char because int might match the return type of a gcc2
6425    builtin and then its argument prototype would still apply.  */
6426 char initscr ();
6427 int
6428 main ()
6429 {
6430 initscr ();
6431   ;
6432   return 0;
6433 }
6434 _ACEOF
6435 rm -f conftest.$ac_objext conftest$ac_exeext
6436 if { (eval echo "$as_me:6436: \"$ac_link\"") >&5
6437   (eval $ac_link) 2>&5
6438   ac_status=$?
6439   echo "$as_me:6439: \$? = $ac_status" >&5
6440   (exit $ac_status); } &&
6441          { ac_try='test -s conftest$ac_exeext'
6442   { (eval echo "$as_me:6442: \"$ac_try\"") >&5
6443   (eval $ac_try) 2>&5
6444   ac_status=$?
6445   echo "$as_me:6445: \$? = $ac_status" >&5
6446   (exit $ac_status); }; }; then
6447   ac_cv_lib_gpm_initscr=yes
6448 else
6449   echo "$as_me: failed program was:" >&5
6450 cat conftest.$ac_ext >&5
6451 ac_cv_lib_gpm_initscr=no
6452 fi
6453 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6454 LIBS=$ac_check_lib_save_LIBS
6455 fi
6456 echo "$as_me:6456: result: $ac_cv_lib_gpm_initscr" >&5
6457 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6458 if test $ac_cv_lib_gpm_initscr = yes; then
6459   LIBS="$cf_ncurses_SAVE"
6460 else
6461   cf_ncurses_LIBS="-lgpm"
6462 fi
6463
6464 fi
6465
6466 case $host_os in #(vi
6467 freebsd*)
6468         # This is only necessary if you are linking against an obsolete
6469         # version of ncurses (but it should do no harm, since it's static).
6470         if test "$cf_nculib_root" = ncurses ; then
6471                 echo "$as_me:6471: checking for tgoto in -lmytinfo" >&5
6472 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6473 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6474   echo $ECHO_N "(cached) $ECHO_C" >&6
6475 else
6476   ac_check_lib_save_LIBS=$LIBS
6477 LIBS="-lmytinfo  $LIBS"
6478 cat >conftest.$ac_ext <<_ACEOF
6479 #line 6479 "configure"
6480 #include "confdefs.h"
6481
6482 /* Override any gcc2 internal prototype to avoid an error.  */
6483 #ifdef __cplusplus
6484 extern "C"
6485 #endif
6486 /* We use char because int might match the return type of a gcc2
6487    builtin and then its argument prototype would still apply.  */
6488 char tgoto ();
6489 int
6490 main ()
6491 {
6492 tgoto ();
6493   ;
6494   return 0;
6495 }
6496 _ACEOF
6497 rm -f conftest.$ac_objext conftest$ac_exeext
6498 if { (eval echo "$as_me:6498: \"$ac_link\"") >&5
6499   (eval $ac_link) 2>&5
6500   ac_status=$?
6501   echo "$as_me:6501: \$? = $ac_status" >&5
6502   (exit $ac_status); } &&
6503          { ac_try='test -s conftest$ac_exeext'
6504   { (eval echo "$as_me:6504: \"$ac_try\"") >&5
6505   (eval $ac_try) 2>&5
6506   ac_status=$?
6507   echo "$as_me:6507: \$? = $ac_status" >&5
6508   (exit $ac_status); }; }; then
6509   ac_cv_lib_mytinfo_tgoto=yes
6510 else
6511   echo "$as_me: failed program was:" >&5
6512 cat conftest.$ac_ext >&5
6513 ac_cv_lib_mytinfo_tgoto=no
6514 fi
6515 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6516 LIBS=$ac_check_lib_save_LIBS
6517 fi
6518 echo "$as_me:6518: result: $ac_cv_lib_mytinfo_tgoto" >&5
6519 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6520 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6521   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6522 fi
6523
6524         fi
6525         ;;
6526 esac
6527
6528 LIBS="$cf_ncurses_LIBS $LIBS"
6529
6530 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6531 then
6532         LIBS="-l$cf_nculib_root $LIBS"
6533 else
6534
6535         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6536         cf_libdir=""
6537         echo "$as_me:6537: checking for initscr" >&5
6538 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6539 if test "${ac_cv_func_initscr+set}" = set; then
6540   echo $ECHO_N "(cached) $ECHO_C" >&6
6541 else
6542   cat >conftest.$ac_ext <<_ACEOF
6543 #line 6543 "configure"
6544 #include "confdefs.h"
6545 /* System header to define __stub macros and hopefully few prototypes,
6546     which can conflict with char initscr (); below.  */
6547 #include <assert.h>
6548 /* Override any gcc2 internal prototype to avoid an error.  */
6549 #ifdef __cplusplus
6550 extern "C"
6551 #endif
6552 /* We use char because int might match the return type of a gcc2
6553    builtin and then its argument prototype would still apply.  */
6554 char initscr ();
6555 char (*f) ();
6556
6557 int
6558 main ()
6559 {
6560 /* The GNU C library defines this for functions which it implements
6561     to always fail with ENOSYS.  Some functions are actually named
6562     something starting with __ and the normal name is an alias.  */
6563 #if defined (__stub_initscr) || defined (__stub___initscr)
6564 choke me
6565 #else
6566 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6567 #endif
6568
6569   ;
6570   return 0;
6571 }
6572 _ACEOF
6573 rm -f conftest.$ac_objext conftest$ac_exeext
6574 if { (eval echo "$as_me:6574: \"$ac_link\"") >&5
6575   (eval $ac_link) 2>&5
6576   ac_status=$?
6577   echo "$as_me:6577: \$? = $ac_status" >&5
6578   (exit $ac_status); } &&
6579          { ac_try='test -s conftest$ac_exeext'
6580   { (eval echo "$as_me:6580: \"$ac_try\"") >&5
6581   (eval $ac_try) 2>&5
6582   ac_status=$?
6583   echo "$as_me:6583: \$? = $ac_status" >&5
6584   (exit $ac_status); }; }; then
6585   ac_cv_func_initscr=yes
6586 else
6587   echo "$as_me: failed program was:" >&5
6588 cat conftest.$ac_ext >&5
6589 ac_cv_func_initscr=no
6590 fi
6591 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6592 fi
6593 echo "$as_me:6593: result: $ac_cv_func_initscr" >&5
6594 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6595 if test $ac_cv_func_initscr = yes; then
6596   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6597 else
6598
6599                 cf_save_LIBS="$LIBS"
6600                 echo "$as_me:6600: checking for initscr in -l$cf_nculib_root" >&5
6601 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6602                 LIBS="-l$cf_nculib_root $LIBS"
6603                 cat >conftest.$ac_ext <<_ACEOF
6604 #line 6604 "configure"
6605 #include "confdefs.h"
6606 #include <${cf_cv_ncurses_header:-curses.h}>
6607 int
6608 main ()
6609 {
6610 initscr()
6611   ;
6612   return 0;
6613 }
6614 _ACEOF
6615 rm -f conftest.$ac_objext conftest$ac_exeext
6616 if { (eval echo "$as_me:6616: \"$ac_link\"") >&5
6617   (eval $ac_link) 2>&5
6618   ac_status=$?
6619   echo "$as_me:6619: \$? = $ac_status" >&5
6620   (exit $ac_status); } &&
6621          { ac_try='test -s conftest$ac_exeext'
6622   { (eval echo "$as_me:6622: \"$ac_try\"") >&5
6623   (eval $ac_try) 2>&5
6624   ac_status=$?
6625   echo "$as_me:6625: \$? = $ac_status" >&5
6626   (exit $ac_status); }; }; then
6627   echo "$as_me:6627: result: yes" >&5
6628 echo "${ECHO_T}yes" >&6
6629                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6630
6631 else
6632   echo "$as_me: failed program was:" >&5
6633 cat conftest.$ac_ext >&5
6634 echo "$as_me:6634: result: no" >&5
6635 echo "${ECHO_T}no" >&6
6636
6637 cf_search=
6638 cf_library_path_list=""
6639 if test -n "${LDFLAGS}${LIBS}" ; then
6640         for cf_library_path in $LDFLAGS $LIBS
6641         do
6642                 case $cf_library_path in #(vi
6643                 -L*)
6644                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6645
6646 test "x$cf_library_path" != "xNONE" && \
6647 test -d "$cf_library_path" && \
6648  {
6649         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6650         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6651         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6652         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6653         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6654         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"
6655 }
6656
6657                         cf_library_path_list="$cf_library_path_list $cf_search"
6658                         ;;
6659                 esac
6660         done
6661 fi
6662
6663 cf_search=
6664
6665 test "x/usr" != "x$prefix" && \
6666 test -d "/usr" && \
6667 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
6668         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6669         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6670         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
6671         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
6672         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
6673         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
6674 }
6675
6676 test "x$prefix" != "xNONE" && \
6677 test -d "$prefix" && \
6678  {
6679         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6680         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6681         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6682         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6683         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6684         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6685 }
6686
6687 test "x/usr/local" != "x$prefix" && \
6688 test -d "/usr/local" && \
6689 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
6690         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6691         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6692         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
6693         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
6694         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
6695         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
6696 }
6697
6698 test "x/opt" != "x$prefix" && \
6699 test -d "/opt" && \
6700 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
6701         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6702         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6703         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
6704         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
6705         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
6706         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
6707 }
6708
6709 test "x$HOME" != "x$prefix" && \
6710 test -d "$HOME" && \
6711 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
6712         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6713         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6714         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
6715         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
6716         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
6717         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
6718 }
6719
6720 cf_search="$cf_library_path_list $cf_search"
6721
6722                         for cf_libdir in $cf_search
6723                         do
6724                                 echo "$as_me:6724: checking for -l$cf_nculib_root in $cf_libdir" >&5
6725 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6726                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6727                                 cat >conftest.$ac_ext <<_ACEOF
6728 #line 6728 "configure"
6729 #include "confdefs.h"
6730 #include <${cf_cv_ncurses_header:-curses.h}>
6731 int
6732 main ()
6733 {
6734 initscr()
6735   ;
6736   return 0;
6737 }
6738 _ACEOF
6739 rm -f conftest.$ac_objext conftest$ac_exeext
6740 if { (eval echo "$as_me:6740: \"$ac_link\"") >&5
6741   (eval $ac_link) 2>&5
6742   ac_status=$?
6743   echo "$as_me:6743: \$? = $ac_status" >&5
6744   (exit $ac_status); } &&
6745          { ac_try='test -s conftest$ac_exeext'
6746   { (eval echo "$as_me:6746: \"$ac_try\"") >&5
6747   (eval $ac_try) 2>&5
6748   ac_status=$?
6749   echo "$as_me:6749: \$? = $ac_status" >&5
6750   (exit $ac_status); }; }; then
6751   echo "$as_me:6751: result: yes" >&5
6752 echo "${ECHO_T}yes" >&6
6753                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6754                                          break
6755 else
6756   echo "$as_me: failed program was:" >&5
6757 cat conftest.$ac_ext >&5
6758 echo "$as_me:6758: result: no" >&5
6759 echo "${ECHO_T}no" >&6
6760                                          LIBS="$cf_save_LIBS"
6761 fi
6762 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6763                         done
6764
6765 fi
6766 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6767
6768 fi
6769
6770 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6771
6772 if test $cf_found_library = no ; then
6773         { { echo "$as_me:6773: error: Cannot link $cf_nculib_root library" >&5
6774 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6775    { (exit 1); exit 1; }; }
6776 fi
6777
6778 fi
6779
6780 if test -n "$cf_ncurses_LIBS" ; then
6781         echo "$as_me:6781: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6782 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6783         cf_ncurses_SAVE="$LIBS"
6784         for p in $cf_ncurses_LIBS ; do
6785                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6786                 if test "$q" != "$LIBS" ; then
6787                         LIBS="$q"
6788                 fi
6789         done
6790         cat >conftest.$ac_ext <<_ACEOF
6791 #line 6791 "configure"
6792 #include "confdefs.h"
6793 #include <${cf_cv_ncurses_header:-curses.h}>
6794 int
6795 main ()
6796 {
6797 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6798   ;
6799   return 0;
6800 }
6801 _ACEOF
6802 rm -f conftest.$ac_objext conftest$ac_exeext
6803 if { (eval echo "$as_me:6803: \"$ac_link\"") >&5
6804   (eval $ac_link) 2>&5
6805   ac_status=$?
6806   echo "$as_me:6806: \$? = $ac_status" >&5
6807   (exit $ac_status); } &&
6808          { ac_try='test -s conftest$ac_exeext'
6809   { (eval echo "$as_me:6809: \"$ac_try\"") >&5
6810   (eval $ac_try) 2>&5
6811   ac_status=$?
6812   echo "$as_me:6812: \$? = $ac_status" >&5
6813   (exit $ac_status); }; }; then
6814   echo "$as_me:6814: result: yes" >&5
6815 echo "${ECHO_T}yes" >&6
6816 else
6817   echo "$as_me: failed program was:" >&5
6818 cat conftest.$ac_ext >&5
6819 echo "$as_me:6819: result: no" >&5
6820 echo "${ECHO_T}no" >&6
6821                  LIBS="$cf_ncurses_SAVE"
6822 fi
6823 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6824 fi
6825
6826 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6827
6828 cat >>confdefs.h <<EOF
6829 #define $cf_nculib_ROOT 1
6830 EOF
6831
6832 fi
6833
6834         ;;
6835 ncursesw) #(vi
6836
6837 echo "$as_me:6837: checking for multibyte character support" >&5
6838 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6839 if test "${cf_cv_utf8_lib+set}" = set; then
6840   echo $ECHO_N "(cached) $ECHO_C" >&6
6841 else
6842
6843         cf_save_LIBS="$LIBS"
6844         cat >conftest.$ac_ext <<_ACEOF
6845 #line 6845 "configure"
6846 #include "confdefs.h"
6847
6848 #include <stdlib.h>
6849 int
6850 main ()
6851 {
6852 putwc(0,0);
6853   ;
6854   return 0;
6855 }
6856 _ACEOF
6857 rm -f conftest.$ac_objext conftest$ac_exeext
6858 if { (eval echo "$as_me:6858: \"$ac_link\"") >&5
6859   (eval $ac_link) 2>&5
6860   ac_status=$?
6861   echo "$as_me:6861: \$? = $ac_status" >&5
6862   (exit $ac_status); } &&
6863          { ac_try='test -s conftest$ac_exeext'
6864   { (eval echo "$as_me:6864: \"$ac_try\"") >&5
6865   (eval $ac_try) 2>&5
6866   ac_status=$?
6867   echo "$as_me:6867: \$? = $ac_status" >&5
6868   (exit $ac_status); }; }; then
6869   cf_cv_utf8_lib=yes
6870 else
6871   echo "$as_me: failed program was:" >&5
6872 cat conftest.$ac_ext >&5
6873
6874 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6875 # will be set on completion of the AC_TRY_LINK below.
6876 cf_cv_header_path_utf8=
6877 cf_cv_library_path_utf8=
6878
6879 echo "${as_me:-configure}:6879: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6880
6881 cf_save_LIBS="$LIBS"
6882
6883 cat >conftest.$ac_ext <<_ACEOF
6884 #line 6884 "configure"
6885 #include "confdefs.h"
6886
6887 #include <libutf8.h>
6888 int
6889 main ()
6890 {
6891 putwc(0,0);
6892   ;
6893   return 0;
6894 }
6895 _ACEOF
6896 rm -f conftest.$ac_objext conftest$ac_exeext
6897 if { (eval echo "$as_me:6897: \"$ac_link\"") >&5
6898   (eval $ac_link) 2>&5
6899   ac_status=$?
6900   echo "$as_me:6900: \$? = $ac_status" >&5
6901   (exit $ac_status); } &&
6902          { ac_try='test -s conftest$ac_exeext'
6903   { (eval echo "$as_me:6903: \"$ac_try\"") >&5
6904   (eval $ac_try) 2>&5
6905   ac_status=$?
6906   echo "$as_me:6906: \$? = $ac_status" >&5
6907   (exit $ac_status); }; }; then
6908
6909         cf_cv_find_linkage_utf8=yes
6910         cf_cv_header_path_utf8=/usr/include
6911         cf_cv_library_path_utf8=/usr/lib
6912
6913 else
6914   echo "$as_me: failed program was:" >&5
6915 cat conftest.$ac_ext >&5
6916
6917 LIBS="-lutf8  $cf_save_LIBS"
6918
6919 cat >conftest.$ac_ext <<_ACEOF
6920 #line 6920 "configure"
6921 #include "confdefs.h"
6922
6923 #include <libutf8.h>
6924 int
6925 main ()
6926 {
6927 putwc(0,0);
6928   ;
6929   return 0;
6930 }
6931 _ACEOF
6932 rm -f conftest.$ac_objext conftest$ac_exeext
6933 if { (eval echo "$as_me:6933: \"$ac_link\"") >&5
6934   (eval $ac_link) 2>&5
6935   ac_status=$?
6936   echo "$as_me:6936: \$? = $ac_status" >&5
6937   (exit $ac_status); } &&
6938          { ac_try='test -s conftest$ac_exeext'
6939   { (eval echo "$as_me:6939: \"$ac_try\"") >&5
6940   (eval $ac_try) 2>&5
6941   ac_status=$?
6942   echo "$as_me:6942: \$? = $ac_status" >&5
6943   (exit $ac_status); }; }; then
6944
6945         cf_cv_find_linkage_utf8=yes
6946         cf_cv_header_path_utf8=/usr/include
6947         cf_cv_library_path_utf8=/usr/lib
6948         cf_cv_library_file_utf8="-lutf8"
6949
6950 else
6951   echo "$as_me: failed program was:" >&5
6952 cat conftest.$ac_ext >&5
6953
6954         cf_cv_find_linkage_utf8=no
6955         LIBS="$cf_save_LIBS"
6956
6957     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
6958
6959 echo "${as_me:-configure}:6959: testing find linkage for utf8 library ..." 1>&5
6960
6961 echo "${as_me:-configure}:6961: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6962
6963     cf_save_CPPFLAGS="$CPPFLAGS"
6964     cf_test_CPPFLAGS="$CPPFLAGS"
6965
6966 cf_search=
6967
6968 # collect the current set of include-directories from compiler flags
6969 cf_header_path_list=""
6970 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6971         for cf_header_path in $CPPFLAGS $CFLAGS
6972         do
6973                 case $cf_header_path in #(vi
6974                 -I*)
6975                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6976
6977 test "x$cf_header_path" != "xNONE" && \
6978 test -d "$cf_header_path" && \
6979  {
6980         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6981         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6982         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6983         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6984         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6985         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6986 }
6987
6988                         cf_header_path_list="$cf_header_path_list $cf_search"
6989                         ;;
6990                 esac
6991         done
6992 fi
6993
6994 # add the variations for the package we are looking for
6995
6996 cf_search=
6997
6998 test "x/usr" != "x$prefix" && \
6999 test -d "/usr" && \
7000 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
7001         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7002         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7003         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
7004         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
7005         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
7006         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
7007 }
7008
7009 test "x$prefix" != "xNONE" && \
7010 test -d "$prefix" && \
7011  {
7012         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7013         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7014         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7015         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7016         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7017         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7018 }
7019
7020 test "x/usr/local" != "x$prefix" && \
7021 test -d "/usr/local" && \
7022 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
7023         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
7024         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
7025         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
7026         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
7027         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
7028         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
7029 }
7030
7031 test "x/opt" != "x$prefix" && \
7032 test -d "/opt" && \
7033 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
7034         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
7035         test -d /opt/include &&          cf_search="$cf_search /opt/include"
7036         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
7037         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
7038         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
7039         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
7040 }
7041
7042 test "x$HOME" != "x$prefix" && \
7043 test -d "$HOME" && \
7044 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
7045         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
7046         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
7047         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
7048         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
7049         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
7050         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
7051 }
7052
7053 test "$includedir" != NONE && \
7054 test "$includedir" != "/usr/include" && \
7055 test -d "$includedir" && {
7056         test -d $includedir &&    cf_search="$cf_search $includedir"
7057         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7058 }
7059
7060 test "$oldincludedir" != NONE && \
7061 test "$oldincludedir" != "/usr/include" && \
7062 test -d "$oldincludedir" && {
7063         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7064         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7065 }
7066
7067 cf_search="$cf_search $cf_header_path_list"
7068
7069     for cf_cv_header_path_utf8 in $cf_search
7070     do
7071       if test -d $cf_cv_header_path_utf8 ; then
7072         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7073
7074 echo "${as_me:-configure}:7074: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7075
7076         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
7077         cat >conftest.$ac_ext <<_ACEOF
7078 #line 7078 "configure"
7079 #include "confdefs.h"
7080
7081 #include <libutf8.h>
7082 int
7083 main ()
7084 {
7085 putwc(0,0);
7086   ;
7087   return 0;
7088 }
7089 _ACEOF
7090 rm -f conftest.$ac_objext
7091 if { (eval echo "$as_me:7091: \"$ac_compile\"") >&5
7092   (eval $ac_compile) 2>&5
7093   ac_status=$?
7094   echo "$as_me:7094: \$? = $ac_status" >&5
7095   (exit $ac_status); } &&
7096          { ac_try='test -s conftest.$ac_objext'
7097   { (eval echo "$as_me:7097: \"$ac_try\"") >&5
7098   (eval $ac_try) 2>&5
7099   ac_status=$?
7100   echo "$as_me:7100: \$? = $ac_status" >&5
7101   (exit $ac_status); }; }; then
7102
7103             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7104
7105 echo "${as_me:-configure}:7105: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7106
7107             cf_cv_find_linkage_utf8=maybe
7108             cf_test_CPPFLAGS="$CPPFLAGS"
7109             break
7110 else
7111   echo "$as_me: failed program was:" >&5
7112 cat conftest.$ac_ext >&5
7113
7114             CPPFLAGS="$cf_save_CPPFLAGS"
7115
7116 fi
7117 rm -f conftest.$ac_objext conftest.$ac_ext
7118       fi
7119     done
7120
7121     if test "$cf_cv_find_linkage_utf8" = maybe ; then
7122
7123 echo "${as_me:-configure}:7123: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7124
7125       cf_save_LIBS="$LIBS"
7126       cf_save_LDFLAGS="$LDFLAGS"
7127
7128       if test "$cf_cv_find_linkage_utf8" != yes ; then
7129
7130 cf_search=
7131 cf_library_path_list=""
7132 if test -n "${LDFLAGS}${LIBS}" ; then
7133         for cf_library_path in $LDFLAGS $LIBS
7134         do
7135                 case $cf_library_path in #(vi
7136                 -L*)
7137                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7138
7139 test "x$cf_library_path" != "xNONE" && \
7140 test -d "$cf_library_path" && \
7141  {
7142         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7143         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7144         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7145         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7146         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7147         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7148 }
7149
7150                         cf_library_path_list="$cf_library_path_list $cf_search"
7151                         ;;
7152                 esac
7153         done
7154 fi
7155
7156 cf_search=
7157
7158 test "x/usr" != "x$prefix" && \
7159 test -d "/usr" && \
7160 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
7161         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7162         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7163         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
7164         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
7165         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
7166         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
7167 }
7168
7169 test "x$prefix" != "xNONE" && \
7170 test -d "$prefix" && \
7171  {
7172         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7173         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7174         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7175         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7176         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7177         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7178 }
7179
7180 test "x/usr/local" != "x$prefix" && \
7181 test -d "/usr/local" && \
7182 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
7183         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7184         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7185         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
7186         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
7187         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
7188         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
7189 }
7190
7191 test "x/opt" != "x$prefix" && \
7192 test -d "/opt" && \
7193 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
7194         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7195         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7196         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
7197         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
7198         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
7199         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
7200 }
7201
7202 test "x$HOME" != "x$prefix" && \
7203 test -d "$HOME" && \
7204 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
7205         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7206         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7207         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
7208         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
7209         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
7210         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
7211 }
7212
7213 cf_search="$cf_library_path_list $cf_search"
7214
7215         for cf_cv_library_path_utf8 in $cf_search
7216         do
7217           if test -d $cf_cv_library_path_utf8 ; then
7218             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
7219
7220 echo "${as_me:-configure}:7220: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7221
7222             CPPFLAGS="$cf_test_CPPFLAGS"
7223             LIBS="-lutf8  $cf_save_LIBS"
7224             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7225             cat >conftest.$ac_ext <<_ACEOF
7226 #line 7226 "configure"
7227 #include "confdefs.h"
7228
7229 #include <libutf8.h>
7230 int
7231 main ()
7232 {
7233 putwc(0,0);
7234   ;
7235   return 0;
7236 }
7237 _ACEOF
7238 rm -f conftest.$ac_objext conftest$ac_exeext
7239 if { (eval echo "$as_me:7239: \"$ac_link\"") >&5
7240   (eval $ac_link) 2>&5
7241   ac_status=$?
7242   echo "$as_me:7242: \$? = $ac_status" >&5
7243   (exit $ac_status); } &&
7244          { ac_try='test -s conftest$ac_exeext'
7245   { (eval echo "$as_me:7245: \"$ac_try\"") >&5
7246   (eval $ac_try) 2>&5
7247   ac_status=$?
7248   echo "$as_me:7248: \$? = $ac_status" >&5
7249   (exit $ac_status); }; }; then
7250
7251                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7252
7253 echo "${as_me:-configure}:7253: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7254
7255                 cf_cv_find_linkage_utf8=yes
7256                 cf_cv_library_file_utf8="-lutf8"
7257                 break
7258 else
7259   echo "$as_me: failed program was:" >&5
7260 cat conftest.$ac_ext >&5
7261
7262                 CPPFLAGS="$cf_save_CPPFLAGS"
7263                 LIBS="$cf_save_LIBS"
7264                 LDFLAGS="$cf_save_LDFLAGS"
7265
7266 fi
7267 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7268           fi
7269         done
7270         CPPFLAGS="$cf_save_CPPFLAGS"
7271         LDFLAGS="$cf_save_LDFLAGS"
7272       fi
7273
7274     else
7275       cf_cv_find_linkage_utf8=no
7276     fi
7277
7278 fi
7279 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7280
7281 fi
7282 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7283
7284 LIBS="$cf_save_LIBS"
7285
7286 if test "$cf_cv_find_linkage_utf8" = yes ; then
7287 cf_cv_utf8_lib=add-on
7288 else
7289 cf_cv_utf8_lib=no
7290 fi
7291
7292 fi
7293 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7294 fi
7295 echo "$as_me:7295: result: $cf_cv_utf8_lib" >&5
7296 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7297
7298 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7299 # ncurses/ncursesw:
7300 if test "$cf_cv_utf8_lib" = "add-on" ; then
7301
7302 cat >>confdefs.h <<\EOF
7303 #define HAVE_LIBUTF8_H 1
7304 EOF
7305
7306 if test -n "$cf_cv_header_path_utf8" ; then
7307   for cf_add_incdir in $cf_cv_header_path_utf8
7308   do
7309         while test $cf_add_incdir != /usr/include
7310         do
7311           if test -d $cf_add_incdir
7312           then
7313                 cf_have_incdir=no
7314                 if test -n "$CFLAGS$CPPFLAGS" ; then
7315                   # a loop is needed to ensure we can add subdirs of existing dirs
7316                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7317                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7318                           cf_have_incdir=yes; break
7319                         fi
7320                   done
7321                 fi
7322
7323                 if test "$cf_have_incdir" = no ; then
7324                   if test "$cf_add_incdir" = /usr/local/include ; then
7325                         if test "$GCC" = yes
7326                         then
7327                           cf_save_CPPFLAGS=$CPPFLAGS
7328                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7329                           cat >conftest.$ac_ext <<_ACEOF
7330 #line 7330 "configure"
7331 #include "confdefs.h"
7332 #include <stdio.h>
7333 int
7334 main ()
7335 {
7336 printf("Hello")
7337   ;
7338   return 0;
7339 }
7340 _ACEOF
7341 rm -f conftest.$ac_objext
7342 if { (eval echo "$as_me:7342: \"$ac_compile\"") >&5
7343   (eval $ac_compile) 2>&5
7344   ac_status=$?
7345   echo "$as_me:7345: \$? = $ac_status" >&5
7346   (exit $ac_status); } &&
7347          { ac_try='test -s conftest.$ac_objext'
7348   { (eval echo "$as_me:7348: \"$ac_try\"") >&5
7349   (eval $ac_try) 2>&5
7350   ac_status=$?
7351   echo "$as_me:7351: \$? = $ac_status" >&5
7352   (exit $ac_status); }; }; then
7353   :
7354 else
7355   echo "$as_me: failed program was:" >&5
7356 cat conftest.$ac_ext >&5
7357 cf_have_incdir=yes
7358 fi
7359 rm -f conftest.$ac_objext conftest.$ac_ext
7360                           CPPFLAGS=$cf_save_CPPFLAGS
7361                         fi
7362                   fi
7363                 fi
7364
7365                 if test "$cf_have_incdir" = no ; then
7366                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7367
7368 echo "${as_me:-configure}:7368: testing adding $cf_add_incdir to include-path ..." 1>&5
7369
7370                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7371
7372                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7373                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7374                   cf_add_incdir="$cf_top_incdir"
7375                 else
7376                   break
7377                 fi
7378           fi
7379         done
7380   done
7381 fi
7382
7383 if test -n "$cf_cv_library_path_utf8" ; then
7384   for cf_add_libdir in $cf_cv_library_path_utf8
7385   do
7386     if test $cf_add_libdir = /usr/lib ; then
7387       :
7388     elif test -d $cf_add_libdir
7389     then
7390       cf_have_libdir=no
7391       if test -n "$LDFLAGS$LIBS" ; then
7392         # a loop is needed to ensure we can add subdirs of existing dirs
7393         for cf_test_libdir in $LDFLAGS $LIBS ; do
7394           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7395             cf_have_libdir=yes; break
7396           fi
7397         done
7398       fi
7399       if test "$cf_have_libdir" = no ; then
7400         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7401
7402 echo "${as_me:-configure}:7402: testing adding $cf_add_libdir to library-path ..." 1>&5
7403
7404         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7405       fi
7406     fi
7407   done
7408 fi
7409
7410         LIBS="$cf_cv_library_file_utf8 $LIBS"
7411 fi
7412
7413 cf_ncuconfig_root=ncursesw
7414
7415 echo "Looking for ${cf_ncuconfig_root}-config"
7416
7417 if test -n "$ac_tool_prefix"; then
7418   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7419   do
7420     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7421 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7422 echo "$as_me:7422: checking for $ac_word" >&5
7423 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7424 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7425   echo $ECHO_N "(cached) $ECHO_C" >&6
7426 else
7427   if test -n "$NCURSES_CONFIG"; then
7428   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7429 else
7430   ac_save_IFS=$IFS; IFS=$ac_path_separator
7431 ac_dummy="$PATH"
7432 for ac_dir in $ac_dummy; do
7433   IFS=$ac_save_IFS
7434   test -z "$ac_dir" && ac_dir=.
7435   $as_executable_p "$ac_dir/$ac_word" || continue
7436 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7437 echo "$as_me:7437: found $ac_dir/$ac_word" >&5
7438 break
7439 done
7440
7441 fi
7442 fi
7443 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7444 if test -n "$NCURSES_CONFIG"; then
7445   echo "$as_me:7445: result: $NCURSES_CONFIG" >&5
7446 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7447 else
7448   echo "$as_me:7448: result: no" >&5
7449 echo "${ECHO_T}no" >&6
7450 fi
7451
7452     test -n "$NCURSES_CONFIG" && break
7453   done
7454 fi
7455 if test -z "$NCURSES_CONFIG"; then
7456   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7457   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7458 do
7459   # Extract the first word of "$ac_prog", so it can be a program name with args.
7460 set dummy $ac_prog; ac_word=$2
7461 echo "$as_me:7461: checking for $ac_word" >&5
7462 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7463 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7464   echo $ECHO_N "(cached) $ECHO_C" >&6
7465 else
7466   if test -n "$ac_ct_NCURSES_CONFIG"; then
7467   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7468 else
7469   ac_save_IFS=$IFS; IFS=$ac_path_separator
7470 ac_dummy="$PATH"
7471 for ac_dir in $ac_dummy; do
7472   IFS=$ac_save_IFS
7473   test -z "$ac_dir" && ac_dir=.
7474   $as_executable_p "$ac_dir/$ac_word" || continue
7475 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7476 echo "$as_me:7476: found $ac_dir/$ac_word" >&5
7477 break
7478 done
7479
7480 fi
7481 fi
7482 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7483 if test -n "$ac_ct_NCURSES_CONFIG"; then
7484   echo "$as_me:7484: result: $ac_ct_NCURSES_CONFIG" >&5
7485 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7486 else
7487   echo "$as_me:7487: result: no" >&5
7488 echo "${ECHO_T}no" >&6
7489 fi
7490
7491   test -n "$ac_ct_NCURSES_CONFIG" && break
7492 done
7493 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7494
7495   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7496 fi
7497
7498 if test "$NCURSES_CONFIG" != none ; then
7499
7500 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7501 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
7502
7503 # even with config script, some packages use no-override for curses.h
7504
7505 echo "$as_me:7505: checking if we have identified curses headers" >&5
7506 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7507 if test "${cf_cv_ncurses_header+set}" = set; then
7508   echo $ECHO_N "(cached) $ECHO_C" >&6
7509 else
7510
7511 cf_cv_ncurses_header=none
7512 for cf_header in  \
7513     ncursesw/ncurses.h \
7514         ncursesw/curses.h \
7515         ncurses.h \
7516         curses.h
7517 do
7518 cat >conftest.$ac_ext <<_ACEOF
7519 #line 7519 "configure"
7520 #include "confdefs.h"
7521 #include <${cf_header}>
7522 int
7523 main ()
7524 {
7525 initscr(); tgoto("?", 0,0)
7526   ;
7527   return 0;
7528 }
7529 _ACEOF
7530 rm -f conftest.$ac_objext
7531 if { (eval echo "$as_me:7531: \"$ac_compile\"") >&5
7532   (eval $ac_compile) 2>&5
7533   ac_status=$?
7534   echo "$as_me:7534: \$? = $ac_status" >&5
7535   (exit $ac_status); } &&
7536          { ac_try='test -s conftest.$ac_objext'
7537   { (eval echo "$as_me:7537: \"$ac_try\"") >&5
7538   (eval $ac_try) 2>&5
7539   ac_status=$?
7540   echo "$as_me:7540: \$? = $ac_status" >&5
7541   (exit $ac_status); }; }; then
7542   cf_cv_ncurses_header=$cf_header; break
7543 else
7544   echo "$as_me: failed program was:" >&5
7545 cat conftest.$ac_ext >&5
7546 fi
7547 rm -f conftest.$ac_objext conftest.$ac_ext
7548 done
7549
7550 fi
7551 echo "$as_me:7551: result: $cf_cv_ncurses_header" >&5
7552 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7553
7554 if test "$cf_cv_ncurses_header" = none ; then
7555         { { echo "$as_me:7555: error: No curses header-files found" >&5
7556 echo "$as_me: error: No curses header-files found" >&2;}
7557    { (exit 1); exit 1; }; }
7558 fi
7559
7560 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7561
7562 for ac_header in $cf_cv_ncurses_header
7563 do
7564 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7565 echo "$as_me:7565: checking for $ac_header" >&5
7566 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7567 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7568   echo $ECHO_N "(cached) $ECHO_C" >&6
7569 else
7570   cat >conftest.$ac_ext <<_ACEOF
7571 #line 7571 "configure"
7572 #include "confdefs.h"
7573 #include <$ac_header>
7574 _ACEOF
7575 if { (eval echo "$as_me:7575: \"$ac_cpp conftest.$ac_ext\"") >&5
7576   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7577   ac_status=$?
7578   egrep -v '^ *\+' conftest.er1 >conftest.err
7579   rm -f conftest.er1
7580   cat conftest.err >&5
7581   echo "$as_me:7581: \$? = $ac_status" >&5
7582   (exit $ac_status); } >/dev/null; then
7583   if test -s conftest.err; then
7584     ac_cpp_err=$ac_c_preproc_warn_flag
7585   else
7586     ac_cpp_err=
7587   fi
7588 else
7589   ac_cpp_err=yes
7590 fi
7591 if test -z "$ac_cpp_err"; then
7592   eval "$as_ac_Header=yes"
7593 else
7594   echo "$as_me: failed program was:" >&5
7595   cat conftest.$ac_ext >&5
7596   eval "$as_ac_Header=no"
7597 fi
7598 rm -f conftest.err conftest.$ac_ext
7599 fi
7600 echo "$as_me:7600: result: `eval echo '${'$as_ac_Header'}'`" >&5
7601 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7602 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7603   cat >>confdefs.h <<EOF
7604 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7605 EOF
7606
7607 fi
7608 done
7609
7610 cat >>confdefs.h <<\EOF
7611 #define NCURSES 1
7612 EOF
7613
7614 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7615
7616 cat >>confdefs.h <<EOF
7617 #define $cf_nculib_ROOT 1
7618 EOF
7619
7620 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7621
7622 else
7623
7624 cf_ncuhdr_root=ncursesw
7625
7626 test -n "$cf_cv_curses_dir" && \
7627 test "$cf_cv_curses_dir" != "no" && { \
7628
7629 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7630   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7631   do
7632         while test $cf_add_incdir != /usr/include
7633         do
7634           if test -d $cf_add_incdir
7635           then
7636                 cf_have_incdir=no
7637                 if test -n "$CFLAGS$CPPFLAGS" ; then
7638                   # a loop is needed to ensure we can add subdirs of existing dirs
7639                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7640                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7641                           cf_have_incdir=yes; break
7642                         fi
7643                   done
7644                 fi
7645
7646                 if test "$cf_have_incdir" = no ; then
7647                   if test "$cf_add_incdir" = /usr/local/include ; then
7648                         if test "$GCC" = yes
7649                         then
7650                           cf_save_CPPFLAGS=$CPPFLAGS
7651                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7652                           cat >conftest.$ac_ext <<_ACEOF
7653 #line 7653 "configure"
7654 #include "confdefs.h"
7655 #include <stdio.h>
7656 int
7657 main ()
7658 {
7659 printf("Hello")
7660   ;
7661   return 0;
7662 }
7663 _ACEOF
7664 rm -f conftest.$ac_objext
7665 if { (eval echo "$as_me:7665: \"$ac_compile\"") >&5
7666   (eval $ac_compile) 2>&5
7667   ac_status=$?
7668   echo "$as_me:7668: \$? = $ac_status" >&5
7669   (exit $ac_status); } &&
7670          { ac_try='test -s conftest.$ac_objext'
7671   { (eval echo "$as_me:7671: \"$ac_try\"") >&5
7672   (eval $ac_try) 2>&5
7673   ac_status=$?
7674   echo "$as_me:7674: \$? = $ac_status" >&5
7675   (exit $ac_status); }; }; then
7676   :
7677 else
7678   echo "$as_me: failed program was:" >&5
7679 cat conftest.$ac_ext >&5
7680 cf_have_incdir=yes
7681 fi
7682 rm -f conftest.$ac_objext conftest.$ac_ext
7683                           CPPFLAGS=$cf_save_CPPFLAGS
7684                         fi
7685                   fi
7686                 fi
7687
7688                 if test "$cf_have_incdir" = no ; then
7689                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7690
7691 echo "${as_me:-configure}:7691: testing adding $cf_add_incdir to include-path ..." 1>&5
7692
7693                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7694
7695                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7696                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7697                   cf_add_incdir="$cf_top_incdir"
7698                 else
7699                   break
7700                 fi
7701           fi
7702         done
7703   done
7704 fi
7705
7706 }
7707
7708 echo "$as_me:7708: checking for $cf_ncuhdr_root header in include-path" >&5
7709 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7710 if test "${cf_cv_ncurses_h+set}" = set; then
7711   echo $ECHO_N "(cached) $ECHO_C" >&6
7712 else
7713
7714         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7715         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7716         for cf_header in $cf_header_list
7717         do
7718
7719         cat >conftest.$ac_ext <<_ACEOF
7720 #line 7720 "configure"
7721 #include "confdefs.h"
7722
7723 #define _XOPEN_SOURCE_EXTENDED
7724 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7725 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7726
7727 #include <$cf_header>
7728 int
7729 main ()
7730 {
7731
7732 #ifdef NCURSES_VERSION
7733
7734 #ifndef WACS_BSSB
7735         make an error
7736 #endif
7737
7738 printf("%s\n", NCURSES_VERSION);
7739 #else
7740 #ifdef __NCURSES_H
7741 printf("old\n");
7742 #else
7743         make an error
7744 #endif
7745 #endif
7746
7747   ;
7748   return 0;
7749 }
7750 _ACEOF
7751 rm -f conftest.$ac_objext
7752 if { (eval echo "$as_me:7752: \"$ac_compile\"") >&5
7753   (eval $ac_compile) 2>&5
7754   ac_status=$?
7755   echo "$as_me:7755: \$? = $ac_status" >&5
7756   (exit $ac_status); } &&
7757          { ac_try='test -s conftest.$ac_objext'
7758   { (eval echo "$as_me:7758: \"$ac_try\"") >&5
7759   (eval $ac_try) 2>&5
7760   ac_status=$?
7761   echo "$as_me:7761: \$? = $ac_status" >&5
7762   (exit $ac_status); }; }; then
7763   cf_cv_ncurses_h=$cf_header
7764
7765 else
7766   echo "$as_me: failed program was:" >&5
7767 cat conftest.$ac_ext >&5
7768 cf_cv_ncurses_h=no
7769 fi
7770 rm -f conftest.$ac_objext conftest.$ac_ext
7771
7772                 test "$cf_cv_ncurses_h" != no && break
7773         done
7774
7775 fi
7776 echo "$as_me:7776: result: $cf_cv_ncurses_h" >&5
7777 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7778
7779 if test "$cf_cv_ncurses_h" != no ; then
7780         cf_cv_ncurses_header=$cf_cv_ncurses_h
7781 else
7782
7783 echo "$as_me:7783: checking for $cf_ncuhdr_root include-path" >&5
7784 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7785 if test "${cf_cv_ncurses_h2+set}" = set; then
7786   echo $ECHO_N "(cached) $ECHO_C" >&6
7787 else
7788
7789         test -n "$verbose" && echo
7790
7791 cf_search=
7792
7793 # collect the current set of include-directories from compiler flags
7794 cf_header_path_list=""
7795 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7796         for cf_header_path in $CPPFLAGS $CFLAGS
7797         do
7798                 case $cf_header_path in #(vi
7799                 -I*)
7800                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7801
7802 test "x$cf_header_path" != "xNONE" && \
7803 test -d "$cf_header_path" && \
7804  {
7805         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7806         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7807         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7808         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7809         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7810         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"
7811 }
7812
7813                         cf_header_path_list="$cf_header_path_list $cf_search"
7814                         ;;
7815                 esac
7816         done
7817 fi
7818
7819 # add the variations for the package we are looking for
7820
7821 cf_search=
7822
7823 test "x/usr" != "x$prefix" && \
7824 test -d "/usr" && \
7825 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
7826         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7827         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7828         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
7829         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
7830         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
7831         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7832 }
7833
7834 test "x$prefix" != "xNONE" && \
7835 test -d "$prefix" && \
7836  {
7837         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7838         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7839         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7840         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7841         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7842         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7843 }
7844
7845 test "x/usr/local" != "x$prefix" && \
7846 test -d "/usr/local" && \
7847 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
7848         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
7849         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
7850         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
7851         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
7852         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
7853         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7854 }
7855
7856 test "x/opt" != "x$prefix" && \
7857 test -d "/opt" && \
7858 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
7859         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
7860         test -d /opt/include &&          cf_search="$cf_search /opt/include"
7861         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
7862         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
7863         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
7864         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7865 }
7866
7867 test "x$HOME" != "x$prefix" && \
7868 test -d "$HOME" && \
7869 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
7870         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
7871         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
7872         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
7873         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
7874         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
7875         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7876 }
7877
7878 test "$includedir" != NONE && \
7879 test "$includedir" != "/usr/include" && \
7880 test -d "$includedir" && {
7881         test -d $includedir &&    cf_search="$cf_search $includedir"
7882         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7883 }
7884
7885 test "$oldincludedir" != NONE && \
7886 test "$oldincludedir" != "/usr/include" && \
7887 test -d "$oldincludedir" && {
7888         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7889         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7890 }
7891
7892 cf_search="$cf_search $cf_header_path_list"
7893
7894         test -n "$verbose" && echo search path $cf_search
7895         cf_save2_CPPFLAGS="$CPPFLAGS"
7896         for cf_incdir in $cf_search
7897         do
7898
7899 if test -n "$cf_incdir" ; then
7900   for cf_add_incdir in $cf_incdir
7901   do
7902         while test $cf_add_incdir != /usr/include
7903         do
7904           if test -d $cf_add_incdir
7905           then
7906                 cf_have_incdir=no
7907                 if test -n "$CFLAGS$CPPFLAGS" ; then
7908                   # a loop is needed to ensure we can add subdirs of existing dirs
7909                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7910                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7911                           cf_have_incdir=yes; break
7912                         fi
7913                   done
7914                 fi
7915
7916                 if test "$cf_have_incdir" = no ; then
7917                   if test "$cf_add_incdir" = /usr/local/include ; then
7918                         if test "$GCC" = yes
7919                         then
7920                           cf_save_CPPFLAGS=$CPPFLAGS
7921                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7922                           cat >conftest.$ac_ext <<_ACEOF
7923 #line 7923 "configure"
7924 #include "confdefs.h"
7925 #include <stdio.h>
7926 int
7927 main ()
7928 {
7929 printf("Hello")
7930   ;
7931   return 0;
7932 }
7933 _ACEOF
7934 rm -f conftest.$ac_objext
7935 if { (eval echo "$as_me:7935: \"$ac_compile\"") >&5
7936   (eval $ac_compile) 2>&5
7937   ac_status=$?
7938   echo "$as_me:7938: \$? = $ac_status" >&5
7939   (exit $ac_status); } &&
7940          { ac_try='test -s conftest.$ac_objext'
7941   { (eval echo "$as_me:7941: \"$ac_try\"") >&5
7942   (eval $ac_try) 2>&5
7943   ac_status=$?
7944   echo "$as_me:7944: \$? = $ac_status" >&5
7945   (exit $ac_status); }; }; then
7946   :
7947 else
7948   echo "$as_me: failed program was:" >&5
7949 cat conftest.$ac_ext >&5
7950 cf_have_incdir=yes
7951 fi
7952 rm -f conftest.$ac_objext conftest.$ac_ext
7953                           CPPFLAGS=$cf_save_CPPFLAGS
7954                         fi
7955                   fi
7956                 fi
7957
7958                 if test "$cf_have_incdir" = no ; then
7959                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7960
7961 echo "${as_me:-configure}:7961: testing adding $cf_add_incdir to include-path ..." 1>&5
7962
7963                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7964
7965                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7966                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7967                   cf_add_incdir="$cf_top_incdir"
7968                 else
7969                   break
7970                 fi
7971           fi
7972         done
7973   done
7974 fi
7975
7976                 for cf_header in \
7977                         ncurses.h \
7978                         curses.h
7979                 do
7980
7981         cat >conftest.$ac_ext <<_ACEOF
7982 #line 7982 "configure"
7983 #include "confdefs.h"
7984
7985 #include <$cf_header>
7986 int
7987 main ()
7988 {
7989
7990 #ifdef NCURSES_VERSION
7991
7992 printf("%s\n", NCURSES_VERSION);
7993 #else
7994 #ifdef __NCURSES_H
7995 printf("old\n");
7996 #else
7997         make an error
7998 #endif
7999 #endif
8000
8001   ;
8002   return 0;
8003 }
8004 _ACEOF
8005 rm -f conftest.$ac_objext
8006 if { (eval echo "$as_me:8006: \"$ac_compile\"") >&5
8007   (eval $ac_compile) 2>&5
8008   ac_status=$?
8009   echo "$as_me:8009: \$? = $ac_status" >&5
8010   (exit $ac_status); } &&
8011          { ac_try='test -s conftest.$ac_objext'
8012   { (eval echo "$as_me:8012: \"$ac_try\"") >&5
8013   (eval $ac_try) 2>&5
8014   ac_status=$?
8015   echo "$as_me:8015: \$? = $ac_status" >&5
8016   (exit $ac_status); }; }; then
8017   cf_cv_ncurses_h2=$cf_header
8018
8019 else
8020   echo "$as_me: failed program was:" >&5
8021 cat conftest.$ac_ext >&5
8022 cf_cv_ncurses_h2=no
8023 fi
8024 rm -f conftest.$ac_objext conftest.$ac_ext
8025
8026                         if test "$cf_cv_ncurses_h2" != no ; then
8027                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8028                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8029                                 break
8030                         fi
8031                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8032                 done
8033                 CPPFLAGS="$cf_save2_CPPFLAGS"
8034                 test "$cf_cv_ncurses_h2" != no && break
8035         done
8036         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8036: error: not found" >&5
8037 echo "$as_me: error: not found" >&2;}
8038    { (exit 1); exit 1; }; }
8039
8040 fi
8041 echo "$as_me:8041: result: $cf_cv_ncurses_h2" >&5
8042 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8043
8044         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8045         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8046         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8047                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8048         fi
8049
8050 if test -n "$cf_1st_incdir" ; then
8051   for cf_add_incdir in $cf_1st_incdir
8052   do
8053         while test $cf_add_incdir != /usr/include
8054         do
8055           if test -d $cf_add_incdir
8056           then
8057                 cf_have_incdir=no
8058                 if test -n "$CFLAGS$CPPFLAGS" ; then
8059                   # a loop is needed to ensure we can add subdirs of existing dirs
8060                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8061                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8062                           cf_have_incdir=yes; break
8063                         fi
8064                   done
8065                 fi
8066
8067                 if test "$cf_have_incdir" = no ; then
8068                   if test "$cf_add_incdir" = /usr/local/include ; then
8069                         if test "$GCC" = yes
8070                         then
8071                           cf_save_CPPFLAGS=$CPPFLAGS
8072                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8073                           cat >conftest.$ac_ext <<_ACEOF
8074 #line 8074 "configure"
8075 #include "confdefs.h"
8076 #include <stdio.h>
8077 int
8078 main ()
8079 {
8080 printf("Hello")
8081   ;
8082   return 0;
8083 }
8084 _ACEOF
8085 rm -f conftest.$ac_objext
8086 if { (eval echo "$as_me:8086: \"$ac_compile\"") >&5
8087   (eval $ac_compile) 2>&5
8088   ac_status=$?
8089   echo "$as_me:8089: \$? = $ac_status" >&5
8090   (exit $ac_status); } &&
8091          { ac_try='test -s conftest.$ac_objext'
8092   { (eval echo "$as_me:8092: \"$ac_try\"") >&5
8093   (eval $ac_try) 2>&5
8094   ac_status=$?
8095   echo "$as_me:8095: \$? = $ac_status" >&5
8096   (exit $ac_status); }; }; then
8097   :
8098 else
8099   echo "$as_me: failed program was:" >&5
8100 cat conftest.$ac_ext >&5
8101 cf_have_incdir=yes
8102 fi
8103 rm -f conftest.$ac_objext conftest.$ac_ext
8104                           CPPFLAGS=$cf_save_CPPFLAGS
8105                         fi
8106                   fi
8107                 fi
8108
8109                 if test "$cf_have_incdir" = no ; then
8110                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8111
8112 echo "${as_me:-configure}:8112: testing adding $cf_add_incdir to include-path ..." 1>&5
8113
8114                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8115
8116                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8117                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8118                   cf_add_incdir="$cf_top_incdir"
8119                 else
8120                   break
8121                 fi
8122           fi
8123         done
8124   done
8125 fi
8126
8127 fi
8128
8129 # Set definitions to allow ifdef'ing for ncurses.h
8130
8131 case $cf_cv_ncurses_header in # (vi
8132 *ncurses.h)
8133
8134 cat >>confdefs.h <<\EOF
8135 #define HAVE_NCURSES_H 1
8136 EOF
8137
8138         ;;
8139 esac
8140
8141 case $cf_cv_ncurses_header in # (vi
8142 ncurses/curses.h|ncurses/ncurses.h)
8143
8144 cat >>confdefs.h <<\EOF
8145 #define HAVE_NCURSES_NCURSES_H 1
8146 EOF
8147
8148         ;;
8149 ncursesw/curses.h|ncursesw/ncurses.h)
8150
8151 cat >>confdefs.h <<\EOF
8152 #define HAVE_NCURSESW_NCURSES_H 1
8153 EOF
8154
8155         ;;
8156 esac
8157
8158 echo "$as_me:8158: checking for terminfo header" >&5
8159 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8160 if test "${cf_cv_term_header+set}" = set; then
8161   echo $ECHO_N "(cached) $ECHO_C" >&6
8162 else
8163
8164 case ${cf_cv_ncurses_header} in #(vi
8165 */ncurses.h|*/ncursesw.h) #(vi
8166         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8167         ;;
8168 *)
8169         cf_term_header=term.h
8170         ;;
8171 esac
8172
8173 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8174 do
8175 cat >conftest.$ac_ext <<_ACEOF
8176 #line 8176 "configure"
8177 #include "confdefs.h"
8178 #include <stdio.h>
8179 #include <${cf_cv_ncurses_header:-curses.h}>
8180 #include <$cf_test>
8181
8182 int
8183 main ()
8184 {
8185 int x = auto_left_margin
8186   ;
8187   return 0;
8188 }
8189 _ACEOF
8190 rm -f conftest.$ac_objext
8191 if { (eval echo "$as_me:8191: \"$ac_compile\"") >&5
8192   (eval $ac_compile) 2>&5
8193   ac_status=$?
8194   echo "$as_me:8194: \$? = $ac_status" >&5
8195   (exit $ac_status); } &&
8196          { ac_try='test -s conftest.$ac_objext'
8197   { (eval echo "$as_me:8197: \"$ac_try\"") >&5
8198   (eval $ac_try) 2>&5
8199   ac_status=$?
8200   echo "$as_me:8200: \$? = $ac_status" >&5
8201   (exit $ac_status); }; }; then
8202
8203         cf_cv_term_header="$cf_test"
8204 else
8205   echo "$as_me: failed program was:" >&5
8206 cat conftest.$ac_ext >&5
8207
8208         cf_cv_term_header=unknown
8209
8210 fi
8211 rm -f conftest.$ac_objext conftest.$ac_ext
8212         test "$cf_cv_term_header" != unknown && break
8213 done
8214
8215 fi
8216 echo "$as_me:8216: result: $cf_cv_term_header" >&5
8217 echo "${ECHO_T}$cf_cv_term_header" >&6
8218
8219 # Set definitions to allow ifdef'ing to accommodate subdirectories
8220
8221 case $cf_cv_term_header in # (vi
8222 *term.h)
8223
8224 cat >>confdefs.h <<\EOF
8225 #define HAVE_TERM_H 1
8226 EOF
8227
8228         ;;
8229 esac
8230
8231 case $cf_cv_term_header in # (vi
8232 ncurses/term.h) #(vi
8233
8234 cat >>confdefs.h <<\EOF
8235 #define HAVE_NCURSES_TERM_H 1
8236 EOF
8237
8238         ;;
8239 ncursesw/term.h)
8240
8241 cat >>confdefs.h <<\EOF
8242 #define HAVE_NCURSESW_TERM_H 1
8243 EOF
8244
8245         ;;
8246 esac
8247
8248 # some applications need this, but should check for NCURSES_VERSION
8249
8250 cat >>confdefs.h <<\EOF
8251 #define NCURSES 1
8252 EOF
8253
8254 echo "$as_me:8254: checking for ncurses version" >&5
8255 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8256 if test "${cf_cv_ncurses_version+set}" = set; then
8257   echo $ECHO_N "(cached) $ECHO_C" >&6
8258 else
8259
8260         cf_cv_ncurses_version=no
8261         cf_tempfile=out$$
8262         rm -f $cf_tempfile
8263         if test "$cross_compiling" = yes; then
8264
8265         # This will not work if the preprocessor splits the line after the
8266         # Autoconf token.  The 'unproto' program does that.
8267         cat > conftest.$ac_ext <<EOF
8268 #include <${cf_cv_ncurses_header:-curses.h}>
8269 #undef Autoconf
8270 #ifdef NCURSES_VERSION
8271 Autoconf NCURSES_VERSION
8272 #else
8273 #ifdef __NCURSES_H
8274 Autoconf "old"
8275 #endif
8276 ;
8277 #endif
8278 EOF
8279         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8280         { (eval echo "$as_me:8280: \"$cf_try\"") >&5
8281   (eval $cf_try) 2>&5
8282   ac_status=$?
8283   echo "$as_me:8283: \$? = $ac_status" >&5
8284   (exit $ac_status); }
8285         if test -f conftest.out ; then
8286                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8287                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8288                 rm -f conftest.out
8289         fi
8290
8291 else
8292   cat >conftest.$ac_ext <<_ACEOF
8293 #line 8293 "configure"
8294 #include "confdefs.h"
8295
8296 #include <${cf_cv_ncurses_header:-curses.h}>
8297 #include <stdio.h>
8298 int main()
8299 {
8300         FILE *fp = fopen("$cf_tempfile", "w");
8301 #ifdef NCURSES_VERSION
8302 # ifdef NCURSES_VERSION_PATCH
8303         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8304 # else
8305         fprintf(fp, "%s\n", NCURSES_VERSION);
8306 # endif
8307 #else
8308 # ifdef __NCURSES_H
8309         fprintf(fp, "old\n");
8310 # else
8311         make an error
8312 # endif
8313 #endif
8314         ${cf_cv_main_return:-return}(0);
8315 }
8316 _ACEOF
8317 rm -f conftest$ac_exeext
8318 if { (eval echo "$as_me:8318: \"$ac_link\"") >&5
8319   (eval $ac_link) 2>&5
8320   ac_status=$?
8321   echo "$as_me:8321: \$? = $ac_status" >&5
8322   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8323   { (eval echo "$as_me:8323: \"$ac_try\"") >&5
8324   (eval $ac_try) 2>&5
8325   ac_status=$?
8326   echo "$as_me:8326: \$? = $ac_status" >&5
8327   (exit $ac_status); }; }; then
8328
8329         cf_cv_ncurses_version=`cat $cf_tempfile`
8330 else
8331   echo "$as_me: program exited with status $ac_status" >&5
8332 echo "$as_me: failed program was:" >&5
8333 cat conftest.$ac_ext >&5
8334 fi
8335 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8336 fi
8337         rm -f $cf_tempfile
8338
8339 fi
8340 echo "$as_me:8340: result: $cf_cv_ncurses_version" >&5
8341 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8342 test "$cf_cv_ncurses_version" = no ||
8343 cat >>confdefs.h <<\EOF
8344 #define NCURSES 1
8345 EOF
8346
8347 cf_nculib_root=ncursesw
8348         # This works, except for the special case where we find gpm, but
8349         # ncurses is in a nonstandard location via $LIBS, and we really want
8350         # to link gpm.
8351 cf_ncurses_LIBS=""
8352 cf_ncurses_SAVE="$LIBS"
8353 echo "$as_me:8353: checking for Gpm_Open in -lgpm" >&5
8354 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8355 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8356   echo $ECHO_N "(cached) $ECHO_C" >&6
8357 else
8358   ac_check_lib_save_LIBS=$LIBS
8359 LIBS="-lgpm  $LIBS"
8360 cat >conftest.$ac_ext <<_ACEOF
8361 #line 8361 "configure"
8362 #include "confdefs.h"
8363
8364 /* Override any gcc2 internal prototype to avoid an error.  */
8365 #ifdef __cplusplus
8366 extern "C"
8367 #endif
8368 /* We use char because int might match the return type of a gcc2
8369    builtin and then its argument prototype would still apply.  */
8370 char Gpm_Open ();
8371 int
8372 main ()
8373 {
8374 Gpm_Open ();
8375   ;
8376   return 0;
8377 }
8378 _ACEOF
8379 rm -f conftest.$ac_objext conftest$ac_exeext
8380 if { (eval echo "$as_me:8380: \"$ac_link\"") >&5
8381   (eval $ac_link) 2>&5
8382   ac_status=$?
8383   echo "$as_me:8383: \$? = $ac_status" >&5
8384   (exit $ac_status); } &&
8385          { ac_try='test -s conftest$ac_exeext'
8386   { (eval echo "$as_me:8386: \"$ac_try\"") >&5
8387   (eval $ac_try) 2>&5
8388   ac_status=$?
8389   echo "$as_me:8389: \$? = $ac_status" >&5
8390   (exit $ac_status); }; }; then
8391   ac_cv_lib_gpm_Gpm_Open=yes
8392 else
8393   echo "$as_me: failed program was:" >&5
8394 cat conftest.$ac_ext >&5
8395 ac_cv_lib_gpm_Gpm_Open=no
8396 fi
8397 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8398 LIBS=$ac_check_lib_save_LIBS
8399 fi
8400 echo "$as_me:8400: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8401 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8402 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8403   echo "$as_me:8403: checking for initscr in -lgpm" >&5
8404 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8405 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8406   echo $ECHO_N "(cached) $ECHO_C" >&6
8407 else
8408   ac_check_lib_save_LIBS=$LIBS
8409 LIBS="-lgpm  $LIBS"
8410 cat >conftest.$ac_ext <<_ACEOF
8411 #line 8411 "configure"
8412 #include "confdefs.h"
8413
8414 /* Override any gcc2 internal prototype to avoid an error.  */
8415 #ifdef __cplusplus
8416 extern "C"
8417 #endif
8418 /* We use char because int might match the return type of a gcc2
8419    builtin and then its argument prototype would still apply.  */
8420 char initscr ();
8421 int
8422 main ()
8423 {
8424 initscr ();
8425   ;
8426   return 0;
8427 }
8428 _ACEOF
8429 rm -f conftest.$ac_objext conftest$ac_exeext
8430 if { (eval echo "$as_me:8430: \"$ac_link\"") >&5
8431   (eval $ac_link) 2>&5
8432   ac_status=$?
8433   echo "$as_me:8433: \$? = $ac_status" >&5
8434   (exit $ac_status); } &&
8435          { ac_try='test -s conftest$ac_exeext'
8436   { (eval echo "$as_me:8436: \"$ac_try\"") >&5
8437   (eval $ac_try) 2>&5
8438   ac_status=$?
8439   echo "$as_me:8439: \$? = $ac_status" >&5
8440   (exit $ac_status); }; }; then
8441   ac_cv_lib_gpm_initscr=yes
8442 else
8443   echo "$as_me: failed program was:" >&5
8444 cat conftest.$ac_ext >&5
8445 ac_cv_lib_gpm_initscr=no
8446 fi
8447 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8448 LIBS=$ac_check_lib_save_LIBS
8449 fi
8450 echo "$as_me:8450: result: $ac_cv_lib_gpm_initscr" >&5
8451 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8452 if test $ac_cv_lib_gpm_initscr = yes; then
8453   LIBS="$cf_ncurses_SAVE"
8454 else
8455   cf_ncurses_LIBS="-lgpm"
8456 fi
8457
8458 fi
8459
8460 case $host_os in #(vi
8461 freebsd*)
8462         # This is only necessary if you are linking against an obsolete
8463         # version of ncurses (but it should do no harm, since it's static).
8464         if test "$cf_nculib_root" = ncurses ; then
8465                 echo "$as_me:8465: checking for tgoto in -lmytinfo" >&5
8466 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8467 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8468   echo $ECHO_N "(cached) $ECHO_C" >&6
8469 else
8470   ac_check_lib_save_LIBS=$LIBS
8471 LIBS="-lmytinfo  $LIBS"
8472 cat >conftest.$ac_ext <<_ACEOF
8473 #line 8473 "configure"
8474 #include "confdefs.h"
8475
8476 /* Override any gcc2 internal prototype to avoid an error.  */
8477 #ifdef __cplusplus
8478 extern "C"
8479 #endif
8480 /* We use char because int might match the return type of a gcc2
8481    builtin and then its argument prototype would still apply.  */
8482 char tgoto ();
8483 int
8484 main ()
8485 {
8486 tgoto ();
8487   ;
8488   return 0;
8489 }
8490 _ACEOF
8491 rm -f conftest.$ac_objext conftest$ac_exeext
8492 if { (eval echo "$as_me:8492: \"$ac_link\"") >&5
8493   (eval $ac_link) 2>&5
8494   ac_status=$?
8495   echo "$as_me:8495: \$? = $ac_status" >&5
8496   (exit $ac_status); } &&
8497          { ac_try='test -s conftest$ac_exeext'
8498   { (eval echo "$as_me:8498: \"$ac_try\"") >&5
8499   (eval $ac_try) 2>&5
8500   ac_status=$?
8501   echo "$as_me:8501: \$? = $ac_status" >&5
8502   (exit $ac_status); }; }; then
8503   ac_cv_lib_mytinfo_tgoto=yes
8504 else
8505   echo "$as_me: failed program was:" >&5
8506 cat conftest.$ac_ext >&5
8507 ac_cv_lib_mytinfo_tgoto=no
8508 fi
8509 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8510 LIBS=$ac_check_lib_save_LIBS
8511 fi
8512 echo "$as_me:8512: result: $ac_cv_lib_mytinfo_tgoto" >&5
8513 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8514 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8515   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8516 fi
8517
8518         fi
8519         ;;
8520 esac
8521
8522 LIBS="$cf_ncurses_LIBS $LIBS"
8523
8524 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8525 then
8526         LIBS="-l$cf_nculib_root $LIBS"
8527 else
8528
8529         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8530         cf_libdir=""
8531         echo "$as_me:8531: checking for initscr" >&5
8532 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8533 if test "${ac_cv_func_initscr+set}" = set; then
8534   echo $ECHO_N "(cached) $ECHO_C" >&6
8535 else
8536   cat >conftest.$ac_ext <<_ACEOF
8537 #line 8537 "configure"
8538 #include "confdefs.h"
8539 /* System header to define __stub macros and hopefully few prototypes,
8540     which can conflict with char initscr (); below.  */
8541 #include <assert.h>
8542 /* Override any gcc2 internal prototype to avoid an error.  */
8543 #ifdef __cplusplus
8544 extern "C"
8545 #endif
8546 /* We use char because int might match the return type of a gcc2
8547    builtin and then its argument prototype would still apply.  */
8548 char initscr ();
8549 char (*f) ();
8550
8551 int
8552 main ()
8553 {
8554 /* The GNU C library defines this for functions which it implements
8555     to always fail with ENOSYS.  Some functions are actually named
8556     something starting with __ and the normal name is an alias.  */
8557 #if defined (__stub_initscr) || defined (__stub___initscr)
8558 choke me
8559 #else
8560 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8561 #endif
8562
8563   ;
8564   return 0;
8565 }
8566 _ACEOF
8567 rm -f conftest.$ac_objext conftest$ac_exeext
8568 if { (eval echo "$as_me:8568: \"$ac_link\"") >&5
8569   (eval $ac_link) 2>&5
8570   ac_status=$?
8571   echo "$as_me:8571: \$? = $ac_status" >&5
8572   (exit $ac_status); } &&
8573          { ac_try='test -s conftest$ac_exeext'
8574   { (eval echo "$as_me:8574: \"$ac_try\"") >&5
8575   (eval $ac_try) 2>&5
8576   ac_status=$?
8577   echo "$as_me:8577: \$? = $ac_status" >&5
8578   (exit $ac_status); }; }; then
8579   ac_cv_func_initscr=yes
8580 else
8581   echo "$as_me: failed program was:" >&5
8582 cat conftest.$ac_ext >&5
8583 ac_cv_func_initscr=no
8584 fi
8585 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8586 fi
8587 echo "$as_me:8587: result: $ac_cv_func_initscr" >&5
8588 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8589 if test $ac_cv_func_initscr = yes; then
8590   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8591 else
8592
8593                 cf_save_LIBS="$LIBS"
8594                 echo "$as_me:8594: checking for initscr in -l$cf_nculib_root" >&5
8595 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8596                 LIBS="-l$cf_nculib_root $LIBS"
8597                 cat >conftest.$ac_ext <<_ACEOF
8598 #line 8598 "configure"
8599 #include "confdefs.h"
8600 #include <${cf_cv_ncurses_header:-curses.h}>
8601 int
8602 main ()
8603 {
8604 initscr()
8605   ;
8606   return 0;
8607 }
8608 _ACEOF
8609 rm -f conftest.$ac_objext conftest$ac_exeext
8610 if { (eval echo "$as_me:8610: \"$ac_link\"") >&5
8611   (eval $ac_link) 2>&5
8612   ac_status=$?
8613   echo "$as_me:8613: \$? = $ac_status" >&5
8614   (exit $ac_status); } &&
8615          { ac_try='test -s conftest$ac_exeext'
8616   { (eval echo "$as_me:8616: \"$ac_try\"") >&5
8617   (eval $ac_try) 2>&5
8618   ac_status=$?
8619   echo "$as_me:8619: \$? = $ac_status" >&5
8620   (exit $ac_status); }; }; then
8621   echo "$as_me:8621: result: yes" >&5
8622 echo "${ECHO_T}yes" >&6
8623                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8624
8625 else
8626   echo "$as_me: failed program was:" >&5
8627 cat conftest.$ac_ext >&5
8628 echo "$as_me:8628: result: no" >&5
8629 echo "${ECHO_T}no" >&6
8630
8631 cf_search=
8632 cf_library_path_list=""
8633 if test -n "${LDFLAGS}${LIBS}" ; then
8634         for cf_library_path in $LDFLAGS $LIBS
8635         do
8636                 case $cf_library_path in #(vi
8637                 -L*)
8638                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8639
8640 test "x$cf_library_path" != "xNONE" && \
8641 test -d "$cf_library_path" && \
8642  {
8643         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8644         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8645         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8646         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8647         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8648         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"
8649 }
8650
8651                         cf_library_path_list="$cf_library_path_list $cf_search"
8652                         ;;
8653                 esac
8654         done
8655 fi
8656
8657 cf_search=
8658
8659 test "x/usr" != "x$prefix" && \
8660 test -d "/usr" && \
8661 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
8662         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
8663         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
8664         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
8665         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
8666         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
8667         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
8668 }
8669
8670 test "x$prefix" != "xNONE" && \
8671 test -d "$prefix" && \
8672  {
8673         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8674         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8675         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8676         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8677         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8678         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8679 }
8680
8681 test "x/usr/local" != "x$prefix" && \
8682 test -d "/usr/local" && \
8683 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
8684         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
8685         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
8686         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
8687         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
8688         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
8689         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
8690 }
8691
8692 test "x/opt" != "x$prefix" && \
8693 test -d "/opt" && \
8694 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
8695         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
8696         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
8697         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
8698         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
8699         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
8700         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
8701 }
8702
8703 test "x$HOME" != "x$prefix" && \
8704 test -d "$HOME" && \
8705 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
8706         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
8707         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
8708         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
8709         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
8710         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
8711         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
8712 }
8713
8714 cf_search="$cf_library_path_list $cf_search"
8715
8716                         for cf_libdir in $cf_search
8717                         do
8718                                 echo "$as_me:8718: checking for -l$cf_nculib_root in $cf_libdir" >&5
8719 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8720                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8721                                 cat >conftest.$ac_ext <<_ACEOF
8722 #line 8722 "configure"
8723 #include "confdefs.h"
8724 #include <${cf_cv_ncurses_header:-curses.h}>
8725 int
8726 main ()
8727 {
8728 initscr()
8729   ;
8730   return 0;
8731 }
8732 _ACEOF
8733 rm -f conftest.$ac_objext conftest$ac_exeext
8734 if { (eval echo "$as_me:8734: \"$ac_link\"") >&5
8735   (eval $ac_link) 2>&5
8736   ac_status=$?
8737   echo "$as_me:8737: \$? = $ac_status" >&5
8738   (exit $ac_status); } &&
8739          { ac_try='test -s conftest$ac_exeext'
8740   { (eval echo "$as_me:8740: \"$ac_try\"") >&5
8741   (eval $ac_try) 2>&5
8742   ac_status=$?
8743   echo "$as_me:8743: \$? = $ac_status" >&5
8744   (exit $ac_status); }; }; then
8745   echo "$as_me:8745: result: yes" >&5
8746 echo "${ECHO_T}yes" >&6
8747                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8748                                          break
8749 else
8750   echo "$as_me: failed program was:" >&5
8751 cat conftest.$ac_ext >&5
8752 echo "$as_me:8752: result: no" >&5
8753 echo "${ECHO_T}no" >&6
8754                                          LIBS="$cf_save_LIBS"
8755 fi
8756 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8757                         done
8758
8759 fi
8760 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8761
8762 fi
8763
8764 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8765
8766 if test $cf_found_library = no ; then
8767         { { echo "$as_me:8767: error: Cannot link $cf_nculib_root library" >&5
8768 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8769    { (exit 1); exit 1; }; }
8770 fi
8771
8772 fi
8773
8774 if test -n "$cf_ncurses_LIBS" ; then
8775         echo "$as_me:8775: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8776 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8777         cf_ncurses_SAVE="$LIBS"
8778         for p in $cf_ncurses_LIBS ; do
8779                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8780                 if test "$q" != "$LIBS" ; then
8781                         LIBS="$q"
8782                 fi
8783         done
8784         cat >conftest.$ac_ext <<_ACEOF
8785 #line 8785 "configure"
8786 #include "confdefs.h"
8787 #include <${cf_cv_ncurses_header:-curses.h}>
8788 int
8789 main ()
8790 {
8791 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8792   ;
8793   return 0;
8794 }
8795 _ACEOF
8796 rm -f conftest.$ac_objext conftest$ac_exeext
8797 if { (eval echo "$as_me:8797: \"$ac_link\"") >&5
8798   (eval $ac_link) 2>&5
8799   ac_status=$?
8800   echo "$as_me:8800: \$? = $ac_status" >&5
8801   (exit $ac_status); } &&
8802          { ac_try='test -s conftest$ac_exeext'
8803   { (eval echo "$as_me:8803: \"$ac_try\"") >&5
8804   (eval $ac_try) 2>&5
8805   ac_status=$?
8806   echo "$as_me:8806: \$? = $ac_status" >&5
8807   (exit $ac_status); }; }; then
8808   echo "$as_me:8808: result: yes" >&5
8809 echo "${ECHO_T}yes" >&6
8810 else
8811   echo "$as_me: failed program was:" >&5
8812 cat conftest.$ac_ext >&5
8813 echo "$as_me:8813: result: no" >&5
8814 echo "${ECHO_T}no" >&6
8815                  LIBS="$cf_ncurses_SAVE"
8816 fi
8817 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8818 fi
8819
8820 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8821
8822 cat >>confdefs.h <<EOF
8823 #define $cf_nculib_ROOT 1
8824 EOF
8825
8826 fi
8827
8828         ;;
8829 pdcurses)
8830         echo "$as_me:8830: checking for X" >&5
8831 echo $ECHO_N "checking for X... $ECHO_C" >&6
8832
8833 # Check whether --with-x or --without-x was given.
8834 if test "${with_x+set}" = set; then
8835   withval="$with_x"
8836
8837 fi;
8838 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
8839 if test "x$with_x" = xno; then
8840   # The user explicitly disabled X.
8841   have_x=disabled
8842 else
8843   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
8844     # Both variables are already set.
8845     have_x=yes
8846   else
8847     if test "${ac_cv_have_x+set}" = set; then
8848   echo $ECHO_N "(cached) $ECHO_C" >&6
8849 else
8850   # One or both of the vars are not set, and there is no cached value.
8851 ac_x_includes=no ac_x_libraries=no
8852 rm -fr conftest.dir
8853 if mkdir conftest.dir; then
8854   cd conftest.dir
8855   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
8856   cat >Imakefile <<'EOF'
8857 acfindx:
8858         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
8859 EOF
8860   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
8861     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
8862     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
8863     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
8864     for ac_extension in a so sl dylib dll; do
8865       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
8866          test -f $ac_im_libdir/libX11.$ac_extension; then
8867         ac_im_usrlibdir=$ac_im_libdir; break
8868       fi
8869     done
8870     # Screen out bogus values from the imake configuration.  They are
8871     # bogus both because they are the default anyway, and because
8872     # using them would break gcc on systems where it needs fixed includes.
8873     case $ac_im_incroot in
8874         /usr/include) ;;
8875         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
8876     esac
8877     case $ac_im_usrlibdir in
8878         /usr/lib | /lib) ;;
8879         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
8880     esac
8881   fi
8882   cd ..
8883   rm -fr conftest.dir
8884 fi
8885
8886 # Standard set of common directories for X headers.
8887 # Check X11 before X11Rn because it is often a symlink to the current release.
8888 ac_x_header_dirs='
8889 /usr/X11/include
8890 /usr/X11R6/include
8891 /usr/X11R5/include
8892 /usr/X11R4/include
8893
8894 /usr/include/X11
8895 /usr/include/X11R6
8896 /usr/include/X11R5
8897 /usr/include/X11R4
8898
8899 /usr/local/X11/include
8900 /usr/local/X11R6/include
8901 /usr/local/X11R5/include
8902 /usr/local/X11R4/include
8903
8904 /usr/local/include/X11
8905 /usr/local/include/X11R6
8906 /usr/local/include/X11R5
8907 /usr/local/include/X11R4
8908
8909 /usr/X386/include
8910 /usr/x386/include
8911 /usr/XFree86/include/X11
8912
8913 /usr/include
8914 /usr/local/include
8915 /usr/unsupported/include
8916 /usr/athena/include
8917 /usr/local/x11r5/include
8918 /usr/lpp/Xamples/include
8919
8920 /usr/openwin/include
8921 /usr/openwin/share/include'
8922
8923 if test "$ac_x_includes" = no; then
8924   # Guess where to find include files, by looking for Intrinsic.h.
8925   # First, try using that file with no special directory specified.
8926   cat >conftest.$ac_ext <<_ACEOF
8927 #line 8927 "configure"
8928 #include "confdefs.h"
8929 #include <X11/Intrinsic.h>
8930 _ACEOF
8931 if { (eval echo "$as_me:8931: \"$ac_cpp conftest.$ac_ext\"") >&5
8932   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8933   ac_status=$?
8934   egrep -v '^ *\+' conftest.er1 >conftest.err
8935   rm -f conftest.er1
8936   cat conftest.err >&5
8937   echo "$as_me:8937: \$? = $ac_status" >&5
8938   (exit $ac_status); } >/dev/null; then
8939   if test -s conftest.err; then
8940     ac_cpp_err=$ac_c_preproc_warn_flag
8941   else
8942     ac_cpp_err=
8943   fi
8944 else
8945   ac_cpp_err=yes
8946 fi
8947 if test -z "$ac_cpp_err"; then
8948   # We can compile using X headers with no special include directory.
8949 ac_x_includes=
8950 else
8951   echo "$as_me: failed program was:" >&5
8952   cat conftest.$ac_ext >&5
8953   for ac_dir in $ac_x_header_dirs; do
8954   if test -r "$ac_dir/X11/Intrinsic.h"; then
8955     ac_x_includes=$ac_dir
8956     break
8957   fi
8958 done
8959 fi
8960 rm -f conftest.err conftest.$ac_ext
8961 fi # $ac_x_includes = no
8962
8963 if test "$ac_x_libraries" = no; then
8964   # Check for the libraries.
8965   # See if we find them without any special options.
8966   # Don't add to $LIBS permanently.
8967   ac_save_LIBS=$LIBS
8968   LIBS="-lXt $LIBS"
8969   cat >conftest.$ac_ext <<_ACEOF
8970 #line 8970 "configure"
8971 #include "confdefs.h"
8972 #include <X11/Intrinsic.h>
8973 int
8974 main ()
8975 {
8976 XtMalloc (0)
8977   ;
8978   return 0;
8979 }
8980 _ACEOF
8981 rm -f conftest.$ac_objext conftest$ac_exeext
8982 if { (eval echo "$as_me:8982: \"$ac_link\"") >&5
8983   (eval $ac_link) 2>&5
8984   ac_status=$?
8985   echo "$as_me:8985: \$? = $ac_status" >&5
8986   (exit $ac_status); } &&
8987          { ac_try='test -s conftest$ac_exeext'
8988   { (eval echo "$as_me:8988: \"$ac_try\"") >&5
8989   (eval $ac_try) 2>&5
8990   ac_status=$?
8991   echo "$as_me:8991: \$? = $ac_status" >&5
8992   (exit $ac_status); }; }; then
8993   LIBS=$ac_save_LIBS
8994 # We can link X programs with no special library path.
8995 ac_x_libraries=
8996 else
8997   echo "$as_me: failed program was:" >&5
8998 cat conftest.$ac_ext >&5
8999 LIBS=$ac_save_LIBS
9000 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9001 do
9002   # Don't even attempt the hair of trying to link an X program!
9003   for ac_extension in a so sl dylib dll; do
9004     if test -r $ac_dir/libXt.$ac_extension; then
9005       ac_x_libraries=$ac_dir
9006       break 2
9007     fi
9008   done
9009 done
9010 fi
9011 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9012 fi # $ac_x_libraries = no
9013
9014 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9015   # Didn't find X anywhere.  Cache the known absence of X.
9016   ac_cv_have_x="have_x=no"
9017 else
9018   # Record where we found X for the cache.
9019   ac_cv_have_x="have_x=yes \
9020                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9021 fi
9022 fi
9023
9024   fi
9025   eval "$ac_cv_have_x"
9026 fi # $with_x != no
9027
9028 if test "$have_x" != yes; then
9029   echo "$as_me:9029: result: $have_x" >&5
9030 echo "${ECHO_T}$have_x" >&6
9031   no_x=yes
9032 else
9033   # If each of the values was on the command line, it overrides each guess.
9034   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9035   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9036   # Update the cache value to reflect the command line values.
9037   ac_cv_have_x="have_x=yes \
9038                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9039   echo "$as_me:9039: result: libraries $x_libraries, headers $x_includes" >&5
9040 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9041 fi
9042
9043 if test "$no_x" = yes; then
9044   # Not all programs may use this symbol, but it does not hurt to define it.
9045
9046 cat >>confdefs.h <<\EOF
9047 #define X_DISPLAY_MISSING 1
9048 EOF
9049
9050   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9051 else
9052   if test -n "$x_includes"; then
9053     X_CFLAGS="$X_CFLAGS -I$x_includes"
9054   fi
9055
9056   # It would also be nice to do this for all -L options, not just this one.
9057   if test -n "$x_libraries"; then
9058     X_LIBS="$X_LIBS -L$x_libraries"
9059     # For Solaris; some versions of Sun CC require a space after -R and
9060     # others require no space.  Words are not sufficient . . . .
9061     case `(uname -sr) 2>/dev/null` in
9062     "SunOS 5"*)
9063       echo "$as_me:9063: checking whether -R must be followed by a space" >&5
9064 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9065       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9066       cat >conftest.$ac_ext <<_ACEOF
9067 #line 9067 "configure"
9068 #include "confdefs.h"
9069
9070 int
9071 main ()
9072 {
9073
9074   ;
9075   return 0;
9076 }
9077 _ACEOF
9078 rm -f conftest.$ac_objext conftest$ac_exeext
9079 if { (eval echo "$as_me:9079: \"$ac_link\"") >&5
9080   (eval $ac_link) 2>&5
9081   ac_status=$?
9082   echo "$as_me:9082: \$? = $ac_status" >&5
9083   (exit $ac_status); } &&
9084          { ac_try='test -s conftest$ac_exeext'
9085   { (eval echo "$as_me:9085: \"$ac_try\"") >&5
9086   (eval $ac_try) 2>&5
9087   ac_status=$?
9088   echo "$as_me:9088: \$? = $ac_status" >&5
9089   (exit $ac_status); }; }; then
9090   ac_R_nospace=yes
9091 else
9092   echo "$as_me: failed program was:" >&5
9093 cat conftest.$ac_ext >&5
9094 ac_R_nospace=no
9095 fi
9096 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9097       if test $ac_R_nospace = yes; then
9098         echo "$as_me:9098: result: no" >&5
9099 echo "${ECHO_T}no" >&6
9100         X_LIBS="$X_LIBS -R$x_libraries"
9101       else
9102         LIBS="$ac_xsave_LIBS -R $x_libraries"
9103         cat >conftest.$ac_ext <<_ACEOF
9104 #line 9104 "configure"
9105 #include "confdefs.h"
9106
9107 int
9108 main ()
9109 {
9110
9111   ;
9112   return 0;
9113 }
9114 _ACEOF
9115 rm -f conftest.$ac_objext conftest$ac_exeext
9116 if { (eval echo "$as_me:9116: \"$ac_link\"") >&5
9117   (eval $ac_link) 2>&5
9118   ac_status=$?
9119   echo "$as_me:9119: \$? = $ac_status" >&5
9120   (exit $ac_status); } &&
9121          { ac_try='test -s conftest$ac_exeext'
9122   { (eval echo "$as_me:9122: \"$ac_try\"") >&5
9123   (eval $ac_try) 2>&5
9124   ac_status=$?
9125   echo "$as_me:9125: \$? = $ac_status" >&5
9126   (exit $ac_status); }; }; then
9127   ac_R_space=yes
9128 else
9129   echo "$as_me: failed program was:" >&5
9130 cat conftest.$ac_ext >&5
9131 ac_R_space=no
9132 fi
9133 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9134         if test $ac_R_space = yes; then
9135           echo "$as_me:9135: result: yes" >&5
9136 echo "${ECHO_T}yes" >&6
9137           X_LIBS="$X_LIBS -R $x_libraries"
9138         else
9139           echo "$as_me:9139: result: neither works" >&5
9140 echo "${ECHO_T}neither works" >&6
9141         fi
9142       fi
9143       LIBS=$ac_xsave_LIBS
9144     esac
9145   fi
9146
9147   # Check for system-dependent libraries X programs must link with.
9148   # Do this before checking for the system-independent R6 libraries
9149   # (-lICE), since we may need -lsocket or whatever for X linking.
9150
9151   if test "$ISC" = yes; then
9152     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9153   else
9154     # Martyn Johnson says this is needed for Ultrix, if the X
9155     # libraries were built with DECnet support.  And Karl Berry says
9156     # the Alpha needs dnet_stub (dnet does not exist).
9157     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9158     cat >conftest.$ac_ext <<_ACEOF
9159 #line 9159 "configure"
9160 #include "confdefs.h"
9161
9162 /* Override any gcc2 internal prototype to avoid an error.  */
9163 #ifdef __cplusplus
9164 extern "C"
9165 #endif
9166 /* We use char because int might match the return type of a gcc2
9167    builtin and then its argument prototype would still apply.  */
9168 char XOpenDisplay ();
9169 int
9170 main ()
9171 {
9172 XOpenDisplay ();
9173   ;
9174   return 0;
9175 }
9176 _ACEOF
9177 rm -f conftest.$ac_objext conftest$ac_exeext
9178 if { (eval echo "$as_me:9178: \"$ac_link\"") >&5
9179   (eval $ac_link) 2>&5
9180   ac_status=$?
9181   echo "$as_me:9181: \$? = $ac_status" >&5
9182   (exit $ac_status); } &&
9183          { ac_try='test -s conftest$ac_exeext'
9184   { (eval echo "$as_me:9184: \"$ac_try\"") >&5
9185   (eval $ac_try) 2>&5
9186   ac_status=$?
9187   echo "$as_me:9187: \$? = $ac_status" >&5
9188   (exit $ac_status); }; }; then
9189   :
9190 else
9191   echo "$as_me: failed program was:" >&5
9192 cat conftest.$ac_ext >&5
9193 echo "$as_me:9193: checking for dnet_ntoa in -ldnet" >&5
9194 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9195 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9196   echo $ECHO_N "(cached) $ECHO_C" >&6
9197 else
9198   ac_check_lib_save_LIBS=$LIBS
9199 LIBS="-ldnet  $LIBS"
9200 cat >conftest.$ac_ext <<_ACEOF
9201 #line 9201 "configure"
9202 #include "confdefs.h"
9203
9204 /* Override any gcc2 internal prototype to avoid an error.  */
9205 #ifdef __cplusplus
9206 extern "C"
9207 #endif
9208 /* We use char because int might match the return type of a gcc2
9209    builtin and then its argument prototype would still apply.  */
9210 char dnet_ntoa ();
9211 int
9212 main ()
9213 {
9214 dnet_ntoa ();
9215   ;
9216   return 0;
9217 }
9218 _ACEOF
9219 rm -f conftest.$ac_objext conftest$ac_exeext
9220 if { (eval echo "$as_me:9220: \"$ac_link\"") >&5
9221   (eval $ac_link) 2>&5
9222   ac_status=$?
9223   echo "$as_me:9223: \$? = $ac_status" >&5
9224   (exit $ac_status); } &&
9225          { ac_try='test -s conftest$ac_exeext'
9226   { (eval echo "$as_me:9226: \"$ac_try\"") >&5
9227   (eval $ac_try) 2>&5
9228   ac_status=$?
9229   echo "$as_me:9229: \$? = $ac_status" >&5
9230   (exit $ac_status); }; }; then
9231   ac_cv_lib_dnet_dnet_ntoa=yes
9232 else
9233   echo "$as_me: failed program was:" >&5
9234 cat conftest.$ac_ext >&5
9235 ac_cv_lib_dnet_dnet_ntoa=no
9236 fi
9237 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9238 LIBS=$ac_check_lib_save_LIBS
9239 fi
9240 echo "$as_me:9240: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9241 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9242 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9243   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9244 fi
9245
9246     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9247       echo "$as_me:9247: checking for dnet_ntoa in -ldnet_stub" >&5
9248 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9249 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9250   echo $ECHO_N "(cached) $ECHO_C" >&6
9251 else
9252   ac_check_lib_save_LIBS=$LIBS
9253 LIBS="-ldnet_stub  $LIBS"
9254 cat >conftest.$ac_ext <<_ACEOF
9255 #line 9255 "configure"
9256 #include "confdefs.h"
9257
9258 /* Override any gcc2 internal prototype to avoid an error.  */
9259 #ifdef __cplusplus
9260 extern "C"
9261 #endif
9262 /* We use char because int might match the return type of a gcc2
9263    builtin and then its argument prototype would still apply.  */
9264 char dnet_ntoa ();
9265 int
9266 main ()
9267 {
9268 dnet_ntoa ();
9269   ;
9270   return 0;
9271 }
9272 _ACEOF
9273 rm -f conftest.$ac_objext conftest$ac_exeext
9274 if { (eval echo "$as_me:9274: \"$ac_link\"") >&5
9275   (eval $ac_link) 2>&5
9276   ac_status=$?
9277   echo "$as_me:9277: \$? = $ac_status" >&5
9278   (exit $ac_status); } &&
9279          { ac_try='test -s conftest$ac_exeext'
9280   { (eval echo "$as_me:9280: \"$ac_try\"") >&5
9281   (eval $ac_try) 2>&5
9282   ac_status=$?
9283   echo "$as_me:9283: \$? = $ac_status" >&5
9284   (exit $ac_status); }; }; then
9285   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9286 else
9287   echo "$as_me: failed program was:" >&5
9288 cat conftest.$ac_ext >&5
9289 ac_cv_lib_dnet_stub_dnet_ntoa=no
9290 fi
9291 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9292 LIBS=$ac_check_lib_save_LIBS
9293 fi
9294 echo "$as_me:9294: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9295 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9296 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9297   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9298 fi
9299
9300     fi
9301 fi
9302 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9303     LIBS="$ac_xsave_LIBS"
9304
9305     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9306     # to get the SysV transport functions.
9307     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9308     # needs -lnsl.
9309     # The nsl library prevents programs from opening the X display
9310     # on Irix 5.2, according to T.E. Dickey.
9311     # The functions gethostbyname, getservbyname, and inet_addr are
9312     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9313     echo "$as_me:9313: checking for gethostbyname" >&5
9314 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9315 if test "${ac_cv_func_gethostbyname+set}" = set; then
9316   echo $ECHO_N "(cached) $ECHO_C" >&6
9317 else
9318   cat >conftest.$ac_ext <<_ACEOF
9319 #line 9319 "configure"
9320 #include "confdefs.h"
9321 /* System header to define __stub macros and hopefully few prototypes,
9322     which can conflict with char gethostbyname (); below.  */
9323 #include <assert.h>
9324 /* Override any gcc2 internal prototype to avoid an error.  */
9325 #ifdef __cplusplus
9326 extern "C"
9327 #endif
9328 /* We use char because int might match the return type of a gcc2
9329    builtin and then its argument prototype would still apply.  */
9330 char gethostbyname ();
9331 char (*f) ();
9332
9333 int
9334 main ()
9335 {
9336 /* The GNU C library defines this for functions which it implements
9337     to always fail with ENOSYS.  Some functions are actually named
9338     something starting with __ and the normal name is an alias.  */
9339 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9340 choke me
9341 #else
9342 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9343 #endif
9344
9345   ;
9346   return 0;
9347 }
9348 _ACEOF
9349 rm -f conftest.$ac_objext conftest$ac_exeext
9350 if { (eval echo "$as_me:9350: \"$ac_link\"") >&5
9351   (eval $ac_link) 2>&5
9352   ac_status=$?
9353   echo "$as_me:9353: \$? = $ac_status" >&5
9354   (exit $ac_status); } &&
9355          { ac_try='test -s conftest$ac_exeext'
9356   { (eval echo "$as_me:9356: \"$ac_try\"") >&5
9357   (eval $ac_try) 2>&5
9358   ac_status=$?
9359   echo "$as_me:9359: \$? = $ac_status" >&5
9360   (exit $ac_status); }; }; then
9361   ac_cv_func_gethostbyname=yes
9362 else
9363   echo "$as_me: failed program was:" >&5
9364 cat conftest.$ac_ext >&5
9365 ac_cv_func_gethostbyname=no
9366 fi
9367 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9368 fi
9369 echo "$as_me:9369: result: $ac_cv_func_gethostbyname" >&5
9370 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9371
9372     if test $ac_cv_func_gethostbyname = no; then
9373       echo "$as_me:9373: checking for gethostbyname in -lnsl" >&5
9374 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9375 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9376   echo $ECHO_N "(cached) $ECHO_C" >&6
9377 else
9378   ac_check_lib_save_LIBS=$LIBS
9379 LIBS="-lnsl  $LIBS"
9380 cat >conftest.$ac_ext <<_ACEOF
9381 #line 9381 "configure"
9382 #include "confdefs.h"
9383
9384 /* Override any gcc2 internal prototype to avoid an error.  */
9385 #ifdef __cplusplus
9386 extern "C"
9387 #endif
9388 /* We use char because int might match the return type of a gcc2
9389    builtin and then its argument prototype would still apply.  */
9390 char gethostbyname ();
9391 int
9392 main ()
9393 {
9394 gethostbyname ();
9395   ;
9396   return 0;
9397 }
9398 _ACEOF
9399 rm -f conftest.$ac_objext conftest$ac_exeext
9400 if { (eval echo "$as_me:9400: \"$ac_link\"") >&5
9401   (eval $ac_link) 2>&5
9402   ac_status=$?
9403   echo "$as_me:9403: \$? = $ac_status" >&5
9404   (exit $ac_status); } &&
9405          { ac_try='test -s conftest$ac_exeext'
9406   { (eval echo "$as_me:9406: \"$ac_try\"") >&5
9407   (eval $ac_try) 2>&5
9408   ac_status=$?
9409   echo "$as_me:9409: \$? = $ac_status" >&5
9410   (exit $ac_status); }; }; then
9411   ac_cv_lib_nsl_gethostbyname=yes
9412 else
9413   echo "$as_me: failed program was:" >&5
9414 cat conftest.$ac_ext >&5
9415 ac_cv_lib_nsl_gethostbyname=no
9416 fi
9417 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9418 LIBS=$ac_check_lib_save_LIBS
9419 fi
9420 echo "$as_me:9420: result: $ac_cv_lib_nsl_gethostbyname" >&5
9421 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9422 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9423   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9424 fi
9425
9426       if test $ac_cv_lib_nsl_gethostbyname = no; then
9427         echo "$as_me:9427: checking for gethostbyname in -lbsd" >&5
9428 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9429 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9430   echo $ECHO_N "(cached) $ECHO_C" >&6
9431 else
9432   ac_check_lib_save_LIBS=$LIBS
9433 LIBS="-lbsd  $LIBS"
9434 cat >conftest.$ac_ext <<_ACEOF
9435 #line 9435 "configure"
9436 #include "confdefs.h"
9437
9438 /* Override any gcc2 internal prototype to avoid an error.  */
9439 #ifdef __cplusplus
9440 extern "C"
9441 #endif
9442 /* We use char because int might match the return type of a gcc2
9443    builtin and then its argument prototype would still apply.  */
9444 char gethostbyname ();
9445 int
9446 main ()
9447 {
9448 gethostbyname ();
9449   ;
9450   return 0;
9451 }
9452 _ACEOF
9453 rm -f conftest.$ac_objext conftest$ac_exeext
9454 if { (eval echo "$as_me:9454: \"$ac_link\"") >&5
9455   (eval $ac_link) 2>&5
9456   ac_status=$?
9457   echo "$as_me:9457: \$? = $ac_status" >&5
9458   (exit $ac_status); } &&
9459          { ac_try='test -s conftest$ac_exeext'
9460   { (eval echo "$as_me:9460: \"$ac_try\"") >&5
9461   (eval $ac_try) 2>&5
9462   ac_status=$?
9463   echo "$as_me:9463: \$? = $ac_status" >&5
9464   (exit $ac_status); }; }; then
9465   ac_cv_lib_bsd_gethostbyname=yes
9466 else
9467   echo "$as_me: failed program was:" >&5
9468 cat conftest.$ac_ext >&5
9469 ac_cv_lib_bsd_gethostbyname=no
9470 fi
9471 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9472 LIBS=$ac_check_lib_save_LIBS
9473 fi
9474 echo "$as_me:9474: result: $ac_cv_lib_bsd_gethostbyname" >&5
9475 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
9476 if test $ac_cv_lib_bsd_gethostbyname = yes; then
9477   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
9478 fi
9479
9480       fi
9481     fi
9482
9483     # lieder@skyler.mavd.honeywell.com says without -lsocket,
9484     # socket/setsockopt and other routines are undefined under SCO ODT
9485     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
9486     # on later versions), says Simon Leinen: it contains gethostby*
9487     # variants that don't use the nameserver (or something).  -lsocket
9488     # must be given before -lnsl if both are needed.  We assume that
9489     # if connect needs -lnsl, so does gethostbyname.
9490     echo "$as_me:9490: checking for connect" >&5
9491 echo $ECHO_N "checking for connect... $ECHO_C" >&6
9492 if test "${ac_cv_func_connect+set}" = set; then
9493   echo $ECHO_N "(cached) $ECHO_C" >&6
9494 else
9495   cat >conftest.$ac_ext <<_ACEOF
9496 #line 9496 "configure"
9497 #include "confdefs.h"
9498 /* System header to define __stub macros and hopefully few prototypes,
9499     which can conflict with char connect (); below.  */
9500 #include <assert.h>
9501 /* Override any gcc2 internal prototype to avoid an error.  */
9502 #ifdef __cplusplus
9503 extern "C"
9504 #endif
9505 /* We use char because int might match the return type of a gcc2
9506    builtin and then its argument prototype would still apply.  */
9507 char connect ();
9508 char (*f) ();
9509
9510 int
9511 main ()
9512 {
9513 /* The GNU C library defines this for functions which it implements
9514     to always fail with ENOSYS.  Some functions are actually named
9515     something starting with __ and the normal name is an alias.  */
9516 #if defined (__stub_connect) || defined (__stub___connect)
9517 choke me
9518 #else
9519 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9520 #endif
9521
9522   ;
9523   return 0;
9524 }
9525 _ACEOF
9526 rm -f conftest.$ac_objext conftest$ac_exeext
9527 if { (eval echo "$as_me:9527: \"$ac_link\"") >&5
9528   (eval $ac_link) 2>&5
9529   ac_status=$?
9530   echo "$as_me:9530: \$? = $ac_status" >&5
9531   (exit $ac_status); } &&
9532          { ac_try='test -s conftest$ac_exeext'
9533   { (eval echo "$as_me:9533: \"$ac_try\"") >&5
9534   (eval $ac_try) 2>&5
9535   ac_status=$?
9536   echo "$as_me:9536: \$? = $ac_status" >&5
9537   (exit $ac_status); }; }; then
9538   ac_cv_func_connect=yes
9539 else
9540   echo "$as_me: failed program was:" >&5
9541 cat conftest.$ac_ext >&5
9542 ac_cv_func_connect=no
9543 fi
9544 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9545 fi
9546 echo "$as_me:9546: result: $ac_cv_func_connect" >&5
9547 echo "${ECHO_T}$ac_cv_func_connect" >&6
9548
9549     if test $ac_cv_func_connect = no; then
9550       echo "$as_me:9550: checking for connect in -lsocket" >&5
9551 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
9552 if test "${ac_cv_lib_socket_connect+set}" = set; then
9553   echo $ECHO_N "(cached) $ECHO_C" >&6
9554 else
9555   ac_check_lib_save_LIBS=$LIBS
9556 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
9557 cat >conftest.$ac_ext <<_ACEOF
9558 #line 9558 "configure"
9559 #include "confdefs.h"
9560
9561 /* Override any gcc2 internal prototype to avoid an error.  */
9562 #ifdef __cplusplus
9563 extern "C"
9564 #endif
9565 /* We use char because int might match the return type of a gcc2
9566    builtin and then its argument prototype would still apply.  */
9567 char connect ();
9568 int
9569 main ()
9570 {
9571 connect ();
9572   ;
9573   return 0;
9574 }
9575 _ACEOF
9576 rm -f conftest.$ac_objext conftest$ac_exeext
9577 if { (eval echo "$as_me:9577: \"$ac_link\"") >&5
9578   (eval $ac_link) 2>&5
9579   ac_status=$?
9580   echo "$as_me:9580: \$? = $ac_status" >&5
9581   (exit $ac_status); } &&
9582          { ac_try='test -s conftest$ac_exeext'
9583   { (eval echo "$as_me:9583: \"$ac_try\"") >&5
9584   (eval $ac_try) 2>&5
9585   ac_status=$?
9586   echo "$as_me:9586: \$? = $ac_status" >&5
9587   (exit $ac_status); }; }; then
9588   ac_cv_lib_socket_connect=yes
9589 else
9590   echo "$as_me: failed program was:" >&5
9591 cat conftest.$ac_ext >&5
9592 ac_cv_lib_socket_connect=no
9593 fi
9594 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9595 LIBS=$ac_check_lib_save_LIBS
9596 fi
9597 echo "$as_me:9597: result: $ac_cv_lib_socket_connect" >&5
9598 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
9599 if test $ac_cv_lib_socket_connect = yes; then
9600   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
9601 fi
9602
9603     fi
9604
9605     # Guillermo Gomez says -lposix is necessary on A/UX.
9606     echo "$as_me:9606: checking for remove" >&5
9607 echo $ECHO_N "checking for remove... $ECHO_C" >&6
9608 if test "${ac_cv_func_remove+set}" = set; then
9609   echo $ECHO_N "(cached) $ECHO_C" >&6
9610 else
9611   cat >conftest.$ac_ext <<_ACEOF
9612 #line 9612 "configure"
9613 #include "confdefs.h"
9614 /* System header to define __stub macros and hopefully few prototypes,
9615     which can conflict with char remove (); below.  */
9616 #include <assert.h>
9617 /* Override any gcc2 internal prototype to avoid an error.  */
9618 #ifdef __cplusplus
9619 extern "C"
9620 #endif
9621 /* We use char because int might match the return type of a gcc2
9622    builtin and then its argument prototype would still apply.  */
9623 char remove ();
9624 char (*f) ();
9625
9626 int
9627 main ()
9628 {
9629 /* The GNU C library defines this for functions which it implements
9630     to always fail with ENOSYS.  Some functions are actually named
9631     something starting with __ and the normal name is an alias.  */
9632 #if defined (__stub_remove) || defined (__stub___remove)
9633 choke me
9634 #else
9635 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9636 #endif
9637
9638   ;
9639   return 0;
9640 }
9641 _ACEOF
9642 rm -f conftest.$ac_objext conftest$ac_exeext
9643 if { (eval echo "$as_me:9643: \"$ac_link\"") >&5
9644   (eval $ac_link) 2>&5
9645   ac_status=$?
9646   echo "$as_me:9646: \$? = $ac_status" >&5
9647   (exit $ac_status); } &&
9648          { ac_try='test -s conftest$ac_exeext'
9649   { (eval echo "$as_me:9649: \"$ac_try\"") >&5
9650   (eval $ac_try) 2>&5
9651   ac_status=$?
9652   echo "$as_me:9652: \$? = $ac_status" >&5
9653   (exit $ac_status); }; }; then
9654   ac_cv_func_remove=yes
9655 else
9656   echo "$as_me: failed program was:" >&5
9657 cat conftest.$ac_ext >&5
9658 ac_cv_func_remove=no
9659 fi
9660 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9661 fi
9662 echo "$as_me:9662: result: $ac_cv_func_remove" >&5
9663 echo "${ECHO_T}$ac_cv_func_remove" >&6
9664
9665     if test $ac_cv_func_remove = no; then
9666       echo "$as_me:9666: checking for remove in -lposix" >&5
9667 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
9668 if test "${ac_cv_lib_posix_remove+set}" = set; then
9669   echo $ECHO_N "(cached) $ECHO_C" >&6
9670 else
9671   ac_check_lib_save_LIBS=$LIBS
9672 LIBS="-lposix  $LIBS"
9673 cat >conftest.$ac_ext <<_ACEOF
9674 #line 9674 "configure"
9675 #include "confdefs.h"
9676
9677 /* Override any gcc2 internal prototype to avoid an error.  */
9678 #ifdef __cplusplus
9679 extern "C"
9680 #endif
9681 /* We use char because int might match the return type of a gcc2
9682    builtin and then its argument prototype would still apply.  */
9683 char remove ();
9684 int
9685 main ()
9686 {
9687 remove ();
9688   ;
9689   return 0;
9690 }
9691 _ACEOF
9692 rm -f conftest.$ac_objext conftest$ac_exeext
9693 if { (eval echo "$as_me:9693: \"$ac_link\"") >&5
9694   (eval $ac_link) 2>&5
9695   ac_status=$?
9696   echo "$as_me:9696: \$? = $ac_status" >&5
9697   (exit $ac_status); } &&
9698          { ac_try='test -s conftest$ac_exeext'
9699   { (eval echo "$as_me:9699: \"$ac_try\"") >&5
9700   (eval $ac_try) 2>&5
9701   ac_status=$?
9702   echo "$as_me:9702: \$? = $ac_status" >&5
9703   (exit $ac_status); }; }; then
9704   ac_cv_lib_posix_remove=yes
9705 else
9706   echo "$as_me: failed program was:" >&5
9707 cat conftest.$ac_ext >&5
9708 ac_cv_lib_posix_remove=no
9709 fi
9710 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9711 LIBS=$ac_check_lib_save_LIBS
9712 fi
9713 echo "$as_me:9713: result: $ac_cv_lib_posix_remove" >&5
9714 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
9715 if test $ac_cv_lib_posix_remove = yes; then
9716   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
9717 fi
9718
9719     fi
9720
9721     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
9722     echo "$as_me:9722: checking for shmat" >&5
9723 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
9724 if test "${ac_cv_func_shmat+set}" = set; then
9725   echo $ECHO_N "(cached) $ECHO_C" >&6
9726 else
9727   cat >conftest.$ac_ext <<_ACEOF
9728 #line 9728 "configure"
9729 #include "confdefs.h"
9730 /* System header to define __stub macros and hopefully few prototypes,
9731     which can conflict with char shmat (); below.  */
9732 #include <assert.h>
9733 /* Override any gcc2 internal prototype to avoid an error.  */
9734 #ifdef __cplusplus
9735 extern "C"
9736 #endif
9737 /* We use char because int might match the return type of a gcc2
9738    builtin and then its argument prototype would still apply.  */
9739 char shmat ();
9740 char (*f) ();
9741
9742 int
9743 main ()
9744 {
9745 /* The GNU C library defines this for functions which it implements
9746     to always fail with ENOSYS.  Some functions are actually named
9747     something starting with __ and the normal name is an alias.  */
9748 #if defined (__stub_shmat) || defined (__stub___shmat)
9749 choke me
9750 #else
9751 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9752 #endif
9753
9754   ;
9755   return 0;
9756 }
9757 _ACEOF
9758 rm -f conftest.$ac_objext conftest$ac_exeext
9759 if { (eval echo "$as_me:9759: \"$ac_link\"") >&5
9760   (eval $ac_link) 2>&5
9761   ac_status=$?
9762   echo "$as_me:9762: \$? = $ac_status" >&5
9763   (exit $ac_status); } &&
9764          { ac_try='test -s conftest$ac_exeext'
9765   { (eval echo "$as_me:9765: \"$ac_try\"") >&5
9766   (eval $ac_try) 2>&5
9767   ac_status=$?
9768   echo "$as_me:9768: \$? = $ac_status" >&5
9769   (exit $ac_status); }; }; then
9770   ac_cv_func_shmat=yes
9771 else
9772   echo "$as_me: failed program was:" >&5
9773 cat conftest.$ac_ext >&5
9774 ac_cv_func_shmat=no
9775 fi
9776 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9777 fi
9778 echo "$as_me:9778: result: $ac_cv_func_shmat" >&5
9779 echo "${ECHO_T}$ac_cv_func_shmat" >&6
9780
9781     if test $ac_cv_func_shmat = no; then
9782       echo "$as_me:9782: checking for shmat in -lipc" >&5
9783 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
9784 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
9785   echo $ECHO_N "(cached) $ECHO_C" >&6
9786 else
9787   ac_check_lib_save_LIBS=$LIBS
9788 LIBS="-lipc  $LIBS"
9789 cat >conftest.$ac_ext <<_ACEOF
9790 #line 9790 "configure"
9791 #include "confdefs.h"
9792
9793 /* Override any gcc2 internal prototype to avoid an error.  */
9794 #ifdef __cplusplus
9795 extern "C"
9796 #endif
9797 /* We use char because int might match the return type of a gcc2
9798    builtin and then its argument prototype would still apply.  */
9799 char shmat ();
9800 int
9801 main ()
9802 {
9803 shmat ();
9804   ;
9805   return 0;
9806 }
9807 _ACEOF
9808 rm -f conftest.$ac_objext conftest$ac_exeext
9809 if { (eval echo "$as_me:9809: \"$ac_link\"") >&5
9810   (eval $ac_link) 2>&5
9811   ac_status=$?
9812   echo "$as_me:9812: \$? = $ac_status" >&5
9813   (exit $ac_status); } &&
9814          { ac_try='test -s conftest$ac_exeext'
9815   { (eval echo "$as_me:9815: \"$ac_try\"") >&5
9816   (eval $ac_try) 2>&5
9817   ac_status=$?
9818   echo "$as_me:9818: \$? = $ac_status" >&5
9819   (exit $ac_status); }; }; then
9820   ac_cv_lib_ipc_shmat=yes
9821 else
9822   echo "$as_me: failed program was:" >&5
9823 cat conftest.$ac_ext >&5
9824 ac_cv_lib_ipc_shmat=no
9825 fi
9826 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9827 LIBS=$ac_check_lib_save_LIBS
9828 fi
9829 echo "$as_me:9829: result: $ac_cv_lib_ipc_shmat" >&5
9830 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
9831 if test $ac_cv_lib_ipc_shmat = yes; then
9832   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
9833 fi
9834
9835     fi
9836   fi
9837
9838   # Check for libraries that X11R6 Xt/Xaw programs need.
9839   ac_save_LDFLAGS=$LDFLAGS
9840   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
9841   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
9842   # check for ICE first), but we must link in the order -lSM -lICE or
9843   # we get undefined symbols.  So assume we have SM if we have ICE.
9844   # These have to be linked with before -lX11, unlike the other
9845   # libraries we check for below, so use a different variable.
9846   # John Interrante, Karl Berry
9847   echo "$as_me:9847: checking for IceConnectionNumber in -lICE" >&5
9848 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
9849 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
9850   echo $ECHO_N "(cached) $ECHO_C" >&6
9851 else
9852   ac_check_lib_save_LIBS=$LIBS
9853 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
9854 cat >conftest.$ac_ext <<_ACEOF
9855 #line 9855 "configure"
9856 #include "confdefs.h"
9857
9858 /* Override any gcc2 internal prototype to avoid an error.  */
9859 #ifdef __cplusplus
9860 extern "C"
9861 #endif
9862 /* We use char because int might match the return type of a gcc2
9863    builtin and then its argument prototype would still apply.  */
9864 char IceConnectionNumber ();
9865 int
9866 main ()
9867 {
9868 IceConnectionNumber ();
9869   ;
9870   return 0;
9871 }
9872 _ACEOF
9873 rm -f conftest.$ac_objext conftest$ac_exeext
9874 if { (eval echo "$as_me:9874: \"$ac_link\"") >&5
9875   (eval $ac_link) 2>&5
9876   ac_status=$?
9877   echo "$as_me:9877: \$? = $ac_status" >&5
9878   (exit $ac_status); } &&
9879          { ac_try='test -s conftest$ac_exeext'
9880   { (eval echo "$as_me:9880: \"$ac_try\"") >&5
9881   (eval $ac_try) 2>&5
9882   ac_status=$?
9883   echo "$as_me:9883: \$? = $ac_status" >&5
9884   (exit $ac_status); }; }; then
9885   ac_cv_lib_ICE_IceConnectionNumber=yes
9886 else
9887   echo "$as_me: failed program was:" >&5
9888 cat conftest.$ac_ext >&5
9889 ac_cv_lib_ICE_IceConnectionNumber=no
9890 fi
9891 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9892 LIBS=$ac_check_lib_save_LIBS
9893 fi
9894 echo "$as_me:9894: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
9895 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
9896 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
9897   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
9898 fi
9899
9900   LDFLAGS=$ac_save_LDFLAGS
9901
9902 fi
9903
9904 cf_x_athena=${cf_x_athena:-Xaw}
9905
9906 echo "$as_me:9906: checking if you want to link with Xaw 3d library" >&5
9907 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
9908 withval=
9909
9910 # Check whether --with-Xaw3d or --without-Xaw3d was given.
9911 if test "${with_Xaw3d+set}" = set; then
9912   withval="$with_Xaw3d"
9913
9914 fi;
9915 if test "$withval" = yes ; then
9916         cf_x_athena=Xaw3d
9917         echo "$as_me:9917: result: yes" >&5
9918 echo "${ECHO_T}yes" >&6
9919 else
9920         echo "$as_me:9920: result: no" >&5
9921 echo "${ECHO_T}no" >&6
9922 fi
9923
9924 echo "$as_me:9924: checking if you want to link with neXT Athena library" >&5
9925 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
9926 withval=
9927
9928 # Check whether --with-neXtaw or --without-neXtaw was given.
9929 if test "${with_neXtaw+set}" = set; then
9930   withval="$with_neXtaw"
9931
9932 fi;
9933 if test "$withval" = yes ; then
9934         cf_x_athena=neXtaw
9935         echo "$as_me:9935: result: yes" >&5
9936 echo "${ECHO_T}yes" >&6
9937 else
9938         echo "$as_me:9938: result: no" >&5
9939 echo "${ECHO_T}no" >&6
9940 fi
9941
9942 echo "$as_me:9942: checking if you want to link with Athena-Plus library" >&5
9943 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
9944 withval=
9945
9946 # Check whether --with-XawPlus or --without-XawPlus was given.
9947 if test "${with_XawPlus+set}" = set; then
9948   withval="$with_XawPlus"
9949
9950 fi;
9951 if test "$withval" = yes ; then
9952         cf_x_athena=XawPlus
9953         echo "$as_me:9953: result: yes" >&5
9954 echo "${ECHO_T}yes" >&6
9955 else
9956         echo "$as_me:9956: result: no" >&5
9957 echo "${ECHO_T}no" >&6
9958 fi
9959
9960 cf_x_athena_lib=""
9961
9962 if test "$PKG_CONFIG" != none ; then
9963         cf_athena_list=
9964         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
9965         for cf_athena_pkg in \
9966                 $cf_athena_list \
9967                 ${cf_x_athena} \
9968                 ${cf_x_athena}-devel \
9969                 lib${cf_x_athena} \
9970                 lib${cf_x_athena}-devel
9971         do
9972
9973 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
9974         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
9975
9976 echo "${as_me:-configure}:9976: testing found package $cf_athena_pkg ..." 1>&5
9977
9978         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
9979         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
9980         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
9981
9982 echo "${as_me:-configure}:9982: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
9983
9984         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
9985
9986 echo "${as_me:-configure}:9986: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
9987
9988 cf_fix_cppflags=no
9989 cf_new_cflags=
9990 cf_new_cppflags=
9991 cf_new_extra_cppflags=
9992
9993 for cf_add_cflags in $cf_pkgconfig_incs
9994 do
9995 case $cf_fix_cppflags in
9996 no)
9997         case $cf_add_cflags in #(vi
9998         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
9999                 case $cf_add_cflags in
10000                 -D*)
10001                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10002
10003                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10004                                 && test -z "${cf_tst_cflags}" \
10005                                 && cf_fix_cppflags=yes
10006
10007                         if test $cf_fix_cppflags = yes ; then
10008                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10009                                 continue
10010                         elif test "${cf_tst_cflags}" = "\"'" ; then
10011                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10012                                 continue
10013                         fi
10014                         ;;
10015                 esac
10016                 case "$CPPFLAGS" in
10017                 *$cf_add_cflags) #(vi
10018                         ;;
10019                 *) #(vi
10020                         case $cf_add_cflags in #(vi
10021                         -D*)
10022                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10023
10024 CPPFLAGS=`echo "$CPPFLAGS" | \
10025         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10026                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10027
10028                                 ;;
10029                         esac
10030                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10031                         ;;
10032                 esac
10033                 ;;
10034         *)
10035                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10036                 ;;
10037         esac
10038         ;;
10039 yes)
10040         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10041
10042         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10043
10044         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10045                 && test -z "${cf_tst_cflags}" \
10046                 && cf_fix_cppflags=no
10047         ;;
10048 esac
10049 done
10050
10051 if test -n "$cf_new_cflags" ; then
10052
10053         CFLAGS="$CFLAGS $cf_new_cflags"
10054 fi
10055
10056 if test -n "$cf_new_cppflags" ; then
10057
10058         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10059 fi
10060
10061 if test -n "$cf_new_extra_cppflags" ; then
10062
10063         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10064 fi
10065
10066         LIBS="$cf_pkgconfig_libs $LIBS"
10067
10068                         cf_x_athena_lib="$cf_pkgconfig_libs"
10069
10070 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10071
10072                         cat >>confdefs.h <<EOF
10073 #define $cf_x_athena_LIBS 1
10074 EOF
10075
10076         for cf_trim_lib in Xmu Xt X11
10077         do
10078                 case "$LIBS" in
10079                 *-l$cf_trim_lib\ *-l$cf_trim_lib*)
10080                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10081                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10082
10083 echo "${as_me:-configure}:10083: testing ..trimmed $LIBS ..." 1>&5
10084
10085                         ;;
10086                 esac
10087         done
10088
10089 echo "$as_me:10089: checking for usable $cf_x_athena/Xmu package" >&5
10090 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10091 if test "${cf_cv_xaw_compat+set}" = set; then
10092   echo $ECHO_N "(cached) $ECHO_C" >&6
10093 else
10094
10095 cat >conftest.$ac_ext <<_ACEOF
10096 #line 10096 "configure"
10097 #include "confdefs.h"
10098
10099 #include <X11/Xmu/CharSet.h>
10100
10101 int
10102 main ()
10103 {
10104
10105 int check = XmuCompareISOLatin1("big", "small")
10106
10107   ;
10108   return 0;
10109 }
10110 _ACEOF
10111 rm -f conftest.$ac_objext conftest$ac_exeext
10112 if { (eval echo "$as_me:10112: \"$ac_link\"") >&5
10113   (eval $ac_link) 2>&5
10114   ac_status=$?
10115   echo "$as_me:10115: \$? = $ac_status" >&5
10116   (exit $ac_status); } &&
10117          { ac_try='test -s conftest$ac_exeext'
10118   { (eval echo "$as_me:10118: \"$ac_try\"") >&5
10119   (eval $ac_try) 2>&5
10120   ac_status=$?
10121   echo "$as_me:10121: \$? = $ac_status" >&5
10122   (exit $ac_status); }; }; then
10123   cf_cv_xaw_compat=yes
10124 else
10125   echo "$as_me: failed program was:" >&5
10126 cat conftest.$ac_ext >&5
10127 cf_cv_xaw_compat=no
10128 fi
10129 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10130 fi
10131 echo "$as_me:10131: result: $cf_cv_xaw_compat" >&5
10132 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10133
10134                         if test "$cf_cv_xaw_compat" = no
10135                         then
10136                                 # workaround for broken ".pc" files...
10137                                 case "$cf_x_athena_lib" in #(vi
10138                                 *-lXmu*) #(vi
10139                                         ;;
10140                                 *)
10141                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10142
10143 echo "${as_me:-configure}:10143: testing work around broken package ..." 1>&5
10144
10145                                         cf_save_xmu="$LIBS"
10146                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
10147
10148 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10149         test -n "$verbose" && echo "    found package xmu" 1>&6
10150
10151 echo "${as_me:-configure}:10151: testing found package xmu ..." 1>&5
10152
10153         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10154         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10155         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10156
10157 echo "${as_me:-configure}:10157: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10158
10159         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10160
10161 echo "${as_me:-configure}:10161: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10162
10163 cf_fix_cppflags=no
10164 cf_new_cflags=
10165 cf_new_cppflags=
10166 cf_new_extra_cppflags=
10167
10168 for cf_add_cflags in $cf_pkgconfig_incs
10169 do
10170 case $cf_fix_cppflags in
10171 no)
10172         case $cf_add_cflags in #(vi
10173         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10174                 case $cf_add_cflags in
10175                 -D*)
10176                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10177
10178                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10179                                 && test -z "${cf_tst_cflags}" \
10180                                 && cf_fix_cppflags=yes
10181
10182                         if test $cf_fix_cppflags = yes ; then
10183                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10184                                 continue
10185                         elif test "${cf_tst_cflags}" = "\"'" ; then
10186                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10187                                 continue
10188                         fi
10189                         ;;
10190                 esac
10191                 case "$CPPFLAGS" in
10192                 *$cf_add_cflags) #(vi
10193                         ;;
10194                 *) #(vi
10195                         case $cf_add_cflags in #(vi
10196                         -D*)
10197                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10198
10199 CPPFLAGS=`echo "$CPPFLAGS" | \
10200         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10201                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10202
10203                                 ;;
10204                         esac
10205                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10206                         ;;
10207                 esac
10208                 ;;
10209         *)
10210                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10211                 ;;
10212         esac
10213         ;;
10214 yes)
10215         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10216
10217         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10218
10219         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10220                 && test -z "${cf_tst_cflags}" \
10221                 && cf_fix_cppflags=no
10222         ;;
10223 esac
10224 done
10225
10226 if test -n "$cf_new_cflags" ; then
10227
10228         CFLAGS="$CFLAGS $cf_new_cflags"
10229 fi
10230
10231 if test -n "$cf_new_cppflags" ; then
10232
10233         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10234 fi
10235
10236 if test -n "$cf_new_extra_cppflags" ; then
10237
10238         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10239 fi
10240
10241         LIBS="$cf_pkgconfig_libs $LIBS"
10242
10243                                                         LIBS="$cf_save_xmu"
10244
10245 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10246
10247 echo "${as_me:-configure}:10247: testing ...before $LIBS ..." 1>&5
10248
10249 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
10250 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10251
10252 echo "${as_me:-configure}:10252: testing ...after  $LIBS ..." 1>&5
10253
10254 else
10255         cf_pkgconfig_incs=
10256         cf_pkgconfig_libs=
10257
10258 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10259
10260 echo "${as_me:-configure}:10260: testing ...before $LIBS ..." 1>&5
10261
10262 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
10263 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10264
10265 echo "${as_me:-configure}:10265: testing ...after  $LIBS ..." 1>&5
10266
10267 fi
10268
10269         for cf_trim_lib in Xmu Xt X11
10270         do
10271                 case "$LIBS" in
10272                 *-l$cf_trim_lib\ *-l$cf_trim_lib*)
10273                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10274                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10275
10276 echo "${as_me:-configure}:10276: testing ..trimmed $LIBS ..." 1>&5
10277
10278                         ;;
10279                 esac
10280         done
10281
10282                                         ;;
10283                                 esac
10284                         fi
10285
10286                         break
10287 else
10288         cf_pkgconfig_incs=
10289         cf_pkgconfig_libs=
10290         :
10291 fi
10292
10293         done
10294 fi
10295
10296 if test -z "$cf_x_athena_lib" ; then
10297
10298 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10299         test -n "$verbose" && echo "    found package Xext" 1>&6
10300
10301 echo "${as_me:-configure}:10301: testing found package Xext ..." 1>&5
10302
10303         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10304         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10305         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10306
10307 echo "${as_me:-configure}:10307: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10308
10309         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10310
10311 echo "${as_me:-configure}:10311: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10312
10313 cf_fix_cppflags=no
10314 cf_new_cflags=
10315 cf_new_cppflags=
10316 cf_new_extra_cppflags=
10317
10318 for cf_add_cflags in $cf_pkgconfig_incs
10319 do
10320 case $cf_fix_cppflags in
10321 no)
10322         case $cf_add_cflags in #(vi
10323         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10324                 case $cf_add_cflags in
10325                 -D*)
10326                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10327
10328                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10329                                 && test -z "${cf_tst_cflags}" \
10330                                 && cf_fix_cppflags=yes
10331
10332                         if test $cf_fix_cppflags = yes ; then
10333                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10334                                 continue
10335                         elif test "${cf_tst_cflags}" = "\"'" ; then
10336                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10337                                 continue
10338                         fi
10339                         ;;
10340                 esac
10341                 case "$CPPFLAGS" in
10342                 *$cf_add_cflags) #(vi
10343                         ;;
10344                 *) #(vi
10345                         case $cf_add_cflags in #(vi
10346                         -D*)
10347                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10348
10349 CPPFLAGS=`echo "$CPPFLAGS" | \
10350         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10351                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10352
10353                                 ;;
10354                         esac
10355                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10356                         ;;
10357                 esac
10358                 ;;
10359         *)
10360                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10361                 ;;
10362         esac
10363         ;;
10364 yes)
10365         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10366
10367         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10368
10369         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10370                 && test -z "${cf_tst_cflags}" \
10371                 && cf_fix_cppflags=no
10372         ;;
10373 esac
10374 done
10375
10376 if test -n "$cf_new_cflags" ; then
10377
10378         CFLAGS="$CFLAGS $cf_new_cflags"
10379 fi
10380
10381 if test -n "$cf_new_cppflags" ; then
10382
10383         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10384 fi
10385
10386 if test -n "$cf_new_extra_cppflags" ; then
10387
10388         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10389 fi
10390
10391         LIBS="$cf_pkgconfig_libs $LIBS"
10392         :
10393 else
10394         cf_pkgconfig_incs=
10395         cf_pkgconfig_libs=
10396
10397         echo "$as_me:10397: checking for XextCreateExtension in -lXext" >&5
10398 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10399 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10400   echo $ECHO_N "(cached) $ECHO_C" >&6
10401 else
10402   ac_check_lib_save_LIBS=$LIBS
10403 LIBS="-lXext  $LIBS"
10404 cat >conftest.$ac_ext <<_ACEOF
10405 #line 10405 "configure"
10406 #include "confdefs.h"
10407
10408 /* Override any gcc2 internal prototype to avoid an error.  */
10409 #ifdef __cplusplus
10410 extern "C"
10411 #endif
10412 /* We use char because int might match the return type of a gcc2
10413    builtin and then its argument prototype would still apply.  */
10414 char XextCreateExtension ();
10415 int
10416 main ()
10417 {
10418 XextCreateExtension ();
10419   ;
10420   return 0;
10421 }
10422 _ACEOF
10423 rm -f conftest.$ac_objext conftest$ac_exeext
10424 if { (eval echo "$as_me:10424: \"$ac_link\"") >&5
10425   (eval $ac_link) 2>&5
10426   ac_status=$?
10427   echo "$as_me:10427: \$? = $ac_status" >&5
10428   (exit $ac_status); } &&
10429          { ac_try='test -s conftest$ac_exeext'
10430   { (eval echo "$as_me:10430: \"$ac_try\"") >&5
10431   (eval $ac_try) 2>&5
10432   ac_status=$?
10433   echo "$as_me:10433: \$? = $ac_status" >&5
10434   (exit $ac_status); }; }; then
10435   ac_cv_lib_Xext_XextCreateExtension=yes
10436 else
10437   echo "$as_me: failed program was:" >&5
10438 cat conftest.$ac_ext >&5
10439 ac_cv_lib_Xext_XextCreateExtension=no
10440 fi
10441 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10442 LIBS=$ac_check_lib_save_LIBS
10443 fi
10444 echo "$as_me:10444: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
10445 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
10446 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
10447   LIBS="-lXext $LIBS"
10448 fi
10449
10450 fi
10451
10452 cf_have_X_LIBS=no
10453
10454 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
10455         test -n "$verbose" && echo "    found package xt" 1>&6
10456
10457 echo "${as_me:-configure}:10457: testing found package xt ..." 1>&5
10458
10459         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
10460         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
10461         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
10462
10463 echo "${as_me:-configure}:10463: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10464
10465         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
10466
10467 echo "${as_me:-configure}:10467: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
10468
10469 cf_fix_cppflags=no
10470 cf_new_cflags=
10471 cf_new_cppflags=
10472 cf_new_extra_cppflags=
10473
10474 for cf_add_cflags in $cf_pkgconfig_incs
10475 do
10476 case $cf_fix_cppflags in
10477 no)
10478         case $cf_add_cflags in #(vi
10479         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10480                 case $cf_add_cflags in
10481                 -D*)
10482                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10483
10484                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10485                                 && test -z "${cf_tst_cflags}" \
10486                                 && cf_fix_cppflags=yes
10487
10488                         if test $cf_fix_cppflags = yes ; then
10489                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10490                                 continue
10491                         elif test "${cf_tst_cflags}" = "\"'" ; then
10492                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10493                                 continue
10494                         fi
10495                         ;;
10496                 esac
10497                 case "$CPPFLAGS" in
10498                 *$cf_add_cflags) #(vi
10499                         ;;
10500                 *) #(vi
10501                         case $cf_add_cflags in #(vi
10502                         -D*)
10503                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10504
10505 CPPFLAGS=`echo "$CPPFLAGS" | \
10506         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10507                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10508
10509                                 ;;
10510                         esac
10511                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10512                         ;;
10513                 esac
10514                 ;;
10515         *)
10516                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10517                 ;;
10518         esac
10519         ;;
10520 yes)
10521         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10522
10523         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10524
10525         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10526                 && test -z "${cf_tst_cflags}" \
10527                 && cf_fix_cppflags=no
10528         ;;
10529 esac
10530 done
10531
10532 if test -n "$cf_new_cflags" ; then
10533
10534         CFLAGS="$CFLAGS $cf_new_cflags"
10535 fi
10536
10537 if test -n "$cf_new_cppflags" ; then
10538
10539         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10540 fi
10541
10542 if test -n "$cf_new_extra_cppflags" ; then
10543
10544         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10545 fi
10546
10547         LIBS="$cf_pkgconfig_libs $LIBS"
10548
10549         case "x$LIBS" in #(vi
10550         *-lX11*) #(vi
10551                 ;;
10552         *)
10553 # we have an "xt" package, but it may omit Xt's dependency on X11
10554 echo "$as_me:10554: checking for usable X dependency" >&5
10555 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
10556 if test "${cf_cv_xt_x11_compat+set}" = set; then
10557   echo $ECHO_N "(cached) $ECHO_C" >&6
10558 else
10559
10560 cat >conftest.$ac_ext <<_ACEOF
10561 #line 10561 "configure"
10562 #include "confdefs.h"
10563
10564 #include <X11/Xlib.h>
10565
10566 int
10567 main ()
10568 {
10569
10570         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
10571         int rc2 = XClearWindow((Display*) 0, (Window) 0);
10572         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
10573         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
10574
10575   ;
10576   return 0;
10577 }
10578 _ACEOF
10579 rm -f conftest.$ac_objext conftest$ac_exeext
10580 if { (eval echo "$as_me:10580: \"$ac_link\"") >&5
10581   (eval $ac_link) 2>&5
10582   ac_status=$?
10583   echo "$as_me:10583: \$? = $ac_status" >&5
10584   (exit $ac_status); } &&
10585          { ac_try='test -s conftest$ac_exeext'
10586   { (eval echo "$as_me:10586: \"$ac_try\"") >&5
10587   (eval $ac_try) 2>&5
10588   ac_status=$?
10589   echo "$as_me:10589: \$? = $ac_status" >&5
10590   (exit $ac_status); }; }; then
10591   cf_cv_xt_x11_compat=yes
10592 else
10593   echo "$as_me: failed program was:" >&5
10594 cat conftest.$ac_ext >&5
10595 cf_cv_xt_x11_compat=no
10596 fi
10597 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10598 fi
10599 echo "$as_me:10599: result: $cf_cv_xt_x11_compat" >&5
10600 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
10601                 if test "$cf_cv_xt_x11_compat" = no
10602                 then
10603                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
10604
10605 echo "${as_me:-configure}:10605: testing work around broken X11 dependency ..." 1>&5
10606
10607                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
10608
10609 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
10610         test -n "$verbose" && echo "    found package x11" 1>&6
10611
10612 echo "${as_me:-configure}:10612: testing found package x11 ..." 1>&5
10613
10614         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
10615         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
10616         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
10617
10618 echo "${as_me:-configure}:10618: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10619
10620         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
10621
10622 echo "${as_me:-configure}:10622: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
10623
10624 cf_fix_cppflags=no
10625 cf_new_cflags=
10626 cf_new_cppflags=
10627 cf_new_extra_cppflags=
10628
10629 for cf_add_cflags in $cf_pkgconfig_incs
10630 do
10631 case $cf_fix_cppflags in
10632 no)
10633         case $cf_add_cflags in #(vi
10634         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10635                 case $cf_add_cflags in
10636                 -D*)
10637                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10638
10639                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10640                                 && test -z "${cf_tst_cflags}" \
10641                                 && cf_fix_cppflags=yes
10642
10643                         if test $cf_fix_cppflags = yes ; then
10644                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10645                                 continue
10646                         elif test "${cf_tst_cflags}" = "\"'" ; then
10647                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10648                                 continue
10649                         fi
10650                         ;;
10651                 esac
10652                 case "$CPPFLAGS" in
10653                 *$cf_add_cflags) #(vi
10654                         ;;
10655                 *) #(vi
10656                         case $cf_add_cflags in #(vi
10657                         -D*)
10658                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10659
10660 CPPFLAGS=`echo "$CPPFLAGS" | \
10661         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10662                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10663
10664                                 ;;
10665                         esac
10666                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10667                         ;;
10668                 esac
10669                 ;;
10670         *)
10671                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10672                 ;;
10673         esac
10674         ;;
10675 yes)
10676         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10677
10678         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10679
10680         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10681                 && test -z "${cf_tst_cflags}" \
10682                 && cf_fix_cppflags=no
10683         ;;
10684 esac
10685 done
10686
10687 if test -n "$cf_new_cflags" ; then
10688
10689         CFLAGS="$CFLAGS $cf_new_cflags"
10690 fi
10691
10692 if test -n "$cf_new_cppflags" ; then
10693
10694         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10695 fi
10696
10697 if test -n "$cf_new_extra_cppflags" ; then
10698
10699         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10700 fi
10701
10702         LIBS="$cf_pkgconfig_libs $LIBS"
10703         :
10704 else
10705         cf_pkgconfig_incs=
10706         cf_pkgconfig_libs=
10707
10708 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10709
10710 echo "${as_me:-configure}:10710: testing ...before $LIBS ..." 1>&5
10711
10712 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
10713 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10714
10715 echo "${as_me:-configure}:10715: testing ...after  $LIBS ..." 1>&5
10716
10717 fi
10718
10719                 fi
10720                 ;;
10721         esac
10722
10723 echo "$as_me:10723: checking for usable X Toolkit package" >&5
10724 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
10725 if test "${cf_cv_xt_ice_compat+set}" = set; then
10726   echo $ECHO_N "(cached) $ECHO_C" >&6
10727 else
10728
10729 cat >conftest.$ac_ext <<_ACEOF
10730 #line 10730 "configure"
10731 #include "confdefs.h"
10732
10733 #include <X11/Shell.h>
10734
10735 int
10736 main ()
10737 {
10738 int num = IceConnectionNumber(0)
10739
10740   ;
10741   return 0;
10742 }
10743 _ACEOF
10744 rm -f conftest.$ac_objext conftest$ac_exeext
10745 if { (eval echo "$as_me:10745: \"$ac_link\"") >&5
10746   (eval $ac_link) 2>&5
10747   ac_status=$?
10748   echo "$as_me:10748: \$? = $ac_status" >&5
10749   (exit $ac_status); } &&
10750          { ac_try='test -s conftest$ac_exeext'
10751   { (eval echo "$as_me:10751: \"$ac_try\"") >&5
10752   (eval $ac_try) 2>&5
10753   ac_status=$?
10754   echo "$as_me:10754: \$? = $ac_status" >&5
10755   (exit $ac_status); }; }; then
10756   cf_cv_xt_ice_compat=yes
10757 else
10758   echo "$as_me: failed program was:" >&5
10759 cat conftest.$ac_ext >&5
10760 cf_cv_xt_ice_compat=no
10761 fi
10762 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10763 fi
10764 echo "$as_me:10764: result: $cf_cv_xt_ice_compat" >&5
10765 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
10766
10767         if test "$cf_cv_xt_ice_compat" = no
10768         then
10769                 # workaround for broken ".pc" files used for X Toolkit.
10770                 case "x$X_PRE_LIBS" in #(vi
10771                 *-lICE*)
10772                         case "x$LIBS" in #(vi
10773                         *-lICE*) #(vi
10774                                 ;;
10775                         *)
10776                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
10777
10778 echo "${as_me:-configure}:10778: testing work around broken ICE dependency ..." 1>&5
10779
10780 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
10781         test -n "$verbose" && echo "    found package ice" 1>&6
10782
10783 echo "${as_me:-configure}:10783: testing found package ice ..." 1>&5
10784
10785         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
10786         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
10787         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
10788
10789 echo "${as_me:-configure}:10789: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10790
10791         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
10792
10793 echo "${as_me:-configure}:10793: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
10794
10795 cf_fix_cppflags=no
10796 cf_new_cflags=
10797 cf_new_cppflags=
10798 cf_new_extra_cppflags=
10799
10800 for cf_add_cflags in $cf_pkgconfig_incs
10801 do
10802 case $cf_fix_cppflags in
10803 no)
10804         case $cf_add_cflags in #(vi
10805         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10806                 case $cf_add_cflags in
10807                 -D*)
10808                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10809
10810                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10811                                 && test -z "${cf_tst_cflags}" \
10812                                 && cf_fix_cppflags=yes
10813
10814                         if test $cf_fix_cppflags = yes ; then
10815                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10816                                 continue
10817                         elif test "${cf_tst_cflags}" = "\"'" ; then
10818                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10819                                 continue
10820                         fi
10821                         ;;
10822                 esac
10823                 case "$CPPFLAGS" in
10824                 *$cf_add_cflags) #(vi
10825                         ;;
10826                 *) #(vi
10827                         case $cf_add_cflags in #(vi
10828                         -D*)
10829                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10830
10831 CPPFLAGS=`echo "$CPPFLAGS" | \
10832         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10833                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10834
10835                                 ;;
10836                         esac
10837                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10838                         ;;
10839                 esac
10840                 ;;
10841         *)
10842                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10843                 ;;
10844         esac
10845         ;;
10846 yes)
10847         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10848
10849         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10850
10851         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10852                 && test -z "${cf_tst_cflags}" \
10853                 && cf_fix_cppflags=no
10854         ;;
10855 esac
10856 done
10857
10858 if test -n "$cf_new_cflags" ; then
10859
10860         CFLAGS="$CFLAGS $cf_new_cflags"
10861 fi
10862
10863 if test -n "$cf_new_cppflags" ; then
10864
10865         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10866 fi
10867
10868 if test -n "$cf_new_extra_cppflags" ; then
10869
10870         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10871 fi
10872
10873         LIBS="$cf_pkgconfig_libs $LIBS"
10874
10875 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
10876         test -n "$verbose" && echo "    found package sm" 1>&6
10877
10878 echo "${as_me:-configure}:10878: testing found package sm ..." 1>&5
10879
10880         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
10881         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
10882         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
10883
10884 echo "${as_me:-configure}:10884: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10885
10886         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
10887
10888 echo "${as_me:-configure}:10888: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
10889
10890 cf_fix_cppflags=no
10891 cf_new_cflags=
10892 cf_new_cppflags=
10893 cf_new_extra_cppflags=
10894
10895 for cf_add_cflags in $cf_pkgconfig_incs
10896 do
10897 case $cf_fix_cppflags in
10898 no)
10899         case $cf_add_cflags in #(vi
10900         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10901                 case $cf_add_cflags in
10902                 -D*)
10903                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10904
10905                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10906                                 && test -z "${cf_tst_cflags}" \
10907                                 && cf_fix_cppflags=yes
10908
10909                         if test $cf_fix_cppflags = yes ; then
10910                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10911                                 continue
10912                         elif test "${cf_tst_cflags}" = "\"'" ; then
10913                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10914                                 continue
10915                         fi
10916                         ;;
10917                 esac
10918                 case "$CPPFLAGS" in
10919                 *$cf_add_cflags) #(vi
10920                         ;;
10921                 *) #(vi
10922                         case $cf_add_cflags in #(vi
10923                         -D*)
10924                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10925
10926 CPPFLAGS=`echo "$CPPFLAGS" | \
10927         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10928                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10929
10930                                 ;;
10931                         esac
10932                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10933                         ;;
10934                 esac
10935                 ;;
10936         *)
10937                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10938                 ;;
10939         esac
10940         ;;
10941 yes)
10942         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10943
10944         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10945
10946         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10947                 && test -z "${cf_tst_cflags}" \
10948                 && cf_fix_cppflags=no
10949         ;;
10950 esac
10951 done
10952
10953 if test -n "$cf_new_cflags" ; then
10954
10955         CFLAGS="$CFLAGS $cf_new_cflags"
10956 fi
10957
10958 if test -n "$cf_new_cppflags" ; then
10959
10960         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10961 fi
10962
10963 if test -n "$cf_new_extra_cppflags" ; then
10964
10965         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10966 fi
10967
10968         LIBS="$cf_pkgconfig_libs $LIBS"
10969         :
10970 else
10971         cf_pkgconfig_incs=
10972         cf_pkgconfig_libs=
10973         :
10974 fi
10975
10976 else
10977         cf_pkgconfig_incs=
10978         cf_pkgconfig_libs=
10979
10980 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10981
10982 echo "${as_me:-configure}:10982: testing ...before $LIBS ..." 1>&5
10983
10984 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
10985 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10986
10987 echo "${as_me:-configure}:10987: testing ...after  $LIBS ..." 1>&5
10988
10989 fi
10990
10991                                 ;;
10992                         esac
10993                         ;;
10994                 esac
10995         fi
10996
10997         cf_have_X_LIBS=yes
10998
10999 else
11000         cf_pkgconfig_incs=
11001         cf_pkgconfig_libs=
11002
11003         LDFLAGS="$X_LIBS $LDFLAGS"
11004
11005 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11006
11007 echo "${as_me:-configure}:11007: testing checking additions to CFLAGS ..." 1>&5
11008
11009 cf_check_cflags="$CFLAGS"
11010 cf_check_cppflags="$CPPFLAGS"
11011
11012 cf_fix_cppflags=no
11013 cf_new_cflags=
11014 cf_new_cppflags=
11015 cf_new_extra_cppflags=
11016
11017 for cf_add_cflags in $X_CFLAGS
11018 do
11019 case $cf_fix_cppflags in
11020 no)
11021         case $cf_add_cflags in #(vi
11022         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11023                 case $cf_add_cflags in
11024                 -D*)
11025                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11026
11027                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11028                                 && test -z "${cf_tst_cflags}" \
11029                                 && cf_fix_cppflags=yes
11030
11031                         if test $cf_fix_cppflags = yes ; then
11032                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11033                                 continue
11034                         elif test "${cf_tst_cflags}" = "\"'" ; then
11035                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11036                                 continue
11037                         fi
11038                         ;;
11039                 esac
11040                 case "$CPPFLAGS" in
11041                 *$cf_add_cflags) #(vi
11042                         ;;
11043                 *) #(vi
11044                         case $cf_add_cflags in #(vi
11045                         -D*)
11046                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11047
11048 CPPFLAGS=`echo "$CPPFLAGS" | \
11049         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11050                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11051
11052                                 ;;
11053                         esac
11054                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11055                         ;;
11056                 esac
11057                 ;;
11058         *)
11059                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11060                 ;;
11061         esac
11062         ;;
11063 yes)
11064         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11065
11066         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11067
11068         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11069                 && test -z "${cf_tst_cflags}" \
11070                 && cf_fix_cppflags=no
11071         ;;
11072 esac
11073 done
11074
11075 if test -n "$cf_new_cflags" ; then
11076         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11077
11078 echo "${as_me:-configure}:11078: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11079
11080         CFLAGS="$CFLAGS $cf_new_cflags"
11081 fi
11082
11083 if test -n "$cf_new_cppflags" ; then
11084         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11085
11086 echo "${as_me:-configure}:11086: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11087
11088         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11089 fi
11090
11091 if test -n "$cf_new_extra_cppflags" ; then
11092         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11093
11094 echo "${as_me:-configure}:11094: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11095
11096         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11097 fi
11098
11099 if test "$cf_check_cflags" != "$CFLAGS" ; then
11100 cat >conftest.$ac_ext <<_ACEOF
11101 #line 11101 "configure"
11102 #include "confdefs.h"
11103 #include <stdio.h>
11104 int
11105 main ()
11106 {
11107 printf("Hello world");
11108   ;
11109   return 0;
11110 }
11111 _ACEOF
11112 rm -f conftest.$ac_objext conftest$ac_exeext
11113 if { (eval echo "$as_me:11113: \"$ac_link\"") >&5
11114   (eval $ac_link) 2>&5
11115   ac_status=$?
11116   echo "$as_me:11116: \$? = $ac_status" >&5
11117   (exit $ac_status); } &&
11118          { ac_try='test -s conftest$ac_exeext'
11119   { (eval echo "$as_me:11119: \"$ac_try\"") >&5
11120   (eval $ac_try) 2>&5
11121   ac_status=$?
11122   echo "$as_me:11122: \$? = $ac_status" >&5
11123   (exit $ac_status); }; }; then
11124   :
11125 else
11126   echo "$as_me: failed program was:" >&5
11127 cat conftest.$ac_ext >&5
11128 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
11129
11130 echo "${as_me:-configure}:11130: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
11131
11132          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
11133                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
11134
11135 echo "${as_me:-configure}:11135: testing but keeping change to \$CPPFLAGS ..." 1>&5
11136
11137          fi
11138          CFLAGS="$cf_check_flags"
11139 fi
11140 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11141 fi
11142
11143         echo "$as_me:11143: checking for XOpenDisplay" >&5
11144 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
11145 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
11146   echo $ECHO_N "(cached) $ECHO_C" >&6
11147 else
11148   cat >conftest.$ac_ext <<_ACEOF
11149 #line 11149 "configure"
11150 #include "confdefs.h"
11151 /* System header to define __stub macros and hopefully few prototypes,
11152     which can conflict with char XOpenDisplay (); below.  */
11153 #include <assert.h>
11154 /* Override any gcc2 internal prototype to avoid an error.  */
11155 #ifdef __cplusplus
11156 extern "C"
11157 #endif
11158 /* We use char because int might match the return type of a gcc2
11159    builtin and then its argument prototype would still apply.  */
11160 char XOpenDisplay ();
11161 char (*f) ();
11162
11163 int
11164 main ()
11165 {
11166 /* The GNU C library defines this for functions which it implements
11167     to always fail with ENOSYS.  Some functions are actually named
11168     something starting with __ and the normal name is an alias.  */
11169 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
11170 choke me
11171 #else
11172 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11173 #endif
11174
11175   ;
11176   return 0;
11177 }
11178 _ACEOF
11179 rm -f conftest.$ac_objext conftest$ac_exeext
11180 if { (eval echo "$as_me:11180: \"$ac_link\"") >&5
11181   (eval $ac_link) 2>&5
11182   ac_status=$?
11183   echo "$as_me:11183: \$? = $ac_status" >&5
11184   (exit $ac_status); } &&
11185          { ac_try='test -s conftest$ac_exeext'
11186   { (eval echo "$as_me:11186: \"$ac_try\"") >&5
11187   (eval $ac_try) 2>&5
11188   ac_status=$?
11189   echo "$as_me:11189: \$? = $ac_status" >&5
11190   (exit $ac_status); }; }; then
11191   ac_cv_func_XOpenDisplay=yes
11192 else
11193   echo "$as_me: failed program was:" >&5
11194 cat conftest.$ac_ext >&5
11195 ac_cv_func_XOpenDisplay=no
11196 fi
11197 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11198 fi
11199 echo "$as_me:11199: result: $ac_cv_func_XOpenDisplay" >&5
11200 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
11201 if test $ac_cv_func_XOpenDisplay = yes; then
11202   :
11203 else
11204
11205         echo "$as_me:11205: checking for XOpenDisplay in -lX11" >&5
11206 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
11207 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
11208   echo $ECHO_N "(cached) $ECHO_C" >&6
11209 else
11210   ac_check_lib_save_LIBS=$LIBS
11211 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11212 cat >conftest.$ac_ext <<_ACEOF
11213 #line 11213 "configure"
11214 #include "confdefs.h"
11215
11216 /* Override any gcc2 internal prototype to avoid an error.  */
11217 #ifdef __cplusplus
11218 extern "C"
11219 #endif
11220 /* We use char because int might match the return type of a gcc2
11221    builtin and then its argument prototype would still apply.  */
11222 char XOpenDisplay ();
11223 int
11224 main ()
11225 {
11226 XOpenDisplay ();
11227   ;
11228   return 0;
11229 }
11230 _ACEOF
11231 rm -f conftest.$ac_objext conftest$ac_exeext
11232 if { (eval echo "$as_me:11232: \"$ac_link\"") >&5
11233   (eval $ac_link) 2>&5
11234   ac_status=$?
11235   echo "$as_me:11235: \$? = $ac_status" >&5
11236   (exit $ac_status); } &&
11237          { ac_try='test -s conftest$ac_exeext'
11238   { (eval echo "$as_me:11238: \"$ac_try\"") >&5
11239   (eval $ac_try) 2>&5
11240   ac_status=$?
11241   echo "$as_me:11241: \$? = $ac_status" >&5
11242   (exit $ac_status); }; }; then
11243   ac_cv_lib_X11_XOpenDisplay=yes
11244 else
11245   echo "$as_me: failed program was:" >&5
11246 cat conftest.$ac_ext >&5
11247 ac_cv_lib_X11_XOpenDisplay=no
11248 fi
11249 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11250 LIBS=$ac_check_lib_save_LIBS
11251 fi
11252 echo "$as_me:11252: result: $ac_cv_lib_X11_XOpenDisplay" >&5
11253 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
11254 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
11255   LIBS="-lX11 $LIBS"
11256 fi
11257
11258 fi
11259
11260         echo "$as_me:11260: checking for XtAppInitialize" >&5
11261 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
11262 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
11263   echo $ECHO_N "(cached) $ECHO_C" >&6
11264 else
11265   cat >conftest.$ac_ext <<_ACEOF
11266 #line 11266 "configure"
11267 #include "confdefs.h"
11268 /* System header to define __stub macros and hopefully few prototypes,
11269     which can conflict with char XtAppInitialize (); below.  */
11270 #include <assert.h>
11271 /* Override any gcc2 internal prototype to avoid an error.  */
11272 #ifdef __cplusplus
11273 extern "C"
11274 #endif
11275 /* We use char because int might match the return type of a gcc2
11276    builtin and then its argument prototype would still apply.  */
11277 char XtAppInitialize ();
11278 char (*f) ();
11279
11280 int
11281 main ()
11282 {
11283 /* The GNU C library defines this for functions which it implements
11284     to always fail with ENOSYS.  Some functions are actually named
11285     something starting with __ and the normal name is an alias.  */
11286 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
11287 choke me
11288 #else
11289 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11290 #endif
11291
11292   ;
11293   return 0;
11294 }
11295 _ACEOF
11296 rm -f conftest.$ac_objext conftest$ac_exeext
11297 if { (eval echo "$as_me:11297: \"$ac_link\"") >&5
11298   (eval $ac_link) 2>&5
11299   ac_status=$?
11300   echo "$as_me:11300: \$? = $ac_status" >&5
11301   (exit $ac_status); } &&
11302          { ac_try='test -s conftest$ac_exeext'
11303   { (eval echo "$as_me:11303: \"$ac_try\"") >&5
11304   (eval $ac_try) 2>&5
11305   ac_status=$?
11306   echo "$as_me:11306: \$? = $ac_status" >&5
11307   (exit $ac_status); }; }; then
11308   ac_cv_func_XtAppInitialize=yes
11309 else
11310   echo "$as_me: failed program was:" >&5
11311 cat conftest.$ac_ext >&5
11312 ac_cv_func_XtAppInitialize=no
11313 fi
11314 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11315 fi
11316 echo "$as_me:11316: result: $ac_cv_func_XtAppInitialize" >&5
11317 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
11318 if test $ac_cv_func_XtAppInitialize = yes; then
11319   :
11320 else
11321
11322         echo "$as_me:11322: checking for XtAppInitialize in -lXt" >&5
11323 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
11324 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
11325   echo $ECHO_N "(cached) $ECHO_C" >&6
11326 else
11327   ac_check_lib_save_LIBS=$LIBS
11328 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11329 cat >conftest.$ac_ext <<_ACEOF
11330 #line 11330 "configure"
11331 #include "confdefs.h"
11332
11333 /* Override any gcc2 internal prototype to avoid an error.  */
11334 #ifdef __cplusplus
11335 extern "C"
11336 #endif
11337 /* We use char because int might match the return type of a gcc2
11338    builtin and then its argument prototype would still apply.  */
11339 char XtAppInitialize ();
11340 int
11341 main ()
11342 {
11343 XtAppInitialize ();
11344   ;
11345   return 0;
11346 }
11347 _ACEOF
11348 rm -f conftest.$ac_objext conftest$ac_exeext
11349 if { (eval echo "$as_me:11349: \"$ac_link\"") >&5
11350   (eval $ac_link) 2>&5
11351   ac_status=$?
11352   echo "$as_me:11352: \$? = $ac_status" >&5
11353   (exit $ac_status); } &&
11354          { ac_try='test -s conftest$ac_exeext'
11355   { (eval echo "$as_me:11355: \"$ac_try\"") >&5
11356   (eval $ac_try) 2>&5
11357   ac_status=$?
11358   echo "$as_me:11358: \$? = $ac_status" >&5
11359   (exit $ac_status); }; }; then
11360   ac_cv_lib_Xt_XtAppInitialize=yes
11361 else
11362   echo "$as_me: failed program was:" >&5
11363 cat conftest.$ac_ext >&5
11364 ac_cv_lib_Xt_XtAppInitialize=no
11365 fi
11366 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11367 LIBS=$ac_check_lib_save_LIBS
11368 fi
11369 echo "$as_me:11369: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
11370 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
11371 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
11372
11373 cat >>confdefs.h <<\EOF
11374 #define HAVE_LIBXT 1
11375 EOF
11376
11377                  cf_have_X_LIBS=Xt
11378                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
11379 fi
11380
11381 fi
11382
11383 fi
11384
11385 if test $cf_have_X_LIBS = no ; then
11386         { echo "$as_me:11386: WARNING: Unable to successfully link X Toolkit library (-lXt) with
11387 test program.  You will have to check and add the proper libraries by hand
11388 to makefile." >&5
11389 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
11390 test program.  You will have to check and add the proper libraries by hand
11391 to makefile." >&2;}
11392 fi
11393
11394 cf_x_athena_root=$cf_x_athena
11395 cf_x_athena_inc=""
11396
11397 for cf_path in default \
11398         /usr/contrib/X11R6 \
11399         /usr/contrib/X11R5 \
11400         /usr/lib/X11R5 \
11401         /usr/local
11402 do
11403         if test -z "$cf_x_athena_inc" ; then
11404                 cf_save="$CPPFLAGS"
11405                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
11406                 if test $cf_path != default ; then
11407                         CPPFLAGS="$cf_save -I$cf_path/include"
11408                         echo "$as_me:11408: checking for $cf_test in $cf_path" >&5
11409 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
11410                 else
11411                         echo "$as_me:11411: checking for $cf_test" >&5
11412 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
11413                 fi
11414                 cat >conftest.$ac_ext <<_ACEOF
11415 #line 11415 "configure"
11416 #include "confdefs.h"
11417
11418 #include <X11/Intrinsic.h>
11419 #include <$cf_test>
11420 int
11421 main ()
11422 {
11423
11424   ;
11425   return 0;
11426 }
11427 _ACEOF
11428 rm -f conftest.$ac_objext
11429 if { (eval echo "$as_me:11429: \"$ac_compile\"") >&5
11430   (eval $ac_compile) 2>&5
11431   ac_status=$?
11432   echo "$as_me:11432: \$? = $ac_status" >&5
11433   (exit $ac_status); } &&
11434          { ac_try='test -s conftest.$ac_objext'
11435   { (eval echo "$as_me:11435: \"$ac_try\"") >&5
11436   (eval $ac_try) 2>&5
11437   ac_status=$?
11438   echo "$as_me:11438: \$? = $ac_status" >&5
11439   (exit $ac_status); }; }; then
11440   cf_result=yes
11441 else
11442   echo "$as_me: failed program was:" >&5
11443 cat conftest.$ac_ext >&5
11444 cf_result=no
11445 fi
11446 rm -f conftest.$ac_objext conftest.$ac_ext
11447                 echo "$as_me:11447: result: $cf_result" >&5
11448 echo "${ECHO_T}$cf_result" >&6
11449                 if test "$cf_result" = yes ; then
11450                         cf_x_athena_inc=$cf_path
11451                         break
11452                 else
11453                         CPPFLAGS="$cf_save"
11454                 fi
11455         fi
11456 done
11457
11458 if test -z "$cf_x_athena_inc" ; then
11459         { echo "$as_me:11459: WARNING: Unable to successfully find Athena header files with test program" >&5
11460 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
11461 elif test "$cf_x_athena_inc" != default ; then
11462         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
11463 fi
11464
11465 cf_x_athena_root=$cf_x_athena
11466 cf_x_athena_lib=""
11467
11468 for cf_path in default \
11469         /usr/contrib/X11R6 \
11470         /usr/contrib/X11R5 \
11471         /usr/lib/X11R5 \
11472         /usr/local
11473 do
11474         for cf_lib in \
11475                 ${cf_x_athena_root} \
11476                 ${cf_x_athena_root}7 \
11477                 ${cf_x_athena_root}6
11478         do
11479         for cf_libs in \
11480                 "-l$cf_lib -lXmu" \
11481                 "-l$cf_lib -lXpm -lXmu" \
11482                 "-l${cf_lib}_s -lXmu_s"
11483         do
11484                 if test -z "$cf_x_athena_lib" ; then
11485                         cf_save="$LIBS"
11486                         cf_test=XawSimpleMenuAddGlobalActions
11487                         if test $cf_path != default ; then
11488                                 LIBS="-L$cf_path/lib $cf_libs $LIBS"
11489                                 echo "$as_me:11489: checking for $cf_libs in $cf_path" >&5
11490 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
11491                         else
11492                                 LIBS="$cf_libs $LIBS"
11493                                 echo "$as_me:11493: checking for $cf_test in $cf_libs" >&5
11494 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
11495                         fi
11496                         cat >conftest.$ac_ext <<_ACEOF
11497 #line 11497 "configure"
11498 #include "confdefs.h"
11499
11500 #include <X11/Intrinsic.h>
11501 #include <X11/$cf_x_athena_root/SimpleMenu.h>
11502
11503 int
11504 main ()
11505 {
11506
11507 $cf_test((XtAppContext) 0)
11508   ;
11509   return 0;
11510 }
11511 _ACEOF
11512 rm -f conftest.$ac_objext conftest$ac_exeext
11513 if { (eval echo "$as_me:11513: \"$ac_link\"") >&5
11514   (eval $ac_link) 2>&5
11515   ac_status=$?
11516   echo "$as_me:11516: \$? = $ac_status" >&5
11517   (exit $ac_status); } &&
11518          { ac_try='test -s conftest$ac_exeext'
11519   { (eval echo "$as_me:11519: \"$ac_try\"") >&5
11520   (eval $ac_try) 2>&5
11521   ac_status=$?
11522   echo "$as_me:11522: \$? = $ac_status" >&5
11523   (exit $ac_status); }; }; then
11524   cf_result=yes
11525 else
11526   echo "$as_me: failed program was:" >&5
11527 cat conftest.$ac_ext >&5
11528 cf_result=no
11529 fi
11530 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11531                         echo "$as_me:11531: result: $cf_result" >&5
11532 echo "${ECHO_T}$cf_result" >&6
11533                         if test "$cf_result" = yes ; then
11534                                 cf_x_athena_lib="$cf_libs"
11535                                 break
11536                         fi
11537                         LIBS="$cf_save"
11538                 fi
11539         done # cf_libs
11540                 test -n "$cf_x_athena_lib" && break
11541         done # cf_lib
11542 done
11543
11544 if test -z "$cf_x_athena_lib" ; then
11545         { { echo "$as_me:11545: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
11546 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
11547    { (exit 1); exit 1; }; }
11548 fi
11549
11550 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11551
11552 cat >>confdefs.h <<EOF
11553 #define $cf_x_athena_LIBS 1
11554 EOF
11555
11556 fi
11557
11558 if test -n "$ac_tool_prefix"; then
11559   for ac_prog in xcurses-config
11560   do
11561     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
11562 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
11563 echo "$as_me:11563: checking for $ac_word" >&5
11564 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11565 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
11566   echo $ECHO_N "(cached) $ECHO_C" >&6
11567 else
11568   if test -n "$XCURSES_CONFIG"; then
11569   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
11570 else
11571   ac_save_IFS=$IFS; IFS=$ac_path_separator
11572 ac_dummy="$PATH"
11573 for ac_dir in $ac_dummy; do
11574   IFS=$ac_save_IFS
11575   test -z "$ac_dir" && ac_dir=.
11576   $as_executable_p "$ac_dir/$ac_word" || continue
11577 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
11578 echo "$as_me:11578: found $ac_dir/$ac_word" >&5
11579 break
11580 done
11581
11582 fi
11583 fi
11584 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
11585 if test -n "$XCURSES_CONFIG"; then
11586   echo "$as_me:11586: result: $XCURSES_CONFIG" >&5
11587 echo "${ECHO_T}$XCURSES_CONFIG" >&6
11588 else
11589   echo "$as_me:11589: result: no" >&5
11590 echo "${ECHO_T}no" >&6
11591 fi
11592
11593     test -n "$XCURSES_CONFIG" && break
11594   done
11595 fi
11596 if test -z "$XCURSES_CONFIG"; then
11597   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
11598   for ac_prog in xcurses-config
11599 do
11600   # Extract the first word of "$ac_prog", so it can be a program name with args.
11601 set dummy $ac_prog; ac_word=$2
11602 echo "$as_me:11602: checking for $ac_word" >&5
11603 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11604 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
11605   echo $ECHO_N "(cached) $ECHO_C" >&6
11606 else
11607   if test -n "$ac_ct_XCURSES_CONFIG"; then
11608   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
11609 else
11610   ac_save_IFS=$IFS; IFS=$ac_path_separator
11611 ac_dummy="$PATH"
11612 for ac_dir in $ac_dummy; do
11613   IFS=$ac_save_IFS
11614   test -z "$ac_dir" && ac_dir=.
11615   $as_executable_p "$ac_dir/$ac_word" || continue
11616 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
11617 echo "$as_me:11617: found $ac_dir/$ac_word" >&5
11618 break
11619 done
11620
11621 fi
11622 fi
11623 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
11624 if test -n "$ac_ct_XCURSES_CONFIG"; then
11625   echo "$as_me:11625: result: $ac_ct_XCURSES_CONFIG" >&5
11626 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
11627 else
11628   echo "$as_me:11628: result: no" >&5
11629 echo "${ECHO_T}no" >&6
11630 fi
11631
11632   test -n "$ac_ct_XCURSES_CONFIG" && break
11633 done
11634 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
11635
11636   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
11637 fi
11638
11639 if test "$XCURSES_CONFIG" != none ; then
11640
11641 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
11642 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
11643
11644 cf_cv_lib_XCurses=yes
11645
11646 else
11647
11648 LDFLAGS="$LDFLAGS $X_LIBS"
11649
11650 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11651
11652 echo "${as_me:-configure}:11652: testing checking additions to CFLAGS ..." 1>&5
11653
11654 cf_check_cflags="$CFLAGS"
11655 cf_check_cppflags="$CPPFLAGS"
11656
11657 cf_fix_cppflags=no
11658 cf_new_cflags=
11659 cf_new_cppflags=
11660 cf_new_extra_cppflags=
11661
11662 for cf_add_cflags in $X_CFLAGS
11663 do
11664 case $cf_fix_cppflags in
11665 no)
11666         case $cf_add_cflags in #(vi
11667         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11668                 case $cf_add_cflags in
11669                 -D*)
11670                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11671
11672                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11673                                 && test -z "${cf_tst_cflags}" \
11674                                 && cf_fix_cppflags=yes
11675
11676                         if test $cf_fix_cppflags = yes ; then
11677                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11678                                 continue
11679                         elif test "${cf_tst_cflags}" = "\"'" ; then
11680                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11681                                 continue
11682                         fi
11683                         ;;
11684                 esac
11685                 case "$CPPFLAGS" in
11686                 *$cf_add_cflags) #(vi
11687                         ;;
11688                 *) #(vi
11689                         case $cf_add_cflags in #(vi
11690                         -D*)
11691                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11692
11693 CPPFLAGS=`echo "$CPPFLAGS" | \
11694         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11695                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11696
11697                                 ;;
11698                         esac
11699                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11700                         ;;
11701                 esac
11702                 ;;
11703         *)
11704                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11705                 ;;
11706         esac
11707         ;;
11708 yes)
11709         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11710
11711         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11712
11713         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11714                 && test -z "${cf_tst_cflags}" \
11715                 && cf_fix_cppflags=no
11716         ;;
11717 esac
11718 done
11719
11720 if test -n "$cf_new_cflags" ; then
11721         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11722
11723 echo "${as_me:-configure}:11723: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11724
11725         CFLAGS="$CFLAGS $cf_new_cflags"
11726 fi
11727
11728 if test -n "$cf_new_cppflags" ; then
11729         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11730
11731 echo "${as_me:-configure}:11731: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11732
11733         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11734 fi
11735
11736 if test -n "$cf_new_extra_cppflags" ; then
11737         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11738
11739 echo "${as_me:-configure}:11739: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11740
11741         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11742 fi
11743
11744 if test "$cf_check_cflags" != "$CFLAGS" ; then
11745 cat >conftest.$ac_ext <<_ACEOF
11746 #line 11746 "configure"
11747 #include "confdefs.h"
11748 #include <stdio.h>
11749 int
11750 main ()
11751 {
11752 printf("Hello world");
11753   ;
11754   return 0;
11755 }
11756 _ACEOF
11757 rm -f conftest.$ac_objext conftest$ac_exeext
11758 if { (eval echo "$as_me:11758: \"$ac_link\"") >&5
11759   (eval $ac_link) 2>&5
11760   ac_status=$?
11761   echo "$as_me:11761: \$? = $ac_status" >&5
11762   (exit $ac_status); } &&
11763          { ac_try='test -s conftest$ac_exeext'
11764   { (eval echo "$as_me:11764: \"$ac_try\"") >&5
11765   (eval $ac_try) 2>&5
11766   ac_status=$?
11767   echo "$as_me:11767: \$? = $ac_status" >&5
11768   (exit $ac_status); }; }; then
11769   :
11770 else
11771   echo "$as_me: failed program was:" >&5
11772 cat conftest.$ac_ext >&5
11773 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
11774
11775 echo "${as_me:-configure}:11775: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
11776
11777          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
11778                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
11779
11780 echo "${as_me:-configure}:11780: testing but keeping change to \$CPPFLAGS ..." 1>&5
11781
11782          fi
11783          CFLAGS="$cf_check_flags"
11784 fi
11785 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11786 fi
11787
11788 echo "$as_me:11788: checking for XOpenDisplay in -lX11" >&5
11789 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
11790 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
11791   echo $ECHO_N "(cached) $ECHO_C" >&6
11792 else
11793   ac_check_lib_save_LIBS=$LIBS
11794 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11795 cat >conftest.$ac_ext <<_ACEOF
11796 #line 11796 "configure"
11797 #include "confdefs.h"
11798
11799 /* Override any gcc2 internal prototype to avoid an error.  */
11800 #ifdef __cplusplus
11801 extern "C"
11802 #endif
11803 /* We use char because int might match the return type of a gcc2
11804    builtin and then its argument prototype would still apply.  */
11805 char XOpenDisplay ();
11806 int
11807 main ()
11808 {
11809 XOpenDisplay ();
11810   ;
11811   return 0;
11812 }
11813 _ACEOF
11814 rm -f conftest.$ac_objext conftest$ac_exeext
11815 if { (eval echo "$as_me:11815: \"$ac_link\"") >&5
11816   (eval $ac_link) 2>&5
11817   ac_status=$?
11818   echo "$as_me:11818: \$? = $ac_status" >&5
11819   (exit $ac_status); } &&
11820          { ac_try='test -s conftest$ac_exeext'
11821   { (eval echo "$as_me:11821: \"$ac_try\"") >&5
11822   (eval $ac_try) 2>&5
11823   ac_status=$?
11824   echo "$as_me:11824: \$? = $ac_status" >&5
11825   (exit $ac_status); }; }; then
11826   ac_cv_lib_X11_XOpenDisplay=yes
11827 else
11828   echo "$as_me: failed program was:" >&5
11829 cat conftest.$ac_ext >&5
11830 ac_cv_lib_X11_XOpenDisplay=no
11831 fi
11832 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11833 LIBS=$ac_check_lib_save_LIBS
11834 fi
11835 echo "$as_me:11835: result: $ac_cv_lib_X11_XOpenDisplay" >&5
11836 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
11837 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
11838   LIBS="-lX11 $LIBS"
11839 fi
11840
11841 echo "$as_me:11841: checking for XCurses library" >&5
11842 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
11843 if test "${cf_cv_lib_XCurses+set}" = set; then
11844   echo $ECHO_N "(cached) $ECHO_C" >&6
11845 else
11846
11847 LIBS="-lXCurses $LIBS"
11848 cat >conftest.$ac_ext <<_ACEOF
11849 #line 11849 "configure"
11850 #include "confdefs.h"
11851
11852 #include <xcurses.h>
11853 char *XCursesProgramName = "test";
11854
11855 int
11856 main ()
11857 {
11858 XCursesExit();
11859   ;
11860   return 0;
11861 }
11862 _ACEOF
11863 rm -f conftest.$ac_objext conftest$ac_exeext
11864 if { (eval echo "$as_me:11864: \"$ac_link\"") >&5
11865   (eval $ac_link) 2>&5
11866   ac_status=$?
11867   echo "$as_me:11867: \$? = $ac_status" >&5
11868   (exit $ac_status); } &&
11869          { ac_try='test -s conftest$ac_exeext'
11870   { (eval echo "$as_me:11870: \"$ac_try\"") >&5
11871   (eval $ac_try) 2>&5
11872   ac_status=$?
11873   echo "$as_me:11873: \$? = $ac_status" >&5
11874   (exit $ac_status); }; }; then
11875   cf_cv_lib_XCurses=yes
11876 else
11877   echo "$as_me: failed program was:" >&5
11878 cat conftest.$ac_ext >&5
11879 cf_cv_lib_XCurses=no
11880 fi
11881 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11882
11883 fi
11884 echo "$as_me:11884: result: $cf_cv_lib_XCurses" >&5
11885 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
11886
11887 fi
11888
11889 if test $cf_cv_lib_XCurses = yes ; then
11890
11891 cat >>confdefs.h <<\EOF
11892 #define UNIX 1
11893 EOF
11894
11895 cat >>confdefs.h <<\EOF
11896 #define XCURSES 1
11897 EOF
11898
11899         echo "$as_me:11899: checking for xcurses.h" >&5
11900 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
11901 if test "${ac_cv_header_xcurses_h+set}" = set; then
11902   echo $ECHO_N "(cached) $ECHO_C" >&6
11903 else
11904   cat >conftest.$ac_ext <<_ACEOF
11905 #line 11905 "configure"
11906 #include "confdefs.h"
11907 #include <xcurses.h>
11908 _ACEOF
11909 if { (eval echo "$as_me:11909: \"$ac_cpp conftest.$ac_ext\"") >&5
11910   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11911   ac_status=$?
11912   egrep -v '^ *\+' conftest.er1 >conftest.err
11913   rm -f conftest.er1
11914   cat conftest.err >&5
11915   echo "$as_me:11915: \$? = $ac_status" >&5
11916   (exit $ac_status); } >/dev/null; then
11917   if test -s conftest.err; then
11918     ac_cpp_err=$ac_c_preproc_warn_flag
11919   else
11920     ac_cpp_err=
11921   fi
11922 else
11923   ac_cpp_err=yes
11924 fi
11925 if test -z "$ac_cpp_err"; then
11926   ac_cv_header_xcurses_h=yes
11927 else
11928   echo "$as_me: failed program was:" >&5
11929   cat conftest.$ac_ext >&5
11930   ac_cv_header_xcurses_h=no
11931 fi
11932 rm -f conftest.err conftest.$ac_ext
11933 fi
11934 echo "$as_me:11934: result: $ac_cv_header_xcurses_h" >&5
11935 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
11936 if test $ac_cv_header_xcurses_h = yes; then
11937
11938 cat >>confdefs.h <<\EOF
11939 #define HAVE_XCURSES 1
11940 EOF
11941
11942 fi
11943
11944 else
11945         { { echo "$as_me:11945: error: Cannot link with XCurses" >&5
11946 echo "$as_me: error: Cannot link with XCurses" >&2;}
11947    { (exit 1); exit 1; }; }
11948 fi
11949
11950         ;;
11951 esac
11952
11953 case $cf_cv_screen in
11954 curses|curses_*)
11955
11956 echo "$as_me:11956: checking for NetBSD form.h" >&5
11957 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
11958 if test "${cf_cv_netbsd_form_h+set}" = set; then
11959   echo $ECHO_N "(cached) $ECHO_C" >&6
11960 else
11961
11962 cat >conftest.$ac_ext <<_ACEOF
11963 #line 11963 "configure"
11964 #include "confdefs.h"
11965
11966 #include <${cf_cv_ncurses_header:-curses.h}>
11967 #include <form.h>
11968
11969 int
11970 main ()
11971 {
11972
11973         FORM *form;
11974         int y = current_field(form)->cursor_ypos;
11975         int x = current_field(form)->cursor_xpos;
11976
11977   ;
11978   return 0;
11979 }
11980 _ACEOF
11981 rm -f conftest.$ac_objext
11982 if { (eval echo "$as_me:11982: \"$ac_compile\"") >&5
11983   (eval $ac_compile) 2>&5
11984   ac_status=$?
11985   echo "$as_me:11985: \$? = $ac_status" >&5
11986   (exit $ac_status); } &&
11987          { ac_try='test -s conftest.$ac_objext'
11988   { (eval echo "$as_me:11988: \"$ac_try\"") >&5
11989   (eval $ac_try) 2>&5
11990   ac_status=$?
11991   echo "$as_me:11991: \$? = $ac_status" >&5
11992   (exit $ac_status); }; }; then
11993   cf_cv_netbsd_form_h=yes
11994
11995 else
11996   echo "$as_me: failed program was:" >&5
11997 cat conftest.$ac_ext >&5
11998 cf_cv_netbsd_form_h=no
11999 fi
12000 rm -f conftest.$ac_objext conftest.$ac_ext
12001
12002 fi
12003 echo "$as_me:12003: result: $cf_cv_netbsd_form_h" >&5
12004 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
12005
12006 test "$cf_cv_netbsd_form_h" = yes &&
12007 cat >>confdefs.h <<\EOF
12008 #define HAVE_NETBSD_FORM_H 1
12009 EOF
12010
12011 echo "$as_me:12011: checking for NetBSD menu.h" >&5
12012 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
12013 if test "${cf_cv_netbsd_menu_h+set}" = set; then
12014   echo $ECHO_N "(cached) $ECHO_C" >&6
12015 else
12016
12017 cat >conftest.$ac_ext <<_ACEOF
12018 #line 12018 "configure"
12019 #include "confdefs.h"
12020
12021 #include <${cf_cv_ncurses_header:-curses.h}>
12022 #include <menu.h>
12023
12024 int
12025 main ()
12026 {
12027
12028         MENU *menu;
12029         int y = menu->max_item_width;
12030
12031   ;
12032   return 0;
12033 }
12034 _ACEOF
12035 rm -f conftest.$ac_objext
12036 if { (eval echo "$as_me:12036: \"$ac_compile\"") >&5
12037   (eval $ac_compile) 2>&5
12038   ac_status=$?
12039   echo "$as_me:12039: \$? = $ac_status" >&5
12040   (exit $ac_status); } &&
12041          { ac_try='test -s conftest.$ac_objext'
12042   { (eval echo "$as_me:12042: \"$ac_try\"") >&5
12043   (eval $ac_try) 2>&5
12044   ac_status=$?
12045   echo "$as_me:12045: \$? = $ac_status" >&5
12046   (exit $ac_status); }; }; then
12047   cf_cv_netbsd_menu_h=yes
12048
12049 else
12050   echo "$as_me: failed program was:" >&5
12051 cat conftest.$ac_ext >&5
12052 cf_cv_netbsd_menu_h=no
12053 fi
12054 rm -f conftest.$ac_objext conftest.$ac_ext
12055
12056 fi
12057 echo "$as_me:12057: result: $cf_cv_netbsd_menu_h" >&5
12058 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
12059
12060 test "$cf_cv_netbsd_menu_h" = yes &&
12061 cat >>confdefs.h <<\EOF
12062 #define HAVE_NETBSD_MENU_H 1
12063 EOF
12064
12065         ;;
12066 ncursesw)
12067         cf_cv_libtype=w
12068         ;;
12069 esac
12070
12071 case $cf_cv_screen in #(vi
12072 pdcurses) #(vi
12073         ;;
12074 *)
12075         # look for curses-related libraries
12076         : ${cf_panel_lib:=panel}
12077         : ${cf_menu_lib:=menu}
12078         : ${cf_form_lib:=form}
12079
12080 as_ac_Lib=`echo "ac_cv_lib_$cf_panel_lib$cf_cv_libtype''_new_panel" | $as_tr_sh`
12081 echo "$as_me:12081: checking for new_panel in -l$cf_panel_lib$cf_cv_libtype" >&5
12082 echo $ECHO_N "checking for new_panel in -l$cf_panel_lib$cf_cv_libtype... $ECHO_C" >&6
12083 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12084   echo $ECHO_N "(cached) $ECHO_C" >&6
12085 else
12086   ac_check_lib_save_LIBS=$LIBS
12087 LIBS="-l$cf_panel_lib$cf_cv_libtype  $LIBS"
12088 cat >conftest.$ac_ext <<_ACEOF
12089 #line 12089 "configure"
12090 #include "confdefs.h"
12091
12092 /* Override any gcc2 internal prototype to avoid an error.  */
12093 #ifdef __cplusplus
12094 extern "C"
12095 #endif
12096 /* We use char because int might match the return type of a gcc2
12097    builtin and then its argument prototype would still apply.  */
12098 char new_panel ();
12099 int
12100 main ()
12101 {
12102 new_panel ();
12103   ;
12104   return 0;
12105 }
12106 _ACEOF
12107 rm -f conftest.$ac_objext conftest$ac_exeext
12108 if { (eval echo "$as_me:12108: \"$ac_link\"") >&5
12109   (eval $ac_link) 2>&5
12110   ac_status=$?
12111   echo "$as_me:12111: \$? = $ac_status" >&5
12112   (exit $ac_status); } &&
12113          { ac_try='test -s conftest$ac_exeext'
12114   { (eval echo "$as_me:12114: \"$ac_try\"") >&5
12115   (eval $ac_try) 2>&5
12116   ac_status=$?
12117   echo "$as_me:12117: \$? = $ac_status" >&5
12118   (exit $ac_status); }; }; then
12119   eval "$as_ac_Lib=yes"
12120 else
12121   echo "$as_me: failed program was:" >&5
12122 cat conftest.$ac_ext >&5
12123 eval "$as_ac_Lib=no"
12124 fi
12125 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12126 LIBS=$ac_check_lib_save_LIBS
12127 fi
12128 echo "$as_me:12128: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12129 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12130 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12131   cat >>confdefs.h <<EOF
12132 #define `echo "HAVE_LIB$cf_panel_lib$cf_cv_libtype" | $as_tr_cpp` 1
12133 EOF
12134
12135   LIBS="-l$cf_panel_lib$cf_cv_libtype $LIBS"
12136
12137 fi
12138
12139 as_ac_Lib=`echo "ac_cv_lib_$cf_menu_lib$cf_cv_libtype''_menu_driver" | $as_tr_sh`
12140 echo "$as_me:12140: checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype" >&5
12141 echo $ECHO_N "checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype... $ECHO_C" >&6
12142 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12143   echo $ECHO_N "(cached) $ECHO_C" >&6
12144 else
12145   ac_check_lib_save_LIBS=$LIBS
12146 LIBS="-l$cf_menu_lib$cf_cv_libtype  $LIBS"
12147 cat >conftest.$ac_ext <<_ACEOF
12148 #line 12148 "configure"
12149 #include "confdefs.h"
12150
12151 /* Override any gcc2 internal prototype to avoid an error.  */
12152 #ifdef __cplusplus
12153 extern "C"
12154 #endif
12155 /* We use char because int might match the return type of a gcc2
12156    builtin and then its argument prototype would still apply.  */
12157 char menu_driver ();
12158 int
12159 main ()
12160 {
12161 menu_driver ();
12162   ;
12163   return 0;
12164 }
12165 _ACEOF
12166 rm -f conftest.$ac_objext conftest$ac_exeext
12167 if { (eval echo "$as_me:12167: \"$ac_link\"") >&5
12168   (eval $ac_link) 2>&5
12169   ac_status=$?
12170   echo "$as_me:12170: \$? = $ac_status" >&5
12171   (exit $ac_status); } &&
12172          { ac_try='test -s conftest$ac_exeext'
12173   { (eval echo "$as_me:12173: \"$ac_try\"") >&5
12174   (eval $ac_try) 2>&5
12175   ac_status=$?
12176   echo "$as_me:12176: \$? = $ac_status" >&5
12177   (exit $ac_status); }; }; then
12178   eval "$as_ac_Lib=yes"
12179 else
12180   echo "$as_me: failed program was:" >&5
12181 cat conftest.$ac_ext >&5
12182 eval "$as_ac_Lib=no"
12183 fi
12184 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12185 LIBS=$ac_check_lib_save_LIBS
12186 fi
12187 echo "$as_me:12187: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12188 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12189 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12190   cat >>confdefs.h <<EOF
12191 #define `echo "HAVE_LIB$cf_menu_lib$cf_cv_libtype" | $as_tr_cpp` 1
12192 EOF
12193
12194   LIBS="-l$cf_menu_lib$cf_cv_libtype $LIBS"
12195
12196 fi
12197
12198 as_ac_Lib=`echo "ac_cv_lib_$cf_form_lib$cf_cv_libtype''_form_driver" | $as_tr_sh`
12199 echo "$as_me:12199: checking for form_driver in -l$cf_form_lib$cf_cv_libtype" >&5
12200 echo $ECHO_N "checking for form_driver in -l$cf_form_lib$cf_cv_libtype... $ECHO_C" >&6
12201 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12202   echo $ECHO_N "(cached) $ECHO_C" >&6
12203 else
12204   ac_check_lib_save_LIBS=$LIBS
12205 LIBS="-l$cf_form_lib$cf_cv_libtype  $LIBS"
12206 cat >conftest.$ac_ext <<_ACEOF
12207 #line 12207 "configure"
12208 #include "confdefs.h"
12209
12210 /* Override any gcc2 internal prototype to avoid an error.  */
12211 #ifdef __cplusplus
12212 extern "C"
12213 #endif
12214 /* We use char because int might match the return type of a gcc2
12215    builtin and then its argument prototype would still apply.  */
12216 char form_driver ();
12217 int
12218 main ()
12219 {
12220 form_driver ();
12221   ;
12222   return 0;
12223 }
12224 _ACEOF
12225 rm -f conftest.$ac_objext conftest$ac_exeext
12226 if { (eval echo "$as_me:12226: \"$ac_link\"") >&5
12227   (eval $ac_link) 2>&5
12228   ac_status=$?
12229   echo "$as_me:12229: \$? = $ac_status" >&5
12230   (exit $ac_status); } &&
12231          { ac_try='test -s conftest$ac_exeext'
12232   { (eval echo "$as_me:12232: \"$ac_try\"") >&5
12233   (eval $ac_try) 2>&5
12234   ac_status=$?
12235   echo "$as_me:12235: \$? = $ac_status" >&5
12236   (exit $ac_status); }; }; then
12237   eval "$as_ac_Lib=yes"
12238 else
12239   echo "$as_me: failed program was:" >&5
12240 cat conftest.$ac_ext >&5
12241 eval "$as_ac_Lib=no"
12242 fi
12243 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12244 LIBS=$ac_check_lib_save_LIBS
12245 fi
12246 echo "$as_me:12246: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12247 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12248 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12249   cat >>confdefs.h <<EOF
12250 #define `echo "HAVE_LIB$cf_form_lib$cf_cv_libtype" | $as_tr_cpp` 1
12251 EOF
12252
12253   LIBS="-l$cf_form_lib$cf_cv_libtype $LIBS"
12254
12255 fi
12256
12257         # look for curses-related headers
12258
12259 for ac_header in \
12260                 nc_alloc.h \
12261                 nomacros.h \
12262                 form.h \
12263                 menu.h \
12264                 panel.h \
12265                 term_entry.h \
12266
12267 do
12268 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12269 echo "$as_me:12269: checking for $ac_header" >&5
12270 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12271 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12272   echo $ECHO_N "(cached) $ECHO_C" >&6
12273 else
12274   cat >conftest.$ac_ext <<_ACEOF
12275 #line 12275 "configure"
12276 #include "confdefs.h"
12277 #include <$ac_header>
12278 _ACEOF
12279 if { (eval echo "$as_me:12279: \"$ac_cpp conftest.$ac_ext\"") >&5
12280   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12281   ac_status=$?
12282   egrep -v '^ *\+' conftest.er1 >conftest.err
12283   rm -f conftest.er1
12284   cat conftest.err >&5
12285   echo "$as_me:12285: \$? = $ac_status" >&5
12286   (exit $ac_status); } >/dev/null; then
12287   if test -s conftest.err; then
12288     ac_cpp_err=$ac_c_preproc_warn_flag
12289   else
12290     ac_cpp_err=
12291   fi
12292 else
12293   ac_cpp_err=yes
12294 fi
12295 if test -z "$ac_cpp_err"; then
12296   eval "$as_ac_Header=yes"
12297 else
12298   echo "$as_me: failed program was:" >&5
12299   cat conftest.$ac_ext >&5
12300   eval "$as_ac_Header=no"
12301 fi
12302 rm -f conftest.err conftest.$ac_ext
12303 fi
12304 echo "$as_me:12304: result: `eval echo '${'$as_ac_Header'}'`" >&5
12305 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12306 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12307   cat >>confdefs.h <<EOF
12308 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12309 EOF
12310
12311 fi
12312 done
12313
12314         ;;
12315 esac
12316
12317 echo "$as_me:12317: checking for ANSI C header files" >&5
12318 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
12319 if test "${ac_cv_header_stdc+set}" = set; then
12320   echo $ECHO_N "(cached) $ECHO_C" >&6
12321 else
12322   cat >conftest.$ac_ext <<_ACEOF
12323 #line 12323 "configure"
12324 #include "confdefs.h"
12325 #include <stdlib.h>
12326 #include <stdarg.h>
12327 #include <string.h>
12328 #include <float.h>
12329
12330 _ACEOF
12331 if { (eval echo "$as_me:12331: \"$ac_cpp conftest.$ac_ext\"") >&5
12332   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12333   ac_status=$?
12334   egrep -v '^ *\+' conftest.er1 >conftest.err
12335   rm -f conftest.er1
12336   cat conftest.err >&5
12337   echo "$as_me:12337: \$? = $ac_status" >&5
12338   (exit $ac_status); } >/dev/null; then
12339   if test -s conftest.err; then
12340     ac_cpp_err=$ac_c_preproc_warn_flag
12341   else
12342     ac_cpp_err=
12343   fi
12344 else
12345   ac_cpp_err=yes
12346 fi
12347 if test -z "$ac_cpp_err"; then
12348   ac_cv_header_stdc=yes
12349 else
12350   echo "$as_me: failed program was:" >&5
12351   cat conftest.$ac_ext >&5
12352   ac_cv_header_stdc=no
12353 fi
12354 rm -f conftest.err conftest.$ac_ext
12355
12356 if test $ac_cv_header_stdc = yes; then
12357   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12358   cat >conftest.$ac_ext <<_ACEOF
12359 #line 12359 "configure"
12360 #include "confdefs.h"
12361 #include <string.h>
12362
12363 _ACEOF
12364 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12365   egrep "memchr" >/dev/null 2>&1; then
12366   :
12367 else
12368   ac_cv_header_stdc=no
12369 fi
12370 rm -rf conftest*
12371
12372 fi
12373
12374 if test $ac_cv_header_stdc = yes; then
12375   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12376   cat >conftest.$ac_ext <<_ACEOF
12377 #line 12377 "configure"
12378 #include "confdefs.h"
12379 #include <stdlib.h>
12380
12381 _ACEOF
12382 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12383   egrep "free" >/dev/null 2>&1; then
12384   :
12385 else
12386   ac_cv_header_stdc=no
12387 fi
12388 rm -rf conftest*
12389
12390 fi
12391
12392 if test $ac_cv_header_stdc = yes; then
12393   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12394   if test "$cross_compiling" = yes; then
12395   :
12396 else
12397   cat >conftest.$ac_ext <<_ACEOF
12398 #line 12398 "configure"
12399 #include "confdefs.h"
12400 #include <ctype.h>
12401 #if ((' ' & 0x0FF) == 0x020)
12402 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12403 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12404 #else
12405 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
12406                      || ('j' <= (c) && (c) <= 'r') \
12407                      || ('s' <= (c) && (c) <= 'z'))
12408 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
12409 #endif
12410
12411 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12412 int
12413 main ()
12414 {
12415   int i;
12416   for (i = 0; i < 256; i++)
12417     if (XOR (islower (i), ISLOWER (i))
12418         || toupper (i) != TOUPPER (i))
12419       $ac_main_return(2);
12420   $ac_main_return (0);
12421 }
12422 _ACEOF
12423 rm -f conftest$ac_exeext
12424 if { (eval echo "$as_me:12424: \"$ac_link\"") >&5
12425   (eval $ac_link) 2>&5
12426   ac_status=$?
12427   echo "$as_me:12427: \$? = $ac_status" >&5
12428   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12429   { (eval echo "$as_me:12429: \"$ac_try\"") >&5
12430   (eval $ac_try) 2>&5
12431   ac_status=$?
12432   echo "$as_me:12432: \$? = $ac_status" >&5
12433   (exit $ac_status); }; }; then
12434   :
12435 else
12436   echo "$as_me: program exited with status $ac_status" >&5
12437 echo "$as_me: failed program was:" >&5
12438 cat conftest.$ac_ext >&5
12439 ac_cv_header_stdc=no
12440 fi
12441 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12442 fi
12443 fi
12444 fi
12445 echo "$as_me:12445: result: $ac_cv_header_stdc" >&5
12446 echo "${ECHO_T}$ac_cv_header_stdc" >&6
12447 if test $ac_cv_header_stdc = yes; then
12448
12449 cat >>confdefs.h <<\EOF
12450 #define STDC_HEADERS 1
12451 EOF
12452
12453 fi
12454
12455 echo "$as_me:12455: checking whether time.h and sys/time.h may both be included" >&5
12456 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
12457 if test "${ac_cv_header_time+set}" = set; then
12458   echo $ECHO_N "(cached) $ECHO_C" >&6
12459 else
12460   cat >conftest.$ac_ext <<_ACEOF
12461 #line 12461 "configure"
12462 #include "confdefs.h"
12463 #include <sys/types.h>
12464 #include <sys/time.h>
12465 #include <time.h>
12466
12467 int
12468 main ()
12469 {
12470 if ((struct tm *) 0)
12471 return 0;
12472   ;
12473   return 0;
12474 }
12475 _ACEOF
12476 rm -f conftest.$ac_objext
12477 if { (eval echo "$as_me:12477: \"$ac_compile\"") >&5
12478   (eval $ac_compile) 2>&5
12479   ac_status=$?
12480   echo "$as_me:12480: \$? = $ac_status" >&5
12481   (exit $ac_status); } &&
12482          { ac_try='test -s conftest.$ac_objext'
12483   { (eval echo "$as_me:12483: \"$ac_try\"") >&5
12484   (eval $ac_try) 2>&5
12485   ac_status=$?
12486   echo "$as_me:12486: \$? = $ac_status" >&5
12487   (exit $ac_status); }; }; then
12488   ac_cv_header_time=yes
12489 else
12490   echo "$as_me: failed program was:" >&5
12491 cat conftest.$ac_ext >&5
12492 ac_cv_header_time=no
12493 fi
12494 rm -f conftest.$ac_objext conftest.$ac_ext
12495 fi
12496 echo "$as_me:12496: result: $ac_cv_header_time" >&5
12497 echo "${ECHO_T}$ac_cv_header_time" >&6
12498 if test $ac_cv_header_time = yes; then
12499
12500 cat >>confdefs.h <<\EOF
12501 #define TIME_WITH_SYS_TIME 1
12502 EOF
12503
12504 fi
12505
12506 for ac_header in \
12507 getopt.h \
12508 locale.h \
12509 math.h \
12510 stdarg.h \
12511 sys/ioctl.h \
12512 sys/select.h \
12513 sys/time.h \
12514 termios.h \
12515 unistd.h \
12516
12517 do
12518 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12519 echo "$as_me:12519: checking for $ac_header" >&5
12520 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12521 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12522   echo $ECHO_N "(cached) $ECHO_C" >&6
12523 else
12524   cat >conftest.$ac_ext <<_ACEOF
12525 #line 12525 "configure"
12526 #include "confdefs.h"
12527 #include <$ac_header>
12528 _ACEOF
12529 if { (eval echo "$as_me:12529: \"$ac_cpp conftest.$ac_ext\"") >&5
12530   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12531   ac_status=$?
12532   egrep -v '^ *\+' conftest.er1 >conftest.err
12533   rm -f conftest.er1
12534   cat conftest.err >&5
12535   echo "$as_me:12535: \$? = $ac_status" >&5
12536   (exit $ac_status); } >/dev/null; then
12537   if test -s conftest.err; then
12538     ac_cpp_err=$ac_c_preproc_warn_flag
12539   else
12540     ac_cpp_err=
12541   fi
12542 else
12543   ac_cpp_err=yes
12544 fi
12545 if test -z "$ac_cpp_err"; then
12546   eval "$as_ac_Header=yes"
12547 else
12548   echo "$as_me: failed program was:" >&5
12549   cat conftest.$ac_ext >&5
12550   eval "$as_ac_Header=no"
12551 fi
12552 rm -f conftest.err conftest.$ac_ext
12553 fi
12554 echo "$as_me:12554: result: `eval echo '${'$as_ac_Header'}'`" >&5
12555 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12556 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12557   cat >>confdefs.h <<EOF
12558 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12559 EOF
12560
12561 fi
12562 done
12563
12564 for ac_header in unistd.h getopt.h
12565 do
12566 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12567 echo "$as_me:12567: checking for $ac_header" >&5
12568 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12569 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12570   echo $ECHO_N "(cached) $ECHO_C" >&6
12571 else
12572   cat >conftest.$ac_ext <<_ACEOF
12573 #line 12573 "configure"
12574 #include "confdefs.h"
12575 #include <$ac_header>
12576 _ACEOF
12577 if { (eval echo "$as_me:12577: \"$ac_cpp conftest.$ac_ext\"") >&5
12578   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12579   ac_status=$?
12580   egrep -v '^ *\+' conftest.er1 >conftest.err
12581   rm -f conftest.er1
12582   cat conftest.err >&5
12583   echo "$as_me:12583: \$? = $ac_status" >&5
12584   (exit $ac_status); } >/dev/null; then
12585   if test -s conftest.err; then
12586     ac_cpp_err=$ac_c_preproc_warn_flag
12587   else
12588     ac_cpp_err=
12589   fi
12590 else
12591   ac_cpp_err=yes
12592 fi
12593 if test -z "$ac_cpp_err"; then
12594   eval "$as_ac_Header=yes"
12595 else
12596   echo "$as_me: failed program was:" >&5
12597   cat conftest.$ac_ext >&5
12598   eval "$as_ac_Header=no"
12599 fi
12600 rm -f conftest.err conftest.$ac_ext
12601 fi
12602 echo "$as_me:12602: result: `eval echo '${'$as_ac_Header'}'`" >&5
12603 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12604 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12605   cat >>confdefs.h <<EOF
12606 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12607 EOF
12608
12609 fi
12610 done
12611
12612 echo "$as_me:12612: checking for header declaring getopt variables" >&5
12613 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
12614 if test "${cf_cv_getopt_header+set}" = set; then
12615   echo $ECHO_N "(cached) $ECHO_C" >&6
12616 else
12617
12618 cf_cv_getopt_header=none
12619 for cf_header in stdio.h stdlib.h unistd.h getopt.h
12620 do
12621 cat >conftest.$ac_ext <<_ACEOF
12622 #line 12622 "configure"
12623 #include "confdefs.h"
12624
12625 #include <$cf_header>
12626 int
12627 main ()
12628 {
12629 int x = optind; char *y = optarg
12630   ;
12631   return 0;
12632 }
12633 _ACEOF
12634 rm -f conftest.$ac_objext
12635 if { (eval echo "$as_me:12635: \"$ac_compile\"") >&5
12636   (eval $ac_compile) 2>&5
12637   ac_status=$?
12638   echo "$as_me:12638: \$? = $ac_status" >&5
12639   (exit $ac_status); } &&
12640          { ac_try='test -s conftest.$ac_objext'
12641   { (eval echo "$as_me:12641: \"$ac_try\"") >&5
12642   (eval $ac_try) 2>&5
12643   ac_status=$?
12644   echo "$as_me:12644: \$? = $ac_status" >&5
12645   (exit $ac_status); }; }; then
12646   cf_cv_getopt_header=$cf_header
12647  break
12648 else
12649   echo "$as_me: failed program was:" >&5
12650 cat conftest.$ac_ext >&5
12651 fi
12652 rm -f conftest.$ac_objext conftest.$ac_ext
12653 done
12654
12655 fi
12656 echo "$as_me:12656: result: $cf_cv_getopt_header" >&5
12657 echo "${ECHO_T}$cf_cv_getopt_header" >&6
12658 if test $cf_cv_getopt_header != none ; then
12659
12660 cat >>confdefs.h <<\EOF
12661 #define HAVE_GETOPT_HEADER 1
12662 EOF
12663
12664 fi
12665
12666 for ac_func in \
12667 gettimeofday \
12668
12669 do
12670 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
12671 echo "$as_me:12671: checking for $ac_func" >&5
12672 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
12673 if eval "test \"\${$as_ac_var+set}\" = set"; then
12674   echo $ECHO_N "(cached) $ECHO_C" >&6
12675 else
12676   cat >conftest.$ac_ext <<_ACEOF
12677 #line 12677 "configure"
12678 #include "confdefs.h"
12679 /* System header to define __stub macros and hopefully few prototypes,
12680     which can conflict with char $ac_func (); below.  */
12681 #include <assert.h>
12682 /* Override any gcc2 internal prototype to avoid an error.  */
12683 #ifdef __cplusplus
12684 extern "C"
12685 #endif
12686 /* We use char because int might match the return type of a gcc2
12687    builtin and then its argument prototype would still apply.  */
12688 char $ac_func ();
12689 char (*f) ();
12690
12691 int
12692 main ()
12693 {
12694 /* The GNU C library defines this for functions which it implements
12695     to always fail with ENOSYS.  Some functions are actually named
12696     something starting with __ and the normal name is an alias.  */
12697 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12698 choke me
12699 #else
12700 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12701 #endif
12702
12703   ;
12704   return 0;
12705 }
12706 _ACEOF
12707 rm -f conftest.$ac_objext conftest$ac_exeext
12708 if { (eval echo "$as_me:12708: \"$ac_link\"") >&5
12709   (eval $ac_link) 2>&5
12710   ac_status=$?
12711   echo "$as_me:12711: \$? = $ac_status" >&5
12712   (exit $ac_status); } &&
12713          { ac_try='test -s conftest$ac_exeext'
12714   { (eval echo "$as_me:12714: \"$ac_try\"") >&5
12715   (eval $ac_try) 2>&5
12716   ac_status=$?
12717   echo "$as_me:12717: \$? = $ac_status" >&5
12718   (exit $ac_status); }; }; then
12719   eval "$as_ac_var=yes"
12720 else
12721   echo "$as_me: failed program was:" >&5
12722 cat conftest.$ac_ext >&5
12723 eval "$as_ac_var=no"
12724 fi
12725 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12726 fi
12727 echo "$as_me:12727: result: `eval echo '${'$as_ac_var'}'`" >&5
12728 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
12729 if test `eval echo '${'$as_ac_var'}'` = yes; then
12730   cat >>confdefs.h <<EOF
12731 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
12732 EOF
12733
12734 fi
12735 done
12736
12737 if test "$cf_enable_widec" = yes; then
12738
12739 for ac_func in \
12740 mblen \
12741 mbrlen \
12742 mbrtowc \
12743 mbsrtowcs \
12744 mbstowcs \
12745 mbtowc \
12746 wcsrtombs \
12747 wcstombs \
12748
12749 do
12750 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
12751 echo "$as_me:12751: checking for $ac_func" >&5
12752 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
12753 if eval "test \"\${$as_ac_var+set}\" = set"; then
12754   echo $ECHO_N "(cached) $ECHO_C" >&6
12755 else
12756   cat >conftest.$ac_ext <<_ACEOF
12757 #line 12757 "configure"
12758 #include "confdefs.h"
12759 /* System header to define __stub macros and hopefully few prototypes,
12760     which can conflict with char $ac_func (); below.  */
12761 #include <assert.h>
12762 /* Override any gcc2 internal prototype to avoid an error.  */
12763 #ifdef __cplusplus
12764 extern "C"
12765 #endif
12766 /* We use char because int might match the return type of a gcc2
12767    builtin and then its argument prototype would still apply.  */
12768 char $ac_func ();
12769 char (*f) ();
12770
12771 int
12772 main ()
12773 {
12774 /* The GNU C library defines this for functions which it implements
12775     to always fail with ENOSYS.  Some functions are actually named
12776     something starting with __ and the normal name is an alias.  */
12777 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12778 choke me
12779 #else
12780 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12781 #endif
12782
12783   ;
12784   return 0;
12785 }
12786 _ACEOF
12787 rm -f conftest.$ac_objext conftest$ac_exeext
12788 if { (eval echo "$as_me:12788: \"$ac_link\"") >&5
12789   (eval $ac_link) 2>&5
12790   ac_status=$?
12791   echo "$as_me:12791: \$? = $ac_status" >&5
12792   (exit $ac_status); } &&
12793          { ac_try='test -s conftest$ac_exeext'
12794   { (eval echo "$as_me:12794: \"$ac_try\"") >&5
12795   (eval $ac_try) 2>&5
12796   ac_status=$?
12797   echo "$as_me:12797: \$? = $ac_status" >&5
12798   (exit $ac_status); }; }; then
12799   eval "$as_ac_var=yes"
12800 else
12801   echo "$as_me: failed program was:" >&5
12802 cat conftest.$ac_ext >&5
12803 eval "$as_ac_var=no"
12804 fi
12805 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12806 fi
12807 echo "$as_me:12807: result: `eval echo '${'$as_ac_var'}'`" >&5
12808 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
12809 if test `eval echo '${'$as_ac_var'}'` = yes; then
12810   cat >>confdefs.h <<EOF
12811 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
12812 EOF
12813
12814 fi
12815 done
12816
12817 fi
12818
12819 echo "$as_me:12819: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
12820 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
12821 if test "${cf_cv_need_xopen_extension+set}" = set; then
12822   echo $ECHO_N "(cached) $ECHO_C" >&6
12823 else
12824
12825 cat >conftest.$ac_ext <<_ACEOF
12826 #line 12826 "configure"
12827 #include "confdefs.h"
12828
12829 #include <stdlib.h>
12830 #include <${cf_cv_ncurses_header:-curses.h}>
12831 int
12832 main ()
12833 {
12834
12835 #if defined(NCURSES_VERSION_PATCH)
12836 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
12837         make an error
12838 #endif
12839 #endif
12840         long x = winnstr(stdscr, "", 0);
12841         int x1, y1;
12842         getbegyx(stdscr, y1, x1)
12843   ;
12844   return 0;
12845 }
12846 _ACEOF
12847 rm -f conftest.$ac_objext conftest$ac_exeext
12848 if { (eval echo "$as_me:12848: \"$ac_link\"") >&5
12849   (eval $ac_link) 2>&5
12850   ac_status=$?
12851   echo "$as_me:12851: \$? = $ac_status" >&5
12852   (exit $ac_status); } &&
12853          { ac_try='test -s conftest$ac_exeext'
12854   { (eval echo "$as_me:12854: \"$ac_try\"") >&5
12855   (eval $ac_try) 2>&5
12856   ac_status=$?
12857   echo "$as_me:12857: \$? = $ac_status" >&5
12858   (exit $ac_status); }; }; then
12859   cf_cv_need_xopen_extension=no
12860 else
12861   echo "$as_me: failed program was:" >&5
12862 cat conftest.$ac_ext >&5
12863 cat >conftest.$ac_ext <<_ACEOF
12864 #line 12864 "configure"
12865 #include "confdefs.h"
12866
12867 #define _XOPEN_SOURCE_EXTENDED
12868 #include <stdlib.h>
12869 #include <${cf_cv_ncurses_header:-curses.h}>
12870 int
12871 main ()
12872 {
12873
12874 #ifdef NCURSES_VERSION
12875         cchar_t check;
12876         int check2 = curs_set((int)sizeof(check));
12877 #endif
12878         long x = winnstr(stdscr, "", 0);
12879         int x1, y1;
12880         getbegyx(stdscr, y1, x1)
12881   ;
12882   return 0;
12883 }
12884 _ACEOF
12885 rm -f conftest.$ac_objext conftest$ac_exeext
12886 if { (eval echo "$as_me:12886: \"$ac_link\"") >&5
12887   (eval $ac_link) 2>&5
12888   ac_status=$?
12889   echo "$as_me:12889: \$? = $ac_status" >&5
12890   (exit $ac_status); } &&
12891          { ac_try='test -s conftest$ac_exeext'
12892   { (eval echo "$as_me:12892: \"$ac_try\"") >&5
12893   (eval $ac_try) 2>&5
12894   ac_status=$?
12895   echo "$as_me:12895: \$? = $ac_status" >&5
12896   (exit $ac_status); }; }; then
12897   cf_cv_need_xopen_extension=yes
12898 else
12899   echo "$as_me: failed program was:" >&5
12900 cat conftest.$ac_ext >&5
12901 cf_cv_need_xopen_extension=unknown
12902 fi
12903 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12904 fi
12905 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12906 fi
12907 echo "$as_me:12907: result: $cf_cv_need_xopen_extension" >&5
12908 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
12909 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
12910
12911 echo "$as_me:12911: checking for term.h" >&5
12912 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
12913 if test "${cf_cv_term_header+set}" = set; then
12914   echo $ECHO_N "(cached) $ECHO_C" >&6
12915 else
12916
12917 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
12918 # for <term.h> if we do not find the variant.
12919
12920 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
12921
12922 case ${cf_cv_ncurses_header:-curses.h} in #(vi
12923 */*)
12924         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
12925         cf_header_list="$cf_header_item $cf_header_list"
12926         ;;
12927 esac
12928
12929 for cf_header in $cf_header_list
12930 do
12931         cat >conftest.$ac_ext <<_ACEOF
12932 #line 12932 "configure"
12933 #include "confdefs.h"
12934
12935 #include <${cf_cv_ncurses_header:-curses.h}>
12936 #include <${cf_header}>
12937 int
12938 main ()
12939 {
12940 WINDOW *x
12941   ;
12942   return 0;
12943 }
12944 _ACEOF
12945 rm -f conftest.$ac_objext
12946 if { (eval echo "$as_me:12946: \"$ac_compile\"") >&5
12947   (eval $ac_compile) 2>&5
12948   ac_status=$?
12949   echo "$as_me:12949: \$? = $ac_status" >&5
12950   (exit $ac_status); } &&
12951          { ac_try='test -s conftest.$ac_objext'
12952   { (eval echo "$as_me:12952: \"$ac_try\"") >&5
12953   (eval $ac_try) 2>&5
12954   ac_status=$?
12955   echo "$as_me:12955: \$? = $ac_status" >&5
12956   (exit $ac_status); }; }; then
12957   cf_cv_term_header=$cf_header
12958          break
12959 else
12960   echo "$as_me: failed program was:" >&5
12961 cat conftest.$ac_ext >&5
12962 cf_cv_term_header=no
12963 fi
12964 rm -f conftest.$ac_objext conftest.$ac_ext
12965 done
12966
12967 case $cf_cv_term_header in #(vi
12968 no)
12969         # If curses is ncurses, some packagers still mess it up by trying to make
12970         # us use GNU termcap.  This handles the most common case.
12971         for cf_header in ncurses/term.h ncursesw/term.h
12972         do
12973                 cat >conftest.$ac_ext <<_ACEOF
12974 #line 12974 "configure"
12975 #include "confdefs.h"
12976
12977 #include <${cf_cv_ncurses_header:-curses.h}>
12978 #ifdef NCURSES_VERSION
12979 #include <${cf_header}>
12980 #else
12981 make an error
12982 #endif
12983 int
12984 main ()
12985 {
12986 WINDOW *x
12987   ;
12988   return 0;
12989 }
12990 _ACEOF
12991 rm -f conftest.$ac_objext
12992 if { (eval echo "$as_me:12992: \"$ac_compile\"") >&5
12993   (eval $ac_compile) 2>&5
12994   ac_status=$?
12995   echo "$as_me:12995: \$? = $ac_status" >&5
12996   (exit $ac_status); } &&
12997          { ac_try='test -s conftest.$ac_objext'
12998   { (eval echo "$as_me:12998: \"$ac_try\"") >&5
12999   (eval $ac_try) 2>&5
13000   ac_status=$?
13001   echo "$as_me:13001: \$? = $ac_status" >&5
13002   (exit $ac_status); }; }; then
13003   cf_cv_term_header=$cf_header
13004                          break
13005 else
13006   echo "$as_me: failed program was:" >&5
13007 cat conftest.$ac_ext >&5
13008 cf_cv_term_header=no
13009 fi
13010 rm -f conftest.$ac_objext conftest.$ac_ext
13011         done
13012         ;;
13013 esac
13014
13015 fi
13016 echo "$as_me:13016: result: $cf_cv_term_header" >&5
13017 echo "${ECHO_T}$cf_cv_term_header" >&6
13018
13019 case $cf_cv_term_header in #(vi
13020 term.h) #(vi
13021
13022 cat >>confdefs.h <<\EOF
13023 #define HAVE_TERM_H 1
13024 EOF
13025
13026         ;;
13027 ncurses/term.h) #(vi
13028
13029 cat >>confdefs.h <<\EOF
13030 #define HAVE_NCURSES_TERM_H 1
13031 EOF
13032
13033         ;;
13034 ncursesw/term.h)
13035
13036 cat >>confdefs.h <<\EOF
13037 #define HAVE_NCURSESW_TERM_H 1
13038 EOF
13039
13040         ;;
13041 esac
13042
13043 echo "$as_me:13043: checking for unctrl.h" >&5
13044 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
13045 if test "${cf_cv_unctrl_header+set}" = set; then
13046   echo $ECHO_N "(cached) $ECHO_C" >&6
13047 else
13048
13049 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
13050 # for <unctrl.h> if we do not find the variant.
13051
13052 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
13053
13054 case ${cf_cv_ncurses_header:-curses.h} in #(vi
13055 */*)
13056         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
13057         cf_header_list="$cf_header_item $cf_header_list"
13058         ;;
13059 esac
13060
13061 for cf_header in $cf_header_list
13062 do
13063         cat >conftest.$ac_ext <<_ACEOF
13064 #line 13064 "configure"
13065 #include "confdefs.h"
13066
13067 #include <${cf_cv_ncurses_header:-curses.h}>
13068 #include <${cf_header}>
13069 int
13070 main ()
13071 {
13072 WINDOW *x
13073   ;
13074   return 0;
13075 }
13076 _ACEOF
13077 rm -f conftest.$ac_objext
13078 if { (eval echo "$as_me:13078: \"$ac_compile\"") >&5
13079   (eval $ac_compile) 2>&5
13080   ac_status=$?
13081   echo "$as_me:13081: \$? = $ac_status" >&5
13082   (exit $ac_status); } &&
13083          { ac_try='test -s conftest.$ac_objext'
13084   { (eval echo "$as_me:13084: \"$ac_try\"") >&5
13085   (eval $ac_try) 2>&5
13086   ac_status=$?
13087   echo "$as_me:13087: \$? = $ac_status" >&5
13088   (exit $ac_status); }; }; then
13089   cf_cv_unctrl_header=$cf_header
13090          break
13091 else
13092   echo "$as_me: failed program was:" >&5
13093 cat conftest.$ac_ext >&5
13094 cf_cv_unctrl_header=no
13095 fi
13096 rm -f conftest.$ac_objext conftest.$ac_ext
13097 done
13098
13099 case $cf_cv_unctrl_header in #(vi
13100 no)
13101         { echo "$as_me:13101: WARNING: unctrl.h header not found" >&5
13102 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
13103         ;;
13104 esac
13105
13106 fi
13107 echo "$as_me:13107: result: $cf_cv_unctrl_header" >&5
13108 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
13109
13110 case $cf_cv_unctrl_header in #(vi
13111 unctrl.h) #(vi
13112
13113 cat >>confdefs.h <<\EOF
13114 #define HAVE_UNCTRL_H 1
13115 EOF
13116
13117         ;;
13118 ncurses/unctrl.h) #(vi
13119
13120 cat >>confdefs.h <<\EOF
13121 #define HAVE_NCURSES_UNCTRL_H 1
13122 EOF
13123
13124         ;;
13125 ncursesw/unctrl.h)
13126
13127 cat >>confdefs.h <<\EOF
13128 #define HAVE_NCURSESW_UNCTRL_H 1
13129 EOF
13130
13131         ;;
13132 esac
13133
13134 for cf_func in \
13135 assume_default_colors \
13136 chgat \
13137 color_set \
13138 filter \
13139 getbegx \
13140 getcurx \
13141 getmaxx \
13142 getnstr \
13143 getparx \
13144 getwin \
13145 mvvline \
13146 mvwvline \
13147 napms \
13148 putwin \
13149 resize_term \
13150 resizeterm \
13151 ripoffline \
13152 scr_dump \
13153 setupterm \
13154 slk_color \
13155 slk_init \
13156 termattrs \
13157 tgetent \
13158 tigetnum \
13159 tigetstr \
13160 typeahead \
13161 use_default_colors \
13162 use_screen \
13163 use_window \
13164 vsscanf \
13165 vw_printw \
13166 wchgat \
13167 winsstr \
13168 wresize \
13169 wsyncdown \
13170
13171 do
13172
13173 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13174
13175         echo "$as_me:13175: checking for ${cf_func}" >&5
13176 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
13177
13178 echo "${as_me:-configure}:13178: testing ${cf_func} ..." 1>&5
13179
13180         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
13181   echo $ECHO_N "(cached) $ECHO_C" >&6
13182 else
13183
13184                 eval cf_result='$ac_cv_func_'$cf_func
13185                 if test ".$cf_result" != ".no"; then
13186                         cat >conftest.$ac_ext <<_ACEOF
13187 #line 13187 "configure"
13188 #include "confdefs.h"
13189
13190 #ifdef HAVE_XCURSES
13191 #include <xcurses.h>
13192 char * XCursesProgramName = "test";
13193 #else
13194 #include <${cf_cv_ncurses_header:-curses.h}>
13195 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13196 #include <ncursesw/term.h>
13197 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13198 #include <ncurses/term.h>
13199 #elif defined(HAVE_TERM_H)
13200 #include <term.h>
13201 #endif
13202 #endif
13203
13204 int
13205 main ()
13206 {
13207
13208 #ifndef ${cf_func}
13209 long foo = (long)(&${cf_func});
13210 if (foo + 1234 > 5678)
13211         ${cf_cv_main_return:-return}(foo);
13212 #endif
13213
13214   ;
13215   return 0;
13216 }
13217 _ACEOF
13218 rm -f conftest.$ac_objext conftest$ac_exeext
13219 if { (eval echo "$as_me:13219: \"$ac_link\"") >&5
13220   (eval $ac_link) 2>&5
13221   ac_status=$?
13222   echo "$as_me:13222: \$? = $ac_status" >&5
13223   (exit $ac_status); } &&
13224          { ac_try='test -s conftest$ac_exeext'
13225   { (eval echo "$as_me:13225: \"$ac_try\"") >&5
13226   (eval $ac_try) 2>&5
13227   ac_status=$?
13228   echo "$as_me:13228: \$? = $ac_status" >&5
13229   (exit $ac_status); }; }; then
13230   cf_result=yes
13231 else
13232   echo "$as_me: failed program was:" >&5
13233 cat conftest.$ac_ext >&5
13234 cf_result=no
13235 fi
13236 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13237                 fi
13238                 eval 'cf_cv_func_'$cf_func'=$cf_result'
13239
13240 fi
13241
13242         # use the computed/retrieved cache-value:
13243         eval 'cf_result=$cf_cv_func_'$cf_func
13244         echo "$as_me:13244: result: $cf_result" >&5
13245 echo "${ECHO_T}$cf_result" >&6
13246         if test $cf_result != no; then
13247                 cat >>confdefs.h <<EOF
13248 #define HAVE_${cf_tr_func} 1
13249 EOF
13250
13251         fi
13252 done
13253
13254 for cf_func in tputs
13255 do
13256
13257 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13258
13259         echo "$as_me:13259: checking for ${cf_func}" >&5
13260 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
13261
13262 echo "${as_me:-configure}:13262: testing ${cf_func} ..." 1>&5
13263
13264         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
13265   echo $ECHO_N "(cached) $ECHO_C" >&6
13266 else
13267
13268                 eval cf_result='$ac_cv_func_'$cf_func
13269                 if test ".$cf_result" != ".no"; then
13270                         cat >conftest.$ac_ext <<_ACEOF
13271 #line 13271 "configure"
13272 #include "confdefs.h"
13273
13274 #ifdef HAVE_XCURSES
13275 #include <xcurses.h>
13276 char * XCursesProgramName = "test";
13277 #else
13278 #include <${cf_cv_ncurses_header:-curses.h}>
13279 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13280 #include <ncursesw/term.h>
13281 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13282 #include <ncurses/term.h>
13283 #elif defined(HAVE_TERM_H)
13284 #include <term.h>
13285 #endif
13286 #endif
13287
13288 int
13289 main ()
13290 {
13291
13292 #ifndef ${cf_func}
13293 long foo = (long)(&${cf_func});
13294 if (foo + 1234 > 5678)
13295         ${cf_cv_main_return:-return}(foo);
13296 #endif
13297
13298   ;
13299   return 0;
13300 }
13301 _ACEOF
13302 rm -f conftest.$ac_objext conftest$ac_exeext
13303 if { (eval echo "$as_me:13303: \"$ac_link\"") >&5
13304   (eval $ac_link) 2>&5
13305   ac_status=$?
13306   echo "$as_me:13306: \$? = $ac_status" >&5
13307   (exit $ac_status); } &&
13308          { ac_try='test -s conftest$ac_exeext'
13309   { (eval echo "$as_me:13309: \"$ac_try\"") >&5
13310   (eval $ac_try) 2>&5
13311   ac_status=$?
13312   echo "$as_me:13312: \$? = $ac_status" >&5
13313   (exit $ac_status); }; }; then
13314   cf_result=yes
13315 else
13316   echo "$as_me: failed program was:" >&5
13317 cat conftest.$ac_ext >&5
13318 cf_result=no
13319 fi
13320 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13321                 fi
13322                 eval 'cf_cv_func_'$cf_func'=$cf_result'
13323
13324 fi
13325
13326         # use the computed/retrieved cache-value:
13327         eval 'cf_result=$cf_cv_func_'$cf_func
13328         echo "$as_me:13328: result: $cf_result" >&5
13329 echo "${ECHO_T}$cf_result" >&6
13330         if test $cf_result != no; then
13331                 cat >>confdefs.h <<EOF
13332 #define HAVE_${cf_tr_func} 1
13333 EOF
13334
13335         fi
13336 done
13337
13338 if test x$cf_cv_func_tputs = xyes
13339 then
13340         cf_done=no
13341         for cf_arg in int char
13342         do
13343                 for cf_ret in int void
13344                 do
13345                         if test $cf_ret = void
13346                         then
13347                                 cf_return="/* nothing */"
13348                         else
13349                                 cf_return="return value"
13350                         fi
13351                         cat >conftest.$ac_ext <<_ACEOF
13352 #line 13352 "configure"
13353 #include "confdefs.h"
13354
13355 #include <${cf_cv_ncurses_header:-curses.h}>
13356 #include <$cf_cv_term_header>
13357
13358 static $cf_ret outc($cf_arg value) { $cf_return; }
13359
13360 int
13361 main ()
13362 {
13363
13364         tputs("hello", 0, outc);
13365         ${cf_cv_main_return:-return}(0);
13366
13367   ;
13368   return 0;
13369 }
13370 _ACEOF
13371 rm -f conftest.$ac_objext
13372 if { (eval echo "$as_me:13372: \"$ac_compile\"") >&5
13373   (eval $ac_compile) 2>&5
13374   ac_status=$?
13375   echo "$as_me:13375: \$? = $ac_status" >&5
13376   (exit $ac_status); } &&
13377          { ac_try='test -s conftest.$ac_objext'
13378   { (eval echo "$as_me:13378: \"$ac_try\"") >&5
13379   (eval $ac_try) 2>&5
13380   ac_status=$?
13381   echo "$as_me:13381: \$? = $ac_status" >&5
13382   (exit $ac_status); }; }; then
13383
13384                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
13385
13386 echo "${as_me:-configure}:13386: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
13387
13388                 cat >>confdefs.h <<EOF
13389 #define TPUTS_ARG               $cf_arg
13390 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
13391 #define TPUTS_RETURN(value)     $cf_return
13392 EOF
13393                 cf_done=yes
13394                 break
13395
13396 else
13397   echo "$as_me: failed program was:" >&5
13398 cat conftest.$ac_ext >&5
13399 fi
13400 rm -f conftest.$ac_objext conftest.$ac_ext
13401                 done
13402                 test $cf_done = yes && break
13403         done
13404 fi
13405
13406 echo "$as_me:13406: checking for ncurses extended functions" >&5
13407 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
13408 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
13409   echo $ECHO_N "(cached) $ECHO_C" >&6
13410 else
13411
13412 cat >conftest.$ac_ext <<_ACEOF
13413 #line 13413 "configure"
13414 #include "confdefs.h"
13415
13416 #include <${cf_cv_ncurses_header:-curses.h}>
13417 int
13418 main ()
13419 {
13420
13421 int x = NCURSES_EXT_FUNCS
13422
13423   ;
13424   return 0;
13425 }
13426 _ACEOF
13427 rm -f conftest.$ac_objext
13428 if { (eval echo "$as_me:13428: \"$ac_compile\"") >&5
13429   (eval $ac_compile) 2>&5
13430   ac_status=$?
13431   echo "$as_me:13431: \$? = $ac_status" >&5
13432   (exit $ac_status); } &&
13433          { ac_try='test -s conftest.$ac_objext'
13434   { (eval echo "$as_me:13434: \"$ac_try\"") >&5
13435   (eval $ac_try) 2>&5
13436   ac_status=$?
13437   echo "$as_me:13437: \$? = $ac_status" >&5
13438   (exit $ac_status); }; }; then
13439   cf_cv_ncurses_ext_funcs=defined
13440 else
13441   echo "$as_me: failed program was:" >&5
13442 cat conftest.$ac_ext >&5
13443
13444 cat >conftest.$ac_ext <<_ACEOF
13445 #line 13445 "configure"
13446 #include "confdefs.h"
13447
13448 #include <${cf_cv_ncurses_header:-curses.h}>
13449 int
13450 main ()
13451 {
13452
13453         (void) assume_default_colors (0, 0);
13454         (void) curses_version ();
13455         (void) define_key (0, 0);
13456         (void) is_term_resized (0, 0);
13457         (void) key_defined (0);
13458         (void) keybound (0, 0);
13459         (void) keyok (0, 0);
13460         (void) resize_term (0, 0);
13461         (void) resizeterm (0, 0);
13462         (void) use_default_colors ();
13463         (void) use_extended_names (0);
13464         (void) wresize (0, 0, 0);
13465   ;
13466   return 0;
13467 }
13468 _ACEOF
13469 rm -f conftest.$ac_objext conftest$ac_exeext
13470 if { (eval echo "$as_me:13470: \"$ac_link\"") >&5
13471   (eval $ac_link) 2>&5
13472   ac_status=$?
13473   echo "$as_me:13473: \$? = $ac_status" >&5
13474   (exit $ac_status); } &&
13475          { ac_try='test -s conftest$ac_exeext'
13476   { (eval echo "$as_me:13476: \"$ac_try\"") >&5
13477   (eval $ac_try) 2>&5
13478   ac_status=$?
13479   echo "$as_me:13479: \$? = $ac_status" >&5
13480   (exit $ac_status); }; }; then
13481   cf_cv_ncurses_ext_funcs=yes
13482 else
13483   echo "$as_me: failed program was:" >&5
13484 cat conftest.$ac_ext >&5
13485 cf_cv_ncurses_ext_funcs=no
13486 fi
13487 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13488
13489 fi
13490 rm -f conftest.$ac_objext conftest.$ac_ext
13491
13492 fi
13493 echo "$as_me:13493: result: $cf_cv_ncurses_ext_funcs" >&5
13494 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
13495 test "$cf_cv_ncurses_ext_funcs" = yes &&
13496 cat >>confdefs.h <<\EOF
13497 #define NCURSES_EXT_FUNCS 1
13498 EOF
13499
13500 if test "$cf_enable_widec" = yes
13501 then
13502         # workaround for systems with ncurses before 20111029, due to change of
13503         # feature test macro from _XPG5 to _XOPEN_SOURCE
13504         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
13505         then
13506                 cf_define_xpg5=no
13507                 echo "$as_me:13507: checking if _XPG5 should be defined to enable wide-characters" >&5
13508 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
13509
13510                 cat >conftest.$ac_ext <<_ACEOF
13511 #line 13511 "configure"
13512 #include "confdefs.h"
13513
13514 #include <${cf_cv_ncurses_header:-curses.h}>
13515 int
13516 main ()
13517 {
13518 int x = _XPG5
13519   ;
13520   return 0;
13521 }
13522 _ACEOF
13523 rm -f conftest.$ac_objext
13524 if { (eval echo "$as_me:13524: \"$ac_compile\"") >&5
13525   (eval $ac_compile) 2>&5
13526   ac_status=$?
13527   echo "$as_me:13527: \$? = $ac_status" >&5
13528   (exit $ac_status); } &&
13529          { ac_try='test -s conftest.$ac_objext'
13530   { (eval echo "$as_me:13530: \"$ac_try\"") >&5
13531   (eval $ac_try) 2>&5
13532   ac_status=$?
13533   echo "$as_me:13533: \$? = $ac_status" >&5
13534   (exit $ac_status); }; }; then
13535   :
13536 else
13537   echo "$as_me: failed program was:" >&5
13538 cat conftest.$ac_ext >&5
13539 cf_save_cppflags="$CPPFLAGS"
13540                          CPPFLAGS="$CPPFLAGS -D_XPG5"
13541                          cat >conftest.$ac_ext <<_ACEOF
13542 #line 13542 "configure"
13543 #include "confdefs.h"
13544
13545 #include <${cf_cv_ncurses_header:-curses.h}>
13546 int
13547 main ()
13548 {
13549 int x = _XPG5
13550   ;
13551   return 0;
13552 }
13553 _ACEOF
13554 rm -f conftest.$ac_objext
13555 if { (eval echo "$as_me:13555: \"$ac_compile\"") >&5
13556   (eval $ac_compile) 2>&5
13557   ac_status=$?
13558   echo "$as_me:13558: \$? = $ac_status" >&5
13559   (exit $ac_status); } &&
13560          { ac_try='test -s conftest.$ac_objext'
13561   { (eval echo "$as_me:13561: \"$ac_try\"") >&5
13562   (eval $ac_try) 2>&5
13563   ac_status=$?
13564   echo "$as_me:13564: \$? = $ac_status" >&5
13565   (exit $ac_status); }; }; then
13566   cf_define_xpg5=yes
13567 else
13568   echo "$as_me: failed program was:" >&5
13569 cat conftest.$ac_ext >&5
13570 fi
13571 rm -f conftest.$ac_objext conftest.$ac_ext
13572                          CPPFLAGS="$cf_save_cppflags"
13573 fi
13574 rm -f conftest.$ac_objext conftest.$ac_ext
13575                 echo "$as_me:13575: result: $cf_define_xpg5" >&5
13576 echo "${ECHO_T}$cf_define_xpg5" >&6
13577
13578                 if test "$cf_define_xpg5" = yes
13579                 then
13580                         CPPFLAGS="$CPPFLAGS -D_XPG5"
13581                 fi
13582         fi
13583
13584         echo "$as_me:13584: checking for wide-character functions" >&5
13585 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
13586 if test "${cf_cv_widechar_funcs+set}" = set; then
13587   echo $ECHO_N "(cached) $ECHO_C" >&6
13588 else
13589
13590         cat >conftest.$ac_ext <<_ACEOF
13591 #line 13591 "configure"
13592 #include "confdefs.h"
13593
13594 #include <${cf_cv_ncurses_header:-curses.h}>
13595 int
13596 main ()
13597 {
13598
13599                 static wchar_t src_wchar[2];
13600                 static cchar_t dst_cchar;
13601                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
13602
13603   ;
13604   return 0;
13605 }
13606 _ACEOF
13607 rm -f conftest.$ac_objext conftest$ac_exeext
13608 if { (eval echo "$as_me:13608: \"$ac_link\"") >&5
13609   (eval $ac_link) 2>&5
13610   ac_status=$?
13611   echo "$as_me:13611: \$? = $ac_status" >&5
13612   (exit $ac_status); } &&
13613          { ac_try='test -s conftest$ac_exeext'
13614   { (eval echo "$as_me:13614: \"$ac_try\"") >&5
13615   (eval $ac_try) 2>&5
13616   ac_status=$?
13617   echo "$as_me:13617: \$? = $ac_status" >&5
13618   (exit $ac_status); }; }; then
13619   cf_cv_widechar_funcs=yes
13620 else
13621   echo "$as_me: failed program was:" >&5
13622 cat conftest.$ac_ext >&5
13623 cf_cv_widechar_funcs=no
13624 fi
13625 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13626
13627 fi
13628 echo "$as_me:13628: result: $cf_cv_widechar_funcs" >&5
13629 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
13630         if test "$cf_cv_widechar_funcs" != no ; then
13631
13632 cat >>confdefs.h <<\EOF
13633 #define USE_WIDEC_SUPPORT 1
13634 EOF
13635
13636         else
13637                 cat >>confdefs.h <<\EOF
13638 #define USE_WIDEC_SUPPORT 0
13639 EOF
13640
13641         fi
13642 else
13643         cat >>confdefs.h <<\EOF
13644 #define USE_WIDEC_SUPPORT 0
13645 EOF
13646
13647 fi
13648
13649 echo "$as_me:13649: checking if sys/time.h works with sys/select.h" >&5
13650 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
13651 if test "${cf_cv_sys_time_select+set}" = set; then
13652   echo $ECHO_N "(cached) $ECHO_C" >&6
13653 else
13654
13655 cat >conftest.$ac_ext <<_ACEOF
13656 #line 13656 "configure"
13657 #include "confdefs.h"
13658
13659 #include <sys/types.h>
13660 #ifdef HAVE_SYS_TIME_H
13661 #include <sys/time.h>
13662 #endif
13663 #ifdef HAVE_SYS_SELECT_H
13664 #include <sys/select.h>
13665 #endif
13666
13667 int
13668 main ()
13669 {
13670
13671   ;
13672   return 0;
13673 }
13674 _ACEOF
13675 rm -f conftest.$ac_objext
13676 if { (eval echo "$as_me:13676: \"$ac_compile\"") >&5
13677   (eval $ac_compile) 2>&5
13678   ac_status=$?
13679   echo "$as_me:13679: \$? = $ac_status" >&5
13680   (exit $ac_status); } &&
13681          { ac_try='test -s conftest.$ac_objext'
13682   { (eval echo "$as_me:13682: \"$ac_try\"") >&5
13683   (eval $ac_try) 2>&5
13684   ac_status=$?
13685   echo "$as_me:13685: \$? = $ac_status" >&5
13686   (exit $ac_status); }; }; then
13687   cf_cv_sys_time_select=yes
13688 else
13689   echo "$as_me: failed program was:" >&5
13690 cat conftest.$ac_ext >&5
13691 cf_cv_sys_time_select=no
13692 fi
13693 rm -f conftest.$ac_objext conftest.$ac_ext
13694
13695 fi
13696
13697 echo "$as_me:13697: result: $cf_cv_sys_time_select" >&5
13698 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
13699 test "$cf_cv_sys_time_select" = yes &&
13700 cat >>confdefs.h <<\EOF
13701 #define HAVE_SYS_TIME_SELECT 1
13702 EOF
13703
13704 echo "$as_me:13704: checking for function curses_version" >&5
13705 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
13706 if test "${cf_cv_func_curses_version+set}" = set; then
13707   echo $ECHO_N "(cached) $ECHO_C" >&6
13708 else
13709
13710 if test "$cross_compiling" = yes; then
13711   cf_cv_func_curses_version=unknown
13712 else
13713   cat >conftest.$ac_ext <<_ACEOF
13714 #line 13714 "configure"
13715 #include "confdefs.h"
13716
13717 #include <${cf_cv_ncurses_header:-curses.h}>
13718 int main()
13719 {
13720         char temp[1024];
13721         sprintf(temp, "%s\n", curses_version());
13722         ${cf_cv_main_return:-return}(0);
13723 }
13724
13725 _ACEOF
13726 rm -f conftest$ac_exeext
13727 if { (eval echo "$as_me:13727: \"$ac_link\"") >&5
13728   (eval $ac_link) 2>&5
13729   ac_status=$?
13730   echo "$as_me:13730: \$? = $ac_status" >&5
13731   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13732   { (eval echo "$as_me:13732: \"$ac_try\"") >&5
13733   (eval $ac_try) 2>&5
13734   ac_status=$?
13735   echo "$as_me:13735: \$? = $ac_status" >&5
13736   (exit $ac_status); }; }; then
13737   cf_cv_func_curses_version=yes
13738
13739 else
13740   echo "$as_me: program exited with status $ac_status" >&5
13741 echo "$as_me: failed program was:" >&5
13742 cat conftest.$ac_ext >&5
13743 cf_cv_func_curses_version=no
13744
13745 fi
13746 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13747 fi
13748 rm -f core
13749 fi
13750 echo "$as_me:13750: result: $cf_cv_func_curses_version" >&5
13751 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
13752 test "$cf_cv_func_curses_version" = yes &&
13753 cat >>confdefs.h <<\EOF
13754 #define HAVE_CURSES_VERSION 1
13755 EOF
13756
13757 echo "$as_me:13757: checking for alternate character set array" >&5
13758 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
13759 if test "${cf_cv_curses_acs_map+set}" = set; then
13760   echo $ECHO_N "(cached) $ECHO_C" >&6
13761 else
13762
13763 cf_cv_curses_acs_map=unknown
13764 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
13765 do
13766 cat >conftest.$ac_ext <<_ACEOF
13767 #line 13767 "configure"
13768 #include "confdefs.h"
13769
13770 #include <${cf_cv_ncurses_header:-curses.h}>
13771
13772 int
13773 main ()
13774 {
13775
13776 $name['k'] = ACS_PLUS
13777
13778   ;
13779   return 0;
13780 }
13781 _ACEOF
13782 rm -f conftest.$ac_objext conftest$ac_exeext
13783 if { (eval echo "$as_me:13783: \"$ac_link\"") >&5
13784   (eval $ac_link) 2>&5
13785   ac_status=$?
13786   echo "$as_me:13786: \$? = $ac_status" >&5
13787   (exit $ac_status); } &&
13788          { ac_try='test -s conftest$ac_exeext'
13789   { (eval echo "$as_me:13789: \"$ac_try\"") >&5
13790   (eval $ac_try) 2>&5
13791   ac_status=$?
13792   echo "$as_me:13792: \$? = $ac_status" >&5
13793   (exit $ac_status); }; }; then
13794   cf_cv_curses_acs_map=$name; break
13795 else
13796   echo "$as_me: failed program was:" >&5
13797 cat conftest.$ac_ext >&5
13798 fi
13799 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13800 done
13801
13802 fi
13803 echo "$as_me:13803: result: $cf_cv_curses_acs_map" >&5
13804 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
13805
13806 test "$cf_cv_curses_acs_map" != unknown &&
13807 cat >>confdefs.h <<EOF
13808 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
13809 EOF
13810
13811 if test "$cf_enable_widec" = yes; then
13812
13813 echo "$as_me:13813: checking for wide alternate character set array" >&5
13814 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
13815 if test "${cf_cv_curses_wacs_map+set}" = set; then
13816   echo $ECHO_N "(cached) $ECHO_C" >&6
13817 else
13818
13819         cf_cv_curses_wacs_map=unknown
13820         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
13821         do
13822         cat >conftest.$ac_ext <<_ACEOF
13823 #line 13823 "configure"
13824 #include "confdefs.h"
13825
13826 #ifndef _XOPEN_SOURCE_EXTENDED
13827 #define _XOPEN_SOURCE_EXTENDED
13828 #endif
13829 #include <${cf_cv_ncurses_header:-curses.h}>
13830 int
13831 main ()
13832 {
13833 void *foo = &($name['k'])
13834   ;
13835   return 0;
13836 }
13837 _ACEOF
13838 rm -f conftest.$ac_objext conftest$ac_exeext
13839 if { (eval echo "$as_me:13839: \"$ac_link\"") >&5
13840   (eval $ac_link) 2>&5
13841   ac_status=$?
13842   echo "$as_me:13842: \$? = $ac_status" >&5
13843   (exit $ac_status); } &&
13844          { ac_try='test -s conftest$ac_exeext'
13845   { (eval echo "$as_me:13845: \"$ac_try\"") >&5
13846   (eval $ac_try) 2>&5
13847   ac_status=$?
13848   echo "$as_me:13848: \$? = $ac_status" >&5
13849   (exit $ac_status); }; }; then
13850   cf_cv_curses_wacs_map=$name
13851          break
13852 else
13853   echo "$as_me: failed program was:" >&5
13854 cat conftest.$ac_ext >&5
13855 fi
13856 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13857         done
13858 fi
13859 echo "$as_me:13859: result: $cf_cv_curses_wacs_map" >&5
13860 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
13861
13862 test "$cf_cv_curses_wacs_map" != unknown &&
13863 cat >>confdefs.h <<EOF
13864 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
13865 EOF
13866
13867 echo "$as_me:13867: checking for wide alternate character constants" >&5
13868 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
13869 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
13870   echo $ECHO_N "(cached) $ECHO_C" >&6
13871 else
13872
13873 cf_cv_curses_wacs_symbols=no
13874 if test "$cf_cv_curses_wacs_map" != unknown
13875 then
13876         cat >conftest.$ac_ext <<_ACEOF
13877 #line 13877 "configure"
13878 #include "confdefs.h"
13879
13880 #ifndef _XOPEN_SOURCE_EXTENDED
13881 #define _XOPEN_SOURCE_EXTENDED
13882 #endif
13883 #include <${cf_cv_ncurses_header:-curses.h}>
13884 int
13885 main ()
13886 {
13887 cchar_t *foo = WACS_PLUS;
13888          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
13889   ;
13890   return 0;
13891 }
13892 _ACEOF
13893 rm -f conftest.$ac_objext conftest$ac_exeext
13894 if { (eval echo "$as_me:13894: \"$ac_link\"") >&5
13895   (eval $ac_link) 2>&5
13896   ac_status=$?
13897   echo "$as_me:13897: \$? = $ac_status" >&5
13898   (exit $ac_status); } &&
13899          { ac_try='test -s conftest$ac_exeext'
13900   { (eval echo "$as_me:13900: \"$ac_try\"") >&5
13901   (eval $ac_try) 2>&5
13902   ac_status=$?
13903   echo "$as_me:13903: \$? = $ac_status" >&5
13904   (exit $ac_status); }; }; then
13905   cf_cv_curses_wacs_symbols=yes
13906 else
13907   echo "$as_me: failed program was:" >&5
13908 cat conftest.$ac_ext >&5
13909 fi
13910 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13911 else
13912         cat >conftest.$ac_ext <<_ACEOF
13913 #line 13913 "configure"
13914 #include "confdefs.h"
13915
13916 #ifndef _XOPEN_SOURCE_EXTENDED
13917 #define _XOPEN_SOURCE_EXTENDED
13918 #endif
13919 #include <${cf_cv_ncurses_header:-curses.h}>
13920 int
13921 main ()
13922 {
13923 cchar_t *foo = WACS_PLUS
13924   ;
13925   return 0;
13926 }
13927 _ACEOF
13928 rm -f conftest.$ac_objext conftest$ac_exeext
13929 if { (eval echo "$as_me:13929: \"$ac_link\"") >&5
13930   (eval $ac_link) 2>&5
13931   ac_status=$?
13932   echo "$as_me:13932: \$? = $ac_status" >&5
13933   (exit $ac_status); } &&
13934          { ac_try='test -s conftest$ac_exeext'
13935   { (eval echo "$as_me:13935: \"$ac_try\"") >&5
13936   (eval $ac_try) 2>&5
13937   ac_status=$?
13938   echo "$as_me:13938: \$? = $ac_status" >&5
13939   (exit $ac_status); }; }; then
13940   cf_cv_curses_wacs_symbols=yes
13941 else
13942   echo "$as_me: failed program was:" >&5
13943 cat conftest.$ac_ext >&5
13944 fi
13945 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13946 fi
13947
13948 fi
13949 echo "$as_me:13949: result: $cf_cv_curses_wacs_symbols" >&5
13950 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
13951
13952 test "$cf_cv_curses_wacs_symbols" != no &&
13953 cat >>confdefs.h <<\EOF
13954 #define CURSES_WACS_SYMBOLS 1
13955 EOF
13956
13957 fi
13958
13959 echo "$as_me:13959: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
13960 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
13961 cat >conftest.$ac_ext <<_ACEOF
13962 #line 13962 "configure"
13963 #include "confdefs.h"
13964
13965 #ifndef _XOPEN_SOURCE_EXTENDED
13966 #define _XOPEN_SOURCE_EXTENDED
13967 #endif
13968 #include <${cf_cv_ncurses_header:-curses.h}>
13969 int
13970 main ()
13971 {
13972
13973 attr_t foo
13974
13975   ;
13976   return 0;
13977 }
13978 _ACEOF
13979 rm -f conftest.$ac_objext
13980 if { (eval echo "$as_me:13980: \"$ac_compile\"") >&5
13981   (eval $ac_compile) 2>&5
13982   ac_status=$?
13983   echo "$as_me:13983: \$? = $ac_status" >&5
13984   (exit $ac_status); } &&
13985          { ac_try='test -s conftest.$ac_objext'
13986   { (eval echo "$as_me:13986: \"$ac_try\"") >&5
13987   (eval $ac_try) 2>&5
13988   ac_status=$?
13989   echo "$as_me:13989: \$? = $ac_status" >&5
13990   (exit $ac_status); }; }; then
13991   cf_result=yes
13992 else
13993   echo "$as_me: failed program was:" >&5
13994 cat conftest.$ac_ext >&5
13995 cf_result=no
13996 fi
13997 rm -f conftest.$ac_objext conftest.$ac_ext
13998 echo "$as_me:13998: result: $cf_result" >&5
13999 echo "${ECHO_T}$cf_result" >&6
14000 if test $cf_result = yes ; then
14001
14002 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14003
14004 cat >>confdefs.h <<EOF
14005 #define $cf_result 1
14006 EOF
14007
14008 else
14009
14010 cat >>confdefs.h <<EOF
14011 #define attr_t long
14012 EOF
14013
14014 fi
14015
14016 if test "$cf_enable_widec" = yes; then
14017
14018 # This is needed on Tru64 5.0 to declare mbstate_t
14019 echo "$as_me:14019: checking if we must include wchar.h to declare mbstate_t" >&5
14020 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
14021 if test "${cf_cv_mbstate_t+set}" = set; then
14022   echo $ECHO_N "(cached) $ECHO_C" >&6
14023 else
14024
14025 cat >conftest.$ac_ext <<_ACEOF
14026 #line 14026 "configure"
14027 #include "confdefs.h"
14028
14029 #include <stdlib.h>
14030 #include <stdarg.h>
14031 #include <stdio.h>
14032 #ifdef HAVE_LIBUTF8_H
14033 #include <libutf8.h>
14034 #endif
14035 int
14036 main ()
14037 {
14038 mbstate_t state
14039   ;
14040   return 0;
14041 }
14042 _ACEOF
14043 rm -f conftest.$ac_objext
14044 if { (eval echo "$as_me:14044: \"$ac_compile\"") >&5
14045   (eval $ac_compile) 2>&5
14046   ac_status=$?
14047   echo "$as_me:14047: \$? = $ac_status" >&5
14048   (exit $ac_status); } &&
14049          { ac_try='test -s conftest.$ac_objext'
14050   { (eval echo "$as_me:14050: \"$ac_try\"") >&5
14051   (eval $ac_try) 2>&5
14052   ac_status=$?
14053   echo "$as_me:14053: \$? = $ac_status" >&5
14054   (exit $ac_status); }; }; then
14055   cf_cv_mbstate_t=no
14056 else
14057   echo "$as_me: failed program was:" >&5
14058 cat conftest.$ac_ext >&5
14059 cat >conftest.$ac_ext <<_ACEOF
14060 #line 14060 "configure"
14061 #include "confdefs.h"
14062
14063 #include <stdlib.h>
14064 #include <stdarg.h>
14065 #include <stdio.h>
14066 #include <wchar.h>
14067 #ifdef HAVE_LIBUTF8_H
14068 #include <libutf8.h>
14069 #endif
14070 int
14071 main ()
14072 {
14073 mbstate_t value
14074   ;
14075   return 0;
14076 }
14077 _ACEOF
14078 rm -f conftest.$ac_objext
14079 if { (eval echo "$as_me:14079: \"$ac_compile\"") >&5
14080   (eval $ac_compile) 2>&5
14081   ac_status=$?
14082   echo "$as_me:14082: \$? = $ac_status" >&5
14083   (exit $ac_status); } &&
14084          { ac_try='test -s conftest.$ac_objext'
14085   { (eval echo "$as_me:14085: \"$ac_try\"") >&5
14086   (eval $ac_try) 2>&5
14087   ac_status=$?
14088   echo "$as_me:14088: \$? = $ac_status" >&5
14089   (exit $ac_status); }; }; then
14090   cf_cv_mbstate_t=yes
14091 else
14092   echo "$as_me: failed program was:" >&5
14093 cat conftest.$ac_ext >&5
14094 cf_cv_mbstate_t=unknown
14095 fi
14096 rm -f conftest.$ac_objext conftest.$ac_ext
14097 fi
14098 rm -f conftest.$ac_objext conftest.$ac_ext
14099 fi
14100 echo "$as_me:14100: result: $cf_cv_mbstate_t" >&5
14101 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
14102
14103 if test "$cf_cv_mbstate_t" = yes ; then
14104
14105 cat >>confdefs.h <<\EOF
14106 #define NEED_WCHAR_H 1
14107 EOF
14108
14109         NEED_WCHAR_H=1
14110 fi
14111
14112 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
14113 if test "$cf_cv_mbstate_t" = unknown ; then
14114         NCURSES_MBSTATE_T=1
14115 fi
14116
14117 # if we find mbstate_t in either place, use substitution to provide a fallback.
14118 if test "$cf_cv_mbstate_t" != unknown ; then
14119         NCURSES_OK_MBSTATE_T=1
14120 fi
14121
14122 # This is needed on Tru64 5.0 to declare wchar_t
14123 echo "$as_me:14123: checking if we must include wchar.h to declare wchar_t" >&5
14124 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
14125 if test "${cf_cv_wchar_t+set}" = set; then
14126   echo $ECHO_N "(cached) $ECHO_C" >&6
14127 else
14128
14129 cat >conftest.$ac_ext <<_ACEOF
14130 #line 14130 "configure"
14131 #include "confdefs.h"
14132
14133 #include <stdlib.h>
14134 #include <stdarg.h>
14135 #include <stdio.h>
14136 #ifdef HAVE_LIBUTF8_H
14137 #include <libutf8.h>
14138 #endif
14139 int
14140 main ()
14141 {
14142 wchar_t state
14143   ;
14144   return 0;
14145 }
14146 _ACEOF
14147 rm -f conftest.$ac_objext
14148 if { (eval echo "$as_me:14148: \"$ac_compile\"") >&5
14149   (eval $ac_compile) 2>&5
14150   ac_status=$?
14151   echo "$as_me:14151: \$? = $ac_status" >&5
14152   (exit $ac_status); } &&
14153          { ac_try='test -s conftest.$ac_objext'
14154   { (eval echo "$as_me:14154: \"$ac_try\"") >&5
14155   (eval $ac_try) 2>&5
14156   ac_status=$?
14157   echo "$as_me:14157: \$? = $ac_status" >&5
14158   (exit $ac_status); }; }; then
14159   cf_cv_wchar_t=no
14160 else
14161   echo "$as_me: failed program was:" >&5
14162 cat conftest.$ac_ext >&5
14163 cat >conftest.$ac_ext <<_ACEOF
14164 #line 14164 "configure"
14165 #include "confdefs.h"
14166
14167 #include <stdlib.h>
14168 #include <stdarg.h>
14169 #include <stdio.h>
14170 #include <wchar.h>
14171 #ifdef HAVE_LIBUTF8_H
14172 #include <libutf8.h>
14173 #endif
14174 int
14175 main ()
14176 {
14177 wchar_t value
14178   ;
14179   return 0;
14180 }
14181 _ACEOF
14182 rm -f conftest.$ac_objext
14183 if { (eval echo "$as_me:14183: \"$ac_compile\"") >&5
14184   (eval $ac_compile) 2>&5
14185   ac_status=$?
14186   echo "$as_me:14186: \$? = $ac_status" >&5
14187   (exit $ac_status); } &&
14188          { ac_try='test -s conftest.$ac_objext'
14189   { (eval echo "$as_me:14189: \"$ac_try\"") >&5
14190   (eval $ac_try) 2>&5
14191   ac_status=$?
14192   echo "$as_me:14192: \$? = $ac_status" >&5
14193   (exit $ac_status); }; }; then
14194   cf_cv_wchar_t=yes
14195 else
14196   echo "$as_me: failed program was:" >&5
14197 cat conftest.$ac_ext >&5
14198 cf_cv_wchar_t=unknown
14199 fi
14200 rm -f conftest.$ac_objext conftest.$ac_ext
14201 fi
14202 rm -f conftest.$ac_objext conftest.$ac_ext
14203 fi
14204 echo "$as_me:14204: result: $cf_cv_wchar_t" >&5
14205 echo "${ECHO_T}$cf_cv_wchar_t" >&6
14206
14207 if test "$cf_cv_wchar_t" = yes ; then
14208
14209 cat >>confdefs.h <<\EOF
14210 #define NEED_WCHAR_H 1
14211 EOF
14212
14213         NEED_WCHAR_H=1
14214 fi
14215
14216 # if we do not find wchar_t in either place, use substitution to provide a fallback.
14217 if test "$cf_cv_wchar_t" = unknown ; then
14218         NCURSES_WCHAR_T=1
14219 fi
14220
14221 # if we find wchar_t in either place, use substitution to provide a fallback.
14222 if test "$cf_cv_wchar_t" != unknown ; then
14223         NCURSES_OK_WCHAR_T=1
14224 fi
14225
14226 # This is needed on Tru64 5.0 to declare wint_t
14227 echo "$as_me:14227: checking if we must include wchar.h to declare wint_t" >&5
14228 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
14229 if test "${cf_cv_wint_t+set}" = set; then
14230   echo $ECHO_N "(cached) $ECHO_C" >&6
14231 else
14232
14233 cat >conftest.$ac_ext <<_ACEOF
14234 #line 14234 "configure"
14235 #include "confdefs.h"
14236
14237 #include <stdlib.h>
14238 #include <stdarg.h>
14239 #include <stdio.h>
14240 #ifdef HAVE_LIBUTF8_H
14241 #include <libutf8.h>
14242 #endif
14243 int
14244 main ()
14245 {
14246 wint_t state
14247   ;
14248   return 0;
14249 }
14250 _ACEOF
14251 rm -f conftest.$ac_objext
14252 if { (eval echo "$as_me:14252: \"$ac_compile\"") >&5
14253   (eval $ac_compile) 2>&5
14254   ac_status=$?
14255   echo "$as_me:14255: \$? = $ac_status" >&5
14256   (exit $ac_status); } &&
14257          { ac_try='test -s conftest.$ac_objext'
14258   { (eval echo "$as_me:14258: \"$ac_try\"") >&5
14259   (eval $ac_try) 2>&5
14260   ac_status=$?
14261   echo "$as_me:14261: \$? = $ac_status" >&5
14262   (exit $ac_status); }; }; then
14263   cf_cv_wint_t=no
14264 else
14265   echo "$as_me: failed program was:" >&5
14266 cat conftest.$ac_ext >&5
14267 cat >conftest.$ac_ext <<_ACEOF
14268 #line 14268 "configure"
14269 #include "confdefs.h"
14270
14271 #include <stdlib.h>
14272 #include <stdarg.h>
14273 #include <stdio.h>
14274 #include <wchar.h>
14275 #ifdef HAVE_LIBUTF8_H
14276 #include <libutf8.h>
14277 #endif
14278 int
14279 main ()
14280 {
14281 wint_t value
14282   ;
14283   return 0;
14284 }
14285 _ACEOF
14286 rm -f conftest.$ac_objext
14287 if { (eval echo "$as_me:14287: \"$ac_compile\"") >&5
14288   (eval $ac_compile) 2>&5
14289   ac_status=$?
14290   echo "$as_me:14290: \$? = $ac_status" >&5
14291   (exit $ac_status); } &&
14292          { ac_try='test -s conftest.$ac_objext'
14293   { (eval echo "$as_me:14293: \"$ac_try\"") >&5
14294   (eval $ac_try) 2>&5
14295   ac_status=$?
14296   echo "$as_me:14296: \$? = $ac_status" >&5
14297   (exit $ac_status); }; }; then
14298   cf_cv_wint_t=yes
14299 else
14300   echo "$as_me: failed program was:" >&5
14301 cat conftest.$ac_ext >&5
14302 cf_cv_wint_t=unknown
14303 fi
14304 rm -f conftest.$ac_objext conftest.$ac_ext
14305 fi
14306 rm -f conftest.$ac_objext conftest.$ac_ext
14307 fi
14308 echo "$as_me:14308: result: $cf_cv_wint_t" >&5
14309 echo "${ECHO_T}$cf_cv_wint_t" >&6
14310
14311 if test "$cf_cv_wint_t" = yes ; then
14312
14313 cat >>confdefs.h <<\EOF
14314 #define NEED_WCHAR_H 1
14315 EOF
14316
14317         NEED_WCHAR_H=1
14318 fi
14319
14320 # if we do not find wint_t in either place, use substitution to provide a fallback.
14321 if test "$cf_cv_wint_t" = unknown ; then
14322         NCURSES_WINT_T=1
14323 fi
14324
14325 # if we find wint_t in either place, use substitution to provide a fallback.
14326 if test "$cf_cv_wint_t" != unknown ; then
14327         NCURSES_OK_WINT_T=1
14328 fi
14329
14330         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
14331
14332 echo "$as_me:14332: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14333 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14334 cat >conftest.$ac_ext <<_ACEOF
14335 #line 14335 "configure"
14336 #include "confdefs.h"
14337
14338 #ifndef _XOPEN_SOURCE_EXTENDED
14339 #define _XOPEN_SOURCE_EXTENDED
14340 #endif
14341 #include <${cf_cv_ncurses_header:-curses.h}>
14342 int
14343 main ()
14344 {
14345
14346 mbstate_t foo
14347
14348   ;
14349   return 0;
14350 }
14351 _ACEOF
14352 rm -f conftest.$ac_objext
14353 if { (eval echo "$as_me:14353: \"$ac_compile\"") >&5
14354   (eval $ac_compile) 2>&5
14355   ac_status=$?
14356   echo "$as_me:14356: \$? = $ac_status" >&5
14357   (exit $ac_status); } &&
14358          { ac_try='test -s conftest.$ac_objext'
14359   { (eval echo "$as_me:14359: \"$ac_try\"") >&5
14360   (eval $ac_try) 2>&5
14361   ac_status=$?
14362   echo "$as_me:14362: \$? = $ac_status" >&5
14363   (exit $ac_status); }; }; then
14364   cf_result=yes
14365 else
14366   echo "$as_me: failed program was:" >&5
14367 cat conftest.$ac_ext >&5
14368 cf_result=no
14369 fi
14370 rm -f conftest.$ac_objext conftest.$ac_ext
14371 echo "$as_me:14371: result: $cf_result" >&5
14372 echo "${ECHO_T}$cf_result" >&6
14373 if test $cf_result = yes ; then
14374
14375 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14376
14377 cat >>confdefs.h <<EOF
14378 #define $cf_result 1
14379 EOF
14380
14381 else
14382
14383 cat >>confdefs.h <<EOF
14384 #define mbstate_t long
14385 EOF
14386
14387 fi
14388
14389         fi
14390
14391         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
14392
14393 echo "$as_me:14393: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14394 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14395 cat >conftest.$ac_ext <<_ACEOF
14396 #line 14396 "configure"
14397 #include "confdefs.h"
14398
14399 #ifndef _XOPEN_SOURCE_EXTENDED
14400 #define _XOPEN_SOURCE_EXTENDED
14401 #endif
14402 #include <${cf_cv_ncurses_header:-curses.h}>
14403 int
14404 main ()
14405 {
14406
14407 wchar_t foo
14408
14409   ;
14410   return 0;
14411 }
14412 _ACEOF
14413 rm -f conftest.$ac_objext
14414 if { (eval echo "$as_me:14414: \"$ac_compile\"") >&5
14415   (eval $ac_compile) 2>&5
14416   ac_status=$?
14417   echo "$as_me:14417: \$? = $ac_status" >&5
14418   (exit $ac_status); } &&
14419          { ac_try='test -s conftest.$ac_objext'
14420   { (eval echo "$as_me:14420: \"$ac_try\"") >&5
14421   (eval $ac_try) 2>&5
14422   ac_status=$?
14423   echo "$as_me:14423: \$? = $ac_status" >&5
14424   (exit $ac_status); }; }; then
14425   cf_result=yes
14426 else
14427   echo "$as_me: failed program was:" >&5
14428 cat conftest.$ac_ext >&5
14429 cf_result=no
14430 fi
14431 rm -f conftest.$ac_objext conftest.$ac_ext
14432 echo "$as_me:14432: result: $cf_result" >&5
14433 echo "${ECHO_T}$cf_result" >&6
14434 if test $cf_result = yes ; then
14435
14436 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14437
14438 cat >>confdefs.h <<EOF
14439 #define $cf_result 1
14440 EOF
14441
14442 else
14443
14444 cat >>confdefs.h <<EOF
14445 #define wchar_t long
14446 EOF
14447
14448 fi
14449
14450         fi
14451
14452         if test "$NCURSES_OK_WINT_T" = 0 ; then
14453
14454 echo "$as_me:14454: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14455 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14456 cat >conftest.$ac_ext <<_ACEOF
14457 #line 14457 "configure"
14458 #include "confdefs.h"
14459
14460 #ifndef _XOPEN_SOURCE_EXTENDED
14461 #define _XOPEN_SOURCE_EXTENDED
14462 #endif
14463 #include <${cf_cv_ncurses_header:-curses.h}>
14464 int
14465 main ()
14466 {
14467
14468 wint_t foo
14469
14470   ;
14471   return 0;
14472 }
14473 _ACEOF
14474 rm -f conftest.$ac_objext
14475 if { (eval echo "$as_me:14475: \"$ac_compile\"") >&5
14476   (eval $ac_compile) 2>&5
14477   ac_status=$?
14478   echo "$as_me:14478: \$? = $ac_status" >&5
14479   (exit $ac_status); } &&
14480          { ac_try='test -s conftest.$ac_objext'
14481   { (eval echo "$as_me:14481: \"$ac_try\"") >&5
14482   (eval $ac_try) 2>&5
14483   ac_status=$?
14484   echo "$as_me:14484: \$? = $ac_status" >&5
14485   (exit $ac_status); }; }; then
14486   cf_result=yes
14487 else
14488   echo "$as_me: failed program was:" >&5
14489 cat conftest.$ac_ext >&5
14490 cf_result=no
14491 fi
14492 rm -f conftest.$ac_objext conftest.$ac_ext
14493 echo "$as_me:14493: result: $cf_result" >&5
14494 echo "${ECHO_T}$cf_result" >&6
14495 if test $cf_result = yes ; then
14496
14497 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14498
14499 cat >>confdefs.h <<EOF
14500 #define $cf_result 1
14501 EOF
14502
14503 else
14504
14505 cat >>confdefs.h <<EOF
14506 #define wint_t long
14507 EOF
14508
14509 fi
14510
14511         fi
14512 fi
14513
14514 echo "$as_me:14514: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
14515 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14516
14517 cat >conftest.$ac_ext <<_ACEOF
14518 #line 14518 "configure"
14519 #include "confdefs.h"
14520
14521 #ifdef HAVE_XCURSES
14522 #include <xcurses.h>
14523 char * XCursesProgramName = "test";
14524 #else
14525 #include <${cf_cv_ncurses_header:-curses.h}>
14526 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14527 #include <ncursesw/term.h>
14528 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14529 #include <ncurses/term.h>
14530 #elif defined(HAVE_TERM_H)
14531 #include <term.h>
14532 #endif
14533 #endif
14534
14535 int
14536 main ()
14537 {
14538
14539 void *foo = &(boolnames)
14540
14541   ;
14542   return 0;
14543 }
14544 _ACEOF
14545 rm -f conftest.$ac_objext
14546 if { (eval echo "$as_me:14546: \"$ac_compile\"") >&5
14547   (eval $ac_compile) 2>&5
14548   ac_status=$?
14549   echo "$as_me:14549: \$? = $ac_status" >&5
14550   (exit $ac_status); } &&
14551          { ac_try='test -s conftest.$ac_objext'
14552   { (eval echo "$as_me:14552: \"$ac_try\"") >&5
14553   (eval $ac_try) 2>&5
14554   ac_status=$?
14555   echo "$as_me:14555: \$? = $ac_status" >&5
14556   (exit $ac_status); }; }; then
14557   cf_result=yes
14558 else
14559   echo "$as_me: failed program was:" >&5
14560 cat conftest.$ac_ext >&5
14561 cf_result=no
14562 fi
14563 rm -f conftest.$ac_objext conftest.$ac_ext
14564 echo "$as_me:14564: result: $cf_result" >&5
14565 echo "${ECHO_T}$cf_result" >&6
14566
14567 if test $cf_result = yes ; then
14568
14569 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14570
14571         cat >>confdefs.h <<EOF
14572 #define $cf_result 1
14573 EOF
14574
14575 else
14576         echo "$as_me:14576: checking for data boolnames in library" >&5
14577 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
14578         # BSD linkers insist on making weak linkage, but resolve at runtime.
14579         if test "$cross_compiling" = yes; then
14580
14581         # cross-compiling
14582         cat >conftest.$ac_ext <<_ACEOF
14583 #line 14583 "configure"
14584 #include "confdefs.h"
14585
14586 #ifdef HAVE_XCURSES
14587 #include <xcurses.h>
14588 char * XCursesProgramName = "test";
14589 #else
14590 #include <${cf_cv_ncurses_header:-curses.h}>
14591 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14592 #include <ncursesw/term.h>
14593 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14594 #include <ncurses/term.h>
14595 #elif defined(HAVE_TERM_H)
14596 #include <term.h>
14597 #endif
14598 #endif
14599
14600 extern char boolnames;
14601 int
14602 main ()
14603 {
14604
14605         do {
14606                 void *foo = &(boolnames);
14607                 ${cf_cv_main_return:-return}(foo == 0);
14608         } while (0)
14609
14610   ;
14611   return 0;
14612 }
14613 _ACEOF
14614 rm -f conftest.$ac_objext conftest$ac_exeext
14615 if { (eval echo "$as_me:14615: \"$ac_link\"") >&5
14616   (eval $ac_link) 2>&5
14617   ac_status=$?
14618   echo "$as_me:14618: \$? = $ac_status" >&5
14619   (exit $ac_status); } &&
14620          { ac_try='test -s conftest$ac_exeext'
14621   { (eval echo "$as_me:14621: \"$ac_try\"") >&5
14622   (eval $ac_try) 2>&5
14623   ac_status=$?
14624   echo "$as_me:14624: \$? = $ac_status" >&5
14625   (exit $ac_status); }; }; then
14626   cf_result=yes
14627 else
14628   echo "$as_me: failed program was:" >&5
14629 cat conftest.$ac_ext >&5
14630 cf_result=no
14631 fi
14632 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14633
14634 else
14635   cat >conftest.$ac_ext <<_ACEOF
14636 #line 14636 "configure"
14637 #include "confdefs.h"
14638
14639 #ifdef HAVE_XCURSES
14640 #include <xcurses.h>
14641 char * XCursesProgramName = "test";
14642 #else
14643 #include <${cf_cv_ncurses_header:-curses.h}>
14644 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14645 #include <ncursesw/term.h>
14646 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14647 #include <ncurses/term.h>
14648 #elif defined(HAVE_TERM_H)
14649 #include <term.h>
14650 #endif
14651 #endif
14652
14653 extern char boolnames;
14654 int main(void)
14655 {
14656         void *foo = &(boolnames);
14657         ${cf_cv_main_return:-return}(foo == 0);
14658 }
14659 _ACEOF
14660 rm -f conftest$ac_exeext
14661 if { (eval echo "$as_me:14661: \"$ac_link\"") >&5
14662   (eval $ac_link) 2>&5
14663   ac_status=$?
14664   echo "$as_me:14664: \$? = $ac_status" >&5
14665   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14666   { (eval echo "$as_me:14666: \"$ac_try\"") >&5
14667   (eval $ac_try) 2>&5
14668   ac_status=$?
14669   echo "$as_me:14669: \$? = $ac_status" >&5
14670   (exit $ac_status); }; }; then
14671   cf_result=yes
14672 else
14673   echo "$as_me: program exited with status $ac_status" >&5
14674 echo "$as_me: failed program was:" >&5
14675 cat conftest.$ac_ext >&5
14676 cf_result=no
14677 fi
14678 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14679 fi
14680         echo "$as_me:14680: result: $cf_result" >&5
14681 echo "${ECHO_T}$cf_result" >&6
14682         if test $cf_result = yes ; then
14683
14684 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14685
14686                 cat >>confdefs.h <<EOF
14687 #define $cf_result 1
14688 EOF
14689
14690         fi
14691 fi
14692
14693 echo "$as_me:14693: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
14694 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14695
14696 cat >conftest.$ac_ext <<_ACEOF
14697 #line 14697 "configure"
14698 #include "confdefs.h"
14699
14700 #ifdef HAVE_XCURSES
14701 #include <xcurses.h>
14702 char * XCursesProgramName = "test";
14703 #else
14704 #include <${cf_cv_ncurses_header:-curses.h}>
14705 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14706 #include <ncursesw/term.h>
14707 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14708 #include <ncurses/term.h>
14709 #elif defined(HAVE_TERM_H)
14710 #include <term.h>
14711 #endif
14712 #endif
14713
14714 int
14715 main ()
14716 {
14717
14718 void *foo = &(boolfnames)
14719
14720   ;
14721   return 0;
14722 }
14723 _ACEOF
14724 rm -f conftest.$ac_objext
14725 if { (eval echo "$as_me:14725: \"$ac_compile\"") >&5
14726   (eval $ac_compile) 2>&5
14727   ac_status=$?
14728   echo "$as_me:14728: \$? = $ac_status" >&5
14729   (exit $ac_status); } &&
14730          { ac_try='test -s conftest.$ac_objext'
14731   { (eval echo "$as_me:14731: \"$ac_try\"") >&5
14732   (eval $ac_try) 2>&5
14733   ac_status=$?
14734   echo "$as_me:14734: \$? = $ac_status" >&5
14735   (exit $ac_status); }; }; then
14736   cf_result=yes
14737 else
14738   echo "$as_me: failed program was:" >&5
14739 cat conftest.$ac_ext >&5
14740 cf_result=no
14741 fi
14742 rm -f conftest.$ac_objext conftest.$ac_ext
14743 echo "$as_me:14743: result: $cf_result" >&5
14744 echo "${ECHO_T}$cf_result" >&6
14745
14746 if test $cf_result = yes ; then
14747
14748 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14749
14750         cat >>confdefs.h <<EOF
14751 #define $cf_result 1
14752 EOF
14753
14754 else
14755         echo "$as_me:14755: checking for data boolfnames in library" >&5
14756 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
14757         # BSD linkers insist on making weak linkage, but resolve at runtime.
14758         if test "$cross_compiling" = yes; then
14759
14760         # cross-compiling
14761         cat >conftest.$ac_ext <<_ACEOF
14762 #line 14762 "configure"
14763 #include "confdefs.h"
14764
14765 #ifdef HAVE_XCURSES
14766 #include <xcurses.h>
14767 char * XCursesProgramName = "test";
14768 #else
14769 #include <${cf_cv_ncurses_header:-curses.h}>
14770 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14771 #include <ncursesw/term.h>
14772 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14773 #include <ncurses/term.h>
14774 #elif defined(HAVE_TERM_H)
14775 #include <term.h>
14776 #endif
14777 #endif
14778
14779 extern char boolfnames;
14780 int
14781 main ()
14782 {
14783
14784         do {
14785                 void *foo = &(boolfnames);
14786                 ${cf_cv_main_return:-return}(foo == 0);
14787         } while (0)
14788
14789   ;
14790   return 0;
14791 }
14792 _ACEOF
14793 rm -f conftest.$ac_objext conftest$ac_exeext
14794 if { (eval echo "$as_me:14794: \"$ac_link\"") >&5
14795   (eval $ac_link) 2>&5
14796   ac_status=$?
14797   echo "$as_me:14797: \$? = $ac_status" >&5
14798   (exit $ac_status); } &&
14799          { ac_try='test -s conftest$ac_exeext'
14800   { (eval echo "$as_me:14800: \"$ac_try\"") >&5
14801   (eval $ac_try) 2>&5
14802   ac_status=$?
14803   echo "$as_me:14803: \$? = $ac_status" >&5
14804   (exit $ac_status); }; }; then
14805   cf_result=yes
14806 else
14807   echo "$as_me: failed program was:" >&5
14808 cat conftest.$ac_ext >&5
14809 cf_result=no
14810 fi
14811 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14812
14813 else
14814   cat >conftest.$ac_ext <<_ACEOF
14815 #line 14815 "configure"
14816 #include "confdefs.h"
14817
14818 #ifdef HAVE_XCURSES
14819 #include <xcurses.h>
14820 char * XCursesProgramName = "test";
14821 #else
14822 #include <${cf_cv_ncurses_header:-curses.h}>
14823 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14824 #include <ncursesw/term.h>
14825 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14826 #include <ncurses/term.h>
14827 #elif defined(HAVE_TERM_H)
14828 #include <term.h>
14829 #endif
14830 #endif
14831
14832 extern char boolfnames;
14833 int main(void)
14834 {
14835         void *foo = &(boolfnames);
14836         ${cf_cv_main_return:-return}(foo == 0);
14837 }
14838 _ACEOF
14839 rm -f conftest$ac_exeext
14840 if { (eval echo "$as_me:14840: \"$ac_link\"") >&5
14841   (eval $ac_link) 2>&5
14842   ac_status=$?
14843   echo "$as_me:14843: \$? = $ac_status" >&5
14844   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14845   { (eval echo "$as_me:14845: \"$ac_try\"") >&5
14846   (eval $ac_try) 2>&5
14847   ac_status=$?
14848   echo "$as_me:14848: \$? = $ac_status" >&5
14849   (exit $ac_status); }; }; then
14850   cf_result=yes
14851 else
14852   echo "$as_me: program exited with status $ac_status" >&5
14853 echo "$as_me: failed program was:" >&5
14854 cat conftest.$ac_ext >&5
14855 cf_result=no
14856 fi
14857 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14858 fi
14859         echo "$as_me:14859: result: $cf_result" >&5
14860 echo "${ECHO_T}$cf_result" >&6
14861         if test $cf_result = yes ; then
14862
14863 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14864
14865                 cat >>confdefs.h <<EOF
14866 #define $cf_result 1
14867 EOF
14868
14869         fi
14870 fi
14871
14872 if ( test "$GCC" = yes || test "$GXX" = yes )
14873 then
14874 echo "$as_me:14874: checking if you want to turn on gcc warnings" >&5
14875 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
14876
14877 # Check whether --enable-warnings or --disable-warnings was given.
14878 if test "${enable_warnings+set}" = set; then
14879   enableval="$enable_warnings"
14880   test "$enableval" != yes && enableval=no
14881   if test "$enableval" != "no" ; then
14882     with_warnings=yes
14883   else
14884     with_warnings=no
14885   fi
14886 else
14887   enableval=no
14888   with_warnings=no
14889
14890 fi;
14891 echo "$as_me:14891: result: $with_warnings" >&5
14892 echo "${ECHO_T}$with_warnings" >&6
14893 if test "$with_warnings" = "yes"
14894 then
14895
14896 if test "$GCC" = yes
14897 then
14898 cat > conftest.i <<EOF
14899 #ifndef GCC_PRINTF
14900 #define GCC_PRINTF 0
14901 #endif
14902 #ifndef GCC_SCANF
14903 #define GCC_SCANF 0
14904 #endif
14905 #ifndef GCC_NORETURN
14906 #define GCC_NORETURN /* nothing */
14907 #endif
14908 #ifndef GCC_UNUSED
14909 #define GCC_UNUSED /* nothing */
14910 #endif
14911 EOF
14912 if test "$GCC" = yes
14913 then
14914         { echo "$as_me:14914: checking for $CC __attribute__ directives..." >&5
14915 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
14916 cat > conftest.$ac_ext <<EOF
14917 #line 14917 "${as_me:-configure}"
14918 #include "confdefs.h"
14919 #include "conftest.h"
14920 #include "conftest.i"
14921 #if     GCC_PRINTF
14922 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
14923 #else
14924 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
14925 #endif
14926 #if     GCC_SCANF
14927 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
14928 #else
14929 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
14930 #endif
14931 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
14932 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
14933 extern void foo(void) GCC_NORETURN;
14934 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
14935 EOF
14936         cf_printf_attribute=no
14937         cf_scanf_attribute=no
14938         for cf_attribute in scanf printf unused noreturn
14939         do
14940
14941 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14942
14943                 cf_directive="__attribute__(($cf_attribute))"
14944                 echo "checking for $CC $cf_directive" 1>&5
14945
14946                 case $cf_attribute in #(vi
14947                 printf) #(vi
14948                         cf_printf_attribute=yes
14949                         cat >conftest.h <<EOF
14950 #define GCC_$cf_ATTRIBUTE 1
14951 EOF
14952                         ;;
14953                 scanf) #(vi
14954                         cf_scanf_attribute=yes
14955                         cat >conftest.h <<EOF
14956 #define GCC_$cf_ATTRIBUTE 1
14957 EOF
14958                         ;;
14959                 *) #(vi
14960                         cat >conftest.h <<EOF
14961 #define GCC_$cf_ATTRIBUTE $cf_directive
14962 EOF
14963                         ;;
14964                 esac
14965
14966                 if { (eval echo "$as_me:14966: \"$ac_compile\"") >&5
14967   (eval $ac_compile) 2>&5
14968   ac_status=$?
14969   echo "$as_me:14969: \$? = $ac_status" >&5
14970   (exit $ac_status); }; then
14971                         test -n "$verbose" && echo "$as_me:14971: result: ... $cf_attribute" >&5
14972 echo "${ECHO_T}... $cf_attribute" >&6
14973                         cat conftest.h >>confdefs.h
14974                         case $cf_attribute in #(vi
14975                         noreturn) #(vi
14976
14977 cat >>confdefs.h <<EOF
14978 #define GCC_NORETURN $cf_directive
14979 EOF
14980
14981                                 ;;
14982                         printf) #(vi
14983                                 cf_value='/* nothing */'
14984                                 if test "$cf_printf_attribute" != no ; then
14985                                         cf_value='__attribute__((format(printf,fmt,var)))'
14986
14987 cat >>confdefs.h <<\EOF
14988 #define GCC_PRINTF 1
14989 EOF
14990
14991                                 fi
14992
14993 cat >>confdefs.h <<EOF
14994 #define GCC_PRINTFLIKE(fmt,var) $cf_value
14995 EOF
14996
14997                                 ;;
14998                         scanf) #(vi
14999                                 cf_value='/* nothing */'
15000                                 if test "$cf_scanf_attribute" != no ; then
15001                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15002
15003 cat >>confdefs.h <<\EOF
15004 #define GCC_SCANF 1
15005 EOF
15006
15007                                 fi
15008
15009 cat >>confdefs.h <<EOF
15010 #define GCC_SCANFLIKE(fmt,var) $cf_value
15011 EOF
15012
15013                                 ;;
15014                         unused) #(vi
15015
15016 cat >>confdefs.h <<EOF
15017 #define GCC_UNUSED $cf_directive
15018 EOF
15019
15020                                 ;;
15021                         esac
15022                 fi
15023         done
15024 else
15025         fgrep define conftest.i >>confdefs.h
15026 fi
15027 rm -rf conftest*
15028 fi
15029
15030 INTEL_COMPILER=no
15031
15032 if test "$GCC" = yes ; then
15033         case $host_os in
15034         linux*|gnu*)
15035                 echo "$as_me:15035: checking if this is really Intel C compiler" >&5
15036 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
15037                 cf_save_CFLAGS="$CFLAGS"
15038                 CFLAGS="$CFLAGS -no-gcc"
15039                 cat >conftest.$ac_ext <<_ACEOF
15040 #line 15040 "configure"
15041 #include "confdefs.h"
15042
15043 int
15044 main ()
15045 {
15046
15047 #ifdef __INTEL_COMPILER
15048 #else
15049 make an error
15050 #endif
15051
15052   ;
15053   return 0;
15054 }
15055 _ACEOF
15056 rm -f conftest.$ac_objext
15057 if { (eval echo "$as_me:15057: \"$ac_compile\"") >&5
15058   (eval $ac_compile) 2>&5
15059   ac_status=$?
15060   echo "$as_me:15060: \$? = $ac_status" >&5
15061   (exit $ac_status); } &&
15062          { ac_try='test -s conftest.$ac_objext'
15063   { (eval echo "$as_me:15063: \"$ac_try\"") >&5
15064   (eval $ac_try) 2>&5
15065   ac_status=$?
15066   echo "$as_me:15066: \$? = $ac_status" >&5
15067   (exit $ac_status); }; }; then
15068   INTEL_COMPILER=yes
15069 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
15070
15071 else
15072   echo "$as_me: failed program was:" >&5
15073 cat conftest.$ac_ext >&5
15074 fi
15075 rm -f conftest.$ac_objext conftest.$ac_ext
15076                 CFLAGS="$cf_save_CFLAGS"
15077                 echo "$as_me:15077: result: $INTEL_COMPILER" >&5
15078 echo "${ECHO_T}$INTEL_COMPILER" >&6
15079                 ;;
15080         esac
15081 fi
15082
15083 CLANG_COMPILER=no
15084
15085 if test "$GCC" = yes ; then
15086         echo "$as_me:15086: checking if this is really Clang C compiler" >&5
15087 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
15088         cf_save_CFLAGS="$CFLAGS"
15089         CFLAGS="$CFLAGS -Qunused-arguments"
15090         cat >conftest.$ac_ext <<_ACEOF
15091 #line 15091 "configure"
15092 #include "confdefs.h"
15093
15094 int
15095 main ()
15096 {
15097
15098 #ifdef __clang__
15099 #else
15100 make an error
15101 #endif
15102
15103   ;
15104   return 0;
15105 }
15106 _ACEOF
15107 rm -f conftest.$ac_objext
15108 if { (eval echo "$as_me:15108: \"$ac_compile\"") >&5
15109   (eval $ac_compile) 2>&5
15110   ac_status=$?
15111   echo "$as_me:15111: \$? = $ac_status" >&5
15112   (exit $ac_status); } &&
15113          { ac_try='test -s conftest.$ac_objext'
15114   { (eval echo "$as_me:15114: \"$ac_try\"") >&5
15115   (eval $ac_try) 2>&5
15116   ac_status=$?
15117   echo "$as_me:15117: \$? = $ac_status" >&5
15118   (exit $ac_status); }; }; then
15119   CLANG_COMPILER=yes
15120 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
15121
15122 else
15123   echo "$as_me: failed program was:" >&5
15124 cat conftest.$ac_ext >&5
15125 fi
15126 rm -f conftest.$ac_objext conftest.$ac_ext
15127         CFLAGS="$cf_save_CFLAGS"
15128         echo "$as_me:15128: result: $CLANG_COMPILER" >&5
15129 echo "${ECHO_T}$CLANG_COMPILER" >&6
15130 fi
15131
15132 cat > conftest.$ac_ext <<EOF
15133 #line 15133 "${as_me:-configure}"
15134 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15135 EOF
15136
15137 if test "$INTEL_COMPILER" = yes
15138 then
15139 # The "-wdXXX" options suppress warnings:
15140 # remark #1419: external declaration in primary source file
15141 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15142 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15143 # remark #193: zero used for undefined preprocessing identifier
15144 # remark #593: variable "curs_sb_left_arrow" was set but never used
15145 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15146 # remark #869: parameter "tw" was never referenced
15147 # remark #981: operands are evaluated in unspecified order
15148 # warning #279: controlling expression is constant
15149
15150         { echo "$as_me:15150: checking for $CC warning options..." >&5
15151 echo "$as_me: checking for $CC warning options..." >&6;}
15152         cf_save_CFLAGS="$CFLAGS"
15153         EXTRA_CFLAGS="-Wall"
15154         for cf_opt in \
15155                 wd1419 \
15156                 wd1683 \
15157                 wd1684 \
15158                 wd193 \
15159                 wd593 \
15160                 wd279 \
15161                 wd810 \
15162                 wd869 \
15163                 wd981
15164         do
15165                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15166                 if { (eval echo "$as_me:15166: \"$ac_compile\"") >&5
15167   (eval $ac_compile) 2>&5
15168   ac_status=$?
15169   echo "$as_me:15169: \$? = $ac_status" >&5
15170   (exit $ac_status); }; then
15171                         test -n "$verbose" && echo "$as_me:15171: result: ... -$cf_opt" >&5
15172 echo "${ECHO_T}... -$cf_opt" >&6
15173                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15174                 fi
15175         done
15176         CFLAGS="$cf_save_CFLAGS"
15177
15178 elif test "$GCC" = yes
15179 then
15180         { echo "$as_me:15180: checking for $CC warning options..." >&5
15181 echo "$as_me: checking for $CC warning options..." >&6;}
15182         cf_save_CFLAGS="$CFLAGS"
15183         EXTRA_CFLAGS=
15184         cf_warn_CONST=""
15185         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15186         for cf_opt in W Wall \
15187                 Wbad-function-cast \
15188                 Wcast-align \
15189                 Wcast-qual \
15190                 Winline \
15191                 Wmissing-declarations \
15192                 Wmissing-prototypes \
15193                 Wnested-externs \
15194                 Wpointer-arith \
15195                 Wshadow \
15196                 Wstrict-prototypes \
15197                 Wundef $cf_warn_CONST
15198         do
15199                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15200                 if { (eval echo "$as_me:15200: \"$ac_compile\"") >&5
15201   (eval $ac_compile) 2>&5
15202   ac_status=$?
15203   echo "$as_me:15203: \$? = $ac_status" >&5
15204   (exit $ac_status); }; then
15205                         test -n "$verbose" && echo "$as_me:15205: result: ... -$cf_opt" >&5
15206 echo "${ECHO_T}... -$cf_opt" >&6
15207                         case $cf_opt in #(vi
15208                         Wcast-qual) #(vi
15209                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
15210                                 ;;
15211                         Winline) #(vi
15212                                 case $GCC_VERSION in
15213                                 [34].*)
15214                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15215
15216 echo "${as_me:-configure}:15216: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15217
15218                                         continue;;
15219                                 esac
15220                                 ;;
15221                         Wpointer-arith) #(vi
15222                                 case $GCC_VERSION in
15223                                 [12].*)
15224                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15225
15226 echo "${as_me:-configure}:15226: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15227
15228                                         continue;;
15229                                 esac
15230                                 ;;
15231                         esac
15232                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15233                 fi
15234         done
15235         CFLAGS="$cf_save_CFLAGS"
15236 fi
15237 rm -rf conftest*
15238
15239 fi
15240 fi
15241
15242 echo "$as_me:15242: checking if you want to use dmalloc for testing" >&5
15243 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
15244
15245 # Check whether --with-dmalloc or --without-dmalloc was given.
15246 if test "${with_dmalloc+set}" = set; then
15247   withval="$with_dmalloc"
15248
15249 cat >>confdefs.h <<EOF
15250 #define USE_DMALLOC 1
15251 EOF
15252
15253         : ${with_cflags:=-g}
15254         : ${with_no_leaks:=yes}
15255          with_dmalloc=yes
15256 else
15257   with_dmalloc=
15258 fi;
15259 echo "$as_me:15259: result: ${with_dmalloc:-no}" >&5
15260 echo "${ECHO_T}${with_dmalloc:-no}" >&6
15261
15262 case .$with_cflags in #(vi
15263 .*-g*)
15264         case .$CFLAGS in #(vi
15265         .*-g*) #(vi
15266                 ;;
15267         *)
15268
15269 cf_fix_cppflags=no
15270 cf_new_cflags=
15271 cf_new_cppflags=
15272 cf_new_extra_cppflags=
15273
15274 for cf_add_cflags in -g
15275 do
15276 case $cf_fix_cppflags in
15277 no)
15278         case $cf_add_cflags in #(vi
15279         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
15280                 case $cf_add_cflags in
15281                 -D*)
15282                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15283
15284                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15285                                 && test -z "${cf_tst_cflags}" \
15286                                 && cf_fix_cppflags=yes
15287
15288                         if test $cf_fix_cppflags = yes ; then
15289                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15290                                 continue
15291                         elif test "${cf_tst_cflags}" = "\"'" ; then
15292                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15293                                 continue
15294                         fi
15295                         ;;
15296                 esac
15297                 case "$CPPFLAGS" in
15298                 *$cf_add_cflags) #(vi
15299                         ;;
15300                 *) #(vi
15301                         case $cf_add_cflags in #(vi
15302                         -D*)
15303                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15304
15305 CPPFLAGS=`echo "$CPPFLAGS" | \
15306         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15307                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15308
15309                                 ;;
15310                         esac
15311                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
15312                         ;;
15313                 esac
15314                 ;;
15315         *)
15316                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
15317                 ;;
15318         esac
15319         ;;
15320 yes)
15321         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15322
15323         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15324
15325         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15326                 && test -z "${cf_tst_cflags}" \
15327                 && cf_fix_cppflags=no
15328         ;;
15329 esac
15330 done
15331
15332 if test -n "$cf_new_cflags" ; then
15333
15334         CFLAGS="$CFLAGS $cf_new_cflags"
15335 fi
15336
15337 if test -n "$cf_new_cppflags" ; then
15338
15339         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
15340 fi
15341
15342 if test -n "$cf_new_extra_cppflags" ; then
15343
15344         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
15345 fi
15346
15347                 ;;
15348         esac
15349         ;;
15350 esac
15351
15352 if test "$with_dmalloc" = yes ; then
15353         echo "$as_me:15353: checking for dmalloc.h" >&5
15354 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
15355 if test "${ac_cv_header_dmalloc_h+set}" = set; then
15356   echo $ECHO_N "(cached) $ECHO_C" >&6
15357 else
15358   cat >conftest.$ac_ext <<_ACEOF
15359 #line 15359 "configure"
15360 #include "confdefs.h"
15361 #include <dmalloc.h>
15362 _ACEOF
15363 if { (eval echo "$as_me:15363: \"$ac_cpp conftest.$ac_ext\"") >&5
15364   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15365   ac_status=$?
15366   egrep -v '^ *\+' conftest.er1 >conftest.err
15367   rm -f conftest.er1
15368   cat conftest.err >&5
15369   echo "$as_me:15369: \$? = $ac_status" >&5
15370   (exit $ac_status); } >/dev/null; then
15371   if test -s conftest.err; then
15372     ac_cpp_err=$ac_c_preproc_warn_flag
15373   else
15374     ac_cpp_err=
15375   fi
15376 else
15377   ac_cpp_err=yes
15378 fi
15379 if test -z "$ac_cpp_err"; then
15380   ac_cv_header_dmalloc_h=yes
15381 else
15382   echo "$as_me: failed program was:" >&5
15383   cat conftest.$ac_ext >&5
15384   ac_cv_header_dmalloc_h=no
15385 fi
15386 rm -f conftest.err conftest.$ac_ext
15387 fi
15388 echo "$as_me:15388: result: $ac_cv_header_dmalloc_h" >&5
15389 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
15390 if test $ac_cv_header_dmalloc_h = yes; then
15391
15392 echo "$as_me:15392: checking for dmalloc_debug in -ldmalloc" >&5
15393 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
15394 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
15395   echo $ECHO_N "(cached) $ECHO_C" >&6
15396 else
15397   ac_check_lib_save_LIBS=$LIBS
15398 LIBS="-ldmalloc  $LIBS"
15399 cat >conftest.$ac_ext <<_ACEOF
15400 #line 15400 "configure"
15401 #include "confdefs.h"
15402
15403 /* Override any gcc2 internal prototype to avoid an error.  */
15404 #ifdef __cplusplus
15405 extern "C"
15406 #endif
15407 /* We use char because int might match the return type of a gcc2
15408    builtin and then its argument prototype would still apply.  */
15409 char dmalloc_debug ();
15410 int
15411 main ()
15412 {
15413 dmalloc_debug ();
15414   ;
15415   return 0;
15416 }
15417 _ACEOF
15418 rm -f conftest.$ac_objext conftest$ac_exeext
15419 if { (eval echo "$as_me:15419: \"$ac_link\"") >&5
15420   (eval $ac_link) 2>&5
15421   ac_status=$?
15422   echo "$as_me:15422: \$? = $ac_status" >&5
15423   (exit $ac_status); } &&
15424          { ac_try='test -s conftest$ac_exeext'
15425   { (eval echo "$as_me:15425: \"$ac_try\"") >&5
15426   (eval $ac_try) 2>&5
15427   ac_status=$?
15428   echo "$as_me:15428: \$? = $ac_status" >&5
15429   (exit $ac_status); }; }; then
15430   ac_cv_lib_dmalloc_dmalloc_debug=yes
15431 else
15432   echo "$as_me: failed program was:" >&5
15433 cat conftest.$ac_ext >&5
15434 ac_cv_lib_dmalloc_dmalloc_debug=no
15435 fi
15436 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15437 LIBS=$ac_check_lib_save_LIBS
15438 fi
15439 echo "$as_me:15439: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
15440 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
15441 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
15442   cat >>confdefs.h <<EOF
15443 #define HAVE_LIBDMALLOC 1
15444 EOF
15445
15446   LIBS="-ldmalloc $LIBS"
15447
15448 fi
15449
15450 fi
15451
15452 fi
15453
15454 echo "$as_me:15454: checking if you want to use dbmalloc for testing" >&5
15455 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
15456
15457 # Check whether --with-dbmalloc or --without-dbmalloc was given.
15458 if test "${with_dbmalloc+set}" = set; then
15459   withval="$with_dbmalloc"
15460
15461 cat >>confdefs.h <<EOF
15462 #define USE_DBMALLOC 1
15463 EOF
15464
15465         : ${with_cflags:=-g}
15466         : ${with_no_leaks:=yes}
15467          with_dbmalloc=yes
15468 else
15469   with_dbmalloc=
15470 fi;
15471 echo "$as_me:15471: result: ${with_dbmalloc:-no}" >&5
15472 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
15473
15474 case .$with_cflags in #(vi
15475 .*-g*)
15476         case .$CFLAGS in #(vi
15477         .*-g*) #(vi
15478                 ;;
15479         *)
15480
15481 cf_fix_cppflags=no
15482 cf_new_cflags=
15483 cf_new_cppflags=
15484 cf_new_extra_cppflags=
15485
15486 for cf_add_cflags in -g
15487 do
15488 case $cf_fix_cppflags in
15489 no)
15490         case $cf_add_cflags in #(vi
15491         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
15492                 case $cf_add_cflags in
15493                 -D*)
15494                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15495
15496                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15497                                 && test -z "${cf_tst_cflags}" \
15498                                 && cf_fix_cppflags=yes
15499
15500                         if test $cf_fix_cppflags = yes ; then
15501                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15502                                 continue
15503                         elif test "${cf_tst_cflags}" = "\"'" ; then
15504                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15505                                 continue
15506                         fi
15507                         ;;
15508                 esac
15509                 case "$CPPFLAGS" in
15510                 *$cf_add_cflags) #(vi
15511                         ;;
15512                 *) #(vi
15513                         case $cf_add_cflags in #(vi
15514                         -D*)
15515                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15516
15517 CPPFLAGS=`echo "$CPPFLAGS" | \
15518         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15519                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15520
15521                                 ;;
15522                         esac
15523                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
15524                         ;;
15525                 esac
15526                 ;;
15527         *)
15528                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
15529                 ;;
15530         esac
15531         ;;
15532 yes)
15533         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15534
15535         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15536
15537         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15538                 && test -z "${cf_tst_cflags}" \
15539                 && cf_fix_cppflags=no
15540         ;;
15541 esac
15542 done
15543
15544 if test -n "$cf_new_cflags" ; then
15545
15546         CFLAGS="$CFLAGS $cf_new_cflags"
15547 fi
15548
15549 if test -n "$cf_new_cppflags" ; then
15550
15551         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
15552 fi
15553
15554 if test -n "$cf_new_extra_cppflags" ; then
15555
15556         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
15557 fi
15558
15559                 ;;
15560         esac
15561         ;;
15562 esac
15563
15564 if test "$with_dbmalloc" = yes ; then
15565         echo "$as_me:15565: checking for dbmalloc.h" >&5
15566 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
15567 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
15568   echo $ECHO_N "(cached) $ECHO_C" >&6
15569 else
15570   cat >conftest.$ac_ext <<_ACEOF
15571 #line 15571 "configure"
15572 #include "confdefs.h"
15573 #include <dbmalloc.h>
15574 _ACEOF
15575 if { (eval echo "$as_me:15575: \"$ac_cpp conftest.$ac_ext\"") >&5
15576   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15577   ac_status=$?
15578   egrep -v '^ *\+' conftest.er1 >conftest.err
15579   rm -f conftest.er1
15580   cat conftest.err >&5
15581   echo "$as_me:15581: \$? = $ac_status" >&5
15582   (exit $ac_status); } >/dev/null; then
15583   if test -s conftest.err; then
15584     ac_cpp_err=$ac_c_preproc_warn_flag
15585   else
15586     ac_cpp_err=
15587   fi
15588 else
15589   ac_cpp_err=yes
15590 fi
15591 if test -z "$ac_cpp_err"; then
15592   ac_cv_header_dbmalloc_h=yes
15593 else
15594   echo "$as_me: failed program was:" >&5
15595   cat conftest.$ac_ext >&5
15596   ac_cv_header_dbmalloc_h=no
15597 fi
15598 rm -f conftest.err conftest.$ac_ext
15599 fi
15600 echo "$as_me:15600: result: $ac_cv_header_dbmalloc_h" >&5
15601 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
15602 if test $ac_cv_header_dbmalloc_h = yes; then
15603
15604 echo "$as_me:15604: checking for debug_malloc in -ldbmalloc" >&5
15605 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
15606 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
15607   echo $ECHO_N "(cached) $ECHO_C" >&6
15608 else
15609   ac_check_lib_save_LIBS=$LIBS
15610 LIBS="-ldbmalloc  $LIBS"
15611 cat >conftest.$ac_ext <<_ACEOF
15612 #line 15612 "configure"
15613 #include "confdefs.h"
15614
15615 /* Override any gcc2 internal prototype to avoid an error.  */
15616 #ifdef __cplusplus
15617 extern "C"
15618 #endif
15619 /* We use char because int might match the return type of a gcc2
15620    builtin and then its argument prototype would still apply.  */
15621 char debug_malloc ();
15622 int
15623 main ()
15624 {
15625 debug_malloc ();
15626   ;
15627   return 0;
15628 }
15629 _ACEOF
15630 rm -f conftest.$ac_objext conftest$ac_exeext
15631 if { (eval echo "$as_me:15631: \"$ac_link\"") >&5
15632   (eval $ac_link) 2>&5
15633   ac_status=$?
15634   echo "$as_me:15634: \$? = $ac_status" >&5
15635   (exit $ac_status); } &&
15636          { ac_try='test -s conftest$ac_exeext'
15637   { (eval echo "$as_me:15637: \"$ac_try\"") >&5
15638   (eval $ac_try) 2>&5
15639   ac_status=$?
15640   echo "$as_me:15640: \$? = $ac_status" >&5
15641   (exit $ac_status); }; }; then
15642   ac_cv_lib_dbmalloc_debug_malloc=yes
15643 else
15644   echo "$as_me: failed program was:" >&5
15645 cat conftest.$ac_ext >&5
15646 ac_cv_lib_dbmalloc_debug_malloc=no
15647 fi
15648 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15649 LIBS=$ac_check_lib_save_LIBS
15650 fi
15651 echo "$as_me:15651: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
15652 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
15653 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
15654   cat >>confdefs.h <<EOF
15655 #define HAVE_LIBDBMALLOC 1
15656 EOF
15657
15658   LIBS="-ldbmalloc $LIBS"
15659
15660 fi
15661
15662 fi
15663
15664 fi
15665
15666 echo "$as_me:15666: checking if you want to use valgrind for testing" >&5
15667 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
15668
15669 # Check whether --with-valgrind or --without-valgrind was given.
15670 if test "${with_valgrind+set}" = set; then
15671   withval="$with_valgrind"
15672
15673 cat >>confdefs.h <<EOF
15674 #define USE_VALGRIND 1
15675 EOF
15676
15677         : ${with_cflags:=-g}
15678         : ${with_no_leaks:=yes}
15679          with_valgrind=yes
15680 else
15681   with_valgrind=
15682 fi;
15683 echo "$as_me:15683: result: ${with_valgrind:-no}" >&5
15684 echo "${ECHO_T}${with_valgrind:-no}" >&6
15685
15686 case .$with_cflags in #(vi
15687 .*-g*)
15688         case .$CFLAGS in #(vi
15689         .*-g*) #(vi
15690                 ;;
15691         *)
15692
15693 cf_fix_cppflags=no
15694 cf_new_cflags=
15695 cf_new_cppflags=
15696 cf_new_extra_cppflags=
15697
15698 for cf_add_cflags in -g
15699 do
15700 case $cf_fix_cppflags in
15701 no)
15702         case $cf_add_cflags in #(vi
15703         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
15704                 case $cf_add_cflags in
15705                 -D*)
15706                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15707
15708                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15709                                 && test -z "${cf_tst_cflags}" \
15710                                 && cf_fix_cppflags=yes
15711
15712                         if test $cf_fix_cppflags = yes ; then
15713                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15714                                 continue
15715                         elif test "${cf_tst_cflags}" = "\"'" ; then
15716                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15717                                 continue
15718                         fi
15719                         ;;
15720                 esac
15721                 case "$CPPFLAGS" in
15722                 *$cf_add_cflags) #(vi
15723                         ;;
15724                 *) #(vi
15725                         case $cf_add_cflags in #(vi
15726                         -D*)
15727                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15728
15729 CPPFLAGS=`echo "$CPPFLAGS" | \
15730         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15731                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15732
15733                                 ;;
15734                         esac
15735                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
15736                         ;;
15737                 esac
15738                 ;;
15739         *)
15740                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
15741                 ;;
15742         esac
15743         ;;
15744 yes)
15745         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15746
15747         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15748
15749         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15750                 && test -z "${cf_tst_cflags}" \
15751                 && cf_fix_cppflags=no
15752         ;;
15753 esac
15754 done
15755
15756 if test -n "$cf_new_cflags" ; then
15757
15758         CFLAGS="$CFLAGS $cf_new_cflags"
15759 fi
15760
15761 if test -n "$cf_new_cppflags" ; then
15762
15763         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
15764 fi
15765
15766 if test -n "$cf_new_extra_cppflags" ; then
15767
15768         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
15769 fi
15770
15771                 ;;
15772         esac
15773         ;;
15774 esac
15775
15776 echo "$as_me:15776: checking if you want to perform memory-leak testing" >&5
15777 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
15778
15779 # Check whether --enable-leaks or --disable-leaks was given.
15780 if test "${enable_leaks+set}" = set; then
15781   enableval="$enable_leaks"
15782   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
15783 else
15784   : ${with_no_leaks:=no}
15785 fi;
15786 echo "$as_me:15786: result: $with_no_leaks" >&5
15787 echo "${ECHO_T}$with_no_leaks" >&6
15788
15789 if test "$with_no_leaks" = yes ; then
15790
15791 cat >>confdefs.h <<\EOF
15792 #define NO_LEAKS 1
15793 EOF
15794
15795 cat >>confdefs.h <<\EOF
15796 #define YY_NO_LEAKS 1
15797 EOF
15798
15799 fi
15800
15801 LD_RPATH_OPT=
15802 echo "$as_me:15802: checking for an rpath option" >&5
15803 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
15804 case $cf_cv_system_name in #(vi
15805 irix*) #(vi
15806         if test "$GCC" = yes; then
15807                 LD_RPATH_OPT="-Wl,-rpath,"
15808         else
15809                 LD_RPATH_OPT="-rpath "
15810         fi
15811         ;;
15812 linux*|gnu*|k*bsd*-gnu) #(vi
15813         LD_RPATH_OPT="-Wl,-rpath,"
15814         ;;
15815 openbsd[2-9].*|mirbsd*) #(vi
15816         LD_RPATH_OPT="-Wl,-rpath,"
15817         ;;
15818 dragonfly*|freebsd*) #(vi
15819         LD_RPATH_OPT="-rpath "
15820         ;;
15821 netbsd*) #(vi
15822         LD_RPATH_OPT="-Wl,-rpath,"
15823         ;;
15824 osf*|mls+*) #(vi
15825         LD_RPATH_OPT="-rpath "
15826         ;;
15827 solaris2*) #(vi
15828         LD_RPATH_OPT="-R"
15829         ;;
15830 *)
15831         ;;
15832 esac
15833 echo "$as_me:15833: result: $LD_RPATH_OPT" >&5
15834 echo "${ECHO_T}$LD_RPATH_OPT" >&6
15835
15836 case "x$LD_RPATH_OPT" in #(vi
15837 x-R*)
15838         echo "$as_me:15838: checking if we need a space after rpath option" >&5
15839 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
15840         cf_save_LIBS="$LIBS"
15841         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
15842         cat >conftest.$ac_ext <<_ACEOF
15843 #line 15843 "configure"
15844 #include "confdefs.h"
15845
15846 int
15847 main ()
15848 {
15849
15850   ;
15851   return 0;
15852 }
15853 _ACEOF
15854 rm -f conftest.$ac_objext conftest$ac_exeext
15855 if { (eval echo "$as_me:15855: \"$ac_link\"") >&5
15856   (eval $ac_link) 2>&5
15857   ac_status=$?
15858   echo "$as_me:15858: \$? = $ac_status" >&5
15859   (exit $ac_status); } &&
15860          { ac_try='test -s conftest$ac_exeext'
15861   { (eval echo "$as_me:15861: \"$ac_try\"") >&5
15862   (eval $ac_try) 2>&5
15863   ac_status=$?
15864   echo "$as_me:15864: \$? = $ac_status" >&5
15865   (exit $ac_status); }; }; then
15866   cf_rpath_space=no
15867 else
15868   echo "$as_me: failed program was:" >&5
15869 cat conftest.$ac_ext >&5
15870 cf_rpath_space=yes
15871 fi
15872 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15873         LIBS="$cf_save_LIBS"
15874         echo "$as_me:15874: result: $cf_rpath_space" >&5
15875 echo "${ECHO_T}$cf_rpath_space" >&6
15876         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
15877         ;;
15878 esac
15879
15880 echo "$as_me:15880: checking if rpath-hack should be disabled" >&5
15881 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
15882
15883 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
15884 if test "${enable_rpath_hack+set}" = set; then
15885   enableval="$enable_rpath_hack"
15886   test "$enableval" != no && enableval=yes
15887   if test "$enableval" != "yes" ; then
15888     cf_disable_rpath_hack=yes
15889   else
15890     cf_disable_rpath_hack=no
15891   fi
15892 else
15893   enableval=yes
15894   cf_disable_rpath_hack=no
15895
15896 fi;
15897 echo "$as_me:15897: result: $cf_disable_rpath_hack" >&5
15898 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
15899 if test "$cf_disable_rpath_hack" = no ; then
15900
15901 echo "$as_me:15901: checking for updated LDFLAGS" >&5
15902 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
15903 if test -n "$LD_RPATH_OPT" ; then
15904         echo "$as_me:15904: result: maybe" >&5
15905 echo "${ECHO_T}maybe" >&6
15906
15907         for ac_prog in ldd
15908 do
15909   # Extract the first word of "$ac_prog", so it can be a program name with args.
15910 set dummy $ac_prog; ac_word=$2
15911 echo "$as_me:15911: checking for $ac_word" >&5
15912 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15913 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
15914   echo $ECHO_N "(cached) $ECHO_C" >&6
15915 else
15916   if test -n "$cf_ldd_prog"; then
15917   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
15918 else
15919   ac_save_IFS=$IFS; IFS=$ac_path_separator
15920 ac_dummy="$PATH"
15921 for ac_dir in $ac_dummy; do
15922   IFS=$ac_save_IFS
15923   test -z "$ac_dir" && ac_dir=.
15924   $as_executable_p "$ac_dir/$ac_word" || continue
15925 ac_cv_prog_cf_ldd_prog="$ac_prog"
15926 echo "$as_me:15926: found $ac_dir/$ac_word" >&5
15927 break
15928 done
15929
15930 fi
15931 fi
15932 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
15933 if test -n "$cf_ldd_prog"; then
15934   echo "$as_me:15934: result: $cf_ldd_prog" >&5
15935 echo "${ECHO_T}$cf_ldd_prog" >&6
15936 else
15937   echo "$as_me:15937: result: no" >&5
15938 echo "${ECHO_T}no" >&6
15939 fi
15940
15941   test -n "$cf_ldd_prog" && break
15942 done
15943 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
15944
15945         cf_rpath_list="/usr/lib /lib"
15946         if test "$cf_ldd_prog" != no
15947         then
15948                 cf_rpath_oops=
15949
15950 cat >conftest.$ac_ext <<_ACEOF
15951 #line 15951 "configure"
15952 #include "confdefs.h"
15953 #include <stdio.h>
15954 int
15955 main ()
15956 {
15957 printf("Hello");
15958   ;
15959   return 0;
15960 }
15961 _ACEOF
15962 rm -f conftest.$ac_objext conftest$ac_exeext
15963 if { (eval echo "$as_me:15963: \"$ac_link\"") >&5
15964   (eval $ac_link) 2>&5
15965   ac_status=$?
15966   echo "$as_me:15966: \$? = $ac_status" >&5
15967   (exit $ac_status); } &&
15968          { ac_try='test -s conftest$ac_exeext'
15969   { (eval echo "$as_me:15969: \"$ac_try\"") >&5
15970   (eval $ac_try) 2>&5
15971   ac_status=$?
15972   echo "$as_me:15972: \$? = $ac_status" >&5
15973   (exit $ac_status); }; }; then
15974   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
15975                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
15976 else
15977   echo "$as_me: failed program was:" >&5
15978 cat conftest.$ac_ext >&5
15979 fi
15980 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15981
15982                 # If we passed the link-test, but get a "not found" on a given library,
15983                 # this could be due to inept reconfiguration of gcc to make it only
15984                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
15985                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
15986                 # /usr/local libraries.
15987                 if test -n "$cf_rpath_oops"
15988                 then
15989                         for cf_rpath_src in $cf_rpath_oops
15990                         do
15991                                 for cf_rpath_dir in \
15992                                         /usr/local \
15993                                         /usr/pkg \
15994                                         /opt/sfw
15995                                 do
15996                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
15997                                         then
15998                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
15999
16000 echo "${as_me:-configure}:16000: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
16001
16002                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
16003                                                 break
16004                                         fi
16005                                 done
16006                         done
16007                 fi
16008         fi
16009
16010         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16011
16012 echo "${as_me:-configure}:16012: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16013
16014 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
16015
16016 echo "${as_me:-configure}:16016: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
16017
16018 cf_rpath_dst=
16019 for cf_rpath_src in $LDFLAGS
16020 do
16021         case $cf_rpath_src in #(vi
16022         -L*) #(vi
16023
16024                 # check if this refers to a directory which we will ignore
16025                 cf_rpath_skip=no
16026                 if test -n "$cf_rpath_list"
16027                 then
16028                         for cf_rpath_item in $cf_rpath_list
16029                         do
16030                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16031                                 then
16032                                         cf_rpath_skip=yes
16033                                         break
16034                                 fi
16035                         done
16036                 fi
16037
16038                 if test "$cf_rpath_skip" = no
16039                 then
16040                         # transform the option
16041                         if test "$LD_RPATH_OPT" = "-R " ; then
16042                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16043                         else
16044                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16045                         fi
16046
16047                         # if we have not already added this, add it now
16048                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16049                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16050                         then
16051                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16052
16053 echo "${as_me:-configure}:16053: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16054
16055                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16056                         fi
16057                 fi
16058                 ;;
16059         esac
16060         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16061 done
16062 LDFLAGS=$cf_rpath_dst
16063
16064 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
16065
16066 echo "${as_me:-configure}:16066: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
16067
16068 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
16069
16070 echo "${as_me:-configure}:16070: testing ...checking LIBS $LIBS ..." 1>&5
16071
16072 cf_rpath_dst=
16073 for cf_rpath_src in $LIBS
16074 do
16075         case $cf_rpath_src in #(vi
16076         -L*) #(vi
16077
16078                 # check if this refers to a directory which we will ignore
16079                 cf_rpath_skip=no
16080                 if test -n "$cf_rpath_list"
16081                 then
16082                         for cf_rpath_item in $cf_rpath_list
16083                         do
16084                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16085                                 then
16086                                         cf_rpath_skip=yes
16087                                         break
16088                                 fi
16089                         done
16090                 fi
16091
16092                 if test "$cf_rpath_skip" = no
16093                 then
16094                         # transform the option
16095                         if test "$LD_RPATH_OPT" = "-R " ; then
16096                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16097                         else
16098                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16099                         fi
16100
16101                         # if we have not already added this, add it now
16102                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16103                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16104                         then
16105                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16106
16107 echo "${as_me:-configure}:16107: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16108
16109                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16110                         fi
16111                 fi
16112                 ;;
16113         esac
16114         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16115 done
16116 LIBS=$cf_rpath_dst
16117
16118 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
16119
16120 echo "${as_me:-configure}:16120: testing ...checked LIBS $LIBS ..." 1>&5
16121
16122         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16123
16124 echo "${as_me:-configure}:16124: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16125
16126 else
16127         echo "$as_me:16127: result: no" >&5
16128 echo "${ECHO_T}no" >&6
16129 fi
16130
16131 fi
16132
16133 TEST_ARGS="$LIBS"
16134 LIBS=
16135
16136 ac_config_files="$ac_config_files Makefile"
16137 ac_config_commands="$ac_config_commands default"
16138 cat >confcache <<\_ACEOF
16139 # This file is a shell script that caches the results of configure
16140 # tests run on this system so they can be shared between configure
16141 # scripts and configure runs, see configure's option --config-cache.
16142 # It is not useful on other systems.  If it contains results you don't
16143 # want to keep, you may remove or edit it.
16144 #
16145 # config.status only pays attention to the cache file if you give it
16146 # the --recheck option to rerun configure.
16147 #
16148 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16149 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16150 # following values.
16151
16152 _ACEOF
16153
16154 # The following way of writing the cache mishandles newlines in values,
16155 # but we know of no workaround that is simple, portable, and efficient.
16156 # So, don't put newlines in cache variables' values.
16157 # Ultrix sh set writes to stderr and can't be redirected directly,
16158 # and sets the high bit in the cache file unless we assign to the vars.
16159 {
16160   (set) 2>&1 |
16161     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16162     *ac_space=\ *)
16163       # `set' does not quote correctly, so add quotes (double-quote
16164       # substitution turns \\\\ into \\, and sed turns \\ into \).
16165       sed -n \
16166         "s/'/'\\\\''/g;
16167           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16168       ;;
16169     *)
16170       # `set' quotes correctly as required by POSIX, so do not add quotes.
16171       sed -n \
16172         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16173       ;;
16174     esac;
16175 } |
16176   sed '
16177      t clear
16178      : clear
16179      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16180      t end
16181      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16182      : end' >>confcache
16183 if cmp -s $cache_file confcache; then :; else
16184   if test -w $cache_file; then
16185     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16186     cat confcache >$cache_file
16187   else
16188     echo "not updating unwritable cache $cache_file"
16189   fi
16190 fi
16191 rm -f confcache
16192
16193 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16194 # Let make expand exec_prefix.
16195 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16196
16197 # VPATH may cause trouble with some makes, so we remove $(srcdir),
16198 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
16199 # trailing colons and then remove the whole line if VPATH becomes empty
16200 # (actually we leave an empty line to preserve line numbers).
16201 if test "x$srcdir" = x.; then
16202   ac_vpsub='/^[         ]*VPATH[        ]*=/{
16203 s/:*\$(srcdir):*/:/;
16204 s/:*\${srcdir}:*/:/;
16205 s/:*@srcdir@:*/:/;
16206 s/^\([^=]*=[    ]*\):*/\1/;
16207 s/:*$//;
16208 s/^[^=]*=[      ]*$//;
16209 }'
16210 fi
16211
16212 DEFS=-DHAVE_CONFIG_H
16213
16214 : ${CONFIG_STATUS=./config.status}
16215 ac_clean_files_save=$ac_clean_files
16216 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16217 { echo "$as_me:16217: creating $CONFIG_STATUS" >&5
16218 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16219 cat >$CONFIG_STATUS <<_ACEOF
16220 #! $SHELL
16221 # Generated automatically by configure.
16222 # Run this file to recreate the current configuration.
16223 # Compiler output produced by configure, useful for debugging
16224 # configure, is in config.log if it exists.
16225
16226 debug=false
16227 SHELL=\${CONFIG_SHELL-$SHELL}
16228 ac_cs_invocation="\$0 \$@"
16229
16230 _ACEOF
16231
16232 cat >>$CONFIG_STATUS <<\_ACEOF
16233 # Be Bourne compatible
16234 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16235   emulate sh
16236   NULLCMD=:
16237 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16238   set -o posix
16239 fi
16240
16241 # Name of the executable.
16242 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16243
16244 if expr a : '\(a\)' >/dev/null 2>&1; then
16245   as_expr=expr
16246 else
16247   as_expr=false
16248 fi
16249
16250 rm -f conf$$ conf$$.exe conf$$.file
16251 echo >conf$$.file
16252 if ln -s conf$$.file conf$$ 2>/dev/null; then
16253   # We could just check for DJGPP; but this test a) works b) is more generic
16254   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16255   if test -f conf$$.exe; then
16256     # Don't use ln at all; we don't have any links
16257     as_ln_s='cp -p'
16258   else
16259     as_ln_s='ln -s'
16260   fi
16261 elif ln conf$$.file conf$$ 2>/dev/null; then
16262   as_ln_s=ln
16263 else
16264   as_ln_s='cp -p'
16265 fi
16266 rm -f conf$$ conf$$.exe conf$$.file
16267
16268 as_executable_p="test -f"
16269
16270 # Support unset when possible.
16271 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16272   as_unset=unset
16273 else
16274   as_unset=false
16275 fi
16276
16277 # NLS nuisances.
16278 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16279 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16280 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16281 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16282 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16283 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16284 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16285 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16286
16287 # IFS
16288 # We need space, tab and new line, in precisely that order.
16289 as_nl='
16290 '
16291 IFS="   $as_nl"
16292
16293 # CDPATH.
16294 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16295
16296 exec 6>&1
16297
16298 _ACEOF
16299
16300 # Files that config.status was made for.
16301 if test -n "$ac_config_files"; then
16302   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16303 fi
16304
16305 if test -n "$ac_config_headers"; then
16306   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16307 fi
16308
16309 if test -n "$ac_config_links"; then
16310   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16311 fi
16312
16313 if test -n "$ac_config_commands"; then
16314   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16315 fi
16316
16317 cat >>$CONFIG_STATUS <<\EOF
16318
16319 ac_cs_usage="\
16320 \`$as_me' instantiates files from templates according to the
16321 current configuration.
16322
16323 Usage: $0 [OPTIONS] [FILE]...
16324
16325   -h, --help       print this help, then exit
16326   -V, --version    print version number, then exit
16327   -d, --debug      don't remove temporary files
16328       --recheck    update $as_me by reconfiguring in the same conditions
16329   --file=FILE[:TEMPLATE]
16330                    instantiate the configuration file FILE
16331   --header=FILE[:TEMPLATE]
16332                    instantiate the configuration header FILE
16333
16334 Configuration files:
16335 $config_files
16336
16337 Configuration headers:
16338 $config_headers
16339
16340 Configuration commands:
16341 $config_commands
16342
16343 Report bugs to <dickey@invisible-island.net>."
16344 EOF
16345
16346 cat >>$CONFIG_STATUS <<EOF
16347 ac_cs_version="\\
16348 config.status
16349 configured by $0, generated by GNU Autoconf 2.52.20121002,
16350   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16351
16352 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16353 Free Software Foundation, Inc.
16354 This config.status script is free software; the Free Software Foundation
16355 gives unlimited permission to copy, distribute and modify it."
16356 srcdir=$srcdir
16357 INSTALL="$INSTALL"
16358 EOF
16359
16360 cat >>$CONFIG_STATUS <<\EOF
16361 # If no file are specified by the user, then we need to provide default
16362 # value.  By we need to know if files were specified by the user.
16363 ac_need_defaults=:
16364 while test $# != 0
16365 do
16366   case $1 in
16367   --*=*)
16368     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16369     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16370     shift
16371     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16372     shift
16373     ;;
16374   -*);;
16375   *) # This is not an option, so the user has probably given explicit
16376      # arguments.
16377      ac_need_defaults=false;;
16378   esac
16379
16380   case $1 in
16381   # Handling of the options.
16382 EOF
16383 cat >>$CONFIG_STATUS <<EOF
16384   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16385     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16386     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16387 EOF
16388 cat >>$CONFIG_STATUS <<\EOF
16389   --version | --vers* | -V )
16390     echo "$ac_cs_version"; exit 0 ;;
16391   --he | --h)
16392     # Conflict between --help and --header
16393     { { echo "$as_me:16393: error: ambiguous option: $1
16394 Try \`$0 --help' for more information." >&5
16395 echo "$as_me: error: ambiguous option: $1
16396 Try \`$0 --help' for more information." >&2;}
16397    { (exit 1); exit 1; }; };;
16398   --help | --hel | -h )
16399     echo "$ac_cs_usage"; exit 0 ;;
16400   --debug | --d* | -d )
16401     debug=: ;;
16402   --file | --fil | --fi | --f )
16403     shift
16404     CONFIG_FILES="$CONFIG_FILES $1"
16405     ac_need_defaults=false;;
16406   --header | --heade | --head | --hea )
16407     shift
16408     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16409     ac_need_defaults=false;;
16410
16411   # This is an error.
16412   -*) { { echo "$as_me:16412: error: unrecognized option: $1
16413 Try \`$0 --help' for more information." >&5
16414 echo "$as_me: error: unrecognized option: $1
16415 Try \`$0 --help' for more information." >&2;}
16416    { (exit 1); exit 1; }; } ;;
16417
16418   *) ac_config_targets="$ac_config_targets $1" ;;
16419
16420   esac
16421   shift
16422 done
16423
16424 exec 5>>config.log
16425 cat >&5 << _ACEOF
16426
16427 ## ----------------------- ##
16428 ## Running config.status.  ##
16429 ## ----------------------- ##
16430
16431 This file was extended by $as_me 2.52.20121002, executed with
16432   CONFIG_FILES    = $CONFIG_FILES
16433   CONFIG_HEADERS  = $CONFIG_HEADERS
16434   CONFIG_LINKS    = $CONFIG_LINKS
16435   CONFIG_COMMANDS = $CONFIG_COMMANDS
16436   > $ac_cs_invocation
16437 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16438
16439 _ACEOF
16440 EOF
16441
16442 cat >>$CONFIG_STATUS <<EOF
16443 #
16444 # INIT-COMMANDS section.
16445 #
16446
16447 AWK="$AWK"
16448 ECHO_CC="$ECHO_CC"
16449 ECHO_LD="$ECHO_LD"
16450 SHOW_CC="$SHOW_LD"
16451
16452 EOF
16453
16454 cat >>$CONFIG_STATUS <<\EOF
16455 for ac_config_target in $ac_config_targets
16456 do
16457   case "$ac_config_target" in
16458   # Handling of arguments.
16459   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16460   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16461   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
16462   *) { { echo "$as_me:16462: error: invalid argument: $ac_config_target" >&5
16463 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16464    { (exit 1); exit 1; }; };;
16465   esac
16466 done
16467
16468 # If the user did not use the arguments to specify the items to instantiate,
16469 # then the envvar interface is used.  Set only those that are not.
16470 # We use the long form for the default assignment because of an extremely
16471 # bizarre bug on SunOS 4.1.3.
16472 if $ac_need_defaults; then
16473   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16474   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16475   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16476 fi
16477
16478 # Create a temporary directory, and hook for its removal unless debugging.
16479 $debug ||
16480 {
16481   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16482   trap '{ (exit 1); exit 1; }' 1 2 13 15
16483 }
16484
16485 # Create a (secure) tmp directory for tmp files.
16486 : ${TMPDIR=/tmp}
16487 {
16488   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16489   test -n "$tmp" && test -d "$tmp"
16490 }  ||
16491 {
16492   tmp=$TMPDIR/cs$$-$RANDOM
16493   (umask 077 && mkdir $tmp)
16494 } ||
16495 {
16496    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16497    { (exit 1); exit 1; }
16498 }
16499
16500 EOF
16501
16502 cat >>$CONFIG_STATUS <<EOF
16503
16504 #
16505 # CONFIG_FILES section.
16506 #
16507
16508 # No need to generate the scripts if there are no CONFIG_FILES.
16509 # This happens for instance when ./config.status config.h
16510 if test -n "\$CONFIG_FILES"; then
16511   # Protect against being on the right side of a sed subst in config.status.
16512   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
16513    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
16514 s,@SHELL@,$SHELL,;t t
16515 s,@exec_prefix@,$exec_prefix,;t t
16516 s,@prefix@,$prefix,;t t
16517 s,@program_transform_name@,$program_transform_name,;t t
16518 s,@bindir@,$bindir,;t t
16519 s,@sbindir@,$sbindir,;t t
16520 s,@libexecdir@,$libexecdir,;t t
16521 s,@datarootdir@,$datarootdir,;t t
16522 s,@datadir@,$datadir,;t t
16523 s,@sysconfdir@,$sysconfdir,;t t
16524 s,@sharedstatedir@,$sharedstatedir,;t t
16525 s,@localstatedir@,$localstatedir,;t t
16526 s,@libdir@,$libdir,;t t
16527 s,@includedir@,$includedir,;t t
16528 s,@oldincludedir@,$oldincludedir,;t t
16529 s,@infodir@,$infodir,;t t
16530 s,@mandir@,$mandir,;t t
16531 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
16532 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
16533 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
16534 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
16535 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
16536 s,@build_alias@,$build_alias,;t t
16537 s,@host_alias@,$host_alias,;t t
16538 s,@target_alias@,$target_alias,;t t
16539 s,@ECHO_C@,$ECHO_C,;t t
16540 s,@ECHO_N@,$ECHO_N,;t t
16541 s,@ECHO_T@,$ECHO_T,;t t
16542 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
16543 s,@DEFS@,$DEFS,;t t
16544 s,@LIBS@,$LIBS,;t t
16545 s,@build@,$build,;t t
16546 s,@build_cpu@,$build_cpu,;t t
16547 s,@build_vendor@,$build_vendor,;t t
16548 s,@build_os@,$build_os,;t t
16549 s,@host@,$host,;t t
16550 s,@host_cpu@,$host_cpu,;t t
16551 s,@host_vendor@,$host_vendor,;t t
16552 s,@host_os@,$host_os,;t t
16553 s,@SET_MAKE@,$SET_MAKE,;t t
16554 s,@CC@,$CC,;t t
16555 s,@CFLAGS@,$CFLAGS,;t t
16556 s,@LDFLAGS@,$LDFLAGS,;t t
16557 s,@CPPFLAGS@,$CPPFLAGS,;t t
16558 s,@ac_ct_CC@,$ac_ct_CC,;t t
16559 s,@EXEEXT@,$EXEEXT,;t t
16560 s,@OBJEXT@,$OBJEXT,;t t
16561 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
16562 s,@CPP@,$CPP,;t t
16563 s,@AWK@,$AWK,;t t
16564 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
16565 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
16566 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
16567 s,@LINT@,$LINT,;t t
16568 s,@LINT_OPTS@,$LINT_OPTS,;t t
16569 s,@CTAGS@,$CTAGS,;t t
16570 s,@ETAGS@,$ETAGS,;t t
16571 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
16572 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
16573 s,@MATH_LIB@,$MATH_LIB,;t t
16574 s,@top_builddir@,$top_builddir,;t t
16575 s,@CC_G_OPT@,$CC_G_OPT,;t t
16576 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
16577 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
16578 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
16579 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
16580 s,@LD@,$LD,;t t
16581 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
16582 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
16583 s,@LD_MODEL@,$LD_MODEL,;t t
16584 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
16585 s,@LIBTOOL@,$LIBTOOL,;t t
16586 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
16587 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
16588 s,@LIB_LINK@,$LIB_LINK,;t t
16589 s,@LINK_TESTS@,$LINK_TESTS,;t t
16590 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
16591 s,@PTHREAD@,$PTHREAD,;t t
16592 s,@TEST_ARGS@,$TEST_ARGS,;t t
16593 s,@TEST_DEPS@,$TEST_DEPS,;t t
16594 s,@TEST_LIBS@,$TEST_LIBS,;t t
16595 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
16596 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
16597 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
16598 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
16599 s,@includesubdir@,$includesubdir,;t t
16600 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
16601 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
16602 s,@ECHO_LT@,$ECHO_LT,;t t
16603 s,@ECHO_LD@,$ECHO_LD,;t t
16604 s,@RULE_CC@,$RULE_CC,;t t
16605 s,@SHOW_CC@,$SHOW_CC,;t t
16606 s,@ECHO_CC@,$ECHO_CC,;t t
16607 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
16608 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
16609 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
16610 s,@X_CFLAGS@,$X_CFLAGS,;t t
16611 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
16612 s,@X_LIBS@,$X_LIBS,;t t
16613 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
16614 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
16615 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
16616 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
16617 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
16618 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
16619 CEOF
16620
16621 EOF
16622
16623   cat >>$CONFIG_STATUS <<\EOF
16624   # Split the substitutions into bite-sized pieces for seds with
16625   # small command number limits, like on Digital OSF/1 and HP-UX.
16626   ac_max_sed_lines=48
16627   ac_sed_frag=1 # Number of current file.
16628   ac_beg=1 # First line for current file.
16629   ac_end=$ac_max_sed_lines # Line after last line for current file.
16630   ac_more_lines=:
16631   ac_sed_cmds=
16632   while $ac_more_lines; do
16633     if test $ac_beg -gt 1; then
16634       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16635     else
16636       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16637     fi
16638     if test ! -s $tmp/subs.frag; then
16639       ac_more_lines=false
16640     else
16641       # The purpose of the label and of the branching condition is to
16642       # speed up the sed processing (if there are no `@' at all, there
16643       # is no need to browse any of the substitutions).
16644       # These are the two extra sed commands mentioned above.
16645       (echo ':t
16646   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
16647       if test -z "$ac_sed_cmds"; then
16648         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
16649       else
16650         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
16651       fi
16652       ac_sed_frag=`expr $ac_sed_frag + 1`
16653       ac_beg=$ac_end
16654       ac_end=`expr $ac_end + $ac_max_sed_lines`
16655     fi
16656   done
16657   if test -z "$ac_sed_cmds"; then
16658     ac_sed_cmds=cat
16659   fi
16660 fi # test -n "$CONFIG_FILES"
16661
16662 EOF
16663 cat >>$CONFIG_STATUS <<\EOF
16664 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
16665   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16666   case $ac_file in
16667   - | *:- | *:-:* ) # input from stdin
16668         cat >$tmp/stdin
16669         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16670         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16671   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16672         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16673   * )   ac_file_in=$ac_file.in ;;
16674   esac
16675
16676   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
16677   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16678          X"$ac_file" : 'X\(//\)[^/]' \| \
16679          X"$ac_file" : 'X\(//\)$' \| \
16680          X"$ac_file" : 'X\(/\)' \| \
16681          .     : '\(.\)' 2>/dev/null ||
16682 echo X"$ac_file" |
16683     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16684           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16685           /^X\(\/\/\)$/{ s//\1/; q; }
16686           /^X\(\/\).*/{ s//\1/; q; }
16687           s/.*/./; q'`
16688   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16689     { case "$ac_dir" in
16690   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16691   *)                      as_incr_dir=.;;
16692 esac
16693 as_dummy="$ac_dir"
16694 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16695   case $as_mkdir_dir in
16696     # Skip DOS drivespec
16697     ?:) as_incr_dir=$as_mkdir_dir ;;
16698     *)
16699       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16700       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16701     ;;
16702   esac
16703 done; }
16704
16705     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
16706     # A "../" for each directory in $ac_dir_suffix.
16707     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
16708   else
16709     ac_dir_suffix= ac_dots=
16710   fi
16711
16712   case $srcdir in
16713   .)  ac_srcdir=.
16714       if test -z "$ac_dots"; then
16715          ac_top_srcdir=.
16716       else
16717          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
16718       fi ;;
16719   [\\/]* | ?:[\\/]* )
16720       ac_srcdir=$srcdir$ac_dir_suffix;
16721       ac_top_srcdir=$srcdir ;;
16722   *) # Relative path.
16723     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
16724     ac_top_srcdir=$ac_dots$srcdir ;;
16725   esac
16726
16727   case $INSTALL in
16728   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
16729   *) ac_INSTALL=$ac_dots$INSTALL ;;
16730   esac
16731
16732   if test x"$ac_file" != x-; then
16733     { echo "$as_me:16733: creating $ac_file" >&5
16734 echo "$as_me: creating $ac_file" >&6;}
16735     rm -f "$ac_file"
16736   fi
16737   # Let's still pretend it is `configure' which instantiates (i.e., don't
16738   # use $as_me), people would be surprised to read:
16739   #    /* config.h.  Generated automatically by config.status.  */
16740   configure_input="Generated automatically from `echo $ac_file_in |
16741                                                  sed 's,.*/,,'` by configure."
16742
16743   # First look for the input files in the build tree, otherwise in the
16744   # src tree.
16745   ac_file_inputs=`IFS=:
16746     for f in $ac_file_in; do
16747       case $f in
16748       -) echo $tmp/stdin ;;
16749       [\\/$]*)
16750          # Absolute (can't be DOS-style, as IFS=:)
16751          test -f "$f" || { { echo "$as_me:16751: error: cannot find input file: $f" >&5
16752 echo "$as_me: error: cannot find input file: $f" >&2;}
16753    { (exit 1); exit 1; }; }
16754          echo $f;;
16755       *) # Relative
16756          if test -f "$f"; then
16757            # Build tree
16758            echo $f
16759          elif test -f "$srcdir/$f"; then
16760            # Source tree
16761            echo $srcdir/$f
16762          else
16763            # /dev/null tree
16764            { { echo "$as_me:16764: error: cannot find input file: $f" >&5
16765 echo "$as_me: error: cannot find input file: $f" >&2;}
16766    { (exit 1); exit 1; }; }
16767          fi;;
16768       esac
16769     done` || { (exit 1); exit 1; }
16770 EOF
16771 cat >>$CONFIG_STATUS <<\EOF
16772   ac_warn_datarootdir=no
16773   if test x"$ac_file" != x-; then
16774     for ac_item in $ac_file_inputs
16775     do
16776       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
16777       if test -n "$ac_seen"; then
16778         ac_used=`grep '@datarootdir@' $ac_item`
16779         if test -z "$ac_used"; then
16780           { echo "$as_me:16780: WARNING: datarootdir was used implicitly but not set:
16781 $ac_seen" >&5
16782 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
16783 $ac_seen" >&2;}
16784           ac_warn_datarootdir=yes
16785         fi
16786       fi
16787       ac_seen=`grep '${datarootdir}' $ac_item`
16788       if test -n "$ac_seen"; then
16789         { echo "$as_me:16789: WARNING: datarootdir was used explicitly but not set:
16790 $ac_seen" >&5
16791 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
16792 $ac_seen" >&2;}
16793         ac_warn_datarootdir=yes
16794       fi
16795     done
16796   fi
16797
16798 if test "x$ac_warn_datarootdir" = xyes; then
16799   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
16800 fi
16801
16802 EOF
16803 cat >>$CONFIG_STATUS <<EOF
16804   sed "$ac_vpsub
16805 $extrasub
16806 EOF
16807 cat >>$CONFIG_STATUS <<\EOF
16808 :t
16809 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
16810 s,@configure_input@,$configure_input,;t t
16811 s,@srcdir@,$ac_srcdir,;t t
16812 s,@top_srcdir@,$ac_top_srcdir,;t t
16813 s,@INSTALL@,$ac_INSTALL,;t t
16814 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
16815   rm -f $tmp/stdin
16816   if test x"$ac_file" != x-; then
16817     cp $tmp/out $ac_file
16818
16819     for ac_name in prefix exec_prefix datarootdir
16820     do
16821         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
16822         if test -n "$ac_seen"; then
16823             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
16824             if test -z "$ac_init"; then
16825               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
16826               { echo "$as_me:16826: WARNING: Variable $ac_name is used but was not set:
16827 $ac_seen" >&5
16828 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
16829 $ac_seen" >&2;}
16830             fi
16831         fi
16832     done
16833     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
16834     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
16835     if test -s $tmp/out; then
16836       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
16837       { echo "$as_me:16837: WARNING: Some variables may not be substituted:
16838 $ac_seen" >&5
16839 echo "$as_me: WARNING: Some variables may not be substituted:
16840 $ac_seen" >&2;}
16841     fi
16842   else
16843     cat $tmp/out
16844   fi
16845   rm -f $tmp/out
16846
16847 done
16848 EOF
16849 cat >>$CONFIG_STATUS <<\EOF
16850
16851 #
16852 # CONFIG_HEADER section.
16853 #
16854
16855 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
16856 # NAME is the cpp macro being defined and VALUE is the value it is being given.
16857 #
16858 # ac_d sets the value in "#define NAME VALUE" lines.
16859 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
16860 ac_dB='[        ].*$,\1#\2'
16861 ac_dC=' '
16862 ac_dD=',;t'
16863 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
16864 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16865 ac_iB='\([      ]\),\1#\2define\3'
16866 ac_iC=' '
16867 ac_iD='\4,;t'
16868 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16869 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16870 ac_uB='$,\1#\2define\3'
16871 ac_uC=' '
16872 ac_uD=',;t'
16873
16874 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
16875   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16876   case $ac_file in
16877   - | *:- | *:-:* ) # input from stdin
16878         cat >$tmp/stdin
16879         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16880         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16881   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16882         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16883   * )   ac_file_in=$ac_file.in ;;
16884   esac
16885
16886   test x"$ac_file" != x- && { echo "$as_me:16886: creating $ac_file" >&5
16887 echo "$as_me: creating $ac_file" >&6;}
16888
16889   # First look for the input files in the build tree, otherwise in the
16890   # src tree.
16891   ac_file_inputs=`IFS=:
16892     for f in $ac_file_in; do
16893       case $f in
16894       -) echo $tmp/stdin ;;
16895       [\\/$]*)
16896          # Absolute (can't be DOS-style, as IFS=:)
16897          test -f "$f" || { { echo "$as_me:16897: error: cannot find input file: $f" >&5
16898 echo "$as_me: error: cannot find input file: $f" >&2;}
16899    { (exit 1); exit 1; }; }
16900          echo $f;;
16901       *) # Relative
16902          if test -f "$f"; then
16903            # Build tree
16904            echo $f
16905          elif test -f "$srcdir/$f"; then
16906            # Source tree
16907            echo $srcdir/$f
16908          else
16909            # /dev/null tree
16910            { { echo "$as_me:16910: error: cannot find input file: $f" >&5
16911 echo "$as_me: error: cannot find input file: $f" >&2;}
16912    { (exit 1); exit 1; }; }
16913          fi;;
16914       esac
16915     done` || { (exit 1); exit 1; }
16916   # Remove the trailing spaces.
16917   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
16918
16919 EOF
16920
16921 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
16922 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
16923 # be either 'cat' or 'sort'.
16924 cat confdefs.h | uniq >conftest.vals
16925
16926 # Break up conftest.vals because some shells have a limit on
16927 # the size of here documents, and old seds have small limits too.
16928
16929 rm -f conftest.tail
16930 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
16931 while grep . conftest.vals >/dev/null
16932 do
16933   # Write chunks of a limited-size here document to conftest.frag.
16934   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
16935   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
16936   echo 'CEOF' >> $CONFIG_STATUS
16937   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
16938   rm -f conftest.vals
16939   mv conftest.tail conftest.vals
16940 done
16941 rm -f conftest.vals
16942
16943 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
16944 # marker @DEFS@.
16945 echo '  cat >> conftest.edit <<CEOF
16946 /@DEFS@/r conftest.frag
16947 /@DEFS@/d
16948 CEOF
16949 sed -f conftest.edit $tmp/in > $tmp/out
16950 rm -f $tmp/in
16951 mv $tmp/out $tmp/in
16952 rm -f conftest.edit conftest.frag
16953 ' >> $CONFIG_STATUS
16954
16955 cat >>$CONFIG_STATUS <<\EOF
16956   # Let's still pretend it is `configure' which instantiates (i.e., don't
16957   # use $as_me), people would be surprised to read:
16958   #    /* config.h.  Generated automatically by config.status.  */
16959   if test x"$ac_file" = x-; then
16960     echo "/* Generated automatically by configure.  */" >$tmp/config.h
16961   else
16962     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
16963   fi
16964   cat $tmp/in >>$tmp/config.h
16965   rm -f $tmp/in
16966   if test x"$ac_file" != x-; then
16967     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
16968       { echo "$as_me:16968: $ac_file is unchanged" >&5
16969 echo "$as_me: $ac_file is unchanged" >&6;}
16970     else
16971       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16972          X"$ac_file" : 'X\(//\)[^/]' \| \
16973          X"$ac_file" : 'X\(//\)$' \| \
16974          X"$ac_file" : 'X\(/\)' \| \
16975          .     : '\(.\)' 2>/dev/null ||
16976 echo X"$ac_file" |
16977     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16978           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16979           /^X\(\/\/\)$/{ s//\1/; q; }
16980           /^X\(\/\).*/{ s//\1/; q; }
16981           s/.*/./; q'`
16982       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16983         { case "$ac_dir" in
16984   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16985   *)                      as_incr_dir=.;;
16986 esac
16987 as_dummy="$ac_dir"
16988 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16989   case $as_mkdir_dir in
16990     # Skip DOS drivespec
16991     ?:) as_incr_dir=$as_mkdir_dir ;;
16992     *)
16993       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16994       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16995     ;;
16996   esac
16997 done; }
16998
16999       fi
17000       rm -f $ac_file
17001       mv $tmp/config.h $ac_file
17002     fi
17003   else
17004     cat $tmp/config.h
17005     rm -f $tmp/config.h
17006   fi
17007 done
17008 EOF
17009 cat >>$CONFIG_STATUS <<\EOF
17010 #
17011 # CONFIG_COMMANDS section.
17012 #
17013 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17014   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17015   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17016
17017   case $ac_dest in
17018     default )
17019
17020 for cf_dir in .
17021 do
17022         if test ! -d $srcdir/$cf_dir; then
17023                 continue
17024         elif test -f $srcdir/$cf_dir/programs; then
17025                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
17026         fi
17027 done
17028
17029         cat >>Makefile <<TEST_EOF
17030
17031 # These rules are generated so we do not rely on suffix rules, which do not
17032 # work consistently for different make-programs (the '\$(MODEL)/' confuses
17033 # some, and the '\$x' confuses others).
17034 TEST_EOF
17035
17036 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
17037 for N in $LIST
17038 do
17039         cat >>Makefile <<TEST_EOF
17040
17041 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
17042         \$(srcdir)/test.priv.h \\
17043         ncurses_cfg.h
17044         $SHOW_CC
17045         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
17046 TEST_EOF
17047 done
17048
17049 if test -f ../config.guess && test -f ../config.sub
17050 then
17051         cat >>Makefile <<TEST_EOF
17052
17053 # if we used CF_INHERIT for getting these files, we can remove them
17054 distclean::
17055         rm -f config.guess config.sub
17056 TEST_EOF
17057 fi
17058  ;;
17059   esac
17060 done
17061 EOF
17062
17063 cat >>$CONFIG_STATUS <<\EOF
17064
17065 { (exit 0); exit 0; }
17066 EOF
17067 chmod +x $CONFIG_STATUS
17068 ac_clean_files=$ac_clean_files_save
17069
17070 # configure is writing to config.log, and then calls config.status.
17071 # config.status does its own redirection, appending to config.log.
17072 # Unfortunately, on DOS this fails, as config.log is still kept open
17073 # by configure, so config.status won't be able to write to it; its
17074 # output is simply discarded.  So we exec the FD to /dev/null,
17075 # effectively closing config.log, so it can be properly (re)opened and
17076 # appended to by config.status.  When coming back to configure, we
17077 # need to make the FD available again.
17078 if test "$no_create" != yes; then
17079   ac_cs_success=:
17080   exec 5>/dev/null
17081   $SHELL $CONFIG_STATUS || ac_cs_success=false
17082   exec 5>>config.log
17083   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17084   # would make configure fail if this is the last instruction.
17085   $ac_cs_success || { (exit 1); exit 1; }
17086 fi
17087