]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.9 - patch 20121026
[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", sin(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     cf_term_lib=""
5107     cf_curs_lib=""
5108
5109     if test ".${cf_cv_ncurses_version:-no}" != .no
5110     then
5111         cf_check_list="ncurses curses cursesX"
5112     else
5113         cf_check_list="cursesX curses ncurses"
5114     fi
5115
5116     # Check for library containing tgoto.  Do this before curses library
5117     # because it may be needed to link the test-case for initscr.
5118     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     # Check for library containing initscr
5241     test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5242         for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5243     do
5244         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5245 echo "$as_me:5245: checking for initscr in -l$cf_curs_lib" >&5
5246 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5247 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5248   echo $ECHO_N "(cached) $ECHO_C" >&6
5249 else
5250   ac_check_lib_save_LIBS=$LIBS
5251 LIBS="-l$cf_curs_lib  $LIBS"
5252 cat >conftest.$ac_ext <<_ACEOF
5253 #line 5253 "configure"
5254 #include "confdefs.h"
5255
5256 /* Override any gcc2 internal prototype to avoid an error.  */
5257 #ifdef __cplusplus
5258 extern "C"
5259 #endif
5260 /* We use char because int might match the return type of a gcc2
5261    builtin and then its argument prototype would still apply.  */
5262 char initscr ();
5263 int
5264 main ()
5265 {
5266 initscr ();
5267   ;
5268   return 0;
5269 }
5270 _ACEOF
5271 rm -f conftest.$ac_objext conftest$ac_exeext
5272 if { (eval echo "$as_me:5272: \"$ac_link\"") >&5
5273   (eval $ac_link) 2>&5
5274   ac_status=$?
5275   echo "$as_me:5275: \$? = $ac_status" >&5
5276   (exit $ac_status); } &&
5277          { ac_try='test -s conftest$ac_exeext'
5278   { (eval echo "$as_me:5278: \"$ac_try\"") >&5
5279   (eval $ac_try) 2>&5
5280   ac_status=$?
5281   echo "$as_me:5281: \$? = $ac_status" >&5
5282   (exit $ac_status); }; }; then
5283   eval "$as_ac_Lib=yes"
5284 else
5285   echo "$as_me: failed program was:" >&5
5286 cat conftest.$ac_ext >&5
5287 eval "$as_ac_Lib=no"
5288 fi
5289 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5290 LIBS=$ac_check_lib_save_LIBS
5291 fi
5292 echo "$as_me:5292: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5293 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5294 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5295   break
5296 fi
5297
5298     done
5299     test $cf_curs_lib = unknown && { { echo "$as_me:5299: error: no curses library found" >&5
5300 echo "$as_me: error: no curses library found" >&2;}
5301    { (exit 1); exit 1; }; }
5302
5303     LIBS="-l$cf_curs_lib $cf_save_LIBS"
5304     if test "$cf_term_lib" = unknown ; then
5305         echo "$as_me:5305: checking if we can link with $cf_curs_lib library" >&5
5306 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5307         cat >conftest.$ac_ext <<_ACEOF
5308 #line 5308 "configure"
5309 #include "confdefs.h"
5310 #include <${cf_cv_ncurses_header:-curses.h}>
5311 int
5312 main ()
5313 {
5314 initscr()
5315   ;
5316   return 0;
5317 }
5318 _ACEOF
5319 rm -f conftest.$ac_objext conftest$ac_exeext
5320 if { (eval echo "$as_me:5320: \"$ac_link\"") >&5
5321   (eval $ac_link) 2>&5
5322   ac_status=$?
5323   echo "$as_me:5323: \$? = $ac_status" >&5
5324   (exit $ac_status); } &&
5325          { ac_try='test -s conftest$ac_exeext'
5326   { (eval echo "$as_me:5326: \"$ac_try\"") >&5
5327   (eval $ac_try) 2>&5
5328   ac_status=$?
5329   echo "$as_me:5329: \$? = $ac_status" >&5
5330   (exit $ac_status); }; }; then
5331   cf_result=yes
5332 else
5333   echo "$as_me: failed program was:" >&5
5334 cat conftest.$ac_ext >&5
5335 cf_result=no
5336 fi
5337 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5338         echo "$as_me:5338: result: $cf_result" >&5
5339 echo "${ECHO_T}$cf_result" >&6
5340         test $cf_result = no && { { echo "$as_me:5340: error: Cannot link curses library" >&5
5341 echo "$as_me: error: Cannot link curses library" >&2;}
5342    { (exit 1); exit 1; }; }
5343     elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5344         :
5345     elif test "$cf_term_lib" != predefined ; then
5346         echo "$as_me:5346: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5347 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5348         cat >conftest.$ac_ext <<_ACEOF
5349 #line 5349 "configure"
5350 #include "confdefs.h"
5351 #include <${cf_cv_ncurses_header:-curses.h}>
5352 int
5353 main ()
5354 {
5355 initscr(); tgoto((char *)0, 0, 0);
5356   ;
5357   return 0;
5358 }
5359 _ACEOF
5360 rm -f conftest.$ac_objext conftest$ac_exeext
5361 if { (eval echo "$as_me:5361: \"$ac_link\"") >&5
5362   (eval $ac_link) 2>&5
5363   ac_status=$?
5364   echo "$as_me:5364: \$? = $ac_status" >&5
5365   (exit $ac_status); } &&
5366          { ac_try='test -s conftest$ac_exeext'
5367   { (eval echo "$as_me:5367: \"$ac_try\"") >&5
5368   (eval $ac_try) 2>&5
5369   ac_status=$?
5370   echo "$as_me:5370: \$? = $ac_status" >&5
5371   (exit $ac_status); }; }; then
5372   cf_result=no
5373 else
5374   echo "$as_me: failed program was:" >&5
5375 cat conftest.$ac_ext >&5
5376
5377             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5378             cat >conftest.$ac_ext <<_ACEOF
5379 #line 5379 "configure"
5380 #include "confdefs.h"
5381 #include <${cf_cv_ncurses_header:-curses.h}>
5382 int
5383 main ()
5384 {
5385 initscr()
5386   ;
5387   return 0;
5388 }
5389 _ACEOF
5390 rm -f conftest.$ac_objext conftest$ac_exeext
5391 if { (eval echo "$as_me:5391: \"$ac_link\"") >&5
5392   (eval $ac_link) 2>&5
5393   ac_status=$?
5394   echo "$as_me:5394: \$? = $ac_status" >&5
5395   (exit $ac_status); } &&
5396          { ac_try='test -s conftest$ac_exeext'
5397   { (eval echo "$as_me:5397: \"$ac_try\"") >&5
5398   (eval $ac_try) 2>&5
5399   ac_status=$?
5400   echo "$as_me:5400: \$? = $ac_status" >&5
5401   (exit $ac_status); }; }; then
5402   cf_result=yes
5403 else
5404   echo "$as_me: failed program was:" >&5
5405 cat conftest.$ac_ext >&5
5406 cf_result=error
5407 fi
5408 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5409
5410 fi
5411 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5412         echo "$as_me:5412: result: $cf_result" >&5
5413 echo "${ECHO_T}$cf_result" >&6
5414     fi
5415 fi
5416 fi
5417
5418         ;;
5419 ncurses) #(vi
5420
5421 cf_ncuconfig_root=ncurses
5422
5423 echo "Looking for ${cf_ncuconfig_root}-config"
5424
5425 if test -n "$ac_tool_prefix"; then
5426   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5427   do
5428     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5429 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5430 echo "$as_me:5430: checking for $ac_word" >&5
5431 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5432 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5433   echo $ECHO_N "(cached) $ECHO_C" >&6
5434 else
5435   if test -n "$NCURSES_CONFIG"; then
5436   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5437 else
5438   ac_save_IFS=$IFS; IFS=$ac_path_separator
5439 ac_dummy="$PATH"
5440 for ac_dir in $ac_dummy; do
5441   IFS=$ac_save_IFS
5442   test -z "$ac_dir" && ac_dir=.
5443   $as_executable_p "$ac_dir/$ac_word" || continue
5444 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5445 echo "$as_me:5445: found $ac_dir/$ac_word" >&5
5446 break
5447 done
5448
5449 fi
5450 fi
5451 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5452 if test -n "$NCURSES_CONFIG"; then
5453   echo "$as_me:5453: result: $NCURSES_CONFIG" >&5
5454 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5455 else
5456   echo "$as_me:5456: result: no" >&5
5457 echo "${ECHO_T}no" >&6
5458 fi
5459
5460     test -n "$NCURSES_CONFIG" && break
5461   done
5462 fi
5463 if test -z "$NCURSES_CONFIG"; then
5464   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5465   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5466 do
5467   # Extract the first word of "$ac_prog", so it can be a program name with args.
5468 set dummy $ac_prog; ac_word=$2
5469 echo "$as_me:5469: checking for $ac_word" >&5
5470 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5471 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5472   echo $ECHO_N "(cached) $ECHO_C" >&6
5473 else
5474   if test -n "$ac_ct_NCURSES_CONFIG"; then
5475   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5476 else
5477   ac_save_IFS=$IFS; IFS=$ac_path_separator
5478 ac_dummy="$PATH"
5479 for ac_dir in $ac_dummy; do
5480   IFS=$ac_save_IFS
5481   test -z "$ac_dir" && ac_dir=.
5482   $as_executable_p "$ac_dir/$ac_word" || continue
5483 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5484 echo "$as_me:5484: found $ac_dir/$ac_word" >&5
5485 break
5486 done
5487
5488 fi
5489 fi
5490 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5491 if test -n "$ac_ct_NCURSES_CONFIG"; then
5492   echo "$as_me:5492: result: $ac_ct_NCURSES_CONFIG" >&5
5493 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5494 else
5495   echo "$as_me:5495: result: no" >&5
5496 echo "${ECHO_T}no" >&6
5497 fi
5498
5499   test -n "$ac_ct_NCURSES_CONFIG" && break
5500 done
5501 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5502
5503   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5504 fi
5505
5506 if test "$NCURSES_CONFIG" != none ; then
5507
5508 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5509 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
5510
5511 # even with config script, some packages use no-override for curses.h
5512
5513 echo "$as_me:5513: checking if we have identified curses headers" >&5
5514 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5515 if test "${cf_cv_ncurses_header+set}" = set; then
5516   echo $ECHO_N "(cached) $ECHO_C" >&6
5517 else
5518
5519 cf_cv_ncurses_header=none
5520 for cf_header in  \
5521     ncurses/ncurses.h \
5522         ncurses/curses.h \
5523         ncurses.h \
5524         curses.h
5525 do
5526 cat >conftest.$ac_ext <<_ACEOF
5527 #line 5527 "configure"
5528 #include "confdefs.h"
5529 #include <${cf_header}>
5530 int
5531 main ()
5532 {
5533 initscr(); tgoto("?", 0,0)
5534   ;
5535   return 0;
5536 }
5537 _ACEOF
5538 rm -f conftest.$ac_objext
5539 if { (eval echo "$as_me:5539: \"$ac_compile\"") >&5
5540   (eval $ac_compile) 2>&5
5541   ac_status=$?
5542   echo "$as_me:5542: \$? = $ac_status" >&5
5543   (exit $ac_status); } &&
5544          { ac_try='test -s conftest.$ac_objext'
5545   { (eval echo "$as_me:5545: \"$ac_try\"") >&5
5546   (eval $ac_try) 2>&5
5547   ac_status=$?
5548   echo "$as_me:5548: \$? = $ac_status" >&5
5549   (exit $ac_status); }; }; then
5550   cf_cv_ncurses_header=$cf_header; break
5551 else
5552   echo "$as_me: failed program was:" >&5
5553 cat conftest.$ac_ext >&5
5554 fi
5555 rm -f conftest.$ac_objext conftest.$ac_ext
5556 done
5557
5558 fi
5559 echo "$as_me:5559: result: $cf_cv_ncurses_header" >&5
5560 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5561
5562 if test "$cf_cv_ncurses_header" = none ; then
5563         { { echo "$as_me:5563: error: No curses header-files found" >&5
5564 echo "$as_me: error: No curses header-files found" >&2;}
5565    { (exit 1); exit 1; }; }
5566 fi
5567
5568 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5569
5570 for ac_header in $cf_cv_ncurses_header
5571 do
5572 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5573 echo "$as_me:5573: checking for $ac_header" >&5
5574 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5575 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5576   echo $ECHO_N "(cached) $ECHO_C" >&6
5577 else
5578   cat >conftest.$ac_ext <<_ACEOF
5579 #line 5579 "configure"
5580 #include "confdefs.h"
5581 #include <$ac_header>
5582 _ACEOF
5583 if { (eval echo "$as_me:5583: \"$ac_cpp conftest.$ac_ext\"") >&5
5584   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5585   ac_status=$?
5586   egrep -v '^ *\+' conftest.er1 >conftest.err
5587   rm -f conftest.er1
5588   cat conftest.err >&5
5589   echo "$as_me:5589: \$? = $ac_status" >&5
5590   (exit $ac_status); } >/dev/null; then
5591   if test -s conftest.err; then
5592     ac_cpp_err=$ac_c_preproc_warn_flag
5593   else
5594     ac_cpp_err=
5595   fi
5596 else
5597   ac_cpp_err=yes
5598 fi
5599 if test -z "$ac_cpp_err"; then
5600   eval "$as_ac_Header=yes"
5601 else
5602   echo "$as_me: failed program was:" >&5
5603   cat conftest.$ac_ext >&5
5604   eval "$as_ac_Header=no"
5605 fi
5606 rm -f conftest.err conftest.$ac_ext
5607 fi
5608 echo "$as_me:5608: result: `eval echo '${'$as_ac_Header'}'`" >&5
5609 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5610 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5611   cat >>confdefs.h <<EOF
5612 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5613 EOF
5614
5615 fi
5616 done
5617
5618 cat >>confdefs.h <<\EOF
5619 #define NCURSES 1
5620 EOF
5621
5622 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5623
5624 cat >>confdefs.h <<EOF
5625 #define $cf_nculib_ROOT 1
5626 EOF
5627
5628 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5629
5630 else
5631
5632 cf_ncuhdr_root=ncurses
5633
5634 test -n "$cf_cv_curses_dir" && \
5635 test "$cf_cv_curses_dir" != "no" && { \
5636
5637 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5638   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5639   do
5640         while test $cf_add_incdir != /usr/include
5641         do
5642           if test -d $cf_add_incdir
5643           then
5644                 cf_have_incdir=no
5645                 if test -n "$CFLAGS$CPPFLAGS" ; then
5646                   # a loop is needed to ensure we can add subdirs of existing dirs
5647                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5648                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5649                           cf_have_incdir=yes; break
5650                         fi
5651                   done
5652                 fi
5653
5654                 if test "$cf_have_incdir" = no ; then
5655                   if test "$cf_add_incdir" = /usr/local/include ; then
5656                         if test "$GCC" = yes
5657                         then
5658                           cf_save_CPPFLAGS=$CPPFLAGS
5659                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5660                           cat >conftest.$ac_ext <<_ACEOF
5661 #line 5661 "configure"
5662 #include "confdefs.h"
5663 #include <stdio.h>
5664 int
5665 main ()
5666 {
5667 printf("Hello")
5668   ;
5669   return 0;
5670 }
5671 _ACEOF
5672 rm -f conftest.$ac_objext
5673 if { (eval echo "$as_me:5673: \"$ac_compile\"") >&5
5674   (eval $ac_compile) 2>&5
5675   ac_status=$?
5676   echo "$as_me:5676: \$? = $ac_status" >&5
5677   (exit $ac_status); } &&
5678          { ac_try='test -s conftest.$ac_objext'
5679   { (eval echo "$as_me:5679: \"$ac_try\"") >&5
5680   (eval $ac_try) 2>&5
5681   ac_status=$?
5682   echo "$as_me:5682: \$? = $ac_status" >&5
5683   (exit $ac_status); }; }; then
5684   :
5685 else
5686   echo "$as_me: failed program was:" >&5
5687 cat conftest.$ac_ext >&5
5688 cf_have_incdir=yes
5689 fi
5690 rm -f conftest.$ac_objext conftest.$ac_ext
5691                           CPPFLAGS=$cf_save_CPPFLAGS
5692                         fi
5693                   fi
5694                 fi
5695
5696                 if test "$cf_have_incdir" = no ; then
5697                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5698
5699 echo "${as_me:-configure}:5699: testing adding $cf_add_incdir to include-path ..." 1>&5
5700
5701                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5702
5703                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5704                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5705                   cf_add_incdir="$cf_top_incdir"
5706                 else
5707                   break
5708                 fi
5709           fi
5710         done
5711   done
5712 fi
5713
5714 }
5715
5716 echo "$as_me:5716: checking for $cf_ncuhdr_root header in include-path" >&5
5717 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5718 if test "${cf_cv_ncurses_h+set}" = set; then
5719   echo $ECHO_N "(cached) $ECHO_C" >&6
5720 else
5721
5722         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5723         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5724         for cf_header in $cf_header_list
5725         do
5726
5727         cat >conftest.$ac_ext <<_ACEOF
5728 #line 5728 "configure"
5729 #include "confdefs.h"
5730
5731 #include <$cf_header>
5732 int
5733 main ()
5734 {
5735
5736 #ifdef NCURSES_VERSION
5737
5738 printf("%s\n", NCURSES_VERSION);
5739 #else
5740 #ifdef __NCURSES_H
5741 printf("old\n");
5742 #else
5743         make an error
5744 #endif
5745 #endif
5746
5747   ;
5748   return 0;
5749 }
5750 _ACEOF
5751 rm -f conftest.$ac_objext
5752 if { (eval echo "$as_me:5752: \"$ac_compile\"") >&5
5753   (eval $ac_compile) 2>&5
5754   ac_status=$?
5755   echo "$as_me:5755: \$? = $ac_status" >&5
5756   (exit $ac_status); } &&
5757          { ac_try='test -s conftest.$ac_objext'
5758   { (eval echo "$as_me:5758: \"$ac_try\"") >&5
5759   (eval $ac_try) 2>&5
5760   ac_status=$?
5761   echo "$as_me:5761: \$? = $ac_status" >&5
5762   (exit $ac_status); }; }; then
5763   cf_cv_ncurses_h=$cf_header
5764
5765 else
5766   echo "$as_me: failed program was:" >&5
5767 cat conftest.$ac_ext >&5
5768 cf_cv_ncurses_h=no
5769 fi
5770 rm -f conftest.$ac_objext conftest.$ac_ext
5771
5772                 test "$cf_cv_ncurses_h" != no && break
5773         done
5774
5775 fi
5776 echo "$as_me:5776: result: $cf_cv_ncurses_h" >&5
5777 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5778
5779 if test "$cf_cv_ncurses_h" != no ; then
5780         cf_cv_ncurses_header=$cf_cv_ncurses_h
5781 else
5782
5783 echo "$as_me:5783: checking for $cf_ncuhdr_root include-path" >&5
5784 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5785 if test "${cf_cv_ncurses_h2+set}" = set; then
5786   echo $ECHO_N "(cached) $ECHO_C" >&6
5787 else
5788
5789         test -n "$verbose" && echo
5790
5791 cf_search=
5792
5793 # collect the current set of include-directories from compiler flags
5794 cf_header_path_list=""
5795 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5796         for cf_header_path in $CPPFLAGS $CFLAGS
5797         do
5798                 case $cf_header_path in #(vi
5799                 -I*)
5800                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5801
5802 test "$cf_header_path" != "NONE" && \
5803 test -d "$cf_header_path" && \
5804  {
5805         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5806         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5807         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5808         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5809         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5810         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"
5811 }
5812
5813                         cf_header_path_list="$cf_header_path_list $cf_search"
5814                         ;;
5815                 esac
5816         done
5817 fi
5818
5819 # add the variations for the package we are looking for
5820
5821 cf_search=
5822
5823 test "/usr" != "$prefix" && \
5824 test -d "/usr" && \
5825 (test $prefix = NONE || test "/usr" != "$prefix") && {
5826         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
5827         test -d /usr/include &&          cf_search="$cf_search /usr/include"
5828         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
5829         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
5830         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
5831         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5832 }
5833
5834 test "$prefix" != "NONE" && \
5835 test -d "$prefix" && \
5836  {
5837         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5838         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5839         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5840         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5841         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5842         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5843 }
5844
5845 test "/usr/local" != "$prefix" && \
5846 test -d "/usr/local" && \
5847 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
5848         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
5849         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
5850         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
5851         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
5852         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
5853         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5854 }
5855
5856 test "/opt" != "$prefix" && \
5857 test -d "/opt" && \
5858 (test $prefix = NONE || test "/opt" != "$prefix") && {
5859         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
5860         test -d /opt/include &&          cf_search="$cf_search /opt/include"
5861         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
5862         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
5863         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
5864         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5865 }
5866
5867 test "$HOME" != "$prefix" && \
5868 test -d "$HOME" && \
5869 (test $prefix = NONE || test "$HOME" != "$prefix") && {
5870         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
5871         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
5872         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
5873         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
5874         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
5875         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5876 }
5877
5878 test "$includedir" != NONE && \
5879 test "$includedir" != "/usr/include" && \
5880 test -d "$includedir" && {
5881         test -d $includedir &&    cf_search="$cf_search $includedir"
5882         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5883 }
5884
5885 test "$oldincludedir" != NONE && \
5886 test "$oldincludedir" != "/usr/include" && \
5887 test -d "$oldincludedir" && {
5888         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5889         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5890 }
5891
5892 cf_search="$cf_search $cf_header_path_list"
5893
5894         test -n "$verbose" && echo search path $cf_search
5895         cf_save2_CPPFLAGS="$CPPFLAGS"
5896         for cf_incdir in $cf_search
5897         do
5898
5899 if test -n "$cf_incdir" ; then
5900   for cf_add_incdir in $cf_incdir
5901   do
5902         while test $cf_add_incdir != /usr/include
5903         do
5904           if test -d $cf_add_incdir
5905           then
5906                 cf_have_incdir=no
5907                 if test -n "$CFLAGS$CPPFLAGS" ; then
5908                   # a loop is needed to ensure we can add subdirs of existing dirs
5909                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5910                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5911                           cf_have_incdir=yes; break
5912                         fi
5913                   done
5914                 fi
5915
5916                 if test "$cf_have_incdir" = no ; then
5917                   if test "$cf_add_incdir" = /usr/local/include ; then
5918                         if test "$GCC" = yes
5919                         then
5920                           cf_save_CPPFLAGS=$CPPFLAGS
5921                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5922                           cat >conftest.$ac_ext <<_ACEOF
5923 #line 5923 "configure"
5924 #include "confdefs.h"
5925 #include <stdio.h>
5926 int
5927 main ()
5928 {
5929 printf("Hello")
5930   ;
5931   return 0;
5932 }
5933 _ACEOF
5934 rm -f conftest.$ac_objext
5935 if { (eval echo "$as_me:5935: \"$ac_compile\"") >&5
5936   (eval $ac_compile) 2>&5
5937   ac_status=$?
5938   echo "$as_me:5938: \$? = $ac_status" >&5
5939   (exit $ac_status); } &&
5940          { ac_try='test -s conftest.$ac_objext'
5941   { (eval echo "$as_me:5941: \"$ac_try\"") >&5
5942   (eval $ac_try) 2>&5
5943   ac_status=$?
5944   echo "$as_me:5944: \$? = $ac_status" >&5
5945   (exit $ac_status); }; }; then
5946   :
5947 else
5948   echo "$as_me: failed program was:" >&5
5949 cat conftest.$ac_ext >&5
5950 cf_have_incdir=yes
5951 fi
5952 rm -f conftest.$ac_objext conftest.$ac_ext
5953                           CPPFLAGS=$cf_save_CPPFLAGS
5954                         fi
5955                   fi
5956                 fi
5957
5958                 if test "$cf_have_incdir" = no ; then
5959                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5960
5961 echo "${as_me:-configure}:5961: testing adding $cf_add_incdir to include-path ..." 1>&5
5962
5963                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5964
5965                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5966                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5967                   cf_add_incdir="$cf_top_incdir"
5968                 else
5969                   break
5970                 fi
5971           fi
5972         done
5973   done
5974 fi
5975
5976                 for cf_header in \
5977                         ncurses.h \
5978                         curses.h
5979                 do
5980
5981         cat >conftest.$ac_ext <<_ACEOF
5982 #line 5982 "configure"
5983 #include "confdefs.h"
5984
5985 #include <$cf_header>
5986 int
5987 main ()
5988 {
5989
5990 #ifdef NCURSES_VERSION
5991
5992 printf("%s\n", NCURSES_VERSION);
5993 #else
5994 #ifdef __NCURSES_H
5995 printf("old\n");
5996 #else
5997         make an error
5998 #endif
5999 #endif
6000
6001   ;
6002   return 0;
6003 }
6004 _ACEOF
6005 rm -f conftest.$ac_objext
6006 if { (eval echo "$as_me:6006: \"$ac_compile\"") >&5
6007   (eval $ac_compile) 2>&5
6008   ac_status=$?
6009   echo "$as_me:6009: \$? = $ac_status" >&5
6010   (exit $ac_status); } &&
6011          { ac_try='test -s conftest.$ac_objext'
6012   { (eval echo "$as_me:6012: \"$ac_try\"") >&5
6013   (eval $ac_try) 2>&5
6014   ac_status=$?
6015   echo "$as_me:6015: \$? = $ac_status" >&5
6016   (exit $ac_status); }; }; then
6017   cf_cv_ncurses_h2=$cf_header
6018
6019 else
6020   echo "$as_me: failed program was:" >&5
6021 cat conftest.$ac_ext >&5
6022 cf_cv_ncurses_h2=no
6023 fi
6024 rm -f conftest.$ac_objext conftest.$ac_ext
6025
6026                         if test "$cf_cv_ncurses_h2" != no ; then
6027                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6028                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6029                                 break
6030                         fi
6031                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6032                 done
6033                 CPPFLAGS="$cf_save2_CPPFLAGS"
6034                 test "$cf_cv_ncurses_h2" != no && break
6035         done
6036         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6036: error: not found" >&5
6037 echo "$as_me: error: not found" >&2;}
6038    { (exit 1); exit 1; }; }
6039
6040 fi
6041 echo "$as_me:6041: result: $cf_cv_ncurses_h2" >&5
6042 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6043
6044         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6045         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6046         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6047                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6048         fi
6049
6050 if test -n "$cf_1st_incdir" ; then
6051   for cf_add_incdir in $cf_1st_incdir
6052   do
6053         while test $cf_add_incdir != /usr/include
6054         do
6055           if test -d $cf_add_incdir
6056           then
6057                 cf_have_incdir=no
6058                 if test -n "$CFLAGS$CPPFLAGS" ; then
6059                   # a loop is needed to ensure we can add subdirs of existing dirs
6060                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6061                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6062                           cf_have_incdir=yes; break
6063                         fi
6064                   done
6065                 fi
6066
6067                 if test "$cf_have_incdir" = no ; then
6068                   if test "$cf_add_incdir" = /usr/local/include ; then
6069                         if test "$GCC" = yes
6070                         then
6071                           cf_save_CPPFLAGS=$CPPFLAGS
6072                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6073                           cat >conftest.$ac_ext <<_ACEOF
6074 #line 6074 "configure"
6075 #include "confdefs.h"
6076 #include <stdio.h>
6077 int
6078 main ()
6079 {
6080 printf("Hello")
6081   ;
6082   return 0;
6083 }
6084 _ACEOF
6085 rm -f conftest.$ac_objext
6086 if { (eval echo "$as_me:6086: \"$ac_compile\"") >&5
6087   (eval $ac_compile) 2>&5
6088   ac_status=$?
6089   echo "$as_me:6089: \$? = $ac_status" >&5
6090   (exit $ac_status); } &&
6091          { ac_try='test -s conftest.$ac_objext'
6092   { (eval echo "$as_me:6092: \"$ac_try\"") >&5
6093   (eval $ac_try) 2>&5
6094   ac_status=$?
6095   echo "$as_me:6095: \$? = $ac_status" >&5
6096   (exit $ac_status); }; }; then
6097   :
6098 else
6099   echo "$as_me: failed program was:" >&5
6100 cat conftest.$ac_ext >&5
6101 cf_have_incdir=yes
6102 fi
6103 rm -f conftest.$ac_objext conftest.$ac_ext
6104                           CPPFLAGS=$cf_save_CPPFLAGS
6105                         fi
6106                   fi
6107                 fi
6108
6109                 if test "$cf_have_incdir" = no ; then
6110                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6111
6112 echo "${as_me:-configure}:6112: testing adding $cf_add_incdir to include-path ..." 1>&5
6113
6114                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6115
6116                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6117                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6118                   cf_add_incdir="$cf_top_incdir"
6119                 else
6120                   break
6121                 fi
6122           fi
6123         done
6124   done
6125 fi
6126
6127 fi
6128
6129 # Set definitions to allow ifdef'ing for ncurses.h
6130
6131 case $cf_cv_ncurses_header in # (vi
6132 *ncurses.h)
6133
6134 cat >>confdefs.h <<\EOF
6135 #define HAVE_NCURSES_H 1
6136 EOF
6137
6138         ;;
6139 esac
6140
6141 case $cf_cv_ncurses_header in # (vi
6142 ncurses/curses.h|ncurses/ncurses.h)
6143
6144 cat >>confdefs.h <<\EOF
6145 #define HAVE_NCURSES_NCURSES_H 1
6146 EOF
6147
6148         ;;
6149 ncursesw/curses.h|ncursesw/ncurses.h)
6150
6151 cat >>confdefs.h <<\EOF
6152 #define HAVE_NCURSESW_NCURSES_H 1
6153 EOF
6154
6155         ;;
6156 esac
6157
6158 echo "$as_me:6158: checking for terminfo header" >&5
6159 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6160 if test "${cf_cv_term_header+set}" = set; then
6161   echo $ECHO_N "(cached) $ECHO_C" >&6
6162 else
6163
6164 case ${cf_cv_ncurses_header} in #(vi
6165 */ncurses.h|*/ncursesw.h) #(vi
6166         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6167         ;;
6168 *)
6169         cf_term_header=term.h
6170         ;;
6171 esac
6172
6173 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6174 do
6175 cat >conftest.$ac_ext <<_ACEOF
6176 #line 6176 "configure"
6177 #include "confdefs.h"
6178 #include <stdio.h>
6179 #include <${cf_cv_ncurses_header:-curses.h}>
6180 #include <$cf_test>
6181
6182 int
6183 main ()
6184 {
6185 int x = auto_left_margin
6186   ;
6187   return 0;
6188 }
6189 _ACEOF
6190 rm -f conftest.$ac_objext
6191 if { (eval echo "$as_me:6191: \"$ac_compile\"") >&5
6192   (eval $ac_compile) 2>&5
6193   ac_status=$?
6194   echo "$as_me:6194: \$? = $ac_status" >&5
6195   (exit $ac_status); } &&
6196          { ac_try='test -s conftest.$ac_objext'
6197   { (eval echo "$as_me:6197: \"$ac_try\"") >&5
6198   (eval $ac_try) 2>&5
6199   ac_status=$?
6200   echo "$as_me:6200: \$? = $ac_status" >&5
6201   (exit $ac_status); }; }; then
6202
6203         cf_cv_term_header="$cf_test"
6204 else
6205   echo "$as_me: failed program was:" >&5
6206 cat conftest.$ac_ext >&5
6207
6208         cf_cv_term_header=unknown
6209
6210 fi
6211 rm -f conftest.$ac_objext conftest.$ac_ext
6212         test "$cf_cv_term_header" != unknown && break
6213 done
6214
6215 fi
6216 echo "$as_me:6216: result: $cf_cv_term_header" >&5
6217 echo "${ECHO_T}$cf_cv_term_header" >&6
6218
6219 # Set definitions to allow ifdef'ing to accommodate subdirectories
6220
6221 case $cf_cv_term_header in # (vi
6222 *term.h)
6223
6224 cat >>confdefs.h <<\EOF
6225 #define HAVE_TERM_H 1
6226 EOF
6227
6228         ;;
6229 esac
6230
6231 case $cf_cv_term_header in # (vi
6232 ncurses/term.h) #(vi
6233
6234 cat >>confdefs.h <<\EOF
6235 #define HAVE_NCURSES_TERM_H 1
6236 EOF
6237
6238         ;;
6239 ncursesw/term.h)
6240
6241 cat >>confdefs.h <<\EOF
6242 #define HAVE_NCURSESW_TERM_H 1
6243 EOF
6244
6245         ;;
6246 esac
6247
6248 # some applications need this, but should check for NCURSES_VERSION
6249
6250 cat >>confdefs.h <<\EOF
6251 #define NCURSES 1
6252 EOF
6253
6254 echo "$as_me:6254: checking for ncurses version" >&5
6255 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6256 if test "${cf_cv_ncurses_version+set}" = set; then
6257   echo $ECHO_N "(cached) $ECHO_C" >&6
6258 else
6259
6260         cf_cv_ncurses_version=no
6261         cf_tempfile=out$$
6262         rm -f $cf_tempfile
6263         if test "$cross_compiling" = yes; then
6264
6265         # This will not work if the preprocessor splits the line after the
6266         # Autoconf token.  The 'unproto' program does that.
6267         cat > conftest.$ac_ext <<EOF
6268 #include <${cf_cv_ncurses_header:-curses.h}>
6269 #undef Autoconf
6270 #ifdef NCURSES_VERSION
6271 Autoconf NCURSES_VERSION
6272 #else
6273 #ifdef __NCURSES_H
6274 Autoconf "old"
6275 #endif
6276 ;
6277 #endif
6278 EOF
6279         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6280         { (eval echo "$as_me:6280: \"$cf_try\"") >&5
6281   (eval $cf_try) 2>&5
6282   ac_status=$?
6283   echo "$as_me:6283: \$? = $ac_status" >&5
6284   (exit $ac_status); }
6285         if test -f conftest.out ; then
6286                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6287                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6288                 rm -f conftest.out
6289         fi
6290
6291 else
6292   cat >conftest.$ac_ext <<_ACEOF
6293 #line 6293 "configure"
6294 #include "confdefs.h"
6295
6296 #include <${cf_cv_ncurses_header:-curses.h}>
6297 #include <stdio.h>
6298 int main()
6299 {
6300         FILE *fp = fopen("$cf_tempfile", "w");
6301 #ifdef NCURSES_VERSION
6302 # ifdef NCURSES_VERSION_PATCH
6303         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6304 # else
6305         fprintf(fp, "%s\n", NCURSES_VERSION);
6306 # endif
6307 #else
6308 # ifdef __NCURSES_H
6309         fprintf(fp, "old\n");
6310 # else
6311         make an error
6312 # endif
6313 #endif
6314         ${cf_cv_main_return:-return}(0);
6315 }
6316 _ACEOF
6317 rm -f conftest$ac_exeext
6318 if { (eval echo "$as_me:6318: \"$ac_link\"") >&5
6319   (eval $ac_link) 2>&5
6320   ac_status=$?
6321   echo "$as_me:6321: \$? = $ac_status" >&5
6322   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6323   { (eval echo "$as_me:6323: \"$ac_try\"") >&5
6324   (eval $ac_try) 2>&5
6325   ac_status=$?
6326   echo "$as_me:6326: \$? = $ac_status" >&5
6327   (exit $ac_status); }; }; then
6328
6329         cf_cv_ncurses_version=`cat $cf_tempfile`
6330 else
6331   echo "$as_me: program exited with status $ac_status" >&5
6332 echo "$as_me: failed program was:" >&5
6333 cat conftest.$ac_ext >&5
6334 fi
6335 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6336 fi
6337         rm -f $cf_tempfile
6338
6339 fi
6340 echo "$as_me:6340: result: $cf_cv_ncurses_version" >&5
6341 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6342 test "$cf_cv_ncurses_version" = no ||
6343 cat >>confdefs.h <<\EOF
6344 #define NCURSES 1
6345 EOF
6346
6347 cf_nculib_root=ncurses
6348         # This works, except for the special case where we find gpm, but
6349         # ncurses is in a nonstandard location via $LIBS, and we really want
6350         # to link gpm.
6351 cf_ncurses_LIBS=""
6352 cf_ncurses_SAVE="$LIBS"
6353 echo "$as_me:6353: checking for Gpm_Open in -lgpm" >&5
6354 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6355 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6356   echo $ECHO_N "(cached) $ECHO_C" >&6
6357 else
6358   ac_check_lib_save_LIBS=$LIBS
6359 LIBS="-lgpm  $LIBS"
6360 cat >conftest.$ac_ext <<_ACEOF
6361 #line 6361 "configure"
6362 #include "confdefs.h"
6363
6364 /* Override any gcc2 internal prototype to avoid an error.  */
6365 #ifdef __cplusplus
6366 extern "C"
6367 #endif
6368 /* We use char because int might match the return type of a gcc2
6369    builtin and then its argument prototype would still apply.  */
6370 char Gpm_Open ();
6371 int
6372 main ()
6373 {
6374 Gpm_Open ();
6375   ;
6376   return 0;
6377 }
6378 _ACEOF
6379 rm -f conftest.$ac_objext conftest$ac_exeext
6380 if { (eval echo "$as_me:6380: \"$ac_link\"") >&5
6381   (eval $ac_link) 2>&5
6382   ac_status=$?
6383   echo "$as_me:6383: \$? = $ac_status" >&5
6384   (exit $ac_status); } &&
6385          { ac_try='test -s conftest$ac_exeext'
6386   { (eval echo "$as_me:6386: \"$ac_try\"") >&5
6387   (eval $ac_try) 2>&5
6388   ac_status=$?
6389   echo "$as_me:6389: \$? = $ac_status" >&5
6390   (exit $ac_status); }; }; then
6391   ac_cv_lib_gpm_Gpm_Open=yes
6392 else
6393   echo "$as_me: failed program was:" >&5
6394 cat conftest.$ac_ext >&5
6395 ac_cv_lib_gpm_Gpm_Open=no
6396 fi
6397 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6398 LIBS=$ac_check_lib_save_LIBS
6399 fi
6400 echo "$as_me:6400: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6401 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6402 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6403   echo "$as_me:6403: checking for initscr in -lgpm" >&5
6404 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6405 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6406   echo $ECHO_N "(cached) $ECHO_C" >&6
6407 else
6408   ac_check_lib_save_LIBS=$LIBS
6409 LIBS="-lgpm  $LIBS"
6410 cat >conftest.$ac_ext <<_ACEOF
6411 #line 6411 "configure"
6412 #include "confdefs.h"
6413
6414 /* Override any gcc2 internal prototype to avoid an error.  */
6415 #ifdef __cplusplus
6416 extern "C"
6417 #endif
6418 /* We use char because int might match the return type of a gcc2
6419    builtin and then its argument prototype would still apply.  */
6420 char initscr ();
6421 int
6422 main ()
6423 {
6424 initscr ();
6425   ;
6426   return 0;
6427 }
6428 _ACEOF
6429 rm -f conftest.$ac_objext conftest$ac_exeext
6430 if { (eval echo "$as_me:6430: \"$ac_link\"") >&5
6431   (eval $ac_link) 2>&5
6432   ac_status=$?
6433   echo "$as_me:6433: \$? = $ac_status" >&5
6434   (exit $ac_status); } &&
6435          { ac_try='test -s conftest$ac_exeext'
6436   { (eval echo "$as_me:6436: \"$ac_try\"") >&5
6437   (eval $ac_try) 2>&5
6438   ac_status=$?
6439   echo "$as_me:6439: \$? = $ac_status" >&5
6440   (exit $ac_status); }; }; then
6441   ac_cv_lib_gpm_initscr=yes
6442 else
6443   echo "$as_me: failed program was:" >&5
6444 cat conftest.$ac_ext >&5
6445 ac_cv_lib_gpm_initscr=no
6446 fi
6447 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6448 LIBS=$ac_check_lib_save_LIBS
6449 fi
6450 echo "$as_me:6450: result: $ac_cv_lib_gpm_initscr" >&5
6451 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6452 if test $ac_cv_lib_gpm_initscr = yes; then
6453   LIBS="$cf_ncurses_SAVE"
6454 else
6455   cf_ncurses_LIBS="-lgpm"
6456 fi
6457
6458 fi
6459
6460 case $host_os in #(vi
6461 freebsd*)
6462         # This is only necessary if you are linking against an obsolete
6463         # version of ncurses (but it should do no harm, since it's static).
6464         if test "$cf_nculib_root" = ncurses ; then
6465                 echo "$as_me:6465: checking for tgoto in -lmytinfo" >&5
6466 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6467 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6468   echo $ECHO_N "(cached) $ECHO_C" >&6
6469 else
6470   ac_check_lib_save_LIBS=$LIBS
6471 LIBS="-lmytinfo  $LIBS"
6472 cat >conftest.$ac_ext <<_ACEOF
6473 #line 6473 "configure"
6474 #include "confdefs.h"
6475
6476 /* Override any gcc2 internal prototype to avoid an error.  */
6477 #ifdef __cplusplus
6478 extern "C"
6479 #endif
6480 /* We use char because int might match the return type of a gcc2
6481    builtin and then its argument prototype would still apply.  */
6482 char tgoto ();
6483 int
6484 main ()
6485 {
6486 tgoto ();
6487   ;
6488   return 0;
6489 }
6490 _ACEOF
6491 rm -f conftest.$ac_objext conftest$ac_exeext
6492 if { (eval echo "$as_me:6492: \"$ac_link\"") >&5
6493   (eval $ac_link) 2>&5
6494   ac_status=$?
6495   echo "$as_me:6495: \$? = $ac_status" >&5
6496   (exit $ac_status); } &&
6497          { ac_try='test -s conftest$ac_exeext'
6498   { (eval echo "$as_me:6498: \"$ac_try\"") >&5
6499   (eval $ac_try) 2>&5
6500   ac_status=$?
6501   echo "$as_me:6501: \$? = $ac_status" >&5
6502   (exit $ac_status); }; }; then
6503   ac_cv_lib_mytinfo_tgoto=yes
6504 else
6505   echo "$as_me: failed program was:" >&5
6506 cat conftest.$ac_ext >&5
6507 ac_cv_lib_mytinfo_tgoto=no
6508 fi
6509 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6510 LIBS=$ac_check_lib_save_LIBS
6511 fi
6512 echo "$as_me:6512: result: $ac_cv_lib_mytinfo_tgoto" >&5
6513 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6514 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6515   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6516 fi
6517
6518         fi
6519         ;;
6520 esac
6521
6522 LIBS="$cf_ncurses_LIBS $LIBS"
6523
6524 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6525 then
6526         LIBS="-l$cf_nculib_root $LIBS"
6527 else
6528
6529         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6530         cf_libdir=""
6531         echo "$as_me:6531: checking for initscr" >&5
6532 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6533 if test "${ac_cv_func_initscr+set}" = set; then
6534   echo $ECHO_N "(cached) $ECHO_C" >&6
6535 else
6536   cat >conftest.$ac_ext <<_ACEOF
6537 #line 6537 "configure"
6538 #include "confdefs.h"
6539 /* System header to define __stub macros and hopefully few prototypes,
6540     which can conflict with char initscr (); below.  */
6541 #include <assert.h>
6542 /* Override any gcc2 internal prototype to avoid an error.  */
6543 #ifdef __cplusplus
6544 extern "C"
6545 #endif
6546 /* We use char because int might match the return type of a gcc2
6547    builtin and then its argument prototype would still apply.  */
6548 char initscr ();
6549 char (*f) ();
6550
6551 int
6552 main ()
6553 {
6554 /* The GNU C library defines this for functions which it implements
6555     to always fail with ENOSYS.  Some functions are actually named
6556     something starting with __ and the normal name is an alias.  */
6557 #if defined (__stub_initscr) || defined (__stub___initscr)
6558 choke me
6559 #else
6560 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6561 #endif
6562
6563   ;
6564   return 0;
6565 }
6566 _ACEOF
6567 rm -f conftest.$ac_objext conftest$ac_exeext
6568 if { (eval echo "$as_me:6568: \"$ac_link\"") >&5
6569   (eval $ac_link) 2>&5
6570   ac_status=$?
6571   echo "$as_me:6571: \$? = $ac_status" >&5
6572   (exit $ac_status); } &&
6573          { ac_try='test -s conftest$ac_exeext'
6574   { (eval echo "$as_me:6574: \"$ac_try\"") >&5
6575   (eval $ac_try) 2>&5
6576   ac_status=$?
6577   echo "$as_me:6577: \$? = $ac_status" >&5
6578   (exit $ac_status); }; }; then
6579   ac_cv_func_initscr=yes
6580 else
6581   echo "$as_me: failed program was:" >&5
6582 cat conftest.$ac_ext >&5
6583 ac_cv_func_initscr=no
6584 fi
6585 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6586 fi
6587 echo "$as_me:6587: result: $ac_cv_func_initscr" >&5
6588 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6589 if test $ac_cv_func_initscr = yes; then
6590   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6591 else
6592
6593                 cf_save_LIBS="$LIBS"
6594                 echo "$as_me:6594: checking for initscr in -l$cf_nculib_root" >&5
6595 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6596                 LIBS="-l$cf_nculib_root $LIBS"
6597                 cat >conftest.$ac_ext <<_ACEOF
6598 #line 6598 "configure"
6599 #include "confdefs.h"
6600 #include <${cf_cv_ncurses_header:-curses.h}>
6601 int
6602 main ()
6603 {
6604 initscr()
6605   ;
6606   return 0;
6607 }
6608 _ACEOF
6609 rm -f conftest.$ac_objext conftest$ac_exeext
6610 if { (eval echo "$as_me:6610: \"$ac_link\"") >&5
6611   (eval $ac_link) 2>&5
6612   ac_status=$?
6613   echo "$as_me:6613: \$? = $ac_status" >&5
6614   (exit $ac_status); } &&
6615          { ac_try='test -s conftest$ac_exeext'
6616   { (eval echo "$as_me:6616: \"$ac_try\"") >&5
6617   (eval $ac_try) 2>&5
6618   ac_status=$?
6619   echo "$as_me:6619: \$? = $ac_status" >&5
6620   (exit $ac_status); }; }; then
6621   echo "$as_me:6621: result: yes" >&5
6622 echo "${ECHO_T}yes" >&6
6623                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6624
6625 else
6626   echo "$as_me: failed program was:" >&5
6627 cat conftest.$ac_ext >&5
6628 echo "$as_me:6628: result: no" >&5
6629 echo "${ECHO_T}no" >&6
6630
6631 cf_search=
6632 cf_library_path_list=""
6633 if test -n "${LDFLAGS}${LIBS}" ; then
6634         for cf_library_path in $LDFLAGS $LIBS
6635         do
6636                 case $cf_library_path in #(vi
6637                 -L*)
6638                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6639
6640 test "$cf_library_path" != "NONE" && \
6641 test -d "$cf_library_path" && \
6642  {
6643         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6644         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6645         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6646         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6647         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6648         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"
6649 }
6650
6651                         cf_library_path_list="$cf_library_path_list $cf_search"
6652                         ;;
6653                 esac
6654         done
6655 fi
6656
6657 cf_search=
6658
6659 test "/usr" != "$prefix" && \
6660 test -d "/usr" && \
6661 (test $prefix = NONE || test "/usr" != "$prefix") && {
6662         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6663         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6664         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
6665         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
6666         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
6667         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
6668 }
6669
6670 test "$prefix" != "NONE" && \
6671 test -d "$prefix" && \
6672  {
6673         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6674         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6675         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6676         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6677         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6678         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6679 }
6680
6681 test "/usr/local" != "$prefix" && \
6682 test -d "/usr/local" && \
6683 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6684         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6685         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6686         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
6687         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
6688         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
6689         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
6690 }
6691
6692 test "/opt" != "$prefix" && \
6693 test -d "/opt" && \
6694 (test $prefix = NONE || test "/opt" != "$prefix") && {
6695         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6696         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6697         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
6698         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
6699         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
6700         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
6701 }
6702
6703 test "$HOME" != "$prefix" && \
6704 test -d "$HOME" && \
6705 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6706         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6707         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6708         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
6709         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
6710         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
6711         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
6712 }
6713
6714 cf_search="$cf_library_path_list $cf_search"
6715
6716                         for cf_libdir in $cf_search
6717                         do
6718                                 echo "$as_me:6718: checking for -l$cf_nculib_root in $cf_libdir" >&5
6719 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6720                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6721                                 cat >conftest.$ac_ext <<_ACEOF
6722 #line 6722 "configure"
6723 #include "confdefs.h"
6724 #include <${cf_cv_ncurses_header:-curses.h}>
6725 int
6726 main ()
6727 {
6728 initscr()
6729   ;
6730   return 0;
6731 }
6732 _ACEOF
6733 rm -f conftest.$ac_objext conftest$ac_exeext
6734 if { (eval echo "$as_me:6734: \"$ac_link\"") >&5
6735   (eval $ac_link) 2>&5
6736   ac_status=$?
6737   echo "$as_me:6737: \$? = $ac_status" >&5
6738   (exit $ac_status); } &&
6739          { ac_try='test -s conftest$ac_exeext'
6740   { (eval echo "$as_me:6740: \"$ac_try\"") >&5
6741   (eval $ac_try) 2>&5
6742   ac_status=$?
6743   echo "$as_me:6743: \$? = $ac_status" >&5
6744   (exit $ac_status); }; }; then
6745   echo "$as_me:6745: result: yes" >&5
6746 echo "${ECHO_T}yes" >&6
6747                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6748                                          break
6749 else
6750   echo "$as_me: failed program was:" >&5
6751 cat conftest.$ac_ext >&5
6752 echo "$as_me:6752: result: no" >&5
6753 echo "${ECHO_T}no" >&6
6754                                          LIBS="$cf_save_LIBS"
6755 fi
6756 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6757                         done
6758
6759 fi
6760 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6761
6762 fi
6763
6764 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6765
6766 if test $cf_found_library = no ; then
6767         { { echo "$as_me:6767: error: Cannot link $cf_nculib_root library" >&5
6768 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6769    { (exit 1); exit 1; }; }
6770 fi
6771
6772 fi
6773
6774 if test -n "$cf_ncurses_LIBS" ; then
6775         echo "$as_me:6775: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6776 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6777         cf_ncurses_SAVE="$LIBS"
6778         for p in $cf_ncurses_LIBS ; do
6779                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6780                 if test "$q" != "$LIBS" ; then
6781                         LIBS="$q"
6782                 fi
6783         done
6784         cat >conftest.$ac_ext <<_ACEOF
6785 #line 6785 "configure"
6786 #include "confdefs.h"
6787 #include <${cf_cv_ncurses_header:-curses.h}>
6788 int
6789 main ()
6790 {
6791 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6792   ;
6793   return 0;
6794 }
6795 _ACEOF
6796 rm -f conftest.$ac_objext conftest$ac_exeext
6797 if { (eval echo "$as_me:6797: \"$ac_link\"") >&5
6798   (eval $ac_link) 2>&5
6799   ac_status=$?
6800   echo "$as_me:6800: \$? = $ac_status" >&5
6801   (exit $ac_status); } &&
6802          { ac_try='test -s conftest$ac_exeext'
6803   { (eval echo "$as_me:6803: \"$ac_try\"") >&5
6804   (eval $ac_try) 2>&5
6805   ac_status=$?
6806   echo "$as_me:6806: \$? = $ac_status" >&5
6807   (exit $ac_status); }; }; then
6808   echo "$as_me:6808: result: yes" >&5
6809 echo "${ECHO_T}yes" >&6
6810 else
6811   echo "$as_me: failed program was:" >&5
6812 cat conftest.$ac_ext >&5
6813 echo "$as_me:6813: result: no" >&5
6814 echo "${ECHO_T}no" >&6
6815                  LIBS="$cf_ncurses_SAVE"
6816 fi
6817 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6818 fi
6819
6820 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6821
6822 cat >>confdefs.h <<EOF
6823 #define $cf_nculib_ROOT 1
6824 EOF
6825
6826 fi
6827
6828         ;;
6829 ncursesw) #(vi
6830
6831 echo "$as_me:6831: checking for multibyte character support" >&5
6832 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6833 if test "${cf_cv_utf8_lib+set}" = set; then
6834   echo $ECHO_N "(cached) $ECHO_C" >&6
6835 else
6836
6837         cf_save_LIBS="$LIBS"
6838         cat >conftest.$ac_ext <<_ACEOF
6839 #line 6839 "configure"
6840 #include "confdefs.h"
6841
6842 #include <stdlib.h>
6843 int
6844 main ()
6845 {
6846 putwc(0,0);
6847   ;
6848   return 0;
6849 }
6850 _ACEOF
6851 rm -f conftest.$ac_objext conftest$ac_exeext
6852 if { (eval echo "$as_me:6852: \"$ac_link\"") >&5
6853   (eval $ac_link) 2>&5
6854   ac_status=$?
6855   echo "$as_me:6855: \$? = $ac_status" >&5
6856   (exit $ac_status); } &&
6857          { ac_try='test -s conftest$ac_exeext'
6858   { (eval echo "$as_me:6858: \"$ac_try\"") >&5
6859   (eval $ac_try) 2>&5
6860   ac_status=$?
6861   echo "$as_me:6861: \$? = $ac_status" >&5
6862   (exit $ac_status); }; }; then
6863   cf_cv_utf8_lib=yes
6864 else
6865   echo "$as_me: failed program was:" >&5
6866 cat conftest.$ac_ext >&5
6867
6868 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6869 # will be set on completion of the AC_TRY_LINK below.
6870 cf_cv_header_path_utf8=
6871 cf_cv_library_path_utf8=
6872
6873 echo "${as_me:-configure}:6873: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6874
6875 cf_save_LIBS="$LIBS"
6876
6877 cat >conftest.$ac_ext <<_ACEOF
6878 #line 6878 "configure"
6879 #include "confdefs.h"
6880
6881 #include <libutf8.h>
6882 int
6883 main ()
6884 {
6885 putwc(0,0);
6886   ;
6887   return 0;
6888 }
6889 _ACEOF
6890 rm -f conftest.$ac_objext conftest$ac_exeext
6891 if { (eval echo "$as_me:6891: \"$ac_link\"") >&5
6892   (eval $ac_link) 2>&5
6893   ac_status=$?
6894   echo "$as_me:6894: \$? = $ac_status" >&5
6895   (exit $ac_status); } &&
6896          { ac_try='test -s conftest$ac_exeext'
6897   { (eval echo "$as_me:6897: \"$ac_try\"") >&5
6898   (eval $ac_try) 2>&5
6899   ac_status=$?
6900   echo "$as_me:6900: \$? = $ac_status" >&5
6901   (exit $ac_status); }; }; then
6902
6903         cf_cv_find_linkage_utf8=yes
6904         cf_cv_header_path_utf8=/usr/include
6905         cf_cv_library_path_utf8=/usr/lib
6906
6907 else
6908   echo "$as_me: failed program was:" >&5
6909 cat conftest.$ac_ext >&5
6910
6911 LIBS="-lutf8  $cf_save_LIBS"
6912
6913 cat >conftest.$ac_ext <<_ACEOF
6914 #line 6914 "configure"
6915 #include "confdefs.h"
6916
6917 #include <libutf8.h>
6918 int
6919 main ()
6920 {
6921 putwc(0,0);
6922   ;
6923   return 0;
6924 }
6925 _ACEOF
6926 rm -f conftest.$ac_objext conftest$ac_exeext
6927 if { (eval echo "$as_me:6927: \"$ac_link\"") >&5
6928   (eval $ac_link) 2>&5
6929   ac_status=$?
6930   echo "$as_me:6930: \$? = $ac_status" >&5
6931   (exit $ac_status); } &&
6932          { ac_try='test -s conftest$ac_exeext'
6933   { (eval echo "$as_me:6933: \"$ac_try\"") >&5
6934   (eval $ac_try) 2>&5
6935   ac_status=$?
6936   echo "$as_me:6936: \$? = $ac_status" >&5
6937   (exit $ac_status); }; }; then
6938
6939         cf_cv_find_linkage_utf8=yes
6940         cf_cv_header_path_utf8=/usr/include
6941         cf_cv_library_path_utf8=/usr/lib
6942         cf_cv_library_file_utf8="-lutf8"
6943
6944 else
6945   echo "$as_me: failed program was:" >&5
6946 cat conftest.$ac_ext >&5
6947
6948         cf_cv_find_linkage_utf8=no
6949         LIBS="$cf_save_LIBS"
6950
6951     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
6952
6953 echo "${as_me:-configure}:6953: testing find linkage for utf8 library ..." 1>&5
6954
6955 echo "${as_me:-configure}:6955: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6956
6957     cf_save_CPPFLAGS="$CPPFLAGS"
6958     cf_test_CPPFLAGS="$CPPFLAGS"
6959
6960 cf_search=
6961
6962 # collect the current set of include-directories from compiler flags
6963 cf_header_path_list=""
6964 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6965         for cf_header_path in $CPPFLAGS $CFLAGS
6966         do
6967                 case $cf_header_path in #(vi
6968                 -I*)
6969                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6970
6971 test "$cf_header_path" != "NONE" && \
6972 test -d "$cf_header_path" && \
6973  {
6974         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6975         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6976         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6977         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6978         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6979         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6980 }
6981
6982                         cf_header_path_list="$cf_header_path_list $cf_search"
6983                         ;;
6984                 esac
6985         done
6986 fi
6987
6988 # add the variations for the package we are looking for
6989
6990 cf_search=
6991
6992 test "/usr" != "$prefix" && \
6993 test -d "/usr" && \
6994 (test $prefix = NONE || test "/usr" != "$prefix") && {
6995         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6996         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6997         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
6998         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
6999         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
7000         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
7001 }
7002
7003 test "$prefix" != "NONE" && \
7004 test -d "$prefix" && \
7005  {
7006         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7007         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7008         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7009         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7010         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7011         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7012 }
7013
7014 test "/usr/local" != "$prefix" && \
7015 test -d "/usr/local" && \
7016 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7017         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
7018         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
7019         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
7020         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
7021         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
7022         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
7023 }
7024
7025 test "/opt" != "$prefix" && \
7026 test -d "/opt" && \
7027 (test $prefix = NONE || test "/opt" != "$prefix") && {
7028         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
7029         test -d /opt/include &&          cf_search="$cf_search /opt/include"
7030         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
7031         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
7032         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
7033         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
7034 }
7035
7036 test "$HOME" != "$prefix" && \
7037 test -d "$HOME" && \
7038 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7039         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
7040         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
7041         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
7042         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
7043         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
7044         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
7045 }
7046
7047 test "$includedir" != NONE && \
7048 test "$includedir" != "/usr/include" && \
7049 test -d "$includedir" && {
7050         test -d $includedir &&    cf_search="$cf_search $includedir"
7051         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7052 }
7053
7054 test "$oldincludedir" != NONE && \
7055 test "$oldincludedir" != "/usr/include" && \
7056 test -d "$oldincludedir" && {
7057         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7058         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7059 }
7060
7061 cf_search="$cf_search $cf_header_path_list"
7062
7063     for cf_cv_header_path_utf8 in $cf_search
7064     do
7065       if test -d $cf_cv_header_path_utf8 ; then
7066         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7067
7068 echo "${as_me:-configure}:7068: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7069
7070         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
7071         cat >conftest.$ac_ext <<_ACEOF
7072 #line 7072 "configure"
7073 #include "confdefs.h"
7074
7075 #include <libutf8.h>
7076 int
7077 main ()
7078 {
7079 putwc(0,0);
7080   ;
7081   return 0;
7082 }
7083 _ACEOF
7084 rm -f conftest.$ac_objext
7085 if { (eval echo "$as_me:7085: \"$ac_compile\"") >&5
7086   (eval $ac_compile) 2>&5
7087   ac_status=$?
7088   echo "$as_me:7088: \$? = $ac_status" >&5
7089   (exit $ac_status); } &&
7090          { ac_try='test -s conftest.$ac_objext'
7091   { (eval echo "$as_me:7091: \"$ac_try\"") >&5
7092   (eval $ac_try) 2>&5
7093   ac_status=$?
7094   echo "$as_me:7094: \$? = $ac_status" >&5
7095   (exit $ac_status); }; }; then
7096
7097             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7098
7099 echo "${as_me:-configure}:7099: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7100
7101             cf_cv_find_linkage_utf8=maybe
7102             cf_test_CPPFLAGS="$CPPFLAGS"
7103             break
7104 else
7105   echo "$as_me: failed program was:" >&5
7106 cat conftest.$ac_ext >&5
7107
7108             CPPFLAGS="$cf_save_CPPFLAGS"
7109
7110 fi
7111 rm -f conftest.$ac_objext conftest.$ac_ext
7112       fi
7113     done
7114
7115     if test "$cf_cv_find_linkage_utf8" = maybe ; then
7116
7117 echo "${as_me:-configure}:7117: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7118
7119       cf_save_LIBS="$LIBS"
7120       cf_save_LDFLAGS="$LDFLAGS"
7121
7122       if test "$cf_cv_find_linkage_utf8" != yes ; then
7123
7124 cf_search=
7125 cf_library_path_list=""
7126 if test -n "${LDFLAGS}${LIBS}" ; then
7127         for cf_library_path in $LDFLAGS $LIBS
7128         do
7129                 case $cf_library_path in #(vi
7130                 -L*)
7131                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7132
7133 test "$cf_library_path" != "NONE" && \
7134 test -d "$cf_library_path" && \
7135  {
7136         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7137         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7138         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7139         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7140         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7141         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7142 }
7143
7144                         cf_library_path_list="$cf_library_path_list $cf_search"
7145                         ;;
7146                 esac
7147         done
7148 fi
7149
7150 cf_search=
7151
7152 test "/usr" != "$prefix" && \
7153 test -d "/usr" && \
7154 (test $prefix = NONE || test "/usr" != "$prefix") && {
7155         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7156         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7157         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
7158         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
7159         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
7160         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
7161 }
7162
7163 test "$prefix" != "NONE" && \
7164 test -d "$prefix" && \
7165  {
7166         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7167         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7168         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7169         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7170         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7171         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7172 }
7173
7174 test "/usr/local" != "$prefix" && \
7175 test -d "/usr/local" && \
7176 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7177         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7178         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7179         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
7180         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
7181         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
7182         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
7183 }
7184
7185 test "/opt" != "$prefix" && \
7186 test -d "/opt" && \
7187 (test $prefix = NONE || test "/opt" != "$prefix") && {
7188         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7189         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7190         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
7191         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
7192         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
7193         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
7194 }
7195
7196 test "$HOME" != "$prefix" && \
7197 test -d "$HOME" && \
7198 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7199         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7200         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7201         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
7202         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
7203         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
7204         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
7205 }
7206
7207 cf_search="$cf_library_path_list $cf_search"
7208
7209         for cf_cv_library_path_utf8 in $cf_search
7210         do
7211           if test -d $cf_cv_library_path_utf8 ; then
7212             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
7213
7214 echo "${as_me:-configure}:7214: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7215
7216             CPPFLAGS="$cf_test_CPPFLAGS"
7217             LIBS="-lutf8  $cf_save_LIBS"
7218             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7219             cat >conftest.$ac_ext <<_ACEOF
7220 #line 7220 "configure"
7221 #include "confdefs.h"
7222
7223 #include <libutf8.h>
7224 int
7225 main ()
7226 {
7227 putwc(0,0);
7228   ;
7229   return 0;
7230 }
7231 _ACEOF
7232 rm -f conftest.$ac_objext conftest$ac_exeext
7233 if { (eval echo "$as_me:7233: \"$ac_link\"") >&5
7234   (eval $ac_link) 2>&5
7235   ac_status=$?
7236   echo "$as_me:7236: \$? = $ac_status" >&5
7237   (exit $ac_status); } &&
7238          { ac_try='test -s conftest$ac_exeext'
7239   { (eval echo "$as_me:7239: \"$ac_try\"") >&5
7240   (eval $ac_try) 2>&5
7241   ac_status=$?
7242   echo "$as_me:7242: \$? = $ac_status" >&5
7243   (exit $ac_status); }; }; then
7244
7245                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7246
7247 echo "${as_me:-configure}:7247: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7248
7249                 cf_cv_find_linkage_utf8=yes
7250                 cf_cv_library_file_utf8="-lutf8"
7251                 break
7252 else
7253   echo "$as_me: failed program was:" >&5
7254 cat conftest.$ac_ext >&5
7255
7256                 CPPFLAGS="$cf_save_CPPFLAGS"
7257                 LIBS="$cf_save_LIBS"
7258                 LDFLAGS="$cf_save_LDFLAGS"
7259
7260 fi
7261 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7262           fi
7263         done
7264         CPPFLAGS="$cf_save_CPPFLAGS"
7265         LDFLAGS="$cf_save_LDFLAGS"
7266       fi
7267
7268     else
7269       cf_cv_find_linkage_utf8=no
7270     fi
7271
7272 fi
7273 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7274
7275 fi
7276 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7277
7278 LIBS="$cf_save_LIBS"
7279
7280 if test "$cf_cv_find_linkage_utf8" = yes ; then
7281 cf_cv_utf8_lib=add-on
7282 else
7283 cf_cv_utf8_lib=no
7284 fi
7285
7286 fi
7287 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7288 fi
7289 echo "$as_me:7289: result: $cf_cv_utf8_lib" >&5
7290 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7291
7292 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7293 # ncurses/ncursesw:
7294 if test "$cf_cv_utf8_lib" = "add-on" ; then
7295
7296 cat >>confdefs.h <<\EOF
7297 #define HAVE_LIBUTF8_H 1
7298 EOF
7299
7300 if test -n "$cf_cv_header_path_utf8" ; then
7301   for cf_add_incdir in $cf_cv_header_path_utf8
7302   do
7303         while test $cf_add_incdir != /usr/include
7304         do
7305           if test -d $cf_add_incdir
7306           then
7307                 cf_have_incdir=no
7308                 if test -n "$CFLAGS$CPPFLAGS" ; then
7309                   # a loop is needed to ensure we can add subdirs of existing dirs
7310                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7311                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7312                           cf_have_incdir=yes; break
7313                         fi
7314                   done
7315                 fi
7316
7317                 if test "$cf_have_incdir" = no ; then
7318                   if test "$cf_add_incdir" = /usr/local/include ; then
7319                         if test "$GCC" = yes
7320                         then
7321                           cf_save_CPPFLAGS=$CPPFLAGS
7322                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7323                           cat >conftest.$ac_ext <<_ACEOF
7324 #line 7324 "configure"
7325 #include "confdefs.h"
7326 #include <stdio.h>
7327 int
7328 main ()
7329 {
7330 printf("Hello")
7331   ;
7332   return 0;
7333 }
7334 _ACEOF
7335 rm -f conftest.$ac_objext
7336 if { (eval echo "$as_me:7336: \"$ac_compile\"") >&5
7337   (eval $ac_compile) 2>&5
7338   ac_status=$?
7339   echo "$as_me:7339: \$? = $ac_status" >&5
7340   (exit $ac_status); } &&
7341          { ac_try='test -s conftest.$ac_objext'
7342   { (eval echo "$as_me:7342: \"$ac_try\"") >&5
7343   (eval $ac_try) 2>&5
7344   ac_status=$?
7345   echo "$as_me:7345: \$? = $ac_status" >&5
7346   (exit $ac_status); }; }; then
7347   :
7348 else
7349   echo "$as_me: failed program was:" >&5
7350 cat conftest.$ac_ext >&5
7351 cf_have_incdir=yes
7352 fi
7353 rm -f conftest.$ac_objext conftest.$ac_ext
7354                           CPPFLAGS=$cf_save_CPPFLAGS
7355                         fi
7356                   fi
7357                 fi
7358
7359                 if test "$cf_have_incdir" = no ; then
7360                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7361
7362 echo "${as_me:-configure}:7362: testing adding $cf_add_incdir to include-path ..." 1>&5
7363
7364                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7365
7366                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7367                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7368                   cf_add_incdir="$cf_top_incdir"
7369                 else
7370                   break
7371                 fi
7372           fi
7373         done
7374   done
7375 fi
7376
7377 if test -n "$cf_cv_library_path_utf8" ; then
7378   for cf_add_libdir in $cf_cv_library_path_utf8
7379   do
7380     if test $cf_add_libdir = /usr/lib ; then
7381       :
7382     elif test -d $cf_add_libdir
7383     then
7384       cf_have_libdir=no
7385       if test -n "$LDFLAGS$LIBS" ; then
7386         # a loop is needed to ensure we can add subdirs of existing dirs
7387         for cf_test_libdir in $LDFLAGS $LIBS ; do
7388           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7389             cf_have_libdir=yes; break
7390           fi
7391         done
7392       fi
7393       if test "$cf_have_libdir" = no ; then
7394         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7395
7396 echo "${as_me:-configure}:7396: testing adding $cf_add_libdir to library-path ..." 1>&5
7397
7398         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7399       fi
7400     fi
7401   done
7402 fi
7403
7404         LIBS="$cf_cv_library_file_utf8 $LIBS"
7405 fi
7406
7407 cf_ncuconfig_root=ncursesw
7408
7409 echo "Looking for ${cf_ncuconfig_root}-config"
7410
7411 if test -n "$ac_tool_prefix"; then
7412   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7413   do
7414     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7415 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7416 echo "$as_me:7416: checking for $ac_word" >&5
7417 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7418 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7419   echo $ECHO_N "(cached) $ECHO_C" >&6
7420 else
7421   if test -n "$NCURSES_CONFIG"; then
7422   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7423 else
7424   ac_save_IFS=$IFS; IFS=$ac_path_separator
7425 ac_dummy="$PATH"
7426 for ac_dir in $ac_dummy; do
7427   IFS=$ac_save_IFS
7428   test -z "$ac_dir" && ac_dir=.
7429   $as_executable_p "$ac_dir/$ac_word" || continue
7430 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7431 echo "$as_me:7431: found $ac_dir/$ac_word" >&5
7432 break
7433 done
7434
7435 fi
7436 fi
7437 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7438 if test -n "$NCURSES_CONFIG"; then
7439   echo "$as_me:7439: result: $NCURSES_CONFIG" >&5
7440 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7441 else
7442   echo "$as_me:7442: result: no" >&5
7443 echo "${ECHO_T}no" >&6
7444 fi
7445
7446     test -n "$NCURSES_CONFIG" && break
7447   done
7448 fi
7449 if test -z "$NCURSES_CONFIG"; then
7450   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7451   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7452 do
7453   # Extract the first word of "$ac_prog", so it can be a program name with args.
7454 set dummy $ac_prog; ac_word=$2
7455 echo "$as_me:7455: checking for $ac_word" >&5
7456 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7457 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7458   echo $ECHO_N "(cached) $ECHO_C" >&6
7459 else
7460   if test -n "$ac_ct_NCURSES_CONFIG"; then
7461   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7462 else
7463   ac_save_IFS=$IFS; IFS=$ac_path_separator
7464 ac_dummy="$PATH"
7465 for ac_dir in $ac_dummy; do
7466   IFS=$ac_save_IFS
7467   test -z "$ac_dir" && ac_dir=.
7468   $as_executable_p "$ac_dir/$ac_word" || continue
7469 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7470 echo "$as_me:7470: found $ac_dir/$ac_word" >&5
7471 break
7472 done
7473
7474 fi
7475 fi
7476 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7477 if test -n "$ac_ct_NCURSES_CONFIG"; then
7478   echo "$as_me:7478: result: $ac_ct_NCURSES_CONFIG" >&5
7479 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7480 else
7481   echo "$as_me:7481: result: no" >&5
7482 echo "${ECHO_T}no" >&6
7483 fi
7484
7485   test -n "$ac_ct_NCURSES_CONFIG" && break
7486 done
7487 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7488
7489   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7490 fi
7491
7492 if test "$NCURSES_CONFIG" != none ; then
7493
7494 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7495 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
7496
7497 # even with config script, some packages use no-override for curses.h
7498
7499 echo "$as_me:7499: checking if we have identified curses headers" >&5
7500 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7501 if test "${cf_cv_ncurses_header+set}" = set; then
7502   echo $ECHO_N "(cached) $ECHO_C" >&6
7503 else
7504
7505 cf_cv_ncurses_header=none
7506 for cf_header in  \
7507     ncursesw/ncurses.h \
7508         ncursesw/curses.h \
7509         ncurses.h \
7510         curses.h
7511 do
7512 cat >conftest.$ac_ext <<_ACEOF
7513 #line 7513 "configure"
7514 #include "confdefs.h"
7515 #include <${cf_header}>
7516 int
7517 main ()
7518 {
7519 initscr(); tgoto("?", 0,0)
7520   ;
7521   return 0;
7522 }
7523 _ACEOF
7524 rm -f conftest.$ac_objext
7525 if { (eval echo "$as_me:7525: \"$ac_compile\"") >&5
7526   (eval $ac_compile) 2>&5
7527   ac_status=$?
7528   echo "$as_me:7528: \$? = $ac_status" >&5
7529   (exit $ac_status); } &&
7530          { ac_try='test -s conftest.$ac_objext'
7531   { (eval echo "$as_me:7531: \"$ac_try\"") >&5
7532   (eval $ac_try) 2>&5
7533   ac_status=$?
7534   echo "$as_me:7534: \$? = $ac_status" >&5
7535   (exit $ac_status); }; }; then
7536   cf_cv_ncurses_header=$cf_header; break
7537 else
7538   echo "$as_me: failed program was:" >&5
7539 cat conftest.$ac_ext >&5
7540 fi
7541 rm -f conftest.$ac_objext conftest.$ac_ext
7542 done
7543
7544 fi
7545 echo "$as_me:7545: result: $cf_cv_ncurses_header" >&5
7546 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7547
7548 if test "$cf_cv_ncurses_header" = none ; then
7549         { { echo "$as_me:7549: error: No curses header-files found" >&5
7550 echo "$as_me: error: No curses header-files found" >&2;}
7551    { (exit 1); exit 1; }; }
7552 fi
7553
7554 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7555
7556 for ac_header in $cf_cv_ncurses_header
7557 do
7558 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7559 echo "$as_me:7559: checking for $ac_header" >&5
7560 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7561 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7562   echo $ECHO_N "(cached) $ECHO_C" >&6
7563 else
7564   cat >conftest.$ac_ext <<_ACEOF
7565 #line 7565 "configure"
7566 #include "confdefs.h"
7567 #include <$ac_header>
7568 _ACEOF
7569 if { (eval echo "$as_me:7569: \"$ac_cpp conftest.$ac_ext\"") >&5
7570   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7571   ac_status=$?
7572   egrep -v '^ *\+' conftest.er1 >conftest.err
7573   rm -f conftest.er1
7574   cat conftest.err >&5
7575   echo "$as_me:7575: \$? = $ac_status" >&5
7576   (exit $ac_status); } >/dev/null; then
7577   if test -s conftest.err; then
7578     ac_cpp_err=$ac_c_preproc_warn_flag
7579   else
7580     ac_cpp_err=
7581   fi
7582 else
7583   ac_cpp_err=yes
7584 fi
7585 if test -z "$ac_cpp_err"; then
7586   eval "$as_ac_Header=yes"
7587 else
7588   echo "$as_me: failed program was:" >&5
7589   cat conftest.$ac_ext >&5
7590   eval "$as_ac_Header=no"
7591 fi
7592 rm -f conftest.err conftest.$ac_ext
7593 fi
7594 echo "$as_me:7594: result: `eval echo '${'$as_ac_Header'}'`" >&5
7595 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7596 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7597   cat >>confdefs.h <<EOF
7598 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7599 EOF
7600
7601 fi
7602 done
7603
7604 cat >>confdefs.h <<\EOF
7605 #define NCURSES 1
7606 EOF
7607
7608 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7609
7610 cat >>confdefs.h <<EOF
7611 #define $cf_nculib_ROOT 1
7612 EOF
7613
7614 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7615
7616 else
7617
7618 cf_ncuhdr_root=ncursesw
7619
7620 test -n "$cf_cv_curses_dir" && \
7621 test "$cf_cv_curses_dir" != "no" && { \
7622
7623 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7624   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7625   do
7626         while test $cf_add_incdir != /usr/include
7627         do
7628           if test -d $cf_add_incdir
7629           then
7630                 cf_have_incdir=no
7631                 if test -n "$CFLAGS$CPPFLAGS" ; then
7632                   # a loop is needed to ensure we can add subdirs of existing dirs
7633                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7634                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7635                           cf_have_incdir=yes; break
7636                         fi
7637                   done
7638                 fi
7639
7640                 if test "$cf_have_incdir" = no ; then
7641                   if test "$cf_add_incdir" = /usr/local/include ; then
7642                         if test "$GCC" = yes
7643                         then
7644                           cf_save_CPPFLAGS=$CPPFLAGS
7645                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7646                           cat >conftest.$ac_ext <<_ACEOF
7647 #line 7647 "configure"
7648 #include "confdefs.h"
7649 #include <stdio.h>
7650 int
7651 main ()
7652 {
7653 printf("Hello")
7654   ;
7655   return 0;
7656 }
7657 _ACEOF
7658 rm -f conftest.$ac_objext
7659 if { (eval echo "$as_me:7659: \"$ac_compile\"") >&5
7660   (eval $ac_compile) 2>&5
7661   ac_status=$?
7662   echo "$as_me:7662: \$? = $ac_status" >&5
7663   (exit $ac_status); } &&
7664          { ac_try='test -s conftest.$ac_objext'
7665   { (eval echo "$as_me:7665: \"$ac_try\"") >&5
7666   (eval $ac_try) 2>&5
7667   ac_status=$?
7668   echo "$as_me:7668: \$? = $ac_status" >&5
7669   (exit $ac_status); }; }; then
7670   :
7671 else
7672   echo "$as_me: failed program was:" >&5
7673 cat conftest.$ac_ext >&5
7674 cf_have_incdir=yes
7675 fi
7676 rm -f conftest.$ac_objext conftest.$ac_ext
7677                           CPPFLAGS=$cf_save_CPPFLAGS
7678                         fi
7679                   fi
7680                 fi
7681
7682                 if test "$cf_have_incdir" = no ; then
7683                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7684
7685 echo "${as_me:-configure}:7685: testing adding $cf_add_incdir to include-path ..." 1>&5
7686
7687                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7688
7689                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7690                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7691                   cf_add_incdir="$cf_top_incdir"
7692                 else
7693                   break
7694                 fi
7695           fi
7696         done
7697   done
7698 fi
7699
7700 }
7701
7702 echo "$as_me:7702: checking for $cf_ncuhdr_root header in include-path" >&5
7703 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7704 if test "${cf_cv_ncurses_h+set}" = set; then
7705   echo $ECHO_N "(cached) $ECHO_C" >&6
7706 else
7707
7708         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7709         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7710         for cf_header in $cf_header_list
7711         do
7712
7713         cat >conftest.$ac_ext <<_ACEOF
7714 #line 7714 "configure"
7715 #include "confdefs.h"
7716
7717 #define _XOPEN_SOURCE_EXTENDED
7718 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7719 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7720
7721 #include <$cf_header>
7722 int
7723 main ()
7724 {
7725
7726 #ifdef NCURSES_VERSION
7727
7728 #ifndef WACS_BSSB
7729         make an error
7730 #endif
7731
7732 printf("%s\n", NCURSES_VERSION);
7733 #else
7734 #ifdef __NCURSES_H
7735 printf("old\n");
7736 #else
7737         make an error
7738 #endif
7739 #endif
7740
7741   ;
7742   return 0;
7743 }
7744 _ACEOF
7745 rm -f conftest.$ac_objext
7746 if { (eval echo "$as_me:7746: \"$ac_compile\"") >&5
7747   (eval $ac_compile) 2>&5
7748   ac_status=$?
7749   echo "$as_me:7749: \$? = $ac_status" >&5
7750   (exit $ac_status); } &&
7751          { ac_try='test -s conftest.$ac_objext'
7752   { (eval echo "$as_me:7752: \"$ac_try\"") >&5
7753   (eval $ac_try) 2>&5
7754   ac_status=$?
7755   echo "$as_me:7755: \$? = $ac_status" >&5
7756   (exit $ac_status); }; }; then
7757   cf_cv_ncurses_h=$cf_header
7758
7759 else
7760   echo "$as_me: failed program was:" >&5
7761 cat conftest.$ac_ext >&5
7762 cf_cv_ncurses_h=no
7763 fi
7764 rm -f conftest.$ac_objext conftest.$ac_ext
7765
7766                 test "$cf_cv_ncurses_h" != no && break
7767         done
7768
7769 fi
7770 echo "$as_me:7770: result: $cf_cv_ncurses_h" >&5
7771 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7772
7773 if test "$cf_cv_ncurses_h" != no ; then
7774         cf_cv_ncurses_header=$cf_cv_ncurses_h
7775 else
7776
7777 echo "$as_me:7777: checking for $cf_ncuhdr_root include-path" >&5
7778 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7779 if test "${cf_cv_ncurses_h2+set}" = set; then
7780   echo $ECHO_N "(cached) $ECHO_C" >&6
7781 else
7782
7783         test -n "$verbose" && echo
7784
7785 cf_search=
7786
7787 # collect the current set of include-directories from compiler flags
7788 cf_header_path_list=""
7789 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7790         for cf_header_path in $CPPFLAGS $CFLAGS
7791         do
7792                 case $cf_header_path in #(vi
7793                 -I*)
7794                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7795
7796 test "$cf_header_path" != "NONE" && \
7797 test -d "$cf_header_path" && \
7798  {
7799         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7800         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7801         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7802         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7803         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7804         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"
7805 }
7806
7807                         cf_header_path_list="$cf_header_path_list $cf_search"
7808                         ;;
7809                 esac
7810         done
7811 fi
7812
7813 # add the variations for the package we are looking for
7814
7815 cf_search=
7816
7817 test "/usr" != "$prefix" && \
7818 test -d "/usr" && \
7819 (test $prefix = NONE || test "/usr" != "$prefix") && {
7820         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7821         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7822         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
7823         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
7824         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
7825         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7826 }
7827
7828 test "$prefix" != "NONE" && \
7829 test -d "$prefix" && \
7830  {
7831         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7832         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7833         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7834         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7835         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7836         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7837 }
7838
7839 test "/usr/local" != "$prefix" && \
7840 test -d "/usr/local" && \
7841 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7842         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
7843         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
7844         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
7845         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
7846         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
7847         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7848 }
7849
7850 test "/opt" != "$prefix" && \
7851 test -d "/opt" && \
7852 (test $prefix = NONE || test "/opt" != "$prefix") && {
7853         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
7854         test -d /opt/include &&          cf_search="$cf_search /opt/include"
7855         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
7856         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
7857         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
7858         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7859 }
7860
7861 test "$HOME" != "$prefix" && \
7862 test -d "$HOME" && \
7863 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7864         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
7865         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
7866         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
7867         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
7868         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
7869         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7870 }
7871
7872 test "$includedir" != NONE && \
7873 test "$includedir" != "/usr/include" && \
7874 test -d "$includedir" && {
7875         test -d $includedir &&    cf_search="$cf_search $includedir"
7876         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7877 }
7878
7879 test "$oldincludedir" != NONE && \
7880 test "$oldincludedir" != "/usr/include" && \
7881 test -d "$oldincludedir" && {
7882         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7883         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7884 }
7885
7886 cf_search="$cf_search $cf_header_path_list"
7887
7888         test -n "$verbose" && echo search path $cf_search
7889         cf_save2_CPPFLAGS="$CPPFLAGS"
7890         for cf_incdir in $cf_search
7891         do
7892
7893 if test -n "$cf_incdir" ; then
7894   for cf_add_incdir in $cf_incdir
7895   do
7896         while test $cf_add_incdir != /usr/include
7897         do
7898           if test -d $cf_add_incdir
7899           then
7900                 cf_have_incdir=no
7901                 if test -n "$CFLAGS$CPPFLAGS" ; then
7902                   # a loop is needed to ensure we can add subdirs of existing dirs
7903                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7904                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7905                           cf_have_incdir=yes; break
7906                         fi
7907                   done
7908                 fi
7909
7910                 if test "$cf_have_incdir" = no ; then
7911                   if test "$cf_add_incdir" = /usr/local/include ; then
7912                         if test "$GCC" = yes
7913                         then
7914                           cf_save_CPPFLAGS=$CPPFLAGS
7915                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7916                           cat >conftest.$ac_ext <<_ACEOF
7917 #line 7917 "configure"
7918 #include "confdefs.h"
7919 #include <stdio.h>
7920 int
7921 main ()
7922 {
7923 printf("Hello")
7924   ;
7925   return 0;
7926 }
7927 _ACEOF
7928 rm -f conftest.$ac_objext
7929 if { (eval echo "$as_me:7929: \"$ac_compile\"") >&5
7930   (eval $ac_compile) 2>&5
7931   ac_status=$?
7932   echo "$as_me:7932: \$? = $ac_status" >&5
7933   (exit $ac_status); } &&
7934          { ac_try='test -s conftest.$ac_objext'
7935   { (eval echo "$as_me:7935: \"$ac_try\"") >&5
7936   (eval $ac_try) 2>&5
7937   ac_status=$?
7938   echo "$as_me:7938: \$? = $ac_status" >&5
7939   (exit $ac_status); }; }; then
7940   :
7941 else
7942   echo "$as_me: failed program was:" >&5
7943 cat conftest.$ac_ext >&5
7944 cf_have_incdir=yes
7945 fi
7946 rm -f conftest.$ac_objext conftest.$ac_ext
7947                           CPPFLAGS=$cf_save_CPPFLAGS
7948                         fi
7949                   fi
7950                 fi
7951
7952                 if test "$cf_have_incdir" = no ; then
7953                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7954
7955 echo "${as_me:-configure}:7955: testing adding $cf_add_incdir to include-path ..." 1>&5
7956
7957                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7958
7959                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7960                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7961                   cf_add_incdir="$cf_top_incdir"
7962                 else
7963                   break
7964                 fi
7965           fi
7966         done
7967   done
7968 fi
7969
7970                 for cf_header in \
7971                         ncurses.h \
7972                         curses.h
7973                 do
7974
7975         cat >conftest.$ac_ext <<_ACEOF
7976 #line 7976 "configure"
7977 #include "confdefs.h"
7978
7979 #include <$cf_header>
7980 int
7981 main ()
7982 {
7983
7984 #ifdef NCURSES_VERSION
7985
7986 printf("%s\n", NCURSES_VERSION);
7987 #else
7988 #ifdef __NCURSES_H
7989 printf("old\n");
7990 #else
7991         make an error
7992 #endif
7993 #endif
7994
7995   ;
7996   return 0;
7997 }
7998 _ACEOF
7999 rm -f conftest.$ac_objext
8000 if { (eval echo "$as_me:8000: \"$ac_compile\"") >&5
8001   (eval $ac_compile) 2>&5
8002   ac_status=$?
8003   echo "$as_me:8003: \$? = $ac_status" >&5
8004   (exit $ac_status); } &&
8005          { ac_try='test -s conftest.$ac_objext'
8006   { (eval echo "$as_me:8006: \"$ac_try\"") >&5
8007   (eval $ac_try) 2>&5
8008   ac_status=$?
8009   echo "$as_me:8009: \$? = $ac_status" >&5
8010   (exit $ac_status); }; }; then
8011   cf_cv_ncurses_h2=$cf_header
8012
8013 else
8014   echo "$as_me: failed program was:" >&5
8015 cat conftest.$ac_ext >&5
8016 cf_cv_ncurses_h2=no
8017 fi
8018 rm -f conftest.$ac_objext conftest.$ac_ext
8019
8020                         if test "$cf_cv_ncurses_h2" != no ; then
8021                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8022                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8023                                 break
8024                         fi
8025                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8026                 done
8027                 CPPFLAGS="$cf_save2_CPPFLAGS"
8028                 test "$cf_cv_ncurses_h2" != no && break
8029         done
8030         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8030: error: not found" >&5
8031 echo "$as_me: error: not found" >&2;}
8032    { (exit 1); exit 1; }; }
8033
8034 fi
8035 echo "$as_me:8035: result: $cf_cv_ncurses_h2" >&5
8036 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8037
8038         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8039         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8040         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8041                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8042         fi
8043
8044 if test -n "$cf_1st_incdir" ; then
8045   for cf_add_incdir in $cf_1st_incdir
8046   do
8047         while test $cf_add_incdir != /usr/include
8048         do
8049           if test -d $cf_add_incdir
8050           then
8051                 cf_have_incdir=no
8052                 if test -n "$CFLAGS$CPPFLAGS" ; then
8053                   # a loop is needed to ensure we can add subdirs of existing dirs
8054                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8055                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8056                           cf_have_incdir=yes; break
8057                         fi
8058                   done
8059                 fi
8060
8061                 if test "$cf_have_incdir" = no ; then
8062                   if test "$cf_add_incdir" = /usr/local/include ; then
8063                         if test "$GCC" = yes
8064                         then
8065                           cf_save_CPPFLAGS=$CPPFLAGS
8066                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8067                           cat >conftest.$ac_ext <<_ACEOF
8068 #line 8068 "configure"
8069 #include "confdefs.h"
8070 #include <stdio.h>
8071 int
8072 main ()
8073 {
8074 printf("Hello")
8075   ;
8076   return 0;
8077 }
8078 _ACEOF
8079 rm -f conftest.$ac_objext
8080 if { (eval echo "$as_me:8080: \"$ac_compile\"") >&5
8081   (eval $ac_compile) 2>&5
8082   ac_status=$?
8083   echo "$as_me:8083: \$? = $ac_status" >&5
8084   (exit $ac_status); } &&
8085          { ac_try='test -s conftest.$ac_objext'
8086   { (eval echo "$as_me:8086: \"$ac_try\"") >&5
8087   (eval $ac_try) 2>&5
8088   ac_status=$?
8089   echo "$as_me:8089: \$? = $ac_status" >&5
8090   (exit $ac_status); }; }; then
8091   :
8092 else
8093   echo "$as_me: failed program was:" >&5
8094 cat conftest.$ac_ext >&5
8095 cf_have_incdir=yes
8096 fi
8097 rm -f conftest.$ac_objext conftest.$ac_ext
8098                           CPPFLAGS=$cf_save_CPPFLAGS
8099                         fi
8100                   fi
8101                 fi
8102
8103                 if test "$cf_have_incdir" = no ; then
8104                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8105
8106 echo "${as_me:-configure}:8106: testing adding $cf_add_incdir to include-path ..." 1>&5
8107
8108                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8109
8110                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8111                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8112                   cf_add_incdir="$cf_top_incdir"
8113                 else
8114                   break
8115                 fi
8116           fi
8117         done
8118   done
8119 fi
8120
8121 fi
8122
8123 # Set definitions to allow ifdef'ing for ncurses.h
8124
8125 case $cf_cv_ncurses_header in # (vi
8126 *ncurses.h)
8127
8128 cat >>confdefs.h <<\EOF
8129 #define HAVE_NCURSES_H 1
8130 EOF
8131
8132         ;;
8133 esac
8134
8135 case $cf_cv_ncurses_header in # (vi
8136 ncurses/curses.h|ncurses/ncurses.h)
8137
8138 cat >>confdefs.h <<\EOF
8139 #define HAVE_NCURSES_NCURSES_H 1
8140 EOF
8141
8142         ;;
8143 ncursesw/curses.h|ncursesw/ncurses.h)
8144
8145 cat >>confdefs.h <<\EOF
8146 #define HAVE_NCURSESW_NCURSES_H 1
8147 EOF
8148
8149         ;;
8150 esac
8151
8152 echo "$as_me:8152: checking for terminfo header" >&5
8153 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8154 if test "${cf_cv_term_header+set}" = set; then
8155   echo $ECHO_N "(cached) $ECHO_C" >&6
8156 else
8157
8158 case ${cf_cv_ncurses_header} in #(vi
8159 */ncurses.h|*/ncursesw.h) #(vi
8160         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8161         ;;
8162 *)
8163         cf_term_header=term.h
8164         ;;
8165 esac
8166
8167 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8168 do
8169 cat >conftest.$ac_ext <<_ACEOF
8170 #line 8170 "configure"
8171 #include "confdefs.h"
8172 #include <stdio.h>
8173 #include <${cf_cv_ncurses_header:-curses.h}>
8174 #include <$cf_test>
8175
8176 int
8177 main ()
8178 {
8179 int x = auto_left_margin
8180   ;
8181   return 0;
8182 }
8183 _ACEOF
8184 rm -f conftest.$ac_objext
8185 if { (eval echo "$as_me:8185: \"$ac_compile\"") >&5
8186   (eval $ac_compile) 2>&5
8187   ac_status=$?
8188   echo "$as_me:8188: \$? = $ac_status" >&5
8189   (exit $ac_status); } &&
8190          { ac_try='test -s conftest.$ac_objext'
8191   { (eval echo "$as_me:8191: \"$ac_try\"") >&5
8192   (eval $ac_try) 2>&5
8193   ac_status=$?
8194   echo "$as_me:8194: \$? = $ac_status" >&5
8195   (exit $ac_status); }; }; then
8196
8197         cf_cv_term_header="$cf_test"
8198 else
8199   echo "$as_me: failed program was:" >&5
8200 cat conftest.$ac_ext >&5
8201
8202         cf_cv_term_header=unknown
8203
8204 fi
8205 rm -f conftest.$ac_objext conftest.$ac_ext
8206         test "$cf_cv_term_header" != unknown && break
8207 done
8208
8209 fi
8210 echo "$as_me:8210: result: $cf_cv_term_header" >&5
8211 echo "${ECHO_T}$cf_cv_term_header" >&6
8212
8213 # Set definitions to allow ifdef'ing to accommodate subdirectories
8214
8215 case $cf_cv_term_header in # (vi
8216 *term.h)
8217
8218 cat >>confdefs.h <<\EOF
8219 #define HAVE_TERM_H 1
8220 EOF
8221
8222         ;;
8223 esac
8224
8225 case $cf_cv_term_header in # (vi
8226 ncurses/term.h) #(vi
8227
8228 cat >>confdefs.h <<\EOF
8229 #define HAVE_NCURSES_TERM_H 1
8230 EOF
8231
8232         ;;
8233 ncursesw/term.h)
8234
8235 cat >>confdefs.h <<\EOF
8236 #define HAVE_NCURSESW_TERM_H 1
8237 EOF
8238
8239         ;;
8240 esac
8241
8242 # some applications need this, but should check for NCURSES_VERSION
8243
8244 cat >>confdefs.h <<\EOF
8245 #define NCURSES 1
8246 EOF
8247
8248 echo "$as_me:8248: checking for ncurses version" >&5
8249 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8250 if test "${cf_cv_ncurses_version+set}" = set; then
8251   echo $ECHO_N "(cached) $ECHO_C" >&6
8252 else
8253
8254         cf_cv_ncurses_version=no
8255         cf_tempfile=out$$
8256         rm -f $cf_tempfile
8257         if test "$cross_compiling" = yes; then
8258
8259         # This will not work if the preprocessor splits the line after the
8260         # Autoconf token.  The 'unproto' program does that.
8261         cat > conftest.$ac_ext <<EOF
8262 #include <${cf_cv_ncurses_header:-curses.h}>
8263 #undef Autoconf
8264 #ifdef NCURSES_VERSION
8265 Autoconf NCURSES_VERSION
8266 #else
8267 #ifdef __NCURSES_H
8268 Autoconf "old"
8269 #endif
8270 ;
8271 #endif
8272 EOF
8273         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8274         { (eval echo "$as_me:8274: \"$cf_try\"") >&5
8275   (eval $cf_try) 2>&5
8276   ac_status=$?
8277   echo "$as_me:8277: \$? = $ac_status" >&5
8278   (exit $ac_status); }
8279         if test -f conftest.out ; then
8280                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8281                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8282                 rm -f conftest.out
8283         fi
8284
8285 else
8286   cat >conftest.$ac_ext <<_ACEOF
8287 #line 8287 "configure"
8288 #include "confdefs.h"
8289
8290 #include <${cf_cv_ncurses_header:-curses.h}>
8291 #include <stdio.h>
8292 int main()
8293 {
8294         FILE *fp = fopen("$cf_tempfile", "w");
8295 #ifdef NCURSES_VERSION
8296 # ifdef NCURSES_VERSION_PATCH
8297         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8298 # else
8299         fprintf(fp, "%s\n", NCURSES_VERSION);
8300 # endif
8301 #else
8302 # ifdef __NCURSES_H
8303         fprintf(fp, "old\n");
8304 # else
8305         make an error
8306 # endif
8307 #endif
8308         ${cf_cv_main_return:-return}(0);
8309 }
8310 _ACEOF
8311 rm -f conftest$ac_exeext
8312 if { (eval echo "$as_me:8312: \"$ac_link\"") >&5
8313   (eval $ac_link) 2>&5
8314   ac_status=$?
8315   echo "$as_me:8315: \$? = $ac_status" >&5
8316   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8317   { (eval echo "$as_me:8317: \"$ac_try\"") >&5
8318   (eval $ac_try) 2>&5
8319   ac_status=$?
8320   echo "$as_me:8320: \$? = $ac_status" >&5
8321   (exit $ac_status); }; }; then
8322
8323         cf_cv_ncurses_version=`cat $cf_tempfile`
8324 else
8325   echo "$as_me: program exited with status $ac_status" >&5
8326 echo "$as_me: failed program was:" >&5
8327 cat conftest.$ac_ext >&5
8328 fi
8329 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8330 fi
8331         rm -f $cf_tempfile
8332
8333 fi
8334 echo "$as_me:8334: result: $cf_cv_ncurses_version" >&5
8335 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8336 test "$cf_cv_ncurses_version" = no ||
8337 cat >>confdefs.h <<\EOF
8338 #define NCURSES 1
8339 EOF
8340
8341 cf_nculib_root=ncursesw
8342         # This works, except for the special case where we find gpm, but
8343         # ncurses is in a nonstandard location via $LIBS, and we really want
8344         # to link gpm.
8345 cf_ncurses_LIBS=""
8346 cf_ncurses_SAVE="$LIBS"
8347 echo "$as_me:8347: checking for Gpm_Open in -lgpm" >&5
8348 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8349 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8350   echo $ECHO_N "(cached) $ECHO_C" >&6
8351 else
8352   ac_check_lib_save_LIBS=$LIBS
8353 LIBS="-lgpm  $LIBS"
8354 cat >conftest.$ac_ext <<_ACEOF
8355 #line 8355 "configure"
8356 #include "confdefs.h"
8357
8358 /* Override any gcc2 internal prototype to avoid an error.  */
8359 #ifdef __cplusplus
8360 extern "C"
8361 #endif
8362 /* We use char because int might match the return type of a gcc2
8363    builtin and then its argument prototype would still apply.  */
8364 char Gpm_Open ();
8365 int
8366 main ()
8367 {
8368 Gpm_Open ();
8369   ;
8370   return 0;
8371 }
8372 _ACEOF
8373 rm -f conftest.$ac_objext conftest$ac_exeext
8374 if { (eval echo "$as_me:8374: \"$ac_link\"") >&5
8375   (eval $ac_link) 2>&5
8376   ac_status=$?
8377   echo "$as_me:8377: \$? = $ac_status" >&5
8378   (exit $ac_status); } &&
8379          { ac_try='test -s conftest$ac_exeext'
8380   { (eval echo "$as_me:8380: \"$ac_try\"") >&5
8381   (eval $ac_try) 2>&5
8382   ac_status=$?
8383   echo "$as_me:8383: \$? = $ac_status" >&5
8384   (exit $ac_status); }; }; then
8385   ac_cv_lib_gpm_Gpm_Open=yes
8386 else
8387   echo "$as_me: failed program was:" >&5
8388 cat conftest.$ac_ext >&5
8389 ac_cv_lib_gpm_Gpm_Open=no
8390 fi
8391 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8392 LIBS=$ac_check_lib_save_LIBS
8393 fi
8394 echo "$as_me:8394: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8395 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8396 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8397   echo "$as_me:8397: checking for initscr in -lgpm" >&5
8398 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8399 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8400   echo $ECHO_N "(cached) $ECHO_C" >&6
8401 else
8402   ac_check_lib_save_LIBS=$LIBS
8403 LIBS="-lgpm  $LIBS"
8404 cat >conftest.$ac_ext <<_ACEOF
8405 #line 8405 "configure"
8406 #include "confdefs.h"
8407
8408 /* Override any gcc2 internal prototype to avoid an error.  */
8409 #ifdef __cplusplus
8410 extern "C"
8411 #endif
8412 /* We use char because int might match the return type of a gcc2
8413    builtin and then its argument prototype would still apply.  */
8414 char initscr ();
8415 int
8416 main ()
8417 {
8418 initscr ();
8419   ;
8420   return 0;
8421 }
8422 _ACEOF
8423 rm -f conftest.$ac_objext conftest$ac_exeext
8424 if { (eval echo "$as_me:8424: \"$ac_link\"") >&5
8425   (eval $ac_link) 2>&5
8426   ac_status=$?
8427   echo "$as_me:8427: \$? = $ac_status" >&5
8428   (exit $ac_status); } &&
8429          { ac_try='test -s conftest$ac_exeext'
8430   { (eval echo "$as_me:8430: \"$ac_try\"") >&5
8431   (eval $ac_try) 2>&5
8432   ac_status=$?
8433   echo "$as_me:8433: \$? = $ac_status" >&5
8434   (exit $ac_status); }; }; then
8435   ac_cv_lib_gpm_initscr=yes
8436 else
8437   echo "$as_me: failed program was:" >&5
8438 cat conftest.$ac_ext >&5
8439 ac_cv_lib_gpm_initscr=no
8440 fi
8441 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8442 LIBS=$ac_check_lib_save_LIBS
8443 fi
8444 echo "$as_me:8444: result: $ac_cv_lib_gpm_initscr" >&5
8445 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8446 if test $ac_cv_lib_gpm_initscr = yes; then
8447   LIBS="$cf_ncurses_SAVE"
8448 else
8449   cf_ncurses_LIBS="-lgpm"
8450 fi
8451
8452 fi
8453
8454 case $host_os in #(vi
8455 freebsd*)
8456         # This is only necessary if you are linking against an obsolete
8457         # version of ncurses (but it should do no harm, since it's static).
8458         if test "$cf_nculib_root" = ncurses ; then
8459                 echo "$as_me:8459: checking for tgoto in -lmytinfo" >&5
8460 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8461 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8462   echo $ECHO_N "(cached) $ECHO_C" >&6
8463 else
8464   ac_check_lib_save_LIBS=$LIBS
8465 LIBS="-lmytinfo  $LIBS"
8466 cat >conftest.$ac_ext <<_ACEOF
8467 #line 8467 "configure"
8468 #include "confdefs.h"
8469
8470 /* Override any gcc2 internal prototype to avoid an error.  */
8471 #ifdef __cplusplus
8472 extern "C"
8473 #endif
8474 /* We use char because int might match the return type of a gcc2
8475    builtin and then its argument prototype would still apply.  */
8476 char tgoto ();
8477 int
8478 main ()
8479 {
8480 tgoto ();
8481   ;
8482   return 0;
8483 }
8484 _ACEOF
8485 rm -f conftest.$ac_objext conftest$ac_exeext
8486 if { (eval echo "$as_me:8486: \"$ac_link\"") >&5
8487   (eval $ac_link) 2>&5
8488   ac_status=$?
8489   echo "$as_me:8489: \$? = $ac_status" >&5
8490   (exit $ac_status); } &&
8491          { ac_try='test -s conftest$ac_exeext'
8492   { (eval echo "$as_me:8492: \"$ac_try\"") >&5
8493   (eval $ac_try) 2>&5
8494   ac_status=$?
8495   echo "$as_me:8495: \$? = $ac_status" >&5
8496   (exit $ac_status); }; }; then
8497   ac_cv_lib_mytinfo_tgoto=yes
8498 else
8499   echo "$as_me: failed program was:" >&5
8500 cat conftest.$ac_ext >&5
8501 ac_cv_lib_mytinfo_tgoto=no
8502 fi
8503 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8504 LIBS=$ac_check_lib_save_LIBS
8505 fi
8506 echo "$as_me:8506: result: $ac_cv_lib_mytinfo_tgoto" >&5
8507 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8508 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8509   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8510 fi
8511
8512         fi
8513         ;;
8514 esac
8515
8516 LIBS="$cf_ncurses_LIBS $LIBS"
8517
8518 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8519 then
8520         LIBS="-l$cf_nculib_root $LIBS"
8521 else
8522
8523         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8524         cf_libdir=""
8525         echo "$as_me:8525: checking for initscr" >&5
8526 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8527 if test "${ac_cv_func_initscr+set}" = set; then
8528   echo $ECHO_N "(cached) $ECHO_C" >&6
8529 else
8530   cat >conftest.$ac_ext <<_ACEOF
8531 #line 8531 "configure"
8532 #include "confdefs.h"
8533 /* System header to define __stub macros and hopefully few prototypes,
8534     which can conflict with char initscr (); below.  */
8535 #include <assert.h>
8536 /* Override any gcc2 internal prototype to avoid an error.  */
8537 #ifdef __cplusplus
8538 extern "C"
8539 #endif
8540 /* We use char because int might match the return type of a gcc2
8541    builtin and then its argument prototype would still apply.  */
8542 char initscr ();
8543 char (*f) ();
8544
8545 int
8546 main ()
8547 {
8548 /* The GNU C library defines this for functions which it implements
8549     to always fail with ENOSYS.  Some functions are actually named
8550     something starting with __ and the normal name is an alias.  */
8551 #if defined (__stub_initscr) || defined (__stub___initscr)
8552 choke me
8553 #else
8554 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8555 #endif
8556
8557   ;
8558   return 0;
8559 }
8560 _ACEOF
8561 rm -f conftest.$ac_objext conftest$ac_exeext
8562 if { (eval echo "$as_me:8562: \"$ac_link\"") >&5
8563   (eval $ac_link) 2>&5
8564   ac_status=$?
8565   echo "$as_me:8565: \$? = $ac_status" >&5
8566   (exit $ac_status); } &&
8567          { ac_try='test -s conftest$ac_exeext'
8568   { (eval echo "$as_me:8568: \"$ac_try\"") >&5
8569   (eval $ac_try) 2>&5
8570   ac_status=$?
8571   echo "$as_me:8571: \$? = $ac_status" >&5
8572   (exit $ac_status); }; }; then
8573   ac_cv_func_initscr=yes
8574 else
8575   echo "$as_me: failed program was:" >&5
8576 cat conftest.$ac_ext >&5
8577 ac_cv_func_initscr=no
8578 fi
8579 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8580 fi
8581 echo "$as_me:8581: result: $ac_cv_func_initscr" >&5
8582 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8583 if test $ac_cv_func_initscr = yes; then
8584   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8585 else
8586
8587                 cf_save_LIBS="$LIBS"
8588                 echo "$as_me:8588: checking for initscr in -l$cf_nculib_root" >&5
8589 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8590                 LIBS="-l$cf_nculib_root $LIBS"
8591                 cat >conftest.$ac_ext <<_ACEOF
8592 #line 8592 "configure"
8593 #include "confdefs.h"
8594 #include <${cf_cv_ncurses_header:-curses.h}>
8595 int
8596 main ()
8597 {
8598 initscr()
8599   ;
8600   return 0;
8601 }
8602 _ACEOF
8603 rm -f conftest.$ac_objext conftest$ac_exeext
8604 if { (eval echo "$as_me:8604: \"$ac_link\"") >&5
8605   (eval $ac_link) 2>&5
8606   ac_status=$?
8607   echo "$as_me:8607: \$? = $ac_status" >&5
8608   (exit $ac_status); } &&
8609          { ac_try='test -s conftest$ac_exeext'
8610   { (eval echo "$as_me:8610: \"$ac_try\"") >&5
8611   (eval $ac_try) 2>&5
8612   ac_status=$?
8613   echo "$as_me:8613: \$? = $ac_status" >&5
8614   (exit $ac_status); }; }; then
8615   echo "$as_me:8615: result: yes" >&5
8616 echo "${ECHO_T}yes" >&6
8617                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8618
8619 else
8620   echo "$as_me: failed program was:" >&5
8621 cat conftest.$ac_ext >&5
8622 echo "$as_me:8622: result: no" >&5
8623 echo "${ECHO_T}no" >&6
8624
8625 cf_search=
8626 cf_library_path_list=""
8627 if test -n "${LDFLAGS}${LIBS}" ; then
8628         for cf_library_path in $LDFLAGS $LIBS
8629         do
8630                 case $cf_library_path in #(vi
8631                 -L*)
8632                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8633
8634 test "$cf_library_path" != "NONE" && \
8635 test -d "$cf_library_path" && \
8636  {
8637         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8638         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8639         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8640         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8641         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8642         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"
8643 }
8644
8645                         cf_library_path_list="$cf_library_path_list $cf_search"
8646                         ;;
8647                 esac
8648         done
8649 fi
8650
8651 cf_search=
8652
8653 test "/usr" != "$prefix" && \
8654 test -d "/usr" && \
8655 (test $prefix = NONE || test "/usr" != "$prefix") && {
8656         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
8657         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
8658         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
8659         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
8660         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
8661         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
8662 }
8663
8664 test "$prefix" != "NONE" && \
8665 test -d "$prefix" && \
8666  {
8667         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8668         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8669         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8670         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8671         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8672         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8673 }
8674
8675 test "/usr/local" != "$prefix" && \
8676 test -d "/usr/local" && \
8677 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8678         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
8679         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
8680         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
8681         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
8682         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
8683         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
8684 }
8685
8686 test "/opt" != "$prefix" && \
8687 test -d "/opt" && \
8688 (test $prefix = NONE || test "/opt" != "$prefix") && {
8689         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
8690         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
8691         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
8692         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
8693         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
8694         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
8695 }
8696
8697 test "$HOME" != "$prefix" && \
8698 test -d "$HOME" && \
8699 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8700         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
8701         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
8702         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
8703         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
8704         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
8705         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
8706 }
8707
8708 cf_search="$cf_library_path_list $cf_search"
8709
8710                         for cf_libdir in $cf_search
8711                         do
8712                                 echo "$as_me:8712: checking for -l$cf_nculib_root in $cf_libdir" >&5
8713 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8714                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8715                                 cat >conftest.$ac_ext <<_ACEOF
8716 #line 8716 "configure"
8717 #include "confdefs.h"
8718 #include <${cf_cv_ncurses_header:-curses.h}>
8719 int
8720 main ()
8721 {
8722 initscr()
8723   ;
8724   return 0;
8725 }
8726 _ACEOF
8727 rm -f conftest.$ac_objext conftest$ac_exeext
8728 if { (eval echo "$as_me:8728: \"$ac_link\"") >&5
8729   (eval $ac_link) 2>&5
8730   ac_status=$?
8731   echo "$as_me:8731: \$? = $ac_status" >&5
8732   (exit $ac_status); } &&
8733          { ac_try='test -s conftest$ac_exeext'
8734   { (eval echo "$as_me:8734: \"$ac_try\"") >&5
8735   (eval $ac_try) 2>&5
8736   ac_status=$?
8737   echo "$as_me:8737: \$? = $ac_status" >&5
8738   (exit $ac_status); }; }; then
8739   echo "$as_me:8739: result: yes" >&5
8740 echo "${ECHO_T}yes" >&6
8741                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8742                                          break
8743 else
8744   echo "$as_me: failed program was:" >&5
8745 cat conftest.$ac_ext >&5
8746 echo "$as_me:8746: result: no" >&5
8747 echo "${ECHO_T}no" >&6
8748                                          LIBS="$cf_save_LIBS"
8749 fi
8750 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8751                         done
8752
8753 fi
8754 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8755
8756 fi
8757
8758 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8759
8760 if test $cf_found_library = no ; then
8761         { { echo "$as_me:8761: error: Cannot link $cf_nculib_root library" >&5
8762 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8763    { (exit 1); exit 1; }; }
8764 fi
8765
8766 fi
8767
8768 if test -n "$cf_ncurses_LIBS" ; then
8769         echo "$as_me:8769: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8770 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8771         cf_ncurses_SAVE="$LIBS"
8772         for p in $cf_ncurses_LIBS ; do
8773                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8774                 if test "$q" != "$LIBS" ; then
8775                         LIBS="$q"
8776                 fi
8777         done
8778         cat >conftest.$ac_ext <<_ACEOF
8779 #line 8779 "configure"
8780 #include "confdefs.h"
8781 #include <${cf_cv_ncurses_header:-curses.h}>
8782 int
8783 main ()
8784 {
8785 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8786   ;
8787   return 0;
8788 }
8789 _ACEOF
8790 rm -f conftest.$ac_objext conftest$ac_exeext
8791 if { (eval echo "$as_me:8791: \"$ac_link\"") >&5
8792   (eval $ac_link) 2>&5
8793   ac_status=$?
8794   echo "$as_me:8794: \$? = $ac_status" >&5
8795   (exit $ac_status); } &&
8796          { ac_try='test -s conftest$ac_exeext'
8797   { (eval echo "$as_me:8797: \"$ac_try\"") >&5
8798   (eval $ac_try) 2>&5
8799   ac_status=$?
8800   echo "$as_me:8800: \$? = $ac_status" >&5
8801   (exit $ac_status); }; }; then
8802   echo "$as_me:8802: result: yes" >&5
8803 echo "${ECHO_T}yes" >&6
8804 else
8805   echo "$as_me: failed program was:" >&5
8806 cat conftest.$ac_ext >&5
8807 echo "$as_me:8807: result: no" >&5
8808 echo "${ECHO_T}no" >&6
8809                  LIBS="$cf_ncurses_SAVE"
8810 fi
8811 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8812 fi
8813
8814 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8815
8816 cat >>confdefs.h <<EOF
8817 #define $cf_nculib_ROOT 1
8818 EOF
8819
8820 fi
8821
8822         ;;
8823 pdcurses)
8824         echo "$as_me:8824: checking for X" >&5
8825 echo $ECHO_N "checking for X... $ECHO_C" >&6
8826
8827 # Check whether --with-x or --without-x was given.
8828 if test "${with_x+set}" = set; then
8829   withval="$with_x"
8830
8831 fi;
8832 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
8833 if test "x$with_x" = xno; then
8834   # The user explicitly disabled X.
8835   have_x=disabled
8836 else
8837   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
8838     # Both variables are already set.
8839     have_x=yes
8840   else
8841     if test "${ac_cv_have_x+set}" = set; then
8842   echo $ECHO_N "(cached) $ECHO_C" >&6
8843 else
8844   # One or both of the vars are not set, and there is no cached value.
8845 ac_x_includes=no ac_x_libraries=no
8846 rm -fr conftest.dir
8847 if mkdir conftest.dir; then
8848   cd conftest.dir
8849   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
8850   cat >Imakefile <<'EOF'
8851 acfindx:
8852         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
8853 EOF
8854   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
8855     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
8856     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
8857     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
8858     for ac_extension in a so sl dylib dll; do
8859       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
8860          test -f $ac_im_libdir/libX11.$ac_extension; then
8861         ac_im_usrlibdir=$ac_im_libdir; break
8862       fi
8863     done
8864     # Screen out bogus values from the imake configuration.  They are
8865     # bogus both because they are the default anyway, and because
8866     # using them would break gcc on systems where it needs fixed includes.
8867     case $ac_im_incroot in
8868         /usr/include) ;;
8869         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
8870     esac
8871     case $ac_im_usrlibdir in
8872         /usr/lib | /lib) ;;
8873         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
8874     esac
8875   fi
8876   cd ..
8877   rm -fr conftest.dir
8878 fi
8879
8880 # Standard set of common directories for X headers.
8881 # Check X11 before X11Rn because it is often a symlink to the current release.
8882 ac_x_header_dirs='
8883 /usr/X11/include
8884 /usr/X11R6/include
8885 /usr/X11R5/include
8886 /usr/X11R4/include
8887
8888 /usr/include/X11
8889 /usr/include/X11R6
8890 /usr/include/X11R5
8891 /usr/include/X11R4
8892
8893 /usr/local/X11/include
8894 /usr/local/X11R6/include
8895 /usr/local/X11R5/include
8896 /usr/local/X11R4/include
8897
8898 /usr/local/include/X11
8899 /usr/local/include/X11R6
8900 /usr/local/include/X11R5
8901 /usr/local/include/X11R4
8902
8903 /usr/X386/include
8904 /usr/x386/include
8905 /usr/XFree86/include/X11
8906
8907 /usr/include
8908 /usr/local/include
8909 /usr/unsupported/include
8910 /usr/athena/include
8911 /usr/local/x11r5/include
8912 /usr/lpp/Xamples/include
8913
8914 /usr/openwin/include
8915 /usr/openwin/share/include'
8916
8917 if test "$ac_x_includes" = no; then
8918   # Guess where to find include files, by looking for Intrinsic.h.
8919   # First, try using that file with no special directory specified.
8920   cat >conftest.$ac_ext <<_ACEOF
8921 #line 8921 "configure"
8922 #include "confdefs.h"
8923 #include <X11/Intrinsic.h>
8924 _ACEOF
8925 if { (eval echo "$as_me:8925: \"$ac_cpp conftest.$ac_ext\"") >&5
8926   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8927   ac_status=$?
8928   egrep -v '^ *\+' conftest.er1 >conftest.err
8929   rm -f conftest.er1
8930   cat conftest.err >&5
8931   echo "$as_me:8931: \$? = $ac_status" >&5
8932   (exit $ac_status); } >/dev/null; then
8933   if test -s conftest.err; then
8934     ac_cpp_err=$ac_c_preproc_warn_flag
8935   else
8936     ac_cpp_err=
8937   fi
8938 else
8939   ac_cpp_err=yes
8940 fi
8941 if test -z "$ac_cpp_err"; then
8942   # We can compile using X headers with no special include directory.
8943 ac_x_includes=
8944 else
8945   echo "$as_me: failed program was:" >&5
8946   cat conftest.$ac_ext >&5
8947   for ac_dir in $ac_x_header_dirs; do
8948   if test -r "$ac_dir/X11/Intrinsic.h"; then
8949     ac_x_includes=$ac_dir
8950     break
8951   fi
8952 done
8953 fi
8954 rm -f conftest.err conftest.$ac_ext
8955 fi # $ac_x_includes = no
8956
8957 if test "$ac_x_libraries" = no; then
8958   # Check for the libraries.
8959   # See if we find them without any special options.
8960   # Don't add to $LIBS permanently.
8961   ac_save_LIBS=$LIBS
8962   LIBS="-lXt $LIBS"
8963   cat >conftest.$ac_ext <<_ACEOF
8964 #line 8964 "configure"
8965 #include "confdefs.h"
8966 #include <X11/Intrinsic.h>
8967 int
8968 main ()
8969 {
8970 XtMalloc (0)
8971   ;
8972   return 0;
8973 }
8974 _ACEOF
8975 rm -f conftest.$ac_objext conftest$ac_exeext
8976 if { (eval echo "$as_me:8976: \"$ac_link\"") >&5
8977   (eval $ac_link) 2>&5
8978   ac_status=$?
8979   echo "$as_me:8979: \$? = $ac_status" >&5
8980   (exit $ac_status); } &&
8981          { ac_try='test -s conftest$ac_exeext'
8982   { (eval echo "$as_me:8982: \"$ac_try\"") >&5
8983   (eval $ac_try) 2>&5
8984   ac_status=$?
8985   echo "$as_me:8985: \$? = $ac_status" >&5
8986   (exit $ac_status); }; }; then
8987   LIBS=$ac_save_LIBS
8988 # We can link X programs with no special library path.
8989 ac_x_libraries=
8990 else
8991   echo "$as_me: failed program was:" >&5
8992 cat conftest.$ac_ext >&5
8993 LIBS=$ac_save_LIBS
8994 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
8995 do
8996   # Don't even attempt the hair of trying to link an X program!
8997   for ac_extension in a so sl dylib dll; do
8998     if test -r $ac_dir/libXt.$ac_extension; then
8999       ac_x_libraries=$ac_dir
9000       break 2
9001     fi
9002   done
9003 done
9004 fi
9005 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9006 fi # $ac_x_libraries = no
9007
9008 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9009   # Didn't find X anywhere.  Cache the known absence of X.
9010   ac_cv_have_x="have_x=no"
9011 else
9012   # Record where we found X for the cache.
9013   ac_cv_have_x="have_x=yes \
9014                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9015 fi
9016 fi
9017
9018   fi
9019   eval "$ac_cv_have_x"
9020 fi # $with_x != no
9021
9022 if test "$have_x" != yes; then
9023   echo "$as_me:9023: result: $have_x" >&5
9024 echo "${ECHO_T}$have_x" >&6
9025   no_x=yes
9026 else
9027   # If each of the values was on the command line, it overrides each guess.
9028   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9029   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9030   # Update the cache value to reflect the command line values.
9031   ac_cv_have_x="have_x=yes \
9032                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9033   echo "$as_me:9033: result: libraries $x_libraries, headers $x_includes" >&5
9034 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9035 fi
9036
9037 if test "$no_x" = yes; then
9038   # Not all programs may use this symbol, but it does not hurt to define it.
9039
9040 cat >>confdefs.h <<\EOF
9041 #define X_DISPLAY_MISSING 1
9042 EOF
9043
9044   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9045 else
9046   if test -n "$x_includes"; then
9047     X_CFLAGS="$X_CFLAGS -I$x_includes"
9048   fi
9049
9050   # It would also be nice to do this for all -L options, not just this one.
9051   if test -n "$x_libraries"; then
9052     X_LIBS="$X_LIBS -L$x_libraries"
9053     # For Solaris; some versions of Sun CC require a space after -R and
9054     # others require no space.  Words are not sufficient . . . .
9055     case `(uname -sr) 2>/dev/null` in
9056     "SunOS 5"*)
9057       echo "$as_me:9057: checking whether -R must be followed by a space" >&5
9058 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9059       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9060       cat >conftest.$ac_ext <<_ACEOF
9061 #line 9061 "configure"
9062 #include "confdefs.h"
9063
9064 int
9065 main ()
9066 {
9067
9068   ;
9069   return 0;
9070 }
9071 _ACEOF
9072 rm -f conftest.$ac_objext conftest$ac_exeext
9073 if { (eval echo "$as_me:9073: \"$ac_link\"") >&5
9074   (eval $ac_link) 2>&5
9075   ac_status=$?
9076   echo "$as_me:9076: \$? = $ac_status" >&5
9077   (exit $ac_status); } &&
9078          { ac_try='test -s conftest$ac_exeext'
9079   { (eval echo "$as_me:9079: \"$ac_try\"") >&5
9080   (eval $ac_try) 2>&5
9081   ac_status=$?
9082   echo "$as_me:9082: \$? = $ac_status" >&5
9083   (exit $ac_status); }; }; then
9084   ac_R_nospace=yes
9085 else
9086   echo "$as_me: failed program was:" >&5
9087 cat conftest.$ac_ext >&5
9088 ac_R_nospace=no
9089 fi
9090 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9091       if test $ac_R_nospace = yes; then
9092         echo "$as_me:9092: result: no" >&5
9093 echo "${ECHO_T}no" >&6
9094         X_LIBS="$X_LIBS -R$x_libraries"
9095       else
9096         LIBS="$ac_xsave_LIBS -R $x_libraries"
9097         cat >conftest.$ac_ext <<_ACEOF
9098 #line 9098 "configure"
9099 #include "confdefs.h"
9100
9101 int
9102 main ()
9103 {
9104
9105   ;
9106   return 0;
9107 }
9108 _ACEOF
9109 rm -f conftest.$ac_objext conftest$ac_exeext
9110 if { (eval echo "$as_me:9110: \"$ac_link\"") >&5
9111   (eval $ac_link) 2>&5
9112   ac_status=$?
9113   echo "$as_me:9113: \$? = $ac_status" >&5
9114   (exit $ac_status); } &&
9115          { ac_try='test -s conftest$ac_exeext'
9116   { (eval echo "$as_me:9116: \"$ac_try\"") >&5
9117   (eval $ac_try) 2>&5
9118   ac_status=$?
9119   echo "$as_me:9119: \$? = $ac_status" >&5
9120   (exit $ac_status); }; }; then
9121   ac_R_space=yes
9122 else
9123   echo "$as_me: failed program was:" >&5
9124 cat conftest.$ac_ext >&5
9125 ac_R_space=no
9126 fi
9127 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9128         if test $ac_R_space = yes; then
9129           echo "$as_me:9129: result: yes" >&5
9130 echo "${ECHO_T}yes" >&6
9131           X_LIBS="$X_LIBS -R $x_libraries"
9132         else
9133           echo "$as_me:9133: result: neither works" >&5
9134 echo "${ECHO_T}neither works" >&6
9135         fi
9136       fi
9137       LIBS=$ac_xsave_LIBS
9138     esac
9139   fi
9140
9141   # Check for system-dependent libraries X programs must link with.
9142   # Do this before checking for the system-independent R6 libraries
9143   # (-lICE), since we may need -lsocket or whatever for X linking.
9144
9145   if test "$ISC" = yes; then
9146     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9147   else
9148     # Martyn Johnson says this is needed for Ultrix, if the X
9149     # libraries were built with DECnet support.  And Karl Berry says
9150     # the Alpha needs dnet_stub (dnet does not exist).
9151     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9152     cat >conftest.$ac_ext <<_ACEOF
9153 #line 9153 "configure"
9154 #include "confdefs.h"
9155
9156 /* Override any gcc2 internal prototype to avoid an error.  */
9157 #ifdef __cplusplus
9158 extern "C"
9159 #endif
9160 /* We use char because int might match the return type of a gcc2
9161    builtin and then its argument prototype would still apply.  */
9162 char XOpenDisplay ();
9163 int
9164 main ()
9165 {
9166 XOpenDisplay ();
9167   ;
9168   return 0;
9169 }
9170 _ACEOF
9171 rm -f conftest.$ac_objext conftest$ac_exeext
9172 if { (eval echo "$as_me:9172: \"$ac_link\"") >&5
9173   (eval $ac_link) 2>&5
9174   ac_status=$?
9175   echo "$as_me:9175: \$? = $ac_status" >&5
9176   (exit $ac_status); } &&
9177          { ac_try='test -s conftest$ac_exeext'
9178   { (eval echo "$as_me:9178: \"$ac_try\"") >&5
9179   (eval $ac_try) 2>&5
9180   ac_status=$?
9181   echo "$as_me:9181: \$? = $ac_status" >&5
9182   (exit $ac_status); }; }; then
9183   :
9184 else
9185   echo "$as_me: failed program was:" >&5
9186 cat conftest.$ac_ext >&5
9187 echo "$as_me:9187: checking for dnet_ntoa in -ldnet" >&5
9188 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9189 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9190   echo $ECHO_N "(cached) $ECHO_C" >&6
9191 else
9192   ac_check_lib_save_LIBS=$LIBS
9193 LIBS="-ldnet  $LIBS"
9194 cat >conftest.$ac_ext <<_ACEOF
9195 #line 9195 "configure"
9196 #include "confdefs.h"
9197
9198 /* Override any gcc2 internal prototype to avoid an error.  */
9199 #ifdef __cplusplus
9200 extern "C"
9201 #endif
9202 /* We use char because int might match the return type of a gcc2
9203    builtin and then its argument prototype would still apply.  */
9204 char dnet_ntoa ();
9205 int
9206 main ()
9207 {
9208 dnet_ntoa ();
9209   ;
9210   return 0;
9211 }
9212 _ACEOF
9213 rm -f conftest.$ac_objext conftest$ac_exeext
9214 if { (eval echo "$as_me:9214: \"$ac_link\"") >&5
9215   (eval $ac_link) 2>&5
9216   ac_status=$?
9217   echo "$as_me:9217: \$? = $ac_status" >&5
9218   (exit $ac_status); } &&
9219          { ac_try='test -s conftest$ac_exeext'
9220   { (eval echo "$as_me:9220: \"$ac_try\"") >&5
9221   (eval $ac_try) 2>&5
9222   ac_status=$?
9223   echo "$as_me:9223: \$? = $ac_status" >&5
9224   (exit $ac_status); }; }; then
9225   ac_cv_lib_dnet_dnet_ntoa=yes
9226 else
9227   echo "$as_me: failed program was:" >&5
9228 cat conftest.$ac_ext >&5
9229 ac_cv_lib_dnet_dnet_ntoa=no
9230 fi
9231 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9232 LIBS=$ac_check_lib_save_LIBS
9233 fi
9234 echo "$as_me:9234: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9235 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9236 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9237   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9238 fi
9239
9240     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9241       echo "$as_me:9241: checking for dnet_ntoa in -ldnet_stub" >&5
9242 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9243 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9244   echo $ECHO_N "(cached) $ECHO_C" >&6
9245 else
9246   ac_check_lib_save_LIBS=$LIBS
9247 LIBS="-ldnet_stub  $LIBS"
9248 cat >conftest.$ac_ext <<_ACEOF
9249 #line 9249 "configure"
9250 #include "confdefs.h"
9251
9252 /* Override any gcc2 internal prototype to avoid an error.  */
9253 #ifdef __cplusplus
9254 extern "C"
9255 #endif
9256 /* We use char because int might match the return type of a gcc2
9257    builtin and then its argument prototype would still apply.  */
9258 char dnet_ntoa ();
9259 int
9260 main ()
9261 {
9262 dnet_ntoa ();
9263   ;
9264   return 0;
9265 }
9266 _ACEOF
9267 rm -f conftest.$ac_objext conftest$ac_exeext
9268 if { (eval echo "$as_me:9268: \"$ac_link\"") >&5
9269   (eval $ac_link) 2>&5
9270   ac_status=$?
9271   echo "$as_me:9271: \$? = $ac_status" >&5
9272   (exit $ac_status); } &&
9273          { ac_try='test -s conftest$ac_exeext'
9274   { (eval echo "$as_me:9274: \"$ac_try\"") >&5
9275   (eval $ac_try) 2>&5
9276   ac_status=$?
9277   echo "$as_me:9277: \$? = $ac_status" >&5
9278   (exit $ac_status); }; }; then
9279   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9280 else
9281   echo "$as_me: failed program was:" >&5
9282 cat conftest.$ac_ext >&5
9283 ac_cv_lib_dnet_stub_dnet_ntoa=no
9284 fi
9285 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9286 LIBS=$ac_check_lib_save_LIBS
9287 fi
9288 echo "$as_me:9288: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9289 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9290 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9291   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9292 fi
9293
9294     fi
9295 fi
9296 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9297     LIBS="$ac_xsave_LIBS"
9298
9299     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9300     # to get the SysV transport functions.
9301     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9302     # needs -lnsl.
9303     # The nsl library prevents programs from opening the X display
9304     # on Irix 5.2, according to T.E. Dickey.
9305     # The functions gethostbyname, getservbyname, and inet_addr are
9306     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9307     echo "$as_me:9307: checking for gethostbyname" >&5
9308 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9309 if test "${ac_cv_func_gethostbyname+set}" = set; then
9310   echo $ECHO_N "(cached) $ECHO_C" >&6
9311 else
9312   cat >conftest.$ac_ext <<_ACEOF
9313 #line 9313 "configure"
9314 #include "confdefs.h"
9315 /* System header to define __stub macros and hopefully few prototypes,
9316     which can conflict with char gethostbyname (); below.  */
9317 #include <assert.h>
9318 /* Override any gcc2 internal prototype to avoid an error.  */
9319 #ifdef __cplusplus
9320 extern "C"
9321 #endif
9322 /* We use char because int might match the return type of a gcc2
9323    builtin and then its argument prototype would still apply.  */
9324 char gethostbyname ();
9325 char (*f) ();
9326
9327 int
9328 main ()
9329 {
9330 /* The GNU C library defines this for functions which it implements
9331     to always fail with ENOSYS.  Some functions are actually named
9332     something starting with __ and the normal name is an alias.  */
9333 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9334 choke me
9335 #else
9336 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9337 #endif
9338
9339   ;
9340   return 0;
9341 }
9342 _ACEOF
9343 rm -f conftest.$ac_objext conftest$ac_exeext
9344 if { (eval echo "$as_me:9344: \"$ac_link\"") >&5
9345   (eval $ac_link) 2>&5
9346   ac_status=$?
9347   echo "$as_me:9347: \$? = $ac_status" >&5
9348   (exit $ac_status); } &&
9349          { ac_try='test -s conftest$ac_exeext'
9350   { (eval echo "$as_me:9350: \"$ac_try\"") >&5
9351   (eval $ac_try) 2>&5
9352   ac_status=$?
9353   echo "$as_me:9353: \$? = $ac_status" >&5
9354   (exit $ac_status); }; }; then
9355   ac_cv_func_gethostbyname=yes
9356 else
9357   echo "$as_me: failed program was:" >&5
9358 cat conftest.$ac_ext >&5
9359 ac_cv_func_gethostbyname=no
9360 fi
9361 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9362 fi
9363 echo "$as_me:9363: result: $ac_cv_func_gethostbyname" >&5
9364 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9365
9366     if test $ac_cv_func_gethostbyname = no; then
9367       echo "$as_me:9367: checking for gethostbyname in -lnsl" >&5
9368 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9369 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9370   echo $ECHO_N "(cached) $ECHO_C" >&6
9371 else
9372   ac_check_lib_save_LIBS=$LIBS
9373 LIBS="-lnsl  $LIBS"
9374 cat >conftest.$ac_ext <<_ACEOF
9375 #line 9375 "configure"
9376 #include "confdefs.h"
9377
9378 /* Override any gcc2 internal prototype to avoid an error.  */
9379 #ifdef __cplusplus
9380 extern "C"
9381 #endif
9382 /* We use char because int might match the return type of a gcc2
9383    builtin and then its argument prototype would still apply.  */
9384 char gethostbyname ();
9385 int
9386 main ()
9387 {
9388 gethostbyname ();
9389   ;
9390   return 0;
9391 }
9392 _ACEOF
9393 rm -f conftest.$ac_objext conftest$ac_exeext
9394 if { (eval echo "$as_me:9394: \"$ac_link\"") >&5
9395   (eval $ac_link) 2>&5
9396   ac_status=$?
9397   echo "$as_me:9397: \$? = $ac_status" >&5
9398   (exit $ac_status); } &&
9399          { ac_try='test -s conftest$ac_exeext'
9400   { (eval echo "$as_me:9400: \"$ac_try\"") >&5
9401   (eval $ac_try) 2>&5
9402   ac_status=$?
9403   echo "$as_me:9403: \$? = $ac_status" >&5
9404   (exit $ac_status); }; }; then
9405   ac_cv_lib_nsl_gethostbyname=yes
9406 else
9407   echo "$as_me: failed program was:" >&5
9408 cat conftest.$ac_ext >&5
9409 ac_cv_lib_nsl_gethostbyname=no
9410 fi
9411 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9412 LIBS=$ac_check_lib_save_LIBS
9413 fi
9414 echo "$as_me:9414: result: $ac_cv_lib_nsl_gethostbyname" >&5
9415 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9416 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9417   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9418 fi
9419
9420       if test $ac_cv_lib_nsl_gethostbyname = no; then
9421         echo "$as_me:9421: checking for gethostbyname in -lbsd" >&5
9422 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9423 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9424   echo $ECHO_N "(cached) $ECHO_C" >&6
9425 else
9426   ac_check_lib_save_LIBS=$LIBS
9427 LIBS="-lbsd  $LIBS"
9428 cat >conftest.$ac_ext <<_ACEOF
9429 #line 9429 "configure"
9430 #include "confdefs.h"
9431
9432 /* Override any gcc2 internal prototype to avoid an error.  */
9433 #ifdef __cplusplus
9434 extern "C"
9435 #endif
9436 /* We use char because int might match the return type of a gcc2
9437    builtin and then its argument prototype would still apply.  */
9438 char gethostbyname ();
9439 int
9440 main ()
9441 {
9442 gethostbyname ();
9443   ;
9444   return 0;
9445 }
9446 _ACEOF
9447 rm -f conftest.$ac_objext conftest$ac_exeext
9448 if { (eval echo "$as_me:9448: \"$ac_link\"") >&5
9449   (eval $ac_link) 2>&5
9450   ac_status=$?
9451   echo "$as_me:9451: \$? = $ac_status" >&5
9452   (exit $ac_status); } &&
9453          { ac_try='test -s conftest$ac_exeext'
9454   { (eval echo "$as_me:9454: \"$ac_try\"") >&5
9455   (eval $ac_try) 2>&5
9456   ac_status=$?
9457   echo "$as_me:9457: \$? = $ac_status" >&5
9458   (exit $ac_status); }; }; then
9459   ac_cv_lib_bsd_gethostbyname=yes
9460 else
9461   echo "$as_me: failed program was:" >&5
9462 cat conftest.$ac_ext >&5
9463 ac_cv_lib_bsd_gethostbyname=no
9464 fi
9465 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9466 LIBS=$ac_check_lib_save_LIBS
9467 fi
9468 echo "$as_me:9468: result: $ac_cv_lib_bsd_gethostbyname" >&5
9469 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
9470 if test $ac_cv_lib_bsd_gethostbyname = yes; then
9471   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
9472 fi
9473
9474       fi
9475     fi
9476
9477     # lieder@skyler.mavd.honeywell.com says without -lsocket,
9478     # socket/setsockopt and other routines are undefined under SCO ODT
9479     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
9480     # on later versions), says Simon Leinen: it contains gethostby*
9481     # variants that don't use the nameserver (or something).  -lsocket
9482     # must be given before -lnsl if both are needed.  We assume that
9483     # if connect needs -lnsl, so does gethostbyname.
9484     echo "$as_me:9484: checking for connect" >&5
9485 echo $ECHO_N "checking for connect... $ECHO_C" >&6
9486 if test "${ac_cv_func_connect+set}" = set; then
9487   echo $ECHO_N "(cached) $ECHO_C" >&6
9488 else
9489   cat >conftest.$ac_ext <<_ACEOF
9490 #line 9490 "configure"
9491 #include "confdefs.h"
9492 /* System header to define __stub macros and hopefully few prototypes,
9493     which can conflict with char connect (); below.  */
9494 #include <assert.h>
9495 /* Override any gcc2 internal prototype to avoid an error.  */
9496 #ifdef __cplusplus
9497 extern "C"
9498 #endif
9499 /* We use char because int might match the return type of a gcc2
9500    builtin and then its argument prototype would still apply.  */
9501 char connect ();
9502 char (*f) ();
9503
9504 int
9505 main ()
9506 {
9507 /* The GNU C library defines this for functions which it implements
9508     to always fail with ENOSYS.  Some functions are actually named
9509     something starting with __ and the normal name is an alias.  */
9510 #if defined (__stub_connect) || defined (__stub___connect)
9511 choke me
9512 #else
9513 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9514 #endif
9515
9516   ;
9517   return 0;
9518 }
9519 _ACEOF
9520 rm -f conftest.$ac_objext conftest$ac_exeext
9521 if { (eval echo "$as_me:9521: \"$ac_link\"") >&5
9522   (eval $ac_link) 2>&5
9523   ac_status=$?
9524   echo "$as_me:9524: \$? = $ac_status" >&5
9525   (exit $ac_status); } &&
9526          { ac_try='test -s conftest$ac_exeext'
9527   { (eval echo "$as_me:9527: \"$ac_try\"") >&5
9528   (eval $ac_try) 2>&5
9529   ac_status=$?
9530   echo "$as_me:9530: \$? = $ac_status" >&5
9531   (exit $ac_status); }; }; then
9532   ac_cv_func_connect=yes
9533 else
9534   echo "$as_me: failed program was:" >&5
9535 cat conftest.$ac_ext >&5
9536 ac_cv_func_connect=no
9537 fi
9538 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9539 fi
9540 echo "$as_me:9540: result: $ac_cv_func_connect" >&5
9541 echo "${ECHO_T}$ac_cv_func_connect" >&6
9542
9543     if test $ac_cv_func_connect = no; then
9544       echo "$as_me:9544: checking for connect in -lsocket" >&5
9545 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
9546 if test "${ac_cv_lib_socket_connect+set}" = set; then
9547   echo $ECHO_N "(cached) $ECHO_C" >&6
9548 else
9549   ac_check_lib_save_LIBS=$LIBS
9550 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
9551 cat >conftest.$ac_ext <<_ACEOF
9552 #line 9552 "configure"
9553 #include "confdefs.h"
9554
9555 /* Override any gcc2 internal prototype to avoid an error.  */
9556 #ifdef __cplusplus
9557 extern "C"
9558 #endif
9559 /* We use char because int might match the return type of a gcc2
9560    builtin and then its argument prototype would still apply.  */
9561 char connect ();
9562 int
9563 main ()
9564 {
9565 connect ();
9566   ;
9567   return 0;
9568 }
9569 _ACEOF
9570 rm -f conftest.$ac_objext conftest$ac_exeext
9571 if { (eval echo "$as_me:9571: \"$ac_link\"") >&5
9572   (eval $ac_link) 2>&5
9573   ac_status=$?
9574   echo "$as_me:9574: \$? = $ac_status" >&5
9575   (exit $ac_status); } &&
9576          { ac_try='test -s conftest$ac_exeext'
9577   { (eval echo "$as_me:9577: \"$ac_try\"") >&5
9578   (eval $ac_try) 2>&5
9579   ac_status=$?
9580   echo "$as_me:9580: \$? = $ac_status" >&5
9581   (exit $ac_status); }; }; then
9582   ac_cv_lib_socket_connect=yes
9583 else
9584   echo "$as_me: failed program was:" >&5
9585 cat conftest.$ac_ext >&5
9586 ac_cv_lib_socket_connect=no
9587 fi
9588 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9589 LIBS=$ac_check_lib_save_LIBS
9590 fi
9591 echo "$as_me:9591: result: $ac_cv_lib_socket_connect" >&5
9592 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
9593 if test $ac_cv_lib_socket_connect = yes; then
9594   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
9595 fi
9596
9597     fi
9598
9599     # Guillermo Gomez says -lposix is necessary on A/UX.
9600     echo "$as_me:9600: checking for remove" >&5
9601 echo $ECHO_N "checking for remove... $ECHO_C" >&6
9602 if test "${ac_cv_func_remove+set}" = set; then
9603   echo $ECHO_N "(cached) $ECHO_C" >&6
9604 else
9605   cat >conftest.$ac_ext <<_ACEOF
9606 #line 9606 "configure"
9607 #include "confdefs.h"
9608 /* System header to define __stub macros and hopefully few prototypes,
9609     which can conflict with char remove (); below.  */
9610 #include <assert.h>
9611 /* Override any gcc2 internal prototype to avoid an error.  */
9612 #ifdef __cplusplus
9613 extern "C"
9614 #endif
9615 /* We use char because int might match the return type of a gcc2
9616    builtin and then its argument prototype would still apply.  */
9617 char remove ();
9618 char (*f) ();
9619
9620 int
9621 main ()
9622 {
9623 /* The GNU C library defines this for functions which it implements
9624     to always fail with ENOSYS.  Some functions are actually named
9625     something starting with __ and the normal name is an alias.  */
9626 #if defined (__stub_remove) || defined (__stub___remove)
9627 choke me
9628 #else
9629 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9630 #endif
9631
9632   ;
9633   return 0;
9634 }
9635 _ACEOF
9636 rm -f conftest.$ac_objext conftest$ac_exeext
9637 if { (eval echo "$as_me:9637: \"$ac_link\"") >&5
9638   (eval $ac_link) 2>&5
9639   ac_status=$?
9640   echo "$as_me:9640: \$? = $ac_status" >&5
9641   (exit $ac_status); } &&
9642          { ac_try='test -s conftest$ac_exeext'
9643   { (eval echo "$as_me:9643: \"$ac_try\"") >&5
9644   (eval $ac_try) 2>&5
9645   ac_status=$?
9646   echo "$as_me:9646: \$? = $ac_status" >&5
9647   (exit $ac_status); }; }; then
9648   ac_cv_func_remove=yes
9649 else
9650   echo "$as_me: failed program was:" >&5
9651 cat conftest.$ac_ext >&5
9652 ac_cv_func_remove=no
9653 fi
9654 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9655 fi
9656 echo "$as_me:9656: result: $ac_cv_func_remove" >&5
9657 echo "${ECHO_T}$ac_cv_func_remove" >&6
9658
9659     if test $ac_cv_func_remove = no; then
9660       echo "$as_me:9660: checking for remove in -lposix" >&5
9661 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
9662 if test "${ac_cv_lib_posix_remove+set}" = set; then
9663   echo $ECHO_N "(cached) $ECHO_C" >&6
9664 else
9665   ac_check_lib_save_LIBS=$LIBS
9666 LIBS="-lposix  $LIBS"
9667 cat >conftest.$ac_ext <<_ACEOF
9668 #line 9668 "configure"
9669 #include "confdefs.h"
9670
9671 /* Override any gcc2 internal prototype to avoid an error.  */
9672 #ifdef __cplusplus
9673 extern "C"
9674 #endif
9675 /* We use char because int might match the return type of a gcc2
9676    builtin and then its argument prototype would still apply.  */
9677 char remove ();
9678 int
9679 main ()
9680 {
9681 remove ();
9682   ;
9683   return 0;
9684 }
9685 _ACEOF
9686 rm -f conftest.$ac_objext conftest$ac_exeext
9687 if { (eval echo "$as_me:9687: \"$ac_link\"") >&5
9688   (eval $ac_link) 2>&5
9689   ac_status=$?
9690   echo "$as_me:9690: \$? = $ac_status" >&5
9691   (exit $ac_status); } &&
9692          { ac_try='test -s conftest$ac_exeext'
9693   { (eval echo "$as_me:9693: \"$ac_try\"") >&5
9694   (eval $ac_try) 2>&5
9695   ac_status=$?
9696   echo "$as_me:9696: \$? = $ac_status" >&5
9697   (exit $ac_status); }; }; then
9698   ac_cv_lib_posix_remove=yes
9699 else
9700   echo "$as_me: failed program was:" >&5
9701 cat conftest.$ac_ext >&5
9702 ac_cv_lib_posix_remove=no
9703 fi
9704 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9705 LIBS=$ac_check_lib_save_LIBS
9706 fi
9707 echo "$as_me:9707: result: $ac_cv_lib_posix_remove" >&5
9708 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
9709 if test $ac_cv_lib_posix_remove = yes; then
9710   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
9711 fi
9712
9713     fi
9714
9715     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
9716     echo "$as_me:9716: checking for shmat" >&5
9717 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
9718 if test "${ac_cv_func_shmat+set}" = set; then
9719   echo $ECHO_N "(cached) $ECHO_C" >&6
9720 else
9721   cat >conftest.$ac_ext <<_ACEOF
9722 #line 9722 "configure"
9723 #include "confdefs.h"
9724 /* System header to define __stub macros and hopefully few prototypes,
9725     which can conflict with char shmat (); below.  */
9726 #include <assert.h>
9727 /* Override any gcc2 internal prototype to avoid an error.  */
9728 #ifdef __cplusplus
9729 extern "C"
9730 #endif
9731 /* We use char because int might match the return type of a gcc2
9732    builtin and then its argument prototype would still apply.  */
9733 char shmat ();
9734 char (*f) ();
9735
9736 int
9737 main ()
9738 {
9739 /* The GNU C library defines this for functions which it implements
9740     to always fail with ENOSYS.  Some functions are actually named
9741     something starting with __ and the normal name is an alias.  */
9742 #if defined (__stub_shmat) || defined (__stub___shmat)
9743 choke me
9744 #else
9745 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9746 #endif
9747
9748   ;
9749   return 0;
9750 }
9751 _ACEOF
9752 rm -f conftest.$ac_objext conftest$ac_exeext
9753 if { (eval echo "$as_me:9753: \"$ac_link\"") >&5
9754   (eval $ac_link) 2>&5
9755   ac_status=$?
9756   echo "$as_me:9756: \$? = $ac_status" >&5
9757   (exit $ac_status); } &&
9758          { ac_try='test -s conftest$ac_exeext'
9759   { (eval echo "$as_me:9759: \"$ac_try\"") >&5
9760   (eval $ac_try) 2>&5
9761   ac_status=$?
9762   echo "$as_me:9762: \$? = $ac_status" >&5
9763   (exit $ac_status); }; }; then
9764   ac_cv_func_shmat=yes
9765 else
9766   echo "$as_me: failed program was:" >&5
9767 cat conftest.$ac_ext >&5
9768 ac_cv_func_shmat=no
9769 fi
9770 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9771 fi
9772 echo "$as_me:9772: result: $ac_cv_func_shmat" >&5
9773 echo "${ECHO_T}$ac_cv_func_shmat" >&6
9774
9775     if test $ac_cv_func_shmat = no; then
9776       echo "$as_me:9776: checking for shmat in -lipc" >&5
9777 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
9778 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
9779   echo $ECHO_N "(cached) $ECHO_C" >&6
9780 else
9781   ac_check_lib_save_LIBS=$LIBS
9782 LIBS="-lipc  $LIBS"
9783 cat >conftest.$ac_ext <<_ACEOF
9784 #line 9784 "configure"
9785 #include "confdefs.h"
9786
9787 /* Override any gcc2 internal prototype to avoid an error.  */
9788 #ifdef __cplusplus
9789 extern "C"
9790 #endif
9791 /* We use char because int might match the return type of a gcc2
9792    builtin and then its argument prototype would still apply.  */
9793 char shmat ();
9794 int
9795 main ()
9796 {
9797 shmat ();
9798   ;
9799   return 0;
9800 }
9801 _ACEOF
9802 rm -f conftest.$ac_objext conftest$ac_exeext
9803 if { (eval echo "$as_me:9803: \"$ac_link\"") >&5
9804   (eval $ac_link) 2>&5
9805   ac_status=$?
9806   echo "$as_me:9806: \$? = $ac_status" >&5
9807   (exit $ac_status); } &&
9808          { ac_try='test -s conftest$ac_exeext'
9809   { (eval echo "$as_me:9809: \"$ac_try\"") >&5
9810   (eval $ac_try) 2>&5
9811   ac_status=$?
9812   echo "$as_me:9812: \$? = $ac_status" >&5
9813   (exit $ac_status); }; }; then
9814   ac_cv_lib_ipc_shmat=yes
9815 else
9816   echo "$as_me: failed program was:" >&5
9817 cat conftest.$ac_ext >&5
9818 ac_cv_lib_ipc_shmat=no
9819 fi
9820 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9821 LIBS=$ac_check_lib_save_LIBS
9822 fi
9823 echo "$as_me:9823: result: $ac_cv_lib_ipc_shmat" >&5
9824 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
9825 if test $ac_cv_lib_ipc_shmat = yes; then
9826   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
9827 fi
9828
9829     fi
9830   fi
9831
9832   # Check for libraries that X11R6 Xt/Xaw programs need.
9833   ac_save_LDFLAGS=$LDFLAGS
9834   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
9835   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
9836   # check for ICE first), but we must link in the order -lSM -lICE or
9837   # we get undefined symbols.  So assume we have SM if we have ICE.
9838   # These have to be linked with before -lX11, unlike the other
9839   # libraries we check for below, so use a different variable.
9840   # John Interrante, Karl Berry
9841   echo "$as_me:9841: checking for IceConnectionNumber in -lICE" >&5
9842 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
9843 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
9844   echo $ECHO_N "(cached) $ECHO_C" >&6
9845 else
9846   ac_check_lib_save_LIBS=$LIBS
9847 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
9848 cat >conftest.$ac_ext <<_ACEOF
9849 #line 9849 "configure"
9850 #include "confdefs.h"
9851
9852 /* Override any gcc2 internal prototype to avoid an error.  */
9853 #ifdef __cplusplus
9854 extern "C"
9855 #endif
9856 /* We use char because int might match the return type of a gcc2
9857    builtin and then its argument prototype would still apply.  */
9858 char IceConnectionNumber ();
9859 int
9860 main ()
9861 {
9862 IceConnectionNumber ();
9863   ;
9864   return 0;
9865 }
9866 _ACEOF
9867 rm -f conftest.$ac_objext conftest$ac_exeext
9868 if { (eval echo "$as_me:9868: \"$ac_link\"") >&5
9869   (eval $ac_link) 2>&5
9870   ac_status=$?
9871   echo "$as_me:9871: \$? = $ac_status" >&5
9872   (exit $ac_status); } &&
9873          { ac_try='test -s conftest$ac_exeext'
9874   { (eval echo "$as_me:9874: \"$ac_try\"") >&5
9875   (eval $ac_try) 2>&5
9876   ac_status=$?
9877   echo "$as_me:9877: \$? = $ac_status" >&5
9878   (exit $ac_status); }; }; then
9879   ac_cv_lib_ICE_IceConnectionNumber=yes
9880 else
9881   echo "$as_me: failed program was:" >&5
9882 cat conftest.$ac_ext >&5
9883 ac_cv_lib_ICE_IceConnectionNumber=no
9884 fi
9885 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9886 LIBS=$ac_check_lib_save_LIBS
9887 fi
9888 echo "$as_me:9888: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
9889 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
9890 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
9891   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
9892 fi
9893
9894   LDFLAGS=$ac_save_LDFLAGS
9895
9896 fi
9897
9898 cf_x_athena=${cf_x_athena:-Xaw}
9899
9900 echo "$as_me:9900: checking if you want to link with Xaw 3d library" >&5
9901 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
9902 withval=
9903
9904 # Check whether --with-Xaw3d or --without-Xaw3d was given.
9905 if test "${with_Xaw3d+set}" = set; then
9906   withval="$with_Xaw3d"
9907
9908 fi;
9909 if test "$withval" = yes ; then
9910         cf_x_athena=Xaw3d
9911         echo "$as_me:9911: result: yes" >&5
9912 echo "${ECHO_T}yes" >&6
9913 else
9914         echo "$as_me:9914: result: no" >&5
9915 echo "${ECHO_T}no" >&6
9916 fi
9917
9918 echo "$as_me:9918: checking if you want to link with neXT Athena library" >&5
9919 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
9920 withval=
9921
9922 # Check whether --with-neXtaw or --without-neXtaw was given.
9923 if test "${with_neXtaw+set}" = set; then
9924   withval="$with_neXtaw"
9925
9926 fi;
9927 if test "$withval" = yes ; then
9928         cf_x_athena=neXtaw
9929         echo "$as_me:9929: result: yes" >&5
9930 echo "${ECHO_T}yes" >&6
9931 else
9932         echo "$as_me:9932: result: no" >&5
9933 echo "${ECHO_T}no" >&6
9934 fi
9935
9936 echo "$as_me:9936: checking if you want to link with Athena-Plus library" >&5
9937 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
9938 withval=
9939
9940 # Check whether --with-XawPlus or --without-XawPlus was given.
9941 if test "${with_XawPlus+set}" = set; then
9942   withval="$with_XawPlus"
9943
9944 fi;
9945 if test "$withval" = yes ; then
9946         cf_x_athena=XawPlus
9947         echo "$as_me:9947: result: yes" >&5
9948 echo "${ECHO_T}yes" >&6
9949 else
9950         echo "$as_me:9950: result: no" >&5
9951 echo "${ECHO_T}no" >&6
9952 fi
9953
9954 cf_x_athena_lib=""
9955
9956 if test "$PKG_CONFIG" != none ; then
9957         cf_athena_list=
9958         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
9959         for cf_athena_pkg in \
9960                 $cf_athena_list \
9961                 ${cf_x_athena} \
9962                 ${cf_x_athena}-devel \
9963                 lib${cf_x_athena} \
9964                 lib${cf_x_athena}-devel
9965         do
9966
9967 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
9968         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
9969
9970 echo "${as_me:-configure}:9970: testing found package $cf_athena_pkg ..." 1>&5
9971
9972         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
9973         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
9974         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
9975
9976 echo "${as_me:-configure}:9976: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
9977
9978         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
9979
9980 echo "${as_me:-configure}:9980: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
9981
9982 cf_fix_cppflags=no
9983 cf_new_cflags=
9984 cf_new_cppflags=
9985 cf_new_extra_cppflags=
9986
9987 for cf_add_cflags in $cf_pkgconfig_incs
9988 do
9989 case $cf_fix_cppflags in
9990 no)
9991         case $cf_add_cflags in #(vi
9992         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
9993                 case $cf_add_cflags in
9994                 -D*)
9995                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9996
9997                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9998                                 && test -z "${cf_tst_cflags}" \
9999                                 && cf_fix_cppflags=yes
10000
10001                         if test $cf_fix_cppflags = yes ; then
10002                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10003                                 continue
10004                         elif test "${cf_tst_cflags}" = "\"'" ; then
10005                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10006                                 continue
10007                         fi
10008                         ;;
10009                 esac
10010                 case "$CPPFLAGS" in
10011                 *$cf_add_cflags) #(vi
10012                         ;;
10013                 *) #(vi
10014                         case $cf_add_cflags in #(vi
10015                         -D*)
10016                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10017
10018 CPPFLAGS=`echo "$CPPFLAGS" | \
10019         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10020                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10021
10022                                 ;;
10023                         esac
10024                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10025                         ;;
10026                 esac
10027                 ;;
10028         *)
10029                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10030                 ;;
10031         esac
10032         ;;
10033 yes)
10034         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10035
10036         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10037
10038         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10039                 && test -z "${cf_tst_cflags}" \
10040                 && cf_fix_cppflags=no
10041         ;;
10042 esac
10043 done
10044
10045 if test -n "$cf_new_cflags" ; then
10046
10047         CFLAGS="$CFLAGS $cf_new_cflags"
10048 fi
10049
10050 if test -n "$cf_new_cppflags" ; then
10051
10052         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10053 fi
10054
10055 if test -n "$cf_new_extra_cppflags" ; then
10056
10057         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10058 fi
10059
10060         LIBS="$cf_pkgconfig_libs $LIBS"
10061
10062                         cf_x_athena_lib="$cf_pkgconfig_libs"
10063
10064 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10065
10066                         cat >>confdefs.h <<EOF
10067 #define $cf_x_athena_LIBS 1
10068 EOF
10069
10070 echo "$as_me:10070: checking for usable $cf_x_athena/Xmu package" >&5
10071 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10072 if test "${cf_cv_xaw_compat+set}" = set; then
10073   echo $ECHO_N "(cached) $ECHO_C" >&6
10074 else
10075
10076 cat >conftest.$ac_ext <<_ACEOF
10077 #line 10077 "configure"
10078 #include "confdefs.h"
10079
10080 #include <X11/Xmu/CharSet.h>
10081
10082 int
10083 main ()
10084 {
10085
10086 int check = XmuCompareISOLatin1("big", "small")
10087
10088   ;
10089   return 0;
10090 }
10091 _ACEOF
10092 rm -f conftest.$ac_objext conftest$ac_exeext
10093 if { (eval echo "$as_me:10093: \"$ac_link\"") >&5
10094   (eval $ac_link) 2>&5
10095   ac_status=$?
10096   echo "$as_me:10096: \$? = $ac_status" >&5
10097   (exit $ac_status); } &&
10098          { ac_try='test -s conftest$ac_exeext'
10099   { (eval echo "$as_me:10099: \"$ac_try\"") >&5
10100   (eval $ac_try) 2>&5
10101   ac_status=$?
10102   echo "$as_me:10102: \$? = $ac_status" >&5
10103   (exit $ac_status); }; }; then
10104   cf_cv_xaw_compat=yes
10105 else
10106   echo "$as_me: failed program was:" >&5
10107 cat conftest.$ac_ext >&5
10108 cf_cv_xaw_compat=no
10109 fi
10110 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10111 fi
10112 echo "$as_me:10112: result: $cf_cv_xaw_compat" >&5
10113 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10114
10115                         if test "$cf_cv_xaw_compat" = no
10116                         then
10117                                 # workaround for broken ".pc" files...
10118                                 case "$cf_x_athena_lib" in #(vi
10119                                 *-lXmu*) #(vi
10120                                         ;;
10121                                 *)
10122                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10123
10124 echo "${as_me:-configure}:10124: testing work around broken package ..." 1>&5
10125
10126 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10127         test -n "$verbose" && echo "    found package xmu" 1>&6
10128
10129 echo "${as_me:-configure}:10129: testing found package xmu ..." 1>&5
10130
10131         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10132         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10133         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10134
10135 echo "${as_me:-configure}:10135: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10136
10137         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10138
10139 echo "${as_me:-configure}:10139: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10140
10141 cf_fix_cppflags=no
10142 cf_new_cflags=
10143 cf_new_cppflags=
10144 cf_new_extra_cppflags=
10145
10146 for cf_add_cflags in $cf_pkgconfig_incs
10147 do
10148 case $cf_fix_cppflags in
10149 no)
10150         case $cf_add_cflags in #(vi
10151         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10152                 case $cf_add_cflags in
10153                 -D*)
10154                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10155
10156                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10157                                 && test -z "${cf_tst_cflags}" \
10158                                 && cf_fix_cppflags=yes
10159
10160                         if test $cf_fix_cppflags = yes ; then
10161                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10162                                 continue
10163                         elif test "${cf_tst_cflags}" = "\"'" ; then
10164                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10165                                 continue
10166                         fi
10167                         ;;
10168                 esac
10169                 case "$CPPFLAGS" in
10170                 *$cf_add_cflags) #(vi
10171                         ;;
10172                 *) #(vi
10173                         case $cf_add_cflags in #(vi
10174                         -D*)
10175                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10176
10177 CPPFLAGS=`echo "$CPPFLAGS" | \
10178         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10179                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10180
10181                                 ;;
10182                         esac
10183                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10184                         ;;
10185                 esac
10186                 ;;
10187         *)
10188                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10189                 ;;
10190         esac
10191         ;;
10192 yes)
10193         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10194
10195         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10196
10197         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10198                 && test -z "${cf_tst_cflags}" \
10199                 && cf_fix_cppflags=no
10200         ;;
10201 esac
10202 done
10203
10204 if test -n "$cf_new_cflags" ; then
10205
10206         CFLAGS="$CFLAGS $cf_new_cflags"
10207 fi
10208
10209 if test -n "$cf_new_cppflags" ; then
10210
10211         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10212 fi
10213
10214 if test -n "$cf_new_extra_cppflags" ; then
10215
10216         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10217 fi
10218
10219         LIBS="$cf_pkgconfig_libs $LIBS"
10220         :
10221 else
10222
10223 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10224
10225 echo "${as_me:-configure}:10225: testing ...before $LIBS ..." 1>&5
10226
10227 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lXmu ," -e 's/  / /g'`
10228 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10229
10230 echo "${as_me:-configure}:10230: testing ...after  $LIBS ..." 1>&5
10231
10232 fi
10233
10234                                         ;;
10235                                 esac
10236                         fi
10237
10238                         break
10239 else
10240         :
10241 fi
10242
10243         done
10244 fi
10245
10246 if test -z "$cf_x_athena_lib" ; then
10247
10248 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10249         test -n "$verbose" && echo "    found package Xext" 1>&6
10250
10251 echo "${as_me:-configure}:10251: testing found package Xext ..." 1>&5
10252
10253         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10254         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10255         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10256
10257 echo "${as_me:-configure}:10257: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10258
10259         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10260
10261 echo "${as_me:-configure}:10261: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10262
10263 cf_fix_cppflags=no
10264 cf_new_cflags=
10265 cf_new_cppflags=
10266 cf_new_extra_cppflags=
10267
10268 for cf_add_cflags in $cf_pkgconfig_incs
10269 do
10270 case $cf_fix_cppflags in
10271 no)
10272         case $cf_add_cflags in #(vi
10273         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10274                 case $cf_add_cflags in
10275                 -D*)
10276                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10277
10278                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10279                                 && test -z "${cf_tst_cflags}" \
10280                                 && cf_fix_cppflags=yes
10281
10282                         if test $cf_fix_cppflags = yes ; then
10283                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10284                                 continue
10285                         elif test "${cf_tst_cflags}" = "\"'" ; then
10286                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10287                                 continue
10288                         fi
10289                         ;;
10290                 esac
10291                 case "$CPPFLAGS" in
10292                 *$cf_add_cflags) #(vi
10293                         ;;
10294                 *) #(vi
10295                         case $cf_add_cflags in #(vi
10296                         -D*)
10297                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10298
10299 CPPFLAGS=`echo "$CPPFLAGS" | \
10300         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10301                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10302
10303                                 ;;
10304                         esac
10305                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10306                         ;;
10307                 esac
10308                 ;;
10309         *)
10310                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10311                 ;;
10312         esac
10313         ;;
10314 yes)
10315         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10316
10317         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10318
10319         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10320                 && test -z "${cf_tst_cflags}" \
10321                 && cf_fix_cppflags=no
10322         ;;
10323 esac
10324 done
10325
10326 if test -n "$cf_new_cflags" ; then
10327
10328         CFLAGS="$CFLAGS $cf_new_cflags"
10329 fi
10330
10331 if test -n "$cf_new_cppflags" ; then
10332
10333         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10334 fi
10335
10336 if test -n "$cf_new_extra_cppflags" ; then
10337
10338         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10339 fi
10340
10341         LIBS="$cf_pkgconfig_libs $LIBS"
10342         :
10343 else
10344
10345         echo "$as_me:10345: checking for XextCreateExtension in -lXext" >&5
10346 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10347 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10348   echo $ECHO_N "(cached) $ECHO_C" >&6
10349 else
10350   ac_check_lib_save_LIBS=$LIBS
10351 LIBS="-lXext  $LIBS"
10352 cat >conftest.$ac_ext <<_ACEOF
10353 #line 10353 "configure"
10354 #include "confdefs.h"
10355
10356 /* Override any gcc2 internal prototype to avoid an error.  */
10357 #ifdef __cplusplus
10358 extern "C"
10359 #endif
10360 /* We use char because int might match the return type of a gcc2
10361    builtin and then its argument prototype would still apply.  */
10362 char XextCreateExtension ();
10363 int
10364 main ()
10365 {
10366 XextCreateExtension ();
10367   ;
10368   return 0;
10369 }
10370 _ACEOF
10371 rm -f conftest.$ac_objext conftest$ac_exeext
10372 if { (eval echo "$as_me:10372: \"$ac_link\"") >&5
10373   (eval $ac_link) 2>&5
10374   ac_status=$?
10375   echo "$as_me:10375: \$? = $ac_status" >&5
10376   (exit $ac_status); } &&
10377          { ac_try='test -s conftest$ac_exeext'
10378   { (eval echo "$as_me:10378: \"$ac_try\"") >&5
10379   (eval $ac_try) 2>&5
10380   ac_status=$?
10381   echo "$as_me:10381: \$? = $ac_status" >&5
10382   (exit $ac_status); }; }; then
10383   ac_cv_lib_Xext_XextCreateExtension=yes
10384 else
10385   echo "$as_me: failed program was:" >&5
10386 cat conftest.$ac_ext >&5
10387 ac_cv_lib_Xext_XextCreateExtension=no
10388 fi
10389 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10390 LIBS=$ac_check_lib_save_LIBS
10391 fi
10392 echo "$as_me:10392: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
10393 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
10394 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
10395   LIBS="-lXext $LIBS"
10396 fi
10397
10398 fi
10399
10400 cf_have_X_LIBS=no
10401
10402 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
10403         test -n "$verbose" && echo "    found package xt" 1>&6
10404
10405 echo "${as_me:-configure}:10405: testing found package xt ..." 1>&5
10406
10407         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
10408         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
10409         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
10410
10411 echo "${as_me:-configure}:10411: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10412
10413         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
10414
10415 echo "${as_me:-configure}:10415: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
10416
10417 cf_fix_cppflags=no
10418 cf_new_cflags=
10419 cf_new_cppflags=
10420 cf_new_extra_cppflags=
10421
10422 for cf_add_cflags in $cf_pkgconfig_incs
10423 do
10424 case $cf_fix_cppflags in
10425 no)
10426         case $cf_add_cflags in #(vi
10427         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10428                 case $cf_add_cflags in
10429                 -D*)
10430                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10431
10432                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10433                                 && test -z "${cf_tst_cflags}" \
10434                                 && cf_fix_cppflags=yes
10435
10436                         if test $cf_fix_cppflags = yes ; then
10437                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10438                                 continue
10439                         elif test "${cf_tst_cflags}" = "\"'" ; then
10440                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10441                                 continue
10442                         fi
10443                         ;;
10444                 esac
10445                 case "$CPPFLAGS" in
10446                 *$cf_add_cflags) #(vi
10447                         ;;
10448                 *) #(vi
10449                         case $cf_add_cflags in #(vi
10450                         -D*)
10451                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10452
10453 CPPFLAGS=`echo "$CPPFLAGS" | \
10454         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10455                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10456
10457                                 ;;
10458                         esac
10459                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10460                         ;;
10461                 esac
10462                 ;;
10463         *)
10464                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10465                 ;;
10466         esac
10467         ;;
10468 yes)
10469         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10470
10471         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10472
10473         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10474                 && test -z "${cf_tst_cflags}" \
10475                 && cf_fix_cppflags=no
10476         ;;
10477 esac
10478 done
10479
10480 if test -n "$cf_new_cflags" ; then
10481
10482         CFLAGS="$CFLAGS $cf_new_cflags"
10483 fi
10484
10485 if test -n "$cf_new_cppflags" ; then
10486
10487         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10488 fi
10489
10490 if test -n "$cf_new_extra_cppflags" ; then
10491
10492         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10493 fi
10494
10495         LIBS="$cf_pkgconfig_libs $LIBS"
10496
10497         case "x$LIBS" in #(vi
10498         *-lX11*) #(vi
10499                 ;;
10500         *)
10501 # we have an "xt" package, but it may omit Xt's dependency on X11
10502 echo "$as_me:10502: checking for usable X dependency" >&5
10503 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
10504 if test "${cf_cv_xt_x11_compat+set}" = set; then
10505   echo $ECHO_N "(cached) $ECHO_C" >&6
10506 else
10507
10508 cat >conftest.$ac_ext <<_ACEOF
10509 #line 10509 "configure"
10510 #include "confdefs.h"
10511
10512 #include <X11/Xlib.h>
10513
10514 int
10515 main ()
10516 {
10517
10518         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
10519         int rc2 = XClearWindow((Display*) 0, (Window) 0);
10520         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
10521         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
10522
10523   ;
10524   return 0;
10525 }
10526 _ACEOF
10527 rm -f conftest.$ac_objext conftest$ac_exeext
10528 if { (eval echo "$as_me:10528: \"$ac_link\"") >&5
10529   (eval $ac_link) 2>&5
10530   ac_status=$?
10531   echo "$as_me:10531: \$? = $ac_status" >&5
10532   (exit $ac_status); } &&
10533          { ac_try='test -s conftest$ac_exeext'
10534   { (eval echo "$as_me:10534: \"$ac_try\"") >&5
10535   (eval $ac_try) 2>&5
10536   ac_status=$?
10537   echo "$as_me:10537: \$? = $ac_status" >&5
10538   (exit $ac_status); }; }; then
10539   cf_cv_xt_x11_compat=yes
10540 else
10541   echo "$as_me: failed program was:" >&5
10542 cat conftest.$ac_ext >&5
10543 cf_cv_xt_x11_compat=no
10544 fi
10545 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10546 fi
10547 echo "$as_me:10547: result: $cf_cv_xt_x11_compat" >&5
10548 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
10549                 if test "$cf_cv_xt_x11_compat" = no
10550                 then
10551                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
10552
10553 echo "${as_me:-configure}:10553: testing work around broken X11 dependency ..." 1>&5
10554
10555                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
10556
10557 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
10558         test -n "$verbose" && echo "    found package x11" 1>&6
10559
10560 echo "${as_me:-configure}:10560: testing found package x11 ..." 1>&5
10561
10562         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
10563         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
10564         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
10565
10566 echo "${as_me:-configure}:10566: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10567
10568         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
10569
10570 echo "${as_me:-configure}:10570: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
10571
10572 cf_fix_cppflags=no
10573 cf_new_cflags=
10574 cf_new_cppflags=
10575 cf_new_extra_cppflags=
10576
10577 for cf_add_cflags in $cf_pkgconfig_incs
10578 do
10579 case $cf_fix_cppflags in
10580 no)
10581         case $cf_add_cflags in #(vi
10582         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10583                 case $cf_add_cflags in
10584                 -D*)
10585                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10586
10587                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10588                                 && test -z "${cf_tst_cflags}" \
10589                                 && cf_fix_cppflags=yes
10590
10591                         if test $cf_fix_cppflags = yes ; then
10592                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10593                                 continue
10594                         elif test "${cf_tst_cflags}" = "\"'" ; then
10595                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10596                                 continue
10597                         fi
10598                         ;;
10599                 esac
10600                 case "$CPPFLAGS" in
10601                 *$cf_add_cflags) #(vi
10602                         ;;
10603                 *) #(vi
10604                         case $cf_add_cflags in #(vi
10605                         -D*)
10606                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10607
10608 CPPFLAGS=`echo "$CPPFLAGS" | \
10609         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10610                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10611
10612                                 ;;
10613                         esac
10614                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10615                         ;;
10616                 esac
10617                 ;;
10618         *)
10619                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10620                 ;;
10621         esac
10622         ;;
10623 yes)
10624         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10625
10626         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10627
10628         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10629                 && test -z "${cf_tst_cflags}" \
10630                 && cf_fix_cppflags=no
10631         ;;
10632 esac
10633 done
10634
10635 if test -n "$cf_new_cflags" ; then
10636
10637         CFLAGS="$CFLAGS $cf_new_cflags"
10638 fi
10639
10640 if test -n "$cf_new_cppflags" ; then
10641
10642         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10643 fi
10644
10645 if test -n "$cf_new_extra_cppflags" ; then
10646
10647         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10648 fi
10649
10650         LIBS="$cf_pkgconfig_libs $LIBS"
10651         :
10652 else
10653
10654 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10655
10656 echo "${as_me:-configure}:10656: testing ...before $LIBS ..." 1>&5
10657
10658 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lX11 ," -e 's/  / /g'`
10659 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10660
10661 echo "${as_me:-configure}:10661: testing ...after  $LIBS ..." 1>&5
10662
10663 fi
10664
10665                 fi
10666                 ;;
10667         esac
10668
10669 echo "$as_me:10669: checking for usable X Toolkit package" >&5
10670 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
10671 if test "${cf_cv_xt_ice_compat+set}" = set; then
10672   echo $ECHO_N "(cached) $ECHO_C" >&6
10673 else
10674
10675 cat >conftest.$ac_ext <<_ACEOF
10676 #line 10676 "configure"
10677 #include "confdefs.h"
10678
10679 #include <X11/Shell.h>
10680
10681 int
10682 main ()
10683 {
10684 int num = IceConnectionNumber(0)
10685
10686   ;
10687   return 0;
10688 }
10689 _ACEOF
10690 rm -f conftest.$ac_objext conftest$ac_exeext
10691 if { (eval echo "$as_me:10691: \"$ac_link\"") >&5
10692   (eval $ac_link) 2>&5
10693   ac_status=$?
10694   echo "$as_me:10694: \$? = $ac_status" >&5
10695   (exit $ac_status); } &&
10696          { ac_try='test -s conftest$ac_exeext'
10697   { (eval echo "$as_me:10697: \"$ac_try\"") >&5
10698   (eval $ac_try) 2>&5
10699   ac_status=$?
10700   echo "$as_me:10700: \$? = $ac_status" >&5
10701   (exit $ac_status); }; }; then
10702   cf_cv_xt_ice_compat=yes
10703 else
10704   echo "$as_me: failed program was:" >&5
10705 cat conftest.$ac_ext >&5
10706 cf_cv_xt_ice_compat=no
10707 fi
10708 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10709 fi
10710 echo "$as_me:10710: result: $cf_cv_xt_ice_compat" >&5
10711 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
10712
10713         if test "$cf_cv_xt_ice_compat" = no
10714         then
10715                 # workaround for broken ".pc" files used for X Toolkit.
10716                 case "x$X_PRE_LIBS" in #(vi
10717                 *-lICE*)
10718                         case "x$LIBS" in #(vi
10719                         *-lICE*) #(vi
10720                                 ;;
10721                         *)
10722                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
10723
10724 echo "${as_me:-configure}:10724: testing work around broken ICE dependency ..." 1>&5
10725
10726 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
10727         test -n "$verbose" && echo "    found package ice" 1>&6
10728
10729 echo "${as_me:-configure}:10729: testing found package ice ..." 1>&5
10730
10731         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
10732         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
10733         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
10734
10735 echo "${as_me:-configure}:10735: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10736
10737         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
10738
10739 echo "${as_me:-configure}:10739: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
10740
10741 cf_fix_cppflags=no
10742 cf_new_cflags=
10743 cf_new_cppflags=
10744 cf_new_extra_cppflags=
10745
10746 for cf_add_cflags in $cf_pkgconfig_incs
10747 do
10748 case $cf_fix_cppflags in
10749 no)
10750         case $cf_add_cflags in #(vi
10751         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10752                 case $cf_add_cflags in
10753                 -D*)
10754                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10755
10756                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10757                                 && test -z "${cf_tst_cflags}" \
10758                                 && cf_fix_cppflags=yes
10759
10760                         if test $cf_fix_cppflags = yes ; then
10761                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10762                                 continue
10763                         elif test "${cf_tst_cflags}" = "\"'" ; then
10764                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10765                                 continue
10766                         fi
10767                         ;;
10768                 esac
10769                 case "$CPPFLAGS" in
10770                 *$cf_add_cflags) #(vi
10771                         ;;
10772                 *) #(vi
10773                         case $cf_add_cflags in #(vi
10774                         -D*)
10775                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10776
10777 CPPFLAGS=`echo "$CPPFLAGS" | \
10778         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10779                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10780
10781                                 ;;
10782                         esac
10783                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10784                         ;;
10785                 esac
10786                 ;;
10787         *)
10788                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10789                 ;;
10790         esac
10791         ;;
10792 yes)
10793         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10794
10795         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10796
10797         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10798                 && test -z "${cf_tst_cflags}" \
10799                 && cf_fix_cppflags=no
10800         ;;
10801 esac
10802 done
10803
10804 if test -n "$cf_new_cflags" ; then
10805
10806         CFLAGS="$CFLAGS $cf_new_cflags"
10807 fi
10808
10809 if test -n "$cf_new_cppflags" ; then
10810
10811         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10812 fi
10813
10814 if test -n "$cf_new_extra_cppflags" ; then
10815
10816         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10817 fi
10818
10819         LIBS="$cf_pkgconfig_libs $LIBS"
10820
10821 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
10822         test -n "$verbose" && echo "    found package sm" 1>&6
10823
10824 echo "${as_me:-configure}:10824: testing found package sm ..." 1>&5
10825
10826         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
10827         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
10828         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
10829
10830 echo "${as_me:-configure}:10830: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10831
10832         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
10833
10834 echo "${as_me:-configure}:10834: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
10835
10836 cf_fix_cppflags=no
10837 cf_new_cflags=
10838 cf_new_cppflags=
10839 cf_new_extra_cppflags=
10840
10841 for cf_add_cflags in $cf_pkgconfig_incs
10842 do
10843 case $cf_fix_cppflags in
10844 no)
10845         case $cf_add_cflags in #(vi
10846         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10847                 case $cf_add_cflags in
10848                 -D*)
10849                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10850
10851                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10852                                 && test -z "${cf_tst_cflags}" \
10853                                 && cf_fix_cppflags=yes
10854
10855                         if test $cf_fix_cppflags = yes ; then
10856                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10857                                 continue
10858                         elif test "${cf_tst_cflags}" = "\"'" ; then
10859                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10860                                 continue
10861                         fi
10862                         ;;
10863                 esac
10864                 case "$CPPFLAGS" in
10865                 *$cf_add_cflags) #(vi
10866                         ;;
10867                 *) #(vi
10868                         case $cf_add_cflags in #(vi
10869                         -D*)
10870                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10871
10872 CPPFLAGS=`echo "$CPPFLAGS" | \
10873         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10874                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10875
10876                                 ;;
10877                         esac
10878                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10879                         ;;
10880                 esac
10881                 ;;
10882         *)
10883                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10884                 ;;
10885         esac
10886         ;;
10887 yes)
10888         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10889
10890         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10891
10892         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10893                 && test -z "${cf_tst_cflags}" \
10894                 && cf_fix_cppflags=no
10895         ;;
10896 esac
10897 done
10898
10899 if test -n "$cf_new_cflags" ; then
10900
10901         CFLAGS="$CFLAGS $cf_new_cflags"
10902 fi
10903
10904 if test -n "$cf_new_cppflags" ; then
10905
10906         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10907 fi
10908
10909 if test -n "$cf_new_extra_cppflags" ; then
10910
10911         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10912 fi
10913
10914         LIBS="$cf_pkgconfig_libs $LIBS"
10915         :
10916 else
10917         :
10918 fi
10919
10920 else
10921
10922 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10923
10924 echo "${as_me:-configure}:10924: testing ...before $LIBS ..." 1>&5
10925
10926 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/  / /g'`
10927 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10928
10929 echo "${as_me:-configure}:10929: testing ...after  $LIBS ..." 1>&5
10930
10931 fi
10932
10933                                 ;;
10934                         esac
10935                         ;;
10936                 esac
10937         fi
10938
10939         cf_have_X_LIBS=yes
10940
10941 else
10942
10943         LDFLAGS="$X_LIBS $LDFLAGS"
10944
10945 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
10946
10947 echo "${as_me:-configure}:10947: testing checking additions to CFLAGS ..." 1>&5
10948
10949 cf_check_cflags="$CFLAGS"
10950 cf_check_cppflags="$CPPFLAGS"
10951
10952 cf_fix_cppflags=no
10953 cf_new_cflags=
10954 cf_new_cppflags=
10955 cf_new_extra_cppflags=
10956
10957 for cf_add_cflags in $X_CFLAGS
10958 do
10959 case $cf_fix_cppflags in
10960 no)
10961         case $cf_add_cflags in #(vi
10962         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10963                 case $cf_add_cflags in
10964                 -D*)
10965                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10966
10967                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10968                                 && test -z "${cf_tst_cflags}" \
10969                                 && cf_fix_cppflags=yes
10970
10971                         if test $cf_fix_cppflags = yes ; then
10972                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10973                                 continue
10974                         elif test "${cf_tst_cflags}" = "\"'" ; then
10975                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10976                                 continue
10977                         fi
10978                         ;;
10979                 esac
10980                 case "$CPPFLAGS" in
10981                 *$cf_add_cflags) #(vi
10982                         ;;
10983                 *) #(vi
10984                         case $cf_add_cflags in #(vi
10985                         -D*)
10986                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10987
10988 CPPFLAGS=`echo "$CPPFLAGS" | \
10989         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10990                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10991
10992                                 ;;
10993                         esac
10994                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10995                         ;;
10996                 esac
10997                 ;;
10998         *)
10999                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11000                 ;;
11001         esac
11002         ;;
11003 yes)
11004         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11005
11006         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11007
11008         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11009                 && test -z "${cf_tst_cflags}" \
11010                 && cf_fix_cppflags=no
11011         ;;
11012 esac
11013 done
11014
11015 if test -n "$cf_new_cflags" ; then
11016         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11017
11018 echo "${as_me:-configure}:11018: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11019
11020         CFLAGS="$CFLAGS $cf_new_cflags"
11021 fi
11022
11023 if test -n "$cf_new_cppflags" ; then
11024         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11025
11026 echo "${as_me:-configure}:11026: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11027
11028         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11029 fi
11030
11031 if test -n "$cf_new_extra_cppflags" ; then
11032         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11033
11034 echo "${as_me:-configure}:11034: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11035
11036         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11037 fi
11038
11039 if test "$cf_check_cflags" != "$CFLAGS" ; then
11040 cat >conftest.$ac_ext <<_ACEOF
11041 #line 11041 "configure"
11042 #include "confdefs.h"
11043 #include <stdio.h>
11044 int
11045 main ()
11046 {
11047 printf("Hello world");
11048   ;
11049   return 0;
11050 }
11051 _ACEOF
11052 rm -f conftest.$ac_objext conftest$ac_exeext
11053 if { (eval echo "$as_me:11053: \"$ac_link\"") >&5
11054   (eval $ac_link) 2>&5
11055   ac_status=$?
11056   echo "$as_me:11056: \$? = $ac_status" >&5
11057   (exit $ac_status); } &&
11058          { ac_try='test -s conftest$ac_exeext'
11059   { (eval echo "$as_me:11059: \"$ac_try\"") >&5
11060   (eval $ac_try) 2>&5
11061   ac_status=$?
11062   echo "$as_me:11062: \$? = $ac_status" >&5
11063   (exit $ac_status); }; }; then
11064   :
11065 else
11066   echo "$as_me: failed program was:" >&5
11067 cat conftest.$ac_ext >&5
11068 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
11069
11070 echo "${as_me:-configure}:11070: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
11071
11072          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
11073                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
11074
11075 echo "${as_me:-configure}:11075: testing but keeping change to \$CPPFLAGS ..." 1>&5
11076
11077          fi
11078          CFLAGS="$cf_check_flags"
11079 fi
11080 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11081 fi
11082
11083         echo "$as_me:11083: checking for XOpenDisplay" >&5
11084 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
11085 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
11086   echo $ECHO_N "(cached) $ECHO_C" >&6
11087 else
11088   cat >conftest.$ac_ext <<_ACEOF
11089 #line 11089 "configure"
11090 #include "confdefs.h"
11091 /* System header to define __stub macros and hopefully few prototypes,
11092     which can conflict with char XOpenDisplay (); below.  */
11093 #include <assert.h>
11094 /* Override any gcc2 internal prototype to avoid an error.  */
11095 #ifdef __cplusplus
11096 extern "C"
11097 #endif
11098 /* We use char because int might match the return type of a gcc2
11099    builtin and then its argument prototype would still apply.  */
11100 char XOpenDisplay ();
11101 char (*f) ();
11102
11103 int
11104 main ()
11105 {
11106 /* The GNU C library defines this for functions which it implements
11107     to always fail with ENOSYS.  Some functions are actually named
11108     something starting with __ and the normal name is an alias.  */
11109 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
11110 choke me
11111 #else
11112 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11113 #endif
11114
11115   ;
11116   return 0;
11117 }
11118 _ACEOF
11119 rm -f conftest.$ac_objext conftest$ac_exeext
11120 if { (eval echo "$as_me:11120: \"$ac_link\"") >&5
11121   (eval $ac_link) 2>&5
11122   ac_status=$?
11123   echo "$as_me:11123: \$? = $ac_status" >&5
11124   (exit $ac_status); } &&
11125          { ac_try='test -s conftest$ac_exeext'
11126   { (eval echo "$as_me:11126: \"$ac_try\"") >&5
11127   (eval $ac_try) 2>&5
11128   ac_status=$?
11129   echo "$as_me:11129: \$? = $ac_status" >&5
11130   (exit $ac_status); }; }; then
11131   ac_cv_func_XOpenDisplay=yes
11132 else
11133   echo "$as_me: failed program was:" >&5
11134 cat conftest.$ac_ext >&5
11135 ac_cv_func_XOpenDisplay=no
11136 fi
11137 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11138 fi
11139 echo "$as_me:11139: result: $ac_cv_func_XOpenDisplay" >&5
11140 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
11141 if test $ac_cv_func_XOpenDisplay = yes; then
11142   :
11143 else
11144
11145         echo "$as_me:11145: checking for XOpenDisplay in -lX11" >&5
11146 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
11147 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
11148   echo $ECHO_N "(cached) $ECHO_C" >&6
11149 else
11150   ac_check_lib_save_LIBS=$LIBS
11151 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11152 cat >conftest.$ac_ext <<_ACEOF
11153 #line 11153 "configure"
11154 #include "confdefs.h"
11155
11156 /* Override any gcc2 internal prototype to avoid an error.  */
11157 #ifdef __cplusplus
11158 extern "C"
11159 #endif
11160 /* We use char because int might match the return type of a gcc2
11161    builtin and then its argument prototype would still apply.  */
11162 char XOpenDisplay ();
11163 int
11164 main ()
11165 {
11166 XOpenDisplay ();
11167   ;
11168   return 0;
11169 }
11170 _ACEOF
11171 rm -f conftest.$ac_objext conftest$ac_exeext
11172 if { (eval echo "$as_me:11172: \"$ac_link\"") >&5
11173   (eval $ac_link) 2>&5
11174   ac_status=$?
11175   echo "$as_me:11175: \$? = $ac_status" >&5
11176   (exit $ac_status); } &&
11177          { ac_try='test -s conftest$ac_exeext'
11178   { (eval echo "$as_me:11178: \"$ac_try\"") >&5
11179   (eval $ac_try) 2>&5
11180   ac_status=$?
11181   echo "$as_me:11181: \$? = $ac_status" >&5
11182   (exit $ac_status); }; }; then
11183   ac_cv_lib_X11_XOpenDisplay=yes
11184 else
11185   echo "$as_me: failed program was:" >&5
11186 cat conftest.$ac_ext >&5
11187 ac_cv_lib_X11_XOpenDisplay=no
11188 fi
11189 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11190 LIBS=$ac_check_lib_save_LIBS
11191 fi
11192 echo "$as_me:11192: result: $ac_cv_lib_X11_XOpenDisplay" >&5
11193 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
11194 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
11195   LIBS="-lX11 $LIBS"
11196 fi
11197
11198 fi
11199
11200         echo "$as_me:11200: checking for XtAppInitialize" >&5
11201 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
11202 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
11203   echo $ECHO_N "(cached) $ECHO_C" >&6
11204 else
11205   cat >conftest.$ac_ext <<_ACEOF
11206 #line 11206 "configure"
11207 #include "confdefs.h"
11208 /* System header to define __stub macros and hopefully few prototypes,
11209     which can conflict with char XtAppInitialize (); below.  */
11210 #include <assert.h>
11211 /* Override any gcc2 internal prototype to avoid an error.  */
11212 #ifdef __cplusplus
11213 extern "C"
11214 #endif
11215 /* We use char because int might match the return type of a gcc2
11216    builtin and then its argument prototype would still apply.  */
11217 char XtAppInitialize ();
11218 char (*f) ();
11219
11220 int
11221 main ()
11222 {
11223 /* The GNU C library defines this for functions which it implements
11224     to always fail with ENOSYS.  Some functions are actually named
11225     something starting with __ and the normal name is an alias.  */
11226 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
11227 choke me
11228 #else
11229 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11230 #endif
11231
11232   ;
11233   return 0;
11234 }
11235 _ACEOF
11236 rm -f conftest.$ac_objext conftest$ac_exeext
11237 if { (eval echo "$as_me:11237: \"$ac_link\"") >&5
11238   (eval $ac_link) 2>&5
11239   ac_status=$?
11240   echo "$as_me:11240: \$? = $ac_status" >&5
11241   (exit $ac_status); } &&
11242          { ac_try='test -s conftest$ac_exeext'
11243   { (eval echo "$as_me:11243: \"$ac_try\"") >&5
11244   (eval $ac_try) 2>&5
11245   ac_status=$?
11246   echo "$as_me:11246: \$? = $ac_status" >&5
11247   (exit $ac_status); }; }; then
11248   ac_cv_func_XtAppInitialize=yes
11249 else
11250   echo "$as_me: failed program was:" >&5
11251 cat conftest.$ac_ext >&5
11252 ac_cv_func_XtAppInitialize=no
11253 fi
11254 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11255 fi
11256 echo "$as_me:11256: result: $ac_cv_func_XtAppInitialize" >&5
11257 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
11258 if test $ac_cv_func_XtAppInitialize = yes; then
11259   :
11260 else
11261
11262         echo "$as_me:11262: checking for XtAppInitialize in -lXt" >&5
11263 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
11264 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
11265   echo $ECHO_N "(cached) $ECHO_C" >&6
11266 else
11267   ac_check_lib_save_LIBS=$LIBS
11268 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11269 cat >conftest.$ac_ext <<_ACEOF
11270 #line 11270 "configure"
11271 #include "confdefs.h"
11272
11273 /* Override any gcc2 internal prototype to avoid an error.  */
11274 #ifdef __cplusplus
11275 extern "C"
11276 #endif
11277 /* We use char because int might match the return type of a gcc2
11278    builtin and then its argument prototype would still apply.  */
11279 char XtAppInitialize ();
11280 int
11281 main ()
11282 {
11283 XtAppInitialize ();
11284   ;
11285   return 0;
11286 }
11287 _ACEOF
11288 rm -f conftest.$ac_objext conftest$ac_exeext
11289 if { (eval echo "$as_me:11289: \"$ac_link\"") >&5
11290   (eval $ac_link) 2>&5
11291   ac_status=$?
11292   echo "$as_me:11292: \$? = $ac_status" >&5
11293   (exit $ac_status); } &&
11294          { ac_try='test -s conftest$ac_exeext'
11295   { (eval echo "$as_me:11295: \"$ac_try\"") >&5
11296   (eval $ac_try) 2>&5
11297   ac_status=$?
11298   echo "$as_me:11298: \$? = $ac_status" >&5
11299   (exit $ac_status); }; }; then
11300   ac_cv_lib_Xt_XtAppInitialize=yes
11301 else
11302   echo "$as_me: failed program was:" >&5
11303 cat conftest.$ac_ext >&5
11304 ac_cv_lib_Xt_XtAppInitialize=no
11305 fi
11306 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11307 LIBS=$ac_check_lib_save_LIBS
11308 fi
11309 echo "$as_me:11309: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
11310 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
11311 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
11312
11313 cat >>confdefs.h <<\EOF
11314 #define HAVE_LIBXT 1
11315 EOF
11316
11317                  cf_have_X_LIBS=Xt
11318                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
11319 fi
11320
11321 fi
11322
11323 fi
11324
11325 if test $cf_have_X_LIBS = no ; then
11326         { echo "$as_me:11326: WARNING: Unable to successfully link X Toolkit library (-lXt) with
11327 test program.  You will have to check and add the proper libraries by hand
11328 to makefile." >&5
11329 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
11330 test program.  You will have to check and add the proper libraries by hand
11331 to makefile." >&2;}
11332 fi
11333
11334 cf_x_athena_root=$cf_x_athena
11335 cf_x_athena_inc=""
11336
11337 for cf_path in default \
11338         /usr/contrib/X11R6 \
11339         /usr/contrib/X11R5 \
11340         /usr/lib/X11R5 \
11341         /usr/local
11342 do
11343         if test -z "$cf_x_athena_inc" ; then
11344                 cf_save="$CPPFLAGS"
11345                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
11346                 if test $cf_path != default ; then
11347                         CPPFLAGS="$cf_save -I$cf_path/include"
11348                         echo "$as_me:11348: checking for $cf_test in $cf_path" >&5
11349 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
11350                 else
11351                         echo "$as_me:11351: checking for $cf_test" >&5
11352 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
11353                 fi
11354                 cat >conftest.$ac_ext <<_ACEOF
11355 #line 11355 "configure"
11356 #include "confdefs.h"
11357
11358 #include <X11/Intrinsic.h>
11359 #include <$cf_test>
11360 int
11361 main ()
11362 {
11363
11364   ;
11365   return 0;
11366 }
11367 _ACEOF
11368 rm -f conftest.$ac_objext
11369 if { (eval echo "$as_me:11369: \"$ac_compile\"") >&5
11370   (eval $ac_compile) 2>&5
11371   ac_status=$?
11372   echo "$as_me:11372: \$? = $ac_status" >&5
11373   (exit $ac_status); } &&
11374          { ac_try='test -s conftest.$ac_objext'
11375   { (eval echo "$as_me:11375: \"$ac_try\"") >&5
11376   (eval $ac_try) 2>&5
11377   ac_status=$?
11378   echo "$as_me:11378: \$? = $ac_status" >&5
11379   (exit $ac_status); }; }; then
11380   cf_result=yes
11381 else
11382   echo "$as_me: failed program was:" >&5
11383 cat conftest.$ac_ext >&5
11384 cf_result=no
11385 fi
11386 rm -f conftest.$ac_objext conftest.$ac_ext
11387                 echo "$as_me:11387: result: $cf_result" >&5
11388 echo "${ECHO_T}$cf_result" >&6
11389                 if test "$cf_result" = yes ; then
11390                         cf_x_athena_inc=$cf_path
11391                         break
11392                 else
11393                         CPPFLAGS="$cf_save"
11394                 fi
11395         fi
11396 done
11397
11398 if test -z "$cf_x_athena_inc" ; then
11399         { echo "$as_me:11399: WARNING: Unable to successfully find Athena header files with test program" >&5
11400 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
11401 elif test "$cf_x_athena_inc" != default ; then
11402         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
11403 fi
11404
11405 cf_x_athena_root=$cf_x_athena
11406 cf_x_athena_lib=""
11407
11408 for cf_path in default \
11409         /usr/contrib/X11R6 \
11410         /usr/contrib/X11R5 \
11411         /usr/lib/X11R5 \
11412         /usr/local
11413 do
11414         for cf_lib in \
11415                 ${cf_x_athena_root} \
11416                 ${cf_x_athena_root}7 \
11417                 ${cf_x_athena_root}6
11418         do
11419         for cf_libs in \
11420                 "-l$cf_lib -lXmu" \
11421                 "-l$cf_lib -lXpm -lXmu" \
11422                 "-l${cf_lib}_s -lXmu_s"
11423         do
11424                 if test -z "$cf_x_athena_lib" ; then
11425                         cf_save="$LIBS"
11426                         cf_test=XawSimpleMenuAddGlobalActions
11427                         if test $cf_path != default ; then
11428                                 LIBS="-L$cf_path/lib $cf_libs $LIBS"
11429                                 echo "$as_me:11429: checking for $cf_libs in $cf_path" >&5
11430 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
11431                         else
11432                                 LIBS="$cf_libs $LIBS"
11433                                 echo "$as_me:11433: checking for $cf_test in $cf_libs" >&5
11434 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
11435                         fi
11436                         cat >conftest.$ac_ext <<_ACEOF
11437 #line 11437 "configure"
11438 #include "confdefs.h"
11439
11440 #include <X11/Intrinsic.h>
11441 #include <X11/$cf_x_athena_root/SimpleMenu.h>
11442
11443 int
11444 main ()
11445 {
11446
11447 $cf_test((XtAppContext) 0)
11448   ;
11449   return 0;
11450 }
11451 _ACEOF
11452 rm -f conftest.$ac_objext conftest$ac_exeext
11453 if { (eval echo "$as_me:11453: \"$ac_link\"") >&5
11454   (eval $ac_link) 2>&5
11455   ac_status=$?
11456   echo "$as_me:11456: \$? = $ac_status" >&5
11457   (exit $ac_status); } &&
11458          { ac_try='test -s conftest$ac_exeext'
11459   { (eval echo "$as_me:11459: \"$ac_try\"") >&5
11460   (eval $ac_try) 2>&5
11461   ac_status=$?
11462   echo "$as_me:11462: \$? = $ac_status" >&5
11463   (exit $ac_status); }; }; then
11464   cf_result=yes
11465 else
11466   echo "$as_me: failed program was:" >&5
11467 cat conftest.$ac_ext >&5
11468 cf_result=no
11469 fi
11470 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11471                         echo "$as_me:11471: result: $cf_result" >&5
11472 echo "${ECHO_T}$cf_result" >&6
11473                         if test "$cf_result" = yes ; then
11474                                 cf_x_athena_lib="$cf_libs"
11475                                 break
11476                         fi
11477                         LIBS="$cf_save"
11478                 fi
11479         done # cf_libs
11480                 test -n "$cf_x_athena_lib" && break
11481         done # cf_lib
11482 done
11483
11484 if test -z "$cf_x_athena_lib" ; then
11485         { { echo "$as_me:11485: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
11486 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
11487    { (exit 1); exit 1; }; }
11488 fi
11489
11490 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11491
11492 cat >>confdefs.h <<EOF
11493 #define $cf_x_athena_LIBS 1
11494 EOF
11495
11496 fi
11497
11498 if test -n "$ac_tool_prefix"; then
11499   for ac_prog in xcurses-config
11500   do
11501     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
11502 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
11503 echo "$as_me:11503: checking for $ac_word" >&5
11504 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11505 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
11506   echo $ECHO_N "(cached) $ECHO_C" >&6
11507 else
11508   if test -n "$XCURSES_CONFIG"; then
11509   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
11510 else
11511   ac_save_IFS=$IFS; IFS=$ac_path_separator
11512 ac_dummy="$PATH"
11513 for ac_dir in $ac_dummy; do
11514   IFS=$ac_save_IFS
11515   test -z "$ac_dir" && ac_dir=.
11516   $as_executable_p "$ac_dir/$ac_word" || continue
11517 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
11518 echo "$as_me:11518: found $ac_dir/$ac_word" >&5
11519 break
11520 done
11521
11522 fi
11523 fi
11524 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
11525 if test -n "$XCURSES_CONFIG"; then
11526   echo "$as_me:11526: result: $XCURSES_CONFIG" >&5
11527 echo "${ECHO_T}$XCURSES_CONFIG" >&6
11528 else
11529   echo "$as_me:11529: result: no" >&5
11530 echo "${ECHO_T}no" >&6
11531 fi
11532
11533     test -n "$XCURSES_CONFIG" && break
11534   done
11535 fi
11536 if test -z "$XCURSES_CONFIG"; then
11537   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
11538   for ac_prog in xcurses-config
11539 do
11540   # Extract the first word of "$ac_prog", so it can be a program name with args.
11541 set dummy $ac_prog; ac_word=$2
11542 echo "$as_me:11542: checking for $ac_word" >&5
11543 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11544 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
11545   echo $ECHO_N "(cached) $ECHO_C" >&6
11546 else
11547   if test -n "$ac_ct_XCURSES_CONFIG"; then
11548   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
11549 else
11550   ac_save_IFS=$IFS; IFS=$ac_path_separator
11551 ac_dummy="$PATH"
11552 for ac_dir in $ac_dummy; do
11553   IFS=$ac_save_IFS
11554   test -z "$ac_dir" && ac_dir=.
11555   $as_executable_p "$ac_dir/$ac_word" || continue
11556 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
11557 echo "$as_me:11557: found $ac_dir/$ac_word" >&5
11558 break
11559 done
11560
11561 fi
11562 fi
11563 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
11564 if test -n "$ac_ct_XCURSES_CONFIG"; then
11565   echo "$as_me:11565: result: $ac_ct_XCURSES_CONFIG" >&5
11566 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
11567 else
11568   echo "$as_me:11568: result: no" >&5
11569 echo "${ECHO_T}no" >&6
11570 fi
11571
11572   test -n "$ac_ct_XCURSES_CONFIG" && break
11573 done
11574 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
11575
11576   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
11577 fi
11578
11579 if test "$XCURSES_CONFIG" != none ; then
11580
11581 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
11582 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
11583
11584 cf_cv_lib_XCurses=yes
11585
11586 else
11587
11588 LDFLAGS="$LDFLAGS $X_LIBS"
11589
11590 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11591
11592 echo "${as_me:-configure}:11592: testing checking additions to CFLAGS ..." 1>&5
11593
11594 cf_check_cflags="$CFLAGS"
11595 cf_check_cppflags="$CPPFLAGS"
11596
11597 cf_fix_cppflags=no
11598 cf_new_cflags=
11599 cf_new_cppflags=
11600 cf_new_extra_cppflags=
11601
11602 for cf_add_cflags in $X_CFLAGS
11603 do
11604 case $cf_fix_cppflags in
11605 no)
11606         case $cf_add_cflags in #(vi
11607         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11608                 case $cf_add_cflags in
11609                 -D*)
11610                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11611
11612                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11613                                 && test -z "${cf_tst_cflags}" \
11614                                 && cf_fix_cppflags=yes
11615
11616                         if test $cf_fix_cppflags = yes ; then
11617                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11618                                 continue
11619                         elif test "${cf_tst_cflags}" = "\"'" ; then
11620                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11621                                 continue
11622                         fi
11623                         ;;
11624                 esac
11625                 case "$CPPFLAGS" in
11626                 *$cf_add_cflags) #(vi
11627                         ;;
11628                 *) #(vi
11629                         case $cf_add_cflags in #(vi
11630                         -D*)
11631                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11632
11633 CPPFLAGS=`echo "$CPPFLAGS" | \
11634         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11635                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11636
11637                                 ;;
11638                         esac
11639                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11640                         ;;
11641                 esac
11642                 ;;
11643         *)
11644                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11645                 ;;
11646         esac
11647         ;;
11648 yes)
11649         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11650
11651         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11652
11653         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11654                 && test -z "${cf_tst_cflags}" \
11655                 && cf_fix_cppflags=no
11656         ;;
11657 esac
11658 done
11659
11660 if test -n "$cf_new_cflags" ; then
11661         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11662
11663 echo "${as_me:-configure}:11663: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11664
11665         CFLAGS="$CFLAGS $cf_new_cflags"
11666 fi
11667
11668 if test -n "$cf_new_cppflags" ; then
11669         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11670
11671 echo "${as_me:-configure}:11671: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11672
11673         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11674 fi
11675
11676 if test -n "$cf_new_extra_cppflags" ; then
11677         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11678
11679 echo "${as_me:-configure}:11679: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11680
11681         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11682 fi
11683
11684 if test "$cf_check_cflags" != "$CFLAGS" ; then
11685 cat >conftest.$ac_ext <<_ACEOF
11686 #line 11686 "configure"
11687 #include "confdefs.h"
11688 #include <stdio.h>
11689 int
11690 main ()
11691 {
11692 printf("Hello world");
11693   ;
11694   return 0;
11695 }
11696 _ACEOF
11697 rm -f conftest.$ac_objext conftest$ac_exeext
11698 if { (eval echo "$as_me:11698: \"$ac_link\"") >&5
11699   (eval $ac_link) 2>&5
11700   ac_status=$?
11701   echo "$as_me:11701: \$? = $ac_status" >&5
11702   (exit $ac_status); } &&
11703          { ac_try='test -s conftest$ac_exeext'
11704   { (eval echo "$as_me:11704: \"$ac_try\"") >&5
11705   (eval $ac_try) 2>&5
11706   ac_status=$?
11707   echo "$as_me:11707: \$? = $ac_status" >&5
11708   (exit $ac_status); }; }; then
11709   :
11710 else
11711   echo "$as_me: failed program was:" >&5
11712 cat conftest.$ac_ext >&5
11713 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
11714
11715 echo "${as_me:-configure}:11715: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
11716
11717          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
11718                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
11719
11720 echo "${as_me:-configure}:11720: testing but keeping change to \$CPPFLAGS ..." 1>&5
11721
11722          fi
11723          CFLAGS="$cf_check_flags"
11724 fi
11725 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11726 fi
11727
11728 echo "$as_me:11728: checking for XOpenDisplay in -lX11" >&5
11729 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
11730 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
11731   echo $ECHO_N "(cached) $ECHO_C" >&6
11732 else
11733   ac_check_lib_save_LIBS=$LIBS
11734 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11735 cat >conftest.$ac_ext <<_ACEOF
11736 #line 11736 "configure"
11737 #include "confdefs.h"
11738
11739 /* Override any gcc2 internal prototype to avoid an error.  */
11740 #ifdef __cplusplus
11741 extern "C"
11742 #endif
11743 /* We use char because int might match the return type of a gcc2
11744    builtin and then its argument prototype would still apply.  */
11745 char XOpenDisplay ();
11746 int
11747 main ()
11748 {
11749 XOpenDisplay ();
11750   ;
11751   return 0;
11752 }
11753 _ACEOF
11754 rm -f conftest.$ac_objext conftest$ac_exeext
11755 if { (eval echo "$as_me:11755: \"$ac_link\"") >&5
11756   (eval $ac_link) 2>&5
11757   ac_status=$?
11758   echo "$as_me:11758: \$? = $ac_status" >&5
11759   (exit $ac_status); } &&
11760          { ac_try='test -s conftest$ac_exeext'
11761   { (eval echo "$as_me:11761: \"$ac_try\"") >&5
11762   (eval $ac_try) 2>&5
11763   ac_status=$?
11764   echo "$as_me:11764: \$? = $ac_status" >&5
11765   (exit $ac_status); }; }; then
11766   ac_cv_lib_X11_XOpenDisplay=yes
11767 else
11768   echo "$as_me: failed program was:" >&5
11769 cat conftest.$ac_ext >&5
11770 ac_cv_lib_X11_XOpenDisplay=no
11771 fi
11772 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11773 LIBS=$ac_check_lib_save_LIBS
11774 fi
11775 echo "$as_me:11775: result: $ac_cv_lib_X11_XOpenDisplay" >&5
11776 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
11777 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
11778   LIBS="-lX11 $LIBS"
11779 fi
11780
11781 echo "$as_me:11781: checking for XCurses library" >&5
11782 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
11783 if test "${cf_cv_lib_XCurses+set}" = set; then
11784   echo $ECHO_N "(cached) $ECHO_C" >&6
11785 else
11786
11787 LIBS="-lXCurses $LIBS"
11788 cat >conftest.$ac_ext <<_ACEOF
11789 #line 11789 "configure"
11790 #include "confdefs.h"
11791
11792 #include <xcurses.h>
11793 char *XCursesProgramName = "test";
11794
11795 int
11796 main ()
11797 {
11798 XCursesExit();
11799   ;
11800   return 0;
11801 }
11802 _ACEOF
11803 rm -f conftest.$ac_objext conftest$ac_exeext
11804 if { (eval echo "$as_me:11804: \"$ac_link\"") >&5
11805   (eval $ac_link) 2>&5
11806   ac_status=$?
11807   echo "$as_me:11807: \$? = $ac_status" >&5
11808   (exit $ac_status); } &&
11809          { ac_try='test -s conftest$ac_exeext'
11810   { (eval echo "$as_me:11810: \"$ac_try\"") >&5
11811   (eval $ac_try) 2>&5
11812   ac_status=$?
11813   echo "$as_me:11813: \$? = $ac_status" >&5
11814   (exit $ac_status); }; }; then
11815   cf_cv_lib_XCurses=yes
11816 else
11817   echo "$as_me: failed program was:" >&5
11818 cat conftest.$ac_ext >&5
11819 cf_cv_lib_XCurses=no
11820 fi
11821 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11822
11823 fi
11824 echo "$as_me:11824: result: $cf_cv_lib_XCurses" >&5
11825 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
11826
11827 fi
11828
11829 if test $cf_cv_lib_XCurses = yes ; then
11830
11831 cat >>confdefs.h <<\EOF
11832 #define UNIX 1
11833 EOF
11834
11835 cat >>confdefs.h <<\EOF
11836 #define XCURSES 1
11837 EOF
11838
11839         echo "$as_me:11839: checking for xcurses.h" >&5
11840 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
11841 if test "${ac_cv_header_xcurses_h+set}" = set; then
11842   echo $ECHO_N "(cached) $ECHO_C" >&6
11843 else
11844   cat >conftest.$ac_ext <<_ACEOF
11845 #line 11845 "configure"
11846 #include "confdefs.h"
11847 #include <xcurses.h>
11848 _ACEOF
11849 if { (eval echo "$as_me:11849: \"$ac_cpp conftest.$ac_ext\"") >&5
11850   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11851   ac_status=$?
11852   egrep -v '^ *\+' conftest.er1 >conftest.err
11853   rm -f conftest.er1
11854   cat conftest.err >&5
11855   echo "$as_me:11855: \$? = $ac_status" >&5
11856   (exit $ac_status); } >/dev/null; then
11857   if test -s conftest.err; then
11858     ac_cpp_err=$ac_c_preproc_warn_flag
11859   else
11860     ac_cpp_err=
11861   fi
11862 else
11863   ac_cpp_err=yes
11864 fi
11865 if test -z "$ac_cpp_err"; then
11866   ac_cv_header_xcurses_h=yes
11867 else
11868   echo "$as_me: failed program was:" >&5
11869   cat conftest.$ac_ext >&5
11870   ac_cv_header_xcurses_h=no
11871 fi
11872 rm -f conftest.err conftest.$ac_ext
11873 fi
11874 echo "$as_me:11874: result: $ac_cv_header_xcurses_h" >&5
11875 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
11876 if test $ac_cv_header_xcurses_h = yes; then
11877
11878 cat >>confdefs.h <<\EOF
11879 #define HAVE_XCURSES 1
11880 EOF
11881
11882 fi
11883
11884 else
11885         { { echo "$as_me:11885: error: Cannot link with XCurses" >&5
11886 echo "$as_me: error: Cannot link with XCurses" >&2;}
11887    { (exit 1); exit 1; }; }
11888 fi
11889
11890         ;;
11891 esac
11892
11893 case $cf_cv_screen in
11894 curses|curses_*)
11895
11896 echo "$as_me:11896: checking for NetBSD form.h" >&5
11897 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
11898 if test "${cf_cv_netbsd_form_h+set}" = set; then
11899   echo $ECHO_N "(cached) $ECHO_C" >&6
11900 else
11901
11902 cat >conftest.$ac_ext <<_ACEOF
11903 #line 11903 "configure"
11904 #include "confdefs.h"
11905
11906 #include <${cf_cv_ncurses_header:-curses.h}>
11907 #include <form.h>
11908
11909 int
11910 main ()
11911 {
11912
11913         FORM *form;
11914         int y = current_field(form)->cursor_ypos;
11915         int x = current_field(form)->cursor_xpos;
11916
11917   ;
11918   return 0;
11919 }
11920 _ACEOF
11921 rm -f conftest.$ac_objext
11922 if { (eval echo "$as_me:11922: \"$ac_compile\"") >&5
11923   (eval $ac_compile) 2>&5
11924   ac_status=$?
11925   echo "$as_me:11925: \$? = $ac_status" >&5
11926   (exit $ac_status); } &&
11927          { ac_try='test -s conftest.$ac_objext'
11928   { (eval echo "$as_me:11928: \"$ac_try\"") >&5
11929   (eval $ac_try) 2>&5
11930   ac_status=$?
11931   echo "$as_me:11931: \$? = $ac_status" >&5
11932   (exit $ac_status); }; }; then
11933   cf_cv_netbsd_form_h=yes
11934
11935 else
11936   echo "$as_me: failed program was:" >&5
11937 cat conftest.$ac_ext >&5
11938 cf_cv_netbsd_form_h=no
11939 fi
11940 rm -f conftest.$ac_objext conftest.$ac_ext
11941
11942 fi
11943 echo "$as_me:11943: result: $cf_cv_netbsd_form_h" >&5
11944 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
11945
11946 test "$cf_cv_netbsd_form_h" = yes &&
11947 cat >>confdefs.h <<\EOF
11948 #define HAVE_NETBSD_FORM_H 1
11949 EOF
11950
11951 echo "$as_me:11951: checking for NetBSD menu.h" >&5
11952 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
11953 if test "${cf_cv_netbsd_menu_h+set}" = set; then
11954   echo $ECHO_N "(cached) $ECHO_C" >&6
11955 else
11956
11957 cat >conftest.$ac_ext <<_ACEOF
11958 #line 11958 "configure"
11959 #include "confdefs.h"
11960
11961 #include <${cf_cv_ncurses_header:-curses.h}>
11962 #include <menu.h>
11963
11964 int
11965 main ()
11966 {
11967
11968         MENU *menu;
11969         int y = menu->max_item_width;
11970
11971   ;
11972   return 0;
11973 }
11974 _ACEOF
11975 rm -f conftest.$ac_objext
11976 if { (eval echo "$as_me:11976: \"$ac_compile\"") >&5
11977   (eval $ac_compile) 2>&5
11978   ac_status=$?
11979   echo "$as_me:11979: \$? = $ac_status" >&5
11980   (exit $ac_status); } &&
11981          { ac_try='test -s conftest.$ac_objext'
11982   { (eval echo "$as_me:11982: \"$ac_try\"") >&5
11983   (eval $ac_try) 2>&5
11984   ac_status=$?
11985   echo "$as_me:11985: \$? = $ac_status" >&5
11986   (exit $ac_status); }; }; then
11987   cf_cv_netbsd_menu_h=yes
11988
11989 else
11990   echo "$as_me: failed program was:" >&5
11991 cat conftest.$ac_ext >&5
11992 cf_cv_netbsd_menu_h=no
11993 fi
11994 rm -f conftest.$ac_objext conftest.$ac_ext
11995
11996 fi
11997 echo "$as_me:11997: result: $cf_cv_netbsd_menu_h" >&5
11998 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
11999
12000 test "$cf_cv_netbsd_menu_h" = yes &&
12001 cat >>confdefs.h <<\EOF
12002 #define HAVE_NETBSD_MENU_H 1
12003 EOF
12004
12005         ;;
12006 ncursesw)
12007         cf_cv_libtype=w
12008         ;;
12009 esac
12010
12011 case $cf_cv_screen in #(vi
12012 pdcurses) #(vi
12013         ;;
12014 *)
12015         # look for curses-related libraries
12016
12017 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
12018 echo "$as_me:12018: checking for new_panel in -lpanel$cf_cv_libtype" >&5
12019 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
12020 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12021   echo $ECHO_N "(cached) $ECHO_C" >&6
12022 else
12023   ac_check_lib_save_LIBS=$LIBS
12024 LIBS="-lpanel$cf_cv_libtype  $LIBS"
12025 cat >conftest.$ac_ext <<_ACEOF
12026 #line 12026 "configure"
12027 #include "confdefs.h"
12028
12029 /* Override any gcc2 internal prototype to avoid an error.  */
12030 #ifdef __cplusplus
12031 extern "C"
12032 #endif
12033 /* We use char because int might match the return type of a gcc2
12034    builtin and then its argument prototype would still apply.  */
12035 char new_panel ();
12036 int
12037 main ()
12038 {
12039 new_panel ();
12040   ;
12041   return 0;
12042 }
12043 _ACEOF
12044 rm -f conftest.$ac_objext conftest$ac_exeext
12045 if { (eval echo "$as_me:12045: \"$ac_link\"") >&5
12046   (eval $ac_link) 2>&5
12047   ac_status=$?
12048   echo "$as_me:12048: \$? = $ac_status" >&5
12049   (exit $ac_status); } &&
12050          { ac_try='test -s conftest$ac_exeext'
12051   { (eval echo "$as_me:12051: \"$ac_try\"") >&5
12052   (eval $ac_try) 2>&5
12053   ac_status=$?
12054   echo "$as_me:12054: \$? = $ac_status" >&5
12055   (exit $ac_status); }; }; then
12056   eval "$as_ac_Lib=yes"
12057 else
12058   echo "$as_me: failed program was:" >&5
12059 cat conftest.$ac_ext >&5
12060 eval "$as_ac_Lib=no"
12061 fi
12062 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12063 LIBS=$ac_check_lib_save_LIBS
12064 fi
12065 echo "$as_me:12065: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12066 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12067 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12068   cat >>confdefs.h <<EOF
12069 #define `echo "HAVE_LIBpanel$cf_cv_libtype" | $as_tr_cpp` 1
12070 EOF
12071
12072   LIBS="-lpanel$cf_cv_libtype $LIBS"
12073
12074 fi
12075
12076 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
12077 echo "$as_me:12077: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
12078 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
12079 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12080   echo $ECHO_N "(cached) $ECHO_C" >&6
12081 else
12082   ac_check_lib_save_LIBS=$LIBS
12083 LIBS="-lmenu$cf_cv_libtype  $LIBS"
12084 cat >conftest.$ac_ext <<_ACEOF
12085 #line 12085 "configure"
12086 #include "confdefs.h"
12087
12088 /* Override any gcc2 internal prototype to avoid an error.  */
12089 #ifdef __cplusplus
12090 extern "C"
12091 #endif
12092 /* We use char because int might match the return type of a gcc2
12093    builtin and then its argument prototype would still apply.  */
12094 char menu_driver ();
12095 int
12096 main ()
12097 {
12098 menu_driver ();
12099   ;
12100   return 0;
12101 }
12102 _ACEOF
12103 rm -f conftest.$ac_objext conftest$ac_exeext
12104 if { (eval echo "$as_me:12104: \"$ac_link\"") >&5
12105   (eval $ac_link) 2>&5
12106   ac_status=$?
12107   echo "$as_me:12107: \$? = $ac_status" >&5
12108   (exit $ac_status); } &&
12109          { ac_try='test -s conftest$ac_exeext'
12110   { (eval echo "$as_me:12110: \"$ac_try\"") >&5
12111   (eval $ac_try) 2>&5
12112   ac_status=$?
12113   echo "$as_me:12113: \$? = $ac_status" >&5
12114   (exit $ac_status); }; }; then
12115   eval "$as_ac_Lib=yes"
12116 else
12117   echo "$as_me: failed program was:" >&5
12118 cat conftest.$ac_ext >&5
12119 eval "$as_ac_Lib=no"
12120 fi
12121 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12122 LIBS=$ac_check_lib_save_LIBS
12123 fi
12124 echo "$as_me:12124: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12125 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12126 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12127   cat >>confdefs.h <<EOF
12128 #define `echo "HAVE_LIBmenu$cf_cv_libtype" | $as_tr_cpp` 1
12129 EOF
12130
12131   LIBS="-lmenu$cf_cv_libtype $LIBS"
12132
12133 fi
12134
12135 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
12136 echo "$as_me:12136: checking for form_driver in -lform$cf_cv_libtype" >&5
12137 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
12138 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12139   echo $ECHO_N "(cached) $ECHO_C" >&6
12140 else
12141   ac_check_lib_save_LIBS=$LIBS
12142 LIBS="-lform$cf_cv_libtype  $LIBS"
12143 cat >conftest.$ac_ext <<_ACEOF
12144 #line 12144 "configure"
12145 #include "confdefs.h"
12146
12147 /* Override any gcc2 internal prototype to avoid an error.  */
12148 #ifdef __cplusplus
12149 extern "C"
12150 #endif
12151 /* We use char because int might match the return type of a gcc2
12152    builtin and then its argument prototype would still apply.  */
12153 char form_driver ();
12154 int
12155 main ()
12156 {
12157 form_driver ();
12158   ;
12159   return 0;
12160 }
12161 _ACEOF
12162 rm -f conftest.$ac_objext conftest$ac_exeext
12163 if { (eval echo "$as_me:12163: \"$ac_link\"") >&5
12164   (eval $ac_link) 2>&5
12165   ac_status=$?
12166   echo "$as_me:12166: \$? = $ac_status" >&5
12167   (exit $ac_status); } &&
12168          { ac_try='test -s conftest$ac_exeext'
12169   { (eval echo "$as_me:12169: \"$ac_try\"") >&5
12170   (eval $ac_try) 2>&5
12171   ac_status=$?
12172   echo "$as_me:12172: \$? = $ac_status" >&5
12173   (exit $ac_status); }; }; then
12174   eval "$as_ac_Lib=yes"
12175 else
12176   echo "$as_me: failed program was:" >&5
12177 cat conftest.$ac_ext >&5
12178 eval "$as_ac_Lib=no"
12179 fi
12180 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12181 LIBS=$ac_check_lib_save_LIBS
12182 fi
12183 echo "$as_me:12183: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12184 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12185 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12186   cat >>confdefs.h <<EOF
12187 #define `echo "HAVE_LIBform$cf_cv_libtype" | $as_tr_cpp` 1
12188 EOF
12189
12190   LIBS="-lform$cf_cv_libtype $LIBS"
12191
12192 fi
12193
12194         # look for curses-related headers
12195
12196 for ac_header in \
12197                 nc_alloc.h \
12198                 nomacros.h \
12199                 form.h \
12200                 menu.h \
12201                 panel.h \
12202                 term_entry.h \
12203
12204 do
12205 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12206 echo "$as_me:12206: checking for $ac_header" >&5
12207 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12208 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12209   echo $ECHO_N "(cached) $ECHO_C" >&6
12210 else
12211   cat >conftest.$ac_ext <<_ACEOF
12212 #line 12212 "configure"
12213 #include "confdefs.h"
12214 #include <$ac_header>
12215 _ACEOF
12216 if { (eval echo "$as_me:12216: \"$ac_cpp conftest.$ac_ext\"") >&5
12217   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12218   ac_status=$?
12219   egrep -v '^ *\+' conftest.er1 >conftest.err
12220   rm -f conftest.er1
12221   cat conftest.err >&5
12222   echo "$as_me:12222: \$? = $ac_status" >&5
12223   (exit $ac_status); } >/dev/null; then
12224   if test -s conftest.err; then
12225     ac_cpp_err=$ac_c_preproc_warn_flag
12226   else
12227     ac_cpp_err=
12228   fi
12229 else
12230   ac_cpp_err=yes
12231 fi
12232 if test -z "$ac_cpp_err"; then
12233   eval "$as_ac_Header=yes"
12234 else
12235   echo "$as_me: failed program was:" >&5
12236   cat conftest.$ac_ext >&5
12237   eval "$as_ac_Header=no"
12238 fi
12239 rm -f conftest.err conftest.$ac_ext
12240 fi
12241 echo "$as_me:12241: result: `eval echo '${'$as_ac_Header'}'`" >&5
12242 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12243 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12244   cat >>confdefs.h <<EOF
12245 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12246 EOF
12247
12248 fi
12249 done
12250
12251         ;;
12252 esac
12253
12254 echo "$as_me:12254: checking return type of signal handlers" >&5
12255 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
12256 if test "${ac_cv_type_signal+set}" = set; then
12257   echo $ECHO_N "(cached) $ECHO_C" >&6
12258 else
12259   cat >conftest.$ac_ext <<_ACEOF
12260 #line 12260 "configure"
12261 #include "confdefs.h"
12262 #include <sys/types.h>
12263 #include <signal.h>
12264 #ifdef signal
12265 # undef signal
12266 #endif
12267 #ifdef __cplusplus
12268 extern "C" void (*signal (int, void (*)(int)))(int);
12269 #else
12270 void (*signal ()) ();
12271 #endif
12272
12273 int
12274 main ()
12275 {
12276 int i;
12277   ;
12278   return 0;
12279 }
12280 _ACEOF
12281 rm -f conftest.$ac_objext
12282 if { (eval echo "$as_me:12282: \"$ac_compile\"") >&5
12283   (eval $ac_compile) 2>&5
12284   ac_status=$?
12285   echo "$as_me:12285: \$? = $ac_status" >&5
12286   (exit $ac_status); } &&
12287          { ac_try='test -s conftest.$ac_objext'
12288   { (eval echo "$as_me:12288: \"$ac_try\"") >&5
12289   (eval $ac_try) 2>&5
12290   ac_status=$?
12291   echo "$as_me:12291: \$? = $ac_status" >&5
12292   (exit $ac_status); }; }; then
12293   ac_cv_type_signal=void
12294 else
12295   echo "$as_me: failed program was:" >&5
12296 cat conftest.$ac_ext >&5
12297 ac_cv_type_signal=int
12298 fi
12299 rm -f conftest.$ac_objext conftest.$ac_ext
12300 fi
12301 echo "$as_me:12301: result: $ac_cv_type_signal" >&5
12302 echo "${ECHO_T}$ac_cv_type_signal" >&6
12303
12304 cat >>confdefs.h <<EOF
12305 #define RETSIGTYPE $ac_cv_type_signal
12306 EOF
12307
12308 echo "$as_me:12308: checking for ANSI C header files" >&5
12309 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
12310 if test "${ac_cv_header_stdc+set}" = set; then
12311   echo $ECHO_N "(cached) $ECHO_C" >&6
12312 else
12313   cat >conftest.$ac_ext <<_ACEOF
12314 #line 12314 "configure"
12315 #include "confdefs.h"
12316 #include <stdlib.h>
12317 #include <stdarg.h>
12318 #include <string.h>
12319 #include <float.h>
12320
12321 _ACEOF
12322 if { (eval echo "$as_me:12322: \"$ac_cpp conftest.$ac_ext\"") >&5
12323   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12324   ac_status=$?
12325   egrep -v '^ *\+' conftest.er1 >conftest.err
12326   rm -f conftest.er1
12327   cat conftest.err >&5
12328   echo "$as_me:12328: \$? = $ac_status" >&5
12329   (exit $ac_status); } >/dev/null; then
12330   if test -s conftest.err; then
12331     ac_cpp_err=$ac_c_preproc_warn_flag
12332   else
12333     ac_cpp_err=
12334   fi
12335 else
12336   ac_cpp_err=yes
12337 fi
12338 if test -z "$ac_cpp_err"; then
12339   ac_cv_header_stdc=yes
12340 else
12341   echo "$as_me: failed program was:" >&5
12342   cat conftest.$ac_ext >&5
12343   ac_cv_header_stdc=no
12344 fi
12345 rm -f conftest.err conftest.$ac_ext
12346
12347 if test $ac_cv_header_stdc = yes; then
12348   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12349   cat >conftest.$ac_ext <<_ACEOF
12350 #line 12350 "configure"
12351 #include "confdefs.h"
12352 #include <string.h>
12353
12354 _ACEOF
12355 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12356   egrep "memchr" >/dev/null 2>&1; then
12357   :
12358 else
12359   ac_cv_header_stdc=no
12360 fi
12361 rm -rf conftest*
12362
12363 fi
12364
12365 if test $ac_cv_header_stdc = yes; then
12366   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12367   cat >conftest.$ac_ext <<_ACEOF
12368 #line 12368 "configure"
12369 #include "confdefs.h"
12370 #include <stdlib.h>
12371
12372 _ACEOF
12373 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12374   egrep "free" >/dev/null 2>&1; then
12375   :
12376 else
12377   ac_cv_header_stdc=no
12378 fi
12379 rm -rf conftest*
12380
12381 fi
12382
12383 if test $ac_cv_header_stdc = yes; then
12384   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12385   if test "$cross_compiling" = yes; then
12386   :
12387 else
12388   cat >conftest.$ac_ext <<_ACEOF
12389 #line 12389 "configure"
12390 #include "confdefs.h"
12391 #include <ctype.h>
12392 #if ((' ' & 0x0FF) == 0x020)
12393 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12394 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12395 #else
12396 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
12397                      || ('j' <= (c) && (c) <= 'r') \
12398                      || ('s' <= (c) && (c) <= 'z'))
12399 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
12400 #endif
12401
12402 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12403 int
12404 main ()
12405 {
12406   int i;
12407   for (i = 0; i < 256; i++)
12408     if (XOR (islower (i), ISLOWER (i))
12409         || toupper (i) != TOUPPER (i))
12410       $ac_main_return(2);
12411   $ac_main_return (0);
12412 }
12413 _ACEOF
12414 rm -f conftest$ac_exeext
12415 if { (eval echo "$as_me:12415: \"$ac_link\"") >&5
12416   (eval $ac_link) 2>&5
12417   ac_status=$?
12418   echo "$as_me:12418: \$? = $ac_status" >&5
12419   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12420   { (eval echo "$as_me:12420: \"$ac_try\"") >&5
12421   (eval $ac_try) 2>&5
12422   ac_status=$?
12423   echo "$as_me:12423: \$? = $ac_status" >&5
12424   (exit $ac_status); }; }; then
12425   :
12426 else
12427   echo "$as_me: program exited with status $ac_status" >&5
12428 echo "$as_me: failed program was:" >&5
12429 cat conftest.$ac_ext >&5
12430 ac_cv_header_stdc=no
12431 fi
12432 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12433 fi
12434 fi
12435 fi
12436 echo "$as_me:12436: result: $ac_cv_header_stdc" >&5
12437 echo "${ECHO_T}$ac_cv_header_stdc" >&6
12438 if test $ac_cv_header_stdc = yes; then
12439
12440 cat >>confdefs.h <<\EOF
12441 #define STDC_HEADERS 1
12442 EOF
12443
12444 fi
12445
12446 echo "$as_me:12446: checking whether time.h and sys/time.h may both be included" >&5
12447 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
12448 if test "${ac_cv_header_time+set}" = set; then
12449   echo $ECHO_N "(cached) $ECHO_C" >&6
12450 else
12451   cat >conftest.$ac_ext <<_ACEOF
12452 #line 12452 "configure"
12453 #include "confdefs.h"
12454 #include <sys/types.h>
12455 #include <sys/time.h>
12456 #include <time.h>
12457
12458 int
12459 main ()
12460 {
12461 if ((struct tm *) 0)
12462 return 0;
12463   ;
12464   return 0;
12465 }
12466 _ACEOF
12467 rm -f conftest.$ac_objext
12468 if { (eval echo "$as_me:12468: \"$ac_compile\"") >&5
12469   (eval $ac_compile) 2>&5
12470   ac_status=$?
12471   echo "$as_me:12471: \$? = $ac_status" >&5
12472   (exit $ac_status); } &&
12473          { ac_try='test -s conftest.$ac_objext'
12474   { (eval echo "$as_me:12474: \"$ac_try\"") >&5
12475   (eval $ac_try) 2>&5
12476   ac_status=$?
12477   echo "$as_me:12477: \$? = $ac_status" >&5
12478   (exit $ac_status); }; }; then
12479   ac_cv_header_time=yes
12480 else
12481   echo "$as_me: failed program was:" >&5
12482 cat conftest.$ac_ext >&5
12483 ac_cv_header_time=no
12484 fi
12485 rm -f conftest.$ac_objext conftest.$ac_ext
12486 fi
12487 echo "$as_me:12487: result: $ac_cv_header_time" >&5
12488 echo "${ECHO_T}$ac_cv_header_time" >&6
12489 if test $ac_cv_header_time = yes; then
12490
12491 cat >>confdefs.h <<\EOF
12492 #define TIME_WITH_SYS_TIME 1
12493 EOF
12494
12495 fi
12496
12497 for ac_header in \
12498 getopt.h \
12499 locale.h \
12500 math.h \
12501 stdarg.h \
12502 sys/ioctl.h \
12503 sys/select.h \
12504 sys/time.h \
12505 termios.h \
12506 unistd.h \
12507
12508 do
12509 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12510 echo "$as_me:12510: checking for $ac_header" >&5
12511 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12512 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12513   echo $ECHO_N "(cached) $ECHO_C" >&6
12514 else
12515   cat >conftest.$ac_ext <<_ACEOF
12516 #line 12516 "configure"
12517 #include "confdefs.h"
12518 #include <$ac_header>
12519 _ACEOF
12520 if { (eval echo "$as_me:12520: \"$ac_cpp conftest.$ac_ext\"") >&5
12521   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12522   ac_status=$?
12523   egrep -v '^ *\+' conftest.er1 >conftest.err
12524   rm -f conftest.er1
12525   cat conftest.err >&5
12526   echo "$as_me:12526: \$? = $ac_status" >&5
12527   (exit $ac_status); } >/dev/null; then
12528   if test -s conftest.err; then
12529     ac_cpp_err=$ac_c_preproc_warn_flag
12530   else
12531     ac_cpp_err=
12532   fi
12533 else
12534   ac_cpp_err=yes
12535 fi
12536 if test -z "$ac_cpp_err"; then
12537   eval "$as_ac_Header=yes"
12538 else
12539   echo "$as_me: failed program was:" >&5
12540   cat conftest.$ac_ext >&5
12541   eval "$as_ac_Header=no"
12542 fi
12543 rm -f conftest.err conftest.$ac_ext
12544 fi
12545 echo "$as_me:12545: result: `eval echo '${'$as_ac_Header'}'`" >&5
12546 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12547 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12548   cat >>confdefs.h <<EOF
12549 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12550 EOF
12551
12552 fi
12553 done
12554
12555 for ac_header in unistd.h getopt.h
12556 do
12557 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12558 echo "$as_me:12558: checking for $ac_header" >&5
12559 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12560 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12561   echo $ECHO_N "(cached) $ECHO_C" >&6
12562 else
12563   cat >conftest.$ac_ext <<_ACEOF
12564 #line 12564 "configure"
12565 #include "confdefs.h"
12566 #include <$ac_header>
12567 _ACEOF
12568 if { (eval echo "$as_me:12568: \"$ac_cpp conftest.$ac_ext\"") >&5
12569   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12570   ac_status=$?
12571   egrep -v '^ *\+' conftest.er1 >conftest.err
12572   rm -f conftest.er1
12573   cat conftest.err >&5
12574   echo "$as_me:12574: \$? = $ac_status" >&5
12575   (exit $ac_status); } >/dev/null; then
12576   if test -s conftest.err; then
12577     ac_cpp_err=$ac_c_preproc_warn_flag
12578   else
12579     ac_cpp_err=
12580   fi
12581 else
12582   ac_cpp_err=yes
12583 fi
12584 if test -z "$ac_cpp_err"; then
12585   eval "$as_ac_Header=yes"
12586 else
12587   echo "$as_me: failed program was:" >&5
12588   cat conftest.$ac_ext >&5
12589   eval "$as_ac_Header=no"
12590 fi
12591 rm -f conftest.err conftest.$ac_ext
12592 fi
12593 echo "$as_me:12593: result: `eval echo '${'$as_ac_Header'}'`" >&5
12594 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12595 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12596   cat >>confdefs.h <<EOF
12597 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12598 EOF
12599
12600 fi
12601 done
12602
12603 echo "$as_me:12603: checking for header declaring getopt variables" >&5
12604 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
12605 if test "${cf_cv_getopt_header+set}" = set; then
12606   echo $ECHO_N "(cached) $ECHO_C" >&6
12607 else
12608
12609 cf_cv_getopt_header=none
12610 for cf_header in stdio.h stdlib.h unistd.h getopt.h
12611 do
12612 cat >conftest.$ac_ext <<_ACEOF
12613 #line 12613 "configure"
12614 #include "confdefs.h"
12615
12616 #include <$cf_header>
12617 int
12618 main ()
12619 {
12620 int x = optind; char *y = optarg
12621   ;
12622   return 0;
12623 }
12624 _ACEOF
12625 rm -f conftest.$ac_objext
12626 if { (eval echo "$as_me:12626: \"$ac_compile\"") >&5
12627   (eval $ac_compile) 2>&5
12628   ac_status=$?
12629   echo "$as_me:12629: \$? = $ac_status" >&5
12630   (exit $ac_status); } &&
12631          { ac_try='test -s conftest.$ac_objext'
12632   { (eval echo "$as_me:12632: \"$ac_try\"") >&5
12633   (eval $ac_try) 2>&5
12634   ac_status=$?
12635   echo "$as_me:12635: \$? = $ac_status" >&5
12636   (exit $ac_status); }; }; then
12637   cf_cv_getopt_header=$cf_header
12638  break
12639 else
12640   echo "$as_me: failed program was:" >&5
12641 cat conftest.$ac_ext >&5
12642 fi
12643 rm -f conftest.$ac_objext conftest.$ac_ext
12644 done
12645
12646 fi
12647 echo "$as_me:12647: result: $cf_cv_getopt_header" >&5
12648 echo "${ECHO_T}$cf_cv_getopt_header" >&6
12649 if test $cf_cv_getopt_header != none ; then
12650
12651 cat >>confdefs.h <<\EOF
12652 #define HAVE_GETOPT_HEADER 1
12653 EOF
12654
12655 fi
12656
12657 for ac_func in \
12658 gettimeofday \
12659 strdup \
12660
12661 do
12662 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
12663 echo "$as_me:12663: checking for $ac_func" >&5
12664 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
12665 if eval "test \"\${$as_ac_var+set}\" = set"; then
12666   echo $ECHO_N "(cached) $ECHO_C" >&6
12667 else
12668   cat >conftest.$ac_ext <<_ACEOF
12669 #line 12669 "configure"
12670 #include "confdefs.h"
12671 /* System header to define __stub macros and hopefully few prototypes,
12672     which can conflict with char $ac_func (); below.  */
12673 #include <assert.h>
12674 /* Override any gcc2 internal prototype to avoid an error.  */
12675 #ifdef __cplusplus
12676 extern "C"
12677 #endif
12678 /* We use char because int might match the return type of a gcc2
12679    builtin and then its argument prototype would still apply.  */
12680 char $ac_func ();
12681 char (*f) ();
12682
12683 int
12684 main ()
12685 {
12686 /* The GNU C library defines this for functions which it implements
12687     to always fail with ENOSYS.  Some functions are actually named
12688     something starting with __ and the normal name is an alias.  */
12689 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12690 choke me
12691 #else
12692 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12693 #endif
12694
12695   ;
12696   return 0;
12697 }
12698 _ACEOF
12699 rm -f conftest.$ac_objext conftest$ac_exeext
12700 if { (eval echo "$as_me:12700: \"$ac_link\"") >&5
12701   (eval $ac_link) 2>&5
12702   ac_status=$?
12703   echo "$as_me:12703: \$? = $ac_status" >&5
12704   (exit $ac_status); } &&
12705          { ac_try='test -s conftest$ac_exeext'
12706   { (eval echo "$as_me:12706: \"$ac_try\"") >&5
12707   (eval $ac_try) 2>&5
12708   ac_status=$?
12709   echo "$as_me:12709: \$? = $ac_status" >&5
12710   (exit $ac_status); }; }; then
12711   eval "$as_ac_var=yes"
12712 else
12713   echo "$as_me: failed program was:" >&5
12714 cat conftest.$ac_ext >&5
12715 eval "$as_ac_var=no"
12716 fi
12717 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12718 fi
12719 echo "$as_me:12719: result: `eval echo '${'$as_ac_var'}'`" >&5
12720 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
12721 if test `eval echo '${'$as_ac_var'}'` = yes; then
12722   cat >>confdefs.h <<EOF
12723 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
12724 EOF
12725
12726 fi
12727 done
12728
12729 if test "$cf_enable_widec" = yes; then
12730
12731 for ac_func in \
12732 mblen \
12733 mbrlen \
12734 mbrtowc \
12735 mbsrtowcs \
12736 mbstowcs \
12737 mbtowc \
12738 wcsrtombs \
12739 wcstombs \
12740
12741 do
12742 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
12743 echo "$as_me:12743: checking for $ac_func" >&5
12744 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
12745 if eval "test \"\${$as_ac_var+set}\" = set"; then
12746   echo $ECHO_N "(cached) $ECHO_C" >&6
12747 else
12748   cat >conftest.$ac_ext <<_ACEOF
12749 #line 12749 "configure"
12750 #include "confdefs.h"
12751 /* System header to define __stub macros and hopefully few prototypes,
12752     which can conflict with char $ac_func (); below.  */
12753 #include <assert.h>
12754 /* Override any gcc2 internal prototype to avoid an error.  */
12755 #ifdef __cplusplus
12756 extern "C"
12757 #endif
12758 /* We use char because int might match the return type of a gcc2
12759    builtin and then its argument prototype would still apply.  */
12760 char $ac_func ();
12761 char (*f) ();
12762
12763 int
12764 main ()
12765 {
12766 /* The GNU C library defines this for functions which it implements
12767     to always fail with ENOSYS.  Some functions are actually named
12768     something starting with __ and the normal name is an alias.  */
12769 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12770 choke me
12771 #else
12772 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12773 #endif
12774
12775   ;
12776   return 0;
12777 }
12778 _ACEOF
12779 rm -f conftest.$ac_objext conftest$ac_exeext
12780 if { (eval echo "$as_me:12780: \"$ac_link\"") >&5
12781   (eval $ac_link) 2>&5
12782   ac_status=$?
12783   echo "$as_me:12783: \$? = $ac_status" >&5
12784   (exit $ac_status); } &&
12785          { ac_try='test -s conftest$ac_exeext'
12786   { (eval echo "$as_me:12786: \"$ac_try\"") >&5
12787   (eval $ac_try) 2>&5
12788   ac_status=$?
12789   echo "$as_me:12789: \$? = $ac_status" >&5
12790   (exit $ac_status); }; }; then
12791   eval "$as_ac_var=yes"
12792 else
12793   echo "$as_me: failed program was:" >&5
12794 cat conftest.$ac_ext >&5
12795 eval "$as_ac_var=no"
12796 fi
12797 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12798 fi
12799 echo "$as_me:12799: result: `eval echo '${'$as_ac_var'}'`" >&5
12800 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
12801 if test `eval echo '${'$as_ac_var'}'` = yes; then
12802   cat >>confdefs.h <<EOF
12803 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
12804 EOF
12805
12806 fi
12807 done
12808
12809 fi
12810
12811 echo "$as_me:12811: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
12812 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
12813 if test "${cf_cv_need_xopen_extension+set}" = set; then
12814   echo $ECHO_N "(cached) $ECHO_C" >&6
12815 else
12816
12817 cat >conftest.$ac_ext <<_ACEOF
12818 #line 12818 "configure"
12819 #include "confdefs.h"
12820
12821 #include <stdlib.h>
12822 #include <${cf_cv_ncurses_header:-curses.h}>
12823 int
12824 main ()
12825 {
12826
12827 #if defined(NCURSES_VERSION_PATCH)
12828 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
12829         make an error
12830 #endif
12831 #endif
12832         long x = winnstr(stdscr, "", 0);
12833         int x1, y1;
12834         getbegyx(stdscr, y1, x1)
12835   ;
12836   return 0;
12837 }
12838 _ACEOF
12839 rm -f conftest.$ac_objext conftest$ac_exeext
12840 if { (eval echo "$as_me:12840: \"$ac_link\"") >&5
12841   (eval $ac_link) 2>&5
12842   ac_status=$?
12843   echo "$as_me:12843: \$? = $ac_status" >&5
12844   (exit $ac_status); } &&
12845          { ac_try='test -s conftest$ac_exeext'
12846   { (eval echo "$as_me:12846: \"$ac_try\"") >&5
12847   (eval $ac_try) 2>&5
12848   ac_status=$?
12849   echo "$as_me:12849: \$? = $ac_status" >&5
12850   (exit $ac_status); }; }; then
12851   cf_cv_need_xopen_extension=no
12852 else
12853   echo "$as_me: failed program was:" >&5
12854 cat conftest.$ac_ext >&5
12855 cat >conftest.$ac_ext <<_ACEOF
12856 #line 12856 "configure"
12857 #include "confdefs.h"
12858
12859 #define _XOPEN_SOURCE_EXTENDED
12860 #include <stdlib.h>
12861 #include <${cf_cv_ncurses_header:-curses.h}>
12862 int
12863 main ()
12864 {
12865
12866 #ifdef NCURSES_VERSION
12867         cchar_t check;
12868         int check2 = curs_set((int)sizeof(check));
12869 #endif
12870         long x = winnstr(stdscr, "", 0);
12871         int x1, y1;
12872         getbegyx(stdscr, y1, x1)
12873   ;
12874   return 0;
12875 }
12876 _ACEOF
12877 rm -f conftest.$ac_objext conftest$ac_exeext
12878 if { (eval echo "$as_me:12878: \"$ac_link\"") >&5
12879   (eval $ac_link) 2>&5
12880   ac_status=$?
12881   echo "$as_me:12881: \$? = $ac_status" >&5
12882   (exit $ac_status); } &&
12883          { ac_try='test -s conftest$ac_exeext'
12884   { (eval echo "$as_me:12884: \"$ac_try\"") >&5
12885   (eval $ac_try) 2>&5
12886   ac_status=$?
12887   echo "$as_me:12887: \$? = $ac_status" >&5
12888   (exit $ac_status); }; }; then
12889   cf_cv_need_xopen_extension=yes
12890 else
12891   echo "$as_me: failed program was:" >&5
12892 cat conftest.$ac_ext >&5
12893 cf_cv_need_xopen_extension=unknown
12894 fi
12895 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12896 fi
12897 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12898 fi
12899 echo "$as_me:12899: result: $cf_cv_need_xopen_extension" >&5
12900 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
12901 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
12902
12903 echo "$as_me:12903: checking for term.h" >&5
12904 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
12905 if test "${cf_cv_term_header+set}" = set; then
12906   echo $ECHO_N "(cached) $ECHO_C" >&6
12907 else
12908
12909 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
12910 # for <term.h> if we do not find the variant.
12911
12912 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
12913
12914 case ${cf_cv_ncurses_header:-curses.h} in #(vi
12915 */*)
12916         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
12917         cf_header_list="$cf_header_item $cf_header_list"
12918         ;;
12919 esac
12920
12921 for cf_header in $cf_header_list
12922 do
12923         cat >conftest.$ac_ext <<_ACEOF
12924 #line 12924 "configure"
12925 #include "confdefs.h"
12926
12927 #include <${cf_cv_ncurses_header:-curses.h}>
12928 #include <${cf_header}>
12929 int
12930 main ()
12931 {
12932 WINDOW *x
12933   ;
12934   return 0;
12935 }
12936 _ACEOF
12937 rm -f conftest.$ac_objext
12938 if { (eval echo "$as_me:12938: \"$ac_compile\"") >&5
12939   (eval $ac_compile) 2>&5
12940   ac_status=$?
12941   echo "$as_me:12941: \$? = $ac_status" >&5
12942   (exit $ac_status); } &&
12943          { ac_try='test -s conftest.$ac_objext'
12944   { (eval echo "$as_me:12944: \"$ac_try\"") >&5
12945   (eval $ac_try) 2>&5
12946   ac_status=$?
12947   echo "$as_me:12947: \$? = $ac_status" >&5
12948   (exit $ac_status); }; }; then
12949   cf_cv_term_header=$cf_header
12950          break
12951 else
12952   echo "$as_me: failed program was:" >&5
12953 cat conftest.$ac_ext >&5
12954 cf_cv_term_header=no
12955 fi
12956 rm -f conftest.$ac_objext conftest.$ac_ext
12957 done
12958
12959 case $cf_cv_term_header in #(vi
12960 no)
12961         # If curses is ncurses, some packagers still mess it up by trying to make
12962         # us use GNU termcap.  This handles the most common case.
12963         for cf_header in ncurses/term.h ncursesw/term.h
12964         do
12965                 cat >conftest.$ac_ext <<_ACEOF
12966 #line 12966 "configure"
12967 #include "confdefs.h"
12968
12969 #include <${cf_cv_ncurses_header:-curses.h}>
12970 #ifdef NCURSES_VERSION
12971 #include <${cf_header}>
12972 #else
12973 make an error
12974 #endif
12975 int
12976 main ()
12977 {
12978 WINDOW *x
12979   ;
12980   return 0;
12981 }
12982 _ACEOF
12983 rm -f conftest.$ac_objext
12984 if { (eval echo "$as_me:12984: \"$ac_compile\"") >&5
12985   (eval $ac_compile) 2>&5
12986   ac_status=$?
12987   echo "$as_me:12987: \$? = $ac_status" >&5
12988   (exit $ac_status); } &&
12989          { ac_try='test -s conftest.$ac_objext'
12990   { (eval echo "$as_me:12990: \"$ac_try\"") >&5
12991   (eval $ac_try) 2>&5
12992   ac_status=$?
12993   echo "$as_me:12993: \$? = $ac_status" >&5
12994   (exit $ac_status); }; }; then
12995   cf_cv_term_header=$cf_header
12996                          break
12997 else
12998   echo "$as_me: failed program was:" >&5
12999 cat conftest.$ac_ext >&5
13000 cf_cv_term_header=no
13001 fi
13002 rm -f conftest.$ac_objext conftest.$ac_ext
13003         done
13004         ;;
13005 esac
13006
13007 fi
13008 echo "$as_me:13008: result: $cf_cv_term_header" >&5
13009 echo "${ECHO_T}$cf_cv_term_header" >&6
13010
13011 case $cf_cv_term_header in #(vi
13012 term.h) #(vi
13013
13014 cat >>confdefs.h <<\EOF
13015 #define HAVE_TERM_H 1
13016 EOF
13017
13018         ;;
13019 ncurses/term.h) #(vi
13020
13021 cat >>confdefs.h <<\EOF
13022 #define HAVE_NCURSES_TERM_H 1
13023 EOF
13024
13025         ;;
13026 ncursesw/term.h)
13027
13028 cat >>confdefs.h <<\EOF
13029 #define HAVE_NCURSESW_TERM_H 1
13030 EOF
13031
13032         ;;
13033 esac
13034
13035 echo "$as_me:13035: checking for unctrl.h" >&5
13036 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
13037 if test "${cf_cv_unctrl_header+set}" = set; then
13038   echo $ECHO_N "(cached) $ECHO_C" >&6
13039 else
13040
13041 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
13042 # for <unctrl.h> if we do not find the variant.
13043
13044 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
13045
13046 case ${cf_cv_ncurses_header:-curses.h} in #(vi
13047 */*)
13048         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
13049         cf_header_list="$cf_header_item $cf_header_list"
13050         ;;
13051 esac
13052
13053 for cf_header in $cf_header_list
13054 do
13055         cat >conftest.$ac_ext <<_ACEOF
13056 #line 13056 "configure"
13057 #include "confdefs.h"
13058
13059 #include <${cf_cv_ncurses_header:-curses.h}>
13060 #include <${cf_header}>
13061 int
13062 main ()
13063 {
13064 WINDOW *x
13065   ;
13066   return 0;
13067 }
13068 _ACEOF
13069 rm -f conftest.$ac_objext
13070 if { (eval echo "$as_me:13070: \"$ac_compile\"") >&5
13071   (eval $ac_compile) 2>&5
13072   ac_status=$?
13073   echo "$as_me:13073: \$? = $ac_status" >&5
13074   (exit $ac_status); } &&
13075          { ac_try='test -s conftest.$ac_objext'
13076   { (eval echo "$as_me:13076: \"$ac_try\"") >&5
13077   (eval $ac_try) 2>&5
13078   ac_status=$?
13079   echo "$as_me:13079: \$? = $ac_status" >&5
13080   (exit $ac_status); }; }; then
13081   cf_cv_unctrl_header=$cf_header
13082          break
13083 else
13084   echo "$as_me: failed program was:" >&5
13085 cat conftest.$ac_ext >&5
13086 cf_cv_unctrl_header=no
13087 fi
13088 rm -f conftest.$ac_objext conftest.$ac_ext
13089 done
13090
13091 case $cf_cv_unctrl_header in #(vi
13092 no)
13093         { echo "$as_me:13093: WARNING: unctrl.h header not found" >&5
13094 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
13095         ;;
13096 esac
13097
13098 fi
13099 echo "$as_me:13099: result: $cf_cv_unctrl_header" >&5
13100 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
13101
13102 case $cf_cv_unctrl_header in #(vi
13103 unctrl.h) #(vi
13104
13105 cat >>confdefs.h <<\EOF
13106 #define HAVE_UNCTRL_H 1
13107 EOF
13108
13109         ;;
13110 ncurses/unctrl.h) #(vi
13111
13112 cat >>confdefs.h <<\EOF
13113 #define HAVE_NCURSES_UNCTRL_H 1
13114 EOF
13115
13116         ;;
13117 ncursesw/unctrl.h)
13118
13119 cat >>confdefs.h <<\EOF
13120 #define HAVE_NCURSESW_UNCTRL_H 1
13121 EOF
13122
13123         ;;
13124 esac
13125
13126 for cf_func in \
13127 assume_default_colors \
13128 chgat \
13129 color_set \
13130 filter \
13131 getbegx \
13132 getcurx \
13133 getmaxx \
13134 getnstr \
13135 getparx \
13136 getwin \
13137 mvvline \
13138 mvwvline \
13139 napms \
13140 putwin \
13141 resize_term \
13142 resizeterm \
13143 ripoffline \
13144 scr_dump \
13145 setupterm \
13146 slk_color \
13147 slk_init \
13148 termattrs \
13149 tgetent \
13150 tigetnum \
13151 tigetstr \
13152 typeahead \
13153 use_default_colors \
13154 use_screen \
13155 use_window \
13156 vsscanf \
13157 vw_printw \
13158 wchgat \
13159 winsstr \
13160 wresize \
13161 wsyncdown \
13162
13163 do
13164
13165 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13166
13167         echo "$as_me:13167: checking for ${cf_func}" >&5
13168 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
13169
13170 echo "${as_me:-configure}:13170: testing ${cf_func} ..." 1>&5
13171
13172         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
13173   echo $ECHO_N "(cached) $ECHO_C" >&6
13174 else
13175
13176                 eval cf_result='$ac_cv_func_'$cf_func
13177                 if test ".$cf_result" != ".no"; then
13178                         cat >conftest.$ac_ext <<_ACEOF
13179 #line 13179 "configure"
13180 #include "confdefs.h"
13181
13182 #ifdef HAVE_XCURSES
13183 #include <xcurses.h>
13184 char * XCursesProgramName = "test";
13185 #else
13186 #include <${cf_cv_ncurses_header:-curses.h}>
13187 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13188 #include <ncursesw/term.h>
13189 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13190 #include <ncurses/term.h>
13191 #elif defined(HAVE_TERM_H)
13192 #include <term.h>
13193 #endif
13194 #endif
13195
13196 int
13197 main ()
13198 {
13199
13200 #ifndef ${cf_func}
13201 long foo = (long)(&${cf_func});
13202 if (foo + 1234 > 5678)
13203         ${cf_cv_main_return:-return}(foo);
13204 #endif
13205
13206   ;
13207   return 0;
13208 }
13209 _ACEOF
13210 rm -f conftest.$ac_objext conftest$ac_exeext
13211 if { (eval echo "$as_me:13211: \"$ac_link\"") >&5
13212   (eval $ac_link) 2>&5
13213   ac_status=$?
13214   echo "$as_me:13214: \$? = $ac_status" >&5
13215   (exit $ac_status); } &&
13216          { ac_try='test -s conftest$ac_exeext'
13217   { (eval echo "$as_me:13217: \"$ac_try\"") >&5
13218   (eval $ac_try) 2>&5
13219   ac_status=$?
13220   echo "$as_me:13220: \$? = $ac_status" >&5
13221   (exit $ac_status); }; }; then
13222   cf_result=yes
13223 else
13224   echo "$as_me: failed program was:" >&5
13225 cat conftest.$ac_ext >&5
13226 cf_result=no
13227 fi
13228 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13229                 fi
13230                 eval 'cf_cv_func_'$cf_func'=$cf_result'
13231
13232 fi
13233
13234         # use the computed/retrieved cache-value:
13235         eval 'cf_result=$cf_cv_func_'$cf_func
13236         echo "$as_me:13236: result: $cf_result" >&5
13237 echo "${ECHO_T}$cf_result" >&6
13238         if test $cf_result != no; then
13239                 cat >>confdefs.h <<EOF
13240 #define HAVE_${cf_tr_func} 1
13241 EOF
13242
13243         fi
13244 done
13245
13246 for cf_func in tputs
13247 do
13248
13249 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13250
13251         echo "$as_me:13251: checking for ${cf_func}" >&5
13252 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
13253
13254 echo "${as_me:-configure}:13254: testing ${cf_func} ..." 1>&5
13255
13256         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
13257   echo $ECHO_N "(cached) $ECHO_C" >&6
13258 else
13259
13260                 eval cf_result='$ac_cv_func_'$cf_func
13261                 if test ".$cf_result" != ".no"; then
13262                         cat >conftest.$ac_ext <<_ACEOF
13263 #line 13263 "configure"
13264 #include "confdefs.h"
13265
13266 #ifdef HAVE_XCURSES
13267 #include <xcurses.h>
13268 char * XCursesProgramName = "test";
13269 #else
13270 #include <${cf_cv_ncurses_header:-curses.h}>
13271 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13272 #include <ncursesw/term.h>
13273 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13274 #include <ncurses/term.h>
13275 #elif defined(HAVE_TERM_H)
13276 #include <term.h>
13277 #endif
13278 #endif
13279
13280 int
13281 main ()
13282 {
13283
13284 #ifndef ${cf_func}
13285 long foo = (long)(&${cf_func});
13286 if (foo + 1234 > 5678)
13287         ${cf_cv_main_return:-return}(foo);
13288 #endif
13289
13290   ;
13291   return 0;
13292 }
13293 _ACEOF
13294 rm -f conftest.$ac_objext conftest$ac_exeext
13295 if { (eval echo "$as_me:13295: \"$ac_link\"") >&5
13296   (eval $ac_link) 2>&5
13297   ac_status=$?
13298   echo "$as_me:13298: \$? = $ac_status" >&5
13299   (exit $ac_status); } &&
13300          { ac_try='test -s conftest$ac_exeext'
13301   { (eval echo "$as_me:13301: \"$ac_try\"") >&5
13302   (eval $ac_try) 2>&5
13303   ac_status=$?
13304   echo "$as_me:13304: \$? = $ac_status" >&5
13305   (exit $ac_status); }; }; then
13306   cf_result=yes
13307 else
13308   echo "$as_me: failed program was:" >&5
13309 cat conftest.$ac_ext >&5
13310 cf_result=no
13311 fi
13312 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13313                 fi
13314                 eval 'cf_cv_func_'$cf_func'=$cf_result'
13315
13316 fi
13317
13318         # use the computed/retrieved cache-value:
13319         eval 'cf_result=$cf_cv_func_'$cf_func
13320         echo "$as_me:13320: result: $cf_result" >&5
13321 echo "${ECHO_T}$cf_result" >&6
13322         if test $cf_result != no; then
13323                 cat >>confdefs.h <<EOF
13324 #define HAVE_${cf_tr_func} 1
13325 EOF
13326
13327         fi
13328 done
13329
13330 if test x$cf_cv_func_tputs = xyes
13331 then
13332         cf_done=no
13333         for cf_arg in int char
13334         do
13335                 for cf_ret in int void
13336                 do
13337                         if test $cf_ret = void
13338                         then
13339                                 cf_return="/* nothing */"
13340                         else
13341                                 cf_return="return value"
13342                         fi
13343                         cat >conftest.$ac_ext <<_ACEOF
13344 #line 13344 "configure"
13345 #include "confdefs.h"
13346
13347 #include <${cf_cv_ncurses_header:-curses.h}>
13348 #include <$cf_cv_term_header>
13349
13350 static $cf_ret outc($cf_arg value) { $cf_return; }
13351
13352 int
13353 main ()
13354 {
13355
13356         tputs("hello", 0, outc);
13357         ${cf_cv_main_return:-return}(0);
13358
13359   ;
13360   return 0;
13361 }
13362 _ACEOF
13363 rm -f conftest.$ac_objext
13364 if { (eval echo "$as_me:13364: \"$ac_compile\"") >&5
13365   (eval $ac_compile) 2>&5
13366   ac_status=$?
13367   echo "$as_me:13367: \$? = $ac_status" >&5
13368   (exit $ac_status); } &&
13369          { ac_try='test -s conftest.$ac_objext'
13370   { (eval echo "$as_me:13370: \"$ac_try\"") >&5
13371   (eval $ac_try) 2>&5
13372   ac_status=$?
13373   echo "$as_me:13373: \$? = $ac_status" >&5
13374   (exit $ac_status); }; }; then
13375
13376                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
13377
13378 echo "${as_me:-configure}:13378: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
13379
13380                 cat >>confdefs.h <<EOF
13381 #define TPUTS_ARG               $cf_arg
13382 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
13383 #define TPUTS_RETURN(value)     $cf_return
13384 EOF
13385                 cf_done=yes
13386                 break
13387
13388 else
13389   echo "$as_me: failed program was:" >&5
13390 cat conftest.$ac_ext >&5
13391 fi
13392 rm -f conftest.$ac_objext conftest.$ac_ext
13393                 done
13394                 test $cf_done = yes && break
13395         done
13396 fi
13397
13398 echo "$as_me:13398: checking for ncurses extended functions" >&5
13399 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
13400 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
13401   echo $ECHO_N "(cached) $ECHO_C" >&6
13402 else
13403
13404 cat >conftest.$ac_ext <<_ACEOF
13405 #line 13405 "configure"
13406 #include "confdefs.h"
13407
13408 #include <${cf_cv_ncurses_header:-curses.h}>
13409 int
13410 main ()
13411 {
13412
13413 int x = NCURSES_EXT_FUNCS
13414
13415   ;
13416   return 0;
13417 }
13418 _ACEOF
13419 rm -f conftest.$ac_objext
13420 if { (eval echo "$as_me:13420: \"$ac_compile\"") >&5
13421   (eval $ac_compile) 2>&5
13422   ac_status=$?
13423   echo "$as_me:13423: \$? = $ac_status" >&5
13424   (exit $ac_status); } &&
13425          { ac_try='test -s conftest.$ac_objext'
13426   { (eval echo "$as_me:13426: \"$ac_try\"") >&5
13427   (eval $ac_try) 2>&5
13428   ac_status=$?
13429   echo "$as_me:13429: \$? = $ac_status" >&5
13430   (exit $ac_status); }; }; then
13431   cf_cv_ncurses_ext_funcs=defined
13432 else
13433   echo "$as_me: failed program was:" >&5
13434 cat conftest.$ac_ext >&5
13435
13436 cat >conftest.$ac_ext <<_ACEOF
13437 #line 13437 "configure"
13438 #include "confdefs.h"
13439
13440 #include <${cf_cv_ncurses_header:-curses.h}>
13441 int
13442 main ()
13443 {
13444
13445         (void) assume_default_colors (0, 0);
13446         (void) curses_version ();
13447         (void) define_key (0, 0);
13448         (void) is_term_resized (0, 0);
13449         (void) key_defined (0);
13450         (void) keybound (0, 0);
13451         (void) keyok (0, 0);
13452         (void) resize_term (0, 0);
13453         (void) resizeterm (0, 0);
13454         (void) use_default_colors ();
13455         (void) use_extended_names (0);
13456         (void) wresize (0, 0, 0);
13457   ;
13458   return 0;
13459 }
13460 _ACEOF
13461 rm -f conftest.$ac_objext conftest$ac_exeext
13462 if { (eval echo "$as_me:13462: \"$ac_link\"") >&5
13463   (eval $ac_link) 2>&5
13464   ac_status=$?
13465   echo "$as_me:13465: \$? = $ac_status" >&5
13466   (exit $ac_status); } &&
13467          { ac_try='test -s conftest$ac_exeext'
13468   { (eval echo "$as_me:13468: \"$ac_try\"") >&5
13469   (eval $ac_try) 2>&5
13470   ac_status=$?
13471   echo "$as_me:13471: \$? = $ac_status" >&5
13472   (exit $ac_status); }; }; then
13473   cf_cv_ncurses_ext_funcs=yes
13474 else
13475   echo "$as_me: failed program was:" >&5
13476 cat conftest.$ac_ext >&5
13477 cf_cv_ncurses_ext_funcs=no
13478 fi
13479 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13480
13481 fi
13482 rm -f conftest.$ac_objext conftest.$ac_ext
13483
13484 fi
13485 echo "$as_me:13485: result: $cf_cv_ncurses_ext_funcs" >&5
13486 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
13487 test "$cf_cv_ncurses_ext_funcs" = yes &&
13488 cat >>confdefs.h <<\EOF
13489 #define NCURSES_EXT_FUNCS 1
13490 EOF
13491
13492 if test "$cf_enable_widec" = yes
13493 then
13494         # workaround for systems with ncurses before 20111029, due to change of
13495         # feature test macro from _XPG5 to _XOPEN_SOURCE
13496         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
13497         then
13498                 cf_define_xpg5=no
13499                 echo "$as_me:13499: checking if _XPG5 should be defined to enable wide-characters" >&5
13500 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
13501
13502                 cat >conftest.$ac_ext <<_ACEOF
13503 #line 13503 "configure"
13504 #include "confdefs.h"
13505
13506 #include <${cf_cv_ncurses_header:-curses.h}>
13507 int
13508 main ()
13509 {
13510 int x = _XPG5
13511   ;
13512   return 0;
13513 }
13514 _ACEOF
13515 rm -f conftest.$ac_objext
13516 if { (eval echo "$as_me:13516: \"$ac_compile\"") >&5
13517   (eval $ac_compile) 2>&5
13518   ac_status=$?
13519   echo "$as_me:13519: \$? = $ac_status" >&5
13520   (exit $ac_status); } &&
13521          { ac_try='test -s conftest.$ac_objext'
13522   { (eval echo "$as_me:13522: \"$ac_try\"") >&5
13523   (eval $ac_try) 2>&5
13524   ac_status=$?
13525   echo "$as_me:13525: \$? = $ac_status" >&5
13526   (exit $ac_status); }; }; then
13527   :
13528 else
13529   echo "$as_me: failed program was:" >&5
13530 cat conftest.$ac_ext >&5
13531 cf_save_cppflags="$CPPFLAGS"
13532                          CPPFLAGS="$CPPFLAGS -D_XPG5"
13533                          cat >conftest.$ac_ext <<_ACEOF
13534 #line 13534 "configure"
13535 #include "confdefs.h"
13536
13537 #include <${cf_cv_ncurses_header:-curses.h}>
13538 int
13539 main ()
13540 {
13541 int x = _XPG5
13542   ;
13543   return 0;
13544 }
13545 _ACEOF
13546 rm -f conftest.$ac_objext
13547 if { (eval echo "$as_me:13547: \"$ac_compile\"") >&5
13548   (eval $ac_compile) 2>&5
13549   ac_status=$?
13550   echo "$as_me:13550: \$? = $ac_status" >&5
13551   (exit $ac_status); } &&
13552          { ac_try='test -s conftest.$ac_objext'
13553   { (eval echo "$as_me:13553: \"$ac_try\"") >&5
13554   (eval $ac_try) 2>&5
13555   ac_status=$?
13556   echo "$as_me:13556: \$? = $ac_status" >&5
13557   (exit $ac_status); }; }; then
13558   cf_define_xpg5=yes
13559 else
13560   echo "$as_me: failed program was:" >&5
13561 cat conftest.$ac_ext >&5
13562 fi
13563 rm -f conftest.$ac_objext conftest.$ac_ext
13564                          CPPFLAGS="$cf_save_cppflags"
13565 fi
13566 rm -f conftest.$ac_objext conftest.$ac_ext
13567                 echo "$as_me:13567: result: $cf_define_xpg5" >&5
13568 echo "${ECHO_T}$cf_define_xpg5" >&6
13569
13570                 if test "$cf_define_xpg5" = yes
13571                 then
13572                         CPPFLAGS="$CPPFLAGS -D_XPG5"
13573                 fi
13574         fi
13575
13576         echo "$as_me:13576: checking for wide-character functions" >&5
13577 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
13578 if test "${cf_cv_widechar_funcs+set}" = set; then
13579   echo $ECHO_N "(cached) $ECHO_C" >&6
13580 else
13581
13582         cat >conftest.$ac_ext <<_ACEOF
13583 #line 13583 "configure"
13584 #include "confdefs.h"
13585
13586 #include <${cf_cv_ncurses_header:-curses.h}>
13587 int
13588 main ()
13589 {
13590
13591                 static wchar_t src_wchar[2];
13592                 static cchar_t dst_cchar;
13593                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
13594
13595   ;
13596   return 0;
13597 }
13598 _ACEOF
13599 rm -f conftest.$ac_objext conftest$ac_exeext
13600 if { (eval echo "$as_me:13600: \"$ac_link\"") >&5
13601   (eval $ac_link) 2>&5
13602   ac_status=$?
13603   echo "$as_me:13603: \$? = $ac_status" >&5
13604   (exit $ac_status); } &&
13605          { ac_try='test -s conftest$ac_exeext'
13606   { (eval echo "$as_me:13606: \"$ac_try\"") >&5
13607   (eval $ac_try) 2>&5
13608   ac_status=$?
13609   echo "$as_me:13609: \$? = $ac_status" >&5
13610   (exit $ac_status); }; }; then
13611   cf_cv_widechar_funcs=yes
13612 else
13613   echo "$as_me: failed program was:" >&5
13614 cat conftest.$ac_ext >&5
13615 cf_cv_widechar_funcs=no
13616 fi
13617 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13618
13619 fi
13620 echo "$as_me:13620: result: $cf_cv_widechar_funcs" >&5
13621 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
13622         if test "$cf_cv_widechar_funcs" != no ; then
13623
13624 cat >>confdefs.h <<\EOF
13625 #define USE_WIDEC_SUPPORT 1
13626 EOF
13627
13628         else
13629                 cat >>confdefs.h <<\EOF
13630 #define USE_WIDEC_SUPPORT 0
13631 EOF
13632
13633         fi
13634 else
13635         cat >>confdefs.h <<\EOF
13636 #define USE_WIDEC_SUPPORT 0
13637 EOF
13638
13639 fi
13640
13641 echo "$as_me:13641: checking if sys/time.h works with sys/select.h" >&5
13642 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
13643 if test "${cf_cv_sys_time_select+set}" = set; then
13644   echo $ECHO_N "(cached) $ECHO_C" >&6
13645 else
13646
13647 cat >conftest.$ac_ext <<_ACEOF
13648 #line 13648 "configure"
13649 #include "confdefs.h"
13650
13651 #include <sys/types.h>
13652 #ifdef HAVE_SYS_TIME_H
13653 #include <sys/time.h>
13654 #endif
13655 #ifdef HAVE_SYS_SELECT_H
13656 #include <sys/select.h>
13657 #endif
13658
13659 int
13660 main ()
13661 {
13662
13663   ;
13664   return 0;
13665 }
13666 _ACEOF
13667 rm -f conftest.$ac_objext
13668 if { (eval echo "$as_me:13668: \"$ac_compile\"") >&5
13669   (eval $ac_compile) 2>&5
13670   ac_status=$?
13671   echo "$as_me:13671: \$? = $ac_status" >&5
13672   (exit $ac_status); } &&
13673          { ac_try='test -s conftest.$ac_objext'
13674   { (eval echo "$as_me:13674: \"$ac_try\"") >&5
13675   (eval $ac_try) 2>&5
13676   ac_status=$?
13677   echo "$as_me:13677: \$? = $ac_status" >&5
13678   (exit $ac_status); }; }; then
13679   cf_cv_sys_time_select=yes
13680 else
13681   echo "$as_me: failed program was:" >&5
13682 cat conftest.$ac_ext >&5
13683 cf_cv_sys_time_select=no
13684 fi
13685 rm -f conftest.$ac_objext conftest.$ac_ext
13686
13687 fi
13688
13689 echo "$as_me:13689: result: $cf_cv_sys_time_select" >&5
13690 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
13691 test "$cf_cv_sys_time_select" = yes &&
13692 cat >>confdefs.h <<\EOF
13693 #define HAVE_SYS_TIME_SELECT 1
13694 EOF
13695
13696 echo "$as_me:13696: checking for function curses_version" >&5
13697 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
13698 if test "${cf_cv_func_curses_version+set}" = set; then
13699   echo $ECHO_N "(cached) $ECHO_C" >&6
13700 else
13701
13702 if test "$cross_compiling" = yes; then
13703   cf_cv_func_curses_version=unknown
13704 else
13705   cat >conftest.$ac_ext <<_ACEOF
13706 #line 13706 "configure"
13707 #include "confdefs.h"
13708
13709 #include <${cf_cv_ncurses_header:-curses.h}>
13710 int main()
13711 {
13712         char temp[1024];
13713         sprintf(temp, "%s\n", curses_version());
13714         ${cf_cv_main_return:-return}(0);
13715 }
13716
13717 _ACEOF
13718 rm -f conftest$ac_exeext
13719 if { (eval echo "$as_me:13719: \"$ac_link\"") >&5
13720   (eval $ac_link) 2>&5
13721   ac_status=$?
13722   echo "$as_me:13722: \$? = $ac_status" >&5
13723   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13724   { (eval echo "$as_me:13724: \"$ac_try\"") >&5
13725   (eval $ac_try) 2>&5
13726   ac_status=$?
13727   echo "$as_me:13727: \$? = $ac_status" >&5
13728   (exit $ac_status); }; }; then
13729   cf_cv_func_curses_version=yes
13730
13731 else
13732   echo "$as_me: program exited with status $ac_status" >&5
13733 echo "$as_me: failed program was:" >&5
13734 cat conftest.$ac_ext >&5
13735 cf_cv_func_curses_version=no
13736
13737 fi
13738 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13739 fi
13740 rm -f core
13741 fi
13742 echo "$as_me:13742: result: $cf_cv_func_curses_version" >&5
13743 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
13744 test "$cf_cv_func_curses_version" = yes &&
13745 cat >>confdefs.h <<\EOF
13746 #define HAVE_CURSES_VERSION 1
13747 EOF
13748
13749 echo "$as_me:13749: checking for alternate character set array" >&5
13750 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
13751 if test "${cf_cv_curses_acs_map+set}" = set; then
13752   echo $ECHO_N "(cached) $ECHO_C" >&6
13753 else
13754
13755 cf_cv_curses_acs_map=unknown
13756 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
13757 do
13758 cat >conftest.$ac_ext <<_ACEOF
13759 #line 13759 "configure"
13760 #include "confdefs.h"
13761
13762 #include <${cf_cv_ncurses_header:-curses.h}>
13763
13764 int
13765 main ()
13766 {
13767
13768 $name['k'] = ACS_PLUS
13769
13770   ;
13771   return 0;
13772 }
13773 _ACEOF
13774 rm -f conftest.$ac_objext conftest$ac_exeext
13775 if { (eval echo "$as_me:13775: \"$ac_link\"") >&5
13776   (eval $ac_link) 2>&5
13777   ac_status=$?
13778   echo "$as_me:13778: \$? = $ac_status" >&5
13779   (exit $ac_status); } &&
13780          { ac_try='test -s conftest$ac_exeext'
13781   { (eval echo "$as_me:13781: \"$ac_try\"") >&5
13782   (eval $ac_try) 2>&5
13783   ac_status=$?
13784   echo "$as_me:13784: \$? = $ac_status" >&5
13785   (exit $ac_status); }; }; then
13786   cf_cv_curses_acs_map=$name; break
13787 else
13788   echo "$as_me: failed program was:" >&5
13789 cat conftest.$ac_ext >&5
13790 fi
13791 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13792 done
13793
13794 fi
13795 echo "$as_me:13795: result: $cf_cv_curses_acs_map" >&5
13796 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
13797
13798 test "$cf_cv_curses_acs_map" != unknown &&
13799 cat >>confdefs.h <<EOF
13800 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
13801 EOF
13802
13803 if test "$cf_enable_widec" = yes; then
13804
13805 echo "$as_me:13805: checking for wide alternate character set array" >&5
13806 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
13807 if test "${cf_cv_curses_wacs_map+set}" = set; then
13808   echo $ECHO_N "(cached) $ECHO_C" >&6
13809 else
13810
13811         cf_cv_curses_wacs_map=unknown
13812         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
13813         do
13814         cat >conftest.$ac_ext <<_ACEOF
13815 #line 13815 "configure"
13816 #include "confdefs.h"
13817
13818 #ifndef _XOPEN_SOURCE_EXTENDED
13819 #define _XOPEN_SOURCE_EXTENDED
13820 #endif
13821 #include <${cf_cv_ncurses_header:-curses.h}>
13822 int
13823 main ()
13824 {
13825 void *foo = &($name['k'])
13826   ;
13827   return 0;
13828 }
13829 _ACEOF
13830 rm -f conftest.$ac_objext conftest$ac_exeext
13831 if { (eval echo "$as_me:13831: \"$ac_link\"") >&5
13832   (eval $ac_link) 2>&5
13833   ac_status=$?
13834   echo "$as_me:13834: \$? = $ac_status" >&5
13835   (exit $ac_status); } &&
13836          { ac_try='test -s conftest$ac_exeext'
13837   { (eval echo "$as_me:13837: \"$ac_try\"") >&5
13838   (eval $ac_try) 2>&5
13839   ac_status=$?
13840   echo "$as_me:13840: \$? = $ac_status" >&5
13841   (exit $ac_status); }; }; then
13842   cf_cv_curses_wacs_map=$name
13843          break
13844 else
13845   echo "$as_me: failed program was:" >&5
13846 cat conftest.$ac_ext >&5
13847 fi
13848 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13849         done
13850 fi
13851 echo "$as_me:13851: result: $cf_cv_curses_wacs_map" >&5
13852 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
13853
13854 test "$cf_cv_curses_wacs_map" != unknown &&
13855 cat >>confdefs.h <<EOF
13856 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
13857 EOF
13858
13859 echo "$as_me:13859: checking for wide alternate character constants" >&5
13860 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
13861 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
13862   echo $ECHO_N "(cached) $ECHO_C" >&6
13863 else
13864
13865 cf_cv_curses_wacs_symbols=no
13866 if test "$cf_cv_curses_wacs_map" != unknown
13867 then
13868         cat >conftest.$ac_ext <<_ACEOF
13869 #line 13869 "configure"
13870 #include "confdefs.h"
13871
13872 #ifndef _XOPEN_SOURCE_EXTENDED
13873 #define _XOPEN_SOURCE_EXTENDED
13874 #endif
13875 #include <${cf_cv_ncurses_header:-curses.h}>
13876 int
13877 main ()
13878 {
13879 cchar_t *foo = WACS_PLUS;
13880          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
13881   ;
13882   return 0;
13883 }
13884 _ACEOF
13885 rm -f conftest.$ac_objext conftest$ac_exeext
13886 if { (eval echo "$as_me:13886: \"$ac_link\"") >&5
13887   (eval $ac_link) 2>&5
13888   ac_status=$?
13889   echo "$as_me:13889: \$? = $ac_status" >&5
13890   (exit $ac_status); } &&
13891          { ac_try='test -s conftest$ac_exeext'
13892   { (eval echo "$as_me:13892: \"$ac_try\"") >&5
13893   (eval $ac_try) 2>&5
13894   ac_status=$?
13895   echo "$as_me:13895: \$? = $ac_status" >&5
13896   (exit $ac_status); }; }; then
13897   cf_cv_curses_wacs_symbols=yes
13898 else
13899   echo "$as_me: failed program was:" >&5
13900 cat conftest.$ac_ext >&5
13901 fi
13902 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13903 else
13904         cat >conftest.$ac_ext <<_ACEOF
13905 #line 13905 "configure"
13906 #include "confdefs.h"
13907
13908 #ifndef _XOPEN_SOURCE_EXTENDED
13909 #define _XOPEN_SOURCE_EXTENDED
13910 #endif
13911 #include <${cf_cv_ncurses_header:-curses.h}>
13912 int
13913 main ()
13914 {
13915 cchar_t *foo = WACS_PLUS
13916   ;
13917   return 0;
13918 }
13919 _ACEOF
13920 rm -f conftest.$ac_objext conftest$ac_exeext
13921 if { (eval echo "$as_me:13921: \"$ac_link\"") >&5
13922   (eval $ac_link) 2>&5
13923   ac_status=$?
13924   echo "$as_me:13924: \$? = $ac_status" >&5
13925   (exit $ac_status); } &&
13926          { ac_try='test -s conftest$ac_exeext'
13927   { (eval echo "$as_me:13927: \"$ac_try\"") >&5
13928   (eval $ac_try) 2>&5
13929   ac_status=$?
13930   echo "$as_me:13930: \$? = $ac_status" >&5
13931   (exit $ac_status); }; }; then
13932   cf_cv_curses_wacs_symbols=yes
13933 else
13934   echo "$as_me: failed program was:" >&5
13935 cat conftest.$ac_ext >&5
13936 fi
13937 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13938 fi
13939
13940 fi
13941 echo "$as_me:13941: result: $cf_cv_curses_wacs_symbols" >&5
13942 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
13943
13944 test "$cf_cv_curses_wacs_symbols" != no &&
13945 cat >>confdefs.h <<\EOF
13946 #define CURSES_WACS_SYMBOLS 1
13947 EOF
13948
13949 fi
13950
13951 echo "$as_me:13951: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
13952 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
13953 cat >conftest.$ac_ext <<_ACEOF
13954 #line 13954 "configure"
13955 #include "confdefs.h"
13956
13957 #ifndef _XOPEN_SOURCE_EXTENDED
13958 #define _XOPEN_SOURCE_EXTENDED
13959 #endif
13960 #include <${cf_cv_ncurses_header:-curses.h}>
13961 int
13962 main ()
13963 {
13964
13965 attr_t foo
13966
13967   ;
13968   return 0;
13969 }
13970 _ACEOF
13971 rm -f conftest.$ac_objext
13972 if { (eval echo "$as_me:13972: \"$ac_compile\"") >&5
13973   (eval $ac_compile) 2>&5
13974   ac_status=$?
13975   echo "$as_me:13975: \$? = $ac_status" >&5
13976   (exit $ac_status); } &&
13977          { ac_try='test -s conftest.$ac_objext'
13978   { (eval echo "$as_me:13978: \"$ac_try\"") >&5
13979   (eval $ac_try) 2>&5
13980   ac_status=$?
13981   echo "$as_me:13981: \$? = $ac_status" >&5
13982   (exit $ac_status); }; }; then
13983   cf_result=yes
13984 else
13985   echo "$as_me: failed program was:" >&5
13986 cat conftest.$ac_ext >&5
13987 cf_result=no
13988 fi
13989 rm -f conftest.$ac_objext conftest.$ac_ext
13990 echo "$as_me:13990: result: $cf_result" >&5
13991 echo "${ECHO_T}$cf_result" >&6
13992 if test $cf_result = yes ; then
13993
13994 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13995
13996 cat >>confdefs.h <<EOF
13997 #define $cf_result 1
13998 EOF
13999
14000 else
14001
14002 cat >>confdefs.h <<EOF
14003 #define attr_t long
14004 EOF
14005
14006 fi
14007
14008 if test "$cf_enable_widec" = yes; then
14009
14010 # This is needed on Tru64 5.0 to declare mbstate_t
14011 echo "$as_me:14011: checking if we must include wchar.h to declare mbstate_t" >&5
14012 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
14013 if test "${cf_cv_mbstate_t+set}" = set; then
14014   echo $ECHO_N "(cached) $ECHO_C" >&6
14015 else
14016
14017 cat >conftest.$ac_ext <<_ACEOF
14018 #line 14018 "configure"
14019 #include "confdefs.h"
14020
14021 #include <stdlib.h>
14022 #include <stdarg.h>
14023 #include <stdio.h>
14024 #ifdef HAVE_LIBUTF8_H
14025 #include <libutf8.h>
14026 #endif
14027 int
14028 main ()
14029 {
14030 mbstate_t state
14031   ;
14032   return 0;
14033 }
14034 _ACEOF
14035 rm -f conftest.$ac_objext
14036 if { (eval echo "$as_me:14036: \"$ac_compile\"") >&5
14037   (eval $ac_compile) 2>&5
14038   ac_status=$?
14039   echo "$as_me:14039: \$? = $ac_status" >&5
14040   (exit $ac_status); } &&
14041          { ac_try='test -s conftest.$ac_objext'
14042   { (eval echo "$as_me:14042: \"$ac_try\"") >&5
14043   (eval $ac_try) 2>&5
14044   ac_status=$?
14045   echo "$as_me:14045: \$? = $ac_status" >&5
14046   (exit $ac_status); }; }; then
14047   cf_cv_mbstate_t=no
14048 else
14049   echo "$as_me: failed program was:" >&5
14050 cat conftest.$ac_ext >&5
14051 cat >conftest.$ac_ext <<_ACEOF
14052 #line 14052 "configure"
14053 #include "confdefs.h"
14054
14055 #include <stdlib.h>
14056 #include <stdarg.h>
14057 #include <stdio.h>
14058 #include <wchar.h>
14059 #ifdef HAVE_LIBUTF8_H
14060 #include <libutf8.h>
14061 #endif
14062 int
14063 main ()
14064 {
14065 mbstate_t value
14066   ;
14067   return 0;
14068 }
14069 _ACEOF
14070 rm -f conftest.$ac_objext
14071 if { (eval echo "$as_me:14071: \"$ac_compile\"") >&5
14072   (eval $ac_compile) 2>&5
14073   ac_status=$?
14074   echo "$as_me:14074: \$? = $ac_status" >&5
14075   (exit $ac_status); } &&
14076          { ac_try='test -s conftest.$ac_objext'
14077   { (eval echo "$as_me:14077: \"$ac_try\"") >&5
14078   (eval $ac_try) 2>&5
14079   ac_status=$?
14080   echo "$as_me:14080: \$? = $ac_status" >&5
14081   (exit $ac_status); }; }; then
14082   cf_cv_mbstate_t=yes
14083 else
14084   echo "$as_me: failed program was:" >&5
14085 cat conftest.$ac_ext >&5
14086 cf_cv_mbstate_t=unknown
14087 fi
14088 rm -f conftest.$ac_objext conftest.$ac_ext
14089 fi
14090 rm -f conftest.$ac_objext conftest.$ac_ext
14091 fi
14092 echo "$as_me:14092: result: $cf_cv_mbstate_t" >&5
14093 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
14094
14095 if test "$cf_cv_mbstate_t" = yes ; then
14096
14097 cat >>confdefs.h <<\EOF
14098 #define NEED_WCHAR_H 1
14099 EOF
14100
14101         NEED_WCHAR_H=1
14102 fi
14103
14104 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
14105 if test "$cf_cv_mbstate_t" = unknown ; then
14106         NCURSES_MBSTATE_T=1
14107 fi
14108
14109 # if we find mbstate_t in either place, use substitution to provide a fallback.
14110 if test "$cf_cv_mbstate_t" != unknown ; then
14111         NCURSES_OK_MBSTATE_T=1
14112 fi
14113
14114 # This is needed on Tru64 5.0 to declare wchar_t
14115 echo "$as_me:14115: checking if we must include wchar.h to declare wchar_t" >&5
14116 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
14117 if test "${cf_cv_wchar_t+set}" = set; then
14118   echo $ECHO_N "(cached) $ECHO_C" >&6
14119 else
14120
14121 cat >conftest.$ac_ext <<_ACEOF
14122 #line 14122 "configure"
14123 #include "confdefs.h"
14124
14125 #include <stdlib.h>
14126 #include <stdarg.h>
14127 #include <stdio.h>
14128 #ifdef HAVE_LIBUTF8_H
14129 #include <libutf8.h>
14130 #endif
14131 int
14132 main ()
14133 {
14134 wchar_t state
14135   ;
14136   return 0;
14137 }
14138 _ACEOF
14139 rm -f conftest.$ac_objext
14140 if { (eval echo "$as_me:14140: \"$ac_compile\"") >&5
14141   (eval $ac_compile) 2>&5
14142   ac_status=$?
14143   echo "$as_me:14143: \$? = $ac_status" >&5
14144   (exit $ac_status); } &&
14145          { ac_try='test -s conftest.$ac_objext'
14146   { (eval echo "$as_me:14146: \"$ac_try\"") >&5
14147   (eval $ac_try) 2>&5
14148   ac_status=$?
14149   echo "$as_me:14149: \$? = $ac_status" >&5
14150   (exit $ac_status); }; }; then
14151   cf_cv_wchar_t=no
14152 else
14153   echo "$as_me: failed program was:" >&5
14154 cat conftest.$ac_ext >&5
14155 cat >conftest.$ac_ext <<_ACEOF
14156 #line 14156 "configure"
14157 #include "confdefs.h"
14158
14159 #include <stdlib.h>
14160 #include <stdarg.h>
14161 #include <stdio.h>
14162 #include <wchar.h>
14163 #ifdef HAVE_LIBUTF8_H
14164 #include <libutf8.h>
14165 #endif
14166 int
14167 main ()
14168 {
14169 wchar_t value
14170   ;
14171   return 0;
14172 }
14173 _ACEOF
14174 rm -f conftest.$ac_objext
14175 if { (eval echo "$as_me:14175: \"$ac_compile\"") >&5
14176   (eval $ac_compile) 2>&5
14177   ac_status=$?
14178   echo "$as_me:14178: \$? = $ac_status" >&5
14179   (exit $ac_status); } &&
14180          { ac_try='test -s conftest.$ac_objext'
14181   { (eval echo "$as_me:14181: \"$ac_try\"") >&5
14182   (eval $ac_try) 2>&5
14183   ac_status=$?
14184   echo "$as_me:14184: \$? = $ac_status" >&5
14185   (exit $ac_status); }; }; then
14186   cf_cv_wchar_t=yes
14187 else
14188   echo "$as_me: failed program was:" >&5
14189 cat conftest.$ac_ext >&5
14190 cf_cv_wchar_t=unknown
14191 fi
14192 rm -f conftest.$ac_objext conftest.$ac_ext
14193 fi
14194 rm -f conftest.$ac_objext conftest.$ac_ext
14195 fi
14196 echo "$as_me:14196: result: $cf_cv_wchar_t" >&5
14197 echo "${ECHO_T}$cf_cv_wchar_t" >&6
14198
14199 if test "$cf_cv_wchar_t" = yes ; then
14200
14201 cat >>confdefs.h <<\EOF
14202 #define NEED_WCHAR_H 1
14203 EOF
14204
14205         NEED_WCHAR_H=1
14206 fi
14207
14208 # if we do not find wchar_t in either place, use substitution to provide a fallback.
14209 if test "$cf_cv_wchar_t" = unknown ; then
14210         NCURSES_WCHAR_T=1
14211 fi
14212
14213 # if we find wchar_t in either place, use substitution to provide a fallback.
14214 if test "$cf_cv_wchar_t" != unknown ; then
14215         NCURSES_OK_WCHAR_T=1
14216 fi
14217
14218 # This is needed on Tru64 5.0 to declare wint_t
14219 echo "$as_me:14219: checking if we must include wchar.h to declare wint_t" >&5
14220 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
14221 if test "${cf_cv_wint_t+set}" = set; then
14222   echo $ECHO_N "(cached) $ECHO_C" >&6
14223 else
14224
14225 cat >conftest.$ac_ext <<_ACEOF
14226 #line 14226 "configure"
14227 #include "confdefs.h"
14228
14229 #include <stdlib.h>
14230 #include <stdarg.h>
14231 #include <stdio.h>
14232 #ifdef HAVE_LIBUTF8_H
14233 #include <libutf8.h>
14234 #endif
14235 int
14236 main ()
14237 {
14238 wint_t state
14239   ;
14240   return 0;
14241 }
14242 _ACEOF
14243 rm -f conftest.$ac_objext
14244 if { (eval echo "$as_me:14244: \"$ac_compile\"") >&5
14245   (eval $ac_compile) 2>&5
14246   ac_status=$?
14247   echo "$as_me:14247: \$? = $ac_status" >&5
14248   (exit $ac_status); } &&
14249          { ac_try='test -s conftest.$ac_objext'
14250   { (eval echo "$as_me:14250: \"$ac_try\"") >&5
14251   (eval $ac_try) 2>&5
14252   ac_status=$?
14253   echo "$as_me:14253: \$? = $ac_status" >&5
14254   (exit $ac_status); }; }; then
14255   cf_cv_wint_t=no
14256 else
14257   echo "$as_me: failed program was:" >&5
14258 cat conftest.$ac_ext >&5
14259 cat >conftest.$ac_ext <<_ACEOF
14260 #line 14260 "configure"
14261 #include "confdefs.h"
14262
14263 #include <stdlib.h>
14264 #include <stdarg.h>
14265 #include <stdio.h>
14266 #include <wchar.h>
14267 #ifdef HAVE_LIBUTF8_H
14268 #include <libutf8.h>
14269 #endif
14270 int
14271 main ()
14272 {
14273 wint_t value
14274   ;
14275   return 0;
14276 }
14277 _ACEOF
14278 rm -f conftest.$ac_objext
14279 if { (eval echo "$as_me:14279: \"$ac_compile\"") >&5
14280   (eval $ac_compile) 2>&5
14281   ac_status=$?
14282   echo "$as_me:14282: \$? = $ac_status" >&5
14283   (exit $ac_status); } &&
14284          { ac_try='test -s conftest.$ac_objext'
14285   { (eval echo "$as_me:14285: \"$ac_try\"") >&5
14286   (eval $ac_try) 2>&5
14287   ac_status=$?
14288   echo "$as_me:14288: \$? = $ac_status" >&5
14289   (exit $ac_status); }; }; then
14290   cf_cv_wint_t=yes
14291 else
14292   echo "$as_me: failed program was:" >&5
14293 cat conftest.$ac_ext >&5
14294 cf_cv_wint_t=unknown
14295 fi
14296 rm -f conftest.$ac_objext conftest.$ac_ext
14297 fi
14298 rm -f conftest.$ac_objext conftest.$ac_ext
14299 fi
14300 echo "$as_me:14300: result: $cf_cv_wint_t" >&5
14301 echo "${ECHO_T}$cf_cv_wint_t" >&6
14302
14303 if test "$cf_cv_wint_t" = yes ; then
14304
14305 cat >>confdefs.h <<\EOF
14306 #define NEED_WCHAR_H 1
14307 EOF
14308
14309         NEED_WCHAR_H=1
14310 fi
14311
14312 # if we do not find wint_t in either place, use substitution to provide a fallback.
14313 if test "$cf_cv_wint_t" = unknown ; then
14314         NCURSES_WINT_T=1
14315 fi
14316
14317 # if we find wint_t in either place, use substitution to provide a fallback.
14318 if test "$cf_cv_wint_t" != unknown ; then
14319         NCURSES_OK_WINT_T=1
14320 fi
14321
14322         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
14323
14324 echo "$as_me:14324: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14325 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14326 cat >conftest.$ac_ext <<_ACEOF
14327 #line 14327 "configure"
14328 #include "confdefs.h"
14329
14330 #ifndef _XOPEN_SOURCE_EXTENDED
14331 #define _XOPEN_SOURCE_EXTENDED
14332 #endif
14333 #include <${cf_cv_ncurses_header:-curses.h}>
14334 int
14335 main ()
14336 {
14337
14338 mbstate_t foo
14339
14340   ;
14341   return 0;
14342 }
14343 _ACEOF
14344 rm -f conftest.$ac_objext
14345 if { (eval echo "$as_me:14345: \"$ac_compile\"") >&5
14346   (eval $ac_compile) 2>&5
14347   ac_status=$?
14348   echo "$as_me:14348: \$? = $ac_status" >&5
14349   (exit $ac_status); } &&
14350          { ac_try='test -s conftest.$ac_objext'
14351   { (eval echo "$as_me:14351: \"$ac_try\"") >&5
14352   (eval $ac_try) 2>&5
14353   ac_status=$?
14354   echo "$as_me:14354: \$? = $ac_status" >&5
14355   (exit $ac_status); }; }; then
14356   cf_result=yes
14357 else
14358   echo "$as_me: failed program was:" >&5
14359 cat conftest.$ac_ext >&5
14360 cf_result=no
14361 fi
14362 rm -f conftest.$ac_objext conftest.$ac_ext
14363 echo "$as_me:14363: result: $cf_result" >&5
14364 echo "${ECHO_T}$cf_result" >&6
14365 if test $cf_result = yes ; then
14366
14367 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14368
14369 cat >>confdefs.h <<EOF
14370 #define $cf_result 1
14371 EOF
14372
14373 else
14374
14375 cat >>confdefs.h <<EOF
14376 #define mbstate_t long
14377 EOF
14378
14379 fi
14380
14381         fi
14382
14383         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
14384
14385 echo "$as_me:14385: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14386 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14387 cat >conftest.$ac_ext <<_ACEOF
14388 #line 14388 "configure"
14389 #include "confdefs.h"
14390
14391 #ifndef _XOPEN_SOURCE_EXTENDED
14392 #define _XOPEN_SOURCE_EXTENDED
14393 #endif
14394 #include <${cf_cv_ncurses_header:-curses.h}>
14395 int
14396 main ()
14397 {
14398
14399 wchar_t foo
14400
14401   ;
14402   return 0;
14403 }
14404 _ACEOF
14405 rm -f conftest.$ac_objext
14406 if { (eval echo "$as_me:14406: \"$ac_compile\"") >&5
14407   (eval $ac_compile) 2>&5
14408   ac_status=$?
14409   echo "$as_me:14409: \$? = $ac_status" >&5
14410   (exit $ac_status); } &&
14411          { ac_try='test -s conftest.$ac_objext'
14412   { (eval echo "$as_me:14412: \"$ac_try\"") >&5
14413   (eval $ac_try) 2>&5
14414   ac_status=$?
14415   echo "$as_me:14415: \$? = $ac_status" >&5
14416   (exit $ac_status); }; }; then
14417   cf_result=yes
14418 else
14419   echo "$as_me: failed program was:" >&5
14420 cat conftest.$ac_ext >&5
14421 cf_result=no
14422 fi
14423 rm -f conftest.$ac_objext conftest.$ac_ext
14424 echo "$as_me:14424: result: $cf_result" >&5
14425 echo "${ECHO_T}$cf_result" >&6
14426 if test $cf_result = yes ; then
14427
14428 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14429
14430 cat >>confdefs.h <<EOF
14431 #define $cf_result 1
14432 EOF
14433
14434 else
14435
14436 cat >>confdefs.h <<EOF
14437 #define wchar_t long
14438 EOF
14439
14440 fi
14441
14442         fi
14443
14444         if test "$NCURSES_OK_WINT_T" = 0 ; then
14445
14446 echo "$as_me:14446: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14447 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14448 cat >conftest.$ac_ext <<_ACEOF
14449 #line 14449 "configure"
14450 #include "confdefs.h"
14451
14452 #ifndef _XOPEN_SOURCE_EXTENDED
14453 #define _XOPEN_SOURCE_EXTENDED
14454 #endif
14455 #include <${cf_cv_ncurses_header:-curses.h}>
14456 int
14457 main ()
14458 {
14459
14460 wint_t foo
14461
14462   ;
14463   return 0;
14464 }
14465 _ACEOF
14466 rm -f conftest.$ac_objext
14467 if { (eval echo "$as_me:14467: \"$ac_compile\"") >&5
14468   (eval $ac_compile) 2>&5
14469   ac_status=$?
14470   echo "$as_me:14470: \$? = $ac_status" >&5
14471   (exit $ac_status); } &&
14472          { ac_try='test -s conftest.$ac_objext'
14473   { (eval echo "$as_me:14473: \"$ac_try\"") >&5
14474   (eval $ac_try) 2>&5
14475   ac_status=$?
14476   echo "$as_me:14476: \$? = $ac_status" >&5
14477   (exit $ac_status); }; }; then
14478   cf_result=yes
14479 else
14480   echo "$as_me: failed program was:" >&5
14481 cat conftest.$ac_ext >&5
14482 cf_result=no
14483 fi
14484 rm -f conftest.$ac_objext conftest.$ac_ext
14485 echo "$as_me:14485: result: $cf_result" >&5
14486 echo "${ECHO_T}$cf_result" >&6
14487 if test $cf_result = yes ; then
14488
14489 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14490
14491 cat >>confdefs.h <<EOF
14492 #define $cf_result 1
14493 EOF
14494
14495 else
14496
14497 cat >>confdefs.h <<EOF
14498 #define wint_t long
14499 EOF
14500
14501 fi
14502
14503         fi
14504 fi
14505
14506 echo "$as_me:14506: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
14507 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14508
14509 cat >conftest.$ac_ext <<_ACEOF
14510 #line 14510 "configure"
14511 #include "confdefs.h"
14512
14513 #ifdef HAVE_XCURSES
14514 #include <xcurses.h>
14515 char * XCursesProgramName = "test";
14516 #else
14517 #include <${cf_cv_ncurses_header:-curses.h}>
14518 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14519 #include <ncursesw/term.h>
14520 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14521 #include <ncurses/term.h>
14522 #elif defined(HAVE_TERM_H)
14523 #include <term.h>
14524 #endif
14525 #endif
14526
14527 int
14528 main ()
14529 {
14530
14531 void *foo = &(boolnames)
14532
14533   ;
14534   return 0;
14535 }
14536 _ACEOF
14537 rm -f conftest.$ac_objext
14538 if { (eval echo "$as_me:14538: \"$ac_compile\"") >&5
14539   (eval $ac_compile) 2>&5
14540   ac_status=$?
14541   echo "$as_me:14541: \$? = $ac_status" >&5
14542   (exit $ac_status); } &&
14543          { ac_try='test -s conftest.$ac_objext'
14544   { (eval echo "$as_me:14544: \"$ac_try\"") >&5
14545   (eval $ac_try) 2>&5
14546   ac_status=$?
14547   echo "$as_me:14547: \$? = $ac_status" >&5
14548   (exit $ac_status); }; }; then
14549   cf_result=yes
14550 else
14551   echo "$as_me: failed program was:" >&5
14552 cat conftest.$ac_ext >&5
14553 cf_result=no
14554 fi
14555 rm -f conftest.$ac_objext conftest.$ac_ext
14556 echo "$as_me:14556: result: $cf_result" >&5
14557 echo "${ECHO_T}$cf_result" >&6
14558
14559 if test $cf_result = yes ; then
14560
14561 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14562
14563         cat >>confdefs.h <<EOF
14564 #define $cf_result 1
14565 EOF
14566
14567 else
14568         echo "$as_me:14568: checking for data boolnames in library" >&5
14569 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
14570         # BSD linkers insist on making weak linkage, but resolve at runtime.
14571         if test "$cross_compiling" = yes; then
14572
14573         # cross-compiling
14574         cat >conftest.$ac_ext <<_ACEOF
14575 #line 14575 "configure"
14576 #include "confdefs.h"
14577
14578 #ifdef HAVE_XCURSES
14579 #include <xcurses.h>
14580 char * XCursesProgramName = "test";
14581 #else
14582 #include <${cf_cv_ncurses_header:-curses.h}>
14583 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14584 #include <ncursesw/term.h>
14585 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14586 #include <ncurses/term.h>
14587 #elif defined(HAVE_TERM_H)
14588 #include <term.h>
14589 #endif
14590 #endif
14591
14592 extern char boolnames;
14593 int
14594 main ()
14595 {
14596
14597         do {
14598                 void *foo = &(boolnames);
14599                 ${cf_cv_main_return:-return}(foo == 0);
14600         } while (0)
14601
14602   ;
14603   return 0;
14604 }
14605 _ACEOF
14606 rm -f conftest.$ac_objext conftest$ac_exeext
14607 if { (eval echo "$as_me:14607: \"$ac_link\"") >&5
14608   (eval $ac_link) 2>&5
14609   ac_status=$?
14610   echo "$as_me:14610: \$? = $ac_status" >&5
14611   (exit $ac_status); } &&
14612          { ac_try='test -s conftest$ac_exeext'
14613   { (eval echo "$as_me:14613: \"$ac_try\"") >&5
14614   (eval $ac_try) 2>&5
14615   ac_status=$?
14616   echo "$as_me:14616: \$? = $ac_status" >&5
14617   (exit $ac_status); }; }; then
14618   cf_result=yes
14619 else
14620   echo "$as_me: failed program was:" >&5
14621 cat conftest.$ac_ext >&5
14622 cf_result=no
14623 fi
14624 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14625
14626 else
14627   cat >conftest.$ac_ext <<_ACEOF
14628 #line 14628 "configure"
14629 #include "confdefs.h"
14630
14631 #ifdef HAVE_XCURSES
14632 #include <xcurses.h>
14633 char * XCursesProgramName = "test";
14634 #else
14635 #include <${cf_cv_ncurses_header:-curses.h}>
14636 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14637 #include <ncursesw/term.h>
14638 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14639 #include <ncurses/term.h>
14640 #elif defined(HAVE_TERM_H)
14641 #include <term.h>
14642 #endif
14643 #endif
14644
14645 extern char boolnames;
14646 int main(void)
14647 {
14648         void *foo = &(boolnames);
14649         ${cf_cv_main_return:-return}(foo == 0);
14650 }
14651 _ACEOF
14652 rm -f conftest$ac_exeext
14653 if { (eval echo "$as_me:14653: \"$ac_link\"") >&5
14654   (eval $ac_link) 2>&5
14655   ac_status=$?
14656   echo "$as_me:14656: \$? = $ac_status" >&5
14657   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14658   { (eval echo "$as_me:14658: \"$ac_try\"") >&5
14659   (eval $ac_try) 2>&5
14660   ac_status=$?
14661   echo "$as_me:14661: \$? = $ac_status" >&5
14662   (exit $ac_status); }; }; then
14663   cf_result=yes
14664 else
14665   echo "$as_me: program exited with status $ac_status" >&5
14666 echo "$as_me: failed program was:" >&5
14667 cat conftest.$ac_ext >&5
14668 cf_result=no
14669 fi
14670 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14671 fi
14672         echo "$as_me:14672: result: $cf_result" >&5
14673 echo "${ECHO_T}$cf_result" >&6
14674         if test $cf_result = yes ; then
14675
14676 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14677
14678                 cat >>confdefs.h <<EOF
14679 #define $cf_result 1
14680 EOF
14681
14682         fi
14683 fi
14684
14685 echo "$as_me:14685: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
14686 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14687
14688 cat >conftest.$ac_ext <<_ACEOF
14689 #line 14689 "configure"
14690 #include "confdefs.h"
14691
14692 #ifdef HAVE_XCURSES
14693 #include <xcurses.h>
14694 char * XCursesProgramName = "test";
14695 #else
14696 #include <${cf_cv_ncurses_header:-curses.h}>
14697 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14698 #include <ncursesw/term.h>
14699 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14700 #include <ncurses/term.h>
14701 #elif defined(HAVE_TERM_H)
14702 #include <term.h>
14703 #endif
14704 #endif
14705
14706 int
14707 main ()
14708 {
14709
14710 void *foo = &(boolfnames)
14711
14712   ;
14713   return 0;
14714 }
14715 _ACEOF
14716 rm -f conftest.$ac_objext
14717 if { (eval echo "$as_me:14717: \"$ac_compile\"") >&5
14718   (eval $ac_compile) 2>&5
14719   ac_status=$?
14720   echo "$as_me:14720: \$? = $ac_status" >&5
14721   (exit $ac_status); } &&
14722          { ac_try='test -s conftest.$ac_objext'
14723   { (eval echo "$as_me:14723: \"$ac_try\"") >&5
14724   (eval $ac_try) 2>&5
14725   ac_status=$?
14726   echo "$as_me:14726: \$? = $ac_status" >&5
14727   (exit $ac_status); }; }; then
14728   cf_result=yes
14729 else
14730   echo "$as_me: failed program was:" >&5
14731 cat conftest.$ac_ext >&5
14732 cf_result=no
14733 fi
14734 rm -f conftest.$ac_objext conftest.$ac_ext
14735 echo "$as_me:14735: result: $cf_result" >&5
14736 echo "${ECHO_T}$cf_result" >&6
14737
14738 if test $cf_result = yes ; then
14739
14740 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14741
14742         cat >>confdefs.h <<EOF
14743 #define $cf_result 1
14744 EOF
14745
14746 else
14747         echo "$as_me:14747: checking for data boolfnames in library" >&5
14748 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
14749         # BSD linkers insist on making weak linkage, but resolve at runtime.
14750         if test "$cross_compiling" = yes; then
14751
14752         # cross-compiling
14753         cat >conftest.$ac_ext <<_ACEOF
14754 #line 14754 "configure"
14755 #include "confdefs.h"
14756
14757 #ifdef HAVE_XCURSES
14758 #include <xcurses.h>
14759 char * XCursesProgramName = "test";
14760 #else
14761 #include <${cf_cv_ncurses_header:-curses.h}>
14762 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14763 #include <ncursesw/term.h>
14764 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14765 #include <ncurses/term.h>
14766 #elif defined(HAVE_TERM_H)
14767 #include <term.h>
14768 #endif
14769 #endif
14770
14771 extern char boolfnames;
14772 int
14773 main ()
14774 {
14775
14776         do {
14777                 void *foo = &(boolfnames);
14778                 ${cf_cv_main_return:-return}(foo == 0);
14779         } while (0)
14780
14781   ;
14782   return 0;
14783 }
14784 _ACEOF
14785 rm -f conftest.$ac_objext conftest$ac_exeext
14786 if { (eval echo "$as_me:14786: \"$ac_link\"") >&5
14787   (eval $ac_link) 2>&5
14788   ac_status=$?
14789   echo "$as_me:14789: \$? = $ac_status" >&5
14790   (exit $ac_status); } &&
14791          { ac_try='test -s conftest$ac_exeext'
14792   { (eval echo "$as_me:14792: \"$ac_try\"") >&5
14793   (eval $ac_try) 2>&5
14794   ac_status=$?
14795   echo "$as_me:14795: \$? = $ac_status" >&5
14796   (exit $ac_status); }; }; then
14797   cf_result=yes
14798 else
14799   echo "$as_me: failed program was:" >&5
14800 cat conftest.$ac_ext >&5
14801 cf_result=no
14802 fi
14803 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14804
14805 else
14806   cat >conftest.$ac_ext <<_ACEOF
14807 #line 14807 "configure"
14808 #include "confdefs.h"
14809
14810 #ifdef HAVE_XCURSES
14811 #include <xcurses.h>
14812 char * XCursesProgramName = "test";
14813 #else
14814 #include <${cf_cv_ncurses_header:-curses.h}>
14815 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14816 #include <ncursesw/term.h>
14817 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14818 #include <ncurses/term.h>
14819 #elif defined(HAVE_TERM_H)
14820 #include <term.h>
14821 #endif
14822 #endif
14823
14824 extern char boolfnames;
14825 int main(void)
14826 {
14827         void *foo = &(boolfnames);
14828         ${cf_cv_main_return:-return}(foo == 0);
14829 }
14830 _ACEOF
14831 rm -f conftest$ac_exeext
14832 if { (eval echo "$as_me:14832: \"$ac_link\"") >&5
14833   (eval $ac_link) 2>&5
14834   ac_status=$?
14835   echo "$as_me:14835: \$? = $ac_status" >&5
14836   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14837   { (eval echo "$as_me:14837: \"$ac_try\"") >&5
14838   (eval $ac_try) 2>&5
14839   ac_status=$?
14840   echo "$as_me:14840: \$? = $ac_status" >&5
14841   (exit $ac_status); }; }; then
14842   cf_result=yes
14843 else
14844   echo "$as_me: program exited with status $ac_status" >&5
14845 echo "$as_me: failed program was:" >&5
14846 cat conftest.$ac_ext >&5
14847 cf_result=no
14848 fi
14849 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14850 fi
14851         echo "$as_me:14851: result: $cf_result" >&5
14852 echo "${ECHO_T}$cf_result" >&6
14853         if test $cf_result = yes ; then
14854
14855 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14856
14857                 cat >>confdefs.h <<EOF
14858 #define $cf_result 1
14859 EOF
14860
14861         fi
14862 fi
14863
14864 if ( test "$GCC" = yes || test "$GXX" = yes )
14865 then
14866 echo "$as_me:14866: checking if you want to turn on gcc warnings" >&5
14867 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
14868
14869 # Check whether --enable-warnings or --disable-warnings was given.
14870 if test "${enable_warnings+set}" = set; then
14871   enableval="$enable_warnings"
14872   test "$enableval" != yes && enableval=no
14873   if test "$enableval" != "no" ; then
14874     with_warnings=yes
14875   else
14876     with_warnings=no
14877   fi
14878 else
14879   enableval=no
14880   with_warnings=no
14881
14882 fi;
14883 echo "$as_me:14883: result: $with_warnings" >&5
14884 echo "${ECHO_T}$with_warnings" >&6
14885 if test "$with_warnings" = "yes"
14886 then
14887
14888 if test "$GCC" = yes
14889 then
14890 cat > conftest.i <<EOF
14891 #ifndef GCC_PRINTF
14892 #define GCC_PRINTF 0
14893 #endif
14894 #ifndef GCC_SCANF
14895 #define GCC_SCANF 0
14896 #endif
14897 #ifndef GCC_NORETURN
14898 #define GCC_NORETURN /* nothing */
14899 #endif
14900 #ifndef GCC_UNUSED
14901 #define GCC_UNUSED /* nothing */
14902 #endif
14903 EOF
14904 if test "$GCC" = yes
14905 then
14906         { echo "$as_me:14906: checking for $CC __attribute__ directives..." >&5
14907 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
14908 cat > conftest.$ac_ext <<EOF
14909 #line 14909 "${as_me:-configure}"
14910 #include "confdefs.h"
14911 #include "conftest.h"
14912 #include "conftest.i"
14913 #if     GCC_PRINTF
14914 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
14915 #else
14916 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
14917 #endif
14918 #if     GCC_SCANF
14919 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
14920 #else
14921 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
14922 #endif
14923 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
14924 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
14925 extern void foo(void) GCC_NORETURN;
14926 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
14927 EOF
14928         cf_printf_attribute=no
14929         cf_scanf_attribute=no
14930         for cf_attribute in scanf printf unused noreturn
14931         do
14932
14933 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14934
14935                 cf_directive="__attribute__(($cf_attribute))"
14936                 echo "checking for $CC $cf_directive" 1>&5
14937
14938                 case $cf_attribute in #(vi
14939                 printf) #(vi
14940                         cf_printf_attribute=yes
14941                         cat >conftest.h <<EOF
14942 #define GCC_$cf_ATTRIBUTE 1
14943 EOF
14944                         ;;
14945                 scanf) #(vi
14946                         cf_scanf_attribute=yes
14947                         cat >conftest.h <<EOF
14948 #define GCC_$cf_ATTRIBUTE 1
14949 EOF
14950                         ;;
14951                 *) #(vi
14952                         cat >conftest.h <<EOF
14953 #define GCC_$cf_ATTRIBUTE $cf_directive
14954 EOF
14955                         ;;
14956                 esac
14957
14958                 if { (eval echo "$as_me:14958: \"$ac_compile\"") >&5
14959   (eval $ac_compile) 2>&5
14960   ac_status=$?
14961   echo "$as_me:14961: \$? = $ac_status" >&5
14962   (exit $ac_status); }; then
14963                         test -n "$verbose" && echo "$as_me:14963: result: ... $cf_attribute" >&5
14964 echo "${ECHO_T}... $cf_attribute" >&6
14965                         cat conftest.h >>confdefs.h
14966                         case $cf_attribute in #(vi
14967                         noreturn) #(vi
14968
14969 cat >>confdefs.h <<EOF
14970 #define GCC_NORETURN $cf_directive
14971 EOF
14972
14973                                 ;;
14974                         printf) #(vi
14975                                 cf_value='/* nothing */'
14976                                 if test "$cf_printf_attribute" != no ; then
14977                                         cf_value='__attribute__((format(printf,fmt,var)))'
14978
14979 cat >>confdefs.h <<\EOF
14980 #define GCC_PRINTF 1
14981 EOF
14982
14983                                 fi
14984
14985 cat >>confdefs.h <<EOF
14986 #define GCC_PRINTFLIKE(fmt,var) $cf_value
14987 EOF
14988
14989                                 ;;
14990                         scanf) #(vi
14991                                 cf_value='/* nothing */'
14992                                 if test "$cf_scanf_attribute" != no ; then
14993                                         cf_value='__attribute__((format(scanf,fmt,var)))'
14994
14995 cat >>confdefs.h <<\EOF
14996 #define GCC_SCANF 1
14997 EOF
14998
14999                                 fi
15000
15001 cat >>confdefs.h <<EOF
15002 #define GCC_SCANFLIKE(fmt,var) $cf_value
15003 EOF
15004
15005                                 ;;
15006                         unused) #(vi
15007
15008 cat >>confdefs.h <<EOF
15009 #define GCC_UNUSED $cf_directive
15010 EOF
15011
15012                                 ;;
15013                         esac
15014                 fi
15015         done
15016 else
15017         fgrep define conftest.i >>confdefs.h
15018 fi
15019 rm -rf conftest*
15020 fi
15021
15022 INTEL_COMPILER=no
15023
15024 if test "$GCC" = yes ; then
15025         case $host_os in
15026         linux*|gnu*)
15027                 echo "$as_me:15027: checking if this is really Intel C compiler" >&5
15028 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
15029                 cf_save_CFLAGS="$CFLAGS"
15030                 CFLAGS="$CFLAGS -no-gcc"
15031                 cat >conftest.$ac_ext <<_ACEOF
15032 #line 15032 "configure"
15033 #include "confdefs.h"
15034
15035 int
15036 main ()
15037 {
15038
15039 #ifdef __INTEL_COMPILER
15040 #else
15041 make an error
15042 #endif
15043
15044   ;
15045   return 0;
15046 }
15047 _ACEOF
15048 rm -f conftest.$ac_objext
15049 if { (eval echo "$as_me:15049: \"$ac_compile\"") >&5
15050   (eval $ac_compile) 2>&5
15051   ac_status=$?
15052   echo "$as_me:15052: \$? = $ac_status" >&5
15053   (exit $ac_status); } &&
15054          { ac_try='test -s conftest.$ac_objext'
15055   { (eval echo "$as_me:15055: \"$ac_try\"") >&5
15056   (eval $ac_try) 2>&5
15057   ac_status=$?
15058   echo "$as_me:15058: \$? = $ac_status" >&5
15059   (exit $ac_status); }; }; then
15060   INTEL_COMPILER=yes
15061 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
15062
15063 else
15064   echo "$as_me: failed program was:" >&5
15065 cat conftest.$ac_ext >&5
15066 fi
15067 rm -f conftest.$ac_objext conftest.$ac_ext
15068                 CFLAGS="$cf_save_CFLAGS"
15069                 echo "$as_me:15069: result: $INTEL_COMPILER" >&5
15070 echo "${ECHO_T}$INTEL_COMPILER" >&6
15071                 ;;
15072         esac
15073 fi
15074
15075 CLANG_COMPILER=no
15076
15077 if test "$GCC" = yes ; then
15078         echo "$as_me:15078: checking if this is really Clang C compiler" >&5
15079 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
15080         cf_save_CFLAGS="$CFLAGS"
15081         CFLAGS="$CFLAGS -Qunused-arguments"
15082         cat >conftest.$ac_ext <<_ACEOF
15083 #line 15083 "configure"
15084 #include "confdefs.h"
15085
15086 int
15087 main ()
15088 {
15089
15090 #ifdef __clang__
15091 #else
15092 make an error
15093 #endif
15094
15095   ;
15096   return 0;
15097 }
15098 _ACEOF
15099 rm -f conftest.$ac_objext
15100 if { (eval echo "$as_me:15100: \"$ac_compile\"") >&5
15101   (eval $ac_compile) 2>&5
15102   ac_status=$?
15103   echo "$as_me:15103: \$? = $ac_status" >&5
15104   (exit $ac_status); } &&
15105          { ac_try='test -s conftest.$ac_objext'
15106   { (eval echo "$as_me:15106: \"$ac_try\"") >&5
15107   (eval $ac_try) 2>&5
15108   ac_status=$?
15109   echo "$as_me:15109: \$? = $ac_status" >&5
15110   (exit $ac_status); }; }; then
15111   CLANG_COMPILER=yes
15112 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
15113
15114 else
15115   echo "$as_me: failed program was:" >&5
15116 cat conftest.$ac_ext >&5
15117 fi
15118 rm -f conftest.$ac_objext conftest.$ac_ext
15119         CFLAGS="$cf_save_CFLAGS"
15120         echo "$as_me:15120: result: $CLANG_COMPILER" >&5
15121 echo "${ECHO_T}$CLANG_COMPILER" >&6
15122 fi
15123
15124 cat > conftest.$ac_ext <<EOF
15125 #line 15125 "${as_me:-configure}"
15126 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15127 EOF
15128
15129 if test "$INTEL_COMPILER" = yes
15130 then
15131 # The "-wdXXX" options suppress warnings:
15132 # remark #1419: external declaration in primary source file
15133 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15134 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15135 # remark #193: zero used for undefined preprocessing identifier
15136 # remark #593: variable "curs_sb_left_arrow" was set but never used
15137 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15138 # remark #869: parameter "tw" was never referenced
15139 # remark #981: operands are evaluated in unspecified order
15140 # warning #279: controlling expression is constant
15141
15142         { echo "$as_me:15142: checking for $CC warning options..." >&5
15143 echo "$as_me: checking for $CC warning options..." >&6;}
15144         cf_save_CFLAGS="$CFLAGS"
15145         EXTRA_CFLAGS="-Wall"
15146         for cf_opt in \
15147                 wd1419 \
15148                 wd1683 \
15149                 wd1684 \
15150                 wd193 \
15151                 wd593 \
15152                 wd279 \
15153                 wd810 \
15154                 wd869 \
15155                 wd981
15156         do
15157                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15158                 if { (eval echo "$as_me:15158: \"$ac_compile\"") >&5
15159   (eval $ac_compile) 2>&5
15160   ac_status=$?
15161   echo "$as_me:15161: \$? = $ac_status" >&5
15162   (exit $ac_status); }; then
15163                         test -n "$verbose" && echo "$as_me:15163: result: ... -$cf_opt" >&5
15164 echo "${ECHO_T}... -$cf_opt" >&6
15165                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15166                 fi
15167         done
15168         CFLAGS="$cf_save_CFLAGS"
15169
15170 elif test "$GCC" = yes
15171 then
15172         { echo "$as_me:15172: checking for $CC warning options..." >&5
15173 echo "$as_me: checking for $CC warning options..." >&6;}
15174         cf_save_CFLAGS="$CFLAGS"
15175         EXTRA_CFLAGS=
15176         cf_warn_CONST=""
15177         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15178         for cf_opt in W Wall \
15179                 Wbad-function-cast \
15180                 Wcast-align \
15181                 Wcast-qual \
15182                 Winline \
15183                 Wmissing-declarations \
15184                 Wmissing-prototypes \
15185                 Wnested-externs \
15186                 Wpointer-arith \
15187                 Wshadow \
15188                 Wstrict-prototypes \
15189                 Wundef $cf_warn_CONST
15190         do
15191                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15192                 if { (eval echo "$as_me:15192: \"$ac_compile\"") >&5
15193   (eval $ac_compile) 2>&5
15194   ac_status=$?
15195   echo "$as_me:15195: \$? = $ac_status" >&5
15196   (exit $ac_status); }; then
15197                         test -n "$verbose" && echo "$as_me:15197: result: ... -$cf_opt" >&5
15198 echo "${ECHO_T}... -$cf_opt" >&6
15199                         case $cf_opt in #(vi
15200                         Wcast-qual) #(vi
15201                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
15202                                 ;;
15203                         Winline) #(vi
15204                                 case $GCC_VERSION in
15205                                 [34].*)
15206                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15207
15208 echo "${as_me:-configure}:15208: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15209
15210                                         continue;;
15211                                 esac
15212                                 ;;
15213                         Wpointer-arith) #(vi
15214                                 case $GCC_VERSION in
15215                                 [12].*)
15216                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15217
15218 echo "${as_me:-configure}:15218: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15219
15220                                         continue;;
15221                                 esac
15222                                 ;;
15223                         esac
15224                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15225                 fi
15226         done
15227         CFLAGS="$cf_save_CFLAGS"
15228 fi
15229 rm -rf conftest*
15230
15231 fi
15232 fi
15233
15234 echo "$as_me:15234: checking if you want to use dmalloc for testing" >&5
15235 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
15236
15237 # Check whether --with-dmalloc or --without-dmalloc was given.
15238 if test "${with_dmalloc+set}" = set; then
15239   withval="$with_dmalloc"
15240
15241 cat >>confdefs.h <<EOF
15242 #define USE_DMALLOC 1
15243 EOF
15244
15245         : ${with_cflags:=-g}
15246         : ${with_no_leaks:=yes}
15247          with_dmalloc=yes
15248 else
15249   with_dmalloc=
15250 fi;
15251 echo "$as_me:15251: result: ${with_dmalloc:-no}" >&5
15252 echo "${ECHO_T}${with_dmalloc:-no}" >&6
15253
15254 case .$with_cflags in #(vi
15255 .*-g*)
15256         case .$CFLAGS in #(vi
15257         .*-g*) #(vi
15258                 ;;
15259         *)
15260
15261 cf_fix_cppflags=no
15262 cf_new_cflags=
15263 cf_new_cppflags=
15264 cf_new_extra_cppflags=
15265
15266 for cf_add_cflags in -g
15267 do
15268 case $cf_fix_cppflags in
15269 no)
15270         case $cf_add_cflags in #(vi
15271         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
15272                 case $cf_add_cflags in
15273                 -D*)
15274                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15275
15276                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15277                                 && test -z "${cf_tst_cflags}" \
15278                                 && cf_fix_cppflags=yes
15279
15280                         if test $cf_fix_cppflags = yes ; then
15281                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15282                                 continue
15283                         elif test "${cf_tst_cflags}" = "\"'" ; then
15284                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15285                                 continue
15286                         fi
15287                         ;;
15288                 esac
15289                 case "$CPPFLAGS" in
15290                 *$cf_add_cflags) #(vi
15291                         ;;
15292                 *) #(vi
15293                         case $cf_add_cflags in #(vi
15294                         -D*)
15295                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15296
15297 CPPFLAGS=`echo "$CPPFLAGS" | \
15298         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15299                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15300
15301                                 ;;
15302                         esac
15303                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
15304                         ;;
15305                 esac
15306                 ;;
15307         *)
15308                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
15309                 ;;
15310         esac
15311         ;;
15312 yes)
15313         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15314
15315         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15316
15317         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15318                 && test -z "${cf_tst_cflags}" \
15319                 && cf_fix_cppflags=no
15320         ;;
15321 esac
15322 done
15323
15324 if test -n "$cf_new_cflags" ; then
15325
15326         CFLAGS="$CFLAGS $cf_new_cflags"
15327 fi
15328
15329 if test -n "$cf_new_cppflags" ; then
15330
15331         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
15332 fi
15333
15334 if test -n "$cf_new_extra_cppflags" ; then
15335
15336         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
15337 fi
15338
15339                 ;;
15340         esac
15341         ;;
15342 esac
15343
15344 if test "$with_dmalloc" = yes ; then
15345         echo "$as_me:15345: checking for dmalloc.h" >&5
15346 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
15347 if test "${ac_cv_header_dmalloc_h+set}" = set; then
15348   echo $ECHO_N "(cached) $ECHO_C" >&6
15349 else
15350   cat >conftest.$ac_ext <<_ACEOF
15351 #line 15351 "configure"
15352 #include "confdefs.h"
15353 #include <dmalloc.h>
15354 _ACEOF
15355 if { (eval echo "$as_me:15355: \"$ac_cpp conftest.$ac_ext\"") >&5
15356   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15357   ac_status=$?
15358   egrep -v '^ *\+' conftest.er1 >conftest.err
15359   rm -f conftest.er1
15360   cat conftest.err >&5
15361   echo "$as_me:15361: \$? = $ac_status" >&5
15362   (exit $ac_status); } >/dev/null; then
15363   if test -s conftest.err; then
15364     ac_cpp_err=$ac_c_preproc_warn_flag
15365   else
15366     ac_cpp_err=
15367   fi
15368 else
15369   ac_cpp_err=yes
15370 fi
15371 if test -z "$ac_cpp_err"; then
15372   ac_cv_header_dmalloc_h=yes
15373 else
15374   echo "$as_me: failed program was:" >&5
15375   cat conftest.$ac_ext >&5
15376   ac_cv_header_dmalloc_h=no
15377 fi
15378 rm -f conftest.err conftest.$ac_ext
15379 fi
15380 echo "$as_me:15380: result: $ac_cv_header_dmalloc_h" >&5
15381 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
15382 if test $ac_cv_header_dmalloc_h = yes; then
15383
15384 echo "$as_me:15384: checking for dmalloc_debug in -ldmalloc" >&5
15385 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
15386 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
15387   echo $ECHO_N "(cached) $ECHO_C" >&6
15388 else
15389   ac_check_lib_save_LIBS=$LIBS
15390 LIBS="-ldmalloc  $LIBS"
15391 cat >conftest.$ac_ext <<_ACEOF
15392 #line 15392 "configure"
15393 #include "confdefs.h"
15394
15395 /* Override any gcc2 internal prototype to avoid an error.  */
15396 #ifdef __cplusplus
15397 extern "C"
15398 #endif
15399 /* We use char because int might match the return type of a gcc2
15400    builtin and then its argument prototype would still apply.  */
15401 char dmalloc_debug ();
15402 int
15403 main ()
15404 {
15405 dmalloc_debug ();
15406   ;
15407   return 0;
15408 }
15409 _ACEOF
15410 rm -f conftest.$ac_objext conftest$ac_exeext
15411 if { (eval echo "$as_me:15411: \"$ac_link\"") >&5
15412   (eval $ac_link) 2>&5
15413   ac_status=$?
15414   echo "$as_me:15414: \$? = $ac_status" >&5
15415   (exit $ac_status); } &&
15416          { ac_try='test -s conftest$ac_exeext'
15417   { (eval echo "$as_me:15417: \"$ac_try\"") >&5
15418   (eval $ac_try) 2>&5
15419   ac_status=$?
15420   echo "$as_me:15420: \$? = $ac_status" >&5
15421   (exit $ac_status); }; }; then
15422   ac_cv_lib_dmalloc_dmalloc_debug=yes
15423 else
15424   echo "$as_me: failed program was:" >&5
15425 cat conftest.$ac_ext >&5
15426 ac_cv_lib_dmalloc_dmalloc_debug=no
15427 fi
15428 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15429 LIBS=$ac_check_lib_save_LIBS
15430 fi
15431 echo "$as_me:15431: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
15432 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
15433 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
15434   cat >>confdefs.h <<EOF
15435 #define HAVE_LIBDMALLOC 1
15436 EOF
15437
15438   LIBS="-ldmalloc $LIBS"
15439
15440 fi
15441
15442 fi
15443
15444 fi
15445
15446 echo "$as_me:15446: checking if you want to use dbmalloc for testing" >&5
15447 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
15448
15449 # Check whether --with-dbmalloc or --without-dbmalloc was given.
15450 if test "${with_dbmalloc+set}" = set; then
15451   withval="$with_dbmalloc"
15452
15453 cat >>confdefs.h <<EOF
15454 #define USE_DBMALLOC 1
15455 EOF
15456
15457         : ${with_cflags:=-g}
15458         : ${with_no_leaks:=yes}
15459          with_dbmalloc=yes
15460 else
15461   with_dbmalloc=
15462 fi;
15463 echo "$as_me:15463: result: ${with_dbmalloc:-no}" >&5
15464 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
15465
15466 case .$with_cflags in #(vi
15467 .*-g*)
15468         case .$CFLAGS in #(vi
15469         .*-g*) #(vi
15470                 ;;
15471         *)
15472
15473 cf_fix_cppflags=no
15474 cf_new_cflags=
15475 cf_new_cppflags=
15476 cf_new_extra_cppflags=
15477
15478 for cf_add_cflags in -g
15479 do
15480 case $cf_fix_cppflags in
15481 no)
15482         case $cf_add_cflags in #(vi
15483         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
15484                 case $cf_add_cflags in
15485                 -D*)
15486                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15487
15488                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15489                                 && test -z "${cf_tst_cflags}" \
15490                                 && cf_fix_cppflags=yes
15491
15492                         if test $cf_fix_cppflags = yes ; then
15493                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15494                                 continue
15495                         elif test "${cf_tst_cflags}" = "\"'" ; then
15496                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15497                                 continue
15498                         fi
15499                         ;;
15500                 esac
15501                 case "$CPPFLAGS" in
15502                 *$cf_add_cflags) #(vi
15503                         ;;
15504                 *) #(vi
15505                         case $cf_add_cflags in #(vi
15506                         -D*)
15507                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15508
15509 CPPFLAGS=`echo "$CPPFLAGS" | \
15510         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15511                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15512
15513                                 ;;
15514                         esac
15515                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
15516                         ;;
15517                 esac
15518                 ;;
15519         *)
15520                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
15521                 ;;
15522         esac
15523         ;;
15524 yes)
15525         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15526
15527         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15528
15529         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15530                 && test -z "${cf_tst_cflags}" \
15531                 && cf_fix_cppflags=no
15532         ;;
15533 esac
15534 done
15535
15536 if test -n "$cf_new_cflags" ; then
15537
15538         CFLAGS="$CFLAGS $cf_new_cflags"
15539 fi
15540
15541 if test -n "$cf_new_cppflags" ; then
15542
15543         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
15544 fi
15545
15546 if test -n "$cf_new_extra_cppflags" ; then
15547
15548         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
15549 fi
15550
15551                 ;;
15552         esac
15553         ;;
15554 esac
15555
15556 if test "$with_dbmalloc" = yes ; then
15557         echo "$as_me:15557: checking for dbmalloc.h" >&5
15558 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
15559 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
15560   echo $ECHO_N "(cached) $ECHO_C" >&6
15561 else
15562   cat >conftest.$ac_ext <<_ACEOF
15563 #line 15563 "configure"
15564 #include "confdefs.h"
15565 #include <dbmalloc.h>
15566 _ACEOF
15567 if { (eval echo "$as_me:15567: \"$ac_cpp conftest.$ac_ext\"") >&5
15568   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15569   ac_status=$?
15570   egrep -v '^ *\+' conftest.er1 >conftest.err
15571   rm -f conftest.er1
15572   cat conftest.err >&5
15573   echo "$as_me:15573: \$? = $ac_status" >&5
15574   (exit $ac_status); } >/dev/null; then
15575   if test -s conftest.err; then
15576     ac_cpp_err=$ac_c_preproc_warn_flag
15577   else
15578     ac_cpp_err=
15579   fi
15580 else
15581   ac_cpp_err=yes
15582 fi
15583 if test -z "$ac_cpp_err"; then
15584   ac_cv_header_dbmalloc_h=yes
15585 else
15586   echo "$as_me: failed program was:" >&5
15587   cat conftest.$ac_ext >&5
15588   ac_cv_header_dbmalloc_h=no
15589 fi
15590 rm -f conftest.err conftest.$ac_ext
15591 fi
15592 echo "$as_me:15592: result: $ac_cv_header_dbmalloc_h" >&5
15593 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
15594 if test $ac_cv_header_dbmalloc_h = yes; then
15595
15596 echo "$as_me:15596: checking for debug_malloc in -ldbmalloc" >&5
15597 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
15598 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
15599   echo $ECHO_N "(cached) $ECHO_C" >&6
15600 else
15601   ac_check_lib_save_LIBS=$LIBS
15602 LIBS="-ldbmalloc  $LIBS"
15603 cat >conftest.$ac_ext <<_ACEOF
15604 #line 15604 "configure"
15605 #include "confdefs.h"
15606
15607 /* Override any gcc2 internal prototype to avoid an error.  */
15608 #ifdef __cplusplus
15609 extern "C"
15610 #endif
15611 /* We use char because int might match the return type of a gcc2
15612    builtin and then its argument prototype would still apply.  */
15613 char debug_malloc ();
15614 int
15615 main ()
15616 {
15617 debug_malloc ();
15618   ;
15619   return 0;
15620 }
15621 _ACEOF
15622 rm -f conftest.$ac_objext conftest$ac_exeext
15623 if { (eval echo "$as_me:15623: \"$ac_link\"") >&5
15624   (eval $ac_link) 2>&5
15625   ac_status=$?
15626   echo "$as_me:15626: \$? = $ac_status" >&5
15627   (exit $ac_status); } &&
15628          { ac_try='test -s conftest$ac_exeext'
15629   { (eval echo "$as_me:15629: \"$ac_try\"") >&5
15630   (eval $ac_try) 2>&5
15631   ac_status=$?
15632   echo "$as_me:15632: \$? = $ac_status" >&5
15633   (exit $ac_status); }; }; then
15634   ac_cv_lib_dbmalloc_debug_malloc=yes
15635 else
15636   echo "$as_me: failed program was:" >&5
15637 cat conftest.$ac_ext >&5
15638 ac_cv_lib_dbmalloc_debug_malloc=no
15639 fi
15640 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15641 LIBS=$ac_check_lib_save_LIBS
15642 fi
15643 echo "$as_me:15643: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
15644 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
15645 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
15646   cat >>confdefs.h <<EOF
15647 #define HAVE_LIBDBMALLOC 1
15648 EOF
15649
15650   LIBS="-ldbmalloc $LIBS"
15651
15652 fi
15653
15654 fi
15655
15656 fi
15657
15658 echo "$as_me:15658: checking if you want to use valgrind for testing" >&5
15659 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
15660
15661 # Check whether --with-valgrind or --without-valgrind was given.
15662 if test "${with_valgrind+set}" = set; then
15663   withval="$with_valgrind"
15664
15665 cat >>confdefs.h <<EOF
15666 #define USE_VALGRIND 1
15667 EOF
15668
15669         : ${with_cflags:=-g}
15670         : ${with_no_leaks:=yes}
15671          with_valgrind=yes
15672 else
15673   with_valgrind=
15674 fi;
15675 echo "$as_me:15675: result: ${with_valgrind:-no}" >&5
15676 echo "${ECHO_T}${with_valgrind:-no}" >&6
15677
15678 case .$with_cflags in #(vi
15679 .*-g*)
15680         case .$CFLAGS in #(vi
15681         .*-g*) #(vi
15682                 ;;
15683         *)
15684
15685 cf_fix_cppflags=no
15686 cf_new_cflags=
15687 cf_new_cppflags=
15688 cf_new_extra_cppflags=
15689
15690 for cf_add_cflags in -g
15691 do
15692 case $cf_fix_cppflags in
15693 no)
15694         case $cf_add_cflags in #(vi
15695         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
15696                 case $cf_add_cflags in
15697                 -D*)
15698                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15699
15700                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15701                                 && test -z "${cf_tst_cflags}" \
15702                                 && cf_fix_cppflags=yes
15703
15704                         if test $cf_fix_cppflags = yes ; then
15705                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15706                                 continue
15707                         elif test "${cf_tst_cflags}" = "\"'" ; then
15708                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15709                                 continue
15710                         fi
15711                         ;;
15712                 esac
15713                 case "$CPPFLAGS" in
15714                 *$cf_add_cflags) #(vi
15715                         ;;
15716                 *) #(vi
15717                         case $cf_add_cflags in #(vi
15718                         -D*)
15719                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15720
15721 CPPFLAGS=`echo "$CPPFLAGS" | \
15722         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15723                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15724
15725                                 ;;
15726                         esac
15727                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
15728                         ;;
15729                 esac
15730                 ;;
15731         *)
15732                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
15733                 ;;
15734         esac
15735         ;;
15736 yes)
15737         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15738
15739         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15740
15741         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15742                 && test -z "${cf_tst_cflags}" \
15743                 && cf_fix_cppflags=no
15744         ;;
15745 esac
15746 done
15747
15748 if test -n "$cf_new_cflags" ; then
15749
15750         CFLAGS="$CFLAGS $cf_new_cflags"
15751 fi
15752
15753 if test -n "$cf_new_cppflags" ; then
15754
15755         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
15756 fi
15757
15758 if test -n "$cf_new_extra_cppflags" ; then
15759
15760         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
15761 fi
15762
15763                 ;;
15764         esac
15765         ;;
15766 esac
15767
15768 echo "$as_me:15768: checking if you want to perform memory-leak testing" >&5
15769 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
15770
15771 # Check whether --enable-leaks or --disable-leaks was given.
15772 if test "${enable_leaks+set}" = set; then
15773   enableval="$enable_leaks"
15774   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
15775 else
15776   : ${with_no_leaks:=no}
15777 fi;
15778 echo "$as_me:15778: result: $with_no_leaks" >&5
15779 echo "${ECHO_T}$with_no_leaks" >&6
15780
15781 if test "$with_no_leaks" = yes ; then
15782
15783 cat >>confdefs.h <<\EOF
15784 #define NO_LEAKS 1
15785 EOF
15786
15787 cat >>confdefs.h <<\EOF
15788 #define YY_NO_LEAKS 1
15789 EOF
15790
15791 fi
15792
15793 LD_RPATH_OPT=
15794 echo "$as_me:15794: checking for an rpath option" >&5
15795 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
15796 case $cf_cv_system_name in #(vi
15797 irix*) #(vi
15798         if test "$GCC" = yes; then
15799                 LD_RPATH_OPT="-Wl,-rpath,"
15800         else
15801                 LD_RPATH_OPT="-rpath "
15802         fi
15803         ;;
15804 linux*|gnu*|k*bsd*-gnu) #(vi
15805         LD_RPATH_OPT="-Wl,-rpath,"
15806         ;;
15807 openbsd[2-9].*|mirbsd*) #(vi
15808         LD_RPATH_OPT="-Wl,-rpath,"
15809         ;;
15810 dragonfly*|freebsd*) #(vi
15811         LD_RPATH_OPT="-rpath "
15812         ;;
15813 netbsd*) #(vi
15814         LD_RPATH_OPT="-Wl,-rpath,"
15815         ;;
15816 osf*|mls+*) #(vi
15817         LD_RPATH_OPT="-rpath "
15818         ;;
15819 solaris2*) #(vi
15820         LD_RPATH_OPT="-R"
15821         ;;
15822 *)
15823         ;;
15824 esac
15825 echo "$as_me:15825: result: $LD_RPATH_OPT" >&5
15826 echo "${ECHO_T}$LD_RPATH_OPT" >&6
15827
15828 case "x$LD_RPATH_OPT" in #(vi
15829 x-R*)
15830         echo "$as_me:15830: checking if we need a space after rpath option" >&5
15831 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
15832         cf_save_LIBS="$LIBS"
15833         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
15834         cat >conftest.$ac_ext <<_ACEOF
15835 #line 15835 "configure"
15836 #include "confdefs.h"
15837
15838 int
15839 main ()
15840 {
15841
15842   ;
15843   return 0;
15844 }
15845 _ACEOF
15846 rm -f conftest.$ac_objext conftest$ac_exeext
15847 if { (eval echo "$as_me:15847: \"$ac_link\"") >&5
15848   (eval $ac_link) 2>&5
15849   ac_status=$?
15850   echo "$as_me:15850: \$? = $ac_status" >&5
15851   (exit $ac_status); } &&
15852          { ac_try='test -s conftest$ac_exeext'
15853   { (eval echo "$as_me:15853: \"$ac_try\"") >&5
15854   (eval $ac_try) 2>&5
15855   ac_status=$?
15856   echo "$as_me:15856: \$? = $ac_status" >&5
15857   (exit $ac_status); }; }; then
15858   cf_rpath_space=no
15859 else
15860   echo "$as_me: failed program was:" >&5
15861 cat conftest.$ac_ext >&5
15862 cf_rpath_space=yes
15863 fi
15864 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15865         LIBS="$cf_save_LIBS"
15866         echo "$as_me:15866: result: $cf_rpath_space" >&5
15867 echo "${ECHO_T}$cf_rpath_space" >&6
15868         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
15869         ;;
15870 esac
15871
15872 echo "$as_me:15872: checking if rpath-hack should be disabled" >&5
15873 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
15874
15875 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
15876 if test "${enable_rpath_hack+set}" = set; then
15877   enableval="$enable_rpath_hack"
15878   test "$enableval" != no && enableval=yes
15879   if test "$enableval" != "yes" ; then
15880     cf_disable_rpath_hack=yes
15881   else
15882     cf_disable_rpath_hack=no
15883   fi
15884 else
15885   enableval=yes
15886   cf_disable_rpath_hack=no
15887
15888 fi;
15889 echo "$as_me:15889: result: $cf_disable_rpath_hack" >&5
15890 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
15891 if test "$cf_disable_rpath_hack" = no ; then
15892
15893 echo "$as_me:15893: checking for updated LDFLAGS" >&5
15894 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
15895 if test -n "$LD_RPATH_OPT" ; then
15896         echo "$as_me:15896: result: maybe" >&5
15897 echo "${ECHO_T}maybe" >&6
15898
15899         for ac_prog in ldd
15900 do
15901   # Extract the first word of "$ac_prog", so it can be a program name with args.
15902 set dummy $ac_prog; ac_word=$2
15903 echo "$as_me:15903: checking for $ac_word" >&5
15904 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15905 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
15906   echo $ECHO_N "(cached) $ECHO_C" >&6
15907 else
15908   if test -n "$cf_ldd_prog"; then
15909   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
15910 else
15911   ac_save_IFS=$IFS; IFS=$ac_path_separator
15912 ac_dummy="$PATH"
15913 for ac_dir in $ac_dummy; do
15914   IFS=$ac_save_IFS
15915   test -z "$ac_dir" && ac_dir=.
15916   $as_executable_p "$ac_dir/$ac_word" || continue
15917 ac_cv_prog_cf_ldd_prog="$ac_prog"
15918 echo "$as_me:15918: found $ac_dir/$ac_word" >&5
15919 break
15920 done
15921
15922 fi
15923 fi
15924 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
15925 if test -n "$cf_ldd_prog"; then
15926   echo "$as_me:15926: result: $cf_ldd_prog" >&5
15927 echo "${ECHO_T}$cf_ldd_prog" >&6
15928 else
15929   echo "$as_me:15929: result: no" >&5
15930 echo "${ECHO_T}no" >&6
15931 fi
15932
15933   test -n "$cf_ldd_prog" && break
15934 done
15935 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
15936
15937         cf_rpath_list="/usr/lib /lib"
15938         if test "$cf_ldd_prog" != no
15939         then
15940                 cf_rpath_oops=
15941
15942 cat >conftest.$ac_ext <<_ACEOF
15943 #line 15943 "configure"
15944 #include "confdefs.h"
15945 #include <stdio.h>
15946 int
15947 main ()
15948 {
15949 printf("Hello");
15950   ;
15951   return 0;
15952 }
15953 _ACEOF
15954 rm -f conftest.$ac_objext conftest$ac_exeext
15955 if { (eval echo "$as_me:15955: \"$ac_link\"") >&5
15956   (eval $ac_link) 2>&5
15957   ac_status=$?
15958   echo "$as_me:15958: \$? = $ac_status" >&5
15959   (exit $ac_status); } &&
15960          { ac_try='test -s conftest$ac_exeext'
15961   { (eval echo "$as_me:15961: \"$ac_try\"") >&5
15962   (eval $ac_try) 2>&5
15963   ac_status=$?
15964   echo "$as_me:15964: \$? = $ac_status" >&5
15965   (exit $ac_status); }; }; then
15966   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u`
15967                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort -u`
15968 else
15969   echo "$as_me: failed program was:" >&5
15970 cat conftest.$ac_ext >&5
15971 fi
15972 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15973
15974                 # If we passed the link-test, but get a "not found" on a given library,
15975                 # this could be due to inept reconfiguration of gcc to make it only
15976                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
15977                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
15978                 # /usr/local libraries.
15979                 if test -n "$cf_rpath_oops"
15980                 then
15981                         for cf_rpath_src in $cf_rpath_oops
15982                         do
15983                                 for cf_rpath_dir in \
15984                                         /usr/local \
15985                                         /usr/pkg \
15986                                         /opt/sfw
15987                                 do
15988                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
15989                                         then
15990                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
15991
15992 echo "${as_me:-configure}:15992: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
15993
15994                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
15995                                                 break
15996                                         fi
15997                                 done
15998                         done
15999                 fi
16000         fi
16001
16002         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16003
16004 echo "${as_me:-configure}:16004: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16005
16006 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
16007
16008 echo "${as_me:-configure}:16008: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
16009
16010 cf_rpath_dst=
16011 for cf_rpath_src in $LDFLAGS
16012 do
16013         case $cf_rpath_src in #(vi
16014         -L*) #(vi
16015
16016                 # check if this refers to a directory which we will ignore
16017                 cf_rpath_skip=no
16018                 if test -n "$cf_rpath_list"
16019                 then
16020                         for cf_rpath_item in $cf_rpath_list
16021                         do
16022                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16023                                 then
16024                                         cf_rpath_skip=yes
16025                                         break
16026                                 fi
16027                         done
16028                 fi
16029
16030                 if test "$cf_rpath_skip" = no
16031                 then
16032                         # transform the option
16033                         if test "$LD_RPATH_OPT" = "-R " ; then
16034                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16035                         else
16036                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16037                         fi
16038
16039                         # if we have not already added this, add it now
16040                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16041                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16042                         then
16043                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16044
16045 echo "${as_me:-configure}:16045: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16046
16047                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16048                         fi
16049                 fi
16050                 ;;
16051         esac
16052         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16053 done
16054 LDFLAGS=$cf_rpath_dst
16055
16056 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
16057
16058 echo "${as_me:-configure}:16058: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
16059
16060 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
16061
16062 echo "${as_me:-configure}:16062: testing ...checking LIBS $LIBS ..." 1>&5
16063
16064 cf_rpath_dst=
16065 for cf_rpath_src in $LIBS
16066 do
16067         case $cf_rpath_src in #(vi
16068         -L*) #(vi
16069
16070                 # check if this refers to a directory which we will ignore
16071                 cf_rpath_skip=no
16072                 if test -n "$cf_rpath_list"
16073                 then
16074                         for cf_rpath_item in $cf_rpath_list
16075                         do
16076                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16077                                 then
16078                                         cf_rpath_skip=yes
16079                                         break
16080                                 fi
16081                         done
16082                 fi
16083
16084                 if test "$cf_rpath_skip" = no
16085                 then
16086                         # transform the option
16087                         if test "$LD_RPATH_OPT" = "-R " ; then
16088                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16089                         else
16090                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16091                         fi
16092
16093                         # if we have not already added this, add it now
16094                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16095                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16096                         then
16097                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16098
16099 echo "${as_me:-configure}:16099: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16100
16101                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16102                         fi
16103                 fi
16104                 ;;
16105         esac
16106         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16107 done
16108 LIBS=$cf_rpath_dst
16109
16110 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
16111
16112 echo "${as_me:-configure}:16112: testing ...checked LIBS $LIBS ..." 1>&5
16113
16114         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16115
16116 echo "${as_me:-configure}:16116: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16117
16118 fi
16119
16120 fi
16121
16122 TEST_ARGS="$LIBS"
16123 LIBS=
16124
16125 ac_config_files="$ac_config_files Makefile"
16126 ac_config_commands="$ac_config_commands default"
16127 cat >confcache <<\_ACEOF
16128 # This file is a shell script that caches the results of configure
16129 # tests run on this system so they can be shared between configure
16130 # scripts and configure runs, see configure's option --config-cache.
16131 # It is not useful on other systems.  If it contains results you don't
16132 # want to keep, you may remove or edit it.
16133 #
16134 # config.status only pays attention to the cache file if you give it
16135 # the --recheck option to rerun configure.
16136 #
16137 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16138 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16139 # following values.
16140
16141 _ACEOF
16142
16143 # The following way of writing the cache mishandles newlines in values,
16144 # but we know of no workaround that is simple, portable, and efficient.
16145 # So, don't put newlines in cache variables' values.
16146 # Ultrix sh set writes to stderr and can't be redirected directly,
16147 # and sets the high bit in the cache file unless we assign to the vars.
16148 {
16149   (set) 2>&1 |
16150     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16151     *ac_space=\ *)
16152       # `set' does not quote correctly, so add quotes (double-quote
16153       # substitution turns \\\\ into \\, and sed turns \\ into \).
16154       sed -n \
16155         "s/'/'\\\\''/g;
16156           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16157       ;;
16158     *)
16159       # `set' quotes correctly as required by POSIX, so do not add quotes.
16160       sed -n \
16161         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16162       ;;
16163     esac;
16164 } |
16165   sed '
16166      t clear
16167      : clear
16168      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16169      t end
16170      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16171      : end' >>confcache
16172 if cmp -s $cache_file confcache; then :; else
16173   if test -w $cache_file; then
16174     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16175     cat confcache >$cache_file
16176   else
16177     echo "not updating unwritable cache $cache_file"
16178   fi
16179 fi
16180 rm -f confcache
16181
16182 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16183 # Let make expand exec_prefix.
16184 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16185
16186 # VPATH may cause trouble with some makes, so we remove $(srcdir),
16187 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
16188 # trailing colons and then remove the whole line if VPATH becomes empty
16189 # (actually we leave an empty line to preserve line numbers).
16190 if test "x$srcdir" = x.; then
16191   ac_vpsub='/^[         ]*VPATH[        ]*=/{
16192 s/:*\$(srcdir):*/:/;
16193 s/:*\${srcdir}:*/:/;
16194 s/:*@srcdir@:*/:/;
16195 s/^\([^=]*=[    ]*\):*/\1/;
16196 s/:*$//;
16197 s/^[^=]*=[      ]*$//;
16198 }'
16199 fi
16200
16201 DEFS=-DHAVE_CONFIG_H
16202
16203 : ${CONFIG_STATUS=./config.status}
16204 ac_clean_files_save=$ac_clean_files
16205 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16206 { echo "$as_me:16206: creating $CONFIG_STATUS" >&5
16207 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16208 cat >$CONFIG_STATUS <<_ACEOF
16209 #! $SHELL
16210 # Generated automatically by configure.
16211 # Run this file to recreate the current configuration.
16212 # Compiler output produced by configure, useful for debugging
16213 # configure, is in config.log if it exists.
16214
16215 debug=false
16216 SHELL=\${CONFIG_SHELL-$SHELL}
16217 ac_cs_invocation="\$0 \$@"
16218
16219 _ACEOF
16220
16221 cat >>$CONFIG_STATUS <<\_ACEOF
16222 # Be Bourne compatible
16223 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16224   emulate sh
16225   NULLCMD=:
16226 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16227   set -o posix
16228 fi
16229
16230 # Name of the executable.
16231 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16232
16233 if expr a : '\(a\)' >/dev/null 2>&1; then
16234   as_expr=expr
16235 else
16236   as_expr=false
16237 fi
16238
16239 rm -f conf$$ conf$$.exe conf$$.file
16240 echo >conf$$.file
16241 if ln -s conf$$.file conf$$ 2>/dev/null; then
16242   # We could just check for DJGPP; but this test a) works b) is more generic
16243   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16244   if test -f conf$$.exe; then
16245     # Don't use ln at all; we don't have any links
16246     as_ln_s='cp -p'
16247   else
16248     as_ln_s='ln -s'
16249   fi
16250 elif ln conf$$.file conf$$ 2>/dev/null; then
16251   as_ln_s=ln
16252 else
16253   as_ln_s='cp -p'
16254 fi
16255 rm -f conf$$ conf$$.exe conf$$.file
16256
16257 as_executable_p="test -f"
16258
16259 # Support unset when possible.
16260 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16261   as_unset=unset
16262 else
16263   as_unset=false
16264 fi
16265
16266 # NLS nuisances.
16267 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16268 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16269 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16270 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16271 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16272 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16273 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16274 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16275
16276 # IFS
16277 # We need space, tab and new line, in precisely that order.
16278 as_nl='
16279 '
16280 IFS="   $as_nl"
16281
16282 # CDPATH.
16283 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16284
16285 exec 6>&1
16286
16287 _ACEOF
16288
16289 # Files that config.status was made for.
16290 if test -n "$ac_config_files"; then
16291   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16292 fi
16293
16294 if test -n "$ac_config_headers"; then
16295   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16296 fi
16297
16298 if test -n "$ac_config_links"; then
16299   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16300 fi
16301
16302 if test -n "$ac_config_commands"; then
16303   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16304 fi
16305
16306 cat >>$CONFIG_STATUS <<\EOF
16307
16308 ac_cs_usage="\
16309 \`$as_me' instantiates files from templates according to the
16310 current configuration.
16311
16312 Usage: $0 [OPTIONS] [FILE]...
16313
16314   -h, --help       print this help, then exit
16315   -V, --version    print version number, then exit
16316   -d, --debug      don't remove temporary files
16317       --recheck    update $as_me by reconfiguring in the same conditions
16318   --file=FILE[:TEMPLATE]
16319                    instantiate the configuration file FILE
16320   --header=FILE[:TEMPLATE]
16321                    instantiate the configuration header FILE
16322
16323 Configuration files:
16324 $config_files
16325
16326 Configuration headers:
16327 $config_headers
16328
16329 Configuration commands:
16330 $config_commands
16331
16332 Report bugs to <dickey@invisible-island.net>."
16333 EOF
16334
16335 cat >>$CONFIG_STATUS <<EOF
16336 ac_cs_version="\\
16337 config.status
16338 configured by $0, generated by GNU Autoconf 2.52.20121002,
16339   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16340
16341 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16342 Free Software Foundation, Inc.
16343 This config.status script is free software; the Free Software Foundation
16344 gives unlimited permission to copy, distribute and modify it."
16345 srcdir=$srcdir
16346 INSTALL="$INSTALL"
16347 EOF
16348
16349 cat >>$CONFIG_STATUS <<\EOF
16350 # If no file are specified by the user, then we need to provide default
16351 # value.  By we need to know if files were specified by the user.
16352 ac_need_defaults=:
16353 while test $# != 0
16354 do
16355   case $1 in
16356   --*=*)
16357     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16358     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16359     shift
16360     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16361     shift
16362     ;;
16363   -*);;
16364   *) # This is not an option, so the user has probably given explicit
16365      # arguments.
16366      ac_need_defaults=false;;
16367   esac
16368
16369   case $1 in
16370   # Handling of the options.
16371 EOF
16372 cat >>$CONFIG_STATUS <<EOF
16373   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16374     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16375     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16376 EOF
16377 cat >>$CONFIG_STATUS <<\EOF
16378   --version | --vers* | -V )
16379     echo "$ac_cs_version"; exit 0 ;;
16380   --he | --h)
16381     # Conflict between --help and --header
16382     { { echo "$as_me:16382: error: ambiguous option: $1
16383 Try \`$0 --help' for more information." >&5
16384 echo "$as_me: error: ambiguous option: $1
16385 Try \`$0 --help' for more information." >&2;}
16386    { (exit 1); exit 1; }; };;
16387   --help | --hel | -h )
16388     echo "$ac_cs_usage"; exit 0 ;;
16389   --debug | --d* | -d )
16390     debug=: ;;
16391   --file | --fil | --fi | --f )
16392     shift
16393     CONFIG_FILES="$CONFIG_FILES $1"
16394     ac_need_defaults=false;;
16395   --header | --heade | --head | --hea )
16396     shift
16397     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16398     ac_need_defaults=false;;
16399
16400   # This is an error.
16401   -*) { { echo "$as_me:16401: error: unrecognized option: $1
16402 Try \`$0 --help' for more information." >&5
16403 echo "$as_me: error: unrecognized option: $1
16404 Try \`$0 --help' for more information." >&2;}
16405    { (exit 1); exit 1; }; } ;;
16406
16407   *) ac_config_targets="$ac_config_targets $1" ;;
16408
16409   esac
16410   shift
16411 done
16412
16413 exec 5>>config.log
16414 cat >&5 << _ACEOF
16415
16416 ## ----------------------- ##
16417 ## Running config.status.  ##
16418 ## ----------------------- ##
16419
16420 This file was extended by $as_me 2.52.20121002, executed with
16421   CONFIG_FILES    = $CONFIG_FILES
16422   CONFIG_HEADERS  = $CONFIG_HEADERS
16423   CONFIG_LINKS    = $CONFIG_LINKS
16424   CONFIG_COMMANDS = $CONFIG_COMMANDS
16425   > $ac_cs_invocation
16426 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16427
16428 _ACEOF
16429 EOF
16430
16431 cat >>$CONFIG_STATUS <<EOF
16432 #
16433 # INIT-COMMANDS section.
16434 #
16435
16436 AWK="$AWK"
16437 ECHO_CC="$ECHO_CC"
16438 ECHO_LD="$ECHO_LD"
16439 SHOW_CC="$SHOW_LD"
16440
16441 EOF
16442
16443 cat >>$CONFIG_STATUS <<\EOF
16444 for ac_config_target in $ac_config_targets
16445 do
16446   case "$ac_config_target" in
16447   # Handling of arguments.
16448   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16449   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16450   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
16451   *) { { echo "$as_me:16451: error: invalid argument: $ac_config_target" >&5
16452 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16453    { (exit 1); exit 1; }; };;
16454   esac
16455 done
16456
16457 # If the user did not use the arguments to specify the items to instantiate,
16458 # then the envvar interface is used.  Set only those that are not.
16459 # We use the long form for the default assignment because of an extremely
16460 # bizarre bug on SunOS 4.1.3.
16461 if $ac_need_defaults; then
16462   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16463   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16464   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16465 fi
16466
16467 # Create a temporary directory, and hook for its removal unless debugging.
16468 $debug ||
16469 {
16470   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16471   trap '{ (exit 1); exit 1; }' 1 2 13 15
16472 }
16473
16474 # Create a (secure) tmp directory for tmp files.
16475 : ${TMPDIR=/tmp}
16476 {
16477   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16478   test -n "$tmp" && test -d "$tmp"
16479 }  ||
16480 {
16481   tmp=$TMPDIR/cs$$-$RANDOM
16482   (umask 077 && mkdir $tmp)
16483 } ||
16484 {
16485    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16486    { (exit 1); exit 1; }
16487 }
16488
16489 EOF
16490
16491 cat >>$CONFIG_STATUS <<EOF
16492
16493 #
16494 # CONFIG_FILES section.
16495 #
16496
16497 # No need to generate the scripts if there are no CONFIG_FILES.
16498 # This happens for instance when ./config.status config.h
16499 if test -n "\$CONFIG_FILES"; then
16500   # Protect against being on the right side of a sed subst in config.status.
16501   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
16502    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
16503 s,@SHELL@,$SHELL,;t t
16504 s,@exec_prefix@,$exec_prefix,;t t
16505 s,@prefix@,$prefix,;t t
16506 s,@program_transform_name@,$program_transform_name,;t t
16507 s,@bindir@,$bindir,;t t
16508 s,@sbindir@,$sbindir,;t t
16509 s,@libexecdir@,$libexecdir,;t t
16510 s,@datarootdir@,$datarootdir,;t t
16511 s,@datadir@,$datadir,;t t
16512 s,@sysconfdir@,$sysconfdir,;t t
16513 s,@sharedstatedir@,$sharedstatedir,;t t
16514 s,@localstatedir@,$localstatedir,;t t
16515 s,@libdir@,$libdir,;t t
16516 s,@includedir@,$includedir,;t t
16517 s,@oldincludedir@,$oldincludedir,;t t
16518 s,@infodir@,$infodir,;t t
16519 s,@mandir@,$mandir,;t t
16520 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
16521 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
16522 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
16523 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
16524 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
16525 s,@build_alias@,$build_alias,;t t
16526 s,@host_alias@,$host_alias,;t t
16527 s,@target_alias@,$target_alias,;t t
16528 s,@ECHO_C@,$ECHO_C,;t t
16529 s,@ECHO_N@,$ECHO_N,;t t
16530 s,@ECHO_T@,$ECHO_T,;t t
16531 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
16532 s,@DEFS@,$DEFS,;t t
16533 s,@LIBS@,$LIBS,;t t
16534 s,@build@,$build,;t t
16535 s,@build_cpu@,$build_cpu,;t t
16536 s,@build_vendor@,$build_vendor,;t t
16537 s,@build_os@,$build_os,;t t
16538 s,@host@,$host,;t t
16539 s,@host_cpu@,$host_cpu,;t t
16540 s,@host_vendor@,$host_vendor,;t t
16541 s,@host_os@,$host_os,;t t
16542 s,@SET_MAKE@,$SET_MAKE,;t t
16543 s,@CC@,$CC,;t t
16544 s,@CFLAGS@,$CFLAGS,;t t
16545 s,@LDFLAGS@,$LDFLAGS,;t t
16546 s,@CPPFLAGS@,$CPPFLAGS,;t t
16547 s,@ac_ct_CC@,$ac_ct_CC,;t t
16548 s,@EXEEXT@,$EXEEXT,;t t
16549 s,@OBJEXT@,$OBJEXT,;t t
16550 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
16551 s,@CPP@,$CPP,;t t
16552 s,@AWK@,$AWK,;t t
16553 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
16554 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
16555 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
16556 s,@LINT@,$LINT,;t t
16557 s,@LINT_OPTS@,$LINT_OPTS,;t t
16558 s,@CTAGS@,$CTAGS,;t t
16559 s,@ETAGS@,$ETAGS,;t t
16560 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
16561 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
16562 s,@MATH_LIB@,$MATH_LIB,;t t
16563 s,@top_builddir@,$top_builddir,;t t
16564 s,@CC_G_OPT@,$CC_G_OPT,;t t
16565 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
16566 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
16567 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
16568 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
16569 s,@LD@,$LD,;t t
16570 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
16571 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
16572 s,@LD_MODEL@,$LD_MODEL,;t t
16573 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
16574 s,@LIBTOOL@,$LIBTOOL,;t t
16575 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
16576 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
16577 s,@LIB_LINK@,$LIB_LINK,;t t
16578 s,@LINK_TESTS@,$LINK_TESTS,;t t
16579 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
16580 s,@PTHREAD@,$PTHREAD,;t t
16581 s,@TEST_ARGS@,$TEST_ARGS,;t t
16582 s,@TEST_DEPS@,$TEST_DEPS,;t t
16583 s,@TEST_LIBS@,$TEST_LIBS,;t t
16584 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
16585 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
16586 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
16587 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
16588 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
16589 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
16590 s,@ECHO_LT@,$ECHO_LT,;t t
16591 s,@ECHO_LD@,$ECHO_LD,;t t
16592 s,@RULE_CC@,$RULE_CC,;t t
16593 s,@SHOW_CC@,$SHOW_CC,;t t
16594 s,@ECHO_CC@,$ECHO_CC,;t t
16595 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
16596 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
16597 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
16598 s,@X_CFLAGS@,$X_CFLAGS,;t t
16599 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
16600 s,@X_LIBS@,$X_LIBS,;t t
16601 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
16602 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
16603 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
16604 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
16605 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
16606 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
16607 CEOF
16608
16609 EOF
16610
16611   cat >>$CONFIG_STATUS <<\EOF
16612   # Split the substitutions into bite-sized pieces for seds with
16613   # small command number limits, like on Digital OSF/1 and HP-UX.
16614   ac_max_sed_lines=48
16615   ac_sed_frag=1 # Number of current file.
16616   ac_beg=1 # First line for current file.
16617   ac_end=$ac_max_sed_lines # Line after last line for current file.
16618   ac_more_lines=:
16619   ac_sed_cmds=
16620   while $ac_more_lines; do
16621     if test $ac_beg -gt 1; then
16622       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16623     else
16624       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16625     fi
16626     if test ! -s $tmp/subs.frag; then
16627       ac_more_lines=false
16628     else
16629       # The purpose of the label and of the branching condition is to
16630       # speed up the sed processing (if there are no `@' at all, there
16631       # is no need to browse any of the substitutions).
16632       # These are the two extra sed commands mentioned above.
16633       (echo ':t
16634   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
16635       if test -z "$ac_sed_cmds"; then
16636         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
16637       else
16638         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
16639       fi
16640       ac_sed_frag=`expr $ac_sed_frag + 1`
16641       ac_beg=$ac_end
16642       ac_end=`expr $ac_end + $ac_max_sed_lines`
16643     fi
16644   done
16645   if test -z "$ac_sed_cmds"; then
16646     ac_sed_cmds=cat
16647   fi
16648 fi # test -n "$CONFIG_FILES"
16649
16650 EOF
16651 cat >>$CONFIG_STATUS <<\EOF
16652 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
16653   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16654   case $ac_file in
16655   - | *:- | *:-:* ) # input from stdin
16656         cat >$tmp/stdin
16657         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16658         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16659   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16660         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16661   * )   ac_file_in=$ac_file.in ;;
16662   esac
16663
16664   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
16665   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16666          X"$ac_file" : 'X\(//\)[^/]' \| \
16667          X"$ac_file" : 'X\(//\)$' \| \
16668          X"$ac_file" : 'X\(/\)' \| \
16669          .     : '\(.\)' 2>/dev/null ||
16670 echo X"$ac_file" |
16671     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16672           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16673           /^X\(\/\/\)$/{ s//\1/; q; }
16674           /^X\(\/\).*/{ s//\1/; q; }
16675           s/.*/./; q'`
16676   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16677     { case "$ac_dir" in
16678   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16679   *)                      as_incr_dir=.;;
16680 esac
16681 as_dummy="$ac_dir"
16682 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16683   case $as_mkdir_dir in
16684     # Skip DOS drivespec
16685     ?:) as_incr_dir=$as_mkdir_dir ;;
16686     *)
16687       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16688       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16689     ;;
16690   esac
16691 done; }
16692
16693     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
16694     # A "../" for each directory in $ac_dir_suffix.
16695     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
16696   else
16697     ac_dir_suffix= ac_dots=
16698   fi
16699
16700   case $srcdir in
16701   .)  ac_srcdir=.
16702       if test -z "$ac_dots"; then
16703          ac_top_srcdir=.
16704       else
16705          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
16706       fi ;;
16707   [\\/]* | ?:[\\/]* )
16708       ac_srcdir=$srcdir$ac_dir_suffix;
16709       ac_top_srcdir=$srcdir ;;
16710   *) # Relative path.
16711     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
16712     ac_top_srcdir=$ac_dots$srcdir ;;
16713   esac
16714
16715   case $INSTALL in
16716   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
16717   *) ac_INSTALL=$ac_dots$INSTALL ;;
16718   esac
16719
16720   if test x"$ac_file" != x-; then
16721     { echo "$as_me:16721: creating $ac_file" >&5
16722 echo "$as_me: creating $ac_file" >&6;}
16723     rm -f "$ac_file"
16724   fi
16725   # Let's still pretend it is `configure' which instantiates (i.e., don't
16726   # use $as_me), people would be surprised to read:
16727   #    /* config.h.  Generated automatically by config.status.  */
16728   configure_input="Generated automatically from `echo $ac_file_in |
16729                                                  sed 's,.*/,,'` by configure."
16730
16731   # First look for the input files in the build tree, otherwise in the
16732   # src tree.
16733   ac_file_inputs=`IFS=:
16734     for f in $ac_file_in; do
16735       case $f in
16736       -) echo $tmp/stdin ;;
16737       [\\/$]*)
16738          # Absolute (can't be DOS-style, as IFS=:)
16739          test -f "$f" || { { echo "$as_me:16739: error: cannot find input file: $f" >&5
16740 echo "$as_me: error: cannot find input file: $f" >&2;}
16741    { (exit 1); exit 1; }; }
16742          echo $f;;
16743       *) # Relative
16744          if test -f "$f"; then
16745            # Build tree
16746            echo $f
16747          elif test -f "$srcdir/$f"; then
16748            # Source tree
16749            echo $srcdir/$f
16750          else
16751            # /dev/null tree
16752            { { echo "$as_me:16752: error: cannot find input file: $f" >&5
16753 echo "$as_me: error: cannot find input file: $f" >&2;}
16754    { (exit 1); exit 1; }; }
16755          fi;;
16756       esac
16757     done` || { (exit 1); exit 1; }
16758 EOF
16759 cat >>$CONFIG_STATUS <<\EOF
16760   ac_warn_datarootdir=no
16761   if test x"$ac_file" != x-; then
16762     for ac_item in $ac_file_inputs
16763     do
16764       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
16765       if test -n "$ac_seen"; then
16766         ac_used=`grep '@datarootdir@' $ac_item`
16767         if test -z "$ac_used"; then
16768           { echo "$as_me:16768: WARNING: datarootdir was used implicitly but not set:
16769 $ac_seen" >&5
16770 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
16771 $ac_seen" >&2;}
16772           ac_warn_datarootdir=yes
16773         fi
16774       fi
16775       ac_seen=`grep '${datarootdir}' $ac_item`
16776       if test -n "$ac_seen"; then
16777         { echo "$as_me:16777: WARNING: datarootdir was used explicitly but not set:
16778 $ac_seen" >&5
16779 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
16780 $ac_seen" >&2;}
16781         ac_warn_datarootdir=yes
16782       fi
16783     done
16784   fi
16785
16786 if test "x$ac_warn_datarootdir" = xyes; then
16787   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
16788 fi
16789
16790 EOF
16791 cat >>$CONFIG_STATUS <<EOF
16792   sed "$ac_vpsub
16793 $extrasub
16794 EOF
16795 cat >>$CONFIG_STATUS <<\EOF
16796 :t
16797 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
16798 s,@configure_input@,$configure_input,;t t
16799 s,@srcdir@,$ac_srcdir,;t t
16800 s,@top_srcdir@,$ac_top_srcdir,;t t
16801 s,@INSTALL@,$ac_INSTALL,;t t
16802 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
16803   rm -f $tmp/stdin
16804   if test x"$ac_file" != x-; then
16805     cp $tmp/out $ac_file
16806
16807     for ac_name in prefix exec_prefix datarootdir
16808     do
16809         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
16810         if test -n "$ac_seen"; then
16811             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
16812             if test -z "$ac_init"; then
16813               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
16814               { echo "$as_me:16814: WARNING: Variable $ac_name is used but was not set:
16815 $ac_seen" >&5
16816 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
16817 $ac_seen" >&2;}
16818             fi
16819         fi
16820     done
16821     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
16822     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
16823     if test -s $tmp/out; then
16824       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
16825       { echo "$as_me:16825: WARNING: Some variables may not be substituted:
16826 $ac_seen" >&5
16827 echo "$as_me: WARNING: Some variables may not be substituted:
16828 $ac_seen" >&2;}
16829     fi
16830   else
16831     cat $tmp/out
16832   fi
16833   rm -f $tmp/out
16834
16835 done
16836 EOF
16837 cat >>$CONFIG_STATUS <<\EOF
16838
16839 #
16840 # CONFIG_HEADER section.
16841 #
16842
16843 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
16844 # NAME is the cpp macro being defined and VALUE is the value it is being given.
16845 #
16846 # ac_d sets the value in "#define NAME VALUE" lines.
16847 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
16848 ac_dB='[        ].*$,\1#\2'
16849 ac_dC=' '
16850 ac_dD=',;t'
16851 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
16852 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16853 ac_iB='\([      ]\),\1#\2define\3'
16854 ac_iC=' '
16855 ac_iD='\4,;t'
16856 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16857 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16858 ac_uB='$,\1#\2define\3'
16859 ac_uC=' '
16860 ac_uD=',;t'
16861
16862 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
16863   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16864   case $ac_file in
16865   - | *:- | *:-:* ) # input from stdin
16866         cat >$tmp/stdin
16867         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16868         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16869   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16870         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16871   * )   ac_file_in=$ac_file.in ;;
16872   esac
16873
16874   test x"$ac_file" != x- && { echo "$as_me:16874: creating $ac_file" >&5
16875 echo "$as_me: creating $ac_file" >&6;}
16876
16877   # First look for the input files in the build tree, otherwise in the
16878   # src tree.
16879   ac_file_inputs=`IFS=:
16880     for f in $ac_file_in; do
16881       case $f in
16882       -) echo $tmp/stdin ;;
16883       [\\/$]*)
16884          # Absolute (can't be DOS-style, as IFS=:)
16885          test -f "$f" || { { echo "$as_me:16885: error: cannot find input file: $f" >&5
16886 echo "$as_me: error: cannot find input file: $f" >&2;}
16887    { (exit 1); exit 1; }; }
16888          echo $f;;
16889       *) # Relative
16890          if test -f "$f"; then
16891            # Build tree
16892            echo $f
16893          elif test -f "$srcdir/$f"; then
16894            # Source tree
16895            echo $srcdir/$f
16896          else
16897            # /dev/null tree
16898            { { echo "$as_me:16898: error: cannot find input file: $f" >&5
16899 echo "$as_me: error: cannot find input file: $f" >&2;}
16900    { (exit 1); exit 1; }; }
16901          fi;;
16902       esac
16903     done` || { (exit 1); exit 1; }
16904   # Remove the trailing spaces.
16905   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
16906
16907 EOF
16908
16909 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
16910 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
16911 # be either 'cat' or 'sort'.
16912 cat confdefs.h | uniq >conftest.vals
16913
16914 # Break up conftest.vals because some shells have a limit on
16915 # the size of here documents, and old seds have small limits too.
16916
16917 rm -f conftest.tail
16918 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
16919 while grep . conftest.vals >/dev/null
16920 do
16921   # Write chunks of a limited-size here document to conftest.frag.
16922   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
16923   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
16924   echo 'CEOF' >> $CONFIG_STATUS
16925   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
16926   rm -f conftest.vals
16927   mv conftest.tail conftest.vals
16928 done
16929 rm -f conftest.vals
16930
16931 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
16932 # marker @DEFS@.
16933 echo '  cat >> conftest.edit <<CEOF
16934 /@DEFS@/r conftest.frag
16935 /@DEFS@/d
16936 CEOF
16937 sed -f conftest.edit $tmp/in > $tmp/out
16938 rm -f $tmp/in
16939 mv $tmp/out $tmp/in
16940 rm -f conftest.edit conftest.frag
16941 ' >> $CONFIG_STATUS
16942
16943 cat >>$CONFIG_STATUS <<\EOF
16944   # Let's still pretend it is `configure' which instantiates (i.e., don't
16945   # use $as_me), people would be surprised to read:
16946   #    /* config.h.  Generated automatically by config.status.  */
16947   if test x"$ac_file" = x-; then
16948     echo "/* Generated automatically by configure.  */" >$tmp/config.h
16949   else
16950     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
16951   fi
16952   cat $tmp/in >>$tmp/config.h
16953   rm -f $tmp/in
16954   if test x"$ac_file" != x-; then
16955     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
16956       { echo "$as_me:16956: $ac_file is unchanged" >&5
16957 echo "$as_me: $ac_file is unchanged" >&6;}
16958     else
16959       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16960          X"$ac_file" : 'X\(//\)[^/]' \| \
16961          X"$ac_file" : 'X\(//\)$' \| \
16962          X"$ac_file" : 'X\(/\)' \| \
16963          .     : '\(.\)' 2>/dev/null ||
16964 echo X"$ac_file" |
16965     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16966           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16967           /^X\(\/\/\)$/{ s//\1/; q; }
16968           /^X\(\/\).*/{ s//\1/; q; }
16969           s/.*/./; q'`
16970       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16971         { case "$ac_dir" in
16972   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16973   *)                      as_incr_dir=.;;
16974 esac
16975 as_dummy="$ac_dir"
16976 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16977   case $as_mkdir_dir in
16978     # Skip DOS drivespec
16979     ?:) as_incr_dir=$as_mkdir_dir ;;
16980     *)
16981       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16982       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16983     ;;
16984   esac
16985 done; }
16986
16987       fi
16988       rm -f $ac_file
16989       mv $tmp/config.h $ac_file
16990     fi
16991   else
16992     cat $tmp/config.h
16993     rm -f $tmp/config.h
16994   fi
16995 done
16996 EOF
16997 cat >>$CONFIG_STATUS <<\EOF
16998 #
16999 # CONFIG_COMMANDS section.
17000 #
17001 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17002   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17003   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17004
17005   case $ac_dest in
17006     default )
17007
17008 for cf_dir in .
17009 do
17010         if test ! -d $srcdir/$cf_dir; then
17011                 continue
17012         elif test -f $srcdir/$cf_dir/programs; then
17013                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
17014         fi
17015 done
17016
17017         cat >>Makefile <<TEST_EOF
17018
17019 # These rules are generated so we do not rely on suffix rules, which do not
17020 # work consistently for different make-programs (the '\$(MODEL)/' confuses
17021 # some, and the '\$x' confuses others).
17022 TEST_EOF
17023
17024 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
17025 for N in $LIST
17026 do
17027         cat >>Makefile <<TEST_EOF
17028
17029 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
17030         \$(srcdir)/test.priv.h \\
17031         ncurses_cfg.h
17032         $SHOW_CC
17033         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
17034 TEST_EOF
17035 done
17036
17037 if test -f ../config.guess && test -f ../config.sub
17038 then
17039         cat >>Makefile <<TEST_EOF
17040
17041 # if we used CF_INHERIT for getting these files, we can remove them
17042 distclean::
17043         rm -f config.guess config.sub
17044 TEST_EOF
17045 fi
17046  ;;
17047   esac
17048 done
17049 EOF
17050
17051 cat >>$CONFIG_STATUS <<\EOF
17052
17053 { (exit 0); exit 0; }
17054 EOF
17055 chmod +x $CONFIG_STATUS
17056 ac_clean_files=$ac_clean_files_save
17057
17058 # configure is writing to config.log, and then calls config.status.
17059 # config.status does its own redirection, appending to config.log.
17060 # Unfortunately, on DOS this fails, as config.log is still kept open
17061 # by configure, so config.status won't be able to write to it; its
17062 # output is simply discarded.  So we exec the FD to /dev/null,
17063 # effectively closing config.log, so it can be properly (re)opened and
17064 # appended to by config.status.  When coming back to configure, we
17065 # need to make the FD available again.
17066 if test "$no_create" != yes; then
17067   ac_cs_success=:
17068   exec 5>/dev/null
17069   $SHELL $CONFIG_STATUS || ac_cs_success=false
17070   exec 5>>config.log
17071   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17072   # would make configure fail if this is the last instruction.
17073   $ac_cs_success || { (exit 1); exit 1; }
17074 fi
17075