]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.9 - patch 20121102
[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
12660 do
12661 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
12662 echo "$as_me:12662: checking for $ac_func" >&5
12663 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
12664 if eval "test \"\${$as_ac_var+set}\" = set"; then
12665   echo $ECHO_N "(cached) $ECHO_C" >&6
12666 else
12667   cat >conftest.$ac_ext <<_ACEOF
12668 #line 12668 "configure"
12669 #include "confdefs.h"
12670 /* System header to define __stub macros and hopefully few prototypes,
12671     which can conflict with char $ac_func (); below.  */
12672 #include <assert.h>
12673 /* Override any gcc2 internal prototype to avoid an error.  */
12674 #ifdef __cplusplus
12675 extern "C"
12676 #endif
12677 /* We use char because int might match the return type of a gcc2
12678    builtin and then its argument prototype would still apply.  */
12679 char $ac_func ();
12680 char (*f) ();
12681
12682 int
12683 main ()
12684 {
12685 /* The GNU C library defines this for functions which it implements
12686     to always fail with ENOSYS.  Some functions are actually named
12687     something starting with __ and the normal name is an alias.  */
12688 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12689 choke me
12690 #else
12691 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12692 #endif
12693
12694   ;
12695   return 0;
12696 }
12697 _ACEOF
12698 rm -f conftest.$ac_objext conftest$ac_exeext
12699 if { (eval echo "$as_me:12699: \"$ac_link\"") >&5
12700   (eval $ac_link) 2>&5
12701   ac_status=$?
12702   echo "$as_me:12702: \$? = $ac_status" >&5
12703   (exit $ac_status); } &&
12704          { ac_try='test -s conftest$ac_exeext'
12705   { (eval echo "$as_me:12705: \"$ac_try\"") >&5
12706   (eval $ac_try) 2>&5
12707   ac_status=$?
12708   echo "$as_me:12708: \$? = $ac_status" >&5
12709   (exit $ac_status); }; }; then
12710   eval "$as_ac_var=yes"
12711 else
12712   echo "$as_me: failed program was:" >&5
12713 cat conftest.$ac_ext >&5
12714 eval "$as_ac_var=no"
12715 fi
12716 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12717 fi
12718 echo "$as_me:12718: result: `eval echo '${'$as_ac_var'}'`" >&5
12719 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
12720 if test `eval echo '${'$as_ac_var'}'` = yes; then
12721   cat >>confdefs.h <<EOF
12722 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
12723 EOF
12724
12725 fi
12726 done
12727
12728 if test "$cf_enable_widec" = yes; then
12729
12730 for ac_func in \
12731 mblen \
12732 mbrlen \
12733 mbrtowc \
12734 mbsrtowcs \
12735 mbstowcs \
12736 mbtowc \
12737 wcsrtombs \
12738 wcstombs \
12739
12740 do
12741 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
12742 echo "$as_me:12742: checking for $ac_func" >&5
12743 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
12744 if eval "test \"\${$as_ac_var+set}\" = set"; then
12745   echo $ECHO_N "(cached) $ECHO_C" >&6
12746 else
12747   cat >conftest.$ac_ext <<_ACEOF
12748 #line 12748 "configure"
12749 #include "confdefs.h"
12750 /* System header to define __stub macros and hopefully few prototypes,
12751     which can conflict with char $ac_func (); below.  */
12752 #include <assert.h>
12753 /* Override any gcc2 internal prototype to avoid an error.  */
12754 #ifdef __cplusplus
12755 extern "C"
12756 #endif
12757 /* We use char because int might match the return type of a gcc2
12758    builtin and then its argument prototype would still apply.  */
12759 char $ac_func ();
12760 char (*f) ();
12761
12762 int
12763 main ()
12764 {
12765 /* The GNU C library defines this for functions which it implements
12766     to always fail with ENOSYS.  Some functions are actually named
12767     something starting with __ and the normal name is an alias.  */
12768 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12769 choke me
12770 #else
12771 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12772 #endif
12773
12774   ;
12775   return 0;
12776 }
12777 _ACEOF
12778 rm -f conftest.$ac_objext conftest$ac_exeext
12779 if { (eval echo "$as_me:12779: \"$ac_link\"") >&5
12780   (eval $ac_link) 2>&5
12781   ac_status=$?
12782   echo "$as_me:12782: \$? = $ac_status" >&5
12783   (exit $ac_status); } &&
12784          { ac_try='test -s conftest$ac_exeext'
12785   { (eval echo "$as_me:12785: \"$ac_try\"") >&5
12786   (eval $ac_try) 2>&5
12787   ac_status=$?
12788   echo "$as_me:12788: \$? = $ac_status" >&5
12789   (exit $ac_status); }; }; then
12790   eval "$as_ac_var=yes"
12791 else
12792   echo "$as_me: failed program was:" >&5
12793 cat conftest.$ac_ext >&5
12794 eval "$as_ac_var=no"
12795 fi
12796 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12797 fi
12798 echo "$as_me:12798: result: `eval echo '${'$as_ac_var'}'`" >&5
12799 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
12800 if test `eval echo '${'$as_ac_var'}'` = yes; then
12801   cat >>confdefs.h <<EOF
12802 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
12803 EOF
12804
12805 fi
12806 done
12807
12808 fi
12809
12810 echo "$as_me:12810: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
12811 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
12812 if test "${cf_cv_need_xopen_extension+set}" = set; then
12813   echo $ECHO_N "(cached) $ECHO_C" >&6
12814 else
12815
12816 cat >conftest.$ac_ext <<_ACEOF
12817 #line 12817 "configure"
12818 #include "confdefs.h"
12819
12820 #include <stdlib.h>
12821 #include <${cf_cv_ncurses_header:-curses.h}>
12822 int
12823 main ()
12824 {
12825
12826 #if defined(NCURSES_VERSION_PATCH)
12827 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
12828         make an error
12829 #endif
12830 #endif
12831         long x = winnstr(stdscr, "", 0);
12832         int x1, y1;
12833         getbegyx(stdscr, y1, x1)
12834   ;
12835   return 0;
12836 }
12837 _ACEOF
12838 rm -f conftest.$ac_objext conftest$ac_exeext
12839 if { (eval echo "$as_me:12839: \"$ac_link\"") >&5
12840   (eval $ac_link) 2>&5
12841   ac_status=$?
12842   echo "$as_me:12842: \$? = $ac_status" >&5
12843   (exit $ac_status); } &&
12844          { ac_try='test -s conftest$ac_exeext'
12845   { (eval echo "$as_me:12845: \"$ac_try\"") >&5
12846   (eval $ac_try) 2>&5
12847   ac_status=$?
12848   echo "$as_me:12848: \$? = $ac_status" >&5
12849   (exit $ac_status); }; }; then
12850   cf_cv_need_xopen_extension=no
12851 else
12852   echo "$as_me: failed program was:" >&5
12853 cat conftest.$ac_ext >&5
12854 cat >conftest.$ac_ext <<_ACEOF
12855 #line 12855 "configure"
12856 #include "confdefs.h"
12857
12858 #define _XOPEN_SOURCE_EXTENDED
12859 #include <stdlib.h>
12860 #include <${cf_cv_ncurses_header:-curses.h}>
12861 int
12862 main ()
12863 {
12864
12865 #ifdef NCURSES_VERSION
12866         cchar_t check;
12867         int check2 = curs_set((int)sizeof(check));
12868 #endif
12869         long x = winnstr(stdscr, "", 0);
12870         int x1, y1;
12871         getbegyx(stdscr, y1, x1)
12872   ;
12873   return 0;
12874 }
12875 _ACEOF
12876 rm -f conftest.$ac_objext conftest$ac_exeext
12877 if { (eval echo "$as_me:12877: \"$ac_link\"") >&5
12878   (eval $ac_link) 2>&5
12879   ac_status=$?
12880   echo "$as_me:12880: \$? = $ac_status" >&5
12881   (exit $ac_status); } &&
12882          { ac_try='test -s conftest$ac_exeext'
12883   { (eval echo "$as_me:12883: \"$ac_try\"") >&5
12884   (eval $ac_try) 2>&5
12885   ac_status=$?
12886   echo "$as_me:12886: \$? = $ac_status" >&5
12887   (exit $ac_status); }; }; then
12888   cf_cv_need_xopen_extension=yes
12889 else
12890   echo "$as_me: failed program was:" >&5
12891 cat conftest.$ac_ext >&5
12892 cf_cv_need_xopen_extension=unknown
12893 fi
12894 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12895 fi
12896 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12897 fi
12898 echo "$as_me:12898: result: $cf_cv_need_xopen_extension" >&5
12899 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
12900 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
12901
12902 echo "$as_me:12902: checking for term.h" >&5
12903 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
12904 if test "${cf_cv_term_header+set}" = set; then
12905   echo $ECHO_N "(cached) $ECHO_C" >&6
12906 else
12907
12908 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
12909 # for <term.h> if we do not find the variant.
12910
12911 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
12912
12913 case ${cf_cv_ncurses_header:-curses.h} in #(vi
12914 */*)
12915         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
12916         cf_header_list="$cf_header_item $cf_header_list"
12917         ;;
12918 esac
12919
12920 for cf_header in $cf_header_list
12921 do
12922         cat >conftest.$ac_ext <<_ACEOF
12923 #line 12923 "configure"
12924 #include "confdefs.h"
12925
12926 #include <${cf_cv_ncurses_header:-curses.h}>
12927 #include <${cf_header}>
12928 int
12929 main ()
12930 {
12931 WINDOW *x
12932   ;
12933   return 0;
12934 }
12935 _ACEOF
12936 rm -f conftest.$ac_objext
12937 if { (eval echo "$as_me:12937: \"$ac_compile\"") >&5
12938   (eval $ac_compile) 2>&5
12939   ac_status=$?
12940   echo "$as_me:12940: \$? = $ac_status" >&5
12941   (exit $ac_status); } &&
12942          { ac_try='test -s conftest.$ac_objext'
12943   { (eval echo "$as_me:12943: \"$ac_try\"") >&5
12944   (eval $ac_try) 2>&5
12945   ac_status=$?
12946   echo "$as_me:12946: \$? = $ac_status" >&5
12947   (exit $ac_status); }; }; then
12948   cf_cv_term_header=$cf_header
12949          break
12950 else
12951   echo "$as_me: failed program was:" >&5
12952 cat conftest.$ac_ext >&5
12953 cf_cv_term_header=no
12954 fi
12955 rm -f conftest.$ac_objext conftest.$ac_ext
12956 done
12957
12958 case $cf_cv_term_header in #(vi
12959 no)
12960         # If curses is ncurses, some packagers still mess it up by trying to make
12961         # us use GNU termcap.  This handles the most common case.
12962         for cf_header in ncurses/term.h ncursesw/term.h
12963         do
12964                 cat >conftest.$ac_ext <<_ACEOF
12965 #line 12965 "configure"
12966 #include "confdefs.h"
12967
12968 #include <${cf_cv_ncurses_header:-curses.h}>
12969 #ifdef NCURSES_VERSION
12970 #include <${cf_header}>
12971 #else
12972 make an error
12973 #endif
12974 int
12975 main ()
12976 {
12977 WINDOW *x
12978   ;
12979   return 0;
12980 }
12981 _ACEOF
12982 rm -f conftest.$ac_objext
12983 if { (eval echo "$as_me:12983: \"$ac_compile\"") >&5
12984   (eval $ac_compile) 2>&5
12985   ac_status=$?
12986   echo "$as_me:12986: \$? = $ac_status" >&5
12987   (exit $ac_status); } &&
12988          { ac_try='test -s conftest.$ac_objext'
12989   { (eval echo "$as_me:12989: \"$ac_try\"") >&5
12990   (eval $ac_try) 2>&5
12991   ac_status=$?
12992   echo "$as_me:12992: \$? = $ac_status" >&5
12993   (exit $ac_status); }; }; then
12994   cf_cv_term_header=$cf_header
12995                          break
12996 else
12997   echo "$as_me: failed program was:" >&5
12998 cat conftest.$ac_ext >&5
12999 cf_cv_term_header=no
13000 fi
13001 rm -f conftest.$ac_objext conftest.$ac_ext
13002         done
13003         ;;
13004 esac
13005
13006 fi
13007 echo "$as_me:13007: result: $cf_cv_term_header" >&5
13008 echo "${ECHO_T}$cf_cv_term_header" >&6
13009
13010 case $cf_cv_term_header in #(vi
13011 term.h) #(vi
13012
13013 cat >>confdefs.h <<\EOF
13014 #define HAVE_TERM_H 1
13015 EOF
13016
13017         ;;
13018 ncurses/term.h) #(vi
13019
13020 cat >>confdefs.h <<\EOF
13021 #define HAVE_NCURSES_TERM_H 1
13022 EOF
13023
13024         ;;
13025 ncursesw/term.h)
13026
13027 cat >>confdefs.h <<\EOF
13028 #define HAVE_NCURSESW_TERM_H 1
13029 EOF
13030
13031         ;;
13032 esac
13033
13034 echo "$as_me:13034: checking for unctrl.h" >&5
13035 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
13036 if test "${cf_cv_unctrl_header+set}" = set; then
13037   echo $ECHO_N "(cached) $ECHO_C" >&6
13038 else
13039
13040 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
13041 # for <unctrl.h> if we do not find the variant.
13042
13043 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
13044
13045 case ${cf_cv_ncurses_header:-curses.h} in #(vi
13046 */*)
13047         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
13048         cf_header_list="$cf_header_item $cf_header_list"
13049         ;;
13050 esac
13051
13052 for cf_header in $cf_header_list
13053 do
13054         cat >conftest.$ac_ext <<_ACEOF
13055 #line 13055 "configure"
13056 #include "confdefs.h"
13057
13058 #include <${cf_cv_ncurses_header:-curses.h}>
13059 #include <${cf_header}>
13060 int
13061 main ()
13062 {
13063 WINDOW *x
13064   ;
13065   return 0;
13066 }
13067 _ACEOF
13068 rm -f conftest.$ac_objext
13069 if { (eval echo "$as_me:13069: \"$ac_compile\"") >&5
13070   (eval $ac_compile) 2>&5
13071   ac_status=$?
13072   echo "$as_me:13072: \$? = $ac_status" >&5
13073   (exit $ac_status); } &&
13074          { ac_try='test -s conftest.$ac_objext'
13075   { (eval echo "$as_me:13075: \"$ac_try\"") >&5
13076   (eval $ac_try) 2>&5
13077   ac_status=$?
13078   echo "$as_me:13078: \$? = $ac_status" >&5
13079   (exit $ac_status); }; }; then
13080   cf_cv_unctrl_header=$cf_header
13081          break
13082 else
13083   echo "$as_me: failed program was:" >&5
13084 cat conftest.$ac_ext >&5
13085 cf_cv_unctrl_header=no
13086 fi
13087 rm -f conftest.$ac_objext conftest.$ac_ext
13088 done
13089
13090 case $cf_cv_unctrl_header in #(vi
13091 no)
13092         { echo "$as_me:13092: WARNING: unctrl.h header not found" >&5
13093 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
13094         ;;
13095 esac
13096
13097 fi
13098 echo "$as_me:13098: result: $cf_cv_unctrl_header" >&5
13099 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
13100
13101 case $cf_cv_unctrl_header in #(vi
13102 unctrl.h) #(vi
13103
13104 cat >>confdefs.h <<\EOF
13105 #define HAVE_UNCTRL_H 1
13106 EOF
13107
13108         ;;
13109 ncurses/unctrl.h) #(vi
13110
13111 cat >>confdefs.h <<\EOF
13112 #define HAVE_NCURSES_UNCTRL_H 1
13113 EOF
13114
13115         ;;
13116 ncursesw/unctrl.h)
13117
13118 cat >>confdefs.h <<\EOF
13119 #define HAVE_NCURSESW_UNCTRL_H 1
13120 EOF
13121
13122         ;;
13123 esac
13124
13125 for cf_func in \
13126 assume_default_colors \
13127 chgat \
13128 color_set \
13129 filter \
13130 getbegx \
13131 getcurx \
13132 getmaxx \
13133 getnstr \
13134 getparx \
13135 getwin \
13136 mvvline \
13137 mvwvline \
13138 napms \
13139 putwin \
13140 resize_term \
13141 resizeterm \
13142 ripoffline \
13143 scr_dump \
13144 setupterm \
13145 slk_color \
13146 slk_init \
13147 termattrs \
13148 tgetent \
13149 tigetnum \
13150 tigetstr \
13151 typeahead \
13152 use_default_colors \
13153 use_screen \
13154 use_window \
13155 vsscanf \
13156 vw_printw \
13157 wchgat \
13158 winsstr \
13159 wresize \
13160 wsyncdown \
13161
13162 do
13163
13164 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13165
13166         echo "$as_me:13166: checking for ${cf_func}" >&5
13167 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
13168
13169 echo "${as_me:-configure}:13169: testing ${cf_func} ..." 1>&5
13170
13171         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
13172   echo $ECHO_N "(cached) $ECHO_C" >&6
13173 else
13174
13175                 eval cf_result='$ac_cv_func_'$cf_func
13176                 if test ".$cf_result" != ".no"; then
13177                         cat >conftest.$ac_ext <<_ACEOF
13178 #line 13178 "configure"
13179 #include "confdefs.h"
13180
13181 #ifdef HAVE_XCURSES
13182 #include <xcurses.h>
13183 char * XCursesProgramName = "test";
13184 #else
13185 #include <${cf_cv_ncurses_header:-curses.h}>
13186 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13187 #include <ncursesw/term.h>
13188 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13189 #include <ncurses/term.h>
13190 #elif defined(HAVE_TERM_H)
13191 #include <term.h>
13192 #endif
13193 #endif
13194
13195 int
13196 main ()
13197 {
13198
13199 #ifndef ${cf_func}
13200 long foo = (long)(&${cf_func});
13201 if (foo + 1234 > 5678)
13202         ${cf_cv_main_return:-return}(foo);
13203 #endif
13204
13205   ;
13206   return 0;
13207 }
13208 _ACEOF
13209 rm -f conftest.$ac_objext conftest$ac_exeext
13210 if { (eval echo "$as_me:13210: \"$ac_link\"") >&5
13211   (eval $ac_link) 2>&5
13212   ac_status=$?
13213   echo "$as_me:13213: \$? = $ac_status" >&5
13214   (exit $ac_status); } &&
13215          { ac_try='test -s conftest$ac_exeext'
13216   { (eval echo "$as_me:13216: \"$ac_try\"") >&5
13217   (eval $ac_try) 2>&5
13218   ac_status=$?
13219   echo "$as_me:13219: \$? = $ac_status" >&5
13220   (exit $ac_status); }; }; then
13221   cf_result=yes
13222 else
13223   echo "$as_me: failed program was:" >&5
13224 cat conftest.$ac_ext >&5
13225 cf_result=no
13226 fi
13227 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13228                 fi
13229                 eval 'cf_cv_func_'$cf_func'=$cf_result'
13230
13231 fi
13232
13233         # use the computed/retrieved cache-value:
13234         eval 'cf_result=$cf_cv_func_'$cf_func
13235         echo "$as_me:13235: result: $cf_result" >&5
13236 echo "${ECHO_T}$cf_result" >&6
13237         if test $cf_result != no; then
13238                 cat >>confdefs.h <<EOF
13239 #define HAVE_${cf_tr_func} 1
13240 EOF
13241
13242         fi
13243 done
13244
13245 for cf_func in tputs
13246 do
13247
13248 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13249
13250         echo "$as_me:13250: checking for ${cf_func}" >&5
13251 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
13252
13253 echo "${as_me:-configure}:13253: testing ${cf_func} ..." 1>&5
13254
13255         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
13256   echo $ECHO_N "(cached) $ECHO_C" >&6
13257 else
13258
13259                 eval cf_result='$ac_cv_func_'$cf_func
13260                 if test ".$cf_result" != ".no"; then
13261                         cat >conftest.$ac_ext <<_ACEOF
13262 #line 13262 "configure"
13263 #include "confdefs.h"
13264
13265 #ifdef HAVE_XCURSES
13266 #include <xcurses.h>
13267 char * XCursesProgramName = "test";
13268 #else
13269 #include <${cf_cv_ncurses_header:-curses.h}>
13270 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13271 #include <ncursesw/term.h>
13272 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13273 #include <ncurses/term.h>
13274 #elif defined(HAVE_TERM_H)
13275 #include <term.h>
13276 #endif
13277 #endif
13278
13279 int
13280 main ()
13281 {
13282
13283 #ifndef ${cf_func}
13284 long foo = (long)(&${cf_func});
13285 if (foo + 1234 > 5678)
13286         ${cf_cv_main_return:-return}(foo);
13287 #endif
13288
13289   ;
13290   return 0;
13291 }
13292 _ACEOF
13293 rm -f conftest.$ac_objext conftest$ac_exeext
13294 if { (eval echo "$as_me:13294: \"$ac_link\"") >&5
13295   (eval $ac_link) 2>&5
13296   ac_status=$?
13297   echo "$as_me:13297: \$? = $ac_status" >&5
13298   (exit $ac_status); } &&
13299          { ac_try='test -s conftest$ac_exeext'
13300   { (eval echo "$as_me:13300: \"$ac_try\"") >&5
13301   (eval $ac_try) 2>&5
13302   ac_status=$?
13303   echo "$as_me:13303: \$? = $ac_status" >&5
13304   (exit $ac_status); }; }; then
13305   cf_result=yes
13306 else
13307   echo "$as_me: failed program was:" >&5
13308 cat conftest.$ac_ext >&5
13309 cf_result=no
13310 fi
13311 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13312                 fi
13313                 eval 'cf_cv_func_'$cf_func'=$cf_result'
13314
13315 fi
13316
13317         # use the computed/retrieved cache-value:
13318         eval 'cf_result=$cf_cv_func_'$cf_func
13319         echo "$as_me:13319: result: $cf_result" >&5
13320 echo "${ECHO_T}$cf_result" >&6
13321         if test $cf_result != no; then
13322                 cat >>confdefs.h <<EOF
13323 #define HAVE_${cf_tr_func} 1
13324 EOF
13325
13326         fi
13327 done
13328
13329 if test x$cf_cv_func_tputs = xyes
13330 then
13331         cf_done=no
13332         for cf_arg in int char
13333         do
13334                 for cf_ret in int void
13335                 do
13336                         if test $cf_ret = void
13337                         then
13338                                 cf_return="/* nothing */"
13339                         else
13340                                 cf_return="return value"
13341                         fi
13342                         cat >conftest.$ac_ext <<_ACEOF
13343 #line 13343 "configure"
13344 #include "confdefs.h"
13345
13346 #include <${cf_cv_ncurses_header:-curses.h}>
13347 #include <$cf_cv_term_header>
13348
13349 static $cf_ret outc($cf_arg value) { $cf_return; }
13350
13351 int
13352 main ()
13353 {
13354
13355         tputs("hello", 0, outc);
13356         ${cf_cv_main_return:-return}(0);
13357
13358   ;
13359   return 0;
13360 }
13361 _ACEOF
13362 rm -f conftest.$ac_objext
13363 if { (eval echo "$as_me:13363: \"$ac_compile\"") >&5
13364   (eval $ac_compile) 2>&5
13365   ac_status=$?
13366   echo "$as_me:13366: \$? = $ac_status" >&5
13367   (exit $ac_status); } &&
13368          { ac_try='test -s conftest.$ac_objext'
13369   { (eval echo "$as_me:13369: \"$ac_try\"") >&5
13370   (eval $ac_try) 2>&5
13371   ac_status=$?
13372   echo "$as_me:13372: \$? = $ac_status" >&5
13373   (exit $ac_status); }; }; then
13374
13375                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
13376
13377 echo "${as_me:-configure}:13377: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
13378
13379                 cat >>confdefs.h <<EOF
13380 #define TPUTS_ARG               $cf_arg
13381 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
13382 #define TPUTS_RETURN(value)     $cf_return
13383 EOF
13384                 cf_done=yes
13385                 break
13386
13387 else
13388   echo "$as_me: failed program was:" >&5
13389 cat conftest.$ac_ext >&5
13390 fi
13391 rm -f conftest.$ac_objext conftest.$ac_ext
13392                 done
13393                 test $cf_done = yes && break
13394         done
13395 fi
13396
13397 echo "$as_me:13397: checking for ncurses extended functions" >&5
13398 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
13399 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
13400   echo $ECHO_N "(cached) $ECHO_C" >&6
13401 else
13402
13403 cat >conftest.$ac_ext <<_ACEOF
13404 #line 13404 "configure"
13405 #include "confdefs.h"
13406
13407 #include <${cf_cv_ncurses_header:-curses.h}>
13408 int
13409 main ()
13410 {
13411
13412 int x = NCURSES_EXT_FUNCS
13413
13414   ;
13415   return 0;
13416 }
13417 _ACEOF
13418 rm -f conftest.$ac_objext
13419 if { (eval echo "$as_me:13419: \"$ac_compile\"") >&5
13420   (eval $ac_compile) 2>&5
13421   ac_status=$?
13422   echo "$as_me:13422: \$? = $ac_status" >&5
13423   (exit $ac_status); } &&
13424          { ac_try='test -s conftest.$ac_objext'
13425   { (eval echo "$as_me:13425: \"$ac_try\"") >&5
13426   (eval $ac_try) 2>&5
13427   ac_status=$?
13428   echo "$as_me:13428: \$? = $ac_status" >&5
13429   (exit $ac_status); }; }; then
13430   cf_cv_ncurses_ext_funcs=defined
13431 else
13432   echo "$as_me: failed program was:" >&5
13433 cat conftest.$ac_ext >&5
13434
13435 cat >conftest.$ac_ext <<_ACEOF
13436 #line 13436 "configure"
13437 #include "confdefs.h"
13438
13439 #include <${cf_cv_ncurses_header:-curses.h}>
13440 int
13441 main ()
13442 {
13443
13444         (void) assume_default_colors (0, 0);
13445         (void) curses_version ();
13446         (void) define_key (0, 0);
13447         (void) is_term_resized (0, 0);
13448         (void) key_defined (0);
13449         (void) keybound (0, 0);
13450         (void) keyok (0, 0);
13451         (void) resize_term (0, 0);
13452         (void) resizeterm (0, 0);
13453         (void) use_default_colors ();
13454         (void) use_extended_names (0);
13455         (void) wresize (0, 0, 0);
13456   ;
13457   return 0;
13458 }
13459 _ACEOF
13460 rm -f conftest.$ac_objext conftest$ac_exeext
13461 if { (eval echo "$as_me:13461: \"$ac_link\"") >&5
13462   (eval $ac_link) 2>&5
13463   ac_status=$?
13464   echo "$as_me:13464: \$? = $ac_status" >&5
13465   (exit $ac_status); } &&
13466          { ac_try='test -s conftest$ac_exeext'
13467   { (eval echo "$as_me:13467: \"$ac_try\"") >&5
13468   (eval $ac_try) 2>&5
13469   ac_status=$?
13470   echo "$as_me:13470: \$? = $ac_status" >&5
13471   (exit $ac_status); }; }; then
13472   cf_cv_ncurses_ext_funcs=yes
13473 else
13474   echo "$as_me: failed program was:" >&5
13475 cat conftest.$ac_ext >&5
13476 cf_cv_ncurses_ext_funcs=no
13477 fi
13478 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13479
13480 fi
13481 rm -f conftest.$ac_objext conftest.$ac_ext
13482
13483 fi
13484 echo "$as_me:13484: result: $cf_cv_ncurses_ext_funcs" >&5
13485 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
13486 test "$cf_cv_ncurses_ext_funcs" = yes &&
13487 cat >>confdefs.h <<\EOF
13488 #define NCURSES_EXT_FUNCS 1
13489 EOF
13490
13491 if test "$cf_enable_widec" = yes
13492 then
13493         # workaround for systems with ncurses before 20111029, due to change of
13494         # feature test macro from _XPG5 to _XOPEN_SOURCE
13495         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
13496         then
13497                 cf_define_xpg5=no
13498                 echo "$as_me:13498: checking if _XPG5 should be defined to enable wide-characters" >&5
13499 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
13500
13501                 cat >conftest.$ac_ext <<_ACEOF
13502 #line 13502 "configure"
13503 #include "confdefs.h"
13504
13505 #include <${cf_cv_ncurses_header:-curses.h}>
13506 int
13507 main ()
13508 {
13509 int x = _XPG5
13510   ;
13511   return 0;
13512 }
13513 _ACEOF
13514 rm -f conftest.$ac_objext
13515 if { (eval echo "$as_me:13515: \"$ac_compile\"") >&5
13516   (eval $ac_compile) 2>&5
13517   ac_status=$?
13518   echo "$as_me:13518: \$? = $ac_status" >&5
13519   (exit $ac_status); } &&
13520          { ac_try='test -s conftest.$ac_objext'
13521   { (eval echo "$as_me:13521: \"$ac_try\"") >&5
13522   (eval $ac_try) 2>&5
13523   ac_status=$?
13524   echo "$as_me:13524: \$? = $ac_status" >&5
13525   (exit $ac_status); }; }; then
13526   :
13527 else
13528   echo "$as_me: failed program was:" >&5
13529 cat conftest.$ac_ext >&5
13530 cf_save_cppflags="$CPPFLAGS"
13531                          CPPFLAGS="$CPPFLAGS -D_XPG5"
13532                          cat >conftest.$ac_ext <<_ACEOF
13533 #line 13533 "configure"
13534 #include "confdefs.h"
13535
13536 #include <${cf_cv_ncurses_header:-curses.h}>
13537 int
13538 main ()
13539 {
13540 int x = _XPG5
13541   ;
13542   return 0;
13543 }
13544 _ACEOF
13545 rm -f conftest.$ac_objext
13546 if { (eval echo "$as_me:13546: \"$ac_compile\"") >&5
13547   (eval $ac_compile) 2>&5
13548   ac_status=$?
13549   echo "$as_me:13549: \$? = $ac_status" >&5
13550   (exit $ac_status); } &&
13551          { ac_try='test -s conftest.$ac_objext'
13552   { (eval echo "$as_me:13552: \"$ac_try\"") >&5
13553   (eval $ac_try) 2>&5
13554   ac_status=$?
13555   echo "$as_me:13555: \$? = $ac_status" >&5
13556   (exit $ac_status); }; }; then
13557   cf_define_xpg5=yes
13558 else
13559   echo "$as_me: failed program was:" >&5
13560 cat conftest.$ac_ext >&5
13561 fi
13562 rm -f conftest.$ac_objext conftest.$ac_ext
13563                          CPPFLAGS="$cf_save_cppflags"
13564 fi
13565 rm -f conftest.$ac_objext conftest.$ac_ext
13566                 echo "$as_me:13566: result: $cf_define_xpg5" >&5
13567 echo "${ECHO_T}$cf_define_xpg5" >&6
13568
13569                 if test "$cf_define_xpg5" = yes
13570                 then
13571                         CPPFLAGS="$CPPFLAGS -D_XPG5"
13572                 fi
13573         fi
13574
13575         echo "$as_me:13575: checking for wide-character functions" >&5
13576 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
13577 if test "${cf_cv_widechar_funcs+set}" = set; then
13578   echo $ECHO_N "(cached) $ECHO_C" >&6
13579 else
13580
13581         cat >conftest.$ac_ext <<_ACEOF
13582 #line 13582 "configure"
13583 #include "confdefs.h"
13584
13585 #include <${cf_cv_ncurses_header:-curses.h}>
13586 int
13587 main ()
13588 {
13589
13590                 static wchar_t src_wchar[2];
13591                 static cchar_t dst_cchar;
13592                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
13593
13594   ;
13595   return 0;
13596 }
13597 _ACEOF
13598 rm -f conftest.$ac_objext conftest$ac_exeext
13599 if { (eval echo "$as_me:13599: \"$ac_link\"") >&5
13600   (eval $ac_link) 2>&5
13601   ac_status=$?
13602   echo "$as_me:13602: \$? = $ac_status" >&5
13603   (exit $ac_status); } &&
13604          { ac_try='test -s conftest$ac_exeext'
13605   { (eval echo "$as_me:13605: \"$ac_try\"") >&5
13606   (eval $ac_try) 2>&5
13607   ac_status=$?
13608   echo "$as_me:13608: \$? = $ac_status" >&5
13609   (exit $ac_status); }; }; then
13610   cf_cv_widechar_funcs=yes
13611 else
13612   echo "$as_me: failed program was:" >&5
13613 cat conftest.$ac_ext >&5
13614 cf_cv_widechar_funcs=no
13615 fi
13616 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13617
13618 fi
13619 echo "$as_me:13619: result: $cf_cv_widechar_funcs" >&5
13620 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
13621         if test "$cf_cv_widechar_funcs" != no ; then
13622
13623 cat >>confdefs.h <<\EOF
13624 #define USE_WIDEC_SUPPORT 1
13625 EOF
13626
13627         else
13628                 cat >>confdefs.h <<\EOF
13629 #define USE_WIDEC_SUPPORT 0
13630 EOF
13631
13632         fi
13633 else
13634         cat >>confdefs.h <<\EOF
13635 #define USE_WIDEC_SUPPORT 0
13636 EOF
13637
13638 fi
13639
13640 echo "$as_me:13640: checking if sys/time.h works with sys/select.h" >&5
13641 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
13642 if test "${cf_cv_sys_time_select+set}" = set; then
13643   echo $ECHO_N "(cached) $ECHO_C" >&6
13644 else
13645
13646 cat >conftest.$ac_ext <<_ACEOF
13647 #line 13647 "configure"
13648 #include "confdefs.h"
13649
13650 #include <sys/types.h>
13651 #ifdef HAVE_SYS_TIME_H
13652 #include <sys/time.h>
13653 #endif
13654 #ifdef HAVE_SYS_SELECT_H
13655 #include <sys/select.h>
13656 #endif
13657
13658 int
13659 main ()
13660 {
13661
13662   ;
13663   return 0;
13664 }
13665 _ACEOF
13666 rm -f conftest.$ac_objext
13667 if { (eval echo "$as_me:13667: \"$ac_compile\"") >&5
13668   (eval $ac_compile) 2>&5
13669   ac_status=$?
13670   echo "$as_me:13670: \$? = $ac_status" >&5
13671   (exit $ac_status); } &&
13672          { ac_try='test -s conftest.$ac_objext'
13673   { (eval echo "$as_me:13673: \"$ac_try\"") >&5
13674   (eval $ac_try) 2>&5
13675   ac_status=$?
13676   echo "$as_me:13676: \$? = $ac_status" >&5
13677   (exit $ac_status); }; }; then
13678   cf_cv_sys_time_select=yes
13679 else
13680   echo "$as_me: failed program was:" >&5
13681 cat conftest.$ac_ext >&5
13682 cf_cv_sys_time_select=no
13683 fi
13684 rm -f conftest.$ac_objext conftest.$ac_ext
13685
13686 fi
13687
13688 echo "$as_me:13688: result: $cf_cv_sys_time_select" >&5
13689 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
13690 test "$cf_cv_sys_time_select" = yes &&
13691 cat >>confdefs.h <<\EOF
13692 #define HAVE_SYS_TIME_SELECT 1
13693 EOF
13694
13695 echo "$as_me:13695: checking for function curses_version" >&5
13696 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
13697 if test "${cf_cv_func_curses_version+set}" = set; then
13698   echo $ECHO_N "(cached) $ECHO_C" >&6
13699 else
13700
13701 if test "$cross_compiling" = yes; then
13702   cf_cv_func_curses_version=unknown
13703 else
13704   cat >conftest.$ac_ext <<_ACEOF
13705 #line 13705 "configure"
13706 #include "confdefs.h"
13707
13708 #include <${cf_cv_ncurses_header:-curses.h}>
13709 int main()
13710 {
13711         char temp[1024];
13712         sprintf(temp, "%s\n", curses_version());
13713         ${cf_cv_main_return:-return}(0);
13714 }
13715
13716 _ACEOF
13717 rm -f conftest$ac_exeext
13718 if { (eval echo "$as_me:13718: \"$ac_link\"") >&5
13719   (eval $ac_link) 2>&5
13720   ac_status=$?
13721   echo "$as_me:13721: \$? = $ac_status" >&5
13722   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13723   { (eval echo "$as_me:13723: \"$ac_try\"") >&5
13724   (eval $ac_try) 2>&5
13725   ac_status=$?
13726   echo "$as_me:13726: \$? = $ac_status" >&5
13727   (exit $ac_status); }; }; then
13728   cf_cv_func_curses_version=yes
13729
13730 else
13731   echo "$as_me: program exited with status $ac_status" >&5
13732 echo "$as_me: failed program was:" >&5
13733 cat conftest.$ac_ext >&5
13734 cf_cv_func_curses_version=no
13735
13736 fi
13737 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13738 fi
13739 rm -f core
13740 fi
13741 echo "$as_me:13741: result: $cf_cv_func_curses_version" >&5
13742 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
13743 test "$cf_cv_func_curses_version" = yes &&
13744 cat >>confdefs.h <<\EOF
13745 #define HAVE_CURSES_VERSION 1
13746 EOF
13747
13748 echo "$as_me:13748: checking for alternate character set array" >&5
13749 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
13750 if test "${cf_cv_curses_acs_map+set}" = set; then
13751   echo $ECHO_N "(cached) $ECHO_C" >&6
13752 else
13753
13754 cf_cv_curses_acs_map=unknown
13755 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
13756 do
13757 cat >conftest.$ac_ext <<_ACEOF
13758 #line 13758 "configure"
13759 #include "confdefs.h"
13760
13761 #include <${cf_cv_ncurses_header:-curses.h}>
13762
13763 int
13764 main ()
13765 {
13766
13767 $name['k'] = ACS_PLUS
13768
13769   ;
13770   return 0;
13771 }
13772 _ACEOF
13773 rm -f conftest.$ac_objext conftest$ac_exeext
13774 if { (eval echo "$as_me:13774: \"$ac_link\"") >&5
13775   (eval $ac_link) 2>&5
13776   ac_status=$?
13777   echo "$as_me:13777: \$? = $ac_status" >&5
13778   (exit $ac_status); } &&
13779          { ac_try='test -s conftest$ac_exeext'
13780   { (eval echo "$as_me:13780: \"$ac_try\"") >&5
13781   (eval $ac_try) 2>&5
13782   ac_status=$?
13783   echo "$as_me:13783: \$? = $ac_status" >&5
13784   (exit $ac_status); }; }; then
13785   cf_cv_curses_acs_map=$name; break
13786 else
13787   echo "$as_me: failed program was:" >&5
13788 cat conftest.$ac_ext >&5
13789 fi
13790 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13791 done
13792
13793 fi
13794 echo "$as_me:13794: result: $cf_cv_curses_acs_map" >&5
13795 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
13796
13797 test "$cf_cv_curses_acs_map" != unknown &&
13798 cat >>confdefs.h <<EOF
13799 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
13800 EOF
13801
13802 if test "$cf_enable_widec" = yes; then
13803
13804 echo "$as_me:13804: checking for wide alternate character set array" >&5
13805 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
13806 if test "${cf_cv_curses_wacs_map+set}" = set; then
13807   echo $ECHO_N "(cached) $ECHO_C" >&6
13808 else
13809
13810         cf_cv_curses_wacs_map=unknown
13811         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
13812         do
13813         cat >conftest.$ac_ext <<_ACEOF
13814 #line 13814 "configure"
13815 #include "confdefs.h"
13816
13817 #ifndef _XOPEN_SOURCE_EXTENDED
13818 #define _XOPEN_SOURCE_EXTENDED
13819 #endif
13820 #include <${cf_cv_ncurses_header:-curses.h}>
13821 int
13822 main ()
13823 {
13824 void *foo = &($name['k'])
13825   ;
13826   return 0;
13827 }
13828 _ACEOF
13829 rm -f conftest.$ac_objext conftest$ac_exeext
13830 if { (eval echo "$as_me:13830: \"$ac_link\"") >&5
13831   (eval $ac_link) 2>&5
13832   ac_status=$?
13833   echo "$as_me:13833: \$? = $ac_status" >&5
13834   (exit $ac_status); } &&
13835          { ac_try='test -s conftest$ac_exeext'
13836   { (eval echo "$as_me:13836: \"$ac_try\"") >&5
13837   (eval $ac_try) 2>&5
13838   ac_status=$?
13839   echo "$as_me:13839: \$? = $ac_status" >&5
13840   (exit $ac_status); }; }; then
13841   cf_cv_curses_wacs_map=$name
13842          break
13843 else
13844   echo "$as_me: failed program was:" >&5
13845 cat conftest.$ac_ext >&5
13846 fi
13847 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13848         done
13849 fi
13850 echo "$as_me:13850: result: $cf_cv_curses_wacs_map" >&5
13851 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
13852
13853 test "$cf_cv_curses_wacs_map" != unknown &&
13854 cat >>confdefs.h <<EOF
13855 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
13856 EOF
13857
13858 echo "$as_me:13858: checking for wide alternate character constants" >&5
13859 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
13860 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
13861   echo $ECHO_N "(cached) $ECHO_C" >&6
13862 else
13863
13864 cf_cv_curses_wacs_symbols=no
13865 if test "$cf_cv_curses_wacs_map" != unknown
13866 then
13867         cat >conftest.$ac_ext <<_ACEOF
13868 #line 13868 "configure"
13869 #include "confdefs.h"
13870
13871 #ifndef _XOPEN_SOURCE_EXTENDED
13872 #define _XOPEN_SOURCE_EXTENDED
13873 #endif
13874 #include <${cf_cv_ncurses_header:-curses.h}>
13875 int
13876 main ()
13877 {
13878 cchar_t *foo = WACS_PLUS;
13879          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
13880   ;
13881   return 0;
13882 }
13883 _ACEOF
13884 rm -f conftest.$ac_objext conftest$ac_exeext
13885 if { (eval echo "$as_me:13885: \"$ac_link\"") >&5
13886   (eval $ac_link) 2>&5
13887   ac_status=$?
13888   echo "$as_me:13888: \$? = $ac_status" >&5
13889   (exit $ac_status); } &&
13890          { ac_try='test -s conftest$ac_exeext'
13891   { (eval echo "$as_me:13891: \"$ac_try\"") >&5
13892   (eval $ac_try) 2>&5
13893   ac_status=$?
13894   echo "$as_me:13894: \$? = $ac_status" >&5
13895   (exit $ac_status); }; }; then
13896   cf_cv_curses_wacs_symbols=yes
13897 else
13898   echo "$as_me: failed program was:" >&5
13899 cat conftest.$ac_ext >&5
13900 fi
13901 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13902 else
13903         cat >conftest.$ac_ext <<_ACEOF
13904 #line 13904 "configure"
13905 #include "confdefs.h"
13906
13907 #ifndef _XOPEN_SOURCE_EXTENDED
13908 #define _XOPEN_SOURCE_EXTENDED
13909 #endif
13910 #include <${cf_cv_ncurses_header:-curses.h}>
13911 int
13912 main ()
13913 {
13914 cchar_t *foo = WACS_PLUS
13915   ;
13916   return 0;
13917 }
13918 _ACEOF
13919 rm -f conftest.$ac_objext conftest$ac_exeext
13920 if { (eval echo "$as_me:13920: \"$ac_link\"") >&5
13921   (eval $ac_link) 2>&5
13922   ac_status=$?
13923   echo "$as_me:13923: \$? = $ac_status" >&5
13924   (exit $ac_status); } &&
13925          { ac_try='test -s conftest$ac_exeext'
13926   { (eval echo "$as_me:13926: \"$ac_try\"") >&5
13927   (eval $ac_try) 2>&5
13928   ac_status=$?
13929   echo "$as_me:13929: \$? = $ac_status" >&5
13930   (exit $ac_status); }; }; then
13931   cf_cv_curses_wacs_symbols=yes
13932 else
13933   echo "$as_me: failed program was:" >&5
13934 cat conftest.$ac_ext >&5
13935 fi
13936 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13937 fi
13938
13939 fi
13940 echo "$as_me:13940: result: $cf_cv_curses_wacs_symbols" >&5
13941 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
13942
13943 test "$cf_cv_curses_wacs_symbols" != no &&
13944 cat >>confdefs.h <<\EOF
13945 #define CURSES_WACS_SYMBOLS 1
13946 EOF
13947
13948 fi
13949
13950 echo "$as_me:13950: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
13951 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
13952 cat >conftest.$ac_ext <<_ACEOF
13953 #line 13953 "configure"
13954 #include "confdefs.h"
13955
13956 #ifndef _XOPEN_SOURCE_EXTENDED
13957 #define _XOPEN_SOURCE_EXTENDED
13958 #endif
13959 #include <${cf_cv_ncurses_header:-curses.h}>
13960 int
13961 main ()
13962 {
13963
13964 attr_t foo
13965
13966   ;
13967   return 0;
13968 }
13969 _ACEOF
13970 rm -f conftest.$ac_objext
13971 if { (eval echo "$as_me:13971: \"$ac_compile\"") >&5
13972   (eval $ac_compile) 2>&5
13973   ac_status=$?
13974   echo "$as_me:13974: \$? = $ac_status" >&5
13975   (exit $ac_status); } &&
13976          { ac_try='test -s conftest.$ac_objext'
13977   { (eval echo "$as_me:13977: \"$ac_try\"") >&5
13978   (eval $ac_try) 2>&5
13979   ac_status=$?
13980   echo "$as_me:13980: \$? = $ac_status" >&5
13981   (exit $ac_status); }; }; then
13982   cf_result=yes
13983 else
13984   echo "$as_me: failed program was:" >&5
13985 cat conftest.$ac_ext >&5
13986 cf_result=no
13987 fi
13988 rm -f conftest.$ac_objext conftest.$ac_ext
13989 echo "$as_me:13989: result: $cf_result" >&5
13990 echo "${ECHO_T}$cf_result" >&6
13991 if test $cf_result = yes ; then
13992
13993 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13994
13995 cat >>confdefs.h <<EOF
13996 #define $cf_result 1
13997 EOF
13998
13999 else
14000
14001 cat >>confdefs.h <<EOF
14002 #define attr_t long
14003 EOF
14004
14005 fi
14006
14007 if test "$cf_enable_widec" = yes; then
14008
14009 # This is needed on Tru64 5.0 to declare mbstate_t
14010 echo "$as_me:14010: checking if we must include wchar.h to declare mbstate_t" >&5
14011 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
14012 if test "${cf_cv_mbstate_t+set}" = set; then
14013   echo $ECHO_N "(cached) $ECHO_C" >&6
14014 else
14015
14016 cat >conftest.$ac_ext <<_ACEOF
14017 #line 14017 "configure"
14018 #include "confdefs.h"
14019
14020 #include <stdlib.h>
14021 #include <stdarg.h>
14022 #include <stdio.h>
14023 #ifdef HAVE_LIBUTF8_H
14024 #include <libutf8.h>
14025 #endif
14026 int
14027 main ()
14028 {
14029 mbstate_t state
14030   ;
14031   return 0;
14032 }
14033 _ACEOF
14034 rm -f conftest.$ac_objext
14035 if { (eval echo "$as_me:14035: \"$ac_compile\"") >&5
14036   (eval $ac_compile) 2>&5
14037   ac_status=$?
14038   echo "$as_me:14038: \$? = $ac_status" >&5
14039   (exit $ac_status); } &&
14040          { ac_try='test -s conftest.$ac_objext'
14041   { (eval echo "$as_me:14041: \"$ac_try\"") >&5
14042   (eval $ac_try) 2>&5
14043   ac_status=$?
14044   echo "$as_me:14044: \$? = $ac_status" >&5
14045   (exit $ac_status); }; }; then
14046   cf_cv_mbstate_t=no
14047 else
14048   echo "$as_me: failed program was:" >&5
14049 cat conftest.$ac_ext >&5
14050 cat >conftest.$ac_ext <<_ACEOF
14051 #line 14051 "configure"
14052 #include "confdefs.h"
14053
14054 #include <stdlib.h>
14055 #include <stdarg.h>
14056 #include <stdio.h>
14057 #include <wchar.h>
14058 #ifdef HAVE_LIBUTF8_H
14059 #include <libutf8.h>
14060 #endif
14061 int
14062 main ()
14063 {
14064 mbstate_t value
14065   ;
14066   return 0;
14067 }
14068 _ACEOF
14069 rm -f conftest.$ac_objext
14070 if { (eval echo "$as_me:14070: \"$ac_compile\"") >&5
14071   (eval $ac_compile) 2>&5
14072   ac_status=$?
14073   echo "$as_me:14073: \$? = $ac_status" >&5
14074   (exit $ac_status); } &&
14075          { ac_try='test -s conftest.$ac_objext'
14076   { (eval echo "$as_me:14076: \"$ac_try\"") >&5
14077   (eval $ac_try) 2>&5
14078   ac_status=$?
14079   echo "$as_me:14079: \$? = $ac_status" >&5
14080   (exit $ac_status); }; }; then
14081   cf_cv_mbstate_t=yes
14082 else
14083   echo "$as_me: failed program was:" >&5
14084 cat conftest.$ac_ext >&5
14085 cf_cv_mbstate_t=unknown
14086 fi
14087 rm -f conftest.$ac_objext conftest.$ac_ext
14088 fi
14089 rm -f conftest.$ac_objext conftest.$ac_ext
14090 fi
14091 echo "$as_me:14091: result: $cf_cv_mbstate_t" >&5
14092 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
14093
14094 if test "$cf_cv_mbstate_t" = yes ; then
14095
14096 cat >>confdefs.h <<\EOF
14097 #define NEED_WCHAR_H 1
14098 EOF
14099
14100         NEED_WCHAR_H=1
14101 fi
14102
14103 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
14104 if test "$cf_cv_mbstate_t" = unknown ; then
14105         NCURSES_MBSTATE_T=1
14106 fi
14107
14108 # if we find mbstate_t in either place, use substitution to provide a fallback.
14109 if test "$cf_cv_mbstate_t" != unknown ; then
14110         NCURSES_OK_MBSTATE_T=1
14111 fi
14112
14113 # This is needed on Tru64 5.0 to declare wchar_t
14114 echo "$as_me:14114: checking if we must include wchar.h to declare wchar_t" >&5
14115 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
14116 if test "${cf_cv_wchar_t+set}" = set; then
14117   echo $ECHO_N "(cached) $ECHO_C" >&6
14118 else
14119
14120 cat >conftest.$ac_ext <<_ACEOF
14121 #line 14121 "configure"
14122 #include "confdefs.h"
14123
14124 #include <stdlib.h>
14125 #include <stdarg.h>
14126 #include <stdio.h>
14127 #ifdef HAVE_LIBUTF8_H
14128 #include <libutf8.h>
14129 #endif
14130 int
14131 main ()
14132 {
14133 wchar_t state
14134   ;
14135   return 0;
14136 }
14137 _ACEOF
14138 rm -f conftest.$ac_objext
14139 if { (eval echo "$as_me:14139: \"$ac_compile\"") >&5
14140   (eval $ac_compile) 2>&5
14141   ac_status=$?
14142   echo "$as_me:14142: \$? = $ac_status" >&5
14143   (exit $ac_status); } &&
14144          { ac_try='test -s conftest.$ac_objext'
14145   { (eval echo "$as_me:14145: \"$ac_try\"") >&5
14146   (eval $ac_try) 2>&5
14147   ac_status=$?
14148   echo "$as_me:14148: \$? = $ac_status" >&5
14149   (exit $ac_status); }; }; then
14150   cf_cv_wchar_t=no
14151 else
14152   echo "$as_me: failed program was:" >&5
14153 cat conftest.$ac_ext >&5
14154 cat >conftest.$ac_ext <<_ACEOF
14155 #line 14155 "configure"
14156 #include "confdefs.h"
14157
14158 #include <stdlib.h>
14159 #include <stdarg.h>
14160 #include <stdio.h>
14161 #include <wchar.h>
14162 #ifdef HAVE_LIBUTF8_H
14163 #include <libutf8.h>
14164 #endif
14165 int
14166 main ()
14167 {
14168 wchar_t value
14169   ;
14170   return 0;
14171 }
14172 _ACEOF
14173 rm -f conftest.$ac_objext
14174 if { (eval echo "$as_me:14174: \"$ac_compile\"") >&5
14175   (eval $ac_compile) 2>&5
14176   ac_status=$?
14177   echo "$as_me:14177: \$? = $ac_status" >&5
14178   (exit $ac_status); } &&
14179          { ac_try='test -s conftest.$ac_objext'
14180   { (eval echo "$as_me:14180: \"$ac_try\"") >&5
14181   (eval $ac_try) 2>&5
14182   ac_status=$?
14183   echo "$as_me:14183: \$? = $ac_status" >&5
14184   (exit $ac_status); }; }; then
14185   cf_cv_wchar_t=yes
14186 else
14187   echo "$as_me: failed program was:" >&5
14188 cat conftest.$ac_ext >&5
14189 cf_cv_wchar_t=unknown
14190 fi
14191 rm -f conftest.$ac_objext conftest.$ac_ext
14192 fi
14193 rm -f conftest.$ac_objext conftest.$ac_ext
14194 fi
14195 echo "$as_me:14195: result: $cf_cv_wchar_t" >&5
14196 echo "${ECHO_T}$cf_cv_wchar_t" >&6
14197
14198 if test "$cf_cv_wchar_t" = yes ; then
14199
14200 cat >>confdefs.h <<\EOF
14201 #define NEED_WCHAR_H 1
14202 EOF
14203
14204         NEED_WCHAR_H=1
14205 fi
14206
14207 # if we do not find wchar_t in either place, use substitution to provide a fallback.
14208 if test "$cf_cv_wchar_t" = unknown ; then
14209         NCURSES_WCHAR_T=1
14210 fi
14211
14212 # if we find wchar_t in either place, use substitution to provide a fallback.
14213 if test "$cf_cv_wchar_t" != unknown ; then
14214         NCURSES_OK_WCHAR_T=1
14215 fi
14216
14217 # This is needed on Tru64 5.0 to declare wint_t
14218 echo "$as_me:14218: checking if we must include wchar.h to declare wint_t" >&5
14219 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
14220 if test "${cf_cv_wint_t+set}" = set; then
14221   echo $ECHO_N "(cached) $ECHO_C" >&6
14222 else
14223
14224 cat >conftest.$ac_ext <<_ACEOF
14225 #line 14225 "configure"
14226 #include "confdefs.h"
14227
14228 #include <stdlib.h>
14229 #include <stdarg.h>
14230 #include <stdio.h>
14231 #ifdef HAVE_LIBUTF8_H
14232 #include <libutf8.h>
14233 #endif
14234 int
14235 main ()
14236 {
14237 wint_t state
14238   ;
14239   return 0;
14240 }
14241 _ACEOF
14242 rm -f conftest.$ac_objext
14243 if { (eval echo "$as_me:14243: \"$ac_compile\"") >&5
14244   (eval $ac_compile) 2>&5
14245   ac_status=$?
14246   echo "$as_me:14246: \$? = $ac_status" >&5
14247   (exit $ac_status); } &&
14248          { ac_try='test -s conftest.$ac_objext'
14249   { (eval echo "$as_me:14249: \"$ac_try\"") >&5
14250   (eval $ac_try) 2>&5
14251   ac_status=$?
14252   echo "$as_me:14252: \$? = $ac_status" >&5
14253   (exit $ac_status); }; }; then
14254   cf_cv_wint_t=no
14255 else
14256   echo "$as_me: failed program was:" >&5
14257 cat conftest.$ac_ext >&5
14258 cat >conftest.$ac_ext <<_ACEOF
14259 #line 14259 "configure"
14260 #include "confdefs.h"
14261
14262 #include <stdlib.h>
14263 #include <stdarg.h>
14264 #include <stdio.h>
14265 #include <wchar.h>
14266 #ifdef HAVE_LIBUTF8_H
14267 #include <libutf8.h>
14268 #endif
14269 int
14270 main ()
14271 {
14272 wint_t value
14273   ;
14274   return 0;
14275 }
14276 _ACEOF
14277 rm -f conftest.$ac_objext
14278 if { (eval echo "$as_me:14278: \"$ac_compile\"") >&5
14279   (eval $ac_compile) 2>&5
14280   ac_status=$?
14281   echo "$as_me:14281: \$? = $ac_status" >&5
14282   (exit $ac_status); } &&
14283          { ac_try='test -s conftest.$ac_objext'
14284   { (eval echo "$as_me:14284: \"$ac_try\"") >&5
14285   (eval $ac_try) 2>&5
14286   ac_status=$?
14287   echo "$as_me:14287: \$? = $ac_status" >&5
14288   (exit $ac_status); }; }; then
14289   cf_cv_wint_t=yes
14290 else
14291   echo "$as_me: failed program was:" >&5
14292 cat conftest.$ac_ext >&5
14293 cf_cv_wint_t=unknown
14294 fi
14295 rm -f conftest.$ac_objext conftest.$ac_ext
14296 fi
14297 rm -f conftest.$ac_objext conftest.$ac_ext
14298 fi
14299 echo "$as_me:14299: result: $cf_cv_wint_t" >&5
14300 echo "${ECHO_T}$cf_cv_wint_t" >&6
14301
14302 if test "$cf_cv_wint_t" = yes ; then
14303
14304 cat >>confdefs.h <<\EOF
14305 #define NEED_WCHAR_H 1
14306 EOF
14307
14308         NEED_WCHAR_H=1
14309 fi
14310
14311 # if we do not find wint_t in either place, use substitution to provide a fallback.
14312 if test "$cf_cv_wint_t" = unknown ; then
14313         NCURSES_WINT_T=1
14314 fi
14315
14316 # if we find wint_t in either place, use substitution to provide a fallback.
14317 if test "$cf_cv_wint_t" != unknown ; then
14318         NCURSES_OK_WINT_T=1
14319 fi
14320
14321         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
14322
14323 echo "$as_me:14323: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14324 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14325 cat >conftest.$ac_ext <<_ACEOF
14326 #line 14326 "configure"
14327 #include "confdefs.h"
14328
14329 #ifndef _XOPEN_SOURCE_EXTENDED
14330 #define _XOPEN_SOURCE_EXTENDED
14331 #endif
14332 #include <${cf_cv_ncurses_header:-curses.h}>
14333 int
14334 main ()
14335 {
14336
14337 mbstate_t foo
14338
14339   ;
14340   return 0;
14341 }
14342 _ACEOF
14343 rm -f conftest.$ac_objext
14344 if { (eval echo "$as_me:14344: \"$ac_compile\"") >&5
14345   (eval $ac_compile) 2>&5
14346   ac_status=$?
14347   echo "$as_me:14347: \$? = $ac_status" >&5
14348   (exit $ac_status); } &&
14349          { ac_try='test -s conftest.$ac_objext'
14350   { (eval echo "$as_me:14350: \"$ac_try\"") >&5
14351   (eval $ac_try) 2>&5
14352   ac_status=$?
14353   echo "$as_me:14353: \$? = $ac_status" >&5
14354   (exit $ac_status); }; }; then
14355   cf_result=yes
14356 else
14357   echo "$as_me: failed program was:" >&5
14358 cat conftest.$ac_ext >&5
14359 cf_result=no
14360 fi
14361 rm -f conftest.$ac_objext conftest.$ac_ext
14362 echo "$as_me:14362: result: $cf_result" >&5
14363 echo "${ECHO_T}$cf_result" >&6
14364 if test $cf_result = yes ; then
14365
14366 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14367
14368 cat >>confdefs.h <<EOF
14369 #define $cf_result 1
14370 EOF
14371
14372 else
14373
14374 cat >>confdefs.h <<EOF
14375 #define mbstate_t long
14376 EOF
14377
14378 fi
14379
14380         fi
14381
14382         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
14383
14384 echo "$as_me:14384: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14385 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14386 cat >conftest.$ac_ext <<_ACEOF
14387 #line 14387 "configure"
14388 #include "confdefs.h"
14389
14390 #ifndef _XOPEN_SOURCE_EXTENDED
14391 #define _XOPEN_SOURCE_EXTENDED
14392 #endif
14393 #include <${cf_cv_ncurses_header:-curses.h}>
14394 int
14395 main ()
14396 {
14397
14398 wchar_t foo
14399
14400   ;
14401   return 0;
14402 }
14403 _ACEOF
14404 rm -f conftest.$ac_objext
14405 if { (eval echo "$as_me:14405: \"$ac_compile\"") >&5
14406   (eval $ac_compile) 2>&5
14407   ac_status=$?
14408   echo "$as_me:14408: \$? = $ac_status" >&5
14409   (exit $ac_status); } &&
14410          { ac_try='test -s conftest.$ac_objext'
14411   { (eval echo "$as_me:14411: \"$ac_try\"") >&5
14412   (eval $ac_try) 2>&5
14413   ac_status=$?
14414   echo "$as_me:14414: \$? = $ac_status" >&5
14415   (exit $ac_status); }; }; then
14416   cf_result=yes
14417 else
14418   echo "$as_me: failed program was:" >&5
14419 cat conftest.$ac_ext >&5
14420 cf_result=no
14421 fi
14422 rm -f conftest.$ac_objext conftest.$ac_ext
14423 echo "$as_me:14423: result: $cf_result" >&5
14424 echo "${ECHO_T}$cf_result" >&6
14425 if test $cf_result = yes ; then
14426
14427 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14428
14429 cat >>confdefs.h <<EOF
14430 #define $cf_result 1
14431 EOF
14432
14433 else
14434
14435 cat >>confdefs.h <<EOF
14436 #define wchar_t long
14437 EOF
14438
14439 fi
14440
14441         fi
14442
14443         if test "$NCURSES_OK_WINT_T" = 0 ; then
14444
14445 echo "$as_me:14445: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14446 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14447 cat >conftest.$ac_ext <<_ACEOF
14448 #line 14448 "configure"
14449 #include "confdefs.h"
14450
14451 #ifndef _XOPEN_SOURCE_EXTENDED
14452 #define _XOPEN_SOURCE_EXTENDED
14453 #endif
14454 #include <${cf_cv_ncurses_header:-curses.h}>
14455 int
14456 main ()
14457 {
14458
14459 wint_t foo
14460
14461   ;
14462   return 0;
14463 }
14464 _ACEOF
14465 rm -f conftest.$ac_objext
14466 if { (eval echo "$as_me:14466: \"$ac_compile\"") >&5
14467   (eval $ac_compile) 2>&5
14468   ac_status=$?
14469   echo "$as_me:14469: \$? = $ac_status" >&5
14470   (exit $ac_status); } &&
14471          { ac_try='test -s conftest.$ac_objext'
14472   { (eval echo "$as_me:14472: \"$ac_try\"") >&5
14473   (eval $ac_try) 2>&5
14474   ac_status=$?
14475   echo "$as_me:14475: \$? = $ac_status" >&5
14476   (exit $ac_status); }; }; then
14477   cf_result=yes
14478 else
14479   echo "$as_me: failed program was:" >&5
14480 cat conftest.$ac_ext >&5
14481 cf_result=no
14482 fi
14483 rm -f conftest.$ac_objext conftest.$ac_ext
14484 echo "$as_me:14484: result: $cf_result" >&5
14485 echo "${ECHO_T}$cf_result" >&6
14486 if test $cf_result = yes ; then
14487
14488 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14489
14490 cat >>confdefs.h <<EOF
14491 #define $cf_result 1
14492 EOF
14493
14494 else
14495
14496 cat >>confdefs.h <<EOF
14497 #define wint_t long
14498 EOF
14499
14500 fi
14501
14502         fi
14503 fi
14504
14505 echo "$as_me:14505: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
14506 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14507
14508 cat >conftest.$ac_ext <<_ACEOF
14509 #line 14509 "configure"
14510 #include "confdefs.h"
14511
14512 #ifdef HAVE_XCURSES
14513 #include <xcurses.h>
14514 char * XCursesProgramName = "test";
14515 #else
14516 #include <${cf_cv_ncurses_header:-curses.h}>
14517 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14518 #include <ncursesw/term.h>
14519 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14520 #include <ncurses/term.h>
14521 #elif defined(HAVE_TERM_H)
14522 #include <term.h>
14523 #endif
14524 #endif
14525
14526 int
14527 main ()
14528 {
14529
14530 void *foo = &(boolnames)
14531
14532   ;
14533   return 0;
14534 }
14535 _ACEOF
14536 rm -f conftest.$ac_objext
14537 if { (eval echo "$as_me:14537: \"$ac_compile\"") >&5
14538   (eval $ac_compile) 2>&5
14539   ac_status=$?
14540   echo "$as_me:14540: \$? = $ac_status" >&5
14541   (exit $ac_status); } &&
14542          { ac_try='test -s conftest.$ac_objext'
14543   { (eval echo "$as_me:14543: \"$ac_try\"") >&5
14544   (eval $ac_try) 2>&5
14545   ac_status=$?
14546   echo "$as_me:14546: \$? = $ac_status" >&5
14547   (exit $ac_status); }; }; then
14548   cf_result=yes
14549 else
14550   echo "$as_me: failed program was:" >&5
14551 cat conftest.$ac_ext >&5
14552 cf_result=no
14553 fi
14554 rm -f conftest.$ac_objext conftest.$ac_ext
14555 echo "$as_me:14555: result: $cf_result" >&5
14556 echo "${ECHO_T}$cf_result" >&6
14557
14558 if test $cf_result = yes ; then
14559
14560 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14561
14562         cat >>confdefs.h <<EOF
14563 #define $cf_result 1
14564 EOF
14565
14566 else
14567         echo "$as_me:14567: checking for data boolnames in library" >&5
14568 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
14569         # BSD linkers insist on making weak linkage, but resolve at runtime.
14570         if test "$cross_compiling" = yes; then
14571
14572         # cross-compiling
14573         cat >conftest.$ac_ext <<_ACEOF
14574 #line 14574 "configure"
14575 #include "confdefs.h"
14576
14577 #ifdef HAVE_XCURSES
14578 #include <xcurses.h>
14579 char * XCursesProgramName = "test";
14580 #else
14581 #include <${cf_cv_ncurses_header:-curses.h}>
14582 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14583 #include <ncursesw/term.h>
14584 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14585 #include <ncurses/term.h>
14586 #elif defined(HAVE_TERM_H)
14587 #include <term.h>
14588 #endif
14589 #endif
14590
14591 extern char boolnames;
14592 int
14593 main ()
14594 {
14595
14596         do {
14597                 void *foo = &(boolnames);
14598                 ${cf_cv_main_return:-return}(foo == 0);
14599         } while (0)
14600
14601   ;
14602   return 0;
14603 }
14604 _ACEOF
14605 rm -f conftest.$ac_objext conftest$ac_exeext
14606 if { (eval echo "$as_me:14606: \"$ac_link\"") >&5
14607   (eval $ac_link) 2>&5
14608   ac_status=$?
14609   echo "$as_me:14609: \$? = $ac_status" >&5
14610   (exit $ac_status); } &&
14611          { ac_try='test -s conftest$ac_exeext'
14612   { (eval echo "$as_me:14612: \"$ac_try\"") >&5
14613   (eval $ac_try) 2>&5
14614   ac_status=$?
14615   echo "$as_me:14615: \$? = $ac_status" >&5
14616   (exit $ac_status); }; }; then
14617   cf_result=yes
14618 else
14619   echo "$as_me: failed program was:" >&5
14620 cat conftest.$ac_ext >&5
14621 cf_result=no
14622 fi
14623 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14624
14625 else
14626   cat >conftest.$ac_ext <<_ACEOF
14627 #line 14627 "configure"
14628 #include "confdefs.h"
14629
14630 #ifdef HAVE_XCURSES
14631 #include <xcurses.h>
14632 char * XCursesProgramName = "test";
14633 #else
14634 #include <${cf_cv_ncurses_header:-curses.h}>
14635 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14636 #include <ncursesw/term.h>
14637 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14638 #include <ncurses/term.h>
14639 #elif defined(HAVE_TERM_H)
14640 #include <term.h>
14641 #endif
14642 #endif
14643
14644 extern char boolnames;
14645 int main(void)
14646 {
14647         void *foo = &(boolnames);
14648         ${cf_cv_main_return:-return}(foo == 0);
14649 }
14650 _ACEOF
14651 rm -f conftest$ac_exeext
14652 if { (eval echo "$as_me:14652: \"$ac_link\"") >&5
14653   (eval $ac_link) 2>&5
14654   ac_status=$?
14655   echo "$as_me:14655: \$? = $ac_status" >&5
14656   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14657   { (eval echo "$as_me:14657: \"$ac_try\"") >&5
14658   (eval $ac_try) 2>&5
14659   ac_status=$?
14660   echo "$as_me:14660: \$? = $ac_status" >&5
14661   (exit $ac_status); }; }; then
14662   cf_result=yes
14663 else
14664   echo "$as_me: program exited with status $ac_status" >&5
14665 echo "$as_me: failed program was:" >&5
14666 cat conftest.$ac_ext >&5
14667 cf_result=no
14668 fi
14669 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14670 fi
14671         echo "$as_me:14671: result: $cf_result" >&5
14672 echo "${ECHO_T}$cf_result" >&6
14673         if test $cf_result = yes ; then
14674
14675 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14676
14677                 cat >>confdefs.h <<EOF
14678 #define $cf_result 1
14679 EOF
14680
14681         fi
14682 fi
14683
14684 echo "$as_me:14684: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
14685 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14686
14687 cat >conftest.$ac_ext <<_ACEOF
14688 #line 14688 "configure"
14689 #include "confdefs.h"
14690
14691 #ifdef HAVE_XCURSES
14692 #include <xcurses.h>
14693 char * XCursesProgramName = "test";
14694 #else
14695 #include <${cf_cv_ncurses_header:-curses.h}>
14696 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14697 #include <ncursesw/term.h>
14698 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14699 #include <ncurses/term.h>
14700 #elif defined(HAVE_TERM_H)
14701 #include <term.h>
14702 #endif
14703 #endif
14704
14705 int
14706 main ()
14707 {
14708
14709 void *foo = &(boolfnames)
14710
14711   ;
14712   return 0;
14713 }
14714 _ACEOF
14715 rm -f conftest.$ac_objext
14716 if { (eval echo "$as_me:14716: \"$ac_compile\"") >&5
14717   (eval $ac_compile) 2>&5
14718   ac_status=$?
14719   echo "$as_me:14719: \$? = $ac_status" >&5
14720   (exit $ac_status); } &&
14721          { ac_try='test -s conftest.$ac_objext'
14722   { (eval echo "$as_me:14722: \"$ac_try\"") >&5
14723   (eval $ac_try) 2>&5
14724   ac_status=$?
14725   echo "$as_me:14725: \$? = $ac_status" >&5
14726   (exit $ac_status); }; }; then
14727   cf_result=yes
14728 else
14729   echo "$as_me: failed program was:" >&5
14730 cat conftest.$ac_ext >&5
14731 cf_result=no
14732 fi
14733 rm -f conftest.$ac_objext conftest.$ac_ext
14734 echo "$as_me:14734: result: $cf_result" >&5
14735 echo "${ECHO_T}$cf_result" >&6
14736
14737 if test $cf_result = yes ; then
14738
14739 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14740
14741         cat >>confdefs.h <<EOF
14742 #define $cf_result 1
14743 EOF
14744
14745 else
14746         echo "$as_me:14746: checking for data boolfnames in library" >&5
14747 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
14748         # BSD linkers insist on making weak linkage, but resolve at runtime.
14749         if test "$cross_compiling" = yes; then
14750
14751         # cross-compiling
14752         cat >conftest.$ac_ext <<_ACEOF
14753 #line 14753 "configure"
14754 #include "confdefs.h"
14755
14756 #ifdef HAVE_XCURSES
14757 #include <xcurses.h>
14758 char * XCursesProgramName = "test";
14759 #else
14760 #include <${cf_cv_ncurses_header:-curses.h}>
14761 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14762 #include <ncursesw/term.h>
14763 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14764 #include <ncurses/term.h>
14765 #elif defined(HAVE_TERM_H)
14766 #include <term.h>
14767 #endif
14768 #endif
14769
14770 extern char boolfnames;
14771 int
14772 main ()
14773 {
14774
14775         do {
14776                 void *foo = &(boolfnames);
14777                 ${cf_cv_main_return:-return}(foo == 0);
14778         } while (0)
14779
14780   ;
14781   return 0;
14782 }
14783 _ACEOF
14784 rm -f conftest.$ac_objext conftest$ac_exeext
14785 if { (eval echo "$as_me:14785: \"$ac_link\"") >&5
14786   (eval $ac_link) 2>&5
14787   ac_status=$?
14788   echo "$as_me:14788: \$? = $ac_status" >&5
14789   (exit $ac_status); } &&
14790          { ac_try='test -s conftest$ac_exeext'
14791   { (eval echo "$as_me:14791: \"$ac_try\"") >&5
14792   (eval $ac_try) 2>&5
14793   ac_status=$?
14794   echo "$as_me:14794: \$? = $ac_status" >&5
14795   (exit $ac_status); }; }; then
14796   cf_result=yes
14797 else
14798   echo "$as_me: failed program was:" >&5
14799 cat conftest.$ac_ext >&5
14800 cf_result=no
14801 fi
14802 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14803
14804 else
14805   cat >conftest.$ac_ext <<_ACEOF
14806 #line 14806 "configure"
14807 #include "confdefs.h"
14808
14809 #ifdef HAVE_XCURSES
14810 #include <xcurses.h>
14811 char * XCursesProgramName = "test";
14812 #else
14813 #include <${cf_cv_ncurses_header:-curses.h}>
14814 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14815 #include <ncursesw/term.h>
14816 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14817 #include <ncurses/term.h>
14818 #elif defined(HAVE_TERM_H)
14819 #include <term.h>
14820 #endif
14821 #endif
14822
14823 extern char boolfnames;
14824 int main(void)
14825 {
14826         void *foo = &(boolfnames);
14827         ${cf_cv_main_return:-return}(foo == 0);
14828 }
14829 _ACEOF
14830 rm -f conftest$ac_exeext
14831 if { (eval echo "$as_me:14831: \"$ac_link\"") >&5
14832   (eval $ac_link) 2>&5
14833   ac_status=$?
14834   echo "$as_me:14834: \$? = $ac_status" >&5
14835   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14836   { (eval echo "$as_me:14836: \"$ac_try\"") >&5
14837   (eval $ac_try) 2>&5
14838   ac_status=$?
14839   echo "$as_me:14839: \$? = $ac_status" >&5
14840   (exit $ac_status); }; }; then
14841   cf_result=yes
14842 else
14843   echo "$as_me: program exited with status $ac_status" >&5
14844 echo "$as_me: failed program was:" >&5
14845 cat conftest.$ac_ext >&5
14846 cf_result=no
14847 fi
14848 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14849 fi
14850         echo "$as_me:14850: result: $cf_result" >&5
14851 echo "${ECHO_T}$cf_result" >&6
14852         if test $cf_result = yes ; then
14853
14854 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14855
14856                 cat >>confdefs.h <<EOF
14857 #define $cf_result 1
14858 EOF
14859
14860         fi
14861 fi
14862
14863 if ( test "$GCC" = yes || test "$GXX" = yes )
14864 then
14865 echo "$as_me:14865: checking if you want to turn on gcc warnings" >&5
14866 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
14867
14868 # Check whether --enable-warnings or --disable-warnings was given.
14869 if test "${enable_warnings+set}" = set; then
14870   enableval="$enable_warnings"
14871   test "$enableval" != yes && enableval=no
14872   if test "$enableval" != "no" ; then
14873     with_warnings=yes
14874   else
14875     with_warnings=no
14876   fi
14877 else
14878   enableval=no
14879   with_warnings=no
14880
14881 fi;
14882 echo "$as_me:14882: result: $with_warnings" >&5
14883 echo "${ECHO_T}$with_warnings" >&6
14884 if test "$with_warnings" = "yes"
14885 then
14886
14887 if test "$GCC" = yes
14888 then
14889 cat > conftest.i <<EOF
14890 #ifndef GCC_PRINTF
14891 #define GCC_PRINTF 0
14892 #endif
14893 #ifndef GCC_SCANF
14894 #define GCC_SCANF 0
14895 #endif
14896 #ifndef GCC_NORETURN
14897 #define GCC_NORETURN /* nothing */
14898 #endif
14899 #ifndef GCC_UNUSED
14900 #define GCC_UNUSED /* nothing */
14901 #endif
14902 EOF
14903 if test "$GCC" = yes
14904 then
14905         { echo "$as_me:14905: checking for $CC __attribute__ directives..." >&5
14906 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
14907 cat > conftest.$ac_ext <<EOF
14908 #line 14908 "${as_me:-configure}"
14909 #include "confdefs.h"
14910 #include "conftest.h"
14911 #include "conftest.i"
14912 #if     GCC_PRINTF
14913 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
14914 #else
14915 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
14916 #endif
14917 #if     GCC_SCANF
14918 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
14919 #else
14920 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
14921 #endif
14922 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
14923 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
14924 extern void foo(void) GCC_NORETURN;
14925 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
14926 EOF
14927         cf_printf_attribute=no
14928         cf_scanf_attribute=no
14929         for cf_attribute in scanf printf unused noreturn
14930         do
14931
14932 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14933
14934                 cf_directive="__attribute__(($cf_attribute))"
14935                 echo "checking for $CC $cf_directive" 1>&5
14936
14937                 case $cf_attribute in #(vi
14938                 printf) #(vi
14939                         cf_printf_attribute=yes
14940                         cat >conftest.h <<EOF
14941 #define GCC_$cf_ATTRIBUTE 1
14942 EOF
14943                         ;;
14944                 scanf) #(vi
14945                         cf_scanf_attribute=yes
14946                         cat >conftest.h <<EOF
14947 #define GCC_$cf_ATTRIBUTE 1
14948 EOF
14949                         ;;
14950                 *) #(vi
14951                         cat >conftest.h <<EOF
14952 #define GCC_$cf_ATTRIBUTE $cf_directive
14953 EOF
14954                         ;;
14955                 esac
14956
14957                 if { (eval echo "$as_me:14957: \"$ac_compile\"") >&5
14958   (eval $ac_compile) 2>&5
14959   ac_status=$?
14960   echo "$as_me:14960: \$? = $ac_status" >&5
14961   (exit $ac_status); }; then
14962                         test -n "$verbose" && echo "$as_me:14962: result: ... $cf_attribute" >&5
14963 echo "${ECHO_T}... $cf_attribute" >&6
14964                         cat conftest.h >>confdefs.h
14965                         case $cf_attribute in #(vi
14966                         noreturn) #(vi
14967
14968 cat >>confdefs.h <<EOF
14969 #define GCC_NORETURN $cf_directive
14970 EOF
14971
14972                                 ;;
14973                         printf) #(vi
14974                                 cf_value='/* nothing */'
14975                                 if test "$cf_printf_attribute" != no ; then
14976                                         cf_value='__attribute__((format(printf,fmt,var)))'
14977
14978 cat >>confdefs.h <<\EOF
14979 #define GCC_PRINTF 1
14980 EOF
14981
14982                                 fi
14983
14984 cat >>confdefs.h <<EOF
14985 #define GCC_PRINTFLIKE(fmt,var) $cf_value
14986 EOF
14987
14988                                 ;;
14989                         scanf) #(vi
14990                                 cf_value='/* nothing */'
14991                                 if test "$cf_scanf_attribute" != no ; then
14992                                         cf_value='__attribute__((format(scanf,fmt,var)))'
14993
14994 cat >>confdefs.h <<\EOF
14995 #define GCC_SCANF 1
14996 EOF
14997
14998                                 fi
14999
15000 cat >>confdefs.h <<EOF
15001 #define GCC_SCANFLIKE(fmt,var) $cf_value
15002 EOF
15003
15004                                 ;;
15005                         unused) #(vi
15006
15007 cat >>confdefs.h <<EOF
15008 #define GCC_UNUSED $cf_directive
15009 EOF
15010
15011                                 ;;
15012                         esac
15013                 fi
15014         done
15015 else
15016         fgrep define conftest.i >>confdefs.h
15017 fi
15018 rm -rf conftest*
15019 fi
15020
15021 INTEL_COMPILER=no
15022
15023 if test "$GCC" = yes ; then
15024         case $host_os in
15025         linux*|gnu*)
15026                 echo "$as_me:15026: checking if this is really Intel C compiler" >&5
15027 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
15028                 cf_save_CFLAGS="$CFLAGS"
15029                 CFLAGS="$CFLAGS -no-gcc"
15030                 cat >conftest.$ac_ext <<_ACEOF
15031 #line 15031 "configure"
15032 #include "confdefs.h"
15033
15034 int
15035 main ()
15036 {
15037
15038 #ifdef __INTEL_COMPILER
15039 #else
15040 make an error
15041 #endif
15042
15043   ;
15044   return 0;
15045 }
15046 _ACEOF
15047 rm -f conftest.$ac_objext
15048 if { (eval echo "$as_me:15048: \"$ac_compile\"") >&5
15049   (eval $ac_compile) 2>&5
15050   ac_status=$?
15051   echo "$as_me:15051: \$? = $ac_status" >&5
15052   (exit $ac_status); } &&
15053          { ac_try='test -s conftest.$ac_objext'
15054   { (eval echo "$as_me:15054: \"$ac_try\"") >&5
15055   (eval $ac_try) 2>&5
15056   ac_status=$?
15057   echo "$as_me:15057: \$? = $ac_status" >&5
15058   (exit $ac_status); }; }; then
15059   INTEL_COMPILER=yes
15060 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
15061
15062 else
15063   echo "$as_me: failed program was:" >&5
15064 cat conftest.$ac_ext >&5
15065 fi
15066 rm -f conftest.$ac_objext conftest.$ac_ext
15067                 CFLAGS="$cf_save_CFLAGS"
15068                 echo "$as_me:15068: result: $INTEL_COMPILER" >&5
15069 echo "${ECHO_T}$INTEL_COMPILER" >&6
15070                 ;;
15071         esac
15072 fi
15073
15074 CLANG_COMPILER=no
15075
15076 if test "$GCC" = yes ; then
15077         echo "$as_me:15077: checking if this is really Clang C compiler" >&5
15078 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
15079         cf_save_CFLAGS="$CFLAGS"
15080         CFLAGS="$CFLAGS -Qunused-arguments"
15081         cat >conftest.$ac_ext <<_ACEOF
15082 #line 15082 "configure"
15083 #include "confdefs.h"
15084
15085 int
15086 main ()
15087 {
15088
15089 #ifdef __clang__
15090 #else
15091 make an error
15092 #endif
15093
15094   ;
15095   return 0;
15096 }
15097 _ACEOF
15098 rm -f conftest.$ac_objext
15099 if { (eval echo "$as_me:15099: \"$ac_compile\"") >&5
15100   (eval $ac_compile) 2>&5
15101   ac_status=$?
15102   echo "$as_me:15102: \$? = $ac_status" >&5
15103   (exit $ac_status); } &&
15104          { ac_try='test -s conftest.$ac_objext'
15105   { (eval echo "$as_me:15105: \"$ac_try\"") >&5
15106   (eval $ac_try) 2>&5
15107   ac_status=$?
15108   echo "$as_me:15108: \$? = $ac_status" >&5
15109   (exit $ac_status); }; }; then
15110   CLANG_COMPILER=yes
15111 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
15112
15113 else
15114   echo "$as_me: failed program was:" >&5
15115 cat conftest.$ac_ext >&5
15116 fi
15117 rm -f conftest.$ac_objext conftest.$ac_ext
15118         CFLAGS="$cf_save_CFLAGS"
15119         echo "$as_me:15119: result: $CLANG_COMPILER" >&5
15120 echo "${ECHO_T}$CLANG_COMPILER" >&6
15121 fi
15122
15123 cat > conftest.$ac_ext <<EOF
15124 #line 15124 "${as_me:-configure}"
15125 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15126 EOF
15127
15128 if test "$INTEL_COMPILER" = yes
15129 then
15130 # The "-wdXXX" options suppress warnings:
15131 # remark #1419: external declaration in primary source file
15132 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15133 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15134 # remark #193: zero used for undefined preprocessing identifier
15135 # remark #593: variable "curs_sb_left_arrow" was set but never used
15136 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15137 # remark #869: parameter "tw" was never referenced
15138 # remark #981: operands are evaluated in unspecified order
15139 # warning #279: controlling expression is constant
15140
15141         { echo "$as_me:15141: checking for $CC warning options..." >&5
15142 echo "$as_me: checking for $CC warning options..." >&6;}
15143         cf_save_CFLAGS="$CFLAGS"
15144         EXTRA_CFLAGS="-Wall"
15145         for cf_opt in \
15146                 wd1419 \
15147                 wd1683 \
15148                 wd1684 \
15149                 wd193 \
15150                 wd593 \
15151                 wd279 \
15152                 wd810 \
15153                 wd869 \
15154                 wd981
15155         do
15156                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15157                 if { (eval echo "$as_me:15157: \"$ac_compile\"") >&5
15158   (eval $ac_compile) 2>&5
15159   ac_status=$?
15160   echo "$as_me:15160: \$? = $ac_status" >&5
15161   (exit $ac_status); }; then
15162                         test -n "$verbose" && echo "$as_me:15162: result: ... -$cf_opt" >&5
15163 echo "${ECHO_T}... -$cf_opt" >&6
15164                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15165                 fi
15166         done
15167         CFLAGS="$cf_save_CFLAGS"
15168
15169 elif test "$GCC" = yes
15170 then
15171         { echo "$as_me:15171: checking for $CC warning options..." >&5
15172 echo "$as_me: checking for $CC warning options..." >&6;}
15173         cf_save_CFLAGS="$CFLAGS"
15174         EXTRA_CFLAGS=
15175         cf_warn_CONST=""
15176         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15177         for cf_opt in W Wall \
15178                 Wbad-function-cast \
15179                 Wcast-align \
15180                 Wcast-qual \
15181                 Winline \
15182                 Wmissing-declarations \
15183                 Wmissing-prototypes \
15184                 Wnested-externs \
15185                 Wpointer-arith \
15186                 Wshadow \
15187                 Wstrict-prototypes \
15188                 Wundef $cf_warn_CONST
15189         do
15190                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15191                 if { (eval echo "$as_me:15191: \"$ac_compile\"") >&5
15192   (eval $ac_compile) 2>&5
15193   ac_status=$?
15194   echo "$as_me:15194: \$? = $ac_status" >&5
15195   (exit $ac_status); }; then
15196                         test -n "$verbose" && echo "$as_me:15196: result: ... -$cf_opt" >&5
15197 echo "${ECHO_T}... -$cf_opt" >&6
15198                         case $cf_opt in #(vi
15199                         Wcast-qual) #(vi
15200                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
15201                                 ;;
15202                         Winline) #(vi
15203                                 case $GCC_VERSION in
15204                                 [34].*)
15205                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15206
15207 echo "${as_me:-configure}:15207: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15208
15209                                         continue;;
15210                                 esac
15211                                 ;;
15212                         Wpointer-arith) #(vi
15213                                 case $GCC_VERSION in
15214                                 [12].*)
15215                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15216
15217 echo "${as_me:-configure}:15217: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15218
15219                                         continue;;
15220                                 esac
15221                                 ;;
15222                         esac
15223                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15224                 fi
15225         done
15226         CFLAGS="$cf_save_CFLAGS"
15227 fi
15228 rm -rf conftest*
15229
15230 fi
15231 fi
15232
15233 echo "$as_me:15233: checking if you want to use dmalloc for testing" >&5
15234 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
15235
15236 # Check whether --with-dmalloc or --without-dmalloc was given.
15237 if test "${with_dmalloc+set}" = set; then
15238   withval="$with_dmalloc"
15239
15240 cat >>confdefs.h <<EOF
15241 #define USE_DMALLOC 1
15242 EOF
15243
15244         : ${with_cflags:=-g}
15245         : ${with_no_leaks:=yes}
15246          with_dmalloc=yes
15247 else
15248   with_dmalloc=
15249 fi;
15250 echo "$as_me:15250: result: ${with_dmalloc:-no}" >&5
15251 echo "${ECHO_T}${with_dmalloc:-no}" >&6
15252
15253 case .$with_cflags in #(vi
15254 .*-g*)
15255         case .$CFLAGS in #(vi
15256         .*-g*) #(vi
15257                 ;;
15258         *)
15259
15260 cf_fix_cppflags=no
15261 cf_new_cflags=
15262 cf_new_cppflags=
15263 cf_new_extra_cppflags=
15264
15265 for cf_add_cflags in -g
15266 do
15267 case $cf_fix_cppflags in
15268 no)
15269         case $cf_add_cflags in #(vi
15270         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
15271                 case $cf_add_cflags in
15272                 -D*)
15273                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15274
15275                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15276                                 && test -z "${cf_tst_cflags}" \
15277                                 && cf_fix_cppflags=yes
15278
15279                         if test $cf_fix_cppflags = yes ; then
15280                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15281                                 continue
15282                         elif test "${cf_tst_cflags}" = "\"'" ; then
15283                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15284                                 continue
15285                         fi
15286                         ;;
15287                 esac
15288                 case "$CPPFLAGS" in
15289                 *$cf_add_cflags) #(vi
15290                         ;;
15291                 *) #(vi
15292                         case $cf_add_cflags in #(vi
15293                         -D*)
15294                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15295
15296 CPPFLAGS=`echo "$CPPFLAGS" | \
15297         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15298                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15299
15300                                 ;;
15301                         esac
15302                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
15303                         ;;
15304                 esac
15305                 ;;
15306         *)
15307                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
15308                 ;;
15309         esac
15310         ;;
15311 yes)
15312         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15313
15314         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15315
15316         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15317                 && test -z "${cf_tst_cflags}" \
15318                 && cf_fix_cppflags=no
15319         ;;
15320 esac
15321 done
15322
15323 if test -n "$cf_new_cflags" ; then
15324
15325         CFLAGS="$CFLAGS $cf_new_cflags"
15326 fi
15327
15328 if test -n "$cf_new_cppflags" ; then
15329
15330         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
15331 fi
15332
15333 if test -n "$cf_new_extra_cppflags" ; then
15334
15335         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
15336 fi
15337
15338                 ;;
15339         esac
15340         ;;
15341 esac
15342
15343 if test "$with_dmalloc" = yes ; then
15344         echo "$as_me:15344: checking for dmalloc.h" >&5
15345 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
15346 if test "${ac_cv_header_dmalloc_h+set}" = set; then
15347   echo $ECHO_N "(cached) $ECHO_C" >&6
15348 else
15349   cat >conftest.$ac_ext <<_ACEOF
15350 #line 15350 "configure"
15351 #include "confdefs.h"
15352 #include <dmalloc.h>
15353 _ACEOF
15354 if { (eval echo "$as_me:15354: \"$ac_cpp conftest.$ac_ext\"") >&5
15355   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15356   ac_status=$?
15357   egrep -v '^ *\+' conftest.er1 >conftest.err
15358   rm -f conftest.er1
15359   cat conftest.err >&5
15360   echo "$as_me:15360: \$? = $ac_status" >&5
15361   (exit $ac_status); } >/dev/null; then
15362   if test -s conftest.err; then
15363     ac_cpp_err=$ac_c_preproc_warn_flag
15364   else
15365     ac_cpp_err=
15366   fi
15367 else
15368   ac_cpp_err=yes
15369 fi
15370 if test -z "$ac_cpp_err"; then
15371   ac_cv_header_dmalloc_h=yes
15372 else
15373   echo "$as_me: failed program was:" >&5
15374   cat conftest.$ac_ext >&5
15375   ac_cv_header_dmalloc_h=no
15376 fi
15377 rm -f conftest.err conftest.$ac_ext
15378 fi
15379 echo "$as_me:15379: result: $ac_cv_header_dmalloc_h" >&5
15380 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
15381 if test $ac_cv_header_dmalloc_h = yes; then
15382
15383 echo "$as_me:15383: checking for dmalloc_debug in -ldmalloc" >&5
15384 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
15385 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
15386   echo $ECHO_N "(cached) $ECHO_C" >&6
15387 else
15388   ac_check_lib_save_LIBS=$LIBS
15389 LIBS="-ldmalloc  $LIBS"
15390 cat >conftest.$ac_ext <<_ACEOF
15391 #line 15391 "configure"
15392 #include "confdefs.h"
15393
15394 /* Override any gcc2 internal prototype to avoid an error.  */
15395 #ifdef __cplusplus
15396 extern "C"
15397 #endif
15398 /* We use char because int might match the return type of a gcc2
15399    builtin and then its argument prototype would still apply.  */
15400 char dmalloc_debug ();
15401 int
15402 main ()
15403 {
15404 dmalloc_debug ();
15405   ;
15406   return 0;
15407 }
15408 _ACEOF
15409 rm -f conftest.$ac_objext conftest$ac_exeext
15410 if { (eval echo "$as_me:15410: \"$ac_link\"") >&5
15411   (eval $ac_link) 2>&5
15412   ac_status=$?
15413   echo "$as_me:15413: \$? = $ac_status" >&5
15414   (exit $ac_status); } &&
15415          { ac_try='test -s conftest$ac_exeext'
15416   { (eval echo "$as_me:15416: \"$ac_try\"") >&5
15417   (eval $ac_try) 2>&5
15418   ac_status=$?
15419   echo "$as_me:15419: \$? = $ac_status" >&5
15420   (exit $ac_status); }; }; then
15421   ac_cv_lib_dmalloc_dmalloc_debug=yes
15422 else
15423   echo "$as_me: failed program was:" >&5
15424 cat conftest.$ac_ext >&5
15425 ac_cv_lib_dmalloc_dmalloc_debug=no
15426 fi
15427 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15428 LIBS=$ac_check_lib_save_LIBS
15429 fi
15430 echo "$as_me:15430: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
15431 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
15432 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
15433   cat >>confdefs.h <<EOF
15434 #define HAVE_LIBDMALLOC 1
15435 EOF
15436
15437   LIBS="-ldmalloc $LIBS"
15438
15439 fi
15440
15441 fi
15442
15443 fi
15444
15445 echo "$as_me:15445: checking if you want to use dbmalloc for testing" >&5
15446 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
15447
15448 # Check whether --with-dbmalloc or --without-dbmalloc was given.
15449 if test "${with_dbmalloc+set}" = set; then
15450   withval="$with_dbmalloc"
15451
15452 cat >>confdefs.h <<EOF
15453 #define USE_DBMALLOC 1
15454 EOF
15455
15456         : ${with_cflags:=-g}
15457         : ${with_no_leaks:=yes}
15458          with_dbmalloc=yes
15459 else
15460   with_dbmalloc=
15461 fi;
15462 echo "$as_me:15462: result: ${with_dbmalloc:-no}" >&5
15463 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
15464
15465 case .$with_cflags in #(vi
15466 .*-g*)
15467         case .$CFLAGS in #(vi
15468         .*-g*) #(vi
15469                 ;;
15470         *)
15471
15472 cf_fix_cppflags=no
15473 cf_new_cflags=
15474 cf_new_cppflags=
15475 cf_new_extra_cppflags=
15476
15477 for cf_add_cflags in -g
15478 do
15479 case $cf_fix_cppflags in
15480 no)
15481         case $cf_add_cflags in #(vi
15482         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
15483                 case $cf_add_cflags in
15484                 -D*)
15485                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15486
15487                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15488                                 && test -z "${cf_tst_cflags}" \
15489                                 && cf_fix_cppflags=yes
15490
15491                         if test $cf_fix_cppflags = yes ; then
15492                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15493                                 continue
15494                         elif test "${cf_tst_cflags}" = "\"'" ; then
15495                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15496                                 continue
15497                         fi
15498                         ;;
15499                 esac
15500                 case "$CPPFLAGS" in
15501                 *$cf_add_cflags) #(vi
15502                         ;;
15503                 *) #(vi
15504                         case $cf_add_cflags in #(vi
15505                         -D*)
15506                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15507
15508 CPPFLAGS=`echo "$CPPFLAGS" | \
15509         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15510                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15511
15512                                 ;;
15513                         esac
15514                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
15515                         ;;
15516                 esac
15517                 ;;
15518         *)
15519                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
15520                 ;;
15521         esac
15522         ;;
15523 yes)
15524         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15525
15526         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15527
15528         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15529                 && test -z "${cf_tst_cflags}" \
15530                 && cf_fix_cppflags=no
15531         ;;
15532 esac
15533 done
15534
15535 if test -n "$cf_new_cflags" ; then
15536
15537         CFLAGS="$CFLAGS $cf_new_cflags"
15538 fi
15539
15540 if test -n "$cf_new_cppflags" ; then
15541
15542         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
15543 fi
15544
15545 if test -n "$cf_new_extra_cppflags" ; then
15546
15547         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
15548 fi
15549
15550                 ;;
15551         esac
15552         ;;
15553 esac
15554
15555 if test "$with_dbmalloc" = yes ; then
15556         echo "$as_me:15556: checking for dbmalloc.h" >&5
15557 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
15558 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
15559   echo $ECHO_N "(cached) $ECHO_C" >&6
15560 else
15561   cat >conftest.$ac_ext <<_ACEOF
15562 #line 15562 "configure"
15563 #include "confdefs.h"
15564 #include <dbmalloc.h>
15565 _ACEOF
15566 if { (eval echo "$as_me:15566: \"$ac_cpp conftest.$ac_ext\"") >&5
15567   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15568   ac_status=$?
15569   egrep -v '^ *\+' conftest.er1 >conftest.err
15570   rm -f conftest.er1
15571   cat conftest.err >&5
15572   echo "$as_me:15572: \$? = $ac_status" >&5
15573   (exit $ac_status); } >/dev/null; then
15574   if test -s conftest.err; then
15575     ac_cpp_err=$ac_c_preproc_warn_flag
15576   else
15577     ac_cpp_err=
15578   fi
15579 else
15580   ac_cpp_err=yes
15581 fi
15582 if test -z "$ac_cpp_err"; then
15583   ac_cv_header_dbmalloc_h=yes
15584 else
15585   echo "$as_me: failed program was:" >&5
15586   cat conftest.$ac_ext >&5
15587   ac_cv_header_dbmalloc_h=no
15588 fi
15589 rm -f conftest.err conftest.$ac_ext
15590 fi
15591 echo "$as_me:15591: result: $ac_cv_header_dbmalloc_h" >&5
15592 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
15593 if test $ac_cv_header_dbmalloc_h = yes; then
15594
15595 echo "$as_me:15595: checking for debug_malloc in -ldbmalloc" >&5
15596 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
15597 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
15598   echo $ECHO_N "(cached) $ECHO_C" >&6
15599 else
15600   ac_check_lib_save_LIBS=$LIBS
15601 LIBS="-ldbmalloc  $LIBS"
15602 cat >conftest.$ac_ext <<_ACEOF
15603 #line 15603 "configure"
15604 #include "confdefs.h"
15605
15606 /* Override any gcc2 internal prototype to avoid an error.  */
15607 #ifdef __cplusplus
15608 extern "C"
15609 #endif
15610 /* We use char because int might match the return type of a gcc2
15611    builtin and then its argument prototype would still apply.  */
15612 char debug_malloc ();
15613 int
15614 main ()
15615 {
15616 debug_malloc ();
15617   ;
15618   return 0;
15619 }
15620 _ACEOF
15621 rm -f conftest.$ac_objext conftest$ac_exeext
15622 if { (eval echo "$as_me:15622: \"$ac_link\"") >&5
15623   (eval $ac_link) 2>&5
15624   ac_status=$?
15625   echo "$as_me:15625: \$? = $ac_status" >&5
15626   (exit $ac_status); } &&
15627          { ac_try='test -s conftest$ac_exeext'
15628   { (eval echo "$as_me:15628: \"$ac_try\"") >&5
15629   (eval $ac_try) 2>&5
15630   ac_status=$?
15631   echo "$as_me:15631: \$? = $ac_status" >&5
15632   (exit $ac_status); }; }; then
15633   ac_cv_lib_dbmalloc_debug_malloc=yes
15634 else
15635   echo "$as_me: failed program was:" >&5
15636 cat conftest.$ac_ext >&5
15637 ac_cv_lib_dbmalloc_debug_malloc=no
15638 fi
15639 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15640 LIBS=$ac_check_lib_save_LIBS
15641 fi
15642 echo "$as_me:15642: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
15643 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
15644 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
15645   cat >>confdefs.h <<EOF
15646 #define HAVE_LIBDBMALLOC 1
15647 EOF
15648
15649   LIBS="-ldbmalloc $LIBS"
15650
15651 fi
15652
15653 fi
15654
15655 fi
15656
15657 echo "$as_me:15657: checking if you want to use valgrind for testing" >&5
15658 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
15659
15660 # Check whether --with-valgrind or --without-valgrind was given.
15661 if test "${with_valgrind+set}" = set; then
15662   withval="$with_valgrind"
15663
15664 cat >>confdefs.h <<EOF
15665 #define USE_VALGRIND 1
15666 EOF
15667
15668         : ${with_cflags:=-g}
15669         : ${with_no_leaks:=yes}
15670          with_valgrind=yes
15671 else
15672   with_valgrind=
15673 fi;
15674 echo "$as_me:15674: result: ${with_valgrind:-no}" >&5
15675 echo "${ECHO_T}${with_valgrind:-no}" >&6
15676
15677 case .$with_cflags in #(vi
15678 .*-g*)
15679         case .$CFLAGS in #(vi
15680         .*-g*) #(vi
15681                 ;;
15682         *)
15683
15684 cf_fix_cppflags=no
15685 cf_new_cflags=
15686 cf_new_cppflags=
15687 cf_new_extra_cppflags=
15688
15689 for cf_add_cflags in -g
15690 do
15691 case $cf_fix_cppflags in
15692 no)
15693         case $cf_add_cflags in #(vi
15694         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
15695                 case $cf_add_cflags in
15696                 -D*)
15697                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15698
15699                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15700                                 && test -z "${cf_tst_cflags}" \
15701                                 && cf_fix_cppflags=yes
15702
15703                         if test $cf_fix_cppflags = yes ; then
15704                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15705                                 continue
15706                         elif test "${cf_tst_cflags}" = "\"'" ; then
15707                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15708                                 continue
15709                         fi
15710                         ;;
15711                 esac
15712                 case "$CPPFLAGS" in
15713                 *$cf_add_cflags) #(vi
15714                         ;;
15715                 *) #(vi
15716                         case $cf_add_cflags in #(vi
15717                         -D*)
15718                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15719
15720 CPPFLAGS=`echo "$CPPFLAGS" | \
15721         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15722                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15723
15724                                 ;;
15725                         esac
15726                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
15727                         ;;
15728                 esac
15729                 ;;
15730         *)
15731                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
15732                 ;;
15733         esac
15734         ;;
15735 yes)
15736         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
15737
15738         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15739
15740         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
15741                 && test -z "${cf_tst_cflags}" \
15742                 && cf_fix_cppflags=no
15743         ;;
15744 esac
15745 done
15746
15747 if test -n "$cf_new_cflags" ; then
15748
15749         CFLAGS="$CFLAGS $cf_new_cflags"
15750 fi
15751
15752 if test -n "$cf_new_cppflags" ; then
15753
15754         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
15755 fi
15756
15757 if test -n "$cf_new_extra_cppflags" ; then
15758
15759         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
15760 fi
15761
15762                 ;;
15763         esac
15764         ;;
15765 esac
15766
15767 echo "$as_me:15767: checking if you want to perform memory-leak testing" >&5
15768 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
15769
15770 # Check whether --enable-leaks or --disable-leaks was given.
15771 if test "${enable_leaks+set}" = set; then
15772   enableval="$enable_leaks"
15773   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
15774 else
15775   : ${with_no_leaks:=no}
15776 fi;
15777 echo "$as_me:15777: result: $with_no_leaks" >&5
15778 echo "${ECHO_T}$with_no_leaks" >&6
15779
15780 if test "$with_no_leaks" = yes ; then
15781
15782 cat >>confdefs.h <<\EOF
15783 #define NO_LEAKS 1
15784 EOF
15785
15786 cat >>confdefs.h <<\EOF
15787 #define YY_NO_LEAKS 1
15788 EOF
15789
15790 fi
15791
15792 LD_RPATH_OPT=
15793 echo "$as_me:15793: checking for an rpath option" >&5
15794 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
15795 case $cf_cv_system_name in #(vi
15796 irix*) #(vi
15797         if test "$GCC" = yes; then
15798                 LD_RPATH_OPT="-Wl,-rpath,"
15799         else
15800                 LD_RPATH_OPT="-rpath "
15801         fi
15802         ;;
15803 linux*|gnu*|k*bsd*-gnu) #(vi
15804         LD_RPATH_OPT="-Wl,-rpath,"
15805         ;;
15806 openbsd[2-9].*|mirbsd*) #(vi
15807         LD_RPATH_OPT="-Wl,-rpath,"
15808         ;;
15809 dragonfly*|freebsd*) #(vi
15810         LD_RPATH_OPT="-rpath "
15811         ;;
15812 netbsd*) #(vi
15813         LD_RPATH_OPT="-Wl,-rpath,"
15814         ;;
15815 osf*|mls+*) #(vi
15816         LD_RPATH_OPT="-rpath "
15817         ;;
15818 solaris2*) #(vi
15819         LD_RPATH_OPT="-R"
15820         ;;
15821 *)
15822         ;;
15823 esac
15824 echo "$as_me:15824: result: $LD_RPATH_OPT" >&5
15825 echo "${ECHO_T}$LD_RPATH_OPT" >&6
15826
15827 case "x$LD_RPATH_OPT" in #(vi
15828 x-R*)
15829         echo "$as_me:15829: checking if we need a space after rpath option" >&5
15830 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
15831         cf_save_LIBS="$LIBS"
15832         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
15833         cat >conftest.$ac_ext <<_ACEOF
15834 #line 15834 "configure"
15835 #include "confdefs.h"
15836
15837 int
15838 main ()
15839 {
15840
15841   ;
15842   return 0;
15843 }
15844 _ACEOF
15845 rm -f conftest.$ac_objext conftest$ac_exeext
15846 if { (eval echo "$as_me:15846: \"$ac_link\"") >&5
15847   (eval $ac_link) 2>&5
15848   ac_status=$?
15849   echo "$as_me:15849: \$? = $ac_status" >&5
15850   (exit $ac_status); } &&
15851          { ac_try='test -s conftest$ac_exeext'
15852   { (eval echo "$as_me:15852: \"$ac_try\"") >&5
15853   (eval $ac_try) 2>&5
15854   ac_status=$?
15855   echo "$as_me:15855: \$? = $ac_status" >&5
15856   (exit $ac_status); }; }; then
15857   cf_rpath_space=no
15858 else
15859   echo "$as_me: failed program was:" >&5
15860 cat conftest.$ac_ext >&5
15861 cf_rpath_space=yes
15862 fi
15863 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15864         LIBS="$cf_save_LIBS"
15865         echo "$as_me:15865: result: $cf_rpath_space" >&5
15866 echo "${ECHO_T}$cf_rpath_space" >&6
15867         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
15868         ;;
15869 esac
15870
15871 echo "$as_me:15871: checking if rpath-hack should be disabled" >&5
15872 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
15873
15874 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
15875 if test "${enable_rpath_hack+set}" = set; then
15876   enableval="$enable_rpath_hack"
15877   test "$enableval" != no && enableval=yes
15878   if test "$enableval" != "yes" ; then
15879     cf_disable_rpath_hack=yes
15880   else
15881     cf_disable_rpath_hack=no
15882   fi
15883 else
15884   enableval=yes
15885   cf_disable_rpath_hack=no
15886
15887 fi;
15888 echo "$as_me:15888: result: $cf_disable_rpath_hack" >&5
15889 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
15890 if test "$cf_disable_rpath_hack" = no ; then
15891
15892 echo "$as_me:15892: checking for updated LDFLAGS" >&5
15893 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
15894 if test -n "$LD_RPATH_OPT" ; then
15895         echo "$as_me:15895: result: maybe" >&5
15896 echo "${ECHO_T}maybe" >&6
15897
15898         for ac_prog in ldd
15899 do
15900   # Extract the first word of "$ac_prog", so it can be a program name with args.
15901 set dummy $ac_prog; ac_word=$2
15902 echo "$as_me:15902: checking for $ac_word" >&5
15903 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15904 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
15905   echo $ECHO_N "(cached) $ECHO_C" >&6
15906 else
15907   if test -n "$cf_ldd_prog"; then
15908   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
15909 else
15910   ac_save_IFS=$IFS; IFS=$ac_path_separator
15911 ac_dummy="$PATH"
15912 for ac_dir in $ac_dummy; do
15913   IFS=$ac_save_IFS
15914   test -z "$ac_dir" && ac_dir=.
15915   $as_executable_p "$ac_dir/$ac_word" || continue
15916 ac_cv_prog_cf_ldd_prog="$ac_prog"
15917 echo "$as_me:15917: found $ac_dir/$ac_word" >&5
15918 break
15919 done
15920
15921 fi
15922 fi
15923 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
15924 if test -n "$cf_ldd_prog"; then
15925   echo "$as_me:15925: result: $cf_ldd_prog" >&5
15926 echo "${ECHO_T}$cf_ldd_prog" >&6
15927 else
15928   echo "$as_me:15928: result: no" >&5
15929 echo "${ECHO_T}no" >&6
15930 fi
15931
15932   test -n "$cf_ldd_prog" && break
15933 done
15934 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
15935
15936         cf_rpath_list="/usr/lib /lib"
15937         if test "$cf_ldd_prog" != no
15938         then
15939                 cf_rpath_oops=
15940
15941 cat >conftest.$ac_ext <<_ACEOF
15942 #line 15942 "configure"
15943 #include "confdefs.h"
15944 #include <stdio.h>
15945 int
15946 main ()
15947 {
15948 printf("Hello");
15949   ;
15950   return 0;
15951 }
15952 _ACEOF
15953 rm -f conftest.$ac_objext conftest$ac_exeext
15954 if { (eval echo "$as_me:15954: \"$ac_link\"") >&5
15955   (eval $ac_link) 2>&5
15956   ac_status=$?
15957   echo "$as_me:15957: \$? = $ac_status" >&5
15958   (exit $ac_status); } &&
15959          { ac_try='test -s conftest$ac_exeext'
15960   { (eval echo "$as_me:15960: \"$ac_try\"") >&5
15961   (eval $ac_try) 2>&5
15962   ac_status=$?
15963   echo "$as_me:15963: \$? = $ac_status" >&5
15964   (exit $ac_status); }; }; then
15965   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u`
15966                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort -u`
15967 else
15968   echo "$as_me: failed program was:" >&5
15969 cat conftest.$ac_ext >&5
15970 fi
15971 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15972
15973                 # If we passed the link-test, but get a "not found" on a given library,
15974                 # this could be due to inept reconfiguration of gcc to make it only
15975                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
15976                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
15977                 # /usr/local libraries.
15978                 if test -n "$cf_rpath_oops"
15979                 then
15980                         for cf_rpath_src in $cf_rpath_oops
15981                         do
15982                                 for cf_rpath_dir in \
15983                                         /usr/local \
15984                                         /usr/pkg \
15985                                         /opt/sfw
15986                                 do
15987                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
15988                                         then
15989                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
15990
15991 echo "${as_me:-configure}:15991: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
15992
15993                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
15994                                                 break
15995                                         fi
15996                                 done
15997                         done
15998                 fi
15999         fi
16000
16001         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16002
16003 echo "${as_me:-configure}:16003: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16004
16005 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
16006
16007 echo "${as_me:-configure}:16007: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
16008
16009 cf_rpath_dst=
16010 for cf_rpath_src in $LDFLAGS
16011 do
16012         case $cf_rpath_src in #(vi
16013         -L*) #(vi
16014
16015                 # check if this refers to a directory which we will ignore
16016                 cf_rpath_skip=no
16017                 if test -n "$cf_rpath_list"
16018                 then
16019                         for cf_rpath_item in $cf_rpath_list
16020                         do
16021                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16022                                 then
16023                                         cf_rpath_skip=yes
16024                                         break
16025                                 fi
16026                         done
16027                 fi
16028
16029                 if test "$cf_rpath_skip" = no
16030                 then
16031                         # transform the option
16032                         if test "$LD_RPATH_OPT" = "-R " ; then
16033                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16034                         else
16035                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16036                         fi
16037
16038                         # if we have not already added this, add it now
16039                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16040                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16041                         then
16042                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16043
16044 echo "${as_me:-configure}:16044: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16045
16046                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16047                         fi
16048                 fi
16049                 ;;
16050         esac
16051         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16052 done
16053 LDFLAGS=$cf_rpath_dst
16054
16055 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
16056
16057 echo "${as_me:-configure}:16057: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
16058
16059 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
16060
16061 echo "${as_me:-configure}:16061: testing ...checking LIBS $LIBS ..." 1>&5
16062
16063 cf_rpath_dst=
16064 for cf_rpath_src in $LIBS
16065 do
16066         case $cf_rpath_src in #(vi
16067         -L*) #(vi
16068
16069                 # check if this refers to a directory which we will ignore
16070                 cf_rpath_skip=no
16071                 if test -n "$cf_rpath_list"
16072                 then
16073                         for cf_rpath_item in $cf_rpath_list
16074                         do
16075                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16076                                 then
16077                                         cf_rpath_skip=yes
16078                                         break
16079                                 fi
16080                         done
16081                 fi
16082
16083                 if test "$cf_rpath_skip" = no
16084                 then
16085                         # transform the option
16086                         if test "$LD_RPATH_OPT" = "-R " ; then
16087                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16088                         else
16089                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16090                         fi
16091
16092                         # if we have not already added this, add it now
16093                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16094                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16095                         then
16096                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16097
16098 echo "${as_me:-configure}:16098: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16099
16100                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16101                         fi
16102                 fi
16103                 ;;
16104         esac
16105         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16106 done
16107 LIBS=$cf_rpath_dst
16108
16109 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
16110
16111 echo "${as_me:-configure}:16111: testing ...checked LIBS $LIBS ..." 1>&5
16112
16113         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16114
16115 echo "${as_me:-configure}:16115: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16116
16117 fi
16118
16119 fi
16120
16121 TEST_ARGS="$LIBS"
16122 LIBS=
16123
16124 ac_config_files="$ac_config_files Makefile"
16125 ac_config_commands="$ac_config_commands default"
16126 cat >confcache <<\_ACEOF
16127 # This file is a shell script that caches the results of configure
16128 # tests run on this system so they can be shared between configure
16129 # scripts and configure runs, see configure's option --config-cache.
16130 # It is not useful on other systems.  If it contains results you don't
16131 # want to keep, you may remove or edit it.
16132 #
16133 # config.status only pays attention to the cache file if you give it
16134 # the --recheck option to rerun configure.
16135 #
16136 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16137 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16138 # following values.
16139
16140 _ACEOF
16141
16142 # The following way of writing the cache mishandles newlines in values,
16143 # but we know of no workaround that is simple, portable, and efficient.
16144 # So, don't put newlines in cache variables' values.
16145 # Ultrix sh set writes to stderr and can't be redirected directly,
16146 # and sets the high bit in the cache file unless we assign to the vars.
16147 {
16148   (set) 2>&1 |
16149     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16150     *ac_space=\ *)
16151       # `set' does not quote correctly, so add quotes (double-quote
16152       # substitution turns \\\\ into \\, and sed turns \\ into \).
16153       sed -n \
16154         "s/'/'\\\\''/g;
16155           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16156       ;;
16157     *)
16158       # `set' quotes correctly as required by POSIX, so do not add quotes.
16159       sed -n \
16160         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16161       ;;
16162     esac;
16163 } |
16164   sed '
16165      t clear
16166      : clear
16167      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16168      t end
16169      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16170      : end' >>confcache
16171 if cmp -s $cache_file confcache; then :; else
16172   if test -w $cache_file; then
16173     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16174     cat confcache >$cache_file
16175   else
16176     echo "not updating unwritable cache $cache_file"
16177   fi
16178 fi
16179 rm -f confcache
16180
16181 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16182 # Let make expand exec_prefix.
16183 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16184
16185 # VPATH may cause trouble with some makes, so we remove $(srcdir),
16186 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
16187 # trailing colons and then remove the whole line if VPATH becomes empty
16188 # (actually we leave an empty line to preserve line numbers).
16189 if test "x$srcdir" = x.; then
16190   ac_vpsub='/^[         ]*VPATH[        ]*=/{
16191 s/:*\$(srcdir):*/:/;
16192 s/:*\${srcdir}:*/:/;
16193 s/:*@srcdir@:*/:/;
16194 s/^\([^=]*=[    ]*\):*/\1/;
16195 s/:*$//;
16196 s/^[^=]*=[      ]*$//;
16197 }'
16198 fi
16199
16200 DEFS=-DHAVE_CONFIG_H
16201
16202 : ${CONFIG_STATUS=./config.status}
16203 ac_clean_files_save=$ac_clean_files
16204 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16205 { echo "$as_me:16205: creating $CONFIG_STATUS" >&5
16206 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16207 cat >$CONFIG_STATUS <<_ACEOF
16208 #! $SHELL
16209 # Generated automatically by configure.
16210 # Run this file to recreate the current configuration.
16211 # Compiler output produced by configure, useful for debugging
16212 # configure, is in config.log if it exists.
16213
16214 debug=false
16215 SHELL=\${CONFIG_SHELL-$SHELL}
16216 ac_cs_invocation="\$0 \$@"
16217
16218 _ACEOF
16219
16220 cat >>$CONFIG_STATUS <<\_ACEOF
16221 # Be Bourne compatible
16222 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16223   emulate sh
16224   NULLCMD=:
16225 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16226   set -o posix
16227 fi
16228
16229 # Name of the executable.
16230 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16231
16232 if expr a : '\(a\)' >/dev/null 2>&1; then
16233   as_expr=expr
16234 else
16235   as_expr=false
16236 fi
16237
16238 rm -f conf$$ conf$$.exe conf$$.file
16239 echo >conf$$.file
16240 if ln -s conf$$.file conf$$ 2>/dev/null; then
16241   # We could just check for DJGPP; but this test a) works b) is more generic
16242   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16243   if test -f conf$$.exe; then
16244     # Don't use ln at all; we don't have any links
16245     as_ln_s='cp -p'
16246   else
16247     as_ln_s='ln -s'
16248   fi
16249 elif ln conf$$.file conf$$ 2>/dev/null; then
16250   as_ln_s=ln
16251 else
16252   as_ln_s='cp -p'
16253 fi
16254 rm -f conf$$ conf$$.exe conf$$.file
16255
16256 as_executable_p="test -f"
16257
16258 # Support unset when possible.
16259 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16260   as_unset=unset
16261 else
16262   as_unset=false
16263 fi
16264
16265 # NLS nuisances.
16266 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16267 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16268 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16269 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16270 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16271 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16272 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16273 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16274
16275 # IFS
16276 # We need space, tab and new line, in precisely that order.
16277 as_nl='
16278 '
16279 IFS="   $as_nl"
16280
16281 # CDPATH.
16282 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16283
16284 exec 6>&1
16285
16286 _ACEOF
16287
16288 # Files that config.status was made for.
16289 if test -n "$ac_config_files"; then
16290   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16291 fi
16292
16293 if test -n "$ac_config_headers"; then
16294   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16295 fi
16296
16297 if test -n "$ac_config_links"; then
16298   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16299 fi
16300
16301 if test -n "$ac_config_commands"; then
16302   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16303 fi
16304
16305 cat >>$CONFIG_STATUS <<\EOF
16306
16307 ac_cs_usage="\
16308 \`$as_me' instantiates files from templates according to the
16309 current configuration.
16310
16311 Usage: $0 [OPTIONS] [FILE]...
16312
16313   -h, --help       print this help, then exit
16314   -V, --version    print version number, then exit
16315   -d, --debug      don't remove temporary files
16316       --recheck    update $as_me by reconfiguring in the same conditions
16317   --file=FILE[:TEMPLATE]
16318                    instantiate the configuration file FILE
16319   --header=FILE[:TEMPLATE]
16320                    instantiate the configuration header FILE
16321
16322 Configuration files:
16323 $config_files
16324
16325 Configuration headers:
16326 $config_headers
16327
16328 Configuration commands:
16329 $config_commands
16330
16331 Report bugs to <dickey@invisible-island.net>."
16332 EOF
16333
16334 cat >>$CONFIG_STATUS <<EOF
16335 ac_cs_version="\\
16336 config.status
16337 configured by $0, generated by GNU Autoconf 2.52.20121002,
16338   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16339
16340 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16341 Free Software Foundation, Inc.
16342 This config.status script is free software; the Free Software Foundation
16343 gives unlimited permission to copy, distribute and modify it."
16344 srcdir=$srcdir
16345 INSTALL="$INSTALL"
16346 EOF
16347
16348 cat >>$CONFIG_STATUS <<\EOF
16349 # If no file are specified by the user, then we need to provide default
16350 # value.  By we need to know if files were specified by the user.
16351 ac_need_defaults=:
16352 while test $# != 0
16353 do
16354   case $1 in
16355   --*=*)
16356     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16357     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16358     shift
16359     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16360     shift
16361     ;;
16362   -*);;
16363   *) # This is not an option, so the user has probably given explicit
16364      # arguments.
16365      ac_need_defaults=false;;
16366   esac
16367
16368   case $1 in
16369   # Handling of the options.
16370 EOF
16371 cat >>$CONFIG_STATUS <<EOF
16372   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16373     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16374     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16375 EOF
16376 cat >>$CONFIG_STATUS <<\EOF
16377   --version | --vers* | -V )
16378     echo "$ac_cs_version"; exit 0 ;;
16379   --he | --h)
16380     # Conflict between --help and --header
16381     { { echo "$as_me:16381: error: ambiguous option: $1
16382 Try \`$0 --help' for more information." >&5
16383 echo "$as_me: error: ambiguous option: $1
16384 Try \`$0 --help' for more information." >&2;}
16385    { (exit 1); exit 1; }; };;
16386   --help | --hel | -h )
16387     echo "$ac_cs_usage"; exit 0 ;;
16388   --debug | --d* | -d )
16389     debug=: ;;
16390   --file | --fil | --fi | --f )
16391     shift
16392     CONFIG_FILES="$CONFIG_FILES $1"
16393     ac_need_defaults=false;;
16394   --header | --heade | --head | --hea )
16395     shift
16396     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16397     ac_need_defaults=false;;
16398
16399   # This is an error.
16400   -*) { { echo "$as_me:16400: error: unrecognized option: $1
16401 Try \`$0 --help' for more information." >&5
16402 echo "$as_me: error: unrecognized option: $1
16403 Try \`$0 --help' for more information." >&2;}
16404    { (exit 1); exit 1; }; } ;;
16405
16406   *) ac_config_targets="$ac_config_targets $1" ;;
16407
16408   esac
16409   shift
16410 done
16411
16412 exec 5>>config.log
16413 cat >&5 << _ACEOF
16414
16415 ## ----------------------- ##
16416 ## Running config.status.  ##
16417 ## ----------------------- ##
16418
16419 This file was extended by $as_me 2.52.20121002, executed with
16420   CONFIG_FILES    = $CONFIG_FILES
16421   CONFIG_HEADERS  = $CONFIG_HEADERS
16422   CONFIG_LINKS    = $CONFIG_LINKS
16423   CONFIG_COMMANDS = $CONFIG_COMMANDS
16424   > $ac_cs_invocation
16425 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16426
16427 _ACEOF
16428 EOF
16429
16430 cat >>$CONFIG_STATUS <<EOF
16431 #
16432 # INIT-COMMANDS section.
16433 #
16434
16435 AWK="$AWK"
16436 ECHO_CC="$ECHO_CC"
16437 ECHO_LD="$ECHO_LD"
16438 SHOW_CC="$SHOW_LD"
16439
16440 EOF
16441
16442 cat >>$CONFIG_STATUS <<\EOF
16443 for ac_config_target in $ac_config_targets
16444 do
16445   case "$ac_config_target" in
16446   # Handling of arguments.
16447   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16448   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16449   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
16450   *) { { echo "$as_me:16450: error: invalid argument: $ac_config_target" >&5
16451 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16452    { (exit 1); exit 1; }; };;
16453   esac
16454 done
16455
16456 # If the user did not use the arguments to specify the items to instantiate,
16457 # then the envvar interface is used.  Set only those that are not.
16458 # We use the long form for the default assignment because of an extremely
16459 # bizarre bug on SunOS 4.1.3.
16460 if $ac_need_defaults; then
16461   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16462   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16463   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16464 fi
16465
16466 # Create a temporary directory, and hook for its removal unless debugging.
16467 $debug ||
16468 {
16469   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16470   trap '{ (exit 1); exit 1; }' 1 2 13 15
16471 }
16472
16473 # Create a (secure) tmp directory for tmp files.
16474 : ${TMPDIR=/tmp}
16475 {
16476   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16477   test -n "$tmp" && test -d "$tmp"
16478 }  ||
16479 {
16480   tmp=$TMPDIR/cs$$-$RANDOM
16481   (umask 077 && mkdir $tmp)
16482 } ||
16483 {
16484    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16485    { (exit 1); exit 1; }
16486 }
16487
16488 EOF
16489
16490 cat >>$CONFIG_STATUS <<EOF
16491
16492 #
16493 # CONFIG_FILES section.
16494 #
16495
16496 # No need to generate the scripts if there are no CONFIG_FILES.
16497 # This happens for instance when ./config.status config.h
16498 if test -n "\$CONFIG_FILES"; then
16499   # Protect against being on the right side of a sed subst in config.status.
16500   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
16501    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
16502 s,@SHELL@,$SHELL,;t t
16503 s,@exec_prefix@,$exec_prefix,;t t
16504 s,@prefix@,$prefix,;t t
16505 s,@program_transform_name@,$program_transform_name,;t t
16506 s,@bindir@,$bindir,;t t
16507 s,@sbindir@,$sbindir,;t t
16508 s,@libexecdir@,$libexecdir,;t t
16509 s,@datarootdir@,$datarootdir,;t t
16510 s,@datadir@,$datadir,;t t
16511 s,@sysconfdir@,$sysconfdir,;t t
16512 s,@sharedstatedir@,$sharedstatedir,;t t
16513 s,@localstatedir@,$localstatedir,;t t
16514 s,@libdir@,$libdir,;t t
16515 s,@includedir@,$includedir,;t t
16516 s,@oldincludedir@,$oldincludedir,;t t
16517 s,@infodir@,$infodir,;t t
16518 s,@mandir@,$mandir,;t t
16519 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
16520 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
16521 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
16522 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
16523 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
16524 s,@build_alias@,$build_alias,;t t
16525 s,@host_alias@,$host_alias,;t t
16526 s,@target_alias@,$target_alias,;t t
16527 s,@ECHO_C@,$ECHO_C,;t t
16528 s,@ECHO_N@,$ECHO_N,;t t
16529 s,@ECHO_T@,$ECHO_T,;t t
16530 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
16531 s,@DEFS@,$DEFS,;t t
16532 s,@LIBS@,$LIBS,;t t
16533 s,@build@,$build,;t t
16534 s,@build_cpu@,$build_cpu,;t t
16535 s,@build_vendor@,$build_vendor,;t t
16536 s,@build_os@,$build_os,;t t
16537 s,@host@,$host,;t t
16538 s,@host_cpu@,$host_cpu,;t t
16539 s,@host_vendor@,$host_vendor,;t t
16540 s,@host_os@,$host_os,;t t
16541 s,@SET_MAKE@,$SET_MAKE,;t t
16542 s,@CC@,$CC,;t t
16543 s,@CFLAGS@,$CFLAGS,;t t
16544 s,@LDFLAGS@,$LDFLAGS,;t t
16545 s,@CPPFLAGS@,$CPPFLAGS,;t t
16546 s,@ac_ct_CC@,$ac_ct_CC,;t t
16547 s,@EXEEXT@,$EXEEXT,;t t
16548 s,@OBJEXT@,$OBJEXT,;t t
16549 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
16550 s,@CPP@,$CPP,;t t
16551 s,@AWK@,$AWK,;t t
16552 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
16553 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
16554 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
16555 s,@LINT@,$LINT,;t t
16556 s,@LINT_OPTS@,$LINT_OPTS,;t t
16557 s,@CTAGS@,$CTAGS,;t t
16558 s,@ETAGS@,$ETAGS,;t t
16559 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
16560 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
16561 s,@MATH_LIB@,$MATH_LIB,;t t
16562 s,@top_builddir@,$top_builddir,;t t
16563 s,@CC_G_OPT@,$CC_G_OPT,;t t
16564 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
16565 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
16566 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
16567 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
16568 s,@LD@,$LD,;t t
16569 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
16570 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
16571 s,@LD_MODEL@,$LD_MODEL,;t t
16572 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
16573 s,@LIBTOOL@,$LIBTOOL,;t t
16574 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
16575 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
16576 s,@LIB_LINK@,$LIB_LINK,;t t
16577 s,@LINK_TESTS@,$LINK_TESTS,;t t
16578 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
16579 s,@PTHREAD@,$PTHREAD,;t t
16580 s,@TEST_ARGS@,$TEST_ARGS,;t t
16581 s,@TEST_DEPS@,$TEST_DEPS,;t t
16582 s,@TEST_LIBS@,$TEST_LIBS,;t t
16583 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
16584 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
16585 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
16586 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
16587 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
16588 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
16589 s,@ECHO_LT@,$ECHO_LT,;t t
16590 s,@ECHO_LD@,$ECHO_LD,;t t
16591 s,@RULE_CC@,$RULE_CC,;t t
16592 s,@SHOW_CC@,$SHOW_CC,;t t
16593 s,@ECHO_CC@,$ECHO_CC,;t t
16594 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
16595 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
16596 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
16597 s,@X_CFLAGS@,$X_CFLAGS,;t t
16598 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
16599 s,@X_LIBS@,$X_LIBS,;t t
16600 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
16601 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
16602 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
16603 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
16604 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
16605 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
16606 CEOF
16607
16608 EOF
16609
16610   cat >>$CONFIG_STATUS <<\EOF
16611   # Split the substitutions into bite-sized pieces for seds with
16612   # small command number limits, like on Digital OSF/1 and HP-UX.
16613   ac_max_sed_lines=48
16614   ac_sed_frag=1 # Number of current file.
16615   ac_beg=1 # First line for current file.
16616   ac_end=$ac_max_sed_lines # Line after last line for current file.
16617   ac_more_lines=:
16618   ac_sed_cmds=
16619   while $ac_more_lines; do
16620     if test $ac_beg -gt 1; then
16621       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16622     else
16623       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16624     fi
16625     if test ! -s $tmp/subs.frag; then
16626       ac_more_lines=false
16627     else
16628       # The purpose of the label and of the branching condition is to
16629       # speed up the sed processing (if there are no `@' at all, there
16630       # is no need to browse any of the substitutions).
16631       # These are the two extra sed commands mentioned above.
16632       (echo ':t
16633   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
16634       if test -z "$ac_sed_cmds"; then
16635         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
16636       else
16637         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
16638       fi
16639       ac_sed_frag=`expr $ac_sed_frag + 1`
16640       ac_beg=$ac_end
16641       ac_end=`expr $ac_end + $ac_max_sed_lines`
16642     fi
16643   done
16644   if test -z "$ac_sed_cmds"; then
16645     ac_sed_cmds=cat
16646   fi
16647 fi # test -n "$CONFIG_FILES"
16648
16649 EOF
16650 cat >>$CONFIG_STATUS <<\EOF
16651 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
16652   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16653   case $ac_file in
16654   - | *:- | *:-:* ) # input from stdin
16655         cat >$tmp/stdin
16656         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16657         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16658   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16659         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16660   * )   ac_file_in=$ac_file.in ;;
16661   esac
16662
16663   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
16664   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16665          X"$ac_file" : 'X\(//\)[^/]' \| \
16666          X"$ac_file" : 'X\(//\)$' \| \
16667          X"$ac_file" : 'X\(/\)' \| \
16668          .     : '\(.\)' 2>/dev/null ||
16669 echo X"$ac_file" |
16670     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16671           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16672           /^X\(\/\/\)$/{ s//\1/; q; }
16673           /^X\(\/\).*/{ s//\1/; q; }
16674           s/.*/./; q'`
16675   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16676     { case "$ac_dir" in
16677   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16678   *)                      as_incr_dir=.;;
16679 esac
16680 as_dummy="$ac_dir"
16681 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16682   case $as_mkdir_dir in
16683     # Skip DOS drivespec
16684     ?:) as_incr_dir=$as_mkdir_dir ;;
16685     *)
16686       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16687       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16688     ;;
16689   esac
16690 done; }
16691
16692     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
16693     # A "../" for each directory in $ac_dir_suffix.
16694     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
16695   else
16696     ac_dir_suffix= ac_dots=
16697   fi
16698
16699   case $srcdir in
16700   .)  ac_srcdir=.
16701       if test -z "$ac_dots"; then
16702          ac_top_srcdir=.
16703       else
16704          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
16705       fi ;;
16706   [\\/]* | ?:[\\/]* )
16707       ac_srcdir=$srcdir$ac_dir_suffix;
16708       ac_top_srcdir=$srcdir ;;
16709   *) # Relative path.
16710     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
16711     ac_top_srcdir=$ac_dots$srcdir ;;
16712   esac
16713
16714   case $INSTALL in
16715   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
16716   *) ac_INSTALL=$ac_dots$INSTALL ;;
16717   esac
16718
16719   if test x"$ac_file" != x-; then
16720     { echo "$as_me:16720: creating $ac_file" >&5
16721 echo "$as_me: creating $ac_file" >&6;}
16722     rm -f "$ac_file"
16723   fi
16724   # Let's still pretend it is `configure' which instantiates (i.e., don't
16725   # use $as_me), people would be surprised to read:
16726   #    /* config.h.  Generated automatically by config.status.  */
16727   configure_input="Generated automatically from `echo $ac_file_in |
16728                                                  sed 's,.*/,,'` by configure."
16729
16730   # First look for the input files in the build tree, otherwise in the
16731   # src tree.
16732   ac_file_inputs=`IFS=:
16733     for f in $ac_file_in; do
16734       case $f in
16735       -) echo $tmp/stdin ;;
16736       [\\/$]*)
16737          # Absolute (can't be DOS-style, as IFS=:)
16738          test -f "$f" || { { echo "$as_me:16738: error: cannot find input file: $f" >&5
16739 echo "$as_me: error: cannot find input file: $f" >&2;}
16740    { (exit 1); exit 1; }; }
16741          echo $f;;
16742       *) # Relative
16743          if test -f "$f"; then
16744            # Build tree
16745            echo $f
16746          elif test -f "$srcdir/$f"; then
16747            # Source tree
16748            echo $srcdir/$f
16749          else
16750            # /dev/null tree
16751            { { echo "$as_me:16751: error: cannot find input file: $f" >&5
16752 echo "$as_me: error: cannot find input file: $f" >&2;}
16753    { (exit 1); exit 1; }; }
16754          fi;;
16755       esac
16756     done` || { (exit 1); exit 1; }
16757 EOF
16758 cat >>$CONFIG_STATUS <<\EOF
16759   ac_warn_datarootdir=no
16760   if test x"$ac_file" != x-; then
16761     for ac_item in $ac_file_inputs
16762     do
16763       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
16764       if test -n "$ac_seen"; then
16765         ac_used=`grep '@datarootdir@' $ac_item`
16766         if test -z "$ac_used"; then
16767           { echo "$as_me:16767: WARNING: datarootdir was used implicitly but not set:
16768 $ac_seen" >&5
16769 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
16770 $ac_seen" >&2;}
16771           ac_warn_datarootdir=yes
16772         fi
16773       fi
16774       ac_seen=`grep '${datarootdir}' $ac_item`
16775       if test -n "$ac_seen"; then
16776         { echo "$as_me:16776: WARNING: datarootdir was used explicitly but not set:
16777 $ac_seen" >&5
16778 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
16779 $ac_seen" >&2;}
16780         ac_warn_datarootdir=yes
16781       fi
16782     done
16783   fi
16784
16785 if test "x$ac_warn_datarootdir" = xyes; then
16786   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
16787 fi
16788
16789 EOF
16790 cat >>$CONFIG_STATUS <<EOF
16791   sed "$ac_vpsub
16792 $extrasub
16793 EOF
16794 cat >>$CONFIG_STATUS <<\EOF
16795 :t
16796 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
16797 s,@configure_input@,$configure_input,;t t
16798 s,@srcdir@,$ac_srcdir,;t t
16799 s,@top_srcdir@,$ac_top_srcdir,;t t
16800 s,@INSTALL@,$ac_INSTALL,;t t
16801 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
16802   rm -f $tmp/stdin
16803   if test x"$ac_file" != x-; then
16804     cp $tmp/out $ac_file
16805
16806     for ac_name in prefix exec_prefix datarootdir
16807     do
16808         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
16809         if test -n "$ac_seen"; then
16810             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
16811             if test -z "$ac_init"; then
16812               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
16813               { echo "$as_me:16813: WARNING: Variable $ac_name is used but was not set:
16814 $ac_seen" >&5
16815 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
16816 $ac_seen" >&2;}
16817             fi
16818         fi
16819     done
16820     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
16821     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
16822     if test -s $tmp/out; then
16823       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
16824       { echo "$as_me:16824: WARNING: Some variables may not be substituted:
16825 $ac_seen" >&5
16826 echo "$as_me: WARNING: Some variables may not be substituted:
16827 $ac_seen" >&2;}
16828     fi
16829   else
16830     cat $tmp/out
16831   fi
16832   rm -f $tmp/out
16833
16834 done
16835 EOF
16836 cat >>$CONFIG_STATUS <<\EOF
16837
16838 #
16839 # CONFIG_HEADER section.
16840 #
16841
16842 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
16843 # NAME is the cpp macro being defined and VALUE is the value it is being given.
16844 #
16845 # ac_d sets the value in "#define NAME VALUE" lines.
16846 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
16847 ac_dB='[        ].*$,\1#\2'
16848 ac_dC=' '
16849 ac_dD=',;t'
16850 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
16851 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16852 ac_iB='\([      ]\),\1#\2define\3'
16853 ac_iC=' '
16854 ac_iD='\4,;t'
16855 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16856 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16857 ac_uB='$,\1#\2define\3'
16858 ac_uC=' '
16859 ac_uD=',;t'
16860
16861 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
16862   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16863   case $ac_file in
16864   - | *:- | *:-:* ) # input from stdin
16865         cat >$tmp/stdin
16866         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16867         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16868   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16869         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16870   * )   ac_file_in=$ac_file.in ;;
16871   esac
16872
16873   test x"$ac_file" != x- && { echo "$as_me:16873: creating $ac_file" >&5
16874 echo "$as_me: creating $ac_file" >&6;}
16875
16876   # First look for the input files in the build tree, otherwise in the
16877   # src tree.
16878   ac_file_inputs=`IFS=:
16879     for f in $ac_file_in; do
16880       case $f in
16881       -) echo $tmp/stdin ;;
16882       [\\/$]*)
16883          # Absolute (can't be DOS-style, as IFS=:)
16884          test -f "$f" || { { echo "$as_me:16884: error: cannot find input file: $f" >&5
16885 echo "$as_me: error: cannot find input file: $f" >&2;}
16886    { (exit 1); exit 1; }; }
16887          echo $f;;
16888       *) # Relative
16889          if test -f "$f"; then
16890            # Build tree
16891            echo $f
16892          elif test -f "$srcdir/$f"; then
16893            # Source tree
16894            echo $srcdir/$f
16895          else
16896            # /dev/null tree
16897            { { echo "$as_me:16897: error: cannot find input file: $f" >&5
16898 echo "$as_me: error: cannot find input file: $f" >&2;}
16899    { (exit 1); exit 1; }; }
16900          fi;;
16901       esac
16902     done` || { (exit 1); exit 1; }
16903   # Remove the trailing spaces.
16904   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
16905
16906 EOF
16907
16908 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
16909 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
16910 # be either 'cat' or 'sort'.
16911 cat confdefs.h | uniq >conftest.vals
16912
16913 # Break up conftest.vals because some shells have a limit on
16914 # the size of here documents, and old seds have small limits too.
16915
16916 rm -f conftest.tail
16917 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
16918 while grep . conftest.vals >/dev/null
16919 do
16920   # Write chunks of a limited-size here document to conftest.frag.
16921   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
16922   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
16923   echo 'CEOF' >> $CONFIG_STATUS
16924   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
16925   rm -f conftest.vals
16926   mv conftest.tail conftest.vals
16927 done
16928 rm -f conftest.vals
16929
16930 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
16931 # marker @DEFS@.
16932 echo '  cat >> conftest.edit <<CEOF
16933 /@DEFS@/r conftest.frag
16934 /@DEFS@/d
16935 CEOF
16936 sed -f conftest.edit $tmp/in > $tmp/out
16937 rm -f $tmp/in
16938 mv $tmp/out $tmp/in
16939 rm -f conftest.edit conftest.frag
16940 ' >> $CONFIG_STATUS
16941
16942 cat >>$CONFIG_STATUS <<\EOF
16943   # Let's still pretend it is `configure' which instantiates (i.e., don't
16944   # use $as_me), people would be surprised to read:
16945   #    /* config.h.  Generated automatically by config.status.  */
16946   if test x"$ac_file" = x-; then
16947     echo "/* Generated automatically by configure.  */" >$tmp/config.h
16948   else
16949     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
16950   fi
16951   cat $tmp/in >>$tmp/config.h
16952   rm -f $tmp/in
16953   if test x"$ac_file" != x-; then
16954     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
16955       { echo "$as_me:16955: $ac_file is unchanged" >&5
16956 echo "$as_me: $ac_file is unchanged" >&6;}
16957     else
16958       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16959          X"$ac_file" : 'X\(//\)[^/]' \| \
16960          X"$ac_file" : 'X\(//\)$' \| \
16961          X"$ac_file" : 'X\(/\)' \| \
16962          .     : '\(.\)' 2>/dev/null ||
16963 echo X"$ac_file" |
16964     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16965           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16966           /^X\(\/\/\)$/{ s//\1/; q; }
16967           /^X\(\/\).*/{ s//\1/; q; }
16968           s/.*/./; q'`
16969       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16970         { case "$ac_dir" in
16971   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16972   *)                      as_incr_dir=.;;
16973 esac
16974 as_dummy="$ac_dir"
16975 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16976   case $as_mkdir_dir in
16977     # Skip DOS drivespec
16978     ?:) as_incr_dir=$as_mkdir_dir ;;
16979     *)
16980       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16981       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16982     ;;
16983   esac
16984 done; }
16985
16986       fi
16987       rm -f $ac_file
16988       mv $tmp/config.h $ac_file
16989     fi
16990   else
16991     cat $tmp/config.h
16992     rm -f $tmp/config.h
16993   fi
16994 done
16995 EOF
16996 cat >>$CONFIG_STATUS <<\EOF
16997 #
16998 # CONFIG_COMMANDS section.
16999 #
17000 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17001   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17002   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17003
17004   case $ac_dest in
17005     default )
17006
17007 for cf_dir in .
17008 do
17009         if test ! -d $srcdir/$cf_dir; then
17010                 continue
17011         elif test -f $srcdir/$cf_dir/programs; then
17012                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
17013         fi
17014 done
17015
17016         cat >>Makefile <<TEST_EOF
17017
17018 # These rules are generated so we do not rely on suffix rules, which do not
17019 # work consistently for different make-programs (the '\$(MODEL)/' confuses
17020 # some, and the '\$x' confuses others).
17021 TEST_EOF
17022
17023 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
17024 for N in $LIST
17025 do
17026         cat >>Makefile <<TEST_EOF
17027
17028 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
17029         \$(srcdir)/test.priv.h \\
17030         ncurses_cfg.h
17031         $SHOW_CC
17032         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
17033 TEST_EOF
17034 done
17035
17036 if test -f ../config.guess && test -f ../config.sub
17037 then
17038         cat >>Makefile <<TEST_EOF
17039
17040 # if we used CF_INHERIT for getting these files, we can remove them
17041 distclean::
17042         rm -f config.guess config.sub
17043 TEST_EOF
17044 fi
17045  ;;
17046   esac
17047 done
17048 EOF
17049
17050 cat >>$CONFIG_STATUS <<\EOF
17051
17052 { (exit 0); exit 0; }
17053 EOF
17054 chmod +x $CONFIG_STATUS
17055 ac_clean_files=$ac_clean_files_save
17056
17057 # configure is writing to config.log, and then calls config.status.
17058 # config.status does its own redirection, appending to config.log.
17059 # Unfortunately, on DOS this fails, as config.log is still kept open
17060 # by configure, so config.status won't be able to write to it; its
17061 # output is simply discarded.  So we exec the FD to /dev/null,
17062 # effectively closing config.log, so it can be properly (re)opened and
17063 # appended to by config.status.  When coming back to configure, we
17064 # need to make the FD available again.
17065 if test "$no_create" != yes; then
17066   ac_cs_success=:
17067   exec 5>/dev/null
17068   $SHELL $CONFIG_STATUS || ac_cs_success=false
17069   exec 5>>config.log
17070   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17071   # would make configure fail if this is the last instruction.
17072   $ac_cs_success || { (exit 1); exit 1; }
17073 fi
17074