]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.9 - patch 20130706
[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*|*-mingw32*|*-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
2656 cf_cv_screen=curses
2657 cf_cv_libtype=
2658
2659 if test "$GCC" = yes
2660 then
2661 cat > conftest.i <<EOF
2662 #ifndef GCC_PRINTF
2663 #define GCC_PRINTF 0
2664 #endif
2665 #ifndef GCC_SCANF
2666 #define GCC_SCANF 0
2667 #endif
2668 #ifndef GCC_NORETURN
2669 #define GCC_NORETURN /* nothing */
2670 #endif
2671 #ifndef GCC_UNUSED
2672 #define GCC_UNUSED /* nothing */
2673 #endif
2674 EOF
2675 if test "$GCC" = yes
2676 then
2677         { echo "$as_me:2677: checking for $CC __attribute__ directives..." >&5
2678 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2679 cat > conftest.$ac_ext <<EOF
2680 #line 2680 "${as_me:-configure}"
2681 #include "confdefs.h"
2682 #include "conftest.h"
2683 #include "conftest.i"
2684 #if     GCC_PRINTF
2685 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2686 #else
2687 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2688 #endif
2689 #if     GCC_SCANF
2690 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2691 #else
2692 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2693 #endif
2694 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2695 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2696 extern void foo(void) GCC_NORETURN;
2697 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2698 EOF
2699         cf_printf_attribute=no
2700         cf_scanf_attribute=no
2701         for cf_attribute in scanf printf unused noreturn
2702         do
2703
2704 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2705
2706                 cf_directive="__attribute__(($cf_attribute))"
2707                 echo "checking for $CC $cf_directive" 1>&5
2708
2709                 case $cf_attribute in #(vi
2710                 printf) #(vi
2711                         cf_printf_attribute=yes
2712                         cat >conftest.h <<EOF
2713 #define GCC_$cf_ATTRIBUTE 1
2714 EOF
2715                         ;;
2716                 scanf) #(vi
2717                         cf_scanf_attribute=yes
2718                         cat >conftest.h <<EOF
2719 #define GCC_$cf_ATTRIBUTE 1
2720 EOF
2721                         ;;
2722                 *) #(vi
2723                         cat >conftest.h <<EOF
2724 #define GCC_$cf_ATTRIBUTE $cf_directive
2725 EOF
2726                         ;;
2727                 esac
2728
2729                 if { (eval echo "$as_me:2729: \"$ac_compile\"") >&5
2730   (eval $ac_compile) 2>&5
2731   ac_status=$?
2732   echo "$as_me:2732: \$? = $ac_status" >&5
2733   (exit $ac_status); }; then
2734                         test -n "$verbose" && echo "$as_me:2734: result: ... $cf_attribute" >&5
2735 echo "${ECHO_T}... $cf_attribute" >&6
2736                         cat conftest.h >>confdefs.h
2737                         case $cf_attribute in #(vi
2738                         noreturn) #(vi
2739
2740 cat >>confdefs.h <<EOF
2741 #define GCC_NORETURN $cf_directive
2742 EOF
2743
2744                                 ;;
2745                         printf) #(vi
2746                                 cf_value='/* nothing */'
2747                                 if test "$cf_printf_attribute" != no ; then
2748                                         cf_value='__attribute__((format(printf,fmt,var)))'
2749
2750 cat >>confdefs.h <<\EOF
2751 #define GCC_PRINTF 1
2752 EOF
2753
2754                                 fi
2755
2756 cat >>confdefs.h <<EOF
2757 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2758 EOF
2759
2760                                 ;;
2761                         scanf) #(vi
2762                                 cf_value='/* nothing */'
2763                                 if test "$cf_scanf_attribute" != no ; then
2764                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2765
2766 cat >>confdefs.h <<\EOF
2767 #define GCC_SCANF 1
2768 EOF
2769
2770                                 fi
2771
2772 cat >>confdefs.h <<EOF
2773 #define GCC_SCANFLIKE(fmt,var) $cf_value
2774 EOF
2775
2776                                 ;;
2777                         unused) #(vi
2778
2779 cat >>confdefs.h <<EOF
2780 #define GCC_UNUSED $cf_directive
2781 EOF
2782
2783                                 ;;
2784                         esac
2785                 fi
2786         done
2787 else
2788         fgrep define conftest.i >>confdefs.h
2789 fi
2790 rm -rf conftest*
2791 fi
2792
2793 cf_XOPEN_SOURCE=500
2794 cf_POSIX_C_SOURCE=199506L
2795 cf_xopen_source=
2796
2797 case $host_os in #(vi
2798 aix[4-7]*) #(vi
2799         cf_xopen_source="-D_ALL_SOURCE"
2800         ;;
2801 cygwin) #(vi
2802         cf_XOPEN_SOURCE=600
2803         ;;
2804 darwin[0-8].*) #(vi
2805         cf_xopen_source="-D_APPLE_C_SOURCE"
2806         ;;
2807 darwin*) #(vi
2808         cf_xopen_source="-D_DARWIN_C_SOURCE"
2809         cf_XOPEN_SOURCE=
2810         ;;
2811 freebsd*|dragonfly*) #(vi
2812         # 5.x headers associate
2813         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2814         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2815         cf_POSIX_C_SOURCE=200112L
2816         cf_XOPEN_SOURCE=600
2817         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2818         ;;
2819 hpux11*) #(vi
2820         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2821         ;;
2822 hpux*) #(vi
2823         cf_xopen_source="-D_HPUX_SOURCE"
2824         ;;
2825 irix[56].*) #(vi
2826         cf_xopen_source="-D_SGI_SOURCE"
2827         cf_XOPEN_SOURCE=
2828         ;;
2829 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
2830
2831 echo "$as_me:2831: checking if we must define _GNU_SOURCE" >&5
2832 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2833 if test "${cf_cv_gnu_source+set}" = set; then
2834   echo $ECHO_N "(cached) $ECHO_C" >&6
2835 else
2836
2837 cat >conftest.$ac_ext <<_ACEOF
2838 #line 2838 "configure"
2839 #include "confdefs.h"
2840 #include <sys/types.h>
2841 int
2842 main ()
2843 {
2844
2845 #ifndef _XOPEN_SOURCE
2846 make an error
2847 #endif
2848   ;
2849   return 0;
2850 }
2851 _ACEOF
2852 rm -f conftest.$ac_objext
2853 if { (eval echo "$as_me:2853: \"$ac_compile\"") >&5
2854   (eval $ac_compile) 2>&5
2855   ac_status=$?
2856   echo "$as_me:2856: \$? = $ac_status" >&5
2857   (exit $ac_status); } &&
2858          { ac_try='test -s conftest.$ac_objext'
2859   { (eval echo "$as_me:2859: \"$ac_try\"") >&5
2860   (eval $ac_try) 2>&5
2861   ac_status=$?
2862   echo "$as_me:2862: \$? = $ac_status" >&5
2863   (exit $ac_status); }; }; then
2864   cf_cv_gnu_source=no
2865 else
2866   echo "$as_me: failed program was:" >&5
2867 cat conftest.$ac_ext >&5
2868 cf_save="$CPPFLAGS"
2869          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2870          cat >conftest.$ac_ext <<_ACEOF
2871 #line 2871 "configure"
2872 #include "confdefs.h"
2873 #include <sys/types.h>
2874 int
2875 main ()
2876 {
2877
2878 #ifdef _XOPEN_SOURCE
2879 make an error
2880 #endif
2881   ;
2882   return 0;
2883 }
2884 _ACEOF
2885 rm -f conftest.$ac_objext
2886 if { (eval echo "$as_me:2886: \"$ac_compile\"") >&5
2887   (eval $ac_compile) 2>&5
2888   ac_status=$?
2889   echo "$as_me:2889: \$? = $ac_status" >&5
2890   (exit $ac_status); } &&
2891          { ac_try='test -s conftest.$ac_objext'
2892   { (eval echo "$as_me:2892: \"$ac_try\"") >&5
2893   (eval $ac_try) 2>&5
2894   ac_status=$?
2895   echo "$as_me:2895: \$? = $ac_status" >&5
2896   (exit $ac_status); }; }; then
2897   cf_cv_gnu_source=no
2898 else
2899   echo "$as_me: failed program was:" >&5
2900 cat conftest.$ac_ext >&5
2901 cf_cv_gnu_source=yes
2902 fi
2903 rm -f conftest.$ac_objext conftest.$ac_ext
2904         CPPFLAGS="$cf_save"
2905
2906 fi
2907 rm -f conftest.$ac_objext conftest.$ac_ext
2908
2909 fi
2910 echo "$as_me:2910: result: $cf_cv_gnu_source" >&5
2911 echo "${ECHO_T}$cf_cv_gnu_source" >&6
2912 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2913
2914         ;;
2915 mirbsd*) #(vi
2916         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
2917         cf_XOPEN_SOURCE=
2918
2919 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2920
2921 cf_save_CFLAGS="$CFLAGS"
2922 cf_save_CPPFLAGS="$CPPFLAGS"
2923
2924 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2925         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2926                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2927
2928 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2929         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2930                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2931
2932 echo "$as_me:2932: checking if we should define _POSIX_C_SOURCE" >&5
2933 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
2934 if test "${cf_cv_posix_c_source+set}" = set; then
2935   echo $ECHO_N "(cached) $ECHO_C" >&6
2936 else
2937
2938 echo "${as_me:-configure}:2938: testing if the symbol is already defined go no further ..." 1>&5
2939
2940         cat >conftest.$ac_ext <<_ACEOF
2941 #line 2941 "configure"
2942 #include "confdefs.h"
2943 #include <sys/types.h>
2944 int
2945 main ()
2946 {
2947
2948 #ifndef _POSIX_C_SOURCE
2949 make an error
2950 #endif
2951   ;
2952   return 0;
2953 }
2954 _ACEOF
2955 rm -f conftest.$ac_objext
2956 if { (eval echo "$as_me:2956: \"$ac_compile\"") >&5
2957   (eval $ac_compile) 2>&5
2958   ac_status=$?
2959   echo "$as_me:2959: \$? = $ac_status" >&5
2960   (exit $ac_status); } &&
2961          { ac_try='test -s conftest.$ac_objext'
2962   { (eval echo "$as_me:2962: \"$ac_try\"") >&5
2963   (eval $ac_try) 2>&5
2964   ac_status=$?
2965   echo "$as_me:2965: \$? = $ac_status" >&5
2966   (exit $ac_status); }; }; then
2967   cf_cv_posix_c_source=no
2968 else
2969   echo "$as_me: failed program was:" >&5
2970 cat conftest.$ac_ext >&5
2971 cf_want_posix_source=no
2972          case .$cf_POSIX_C_SOURCE in #(vi
2973          .[12]??*) #(vi
2974                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2975                 ;;
2976          .2) #(vi
2977                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2978                 cf_want_posix_source=yes
2979                 ;;
2980          .*)
2981                 cf_want_posix_source=yes
2982                 ;;
2983          esac
2984          if test "$cf_want_posix_source" = yes ; then
2985                 cat >conftest.$ac_ext <<_ACEOF
2986 #line 2986 "configure"
2987 #include "confdefs.h"
2988 #include <sys/types.h>
2989 int
2990 main ()
2991 {
2992
2993 #ifdef _POSIX_SOURCE
2994 make an error
2995 #endif
2996   ;
2997   return 0;
2998 }
2999 _ACEOF
3000 rm -f conftest.$ac_objext
3001 if { (eval echo "$as_me:3001: \"$ac_compile\"") >&5
3002   (eval $ac_compile) 2>&5
3003   ac_status=$?
3004   echo "$as_me:3004: \$? = $ac_status" >&5
3005   (exit $ac_status); } &&
3006          { ac_try='test -s conftest.$ac_objext'
3007   { (eval echo "$as_me:3007: \"$ac_try\"") >&5
3008   (eval $ac_try) 2>&5
3009   ac_status=$?
3010   echo "$as_me:3010: \$? = $ac_status" >&5
3011   (exit $ac_status); }; }; then
3012   :
3013 else
3014   echo "$as_me: failed program was:" >&5
3015 cat conftest.$ac_ext >&5
3016 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3017 fi
3018 rm -f conftest.$ac_objext conftest.$ac_ext
3019          fi
3020
3021 echo "${as_me:-configure}:3021: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3022
3023          CFLAGS="$cf_trim_CFLAGS"
3024          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3025
3026 echo "${as_me:-configure}:3026: testing if the second compile does not leave our definition intact error ..." 1>&5
3027
3028          cat >conftest.$ac_ext <<_ACEOF
3029 #line 3029 "configure"
3030 #include "confdefs.h"
3031 #include <sys/types.h>
3032 int
3033 main ()
3034 {
3035
3036 #ifndef _POSIX_C_SOURCE
3037 make an error
3038 #endif
3039   ;
3040   return 0;
3041 }
3042 _ACEOF
3043 rm -f conftest.$ac_objext
3044 if { (eval echo "$as_me:3044: \"$ac_compile\"") >&5
3045   (eval $ac_compile) 2>&5
3046   ac_status=$?
3047   echo "$as_me:3047: \$? = $ac_status" >&5
3048   (exit $ac_status); } &&
3049          { ac_try='test -s conftest.$ac_objext'
3050   { (eval echo "$as_me:3050: \"$ac_try\"") >&5
3051   (eval $ac_try) 2>&5
3052   ac_status=$?
3053   echo "$as_me:3053: \$? = $ac_status" >&5
3054   (exit $ac_status); }; }; then
3055   :
3056 else
3057   echo "$as_me: failed program was:" >&5
3058 cat conftest.$ac_ext >&5
3059 cf_cv_posix_c_source=no
3060 fi
3061 rm -f conftest.$ac_objext conftest.$ac_ext
3062          CFLAGS="$cf_save_CFLAGS"
3063          CPPFLAGS="$cf_save_CPPFLAGS"
3064
3065 fi
3066 rm -f conftest.$ac_objext conftest.$ac_ext
3067
3068 fi
3069 echo "$as_me:3069: result: $cf_cv_posix_c_source" >&5
3070 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3071
3072 if test "$cf_cv_posix_c_source" != no ; then
3073         CFLAGS="$cf_trim_CFLAGS"
3074         CPPFLAGS="$cf_trim_CPPFLAGS"
3075
3076 cf_fix_cppflags=no
3077 cf_new_cflags=
3078 cf_new_cppflags=
3079 cf_new_extra_cppflags=
3080
3081 for cf_add_cflags in $cf_cv_posix_c_source
3082 do
3083 case $cf_fix_cppflags in
3084 no)
3085         case $cf_add_cflags in #(vi
3086         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3087                 case $cf_add_cflags in
3088                 -D*)
3089                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3090
3091                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3092                                 && test -z "${cf_tst_cflags}" \
3093                                 && cf_fix_cppflags=yes
3094
3095                         if test $cf_fix_cppflags = yes ; then
3096                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3097                                 continue
3098                         elif test "${cf_tst_cflags}" = "\"'" ; then
3099                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3100                                 continue
3101                         fi
3102                         ;;
3103                 esac
3104                 case "$CPPFLAGS" in
3105                 *$cf_add_cflags) #(vi
3106                         ;;
3107                 *) #(vi
3108                         case $cf_add_cflags in #(vi
3109                         -D*)
3110                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3111
3112 CPPFLAGS=`echo "$CPPFLAGS" | \
3113         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3114                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3115
3116                                 ;;
3117                         esac
3118                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3119                         ;;
3120                 esac
3121                 ;;
3122         *)
3123                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3124                 ;;
3125         esac
3126         ;;
3127 yes)
3128         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3129
3130         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3131
3132         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3133                 && test -z "${cf_tst_cflags}" \
3134                 && cf_fix_cppflags=no
3135         ;;
3136 esac
3137 done
3138
3139 if test -n "$cf_new_cflags" ; then
3140
3141         CFLAGS="$CFLAGS $cf_new_cflags"
3142 fi
3143
3144 if test -n "$cf_new_cppflags" ; then
3145
3146         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3147 fi
3148
3149 if test -n "$cf_new_extra_cppflags" ; then
3150
3151         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3152 fi
3153
3154 fi
3155
3156         ;;
3157 netbsd*) #(vi
3158         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3159         ;;
3160 openbsd[4-9]*) #(vi
3161         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3162         cf_xopen_source="-D_BSD_SOURCE"
3163         cf_XOPEN_SOURCE=600
3164         ;;
3165 openbsd*) #(vi
3166         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3167         ;;
3168 osf[45]*) #(vi
3169         cf_xopen_source="-D_OSF_SOURCE"
3170         ;;
3171 nto-qnx*) #(vi
3172         cf_xopen_source="-D_QNX_SOURCE"
3173         ;;
3174 sco*) #(vi
3175         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3176         ;;
3177 solaris2.*) #(vi
3178         cf_xopen_source="-D__EXTENSIONS__"
3179         ;;
3180 *)
3181
3182 echo "$as_me:3182: checking if we should define _XOPEN_SOURCE" >&5
3183 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3184 if test "${cf_cv_xopen_source+set}" = set; then
3185   echo $ECHO_N "(cached) $ECHO_C" >&6
3186 else
3187
3188         cat >conftest.$ac_ext <<_ACEOF
3189 #line 3189 "configure"
3190 #include "confdefs.h"
3191
3192 #include <stdlib.h>
3193 #include <string.h>
3194 #include <sys/types.h>
3195
3196 int
3197 main ()
3198 {
3199
3200 #ifndef _XOPEN_SOURCE
3201 make an error
3202 #endif
3203   ;
3204   return 0;
3205 }
3206 _ACEOF
3207 rm -f conftest.$ac_objext
3208 if { (eval echo "$as_me:3208: \"$ac_compile\"") >&5
3209   (eval $ac_compile) 2>&5
3210   ac_status=$?
3211   echo "$as_me:3211: \$? = $ac_status" >&5
3212   (exit $ac_status); } &&
3213          { ac_try='test -s conftest.$ac_objext'
3214   { (eval echo "$as_me:3214: \"$ac_try\"") >&5
3215   (eval $ac_try) 2>&5
3216   ac_status=$?
3217   echo "$as_me:3217: \$? = $ac_status" >&5
3218   (exit $ac_status); }; }; then
3219   cf_cv_xopen_source=no
3220 else
3221   echo "$as_me: failed program was:" >&5
3222 cat conftest.$ac_ext >&5
3223 cf_save="$CPPFLAGS"
3224          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3225          cat >conftest.$ac_ext <<_ACEOF
3226 #line 3226 "configure"
3227 #include "confdefs.h"
3228
3229 #include <stdlib.h>
3230 #include <string.h>
3231 #include <sys/types.h>
3232
3233 int
3234 main ()
3235 {
3236
3237 #ifdef _XOPEN_SOURCE
3238 make an error
3239 #endif
3240   ;
3241   return 0;
3242 }
3243 _ACEOF
3244 rm -f conftest.$ac_objext
3245 if { (eval echo "$as_me:3245: \"$ac_compile\"") >&5
3246   (eval $ac_compile) 2>&5
3247   ac_status=$?
3248   echo "$as_me:3248: \$? = $ac_status" >&5
3249   (exit $ac_status); } &&
3250          { ac_try='test -s conftest.$ac_objext'
3251   { (eval echo "$as_me:3251: \"$ac_try\"") >&5
3252   (eval $ac_try) 2>&5
3253   ac_status=$?
3254   echo "$as_me:3254: \$? = $ac_status" >&5
3255   (exit $ac_status); }; }; then
3256   cf_cv_xopen_source=no
3257 else
3258   echo "$as_me: failed program was:" >&5
3259 cat conftest.$ac_ext >&5
3260 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3261 fi
3262 rm -f conftest.$ac_objext conftest.$ac_ext
3263         CPPFLAGS="$cf_save"
3264
3265 fi
3266 rm -f conftest.$ac_objext conftest.$ac_ext
3267
3268 fi
3269 echo "$as_me:3269: result: $cf_cv_xopen_source" >&5
3270 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3271
3272 if test "$cf_cv_xopen_source" != no ; then
3273
3274 CFLAGS=`echo "$CFLAGS" | \
3275         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3276                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3277
3278 CPPFLAGS=`echo "$CPPFLAGS" | \
3279         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3280                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3281
3282         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3283
3284 cf_fix_cppflags=no
3285 cf_new_cflags=
3286 cf_new_cppflags=
3287 cf_new_extra_cppflags=
3288
3289 for cf_add_cflags in $cf_temp_xopen_source
3290 do
3291 case $cf_fix_cppflags in
3292 no)
3293         case $cf_add_cflags in #(vi
3294         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3295                 case $cf_add_cflags in
3296                 -D*)
3297                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3298
3299                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3300                                 && test -z "${cf_tst_cflags}" \
3301                                 && cf_fix_cppflags=yes
3302
3303                         if test $cf_fix_cppflags = yes ; then
3304                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3305                                 continue
3306                         elif test "${cf_tst_cflags}" = "\"'" ; then
3307                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3308                                 continue
3309                         fi
3310                         ;;
3311                 esac
3312                 case "$CPPFLAGS" in
3313                 *$cf_add_cflags) #(vi
3314                         ;;
3315                 *) #(vi
3316                         case $cf_add_cflags in #(vi
3317                         -D*)
3318                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3319
3320 CPPFLAGS=`echo "$CPPFLAGS" | \
3321         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3322                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3323
3324                                 ;;
3325                         esac
3326                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3327                         ;;
3328                 esac
3329                 ;;
3330         *)
3331                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3332                 ;;
3333         esac
3334         ;;
3335 yes)
3336         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3337
3338         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3339
3340         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3341                 && test -z "${cf_tst_cflags}" \
3342                 && cf_fix_cppflags=no
3343         ;;
3344 esac
3345 done
3346
3347 if test -n "$cf_new_cflags" ; then
3348
3349         CFLAGS="$CFLAGS $cf_new_cflags"
3350 fi
3351
3352 if test -n "$cf_new_cppflags" ; then
3353
3354         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3355 fi
3356
3357 if test -n "$cf_new_extra_cppflags" ; then
3358
3359         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3360 fi
3361
3362 fi
3363
3364 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3365
3366 cf_save_CFLAGS="$CFLAGS"
3367 cf_save_CPPFLAGS="$CPPFLAGS"
3368
3369 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3370         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3371                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3372
3373 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3374         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3375                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3376
3377 echo "$as_me:3377: checking if we should define _POSIX_C_SOURCE" >&5
3378 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3379 if test "${cf_cv_posix_c_source+set}" = set; then
3380   echo $ECHO_N "(cached) $ECHO_C" >&6
3381 else
3382
3383 echo "${as_me:-configure}:3383: testing if the symbol is already defined go no further ..." 1>&5
3384
3385         cat >conftest.$ac_ext <<_ACEOF
3386 #line 3386 "configure"
3387 #include "confdefs.h"
3388 #include <sys/types.h>
3389 int
3390 main ()
3391 {
3392
3393 #ifndef _POSIX_C_SOURCE
3394 make an error
3395 #endif
3396   ;
3397   return 0;
3398 }
3399 _ACEOF
3400 rm -f conftest.$ac_objext
3401 if { (eval echo "$as_me:3401: \"$ac_compile\"") >&5
3402   (eval $ac_compile) 2>&5
3403   ac_status=$?
3404   echo "$as_me:3404: \$? = $ac_status" >&5
3405   (exit $ac_status); } &&
3406          { ac_try='test -s conftest.$ac_objext'
3407   { (eval echo "$as_me:3407: \"$ac_try\"") >&5
3408   (eval $ac_try) 2>&5
3409   ac_status=$?
3410   echo "$as_me:3410: \$? = $ac_status" >&5
3411   (exit $ac_status); }; }; then
3412   cf_cv_posix_c_source=no
3413 else
3414   echo "$as_me: failed program was:" >&5
3415 cat conftest.$ac_ext >&5
3416 cf_want_posix_source=no
3417          case .$cf_POSIX_C_SOURCE in #(vi
3418          .[12]??*) #(vi
3419                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3420                 ;;
3421          .2) #(vi
3422                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3423                 cf_want_posix_source=yes
3424                 ;;
3425          .*)
3426                 cf_want_posix_source=yes
3427                 ;;
3428          esac
3429          if test "$cf_want_posix_source" = yes ; then
3430                 cat >conftest.$ac_ext <<_ACEOF
3431 #line 3431 "configure"
3432 #include "confdefs.h"
3433 #include <sys/types.h>
3434 int
3435 main ()
3436 {
3437
3438 #ifdef _POSIX_SOURCE
3439 make an error
3440 #endif
3441   ;
3442   return 0;
3443 }
3444 _ACEOF
3445 rm -f conftest.$ac_objext
3446 if { (eval echo "$as_me:3446: \"$ac_compile\"") >&5
3447   (eval $ac_compile) 2>&5
3448   ac_status=$?
3449   echo "$as_me:3449: \$? = $ac_status" >&5
3450   (exit $ac_status); } &&
3451          { ac_try='test -s conftest.$ac_objext'
3452   { (eval echo "$as_me:3452: \"$ac_try\"") >&5
3453   (eval $ac_try) 2>&5
3454   ac_status=$?
3455   echo "$as_me:3455: \$? = $ac_status" >&5
3456   (exit $ac_status); }; }; then
3457   :
3458 else
3459   echo "$as_me: failed program was:" >&5
3460 cat conftest.$ac_ext >&5
3461 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3462 fi
3463 rm -f conftest.$ac_objext conftest.$ac_ext
3464          fi
3465
3466 echo "${as_me:-configure}:3466: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3467
3468          CFLAGS="$cf_trim_CFLAGS"
3469          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3470
3471 echo "${as_me:-configure}:3471: testing if the second compile does not leave our definition intact error ..." 1>&5
3472
3473          cat >conftest.$ac_ext <<_ACEOF
3474 #line 3474 "configure"
3475 #include "confdefs.h"
3476 #include <sys/types.h>
3477 int
3478 main ()
3479 {
3480
3481 #ifndef _POSIX_C_SOURCE
3482 make an error
3483 #endif
3484   ;
3485   return 0;
3486 }
3487 _ACEOF
3488 rm -f conftest.$ac_objext
3489 if { (eval echo "$as_me:3489: \"$ac_compile\"") >&5
3490   (eval $ac_compile) 2>&5
3491   ac_status=$?
3492   echo "$as_me:3492: \$? = $ac_status" >&5
3493   (exit $ac_status); } &&
3494          { ac_try='test -s conftest.$ac_objext'
3495   { (eval echo "$as_me:3495: \"$ac_try\"") >&5
3496   (eval $ac_try) 2>&5
3497   ac_status=$?
3498   echo "$as_me:3498: \$? = $ac_status" >&5
3499   (exit $ac_status); }; }; then
3500   :
3501 else
3502   echo "$as_me: failed program was:" >&5
3503 cat conftest.$ac_ext >&5
3504 cf_cv_posix_c_source=no
3505 fi
3506 rm -f conftest.$ac_objext conftest.$ac_ext
3507          CFLAGS="$cf_save_CFLAGS"
3508          CPPFLAGS="$cf_save_CPPFLAGS"
3509
3510 fi
3511 rm -f conftest.$ac_objext conftest.$ac_ext
3512
3513 fi
3514 echo "$as_me:3514: result: $cf_cv_posix_c_source" >&5
3515 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3516
3517 if test "$cf_cv_posix_c_source" != no ; then
3518         CFLAGS="$cf_trim_CFLAGS"
3519         CPPFLAGS="$cf_trim_CPPFLAGS"
3520
3521 cf_fix_cppflags=no
3522 cf_new_cflags=
3523 cf_new_cppflags=
3524 cf_new_extra_cppflags=
3525
3526 for cf_add_cflags in $cf_cv_posix_c_source
3527 do
3528 case $cf_fix_cppflags in
3529 no)
3530         case $cf_add_cflags in #(vi
3531         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3532                 case $cf_add_cflags in
3533                 -D*)
3534                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3535
3536                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3537                                 && test -z "${cf_tst_cflags}" \
3538                                 && cf_fix_cppflags=yes
3539
3540                         if test $cf_fix_cppflags = yes ; then
3541                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3542                                 continue
3543                         elif test "${cf_tst_cflags}" = "\"'" ; then
3544                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3545                                 continue
3546                         fi
3547                         ;;
3548                 esac
3549                 case "$CPPFLAGS" in
3550                 *$cf_add_cflags) #(vi
3551                         ;;
3552                 *) #(vi
3553                         case $cf_add_cflags in #(vi
3554                         -D*)
3555                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3556
3557 CPPFLAGS=`echo "$CPPFLAGS" | \
3558         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3559                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3560
3561                                 ;;
3562                         esac
3563                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3564                         ;;
3565                 esac
3566                 ;;
3567         *)
3568                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3569                 ;;
3570         esac
3571         ;;
3572 yes)
3573         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3574
3575         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3576
3577         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3578                 && test -z "${cf_tst_cflags}" \
3579                 && cf_fix_cppflags=no
3580         ;;
3581 esac
3582 done
3583
3584 if test -n "$cf_new_cflags" ; then
3585
3586         CFLAGS="$CFLAGS $cf_new_cflags"
3587 fi
3588
3589 if test -n "$cf_new_cppflags" ; then
3590
3591         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3592 fi
3593
3594 if test -n "$cf_new_extra_cppflags" ; then
3595
3596         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3597 fi
3598
3599 fi
3600
3601         ;;
3602 esac
3603
3604 if test -n "$cf_xopen_source" ; then
3605
3606 cf_fix_cppflags=no
3607 cf_new_cflags=
3608 cf_new_cppflags=
3609 cf_new_extra_cppflags=
3610
3611 for cf_add_cflags in $cf_xopen_source
3612 do
3613 case $cf_fix_cppflags in
3614 no)
3615         case $cf_add_cflags in #(vi
3616         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3617                 case $cf_add_cflags in
3618                 -D*)
3619                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3620
3621                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3622                                 && test -z "${cf_tst_cflags}" \
3623                                 && cf_fix_cppflags=yes
3624
3625                         if test $cf_fix_cppflags = yes ; then
3626                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3627                                 continue
3628                         elif test "${cf_tst_cflags}" = "\"'" ; then
3629                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3630                                 continue
3631                         fi
3632                         ;;
3633                 esac
3634                 case "$CPPFLAGS" in
3635                 *$cf_add_cflags) #(vi
3636                         ;;
3637                 *) #(vi
3638                         case $cf_add_cflags in #(vi
3639                         -D*)
3640                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3641
3642 CPPFLAGS=`echo "$CPPFLAGS" | \
3643         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3644                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3645
3646                                 ;;
3647                         esac
3648                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3649                         ;;
3650                 esac
3651                 ;;
3652         *)
3653                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3654                 ;;
3655         esac
3656         ;;
3657 yes)
3658         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3659
3660         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3661
3662         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3663                 && test -z "${cf_tst_cflags}" \
3664                 && cf_fix_cppflags=no
3665         ;;
3666 esac
3667 done
3668
3669 if test -n "$cf_new_cflags" ; then
3670
3671         CFLAGS="$CFLAGS $cf_new_cflags"
3672 fi
3673
3674 if test -n "$cf_new_cppflags" ; then
3675
3676         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3677 fi
3678
3679 if test -n "$cf_new_extra_cppflags" ; then
3680
3681         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3682 fi
3683
3684 fi
3685
3686 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3687         echo "$as_me:3687: checking if _XOPEN_SOURCE really is set" >&5
3688 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3689         cat >conftest.$ac_ext <<_ACEOF
3690 #line 3690 "configure"
3691 #include "confdefs.h"
3692 #include <stdlib.h>
3693 int
3694 main ()
3695 {
3696
3697 #ifndef _XOPEN_SOURCE
3698 make an error
3699 #endif
3700   ;
3701   return 0;
3702 }
3703 _ACEOF
3704 rm -f conftest.$ac_objext
3705 if { (eval echo "$as_me:3705: \"$ac_compile\"") >&5
3706   (eval $ac_compile) 2>&5
3707   ac_status=$?
3708   echo "$as_me:3708: \$? = $ac_status" >&5
3709   (exit $ac_status); } &&
3710          { ac_try='test -s conftest.$ac_objext'
3711   { (eval echo "$as_me:3711: \"$ac_try\"") >&5
3712   (eval $ac_try) 2>&5
3713   ac_status=$?
3714   echo "$as_me:3714: \$? = $ac_status" >&5
3715   (exit $ac_status); }; }; then
3716   cf_XOPEN_SOURCE_set=yes
3717 else
3718   echo "$as_me: failed program was:" >&5
3719 cat conftest.$ac_ext >&5
3720 cf_XOPEN_SOURCE_set=no
3721 fi
3722 rm -f conftest.$ac_objext conftest.$ac_ext
3723         echo "$as_me:3723: result: $cf_XOPEN_SOURCE_set" >&5
3724 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3725         if test $cf_XOPEN_SOURCE_set = yes
3726         then
3727                 cat >conftest.$ac_ext <<_ACEOF
3728 #line 3728 "configure"
3729 #include "confdefs.h"
3730 #include <stdlib.h>
3731 int
3732 main ()
3733 {
3734
3735 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3736 make an error
3737 #endif
3738   ;
3739   return 0;
3740 }
3741 _ACEOF
3742 rm -f conftest.$ac_objext
3743 if { (eval echo "$as_me:3743: \"$ac_compile\"") >&5
3744   (eval $ac_compile) 2>&5
3745   ac_status=$?
3746   echo "$as_me:3746: \$? = $ac_status" >&5
3747   (exit $ac_status); } &&
3748          { ac_try='test -s conftest.$ac_objext'
3749   { (eval echo "$as_me:3749: \"$ac_try\"") >&5
3750   (eval $ac_try) 2>&5
3751   ac_status=$?
3752   echo "$as_me:3752: \$? = $ac_status" >&5
3753   (exit $ac_status); }; }; then
3754   cf_XOPEN_SOURCE_set_ok=yes
3755 else
3756   echo "$as_me: failed program was:" >&5
3757 cat conftest.$ac_ext >&5
3758 cf_XOPEN_SOURCE_set_ok=no
3759 fi
3760 rm -f conftest.$ac_objext conftest.$ac_ext
3761                 if test $cf_XOPEN_SOURCE_set_ok = no
3762                 then
3763                         { echo "$as_me:3763: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3764 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3765                 fi
3766         else
3767
3768 echo "$as_me:3768: checking if we should define _XOPEN_SOURCE" >&5
3769 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3770 if test "${cf_cv_xopen_source+set}" = set; then
3771   echo $ECHO_N "(cached) $ECHO_C" >&6
3772 else
3773
3774         cat >conftest.$ac_ext <<_ACEOF
3775 #line 3775 "configure"
3776 #include "confdefs.h"
3777
3778 #include <stdlib.h>
3779 #include <string.h>
3780 #include <sys/types.h>
3781
3782 int
3783 main ()
3784 {
3785
3786 #ifndef _XOPEN_SOURCE
3787 make an error
3788 #endif
3789   ;
3790   return 0;
3791 }
3792 _ACEOF
3793 rm -f conftest.$ac_objext
3794 if { (eval echo "$as_me:3794: \"$ac_compile\"") >&5
3795   (eval $ac_compile) 2>&5
3796   ac_status=$?
3797   echo "$as_me:3797: \$? = $ac_status" >&5
3798   (exit $ac_status); } &&
3799          { ac_try='test -s conftest.$ac_objext'
3800   { (eval echo "$as_me:3800: \"$ac_try\"") >&5
3801   (eval $ac_try) 2>&5
3802   ac_status=$?
3803   echo "$as_me:3803: \$? = $ac_status" >&5
3804   (exit $ac_status); }; }; then
3805   cf_cv_xopen_source=no
3806 else
3807   echo "$as_me: failed program was:" >&5
3808 cat conftest.$ac_ext >&5
3809 cf_save="$CPPFLAGS"
3810          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3811          cat >conftest.$ac_ext <<_ACEOF
3812 #line 3812 "configure"
3813 #include "confdefs.h"
3814
3815 #include <stdlib.h>
3816 #include <string.h>
3817 #include <sys/types.h>
3818
3819 int
3820 main ()
3821 {
3822
3823 #ifdef _XOPEN_SOURCE
3824 make an error
3825 #endif
3826   ;
3827   return 0;
3828 }
3829 _ACEOF
3830 rm -f conftest.$ac_objext
3831 if { (eval echo "$as_me:3831: \"$ac_compile\"") >&5
3832   (eval $ac_compile) 2>&5
3833   ac_status=$?
3834   echo "$as_me:3834: \$? = $ac_status" >&5
3835   (exit $ac_status); } &&
3836          { ac_try='test -s conftest.$ac_objext'
3837   { (eval echo "$as_me:3837: \"$ac_try\"") >&5
3838   (eval $ac_try) 2>&5
3839   ac_status=$?
3840   echo "$as_me:3840: \$? = $ac_status" >&5
3841   (exit $ac_status); }; }; then
3842   cf_cv_xopen_source=no
3843 else
3844   echo "$as_me: failed program was:" >&5
3845 cat conftest.$ac_ext >&5
3846 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3847 fi
3848 rm -f conftest.$ac_objext conftest.$ac_ext
3849         CPPFLAGS="$cf_save"
3850
3851 fi
3852 rm -f conftest.$ac_objext conftest.$ac_ext
3853
3854 fi
3855 echo "$as_me:3855: result: $cf_cv_xopen_source" >&5
3856 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3857
3858 if test "$cf_cv_xopen_source" != no ; then
3859
3860 CFLAGS=`echo "$CFLAGS" | \
3861         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3862                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3863
3864 CPPFLAGS=`echo "$CPPFLAGS" | \
3865         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3866                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3867
3868         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3869
3870 cf_fix_cppflags=no
3871 cf_new_cflags=
3872 cf_new_cppflags=
3873 cf_new_extra_cppflags=
3874
3875 for cf_add_cflags in $cf_temp_xopen_source
3876 do
3877 case $cf_fix_cppflags in
3878 no)
3879         case $cf_add_cflags in #(vi
3880         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3881                 case $cf_add_cflags in
3882                 -D*)
3883                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3884
3885                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3886                                 && test -z "${cf_tst_cflags}" \
3887                                 && cf_fix_cppflags=yes
3888
3889                         if test $cf_fix_cppflags = yes ; then
3890                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3891                                 continue
3892                         elif test "${cf_tst_cflags}" = "\"'" ; then
3893                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3894                                 continue
3895                         fi
3896                         ;;
3897                 esac
3898                 case "$CPPFLAGS" in
3899                 *$cf_add_cflags) #(vi
3900                         ;;
3901                 *) #(vi
3902                         case $cf_add_cflags in #(vi
3903                         -D*)
3904                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3905
3906 CPPFLAGS=`echo "$CPPFLAGS" | \
3907         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3908                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3909
3910                                 ;;
3911                         esac
3912                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3913                         ;;
3914                 esac
3915                 ;;
3916         *)
3917                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3918                 ;;
3919         esac
3920         ;;
3921 yes)
3922         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3923
3924         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3925
3926         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3927                 && test -z "${cf_tst_cflags}" \
3928                 && cf_fix_cppflags=no
3929         ;;
3930 esac
3931 done
3932
3933 if test -n "$cf_new_cflags" ; then
3934
3935         CFLAGS="$CFLAGS $cf_new_cflags"
3936 fi
3937
3938 if test -n "$cf_new_cppflags" ; then
3939
3940         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3941 fi
3942
3943 if test -n "$cf_new_extra_cppflags" ; then
3944
3945         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3946 fi
3947
3948 fi
3949
3950         fi
3951 fi
3952
3953 echo "$as_me:3953: checking for signal global datatype" >&5
3954 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
3955 if test "${cf_cv_sig_atomic_t+set}" = set; then
3956   echo $ECHO_N "(cached) $ECHO_C" >&6
3957 else
3958
3959         for cf_type in \
3960                 "volatile sig_atomic_t" \
3961                 "sig_atomic_t" \
3962                 "int"
3963         do
3964         cat >conftest.$ac_ext <<_ACEOF
3965 #line 3965 "configure"
3966 #include "confdefs.h"
3967
3968 #include <sys/types.h>
3969 #include <signal.h>
3970 #include <stdio.h>
3971
3972 extern $cf_type x;
3973 $cf_type x;
3974 static void handler(int sig)
3975 {
3976         x = 5;
3977 }
3978 int
3979 main ()
3980 {
3981 signal(SIGINT, handler);
3982                  x = 1
3983   ;
3984   return 0;
3985 }
3986 _ACEOF
3987 rm -f conftest.$ac_objext
3988 if { (eval echo "$as_me:3988: \"$ac_compile\"") >&5
3989   (eval $ac_compile) 2>&5
3990   ac_status=$?
3991   echo "$as_me:3991: \$? = $ac_status" >&5
3992   (exit $ac_status); } &&
3993          { ac_try='test -s conftest.$ac_objext'
3994   { (eval echo "$as_me:3994: \"$ac_try\"") >&5
3995   (eval $ac_try) 2>&5
3996   ac_status=$?
3997   echo "$as_me:3997: \$? = $ac_status" >&5
3998   (exit $ac_status); }; }; then
3999   cf_cv_sig_atomic_t=$cf_type
4000 else
4001   echo "$as_me: failed program was:" >&5
4002 cat conftest.$ac_ext >&5
4003 cf_cv_sig_atomic_t=no
4004 fi
4005 rm -f conftest.$ac_objext conftest.$ac_ext
4006                 test "$cf_cv_sig_atomic_t" != no && break
4007         done
4008
4009 fi
4010
4011 echo "$as_me:4011: result: $cf_cv_sig_atomic_t" >&5
4012 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4013 test "$cf_cv_sig_atomic_t" != no &&
4014 cat >>confdefs.h <<EOF
4015 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4016 EOF
4017
4018 echo "$as_me:4018: checking if you want to use pkg-config" >&5
4019 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4020
4021 # Check whether --with-pkg-config or --without-pkg-config was given.
4022 if test "${with_pkg_config+set}" = set; then
4023   withval="$with_pkg_config"
4024   cf_pkg_config=$withval
4025 else
4026   cf_pkg_config=yes
4027 fi;
4028 echo "$as_me:4028: result: $cf_pkg_config" >&5
4029 echo "${ECHO_T}$cf_pkg_config" >&6
4030
4031 case $cf_pkg_config in #(vi
4032 no) #(vi
4033         PKG_CONFIG=none
4034         ;;
4035 yes) #(vi
4036
4037 if test -n "$ac_tool_prefix"; then
4038   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4039 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4040 echo "$as_me:4040: checking for $ac_word" >&5
4041 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4042 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4043   echo $ECHO_N "(cached) $ECHO_C" >&6
4044 else
4045   case $PKG_CONFIG in
4046   [\\/]* | ?:[\\/]*)
4047   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4048   ;;
4049   *)
4050   ac_save_IFS=$IFS; IFS=$ac_path_separator
4051 ac_dummy="$PATH"
4052 for ac_dir in $ac_dummy; do
4053   IFS=$ac_save_IFS
4054   test -z "$ac_dir" && ac_dir=.
4055   if $as_executable_p "$ac_dir/$ac_word"; then
4056    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4057    echo "$as_me:4057: found $ac_dir/$ac_word" >&5
4058    break
4059 fi
4060 done
4061
4062   ;;
4063 esac
4064 fi
4065 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4066
4067 if test -n "$PKG_CONFIG"; then
4068   echo "$as_me:4068: result: $PKG_CONFIG" >&5
4069 echo "${ECHO_T}$PKG_CONFIG" >&6
4070 else
4071   echo "$as_me:4071: result: no" >&5
4072 echo "${ECHO_T}no" >&6
4073 fi
4074
4075 fi
4076 if test -z "$ac_cv_path_PKG_CONFIG"; then
4077   ac_pt_PKG_CONFIG=$PKG_CONFIG
4078   # Extract the first word of "pkg-config", so it can be a program name with args.
4079 set dummy pkg-config; ac_word=$2
4080 echo "$as_me:4080: checking for $ac_word" >&5
4081 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4082 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4083   echo $ECHO_N "(cached) $ECHO_C" >&6
4084 else
4085   case $ac_pt_PKG_CONFIG in
4086   [\\/]* | ?:[\\/]*)
4087   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4088   ;;
4089   *)
4090   ac_save_IFS=$IFS; IFS=$ac_path_separator
4091 ac_dummy="$PATH"
4092 for ac_dir in $ac_dummy; do
4093   IFS=$ac_save_IFS
4094   test -z "$ac_dir" && ac_dir=.
4095   if $as_executable_p "$ac_dir/$ac_word"; then
4096    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4097    echo "$as_me:4097: found $ac_dir/$ac_word" >&5
4098    break
4099 fi
4100 done
4101
4102   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4103   ;;
4104 esac
4105 fi
4106 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4107
4108 if test -n "$ac_pt_PKG_CONFIG"; then
4109   echo "$as_me:4109: result: $ac_pt_PKG_CONFIG" >&5
4110 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4111 else
4112   echo "$as_me:4112: result: no" >&5
4113 echo "${ECHO_T}no" >&6
4114 fi
4115
4116   PKG_CONFIG=$ac_pt_PKG_CONFIG
4117 else
4118   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4119 fi
4120
4121         ;;
4122 *)
4123         PKG_CONFIG=$withval
4124         ;;
4125 esac
4126
4127 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4128 if test "$PKG_CONFIG" != none ; then
4129
4130 if test "x$prefix" != xNONE; then
4131   cf_path_syntax="$prefix"
4132 else
4133   cf_path_syntax="$ac_default_prefix"
4134 fi
4135
4136 case ".$PKG_CONFIG" in #(vi
4137 .\$\(*\)*|.\'*\'*) #(vi
4138   ;;
4139 ..|./*|.\\*) #(vi
4140   ;;
4141 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
4142   ;;
4143 .\${*prefix}*|.\${*dir}*) #(vi
4144   eval PKG_CONFIG="$PKG_CONFIG"
4145   case ".$PKG_CONFIG" in #(vi
4146   .NONE/*)
4147     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4148     ;;
4149   esac
4150   ;; #(vi
4151 .no|.NONE/*)
4152   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4153   ;;
4154 *)
4155   { { echo "$as_me:4155: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4156 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4157    { (exit 1); exit 1; }; }
4158   ;;
4159 esac
4160
4161 fi
4162
4163 echo "$as_me:4163: checking if you want to see long compiling messages" >&5
4164 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4165
4166 # Check whether --enable-echo or --disable-echo was given.
4167 if test "${enable_echo+set}" = set; then
4168   enableval="$enable_echo"
4169   test "$enableval" != no && enableval=yes
4170   if test "$enableval" != "yes" ; then
4171
4172     ECHO_LT='--silent'
4173     ECHO_LD='@echo linking $@;'
4174     RULE_CC='@echo compiling $<'
4175     SHOW_CC='@echo compiling $@'
4176     ECHO_CC='@'
4177
4178   else
4179
4180     ECHO_LT=''
4181     ECHO_LD=''
4182     RULE_CC=''
4183     SHOW_CC=''
4184     ECHO_CC=''
4185
4186   fi
4187 else
4188   enableval=yes
4189
4190     ECHO_LT=''
4191     ECHO_LD=''
4192     RULE_CC=''
4193     SHOW_CC=''
4194     ECHO_CC=''
4195
4196 fi;
4197 echo "$as_me:4197: result: $enableval" >&5
4198 echo "${ECHO_T}$enableval" >&6
4199
4200 echo "$as_me:4200: checking for ncurses wrap-prefix" >&5
4201 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4202
4203 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4204 if test "${with_ncurses_wrap_prefix+set}" = set; then
4205   withval="$with_ncurses_wrap_prefix"
4206   NCURSES_WRAP_PREFIX=$withval
4207 else
4208   NCURSES_WRAP_PREFIX=_nc_
4209 fi;
4210 echo "$as_me:4210: result: $NCURSES_WRAP_PREFIX" >&5
4211 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4212
4213 echo "$as_me:4213: checking if you want to check for wide-character functions" >&5
4214 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4215
4216 # Check whether --enable-widec or --disable-widec was given.
4217 if test "${enable_widec+set}" = set; then
4218   enableval="$enable_widec"
4219   test "$enableval" != no && enableval=yes
4220   if test "$enableval" != "yes" ; then
4221     cf_enable_widec=no
4222   else
4223     cf_enable_widec=yes
4224   fi
4225 else
4226   enableval=yes
4227   cf_enable_widec=yes
4228
4229 fi;
4230 echo "$as_me:4230: result: $cf_enable_widec" >&5
4231 echo "${ECHO_T}$cf_enable_widec" >&6
4232
4233 echo "$as_me:4233: checking for specific curses-directory" >&5
4234 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4235
4236 # Check whether --with-curses-dir or --without-curses-dir was given.
4237 if test "${with_curses_dir+set}" = set; then
4238   withval="$with_curses_dir"
4239   cf_cv_curses_dir=$withval
4240 else
4241   cf_cv_curses_dir=no
4242 fi;
4243 echo "$as_me:4243: result: $cf_cv_curses_dir" >&5
4244 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4245
4246 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4247 then
4248
4249 if test "x$prefix" != xNONE; then
4250   cf_path_syntax="$prefix"
4251 else
4252   cf_path_syntax="$ac_default_prefix"
4253 fi
4254
4255 case ".$withval" in #(vi
4256 .\$\(*\)*|.\'*\'*) #(vi
4257   ;;
4258 ..|./*|.\\*) #(vi
4259   ;;
4260 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
4261   ;;
4262 .\${*prefix}*|.\${*dir}*) #(vi
4263   eval withval="$withval"
4264   case ".$withval" in #(vi
4265   .NONE/*)
4266     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4267     ;;
4268   esac
4269   ;; #(vi
4270 .no|.NONE/*)
4271   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4272   ;;
4273 *)
4274   { { echo "$as_me:4274: error: expected a pathname, not \"$withval\"" >&5
4275 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4276    { (exit 1); exit 1; }; }
4277   ;;
4278 esac
4279
4280         if test -d "$cf_cv_curses_dir"
4281         then
4282
4283 if test -n "$cf_cv_curses_dir/include" ; then
4284   for cf_add_incdir in $cf_cv_curses_dir/include
4285   do
4286         while test $cf_add_incdir != /usr/include
4287         do
4288           if test -d $cf_add_incdir
4289           then
4290                 cf_have_incdir=no
4291                 if test -n "$CFLAGS$CPPFLAGS" ; then
4292                   # a loop is needed to ensure we can add subdirs of existing dirs
4293                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4294                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4295                           cf_have_incdir=yes; break
4296                         fi
4297                   done
4298                 fi
4299
4300                 if test "$cf_have_incdir" = no ; then
4301                   if test "$cf_add_incdir" = /usr/local/include ; then
4302                         if test "$GCC" = yes
4303                         then
4304                           cf_save_CPPFLAGS=$CPPFLAGS
4305                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4306                           cat >conftest.$ac_ext <<_ACEOF
4307 #line 4307 "configure"
4308 #include "confdefs.h"
4309 #include <stdio.h>
4310 int
4311 main ()
4312 {
4313 printf("Hello")
4314   ;
4315   return 0;
4316 }
4317 _ACEOF
4318 rm -f conftest.$ac_objext
4319 if { (eval echo "$as_me:4319: \"$ac_compile\"") >&5
4320   (eval $ac_compile) 2>&5
4321   ac_status=$?
4322   echo "$as_me:4322: \$? = $ac_status" >&5
4323   (exit $ac_status); } &&
4324          { ac_try='test -s conftest.$ac_objext'
4325   { (eval echo "$as_me:4325: \"$ac_try\"") >&5
4326   (eval $ac_try) 2>&5
4327   ac_status=$?
4328   echo "$as_me:4328: \$? = $ac_status" >&5
4329   (exit $ac_status); }; }; then
4330   :
4331 else
4332   echo "$as_me: failed program was:" >&5
4333 cat conftest.$ac_ext >&5
4334 cf_have_incdir=yes
4335 fi
4336 rm -f conftest.$ac_objext conftest.$ac_ext
4337                           CPPFLAGS=$cf_save_CPPFLAGS
4338                         fi
4339                   fi
4340                 fi
4341
4342                 if test "$cf_have_incdir" = no ; then
4343                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4344
4345 echo "${as_me:-configure}:4345: testing adding $cf_add_incdir to include-path ..." 1>&5
4346
4347                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4348
4349                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4350                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4351                   cf_add_incdir="$cf_top_incdir"
4352                 else
4353                   break
4354                 fi
4355           fi
4356         done
4357   done
4358 fi
4359
4360 if test -n "$cf_cv_curses_dir/lib" ; then
4361   for cf_add_libdir in $cf_cv_curses_dir/lib
4362   do
4363     if test $cf_add_libdir = /usr/lib ; then
4364       :
4365     elif test -d $cf_add_libdir
4366     then
4367       cf_have_libdir=no
4368       if test -n "$LDFLAGS$LIBS" ; then
4369         # a loop is needed to ensure we can add subdirs of existing dirs
4370         for cf_test_libdir in $LDFLAGS $LIBS ; do
4371           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4372             cf_have_libdir=yes; break
4373           fi
4374         done
4375       fi
4376       if test "$cf_have_libdir" = no ; then
4377         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4378
4379 echo "${as_me:-configure}:4379: testing adding $cf_add_libdir to library-path ..." 1>&5
4380
4381         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4382       fi
4383     fi
4384   done
4385 fi
4386
4387         fi
4388 fi
4389
4390 cf_cv_screen=curses
4391
4392 echo "$as_me:4392: checking for specified curses library type" >&5
4393 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4394
4395 # Check whether --with-ncursesw or --without-ncursesw was given.
4396 if test "${with_ncursesw+set}" = set; then
4397   withval="$with_ncursesw"
4398   cf_cv_screen=ncursesw
4399 else
4400
4401 # Check whether --with-ncurses or --without-ncurses was given.
4402 if test "${with_ncurses+set}" = set; then
4403   withval="$with_ncurses"
4404   cf_cv_screen=ncurses
4405 else
4406
4407 # Check whether --with-pdcurses or --without-pdcurses was given.
4408 if test "${with_pdcurses+set}" = set; then
4409   withval="$with_pdcurses"
4410   cf_cv_screen=pdcurses
4411 else
4412
4413 # Check whether --with-curses-colr or --without-curses-colr was given.
4414 if test "${with_curses_colr+set}" = set; then
4415   withval="$with_curses_colr"
4416   cf_cv_screen=curses_colr
4417 else
4418
4419 # Check whether --with-curses-5lib or --without-curses-5lib was given.
4420 if test "${with_curses_5lib+set}" = set; then
4421   withval="$with_curses_5lib"
4422   cf_cv_screen=curses_5lib
4423 fi;
4424 fi;
4425 fi;
4426 fi;
4427 fi;
4428
4429 echo "$as_me:4429: result: $cf_cv_screen" >&5
4430 echo "${ECHO_T}$cf_cv_screen" >&6
4431
4432 case $cf_cv_screen in #(vi
4433 curses|curses_*) #(vi
4434
4435 echo "$as_me:4435: checking for extra include directories" >&5
4436 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4437 if test "${cf_cv_curses_incdir+set}" = set; then
4438   echo $ECHO_N "(cached) $ECHO_C" >&6
4439 else
4440
4441 cf_cv_curses_incdir=no
4442 case $host_os in #(vi
4443 hpux10.*) #(vi
4444         if test "x$cf_cv_screen" = "xcurses_colr"
4445         then
4446                 test -d /usr/include/curses_colr && \
4447                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
4448         fi
4449         ;;
4450 sunos3*|sunos4*)
4451         if test "x$cf_cv_screen" = "xcurses_5lib"
4452         then
4453                 test -d /usr/5lib && \
4454                 test -d /usr/5include && \
4455                 cf_cv_curses_incdir="-I/usr/5include"
4456         fi
4457         ;;
4458 esac
4459
4460 fi
4461 echo "$as_me:4461: result: $cf_cv_curses_incdir" >&5
4462 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4463 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4464
4465 echo "$as_me:4465: checking if we have identified curses headers" >&5
4466 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4467 if test "${cf_cv_ncurses_header+set}" = set; then
4468   echo $ECHO_N "(cached) $ECHO_C" >&6
4469 else
4470
4471 cf_cv_ncurses_header=none
4472 for cf_header in  \
4473         ncurses.h \
4474         curses.h ncurses/ncurses.h ncurses/curses.h
4475 do
4476 cat >conftest.$ac_ext <<_ACEOF
4477 #line 4477 "configure"
4478 #include "confdefs.h"
4479 #include <${cf_header}>
4480 int
4481 main ()
4482 {
4483 initscr(); tgoto("?", 0,0)
4484   ;
4485   return 0;
4486 }
4487 _ACEOF
4488 rm -f conftest.$ac_objext
4489 if { (eval echo "$as_me:4489: \"$ac_compile\"") >&5
4490   (eval $ac_compile) 2>&5
4491   ac_status=$?
4492   echo "$as_me:4492: \$? = $ac_status" >&5
4493   (exit $ac_status); } &&
4494          { ac_try='test -s conftest.$ac_objext'
4495   { (eval echo "$as_me:4495: \"$ac_try\"") >&5
4496   (eval $ac_try) 2>&5
4497   ac_status=$?
4498   echo "$as_me:4498: \$? = $ac_status" >&5
4499   (exit $ac_status); }; }; then
4500   cf_cv_ncurses_header=$cf_header; break
4501 else
4502   echo "$as_me: failed program was:" >&5
4503 cat conftest.$ac_ext >&5
4504 fi
4505 rm -f conftest.$ac_objext conftest.$ac_ext
4506 done
4507
4508 fi
4509 echo "$as_me:4509: result: $cf_cv_ncurses_header" >&5
4510 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4511
4512 if test "$cf_cv_ncurses_header" = none ; then
4513         { { echo "$as_me:4513: error: No curses header-files found" >&5
4514 echo "$as_me: error: No curses header-files found" >&2;}
4515    { (exit 1); exit 1; }; }
4516 fi
4517
4518 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4519
4520 for ac_header in $cf_cv_ncurses_header
4521 do
4522 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4523 echo "$as_me:4523: checking for $ac_header" >&5
4524 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4525 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4526   echo $ECHO_N "(cached) $ECHO_C" >&6
4527 else
4528   cat >conftest.$ac_ext <<_ACEOF
4529 #line 4529 "configure"
4530 #include "confdefs.h"
4531 #include <$ac_header>
4532 _ACEOF
4533 if { (eval echo "$as_me:4533: \"$ac_cpp conftest.$ac_ext\"") >&5
4534   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4535   ac_status=$?
4536   egrep -v '^ *\+' conftest.er1 >conftest.err
4537   rm -f conftest.er1
4538   cat conftest.err >&5
4539   echo "$as_me:4539: \$? = $ac_status" >&5
4540   (exit $ac_status); } >/dev/null; then
4541   if test -s conftest.err; then
4542     ac_cpp_err=$ac_c_preproc_warn_flag
4543   else
4544     ac_cpp_err=
4545   fi
4546 else
4547   ac_cpp_err=yes
4548 fi
4549 if test -z "$ac_cpp_err"; then
4550   eval "$as_ac_Header=yes"
4551 else
4552   echo "$as_me: failed program was:" >&5
4553   cat conftest.$ac_ext >&5
4554   eval "$as_ac_Header=no"
4555 fi
4556 rm -f conftest.err conftest.$ac_ext
4557 fi
4558 echo "$as_me:4558: result: `eval echo '${'$as_ac_Header'}'`" >&5
4559 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4560 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4561   cat >>confdefs.h <<EOF
4562 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4563 EOF
4564
4565 fi
4566 done
4567
4568 echo "$as_me:4568: checking for terminfo header" >&5
4569 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4570 if test "${cf_cv_term_header+set}" = set; then
4571   echo $ECHO_N "(cached) $ECHO_C" >&6
4572 else
4573
4574 case ${cf_cv_ncurses_header} in #(vi
4575 */ncurses.h|*/ncursesw.h) #(vi
4576         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4577         ;;
4578 *)
4579         cf_term_header=term.h
4580         ;;
4581 esac
4582
4583 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4584 do
4585 cat >conftest.$ac_ext <<_ACEOF
4586 #line 4586 "configure"
4587 #include "confdefs.h"
4588 #include <stdio.h>
4589 #include <${cf_cv_ncurses_header:-curses.h}>
4590 #include <$cf_test>
4591
4592 int
4593 main ()
4594 {
4595 int x = auto_left_margin
4596   ;
4597   return 0;
4598 }
4599 _ACEOF
4600 rm -f conftest.$ac_objext
4601 if { (eval echo "$as_me:4601: \"$ac_compile\"") >&5
4602   (eval $ac_compile) 2>&5
4603   ac_status=$?
4604   echo "$as_me:4604: \$? = $ac_status" >&5
4605   (exit $ac_status); } &&
4606          { ac_try='test -s conftest.$ac_objext'
4607   { (eval echo "$as_me:4607: \"$ac_try\"") >&5
4608   (eval $ac_try) 2>&5
4609   ac_status=$?
4610   echo "$as_me:4610: \$? = $ac_status" >&5
4611   (exit $ac_status); }; }; then
4612
4613         cf_cv_term_header="$cf_test"
4614 else
4615   echo "$as_me: failed program was:" >&5
4616 cat conftest.$ac_ext >&5
4617
4618         cf_cv_term_header=unknown
4619
4620 fi
4621 rm -f conftest.$ac_objext conftest.$ac_ext
4622         test "$cf_cv_term_header" != unknown && break
4623 done
4624
4625 fi
4626 echo "$as_me:4626: result: $cf_cv_term_header" >&5
4627 echo "${ECHO_T}$cf_cv_term_header" >&6
4628
4629 # Set definitions to allow ifdef'ing to accommodate subdirectories
4630
4631 case $cf_cv_term_header in # (vi
4632 *term.h)
4633
4634 cat >>confdefs.h <<\EOF
4635 #define HAVE_TERM_H 1
4636 EOF
4637
4638         ;;
4639 esac
4640
4641 case $cf_cv_term_header in # (vi
4642 ncurses/term.h) #(vi
4643
4644 cat >>confdefs.h <<\EOF
4645 #define HAVE_NCURSES_TERM_H 1
4646 EOF
4647
4648         ;;
4649 ncursesw/term.h)
4650
4651 cat >>confdefs.h <<\EOF
4652 #define HAVE_NCURSESW_TERM_H 1
4653 EOF
4654
4655         ;;
4656 esac
4657
4658 echo "$as_me:4658: checking for ncurses version" >&5
4659 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4660 if test "${cf_cv_ncurses_version+set}" = set; then
4661   echo $ECHO_N "(cached) $ECHO_C" >&6
4662 else
4663
4664         cf_cv_ncurses_version=no
4665         cf_tempfile=out$$
4666         rm -f $cf_tempfile
4667         if test "$cross_compiling" = yes; then
4668
4669         # This will not work if the preprocessor splits the line after the
4670         # Autoconf token.  The 'unproto' program does that.
4671         cat > conftest.$ac_ext <<EOF
4672 #include <${cf_cv_ncurses_header:-curses.h}>
4673 #undef Autoconf
4674 #ifdef NCURSES_VERSION
4675 Autoconf NCURSES_VERSION
4676 #else
4677 #ifdef __NCURSES_H
4678 Autoconf "old"
4679 #endif
4680 ;
4681 #endif
4682 EOF
4683         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4684         { (eval echo "$as_me:4684: \"$cf_try\"") >&5
4685   (eval $cf_try) 2>&5
4686   ac_status=$?
4687   echo "$as_me:4687: \$? = $ac_status" >&5
4688   (exit $ac_status); }
4689         if test -f conftest.out ; then
4690                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4691                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4692                 rm -f conftest.out
4693         fi
4694
4695 else
4696   cat >conftest.$ac_ext <<_ACEOF
4697 #line 4697 "configure"
4698 #include "confdefs.h"
4699
4700 #include <${cf_cv_ncurses_header:-curses.h}>
4701 #include <stdio.h>
4702 int main()
4703 {
4704         FILE *fp = fopen("$cf_tempfile", "w");
4705 #ifdef NCURSES_VERSION
4706 # ifdef NCURSES_VERSION_PATCH
4707         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4708 # else
4709         fprintf(fp, "%s\n", NCURSES_VERSION);
4710 # endif
4711 #else
4712 # ifdef __NCURSES_H
4713         fprintf(fp, "old\n");
4714 # else
4715         make an error
4716 # endif
4717 #endif
4718         ${cf_cv_main_return:-return}(0);
4719 }
4720 _ACEOF
4721 rm -f conftest$ac_exeext
4722 if { (eval echo "$as_me:4722: \"$ac_link\"") >&5
4723   (eval $ac_link) 2>&5
4724   ac_status=$?
4725   echo "$as_me:4725: \$? = $ac_status" >&5
4726   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4727   { (eval echo "$as_me:4727: \"$ac_try\"") >&5
4728   (eval $ac_try) 2>&5
4729   ac_status=$?
4730   echo "$as_me:4730: \$? = $ac_status" >&5
4731   (exit $ac_status); }; }; then
4732
4733         cf_cv_ncurses_version=`cat $cf_tempfile`
4734 else
4735   echo "$as_me: program exited with status $ac_status" >&5
4736 echo "$as_me: failed program was:" >&5
4737 cat conftest.$ac_ext >&5
4738 fi
4739 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4740 fi
4741         rm -f $cf_tempfile
4742
4743 fi
4744 echo "$as_me:4744: result: $cf_cv_ncurses_version" >&5
4745 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4746 test "$cf_cv_ncurses_version" = no ||
4747 cat >>confdefs.h <<\EOF
4748 #define NCURSES 1
4749 EOF
4750
4751 echo "$as_me:4751: checking if we have identified curses libraries" >&5
4752 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
4753 cat >conftest.$ac_ext <<_ACEOF
4754 #line 4754 "configure"
4755 #include "confdefs.h"
4756 #include <${cf_cv_ncurses_header:-curses.h}>
4757 int
4758 main ()
4759 {
4760 initscr(); tgoto("?", 0,0)
4761   ;
4762   return 0;
4763 }
4764 _ACEOF
4765 rm -f conftest.$ac_objext conftest$ac_exeext
4766 if { (eval echo "$as_me:4766: \"$ac_link\"") >&5
4767   (eval $ac_link) 2>&5
4768   ac_status=$?
4769   echo "$as_me:4769: \$? = $ac_status" >&5
4770   (exit $ac_status); } &&
4771          { ac_try='test -s conftest$ac_exeext'
4772   { (eval echo "$as_me:4772: \"$ac_try\"") >&5
4773   (eval $ac_try) 2>&5
4774   ac_status=$?
4775   echo "$as_me:4775: \$? = $ac_status" >&5
4776   (exit $ac_status); }; }; then
4777   cf_result=yes
4778 else
4779   echo "$as_me: failed program was:" >&5
4780 cat conftest.$ac_ext >&5
4781 cf_result=no
4782 fi
4783 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4784 echo "$as_me:4784: result: $cf_result" >&5
4785 echo "${ECHO_T}$cf_result" >&6
4786
4787 if test "$cf_result" = no ; then
4788 case $host_os in #(vi
4789 freebsd*) #(vi
4790     echo "$as_me:4790: checking for tgoto in -lmytinfo" >&5
4791 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4792 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4793   echo $ECHO_N "(cached) $ECHO_C" >&6
4794 else
4795   ac_check_lib_save_LIBS=$LIBS
4796 LIBS="-lmytinfo  $LIBS"
4797 cat >conftest.$ac_ext <<_ACEOF
4798 #line 4798 "configure"
4799 #include "confdefs.h"
4800
4801 /* Override any gcc2 internal prototype to avoid an error.  */
4802 #ifdef __cplusplus
4803 extern "C"
4804 #endif
4805 /* We use char because int might match the return type of a gcc2
4806    builtin and then its argument prototype would still apply.  */
4807 char tgoto ();
4808 int
4809 main ()
4810 {
4811 tgoto ();
4812   ;
4813   return 0;
4814 }
4815 _ACEOF
4816 rm -f conftest.$ac_objext conftest$ac_exeext
4817 if { (eval echo "$as_me:4817: \"$ac_link\"") >&5
4818   (eval $ac_link) 2>&5
4819   ac_status=$?
4820   echo "$as_me:4820: \$? = $ac_status" >&5
4821   (exit $ac_status); } &&
4822          { ac_try='test -s conftest$ac_exeext'
4823   { (eval echo "$as_me:4823: \"$ac_try\"") >&5
4824   (eval $ac_try) 2>&5
4825   ac_status=$?
4826   echo "$as_me:4826: \$? = $ac_status" >&5
4827   (exit $ac_status); }; }; then
4828   ac_cv_lib_mytinfo_tgoto=yes
4829 else
4830   echo "$as_me: failed program was:" >&5
4831 cat conftest.$ac_ext >&5
4832 ac_cv_lib_mytinfo_tgoto=no
4833 fi
4834 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4835 LIBS=$ac_check_lib_save_LIBS
4836 fi
4837 echo "$as_me:4837: result: $ac_cv_lib_mytinfo_tgoto" >&5
4838 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4839 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4840   LIBS="-lmytinfo $LIBS"
4841 fi
4842
4843     ;;
4844 hpux10.*) #(vi
4845         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
4846         # next (1998), and xcurses "newer" (2000).  There is no header file for
4847         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
4848         # term.h) for cur_colr
4849         if test "x$cf_cv_screen" = "xcurses_colr"
4850         then
4851                 echo "$as_me:4851: checking for initscr in -lcur_colr" >&5
4852 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
4853 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
4854   echo $ECHO_N "(cached) $ECHO_C" >&6
4855 else
4856   ac_check_lib_save_LIBS=$LIBS
4857 LIBS="-lcur_colr  $LIBS"
4858 cat >conftest.$ac_ext <<_ACEOF
4859 #line 4859 "configure"
4860 #include "confdefs.h"
4861
4862 /* Override any gcc2 internal prototype to avoid an error.  */
4863 #ifdef __cplusplus
4864 extern "C"
4865 #endif
4866 /* We use char because int might match the return type of a gcc2
4867    builtin and then its argument prototype would still apply.  */
4868 char initscr ();
4869 int
4870 main ()
4871 {
4872 initscr ();
4873   ;
4874   return 0;
4875 }
4876 _ACEOF
4877 rm -f conftest.$ac_objext conftest$ac_exeext
4878 if { (eval echo "$as_me:4878: \"$ac_link\"") >&5
4879   (eval $ac_link) 2>&5
4880   ac_status=$?
4881   echo "$as_me:4881: \$? = $ac_status" >&5
4882   (exit $ac_status); } &&
4883          { ac_try='test -s conftest$ac_exeext'
4884   { (eval echo "$as_me:4884: \"$ac_try\"") >&5
4885   (eval $ac_try) 2>&5
4886   ac_status=$?
4887   echo "$as_me:4887: \$? = $ac_status" >&5
4888   (exit $ac_status); }; }; then
4889   ac_cv_lib_cur_colr_initscr=yes
4890 else
4891   echo "$as_me: failed program was:" >&5
4892 cat conftest.$ac_ext >&5
4893 ac_cv_lib_cur_colr_initscr=no
4894 fi
4895 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4896 LIBS=$ac_check_lib_save_LIBS
4897 fi
4898 echo "$as_me:4898: result: $ac_cv_lib_cur_colr_initscr" >&5
4899 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
4900 if test $ac_cv_lib_cur_colr_initscr = yes; then
4901
4902                         LIBS="-lcur_colr $LIBS"
4903                         ac_cv_func_initscr=yes
4904
4905 else
4906
4907                 echo "$as_me:4907: checking for initscr in -lHcurses" >&5
4908 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
4909 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
4910   echo $ECHO_N "(cached) $ECHO_C" >&6
4911 else
4912   ac_check_lib_save_LIBS=$LIBS
4913 LIBS="-lHcurses  $LIBS"
4914 cat >conftest.$ac_ext <<_ACEOF
4915 #line 4915 "configure"
4916 #include "confdefs.h"
4917
4918 /* Override any gcc2 internal prototype to avoid an error.  */
4919 #ifdef __cplusplus
4920 extern "C"
4921 #endif
4922 /* We use char because int might match the return type of a gcc2
4923    builtin and then its argument prototype would still apply.  */
4924 char initscr ();
4925 int
4926 main ()
4927 {
4928 initscr ();
4929   ;
4930   return 0;
4931 }
4932 _ACEOF
4933 rm -f conftest.$ac_objext conftest$ac_exeext
4934 if { (eval echo "$as_me:4934: \"$ac_link\"") >&5
4935   (eval $ac_link) 2>&5
4936   ac_status=$?
4937   echo "$as_me:4937: \$? = $ac_status" >&5
4938   (exit $ac_status); } &&
4939          { ac_try='test -s conftest$ac_exeext'
4940   { (eval echo "$as_me:4940: \"$ac_try\"") >&5
4941   (eval $ac_try) 2>&5
4942   ac_status=$?
4943   echo "$as_me:4943: \$? = $ac_status" >&5
4944   (exit $ac_status); }; }; then
4945   ac_cv_lib_Hcurses_initscr=yes
4946 else
4947   echo "$as_me: failed program was:" >&5
4948 cat conftest.$ac_ext >&5
4949 ac_cv_lib_Hcurses_initscr=no
4950 fi
4951 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4952 LIBS=$ac_check_lib_save_LIBS
4953 fi
4954 echo "$as_me:4954: result: $ac_cv_lib_Hcurses_initscr" >&5
4955 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
4956 if test $ac_cv_lib_Hcurses_initscr = yes; then
4957
4958                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
4959                         LIBS="-lHcurses $LIBS"
4960                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
4961                         ac_cv_func_initscr=yes
4962
4963 fi
4964
4965 fi
4966
4967         fi
4968         ;;
4969 linux*)
4970         case `arch 2>/dev/null` in
4971         x86_64)
4972                 if test -d /lib64
4973                 then
4974
4975 if test -n "/lib64" ; then
4976   for cf_add_libdir in /lib64
4977   do
4978     if test $cf_add_libdir = /usr/lib ; then
4979       :
4980     elif test -d $cf_add_libdir
4981     then
4982       cf_have_libdir=no
4983       if test -n "$LDFLAGS$LIBS" ; then
4984         # a loop is needed to ensure we can add subdirs of existing dirs
4985         for cf_test_libdir in $LDFLAGS $LIBS ; do
4986           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4987             cf_have_libdir=yes; break
4988           fi
4989         done
4990       fi
4991       if test "$cf_have_libdir" = no ; then
4992         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4993
4994 echo "${as_me:-configure}:4994: testing adding $cf_add_libdir to library-path ..." 1>&5
4995
4996         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4997       fi
4998     fi
4999   done
5000 fi
5001
5002                 else
5003
5004 if test -n "/lib" ; then
5005   for cf_add_libdir in /lib
5006   do
5007     if test $cf_add_libdir = /usr/lib ; then
5008       :
5009     elif test -d $cf_add_libdir
5010     then
5011       cf_have_libdir=no
5012       if test -n "$LDFLAGS$LIBS" ; then
5013         # a loop is needed to ensure we can add subdirs of existing dirs
5014         for cf_test_libdir in $LDFLAGS $LIBS ; do
5015           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5016             cf_have_libdir=yes; break
5017           fi
5018         done
5019       fi
5020       if test "$cf_have_libdir" = no ; then
5021         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5022
5023 echo "${as_me:-configure}:5023: testing adding $cf_add_libdir to library-path ..." 1>&5
5024
5025         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5026       fi
5027     fi
5028   done
5029 fi
5030
5031                 fi
5032                 ;;
5033         *)
5034
5035 if test -n "/lib" ; then
5036   for cf_add_libdir in /lib
5037   do
5038     if test $cf_add_libdir = /usr/lib ; then
5039       :
5040     elif test -d $cf_add_libdir
5041     then
5042       cf_have_libdir=no
5043       if test -n "$LDFLAGS$LIBS" ; then
5044         # a loop is needed to ensure we can add subdirs of existing dirs
5045         for cf_test_libdir in $LDFLAGS $LIBS ; do
5046           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5047             cf_have_libdir=yes; break
5048           fi
5049         done
5050       fi
5051       if test "$cf_have_libdir" = no ; then
5052         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5053
5054 echo "${as_me:-configure}:5054: testing adding $cf_add_libdir to library-path ..." 1>&5
5055
5056         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5057       fi
5058     fi
5059   done
5060 fi
5061
5062                 ;;
5063         esac
5064         ;;
5065 sunos3*|sunos4*)
5066         if test "x$cf_cv_screen" = "xcurses_5lib"
5067         then
5068                 if test -d /usr/5lib ; then
5069
5070 if test -n "/usr/5lib" ; then
5071   for cf_add_libdir in /usr/5lib
5072   do
5073     if test $cf_add_libdir = /usr/lib ; then
5074       :
5075     elif test -d $cf_add_libdir
5076     then
5077       cf_have_libdir=no
5078       if test -n "$LDFLAGS$LIBS" ; then
5079         # a loop is needed to ensure we can add subdirs of existing dirs
5080         for cf_test_libdir in $LDFLAGS $LIBS ; do
5081           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5082             cf_have_libdir=yes; break
5083           fi
5084         done
5085       fi
5086       if test "$cf_have_libdir" = no ; then
5087         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5088
5089 echo "${as_me:-configure}:5089: testing adding $cf_add_libdir to library-path ..." 1>&5
5090
5091         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5092       fi
5093     fi
5094   done
5095 fi
5096
5097                         LIBS="-lcurses -ltermcap $LIBS"
5098                 fi
5099     fi
5100     ac_cv_func_initscr=yes
5101     ;;
5102 esac
5103
5104 if test ".$ac_cv_func_initscr" != .yes ; then
5105         cf_save_LIBS="$LIBS"
5106
5107         if test ".${cf_cv_ncurses_version:-no}" != .no
5108         then
5109                 cf_check_list="ncurses curses cursesX"
5110         else
5111                 cf_check_list="cursesX curses ncurses"
5112         fi
5113
5114         # Check for library containing tgoto.  Do this before curses library
5115         # because it may be needed to link the test-case for initscr.
5116         if test "x$cf_term_lib" = x
5117         then
5118                 echo "$as_me:5118: checking for tgoto" >&5
5119 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5120 if test "${ac_cv_func_tgoto+set}" = set; then
5121   echo $ECHO_N "(cached) $ECHO_C" >&6
5122 else
5123   cat >conftest.$ac_ext <<_ACEOF
5124 #line 5124 "configure"
5125 #include "confdefs.h"
5126 /* System header to define __stub macros and hopefully few prototypes,
5127     which can conflict with char tgoto (); below.  */
5128 #include <assert.h>
5129 /* Override any gcc2 internal prototype to avoid an error.  */
5130 #ifdef __cplusplus
5131 extern "C"
5132 #endif
5133 /* We use char because int might match the return type of a gcc2
5134    builtin and then its argument prototype would still apply.  */
5135 char tgoto ();
5136 char (*f) ();
5137
5138 int
5139 main ()
5140 {
5141 /* The GNU C library defines this for functions which it implements
5142     to always fail with ENOSYS.  Some functions are actually named
5143     something starting with __ and the normal name is an alias.  */
5144 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5145 choke me
5146 #else
5147 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5148 #endif
5149
5150   ;
5151   return 0;
5152 }
5153 _ACEOF
5154 rm -f conftest.$ac_objext conftest$ac_exeext
5155 if { (eval echo "$as_me:5155: \"$ac_link\"") >&5
5156   (eval $ac_link) 2>&5
5157   ac_status=$?
5158   echo "$as_me:5158: \$? = $ac_status" >&5
5159   (exit $ac_status); } &&
5160          { ac_try='test -s conftest$ac_exeext'
5161   { (eval echo "$as_me:5161: \"$ac_try\"") >&5
5162   (eval $ac_try) 2>&5
5163   ac_status=$?
5164   echo "$as_me:5164: \$? = $ac_status" >&5
5165   (exit $ac_status); }; }; then
5166   ac_cv_func_tgoto=yes
5167 else
5168   echo "$as_me: failed program was:" >&5
5169 cat conftest.$ac_ext >&5
5170 ac_cv_func_tgoto=no
5171 fi
5172 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5173 fi
5174 echo "$as_me:5174: result: $ac_cv_func_tgoto" >&5
5175 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5176 if test $ac_cv_func_tgoto = yes; then
5177   cf_term_lib=predefined
5178 else
5179
5180                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5181                         do
5182                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5183 echo "$as_me:5183: checking for tgoto in -l$cf_term_lib" >&5
5184 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5185 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5186   echo $ECHO_N "(cached) $ECHO_C" >&6
5187 else
5188   ac_check_lib_save_LIBS=$LIBS
5189 LIBS="-l$cf_term_lib  $LIBS"
5190 cat >conftest.$ac_ext <<_ACEOF
5191 #line 5191 "configure"
5192 #include "confdefs.h"
5193
5194 /* Override any gcc2 internal prototype to avoid an error.  */
5195 #ifdef __cplusplus
5196 extern "C"
5197 #endif
5198 /* We use char because int might match the return type of a gcc2
5199    builtin and then its argument prototype would still apply.  */
5200 char tgoto ();
5201 int
5202 main ()
5203 {
5204 tgoto ();
5205   ;
5206   return 0;
5207 }
5208 _ACEOF
5209 rm -f conftest.$ac_objext conftest$ac_exeext
5210 if { (eval echo "$as_me:5210: \"$ac_link\"") >&5
5211   (eval $ac_link) 2>&5
5212   ac_status=$?
5213   echo "$as_me:5213: \$? = $ac_status" >&5
5214   (exit $ac_status); } &&
5215          { ac_try='test -s conftest$ac_exeext'
5216   { (eval echo "$as_me:5216: \"$ac_try\"") >&5
5217   (eval $ac_try) 2>&5
5218   ac_status=$?
5219   echo "$as_me:5219: \$? = $ac_status" >&5
5220   (exit $ac_status); }; }; then
5221   eval "$as_ac_Lib=yes"
5222 else
5223   echo "$as_me: failed program was:" >&5
5224 cat conftest.$ac_ext >&5
5225 eval "$as_ac_Lib=no"
5226 fi
5227 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5228 LIBS=$ac_check_lib_save_LIBS
5229 fi
5230 echo "$as_me:5230: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5231 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5232 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5233   break
5234 fi
5235
5236                         done
5237
5238 fi
5239
5240         fi
5241
5242         # Check for library containing initscr
5243         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5244         if test "x$cf_curs_lib" = x
5245         then
5246                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5247                 do
5248                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5249 echo "$as_me:5249: checking for initscr in -l$cf_curs_lib" >&5
5250 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5251 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5252   echo $ECHO_N "(cached) $ECHO_C" >&6
5253 else
5254   ac_check_lib_save_LIBS=$LIBS
5255 LIBS="-l$cf_curs_lib  $LIBS"
5256 cat >conftest.$ac_ext <<_ACEOF
5257 #line 5257 "configure"
5258 #include "confdefs.h"
5259
5260 /* Override any gcc2 internal prototype to avoid an error.  */
5261 #ifdef __cplusplus
5262 extern "C"
5263 #endif
5264 /* We use char because int might match the return type of a gcc2
5265    builtin and then its argument prototype would still apply.  */
5266 char initscr ();
5267 int
5268 main ()
5269 {
5270 initscr ();
5271   ;
5272   return 0;
5273 }
5274 _ACEOF
5275 rm -f conftest.$ac_objext conftest$ac_exeext
5276 if { (eval echo "$as_me:5276: \"$ac_link\"") >&5
5277   (eval $ac_link) 2>&5
5278   ac_status=$?
5279   echo "$as_me:5279: \$? = $ac_status" >&5
5280   (exit $ac_status); } &&
5281          { ac_try='test -s conftest$ac_exeext'
5282   { (eval echo "$as_me:5282: \"$ac_try\"") >&5
5283   (eval $ac_try) 2>&5
5284   ac_status=$?
5285   echo "$as_me:5285: \$? = $ac_status" >&5
5286   (exit $ac_status); }; }; then
5287   eval "$as_ac_Lib=yes"
5288 else
5289   echo "$as_me: failed program was:" >&5
5290 cat conftest.$ac_ext >&5
5291 eval "$as_ac_Lib=no"
5292 fi
5293 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5294 LIBS=$ac_check_lib_save_LIBS
5295 fi
5296 echo "$as_me:5296: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5297 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5298 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5299   break
5300 fi
5301
5302                 done
5303         fi
5304         test $cf_curs_lib = unknown && { { echo "$as_me:5304: error: no curses library found" >&5
5305 echo "$as_me: error: no curses library found" >&2;}
5306    { (exit 1); exit 1; }; }
5307
5308         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5309         if test "$cf_term_lib" = unknown ; then
5310                 echo "$as_me:5310: checking if we can link with $cf_curs_lib library" >&5
5311 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5312                 cat >conftest.$ac_ext <<_ACEOF
5313 #line 5313 "configure"
5314 #include "confdefs.h"
5315 #include <${cf_cv_ncurses_header:-curses.h}>
5316 int
5317 main ()
5318 {
5319 initscr()
5320   ;
5321   return 0;
5322 }
5323 _ACEOF
5324 rm -f conftest.$ac_objext conftest$ac_exeext
5325 if { (eval echo "$as_me:5325: \"$ac_link\"") >&5
5326   (eval $ac_link) 2>&5
5327   ac_status=$?
5328   echo "$as_me:5328: \$? = $ac_status" >&5
5329   (exit $ac_status); } &&
5330          { ac_try='test -s conftest$ac_exeext'
5331   { (eval echo "$as_me:5331: \"$ac_try\"") >&5
5332   (eval $ac_try) 2>&5
5333   ac_status=$?
5334   echo "$as_me:5334: \$? = $ac_status" >&5
5335   (exit $ac_status); }; }; then
5336   cf_result=yes
5337 else
5338   echo "$as_me: failed program was:" >&5
5339 cat conftest.$ac_ext >&5
5340 cf_result=no
5341 fi
5342 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5343                 echo "$as_me:5343: result: $cf_result" >&5
5344 echo "${ECHO_T}$cf_result" >&6
5345                 test $cf_result = no && { { echo "$as_me:5345: error: Cannot link curses library" >&5
5346 echo "$as_me: error: Cannot link curses library" >&2;}
5347    { (exit 1); exit 1; }; }
5348         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5349                 :
5350         elif test "$cf_term_lib" != predefined ; then
5351                 echo "$as_me:5351: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5352 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5353                 cat >conftest.$ac_ext <<_ACEOF
5354 #line 5354 "configure"
5355 #include "confdefs.h"
5356 #include <${cf_cv_ncurses_header:-curses.h}>
5357 int
5358 main ()
5359 {
5360 initscr(); tgoto((char *)0, 0, 0);
5361   ;
5362   return 0;
5363 }
5364 _ACEOF
5365 rm -f conftest.$ac_objext conftest$ac_exeext
5366 if { (eval echo "$as_me:5366: \"$ac_link\"") >&5
5367   (eval $ac_link) 2>&5
5368   ac_status=$?
5369   echo "$as_me:5369: \$? = $ac_status" >&5
5370   (exit $ac_status); } &&
5371          { ac_try='test -s conftest$ac_exeext'
5372   { (eval echo "$as_me:5372: \"$ac_try\"") >&5
5373   (eval $ac_try) 2>&5
5374   ac_status=$?
5375   echo "$as_me:5375: \$? = $ac_status" >&5
5376   (exit $ac_status); }; }; then
5377   cf_result=no
5378 else
5379   echo "$as_me: failed program was:" >&5
5380 cat conftest.$ac_ext >&5
5381
5382                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5383                         cat >conftest.$ac_ext <<_ACEOF
5384 #line 5384 "configure"
5385 #include "confdefs.h"
5386 #include <${cf_cv_ncurses_header:-curses.h}>
5387 int
5388 main ()
5389 {
5390 initscr()
5391   ;
5392   return 0;
5393 }
5394 _ACEOF
5395 rm -f conftest.$ac_objext conftest$ac_exeext
5396 if { (eval echo "$as_me:5396: \"$ac_link\"") >&5
5397   (eval $ac_link) 2>&5
5398   ac_status=$?
5399   echo "$as_me:5399: \$? = $ac_status" >&5
5400   (exit $ac_status); } &&
5401          { ac_try='test -s conftest$ac_exeext'
5402   { (eval echo "$as_me:5402: \"$ac_try\"") >&5
5403   (eval $ac_try) 2>&5
5404   ac_status=$?
5405   echo "$as_me:5405: \$? = $ac_status" >&5
5406   (exit $ac_status); }; }; then
5407   cf_result=yes
5408 else
5409   echo "$as_me: failed program was:" >&5
5410 cat conftest.$ac_ext >&5
5411 cf_result=error
5412 fi
5413 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5414
5415 fi
5416 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5417                 echo "$as_me:5417: result: $cf_result" >&5
5418 echo "${ECHO_T}$cf_result" >&6
5419         fi
5420 fi
5421 fi
5422
5423         ;;
5424 ncurses) #(vi
5425
5426 cf_ncuconfig_root=ncurses
5427
5428 echo "Looking for ${cf_ncuconfig_root}-config"
5429
5430 if test -n "$ac_tool_prefix"; then
5431   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5432   do
5433     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5434 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5435 echo "$as_me:5435: checking for $ac_word" >&5
5436 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5437 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5438   echo $ECHO_N "(cached) $ECHO_C" >&6
5439 else
5440   if test -n "$NCURSES_CONFIG"; then
5441   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5442 else
5443   ac_save_IFS=$IFS; IFS=$ac_path_separator
5444 ac_dummy="$PATH"
5445 for ac_dir in $ac_dummy; do
5446   IFS=$ac_save_IFS
5447   test -z "$ac_dir" && ac_dir=.
5448   $as_executable_p "$ac_dir/$ac_word" || continue
5449 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5450 echo "$as_me:5450: found $ac_dir/$ac_word" >&5
5451 break
5452 done
5453
5454 fi
5455 fi
5456 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5457 if test -n "$NCURSES_CONFIG"; then
5458   echo "$as_me:5458: result: $NCURSES_CONFIG" >&5
5459 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5460 else
5461   echo "$as_me:5461: result: no" >&5
5462 echo "${ECHO_T}no" >&6
5463 fi
5464
5465     test -n "$NCURSES_CONFIG" && break
5466   done
5467 fi
5468 if test -z "$NCURSES_CONFIG"; then
5469   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5470   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5471 do
5472   # Extract the first word of "$ac_prog", so it can be a program name with args.
5473 set dummy $ac_prog; ac_word=$2
5474 echo "$as_me:5474: checking for $ac_word" >&5
5475 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5476 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5477   echo $ECHO_N "(cached) $ECHO_C" >&6
5478 else
5479   if test -n "$ac_ct_NCURSES_CONFIG"; then
5480   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5481 else
5482   ac_save_IFS=$IFS; IFS=$ac_path_separator
5483 ac_dummy="$PATH"
5484 for ac_dir in $ac_dummy; do
5485   IFS=$ac_save_IFS
5486   test -z "$ac_dir" && ac_dir=.
5487   $as_executable_p "$ac_dir/$ac_word" || continue
5488 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5489 echo "$as_me:5489: found $ac_dir/$ac_word" >&5
5490 break
5491 done
5492
5493 fi
5494 fi
5495 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5496 if test -n "$ac_ct_NCURSES_CONFIG"; then
5497   echo "$as_me:5497: result: $ac_ct_NCURSES_CONFIG" >&5
5498 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5499 else
5500   echo "$as_me:5500: result: no" >&5
5501 echo "${ECHO_T}no" >&6
5502 fi
5503
5504   test -n "$ac_ct_NCURSES_CONFIG" && break
5505 done
5506 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5507
5508   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5509 fi
5510
5511 if test "$NCURSES_CONFIG" != none ; then
5512
5513 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5514 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
5515
5516 # even with config script, some packages use no-override for curses.h
5517
5518 echo "$as_me:5518: checking if we have identified curses headers" >&5
5519 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5520 if test "${cf_cv_ncurses_header+set}" = set; then
5521   echo $ECHO_N "(cached) $ECHO_C" >&6
5522 else
5523
5524 cf_cv_ncurses_header=none
5525 for cf_header in  \
5526     ncurses/ncurses.h \
5527         ncurses/curses.h \
5528         ncurses.h \
5529         curses.h
5530 do
5531 cat >conftest.$ac_ext <<_ACEOF
5532 #line 5532 "configure"
5533 #include "confdefs.h"
5534 #include <${cf_header}>
5535 int
5536 main ()
5537 {
5538 initscr(); tgoto("?", 0,0)
5539   ;
5540   return 0;
5541 }
5542 _ACEOF
5543 rm -f conftest.$ac_objext
5544 if { (eval echo "$as_me:5544: \"$ac_compile\"") >&5
5545   (eval $ac_compile) 2>&5
5546   ac_status=$?
5547   echo "$as_me:5547: \$? = $ac_status" >&5
5548   (exit $ac_status); } &&
5549          { ac_try='test -s conftest.$ac_objext'
5550   { (eval echo "$as_me:5550: \"$ac_try\"") >&5
5551   (eval $ac_try) 2>&5
5552   ac_status=$?
5553   echo "$as_me:5553: \$? = $ac_status" >&5
5554   (exit $ac_status); }; }; then
5555   cf_cv_ncurses_header=$cf_header; break
5556 else
5557   echo "$as_me: failed program was:" >&5
5558 cat conftest.$ac_ext >&5
5559 fi
5560 rm -f conftest.$ac_objext conftest.$ac_ext
5561 done
5562
5563 fi
5564 echo "$as_me:5564: result: $cf_cv_ncurses_header" >&5
5565 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5566
5567 if test "$cf_cv_ncurses_header" = none ; then
5568         { { echo "$as_me:5568: error: No curses header-files found" >&5
5569 echo "$as_me: error: No curses header-files found" >&2;}
5570    { (exit 1); exit 1; }; }
5571 fi
5572
5573 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5574
5575 for ac_header in $cf_cv_ncurses_header
5576 do
5577 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5578 echo "$as_me:5578: checking for $ac_header" >&5
5579 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5580 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5581   echo $ECHO_N "(cached) $ECHO_C" >&6
5582 else
5583   cat >conftest.$ac_ext <<_ACEOF
5584 #line 5584 "configure"
5585 #include "confdefs.h"
5586 #include <$ac_header>
5587 _ACEOF
5588 if { (eval echo "$as_me:5588: \"$ac_cpp conftest.$ac_ext\"") >&5
5589   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5590   ac_status=$?
5591   egrep -v '^ *\+' conftest.er1 >conftest.err
5592   rm -f conftest.er1
5593   cat conftest.err >&5
5594   echo "$as_me:5594: \$? = $ac_status" >&5
5595   (exit $ac_status); } >/dev/null; then
5596   if test -s conftest.err; then
5597     ac_cpp_err=$ac_c_preproc_warn_flag
5598   else
5599     ac_cpp_err=
5600   fi
5601 else
5602   ac_cpp_err=yes
5603 fi
5604 if test -z "$ac_cpp_err"; then
5605   eval "$as_ac_Header=yes"
5606 else
5607   echo "$as_me: failed program was:" >&5
5608   cat conftest.$ac_ext >&5
5609   eval "$as_ac_Header=no"
5610 fi
5611 rm -f conftest.err conftest.$ac_ext
5612 fi
5613 echo "$as_me:5613: result: `eval echo '${'$as_ac_Header'}'`" >&5
5614 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5615 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5616   cat >>confdefs.h <<EOF
5617 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5618 EOF
5619
5620 fi
5621 done
5622
5623 cat >>confdefs.h <<\EOF
5624 #define NCURSES 1
5625 EOF
5626
5627 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5628
5629 cat >>confdefs.h <<EOF
5630 #define $cf_nculib_ROOT 1
5631 EOF
5632
5633 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5634
5635 else
5636
5637 cf_ncuhdr_root=ncurses
5638
5639 test -n "$cf_cv_curses_dir" && \
5640 test "$cf_cv_curses_dir" != "no" && { \
5641
5642 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5643   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5644   do
5645         while test $cf_add_incdir != /usr/include
5646         do
5647           if test -d $cf_add_incdir
5648           then
5649                 cf_have_incdir=no
5650                 if test -n "$CFLAGS$CPPFLAGS" ; then
5651                   # a loop is needed to ensure we can add subdirs of existing dirs
5652                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5653                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5654                           cf_have_incdir=yes; break
5655                         fi
5656                   done
5657                 fi
5658
5659                 if test "$cf_have_incdir" = no ; then
5660                   if test "$cf_add_incdir" = /usr/local/include ; then
5661                         if test "$GCC" = yes
5662                         then
5663                           cf_save_CPPFLAGS=$CPPFLAGS
5664                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5665                           cat >conftest.$ac_ext <<_ACEOF
5666 #line 5666 "configure"
5667 #include "confdefs.h"
5668 #include <stdio.h>
5669 int
5670 main ()
5671 {
5672 printf("Hello")
5673   ;
5674   return 0;
5675 }
5676 _ACEOF
5677 rm -f conftest.$ac_objext
5678 if { (eval echo "$as_me:5678: \"$ac_compile\"") >&5
5679   (eval $ac_compile) 2>&5
5680   ac_status=$?
5681   echo "$as_me:5681: \$? = $ac_status" >&5
5682   (exit $ac_status); } &&
5683          { ac_try='test -s conftest.$ac_objext'
5684   { (eval echo "$as_me:5684: \"$ac_try\"") >&5
5685   (eval $ac_try) 2>&5
5686   ac_status=$?
5687   echo "$as_me:5687: \$? = $ac_status" >&5
5688   (exit $ac_status); }; }; then
5689   :
5690 else
5691   echo "$as_me: failed program was:" >&5
5692 cat conftest.$ac_ext >&5
5693 cf_have_incdir=yes
5694 fi
5695 rm -f conftest.$ac_objext conftest.$ac_ext
5696                           CPPFLAGS=$cf_save_CPPFLAGS
5697                         fi
5698                   fi
5699                 fi
5700
5701                 if test "$cf_have_incdir" = no ; then
5702                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5703
5704 echo "${as_me:-configure}:5704: testing adding $cf_add_incdir to include-path ..." 1>&5
5705
5706                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5707
5708                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5709                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5710                   cf_add_incdir="$cf_top_incdir"
5711                 else
5712                   break
5713                 fi
5714           fi
5715         done
5716   done
5717 fi
5718
5719 }
5720
5721 echo "$as_me:5721: checking for $cf_ncuhdr_root header in include-path" >&5
5722 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5723 if test "${cf_cv_ncurses_h+set}" = set; then
5724   echo $ECHO_N "(cached) $ECHO_C" >&6
5725 else
5726
5727         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5728         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5729         for cf_header in $cf_header_list
5730         do
5731
5732         cat >conftest.$ac_ext <<_ACEOF
5733 #line 5733 "configure"
5734 #include "confdefs.h"
5735
5736 #include <$cf_header>
5737 int
5738 main ()
5739 {
5740
5741 #ifdef NCURSES_VERSION
5742
5743 printf("%s\n", NCURSES_VERSION);
5744 #else
5745 #ifdef __NCURSES_H
5746 printf("old\n");
5747 #else
5748         make an error
5749 #endif
5750 #endif
5751
5752   ;
5753   return 0;
5754 }
5755 _ACEOF
5756 rm -f conftest.$ac_objext
5757 if { (eval echo "$as_me:5757: \"$ac_compile\"") >&5
5758   (eval $ac_compile) 2>&5
5759   ac_status=$?
5760   echo "$as_me:5760: \$? = $ac_status" >&5
5761   (exit $ac_status); } &&
5762          { ac_try='test -s conftest.$ac_objext'
5763   { (eval echo "$as_me:5763: \"$ac_try\"") >&5
5764   (eval $ac_try) 2>&5
5765   ac_status=$?
5766   echo "$as_me:5766: \$? = $ac_status" >&5
5767   (exit $ac_status); }; }; then
5768   cf_cv_ncurses_h=$cf_header
5769
5770 else
5771   echo "$as_me: failed program was:" >&5
5772 cat conftest.$ac_ext >&5
5773 cf_cv_ncurses_h=no
5774 fi
5775 rm -f conftest.$ac_objext conftest.$ac_ext
5776
5777                 test "$cf_cv_ncurses_h" != no && break
5778         done
5779
5780 fi
5781 echo "$as_me:5781: result: $cf_cv_ncurses_h" >&5
5782 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5783
5784 if test "$cf_cv_ncurses_h" != no ; then
5785         cf_cv_ncurses_header=$cf_cv_ncurses_h
5786 else
5787
5788 echo "$as_me:5788: checking for $cf_ncuhdr_root include-path" >&5
5789 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5790 if test "${cf_cv_ncurses_h2+set}" = set; then
5791   echo $ECHO_N "(cached) $ECHO_C" >&6
5792 else
5793
5794         test -n "$verbose" && echo
5795
5796 cf_search=
5797
5798 # collect the current set of include-directories from compiler flags
5799 cf_header_path_list=""
5800 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5801         for cf_header_path in $CPPFLAGS $CFLAGS
5802         do
5803                 case $cf_header_path in #(vi
5804                 -I*)
5805                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5806
5807 test "$cf_header_path" != "NONE" && \
5808 test -d "$cf_header_path" && \
5809  {
5810         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5811         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5812         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5813         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5814         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5815         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"
5816 }
5817
5818                         cf_header_path_list="$cf_header_path_list $cf_search"
5819                         ;;
5820                 esac
5821         done
5822 fi
5823
5824 # add the variations for the package we are looking for
5825
5826 cf_search=
5827
5828 test "/usr" != "$prefix" && \
5829 test -d "/usr" && \
5830 (test $prefix = NONE || test "/usr" != "$prefix") && {
5831         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
5832         test -d /usr/include &&          cf_search="$cf_search /usr/include"
5833         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
5834         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
5835         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
5836         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5837 }
5838
5839 test "$prefix" != "NONE" && \
5840 test -d "$prefix" && \
5841  {
5842         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5843         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5844         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5845         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5846         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5847         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5848 }
5849
5850 test "/usr/local" != "$prefix" && \
5851 test -d "/usr/local" && \
5852 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
5853         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
5854         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
5855         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
5856         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
5857         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
5858         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5859 }
5860
5861 test "/opt" != "$prefix" && \
5862 test -d "/opt" && \
5863 (test $prefix = NONE || test "/opt" != "$prefix") && {
5864         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
5865         test -d /opt/include &&          cf_search="$cf_search /opt/include"
5866         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
5867         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
5868         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
5869         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5870 }
5871
5872 test "$HOME" != "$prefix" && \
5873 test -d "$HOME" && \
5874 (test $prefix = NONE || test "$HOME" != "$prefix") && {
5875         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
5876         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
5877         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
5878         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
5879         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
5880         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5881 }
5882
5883 test "$includedir" != NONE && \
5884 test "$includedir" != "/usr/include" && \
5885 test -d "$includedir" && {
5886         test -d $includedir &&    cf_search="$cf_search $includedir"
5887         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5888 }
5889
5890 test "$oldincludedir" != NONE && \
5891 test "$oldincludedir" != "/usr/include" && \
5892 test -d "$oldincludedir" && {
5893         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5894         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5895 }
5896
5897 cf_search="$cf_search $cf_header_path_list"
5898
5899         test -n "$verbose" && echo search path $cf_search
5900         cf_save2_CPPFLAGS="$CPPFLAGS"
5901         for cf_incdir in $cf_search
5902         do
5903
5904 if test -n "$cf_incdir" ; then
5905   for cf_add_incdir in $cf_incdir
5906   do
5907         while test $cf_add_incdir != /usr/include
5908         do
5909           if test -d $cf_add_incdir
5910           then
5911                 cf_have_incdir=no
5912                 if test -n "$CFLAGS$CPPFLAGS" ; then
5913                   # a loop is needed to ensure we can add subdirs of existing dirs
5914                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5915                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5916                           cf_have_incdir=yes; break
5917                         fi
5918                   done
5919                 fi
5920
5921                 if test "$cf_have_incdir" = no ; then
5922                   if test "$cf_add_incdir" = /usr/local/include ; then
5923                         if test "$GCC" = yes
5924                         then
5925                           cf_save_CPPFLAGS=$CPPFLAGS
5926                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5927                           cat >conftest.$ac_ext <<_ACEOF
5928 #line 5928 "configure"
5929 #include "confdefs.h"
5930 #include <stdio.h>
5931 int
5932 main ()
5933 {
5934 printf("Hello")
5935   ;
5936   return 0;
5937 }
5938 _ACEOF
5939 rm -f conftest.$ac_objext
5940 if { (eval echo "$as_me:5940: \"$ac_compile\"") >&5
5941   (eval $ac_compile) 2>&5
5942   ac_status=$?
5943   echo "$as_me:5943: \$? = $ac_status" >&5
5944   (exit $ac_status); } &&
5945          { ac_try='test -s conftest.$ac_objext'
5946   { (eval echo "$as_me:5946: \"$ac_try\"") >&5
5947   (eval $ac_try) 2>&5
5948   ac_status=$?
5949   echo "$as_me:5949: \$? = $ac_status" >&5
5950   (exit $ac_status); }; }; then
5951   :
5952 else
5953   echo "$as_me: failed program was:" >&5
5954 cat conftest.$ac_ext >&5
5955 cf_have_incdir=yes
5956 fi
5957 rm -f conftest.$ac_objext conftest.$ac_ext
5958                           CPPFLAGS=$cf_save_CPPFLAGS
5959                         fi
5960                   fi
5961                 fi
5962
5963                 if test "$cf_have_incdir" = no ; then
5964                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5965
5966 echo "${as_me:-configure}:5966: testing adding $cf_add_incdir to include-path ..." 1>&5
5967
5968                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5969
5970                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5971                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5972                   cf_add_incdir="$cf_top_incdir"
5973                 else
5974                   break
5975                 fi
5976           fi
5977         done
5978   done
5979 fi
5980
5981                 for cf_header in \
5982                         ncurses.h \
5983                         curses.h
5984                 do
5985
5986         cat >conftest.$ac_ext <<_ACEOF
5987 #line 5987 "configure"
5988 #include "confdefs.h"
5989
5990 #include <$cf_header>
5991 int
5992 main ()
5993 {
5994
5995 #ifdef NCURSES_VERSION
5996
5997 printf("%s\n", NCURSES_VERSION);
5998 #else
5999 #ifdef __NCURSES_H
6000 printf("old\n");
6001 #else
6002         make an error
6003 #endif
6004 #endif
6005
6006   ;
6007   return 0;
6008 }
6009 _ACEOF
6010 rm -f conftest.$ac_objext
6011 if { (eval echo "$as_me:6011: \"$ac_compile\"") >&5
6012   (eval $ac_compile) 2>&5
6013   ac_status=$?
6014   echo "$as_me:6014: \$? = $ac_status" >&5
6015   (exit $ac_status); } &&
6016          { ac_try='test -s conftest.$ac_objext'
6017   { (eval echo "$as_me:6017: \"$ac_try\"") >&5
6018   (eval $ac_try) 2>&5
6019   ac_status=$?
6020   echo "$as_me:6020: \$? = $ac_status" >&5
6021   (exit $ac_status); }; }; then
6022   cf_cv_ncurses_h2=$cf_header
6023
6024 else
6025   echo "$as_me: failed program was:" >&5
6026 cat conftest.$ac_ext >&5
6027 cf_cv_ncurses_h2=no
6028 fi
6029 rm -f conftest.$ac_objext conftest.$ac_ext
6030
6031                         if test "$cf_cv_ncurses_h2" != no ; then
6032                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6033                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6034                                 break
6035                         fi
6036                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6037                 done
6038                 CPPFLAGS="$cf_save2_CPPFLAGS"
6039                 test "$cf_cv_ncurses_h2" != no && break
6040         done
6041         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6041: error: not found" >&5
6042 echo "$as_me: error: not found" >&2;}
6043    { (exit 1); exit 1; }; }
6044
6045 fi
6046 echo "$as_me:6046: result: $cf_cv_ncurses_h2" >&5
6047 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6048
6049         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6050         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6051         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6052                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6053         fi
6054
6055 if test -n "$cf_1st_incdir" ; then
6056   for cf_add_incdir in $cf_1st_incdir
6057   do
6058         while test $cf_add_incdir != /usr/include
6059         do
6060           if test -d $cf_add_incdir
6061           then
6062                 cf_have_incdir=no
6063                 if test -n "$CFLAGS$CPPFLAGS" ; then
6064                   # a loop is needed to ensure we can add subdirs of existing dirs
6065                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6066                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6067                           cf_have_incdir=yes; break
6068                         fi
6069                   done
6070                 fi
6071
6072                 if test "$cf_have_incdir" = no ; then
6073                   if test "$cf_add_incdir" = /usr/local/include ; then
6074                         if test "$GCC" = yes
6075                         then
6076                           cf_save_CPPFLAGS=$CPPFLAGS
6077                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6078                           cat >conftest.$ac_ext <<_ACEOF
6079 #line 6079 "configure"
6080 #include "confdefs.h"
6081 #include <stdio.h>
6082 int
6083 main ()
6084 {
6085 printf("Hello")
6086   ;
6087   return 0;
6088 }
6089 _ACEOF
6090 rm -f conftest.$ac_objext
6091 if { (eval echo "$as_me:6091: \"$ac_compile\"") >&5
6092   (eval $ac_compile) 2>&5
6093   ac_status=$?
6094   echo "$as_me:6094: \$? = $ac_status" >&5
6095   (exit $ac_status); } &&
6096          { ac_try='test -s conftest.$ac_objext'
6097   { (eval echo "$as_me:6097: \"$ac_try\"") >&5
6098   (eval $ac_try) 2>&5
6099   ac_status=$?
6100   echo "$as_me:6100: \$? = $ac_status" >&5
6101   (exit $ac_status); }; }; then
6102   :
6103 else
6104   echo "$as_me: failed program was:" >&5
6105 cat conftest.$ac_ext >&5
6106 cf_have_incdir=yes
6107 fi
6108 rm -f conftest.$ac_objext conftest.$ac_ext
6109                           CPPFLAGS=$cf_save_CPPFLAGS
6110                         fi
6111                   fi
6112                 fi
6113
6114                 if test "$cf_have_incdir" = no ; then
6115                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6116
6117 echo "${as_me:-configure}:6117: testing adding $cf_add_incdir to include-path ..." 1>&5
6118
6119                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6120
6121                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6122                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6123                   cf_add_incdir="$cf_top_incdir"
6124                 else
6125                   break
6126                 fi
6127           fi
6128         done
6129   done
6130 fi
6131
6132 fi
6133
6134 # Set definitions to allow ifdef'ing for ncurses.h
6135
6136 case $cf_cv_ncurses_header in # (vi
6137 *ncurses.h)
6138
6139 cat >>confdefs.h <<\EOF
6140 #define HAVE_NCURSES_H 1
6141 EOF
6142
6143         ;;
6144 esac
6145
6146 case $cf_cv_ncurses_header in # (vi
6147 ncurses/curses.h|ncurses/ncurses.h)
6148
6149 cat >>confdefs.h <<\EOF
6150 #define HAVE_NCURSES_NCURSES_H 1
6151 EOF
6152
6153         ;;
6154 ncursesw/curses.h|ncursesw/ncurses.h)
6155
6156 cat >>confdefs.h <<\EOF
6157 #define HAVE_NCURSESW_NCURSES_H 1
6158 EOF
6159
6160         ;;
6161 esac
6162
6163 echo "$as_me:6163: checking for terminfo header" >&5
6164 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6165 if test "${cf_cv_term_header+set}" = set; then
6166   echo $ECHO_N "(cached) $ECHO_C" >&6
6167 else
6168
6169 case ${cf_cv_ncurses_header} in #(vi
6170 */ncurses.h|*/ncursesw.h) #(vi
6171         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6172         ;;
6173 *)
6174         cf_term_header=term.h
6175         ;;
6176 esac
6177
6178 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6179 do
6180 cat >conftest.$ac_ext <<_ACEOF
6181 #line 6181 "configure"
6182 #include "confdefs.h"
6183 #include <stdio.h>
6184 #include <${cf_cv_ncurses_header:-curses.h}>
6185 #include <$cf_test>
6186
6187 int
6188 main ()
6189 {
6190 int x = auto_left_margin
6191   ;
6192   return 0;
6193 }
6194 _ACEOF
6195 rm -f conftest.$ac_objext
6196 if { (eval echo "$as_me:6196: \"$ac_compile\"") >&5
6197   (eval $ac_compile) 2>&5
6198   ac_status=$?
6199   echo "$as_me:6199: \$? = $ac_status" >&5
6200   (exit $ac_status); } &&
6201          { ac_try='test -s conftest.$ac_objext'
6202   { (eval echo "$as_me:6202: \"$ac_try\"") >&5
6203   (eval $ac_try) 2>&5
6204   ac_status=$?
6205   echo "$as_me:6205: \$? = $ac_status" >&5
6206   (exit $ac_status); }; }; then
6207
6208         cf_cv_term_header="$cf_test"
6209 else
6210   echo "$as_me: failed program was:" >&5
6211 cat conftest.$ac_ext >&5
6212
6213         cf_cv_term_header=unknown
6214
6215 fi
6216 rm -f conftest.$ac_objext conftest.$ac_ext
6217         test "$cf_cv_term_header" != unknown && break
6218 done
6219
6220 fi
6221 echo "$as_me:6221: result: $cf_cv_term_header" >&5
6222 echo "${ECHO_T}$cf_cv_term_header" >&6
6223
6224 # Set definitions to allow ifdef'ing to accommodate subdirectories
6225
6226 case $cf_cv_term_header in # (vi
6227 *term.h)
6228
6229 cat >>confdefs.h <<\EOF
6230 #define HAVE_TERM_H 1
6231 EOF
6232
6233         ;;
6234 esac
6235
6236 case $cf_cv_term_header in # (vi
6237 ncurses/term.h) #(vi
6238
6239 cat >>confdefs.h <<\EOF
6240 #define HAVE_NCURSES_TERM_H 1
6241 EOF
6242
6243         ;;
6244 ncursesw/term.h)
6245
6246 cat >>confdefs.h <<\EOF
6247 #define HAVE_NCURSESW_TERM_H 1
6248 EOF
6249
6250         ;;
6251 esac
6252
6253 # some applications need this, but should check for NCURSES_VERSION
6254
6255 cat >>confdefs.h <<\EOF
6256 #define NCURSES 1
6257 EOF
6258
6259 echo "$as_me:6259: checking for ncurses version" >&5
6260 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6261 if test "${cf_cv_ncurses_version+set}" = set; then
6262   echo $ECHO_N "(cached) $ECHO_C" >&6
6263 else
6264
6265         cf_cv_ncurses_version=no
6266         cf_tempfile=out$$
6267         rm -f $cf_tempfile
6268         if test "$cross_compiling" = yes; then
6269
6270         # This will not work if the preprocessor splits the line after the
6271         # Autoconf token.  The 'unproto' program does that.
6272         cat > conftest.$ac_ext <<EOF
6273 #include <${cf_cv_ncurses_header:-curses.h}>
6274 #undef Autoconf
6275 #ifdef NCURSES_VERSION
6276 Autoconf NCURSES_VERSION
6277 #else
6278 #ifdef __NCURSES_H
6279 Autoconf "old"
6280 #endif
6281 ;
6282 #endif
6283 EOF
6284         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6285         { (eval echo "$as_me:6285: \"$cf_try\"") >&5
6286   (eval $cf_try) 2>&5
6287   ac_status=$?
6288   echo "$as_me:6288: \$? = $ac_status" >&5
6289   (exit $ac_status); }
6290         if test -f conftest.out ; then
6291                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6292                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6293                 rm -f conftest.out
6294         fi
6295
6296 else
6297   cat >conftest.$ac_ext <<_ACEOF
6298 #line 6298 "configure"
6299 #include "confdefs.h"
6300
6301 #include <${cf_cv_ncurses_header:-curses.h}>
6302 #include <stdio.h>
6303 int main()
6304 {
6305         FILE *fp = fopen("$cf_tempfile", "w");
6306 #ifdef NCURSES_VERSION
6307 # ifdef NCURSES_VERSION_PATCH
6308         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6309 # else
6310         fprintf(fp, "%s\n", NCURSES_VERSION);
6311 # endif
6312 #else
6313 # ifdef __NCURSES_H
6314         fprintf(fp, "old\n");
6315 # else
6316         make an error
6317 # endif
6318 #endif
6319         ${cf_cv_main_return:-return}(0);
6320 }
6321 _ACEOF
6322 rm -f conftest$ac_exeext
6323 if { (eval echo "$as_me:6323: \"$ac_link\"") >&5
6324   (eval $ac_link) 2>&5
6325   ac_status=$?
6326   echo "$as_me:6326: \$? = $ac_status" >&5
6327   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6328   { (eval echo "$as_me:6328: \"$ac_try\"") >&5
6329   (eval $ac_try) 2>&5
6330   ac_status=$?
6331   echo "$as_me:6331: \$? = $ac_status" >&5
6332   (exit $ac_status); }; }; then
6333
6334         cf_cv_ncurses_version=`cat $cf_tempfile`
6335 else
6336   echo "$as_me: program exited with status $ac_status" >&5
6337 echo "$as_me: failed program was:" >&5
6338 cat conftest.$ac_ext >&5
6339 fi
6340 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6341 fi
6342         rm -f $cf_tempfile
6343
6344 fi
6345 echo "$as_me:6345: result: $cf_cv_ncurses_version" >&5
6346 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6347 test "$cf_cv_ncurses_version" = no ||
6348 cat >>confdefs.h <<\EOF
6349 #define NCURSES 1
6350 EOF
6351
6352 cf_nculib_root=ncurses
6353         # This works, except for the special case where we find gpm, but
6354         # ncurses is in a nonstandard location via $LIBS, and we really want
6355         # to link gpm.
6356 cf_ncurses_LIBS=""
6357 cf_ncurses_SAVE="$LIBS"
6358 echo "$as_me:6358: checking for Gpm_Open in -lgpm" >&5
6359 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6360 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6361   echo $ECHO_N "(cached) $ECHO_C" >&6
6362 else
6363   ac_check_lib_save_LIBS=$LIBS
6364 LIBS="-lgpm  $LIBS"
6365 cat >conftest.$ac_ext <<_ACEOF
6366 #line 6366 "configure"
6367 #include "confdefs.h"
6368
6369 /* Override any gcc2 internal prototype to avoid an error.  */
6370 #ifdef __cplusplus
6371 extern "C"
6372 #endif
6373 /* We use char because int might match the return type of a gcc2
6374    builtin and then its argument prototype would still apply.  */
6375 char Gpm_Open ();
6376 int
6377 main ()
6378 {
6379 Gpm_Open ();
6380   ;
6381   return 0;
6382 }
6383 _ACEOF
6384 rm -f conftest.$ac_objext conftest$ac_exeext
6385 if { (eval echo "$as_me:6385: \"$ac_link\"") >&5
6386   (eval $ac_link) 2>&5
6387   ac_status=$?
6388   echo "$as_me:6388: \$? = $ac_status" >&5
6389   (exit $ac_status); } &&
6390          { ac_try='test -s conftest$ac_exeext'
6391   { (eval echo "$as_me:6391: \"$ac_try\"") >&5
6392   (eval $ac_try) 2>&5
6393   ac_status=$?
6394   echo "$as_me:6394: \$? = $ac_status" >&5
6395   (exit $ac_status); }; }; then
6396   ac_cv_lib_gpm_Gpm_Open=yes
6397 else
6398   echo "$as_me: failed program was:" >&5
6399 cat conftest.$ac_ext >&5
6400 ac_cv_lib_gpm_Gpm_Open=no
6401 fi
6402 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6403 LIBS=$ac_check_lib_save_LIBS
6404 fi
6405 echo "$as_me:6405: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6406 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6407 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6408   echo "$as_me:6408: checking for initscr in -lgpm" >&5
6409 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6410 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6411   echo $ECHO_N "(cached) $ECHO_C" >&6
6412 else
6413   ac_check_lib_save_LIBS=$LIBS
6414 LIBS="-lgpm  $LIBS"
6415 cat >conftest.$ac_ext <<_ACEOF
6416 #line 6416 "configure"
6417 #include "confdefs.h"
6418
6419 /* Override any gcc2 internal prototype to avoid an error.  */
6420 #ifdef __cplusplus
6421 extern "C"
6422 #endif
6423 /* We use char because int might match the return type of a gcc2
6424    builtin and then its argument prototype would still apply.  */
6425 char initscr ();
6426 int
6427 main ()
6428 {
6429 initscr ();
6430   ;
6431   return 0;
6432 }
6433 _ACEOF
6434 rm -f conftest.$ac_objext conftest$ac_exeext
6435 if { (eval echo "$as_me:6435: \"$ac_link\"") >&5
6436   (eval $ac_link) 2>&5
6437   ac_status=$?
6438   echo "$as_me:6438: \$? = $ac_status" >&5
6439   (exit $ac_status); } &&
6440          { ac_try='test -s conftest$ac_exeext'
6441   { (eval echo "$as_me:6441: \"$ac_try\"") >&5
6442   (eval $ac_try) 2>&5
6443   ac_status=$?
6444   echo "$as_me:6444: \$? = $ac_status" >&5
6445   (exit $ac_status); }; }; then
6446   ac_cv_lib_gpm_initscr=yes
6447 else
6448   echo "$as_me: failed program was:" >&5
6449 cat conftest.$ac_ext >&5
6450 ac_cv_lib_gpm_initscr=no
6451 fi
6452 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6453 LIBS=$ac_check_lib_save_LIBS
6454 fi
6455 echo "$as_me:6455: result: $ac_cv_lib_gpm_initscr" >&5
6456 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6457 if test $ac_cv_lib_gpm_initscr = yes; then
6458   LIBS="$cf_ncurses_SAVE"
6459 else
6460   cf_ncurses_LIBS="-lgpm"
6461 fi
6462
6463 fi
6464
6465 case $host_os in #(vi
6466 freebsd*)
6467         # This is only necessary if you are linking against an obsolete
6468         # version of ncurses (but it should do no harm, since it's static).
6469         if test "$cf_nculib_root" = ncurses ; then
6470                 echo "$as_me:6470: checking for tgoto in -lmytinfo" >&5
6471 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6472 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6473   echo $ECHO_N "(cached) $ECHO_C" >&6
6474 else
6475   ac_check_lib_save_LIBS=$LIBS
6476 LIBS="-lmytinfo  $LIBS"
6477 cat >conftest.$ac_ext <<_ACEOF
6478 #line 6478 "configure"
6479 #include "confdefs.h"
6480
6481 /* Override any gcc2 internal prototype to avoid an error.  */
6482 #ifdef __cplusplus
6483 extern "C"
6484 #endif
6485 /* We use char because int might match the return type of a gcc2
6486    builtin and then its argument prototype would still apply.  */
6487 char tgoto ();
6488 int
6489 main ()
6490 {
6491 tgoto ();
6492   ;
6493   return 0;
6494 }
6495 _ACEOF
6496 rm -f conftest.$ac_objext conftest$ac_exeext
6497 if { (eval echo "$as_me:6497: \"$ac_link\"") >&5
6498   (eval $ac_link) 2>&5
6499   ac_status=$?
6500   echo "$as_me:6500: \$? = $ac_status" >&5
6501   (exit $ac_status); } &&
6502          { ac_try='test -s conftest$ac_exeext'
6503   { (eval echo "$as_me:6503: \"$ac_try\"") >&5
6504   (eval $ac_try) 2>&5
6505   ac_status=$?
6506   echo "$as_me:6506: \$? = $ac_status" >&5
6507   (exit $ac_status); }; }; then
6508   ac_cv_lib_mytinfo_tgoto=yes
6509 else
6510   echo "$as_me: failed program was:" >&5
6511 cat conftest.$ac_ext >&5
6512 ac_cv_lib_mytinfo_tgoto=no
6513 fi
6514 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6515 LIBS=$ac_check_lib_save_LIBS
6516 fi
6517 echo "$as_me:6517: result: $ac_cv_lib_mytinfo_tgoto" >&5
6518 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6519 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6520   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6521 fi
6522
6523         fi
6524         ;;
6525 esac
6526
6527 LIBS="$cf_ncurses_LIBS $LIBS"
6528
6529 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6530 then
6531         LIBS="-l$cf_nculib_root $LIBS"
6532 else
6533
6534         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6535         cf_libdir=""
6536         echo "$as_me:6536: checking for initscr" >&5
6537 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6538 if test "${ac_cv_func_initscr+set}" = set; then
6539   echo $ECHO_N "(cached) $ECHO_C" >&6
6540 else
6541   cat >conftest.$ac_ext <<_ACEOF
6542 #line 6542 "configure"
6543 #include "confdefs.h"
6544 /* System header to define __stub macros and hopefully few prototypes,
6545     which can conflict with char initscr (); below.  */
6546 #include <assert.h>
6547 /* Override any gcc2 internal prototype to avoid an error.  */
6548 #ifdef __cplusplus
6549 extern "C"
6550 #endif
6551 /* We use char because int might match the return type of a gcc2
6552    builtin and then its argument prototype would still apply.  */
6553 char initscr ();
6554 char (*f) ();
6555
6556 int
6557 main ()
6558 {
6559 /* The GNU C library defines this for functions which it implements
6560     to always fail with ENOSYS.  Some functions are actually named
6561     something starting with __ and the normal name is an alias.  */
6562 #if defined (__stub_initscr) || defined (__stub___initscr)
6563 choke me
6564 #else
6565 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6566 #endif
6567
6568   ;
6569   return 0;
6570 }
6571 _ACEOF
6572 rm -f conftest.$ac_objext conftest$ac_exeext
6573 if { (eval echo "$as_me:6573: \"$ac_link\"") >&5
6574   (eval $ac_link) 2>&5
6575   ac_status=$?
6576   echo "$as_me:6576: \$? = $ac_status" >&5
6577   (exit $ac_status); } &&
6578          { ac_try='test -s conftest$ac_exeext'
6579   { (eval echo "$as_me:6579: \"$ac_try\"") >&5
6580   (eval $ac_try) 2>&5
6581   ac_status=$?
6582   echo "$as_me:6582: \$? = $ac_status" >&5
6583   (exit $ac_status); }; }; then
6584   ac_cv_func_initscr=yes
6585 else
6586   echo "$as_me: failed program was:" >&5
6587 cat conftest.$ac_ext >&5
6588 ac_cv_func_initscr=no
6589 fi
6590 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6591 fi
6592 echo "$as_me:6592: result: $ac_cv_func_initscr" >&5
6593 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6594 if test $ac_cv_func_initscr = yes; then
6595   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6596 else
6597
6598                 cf_save_LIBS="$LIBS"
6599                 echo "$as_me:6599: checking for initscr in -l$cf_nculib_root" >&5
6600 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6601                 LIBS="-l$cf_nculib_root $LIBS"
6602                 cat >conftest.$ac_ext <<_ACEOF
6603 #line 6603 "configure"
6604 #include "confdefs.h"
6605 #include <${cf_cv_ncurses_header:-curses.h}>
6606 int
6607 main ()
6608 {
6609 initscr()
6610   ;
6611   return 0;
6612 }
6613 _ACEOF
6614 rm -f conftest.$ac_objext conftest$ac_exeext
6615 if { (eval echo "$as_me:6615: \"$ac_link\"") >&5
6616   (eval $ac_link) 2>&5
6617   ac_status=$?
6618   echo "$as_me:6618: \$? = $ac_status" >&5
6619   (exit $ac_status); } &&
6620          { ac_try='test -s conftest$ac_exeext'
6621   { (eval echo "$as_me:6621: \"$ac_try\"") >&5
6622   (eval $ac_try) 2>&5
6623   ac_status=$?
6624   echo "$as_me:6624: \$? = $ac_status" >&5
6625   (exit $ac_status); }; }; then
6626   echo "$as_me:6626: result: yes" >&5
6627 echo "${ECHO_T}yes" >&6
6628                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6629
6630 else
6631   echo "$as_me: failed program was:" >&5
6632 cat conftest.$ac_ext >&5
6633 echo "$as_me:6633: result: no" >&5
6634 echo "${ECHO_T}no" >&6
6635
6636 cf_search=
6637 cf_library_path_list=""
6638 if test -n "${LDFLAGS}${LIBS}" ; then
6639         for cf_library_path in $LDFLAGS $LIBS
6640         do
6641                 case $cf_library_path in #(vi
6642                 -L*)
6643                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6644
6645 test "$cf_library_path" != "NONE" && \
6646 test -d "$cf_library_path" && \
6647  {
6648         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6649         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6650         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6651         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6652         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6653         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"
6654 }
6655
6656                         cf_library_path_list="$cf_library_path_list $cf_search"
6657                         ;;
6658                 esac
6659         done
6660 fi
6661
6662 cf_search=
6663
6664 test "/usr" != "$prefix" && \
6665 test -d "/usr" && \
6666 (test $prefix = NONE || test "/usr" != "$prefix") && {
6667         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6668         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6669         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
6670         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
6671         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
6672         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
6673 }
6674
6675 test "$prefix" != "NONE" && \
6676 test -d "$prefix" && \
6677  {
6678         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6679         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6680         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6681         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6682         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6683         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6684 }
6685
6686 test "/usr/local" != "$prefix" && \
6687 test -d "/usr/local" && \
6688 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6689         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6690         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6691         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
6692         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
6693         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
6694         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
6695 }
6696
6697 test "/opt" != "$prefix" && \
6698 test -d "/opt" && \
6699 (test $prefix = NONE || test "/opt" != "$prefix") && {
6700         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6701         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6702         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
6703         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
6704         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
6705         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
6706 }
6707
6708 test "$HOME" != "$prefix" && \
6709 test -d "$HOME" && \
6710 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6711         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6712         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6713         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
6714         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
6715         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
6716         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
6717 }
6718
6719 cf_search="$cf_library_path_list $cf_search"
6720
6721                         for cf_libdir in $cf_search
6722                         do
6723                                 echo "$as_me:6723: checking for -l$cf_nculib_root in $cf_libdir" >&5
6724 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6725                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6726                                 cat >conftest.$ac_ext <<_ACEOF
6727 #line 6727 "configure"
6728 #include "confdefs.h"
6729 #include <${cf_cv_ncurses_header:-curses.h}>
6730 int
6731 main ()
6732 {
6733 initscr()
6734   ;
6735   return 0;
6736 }
6737 _ACEOF
6738 rm -f conftest.$ac_objext conftest$ac_exeext
6739 if { (eval echo "$as_me:6739: \"$ac_link\"") >&5
6740   (eval $ac_link) 2>&5
6741   ac_status=$?
6742   echo "$as_me:6742: \$? = $ac_status" >&5
6743   (exit $ac_status); } &&
6744          { ac_try='test -s conftest$ac_exeext'
6745   { (eval echo "$as_me:6745: \"$ac_try\"") >&5
6746   (eval $ac_try) 2>&5
6747   ac_status=$?
6748   echo "$as_me:6748: \$? = $ac_status" >&5
6749   (exit $ac_status); }; }; then
6750   echo "$as_me:6750: result: yes" >&5
6751 echo "${ECHO_T}yes" >&6
6752                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6753                                          break
6754 else
6755   echo "$as_me: failed program was:" >&5
6756 cat conftest.$ac_ext >&5
6757 echo "$as_me:6757: result: no" >&5
6758 echo "${ECHO_T}no" >&6
6759                                          LIBS="$cf_save_LIBS"
6760 fi
6761 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6762                         done
6763
6764 fi
6765 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6766
6767 fi
6768
6769 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6770
6771 if test $cf_found_library = no ; then
6772         { { echo "$as_me:6772: error: Cannot link $cf_nculib_root library" >&5
6773 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6774    { (exit 1); exit 1; }; }
6775 fi
6776
6777 fi
6778
6779 if test -n "$cf_ncurses_LIBS" ; then
6780         echo "$as_me:6780: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6781 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6782         cf_ncurses_SAVE="$LIBS"
6783         for p in $cf_ncurses_LIBS ; do
6784                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6785                 if test "$q" != "$LIBS" ; then
6786                         LIBS="$q"
6787                 fi
6788         done
6789         cat >conftest.$ac_ext <<_ACEOF
6790 #line 6790 "configure"
6791 #include "confdefs.h"
6792 #include <${cf_cv_ncurses_header:-curses.h}>
6793 int
6794 main ()
6795 {
6796 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6797   ;
6798   return 0;
6799 }
6800 _ACEOF
6801 rm -f conftest.$ac_objext conftest$ac_exeext
6802 if { (eval echo "$as_me:6802: \"$ac_link\"") >&5
6803   (eval $ac_link) 2>&5
6804   ac_status=$?
6805   echo "$as_me:6805: \$? = $ac_status" >&5
6806   (exit $ac_status); } &&
6807          { ac_try='test -s conftest$ac_exeext'
6808   { (eval echo "$as_me:6808: \"$ac_try\"") >&5
6809   (eval $ac_try) 2>&5
6810   ac_status=$?
6811   echo "$as_me:6811: \$? = $ac_status" >&5
6812   (exit $ac_status); }; }; then
6813   echo "$as_me:6813: result: yes" >&5
6814 echo "${ECHO_T}yes" >&6
6815 else
6816   echo "$as_me: failed program was:" >&5
6817 cat conftest.$ac_ext >&5
6818 echo "$as_me:6818: result: no" >&5
6819 echo "${ECHO_T}no" >&6
6820                  LIBS="$cf_ncurses_SAVE"
6821 fi
6822 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6823 fi
6824
6825 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6826
6827 cat >>confdefs.h <<EOF
6828 #define $cf_nculib_ROOT 1
6829 EOF
6830
6831 fi
6832
6833         ;;
6834 ncursesw) #(vi
6835
6836 echo "$as_me:6836: checking for multibyte character support" >&5
6837 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6838 if test "${cf_cv_utf8_lib+set}" = set; then
6839   echo $ECHO_N "(cached) $ECHO_C" >&6
6840 else
6841
6842         cf_save_LIBS="$LIBS"
6843         cat >conftest.$ac_ext <<_ACEOF
6844 #line 6844 "configure"
6845 #include "confdefs.h"
6846
6847 #include <stdlib.h>
6848 int
6849 main ()
6850 {
6851 putwc(0,0);
6852   ;
6853   return 0;
6854 }
6855 _ACEOF
6856 rm -f conftest.$ac_objext conftest$ac_exeext
6857 if { (eval echo "$as_me:6857: \"$ac_link\"") >&5
6858   (eval $ac_link) 2>&5
6859   ac_status=$?
6860   echo "$as_me:6860: \$? = $ac_status" >&5
6861   (exit $ac_status); } &&
6862          { ac_try='test -s conftest$ac_exeext'
6863   { (eval echo "$as_me:6863: \"$ac_try\"") >&5
6864   (eval $ac_try) 2>&5
6865   ac_status=$?
6866   echo "$as_me:6866: \$? = $ac_status" >&5
6867   (exit $ac_status); }; }; then
6868   cf_cv_utf8_lib=yes
6869 else
6870   echo "$as_me: failed program was:" >&5
6871 cat conftest.$ac_ext >&5
6872
6873 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6874 # will be set on completion of the AC_TRY_LINK below.
6875 cf_cv_header_path_utf8=
6876 cf_cv_library_path_utf8=
6877
6878 echo "${as_me:-configure}:6878: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6879
6880 cf_save_LIBS="$LIBS"
6881
6882 cat >conftest.$ac_ext <<_ACEOF
6883 #line 6883 "configure"
6884 #include "confdefs.h"
6885
6886 #include <libutf8.h>
6887 int
6888 main ()
6889 {
6890 putwc(0,0);
6891   ;
6892   return 0;
6893 }
6894 _ACEOF
6895 rm -f conftest.$ac_objext conftest$ac_exeext
6896 if { (eval echo "$as_me:6896: \"$ac_link\"") >&5
6897   (eval $ac_link) 2>&5
6898   ac_status=$?
6899   echo "$as_me:6899: \$? = $ac_status" >&5
6900   (exit $ac_status); } &&
6901          { ac_try='test -s conftest$ac_exeext'
6902   { (eval echo "$as_me:6902: \"$ac_try\"") >&5
6903   (eval $ac_try) 2>&5
6904   ac_status=$?
6905   echo "$as_me:6905: \$? = $ac_status" >&5
6906   (exit $ac_status); }; }; then
6907
6908         cf_cv_find_linkage_utf8=yes
6909         cf_cv_header_path_utf8=/usr/include
6910         cf_cv_library_path_utf8=/usr/lib
6911
6912 else
6913   echo "$as_me: failed program was:" >&5
6914 cat conftest.$ac_ext >&5
6915
6916 LIBS="-lutf8  $cf_save_LIBS"
6917
6918 cat >conftest.$ac_ext <<_ACEOF
6919 #line 6919 "configure"
6920 #include "confdefs.h"
6921
6922 #include <libutf8.h>
6923 int
6924 main ()
6925 {
6926 putwc(0,0);
6927   ;
6928   return 0;
6929 }
6930 _ACEOF
6931 rm -f conftest.$ac_objext conftest$ac_exeext
6932 if { (eval echo "$as_me:6932: \"$ac_link\"") >&5
6933   (eval $ac_link) 2>&5
6934   ac_status=$?
6935   echo "$as_me:6935: \$? = $ac_status" >&5
6936   (exit $ac_status); } &&
6937          { ac_try='test -s conftest$ac_exeext'
6938   { (eval echo "$as_me:6938: \"$ac_try\"") >&5
6939   (eval $ac_try) 2>&5
6940   ac_status=$?
6941   echo "$as_me:6941: \$? = $ac_status" >&5
6942   (exit $ac_status); }; }; then
6943
6944         cf_cv_find_linkage_utf8=yes
6945         cf_cv_header_path_utf8=/usr/include
6946         cf_cv_library_path_utf8=/usr/lib
6947         cf_cv_library_file_utf8="-lutf8"
6948
6949 else
6950   echo "$as_me: failed program was:" >&5
6951 cat conftest.$ac_ext >&5
6952
6953         cf_cv_find_linkage_utf8=no
6954         LIBS="$cf_save_LIBS"
6955
6956     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
6957
6958 echo "${as_me:-configure}:6958: testing find linkage for utf8 library ..." 1>&5
6959
6960 echo "${as_me:-configure}:6960: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6961
6962     cf_save_CPPFLAGS="$CPPFLAGS"
6963     cf_test_CPPFLAGS="$CPPFLAGS"
6964
6965 cf_search=
6966
6967 # collect the current set of include-directories from compiler flags
6968 cf_header_path_list=""
6969 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6970         for cf_header_path in $CPPFLAGS $CFLAGS
6971         do
6972                 case $cf_header_path in #(vi
6973                 -I*)
6974                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6975
6976 test "$cf_header_path" != "NONE" && \
6977 test -d "$cf_header_path" && \
6978  {
6979         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6980         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6981         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6982         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6983         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6984         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6985 }
6986
6987                         cf_header_path_list="$cf_header_path_list $cf_search"
6988                         ;;
6989                 esac
6990         done
6991 fi
6992
6993 # add the variations for the package we are looking for
6994
6995 cf_search=
6996
6997 test "/usr" != "$prefix" && \
6998 test -d "/usr" && \
6999 (test $prefix = NONE || test "/usr" != "$prefix") && {
7000         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7001         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7002         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
7003         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
7004         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
7005         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
7006 }
7007
7008 test "$prefix" != "NONE" && \
7009 test -d "$prefix" && \
7010  {
7011         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7012         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7013         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7014         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7015         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7016         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7017 }
7018
7019 test "/usr/local" != "$prefix" && \
7020 test -d "/usr/local" && \
7021 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7022         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
7023         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
7024         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
7025         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
7026         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
7027         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
7028 }
7029
7030 test "/opt" != "$prefix" && \
7031 test -d "/opt" && \
7032 (test $prefix = NONE || test "/opt" != "$prefix") && {
7033         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
7034         test -d /opt/include &&          cf_search="$cf_search /opt/include"
7035         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
7036         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
7037         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
7038         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
7039 }
7040
7041 test "$HOME" != "$prefix" && \
7042 test -d "$HOME" && \
7043 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7044         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
7045         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
7046         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
7047         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
7048         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
7049         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
7050 }
7051
7052 test "$includedir" != NONE && \
7053 test "$includedir" != "/usr/include" && \
7054 test -d "$includedir" && {
7055         test -d $includedir &&    cf_search="$cf_search $includedir"
7056         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7057 }
7058
7059 test "$oldincludedir" != NONE && \
7060 test "$oldincludedir" != "/usr/include" && \
7061 test -d "$oldincludedir" && {
7062         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7063         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7064 }
7065
7066 cf_search="$cf_search $cf_header_path_list"
7067
7068     for cf_cv_header_path_utf8 in $cf_search
7069     do
7070       if test -d $cf_cv_header_path_utf8 ; then
7071         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7072
7073 echo "${as_me:-configure}:7073: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7074
7075         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
7076         cat >conftest.$ac_ext <<_ACEOF
7077 #line 7077 "configure"
7078 #include "confdefs.h"
7079
7080 #include <libutf8.h>
7081 int
7082 main ()
7083 {
7084 putwc(0,0);
7085   ;
7086   return 0;
7087 }
7088 _ACEOF
7089 rm -f conftest.$ac_objext
7090 if { (eval echo "$as_me:7090: \"$ac_compile\"") >&5
7091   (eval $ac_compile) 2>&5
7092   ac_status=$?
7093   echo "$as_me:7093: \$? = $ac_status" >&5
7094   (exit $ac_status); } &&
7095          { ac_try='test -s conftest.$ac_objext'
7096   { (eval echo "$as_me:7096: \"$ac_try\"") >&5
7097   (eval $ac_try) 2>&5
7098   ac_status=$?
7099   echo "$as_me:7099: \$? = $ac_status" >&5
7100   (exit $ac_status); }; }; then
7101
7102             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7103
7104 echo "${as_me:-configure}:7104: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7105
7106             cf_cv_find_linkage_utf8=maybe
7107             cf_test_CPPFLAGS="$CPPFLAGS"
7108             break
7109 else
7110   echo "$as_me: failed program was:" >&5
7111 cat conftest.$ac_ext >&5
7112
7113             CPPFLAGS="$cf_save_CPPFLAGS"
7114
7115 fi
7116 rm -f conftest.$ac_objext conftest.$ac_ext
7117       fi
7118     done
7119
7120     if test "$cf_cv_find_linkage_utf8" = maybe ; then
7121
7122 echo "${as_me:-configure}:7122: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7123
7124       cf_save_LIBS="$LIBS"
7125       cf_save_LDFLAGS="$LDFLAGS"
7126
7127       if test "$cf_cv_find_linkage_utf8" != yes ; then
7128
7129 cf_search=
7130 cf_library_path_list=""
7131 if test -n "${LDFLAGS}${LIBS}" ; then
7132         for cf_library_path in $LDFLAGS $LIBS
7133         do
7134                 case $cf_library_path in #(vi
7135                 -L*)
7136                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7137
7138 test "$cf_library_path" != "NONE" && \
7139 test -d "$cf_library_path" && \
7140  {
7141         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7142         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7143         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7144         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7145         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7146         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7147 }
7148
7149                         cf_library_path_list="$cf_library_path_list $cf_search"
7150                         ;;
7151                 esac
7152         done
7153 fi
7154
7155 cf_search=
7156
7157 test "/usr" != "$prefix" && \
7158 test -d "/usr" && \
7159 (test $prefix = NONE || test "/usr" != "$prefix") && {
7160         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7161         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7162         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
7163         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
7164         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
7165         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
7166 }
7167
7168 test "$prefix" != "NONE" && \
7169 test -d "$prefix" && \
7170  {
7171         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7172         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7173         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7174         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7175         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7176         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7177 }
7178
7179 test "/usr/local" != "$prefix" && \
7180 test -d "/usr/local" && \
7181 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7182         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7183         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7184         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
7185         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
7186         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
7187         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
7188 }
7189
7190 test "/opt" != "$prefix" && \
7191 test -d "/opt" && \
7192 (test $prefix = NONE || test "/opt" != "$prefix") && {
7193         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7194         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7195         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
7196         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
7197         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
7198         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
7199 }
7200
7201 test "$HOME" != "$prefix" && \
7202 test -d "$HOME" && \
7203 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7204         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7205         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7206         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
7207         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
7208         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
7209         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
7210 }
7211
7212 cf_search="$cf_library_path_list $cf_search"
7213
7214         for cf_cv_library_path_utf8 in $cf_search
7215         do
7216           if test -d $cf_cv_library_path_utf8 ; then
7217             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
7218
7219 echo "${as_me:-configure}:7219: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7220
7221             CPPFLAGS="$cf_test_CPPFLAGS"
7222             LIBS="-lutf8  $cf_save_LIBS"
7223             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7224             cat >conftest.$ac_ext <<_ACEOF
7225 #line 7225 "configure"
7226 #include "confdefs.h"
7227
7228 #include <libutf8.h>
7229 int
7230 main ()
7231 {
7232 putwc(0,0);
7233   ;
7234   return 0;
7235 }
7236 _ACEOF
7237 rm -f conftest.$ac_objext conftest$ac_exeext
7238 if { (eval echo "$as_me:7238: \"$ac_link\"") >&5
7239   (eval $ac_link) 2>&5
7240   ac_status=$?
7241   echo "$as_me:7241: \$? = $ac_status" >&5
7242   (exit $ac_status); } &&
7243          { ac_try='test -s conftest$ac_exeext'
7244   { (eval echo "$as_me:7244: \"$ac_try\"") >&5
7245   (eval $ac_try) 2>&5
7246   ac_status=$?
7247   echo "$as_me:7247: \$? = $ac_status" >&5
7248   (exit $ac_status); }; }; then
7249
7250                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7251
7252 echo "${as_me:-configure}:7252: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7253
7254                 cf_cv_find_linkage_utf8=yes
7255                 cf_cv_library_file_utf8="-lutf8"
7256                 break
7257 else
7258   echo "$as_me: failed program was:" >&5
7259 cat conftest.$ac_ext >&5
7260
7261                 CPPFLAGS="$cf_save_CPPFLAGS"
7262                 LIBS="$cf_save_LIBS"
7263                 LDFLAGS="$cf_save_LDFLAGS"
7264
7265 fi
7266 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7267           fi
7268         done
7269         CPPFLAGS="$cf_save_CPPFLAGS"
7270         LDFLAGS="$cf_save_LDFLAGS"
7271       fi
7272
7273     else
7274       cf_cv_find_linkage_utf8=no
7275     fi
7276
7277 fi
7278 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7279
7280 fi
7281 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7282
7283 LIBS="$cf_save_LIBS"
7284
7285 if test "$cf_cv_find_linkage_utf8" = yes ; then
7286 cf_cv_utf8_lib=add-on
7287 else
7288 cf_cv_utf8_lib=no
7289 fi
7290
7291 fi
7292 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7293 fi
7294 echo "$as_me:7294: result: $cf_cv_utf8_lib" >&5
7295 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7296
7297 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7298 # ncurses/ncursesw:
7299 if test "$cf_cv_utf8_lib" = "add-on" ; then
7300
7301 cat >>confdefs.h <<\EOF
7302 #define HAVE_LIBUTF8_H 1
7303 EOF
7304
7305 if test -n "$cf_cv_header_path_utf8" ; then
7306   for cf_add_incdir in $cf_cv_header_path_utf8
7307   do
7308         while test $cf_add_incdir != /usr/include
7309         do
7310           if test -d $cf_add_incdir
7311           then
7312                 cf_have_incdir=no
7313                 if test -n "$CFLAGS$CPPFLAGS" ; then
7314                   # a loop is needed to ensure we can add subdirs of existing dirs
7315                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7316                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7317                           cf_have_incdir=yes; break
7318                         fi
7319                   done
7320                 fi
7321
7322                 if test "$cf_have_incdir" = no ; then
7323                   if test "$cf_add_incdir" = /usr/local/include ; then
7324                         if test "$GCC" = yes
7325                         then
7326                           cf_save_CPPFLAGS=$CPPFLAGS
7327                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7328                           cat >conftest.$ac_ext <<_ACEOF
7329 #line 7329 "configure"
7330 #include "confdefs.h"
7331 #include <stdio.h>
7332 int
7333 main ()
7334 {
7335 printf("Hello")
7336   ;
7337   return 0;
7338 }
7339 _ACEOF
7340 rm -f conftest.$ac_objext
7341 if { (eval echo "$as_me:7341: \"$ac_compile\"") >&5
7342   (eval $ac_compile) 2>&5
7343   ac_status=$?
7344   echo "$as_me:7344: \$? = $ac_status" >&5
7345   (exit $ac_status); } &&
7346          { ac_try='test -s conftest.$ac_objext'
7347   { (eval echo "$as_me:7347: \"$ac_try\"") >&5
7348   (eval $ac_try) 2>&5
7349   ac_status=$?
7350   echo "$as_me:7350: \$? = $ac_status" >&5
7351   (exit $ac_status); }; }; then
7352   :
7353 else
7354   echo "$as_me: failed program was:" >&5
7355 cat conftest.$ac_ext >&5
7356 cf_have_incdir=yes
7357 fi
7358 rm -f conftest.$ac_objext conftest.$ac_ext
7359                           CPPFLAGS=$cf_save_CPPFLAGS
7360                         fi
7361                   fi
7362                 fi
7363
7364                 if test "$cf_have_incdir" = no ; then
7365                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7366
7367 echo "${as_me:-configure}:7367: testing adding $cf_add_incdir to include-path ..." 1>&5
7368
7369                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7370
7371                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7372                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7373                   cf_add_incdir="$cf_top_incdir"
7374                 else
7375                   break
7376                 fi
7377           fi
7378         done
7379   done
7380 fi
7381
7382 if test -n "$cf_cv_library_path_utf8" ; then
7383   for cf_add_libdir in $cf_cv_library_path_utf8
7384   do
7385     if test $cf_add_libdir = /usr/lib ; then
7386       :
7387     elif test -d $cf_add_libdir
7388     then
7389       cf_have_libdir=no
7390       if test -n "$LDFLAGS$LIBS" ; then
7391         # a loop is needed to ensure we can add subdirs of existing dirs
7392         for cf_test_libdir in $LDFLAGS $LIBS ; do
7393           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7394             cf_have_libdir=yes; break
7395           fi
7396         done
7397       fi
7398       if test "$cf_have_libdir" = no ; then
7399         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7400
7401 echo "${as_me:-configure}:7401: testing adding $cf_add_libdir to library-path ..." 1>&5
7402
7403         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7404       fi
7405     fi
7406   done
7407 fi
7408
7409         LIBS="$cf_cv_library_file_utf8 $LIBS"
7410 fi
7411
7412 cf_ncuconfig_root=ncursesw
7413
7414 echo "Looking for ${cf_ncuconfig_root}-config"
7415
7416 if test -n "$ac_tool_prefix"; then
7417   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7418   do
7419     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7420 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7421 echo "$as_me:7421: checking for $ac_word" >&5
7422 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7423 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7424   echo $ECHO_N "(cached) $ECHO_C" >&6
7425 else
7426   if test -n "$NCURSES_CONFIG"; then
7427   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7428 else
7429   ac_save_IFS=$IFS; IFS=$ac_path_separator
7430 ac_dummy="$PATH"
7431 for ac_dir in $ac_dummy; do
7432   IFS=$ac_save_IFS
7433   test -z "$ac_dir" && ac_dir=.
7434   $as_executable_p "$ac_dir/$ac_word" || continue
7435 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7436 echo "$as_me:7436: found $ac_dir/$ac_word" >&5
7437 break
7438 done
7439
7440 fi
7441 fi
7442 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7443 if test -n "$NCURSES_CONFIG"; then
7444   echo "$as_me:7444: result: $NCURSES_CONFIG" >&5
7445 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7446 else
7447   echo "$as_me:7447: result: no" >&5
7448 echo "${ECHO_T}no" >&6
7449 fi
7450
7451     test -n "$NCURSES_CONFIG" && break
7452   done
7453 fi
7454 if test -z "$NCURSES_CONFIG"; then
7455   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7456   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7457 do
7458   # Extract the first word of "$ac_prog", so it can be a program name with args.
7459 set dummy $ac_prog; ac_word=$2
7460 echo "$as_me:7460: checking for $ac_word" >&5
7461 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7462 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7463   echo $ECHO_N "(cached) $ECHO_C" >&6
7464 else
7465   if test -n "$ac_ct_NCURSES_CONFIG"; then
7466   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7467 else
7468   ac_save_IFS=$IFS; IFS=$ac_path_separator
7469 ac_dummy="$PATH"
7470 for ac_dir in $ac_dummy; do
7471   IFS=$ac_save_IFS
7472   test -z "$ac_dir" && ac_dir=.
7473   $as_executable_p "$ac_dir/$ac_word" || continue
7474 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7475 echo "$as_me:7475: found $ac_dir/$ac_word" >&5
7476 break
7477 done
7478
7479 fi
7480 fi
7481 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7482 if test -n "$ac_ct_NCURSES_CONFIG"; then
7483   echo "$as_me:7483: result: $ac_ct_NCURSES_CONFIG" >&5
7484 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7485 else
7486   echo "$as_me:7486: result: no" >&5
7487 echo "${ECHO_T}no" >&6
7488 fi
7489
7490   test -n "$ac_ct_NCURSES_CONFIG" && break
7491 done
7492 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7493
7494   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7495 fi
7496
7497 if test "$NCURSES_CONFIG" != none ; then
7498
7499 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7500 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
7501
7502 # even with config script, some packages use no-override for curses.h
7503
7504 echo "$as_me:7504: checking if we have identified curses headers" >&5
7505 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7506 if test "${cf_cv_ncurses_header+set}" = set; then
7507   echo $ECHO_N "(cached) $ECHO_C" >&6
7508 else
7509
7510 cf_cv_ncurses_header=none
7511 for cf_header in  \
7512     ncursesw/ncurses.h \
7513         ncursesw/curses.h \
7514         ncurses.h \
7515         curses.h
7516 do
7517 cat >conftest.$ac_ext <<_ACEOF
7518 #line 7518 "configure"
7519 #include "confdefs.h"
7520 #include <${cf_header}>
7521 int
7522 main ()
7523 {
7524 initscr(); tgoto("?", 0,0)
7525   ;
7526   return 0;
7527 }
7528 _ACEOF
7529 rm -f conftest.$ac_objext
7530 if { (eval echo "$as_me:7530: \"$ac_compile\"") >&5
7531   (eval $ac_compile) 2>&5
7532   ac_status=$?
7533   echo "$as_me:7533: \$? = $ac_status" >&5
7534   (exit $ac_status); } &&
7535          { ac_try='test -s conftest.$ac_objext'
7536   { (eval echo "$as_me:7536: \"$ac_try\"") >&5
7537   (eval $ac_try) 2>&5
7538   ac_status=$?
7539   echo "$as_me:7539: \$? = $ac_status" >&5
7540   (exit $ac_status); }; }; then
7541   cf_cv_ncurses_header=$cf_header; break
7542 else
7543   echo "$as_me: failed program was:" >&5
7544 cat conftest.$ac_ext >&5
7545 fi
7546 rm -f conftest.$ac_objext conftest.$ac_ext
7547 done
7548
7549 fi
7550 echo "$as_me:7550: result: $cf_cv_ncurses_header" >&5
7551 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7552
7553 if test "$cf_cv_ncurses_header" = none ; then
7554         { { echo "$as_me:7554: error: No curses header-files found" >&5
7555 echo "$as_me: error: No curses header-files found" >&2;}
7556    { (exit 1); exit 1; }; }
7557 fi
7558
7559 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7560
7561 for ac_header in $cf_cv_ncurses_header
7562 do
7563 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7564 echo "$as_me:7564: checking for $ac_header" >&5
7565 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7566 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7567   echo $ECHO_N "(cached) $ECHO_C" >&6
7568 else
7569   cat >conftest.$ac_ext <<_ACEOF
7570 #line 7570 "configure"
7571 #include "confdefs.h"
7572 #include <$ac_header>
7573 _ACEOF
7574 if { (eval echo "$as_me:7574: \"$ac_cpp conftest.$ac_ext\"") >&5
7575   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7576   ac_status=$?
7577   egrep -v '^ *\+' conftest.er1 >conftest.err
7578   rm -f conftest.er1
7579   cat conftest.err >&5
7580   echo "$as_me:7580: \$? = $ac_status" >&5
7581   (exit $ac_status); } >/dev/null; then
7582   if test -s conftest.err; then
7583     ac_cpp_err=$ac_c_preproc_warn_flag
7584   else
7585     ac_cpp_err=
7586   fi
7587 else
7588   ac_cpp_err=yes
7589 fi
7590 if test -z "$ac_cpp_err"; then
7591   eval "$as_ac_Header=yes"
7592 else
7593   echo "$as_me: failed program was:" >&5
7594   cat conftest.$ac_ext >&5
7595   eval "$as_ac_Header=no"
7596 fi
7597 rm -f conftest.err conftest.$ac_ext
7598 fi
7599 echo "$as_me:7599: result: `eval echo '${'$as_ac_Header'}'`" >&5
7600 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7601 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7602   cat >>confdefs.h <<EOF
7603 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7604 EOF
7605
7606 fi
7607 done
7608
7609 cat >>confdefs.h <<\EOF
7610 #define NCURSES 1
7611 EOF
7612
7613 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7614
7615 cat >>confdefs.h <<EOF
7616 #define $cf_nculib_ROOT 1
7617 EOF
7618
7619 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7620
7621 else
7622
7623 cf_ncuhdr_root=ncursesw
7624
7625 test -n "$cf_cv_curses_dir" && \
7626 test "$cf_cv_curses_dir" != "no" && { \
7627
7628 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7629   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7630   do
7631         while test $cf_add_incdir != /usr/include
7632         do
7633           if test -d $cf_add_incdir
7634           then
7635                 cf_have_incdir=no
7636                 if test -n "$CFLAGS$CPPFLAGS" ; then
7637                   # a loop is needed to ensure we can add subdirs of existing dirs
7638                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7639                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7640                           cf_have_incdir=yes; break
7641                         fi
7642                   done
7643                 fi
7644
7645                 if test "$cf_have_incdir" = no ; then
7646                   if test "$cf_add_incdir" = /usr/local/include ; then
7647                         if test "$GCC" = yes
7648                         then
7649                           cf_save_CPPFLAGS=$CPPFLAGS
7650                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7651                           cat >conftest.$ac_ext <<_ACEOF
7652 #line 7652 "configure"
7653 #include "confdefs.h"
7654 #include <stdio.h>
7655 int
7656 main ()
7657 {
7658 printf("Hello")
7659   ;
7660   return 0;
7661 }
7662 _ACEOF
7663 rm -f conftest.$ac_objext
7664 if { (eval echo "$as_me:7664: \"$ac_compile\"") >&5
7665   (eval $ac_compile) 2>&5
7666   ac_status=$?
7667   echo "$as_me:7667: \$? = $ac_status" >&5
7668   (exit $ac_status); } &&
7669          { ac_try='test -s conftest.$ac_objext'
7670   { (eval echo "$as_me:7670: \"$ac_try\"") >&5
7671   (eval $ac_try) 2>&5
7672   ac_status=$?
7673   echo "$as_me:7673: \$? = $ac_status" >&5
7674   (exit $ac_status); }; }; then
7675   :
7676 else
7677   echo "$as_me: failed program was:" >&5
7678 cat conftest.$ac_ext >&5
7679 cf_have_incdir=yes
7680 fi
7681 rm -f conftest.$ac_objext conftest.$ac_ext
7682                           CPPFLAGS=$cf_save_CPPFLAGS
7683                         fi
7684                   fi
7685                 fi
7686
7687                 if test "$cf_have_incdir" = no ; then
7688                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7689
7690 echo "${as_me:-configure}:7690: testing adding $cf_add_incdir to include-path ..." 1>&5
7691
7692                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7693
7694                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7695                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7696                   cf_add_incdir="$cf_top_incdir"
7697                 else
7698                   break
7699                 fi
7700           fi
7701         done
7702   done
7703 fi
7704
7705 }
7706
7707 echo "$as_me:7707: checking for $cf_ncuhdr_root header in include-path" >&5
7708 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7709 if test "${cf_cv_ncurses_h+set}" = set; then
7710   echo $ECHO_N "(cached) $ECHO_C" >&6
7711 else
7712
7713         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7714         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7715         for cf_header in $cf_header_list
7716         do
7717
7718         cat >conftest.$ac_ext <<_ACEOF
7719 #line 7719 "configure"
7720 #include "confdefs.h"
7721
7722 #define _XOPEN_SOURCE_EXTENDED
7723 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7724 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7725
7726 #include <$cf_header>
7727 int
7728 main ()
7729 {
7730
7731 #ifdef NCURSES_VERSION
7732
7733 #ifndef WACS_BSSB
7734         make an error
7735 #endif
7736
7737 printf("%s\n", NCURSES_VERSION);
7738 #else
7739 #ifdef __NCURSES_H
7740 printf("old\n");
7741 #else
7742         make an error
7743 #endif
7744 #endif
7745
7746   ;
7747   return 0;
7748 }
7749 _ACEOF
7750 rm -f conftest.$ac_objext
7751 if { (eval echo "$as_me:7751: \"$ac_compile\"") >&5
7752   (eval $ac_compile) 2>&5
7753   ac_status=$?
7754   echo "$as_me:7754: \$? = $ac_status" >&5
7755   (exit $ac_status); } &&
7756          { ac_try='test -s conftest.$ac_objext'
7757   { (eval echo "$as_me:7757: \"$ac_try\"") >&5
7758   (eval $ac_try) 2>&5
7759   ac_status=$?
7760   echo "$as_me:7760: \$? = $ac_status" >&5
7761   (exit $ac_status); }; }; then
7762   cf_cv_ncurses_h=$cf_header
7763
7764 else
7765   echo "$as_me: failed program was:" >&5
7766 cat conftest.$ac_ext >&5
7767 cf_cv_ncurses_h=no
7768 fi
7769 rm -f conftest.$ac_objext conftest.$ac_ext
7770
7771                 test "$cf_cv_ncurses_h" != no && break
7772         done
7773
7774 fi
7775 echo "$as_me:7775: result: $cf_cv_ncurses_h" >&5
7776 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7777
7778 if test "$cf_cv_ncurses_h" != no ; then
7779         cf_cv_ncurses_header=$cf_cv_ncurses_h
7780 else
7781
7782 echo "$as_me:7782: checking for $cf_ncuhdr_root include-path" >&5
7783 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7784 if test "${cf_cv_ncurses_h2+set}" = set; then
7785   echo $ECHO_N "(cached) $ECHO_C" >&6
7786 else
7787
7788         test -n "$verbose" && echo
7789
7790 cf_search=
7791
7792 # collect the current set of include-directories from compiler flags
7793 cf_header_path_list=""
7794 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7795         for cf_header_path in $CPPFLAGS $CFLAGS
7796         do
7797                 case $cf_header_path in #(vi
7798                 -I*)
7799                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7800
7801 test "$cf_header_path" != "NONE" && \
7802 test -d "$cf_header_path" && \
7803  {
7804         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7805         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7806         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7807         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7808         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7809         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"
7810 }
7811
7812                         cf_header_path_list="$cf_header_path_list $cf_search"
7813                         ;;
7814                 esac
7815         done
7816 fi
7817
7818 # add the variations for the package we are looking for
7819
7820 cf_search=
7821
7822 test "/usr" != "$prefix" && \
7823 test -d "/usr" && \
7824 (test $prefix = NONE || test "/usr" != "$prefix") && {
7825         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7826         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7827         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
7828         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
7829         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
7830         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7831 }
7832
7833 test "$prefix" != "NONE" && \
7834 test -d "$prefix" && \
7835  {
7836         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7837         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7838         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7839         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7840         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7841         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7842 }
7843
7844 test "/usr/local" != "$prefix" && \
7845 test -d "/usr/local" && \
7846 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7847         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
7848         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
7849         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
7850         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
7851         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
7852         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7853 }
7854
7855 test "/opt" != "$prefix" && \
7856 test -d "/opt" && \
7857 (test $prefix = NONE || test "/opt" != "$prefix") && {
7858         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
7859         test -d /opt/include &&          cf_search="$cf_search /opt/include"
7860         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
7861         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
7862         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
7863         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7864 }
7865
7866 test "$HOME" != "$prefix" && \
7867 test -d "$HOME" && \
7868 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7869         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
7870         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
7871         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
7872         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
7873         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
7874         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7875 }
7876
7877 test "$includedir" != NONE && \
7878 test "$includedir" != "/usr/include" && \
7879 test -d "$includedir" && {
7880         test -d $includedir &&    cf_search="$cf_search $includedir"
7881         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7882 }
7883
7884 test "$oldincludedir" != NONE && \
7885 test "$oldincludedir" != "/usr/include" && \
7886 test -d "$oldincludedir" && {
7887         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7888         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7889 }
7890
7891 cf_search="$cf_search $cf_header_path_list"
7892
7893         test -n "$verbose" && echo search path $cf_search
7894         cf_save2_CPPFLAGS="$CPPFLAGS"
7895         for cf_incdir in $cf_search
7896         do
7897
7898 if test -n "$cf_incdir" ; then
7899   for cf_add_incdir in $cf_incdir
7900   do
7901         while test $cf_add_incdir != /usr/include
7902         do
7903           if test -d $cf_add_incdir
7904           then
7905                 cf_have_incdir=no
7906                 if test -n "$CFLAGS$CPPFLAGS" ; then
7907                   # a loop is needed to ensure we can add subdirs of existing dirs
7908                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7909                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7910                           cf_have_incdir=yes; break
7911                         fi
7912                   done
7913                 fi
7914
7915                 if test "$cf_have_incdir" = no ; then
7916                   if test "$cf_add_incdir" = /usr/local/include ; then
7917                         if test "$GCC" = yes
7918                         then
7919                           cf_save_CPPFLAGS=$CPPFLAGS
7920                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7921                           cat >conftest.$ac_ext <<_ACEOF
7922 #line 7922 "configure"
7923 #include "confdefs.h"
7924 #include <stdio.h>
7925 int
7926 main ()
7927 {
7928 printf("Hello")
7929   ;
7930   return 0;
7931 }
7932 _ACEOF
7933 rm -f conftest.$ac_objext
7934 if { (eval echo "$as_me:7934: \"$ac_compile\"") >&5
7935   (eval $ac_compile) 2>&5
7936   ac_status=$?
7937   echo "$as_me:7937: \$? = $ac_status" >&5
7938   (exit $ac_status); } &&
7939          { ac_try='test -s conftest.$ac_objext'
7940   { (eval echo "$as_me:7940: \"$ac_try\"") >&5
7941   (eval $ac_try) 2>&5
7942   ac_status=$?
7943   echo "$as_me:7943: \$? = $ac_status" >&5
7944   (exit $ac_status); }; }; then
7945   :
7946 else
7947   echo "$as_me: failed program was:" >&5
7948 cat conftest.$ac_ext >&5
7949 cf_have_incdir=yes
7950 fi
7951 rm -f conftest.$ac_objext conftest.$ac_ext
7952                           CPPFLAGS=$cf_save_CPPFLAGS
7953                         fi
7954                   fi
7955                 fi
7956
7957                 if test "$cf_have_incdir" = no ; then
7958                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7959
7960 echo "${as_me:-configure}:7960: testing adding $cf_add_incdir to include-path ..." 1>&5
7961
7962                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7963
7964                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7965                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7966                   cf_add_incdir="$cf_top_incdir"
7967                 else
7968                   break
7969                 fi
7970           fi
7971         done
7972   done
7973 fi
7974
7975                 for cf_header in \
7976                         ncurses.h \
7977                         curses.h
7978                 do
7979
7980         cat >conftest.$ac_ext <<_ACEOF
7981 #line 7981 "configure"
7982 #include "confdefs.h"
7983
7984 #include <$cf_header>
7985 int
7986 main ()
7987 {
7988
7989 #ifdef NCURSES_VERSION
7990
7991 printf("%s\n", NCURSES_VERSION);
7992 #else
7993 #ifdef __NCURSES_H
7994 printf("old\n");
7995 #else
7996         make an error
7997 #endif
7998 #endif
7999
8000   ;
8001   return 0;
8002 }
8003 _ACEOF
8004 rm -f conftest.$ac_objext
8005 if { (eval echo "$as_me:8005: \"$ac_compile\"") >&5
8006   (eval $ac_compile) 2>&5
8007   ac_status=$?
8008   echo "$as_me:8008: \$? = $ac_status" >&5
8009   (exit $ac_status); } &&
8010          { ac_try='test -s conftest.$ac_objext'
8011   { (eval echo "$as_me:8011: \"$ac_try\"") >&5
8012   (eval $ac_try) 2>&5
8013   ac_status=$?
8014   echo "$as_me:8014: \$? = $ac_status" >&5
8015   (exit $ac_status); }; }; then
8016   cf_cv_ncurses_h2=$cf_header
8017
8018 else
8019   echo "$as_me: failed program was:" >&5
8020 cat conftest.$ac_ext >&5
8021 cf_cv_ncurses_h2=no
8022 fi
8023 rm -f conftest.$ac_objext conftest.$ac_ext
8024
8025                         if test "$cf_cv_ncurses_h2" != no ; then
8026                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8027                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8028                                 break
8029                         fi
8030                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8031                 done
8032                 CPPFLAGS="$cf_save2_CPPFLAGS"
8033                 test "$cf_cv_ncurses_h2" != no && break
8034         done
8035         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8035: error: not found" >&5
8036 echo "$as_me: error: not found" >&2;}
8037    { (exit 1); exit 1; }; }
8038
8039 fi
8040 echo "$as_me:8040: result: $cf_cv_ncurses_h2" >&5
8041 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8042
8043         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8044         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8045         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8046                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8047         fi
8048
8049 if test -n "$cf_1st_incdir" ; then
8050   for cf_add_incdir in $cf_1st_incdir
8051   do
8052         while test $cf_add_incdir != /usr/include
8053         do
8054           if test -d $cf_add_incdir
8055           then
8056                 cf_have_incdir=no
8057                 if test -n "$CFLAGS$CPPFLAGS" ; then
8058                   # a loop is needed to ensure we can add subdirs of existing dirs
8059                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8060                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8061                           cf_have_incdir=yes; break
8062                         fi
8063                   done
8064                 fi
8065
8066                 if test "$cf_have_incdir" = no ; then
8067                   if test "$cf_add_incdir" = /usr/local/include ; then
8068                         if test "$GCC" = yes
8069                         then
8070                           cf_save_CPPFLAGS=$CPPFLAGS
8071                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8072                           cat >conftest.$ac_ext <<_ACEOF
8073 #line 8073 "configure"
8074 #include "confdefs.h"
8075 #include <stdio.h>
8076 int
8077 main ()
8078 {
8079 printf("Hello")
8080   ;
8081   return 0;
8082 }
8083 _ACEOF
8084 rm -f conftest.$ac_objext
8085 if { (eval echo "$as_me:8085: \"$ac_compile\"") >&5
8086   (eval $ac_compile) 2>&5
8087   ac_status=$?
8088   echo "$as_me:8088: \$? = $ac_status" >&5
8089   (exit $ac_status); } &&
8090          { ac_try='test -s conftest.$ac_objext'
8091   { (eval echo "$as_me:8091: \"$ac_try\"") >&5
8092   (eval $ac_try) 2>&5
8093   ac_status=$?
8094   echo "$as_me:8094: \$? = $ac_status" >&5
8095   (exit $ac_status); }; }; then
8096   :
8097 else
8098   echo "$as_me: failed program was:" >&5
8099 cat conftest.$ac_ext >&5
8100 cf_have_incdir=yes
8101 fi
8102 rm -f conftest.$ac_objext conftest.$ac_ext
8103                           CPPFLAGS=$cf_save_CPPFLAGS
8104                         fi
8105                   fi
8106                 fi
8107
8108                 if test "$cf_have_incdir" = no ; then
8109                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8110
8111 echo "${as_me:-configure}:8111: testing adding $cf_add_incdir to include-path ..." 1>&5
8112
8113                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8114
8115                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8116                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8117                   cf_add_incdir="$cf_top_incdir"
8118                 else
8119                   break
8120                 fi
8121           fi
8122         done
8123   done
8124 fi
8125
8126 fi
8127
8128 # Set definitions to allow ifdef'ing for ncurses.h
8129
8130 case $cf_cv_ncurses_header in # (vi
8131 *ncurses.h)
8132
8133 cat >>confdefs.h <<\EOF
8134 #define HAVE_NCURSES_H 1
8135 EOF
8136
8137         ;;
8138 esac
8139
8140 case $cf_cv_ncurses_header in # (vi
8141 ncurses/curses.h|ncurses/ncurses.h)
8142
8143 cat >>confdefs.h <<\EOF
8144 #define HAVE_NCURSES_NCURSES_H 1
8145 EOF
8146
8147         ;;
8148 ncursesw/curses.h|ncursesw/ncurses.h)
8149
8150 cat >>confdefs.h <<\EOF
8151 #define HAVE_NCURSESW_NCURSES_H 1
8152 EOF
8153
8154         ;;
8155 esac
8156
8157 echo "$as_me:8157: checking for terminfo header" >&5
8158 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8159 if test "${cf_cv_term_header+set}" = set; then
8160   echo $ECHO_N "(cached) $ECHO_C" >&6
8161 else
8162
8163 case ${cf_cv_ncurses_header} in #(vi
8164 */ncurses.h|*/ncursesw.h) #(vi
8165         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8166         ;;
8167 *)
8168         cf_term_header=term.h
8169         ;;
8170 esac
8171
8172 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8173 do
8174 cat >conftest.$ac_ext <<_ACEOF
8175 #line 8175 "configure"
8176 #include "confdefs.h"
8177 #include <stdio.h>
8178 #include <${cf_cv_ncurses_header:-curses.h}>
8179 #include <$cf_test>
8180
8181 int
8182 main ()
8183 {
8184 int x = auto_left_margin
8185   ;
8186   return 0;
8187 }
8188 _ACEOF
8189 rm -f conftest.$ac_objext
8190 if { (eval echo "$as_me:8190: \"$ac_compile\"") >&5
8191   (eval $ac_compile) 2>&5
8192   ac_status=$?
8193   echo "$as_me:8193: \$? = $ac_status" >&5
8194   (exit $ac_status); } &&
8195          { ac_try='test -s conftest.$ac_objext'
8196   { (eval echo "$as_me:8196: \"$ac_try\"") >&5
8197   (eval $ac_try) 2>&5
8198   ac_status=$?
8199   echo "$as_me:8199: \$? = $ac_status" >&5
8200   (exit $ac_status); }; }; then
8201
8202         cf_cv_term_header="$cf_test"
8203 else
8204   echo "$as_me: failed program was:" >&5
8205 cat conftest.$ac_ext >&5
8206
8207         cf_cv_term_header=unknown
8208
8209 fi
8210 rm -f conftest.$ac_objext conftest.$ac_ext
8211         test "$cf_cv_term_header" != unknown && break
8212 done
8213
8214 fi
8215 echo "$as_me:8215: result: $cf_cv_term_header" >&5
8216 echo "${ECHO_T}$cf_cv_term_header" >&6
8217
8218 # Set definitions to allow ifdef'ing to accommodate subdirectories
8219
8220 case $cf_cv_term_header in # (vi
8221 *term.h)
8222
8223 cat >>confdefs.h <<\EOF
8224 #define HAVE_TERM_H 1
8225 EOF
8226
8227         ;;
8228 esac
8229
8230 case $cf_cv_term_header in # (vi
8231 ncurses/term.h) #(vi
8232
8233 cat >>confdefs.h <<\EOF
8234 #define HAVE_NCURSES_TERM_H 1
8235 EOF
8236
8237         ;;
8238 ncursesw/term.h)
8239
8240 cat >>confdefs.h <<\EOF
8241 #define HAVE_NCURSESW_TERM_H 1
8242 EOF
8243
8244         ;;
8245 esac
8246
8247 # some applications need this, but should check for NCURSES_VERSION
8248
8249 cat >>confdefs.h <<\EOF
8250 #define NCURSES 1
8251 EOF
8252
8253 echo "$as_me:8253: checking for ncurses version" >&5
8254 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8255 if test "${cf_cv_ncurses_version+set}" = set; then
8256   echo $ECHO_N "(cached) $ECHO_C" >&6
8257 else
8258
8259         cf_cv_ncurses_version=no
8260         cf_tempfile=out$$
8261         rm -f $cf_tempfile
8262         if test "$cross_compiling" = yes; then
8263
8264         # This will not work if the preprocessor splits the line after the
8265         # Autoconf token.  The 'unproto' program does that.
8266         cat > conftest.$ac_ext <<EOF
8267 #include <${cf_cv_ncurses_header:-curses.h}>
8268 #undef Autoconf
8269 #ifdef NCURSES_VERSION
8270 Autoconf NCURSES_VERSION
8271 #else
8272 #ifdef __NCURSES_H
8273 Autoconf "old"
8274 #endif
8275 ;
8276 #endif
8277 EOF
8278         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8279         { (eval echo "$as_me:8279: \"$cf_try\"") >&5
8280   (eval $cf_try) 2>&5
8281   ac_status=$?
8282   echo "$as_me:8282: \$? = $ac_status" >&5
8283   (exit $ac_status); }
8284         if test -f conftest.out ; then
8285                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8286                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8287                 rm -f conftest.out
8288         fi
8289
8290 else
8291   cat >conftest.$ac_ext <<_ACEOF
8292 #line 8292 "configure"
8293 #include "confdefs.h"
8294
8295 #include <${cf_cv_ncurses_header:-curses.h}>
8296 #include <stdio.h>
8297 int main()
8298 {
8299         FILE *fp = fopen("$cf_tempfile", "w");
8300 #ifdef NCURSES_VERSION
8301 # ifdef NCURSES_VERSION_PATCH
8302         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8303 # else
8304         fprintf(fp, "%s\n", NCURSES_VERSION);
8305 # endif
8306 #else
8307 # ifdef __NCURSES_H
8308         fprintf(fp, "old\n");
8309 # else
8310         make an error
8311 # endif
8312 #endif
8313         ${cf_cv_main_return:-return}(0);
8314 }
8315 _ACEOF
8316 rm -f conftest$ac_exeext
8317 if { (eval echo "$as_me:8317: \"$ac_link\"") >&5
8318   (eval $ac_link) 2>&5
8319   ac_status=$?
8320   echo "$as_me:8320: \$? = $ac_status" >&5
8321   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8322   { (eval echo "$as_me:8322: \"$ac_try\"") >&5
8323   (eval $ac_try) 2>&5
8324   ac_status=$?
8325   echo "$as_me:8325: \$? = $ac_status" >&5
8326   (exit $ac_status); }; }; then
8327
8328         cf_cv_ncurses_version=`cat $cf_tempfile`
8329 else
8330   echo "$as_me: program exited with status $ac_status" >&5
8331 echo "$as_me: failed program was:" >&5
8332 cat conftest.$ac_ext >&5
8333 fi
8334 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8335 fi
8336         rm -f $cf_tempfile
8337
8338 fi
8339 echo "$as_me:8339: result: $cf_cv_ncurses_version" >&5
8340 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8341 test "$cf_cv_ncurses_version" = no ||
8342 cat >>confdefs.h <<\EOF
8343 #define NCURSES 1
8344 EOF
8345
8346 cf_nculib_root=ncursesw
8347         # This works, except for the special case where we find gpm, but
8348         # ncurses is in a nonstandard location via $LIBS, and we really want
8349         # to link gpm.
8350 cf_ncurses_LIBS=""
8351 cf_ncurses_SAVE="$LIBS"
8352 echo "$as_me:8352: checking for Gpm_Open in -lgpm" >&5
8353 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8354 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8355   echo $ECHO_N "(cached) $ECHO_C" >&6
8356 else
8357   ac_check_lib_save_LIBS=$LIBS
8358 LIBS="-lgpm  $LIBS"
8359 cat >conftest.$ac_ext <<_ACEOF
8360 #line 8360 "configure"
8361 #include "confdefs.h"
8362
8363 /* Override any gcc2 internal prototype to avoid an error.  */
8364 #ifdef __cplusplus
8365 extern "C"
8366 #endif
8367 /* We use char because int might match the return type of a gcc2
8368    builtin and then its argument prototype would still apply.  */
8369 char Gpm_Open ();
8370 int
8371 main ()
8372 {
8373 Gpm_Open ();
8374   ;
8375   return 0;
8376 }
8377 _ACEOF
8378 rm -f conftest.$ac_objext conftest$ac_exeext
8379 if { (eval echo "$as_me:8379: \"$ac_link\"") >&5
8380   (eval $ac_link) 2>&5
8381   ac_status=$?
8382   echo "$as_me:8382: \$? = $ac_status" >&5
8383   (exit $ac_status); } &&
8384          { ac_try='test -s conftest$ac_exeext'
8385   { (eval echo "$as_me:8385: \"$ac_try\"") >&5
8386   (eval $ac_try) 2>&5
8387   ac_status=$?
8388   echo "$as_me:8388: \$? = $ac_status" >&5
8389   (exit $ac_status); }; }; then
8390   ac_cv_lib_gpm_Gpm_Open=yes
8391 else
8392   echo "$as_me: failed program was:" >&5
8393 cat conftest.$ac_ext >&5
8394 ac_cv_lib_gpm_Gpm_Open=no
8395 fi
8396 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8397 LIBS=$ac_check_lib_save_LIBS
8398 fi
8399 echo "$as_me:8399: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8400 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8401 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8402   echo "$as_me:8402: checking for initscr in -lgpm" >&5
8403 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8404 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8405   echo $ECHO_N "(cached) $ECHO_C" >&6
8406 else
8407   ac_check_lib_save_LIBS=$LIBS
8408 LIBS="-lgpm  $LIBS"
8409 cat >conftest.$ac_ext <<_ACEOF
8410 #line 8410 "configure"
8411 #include "confdefs.h"
8412
8413 /* Override any gcc2 internal prototype to avoid an error.  */
8414 #ifdef __cplusplus
8415 extern "C"
8416 #endif
8417 /* We use char because int might match the return type of a gcc2
8418    builtin and then its argument prototype would still apply.  */
8419 char initscr ();
8420 int
8421 main ()
8422 {
8423 initscr ();
8424   ;
8425   return 0;
8426 }
8427 _ACEOF
8428 rm -f conftest.$ac_objext conftest$ac_exeext
8429 if { (eval echo "$as_me:8429: \"$ac_link\"") >&5
8430   (eval $ac_link) 2>&5
8431   ac_status=$?
8432   echo "$as_me:8432: \$? = $ac_status" >&5
8433   (exit $ac_status); } &&
8434          { ac_try='test -s conftest$ac_exeext'
8435   { (eval echo "$as_me:8435: \"$ac_try\"") >&5
8436   (eval $ac_try) 2>&5
8437   ac_status=$?
8438   echo "$as_me:8438: \$? = $ac_status" >&5
8439   (exit $ac_status); }; }; then
8440   ac_cv_lib_gpm_initscr=yes
8441 else
8442   echo "$as_me: failed program was:" >&5
8443 cat conftest.$ac_ext >&5
8444 ac_cv_lib_gpm_initscr=no
8445 fi
8446 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8447 LIBS=$ac_check_lib_save_LIBS
8448 fi
8449 echo "$as_me:8449: result: $ac_cv_lib_gpm_initscr" >&5
8450 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8451 if test $ac_cv_lib_gpm_initscr = yes; then
8452   LIBS="$cf_ncurses_SAVE"
8453 else
8454   cf_ncurses_LIBS="-lgpm"
8455 fi
8456
8457 fi
8458
8459 case $host_os in #(vi
8460 freebsd*)
8461         # This is only necessary if you are linking against an obsolete
8462         # version of ncurses (but it should do no harm, since it's static).
8463         if test "$cf_nculib_root" = ncurses ; then
8464                 echo "$as_me:8464: checking for tgoto in -lmytinfo" >&5
8465 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8466 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8467   echo $ECHO_N "(cached) $ECHO_C" >&6
8468 else
8469   ac_check_lib_save_LIBS=$LIBS
8470 LIBS="-lmytinfo  $LIBS"
8471 cat >conftest.$ac_ext <<_ACEOF
8472 #line 8472 "configure"
8473 #include "confdefs.h"
8474
8475 /* Override any gcc2 internal prototype to avoid an error.  */
8476 #ifdef __cplusplus
8477 extern "C"
8478 #endif
8479 /* We use char because int might match the return type of a gcc2
8480    builtin and then its argument prototype would still apply.  */
8481 char tgoto ();
8482 int
8483 main ()
8484 {
8485 tgoto ();
8486   ;
8487   return 0;
8488 }
8489 _ACEOF
8490 rm -f conftest.$ac_objext conftest$ac_exeext
8491 if { (eval echo "$as_me:8491: \"$ac_link\"") >&5
8492   (eval $ac_link) 2>&5
8493   ac_status=$?
8494   echo "$as_me:8494: \$? = $ac_status" >&5
8495   (exit $ac_status); } &&
8496          { ac_try='test -s conftest$ac_exeext'
8497   { (eval echo "$as_me:8497: \"$ac_try\"") >&5
8498   (eval $ac_try) 2>&5
8499   ac_status=$?
8500   echo "$as_me:8500: \$? = $ac_status" >&5
8501   (exit $ac_status); }; }; then
8502   ac_cv_lib_mytinfo_tgoto=yes
8503 else
8504   echo "$as_me: failed program was:" >&5
8505 cat conftest.$ac_ext >&5
8506 ac_cv_lib_mytinfo_tgoto=no
8507 fi
8508 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8509 LIBS=$ac_check_lib_save_LIBS
8510 fi
8511 echo "$as_me:8511: result: $ac_cv_lib_mytinfo_tgoto" >&5
8512 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8513 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8514   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8515 fi
8516
8517         fi
8518         ;;
8519 esac
8520
8521 LIBS="$cf_ncurses_LIBS $LIBS"
8522
8523 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8524 then
8525         LIBS="-l$cf_nculib_root $LIBS"
8526 else
8527
8528         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8529         cf_libdir=""
8530         echo "$as_me:8530: checking for initscr" >&5
8531 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8532 if test "${ac_cv_func_initscr+set}" = set; then
8533   echo $ECHO_N "(cached) $ECHO_C" >&6
8534 else
8535   cat >conftest.$ac_ext <<_ACEOF
8536 #line 8536 "configure"
8537 #include "confdefs.h"
8538 /* System header to define __stub macros and hopefully few prototypes,
8539     which can conflict with char initscr (); below.  */
8540 #include <assert.h>
8541 /* Override any gcc2 internal prototype to avoid an error.  */
8542 #ifdef __cplusplus
8543 extern "C"
8544 #endif
8545 /* We use char because int might match the return type of a gcc2
8546    builtin and then its argument prototype would still apply.  */
8547 char initscr ();
8548 char (*f) ();
8549
8550 int
8551 main ()
8552 {
8553 /* The GNU C library defines this for functions which it implements
8554     to always fail with ENOSYS.  Some functions are actually named
8555     something starting with __ and the normal name is an alias.  */
8556 #if defined (__stub_initscr) || defined (__stub___initscr)
8557 choke me
8558 #else
8559 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8560 #endif
8561
8562   ;
8563   return 0;
8564 }
8565 _ACEOF
8566 rm -f conftest.$ac_objext conftest$ac_exeext
8567 if { (eval echo "$as_me:8567: \"$ac_link\"") >&5
8568   (eval $ac_link) 2>&5
8569   ac_status=$?
8570   echo "$as_me:8570: \$? = $ac_status" >&5
8571   (exit $ac_status); } &&
8572          { ac_try='test -s conftest$ac_exeext'
8573   { (eval echo "$as_me:8573: \"$ac_try\"") >&5
8574   (eval $ac_try) 2>&5
8575   ac_status=$?
8576   echo "$as_me:8576: \$? = $ac_status" >&5
8577   (exit $ac_status); }; }; then
8578   ac_cv_func_initscr=yes
8579 else
8580   echo "$as_me: failed program was:" >&5
8581 cat conftest.$ac_ext >&5
8582 ac_cv_func_initscr=no
8583 fi
8584 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8585 fi
8586 echo "$as_me:8586: result: $ac_cv_func_initscr" >&5
8587 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8588 if test $ac_cv_func_initscr = yes; then
8589   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8590 else
8591
8592                 cf_save_LIBS="$LIBS"
8593                 echo "$as_me:8593: checking for initscr in -l$cf_nculib_root" >&5
8594 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8595                 LIBS="-l$cf_nculib_root $LIBS"
8596                 cat >conftest.$ac_ext <<_ACEOF
8597 #line 8597 "configure"
8598 #include "confdefs.h"
8599 #include <${cf_cv_ncurses_header:-curses.h}>
8600 int
8601 main ()
8602 {
8603 initscr()
8604   ;
8605   return 0;
8606 }
8607 _ACEOF
8608 rm -f conftest.$ac_objext conftest$ac_exeext
8609 if { (eval echo "$as_me:8609: \"$ac_link\"") >&5
8610   (eval $ac_link) 2>&5
8611   ac_status=$?
8612   echo "$as_me:8612: \$? = $ac_status" >&5
8613   (exit $ac_status); } &&
8614          { ac_try='test -s conftest$ac_exeext'
8615   { (eval echo "$as_me:8615: \"$ac_try\"") >&5
8616   (eval $ac_try) 2>&5
8617   ac_status=$?
8618   echo "$as_me:8618: \$? = $ac_status" >&5
8619   (exit $ac_status); }; }; then
8620   echo "$as_me:8620: result: yes" >&5
8621 echo "${ECHO_T}yes" >&6
8622                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8623
8624 else
8625   echo "$as_me: failed program was:" >&5
8626 cat conftest.$ac_ext >&5
8627 echo "$as_me:8627: result: no" >&5
8628 echo "${ECHO_T}no" >&6
8629
8630 cf_search=
8631 cf_library_path_list=""
8632 if test -n "${LDFLAGS}${LIBS}" ; then
8633         for cf_library_path in $LDFLAGS $LIBS
8634         do
8635                 case $cf_library_path in #(vi
8636                 -L*)
8637                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8638
8639 test "$cf_library_path" != "NONE" && \
8640 test -d "$cf_library_path" && \
8641  {
8642         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8643         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8644         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8645         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8646         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8647         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"
8648 }
8649
8650                         cf_library_path_list="$cf_library_path_list $cf_search"
8651                         ;;
8652                 esac
8653         done
8654 fi
8655
8656 cf_search=
8657
8658 test "/usr" != "$prefix" && \
8659 test -d "/usr" && \
8660 (test $prefix = NONE || test "/usr" != "$prefix") && {
8661         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
8662         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
8663         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
8664         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
8665         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
8666         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
8667 }
8668
8669 test "$prefix" != "NONE" && \
8670 test -d "$prefix" && \
8671  {
8672         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8673         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8674         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8675         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8676         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8677         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8678 }
8679
8680 test "/usr/local" != "$prefix" && \
8681 test -d "/usr/local" && \
8682 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8683         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
8684         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
8685         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
8686         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
8687         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
8688         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
8689 }
8690
8691 test "/opt" != "$prefix" && \
8692 test -d "/opt" && \
8693 (test $prefix = NONE || test "/opt" != "$prefix") && {
8694         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
8695         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
8696         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
8697         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
8698         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
8699         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
8700 }
8701
8702 test "$HOME" != "$prefix" && \
8703 test -d "$HOME" && \
8704 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8705         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
8706         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
8707         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
8708         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
8709         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
8710         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
8711 }
8712
8713 cf_search="$cf_library_path_list $cf_search"
8714
8715                         for cf_libdir in $cf_search
8716                         do
8717                                 echo "$as_me:8717: checking for -l$cf_nculib_root in $cf_libdir" >&5
8718 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8719                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8720                                 cat >conftest.$ac_ext <<_ACEOF
8721 #line 8721 "configure"
8722 #include "confdefs.h"
8723 #include <${cf_cv_ncurses_header:-curses.h}>
8724 int
8725 main ()
8726 {
8727 initscr()
8728   ;
8729   return 0;
8730 }
8731 _ACEOF
8732 rm -f conftest.$ac_objext conftest$ac_exeext
8733 if { (eval echo "$as_me:8733: \"$ac_link\"") >&5
8734   (eval $ac_link) 2>&5
8735   ac_status=$?
8736   echo "$as_me:8736: \$? = $ac_status" >&5
8737   (exit $ac_status); } &&
8738          { ac_try='test -s conftest$ac_exeext'
8739   { (eval echo "$as_me:8739: \"$ac_try\"") >&5
8740   (eval $ac_try) 2>&5
8741   ac_status=$?
8742   echo "$as_me:8742: \$? = $ac_status" >&5
8743   (exit $ac_status); }; }; then
8744   echo "$as_me:8744: result: yes" >&5
8745 echo "${ECHO_T}yes" >&6
8746                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8747                                          break
8748 else
8749   echo "$as_me: failed program was:" >&5
8750 cat conftest.$ac_ext >&5
8751 echo "$as_me:8751: result: no" >&5
8752 echo "${ECHO_T}no" >&6
8753                                          LIBS="$cf_save_LIBS"
8754 fi
8755 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8756                         done
8757
8758 fi
8759 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8760
8761 fi
8762
8763 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8764
8765 if test $cf_found_library = no ; then
8766         { { echo "$as_me:8766: error: Cannot link $cf_nculib_root library" >&5
8767 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8768    { (exit 1); exit 1; }; }
8769 fi
8770
8771 fi
8772
8773 if test -n "$cf_ncurses_LIBS" ; then
8774         echo "$as_me:8774: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8775 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8776         cf_ncurses_SAVE="$LIBS"
8777         for p in $cf_ncurses_LIBS ; do
8778                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8779                 if test "$q" != "$LIBS" ; then
8780                         LIBS="$q"
8781                 fi
8782         done
8783         cat >conftest.$ac_ext <<_ACEOF
8784 #line 8784 "configure"
8785 #include "confdefs.h"
8786 #include <${cf_cv_ncurses_header:-curses.h}>
8787 int
8788 main ()
8789 {
8790 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8791   ;
8792   return 0;
8793 }
8794 _ACEOF
8795 rm -f conftest.$ac_objext conftest$ac_exeext
8796 if { (eval echo "$as_me:8796: \"$ac_link\"") >&5
8797   (eval $ac_link) 2>&5
8798   ac_status=$?
8799   echo "$as_me:8799: \$? = $ac_status" >&5
8800   (exit $ac_status); } &&
8801          { ac_try='test -s conftest$ac_exeext'
8802   { (eval echo "$as_me:8802: \"$ac_try\"") >&5
8803   (eval $ac_try) 2>&5
8804   ac_status=$?
8805   echo "$as_me:8805: \$? = $ac_status" >&5
8806   (exit $ac_status); }; }; then
8807   echo "$as_me:8807: result: yes" >&5
8808 echo "${ECHO_T}yes" >&6
8809 else
8810   echo "$as_me: failed program was:" >&5
8811 cat conftest.$ac_ext >&5
8812 echo "$as_me:8812: result: no" >&5
8813 echo "${ECHO_T}no" >&6
8814                  LIBS="$cf_ncurses_SAVE"
8815 fi
8816 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8817 fi
8818
8819 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8820
8821 cat >>confdefs.h <<EOF
8822 #define $cf_nculib_ROOT 1
8823 EOF
8824
8825 fi
8826
8827         ;;
8828 pdcurses)
8829         echo "$as_me:8829: checking for X" >&5
8830 echo $ECHO_N "checking for X... $ECHO_C" >&6
8831
8832 # Check whether --with-x or --without-x was given.
8833 if test "${with_x+set}" = set; then
8834   withval="$with_x"
8835
8836 fi;
8837 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
8838 if test "x$with_x" = xno; then
8839   # The user explicitly disabled X.
8840   have_x=disabled
8841 else
8842   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
8843     # Both variables are already set.
8844     have_x=yes
8845   else
8846     if test "${ac_cv_have_x+set}" = set; then
8847   echo $ECHO_N "(cached) $ECHO_C" >&6
8848 else
8849   # One or both of the vars are not set, and there is no cached value.
8850 ac_x_includes=no ac_x_libraries=no
8851 rm -fr conftest.dir
8852 if mkdir conftest.dir; then
8853   cd conftest.dir
8854   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
8855   cat >Imakefile <<'EOF'
8856 acfindx:
8857         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
8858 EOF
8859   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
8860     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
8861     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
8862     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
8863     for ac_extension in a so sl dylib dll; do
8864       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
8865          test -f $ac_im_libdir/libX11.$ac_extension; then
8866         ac_im_usrlibdir=$ac_im_libdir; break
8867       fi
8868     done
8869     # Screen out bogus values from the imake configuration.  They are
8870     # bogus both because they are the default anyway, and because
8871     # using them would break gcc on systems where it needs fixed includes.
8872     case $ac_im_incroot in
8873         /usr/include) ;;
8874         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
8875     esac
8876     case $ac_im_usrlibdir in
8877         /usr/lib | /lib) ;;
8878         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
8879     esac
8880   fi
8881   cd ..
8882   rm -fr conftest.dir
8883 fi
8884
8885 # Standard set of common directories for X headers.
8886 # Check X11 before X11Rn because it is often a symlink to the current release.
8887 ac_x_header_dirs='
8888 /usr/X11/include
8889 /usr/X11R6/include
8890 /usr/X11R5/include
8891 /usr/X11R4/include
8892
8893 /usr/include/X11
8894 /usr/include/X11R6
8895 /usr/include/X11R5
8896 /usr/include/X11R4
8897
8898 /usr/local/X11/include
8899 /usr/local/X11R6/include
8900 /usr/local/X11R5/include
8901 /usr/local/X11R4/include
8902
8903 /usr/local/include/X11
8904 /usr/local/include/X11R6
8905 /usr/local/include/X11R5
8906 /usr/local/include/X11R4
8907
8908 /usr/X386/include
8909 /usr/x386/include
8910 /usr/XFree86/include/X11
8911
8912 /usr/include
8913 /usr/local/include
8914 /usr/unsupported/include
8915 /usr/athena/include
8916 /usr/local/x11r5/include
8917 /usr/lpp/Xamples/include
8918
8919 /usr/openwin/include
8920 /usr/openwin/share/include'
8921
8922 if test "$ac_x_includes" = no; then
8923   # Guess where to find include files, by looking for Intrinsic.h.
8924   # First, try using that file with no special directory specified.
8925   cat >conftest.$ac_ext <<_ACEOF
8926 #line 8926 "configure"
8927 #include "confdefs.h"
8928 #include <X11/Intrinsic.h>
8929 _ACEOF
8930 if { (eval echo "$as_me:8930: \"$ac_cpp conftest.$ac_ext\"") >&5
8931   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8932   ac_status=$?
8933   egrep -v '^ *\+' conftest.er1 >conftest.err
8934   rm -f conftest.er1
8935   cat conftest.err >&5
8936   echo "$as_me:8936: \$? = $ac_status" >&5
8937   (exit $ac_status); } >/dev/null; then
8938   if test -s conftest.err; then
8939     ac_cpp_err=$ac_c_preproc_warn_flag
8940   else
8941     ac_cpp_err=
8942   fi
8943 else
8944   ac_cpp_err=yes
8945 fi
8946 if test -z "$ac_cpp_err"; then
8947   # We can compile using X headers with no special include directory.
8948 ac_x_includes=
8949 else
8950   echo "$as_me: failed program was:" >&5
8951   cat conftest.$ac_ext >&5
8952   for ac_dir in $ac_x_header_dirs; do
8953   if test -r "$ac_dir/X11/Intrinsic.h"; then
8954     ac_x_includes=$ac_dir
8955     break
8956   fi
8957 done
8958 fi
8959 rm -f conftest.err conftest.$ac_ext
8960 fi # $ac_x_includes = no
8961
8962 if test "$ac_x_libraries" = no; then
8963   # Check for the libraries.
8964   # See if we find them without any special options.
8965   # Don't add to $LIBS permanently.
8966   ac_save_LIBS=$LIBS
8967   LIBS="-lXt $LIBS"
8968   cat >conftest.$ac_ext <<_ACEOF
8969 #line 8969 "configure"
8970 #include "confdefs.h"
8971 #include <X11/Intrinsic.h>
8972 int
8973 main ()
8974 {
8975 XtMalloc (0)
8976   ;
8977   return 0;
8978 }
8979 _ACEOF
8980 rm -f conftest.$ac_objext conftest$ac_exeext
8981 if { (eval echo "$as_me:8981: \"$ac_link\"") >&5
8982   (eval $ac_link) 2>&5
8983   ac_status=$?
8984   echo "$as_me:8984: \$? = $ac_status" >&5
8985   (exit $ac_status); } &&
8986          { ac_try='test -s conftest$ac_exeext'
8987   { (eval echo "$as_me:8987: \"$ac_try\"") >&5
8988   (eval $ac_try) 2>&5
8989   ac_status=$?
8990   echo "$as_me:8990: \$? = $ac_status" >&5
8991   (exit $ac_status); }; }; then
8992   LIBS=$ac_save_LIBS
8993 # We can link X programs with no special library path.
8994 ac_x_libraries=
8995 else
8996   echo "$as_me: failed program was:" >&5
8997 cat conftest.$ac_ext >&5
8998 LIBS=$ac_save_LIBS
8999 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9000 do
9001   # Don't even attempt the hair of trying to link an X program!
9002   for ac_extension in a so sl dylib dll; do
9003     if test -r $ac_dir/libXt.$ac_extension; then
9004       ac_x_libraries=$ac_dir
9005       break 2
9006     fi
9007   done
9008 done
9009 fi
9010 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9011 fi # $ac_x_libraries = no
9012
9013 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9014   # Didn't find X anywhere.  Cache the known absence of X.
9015   ac_cv_have_x="have_x=no"
9016 else
9017   # Record where we found X for the cache.
9018   ac_cv_have_x="have_x=yes \
9019                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9020 fi
9021 fi
9022
9023   fi
9024   eval "$ac_cv_have_x"
9025 fi # $with_x != no
9026
9027 if test "$have_x" != yes; then
9028   echo "$as_me:9028: result: $have_x" >&5
9029 echo "${ECHO_T}$have_x" >&6
9030   no_x=yes
9031 else
9032   # If each of the values was on the command line, it overrides each guess.
9033   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9034   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9035   # Update the cache value to reflect the command line values.
9036   ac_cv_have_x="have_x=yes \
9037                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9038   echo "$as_me:9038: result: libraries $x_libraries, headers $x_includes" >&5
9039 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9040 fi
9041
9042 if test "$no_x" = yes; then
9043   # Not all programs may use this symbol, but it does not hurt to define it.
9044
9045 cat >>confdefs.h <<\EOF
9046 #define X_DISPLAY_MISSING 1
9047 EOF
9048
9049   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9050 else
9051   if test -n "$x_includes"; then
9052     X_CFLAGS="$X_CFLAGS -I$x_includes"
9053   fi
9054
9055   # It would also be nice to do this for all -L options, not just this one.
9056   if test -n "$x_libraries"; then
9057     X_LIBS="$X_LIBS -L$x_libraries"
9058     # For Solaris; some versions of Sun CC require a space after -R and
9059     # others require no space.  Words are not sufficient . . . .
9060     case `(uname -sr) 2>/dev/null` in
9061     "SunOS 5"*)
9062       echo "$as_me:9062: checking whether -R must be followed by a space" >&5
9063 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9064       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9065       cat >conftest.$ac_ext <<_ACEOF
9066 #line 9066 "configure"
9067 #include "confdefs.h"
9068
9069 int
9070 main ()
9071 {
9072
9073   ;
9074   return 0;
9075 }
9076 _ACEOF
9077 rm -f conftest.$ac_objext conftest$ac_exeext
9078 if { (eval echo "$as_me:9078: \"$ac_link\"") >&5
9079   (eval $ac_link) 2>&5
9080   ac_status=$?
9081   echo "$as_me:9081: \$? = $ac_status" >&5
9082   (exit $ac_status); } &&
9083          { ac_try='test -s conftest$ac_exeext'
9084   { (eval echo "$as_me:9084: \"$ac_try\"") >&5
9085   (eval $ac_try) 2>&5
9086   ac_status=$?
9087   echo "$as_me:9087: \$? = $ac_status" >&5
9088   (exit $ac_status); }; }; then
9089   ac_R_nospace=yes
9090 else
9091   echo "$as_me: failed program was:" >&5
9092 cat conftest.$ac_ext >&5
9093 ac_R_nospace=no
9094 fi
9095 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9096       if test $ac_R_nospace = yes; then
9097         echo "$as_me:9097: result: no" >&5
9098 echo "${ECHO_T}no" >&6
9099         X_LIBS="$X_LIBS -R$x_libraries"
9100       else
9101         LIBS="$ac_xsave_LIBS -R $x_libraries"
9102         cat >conftest.$ac_ext <<_ACEOF
9103 #line 9103 "configure"
9104 #include "confdefs.h"
9105
9106 int
9107 main ()
9108 {
9109
9110   ;
9111   return 0;
9112 }
9113 _ACEOF
9114 rm -f conftest.$ac_objext conftest$ac_exeext
9115 if { (eval echo "$as_me:9115: \"$ac_link\"") >&5
9116   (eval $ac_link) 2>&5
9117   ac_status=$?
9118   echo "$as_me:9118: \$? = $ac_status" >&5
9119   (exit $ac_status); } &&
9120          { ac_try='test -s conftest$ac_exeext'
9121   { (eval echo "$as_me:9121: \"$ac_try\"") >&5
9122   (eval $ac_try) 2>&5
9123   ac_status=$?
9124   echo "$as_me:9124: \$? = $ac_status" >&5
9125   (exit $ac_status); }; }; then
9126   ac_R_space=yes
9127 else
9128   echo "$as_me: failed program was:" >&5
9129 cat conftest.$ac_ext >&5
9130 ac_R_space=no
9131 fi
9132 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9133         if test $ac_R_space = yes; then
9134           echo "$as_me:9134: result: yes" >&5
9135 echo "${ECHO_T}yes" >&6
9136           X_LIBS="$X_LIBS -R $x_libraries"
9137         else
9138           echo "$as_me:9138: result: neither works" >&5
9139 echo "${ECHO_T}neither works" >&6
9140         fi
9141       fi
9142       LIBS=$ac_xsave_LIBS
9143     esac
9144   fi
9145
9146   # Check for system-dependent libraries X programs must link with.
9147   # Do this before checking for the system-independent R6 libraries
9148   # (-lICE), since we may need -lsocket or whatever for X linking.
9149
9150   if test "$ISC" = yes; then
9151     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9152   else
9153     # Martyn Johnson says this is needed for Ultrix, if the X
9154     # libraries were built with DECnet support.  And Karl Berry says
9155     # the Alpha needs dnet_stub (dnet does not exist).
9156     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9157     cat >conftest.$ac_ext <<_ACEOF
9158 #line 9158 "configure"
9159 #include "confdefs.h"
9160
9161 /* Override any gcc2 internal prototype to avoid an error.  */
9162 #ifdef __cplusplus
9163 extern "C"
9164 #endif
9165 /* We use char because int might match the return type of a gcc2
9166    builtin and then its argument prototype would still apply.  */
9167 char XOpenDisplay ();
9168 int
9169 main ()
9170 {
9171 XOpenDisplay ();
9172   ;
9173   return 0;
9174 }
9175 _ACEOF
9176 rm -f conftest.$ac_objext conftest$ac_exeext
9177 if { (eval echo "$as_me:9177: \"$ac_link\"") >&5
9178   (eval $ac_link) 2>&5
9179   ac_status=$?
9180   echo "$as_me:9180: \$? = $ac_status" >&5
9181   (exit $ac_status); } &&
9182          { ac_try='test -s conftest$ac_exeext'
9183   { (eval echo "$as_me:9183: \"$ac_try\"") >&5
9184   (eval $ac_try) 2>&5
9185   ac_status=$?
9186   echo "$as_me:9186: \$? = $ac_status" >&5
9187   (exit $ac_status); }; }; then
9188   :
9189 else
9190   echo "$as_me: failed program was:" >&5
9191 cat conftest.$ac_ext >&5
9192 echo "$as_me:9192: checking for dnet_ntoa in -ldnet" >&5
9193 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9194 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9195   echo $ECHO_N "(cached) $ECHO_C" >&6
9196 else
9197   ac_check_lib_save_LIBS=$LIBS
9198 LIBS="-ldnet  $LIBS"
9199 cat >conftest.$ac_ext <<_ACEOF
9200 #line 9200 "configure"
9201 #include "confdefs.h"
9202
9203 /* Override any gcc2 internal prototype to avoid an error.  */
9204 #ifdef __cplusplus
9205 extern "C"
9206 #endif
9207 /* We use char because int might match the return type of a gcc2
9208    builtin and then its argument prototype would still apply.  */
9209 char dnet_ntoa ();
9210 int
9211 main ()
9212 {
9213 dnet_ntoa ();
9214   ;
9215   return 0;
9216 }
9217 _ACEOF
9218 rm -f conftest.$ac_objext conftest$ac_exeext
9219 if { (eval echo "$as_me:9219: \"$ac_link\"") >&5
9220   (eval $ac_link) 2>&5
9221   ac_status=$?
9222   echo "$as_me:9222: \$? = $ac_status" >&5
9223   (exit $ac_status); } &&
9224          { ac_try='test -s conftest$ac_exeext'
9225   { (eval echo "$as_me:9225: \"$ac_try\"") >&5
9226   (eval $ac_try) 2>&5
9227   ac_status=$?
9228   echo "$as_me:9228: \$? = $ac_status" >&5
9229   (exit $ac_status); }; }; then
9230   ac_cv_lib_dnet_dnet_ntoa=yes
9231 else
9232   echo "$as_me: failed program was:" >&5
9233 cat conftest.$ac_ext >&5
9234 ac_cv_lib_dnet_dnet_ntoa=no
9235 fi
9236 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9237 LIBS=$ac_check_lib_save_LIBS
9238 fi
9239 echo "$as_me:9239: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9240 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9241 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9242   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9243 fi
9244
9245     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9246       echo "$as_me:9246: checking for dnet_ntoa in -ldnet_stub" >&5
9247 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9248 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9249   echo $ECHO_N "(cached) $ECHO_C" >&6
9250 else
9251   ac_check_lib_save_LIBS=$LIBS
9252 LIBS="-ldnet_stub  $LIBS"
9253 cat >conftest.$ac_ext <<_ACEOF
9254 #line 9254 "configure"
9255 #include "confdefs.h"
9256
9257 /* Override any gcc2 internal prototype to avoid an error.  */
9258 #ifdef __cplusplus
9259 extern "C"
9260 #endif
9261 /* We use char because int might match the return type of a gcc2
9262    builtin and then its argument prototype would still apply.  */
9263 char dnet_ntoa ();
9264 int
9265 main ()
9266 {
9267 dnet_ntoa ();
9268   ;
9269   return 0;
9270 }
9271 _ACEOF
9272 rm -f conftest.$ac_objext conftest$ac_exeext
9273 if { (eval echo "$as_me:9273: \"$ac_link\"") >&5
9274   (eval $ac_link) 2>&5
9275   ac_status=$?
9276   echo "$as_me:9276: \$? = $ac_status" >&5
9277   (exit $ac_status); } &&
9278          { ac_try='test -s conftest$ac_exeext'
9279   { (eval echo "$as_me:9279: \"$ac_try\"") >&5
9280   (eval $ac_try) 2>&5
9281   ac_status=$?
9282   echo "$as_me:9282: \$? = $ac_status" >&5
9283   (exit $ac_status); }; }; then
9284   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9285 else
9286   echo "$as_me: failed program was:" >&5
9287 cat conftest.$ac_ext >&5
9288 ac_cv_lib_dnet_stub_dnet_ntoa=no
9289 fi
9290 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9291 LIBS=$ac_check_lib_save_LIBS
9292 fi
9293 echo "$as_me:9293: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9294 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9295 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9296   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9297 fi
9298
9299     fi
9300 fi
9301 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9302     LIBS="$ac_xsave_LIBS"
9303
9304     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9305     # to get the SysV transport functions.
9306     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9307     # needs -lnsl.
9308     # The nsl library prevents programs from opening the X display
9309     # on Irix 5.2, according to T.E. Dickey.
9310     # The functions gethostbyname, getservbyname, and inet_addr are
9311     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9312     echo "$as_me:9312: checking for gethostbyname" >&5
9313 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9314 if test "${ac_cv_func_gethostbyname+set}" = set; then
9315   echo $ECHO_N "(cached) $ECHO_C" >&6
9316 else
9317   cat >conftest.$ac_ext <<_ACEOF
9318 #line 9318 "configure"
9319 #include "confdefs.h"
9320 /* System header to define __stub macros and hopefully few prototypes,
9321     which can conflict with char gethostbyname (); below.  */
9322 #include <assert.h>
9323 /* Override any gcc2 internal prototype to avoid an error.  */
9324 #ifdef __cplusplus
9325 extern "C"
9326 #endif
9327 /* We use char because int might match the return type of a gcc2
9328    builtin and then its argument prototype would still apply.  */
9329 char gethostbyname ();
9330 char (*f) ();
9331
9332 int
9333 main ()
9334 {
9335 /* The GNU C library defines this for functions which it implements
9336     to always fail with ENOSYS.  Some functions are actually named
9337     something starting with __ and the normal name is an alias.  */
9338 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9339 choke me
9340 #else
9341 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9342 #endif
9343
9344   ;
9345   return 0;
9346 }
9347 _ACEOF
9348 rm -f conftest.$ac_objext conftest$ac_exeext
9349 if { (eval echo "$as_me:9349: \"$ac_link\"") >&5
9350   (eval $ac_link) 2>&5
9351   ac_status=$?
9352   echo "$as_me:9352: \$? = $ac_status" >&5
9353   (exit $ac_status); } &&
9354          { ac_try='test -s conftest$ac_exeext'
9355   { (eval echo "$as_me:9355: \"$ac_try\"") >&5
9356   (eval $ac_try) 2>&5
9357   ac_status=$?
9358   echo "$as_me:9358: \$? = $ac_status" >&5
9359   (exit $ac_status); }; }; then
9360   ac_cv_func_gethostbyname=yes
9361 else
9362   echo "$as_me: failed program was:" >&5
9363 cat conftest.$ac_ext >&5
9364 ac_cv_func_gethostbyname=no
9365 fi
9366 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9367 fi
9368 echo "$as_me:9368: result: $ac_cv_func_gethostbyname" >&5
9369 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9370
9371     if test $ac_cv_func_gethostbyname = no; then
9372       echo "$as_me:9372: checking for gethostbyname in -lnsl" >&5
9373 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9374 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9375   echo $ECHO_N "(cached) $ECHO_C" >&6
9376 else
9377   ac_check_lib_save_LIBS=$LIBS
9378 LIBS="-lnsl  $LIBS"
9379 cat >conftest.$ac_ext <<_ACEOF
9380 #line 9380 "configure"
9381 #include "confdefs.h"
9382
9383 /* Override any gcc2 internal prototype to avoid an error.  */
9384 #ifdef __cplusplus
9385 extern "C"
9386 #endif
9387 /* We use char because int might match the return type of a gcc2
9388    builtin and then its argument prototype would still apply.  */
9389 char gethostbyname ();
9390 int
9391 main ()
9392 {
9393 gethostbyname ();
9394   ;
9395   return 0;
9396 }
9397 _ACEOF
9398 rm -f conftest.$ac_objext conftest$ac_exeext
9399 if { (eval echo "$as_me:9399: \"$ac_link\"") >&5
9400   (eval $ac_link) 2>&5
9401   ac_status=$?
9402   echo "$as_me:9402: \$? = $ac_status" >&5
9403   (exit $ac_status); } &&
9404          { ac_try='test -s conftest$ac_exeext'
9405   { (eval echo "$as_me:9405: \"$ac_try\"") >&5
9406   (eval $ac_try) 2>&5
9407   ac_status=$?
9408   echo "$as_me:9408: \$? = $ac_status" >&5
9409   (exit $ac_status); }; }; then
9410   ac_cv_lib_nsl_gethostbyname=yes
9411 else
9412   echo "$as_me: failed program was:" >&5
9413 cat conftest.$ac_ext >&5
9414 ac_cv_lib_nsl_gethostbyname=no
9415 fi
9416 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9417 LIBS=$ac_check_lib_save_LIBS
9418 fi
9419 echo "$as_me:9419: result: $ac_cv_lib_nsl_gethostbyname" >&5
9420 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9421 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9422   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9423 fi
9424
9425       if test $ac_cv_lib_nsl_gethostbyname = no; then
9426         echo "$as_me:9426: checking for gethostbyname in -lbsd" >&5
9427 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9428 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9429   echo $ECHO_N "(cached) $ECHO_C" >&6
9430 else
9431   ac_check_lib_save_LIBS=$LIBS
9432 LIBS="-lbsd  $LIBS"
9433 cat >conftest.$ac_ext <<_ACEOF
9434 #line 9434 "configure"
9435 #include "confdefs.h"
9436
9437 /* Override any gcc2 internal prototype to avoid an error.  */
9438 #ifdef __cplusplus
9439 extern "C"
9440 #endif
9441 /* We use char because int might match the return type of a gcc2
9442    builtin and then its argument prototype would still apply.  */
9443 char gethostbyname ();
9444 int
9445 main ()
9446 {
9447 gethostbyname ();
9448   ;
9449   return 0;
9450 }
9451 _ACEOF
9452 rm -f conftest.$ac_objext conftest$ac_exeext
9453 if { (eval echo "$as_me:9453: \"$ac_link\"") >&5
9454   (eval $ac_link) 2>&5
9455   ac_status=$?
9456   echo "$as_me:9456: \$? = $ac_status" >&5
9457   (exit $ac_status); } &&
9458          { ac_try='test -s conftest$ac_exeext'
9459   { (eval echo "$as_me:9459: \"$ac_try\"") >&5
9460   (eval $ac_try) 2>&5
9461   ac_status=$?
9462   echo "$as_me:9462: \$? = $ac_status" >&5
9463   (exit $ac_status); }; }; then
9464   ac_cv_lib_bsd_gethostbyname=yes
9465 else
9466   echo "$as_me: failed program was:" >&5
9467 cat conftest.$ac_ext >&5
9468 ac_cv_lib_bsd_gethostbyname=no
9469 fi
9470 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9471 LIBS=$ac_check_lib_save_LIBS
9472 fi
9473 echo "$as_me:9473: result: $ac_cv_lib_bsd_gethostbyname" >&5
9474 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
9475 if test $ac_cv_lib_bsd_gethostbyname = yes; then
9476   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
9477 fi
9478
9479       fi
9480     fi
9481
9482     # lieder@skyler.mavd.honeywell.com says without -lsocket,
9483     # socket/setsockopt and other routines are undefined under SCO ODT
9484     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
9485     # on later versions), says Simon Leinen: it contains gethostby*
9486     # variants that don't use the nameserver (or something).  -lsocket
9487     # must be given before -lnsl if both are needed.  We assume that
9488     # if connect needs -lnsl, so does gethostbyname.
9489     echo "$as_me:9489: checking for connect" >&5
9490 echo $ECHO_N "checking for connect... $ECHO_C" >&6
9491 if test "${ac_cv_func_connect+set}" = set; then
9492   echo $ECHO_N "(cached) $ECHO_C" >&6
9493 else
9494   cat >conftest.$ac_ext <<_ACEOF
9495 #line 9495 "configure"
9496 #include "confdefs.h"
9497 /* System header to define __stub macros and hopefully few prototypes,
9498     which can conflict with char connect (); below.  */
9499 #include <assert.h>
9500 /* Override any gcc2 internal prototype to avoid an error.  */
9501 #ifdef __cplusplus
9502 extern "C"
9503 #endif
9504 /* We use char because int might match the return type of a gcc2
9505    builtin and then its argument prototype would still apply.  */
9506 char connect ();
9507 char (*f) ();
9508
9509 int
9510 main ()
9511 {
9512 /* The GNU C library defines this for functions which it implements
9513     to always fail with ENOSYS.  Some functions are actually named
9514     something starting with __ and the normal name is an alias.  */
9515 #if defined (__stub_connect) || defined (__stub___connect)
9516 choke me
9517 #else
9518 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9519 #endif
9520
9521   ;
9522   return 0;
9523 }
9524 _ACEOF
9525 rm -f conftest.$ac_objext conftest$ac_exeext
9526 if { (eval echo "$as_me:9526: \"$ac_link\"") >&5
9527   (eval $ac_link) 2>&5
9528   ac_status=$?
9529   echo "$as_me:9529: \$? = $ac_status" >&5
9530   (exit $ac_status); } &&
9531          { ac_try='test -s conftest$ac_exeext'
9532   { (eval echo "$as_me:9532: \"$ac_try\"") >&5
9533   (eval $ac_try) 2>&5
9534   ac_status=$?
9535   echo "$as_me:9535: \$? = $ac_status" >&5
9536   (exit $ac_status); }; }; then
9537   ac_cv_func_connect=yes
9538 else
9539   echo "$as_me: failed program was:" >&5
9540 cat conftest.$ac_ext >&5
9541 ac_cv_func_connect=no
9542 fi
9543 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9544 fi
9545 echo "$as_me:9545: result: $ac_cv_func_connect" >&5
9546 echo "${ECHO_T}$ac_cv_func_connect" >&6
9547
9548     if test $ac_cv_func_connect = no; then
9549       echo "$as_me:9549: checking for connect in -lsocket" >&5
9550 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
9551 if test "${ac_cv_lib_socket_connect+set}" = set; then
9552   echo $ECHO_N "(cached) $ECHO_C" >&6
9553 else
9554   ac_check_lib_save_LIBS=$LIBS
9555 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
9556 cat >conftest.$ac_ext <<_ACEOF
9557 #line 9557 "configure"
9558 #include "confdefs.h"
9559
9560 /* Override any gcc2 internal prototype to avoid an error.  */
9561 #ifdef __cplusplus
9562 extern "C"
9563 #endif
9564 /* We use char because int might match the return type of a gcc2
9565    builtin and then its argument prototype would still apply.  */
9566 char connect ();
9567 int
9568 main ()
9569 {
9570 connect ();
9571   ;
9572   return 0;
9573 }
9574 _ACEOF
9575 rm -f conftest.$ac_objext conftest$ac_exeext
9576 if { (eval echo "$as_me:9576: \"$ac_link\"") >&5
9577   (eval $ac_link) 2>&5
9578   ac_status=$?
9579   echo "$as_me:9579: \$? = $ac_status" >&5
9580   (exit $ac_status); } &&
9581          { ac_try='test -s conftest$ac_exeext'
9582   { (eval echo "$as_me:9582: \"$ac_try\"") >&5
9583   (eval $ac_try) 2>&5
9584   ac_status=$?
9585   echo "$as_me:9585: \$? = $ac_status" >&5
9586   (exit $ac_status); }; }; then
9587   ac_cv_lib_socket_connect=yes
9588 else
9589   echo "$as_me: failed program was:" >&5
9590 cat conftest.$ac_ext >&5
9591 ac_cv_lib_socket_connect=no
9592 fi
9593 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9594 LIBS=$ac_check_lib_save_LIBS
9595 fi
9596 echo "$as_me:9596: result: $ac_cv_lib_socket_connect" >&5
9597 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
9598 if test $ac_cv_lib_socket_connect = yes; then
9599   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
9600 fi
9601
9602     fi
9603
9604     # Guillermo Gomez says -lposix is necessary on A/UX.
9605     echo "$as_me:9605: checking for remove" >&5
9606 echo $ECHO_N "checking for remove... $ECHO_C" >&6
9607 if test "${ac_cv_func_remove+set}" = set; then
9608   echo $ECHO_N "(cached) $ECHO_C" >&6
9609 else
9610   cat >conftest.$ac_ext <<_ACEOF
9611 #line 9611 "configure"
9612 #include "confdefs.h"
9613 /* System header to define __stub macros and hopefully few prototypes,
9614     which can conflict with char remove (); below.  */
9615 #include <assert.h>
9616 /* Override any gcc2 internal prototype to avoid an error.  */
9617 #ifdef __cplusplus
9618 extern "C"
9619 #endif
9620 /* We use char because int might match the return type of a gcc2
9621    builtin and then its argument prototype would still apply.  */
9622 char remove ();
9623 char (*f) ();
9624
9625 int
9626 main ()
9627 {
9628 /* The GNU C library defines this for functions which it implements
9629     to always fail with ENOSYS.  Some functions are actually named
9630     something starting with __ and the normal name is an alias.  */
9631 #if defined (__stub_remove) || defined (__stub___remove)
9632 choke me
9633 #else
9634 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9635 #endif
9636
9637   ;
9638   return 0;
9639 }
9640 _ACEOF
9641 rm -f conftest.$ac_objext conftest$ac_exeext
9642 if { (eval echo "$as_me:9642: \"$ac_link\"") >&5
9643   (eval $ac_link) 2>&5
9644   ac_status=$?
9645   echo "$as_me:9645: \$? = $ac_status" >&5
9646   (exit $ac_status); } &&
9647          { ac_try='test -s conftest$ac_exeext'
9648   { (eval echo "$as_me:9648: \"$ac_try\"") >&5
9649   (eval $ac_try) 2>&5
9650   ac_status=$?
9651   echo "$as_me:9651: \$? = $ac_status" >&5
9652   (exit $ac_status); }; }; then
9653   ac_cv_func_remove=yes
9654 else
9655   echo "$as_me: failed program was:" >&5
9656 cat conftest.$ac_ext >&5
9657 ac_cv_func_remove=no
9658 fi
9659 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9660 fi
9661 echo "$as_me:9661: result: $ac_cv_func_remove" >&5
9662 echo "${ECHO_T}$ac_cv_func_remove" >&6
9663
9664     if test $ac_cv_func_remove = no; then
9665       echo "$as_me:9665: checking for remove in -lposix" >&5
9666 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
9667 if test "${ac_cv_lib_posix_remove+set}" = set; then
9668   echo $ECHO_N "(cached) $ECHO_C" >&6
9669 else
9670   ac_check_lib_save_LIBS=$LIBS
9671 LIBS="-lposix  $LIBS"
9672 cat >conftest.$ac_ext <<_ACEOF
9673 #line 9673 "configure"
9674 #include "confdefs.h"
9675
9676 /* Override any gcc2 internal prototype to avoid an error.  */
9677 #ifdef __cplusplus
9678 extern "C"
9679 #endif
9680 /* We use char because int might match the return type of a gcc2
9681    builtin and then its argument prototype would still apply.  */
9682 char remove ();
9683 int
9684 main ()
9685 {
9686 remove ();
9687   ;
9688   return 0;
9689 }
9690 _ACEOF
9691 rm -f conftest.$ac_objext conftest$ac_exeext
9692 if { (eval echo "$as_me:9692: \"$ac_link\"") >&5
9693   (eval $ac_link) 2>&5
9694   ac_status=$?
9695   echo "$as_me:9695: \$? = $ac_status" >&5
9696   (exit $ac_status); } &&
9697          { ac_try='test -s conftest$ac_exeext'
9698   { (eval echo "$as_me:9698: \"$ac_try\"") >&5
9699   (eval $ac_try) 2>&5
9700   ac_status=$?
9701   echo "$as_me:9701: \$? = $ac_status" >&5
9702   (exit $ac_status); }; }; then
9703   ac_cv_lib_posix_remove=yes
9704 else
9705   echo "$as_me: failed program was:" >&5
9706 cat conftest.$ac_ext >&5
9707 ac_cv_lib_posix_remove=no
9708 fi
9709 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9710 LIBS=$ac_check_lib_save_LIBS
9711 fi
9712 echo "$as_me:9712: result: $ac_cv_lib_posix_remove" >&5
9713 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
9714 if test $ac_cv_lib_posix_remove = yes; then
9715   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
9716 fi
9717
9718     fi
9719
9720     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
9721     echo "$as_me:9721: checking for shmat" >&5
9722 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
9723 if test "${ac_cv_func_shmat+set}" = set; then
9724   echo $ECHO_N "(cached) $ECHO_C" >&6
9725 else
9726   cat >conftest.$ac_ext <<_ACEOF
9727 #line 9727 "configure"
9728 #include "confdefs.h"
9729 /* System header to define __stub macros and hopefully few prototypes,
9730     which can conflict with char shmat (); below.  */
9731 #include <assert.h>
9732 /* Override any gcc2 internal prototype to avoid an error.  */
9733 #ifdef __cplusplus
9734 extern "C"
9735 #endif
9736 /* We use char because int might match the return type of a gcc2
9737    builtin and then its argument prototype would still apply.  */
9738 char shmat ();
9739 char (*f) ();
9740
9741 int
9742 main ()
9743 {
9744 /* The GNU C library defines this for functions which it implements
9745     to always fail with ENOSYS.  Some functions are actually named
9746     something starting with __ and the normal name is an alias.  */
9747 #if defined (__stub_shmat) || defined (__stub___shmat)
9748 choke me
9749 #else
9750 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9751 #endif
9752
9753   ;
9754   return 0;
9755 }
9756 _ACEOF
9757 rm -f conftest.$ac_objext conftest$ac_exeext
9758 if { (eval echo "$as_me:9758: \"$ac_link\"") >&5
9759   (eval $ac_link) 2>&5
9760   ac_status=$?
9761   echo "$as_me:9761: \$? = $ac_status" >&5
9762   (exit $ac_status); } &&
9763          { ac_try='test -s conftest$ac_exeext'
9764   { (eval echo "$as_me:9764: \"$ac_try\"") >&5
9765   (eval $ac_try) 2>&5
9766   ac_status=$?
9767   echo "$as_me:9767: \$? = $ac_status" >&5
9768   (exit $ac_status); }; }; then
9769   ac_cv_func_shmat=yes
9770 else
9771   echo "$as_me: failed program was:" >&5
9772 cat conftest.$ac_ext >&5
9773 ac_cv_func_shmat=no
9774 fi
9775 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9776 fi
9777 echo "$as_me:9777: result: $ac_cv_func_shmat" >&5
9778 echo "${ECHO_T}$ac_cv_func_shmat" >&6
9779
9780     if test $ac_cv_func_shmat = no; then
9781       echo "$as_me:9781: checking for shmat in -lipc" >&5
9782 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
9783 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
9784   echo $ECHO_N "(cached) $ECHO_C" >&6
9785 else
9786   ac_check_lib_save_LIBS=$LIBS
9787 LIBS="-lipc  $LIBS"
9788 cat >conftest.$ac_ext <<_ACEOF
9789 #line 9789 "configure"
9790 #include "confdefs.h"
9791
9792 /* Override any gcc2 internal prototype to avoid an error.  */
9793 #ifdef __cplusplus
9794 extern "C"
9795 #endif
9796 /* We use char because int might match the return type of a gcc2
9797    builtin and then its argument prototype would still apply.  */
9798 char shmat ();
9799 int
9800 main ()
9801 {
9802 shmat ();
9803   ;
9804   return 0;
9805 }
9806 _ACEOF
9807 rm -f conftest.$ac_objext conftest$ac_exeext
9808 if { (eval echo "$as_me:9808: \"$ac_link\"") >&5
9809   (eval $ac_link) 2>&5
9810   ac_status=$?
9811   echo "$as_me:9811: \$? = $ac_status" >&5
9812   (exit $ac_status); } &&
9813          { ac_try='test -s conftest$ac_exeext'
9814   { (eval echo "$as_me:9814: \"$ac_try\"") >&5
9815   (eval $ac_try) 2>&5
9816   ac_status=$?
9817   echo "$as_me:9817: \$? = $ac_status" >&5
9818   (exit $ac_status); }; }; then
9819   ac_cv_lib_ipc_shmat=yes
9820 else
9821   echo "$as_me: failed program was:" >&5
9822 cat conftest.$ac_ext >&5
9823 ac_cv_lib_ipc_shmat=no
9824 fi
9825 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9826 LIBS=$ac_check_lib_save_LIBS
9827 fi
9828 echo "$as_me:9828: result: $ac_cv_lib_ipc_shmat" >&5
9829 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
9830 if test $ac_cv_lib_ipc_shmat = yes; then
9831   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
9832 fi
9833
9834     fi
9835   fi
9836
9837   # Check for libraries that X11R6 Xt/Xaw programs need.
9838   ac_save_LDFLAGS=$LDFLAGS
9839   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
9840   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
9841   # check for ICE first), but we must link in the order -lSM -lICE or
9842   # we get undefined symbols.  So assume we have SM if we have ICE.
9843   # These have to be linked with before -lX11, unlike the other
9844   # libraries we check for below, so use a different variable.
9845   # John Interrante, Karl Berry
9846   echo "$as_me:9846: checking for IceConnectionNumber in -lICE" >&5
9847 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
9848 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
9849   echo $ECHO_N "(cached) $ECHO_C" >&6
9850 else
9851   ac_check_lib_save_LIBS=$LIBS
9852 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
9853 cat >conftest.$ac_ext <<_ACEOF
9854 #line 9854 "configure"
9855 #include "confdefs.h"
9856
9857 /* Override any gcc2 internal prototype to avoid an error.  */
9858 #ifdef __cplusplus
9859 extern "C"
9860 #endif
9861 /* We use char because int might match the return type of a gcc2
9862    builtin and then its argument prototype would still apply.  */
9863 char IceConnectionNumber ();
9864 int
9865 main ()
9866 {
9867 IceConnectionNumber ();
9868   ;
9869   return 0;
9870 }
9871 _ACEOF
9872 rm -f conftest.$ac_objext conftest$ac_exeext
9873 if { (eval echo "$as_me:9873: \"$ac_link\"") >&5
9874   (eval $ac_link) 2>&5
9875   ac_status=$?
9876   echo "$as_me:9876: \$? = $ac_status" >&5
9877   (exit $ac_status); } &&
9878          { ac_try='test -s conftest$ac_exeext'
9879   { (eval echo "$as_me:9879: \"$ac_try\"") >&5
9880   (eval $ac_try) 2>&5
9881   ac_status=$?
9882   echo "$as_me:9882: \$? = $ac_status" >&5
9883   (exit $ac_status); }; }; then
9884   ac_cv_lib_ICE_IceConnectionNumber=yes
9885 else
9886   echo "$as_me: failed program was:" >&5
9887 cat conftest.$ac_ext >&5
9888 ac_cv_lib_ICE_IceConnectionNumber=no
9889 fi
9890 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9891 LIBS=$ac_check_lib_save_LIBS
9892 fi
9893 echo "$as_me:9893: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
9894 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
9895 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
9896   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
9897 fi
9898
9899   LDFLAGS=$ac_save_LDFLAGS
9900
9901 fi
9902
9903 cf_x_athena=${cf_x_athena:-Xaw}
9904
9905 echo "$as_me:9905: checking if you want to link with Xaw 3d library" >&5
9906 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
9907 withval=
9908
9909 # Check whether --with-Xaw3d or --without-Xaw3d was given.
9910 if test "${with_Xaw3d+set}" = set; then
9911   withval="$with_Xaw3d"
9912
9913 fi;
9914 if test "$withval" = yes ; then
9915         cf_x_athena=Xaw3d
9916         echo "$as_me:9916: result: yes" >&5
9917 echo "${ECHO_T}yes" >&6
9918 else
9919         echo "$as_me:9919: result: no" >&5
9920 echo "${ECHO_T}no" >&6
9921 fi
9922
9923 echo "$as_me:9923: checking if you want to link with neXT Athena library" >&5
9924 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
9925 withval=
9926
9927 # Check whether --with-neXtaw or --without-neXtaw was given.
9928 if test "${with_neXtaw+set}" = set; then
9929   withval="$with_neXtaw"
9930
9931 fi;
9932 if test "$withval" = yes ; then
9933         cf_x_athena=neXtaw
9934         echo "$as_me:9934: result: yes" >&5
9935 echo "${ECHO_T}yes" >&6
9936 else
9937         echo "$as_me:9937: result: no" >&5
9938 echo "${ECHO_T}no" >&6
9939 fi
9940
9941 echo "$as_me:9941: checking if you want to link with Athena-Plus library" >&5
9942 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
9943 withval=
9944
9945 # Check whether --with-XawPlus or --without-XawPlus was given.
9946 if test "${with_XawPlus+set}" = set; then
9947   withval="$with_XawPlus"
9948
9949 fi;
9950 if test "$withval" = yes ; then
9951         cf_x_athena=XawPlus
9952         echo "$as_me:9952: result: yes" >&5
9953 echo "${ECHO_T}yes" >&6
9954 else
9955         echo "$as_me:9955: result: no" >&5
9956 echo "${ECHO_T}no" >&6
9957 fi
9958
9959 cf_x_athena_lib=""
9960
9961 if test "$PKG_CONFIG" != none ; then
9962         cf_athena_list=
9963         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
9964         for cf_athena_pkg in \
9965                 $cf_athena_list \
9966                 ${cf_x_athena} \
9967                 ${cf_x_athena}-devel \
9968                 lib${cf_x_athena} \
9969                 lib${cf_x_athena}-devel
9970         do
9971
9972 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
9973         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
9974
9975 echo "${as_me:-configure}:9975: testing found package $cf_athena_pkg ..." 1>&5
9976
9977         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
9978         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
9979         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
9980
9981 echo "${as_me:-configure}:9981: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
9982
9983         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
9984
9985 echo "${as_me:-configure}:9985: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
9986
9987 cf_fix_cppflags=no
9988 cf_new_cflags=
9989 cf_new_cppflags=
9990 cf_new_extra_cppflags=
9991
9992 for cf_add_cflags in $cf_pkgconfig_incs
9993 do
9994 case $cf_fix_cppflags in
9995 no)
9996         case $cf_add_cflags in #(vi
9997         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
9998                 case $cf_add_cflags in
9999                 -D*)
10000                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10001
10002                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10003                                 && test -z "${cf_tst_cflags}" \
10004                                 && cf_fix_cppflags=yes
10005
10006                         if test $cf_fix_cppflags = yes ; then
10007                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10008                                 continue
10009                         elif test "${cf_tst_cflags}" = "\"'" ; then
10010                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10011                                 continue
10012                         fi
10013                         ;;
10014                 esac
10015                 case "$CPPFLAGS" in
10016                 *$cf_add_cflags) #(vi
10017                         ;;
10018                 *) #(vi
10019                         case $cf_add_cflags in #(vi
10020                         -D*)
10021                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10022
10023 CPPFLAGS=`echo "$CPPFLAGS" | \
10024         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10025                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10026
10027                                 ;;
10028                         esac
10029                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10030                         ;;
10031                 esac
10032                 ;;
10033         *)
10034                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10035                 ;;
10036         esac
10037         ;;
10038 yes)
10039         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10040
10041         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10042
10043         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10044                 && test -z "${cf_tst_cflags}" \
10045                 && cf_fix_cppflags=no
10046         ;;
10047 esac
10048 done
10049
10050 if test -n "$cf_new_cflags" ; then
10051
10052         CFLAGS="$CFLAGS $cf_new_cflags"
10053 fi
10054
10055 if test -n "$cf_new_cppflags" ; then
10056
10057         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10058 fi
10059
10060 if test -n "$cf_new_extra_cppflags" ; then
10061
10062         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10063 fi
10064
10065         LIBS="$cf_pkgconfig_libs $LIBS"
10066
10067                         cf_x_athena_lib="$cf_pkgconfig_libs"
10068
10069 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10070
10071                         cat >>confdefs.h <<EOF
10072 #define $cf_x_athena_LIBS 1
10073 EOF
10074
10075 echo "$as_me:10075: checking for usable $cf_x_athena/Xmu package" >&5
10076 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10077 if test "${cf_cv_xaw_compat+set}" = set; then
10078   echo $ECHO_N "(cached) $ECHO_C" >&6
10079 else
10080
10081 cat >conftest.$ac_ext <<_ACEOF
10082 #line 10082 "configure"
10083 #include "confdefs.h"
10084
10085 #include <X11/Xmu/CharSet.h>
10086
10087 int
10088 main ()
10089 {
10090
10091 int check = XmuCompareISOLatin1("big", "small")
10092
10093   ;
10094   return 0;
10095 }
10096 _ACEOF
10097 rm -f conftest.$ac_objext conftest$ac_exeext
10098 if { (eval echo "$as_me:10098: \"$ac_link\"") >&5
10099   (eval $ac_link) 2>&5
10100   ac_status=$?
10101   echo "$as_me:10101: \$? = $ac_status" >&5
10102   (exit $ac_status); } &&
10103          { ac_try='test -s conftest$ac_exeext'
10104   { (eval echo "$as_me:10104: \"$ac_try\"") >&5
10105   (eval $ac_try) 2>&5
10106   ac_status=$?
10107   echo "$as_me:10107: \$? = $ac_status" >&5
10108   (exit $ac_status); }; }; then
10109   cf_cv_xaw_compat=yes
10110 else
10111   echo "$as_me: failed program was:" >&5
10112 cat conftest.$ac_ext >&5
10113 cf_cv_xaw_compat=no
10114 fi
10115 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10116 fi
10117 echo "$as_me:10117: result: $cf_cv_xaw_compat" >&5
10118 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10119
10120                         if test "$cf_cv_xaw_compat" = no
10121                         then
10122                                 # workaround for broken ".pc" files...
10123                                 case "$cf_x_athena_lib" in #(vi
10124                                 *-lXmu*) #(vi
10125                                         ;;
10126                                 *)
10127                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10128
10129 echo "${as_me:-configure}:10129: testing work around broken package ..." 1>&5
10130
10131 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10132         test -n "$verbose" && echo "    found package xmu" 1>&6
10133
10134 echo "${as_me:-configure}:10134: testing found package xmu ..." 1>&5
10135
10136         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10137         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10138         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10139
10140 echo "${as_me:-configure}:10140: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10141
10142         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10143
10144 echo "${as_me:-configure}:10144: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10145
10146 cf_fix_cppflags=no
10147 cf_new_cflags=
10148 cf_new_cppflags=
10149 cf_new_extra_cppflags=
10150
10151 for cf_add_cflags in $cf_pkgconfig_incs
10152 do
10153 case $cf_fix_cppflags in
10154 no)
10155         case $cf_add_cflags in #(vi
10156         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10157                 case $cf_add_cflags in
10158                 -D*)
10159                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10160
10161                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10162                                 && test -z "${cf_tst_cflags}" \
10163                                 && cf_fix_cppflags=yes
10164
10165                         if test $cf_fix_cppflags = yes ; then
10166                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10167                                 continue
10168                         elif test "${cf_tst_cflags}" = "\"'" ; then
10169                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10170                                 continue
10171                         fi
10172                         ;;
10173                 esac
10174                 case "$CPPFLAGS" in
10175                 *$cf_add_cflags) #(vi
10176                         ;;
10177                 *) #(vi
10178                         case $cf_add_cflags in #(vi
10179                         -D*)
10180                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10181
10182 CPPFLAGS=`echo "$CPPFLAGS" | \
10183         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10184                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10185
10186                                 ;;
10187                         esac
10188                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10189                         ;;
10190                 esac
10191                 ;;
10192         *)
10193                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10194                 ;;
10195         esac
10196         ;;
10197 yes)
10198         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10199
10200         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10201
10202         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10203                 && test -z "${cf_tst_cflags}" \
10204                 && cf_fix_cppflags=no
10205         ;;
10206 esac
10207 done
10208
10209 if test -n "$cf_new_cflags" ; then
10210
10211         CFLAGS="$CFLAGS $cf_new_cflags"
10212 fi
10213
10214 if test -n "$cf_new_cppflags" ; then
10215
10216         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10217 fi
10218
10219 if test -n "$cf_new_extra_cppflags" ; then
10220
10221         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10222 fi
10223
10224         LIBS="$cf_pkgconfig_libs $LIBS"
10225         :
10226 else
10227
10228 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10229
10230 echo "${as_me:-configure}:10230: testing ...before $LIBS ..." 1>&5
10231
10232 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lXmu ," -e 's/  / /g'`
10233 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10234
10235 echo "${as_me:-configure}:10235: testing ...after  $LIBS ..." 1>&5
10236
10237 fi
10238
10239                                         ;;
10240                                 esac
10241                         fi
10242
10243                         break
10244 else
10245         :
10246 fi
10247
10248         done
10249 fi
10250
10251 if test -z "$cf_x_athena_lib" ; then
10252
10253 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10254         test -n "$verbose" && echo "    found package Xext" 1>&6
10255
10256 echo "${as_me:-configure}:10256: testing found package Xext ..." 1>&5
10257
10258         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10259         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10260         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10261
10262 echo "${as_me:-configure}:10262: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10263
10264         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10265
10266 echo "${as_me:-configure}:10266: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10267
10268 cf_fix_cppflags=no
10269 cf_new_cflags=
10270 cf_new_cppflags=
10271 cf_new_extra_cppflags=
10272
10273 for cf_add_cflags in $cf_pkgconfig_incs
10274 do
10275 case $cf_fix_cppflags in
10276 no)
10277         case $cf_add_cflags in #(vi
10278         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10279                 case $cf_add_cflags in
10280                 -D*)
10281                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10282
10283                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10284                                 && test -z "${cf_tst_cflags}" \
10285                                 && cf_fix_cppflags=yes
10286
10287                         if test $cf_fix_cppflags = yes ; then
10288                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10289                                 continue
10290                         elif test "${cf_tst_cflags}" = "\"'" ; then
10291                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10292                                 continue
10293                         fi
10294                         ;;
10295                 esac
10296                 case "$CPPFLAGS" in
10297                 *$cf_add_cflags) #(vi
10298                         ;;
10299                 *) #(vi
10300                         case $cf_add_cflags in #(vi
10301                         -D*)
10302                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10303
10304 CPPFLAGS=`echo "$CPPFLAGS" | \
10305         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10306                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10307
10308                                 ;;
10309                         esac
10310                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10311                         ;;
10312                 esac
10313                 ;;
10314         *)
10315                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10316                 ;;
10317         esac
10318         ;;
10319 yes)
10320         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10321
10322         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10323
10324         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10325                 && test -z "${cf_tst_cflags}" \
10326                 && cf_fix_cppflags=no
10327         ;;
10328 esac
10329 done
10330
10331 if test -n "$cf_new_cflags" ; then
10332
10333         CFLAGS="$CFLAGS $cf_new_cflags"
10334 fi
10335
10336 if test -n "$cf_new_cppflags" ; then
10337
10338         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10339 fi
10340
10341 if test -n "$cf_new_extra_cppflags" ; then
10342
10343         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10344 fi
10345
10346         LIBS="$cf_pkgconfig_libs $LIBS"
10347         :
10348 else
10349
10350         echo "$as_me:10350: checking for XextCreateExtension in -lXext" >&5
10351 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10352 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10353   echo $ECHO_N "(cached) $ECHO_C" >&6
10354 else
10355   ac_check_lib_save_LIBS=$LIBS
10356 LIBS="-lXext  $LIBS"
10357 cat >conftest.$ac_ext <<_ACEOF
10358 #line 10358 "configure"
10359 #include "confdefs.h"
10360
10361 /* Override any gcc2 internal prototype to avoid an error.  */
10362 #ifdef __cplusplus
10363 extern "C"
10364 #endif
10365 /* We use char because int might match the return type of a gcc2
10366    builtin and then its argument prototype would still apply.  */
10367 char XextCreateExtension ();
10368 int
10369 main ()
10370 {
10371 XextCreateExtension ();
10372   ;
10373   return 0;
10374 }
10375 _ACEOF
10376 rm -f conftest.$ac_objext conftest$ac_exeext
10377 if { (eval echo "$as_me:10377: \"$ac_link\"") >&5
10378   (eval $ac_link) 2>&5
10379   ac_status=$?
10380   echo "$as_me:10380: \$? = $ac_status" >&5
10381   (exit $ac_status); } &&
10382          { ac_try='test -s conftest$ac_exeext'
10383   { (eval echo "$as_me:10383: \"$ac_try\"") >&5
10384   (eval $ac_try) 2>&5
10385   ac_status=$?
10386   echo "$as_me:10386: \$? = $ac_status" >&5
10387   (exit $ac_status); }; }; then
10388   ac_cv_lib_Xext_XextCreateExtension=yes
10389 else
10390   echo "$as_me: failed program was:" >&5
10391 cat conftest.$ac_ext >&5
10392 ac_cv_lib_Xext_XextCreateExtension=no
10393 fi
10394 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10395 LIBS=$ac_check_lib_save_LIBS
10396 fi
10397 echo "$as_me:10397: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
10398 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
10399 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
10400   LIBS="-lXext $LIBS"
10401 fi
10402
10403 fi
10404
10405 cf_have_X_LIBS=no
10406
10407 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
10408         test -n "$verbose" && echo "    found package xt" 1>&6
10409
10410 echo "${as_me:-configure}:10410: testing found package xt ..." 1>&5
10411
10412         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
10413         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
10414         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
10415
10416 echo "${as_me:-configure}:10416: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10417
10418         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
10419
10420 echo "${as_me:-configure}:10420: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
10421
10422 cf_fix_cppflags=no
10423 cf_new_cflags=
10424 cf_new_cppflags=
10425 cf_new_extra_cppflags=
10426
10427 for cf_add_cflags in $cf_pkgconfig_incs
10428 do
10429 case $cf_fix_cppflags in
10430 no)
10431         case $cf_add_cflags in #(vi
10432         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10433                 case $cf_add_cflags in
10434                 -D*)
10435                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10436
10437                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10438                                 && test -z "${cf_tst_cflags}" \
10439                                 && cf_fix_cppflags=yes
10440
10441                         if test $cf_fix_cppflags = yes ; then
10442                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10443                                 continue
10444                         elif test "${cf_tst_cflags}" = "\"'" ; then
10445                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10446                                 continue
10447                         fi
10448                         ;;
10449                 esac
10450                 case "$CPPFLAGS" in
10451                 *$cf_add_cflags) #(vi
10452                         ;;
10453                 *) #(vi
10454                         case $cf_add_cflags in #(vi
10455                         -D*)
10456                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10457
10458 CPPFLAGS=`echo "$CPPFLAGS" | \
10459         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10460                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10461
10462                                 ;;
10463                         esac
10464                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10465                         ;;
10466                 esac
10467                 ;;
10468         *)
10469                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10470                 ;;
10471         esac
10472         ;;
10473 yes)
10474         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10475
10476         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10477
10478         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10479                 && test -z "${cf_tst_cflags}" \
10480                 && cf_fix_cppflags=no
10481         ;;
10482 esac
10483 done
10484
10485 if test -n "$cf_new_cflags" ; then
10486
10487         CFLAGS="$CFLAGS $cf_new_cflags"
10488 fi
10489
10490 if test -n "$cf_new_cppflags" ; then
10491
10492         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10493 fi
10494
10495 if test -n "$cf_new_extra_cppflags" ; then
10496
10497         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10498 fi
10499
10500         LIBS="$cf_pkgconfig_libs $LIBS"
10501
10502         case "x$LIBS" in #(vi
10503         *-lX11*) #(vi
10504                 ;;
10505         *)
10506 # we have an "xt" package, but it may omit Xt's dependency on X11
10507 echo "$as_me:10507: checking for usable X dependency" >&5
10508 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
10509 if test "${cf_cv_xt_x11_compat+set}" = set; then
10510   echo $ECHO_N "(cached) $ECHO_C" >&6
10511 else
10512
10513 cat >conftest.$ac_ext <<_ACEOF
10514 #line 10514 "configure"
10515 #include "confdefs.h"
10516
10517 #include <X11/Xlib.h>
10518
10519 int
10520 main ()
10521 {
10522
10523         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
10524         int rc2 = XClearWindow((Display*) 0, (Window) 0);
10525         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
10526         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
10527
10528   ;
10529   return 0;
10530 }
10531 _ACEOF
10532 rm -f conftest.$ac_objext conftest$ac_exeext
10533 if { (eval echo "$as_me:10533: \"$ac_link\"") >&5
10534   (eval $ac_link) 2>&5
10535   ac_status=$?
10536   echo "$as_me:10536: \$? = $ac_status" >&5
10537   (exit $ac_status); } &&
10538          { ac_try='test -s conftest$ac_exeext'
10539   { (eval echo "$as_me:10539: \"$ac_try\"") >&5
10540   (eval $ac_try) 2>&5
10541   ac_status=$?
10542   echo "$as_me:10542: \$? = $ac_status" >&5
10543   (exit $ac_status); }; }; then
10544   cf_cv_xt_x11_compat=yes
10545 else
10546   echo "$as_me: failed program was:" >&5
10547 cat conftest.$ac_ext >&5
10548 cf_cv_xt_x11_compat=no
10549 fi
10550 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10551 fi
10552 echo "$as_me:10552: result: $cf_cv_xt_x11_compat" >&5
10553 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
10554                 if test "$cf_cv_xt_x11_compat" = no
10555                 then
10556                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
10557
10558 echo "${as_me:-configure}:10558: testing work around broken X11 dependency ..." 1>&5
10559
10560                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
10561
10562 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
10563         test -n "$verbose" && echo "    found package x11" 1>&6
10564
10565 echo "${as_me:-configure}:10565: testing found package x11 ..." 1>&5
10566
10567         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
10568         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
10569         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
10570
10571 echo "${as_me:-configure}:10571: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10572
10573         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
10574
10575 echo "${as_me:-configure}:10575: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
10576
10577 cf_fix_cppflags=no
10578 cf_new_cflags=
10579 cf_new_cppflags=
10580 cf_new_extra_cppflags=
10581
10582 for cf_add_cflags in $cf_pkgconfig_incs
10583 do
10584 case $cf_fix_cppflags in
10585 no)
10586         case $cf_add_cflags in #(vi
10587         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10588                 case $cf_add_cflags in
10589                 -D*)
10590                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10591
10592                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10593                                 && test -z "${cf_tst_cflags}" \
10594                                 && cf_fix_cppflags=yes
10595
10596                         if test $cf_fix_cppflags = yes ; then
10597                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10598                                 continue
10599                         elif test "${cf_tst_cflags}" = "\"'" ; then
10600                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10601                                 continue
10602                         fi
10603                         ;;
10604                 esac
10605                 case "$CPPFLAGS" in
10606                 *$cf_add_cflags) #(vi
10607                         ;;
10608                 *) #(vi
10609                         case $cf_add_cflags in #(vi
10610                         -D*)
10611                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10612
10613 CPPFLAGS=`echo "$CPPFLAGS" | \
10614         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10615                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10616
10617                                 ;;
10618                         esac
10619                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10620                         ;;
10621                 esac
10622                 ;;
10623         *)
10624                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10625                 ;;
10626         esac
10627         ;;
10628 yes)
10629         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10630
10631         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10632
10633         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10634                 && test -z "${cf_tst_cflags}" \
10635                 && cf_fix_cppflags=no
10636         ;;
10637 esac
10638 done
10639
10640 if test -n "$cf_new_cflags" ; then
10641
10642         CFLAGS="$CFLAGS $cf_new_cflags"
10643 fi
10644
10645 if test -n "$cf_new_cppflags" ; then
10646
10647         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10648 fi
10649
10650 if test -n "$cf_new_extra_cppflags" ; then
10651
10652         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10653 fi
10654
10655         LIBS="$cf_pkgconfig_libs $LIBS"
10656         :
10657 else
10658
10659 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10660
10661 echo "${as_me:-configure}:10661: testing ...before $LIBS ..." 1>&5
10662
10663 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lX11 ," -e 's/  / /g'`
10664 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10665
10666 echo "${as_me:-configure}:10666: testing ...after  $LIBS ..." 1>&5
10667
10668 fi
10669
10670                 fi
10671                 ;;
10672         esac
10673
10674 echo "$as_me:10674: checking for usable X Toolkit package" >&5
10675 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
10676 if test "${cf_cv_xt_ice_compat+set}" = set; then
10677   echo $ECHO_N "(cached) $ECHO_C" >&6
10678 else
10679
10680 cat >conftest.$ac_ext <<_ACEOF
10681 #line 10681 "configure"
10682 #include "confdefs.h"
10683
10684 #include <X11/Shell.h>
10685
10686 int
10687 main ()
10688 {
10689 int num = IceConnectionNumber(0)
10690
10691   ;
10692   return 0;
10693 }
10694 _ACEOF
10695 rm -f conftest.$ac_objext conftest$ac_exeext
10696 if { (eval echo "$as_me:10696: \"$ac_link\"") >&5
10697   (eval $ac_link) 2>&5
10698   ac_status=$?
10699   echo "$as_me:10699: \$? = $ac_status" >&5
10700   (exit $ac_status); } &&
10701          { ac_try='test -s conftest$ac_exeext'
10702   { (eval echo "$as_me:10702: \"$ac_try\"") >&5
10703   (eval $ac_try) 2>&5
10704   ac_status=$?
10705   echo "$as_me:10705: \$? = $ac_status" >&5
10706   (exit $ac_status); }; }; then
10707   cf_cv_xt_ice_compat=yes
10708 else
10709   echo "$as_me: failed program was:" >&5
10710 cat conftest.$ac_ext >&5
10711 cf_cv_xt_ice_compat=no
10712 fi
10713 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10714 fi
10715 echo "$as_me:10715: result: $cf_cv_xt_ice_compat" >&5
10716 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
10717
10718         if test "$cf_cv_xt_ice_compat" = no
10719         then
10720                 # workaround for broken ".pc" files used for X Toolkit.
10721                 case "x$X_PRE_LIBS" in #(vi
10722                 *-lICE*)
10723                         case "x$LIBS" in #(vi
10724                         *-lICE*) #(vi
10725                                 ;;
10726                         *)
10727                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
10728
10729 echo "${as_me:-configure}:10729: testing work around broken ICE dependency ..." 1>&5
10730
10731 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
10732         test -n "$verbose" && echo "    found package ice" 1>&6
10733
10734 echo "${as_me:-configure}:10734: testing found package ice ..." 1>&5
10735
10736         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
10737         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
10738         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
10739
10740 echo "${as_me:-configure}:10740: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10741
10742         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
10743
10744 echo "${as_me:-configure}:10744: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
10745
10746 cf_fix_cppflags=no
10747 cf_new_cflags=
10748 cf_new_cppflags=
10749 cf_new_extra_cppflags=
10750
10751 for cf_add_cflags in $cf_pkgconfig_incs
10752 do
10753 case $cf_fix_cppflags in
10754 no)
10755         case $cf_add_cflags in #(vi
10756         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10757                 case $cf_add_cflags in
10758                 -D*)
10759                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10760
10761                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10762                                 && test -z "${cf_tst_cflags}" \
10763                                 && cf_fix_cppflags=yes
10764
10765                         if test $cf_fix_cppflags = yes ; then
10766                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10767                                 continue
10768                         elif test "${cf_tst_cflags}" = "\"'" ; then
10769                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10770                                 continue
10771                         fi
10772                         ;;
10773                 esac
10774                 case "$CPPFLAGS" in
10775                 *$cf_add_cflags) #(vi
10776                         ;;
10777                 *) #(vi
10778                         case $cf_add_cflags in #(vi
10779                         -D*)
10780                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10781
10782 CPPFLAGS=`echo "$CPPFLAGS" | \
10783         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10784                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10785
10786                                 ;;
10787                         esac
10788                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10789                         ;;
10790                 esac
10791                 ;;
10792         *)
10793                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10794                 ;;
10795         esac
10796         ;;
10797 yes)
10798         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10799
10800         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10801
10802         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10803                 && test -z "${cf_tst_cflags}" \
10804                 && cf_fix_cppflags=no
10805         ;;
10806 esac
10807 done
10808
10809 if test -n "$cf_new_cflags" ; then
10810
10811         CFLAGS="$CFLAGS $cf_new_cflags"
10812 fi
10813
10814 if test -n "$cf_new_cppflags" ; then
10815
10816         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10817 fi
10818
10819 if test -n "$cf_new_extra_cppflags" ; then
10820
10821         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10822 fi
10823
10824         LIBS="$cf_pkgconfig_libs $LIBS"
10825
10826 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
10827         test -n "$verbose" && echo "    found package sm" 1>&6
10828
10829 echo "${as_me:-configure}:10829: testing found package sm ..." 1>&5
10830
10831         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
10832         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
10833         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
10834
10835 echo "${as_me:-configure}:10835: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10836
10837         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
10838
10839 echo "${as_me:-configure}:10839: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
10840
10841 cf_fix_cppflags=no
10842 cf_new_cflags=
10843 cf_new_cppflags=
10844 cf_new_extra_cppflags=
10845
10846 for cf_add_cflags in $cf_pkgconfig_incs
10847 do
10848 case $cf_fix_cppflags in
10849 no)
10850         case $cf_add_cflags in #(vi
10851         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10852                 case $cf_add_cflags in
10853                 -D*)
10854                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10855
10856                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10857                                 && test -z "${cf_tst_cflags}" \
10858                                 && cf_fix_cppflags=yes
10859
10860                         if test $cf_fix_cppflags = yes ; then
10861                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10862                                 continue
10863                         elif test "${cf_tst_cflags}" = "\"'" ; then
10864                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10865                                 continue
10866                         fi
10867                         ;;
10868                 esac
10869                 case "$CPPFLAGS" in
10870                 *$cf_add_cflags) #(vi
10871                         ;;
10872                 *) #(vi
10873                         case $cf_add_cflags in #(vi
10874                         -D*)
10875                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10876
10877 CPPFLAGS=`echo "$CPPFLAGS" | \
10878         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10879                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10880
10881                                 ;;
10882                         esac
10883                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10884                         ;;
10885                 esac
10886                 ;;
10887         *)
10888                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10889                 ;;
10890         esac
10891         ;;
10892 yes)
10893         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10894
10895         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10896
10897         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10898                 && test -z "${cf_tst_cflags}" \
10899                 && cf_fix_cppflags=no
10900         ;;
10901 esac
10902 done
10903
10904 if test -n "$cf_new_cflags" ; then
10905
10906         CFLAGS="$CFLAGS $cf_new_cflags"
10907 fi
10908
10909 if test -n "$cf_new_cppflags" ; then
10910
10911         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10912 fi
10913
10914 if test -n "$cf_new_extra_cppflags" ; then
10915
10916         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10917 fi
10918
10919         LIBS="$cf_pkgconfig_libs $LIBS"
10920         :
10921 else
10922         :
10923 fi
10924
10925 else
10926
10927 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10928
10929 echo "${as_me:-configure}:10929: testing ...before $LIBS ..." 1>&5
10930
10931 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/  / /g'`
10932 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10933
10934 echo "${as_me:-configure}:10934: testing ...after  $LIBS ..." 1>&5
10935
10936 fi
10937
10938                                 ;;
10939                         esac
10940                         ;;
10941                 esac
10942         fi
10943
10944         cf_have_X_LIBS=yes
10945
10946 else
10947
10948         LDFLAGS="$X_LIBS $LDFLAGS"
10949
10950 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
10951
10952 echo "${as_me:-configure}:10952: testing checking additions to CFLAGS ..." 1>&5
10953
10954 cf_check_cflags="$CFLAGS"
10955 cf_check_cppflags="$CPPFLAGS"
10956
10957 cf_fix_cppflags=no
10958 cf_new_cflags=
10959 cf_new_cppflags=
10960 cf_new_extra_cppflags=
10961
10962 for cf_add_cflags in $X_CFLAGS
10963 do
10964 case $cf_fix_cppflags in
10965 no)
10966         case $cf_add_cflags in #(vi
10967         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10968                 case $cf_add_cflags in
10969                 -D*)
10970                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10971
10972                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10973                                 && test -z "${cf_tst_cflags}" \
10974                                 && cf_fix_cppflags=yes
10975
10976                         if test $cf_fix_cppflags = yes ; then
10977                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10978                                 continue
10979                         elif test "${cf_tst_cflags}" = "\"'" ; then
10980                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10981                                 continue
10982                         fi
10983                         ;;
10984                 esac
10985                 case "$CPPFLAGS" in
10986                 *$cf_add_cflags) #(vi
10987                         ;;
10988                 *) #(vi
10989                         case $cf_add_cflags in #(vi
10990                         -D*)
10991                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10992
10993 CPPFLAGS=`echo "$CPPFLAGS" | \
10994         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10995                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10996
10997                                 ;;
10998                         esac
10999                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11000                         ;;
11001                 esac
11002                 ;;
11003         *)
11004                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11005                 ;;
11006         esac
11007         ;;
11008 yes)
11009         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11010
11011         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11012
11013         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11014                 && test -z "${cf_tst_cflags}" \
11015                 && cf_fix_cppflags=no
11016         ;;
11017 esac
11018 done
11019
11020 if test -n "$cf_new_cflags" ; then
11021         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11022
11023 echo "${as_me:-configure}:11023: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11024
11025         CFLAGS="$CFLAGS $cf_new_cflags"
11026 fi
11027
11028 if test -n "$cf_new_cppflags" ; then
11029         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11030
11031 echo "${as_me:-configure}:11031: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11032
11033         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11034 fi
11035
11036 if test -n "$cf_new_extra_cppflags" ; then
11037         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11038
11039 echo "${as_me:-configure}:11039: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11040
11041         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11042 fi
11043
11044 if test "$cf_check_cflags" != "$CFLAGS" ; then
11045 cat >conftest.$ac_ext <<_ACEOF
11046 #line 11046 "configure"
11047 #include "confdefs.h"
11048 #include <stdio.h>
11049 int
11050 main ()
11051 {
11052 printf("Hello world");
11053   ;
11054   return 0;
11055 }
11056 _ACEOF
11057 rm -f conftest.$ac_objext conftest$ac_exeext
11058 if { (eval echo "$as_me:11058: \"$ac_link\"") >&5
11059   (eval $ac_link) 2>&5
11060   ac_status=$?
11061   echo "$as_me:11061: \$? = $ac_status" >&5
11062   (exit $ac_status); } &&
11063          { ac_try='test -s conftest$ac_exeext'
11064   { (eval echo "$as_me:11064: \"$ac_try\"") >&5
11065   (eval $ac_try) 2>&5
11066   ac_status=$?
11067   echo "$as_me:11067: \$? = $ac_status" >&5
11068   (exit $ac_status); }; }; then
11069   :
11070 else
11071   echo "$as_me: failed program was:" >&5
11072 cat conftest.$ac_ext >&5
11073 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
11074
11075 echo "${as_me:-configure}:11075: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
11076
11077          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
11078                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
11079
11080 echo "${as_me:-configure}:11080: testing but keeping change to \$CPPFLAGS ..." 1>&5
11081
11082          fi
11083          CFLAGS="$cf_check_flags"
11084 fi
11085 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11086 fi
11087
11088         echo "$as_me:11088: checking for XOpenDisplay" >&5
11089 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
11090 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
11091   echo $ECHO_N "(cached) $ECHO_C" >&6
11092 else
11093   cat >conftest.$ac_ext <<_ACEOF
11094 #line 11094 "configure"
11095 #include "confdefs.h"
11096 /* System header to define __stub macros and hopefully few prototypes,
11097     which can conflict with char XOpenDisplay (); below.  */
11098 #include <assert.h>
11099 /* Override any gcc2 internal prototype to avoid an error.  */
11100 #ifdef __cplusplus
11101 extern "C"
11102 #endif
11103 /* We use char because int might match the return type of a gcc2
11104    builtin and then its argument prototype would still apply.  */
11105 char XOpenDisplay ();
11106 char (*f) ();
11107
11108 int
11109 main ()
11110 {
11111 /* The GNU C library defines this for functions which it implements
11112     to always fail with ENOSYS.  Some functions are actually named
11113     something starting with __ and the normal name is an alias.  */
11114 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
11115 choke me
11116 #else
11117 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11118 #endif
11119
11120   ;
11121   return 0;
11122 }
11123 _ACEOF
11124 rm -f conftest.$ac_objext conftest$ac_exeext
11125 if { (eval echo "$as_me:11125: \"$ac_link\"") >&5
11126   (eval $ac_link) 2>&5
11127   ac_status=$?
11128   echo "$as_me:11128: \$? = $ac_status" >&5
11129   (exit $ac_status); } &&
11130          { ac_try='test -s conftest$ac_exeext'
11131   { (eval echo "$as_me:11131: \"$ac_try\"") >&5
11132   (eval $ac_try) 2>&5
11133   ac_status=$?
11134   echo "$as_me:11134: \$? = $ac_status" >&5
11135   (exit $ac_status); }; }; then
11136   ac_cv_func_XOpenDisplay=yes
11137 else
11138   echo "$as_me: failed program was:" >&5
11139 cat conftest.$ac_ext >&5
11140 ac_cv_func_XOpenDisplay=no
11141 fi
11142 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11143 fi
11144 echo "$as_me:11144: result: $ac_cv_func_XOpenDisplay" >&5
11145 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
11146 if test $ac_cv_func_XOpenDisplay = yes; then
11147   :
11148 else
11149
11150         echo "$as_me:11150: checking for XOpenDisplay in -lX11" >&5
11151 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
11152 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
11153   echo $ECHO_N "(cached) $ECHO_C" >&6
11154 else
11155   ac_check_lib_save_LIBS=$LIBS
11156 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11157 cat >conftest.$ac_ext <<_ACEOF
11158 #line 11158 "configure"
11159 #include "confdefs.h"
11160
11161 /* Override any gcc2 internal prototype to avoid an error.  */
11162 #ifdef __cplusplus
11163 extern "C"
11164 #endif
11165 /* We use char because int might match the return type of a gcc2
11166    builtin and then its argument prototype would still apply.  */
11167 char XOpenDisplay ();
11168 int
11169 main ()
11170 {
11171 XOpenDisplay ();
11172   ;
11173   return 0;
11174 }
11175 _ACEOF
11176 rm -f conftest.$ac_objext conftest$ac_exeext
11177 if { (eval echo "$as_me:11177: \"$ac_link\"") >&5
11178   (eval $ac_link) 2>&5
11179   ac_status=$?
11180   echo "$as_me:11180: \$? = $ac_status" >&5
11181   (exit $ac_status); } &&
11182          { ac_try='test -s conftest$ac_exeext'
11183   { (eval echo "$as_me:11183: \"$ac_try\"") >&5
11184   (eval $ac_try) 2>&5
11185   ac_status=$?
11186   echo "$as_me:11186: \$? = $ac_status" >&5
11187   (exit $ac_status); }; }; then
11188   ac_cv_lib_X11_XOpenDisplay=yes
11189 else
11190   echo "$as_me: failed program was:" >&5
11191 cat conftest.$ac_ext >&5
11192 ac_cv_lib_X11_XOpenDisplay=no
11193 fi
11194 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11195 LIBS=$ac_check_lib_save_LIBS
11196 fi
11197 echo "$as_me:11197: result: $ac_cv_lib_X11_XOpenDisplay" >&5
11198 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
11199 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
11200   LIBS="-lX11 $LIBS"
11201 fi
11202
11203 fi
11204
11205         echo "$as_me:11205: checking for XtAppInitialize" >&5
11206 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
11207 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
11208   echo $ECHO_N "(cached) $ECHO_C" >&6
11209 else
11210   cat >conftest.$ac_ext <<_ACEOF
11211 #line 11211 "configure"
11212 #include "confdefs.h"
11213 /* System header to define __stub macros and hopefully few prototypes,
11214     which can conflict with char XtAppInitialize (); below.  */
11215 #include <assert.h>
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 XtAppInitialize ();
11223 char (*f) ();
11224
11225 int
11226 main ()
11227 {
11228 /* The GNU C library defines this for functions which it implements
11229     to always fail with ENOSYS.  Some functions are actually named
11230     something starting with __ and the normal name is an alias.  */
11231 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
11232 choke me
11233 #else
11234 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11235 #endif
11236
11237   ;
11238   return 0;
11239 }
11240 _ACEOF
11241 rm -f conftest.$ac_objext conftest$ac_exeext
11242 if { (eval echo "$as_me:11242: \"$ac_link\"") >&5
11243   (eval $ac_link) 2>&5
11244   ac_status=$?
11245   echo "$as_me:11245: \$? = $ac_status" >&5
11246   (exit $ac_status); } &&
11247          { ac_try='test -s conftest$ac_exeext'
11248   { (eval echo "$as_me:11248: \"$ac_try\"") >&5
11249   (eval $ac_try) 2>&5
11250   ac_status=$?
11251   echo "$as_me:11251: \$? = $ac_status" >&5
11252   (exit $ac_status); }; }; then
11253   ac_cv_func_XtAppInitialize=yes
11254 else
11255   echo "$as_me: failed program was:" >&5
11256 cat conftest.$ac_ext >&5
11257 ac_cv_func_XtAppInitialize=no
11258 fi
11259 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11260 fi
11261 echo "$as_me:11261: result: $ac_cv_func_XtAppInitialize" >&5
11262 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
11263 if test $ac_cv_func_XtAppInitialize = yes; then
11264   :
11265 else
11266
11267         echo "$as_me:11267: checking for XtAppInitialize in -lXt" >&5
11268 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
11269 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
11270   echo $ECHO_N "(cached) $ECHO_C" >&6
11271 else
11272   ac_check_lib_save_LIBS=$LIBS
11273 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11274 cat >conftest.$ac_ext <<_ACEOF
11275 #line 11275 "configure"
11276 #include "confdefs.h"
11277
11278 /* Override any gcc2 internal prototype to avoid an error.  */
11279 #ifdef __cplusplus
11280 extern "C"
11281 #endif
11282 /* We use char because int might match the return type of a gcc2
11283    builtin and then its argument prototype would still apply.  */
11284 char XtAppInitialize ();
11285 int
11286 main ()
11287 {
11288 XtAppInitialize ();
11289   ;
11290   return 0;
11291 }
11292 _ACEOF
11293 rm -f conftest.$ac_objext conftest$ac_exeext
11294 if { (eval echo "$as_me:11294: \"$ac_link\"") >&5
11295   (eval $ac_link) 2>&5
11296   ac_status=$?
11297   echo "$as_me:11297: \$? = $ac_status" >&5
11298   (exit $ac_status); } &&
11299          { ac_try='test -s conftest$ac_exeext'
11300   { (eval echo "$as_me:11300: \"$ac_try\"") >&5
11301   (eval $ac_try) 2>&5
11302   ac_status=$?
11303   echo "$as_me:11303: \$? = $ac_status" >&5
11304   (exit $ac_status); }; }; then
11305   ac_cv_lib_Xt_XtAppInitialize=yes
11306 else
11307   echo "$as_me: failed program was:" >&5
11308 cat conftest.$ac_ext >&5
11309 ac_cv_lib_Xt_XtAppInitialize=no
11310 fi
11311 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11312 LIBS=$ac_check_lib_save_LIBS
11313 fi
11314 echo "$as_me:11314: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
11315 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
11316 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
11317
11318 cat >>confdefs.h <<\EOF
11319 #define HAVE_LIBXT 1
11320 EOF
11321
11322                  cf_have_X_LIBS=Xt
11323                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
11324 fi
11325
11326 fi
11327
11328 fi
11329
11330 if test $cf_have_X_LIBS = no ; then
11331         { echo "$as_me:11331: WARNING: Unable to successfully link X Toolkit library (-lXt) with
11332 test program.  You will have to check and add the proper libraries by hand
11333 to makefile." >&5
11334 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
11335 test program.  You will have to check and add the proper libraries by hand
11336 to makefile." >&2;}
11337 fi
11338
11339 cf_x_athena_root=$cf_x_athena
11340 cf_x_athena_inc=""
11341
11342 for cf_path in default \
11343         /usr/contrib/X11R6 \
11344         /usr/contrib/X11R5 \
11345         /usr/lib/X11R5 \
11346         /usr/local
11347 do
11348         if test -z "$cf_x_athena_inc" ; then
11349                 cf_save="$CPPFLAGS"
11350                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
11351                 if test $cf_path != default ; then
11352                         CPPFLAGS="$cf_save -I$cf_path/include"
11353                         echo "$as_me:11353: checking for $cf_test in $cf_path" >&5
11354 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
11355                 else
11356                         echo "$as_me:11356: checking for $cf_test" >&5
11357 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
11358                 fi
11359                 cat >conftest.$ac_ext <<_ACEOF
11360 #line 11360 "configure"
11361 #include "confdefs.h"
11362
11363 #include <X11/Intrinsic.h>
11364 #include <$cf_test>
11365 int
11366 main ()
11367 {
11368
11369   ;
11370   return 0;
11371 }
11372 _ACEOF
11373 rm -f conftest.$ac_objext
11374 if { (eval echo "$as_me:11374: \"$ac_compile\"") >&5
11375   (eval $ac_compile) 2>&5
11376   ac_status=$?
11377   echo "$as_me:11377: \$? = $ac_status" >&5
11378   (exit $ac_status); } &&
11379          { ac_try='test -s conftest.$ac_objext'
11380   { (eval echo "$as_me:11380: \"$ac_try\"") >&5
11381   (eval $ac_try) 2>&5
11382   ac_status=$?
11383   echo "$as_me:11383: \$? = $ac_status" >&5
11384   (exit $ac_status); }; }; then
11385   cf_result=yes
11386 else
11387   echo "$as_me: failed program was:" >&5
11388 cat conftest.$ac_ext >&5
11389 cf_result=no
11390 fi
11391 rm -f conftest.$ac_objext conftest.$ac_ext
11392                 echo "$as_me:11392: result: $cf_result" >&5
11393 echo "${ECHO_T}$cf_result" >&6
11394                 if test "$cf_result" = yes ; then
11395                         cf_x_athena_inc=$cf_path
11396                         break
11397                 else
11398                         CPPFLAGS="$cf_save"
11399                 fi
11400         fi
11401 done
11402
11403 if test -z "$cf_x_athena_inc" ; then
11404         { echo "$as_me:11404: WARNING: Unable to successfully find Athena header files with test program" >&5
11405 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
11406 elif test "$cf_x_athena_inc" != default ; then
11407         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
11408 fi
11409
11410 cf_x_athena_root=$cf_x_athena
11411 cf_x_athena_lib=""
11412
11413 for cf_path in default \
11414         /usr/contrib/X11R6 \
11415         /usr/contrib/X11R5 \
11416         /usr/lib/X11R5 \
11417         /usr/local
11418 do
11419         for cf_lib in \
11420                 ${cf_x_athena_root} \
11421                 ${cf_x_athena_root}7 \
11422                 ${cf_x_athena_root}6
11423         do
11424         for cf_libs in \
11425                 "-l$cf_lib -lXmu" \
11426                 "-l$cf_lib -lXpm -lXmu" \
11427                 "-l${cf_lib}_s -lXmu_s"
11428         do
11429                 if test -z "$cf_x_athena_lib" ; then
11430                         cf_save="$LIBS"
11431                         cf_test=XawSimpleMenuAddGlobalActions
11432                         if test $cf_path != default ; then
11433                                 LIBS="-L$cf_path/lib $cf_libs $LIBS"
11434                                 echo "$as_me:11434: checking for $cf_libs in $cf_path" >&5
11435 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
11436                         else
11437                                 LIBS="$cf_libs $LIBS"
11438                                 echo "$as_me:11438: checking for $cf_test in $cf_libs" >&5
11439 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
11440                         fi
11441                         cat >conftest.$ac_ext <<_ACEOF
11442 #line 11442 "configure"
11443 #include "confdefs.h"
11444
11445 #include <X11/Intrinsic.h>
11446 #include <X11/$cf_x_athena_root/SimpleMenu.h>
11447
11448 int
11449 main ()
11450 {
11451
11452 $cf_test((XtAppContext) 0)
11453   ;
11454   return 0;
11455 }
11456 _ACEOF
11457 rm -f conftest.$ac_objext conftest$ac_exeext
11458 if { (eval echo "$as_me:11458: \"$ac_link\"") >&5
11459   (eval $ac_link) 2>&5
11460   ac_status=$?
11461   echo "$as_me:11461: \$? = $ac_status" >&5
11462   (exit $ac_status); } &&
11463          { ac_try='test -s conftest$ac_exeext'
11464   { (eval echo "$as_me:11464: \"$ac_try\"") >&5
11465   (eval $ac_try) 2>&5
11466   ac_status=$?
11467   echo "$as_me:11467: \$? = $ac_status" >&5
11468   (exit $ac_status); }; }; then
11469   cf_result=yes
11470 else
11471   echo "$as_me: failed program was:" >&5
11472 cat conftest.$ac_ext >&5
11473 cf_result=no
11474 fi
11475 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11476                         echo "$as_me:11476: result: $cf_result" >&5
11477 echo "${ECHO_T}$cf_result" >&6
11478                         if test "$cf_result" = yes ; then
11479                                 cf_x_athena_lib="$cf_libs"
11480                                 break
11481                         fi
11482                         LIBS="$cf_save"
11483                 fi
11484         done # cf_libs
11485                 test -n "$cf_x_athena_lib" && break
11486         done # cf_lib
11487 done
11488
11489 if test -z "$cf_x_athena_lib" ; then
11490         { { echo "$as_me:11490: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
11491 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
11492    { (exit 1); exit 1; }; }
11493 fi
11494
11495 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11496
11497 cat >>confdefs.h <<EOF
11498 #define $cf_x_athena_LIBS 1
11499 EOF
11500
11501 fi
11502
11503 if test -n "$ac_tool_prefix"; then
11504   for ac_prog in xcurses-config
11505   do
11506     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
11507 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
11508 echo "$as_me:11508: checking for $ac_word" >&5
11509 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11510 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
11511   echo $ECHO_N "(cached) $ECHO_C" >&6
11512 else
11513   if test -n "$XCURSES_CONFIG"; then
11514   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
11515 else
11516   ac_save_IFS=$IFS; IFS=$ac_path_separator
11517 ac_dummy="$PATH"
11518 for ac_dir in $ac_dummy; do
11519   IFS=$ac_save_IFS
11520   test -z "$ac_dir" && ac_dir=.
11521   $as_executable_p "$ac_dir/$ac_word" || continue
11522 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
11523 echo "$as_me:11523: found $ac_dir/$ac_word" >&5
11524 break
11525 done
11526
11527 fi
11528 fi
11529 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
11530 if test -n "$XCURSES_CONFIG"; then
11531   echo "$as_me:11531: result: $XCURSES_CONFIG" >&5
11532 echo "${ECHO_T}$XCURSES_CONFIG" >&6
11533 else
11534   echo "$as_me:11534: result: no" >&5
11535 echo "${ECHO_T}no" >&6
11536 fi
11537
11538     test -n "$XCURSES_CONFIG" && break
11539   done
11540 fi
11541 if test -z "$XCURSES_CONFIG"; then
11542   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
11543   for ac_prog in xcurses-config
11544 do
11545   # Extract the first word of "$ac_prog", so it can be a program name with args.
11546 set dummy $ac_prog; ac_word=$2
11547 echo "$as_me:11547: checking for $ac_word" >&5
11548 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11549 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
11550   echo $ECHO_N "(cached) $ECHO_C" >&6
11551 else
11552   if test -n "$ac_ct_XCURSES_CONFIG"; then
11553   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
11554 else
11555   ac_save_IFS=$IFS; IFS=$ac_path_separator
11556 ac_dummy="$PATH"
11557 for ac_dir in $ac_dummy; do
11558   IFS=$ac_save_IFS
11559   test -z "$ac_dir" && ac_dir=.
11560   $as_executable_p "$ac_dir/$ac_word" || continue
11561 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
11562 echo "$as_me:11562: found $ac_dir/$ac_word" >&5
11563 break
11564 done
11565
11566 fi
11567 fi
11568 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
11569 if test -n "$ac_ct_XCURSES_CONFIG"; then
11570   echo "$as_me:11570: result: $ac_ct_XCURSES_CONFIG" >&5
11571 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
11572 else
11573   echo "$as_me:11573: result: no" >&5
11574 echo "${ECHO_T}no" >&6
11575 fi
11576
11577   test -n "$ac_ct_XCURSES_CONFIG" && break
11578 done
11579 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
11580
11581   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
11582 fi
11583
11584 if test "$XCURSES_CONFIG" != none ; then
11585
11586 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
11587 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
11588
11589 cf_cv_lib_XCurses=yes
11590
11591 else
11592
11593 LDFLAGS="$LDFLAGS $X_LIBS"
11594
11595 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11596
11597 echo "${as_me:-configure}:11597: testing checking additions to CFLAGS ..." 1>&5
11598
11599 cf_check_cflags="$CFLAGS"
11600 cf_check_cppflags="$CPPFLAGS"
11601
11602 cf_fix_cppflags=no
11603 cf_new_cflags=
11604 cf_new_cppflags=
11605 cf_new_extra_cppflags=
11606
11607 for cf_add_cflags in $X_CFLAGS
11608 do
11609 case $cf_fix_cppflags in
11610 no)
11611         case $cf_add_cflags in #(vi
11612         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11613                 case $cf_add_cflags in
11614                 -D*)
11615                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11616
11617                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11618                                 && test -z "${cf_tst_cflags}" \
11619                                 && cf_fix_cppflags=yes
11620
11621                         if test $cf_fix_cppflags = yes ; then
11622                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11623                                 continue
11624                         elif test "${cf_tst_cflags}" = "\"'" ; then
11625                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11626                                 continue
11627                         fi
11628                         ;;
11629                 esac
11630                 case "$CPPFLAGS" in
11631                 *$cf_add_cflags) #(vi
11632                         ;;
11633                 *) #(vi
11634                         case $cf_add_cflags in #(vi
11635                         -D*)
11636                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11637
11638 CPPFLAGS=`echo "$CPPFLAGS" | \
11639         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11640                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11641
11642                                 ;;
11643                         esac
11644                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11645                         ;;
11646                 esac
11647                 ;;
11648         *)
11649                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11650                 ;;
11651         esac
11652         ;;
11653 yes)
11654         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11655
11656         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11657
11658         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11659                 && test -z "${cf_tst_cflags}" \
11660                 && cf_fix_cppflags=no
11661         ;;
11662 esac
11663 done
11664
11665 if test -n "$cf_new_cflags" ; then
11666         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11667
11668 echo "${as_me:-configure}:11668: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11669
11670         CFLAGS="$CFLAGS $cf_new_cflags"
11671 fi
11672
11673 if test -n "$cf_new_cppflags" ; then
11674         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11675
11676 echo "${as_me:-configure}:11676: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11677
11678         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11679 fi
11680
11681 if test -n "$cf_new_extra_cppflags" ; then
11682         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11683
11684 echo "${as_me:-configure}:11684: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11685
11686         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11687 fi
11688
11689 if test "$cf_check_cflags" != "$CFLAGS" ; then
11690 cat >conftest.$ac_ext <<_ACEOF
11691 #line 11691 "configure"
11692 #include "confdefs.h"
11693 #include <stdio.h>
11694 int
11695 main ()
11696 {
11697 printf("Hello world");
11698   ;
11699   return 0;
11700 }
11701 _ACEOF
11702 rm -f conftest.$ac_objext conftest$ac_exeext
11703 if { (eval echo "$as_me:11703: \"$ac_link\"") >&5
11704   (eval $ac_link) 2>&5
11705   ac_status=$?
11706   echo "$as_me:11706: \$? = $ac_status" >&5
11707   (exit $ac_status); } &&
11708          { ac_try='test -s conftest$ac_exeext'
11709   { (eval echo "$as_me:11709: \"$ac_try\"") >&5
11710   (eval $ac_try) 2>&5
11711   ac_status=$?
11712   echo "$as_me:11712: \$? = $ac_status" >&5
11713   (exit $ac_status); }; }; then
11714   :
11715 else
11716   echo "$as_me: failed program was:" >&5
11717 cat conftest.$ac_ext >&5
11718 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
11719
11720 echo "${as_me:-configure}:11720: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
11721
11722          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
11723                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
11724
11725 echo "${as_me:-configure}:11725: testing but keeping change to \$CPPFLAGS ..." 1>&5
11726
11727          fi
11728          CFLAGS="$cf_check_flags"
11729 fi
11730 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11731 fi
11732
11733 echo "$as_me:11733: checking for XOpenDisplay in -lX11" >&5
11734 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
11735 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
11736   echo $ECHO_N "(cached) $ECHO_C" >&6
11737 else
11738   ac_check_lib_save_LIBS=$LIBS
11739 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11740 cat >conftest.$ac_ext <<_ACEOF
11741 #line 11741 "configure"
11742 #include "confdefs.h"
11743
11744 /* Override any gcc2 internal prototype to avoid an error.  */
11745 #ifdef __cplusplus
11746 extern "C"
11747 #endif
11748 /* We use char because int might match the return type of a gcc2
11749    builtin and then its argument prototype would still apply.  */
11750 char XOpenDisplay ();
11751 int
11752 main ()
11753 {
11754 XOpenDisplay ();
11755   ;
11756   return 0;
11757 }
11758 _ACEOF
11759 rm -f conftest.$ac_objext conftest$ac_exeext
11760 if { (eval echo "$as_me:11760: \"$ac_link\"") >&5
11761   (eval $ac_link) 2>&5
11762   ac_status=$?
11763   echo "$as_me:11763: \$? = $ac_status" >&5
11764   (exit $ac_status); } &&
11765          { ac_try='test -s conftest$ac_exeext'
11766   { (eval echo "$as_me:11766: \"$ac_try\"") >&5
11767   (eval $ac_try) 2>&5
11768   ac_status=$?
11769   echo "$as_me:11769: \$? = $ac_status" >&5
11770   (exit $ac_status); }; }; then
11771   ac_cv_lib_X11_XOpenDisplay=yes
11772 else
11773   echo "$as_me: failed program was:" >&5
11774 cat conftest.$ac_ext >&5
11775 ac_cv_lib_X11_XOpenDisplay=no
11776 fi
11777 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11778 LIBS=$ac_check_lib_save_LIBS
11779 fi
11780 echo "$as_me:11780: result: $ac_cv_lib_X11_XOpenDisplay" >&5
11781 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
11782 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
11783   LIBS="-lX11 $LIBS"
11784 fi
11785
11786 echo "$as_me:11786: checking for XCurses library" >&5
11787 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
11788 if test "${cf_cv_lib_XCurses+set}" = set; then
11789   echo $ECHO_N "(cached) $ECHO_C" >&6
11790 else
11791
11792 LIBS="-lXCurses $LIBS"
11793 cat >conftest.$ac_ext <<_ACEOF
11794 #line 11794 "configure"
11795 #include "confdefs.h"
11796
11797 #include <xcurses.h>
11798 char *XCursesProgramName = "test";
11799
11800 int
11801 main ()
11802 {
11803 XCursesExit();
11804   ;
11805   return 0;
11806 }
11807 _ACEOF
11808 rm -f conftest.$ac_objext conftest$ac_exeext
11809 if { (eval echo "$as_me:11809: \"$ac_link\"") >&5
11810   (eval $ac_link) 2>&5
11811   ac_status=$?
11812   echo "$as_me:11812: \$? = $ac_status" >&5
11813   (exit $ac_status); } &&
11814          { ac_try='test -s conftest$ac_exeext'
11815   { (eval echo "$as_me:11815: \"$ac_try\"") >&5
11816   (eval $ac_try) 2>&5
11817   ac_status=$?
11818   echo "$as_me:11818: \$? = $ac_status" >&5
11819   (exit $ac_status); }; }; then
11820   cf_cv_lib_XCurses=yes
11821 else
11822   echo "$as_me: failed program was:" >&5
11823 cat conftest.$ac_ext >&5
11824 cf_cv_lib_XCurses=no
11825 fi
11826 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11827
11828 fi
11829 echo "$as_me:11829: result: $cf_cv_lib_XCurses" >&5
11830 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
11831
11832 fi
11833
11834 if test $cf_cv_lib_XCurses = yes ; then
11835
11836 cat >>confdefs.h <<\EOF
11837 #define UNIX 1
11838 EOF
11839
11840 cat >>confdefs.h <<\EOF
11841 #define XCURSES 1
11842 EOF
11843
11844         echo "$as_me:11844: checking for xcurses.h" >&5
11845 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
11846 if test "${ac_cv_header_xcurses_h+set}" = set; then
11847   echo $ECHO_N "(cached) $ECHO_C" >&6
11848 else
11849   cat >conftest.$ac_ext <<_ACEOF
11850 #line 11850 "configure"
11851 #include "confdefs.h"
11852 #include <xcurses.h>
11853 _ACEOF
11854 if { (eval echo "$as_me:11854: \"$ac_cpp conftest.$ac_ext\"") >&5
11855   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11856   ac_status=$?
11857   egrep -v '^ *\+' conftest.er1 >conftest.err
11858   rm -f conftest.er1
11859   cat conftest.err >&5
11860   echo "$as_me:11860: \$? = $ac_status" >&5
11861   (exit $ac_status); } >/dev/null; then
11862   if test -s conftest.err; then
11863     ac_cpp_err=$ac_c_preproc_warn_flag
11864   else
11865     ac_cpp_err=
11866   fi
11867 else
11868   ac_cpp_err=yes
11869 fi
11870 if test -z "$ac_cpp_err"; then
11871   ac_cv_header_xcurses_h=yes
11872 else
11873   echo "$as_me: failed program was:" >&5
11874   cat conftest.$ac_ext >&5
11875   ac_cv_header_xcurses_h=no
11876 fi
11877 rm -f conftest.err conftest.$ac_ext
11878 fi
11879 echo "$as_me:11879: result: $ac_cv_header_xcurses_h" >&5
11880 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
11881 if test $ac_cv_header_xcurses_h = yes; then
11882
11883 cat >>confdefs.h <<\EOF
11884 #define HAVE_XCURSES 1
11885 EOF
11886
11887 fi
11888
11889 else
11890         { { echo "$as_me:11890: error: Cannot link with XCurses" >&5
11891 echo "$as_me: error: Cannot link with XCurses" >&2;}
11892    { (exit 1); exit 1; }; }
11893 fi
11894
11895         ;;
11896 esac
11897
11898 case $cf_cv_screen in
11899 curses|curses_*)
11900
11901 echo "$as_me:11901: checking for NetBSD form.h" >&5
11902 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
11903 if test "${cf_cv_netbsd_form_h+set}" = set; then
11904   echo $ECHO_N "(cached) $ECHO_C" >&6
11905 else
11906
11907 cat >conftest.$ac_ext <<_ACEOF
11908 #line 11908 "configure"
11909 #include "confdefs.h"
11910
11911 #include <${cf_cv_ncurses_header:-curses.h}>
11912 #include <form.h>
11913
11914 int
11915 main ()
11916 {
11917
11918         FORM *form;
11919         int y = current_field(form)->cursor_ypos;
11920         int x = current_field(form)->cursor_xpos;
11921
11922   ;
11923   return 0;
11924 }
11925 _ACEOF
11926 rm -f conftest.$ac_objext
11927 if { (eval echo "$as_me:11927: \"$ac_compile\"") >&5
11928   (eval $ac_compile) 2>&5
11929   ac_status=$?
11930   echo "$as_me:11930: \$? = $ac_status" >&5
11931   (exit $ac_status); } &&
11932          { ac_try='test -s conftest.$ac_objext'
11933   { (eval echo "$as_me:11933: \"$ac_try\"") >&5
11934   (eval $ac_try) 2>&5
11935   ac_status=$?
11936   echo "$as_me:11936: \$? = $ac_status" >&5
11937   (exit $ac_status); }; }; then
11938   cf_cv_netbsd_form_h=yes
11939
11940 else
11941   echo "$as_me: failed program was:" >&5
11942 cat conftest.$ac_ext >&5
11943 cf_cv_netbsd_form_h=no
11944 fi
11945 rm -f conftest.$ac_objext conftest.$ac_ext
11946
11947 fi
11948 echo "$as_me:11948: result: $cf_cv_netbsd_form_h" >&5
11949 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
11950
11951 test "$cf_cv_netbsd_form_h" = yes &&
11952 cat >>confdefs.h <<\EOF
11953 #define HAVE_NETBSD_FORM_H 1
11954 EOF
11955
11956 echo "$as_me:11956: checking for NetBSD menu.h" >&5
11957 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
11958 if test "${cf_cv_netbsd_menu_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 <menu.h>
11968
11969 int
11970 main ()
11971 {
11972
11973         MENU *menu;
11974         int y = menu->max_item_width;
11975
11976   ;
11977   return 0;
11978 }
11979 _ACEOF
11980 rm -f conftest.$ac_objext
11981 if { (eval echo "$as_me:11981: \"$ac_compile\"") >&5
11982   (eval $ac_compile) 2>&5
11983   ac_status=$?
11984   echo "$as_me:11984: \$? = $ac_status" >&5
11985   (exit $ac_status); } &&
11986          { ac_try='test -s conftest.$ac_objext'
11987   { (eval echo "$as_me:11987: \"$ac_try\"") >&5
11988   (eval $ac_try) 2>&5
11989   ac_status=$?
11990   echo "$as_me:11990: \$? = $ac_status" >&5
11991   (exit $ac_status); }; }; then
11992   cf_cv_netbsd_menu_h=yes
11993
11994 else
11995   echo "$as_me: failed program was:" >&5
11996 cat conftest.$ac_ext >&5
11997 cf_cv_netbsd_menu_h=no
11998 fi
11999 rm -f conftest.$ac_objext conftest.$ac_ext
12000
12001 fi
12002 echo "$as_me:12002: result: $cf_cv_netbsd_menu_h" >&5
12003 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
12004
12005 test "$cf_cv_netbsd_menu_h" = yes &&
12006 cat >>confdefs.h <<\EOF
12007 #define HAVE_NETBSD_MENU_H 1
12008 EOF
12009
12010         ;;
12011 ncursesw)
12012         cf_cv_libtype=w
12013         ;;
12014 esac
12015
12016 case $cf_cv_screen in #(vi
12017 pdcurses) #(vi
12018         ;;
12019 *)
12020         # look for curses-related libraries
12021         : ${cf_panel_lib:=panel}
12022         : ${cf_menu_lib:=menu}
12023         : ${cf_form_lib:=form}
12024
12025 as_ac_Lib=`echo "ac_cv_lib_$cf_panel_lib$cf_cv_libtype''_new_panel" | $as_tr_sh`
12026 echo "$as_me:12026: checking for new_panel in -l$cf_panel_lib$cf_cv_libtype" >&5
12027 echo $ECHO_N "checking for new_panel in -l$cf_panel_lib$cf_cv_libtype... $ECHO_C" >&6
12028 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12029   echo $ECHO_N "(cached) $ECHO_C" >&6
12030 else
12031   ac_check_lib_save_LIBS=$LIBS
12032 LIBS="-l$cf_panel_lib$cf_cv_libtype  $LIBS"
12033 cat >conftest.$ac_ext <<_ACEOF
12034 #line 12034 "configure"
12035 #include "confdefs.h"
12036
12037 /* Override any gcc2 internal prototype to avoid an error.  */
12038 #ifdef __cplusplus
12039 extern "C"
12040 #endif
12041 /* We use char because int might match the return type of a gcc2
12042    builtin and then its argument prototype would still apply.  */
12043 char new_panel ();
12044 int
12045 main ()
12046 {
12047 new_panel ();
12048   ;
12049   return 0;
12050 }
12051 _ACEOF
12052 rm -f conftest.$ac_objext conftest$ac_exeext
12053 if { (eval echo "$as_me:12053: \"$ac_link\"") >&5
12054   (eval $ac_link) 2>&5
12055   ac_status=$?
12056   echo "$as_me:12056: \$? = $ac_status" >&5
12057   (exit $ac_status); } &&
12058          { ac_try='test -s conftest$ac_exeext'
12059   { (eval echo "$as_me:12059: \"$ac_try\"") >&5
12060   (eval $ac_try) 2>&5
12061   ac_status=$?
12062   echo "$as_me:12062: \$? = $ac_status" >&5
12063   (exit $ac_status); }; }; then
12064   eval "$as_ac_Lib=yes"
12065 else
12066   echo "$as_me: failed program was:" >&5
12067 cat conftest.$ac_ext >&5
12068 eval "$as_ac_Lib=no"
12069 fi
12070 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12071 LIBS=$ac_check_lib_save_LIBS
12072 fi
12073 echo "$as_me:12073: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12074 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12075 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12076   cat >>confdefs.h <<EOF
12077 #define `echo "HAVE_LIB$cf_panel_lib$cf_cv_libtype" | $as_tr_cpp` 1
12078 EOF
12079
12080   LIBS="-l$cf_panel_lib$cf_cv_libtype $LIBS"
12081
12082 fi
12083
12084 as_ac_Lib=`echo "ac_cv_lib_$cf_menu_lib$cf_cv_libtype''_menu_driver" | $as_tr_sh`
12085 echo "$as_me:12085: checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype" >&5
12086 echo $ECHO_N "checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype... $ECHO_C" >&6
12087 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12088   echo $ECHO_N "(cached) $ECHO_C" >&6
12089 else
12090   ac_check_lib_save_LIBS=$LIBS
12091 LIBS="-l$cf_menu_lib$cf_cv_libtype  $LIBS"
12092 cat >conftest.$ac_ext <<_ACEOF
12093 #line 12093 "configure"
12094 #include "confdefs.h"
12095
12096 /* Override any gcc2 internal prototype to avoid an error.  */
12097 #ifdef __cplusplus
12098 extern "C"
12099 #endif
12100 /* We use char because int might match the return type of a gcc2
12101    builtin and then its argument prototype would still apply.  */
12102 char menu_driver ();
12103 int
12104 main ()
12105 {
12106 menu_driver ();
12107   ;
12108   return 0;
12109 }
12110 _ACEOF
12111 rm -f conftest.$ac_objext conftest$ac_exeext
12112 if { (eval echo "$as_me:12112: \"$ac_link\"") >&5
12113   (eval $ac_link) 2>&5
12114   ac_status=$?
12115   echo "$as_me:12115: \$? = $ac_status" >&5
12116   (exit $ac_status); } &&
12117          { ac_try='test -s conftest$ac_exeext'
12118   { (eval echo "$as_me:12118: \"$ac_try\"") >&5
12119   (eval $ac_try) 2>&5
12120   ac_status=$?
12121   echo "$as_me:12121: \$? = $ac_status" >&5
12122   (exit $ac_status); }; }; then
12123   eval "$as_ac_Lib=yes"
12124 else
12125   echo "$as_me: failed program was:" >&5
12126 cat conftest.$ac_ext >&5
12127 eval "$as_ac_Lib=no"
12128 fi
12129 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12130 LIBS=$ac_check_lib_save_LIBS
12131 fi
12132 echo "$as_me:12132: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12133 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12134 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12135   cat >>confdefs.h <<EOF
12136 #define `echo "HAVE_LIB$cf_menu_lib$cf_cv_libtype" | $as_tr_cpp` 1
12137 EOF
12138
12139   LIBS="-l$cf_menu_lib$cf_cv_libtype $LIBS"
12140
12141 fi
12142
12143 as_ac_Lib=`echo "ac_cv_lib_$cf_form_lib$cf_cv_libtype''_form_driver" | $as_tr_sh`
12144 echo "$as_me:12144: checking for form_driver in -l$cf_form_lib$cf_cv_libtype" >&5
12145 echo $ECHO_N "checking for form_driver in -l$cf_form_lib$cf_cv_libtype... $ECHO_C" >&6
12146 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12147   echo $ECHO_N "(cached) $ECHO_C" >&6
12148 else
12149   ac_check_lib_save_LIBS=$LIBS
12150 LIBS="-l$cf_form_lib$cf_cv_libtype  $LIBS"
12151 cat >conftest.$ac_ext <<_ACEOF
12152 #line 12152 "configure"
12153 #include "confdefs.h"
12154
12155 /* Override any gcc2 internal prototype to avoid an error.  */
12156 #ifdef __cplusplus
12157 extern "C"
12158 #endif
12159 /* We use char because int might match the return type of a gcc2
12160    builtin and then its argument prototype would still apply.  */
12161 char form_driver ();
12162 int
12163 main ()
12164 {
12165 form_driver ();
12166   ;
12167   return 0;
12168 }
12169 _ACEOF
12170 rm -f conftest.$ac_objext conftest$ac_exeext
12171 if { (eval echo "$as_me:12171: \"$ac_link\"") >&5
12172   (eval $ac_link) 2>&5
12173   ac_status=$?
12174   echo "$as_me:12174: \$? = $ac_status" >&5
12175   (exit $ac_status); } &&
12176          { ac_try='test -s conftest$ac_exeext'
12177   { (eval echo "$as_me:12177: \"$ac_try\"") >&5
12178   (eval $ac_try) 2>&5
12179   ac_status=$?
12180   echo "$as_me:12180: \$? = $ac_status" >&5
12181   (exit $ac_status); }; }; then
12182   eval "$as_ac_Lib=yes"
12183 else
12184   echo "$as_me: failed program was:" >&5
12185 cat conftest.$ac_ext >&5
12186 eval "$as_ac_Lib=no"
12187 fi
12188 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12189 LIBS=$ac_check_lib_save_LIBS
12190 fi
12191 echo "$as_me:12191: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12192 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12193 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12194   cat >>confdefs.h <<EOF
12195 #define `echo "HAVE_LIB$cf_form_lib$cf_cv_libtype" | $as_tr_cpp` 1
12196 EOF
12197
12198   LIBS="-l$cf_form_lib$cf_cv_libtype $LIBS"
12199
12200 fi
12201
12202         # look for curses-related headers
12203
12204 for ac_header in \
12205                 nc_alloc.h \
12206                 nomacros.h \
12207                 form.h \
12208                 menu.h \
12209                 panel.h \
12210                 term_entry.h \
12211
12212 do
12213 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12214 echo "$as_me:12214: checking for $ac_header" >&5
12215 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12216 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12217   echo $ECHO_N "(cached) $ECHO_C" >&6
12218 else
12219   cat >conftest.$ac_ext <<_ACEOF
12220 #line 12220 "configure"
12221 #include "confdefs.h"
12222 #include <$ac_header>
12223 _ACEOF
12224 if { (eval echo "$as_me:12224: \"$ac_cpp conftest.$ac_ext\"") >&5
12225   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12226   ac_status=$?
12227   egrep -v '^ *\+' conftest.er1 >conftest.err
12228   rm -f conftest.er1
12229   cat conftest.err >&5
12230   echo "$as_me:12230: \$? = $ac_status" >&5
12231   (exit $ac_status); } >/dev/null; then
12232   if test -s conftest.err; then
12233     ac_cpp_err=$ac_c_preproc_warn_flag
12234   else
12235     ac_cpp_err=
12236   fi
12237 else
12238   ac_cpp_err=yes
12239 fi
12240 if test -z "$ac_cpp_err"; then
12241   eval "$as_ac_Header=yes"
12242 else
12243   echo "$as_me: failed program was:" >&5
12244   cat conftest.$ac_ext >&5
12245   eval "$as_ac_Header=no"
12246 fi
12247 rm -f conftest.err conftest.$ac_ext
12248 fi
12249 echo "$as_me:12249: result: `eval echo '${'$as_ac_Header'}'`" >&5
12250 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12251 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12252   cat >>confdefs.h <<EOF
12253 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12254 EOF
12255
12256 fi
12257 done
12258
12259         ;;
12260 esac
12261
12262 echo "$as_me:12262: checking for ANSI C header files" >&5
12263 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
12264 if test "${ac_cv_header_stdc+set}" = set; then
12265   echo $ECHO_N "(cached) $ECHO_C" >&6
12266 else
12267   cat >conftest.$ac_ext <<_ACEOF
12268 #line 12268 "configure"
12269 #include "confdefs.h"
12270 #include <stdlib.h>
12271 #include <stdarg.h>
12272 #include <string.h>
12273 #include <float.h>
12274
12275 _ACEOF
12276 if { (eval echo "$as_me:12276: \"$ac_cpp conftest.$ac_ext\"") >&5
12277   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12278   ac_status=$?
12279   egrep -v '^ *\+' conftest.er1 >conftest.err
12280   rm -f conftest.er1
12281   cat conftest.err >&5
12282   echo "$as_me:12282: \$? = $ac_status" >&5
12283   (exit $ac_status); } >/dev/null; then
12284   if test -s conftest.err; then
12285     ac_cpp_err=$ac_c_preproc_warn_flag
12286   else
12287     ac_cpp_err=
12288   fi
12289 else
12290   ac_cpp_err=yes
12291 fi
12292 if test -z "$ac_cpp_err"; then
12293   ac_cv_header_stdc=yes
12294 else
12295   echo "$as_me: failed program was:" >&5
12296   cat conftest.$ac_ext >&5
12297   ac_cv_header_stdc=no
12298 fi
12299 rm -f conftest.err conftest.$ac_ext
12300
12301 if test $ac_cv_header_stdc = yes; then
12302   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12303   cat >conftest.$ac_ext <<_ACEOF
12304 #line 12304 "configure"
12305 #include "confdefs.h"
12306 #include <string.h>
12307
12308 _ACEOF
12309 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12310   egrep "memchr" >/dev/null 2>&1; then
12311   :
12312 else
12313   ac_cv_header_stdc=no
12314 fi
12315 rm -rf conftest*
12316
12317 fi
12318
12319 if test $ac_cv_header_stdc = yes; then
12320   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12321   cat >conftest.$ac_ext <<_ACEOF
12322 #line 12322 "configure"
12323 #include "confdefs.h"
12324 #include <stdlib.h>
12325
12326 _ACEOF
12327 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12328   egrep "free" >/dev/null 2>&1; then
12329   :
12330 else
12331   ac_cv_header_stdc=no
12332 fi
12333 rm -rf conftest*
12334
12335 fi
12336
12337 if test $ac_cv_header_stdc = yes; then
12338   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12339   if test "$cross_compiling" = yes; then
12340   :
12341 else
12342   cat >conftest.$ac_ext <<_ACEOF
12343 #line 12343 "configure"
12344 #include "confdefs.h"
12345 #include <ctype.h>
12346 #if ((' ' & 0x0FF) == 0x020)
12347 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12348 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12349 #else
12350 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
12351                      || ('j' <= (c) && (c) <= 'r') \
12352                      || ('s' <= (c) && (c) <= 'z'))
12353 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
12354 #endif
12355
12356 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12357 int
12358 main ()
12359 {
12360   int i;
12361   for (i = 0; i < 256; i++)
12362     if (XOR (islower (i), ISLOWER (i))
12363         || toupper (i) != TOUPPER (i))
12364       $ac_main_return(2);
12365   $ac_main_return (0);
12366 }
12367 _ACEOF
12368 rm -f conftest$ac_exeext
12369 if { (eval echo "$as_me:12369: \"$ac_link\"") >&5
12370   (eval $ac_link) 2>&5
12371   ac_status=$?
12372   echo "$as_me:12372: \$? = $ac_status" >&5
12373   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12374   { (eval echo "$as_me:12374: \"$ac_try\"") >&5
12375   (eval $ac_try) 2>&5
12376   ac_status=$?
12377   echo "$as_me:12377: \$? = $ac_status" >&5
12378   (exit $ac_status); }; }; then
12379   :
12380 else
12381   echo "$as_me: program exited with status $ac_status" >&5
12382 echo "$as_me: failed program was:" >&5
12383 cat conftest.$ac_ext >&5
12384 ac_cv_header_stdc=no
12385 fi
12386 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12387 fi
12388 fi
12389 fi
12390 echo "$as_me:12390: result: $ac_cv_header_stdc" >&5
12391 echo "${ECHO_T}$ac_cv_header_stdc" >&6
12392 if test $ac_cv_header_stdc = yes; then
12393
12394 cat >>confdefs.h <<\EOF
12395 #define STDC_HEADERS 1
12396 EOF
12397
12398 fi
12399
12400 echo "$as_me:12400: checking whether time.h and sys/time.h may both be included" >&5
12401 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
12402 if test "${ac_cv_header_time+set}" = set; then
12403   echo $ECHO_N "(cached) $ECHO_C" >&6
12404 else
12405   cat >conftest.$ac_ext <<_ACEOF
12406 #line 12406 "configure"
12407 #include "confdefs.h"
12408 #include <sys/types.h>
12409 #include <sys/time.h>
12410 #include <time.h>
12411
12412 int
12413 main ()
12414 {
12415 if ((struct tm *) 0)
12416 return 0;
12417   ;
12418   return 0;
12419 }
12420 _ACEOF
12421 rm -f conftest.$ac_objext
12422 if { (eval echo "$as_me:12422: \"$ac_compile\"") >&5
12423   (eval $ac_compile) 2>&5
12424   ac_status=$?
12425   echo "$as_me:12425: \$? = $ac_status" >&5
12426   (exit $ac_status); } &&
12427          { ac_try='test -s conftest.$ac_objext'
12428   { (eval echo "$as_me:12428: \"$ac_try\"") >&5
12429   (eval $ac_try) 2>&5
12430   ac_status=$?
12431   echo "$as_me:12431: \$? = $ac_status" >&5
12432   (exit $ac_status); }; }; then
12433   ac_cv_header_time=yes
12434 else
12435   echo "$as_me: failed program was:" >&5
12436 cat conftest.$ac_ext >&5
12437 ac_cv_header_time=no
12438 fi
12439 rm -f conftest.$ac_objext conftest.$ac_ext
12440 fi
12441 echo "$as_me:12441: result: $ac_cv_header_time" >&5
12442 echo "${ECHO_T}$ac_cv_header_time" >&6
12443 if test $ac_cv_header_time = yes; then
12444
12445 cat >>confdefs.h <<\EOF
12446 #define TIME_WITH_SYS_TIME 1
12447 EOF
12448
12449 fi
12450
12451 for ac_header in \
12452 getopt.h \
12453 locale.h \
12454 math.h \
12455 stdarg.h \
12456 sys/ioctl.h \
12457 sys/select.h \
12458 sys/time.h \
12459 termios.h \
12460 unistd.h \
12461
12462 do
12463 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12464 echo "$as_me:12464: checking for $ac_header" >&5
12465 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12466 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12467   echo $ECHO_N "(cached) $ECHO_C" >&6
12468 else
12469   cat >conftest.$ac_ext <<_ACEOF
12470 #line 12470 "configure"
12471 #include "confdefs.h"
12472 #include <$ac_header>
12473 _ACEOF
12474 if { (eval echo "$as_me:12474: \"$ac_cpp conftest.$ac_ext\"") >&5
12475   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12476   ac_status=$?
12477   egrep -v '^ *\+' conftest.er1 >conftest.err
12478   rm -f conftest.er1
12479   cat conftest.err >&5
12480   echo "$as_me:12480: \$? = $ac_status" >&5
12481   (exit $ac_status); } >/dev/null; then
12482   if test -s conftest.err; then
12483     ac_cpp_err=$ac_c_preproc_warn_flag
12484   else
12485     ac_cpp_err=
12486   fi
12487 else
12488   ac_cpp_err=yes
12489 fi
12490 if test -z "$ac_cpp_err"; then
12491   eval "$as_ac_Header=yes"
12492 else
12493   echo "$as_me: failed program was:" >&5
12494   cat conftest.$ac_ext >&5
12495   eval "$as_ac_Header=no"
12496 fi
12497 rm -f conftest.err conftest.$ac_ext
12498 fi
12499 echo "$as_me:12499: result: `eval echo '${'$as_ac_Header'}'`" >&5
12500 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12501 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12502   cat >>confdefs.h <<EOF
12503 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12504 EOF
12505
12506 fi
12507 done
12508
12509 for ac_header in unistd.h getopt.h
12510 do
12511 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12512 echo "$as_me:12512: checking for $ac_header" >&5
12513 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12514 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12515   echo $ECHO_N "(cached) $ECHO_C" >&6
12516 else
12517   cat >conftest.$ac_ext <<_ACEOF
12518 #line 12518 "configure"
12519 #include "confdefs.h"
12520 #include <$ac_header>
12521 _ACEOF
12522 if { (eval echo "$as_me:12522: \"$ac_cpp conftest.$ac_ext\"") >&5
12523   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12524   ac_status=$?
12525   egrep -v '^ *\+' conftest.er1 >conftest.err
12526   rm -f conftest.er1
12527   cat conftest.err >&5
12528   echo "$as_me:12528: \$? = $ac_status" >&5
12529   (exit $ac_status); } >/dev/null; then
12530   if test -s conftest.err; then
12531     ac_cpp_err=$ac_c_preproc_warn_flag
12532   else
12533     ac_cpp_err=
12534   fi
12535 else
12536   ac_cpp_err=yes
12537 fi
12538 if test -z "$ac_cpp_err"; then
12539   eval "$as_ac_Header=yes"
12540 else
12541   echo "$as_me: failed program was:" >&5
12542   cat conftest.$ac_ext >&5
12543   eval "$as_ac_Header=no"
12544 fi
12545 rm -f conftest.err conftest.$ac_ext
12546 fi
12547 echo "$as_me:12547: result: `eval echo '${'$as_ac_Header'}'`" >&5
12548 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12549 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12550   cat >>confdefs.h <<EOF
12551 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12552 EOF
12553
12554 fi
12555 done
12556
12557 echo "$as_me:12557: checking for header declaring getopt variables" >&5
12558 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
12559 if test "${cf_cv_getopt_header+set}" = set; then
12560   echo $ECHO_N "(cached) $ECHO_C" >&6
12561 else
12562
12563 cf_cv_getopt_header=none
12564 for cf_header in stdio.h stdlib.h unistd.h getopt.h
12565 do
12566 cat >conftest.$ac_ext <<_ACEOF
12567 #line 12567 "configure"
12568 #include "confdefs.h"
12569
12570 #include <$cf_header>
12571 int
12572 main ()
12573 {
12574 int x = optind; char *y = optarg
12575   ;
12576   return 0;
12577 }
12578 _ACEOF
12579 rm -f conftest.$ac_objext
12580 if { (eval echo "$as_me:12580: \"$ac_compile\"") >&5
12581   (eval $ac_compile) 2>&5
12582   ac_status=$?
12583   echo "$as_me:12583: \$? = $ac_status" >&5
12584   (exit $ac_status); } &&
12585          { ac_try='test -s conftest.$ac_objext'
12586   { (eval echo "$as_me:12586: \"$ac_try\"") >&5
12587   (eval $ac_try) 2>&5
12588   ac_status=$?
12589   echo "$as_me:12589: \$? = $ac_status" >&5
12590   (exit $ac_status); }; }; then
12591   cf_cv_getopt_header=$cf_header
12592  break
12593 else
12594   echo "$as_me: failed program was:" >&5
12595 cat conftest.$ac_ext >&5
12596 fi
12597 rm -f conftest.$ac_objext conftest.$ac_ext
12598 done
12599
12600 fi
12601 echo "$as_me:12601: result: $cf_cv_getopt_header" >&5
12602 echo "${ECHO_T}$cf_cv_getopt_header" >&6
12603 if test $cf_cv_getopt_header != none ; then
12604
12605 cat >>confdefs.h <<\EOF
12606 #define HAVE_GETOPT_HEADER 1
12607 EOF
12608
12609 fi
12610
12611 for ac_func in \
12612 gettimeofday \
12613
12614 do
12615 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
12616 echo "$as_me:12616: checking for $ac_func" >&5
12617 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
12618 if eval "test \"\${$as_ac_var+set}\" = set"; then
12619   echo $ECHO_N "(cached) $ECHO_C" >&6
12620 else
12621   cat >conftest.$ac_ext <<_ACEOF
12622 #line 12622 "configure"
12623 #include "confdefs.h"
12624 /* System header to define __stub macros and hopefully few prototypes,
12625     which can conflict with char $ac_func (); below.  */
12626 #include <assert.h>
12627 /* Override any gcc2 internal prototype to avoid an error.  */
12628 #ifdef __cplusplus
12629 extern "C"
12630 #endif
12631 /* We use char because int might match the return type of a gcc2
12632    builtin and then its argument prototype would still apply.  */
12633 char $ac_func ();
12634 char (*f) ();
12635
12636 int
12637 main ()
12638 {
12639 /* The GNU C library defines this for functions which it implements
12640     to always fail with ENOSYS.  Some functions are actually named
12641     something starting with __ and the normal name is an alias.  */
12642 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12643 choke me
12644 #else
12645 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12646 #endif
12647
12648   ;
12649   return 0;
12650 }
12651 _ACEOF
12652 rm -f conftest.$ac_objext conftest$ac_exeext
12653 if { (eval echo "$as_me:12653: \"$ac_link\"") >&5
12654   (eval $ac_link) 2>&5
12655   ac_status=$?
12656   echo "$as_me:12656: \$? = $ac_status" >&5
12657   (exit $ac_status); } &&
12658          { ac_try='test -s conftest$ac_exeext'
12659   { (eval echo "$as_me:12659: \"$ac_try\"") >&5
12660   (eval $ac_try) 2>&5
12661   ac_status=$?
12662   echo "$as_me:12662: \$? = $ac_status" >&5
12663   (exit $ac_status); }; }; then
12664   eval "$as_ac_var=yes"
12665 else
12666   echo "$as_me: failed program was:" >&5
12667 cat conftest.$ac_ext >&5
12668 eval "$as_ac_var=no"
12669 fi
12670 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12671 fi
12672 echo "$as_me:12672: result: `eval echo '${'$as_ac_var'}'`" >&5
12673 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
12674 if test `eval echo '${'$as_ac_var'}'` = yes; then
12675   cat >>confdefs.h <<EOF
12676 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
12677 EOF
12678
12679 fi
12680 done
12681
12682 if test "$cf_enable_widec" = yes; then
12683
12684 for ac_func in \
12685 mblen \
12686 mbrlen \
12687 mbrtowc \
12688 mbsrtowcs \
12689 mbstowcs \
12690 mbtowc \
12691 wcsrtombs \
12692 wcstombs \
12693
12694 do
12695 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
12696 echo "$as_me:12696: checking for $ac_func" >&5
12697 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
12698 if eval "test \"\${$as_ac_var+set}\" = set"; then
12699   echo $ECHO_N "(cached) $ECHO_C" >&6
12700 else
12701   cat >conftest.$ac_ext <<_ACEOF
12702 #line 12702 "configure"
12703 #include "confdefs.h"
12704 /* System header to define __stub macros and hopefully few prototypes,
12705     which can conflict with char $ac_func (); below.  */
12706 #include <assert.h>
12707 /* Override any gcc2 internal prototype to avoid an error.  */
12708 #ifdef __cplusplus
12709 extern "C"
12710 #endif
12711 /* We use char because int might match the return type of a gcc2
12712    builtin and then its argument prototype would still apply.  */
12713 char $ac_func ();
12714 char (*f) ();
12715
12716 int
12717 main ()
12718 {
12719 /* The GNU C library defines this for functions which it implements
12720     to always fail with ENOSYS.  Some functions are actually named
12721     something starting with __ and the normal name is an alias.  */
12722 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12723 choke me
12724 #else
12725 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12726 #endif
12727
12728   ;
12729   return 0;
12730 }
12731 _ACEOF
12732 rm -f conftest.$ac_objext conftest$ac_exeext
12733 if { (eval echo "$as_me:12733: \"$ac_link\"") >&5
12734   (eval $ac_link) 2>&5
12735   ac_status=$?
12736   echo "$as_me:12736: \$? = $ac_status" >&5
12737   (exit $ac_status); } &&
12738          { ac_try='test -s conftest$ac_exeext'
12739   { (eval echo "$as_me:12739: \"$ac_try\"") >&5
12740   (eval $ac_try) 2>&5
12741   ac_status=$?
12742   echo "$as_me:12742: \$? = $ac_status" >&5
12743   (exit $ac_status); }; }; then
12744   eval "$as_ac_var=yes"
12745 else
12746   echo "$as_me: failed program was:" >&5
12747 cat conftest.$ac_ext >&5
12748 eval "$as_ac_var=no"
12749 fi
12750 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12751 fi
12752 echo "$as_me:12752: result: `eval echo '${'$as_ac_var'}'`" >&5
12753 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
12754 if test `eval echo '${'$as_ac_var'}'` = yes; then
12755   cat >>confdefs.h <<EOF
12756 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
12757 EOF
12758
12759 fi
12760 done
12761
12762 fi
12763
12764 echo "$as_me:12764: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
12765 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
12766 if test "${cf_cv_need_xopen_extension+set}" = set; then
12767   echo $ECHO_N "(cached) $ECHO_C" >&6
12768 else
12769
12770 cat >conftest.$ac_ext <<_ACEOF
12771 #line 12771 "configure"
12772 #include "confdefs.h"
12773
12774 #include <stdlib.h>
12775 #include <${cf_cv_ncurses_header:-curses.h}>
12776 int
12777 main ()
12778 {
12779
12780 #if defined(NCURSES_VERSION_PATCH)
12781 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
12782         make an error
12783 #endif
12784 #endif
12785         long x = winnstr(stdscr, "", 0);
12786         int x1, y1;
12787         getbegyx(stdscr, y1, x1)
12788   ;
12789   return 0;
12790 }
12791 _ACEOF
12792 rm -f conftest.$ac_objext conftest$ac_exeext
12793 if { (eval echo "$as_me:12793: \"$ac_link\"") >&5
12794   (eval $ac_link) 2>&5
12795   ac_status=$?
12796   echo "$as_me:12796: \$? = $ac_status" >&5
12797   (exit $ac_status); } &&
12798          { ac_try='test -s conftest$ac_exeext'
12799   { (eval echo "$as_me:12799: \"$ac_try\"") >&5
12800   (eval $ac_try) 2>&5
12801   ac_status=$?
12802   echo "$as_me:12802: \$? = $ac_status" >&5
12803   (exit $ac_status); }; }; then
12804   cf_cv_need_xopen_extension=no
12805 else
12806   echo "$as_me: failed program was:" >&5
12807 cat conftest.$ac_ext >&5
12808 cat >conftest.$ac_ext <<_ACEOF
12809 #line 12809 "configure"
12810 #include "confdefs.h"
12811
12812 #define _XOPEN_SOURCE_EXTENDED
12813 #include <stdlib.h>
12814 #include <${cf_cv_ncurses_header:-curses.h}>
12815 int
12816 main ()
12817 {
12818
12819 #ifdef NCURSES_VERSION
12820         cchar_t check;
12821         int check2 = curs_set((int)sizeof(check));
12822 #endif
12823         long x = winnstr(stdscr, "", 0);
12824         int x1, y1;
12825         getbegyx(stdscr, y1, x1)
12826   ;
12827   return 0;
12828 }
12829 _ACEOF
12830 rm -f conftest.$ac_objext conftest$ac_exeext
12831 if { (eval echo "$as_me:12831: \"$ac_link\"") >&5
12832   (eval $ac_link) 2>&5
12833   ac_status=$?
12834   echo "$as_me:12834: \$? = $ac_status" >&5
12835   (exit $ac_status); } &&
12836          { ac_try='test -s conftest$ac_exeext'
12837   { (eval echo "$as_me:12837: \"$ac_try\"") >&5
12838   (eval $ac_try) 2>&5
12839   ac_status=$?
12840   echo "$as_me:12840: \$? = $ac_status" >&5
12841   (exit $ac_status); }; }; then
12842   cf_cv_need_xopen_extension=yes
12843 else
12844   echo "$as_me: failed program was:" >&5
12845 cat conftest.$ac_ext >&5
12846 cf_cv_need_xopen_extension=unknown
12847 fi
12848 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12849 fi
12850 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12851 fi
12852 echo "$as_me:12852: result: $cf_cv_need_xopen_extension" >&5
12853 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
12854 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
12855
12856 echo "$as_me:12856: checking for term.h" >&5
12857 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
12858 if test "${cf_cv_term_header+set}" = set; then
12859   echo $ECHO_N "(cached) $ECHO_C" >&6
12860 else
12861
12862 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
12863 # for <term.h> if we do not find the variant.
12864
12865 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
12866
12867 case ${cf_cv_ncurses_header:-curses.h} in #(vi
12868 */*)
12869         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
12870         cf_header_list="$cf_header_item $cf_header_list"
12871         ;;
12872 esac
12873
12874 for cf_header in $cf_header_list
12875 do
12876         cat >conftest.$ac_ext <<_ACEOF
12877 #line 12877 "configure"
12878 #include "confdefs.h"
12879
12880 #include <${cf_cv_ncurses_header:-curses.h}>
12881 #include <${cf_header}>
12882 int
12883 main ()
12884 {
12885 WINDOW *x
12886   ;
12887   return 0;
12888 }
12889 _ACEOF
12890 rm -f conftest.$ac_objext
12891 if { (eval echo "$as_me:12891: \"$ac_compile\"") >&5
12892   (eval $ac_compile) 2>&5
12893   ac_status=$?
12894   echo "$as_me:12894: \$? = $ac_status" >&5
12895   (exit $ac_status); } &&
12896          { ac_try='test -s conftest.$ac_objext'
12897   { (eval echo "$as_me:12897: \"$ac_try\"") >&5
12898   (eval $ac_try) 2>&5
12899   ac_status=$?
12900   echo "$as_me:12900: \$? = $ac_status" >&5
12901   (exit $ac_status); }; }; then
12902   cf_cv_term_header=$cf_header
12903          break
12904 else
12905   echo "$as_me: failed program was:" >&5
12906 cat conftest.$ac_ext >&5
12907 cf_cv_term_header=no
12908 fi
12909 rm -f conftest.$ac_objext conftest.$ac_ext
12910 done
12911
12912 case $cf_cv_term_header in #(vi
12913 no)
12914         # If curses is ncurses, some packagers still mess it up by trying to make
12915         # us use GNU termcap.  This handles the most common case.
12916         for cf_header in ncurses/term.h ncursesw/term.h
12917         do
12918                 cat >conftest.$ac_ext <<_ACEOF
12919 #line 12919 "configure"
12920 #include "confdefs.h"
12921
12922 #include <${cf_cv_ncurses_header:-curses.h}>
12923 #ifdef NCURSES_VERSION
12924 #include <${cf_header}>
12925 #else
12926 make an error
12927 #endif
12928 int
12929 main ()
12930 {
12931 WINDOW *x
12932   ;
12933   return 0;
12934 }
12935 _ACEOF
12936 rm -f conftest.$ac_objext
12937 if { (eval echo "$as_me:12937: \"$ac_compile\"") >&5
12938   (eval $ac_compile) 2>&5
12939   ac_status=$?
12940   echo "$as_me:12940: \$? = $ac_status" >&5
12941   (exit $ac_status); } &&
12942          { ac_try='test -s conftest.$ac_objext'
12943   { (eval echo "$as_me:12943: \"$ac_try\"") >&5
12944   (eval $ac_try) 2>&5
12945   ac_status=$?
12946   echo "$as_me:12946: \$? = $ac_status" >&5
12947   (exit $ac_status); }; }; then
12948   cf_cv_term_header=$cf_header
12949                          break
12950 else
12951   echo "$as_me: failed program was:" >&5
12952 cat conftest.$ac_ext >&5
12953 cf_cv_term_header=no
12954 fi
12955 rm -f conftest.$ac_objext conftest.$ac_ext
12956         done
12957         ;;
12958 esac
12959
12960 fi
12961 echo "$as_me:12961: result: $cf_cv_term_header" >&5
12962 echo "${ECHO_T}$cf_cv_term_header" >&6
12963
12964 case $cf_cv_term_header in #(vi
12965 term.h) #(vi
12966
12967 cat >>confdefs.h <<\EOF
12968 #define HAVE_TERM_H 1
12969 EOF
12970
12971         ;;
12972 ncurses/term.h) #(vi
12973
12974 cat >>confdefs.h <<\EOF
12975 #define HAVE_NCURSES_TERM_H 1
12976 EOF
12977
12978         ;;
12979 ncursesw/term.h)
12980
12981 cat >>confdefs.h <<\EOF
12982 #define HAVE_NCURSESW_TERM_H 1
12983 EOF
12984
12985         ;;
12986 esac
12987
12988 echo "$as_me:12988: checking for unctrl.h" >&5
12989 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
12990 if test "${cf_cv_unctrl_header+set}" = set; then
12991   echo $ECHO_N "(cached) $ECHO_C" >&6
12992 else
12993
12994 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
12995 # for <unctrl.h> if we do not find the variant.
12996
12997 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
12998
12999 case ${cf_cv_ncurses_header:-curses.h} in #(vi
13000 */*)
13001         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
13002         cf_header_list="$cf_header_item $cf_header_list"
13003         ;;
13004 esac
13005
13006 for cf_header in $cf_header_list
13007 do
13008         cat >conftest.$ac_ext <<_ACEOF
13009 #line 13009 "configure"
13010 #include "confdefs.h"
13011
13012 #include <${cf_cv_ncurses_header:-curses.h}>
13013 #include <${cf_header}>
13014 int
13015 main ()
13016 {
13017 WINDOW *x
13018   ;
13019   return 0;
13020 }
13021 _ACEOF
13022 rm -f conftest.$ac_objext
13023 if { (eval echo "$as_me:13023: \"$ac_compile\"") >&5
13024   (eval $ac_compile) 2>&5
13025   ac_status=$?
13026   echo "$as_me:13026: \$? = $ac_status" >&5
13027   (exit $ac_status); } &&
13028          { ac_try='test -s conftest.$ac_objext'
13029   { (eval echo "$as_me:13029: \"$ac_try\"") >&5
13030   (eval $ac_try) 2>&5
13031   ac_status=$?
13032   echo "$as_me:13032: \$? = $ac_status" >&5
13033   (exit $ac_status); }; }; then
13034   cf_cv_unctrl_header=$cf_header
13035          break
13036 else
13037   echo "$as_me: failed program was:" >&5
13038 cat conftest.$ac_ext >&5
13039 cf_cv_unctrl_header=no
13040 fi
13041 rm -f conftest.$ac_objext conftest.$ac_ext
13042 done
13043
13044 case $cf_cv_unctrl_header in #(vi
13045 no)
13046         { echo "$as_me:13046: WARNING: unctrl.h header not found" >&5
13047 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
13048         ;;
13049 esac
13050
13051 fi
13052 echo "$as_me:13052: result: $cf_cv_unctrl_header" >&5
13053 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
13054
13055 case $cf_cv_unctrl_header in #(vi
13056 unctrl.h) #(vi
13057
13058 cat >>confdefs.h <<\EOF
13059 #define HAVE_UNCTRL_H 1
13060 EOF
13061
13062         ;;
13063 ncurses/unctrl.h) #(vi
13064
13065 cat >>confdefs.h <<\EOF
13066 #define HAVE_NCURSES_UNCTRL_H 1
13067 EOF
13068
13069         ;;
13070 ncursesw/unctrl.h)
13071
13072 cat >>confdefs.h <<\EOF
13073 #define HAVE_NCURSESW_UNCTRL_H 1
13074 EOF
13075
13076         ;;
13077 esac
13078
13079 for cf_func in \
13080 assume_default_colors \
13081 chgat \
13082 color_set \
13083 filter \
13084 getbegx \
13085 getcurx \
13086 getmaxx \
13087 getnstr \
13088 getparx \
13089 getwin \
13090 mvvline \
13091 mvwvline \
13092 napms \
13093 putwin \
13094 resize_term \
13095 resizeterm \
13096 ripoffline \
13097 scr_dump \
13098 setupterm \
13099 slk_color \
13100 slk_init \
13101 termattrs \
13102 tgetent \
13103 tigetnum \
13104 tigetstr \
13105 typeahead \
13106 use_default_colors \
13107 use_screen \
13108 use_window \
13109 vsscanf \
13110 vw_printw \
13111 wchgat \
13112 winsstr \
13113 wresize \
13114 wsyncdown \
13115
13116 do
13117
13118 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13119
13120         echo "$as_me:13120: checking for ${cf_func}" >&5
13121 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
13122
13123 echo "${as_me:-configure}:13123: testing ${cf_func} ..." 1>&5
13124
13125         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
13126   echo $ECHO_N "(cached) $ECHO_C" >&6
13127 else
13128
13129                 eval cf_result='$ac_cv_func_'$cf_func
13130                 if test ".$cf_result" != ".no"; then
13131                         cat >conftest.$ac_ext <<_ACEOF
13132 #line 13132 "configure"
13133 #include "confdefs.h"
13134
13135 #ifdef HAVE_XCURSES
13136 #include <xcurses.h>
13137 char * XCursesProgramName = "test";
13138 #else
13139 #include <${cf_cv_ncurses_header:-curses.h}>
13140 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13141 #include <ncursesw/term.h>
13142 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13143 #include <ncurses/term.h>
13144 #elif defined(HAVE_TERM_H)
13145 #include <term.h>
13146 #endif
13147 #endif
13148
13149 int
13150 main ()
13151 {
13152
13153 #ifndef ${cf_func}
13154 long foo = (long)(&${cf_func});
13155 if (foo + 1234 > 5678)
13156         ${cf_cv_main_return:-return}(foo);
13157 #endif
13158
13159   ;
13160   return 0;
13161 }
13162 _ACEOF
13163 rm -f conftest.$ac_objext conftest$ac_exeext
13164 if { (eval echo "$as_me:13164: \"$ac_link\"") >&5
13165   (eval $ac_link) 2>&5
13166   ac_status=$?
13167   echo "$as_me:13167: \$? = $ac_status" >&5
13168   (exit $ac_status); } &&
13169          { ac_try='test -s conftest$ac_exeext'
13170   { (eval echo "$as_me:13170: \"$ac_try\"") >&5
13171   (eval $ac_try) 2>&5
13172   ac_status=$?
13173   echo "$as_me:13173: \$? = $ac_status" >&5
13174   (exit $ac_status); }; }; then
13175   cf_result=yes
13176 else
13177   echo "$as_me: failed program was:" >&5
13178 cat conftest.$ac_ext >&5
13179 cf_result=no
13180 fi
13181 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13182                 fi
13183                 eval 'cf_cv_func_'$cf_func'=$cf_result'
13184
13185 fi
13186
13187         # use the computed/retrieved cache-value:
13188         eval 'cf_result=$cf_cv_func_'$cf_func
13189         echo "$as_me:13189: result: $cf_result" >&5
13190 echo "${ECHO_T}$cf_result" >&6
13191         if test $cf_result != no; then
13192                 cat >>confdefs.h <<EOF
13193 #define HAVE_${cf_tr_func} 1
13194 EOF
13195
13196         fi
13197 done
13198
13199 for cf_func in tputs
13200 do
13201
13202 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13203
13204         echo "$as_me:13204: checking for ${cf_func}" >&5
13205 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
13206
13207 echo "${as_me:-configure}:13207: testing ${cf_func} ..." 1>&5
13208
13209         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
13210   echo $ECHO_N "(cached) $ECHO_C" >&6
13211 else
13212
13213                 eval cf_result='$ac_cv_func_'$cf_func
13214                 if test ".$cf_result" != ".no"; then
13215                         cat >conftest.$ac_ext <<_ACEOF
13216 #line 13216 "configure"
13217 #include "confdefs.h"
13218
13219 #ifdef HAVE_XCURSES
13220 #include <xcurses.h>
13221 char * XCursesProgramName = "test";
13222 #else
13223 #include <${cf_cv_ncurses_header:-curses.h}>
13224 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13225 #include <ncursesw/term.h>
13226 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13227 #include <ncurses/term.h>
13228 #elif defined(HAVE_TERM_H)
13229 #include <term.h>
13230 #endif
13231 #endif
13232
13233 int
13234 main ()
13235 {
13236
13237 #ifndef ${cf_func}
13238 long foo = (long)(&${cf_func});
13239 if (foo + 1234 > 5678)
13240         ${cf_cv_main_return:-return}(foo);
13241 #endif
13242
13243   ;
13244   return 0;
13245 }
13246 _ACEOF
13247 rm -f conftest.$ac_objext conftest$ac_exeext
13248 if { (eval echo "$as_me:13248: \"$ac_link\"") >&5
13249   (eval $ac_link) 2>&5
13250   ac_status=$?
13251   echo "$as_me:13251: \$? = $ac_status" >&5
13252   (exit $ac_status); } &&
13253          { ac_try='test -s conftest$ac_exeext'
13254   { (eval echo "$as_me:13254: \"$ac_try\"") >&5
13255   (eval $ac_try) 2>&5
13256   ac_status=$?
13257   echo "$as_me:13257: \$? = $ac_status" >&5
13258   (exit $ac_status); }; }; then
13259   cf_result=yes
13260 else
13261   echo "$as_me: failed program was:" >&5
13262 cat conftest.$ac_ext >&5
13263 cf_result=no
13264 fi
13265 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13266                 fi
13267                 eval 'cf_cv_func_'$cf_func'=$cf_result'
13268
13269 fi
13270
13271         # use the computed/retrieved cache-value:
13272         eval 'cf_result=$cf_cv_func_'$cf_func
13273         echo "$as_me:13273: result: $cf_result" >&5
13274 echo "${ECHO_T}$cf_result" >&6
13275         if test $cf_result != no; then
13276                 cat >>confdefs.h <<EOF
13277 #define HAVE_${cf_tr_func} 1
13278 EOF
13279
13280         fi
13281 done
13282
13283 if test x$cf_cv_func_tputs = xyes
13284 then
13285         cf_done=no
13286         for cf_arg in int char
13287         do
13288                 for cf_ret in int void
13289                 do
13290                         if test $cf_ret = void
13291                         then
13292                                 cf_return="/* nothing */"
13293                         else
13294                                 cf_return="return value"
13295                         fi
13296                         cat >conftest.$ac_ext <<_ACEOF
13297 #line 13297 "configure"
13298 #include "confdefs.h"
13299
13300 #include <${cf_cv_ncurses_header:-curses.h}>
13301 #include <$cf_cv_term_header>
13302
13303 static $cf_ret outc($cf_arg value) { $cf_return; }
13304
13305 int
13306 main ()
13307 {
13308
13309         tputs("hello", 0, outc);
13310         ${cf_cv_main_return:-return}(0);
13311
13312   ;
13313   return 0;
13314 }
13315 _ACEOF
13316 rm -f conftest.$ac_objext
13317 if { (eval echo "$as_me:13317: \"$ac_compile\"") >&5
13318   (eval $ac_compile) 2>&5
13319   ac_status=$?
13320   echo "$as_me:13320: \$? = $ac_status" >&5
13321   (exit $ac_status); } &&
13322          { ac_try='test -s conftest.$ac_objext'
13323   { (eval echo "$as_me:13323: \"$ac_try\"") >&5
13324   (eval $ac_try) 2>&5
13325   ac_status=$?
13326   echo "$as_me:13326: \$? = $ac_status" >&5
13327   (exit $ac_status); }; }; then
13328
13329                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
13330
13331 echo "${as_me:-configure}:13331: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
13332
13333                 cat >>confdefs.h <<EOF
13334 #define TPUTS_ARG               $cf_arg
13335 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
13336 #define TPUTS_RETURN(value)     $cf_return
13337 EOF
13338                 cf_done=yes
13339                 break
13340
13341 else
13342   echo "$as_me: failed program was:" >&5
13343 cat conftest.$ac_ext >&5
13344 fi
13345 rm -f conftest.$ac_objext conftest.$ac_ext
13346                 done
13347                 test $cf_done = yes && break
13348         done
13349 fi
13350
13351 echo "$as_me:13351: checking for ncurses extended functions" >&5
13352 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
13353 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
13354   echo $ECHO_N "(cached) $ECHO_C" >&6
13355 else
13356
13357 cat >conftest.$ac_ext <<_ACEOF
13358 #line 13358 "configure"
13359 #include "confdefs.h"
13360
13361 #include <${cf_cv_ncurses_header:-curses.h}>
13362 int
13363 main ()
13364 {
13365
13366 int x = NCURSES_EXT_FUNCS
13367
13368   ;
13369   return 0;
13370 }
13371 _ACEOF
13372 rm -f conftest.$ac_objext
13373 if { (eval echo "$as_me:13373: \"$ac_compile\"") >&5
13374   (eval $ac_compile) 2>&5
13375   ac_status=$?
13376   echo "$as_me:13376: \$? = $ac_status" >&5
13377   (exit $ac_status); } &&
13378          { ac_try='test -s conftest.$ac_objext'
13379   { (eval echo "$as_me:13379: \"$ac_try\"") >&5
13380   (eval $ac_try) 2>&5
13381   ac_status=$?
13382   echo "$as_me:13382: \$? = $ac_status" >&5
13383   (exit $ac_status); }; }; then
13384   cf_cv_ncurses_ext_funcs=defined
13385 else
13386   echo "$as_me: failed program was:" >&5
13387 cat conftest.$ac_ext >&5
13388
13389 cat >conftest.$ac_ext <<_ACEOF
13390 #line 13390 "configure"
13391 #include "confdefs.h"
13392
13393 #include <${cf_cv_ncurses_header:-curses.h}>
13394 int
13395 main ()
13396 {
13397
13398         (void) assume_default_colors (0, 0);
13399         (void) curses_version ();
13400         (void) define_key (0, 0);
13401         (void) is_term_resized (0, 0);
13402         (void) key_defined (0);
13403         (void) keybound (0, 0);
13404         (void) keyok (0, 0);
13405         (void) resize_term (0, 0);
13406         (void) resizeterm (0, 0);
13407         (void) use_default_colors ();
13408         (void) use_extended_names (0);
13409         (void) wresize (0, 0, 0);
13410   ;
13411   return 0;
13412 }
13413 _ACEOF
13414 rm -f conftest.$ac_objext conftest$ac_exeext
13415 if { (eval echo "$as_me:13415: \"$ac_link\"") >&5
13416   (eval $ac_link) 2>&5
13417   ac_status=$?
13418   echo "$as_me:13418: \$? = $ac_status" >&5
13419   (exit $ac_status); } &&
13420          { ac_try='test -s conftest$ac_exeext'
13421   { (eval echo "$as_me:13421: \"$ac_try\"") >&5
13422   (eval $ac_try) 2>&5
13423   ac_status=$?
13424   echo "$as_me:13424: \$? = $ac_status" >&5
13425   (exit $ac_status); }; }; then
13426   cf_cv_ncurses_ext_funcs=yes
13427 else
13428   echo "$as_me: failed program was:" >&5
13429 cat conftest.$ac_ext >&5
13430 cf_cv_ncurses_ext_funcs=no
13431 fi
13432 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13433
13434 fi
13435 rm -f conftest.$ac_objext conftest.$ac_ext
13436
13437 fi
13438 echo "$as_me:13438: result: $cf_cv_ncurses_ext_funcs" >&5
13439 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
13440 test "$cf_cv_ncurses_ext_funcs" = yes &&
13441 cat >>confdefs.h <<\EOF
13442 #define NCURSES_EXT_FUNCS 1
13443 EOF
13444
13445 if test "$cf_enable_widec" = yes
13446 then
13447         # workaround for systems with ncurses before 20111029, due to change of
13448         # feature test macro from _XPG5 to _XOPEN_SOURCE
13449         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
13450         then
13451                 cf_define_xpg5=no
13452                 echo "$as_me:13452: checking if _XPG5 should be defined to enable wide-characters" >&5
13453 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
13454
13455                 cat >conftest.$ac_ext <<_ACEOF
13456 #line 13456 "configure"
13457 #include "confdefs.h"
13458
13459 #include <${cf_cv_ncurses_header:-curses.h}>
13460 int
13461 main ()
13462 {
13463 int x = _XPG5
13464   ;
13465   return 0;
13466 }
13467 _ACEOF
13468 rm -f conftest.$ac_objext
13469 if { (eval echo "$as_me:13469: \"$ac_compile\"") >&5
13470   (eval $ac_compile) 2>&5
13471   ac_status=$?
13472   echo "$as_me:13472: \$? = $ac_status" >&5
13473   (exit $ac_status); } &&
13474          { ac_try='test -s conftest.$ac_objext'
13475   { (eval echo "$as_me:13475: \"$ac_try\"") >&5
13476   (eval $ac_try) 2>&5
13477   ac_status=$?
13478   echo "$as_me:13478: \$? = $ac_status" >&5
13479   (exit $ac_status); }; }; then
13480   :
13481 else
13482   echo "$as_me: failed program was:" >&5
13483 cat conftest.$ac_ext >&5
13484 cf_save_cppflags="$CPPFLAGS"
13485                          CPPFLAGS="$CPPFLAGS -D_XPG5"
13486                          cat >conftest.$ac_ext <<_ACEOF
13487 #line 13487 "configure"
13488 #include "confdefs.h"
13489
13490 #include <${cf_cv_ncurses_header:-curses.h}>
13491 int
13492 main ()
13493 {
13494 int x = _XPG5
13495   ;
13496   return 0;
13497 }
13498 _ACEOF
13499 rm -f conftest.$ac_objext
13500 if { (eval echo "$as_me:13500: \"$ac_compile\"") >&5
13501   (eval $ac_compile) 2>&5
13502   ac_status=$?
13503   echo "$as_me:13503: \$? = $ac_status" >&5
13504   (exit $ac_status); } &&
13505          { ac_try='test -s conftest.$ac_objext'
13506   { (eval echo "$as_me:13506: \"$ac_try\"") >&5
13507   (eval $ac_try) 2>&5
13508   ac_status=$?
13509   echo "$as_me:13509: \$? = $ac_status" >&5
13510   (exit $ac_status); }; }; then
13511   cf_define_xpg5=yes
13512 else
13513   echo "$as_me: failed program was:" >&5
13514 cat conftest.$ac_ext >&5
13515 fi
13516 rm -f conftest.$ac_objext conftest.$ac_ext
13517                          CPPFLAGS="$cf_save_cppflags"
13518 fi
13519 rm -f conftest.$ac_objext conftest.$ac_ext
13520                 echo "$as_me:13520: result: $cf_define_xpg5" >&5
13521 echo "${ECHO_T}$cf_define_xpg5" >&6
13522
13523                 if test "$cf_define_xpg5" = yes
13524                 then
13525                         CPPFLAGS="$CPPFLAGS -D_XPG5"
13526                 fi
13527         fi
13528
13529         echo "$as_me:13529: checking for wide-character functions" >&5
13530 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
13531 if test "${cf_cv_widechar_funcs+set}" = set; then
13532   echo $ECHO_N "(cached) $ECHO_C" >&6
13533 else
13534
13535         cat >conftest.$ac_ext <<_ACEOF
13536 #line 13536 "configure"
13537 #include "confdefs.h"
13538
13539 #include <${cf_cv_ncurses_header:-curses.h}>
13540 int
13541 main ()
13542 {
13543
13544                 static wchar_t src_wchar[2];
13545                 static cchar_t dst_cchar;
13546                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
13547
13548   ;
13549   return 0;
13550 }
13551 _ACEOF
13552 rm -f conftest.$ac_objext conftest$ac_exeext
13553 if { (eval echo "$as_me:13553: \"$ac_link\"") >&5
13554   (eval $ac_link) 2>&5
13555   ac_status=$?
13556   echo "$as_me:13556: \$? = $ac_status" >&5
13557   (exit $ac_status); } &&
13558          { ac_try='test -s conftest$ac_exeext'
13559   { (eval echo "$as_me:13559: \"$ac_try\"") >&5
13560   (eval $ac_try) 2>&5
13561   ac_status=$?
13562   echo "$as_me:13562: \$? = $ac_status" >&5
13563   (exit $ac_status); }; }; then
13564   cf_cv_widechar_funcs=yes
13565 else
13566   echo "$as_me: failed program was:" >&5
13567 cat conftest.$ac_ext >&5
13568 cf_cv_widechar_funcs=no
13569 fi
13570 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13571
13572 fi
13573 echo "$as_me:13573: result: $cf_cv_widechar_funcs" >&5
13574 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
13575         if test "$cf_cv_widechar_funcs" != no ; then
13576
13577 cat >>confdefs.h <<\EOF
13578 #define USE_WIDEC_SUPPORT 1
13579 EOF
13580
13581         else
13582                 cat >>confdefs.h <<\EOF
13583 #define USE_WIDEC_SUPPORT 0
13584 EOF
13585
13586         fi
13587 else
13588         cat >>confdefs.h <<\EOF
13589 #define USE_WIDEC_SUPPORT 0
13590 EOF
13591
13592 fi
13593
13594 echo "$as_me:13594: checking if sys/time.h works with sys/select.h" >&5
13595 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
13596 if test "${cf_cv_sys_time_select+set}" = set; then
13597   echo $ECHO_N "(cached) $ECHO_C" >&6
13598 else
13599
13600 cat >conftest.$ac_ext <<_ACEOF
13601 #line 13601 "configure"
13602 #include "confdefs.h"
13603
13604 #include <sys/types.h>
13605 #ifdef HAVE_SYS_TIME_H
13606 #include <sys/time.h>
13607 #endif
13608 #ifdef HAVE_SYS_SELECT_H
13609 #include <sys/select.h>
13610 #endif
13611
13612 int
13613 main ()
13614 {
13615
13616   ;
13617   return 0;
13618 }
13619 _ACEOF
13620 rm -f conftest.$ac_objext
13621 if { (eval echo "$as_me:13621: \"$ac_compile\"") >&5
13622   (eval $ac_compile) 2>&5
13623   ac_status=$?
13624   echo "$as_me:13624: \$? = $ac_status" >&5
13625   (exit $ac_status); } &&
13626          { ac_try='test -s conftest.$ac_objext'
13627   { (eval echo "$as_me:13627: \"$ac_try\"") >&5
13628   (eval $ac_try) 2>&5
13629   ac_status=$?
13630   echo "$as_me:13630: \$? = $ac_status" >&5
13631   (exit $ac_status); }; }; then
13632   cf_cv_sys_time_select=yes
13633 else
13634   echo "$as_me: failed program was:" >&5
13635 cat conftest.$ac_ext >&5
13636 cf_cv_sys_time_select=no
13637 fi
13638 rm -f conftest.$ac_objext conftest.$ac_ext
13639
13640 fi
13641
13642 echo "$as_me:13642: result: $cf_cv_sys_time_select" >&5
13643 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
13644 test "$cf_cv_sys_time_select" = yes &&
13645 cat >>confdefs.h <<\EOF
13646 #define HAVE_SYS_TIME_SELECT 1
13647 EOF
13648
13649 echo "$as_me:13649: checking for function curses_version" >&5
13650 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
13651 if test "${cf_cv_func_curses_version+set}" = set; then
13652   echo $ECHO_N "(cached) $ECHO_C" >&6
13653 else
13654
13655 if test "$cross_compiling" = yes; then
13656   cf_cv_func_curses_version=unknown
13657 else
13658   cat >conftest.$ac_ext <<_ACEOF
13659 #line 13659 "configure"
13660 #include "confdefs.h"
13661
13662 #include <${cf_cv_ncurses_header:-curses.h}>
13663 int main()
13664 {
13665         char temp[1024];
13666         sprintf(temp, "%s\n", curses_version());
13667         ${cf_cv_main_return:-return}(0);
13668 }
13669
13670 _ACEOF
13671 rm -f conftest$ac_exeext
13672 if { (eval echo "$as_me:13672: \"$ac_link\"") >&5
13673   (eval $ac_link) 2>&5
13674   ac_status=$?
13675   echo "$as_me:13675: \$? = $ac_status" >&5
13676   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13677   { (eval echo "$as_me:13677: \"$ac_try\"") >&5
13678   (eval $ac_try) 2>&5
13679   ac_status=$?
13680   echo "$as_me:13680: \$? = $ac_status" >&5
13681   (exit $ac_status); }; }; then
13682   cf_cv_func_curses_version=yes
13683
13684 else
13685   echo "$as_me: program exited with status $ac_status" >&5
13686 echo "$as_me: failed program was:" >&5
13687 cat conftest.$ac_ext >&5
13688 cf_cv_func_curses_version=no
13689
13690 fi
13691 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13692 fi
13693 rm -f core
13694 fi
13695 echo "$as_me:13695: result: $cf_cv_func_curses_version" >&5
13696 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
13697 test "$cf_cv_func_curses_version" = yes &&
13698 cat >>confdefs.h <<\EOF
13699 #define HAVE_CURSES_VERSION 1
13700 EOF
13701
13702 echo "$as_me:13702: checking for alternate character set array" >&5
13703 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
13704 if test "${cf_cv_curses_acs_map+set}" = set; then
13705   echo $ECHO_N "(cached) $ECHO_C" >&6
13706 else
13707
13708 cf_cv_curses_acs_map=unknown
13709 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
13710 do
13711 cat >conftest.$ac_ext <<_ACEOF
13712 #line 13712 "configure"
13713 #include "confdefs.h"
13714
13715 #include <${cf_cv_ncurses_header:-curses.h}>
13716
13717 int
13718 main ()
13719 {
13720
13721 $name['k'] = ACS_PLUS
13722
13723   ;
13724   return 0;
13725 }
13726 _ACEOF
13727 rm -f conftest.$ac_objext conftest$ac_exeext
13728 if { (eval echo "$as_me:13728: \"$ac_link\"") >&5
13729   (eval $ac_link) 2>&5
13730   ac_status=$?
13731   echo "$as_me:13731: \$? = $ac_status" >&5
13732   (exit $ac_status); } &&
13733          { ac_try='test -s conftest$ac_exeext'
13734   { (eval echo "$as_me:13734: \"$ac_try\"") >&5
13735   (eval $ac_try) 2>&5
13736   ac_status=$?
13737   echo "$as_me:13737: \$? = $ac_status" >&5
13738   (exit $ac_status); }; }; then
13739   cf_cv_curses_acs_map=$name; break
13740 else
13741   echo "$as_me: failed program was:" >&5
13742 cat conftest.$ac_ext >&5
13743 fi
13744 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13745 done
13746
13747 fi
13748 echo "$as_me:13748: result: $cf_cv_curses_acs_map" >&5
13749 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
13750
13751 test "$cf_cv_curses_acs_map" != unknown &&
13752 cat >>confdefs.h <<EOF
13753 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
13754 EOF
13755
13756 if test "$cf_enable_widec" = yes; then
13757
13758 echo "$as_me:13758: checking for wide alternate character set array" >&5
13759 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
13760 if test "${cf_cv_curses_wacs_map+set}" = set; then
13761   echo $ECHO_N "(cached) $ECHO_C" >&6
13762 else
13763
13764         cf_cv_curses_wacs_map=unknown
13765         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
13766         do
13767         cat >conftest.$ac_ext <<_ACEOF
13768 #line 13768 "configure"
13769 #include "confdefs.h"
13770
13771 #ifndef _XOPEN_SOURCE_EXTENDED
13772 #define _XOPEN_SOURCE_EXTENDED
13773 #endif
13774 #include <${cf_cv_ncurses_header:-curses.h}>
13775 int
13776 main ()
13777 {
13778 void *foo = &($name['k'])
13779   ;
13780   return 0;
13781 }
13782 _ACEOF
13783 rm -f conftest.$ac_objext conftest$ac_exeext
13784 if { (eval echo "$as_me:13784: \"$ac_link\"") >&5
13785   (eval $ac_link) 2>&5
13786   ac_status=$?
13787   echo "$as_me:13787: \$? = $ac_status" >&5
13788   (exit $ac_status); } &&
13789          { ac_try='test -s conftest$ac_exeext'
13790   { (eval echo "$as_me:13790: \"$ac_try\"") >&5
13791   (eval $ac_try) 2>&5
13792   ac_status=$?
13793   echo "$as_me:13793: \$? = $ac_status" >&5
13794   (exit $ac_status); }; }; then
13795   cf_cv_curses_wacs_map=$name
13796          break
13797 else
13798   echo "$as_me: failed program was:" >&5
13799 cat conftest.$ac_ext >&5
13800 fi
13801 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13802         done
13803 fi
13804 echo "$as_me:13804: result: $cf_cv_curses_wacs_map" >&5
13805 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
13806
13807 test "$cf_cv_curses_wacs_map" != unknown &&
13808 cat >>confdefs.h <<EOF
13809 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
13810 EOF
13811
13812 echo "$as_me:13812: checking for wide alternate character constants" >&5
13813 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
13814 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
13815   echo $ECHO_N "(cached) $ECHO_C" >&6
13816 else
13817
13818 cf_cv_curses_wacs_symbols=no
13819 if test "$cf_cv_curses_wacs_map" != unknown
13820 then
13821         cat >conftest.$ac_ext <<_ACEOF
13822 #line 13822 "configure"
13823 #include "confdefs.h"
13824
13825 #ifndef _XOPEN_SOURCE_EXTENDED
13826 #define _XOPEN_SOURCE_EXTENDED
13827 #endif
13828 #include <${cf_cv_ncurses_header:-curses.h}>
13829 int
13830 main ()
13831 {
13832 cchar_t *foo = WACS_PLUS;
13833          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
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_symbols=yes
13851 else
13852   echo "$as_me: failed program was:" >&5
13853 cat conftest.$ac_ext >&5
13854 fi
13855 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13856 else
13857         cat >conftest.$ac_ext <<_ACEOF
13858 #line 13858 "configure"
13859 #include "confdefs.h"
13860
13861 #ifndef _XOPEN_SOURCE_EXTENDED
13862 #define _XOPEN_SOURCE_EXTENDED
13863 #endif
13864 #include <${cf_cv_ncurses_header:-curses.h}>
13865 int
13866 main ()
13867 {
13868 cchar_t *foo = WACS_PLUS
13869   ;
13870   return 0;
13871 }
13872 _ACEOF
13873 rm -f conftest.$ac_objext conftest$ac_exeext
13874 if { (eval echo "$as_me:13874: \"$ac_link\"") >&5
13875   (eval $ac_link) 2>&5
13876   ac_status=$?
13877   echo "$as_me:13877: \$? = $ac_status" >&5
13878   (exit $ac_status); } &&
13879          { ac_try='test -s conftest$ac_exeext'
13880   { (eval echo "$as_me:13880: \"$ac_try\"") >&5
13881   (eval $ac_try) 2>&5
13882   ac_status=$?
13883   echo "$as_me:13883: \$? = $ac_status" >&5
13884   (exit $ac_status); }; }; then
13885   cf_cv_curses_wacs_symbols=yes
13886 else
13887   echo "$as_me: failed program was:" >&5
13888 cat conftest.$ac_ext >&5
13889 fi
13890 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13891 fi
13892
13893 fi
13894 echo "$as_me:13894: result: $cf_cv_curses_wacs_symbols" >&5
13895 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
13896
13897 test "$cf_cv_curses_wacs_symbols" != no &&
13898 cat >>confdefs.h <<\EOF
13899 #define CURSES_WACS_SYMBOLS 1
13900 EOF
13901
13902 fi
13903
13904 echo "$as_me:13904: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
13905 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
13906 cat >conftest.$ac_ext <<_ACEOF
13907 #line 13907 "configure"
13908 #include "confdefs.h"
13909
13910 #ifndef _XOPEN_SOURCE_EXTENDED
13911 #define _XOPEN_SOURCE_EXTENDED
13912 #endif
13913 #include <${cf_cv_ncurses_header:-curses.h}>
13914 int
13915 main ()
13916 {
13917
13918 attr_t foo
13919
13920   ;
13921   return 0;
13922 }
13923 _ACEOF
13924 rm -f conftest.$ac_objext
13925 if { (eval echo "$as_me:13925: \"$ac_compile\"") >&5
13926   (eval $ac_compile) 2>&5
13927   ac_status=$?
13928   echo "$as_me:13928: \$? = $ac_status" >&5
13929   (exit $ac_status); } &&
13930          { ac_try='test -s conftest.$ac_objext'
13931   { (eval echo "$as_me:13931: \"$ac_try\"") >&5
13932   (eval $ac_try) 2>&5
13933   ac_status=$?
13934   echo "$as_me:13934: \$? = $ac_status" >&5
13935   (exit $ac_status); }; }; then
13936   cf_result=yes
13937 else
13938   echo "$as_me: failed program was:" >&5
13939 cat conftest.$ac_ext >&5
13940 cf_result=no
13941 fi
13942 rm -f conftest.$ac_objext conftest.$ac_ext
13943 echo "$as_me:13943: result: $cf_result" >&5
13944 echo "${ECHO_T}$cf_result" >&6
13945 if test $cf_result = yes ; then
13946
13947 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13948
13949 cat >>confdefs.h <<EOF
13950 #define $cf_result 1
13951 EOF
13952
13953 else
13954
13955 cat >>confdefs.h <<EOF
13956 #define attr_t long
13957 EOF
13958
13959 fi
13960
13961 if test "$cf_enable_widec" = yes; then
13962
13963 # This is needed on Tru64 5.0 to declare mbstate_t
13964 echo "$as_me:13964: checking if we must include wchar.h to declare mbstate_t" >&5
13965 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
13966 if test "${cf_cv_mbstate_t+set}" = set; then
13967   echo $ECHO_N "(cached) $ECHO_C" >&6
13968 else
13969
13970 cat >conftest.$ac_ext <<_ACEOF
13971 #line 13971 "configure"
13972 #include "confdefs.h"
13973
13974 #include <stdlib.h>
13975 #include <stdarg.h>
13976 #include <stdio.h>
13977 #ifdef HAVE_LIBUTF8_H
13978 #include <libutf8.h>
13979 #endif
13980 int
13981 main ()
13982 {
13983 mbstate_t state
13984   ;
13985   return 0;
13986 }
13987 _ACEOF
13988 rm -f conftest.$ac_objext
13989 if { (eval echo "$as_me:13989: \"$ac_compile\"") >&5
13990   (eval $ac_compile) 2>&5
13991   ac_status=$?
13992   echo "$as_me:13992: \$? = $ac_status" >&5
13993   (exit $ac_status); } &&
13994          { ac_try='test -s conftest.$ac_objext'
13995   { (eval echo "$as_me:13995: \"$ac_try\"") >&5
13996   (eval $ac_try) 2>&5
13997   ac_status=$?
13998   echo "$as_me:13998: \$? = $ac_status" >&5
13999   (exit $ac_status); }; }; then
14000   cf_cv_mbstate_t=no
14001 else
14002   echo "$as_me: failed program was:" >&5
14003 cat conftest.$ac_ext >&5
14004 cat >conftest.$ac_ext <<_ACEOF
14005 #line 14005 "configure"
14006 #include "confdefs.h"
14007
14008 #include <stdlib.h>
14009 #include <stdarg.h>
14010 #include <stdio.h>
14011 #include <wchar.h>
14012 #ifdef HAVE_LIBUTF8_H
14013 #include <libutf8.h>
14014 #endif
14015 int
14016 main ()
14017 {
14018 mbstate_t value
14019   ;
14020   return 0;
14021 }
14022 _ACEOF
14023 rm -f conftest.$ac_objext
14024 if { (eval echo "$as_me:14024: \"$ac_compile\"") >&5
14025   (eval $ac_compile) 2>&5
14026   ac_status=$?
14027   echo "$as_me:14027: \$? = $ac_status" >&5
14028   (exit $ac_status); } &&
14029          { ac_try='test -s conftest.$ac_objext'
14030   { (eval echo "$as_me:14030: \"$ac_try\"") >&5
14031   (eval $ac_try) 2>&5
14032   ac_status=$?
14033   echo "$as_me:14033: \$? = $ac_status" >&5
14034   (exit $ac_status); }; }; then
14035   cf_cv_mbstate_t=yes
14036 else
14037   echo "$as_me: failed program was:" >&5
14038 cat conftest.$ac_ext >&5
14039 cf_cv_mbstate_t=unknown
14040 fi
14041 rm -f conftest.$ac_objext conftest.$ac_ext
14042 fi
14043 rm -f conftest.$ac_objext conftest.$ac_ext
14044 fi
14045 echo "$as_me:14045: result: $cf_cv_mbstate_t" >&5
14046 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
14047
14048 if test "$cf_cv_mbstate_t" = yes ; then
14049
14050 cat >>confdefs.h <<\EOF
14051 #define NEED_WCHAR_H 1
14052 EOF
14053
14054         NEED_WCHAR_H=1
14055 fi
14056
14057 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
14058 if test "$cf_cv_mbstate_t" = unknown ; then
14059         NCURSES_MBSTATE_T=1
14060 fi
14061
14062 # if we find mbstate_t in either place, use substitution to provide a fallback.
14063 if test "$cf_cv_mbstate_t" != unknown ; then
14064         NCURSES_OK_MBSTATE_T=1
14065 fi
14066
14067 # This is needed on Tru64 5.0 to declare wchar_t
14068 echo "$as_me:14068: checking if we must include wchar.h to declare wchar_t" >&5
14069 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
14070 if test "${cf_cv_wchar_t+set}" = set; then
14071   echo $ECHO_N "(cached) $ECHO_C" >&6
14072 else
14073
14074 cat >conftest.$ac_ext <<_ACEOF
14075 #line 14075 "configure"
14076 #include "confdefs.h"
14077
14078 #include <stdlib.h>
14079 #include <stdarg.h>
14080 #include <stdio.h>
14081 #ifdef HAVE_LIBUTF8_H
14082 #include <libutf8.h>
14083 #endif
14084 int
14085 main ()
14086 {
14087 wchar_t state
14088   ;
14089   return 0;
14090 }
14091 _ACEOF
14092 rm -f conftest.$ac_objext
14093 if { (eval echo "$as_me:14093: \"$ac_compile\"") >&5
14094   (eval $ac_compile) 2>&5
14095   ac_status=$?
14096   echo "$as_me:14096: \$? = $ac_status" >&5
14097   (exit $ac_status); } &&
14098          { ac_try='test -s conftest.$ac_objext'
14099   { (eval echo "$as_me:14099: \"$ac_try\"") >&5
14100   (eval $ac_try) 2>&5
14101   ac_status=$?
14102   echo "$as_me:14102: \$? = $ac_status" >&5
14103   (exit $ac_status); }; }; then
14104   cf_cv_wchar_t=no
14105 else
14106   echo "$as_me: failed program was:" >&5
14107 cat conftest.$ac_ext >&5
14108 cat >conftest.$ac_ext <<_ACEOF
14109 #line 14109 "configure"
14110 #include "confdefs.h"
14111
14112 #include <stdlib.h>
14113 #include <stdarg.h>
14114 #include <stdio.h>
14115 #include <wchar.h>
14116 #ifdef HAVE_LIBUTF8_H
14117 #include <libutf8.h>
14118 #endif
14119 int
14120 main ()
14121 {
14122 wchar_t value
14123   ;
14124   return 0;
14125 }
14126 _ACEOF
14127 rm -f conftest.$ac_objext
14128 if { (eval echo "$as_me:14128: \"$ac_compile\"") >&5
14129   (eval $ac_compile) 2>&5
14130   ac_status=$?
14131   echo "$as_me:14131: \$? = $ac_status" >&5
14132   (exit $ac_status); } &&
14133          { ac_try='test -s conftest.$ac_objext'
14134   { (eval echo "$as_me:14134: \"$ac_try\"") >&5
14135   (eval $ac_try) 2>&5
14136   ac_status=$?
14137   echo "$as_me:14137: \$? = $ac_status" >&5
14138   (exit $ac_status); }; }; then
14139   cf_cv_wchar_t=yes
14140 else
14141   echo "$as_me: failed program was:" >&5
14142 cat conftest.$ac_ext >&5
14143 cf_cv_wchar_t=unknown
14144 fi
14145 rm -f conftest.$ac_objext conftest.$ac_ext
14146 fi
14147 rm -f conftest.$ac_objext conftest.$ac_ext
14148 fi
14149 echo "$as_me:14149: result: $cf_cv_wchar_t" >&5
14150 echo "${ECHO_T}$cf_cv_wchar_t" >&6
14151
14152 if test "$cf_cv_wchar_t" = yes ; then
14153
14154 cat >>confdefs.h <<\EOF
14155 #define NEED_WCHAR_H 1
14156 EOF
14157
14158         NEED_WCHAR_H=1
14159 fi
14160
14161 # if we do not find wchar_t in either place, use substitution to provide a fallback.
14162 if test "$cf_cv_wchar_t" = unknown ; then
14163         NCURSES_WCHAR_T=1
14164 fi
14165
14166 # if we find wchar_t in either place, use substitution to provide a fallback.
14167 if test "$cf_cv_wchar_t" != unknown ; then
14168         NCURSES_OK_WCHAR_T=1
14169 fi
14170
14171 # This is needed on Tru64 5.0 to declare wint_t
14172 echo "$as_me:14172: checking if we must include wchar.h to declare wint_t" >&5
14173 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
14174 if test "${cf_cv_wint_t+set}" = set; then
14175   echo $ECHO_N "(cached) $ECHO_C" >&6
14176 else
14177
14178 cat >conftest.$ac_ext <<_ACEOF
14179 #line 14179 "configure"
14180 #include "confdefs.h"
14181
14182 #include <stdlib.h>
14183 #include <stdarg.h>
14184 #include <stdio.h>
14185 #ifdef HAVE_LIBUTF8_H
14186 #include <libutf8.h>
14187 #endif
14188 int
14189 main ()
14190 {
14191 wint_t state
14192   ;
14193   return 0;
14194 }
14195 _ACEOF
14196 rm -f conftest.$ac_objext
14197 if { (eval echo "$as_me:14197: \"$ac_compile\"") >&5
14198   (eval $ac_compile) 2>&5
14199   ac_status=$?
14200   echo "$as_me:14200: \$? = $ac_status" >&5
14201   (exit $ac_status); } &&
14202          { ac_try='test -s conftest.$ac_objext'
14203   { (eval echo "$as_me:14203: \"$ac_try\"") >&5
14204   (eval $ac_try) 2>&5
14205   ac_status=$?
14206   echo "$as_me:14206: \$? = $ac_status" >&5
14207   (exit $ac_status); }; }; then
14208   cf_cv_wint_t=no
14209 else
14210   echo "$as_me: failed program was:" >&5
14211 cat conftest.$ac_ext >&5
14212 cat >conftest.$ac_ext <<_ACEOF
14213 #line 14213 "configure"
14214 #include "confdefs.h"
14215
14216 #include <stdlib.h>
14217 #include <stdarg.h>
14218 #include <stdio.h>
14219 #include <wchar.h>
14220 #ifdef HAVE_LIBUTF8_H
14221 #include <libutf8.h>
14222 #endif
14223 int
14224 main ()
14225 {
14226 wint_t value
14227   ;
14228   return 0;
14229 }
14230 _ACEOF
14231 rm -f conftest.$ac_objext
14232 if { (eval echo "$as_me:14232: \"$ac_compile\"") >&5
14233   (eval $ac_compile) 2>&5
14234   ac_status=$?
14235   echo "$as_me:14235: \$? = $ac_status" >&5
14236   (exit $ac_status); } &&
14237          { ac_try='test -s conftest.$ac_objext'
14238   { (eval echo "$as_me:14238: \"$ac_try\"") >&5
14239   (eval $ac_try) 2>&5
14240   ac_status=$?
14241   echo "$as_me:14241: \$? = $ac_status" >&5
14242   (exit $ac_status); }; }; then
14243   cf_cv_wint_t=yes
14244 else
14245   echo "$as_me: failed program was:" >&5
14246 cat conftest.$ac_ext >&5
14247 cf_cv_wint_t=unknown
14248 fi
14249 rm -f conftest.$ac_objext conftest.$ac_ext
14250 fi
14251 rm -f conftest.$ac_objext conftest.$ac_ext
14252 fi
14253 echo "$as_me:14253: result: $cf_cv_wint_t" >&5
14254 echo "${ECHO_T}$cf_cv_wint_t" >&6
14255
14256 if test "$cf_cv_wint_t" = yes ; then
14257
14258 cat >>confdefs.h <<\EOF
14259 #define NEED_WCHAR_H 1
14260 EOF
14261
14262         NEED_WCHAR_H=1
14263 fi
14264
14265 # if we do not find wint_t in either place, use substitution to provide a fallback.
14266 if test "$cf_cv_wint_t" = unknown ; then
14267         NCURSES_WINT_T=1
14268 fi
14269
14270 # if we find wint_t in either place, use substitution to provide a fallback.
14271 if test "$cf_cv_wint_t" != unknown ; then
14272         NCURSES_OK_WINT_T=1
14273 fi
14274
14275         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
14276
14277 echo "$as_me:14277: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14278 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14279 cat >conftest.$ac_ext <<_ACEOF
14280 #line 14280 "configure"
14281 #include "confdefs.h"
14282
14283 #ifndef _XOPEN_SOURCE_EXTENDED
14284 #define _XOPEN_SOURCE_EXTENDED
14285 #endif
14286 #include <${cf_cv_ncurses_header:-curses.h}>
14287 int
14288 main ()
14289 {
14290
14291 mbstate_t foo
14292
14293   ;
14294   return 0;
14295 }
14296 _ACEOF
14297 rm -f conftest.$ac_objext
14298 if { (eval echo "$as_me:14298: \"$ac_compile\"") >&5
14299   (eval $ac_compile) 2>&5
14300   ac_status=$?
14301   echo "$as_me:14301: \$? = $ac_status" >&5
14302   (exit $ac_status); } &&
14303          { ac_try='test -s conftest.$ac_objext'
14304   { (eval echo "$as_me:14304: \"$ac_try\"") >&5
14305   (eval $ac_try) 2>&5
14306   ac_status=$?
14307   echo "$as_me:14307: \$? = $ac_status" >&5
14308   (exit $ac_status); }; }; then
14309   cf_result=yes
14310 else
14311   echo "$as_me: failed program was:" >&5
14312 cat conftest.$ac_ext >&5
14313 cf_result=no
14314 fi
14315 rm -f conftest.$ac_objext conftest.$ac_ext
14316 echo "$as_me:14316: result: $cf_result" >&5
14317 echo "${ECHO_T}$cf_result" >&6
14318 if test $cf_result = yes ; then
14319
14320 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14321
14322 cat >>confdefs.h <<EOF
14323 #define $cf_result 1
14324 EOF
14325
14326 else
14327
14328 cat >>confdefs.h <<EOF
14329 #define mbstate_t long
14330 EOF
14331
14332 fi
14333
14334         fi
14335
14336         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
14337
14338 echo "$as_me:14338: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14339 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14340 cat >conftest.$ac_ext <<_ACEOF
14341 #line 14341 "configure"
14342 #include "confdefs.h"
14343
14344 #ifndef _XOPEN_SOURCE_EXTENDED
14345 #define _XOPEN_SOURCE_EXTENDED
14346 #endif
14347 #include <${cf_cv_ncurses_header:-curses.h}>
14348 int
14349 main ()
14350 {
14351
14352 wchar_t foo
14353
14354   ;
14355   return 0;
14356 }
14357 _ACEOF
14358 rm -f conftest.$ac_objext
14359 if { (eval echo "$as_me:14359: \"$ac_compile\"") >&5
14360   (eval $ac_compile) 2>&5
14361   ac_status=$?
14362   echo "$as_me:14362: \$? = $ac_status" >&5
14363   (exit $ac_status); } &&
14364          { ac_try='test -s conftest.$ac_objext'
14365   { (eval echo "$as_me:14365: \"$ac_try\"") >&5
14366   (eval $ac_try) 2>&5
14367   ac_status=$?
14368   echo "$as_me:14368: \$? = $ac_status" >&5
14369   (exit $ac_status); }; }; then
14370   cf_result=yes
14371 else
14372   echo "$as_me: failed program was:" >&5
14373 cat conftest.$ac_ext >&5
14374 cf_result=no
14375 fi
14376 rm -f conftest.$ac_objext conftest.$ac_ext
14377 echo "$as_me:14377: result: $cf_result" >&5
14378 echo "${ECHO_T}$cf_result" >&6
14379 if test $cf_result = yes ; then
14380
14381 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14382
14383 cat >>confdefs.h <<EOF
14384 #define $cf_result 1
14385 EOF
14386
14387 else
14388
14389 cat >>confdefs.h <<EOF
14390 #define wchar_t long
14391 EOF
14392
14393 fi
14394
14395         fi
14396
14397         if test "$NCURSES_OK_WINT_T" = 0 ; then
14398
14399 echo "$as_me:14399: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14400 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14401 cat >conftest.$ac_ext <<_ACEOF
14402 #line 14402 "configure"
14403 #include "confdefs.h"
14404
14405 #ifndef _XOPEN_SOURCE_EXTENDED
14406 #define _XOPEN_SOURCE_EXTENDED
14407 #endif
14408 #include <${cf_cv_ncurses_header:-curses.h}>
14409 int
14410 main ()
14411 {
14412
14413 wint_t foo
14414
14415   ;
14416   return 0;
14417 }
14418 _ACEOF
14419 rm -f conftest.$ac_objext
14420 if { (eval echo "$as_me:14420: \"$ac_compile\"") >&5
14421   (eval $ac_compile) 2>&5
14422   ac_status=$?
14423   echo "$as_me:14423: \$? = $ac_status" >&5
14424   (exit $ac_status); } &&
14425          { ac_try='test -s conftest.$ac_objext'
14426   { (eval echo "$as_me:14426: \"$ac_try\"") >&5
14427   (eval $ac_try) 2>&5
14428   ac_status=$?
14429   echo "$as_me:14429: \$? = $ac_status" >&5
14430   (exit $ac_status); }; }; then
14431   cf_result=yes
14432 else
14433   echo "$as_me: failed program was:" >&5
14434 cat conftest.$ac_ext >&5
14435 cf_result=no
14436 fi
14437 rm -f conftest.$ac_objext conftest.$ac_ext
14438 echo "$as_me:14438: result: $cf_result" >&5
14439 echo "${ECHO_T}$cf_result" >&6
14440 if test $cf_result = yes ; then
14441
14442 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14443
14444 cat >>confdefs.h <<EOF
14445 #define $cf_result 1
14446 EOF
14447
14448 else
14449
14450 cat >>confdefs.h <<EOF
14451 #define wint_t long
14452 EOF
14453
14454 fi
14455
14456         fi
14457 fi
14458
14459 echo "$as_me:14459: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
14460 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14461
14462 cat >conftest.$ac_ext <<_ACEOF
14463 #line 14463 "configure"
14464 #include "confdefs.h"
14465
14466 #ifdef HAVE_XCURSES
14467 #include <xcurses.h>
14468 char * XCursesProgramName = "test";
14469 #else
14470 #include <${cf_cv_ncurses_header:-curses.h}>
14471 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14472 #include <ncursesw/term.h>
14473 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14474 #include <ncurses/term.h>
14475 #elif defined(HAVE_TERM_H)
14476 #include <term.h>
14477 #endif
14478 #endif
14479
14480 int
14481 main ()
14482 {
14483
14484 void *foo = &(boolnames)
14485
14486   ;
14487   return 0;
14488 }
14489 _ACEOF
14490 rm -f conftest.$ac_objext
14491 if { (eval echo "$as_me:14491: \"$ac_compile\"") >&5
14492   (eval $ac_compile) 2>&5
14493   ac_status=$?
14494   echo "$as_me:14494: \$? = $ac_status" >&5
14495   (exit $ac_status); } &&
14496          { ac_try='test -s conftest.$ac_objext'
14497   { (eval echo "$as_me:14497: \"$ac_try\"") >&5
14498   (eval $ac_try) 2>&5
14499   ac_status=$?
14500   echo "$as_me:14500: \$? = $ac_status" >&5
14501   (exit $ac_status); }; }; then
14502   cf_result=yes
14503 else
14504   echo "$as_me: failed program was:" >&5
14505 cat conftest.$ac_ext >&5
14506 cf_result=no
14507 fi
14508 rm -f conftest.$ac_objext conftest.$ac_ext
14509 echo "$as_me:14509: result: $cf_result" >&5
14510 echo "${ECHO_T}$cf_result" >&6
14511
14512 if test $cf_result = yes ; then
14513
14514 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14515
14516         cat >>confdefs.h <<EOF
14517 #define $cf_result 1
14518 EOF
14519
14520 else
14521         echo "$as_me:14521: checking for data boolnames in library" >&5
14522 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
14523         # BSD linkers insist on making weak linkage, but resolve at runtime.
14524         if test "$cross_compiling" = yes; then
14525
14526         # cross-compiling
14527         cat >conftest.$ac_ext <<_ACEOF
14528 #line 14528 "configure"
14529 #include "confdefs.h"
14530
14531 #ifdef HAVE_XCURSES
14532 #include <xcurses.h>
14533 char * XCursesProgramName = "test";
14534 #else
14535 #include <${cf_cv_ncurses_header:-curses.h}>
14536 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14537 #include <ncursesw/term.h>
14538 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14539 #include <ncurses/term.h>
14540 #elif defined(HAVE_TERM_H)
14541 #include <term.h>
14542 #endif
14543 #endif
14544
14545 extern char boolnames;
14546 int
14547 main ()
14548 {
14549
14550         do {
14551                 void *foo = &(boolnames);
14552                 ${cf_cv_main_return:-return}(foo == 0);
14553         } while (0)
14554
14555   ;
14556   return 0;
14557 }
14558 _ACEOF
14559 rm -f conftest.$ac_objext conftest$ac_exeext
14560 if { (eval echo "$as_me:14560: \"$ac_link\"") >&5
14561   (eval $ac_link) 2>&5
14562   ac_status=$?
14563   echo "$as_me:14563: \$? = $ac_status" >&5
14564   (exit $ac_status); } &&
14565          { ac_try='test -s conftest$ac_exeext'
14566   { (eval echo "$as_me:14566: \"$ac_try\"") >&5
14567   (eval $ac_try) 2>&5
14568   ac_status=$?
14569   echo "$as_me:14569: \$? = $ac_status" >&5
14570   (exit $ac_status); }; }; then
14571   cf_result=yes
14572 else
14573   echo "$as_me: failed program was:" >&5
14574 cat conftest.$ac_ext >&5
14575 cf_result=no
14576 fi
14577 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14578
14579 else
14580   cat >conftest.$ac_ext <<_ACEOF
14581 #line 14581 "configure"
14582 #include "confdefs.h"
14583
14584 #ifdef HAVE_XCURSES
14585 #include <xcurses.h>
14586 char * XCursesProgramName = "test";
14587 #else
14588 #include <${cf_cv_ncurses_header:-curses.h}>
14589 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14590 #include <ncursesw/term.h>
14591 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14592 #include <ncurses/term.h>
14593 #elif defined(HAVE_TERM_H)
14594 #include <term.h>
14595 #endif
14596 #endif
14597
14598 extern char boolnames;
14599 int main(void)
14600 {
14601         void *foo = &(boolnames);
14602         ${cf_cv_main_return:-return}(foo == 0);
14603 }
14604 _ACEOF
14605 rm -f conftest$ac_exeext
14606 if { (eval echo "$as_me:14606: \"$ac_link\"") >&5
14607   (eval $ac_link) 2>&5
14608   ac_status=$?
14609   echo "$as_me:14609: \$? = $ac_status" >&5
14610   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14611   { (eval echo "$as_me:14611: \"$ac_try\"") >&5
14612   (eval $ac_try) 2>&5
14613   ac_status=$?
14614   echo "$as_me:14614: \$? = $ac_status" >&5
14615   (exit $ac_status); }; }; then
14616   cf_result=yes
14617 else
14618   echo "$as_me: program exited with status $ac_status" >&5
14619 echo "$as_me: failed program was:" >&5
14620 cat conftest.$ac_ext >&5
14621 cf_result=no
14622 fi
14623 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14624 fi
14625         echo "$as_me:14625: result: $cf_result" >&5
14626 echo "${ECHO_T}$cf_result" >&6
14627         if test $cf_result = yes ; then
14628
14629 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14630
14631                 cat >>confdefs.h <<EOF
14632 #define $cf_result 1
14633 EOF
14634
14635         fi
14636 fi
14637
14638 echo "$as_me:14638: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
14639 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14640
14641 cat >conftest.$ac_ext <<_ACEOF
14642 #line 14642 "configure"
14643 #include "confdefs.h"
14644
14645 #ifdef HAVE_XCURSES
14646 #include <xcurses.h>
14647 char * XCursesProgramName = "test";
14648 #else
14649 #include <${cf_cv_ncurses_header:-curses.h}>
14650 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14651 #include <ncursesw/term.h>
14652 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14653 #include <ncurses/term.h>
14654 #elif defined(HAVE_TERM_H)
14655 #include <term.h>
14656 #endif
14657 #endif
14658
14659 int
14660 main ()
14661 {
14662
14663 void *foo = &(boolfnames)
14664
14665   ;
14666   return 0;
14667 }
14668 _ACEOF
14669 rm -f conftest.$ac_objext
14670 if { (eval echo "$as_me:14670: \"$ac_compile\"") >&5
14671   (eval $ac_compile) 2>&5
14672   ac_status=$?
14673   echo "$as_me:14673: \$? = $ac_status" >&5
14674   (exit $ac_status); } &&
14675          { ac_try='test -s conftest.$ac_objext'
14676   { (eval echo "$as_me:14676: \"$ac_try\"") >&5
14677   (eval $ac_try) 2>&5
14678   ac_status=$?
14679   echo "$as_me:14679: \$? = $ac_status" >&5
14680   (exit $ac_status); }; }; then
14681   cf_result=yes
14682 else
14683   echo "$as_me: failed program was:" >&5
14684 cat conftest.$ac_ext >&5
14685 cf_result=no
14686 fi
14687 rm -f conftest.$ac_objext conftest.$ac_ext
14688 echo "$as_me:14688: result: $cf_result" >&5
14689 echo "${ECHO_T}$cf_result" >&6
14690
14691 if test $cf_result = yes ; then
14692
14693 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14694
14695         cat >>confdefs.h <<EOF
14696 #define $cf_result 1
14697 EOF
14698
14699 else
14700         echo "$as_me:14700: checking for data boolfnames in library" >&5
14701 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
14702         # BSD linkers insist on making weak linkage, but resolve at runtime.
14703         if test "$cross_compiling" = yes; then
14704
14705         # cross-compiling
14706         cat >conftest.$ac_ext <<_ACEOF
14707 #line 14707 "configure"
14708 #include "confdefs.h"
14709
14710 #ifdef HAVE_XCURSES
14711 #include <xcurses.h>
14712 char * XCursesProgramName = "test";
14713 #else
14714 #include <${cf_cv_ncurses_header:-curses.h}>
14715 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14716 #include <ncursesw/term.h>
14717 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14718 #include <ncurses/term.h>
14719 #elif defined(HAVE_TERM_H)
14720 #include <term.h>
14721 #endif
14722 #endif
14723
14724 extern char boolfnames;
14725 int
14726 main ()
14727 {
14728
14729         do {
14730                 void *foo = &(boolfnames);
14731                 ${cf_cv_main_return:-return}(foo == 0);
14732         } while (0)
14733
14734   ;
14735   return 0;
14736 }
14737 _ACEOF
14738 rm -f conftest.$ac_objext conftest$ac_exeext
14739 if { (eval echo "$as_me:14739: \"$ac_link\"") >&5
14740   (eval $ac_link) 2>&5
14741   ac_status=$?
14742   echo "$as_me:14742: \$? = $ac_status" >&5
14743   (exit $ac_status); } &&
14744          { ac_try='test -s conftest$ac_exeext'
14745   { (eval echo "$as_me:14745: \"$ac_try\"") >&5
14746   (eval $ac_try) 2>&5
14747   ac_status=$?
14748   echo "$as_me:14748: \$? = $ac_status" >&5
14749   (exit $ac_status); }; }; then
14750   cf_result=yes
14751 else
14752   echo "$as_me: failed program was:" >&5
14753 cat conftest.$ac_ext >&5
14754 cf_result=no
14755 fi
14756 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14757
14758 else
14759   cat >conftest.$ac_ext <<_ACEOF
14760 #line 14760 "configure"
14761 #include "confdefs.h"
14762
14763 #ifdef HAVE_XCURSES
14764 #include <xcurses.h>
14765 char * XCursesProgramName = "test";
14766 #else
14767 #include <${cf_cv_ncurses_header:-curses.h}>
14768 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14769 #include <ncursesw/term.h>
14770 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14771 #include <ncurses/term.h>
14772 #elif defined(HAVE_TERM_H)
14773 #include <term.h>
14774 #endif
14775 #endif
14776
14777 extern char boolfnames;
14778 int main(void)
14779 {
14780         void *foo = &(boolfnames);
14781         ${cf_cv_main_return:-return}(foo == 0);
14782 }
14783 _ACEOF
14784 rm -f conftest$ac_exeext
14785 if { (eval echo "$as_me:14785: \"$ac_link\"") >&5
14786   (eval $ac_link) 2>&5
14787   ac_status=$?
14788   echo "$as_me:14788: \$? = $ac_status" >&5
14789   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14790   { (eval echo "$as_me:14790: \"$ac_try\"") >&5
14791   (eval $ac_try) 2>&5
14792   ac_status=$?
14793   echo "$as_me:14793: \$? = $ac_status" >&5
14794   (exit $ac_status); }; }; then
14795   cf_result=yes
14796 else
14797   echo "$as_me: program exited with status $ac_status" >&5
14798 echo "$as_me: failed program was:" >&5
14799 cat conftest.$ac_ext >&5
14800 cf_result=no
14801 fi
14802 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14803 fi
14804         echo "$as_me:14804: result: $cf_result" >&5
14805 echo "${ECHO_T}$cf_result" >&6
14806         if test $cf_result = yes ; then
14807
14808 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14809
14810                 cat >>confdefs.h <<EOF
14811 #define $cf_result 1
14812 EOF
14813
14814         fi
14815 fi
14816
14817 if ( test "$GCC" = yes || test "$GXX" = yes )
14818 then
14819 echo "$as_me:14819: checking if you want to turn on gcc warnings" >&5
14820 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
14821
14822 # Check whether --enable-warnings or --disable-warnings was given.
14823 if test "${enable_warnings+set}" = set; then
14824   enableval="$enable_warnings"
14825   test "$enableval" != yes && enableval=no
14826   if test "$enableval" != "no" ; then
14827     with_warnings=yes
14828   else
14829     with_warnings=no
14830   fi
14831 else
14832   enableval=no
14833   with_warnings=no
14834
14835 fi;
14836 echo "$as_me:14836: result: $with_warnings" >&5
14837 echo "${ECHO_T}$with_warnings" >&6
14838 if test "$with_warnings" = "yes"
14839 then
14840
14841 if test "$GCC" = yes
14842 then
14843 cat > conftest.i <<EOF
14844 #ifndef GCC_PRINTF
14845 #define GCC_PRINTF 0
14846 #endif
14847 #ifndef GCC_SCANF
14848 #define GCC_SCANF 0
14849 #endif
14850 #ifndef GCC_NORETURN
14851 #define GCC_NORETURN /* nothing */
14852 #endif
14853 #ifndef GCC_UNUSED
14854 #define GCC_UNUSED /* nothing */
14855 #endif
14856 EOF
14857 if test "$GCC" = yes
14858 then
14859         { echo "$as_me:14859: checking for $CC __attribute__ directives..." >&5
14860 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
14861 cat > conftest.$ac_ext <<EOF
14862 #line 14862 "${as_me:-configure}"
14863 #include "confdefs.h"
14864 #include "conftest.h"
14865 #include "conftest.i"
14866 #if     GCC_PRINTF
14867 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
14868 #else
14869 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
14870 #endif
14871 #if     GCC_SCANF
14872 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
14873 #else
14874 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
14875 #endif
14876 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
14877 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
14878 extern void foo(void) GCC_NORETURN;
14879 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
14880 EOF
14881         cf_printf_attribute=no
14882         cf_scanf_attribute=no
14883         for cf_attribute in scanf printf unused noreturn
14884         do
14885
14886 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14887
14888                 cf_directive="__attribute__(($cf_attribute))"
14889                 echo "checking for $CC $cf_directive" 1>&5
14890
14891                 case $cf_attribute in #(vi
14892                 printf) #(vi
14893                         cf_printf_attribute=yes
14894                         cat >conftest.h <<EOF
14895 #define GCC_$cf_ATTRIBUTE 1
14896 EOF
14897                         ;;
14898                 scanf) #(vi
14899                         cf_scanf_attribute=yes
14900                         cat >conftest.h <<EOF
14901 #define GCC_$cf_ATTRIBUTE 1
14902 EOF
14903                         ;;
14904                 *) #(vi
14905                         cat >conftest.h <<EOF
14906 #define GCC_$cf_ATTRIBUTE $cf_directive
14907 EOF
14908                         ;;
14909                 esac
14910
14911                 if { (eval echo "$as_me:14911: \"$ac_compile\"") >&5
14912   (eval $ac_compile) 2>&5
14913   ac_status=$?
14914   echo "$as_me:14914: \$? = $ac_status" >&5
14915   (exit $ac_status); }; then
14916                         test -n "$verbose" && echo "$as_me:14916: result: ... $cf_attribute" >&5
14917 echo "${ECHO_T}... $cf_attribute" >&6
14918                         cat conftest.h >>confdefs.h
14919                         case $cf_attribute in #(vi
14920                         noreturn) #(vi
14921
14922 cat >>confdefs.h <<EOF
14923 #define GCC_NORETURN $cf_directive
14924 EOF
14925
14926                                 ;;
14927                         printf) #(vi
14928                                 cf_value='/* nothing */'
14929                                 if test "$cf_printf_attribute" != no ; then
14930                                         cf_value='__attribute__((format(printf,fmt,var)))'
14931
14932 cat >>confdefs.h <<\EOF
14933 #define GCC_PRINTF 1
14934 EOF
14935
14936                                 fi
14937
14938 cat >>confdefs.h <<EOF
14939 #define GCC_PRINTFLIKE(fmt,var) $cf_value
14940 EOF
14941
14942                                 ;;
14943                         scanf) #(vi
14944                                 cf_value='/* nothing */'
14945                                 if test "$cf_scanf_attribute" != no ; then
14946                                         cf_value='__attribute__((format(scanf,fmt,var)))'
14947
14948 cat >>confdefs.h <<\EOF
14949 #define GCC_SCANF 1
14950 EOF
14951
14952                                 fi
14953
14954 cat >>confdefs.h <<EOF
14955 #define GCC_SCANFLIKE(fmt,var) $cf_value
14956 EOF
14957
14958                                 ;;
14959                         unused) #(vi
14960
14961 cat >>confdefs.h <<EOF
14962 #define GCC_UNUSED $cf_directive
14963 EOF
14964
14965                                 ;;
14966                         esac
14967                 fi
14968         done
14969 else
14970         fgrep define conftest.i >>confdefs.h
14971 fi
14972 rm -rf conftest*
14973 fi
14974
14975 INTEL_COMPILER=no
14976
14977 if test "$GCC" = yes ; then
14978         case $host_os in
14979         linux*|gnu*)
14980                 echo "$as_me:14980: checking if this is really Intel C compiler" >&5
14981 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
14982                 cf_save_CFLAGS="$CFLAGS"
14983                 CFLAGS="$CFLAGS -no-gcc"
14984                 cat >conftest.$ac_ext <<_ACEOF
14985 #line 14985 "configure"
14986 #include "confdefs.h"
14987
14988 int
14989 main ()
14990 {
14991
14992 #ifdef __INTEL_COMPILER
14993 #else
14994 make an error
14995 #endif
14996
14997   ;
14998   return 0;
14999 }
15000 _ACEOF
15001 rm -f conftest.$ac_objext
15002 if { (eval echo "$as_me:15002: \"$ac_compile\"") >&5
15003   (eval $ac_compile) 2>&5
15004   ac_status=$?
15005   echo "$as_me:15005: \$? = $ac_status" >&5
15006   (exit $ac_status); } &&
15007          { ac_try='test -s conftest.$ac_objext'
15008   { (eval echo "$as_me:15008: \"$ac_try\"") >&5
15009   (eval $ac_try) 2>&5
15010   ac_status=$?
15011   echo "$as_me:15011: \$? = $ac_status" >&5
15012   (exit $ac_status); }; }; then
15013   INTEL_COMPILER=yes
15014 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
15015
15016 else
15017   echo "$as_me: failed program was:" >&5
15018 cat conftest.$ac_ext >&5
15019 fi
15020 rm -f conftest.$ac_objext conftest.$ac_ext
15021                 CFLAGS="$cf_save_CFLAGS"
15022                 echo "$as_me:15022: result: $INTEL_COMPILER" >&5
15023 echo "${ECHO_T}$INTEL_COMPILER" >&6
15024                 ;;
15025         esac
15026 fi
15027
15028 CLANG_COMPILER=no
15029
15030 if test "$GCC" = yes ; then
15031         echo "$as_me:15031: checking if this is really Clang C compiler" >&5
15032 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
15033         cf_save_CFLAGS="$CFLAGS"
15034         CFLAGS="$CFLAGS -Qunused-arguments"
15035         cat >conftest.$ac_ext <<_ACEOF
15036 #line 15036 "configure"
15037 #include "confdefs.h"
15038
15039 int
15040 main ()
15041 {
15042
15043 #ifdef __clang__
15044 #else
15045 make an error
15046 #endif
15047
15048   ;
15049   return 0;
15050 }
15051 _ACEOF
15052 rm -f conftest.$ac_objext
15053 if { (eval echo "$as_me:15053: \"$ac_compile\"") >&5
15054   (eval $ac_compile) 2>&5
15055   ac_status=$?
15056   echo "$as_me:15056: \$? = $ac_status" >&5
15057   (exit $ac_status); } &&
15058          { ac_try='test -s conftest.$ac_objext'
15059   { (eval echo "$as_me:15059: \"$ac_try\"") >&5
15060   (eval $ac_try) 2>&5
15061   ac_status=$?
15062   echo "$as_me:15062: \$? = $ac_status" >&5
15063   (exit $ac_status); }; }; then
15064   CLANG_COMPILER=yes
15065 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
15066
15067 else
15068   echo "$as_me: failed program was:" >&5
15069 cat conftest.$ac_ext >&5
15070 fi
15071 rm -f conftest.$ac_objext conftest.$ac_ext
15072         CFLAGS="$cf_save_CFLAGS"
15073         echo "$as_me:15073: result: $CLANG_COMPILER" >&5
15074 echo "${ECHO_T}$CLANG_COMPILER" >&6
15075 fi
15076
15077 cat > conftest.$ac_ext <<EOF
15078 #line 15078 "${as_me:-configure}"
15079 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15080 EOF
15081
15082 if test "$INTEL_COMPILER" = yes
15083 then
15084 # The "-wdXXX" options suppress warnings:
15085 # remark #1419: external declaration in primary source file
15086 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15087 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15088 # remark #193: zero used for undefined preprocessing identifier
15089 # remark #593: variable "curs_sb_left_arrow" was set but never used
15090 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15091 # remark #869: parameter "tw" was never referenced
15092 # remark #981: operands are evaluated in unspecified order
15093 # warning #279: controlling expression is constant
15094
15095         { echo "$as_me:15095: checking for $CC warning options..." >&5
15096 echo "$as_me: checking for $CC warning options..." >&6;}
15097         cf_save_CFLAGS="$CFLAGS"
15098         EXTRA_CFLAGS="-Wall"
15099         for cf_opt in \
15100                 wd1419 \
15101                 wd1683 \
15102                 wd1684 \
15103                 wd193 \
15104                 wd593 \
15105                 wd279 \
15106                 wd810 \
15107                 wd869 \
15108                 wd981
15109         do
15110                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15111                 if { (eval echo "$as_me:15111: \"$ac_compile\"") >&5
15112   (eval $ac_compile) 2>&5
15113   ac_status=$?
15114   echo "$as_me:15114: \$? = $ac_status" >&5
15115   (exit $ac_status); }; then
15116                         test -n "$verbose" && echo "$as_me:15116: result: ... -$cf_opt" >&5
15117 echo "${ECHO_T}... -$cf_opt" >&6
15118                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15119                 fi
15120         done
15121         CFLAGS="$cf_save_CFLAGS"
15122
15123 elif test "$GCC" = yes
15124 then
15125         { echo "$as_me:15125: checking for $CC warning options..." >&5
15126 echo "$as_me: checking for $CC warning options..." >&6;}
15127         cf_save_CFLAGS="$CFLAGS"
15128         EXTRA_CFLAGS=
15129         cf_warn_CONST=""
15130         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15131         for cf_opt in W Wall \
15132                 Wbad-function-cast \
15133                 Wcast-align \
15134                 Wcast-qual \
15135                 Winline \
15136                 Wmissing-declarations \
15137                 Wmissing-prototypes \
15138                 Wnested-externs \
15139                 Wpointer-arith \
15140                 Wshadow \
15141                 Wstrict-prototypes \
15142                 Wundef $cf_warn_CONST
15143         do
15144                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15145                 if { (eval echo "$as_me:15145: \"$ac_compile\"") >&5
15146   (eval $ac_compile) 2>&5
15147   ac_status=$?
15148   echo "$as_me:15148: \$? = $ac_status" >&5
15149   (exit $ac_status); }; then
15150                         test -n "$verbose" && echo "$as_me:15150: result: ... -$cf_opt" >&5
15151 echo "${ECHO_T}... -$cf_opt" >&6
15152                         case $cf_opt in #(vi
15153                         Wcast-qual) #(vi
15154                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
15155                                 ;;
15156                         Winline) #(vi
15157                                 case $GCC_VERSION in
15158                                 [34].*)
15159                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15160
15161 echo "${as_me:-configure}:15161: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15162
15163                                         continue;;
15164                                 esac
15165                                 ;;
15166                         Wpointer-arith) #(vi
15167                                 case $GCC_VERSION in
15168                                 [12].*)
15169                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15170
15171 echo "${as_me:-configure}:15171: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15172
15173                                         continue;;
15174                                 esac
15175                                 ;;
15176                         esac
15177                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15178                 fi
15179         done
15180         CFLAGS="$cf_save_CFLAGS"
15181 fi
15182 rm -rf conftest*
15183
15184 fi
15185 fi
15186
15187 echo "$as_me:15187: checking if you want to use dmalloc for testing" >&5
15188 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
15189
15190 # Check whether --with-dmalloc or --without-dmalloc was given.
15191 if test "${with_dmalloc+set}" = set; then
15192   withval="$with_dmalloc"
15193
15194 cat >>confdefs.h <<EOF
15195 #define USE_DMALLOC 1
15196 EOF
15197
15198         : ${with_cflags:=-g}
15199         : ${with_no_leaks:=yes}
15200          with_dmalloc=yes
15201 else
15202   with_dmalloc=
15203 fi;
15204 echo "$as_me:15204: result: ${with_dmalloc:-no}" >&5
15205 echo "${ECHO_T}${with_dmalloc:-no}" >&6
15206
15207 case .$with_cflags in #(vi
15208 .*-g*)
15209         case .$CFLAGS in #(vi
15210         .*-g*) #(vi
15211                 ;;
15212         *)
15213
15214 cf_fix_cppflags=no
15215 cf_new_cflags=
15216 cf_new_cppflags=
15217 cf_new_extra_cppflags=
15218
15219 for cf_add_cflags in -g
15220 do
15221 case $cf_fix_cppflags in
15222 no)
15223         case $cf_add_cflags in #(vi
15224         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
15225                 case $cf_add_cflags in
15226                 -D*)
15227                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15228
15229                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15230                                 && test -z "${cf_tst_cflags}" \
15231                                 && cf_fix_cppflags=yes
15232
15233                         if test $cf_fix_cppflags = yes ; then
15234                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15235                                 continue
15236                         elif test "${cf_tst_cflags}" = "\"'" ; then
15237                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15238                                 continue
15239                         fi
15240                         ;;
15241                 esac
15242                 case "$CPPFLAGS" in
15243                 *$cf_add_cflags) #(vi
15244                         ;;
15245                 *) #(vi
15246                         case $cf_add_cflags in #(vi
15247                         -D*)
15248                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15249
15250 CPPFLAGS=`echo "$CPPFLAGS" | \
15251         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15252                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15253
15254                                 ;;
15255                         esac
15256                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
15257                         ;;
15258                 esac
15259                 ;;
15260         *)
15261                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
15262                 ;;
15263         esac
15264         ;;
15265 yes)
15266         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15267
15268         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15269
15270         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15271                 && test -z "${cf_tst_cflags}" \
15272                 && cf_fix_cppflags=no
15273         ;;
15274 esac
15275 done
15276
15277 if test -n "$cf_new_cflags" ; then
15278
15279         CFLAGS="$CFLAGS $cf_new_cflags"
15280 fi
15281
15282 if test -n "$cf_new_cppflags" ; then
15283
15284         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
15285 fi
15286
15287 if test -n "$cf_new_extra_cppflags" ; then
15288
15289         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
15290 fi
15291
15292                 ;;
15293         esac
15294         ;;
15295 esac
15296
15297 if test "$with_dmalloc" = yes ; then
15298         echo "$as_me:15298: checking for dmalloc.h" >&5
15299 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
15300 if test "${ac_cv_header_dmalloc_h+set}" = set; then
15301   echo $ECHO_N "(cached) $ECHO_C" >&6
15302 else
15303   cat >conftest.$ac_ext <<_ACEOF
15304 #line 15304 "configure"
15305 #include "confdefs.h"
15306 #include <dmalloc.h>
15307 _ACEOF
15308 if { (eval echo "$as_me:15308: \"$ac_cpp conftest.$ac_ext\"") >&5
15309   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15310   ac_status=$?
15311   egrep -v '^ *\+' conftest.er1 >conftest.err
15312   rm -f conftest.er1
15313   cat conftest.err >&5
15314   echo "$as_me:15314: \$? = $ac_status" >&5
15315   (exit $ac_status); } >/dev/null; then
15316   if test -s conftest.err; then
15317     ac_cpp_err=$ac_c_preproc_warn_flag
15318   else
15319     ac_cpp_err=
15320   fi
15321 else
15322   ac_cpp_err=yes
15323 fi
15324 if test -z "$ac_cpp_err"; then
15325   ac_cv_header_dmalloc_h=yes
15326 else
15327   echo "$as_me: failed program was:" >&5
15328   cat conftest.$ac_ext >&5
15329   ac_cv_header_dmalloc_h=no
15330 fi
15331 rm -f conftest.err conftest.$ac_ext
15332 fi
15333 echo "$as_me:15333: result: $ac_cv_header_dmalloc_h" >&5
15334 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
15335 if test $ac_cv_header_dmalloc_h = yes; then
15336
15337 echo "$as_me:15337: checking for dmalloc_debug in -ldmalloc" >&5
15338 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
15339 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
15340   echo $ECHO_N "(cached) $ECHO_C" >&6
15341 else
15342   ac_check_lib_save_LIBS=$LIBS
15343 LIBS="-ldmalloc  $LIBS"
15344 cat >conftest.$ac_ext <<_ACEOF
15345 #line 15345 "configure"
15346 #include "confdefs.h"
15347
15348 /* Override any gcc2 internal prototype to avoid an error.  */
15349 #ifdef __cplusplus
15350 extern "C"
15351 #endif
15352 /* We use char because int might match the return type of a gcc2
15353    builtin and then its argument prototype would still apply.  */
15354 char dmalloc_debug ();
15355 int
15356 main ()
15357 {
15358 dmalloc_debug ();
15359   ;
15360   return 0;
15361 }
15362 _ACEOF
15363 rm -f conftest.$ac_objext conftest$ac_exeext
15364 if { (eval echo "$as_me:15364: \"$ac_link\"") >&5
15365   (eval $ac_link) 2>&5
15366   ac_status=$?
15367   echo "$as_me:15367: \$? = $ac_status" >&5
15368   (exit $ac_status); } &&
15369          { ac_try='test -s conftest$ac_exeext'
15370   { (eval echo "$as_me:15370: \"$ac_try\"") >&5
15371   (eval $ac_try) 2>&5
15372   ac_status=$?
15373   echo "$as_me:15373: \$? = $ac_status" >&5
15374   (exit $ac_status); }; }; then
15375   ac_cv_lib_dmalloc_dmalloc_debug=yes
15376 else
15377   echo "$as_me: failed program was:" >&5
15378 cat conftest.$ac_ext >&5
15379 ac_cv_lib_dmalloc_dmalloc_debug=no
15380 fi
15381 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15382 LIBS=$ac_check_lib_save_LIBS
15383 fi
15384 echo "$as_me:15384: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
15385 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
15386 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
15387   cat >>confdefs.h <<EOF
15388 #define HAVE_LIBDMALLOC 1
15389 EOF
15390
15391   LIBS="-ldmalloc $LIBS"
15392
15393 fi
15394
15395 fi
15396
15397 fi
15398
15399 echo "$as_me:15399: checking if you want to use dbmalloc for testing" >&5
15400 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
15401
15402 # Check whether --with-dbmalloc or --without-dbmalloc was given.
15403 if test "${with_dbmalloc+set}" = set; then
15404   withval="$with_dbmalloc"
15405
15406 cat >>confdefs.h <<EOF
15407 #define USE_DBMALLOC 1
15408 EOF
15409
15410         : ${with_cflags:=-g}
15411         : ${with_no_leaks:=yes}
15412          with_dbmalloc=yes
15413 else
15414   with_dbmalloc=
15415 fi;
15416 echo "$as_me:15416: result: ${with_dbmalloc:-no}" >&5
15417 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
15418
15419 case .$with_cflags in #(vi
15420 .*-g*)
15421         case .$CFLAGS in #(vi
15422         .*-g*) #(vi
15423                 ;;
15424         *)
15425
15426 cf_fix_cppflags=no
15427 cf_new_cflags=
15428 cf_new_cppflags=
15429 cf_new_extra_cppflags=
15430
15431 for cf_add_cflags in -g
15432 do
15433 case $cf_fix_cppflags in
15434 no)
15435         case $cf_add_cflags in #(vi
15436         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
15437                 case $cf_add_cflags in
15438                 -D*)
15439                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15440
15441                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15442                                 && test -z "${cf_tst_cflags}" \
15443                                 && cf_fix_cppflags=yes
15444
15445                         if test $cf_fix_cppflags = yes ; then
15446                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15447                                 continue
15448                         elif test "${cf_tst_cflags}" = "\"'" ; then
15449                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15450                                 continue
15451                         fi
15452                         ;;
15453                 esac
15454                 case "$CPPFLAGS" in
15455                 *$cf_add_cflags) #(vi
15456                         ;;
15457                 *) #(vi
15458                         case $cf_add_cflags in #(vi
15459                         -D*)
15460                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15461
15462 CPPFLAGS=`echo "$CPPFLAGS" | \
15463         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15464                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15465
15466                                 ;;
15467                         esac
15468                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
15469                         ;;
15470                 esac
15471                 ;;
15472         *)
15473                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
15474                 ;;
15475         esac
15476         ;;
15477 yes)
15478         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15479
15480         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15481
15482         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15483                 && test -z "${cf_tst_cflags}" \
15484                 && cf_fix_cppflags=no
15485         ;;
15486 esac
15487 done
15488
15489 if test -n "$cf_new_cflags" ; then
15490
15491         CFLAGS="$CFLAGS $cf_new_cflags"
15492 fi
15493
15494 if test -n "$cf_new_cppflags" ; then
15495
15496         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
15497 fi
15498
15499 if test -n "$cf_new_extra_cppflags" ; then
15500
15501         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
15502 fi
15503
15504                 ;;
15505         esac
15506         ;;
15507 esac
15508
15509 if test "$with_dbmalloc" = yes ; then
15510         echo "$as_me:15510: checking for dbmalloc.h" >&5
15511 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
15512 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
15513   echo $ECHO_N "(cached) $ECHO_C" >&6
15514 else
15515   cat >conftest.$ac_ext <<_ACEOF
15516 #line 15516 "configure"
15517 #include "confdefs.h"
15518 #include <dbmalloc.h>
15519 _ACEOF
15520 if { (eval echo "$as_me:15520: \"$ac_cpp conftest.$ac_ext\"") >&5
15521   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15522   ac_status=$?
15523   egrep -v '^ *\+' conftest.er1 >conftest.err
15524   rm -f conftest.er1
15525   cat conftest.err >&5
15526   echo "$as_me:15526: \$? = $ac_status" >&5
15527   (exit $ac_status); } >/dev/null; then
15528   if test -s conftest.err; then
15529     ac_cpp_err=$ac_c_preproc_warn_flag
15530   else
15531     ac_cpp_err=
15532   fi
15533 else
15534   ac_cpp_err=yes
15535 fi
15536 if test -z "$ac_cpp_err"; then
15537   ac_cv_header_dbmalloc_h=yes
15538 else
15539   echo "$as_me: failed program was:" >&5
15540   cat conftest.$ac_ext >&5
15541   ac_cv_header_dbmalloc_h=no
15542 fi
15543 rm -f conftest.err conftest.$ac_ext
15544 fi
15545 echo "$as_me:15545: result: $ac_cv_header_dbmalloc_h" >&5
15546 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
15547 if test $ac_cv_header_dbmalloc_h = yes; then
15548
15549 echo "$as_me:15549: checking for debug_malloc in -ldbmalloc" >&5
15550 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
15551 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
15552   echo $ECHO_N "(cached) $ECHO_C" >&6
15553 else
15554   ac_check_lib_save_LIBS=$LIBS
15555 LIBS="-ldbmalloc  $LIBS"
15556 cat >conftest.$ac_ext <<_ACEOF
15557 #line 15557 "configure"
15558 #include "confdefs.h"
15559
15560 /* Override any gcc2 internal prototype to avoid an error.  */
15561 #ifdef __cplusplus
15562 extern "C"
15563 #endif
15564 /* We use char because int might match the return type of a gcc2
15565    builtin and then its argument prototype would still apply.  */
15566 char debug_malloc ();
15567 int
15568 main ()
15569 {
15570 debug_malloc ();
15571   ;
15572   return 0;
15573 }
15574 _ACEOF
15575 rm -f conftest.$ac_objext conftest$ac_exeext
15576 if { (eval echo "$as_me:15576: \"$ac_link\"") >&5
15577   (eval $ac_link) 2>&5
15578   ac_status=$?
15579   echo "$as_me:15579: \$? = $ac_status" >&5
15580   (exit $ac_status); } &&
15581          { ac_try='test -s conftest$ac_exeext'
15582   { (eval echo "$as_me:15582: \"$ac_try\"") >&5
15583   (eval $ac_try) 2>&5
15584   ac_status=$?
15585   echo "$as_me:15585: \$? = $ac_status" >&5
15586   (exit $ac_status); }; }; then
15587   ac_cv_lib_dbmalloc_debug_malloc=yes
15588 else
15589   echo "$as_me: failed program was:" >&5
15590 cat conftest.$ac_ext >&5
15591 ac_cv_lib_dbmalloc_debug_malloc=no
15592 fi
15593 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15594 LIBS=$ac_check_lib_save_LIBS
15595 fi
15596 echo "$as_me:15596: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
15597 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
15598 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
15599   cat >>confdefs.h <<EOF
15600 #define HAVE_LIBDBMALLOC 1
15601 EOF
15602
15603   LIBS="-ldbmalloc $LIBS"
15604
15605 fi
15606
15607 fi
15608
15609 fi
15610
15611 echo "$as_me:15611: checking if you want to use valgrind for testing" >&5
15612 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
15613
15614 # Check whether --with-valgrind or --without-valgrind was given.
15615 if test "${with_valgrind+set}" = set; then
15616   withval="$with_valgrind"
15617
15618 cat >>confdefs.h <<EOF
15619 #define USE_VALGRIND 1
15620 EOF
15621
15622         : ${with_cflags:=-g}
15623         : ${with_no_leaks:=yes}
15624          with_valgrind=yes
15625 else
15626   with_valgrind=
15627 fi;
15628 echo "$as_me:15628: result: ${with_valgrind:-no}" >&5
15629 echo "${ECHO_T}${with_valgrind:-no}" >&6
15630
15631 case .$with_cflags in #(vi
15632 .*-g*)
15633         case .$CFLAGS in #(vi
15634         .*-g*) #(vi
15635                 ;;
15636         *)
15637
15638 cf_fix_cppflags=no
15639 cf_new_cflags=
15640 cf_new_cppflags=
15641 cf_new_extra_cppflags=
15642
15643 for cf_add_cflags in -g
15644 do
15645 case $cf_fix_cppflags in
15646 no)
15647         case $cf_add_cflags in #(vi
15648         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
15649                 case $cf_add_cflags in
15650                 -D*)
15651                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15652
15653                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15654                                 && test -z "${cf_tst_cflags}" \
15655                                 && cf_fix_cppflags=yes
15656
15657                         if test $cf_fix_cppflags = yes ; then
15658                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15659                                 continue
15660                         elif test "${cf_tst_cflags}" = "\"'" ; then
15661                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15662                                 continue
15663                         fi
15664                         ;;
15665                 esac
15666                 case "$CPPFLAGS" in
15667                 *$cf_add_cflags) #(vi
15668                         ;;
15669                 *) #(vi
15670                         case $cf_add_cflags in #(vi
15671                         -D*)
15672                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15673
15674 CPPFLAGS=`echo "$CPPFLAGS" | \
15675         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15676                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15677
15678                                 ;;
15679                         esac
15680                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
15681                         ;;
15682                 esac
15683                 ;;
15684         *)
15685                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
15686                 ;;
15687         esac
15688         ;;
15689 yes)
15690         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15691
15692         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15693
15694         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15695                 && test -z "${cf_tst_cflags}" \
15696                 && cf_fix_cppflags=no
15697         ;;
15698 esac
15699 done
15700
15701 if test -n "$cf_new_cflags" ; then
15702
15703         CFLAGS="$CFLAGS $cf_new_cflags"
15704 fi
15705
15706 if test -n "$cf_new_cppflags" ; then
15707
15708         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
15709 fi
15710
15711 if test -n "$cf_new_extra_cppflags" ; then
15712
15713         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
15714 fi
15715
15716                 ;;
15717         esac
15718         ;;
15719 esac
15720
15721 echo "$as_me:15721: checking if you want to perform memory-leak testing" >&5
15722 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
15723
15724 # Check whether --enable-leaks or --disable-leaks was given.
15725 if test "${enable_leaks+set}" = set; then
15726   enableval="$enable_leaks"
15727   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
15728 else
15729   : ${with_no_leaks:=no}
15730 fi;
15731 echo "$as_me:15731: result: $with_no_leaks" >&5
15732 echo "${ECHO_T}$with_no_leaks" >&6
15733
15734 if test "$with_no_leaks" = yes ; then
15735
15736 cat >>confdefs.h <<\EOF
15737 #define NO_LEAKS 1
15738 EOF
15739
15740 cat >>confdefs.h <<\EOF
15741 #define YY_NO_LEAKS 1
15742 EOF
15743
15744 fi
15745
15746 LD_RPATH_OPT=
15747 echo "$as_me:15747: checking for an rpath option" >&5
15748 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
15749 case $cf_cv_system_name in #(vi
15750 irix*) #(vi
15751         if test "$GCC" = yes; then
15752                 LD_RPATH_OPT="-Wl,-rpath,"
15753         else
15754                 LD_RPATH_OPT="-rpath "
15755         fi
15756         ;;
15757 linux*|gnu*|k*bsd*-gnu) #(vi
15758         LD_RPATH_OPT="-Wl,-rpath,"
15759         ;;
15760 openbsd[2-9].*|mirbsd*) #(vi
15761         LD_RPATH_OPT="-Wl,-rpath,"
15762         ;;
15763 dragonfly*|freebsd*) #(vi
15764         LD_RPATH_OPT="-rpath "
15765         ;;
15766 netbsd*) #(vi
15767         LD_RPATH_OPT="-Wl,-rpath,"
15768         ;;
15769 osf*|mls+*) #(vi
15770         LD_RPATH_OPT="-rpath "
15771         ;;
15772 solaris2*) #(vi
15773         LD_RPATH_OPT="-R"
15774         ;;
15775 *)
15776         ;;
15777 esac
15778 echo "$as_me:15778: result: $LD_RPATH_OPT" >&5
15779 echo "${ECHO_T}$LD_RPATH_OPT" >&6
15780
15781 case "x$LD_RPATH_OPT" in #(vi
15782 x-R*)
15783         echo "$as_me:15783: checking if we need a space after rpath option" >&5
15784 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
15785         cf_save_LIBS="$LIBS"
15786         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
15787         cat >conftest.$ac_ext <<_ACEOF
15788 #line 15788 "configure"
15789 #include "confdefs.h"
15790
15791 int
15792 main ()
15793 {
15794
15795   ;
15796   return 0;
15797 }
15798 _ACEOF
15799 rm -f conftest.$ac_objext conftest$ac_exeext
15800 if { (eval echo "$as_me:15800: \"$ac_link\"") >&5
15801   (eval $ac_link) 2>&5
15802   ac_status=$?
15803   echo "$as_me:15803: \$? = $ac_status" >&5
15804   (exit $ac_status); } &&
15805          { ac_try='test -s conftest$ac_exeext'
15806   { (eval echo "$as_me:15806: \"$ac_try\"") >&5
15807   (eval $ac_try) 2>&5
15808   ac_status=$?
15809   echo "$as_me:15809: \$? = $ac_status" >&5
15810   (exit $ac_status); }; }; then
15811   cf_rpath_space=no
15812 else
15813   echo "$as_me: failed program was:" >&5
15814 cat conftest.$ac_ext >&5
15815 cf_rpath_space=yes
15816 fi
15817 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15818         LIBS="$cf_save_LIBS"
15819         echo "$as_me:15819: result: $cf_rpath_space" >&5
15820 echo "${ECHO_T}$cf_rpath_space" >&6
15821         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
15822         ;;
15823 esac
15824
15825 echo "$as_me:15825: checking if rpath-hack should be disabled" >&5
15826 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
15827
15828 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
15829 if test "${enable_rpath_hack+set}" = set; then
15830   enableval="$enable_rpath_hack"
15831   test "$enableval" != no && enableval=yes
15832   if test "$enableval" != "yes" ; then
15833     cf_disable_rpath_hack=yes
15834   else
15835     cf_disable_rpath_hack=no
15836   fi
15837 else
15838   enableval=yes
15839   cf_disable_rpath_hack=no
15840
15841 fi;
15842 echo "$as_me:15842: result: $cf_disable_rpath_hack" >&5
15843 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
15844 if test "$cf_disable_rpath_hack" = no ; then
15845
15846 echo "$as_me:15846: checking for updated LDFLAGS" >&5
15847 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
15848 if test -n "$LD_RPATH_OPT" ; then
15849         echo "$as_me:15849: result: maybe" >&5
15850 echo "${ECHO_T}maybe" >&6
15851
15852         for ac_prog in ldd
15853 do
15854   # Extract the first word of "$ac_prog", so it can be a program name with args.
15855 set dummy $ac_prog; ac_word=$2
15856 echo "$as_me:15856: checking for $ac_word" >&5
15857 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15858 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
15859   echo $ECHO_N "(cached) $ECHO_C" >&6
15860 else
15861   if test -n "$cf_ldd_prog"; then
15862   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
15863 else
15864   ac_save_IFS=$IFS; IFS=$ac_path_separator
15865 ac_dummy="$PATH"
15866 for ac_dir in $ac_dummy; do
15867   IFS=$ac_save_IFS
15868   test -z "$ac_dir" && ac_dir=.
15869   $as_executable_p "$ac_dir/$ac_word" || continue
15870 ac_cv_prog_cf_ldd_prog="$ac_prog"
15871 echo "$as_me:15871: found $ac_dir/$ac_word" >&5
15872 break
15873 done
15874
15875 fi
15876 fi
15877 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
15878 if test -n "$cf_ldd_prog"; then
15879   echo "$as_me:15879: result: $cf_ldd_prog" >&5
15880 echo "${ECHO_T}$cf_ldd_prog" >&6
15881 else
15882   echo "$as_me:15882: result: no" >&5
15883 echo "${ECHO_T}no" >&6
15884 fi
15885
15886   test -n "$cf_ldd_prog" && break
15887 done
15888 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
15889
15890         cf_rpath_list="/usr/lib /lib"
15891         if test "$cf_ldd_prog" != no
15892         then
15893                 cf_rpath_oops=
15894
15895 cat >conftest.$ac_ext <<_ACEOF
15896 #line 15896 "configure"
15897 #include "confdefs.h"
15898 #include <stdio.h>
15899 int
15900 main ()
15901 {
15902 printf("Hello");
15903   ;
15904   return 0;
15905 }
15906 _ACEOF
15907 rm -f conftest.$ac_objext conftest$ac_exeext
15908 if { (eval echo "$as_me:15908: \"$ac_link\"") >&5
15909   (eval $ac_link) 2>&5
15910   ac_status=$?
15911   echo "$as_me:15911: \$? = $ac_status" >&5
15912   (exit $ac_status); } &&
15913          { ac_try='test -s conftest$ac_exeext'
15914   { (eval echo "$as_me:15914: \"$ac_try\"") >&5
15915   (eval $ac_try) 2>&5
15916   ac_status=$?
15917   echo "$as_me:15917: \$? = $ac_status" >&5
15918   (exit $ac_status); }; }; then
15919   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u`
15920                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort -u`
15921 else
15922   echo "$as_me: failed program was:" >&5
15923 cat conftest.$ac_ext >&5
15924 fi
15925 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15926
15927                 # If we passed the link-test, but get a "not found" on a given library,
15928                 # this could be due to inept reconfiguration of gcc to make it only
15929                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
15930                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
15931                 # /usr/local libraries.
15932                 if test -n "$cf_rpath_oops"
15933                 then
15934                         for cf_rpath_src in $cf_rpath_oops
15935                         do
15936                                 for cf_rpath_dir in \
15937                                         /usr/local \
15938                                         /usr/pkg \
15939                                         /opt/sfw
15940                                 do
15941                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
15942                                         then
15943                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
15944
15945 echo "${as_me:-configure}:15945: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
15946
15947                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
15948                                                 break
15949                                         fi
15950                                 done
15951                         done
15952                 fi
15953         fi
15954
15955         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
15956
15957 echo "${as_me:-configure}:15957: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
15958
15959 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
15960
15961 echo "${as_me:-configure}:15961: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
15962
15963 cf_rpath_dst=
15964 for cf_rpath_src in $LDFLAGS
15965 do
15966         case $cf_rpath_src in #(vi
15967         -L*) #(vi
15968
15969                 # check if this refers to a directory which we will ignore
15970                 cf_rpath_skip=no
15971                 if test -n "$cf_rpath_list"
15972                 then
15973                         for cf_rpath_item in $cf_rpath_list
15974                         do
15975                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
15976                                 then
15977                                         cf_rpath_skip=yes
15978                                         break
15979                                 fi
15980                         done
15981                 fi
15982
15983                 if test "$cf_rpath_skip" = no
15984                 then
15985                         # transform the option
15986                         if test "$LD_RPATH_OPT" = "-R " ; then
15987                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
15988                         else
15989                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
15990                         fi
15991
15992                         # if we have not already added this, add it now
15993                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
15994                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
15995                         then
15996                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
15997
15998 echo "${as_me:-configure}:15998: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
15999
16000                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16001                         fi
16002                 fi
16003                 ;;
16004         esac
16005         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16006 done
16007 LDFLAGS=$cf_rpath_dst
16008
16009 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
16010
16011 echo "${as_me:-configure}:16011: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
16012
16013 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
16014
16015 echo "${as_me:-configure}:16015: testing ...checking LIBS $LIBS ..." 1>&5
16016
16017 cf_rpath_dst=
16018 for cf_rpath_src in $LIBS
16019 do
16020         case $cf_rpath_src in #(vi
16021         -L*) #(vi
16022
16023                 # check if this refers to a directory which we will ignore
16024                 cf_rpath_skip=no
16025                 if test -n "$cf_rpath_list"
16026                 then
16027                         for cf_rpath_item in $cf_rpath_list
16028                         do
16029                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16030                                 then
16031                                         cf_rpath_skip=yes
16032                                         break
16033                                 fi
16034                         done
16035                 fi
16036
16037                 if test "$cf_rpath_skip" = no
16038                 then
16039                         # transform the option
16040                         if test "$LD_RPATH_OPT" = "-R " ; then
16041                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16042                         else
16043                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16044                         fi
16045
16046                         # if we have not already added this, add it now
16047                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16048                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16049                         then
16050                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16051
16052 echo "${as_me:-configure}:16052: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16053
16054                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16055                         fi
16056                 fi
16057                 ;;
16058         esac
16059         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16060 done
16061 LIBS=$cf_rpath_dst
16062
16063 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
16064
16065 echo "${as_me:-configure}:16065: testing ...checked LIBS $LIBS ..." 1>&5
16066
16067         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16068
16069 echo "${as_me:-configure}:16069: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16070
16071 fi
16072
16073 fi
16074
16075 TEST_ARGS="$LIBS"
16076 LIBS=
16077
16078 ac_config_files="$ac_config_files Makefile"
16079 ac_config_commands="$ac_config_commands default"
16080 cat >confcache <<\_ACEOF
16081 # This file is a shell script that caches the results of configure
16082 # tests run on this system so they can be shared between configure
16083 # scripts and configure runs, see configure's option --config-cache.
16084 # It is not useful on other systems.  If it contains results you don't
16085 # want to keep, you may remove or edit it.
16086 #
16087 # config.status only pays attention to the cache file if you give it
16088 # the --recheck option to rerun configure.
16089 #
16090 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16091 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16092 # following values.
16093
16094 _ACEOF
16095
16096 # The following way of writing the cache mishandles newlines in values,
16097 # but we know of no workaround that is simple, portable, and efficient.
16098 # So, don't put newlines in cache variables' values.
16099 # Ultrix sh set writes to stderr and can't be redirected directly,
16100 # and sets the high bit in the cache file unless we assign to the vars.
16101 {
16102   (set) 2>&1 |
16103     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16104     *ac_space=\ *)
16105       # `set' does not quote correctly, so add quotes (double-quote
16106       # substitution turns \\\\ into \\, and sed turns \\ into \).
16107       sed -n \
16108         "s/'/'\\\\''/g;
16109           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16110       ;;
16111     *)
16112       # `set' quotes correctly as required by POSIX, so do not add quotes.
16113       sed -n \
16114         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16115       ;;
16116     esac;
16117 } |
16118   sed '
16119      t clear
16120      : clear
16121      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16122      t end
16123      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16124      : end' >>confcache
16125 if cmp -s $cache_file confcache; then :; else
16126   if test -w $cache_file; then
16127     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16128     cat confcache >$cache_file
16129   else
16130     echo "not updating unwritable cache $cache_file"
16131   fi
16132 fi
16133 rm -f confcache
16134
16135 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16136 # Let make expand exec_prefix.
16137 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16138
16139 # VPATH may cause trouble with some makes, so we remove $(srcdir),
16140 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
16141 # trailing colons and then remove the whole line if VPATH becomes empty
16142 # (actually we leave an empty line to preserve line numbers).
16143 if test "x$srcdir" = x.; then
16144   ac_vpsub='/^[         ]*VPATH[        ]*=/{
16145 s/:*\$(srcdir):*/:/;
16146 s/:*\${srcdir}:*/:/;
16147 s/:*@srcdir@:*/:/;
16148 s/^\([^=]*=[    ]*\):*/\1/;
16149 s/:*$//;
16150 s/^[^=]*=[      ]*$//;
16151 }'
16152 fi
16153
16154 DEFS=-DHAVE_CONFIG_H
16155
16156 : ${CONFIG_STATUS=./config.status}
16157 ac_clean_files_save=$ac_clean_files
16158 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16159 { echo "$as_me:16159: creating $CONFIG_STATUS" >&5
16160 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16161 cat >$CONFIG_STATUS <<_ACEOF
16162 #! $SHELL
16163 # Generated automatically by configure.
16164 # Run this file to recreate the current configuration.
16165 # Compiler output produced by configure, useful for debugging
16166 # configure, is in config.log if it exists.
16167
16168 debug=false
16169 SHELL=\${CONFIG_SHELL-$SHELL}
16170 ac_cs_invocation="\$0 \$@"
16171
16172 _ACEOF
16173
16174 cat >>$CONFIG_STATUS <<\_ACEOF
16175 # Be Bourne compatible
16176 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16177   emulate sh
16178   NULLCMD=:
16179 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16180   set -o posix
16181 fi
16182
16183 # Name of the executable.
16184 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16185
16186 if expr a : '\(a\)' >/dev/null 2>&1; then
16187   as_expr=expr
16188 else
16189   as_expr=false
16190 fi
16191
16192 rm -f conf$$ conf$$.exe conf$$.file
16193 echo >conf$$.file
16194 if ln -s conf$$.file conf$$ 2>/dev/null; then
16195   # We could just check for DJGPP; but this test a) works b) is more generic
16196   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16197   if test -f conf$$.exe; then
16198     # Don't use ln at all; we don't have any links
16199     as_ln_s='cp -p'
16200   else
16201     as_ln_s='ln -s'
16202   fi
16203 elif ln conf$$.file conf$$ 2>/dev/null; then
16204   as_ln_s=ln
16205 else
16206   as_ln_s='cp -p'
16207 fi
16208 rm -f conf$$ conf$$.exe conf$$.file
16209
16210 as_executable_p="test -f"
16211
16212 # Support unset when possible.
16213 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16214   as_unset=unset
16215 else
16216   as_unset=false
16217 fi
16218
16219 # NLS nuisances.
16220 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16221 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16222 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16223 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16224 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16225 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16226 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16227 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16228
16229 # IFS
16230 # We need space, tab and new line, in precisely that order.
16231 as_nl='
16232 '
16233 IFS="   $as_nl"
16234
16235 # CDPATH.
16236 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16237
16238 exec 6>&1
16239
16240 _ACEOF
16241
16242 # Files that config.status was made for.
16243 if test -n "$ac_config_files"; then
16244   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16245 fi
16246
16247 if test -n "$ac_config_headers"; then
16248   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16249 fi
16250
16251 if test -n "$ac_config_links"; then
16252   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16253 fi
16254
16255 if test -n "$ac_config_commands"; then
16256   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16257 fi
16258
16259 cat >>$CONFIG_STATUS <<\EOF
16260
16261 ac_cs_usage="\
16262 \`$as_me' instantiates files from templates according to the
16263 current configuration.
16264
16265 Usage: $0 [OPTIONS] [FILE]...
16266
16267   -h, --help       print this help, then exit
16268   -V, --version    print version number, then exit
16269   -d, --debug      don't remove temporary files
16270       --recheck    update $as_me by reconfiguring in the same conditions
16271   --file=FILE[:TEMPLATE]
16272                    instantiate the configuration file FILE
16273   --header=FILE[:TEMPLATE]
16274                    instantiate the configuration header FILE
16275
16276 Configuration files:
16277 $config_files
16278
16279 Configuration headers:
16280 $config_headers
16281
16282 Configuration commands:
16283 $config_commands
16284
16285 Report bugs to <dickey@invisible-island.net>."
16286 EOF
16287
16288 cat >>$CONFIG_STATUS <<EOF
16289 ac_cs_version="\\
16290 config.status
16291 configured by $0, generated by GNU Autoconf 2.52.20121002,
16292   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16293
16294 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16295 Free Software Foundation, Inc.
16296 This config.status script is free software; the Free Software Foundation
16297 gives unlimited permission to copy, distribute and modify it."
16298 srcdir=$srcdir
16299 INSTALL="$INSTALL"
16300 EOF
16301
16302 cat >>$CONFIG_STATUS <<\EOF
16303 # If no file are specified by the user, then we need to provide default
16304 # value.  By we need to know if files were specified by the user.
16305 ac_need_defaults=:
16306 while test $# != 0
16307 do
16308   case $1 in
16309   --*=*)
16310     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16311     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16312     shift
16313     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16314     shift
16315     ;;
16316   -*);;
16317   *) # This is not an option, so the user has probably given explicit
16318      # arguments.
16319      ac_need_defaults=false;;
16320   esac
16321
16322   case $1 in
16323   # Handling of the options.
16324 EOF
16325 cat >>$CONFIG_STATUS <<EOF
16326   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16327     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16328     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16329 EOF
16330 cat >>$CONFIG_STATUS <<\EOF
16331   --version | --vers* | -V )
16332     echo "$ac_cs_version"; exit 0 ;;
16333   --he | --h)
16334     # Conflict between --help and --header
16335     { { echo "$as_me:16335: error: ambiguous option: $1
16336 Try \`$0 --help' for more information." >&5
16337 echo "$as_me: error: ambiguous option: $1
16338 Try \`$0 --help' for more information." >&2;}
16339    { (exit 1); exit 1; }; };;
16340   --help | --hel | -h )
16341     echo "$ac_cs_usage"; exit 0 ;;
16342   --debug | --d* | -d )
16343     debug=: ;;
16344   --file | --fil | --fi | --f )
16345     shift
16346     CONFIG_FILES="$CONFIG_FILES $1"
16347     ac_need_defaults=false;;
16348   --header | --heade | --head | --hea )
16349     shift
16350     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16351     ac_need_defaults=false;;
16352
16353   # This is an error.
16354   -*) { { echo "$as_me:16354: error: unrecognized option: $1
16355 Try \`$0 --help' for more information." >&5
16356 echo "$as_me: error: unrecognized option: $1
16357 Try \`$0 --help' for more information." >&2;}
16358    { (exit 1); exit 1; }; } ;;
16359
16360   *) ac_config_targets="$ac_config_targets $1" ;;
16361
16362   esac
16363   shift
16364 done
16365
16366 exec 5>>config.log
16367 cat >&5 << _ACEOF
16368
16369 ## ----------------------- ##
16370 ## Running config.status.  ##
16371 ## ----------------------- ##
16372
16373 This file was extended by $as_me 2.52.20121002, executed with
16374   CONFIG_FILES    = $CONFIG_FILES
16375   CONFIG_HEADERS  = $CONFIG_HEADERS
16376   CONFIG_LINKS    = $CONFIG_LINKS
16377   CONFIG_COMMANDS = $CONFIG_COMMANDS
16378   > $ac_cs_invocation
16379 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16380
16381 _ACEOF
16382 EOF
16383
16384 cat >>$CONFIG_STATUS <<EOF
16385 #
16386 # INIT-COMMANDS section.
16387 #
16388
16389 AWK="$AWK"
16390 ECHO_CC="$ECHO_CC"
16391 ECHO_LD="$ECHO_LD"
16392 SHOW_CC="$SHOW_LD"
16393
16394 EOF
16395
16396 cat >>$CONFIG_STATUS <<\EOF
16397 for ac_config_target in $ac_config_targets
16398 do
16399   case "$ac_config_target" in
16400   # Handling of arguments.
16401   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16402   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16403   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
16404   *) { { echo "$as_me:16404: error: invalid argument: $ac_config_target" >&5
16405 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16406    { (exit 1); exit 1; }; };;
16407   esac
16408 done
16409
16410 # If the user did not use the arguments to specify the items to instantiate,
16411 # then the envvar interface is used.  Set only those that are not.
16412 # We use the long form for the default assignment because of an extremely
16413 # bizarre bug on SunOS 4.1.3.
16414 if $ac_need_defaults; then
16415   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16416   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16417   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16418 fi
16419
16420 # Create a temporary directory, and hook for its removal unless debugging.
16421 $debug ||
16422 {
16423   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16424   trap '{ (exit 1); exit 1; }' 1 2 13 15
16425 }
16426
16427 # Create a (secure) tmp directory for tmp files.
16428 : ${TMPDIR=/tmp}
16429 {
16430   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16431   test -n "$tmp" && test -d "$tmp"
16432 }  ||
16433 {
16434   tmp=$TMPDIR/cs$$-$RANDOM
16435   (umask 077 && mkdir $tmp)
16436 } ||
16437 {
16438    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16439    { (exit 1); exit 1; }
16440 }
16441
16442 EOF
16443
16444 cat >>$CONFIG_STATUS <<EOF
16445
16446 #
16447 # CONFIG_FILES section.
16448 #
16449
16450 # No need to generate the scripts if there are no CONFIG_FILES.
16451 # This happens for instance when ./config.status config.h
16452 if test -n "\$CONFIG_FILES"; then
16453   # Protect against being on the right side of a sed subst in config.status.
16454   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
16455    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
16456 s,@SHELL@,$SHELL,;t t
16457 s,@exec_prefix@,$exec_prefix,;t t
16458 s,@prefix@,$prefix,;t t
16459 s,@program_transform_name@,$program_transform_name,;t t
16460 s,@bindir@,$bindir,;t t
16461 s,@sbindir@,$sbindir,;t t
16462 s,@libexecdir@,$libexecdir,;t t
16463 s,@datarootdir@,$datarootdir,;t t
16464 s,@datadir@,$datadir,;t t
16465 s,@sysconfdir@,$sysconfdir,;t t
16466 s,@sharedstatedir@,$sharedstatedir,;t t
16467 s,@localstatedir@,$localstatedir,;t t
16468 s,@libdir@,$libdir,;t t
16469 s,@includedir@,$includedir,;t t
16470 s,@oldincludedir@,$oldincludedir,;t t
16471 s,@infodir@,$infodir,;t t
16472 s,@mandir@,$mandir,;t t
16473 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
16474 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
16475 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
16476 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
16477 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
16478 s,@build_alias@,$build_alias,;t t
16479 s,@host_alias@,$host_alias,;t t
16480 s,@target_alias@,$target_alias,;t t
16481 s,@ECHO_C@,$ECHO_C,;t t
16482 s,@ECHO_N@,$ECHO_N,;t t
16483 s,@ECHO_T@,$ECHO_T,;t t
16484 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
16485 s,@DEFS@,$DEFS,;t t
16486 s,@LIBS@,$LIBS,;t t
16487 s,@build@,$build,;t t
16488 s,@build_cpu@,$build_cpu,;t t
16489 s,@build_vendor@,$build_vendor,;t t
16490 s,@build_os@,$build_os,;t t
16491 s,@host@,$host,;t t
16492 s,@host_cpu@,$host_cpu,;t t
16493 s,@host_vendor@,$host_vendor,;t t
16494 s,@host_os@,$host_os,;t t
16495 s,@SET_MAKE@,$SET_MAKE,;t t
16496 s,@CC@,$CC,;t t
16497 s,@CFLAGS@,$CFLAGS,;t t
16498 s,@LDFLAGS@,$LDFLAGS,;t t
16499 s,@CPPFLAGS@,$CPPFLAGS,;t t
16500 s,@ac_ct_CC@,$ac_ct_CC,;t t
16501 s,@EXEEXT@,$EXEEXT,;t t
16502 s,@OBJEXT@,$OBJEXT,;t t
16503 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
16504 s,@CPP@,$CPP,;t t
16505 s,@AWK@,$AWK,;t t
16506 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
16507 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
16508 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
16509 s,@LINT@,$LINT,;t t
16510 s,@LINT_OPTS@,$LINT_OPTS,;t t
16511 s,@CTAGS@,$CTAGS,;t t
16512 s,@ETAGS@,$ETAGS,;t t
16513 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
16514 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
16515 s,@MATH_LIB@,$MATH_LIB,;t t
16516 s,@top_builddir@,$top_builddir,;t t
16517 s,@CC_G_OPT@,$CC_G_OPT,;t t
16518 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
16519 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
16520 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
16521 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
16522 s,@LD@,$LD,;t t
16523 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
16524 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
16525 s,@LD_MODEL@,$LD_MODEL,;t t
16526 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
16527 s,@LIBTOOL@,$LIBTOOL,;t t
16528 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
16529 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
16530 s,@LIB_LINK@,$LIB_LINK,;t t
16531 s,@LINK_TESTS@,$LINK_TESTS,;t t
16532 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
16533 s,@PTHREAD@,$PTHREAD,;t t
16534 s,@TEST_ARGS@,$TEST_ARGS,;t t
16535 s,@TEST_DEPS@,$TEST_DEPS,;t t
16536 s,@TEST_LIBS@,$TEST_LIBS,;t t
16537 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
16538 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
16539 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
16540 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
16541 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
16542 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
16543 s,@ECHO_LT@,$ECHO_LT,;t t
16544 s,@ECHO_LD@,$ECHO_LD,;t t
16545 s,@RULE_CC@,$RULE_CC,;t t
16546 s,@SHOW_CC@,$SHOW_CC,;t t
16547 s,@ECHO_CC@,$ECHO_CC,;t t
16548 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
16549 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
16550 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
16551 s,@X_CFLAGS@,$X_CFLAGS,;t t
16552 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
16553 s,@X_LIBS@,$X_LIBS,;t t
16554 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
16555 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
16556 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
16557 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
16558 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
16559 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
16560 CEOF
16561
16562 EOF
16563
16564   cat >>$CONFIG_STATUS <<\EOF
16565   # Split the substitutions into bite-sized pieces for seds with
16566   # small command number limits, like on Digital OSF/1 and HP-UX.
16567   ac_max_sed_lines=48
16568   ac_sed_frag=1 # Number of current file.
16569   ac_beg=1 # First line for current file.
16570   ac_end=$ac_max_sed_lines # Line after last line for current file.
16571   ac_more_lines=:
16572   ac_sed_cmds=
16573   while $ac_more_lines; do
16574     if test $ac_beg -gt 1; then
16575       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16576     else
16577       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16578     fi
16579     if test ! -s $tmp/subs.frag; then
16580       ac_more_lines=false
16581     else
16582       # The purpose of the label and of the branching condition is to
16583       # speed up the sed processing (if there are no `@' at all, there
16584       # is no need to browse any of the substitutions).
16585       # These are the two extra sed commands mentioned above.
16586       (echo ':t
16587   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
16588       if test -z "$ac_sed_cmds"; then
16589         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
16590       else
16591         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
16592       fi
16593       ac_sed_frag=`expr $ac_sed_frag + 1`
16594       ac_beg=$ac_end
16595       ac_end=`expr $ac_end + $ac_max_sed_lines`
16596     fi
16597   done
16598   if test -z "$ac_sed_cmds"; then
16599     ac_sed_cmds=cat
16600   fi
16601 fi # test -n "$CONFIG_FILES"
16602
16603 EOF
16604 cat >>$CONFIG_STATUS <<\EOF
16605 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
16606   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16607   case $ac_file in
16608   - | *:- | *:-:* ) # input from stdin
16609         cat >$tmp/stdin
16610         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16611         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16612   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16613         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16614   * )   ac_file_in=$ac_file.in ;;
16615   esac
16616
16617   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
16618   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16619          X"$ac_file" : 'X\(//\)[^/]' \| \
16620          X"$ac_file" : 'X\(//\)$' \| \
16621          X"$ac_file" : 'X\(/\)' \| \
16622          .     : '\(.\)' 2>/dev/null ||
16623 echo X"$ac_file" |
16624     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16625           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16626           /^X\(\/\/\)$/{ s//\1/; q; }
16627           /^X\(\/\).*/{ s//\1/; q; }
16628           s/.*/./; q'`
16629   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16630     { case "$ac_dir" in
16631   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16632   *)                      as_incr_dir=.;;
16633 esac
16634 as_dummy="$ac_dir"
16635 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16636   case $as_mkdir_dir in
16637     # Skip DOS drivespec
16638     ?:) as_incr_dir=$as_mkdir_dir ;;
16639     *)
16640       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16641       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16642     ;;
16643   esac
16644 done; }
16645
16646     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
16647     # A "../" for each directory in $ac_dir_suffix.
16648     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
16649   else
16650     ac_dir_suffix= ac_dots=
16651   fi
16652
16653   case $srcdir in
16654   .)  ac_srcdir=.
16655       if test -z "$ac_dots"; then
16656          ac_top_srcdir=.
16657       else
16658          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
16659       fi ;;
16660   [\\/]* | ?:[\\/]* )
16661       ac_srcdir=$srcdir$ac_dir_suffix;
16662       ac_top_srcdir=$srcdir ;;
16663   *) # Relative path.
16664     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
16665     ac_top_srcdir=$ac_dots$srcdir ;;
16666   esac
16667
16668   case $INSTALL in
16669   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
16670   *) ac_INSTALL=$ac_dots$INSTALL ;;
16671   esac
16672
16673   if test x"$ac_file" != x-; then
16674     { echo "$as_me:16674: creating $ac_file" >&5
16675 echo "$as_me: creating $ac_file" >&6;}
16676     rm -f "$ac_file"
16677   fi
16678   # Let's still pretend it is `configure' which instantiates (i.e., don't
16679   # use $as_me), people would be surprised to read:
16680   #    /* config.h.  Generated automatically by config.status.  */
16681   configure_input="Generated automatically from `echo $ac_file_in |
16682                                                  sed 's,.*/,,'` by configure."
16683
16684   # First look for the input files in the build tree, otherwise in the
16685   # src tree.
16686   ac_file_inputs=`IFS=:
16687     for f in $ac_file_in; do
16688       case $f in
16689       -) echo $tmp/stdin ;;
16690       [\\/$]*)
16691          # Absolute (can't be DOS-style, as IFS=:)
16692          test -f "$f" || { { echo "$as_me:16692: error: cannot find input file: $f" >&5
16693 echo "$as_me: error: cannot find input file: $f" >&2;}
16694    { (exit 1); exit 1; }; }
16695          echo $f;;
16696       *) # Relative
16697          if test -f "$f"; then
16698            # Build tree
16699            echo $f
16700          elif test -f "$srcdir/$f"; then
16701            # Source tree
16702            echo $srcdir/$f
16703          else
16704            # /dev/null tree
16705            { { echo "$as_me:16705: error: cannot find input file: $f" >&5
16706 echo "$as_me: error: cannot find input file: $f" >&2;}
16707    { (exit 1); exit 1; }; }
16708          fi;;
16709       esac
16710     done` || { (exit 1); exit 1; }
16711 EOF
16712 cat >>$CONFIG_STATUS <<\EOF
16713   ac_warn_datarootdir=no
16714   if test x"$ac_file" != x-; then
16715     for ac_item in $ac_file_inputs
16716     do
16717       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
16718       if test -n "$ac_seen"; then
16719         ac_used=`grep '@datarootdir@' $ac_item`
16720         if test -z "$ac_used"; then
16721           { echo "$as_me:16721: WARNING: datarootdir was used implicitly but not set:
16722 $ac_seen" >&5
16723 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
16724 $ac_seen" >&2;}
16725           ac_warn_datarootdir=yes
16726         fi
16727       fi
16728       ac_seen=`grep '${datarootdir}' $ac_item`
16729       if test -n "$ac_seen"; then
16730         { echo "$as_me:16730: WARNING: datarootdir was used explicitly but not set:
16731 $ac_seen" >&5
16732 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
16733 $ac_seen" >&2;}
16734         ac_warn_datarootdir=yes
16735       fi
16736     done
16737   fi
16738
16739 if test "x$ac_warn_datarootdir" = xyes; then
16740   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
16741 fi
16742
16743 EOF
16744 cat >>$CONFIG_STATUS <<EOF
16745   sed "$ac_vpsub
16746 $extrasub
16747 EOF
16748 cat >>$CONFIG_STATUS <<\EOF
16749 :t
16750 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
16751 s,@configure_input@,$configure_input,;t t
16752 s,@srcdir@,$ac_srcdir,;t t
16753 s,@top_srcdir@,$ac_top_srcdir,;t t
16754 s,@INSTALL@,$ac_INSTALL,;t t
16755 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
16756   rm -f $tmp/stdin
16757   if test x"$ac_file" != x-; then
16758     cp $tmp/out $ac_file
16759
16760     for ac_name in prefix exec_prefix datarootdir
16761     do
16762         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
16763         if test -n "$ac_seen"; then
16764             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
16765             if test -z "$ac_init"; then
16766               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
16767               { echo "$as_me:16767: WARNING: Variable $ac_name is used but was not set:
16768 $ac_seen" >&5
16769 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
16770 $ac_seen" >&2;}
16771             fi
16772         fi
16773     done
16774     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
16775     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
16776     if test -s $tmp/out; then
16777       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
16778       { echo "$as_me:16778: WARNING: Some variables may not be substituted:
16779 $ac_seen" >&5
16780 echo "$as_me: WARNING: Some variables may not be substituted:
16781 $ac_seen" >&2;}
16782     fi
16783   else
16784     cat $tmp/out
16785   fi
16786   rm -f $tmp/out
16787
16788 done
16789 EOF
16790 cat >>$CONFIG_STATUS <<\EOF
16791
16792 #
16793 # CONFIG_HEADER section.
16794 #
16795
16796 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
16797 # NAME is the cpp macro being defined and VALUE is the value it is being given.
16798 #
16799 # ac_d sets the value in "#define NAME VALUE" lines.
16800 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
16801 ac_dB='[        ].*$,\1#\2'
16802 ac_dC=' '
16803 ac_dD=',;t'
16804 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
16805 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16806 ac_iB='\([      ]\),\1#\2define\3'
16807 ac_iC=' '
16808 ac_iD='\4,;t'
16809 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16810 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16811 ac_uB='$,\1#\2define\3'
16812 ac_uC=' '
16813 ac_uD=',;t'
16814
16815 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
16816   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16817   case $ac_file in
16818   - | *:- | *:-:* ) # input from stdin
16819         cat >$tmp/stdin
16820         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16821         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16822   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16823         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16824   * )   ac_file_in=$ac_file.in ;;
16825   esac
16826
16827   test x"$ac_file" != x- && { echo "$as_me:16827: creating $ac_file" >&5
16828 echo "$as_me: creating $ac_file" >&6;}
16829
16830   # First look for the input files in the build tree, otherwise in the
16831   # src tree.
16832   ac_file_inputs=`IFS=:
16833     for f in $ac_file_in; do
16834       case $f in
16835       -) echo $tmp/stdin ;;
16836       [\\/$]*)
16837          # Absolute (can't be DOS-style, as IFS=:)
16838          test -f "$f" || { { echo "$as_me:16838: error: cannot find input file: $f" >&5
16839 echo "$as_me: error: cannot find input file: $f" >&2;}
16840    { (exit 1); exit 1; }; }
16841          echo $f;;
16842       *) # Relative
16843          if test -f "$f"; then
16844            # Build tree
16845            echo $f
16846          elif test -f "$srcdir/$f"; then
16847            # Source tree
16848            echo $srcdir/$f
16849          else
16850            # /dev/null tree
16851            { { echo "$as_me:16851: error: cannot find input file: $f" >&5
16852 echo "$as_me: error: cannot find input file: $f" >&2;}
16853    { (exit 1); exit 1; }; }
16854          fi;;
16855       esac
16856     done` || { (exit 1); exit 1; }
16857   # Remove the trailing spaces.
16858   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
16859
16860 EOF
16861
16862 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
16863 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
16864 # be either 'cat' or 'sort'.
16865 cat confdefs.h | uniq >conftest.vals
16866
16867 # Break up conftest.vals because some shells have a limit on
16868 # the size of here documents, and old seds have small limits too.
16869
16870 rm -f conftest.tail
16871 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
16872 while grep . conftest.vals >/dev/null
16873 do
16874   # Write chunks of a limited-size here document to conftest.frag.
16875   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
16876   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
16877   echo 'CEOF' >> $CONFIG_STATUS
16878   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
16879   rm -f conftest.vals
16880   mv conftest.tail conftest.vals
16881 done
16882 rm -f conftest.vals
16883
16884 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
16885 # marker @DEFS@.
16886 echo '  cat >> conftest.edit <<CEOF
16887 /@DEFS@/r conftest.frag
16888 /@DEFS@/d
16889 CEOF
16890 sed -f conftest.edit $tmp/in > $tmp/out
16891 rm -f $tmp/in
16892 mv $tmp/out $tmp/in
16893 rm -f conftest.edit conftest.frag
16894 ' >> $CONFIG_STATUS
16895
16896 cat >>$CONFIG_STATUS <<\EOF
16897   # Let's still pretend it is `configure' which instantiates (i.e., don't
16898   # use $as_me), people would be surprised to read:
16899   #    /* config.h.  Generated automatically by config.status.  */
16900   if test x"$ac_file" = x-; then
16901     echo "/* Generated automatically by configure.  */" >$tmp/config.h
16902   else
16903     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
16904   fi
16905   cat $tmp/in >>$tmp/config.h
16906   rm -f $tmp/in
16907   if test x"$ac_file" != x-; then
16908     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
16909       { echo "$as_me:16909: $ac_file is unchanged" >&5
16910 echo "$as_me: $ac_file is unchanged" >&6;}
16911     else
16912       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16913          X"$ac_file" : 'X\(//\)[^/]' \| \
16914          X"$ac_file" : 'X\(//\)$' \| \
16915          X"$ac_file" : 'X\(/\)' \| \
16916          .     : '\(.\)' 2>/dev/null ||
16917 echo X"$ac_file" |
16918     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16919           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16920           /^X\(\/\/\)$/{ s//\1/; q; }
16921           /^X\(\/\).*/{ s//\1/; q; }
16922           s/.*/./; q'`
16923       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16924         { case "$ac_dir" in
16925   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16926   *)                      as_incr_dir=.;;
16927 esac
16928 as_dummy="$ac_dir"
16929 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16930   case $as_mkdir_dir in
16931     # Skip DOS drivespec
16932     ?:) as_incr_dir=$as_mkdir_dir ;;
16933     *)
16934       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16935       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16936     ;;
16937   esac
16938 done; }
16939
16940       fi
16941       rm -f $ac_file
16942       mv $tmp/config.h $ac_file
16943     fi
16944   else
16945     cat $tmp/config.h
16946     rm -f $tmp/config.h
16947   fi
16948 done
16949 EOF
16950 cat >>$CONFIG_STATUS <<\EOF
16951 #
16952 # CONFIG_COMMANDS section.
16953 #
16954 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
16955   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
16956   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
16957
16958   case $ac_dest in
16959     default )
16960
16961 for cf_dir in .
16962 do
16963         if test ! -d $srcdir/$cf_dir; then
16964                 continue
16965         elif test -f $srcdir/$cf_dir/programs; then
16966                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
16967         fi
16968 done
16969
16970         cat >>Makefile <<TEST_EOF
16971
16972 # These rules are generated so we do not rely on suffix rules, which do not
16973 # work consistently for different make-programs (the '\$(MODEL)/' confuses
16974 # some, and the '\$x' confuses others).
16975 TEST_EOF
16976
16977 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
16978 for N in $LIST
16979 do
16980         cat >>Makefile <<TEST_EOF
16981
16982 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
16983         \$(srcdir)/test.priv.h \\
16984         ncurses_cfg.h
16985         $SHOW_CC
16986         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
16987 TEST_EOF
16988 done
16989
16990 if test -f ../config.guess && test -f ../config.sub
16991 then
16992         cat >>Makefile <<TEST_EOF
16993
16994 # if we used CF_INHERIT for getting these files, we can remove them
16995 distclean::
16996         rm -f config.guess config.sub
16997 TEST_EOF
16998 fi
16999  ;;
17000   esac
17001 done
17002 EOF
17003
17004 cat >>$CONFIG_STATUS <<\EOF
17005
17006 { (exit 0); exit 0; }
17007 EOF
17008 chmod +x $CONFIG_STATUS
17009 ac_clean_files=$ac_clean_files_save
17010
17011 # configure is writing to config.log, and then calls config.status.
17012 # config.status does its own redirection, appending to config.log.
17013 # Unfortunately, on DOS this fails, as config.log is still kept open
17014 # by configure, so config.status won't be able to write to it; its
17015 # output is simply discarded.  So we exec the FD to /dev/null,
17016 # effectively closing config.log, so it can be properly (re)opened and
17017 # appended to by config.status.  When coming back to configure, we
17018 # need to make the FD available again.
17019 if test "$no_create" != yes; then
17020   ac_cs_success=:
17021   exec 5>/dev/null
17022   $SHELL $CONFIG_STATUS || ac_cs_success=false
17023   exec 5>>config.log
17024   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17025   # would make configure fail if this is the last instruction.
17026   $ac_cs_success || { (exit 1); exit 1; }
17027 fi
17028