]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
fc134a33f5076d8a586834f431cd8be26b15407e
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20150926.
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 Features:
650   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
651   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
652
653 Optional Packages:
654   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
655   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
656
657   --enable-string-hacks   work around bogus compiler/loader warnings
658 General Options:
659   --with-pkg-config{=path} enable/disable use of pkg-config
660   --disable-echo          do not display "compiling" commands
661 Curses Version-dependent Options:
662   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
663   --disable-widec         disable checks for wide-character functions
664   --with-curses-dir=DIR   directory in which (n)curses is installed
665   --with-screen=XXX       use specified curses-libraries
666   --with-ncursesw         use wide ncurses-libraries
667   --with-ncurses          use ncurses-libraries
668   --with-pdcurses         compile/link with pdcurses X11 library
669   --with-curses-colr      compile/link with HPUX 10.x color-curses
670   --with-curses-5lib      compile/link with SunOS 5lib curses
671   --with-Xaw3d            link with Xaw 3d library
672   --with-Xaw3dxft         link with Xaw 3d xft library
673   --with-neXtaw           link with neXT Athena library
674   --with-XawPlus          link with Athena-Plus library
675   --with-x                use the X Window System
676 Testing/development Options:
677   --enable-warnings       test: turn on gcc compiler warnings
678   --with-dmalloc          test: use Gray Watson's dmalloc library
679   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
680   --with-valgrind         test: use valgrind
681   --disable-leaks         test: free permanent memory, analyze leaks
682   --disable-rpath-hack    don't add rpath options for additional libraries
683
684 Some influential environment variables:
685   CC          C compiler command
686   CFLAGS      C compiler flags
687   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
688               nonstandard directory <lib dir>
689   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
690               headers in a nonstandard directory <include dir>
691   CPP         C preprocessor
692
693 Use these variables to override the choices made by `configure' or to help
694 it to find libraries and programs with nonstandard names/locations.
695
696 EOF
697 fi
698
699 if test "$ac_init_help" = "recursive"; then
700   # If there are subdirs, report their specific --help.
701   ac_popdir=`pwd`
702   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
703     cd $ac_subdir
704     # A "../" for each directory in /$ac_subdir.
705     ac_dots=`echo $ac_subdir |
706              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
707
708     case $srcdir in
709     .) # No --srcdir option.  We are building in place.
710       ac_sub_srcdir=$srcdir ;;
711     [\\/]* | ?:[\\/]* ) # Absolute path.
712       ac_sub_srcdir=$srcdir/$ac_subdir ;;
713     *) # Relative path.
714       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
715     esac
716
717     # Check for guested configure; otherwise get Cygnus style configure.
718     if test -f $ac_sub_srcdir/configure.gnu; then
719       echo
720       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
721     elif test -f $ac_sub_srcdir/configure; then
722       echo
723       $SHELL $ac_sub_srcdir/configure  --help=recursive
724     elif test -f $ac_sub_srcdir/configure.ac ||
725            test -f $ac_sub_srcdir/configure.in; then
726       echo
727       $ac_configure --help
728     else
729       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
730     fi
731     cd $ac_popdir
732   done
733 fi
734
735 test -n "$ac_init_help" && exit 0
736 if $ac_init_version; then
737   cat <<\EOF
738
739 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
740 Free Software Foundation, Inc.
741 This configure script is free software; the Free Software Foundation
742 gives unlimited permission to copy, distribute and modify it.
743 EOF
744   exit 0
745 fi
746 exec 5>config.log
747 cat >&5 <<EOF
748 This file contains any messages produced by compilers while
749 running configure, to aid debugging if configure makes a mistake.
750
751 It was created by $as_me, which was
752 generated by GNU Autoconf 2.52.20150926.  Invocation command line was
753
754   $ $0 $@
755
756 EOF
757 {
758 cat <<_ASUNAME
759 ## ---------- ##
760 ## Platform.  ##
761 ## ---------- ##
762
763 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
764 uname -m = `(uname -m) 2>/dev/null || echo unknown`
765 uname -r = `(uname -r) 2>/dev/null || echo unknown`
766 uname -s = `(uname -s) 2>/dev/null || echo unknown`
767 uname -v = `(uname -v) 2>/dev/null || echo unknown`
768
769 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
770 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
771
772 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
773 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
774 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
775 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
776 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
777 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
778 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
779
780 PATH = $PATH
781
782 _ASUNAME
783 } >&5
784
785 cat >&5 <<EOF
786 ## ------------ ##
787 ## Core tests.  ##
788 ## ------------ ##
789
790 EOF
791
792 # Keep a trace of the command line.
793 # Strip out --no-create and --no-recursion so they do not pile up.
794 # Also quote any args containing shell meta-characters.
795 ac_configure_args=
796 ac_sep=
797 for ac_arg
798 do
799   case $ac_arg in
800   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
801   | --no-cr | --no-c) ;;
802   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
803   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
804   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
805     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
806     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
807     ac_sep=" " ;;
808   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
809      ac_sep=" " ;;
810   esac
811   # Get rid of the leading space.
812 done
813
814 # When interrupted or exit'd, cleanup temporary files, and complete
815 # config.log.  We remove comments because anyway the quotes in there
816 # would cause problems or look ugly.
817 trap 'exit_status=$?
818   # Save into config.log some information that might help in debugging.
819   echo >&5
820   echo "## ----------------- ##" >&5
821   echo "## Cache variables.  ##" >&5
822   echo "## ----------------- ##" >&5
823   echo >&5
824   # The following way of writing the cache mishandles newlines in values,
825 {
826   (set) 2>&1 |
827     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
828     *ac_space=\ *)
829       sed -n \
830         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
831           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
832       ;;
833     *)
834       sed -n \
835         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
836       ;;
837     esac;
838 } >&5
839   sed "/^$/d" confdefs.h >conftest.log
840   if test -s conftest.log; then
841     echo >&5
842     echo "## ------------ ##" >&5
843     echo "## confdefs.h.  ##" >&5
844     echo "## ------------ ##" >&5
845     echo >&5
846     cat conftest.log >&5
847   fi
848   (echo; echo) >&5
849   test "$ac_signal" != 0 &&
850     echo "$as_me: caught signal $ac_signal" >&5
851   echo "$as_me: exit $exit_status" >&5
852   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
853     exit $exit_status
854      ' 0
855 for ac_signal in 1 2 13 15; do
856   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
857 done
858 ac_signal=0
859
860 # confdefs.h avoids OS command line length limits that DEFS can exceed.
861 rm -rf conftest* confdefs.h
862 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
863 echo >confdefs.h
864
865 # Let the site file select an alternate cache file if it wants to.
866 # Prefer explicitly selected file to automatically selected ones.
867 if test -z "$CONFIG_SITE"; then
868   if test "x$prefix" != xNONE; then
869     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
870   else
871     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
872   fi
873 fi
874 for ac_site_file in $CONFIG_SITE; do
875   if test -r "$ac_site_file"; then
876     { echo "$as_me:876: loading site script $ac_site_file" >&5
877 echo "$as_me: loading site script $ac_site_file" >&6;}
878     cat "$ac_site_file" >&5
879     . "$ac_site_file"
880   fi
881 done
882
883 if test -r "$cache_file"; then
884   # Some versions of bash will fail to source /dev/null (special
885   # files actually), so we avoid doing that.
886   if test -f "$cache_file"; then
887     { echo "$as_me:887: loading cache $cache_file" >&5
888 echo "$as_me: loading cache $cache_file" >&6;}
889     case $cache_file in
890       [\\/]* | ?:[\\/]* ) . $cache_file;;
891       *)                      . ./$cache_file;;
892     esac
893   fi
894 else
895   { echo "$as_me:895: creating cache $cache_file" >&5
896 echo "$as_me: creating cache $cache_file" >&6;}
897   >$cache_file
898 fi
899
900 # Check that the precious variables saved in the cache have kept the same
901 # value.
902 ac_cache_corrupted=false
903 for ac_var in `(set) 2>&1 |
904                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
905   eval ac_old_set=\$ac_cv_env_${ac_var}_set
906   eval ac_new_set=\$ac_env_${ac_var}_set
907   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
908   eval ac_new_val="\$ac_env_${ac_var}_value"
909   case $ac_old_set,$ac_new_set in
910     set,)
911       { echo "$as_me:911: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
912 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
913       ac_cache_corrupted=: ;;
914     ,set)
915       { echo "$as_me:915: error: \`$ac_var' was not set in the previous run" >&5
916 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
917       ac_cache_corrupted=: ;;
918     ,);;
919     *)
920       if test "x$ac_old_val" != "x$ac_new_val"; then
921         { echo "$as_me:921: error: \`$ac_var' has changed since the previous run:" >&5
922 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
923         { echo "$as_me:923:   former value:  $ac_old_val" >&5
924 echo "$as_me:   former value:  $ac_old_val" >&2;}
925         { echo "$as_me:925:   current value: $ac_new_val" >&5
926 echo "$as_me:   current value: $ac_new_val" >&2;}
927         ac_cache_corrupted=:
928       fi;;
929   esac
930   # Pass precious variables to config.status.  It doesn't matter if
931   # we pass some twice (in addition to the command line arguments).
932   if test "$ac_new_set" = set; then
933     case $ac_new_val in
934     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
935       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
936       ac_configure_args="$ac_configure_args '$ac_arg'"
937       ;;
938     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
939        ;;
940     esac
941   fi
942 done
943 if $ac_cache_corrupted; then
944   { echo "$as_me:944: error: changes in the environment can compromise the build" >&5
945 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
946   { { echo "$as_me:946: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
947 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
948    { (exit 1); exit 1; }; }
949 fi
950
951 ac_ext=c
952 ac_cpp='$CPP $CPPFLAGS'
953 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
954 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
955 ac_compiler_gnu=$ac_cv_c_compiler_gnu
956 ac_main_return=return
957
958 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
959   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
960                    ECHO_T='     ' ;;
961   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
962   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
963 esac
964 echo "#! $SHELL" >conftest.sh
965 echo  "exit 0"   >>conftest.sh
966 chmod +x conftest.sh
967 if { (echo "$as_me:967: PATH=\".;.\"; conftest.sh") >&5
968   (PATH=".;."; conftest.sh) 2>&5
969   ac_status=$?
970   echo "$as_me:970: \$? = $ac_status" >&5
971   (exit $ac_status); }; then
972   ac_path_separator=';'
973 else
974   ac_path_separator=:
975 fi
976 PATH_SEPARATOR="$ac_path_separator"
977 rm -f conftest.sh
978
979 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
980
981 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
982
983 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
984
985 ac_aux_dir=
986 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
987   if test -f $ac_dir/install-sh; then
988     ac_aux_dir=$ac_dir
989     ac_install_sh="$ac_aux_dir/install-sh -c"
990     break
991   elif test -f $ac_dir/install.sh; then
992     ac_aux_dir=$ac_dir
993     ac_install_sh="$ac_aux_dir/install.sh -c"
994     break
995   elif test -f $ac_dir/shtool; then
996     ac_aux_dir=$ac_dir
997     ac_install_sh="$ac_aux_dir/shtool install -c"
998     break
999   fi
1000 done
1001 if test -z "$ac_aux_dir"; then
1002   { { echo "$as_me:1002: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1003 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1004    { (exit 1); exit 1; }; }
1005 fi
1006 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1007 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1008 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1009
1010 # Make sure we can run config.sub.
1011 $ac_config_sub sun4 >/dev/null 2>&1 ||
1012   { { echo "$as_me:1012: error: cannot run $ac_config_sub" >&5
1013 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1014    { (exit 1); exit 1; }; }
1015
1016 echo "$as_me:1016: checking build system type" >&5
1017 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1018 if test "${ac_cv_build+set}" = set; then
1019   echo $ECHO_N "(cached) $ECHO_C" >&6
1020 else
1021   ac_cv_build_alias=$build_alias
1022 test -z "$ac_cv_build_alias" &&
1023   ac_cv_build_alias=`$ac_config_guess`
1024 test -z "$ac_cv_build_alias" &&
1025   { { echo "$as_me:1025: error: cannot guess build type; you must specify one" >&5
1026 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1027    { (exit 1); exit 1; }; }
1028 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1029   { { echo "$as_me:1029: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1030 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1031    { (exit 1); exit 1; }; }
1032
1033 fi
1034 echo "$as_me:1034: result: $ac_cv_build" >&5
1035 echo "${ECHO_T}$ac_cv_build" >&6
1036 build=$ac_cv_build
1037 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1038 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1039 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1040
1041 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1042         echo "$as_me:1042: checking host system type" >&5
1043 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1044 if test "${ac_cv_host+set}" = set; then
1045   echo $ECHO_N "(cached) $ECHO_C" >&6
1046 else
1047   ac_cv_host_alias=$host_alias
1048 test -z "$ac_cv_host_alias" &&
1049   ac_cv_host_alias=$ac_cv_build_alias
1050 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1051   { { echo "$as_me:1051: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1052 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1053    { (exit 1); exit 1; }; }
1054
1055 fi
1056 echo "$as_me:1056: result: $ac_cv_host" >&5
1057 echo "${ECHO_T}$ac_cv_host" >&6
1058 host=$ac_cv_host
1059 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1060 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1061 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1062
1063         system_name="$host_os"
1064 else
1065         system_name="`(uname -s -r) 2>/dev/null`"
1066         if test -z "$system_name" ; then
1067                 system_name="`(hostname) 2>/dev/null`"
1068         fi
1069 fi
1070 test -n "$system_name" &&
1071 cat >>confdefs.h <<EOF
1072 #define SYSTEM_NAME "$system_name"
1073 EOF
1074
1075 if test "${cf_cv_system_name+set}" = set; then
1076   echo $ECHO_N "(cached) $ECHO_C" >&6
1077 else
1078   cf_cv_system_name="$system_name"
1079 fi
1080
1081 test -z "$system_name" && system_name="$cf_cv_system_name"
1082 test -n "$cf_cv_system_name" && echo "$as_me:1082: result: Configuring for $cf_cv_system_name" >&5
1083 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1084
1085 if test ".$system_name" != ".$cf_cv_system_name" ; then
1086         echo "$as_me:1086: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1087 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1088         { { echo "$as_me:1088: error: \"Please remove config.cache and try again.\"" >&5
1089 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1090    { (exit 1); exit 1; }; }
1091 fi
1092
1093 test "$program_prefix" != NONE &&
1094   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1095 # Use a double $ so make ignores it.
1096 test "$program_suffix" != NONE &&
1097   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1098 # Double any \ or $.  echo might interpret backslashes.
1099 # By default was `s,x,x', remove it if useless.
1100 cat <<\_ACEOF >conftest.sed
1101 s/[\\$]/&&/g;s/;s,x,x,$//
1102 _ACEOF
1103 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1104 rm conftest.sed
1105
1106 echo "$as_me:1106: checking whether ${MAKE-make} sets \${MAKE}" >&5
1107 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1108 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1109 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1110   echo $ECHO_N "(cached) $ECHO_C" >&6
1111 else
1112   cat >conftest.make <<\EOF
1113 all:
1114         @echo 'ac_maketemp="${MAKE}"'
1115 EOF
1116 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1117 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1118 if test -n "$ac_maketemp"; then
1119   eval ac_cv_prog_make_${ac_make}_set=yes
1120 else
1121   eval ac_cv_prog_make_${ac_make}_set=no
1122 fi
1123 rm -f conftest.make
1124 fi
1125 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1126   echo "$as_me:1126: result: yes" >&5
1127 echo "${ECHO_T}yes" >&6
1128   SET_MAKE=
1129 else
1130   echo "$as_me:1130: result: no" >&5
1131 echo "${ECHO_T}no" >&6
1132   SET_MAKE="MAKE=${MAKE-make}"
1133 fi
1134
1135 ac_ext=c
1136 ac_cpp='$CPP $CPPFLAGS'
1137 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1138 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1139 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1140 ac_main_return=return
1141 if test -n "$ac_tool_prefix"; then
1142   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1143 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1144 echo "$as_me:1144: checking for $ac_word" >&5
1145 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1146 if test "${ac_cv_prog_CC+set}" = set; then
1147   echo $ECHO_N "(cached) $ECHO_C" >&6
1148 else
1149   if test -n "$CC"; then
1150   ac_cv_prog_CC="$CC" # Let the user override the test.
1151 else
1152   ac_save_IFS=$IFS; IFS=$ac_path_separator
1153 ac_dummy="$PATH"
1154 for ac_dir in $ac_dummy; do
1155   IFS=$ac_save_IFS
1156   test -z "$ac_dir" && ac_dir=.
1157   $as_executable_p "$ac_dir/$ac_word" || continue
1158 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1159 echo "$as_me:1159: found $ac_dir/$ac_word" >&5
1160 break
1161 done
1162
1163 fi
1164 fi
1165 CC=$ac_cv_prog_CC
1166 if test -n "$CC"; then
1167   echo "$as_me:1167: result: $CC" >&5
1168 echo "${ECHO_T}$CC" >&6
1169 else
1170   echo "$as_me:1170: result: no" >&5
1171 echo "${ECHO_T}no" >&6
1172 fi
1173
1174 fi
1175 if test -z "$ac_cv_prog_CC"; then
1176   ac_ct_CC=$CC
1177   # Extract the first word of "gcc", so it can be a program name with args.
1178 set dummy gcc; ac_word=$2
1179 echo "$as_me:1179: checking for $ac_word" >&5
1180 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1181 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1182   echo $ECHO_N "(cached) $ECHO_C" >&6
1183 else
1184   if test -n "$ac_ct_CC"; then
1185   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1186 else
1187   ac_save_IFS=$IFS; IFS=$ac_path_separator
1188 ac_dummy="$PATH"
1189 for ac_dir in $ac_dummy; do
1190   IFS=$ac_save_IFS
1191   test -z "$ac_dir" && ac_dir=.
1192   $as_executable_p "$ac_dir/$ac_word" || continue
1193 ac_cv_prog_ac_ct_CC="gcc"
1194 echo "$as_me:1194: found $ac_dir/$ac_word" >&5
1195 break
1196 done
1197
1198 fi
1199 fi
1200 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1201 if test -n "$ac_ct_CC"; then
1202   echo "$as_me:1202: result: $ac_ct_CC" >&5
1203 echo "${ECHO_T}$ac_ct_CC" >&6
1204 else
1205   echo "$as_me:1205: result: no" >&5
1206 echo "${ECHO_T}no" >&6
1207 fi
1208
1209   CC=$ac_ct_CC
1210 else
1211   CC="$ac_cv_prog_CC"
1212 fi
1213
1214 if test -z "$CC"; then
1215   if test -n "$ac_tool_prefix"; then
1216   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1217 set dummy ${ac_tool_prefix}cc; ac_word=$2
1218 echo "$as_me:1218: checking for $ac_word" >&5
1219 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1220 if test "${ac_cv_prog_CC+set}" = set; then
1221   echo $ECHO_N "(cached) $ECHO_C" >&6
1222 else
1223   if test -n "$CC"; then
1224   ac_cv_prog_CC="$CC" # Let the user override the test.
1225 else
1226   ac_save_IFS=$IFS; IFS=$ac_path_separator
1227 ac_dummy="$PATH"
1228 for ac_dir in $ac_dummy; do
1229   IFS=$ac_save_IFS
1230   test -z "$ac_dir" && ac_dir=.
1231   $as_executable_p "$ac_dir/$ac_word" || continue
1232 ac_cv_prog_CC="${ac_tool_prefix}cc"
1233 echo "$as_me:1233: found $ac_dir/$ac_word" >&5
1234 break
1235 done
1236
1237 fi
1238 fi
1239 CC=$ac_cv_prog_CC
1240 if test -n "$CC"; then
1241   echo "$as_me:1241: result: $CC" >&5
1242 echo "${ECHO_T}$CC" >&6
1243 else
1244   echo "$as_me:1244: result: no" >&5
1245 echo "${ECHO_T}no" >&6
1246 fi
1247
1248 fi
1249 if test -z "$ac_cv_prog_CC"; then
1250   ac_ct_CC=$CC
1251   # Extract the first word of "cc", so it can be a program name with args.
1252 set dummy cc; ac_word=$2
1253 echo "$as_me:1253: checking for $ac_word" >&5
1254 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1255 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1256   echo $ECHO_N "(cached) $ECHO_C" >&6
1257 else
1258   if test -n "$ac_ct_CC"; then
1259   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1260 else
1261   ac_save_IFS=$IFS; IFS=$ac_path_separator
1262 ac_dummy="$PATH"
1263 for ac_dir in $ac_dummy; do
1264   IFS=$ac_save_IFS
1265   test -z "$ac_dir" && ac_dir=.
1266   $as_executable_p "$ac_dir/$ac_word" || continue
1267 ac_cv_prog_ac_ct_CC="cc"
1268 echo "$as_me:1268: found $ac_dir/$ac_word" >&5
1269 break
1270 done
1271
1272 fi
1273 fi
1274 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1275 if test -n "$ac_ct_CC"; then
1276   echo "$as_me:1276: result: $ac_ct_CC" >&5
1277 echo "${ECHO_T}$ac_ct_CC" >&6
1278 else
1279   echo "$as_me:1279: result: no" >&5
1280 echo "${ECHO_T}no" >&6
1281 fi
1282
1283   CC=$ac_ct_CC
1284 else
1285   CC="$ac_cv_prog_CC"
1286 fi
1287
1288 fi
1289 if test -z "$CC"; then
1290   # Extract the first word of "cc", so it can be a program name with args.
1291 set dummy cc; ac_word=$2
1292 echo "$as_me:1292: checking for $ac_word" >&5
1293 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1294 if test "${ac_cv_prog_CC+set}" = set; then
1295   echo $ECHO_N "(cached) $ECHO_C" >&6
1296 else
1297   if test -n "$CC"; then
1298   ac_cv_prog_CC="$CC" # Let the user override the test.
1299 else
1300   ac_prog_rejected=no
1301   ac_save_IFS=$IFS; IFS=$ac_path_separator
1302 ac_dummy="$PATH"
1303 for ac_dir in $ac_dummy; do
1304   IFS=$ac_save_IFS
1305   test -z "$ac_dir" && ac_dir=.
1306   $as_executable_p "$ac_dir/$ac_word" || continue
1307 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1308   ac_prog_rejected=yes
1309   continue
1310 fi
1311 ac_cv_prog_CC="cc"
1312 echo "$as_me:1312: found $ac_dir/$ac_word" >&5
1313 break
1314 done
1315
1316 if test $ac_prog_rejected = yes; then
1317   # We found a bogon in the path, so make sure we never use it.
1318   set dummy $ac_cv_prog_CC
1319   shift
1320   if test $# != 0; then
1321     # We chose a different compiler from the bogus one.
1322     # However, it has the same basename, so the bogon will be chosen
1323     # first if we set CC to just the basename; use the full file name.
1324     shift
1325     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1326     shift
1327     ac_cv_prog_CC="$@"
1328   fi
1329 fi
1330 fi
1331 fi
1332 CC=$ac_cv_prog_CC
1333 if test -n "$CC"; then
1334   echo "$as_me:1334: result: $CC" >&5
1335 echo "${ECHO_T}$CC" >&6
1336 else
1337   echo "$as_me:1337: result: no" >&5
1338 echo "${ECHO_T}no" >&6
1339 fi
1340
1341 fi
1342 if test -z "$CC"; then
1343   if test -n "$ac_tool_prefix"; then
1344   for ac_prog in cl
1345   do
1346     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1347 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1348 echo "$as_me:1348: checking for $ac_word" >&5
1349 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1350 if test "${ac_cv_prog_CC+set}" = set; then
1351   echo $ECHO_N "(cached) $ECHO_C" >&6
1352 else
1353   if test -n "$CC"; then
1354   ac_cv_prog_CC="$CC" # Let the user override the test.
1355 else
1356   ac_save_IFS=$IFS; IFS=$ac_path_separator
1357 ac_dummy="$PATH"
1358 for ac_dir in $ac_dummy; do
1359   IFS=$ac_save_IFS
1360   test -z "$ac_dir" && ac_dir=.
1361   $as_executable_p "$ac_dir/$ac_word" || continue
1362 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1363 echo "$as_me:1363: found $ac_dir/$ac_word" >&5
1364 break
1365 done
1366
1367 fi
1368 fi
1369 CC=$ac_cv_prog_CC
1370 if test -n "$CC"; then
1371   echo "$as_me:1371: result: $CC" >&5
1372 echo "${ECHO_T}$CC" >&6
1373 else
1374   echo "$as_me:1374: result: no" >&5
1375 echo "${ECHO_T}no" >&6
1376 fi
1377
1378     test -n "$CC" && break
1379   done
1380 fi
1381 if test -z "$CC"; then
1382   ac_ct_CC=$CC
1383   for ac_prog in cl
1384 do
1385   # Extract the first word of "$ac_prog", so it can be a program name with args.
1386 set dummy $ac_prog; ac_word=$2
1387 echo "$as_me:1387: checking for $ac_word" >&5
1388 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1389 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1390   echo $ECHO_N "(cached) $ECHO_C" >&6
1391 else
1392   if test -n "$ac_ct_CC"; then
1393   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1394 else
1395   ac_save_IFS=$IFS; IFS=$ac_path_separator
1396 ac_dummy="$PATH"
1397 for ac_dir in $ac_dummy; do
1398   IFS=$ac_save_IFS
1399   test -z "$ac_dir" && ac_dir=.
1400   $as_executable_p "$ac_dir/$ac_word" || continue
1401 ac_cv_prog_ac_ct_CC="$ac_prog"
1402 echo "$as_me:1402: found $ac_dir/$ac_word" >&5
1403 break
1404 done
1405
1406 fi
1407 fi
1408 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1409 if test -n "$ac_ct_CC"; then
1410   echo "$as_me:1410: result: $ac_ct_CC" >&5
1411 echo "${ECHO_T}$ac_ct_CC" >&6
1412 else
1413   echo "$as_me:1413: result: no" >&5
1414 echo "${ECHO_T}no" >&6
1415 fi
1416
1417   test -n "$ac_ct_CC" && break
1418 done
1419
1420   CC=$ac_ct_CC
1421 fi
1422
1423 fi
1424
1425 test -z "$CC" && { { echo "$as_me:1425: error: no acceptable cc found in \$PATH" >&5
1426 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1427    { (exit 1); exit 1; }; }
1428
1429 # Provide some information about the compiler.
1430 echo "$as_me:1430:" \
1431      "checking for C compiler version" >&5
1432 ac_compiler=`set X $ac_compile; echo $2`
1433 { (eval echo "$as_me:1433: \"$ac_compiler --version </dev/null >&5\"") >&5
1434   (eval $ac_compiler --version </dev/null >&5) 2>&5
1435   ac_status=$?
1436   echo "$as_me:1436: \$? = $ac_status" >&5
1437   (exit $ac_status); }
1438 { (eval echo "$as_me:1438: \"$ac_compiler -v </dev/null >&5\"") >&5
1439   (eval $ac_compiler -v </dev/null >&5) 2>&5
1440   ac_status=$?
1441   echo "$as_me:1441: \$? = $ac_status" >&5
1442   (exit $ac_status); }
1443 { (eval echo "$as_me:1443: \"$ac_compiler -V </dev/null >&5\"") >&5
1444   (eval $ac_compiler -V </dev/null >&5) 2>&5
1445   ac_status=$?
1446   echo "$as_me:1446: \$? = $ac_status" >&5
1447   (exit $ac_status); }
1448
1449 cat >conftest.$ac_ext <<_ACEOF
1450 #line 1450 "configure"
1451 #include "confdefs.h"
1452
1453 int
1454 main ()
1455 {
1456
1457   ;
1458   return 0;
1459 }
1460 _ACEOF
1461 ac_clean_files_save=$ac_clean_files
1462 ac_clean_files="$ac_clean_files a.out a.exe"
1463 # Try to create an executable without -o first, disregard a.out.
1464 # It will help us diagnose broken compilers, and finding out an intuition
1465 # of exeext.
1466 echo "$as_me:1466: checking for C compiler default output" >&5
1467 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1468 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1469 if { (eval echo "$as_me:1469: \"$ac_link_default\"") >&5
1470   (eval $ac_link_default) 2>&5
1471   ac_status=$?
1472   echo "$as_me:1472: \$? = $ac_status" >&5
1473   (exit $ac_status); }; then
1474   # Find the output, starting from the most likely.  This scheme is
1475 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1476 # resort.
1477 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1478                 ls a.out conftest 2>/dev/null;
1479                 ls a.* conftest.* 2>/dev/null`; do
1480   case $ac_file in
1481     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1482     a.out ) # We found the default executable, but exeext='' is most
1483             # certainly right.
1484             break;;
1485     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1486           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1487           export ac_cv_exeext
1488           break;;
1489     * ) break;;
1490   esac
1491 done
1492 else
1493   echo "$as_me: failed program was:" >&5
1494 cat conftest.$ac_ext >&5
1495 { { echo "$as_me:1495: error: C compiler cannot create executables" >&5
1496 echo "$as_me: error: C compiler cannot create executables" >&2;}
1497    { (exit 77); exit 77; }; }
1498 fi
1499
1500 ac_exeext=$ac_cv_exeext
1501 echo "$as_me:1501: result: $ac_file" >&5
1502 echo "${ECHO_T}$ac_file" >&6
1503
1504 # Check the compiler produces executables we can run.  If not, either
1505 # the compiler is broken, or we cross compile.
1506 echo "$as_me:1506: checking whether the C compiler works" >&5
1507 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1508 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1509 # If not cross compiling, check that we can run a simple program.
1510 if test "$cross_compiling" != yes; then
1511   if { ac_try='./$ac_file'
1512   { (eval echo "$as_me:1512: \"$ac_try\"") >&5
1513   (eval $ac_try) 2>&5
1514   ac_status=$?
1515   echo "$as_me:1515: \$? = $ac_status" >&5
1516   (exit $ac_status); }; }; then
1517     cross_compiling=no
1518   else
1519     if test "$cross_compiling" = maybe; then
1520         cross_compiling=yes
1521     else
1522         { { echo "$as_me:1522: error: cannot run C compiled programs.
1523 If you meant to cross compile, use \`--host'." >&5
1524 echo "$as_me: error: cannot run C compiled programs.
1525 If you meant to cross compile, use \`--host'." >&2;}
1526    { (exit 1); exit 1; }; }
1527     fi
1528   fi
1529 fi
1530 echo "$as_me:1530: result: yes" >&5
1531 echo "${ECHO_T}yes" >&6
1532
1533 rm -f a.out a.exe conftest$ac_cv_exeext
1534 ac_clean_files=$ac_clean_files_save
1535 # Check the compiler produces executables we can run.  If not, either
1536 # the compiler is broken, or we cross compile.
1537 echo "$as_me:1537: checking whether we are cross compiling" >&5
1538 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1539 echo "$as_me:1539: result: $cross_compiling" >&5
1540 echo "${ECHO_T}$cross_compiling" >&6
1541
1542 echo "$as_me:1542: checking for executable suffix" >&5
1543 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1544 if { (eval echo "$as_me:1544: \"$ac_link\"") >&5
1545   (eval $ac_link) 2>&5
1546   ac_status=$?
1547   echo "$as_me:1547: \$? = $ac_status" >&5
1548   (exit $ac_status); }; then
1549   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1550 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1551 # work properly (i.e., refer to `conftest.exe'), while it won't with
1552 # `rm'.
1553 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1554   case $ac_file in
1555     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1556     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1557           export ac_cv_exeext
1558           break;;
1559     * ) break;;
1560   esac
1561 done
1562 else
1563   { { echo "$as_me:1563: error: cannot compute EXEEXT: cannot compile and link" >&5
1564 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1565    { (exit 1); exit 1; }; }
1566 fi
1567
1568 rm -f conftest$ac_cv_exeext
1569 echo "$as_me:1569: result: $ac_cv_exeext" >&5
1570 echo "${ECHO_T}$ac_cv_exeext" >&6
1571
1572 rm -f conftest.$ac_ext
1573 EXEEXT=$ac_cv_exeext
1574 ac_exeext=$EXEEXT
1575 echo "$as_me:1575: checking for object suffix" >&5
1576 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1577 if test "${ac_cv_objext+set}" = set; then
1578   echo $ECHO_N "(cached) $ECHO_C" >&6
1579 else
1580   cat >conftest.$ac_ext <<_ACEOF
1581 #line 1581 "configure"
1582 #include "confdefs.h"
1583
1584 int
1585 main ()
1586 {
1587
1588   ;
1589   return 0;
1590 }
1591 _ACEOF
1592 rm -f conftest.o conftest.obj
1593 if { (eval echo "$as_me:1593: \"$ac_compile\"") >&5
1594   (eval $ac_compile) 2>&5
1595   ac_status=$?
1596   echo "$as_me:1596: \$? = $ac_status" >&5
1597   (exit $ac_status); }; then
1598   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1599   case $ac_file in
1600     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1601     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1602        break;;
1603   esac
1604 done
1605 else
1606   echo "$as_me: failed program was:" >&5
1607 cat conftest.$ac_ext >&5
1608 { { echo "$as_me:1608: error: cannot compute OBJEXT: cannot compile" >&5
1609 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1610    { (exit 1); exit 1; }; }
1611 fi
1612
1613 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1614 fi
1615 echo "$as_me:1615: result: $ac_cv_objext" >&5
1616 echo "${ECHO_T}$ac_cv_objext" >&6
1617 OBJEXT=$ac_cv_objext
1618 ac_objext=$OBJEXT
1619 echo "$as_me:1619: checking whether we are using the GNU C compiler" >&5
1620 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1621 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1622   echo $ECHO_N "(cached) $ECHO_C" >&6
1623 else
1624   cat >conftest.$ac_ext <<_ACEOF
1625 #line 1625 "configure"
1626 #include "confdefs.h"
1627
1628 int
1629 main ()
1630 {
1631 #ifndef __GNUC__
1632        choke me
1633 #endif
1634
1635   ;
1636   return 0;
1637 }
1638 _ACEOF
1639 rm -f conftest.$ac_objext
1640 if { (eval echo "$as_me:1640: \"$ac_compile\"") >&5
1641   (eval $ac_compile) 2>&5
1642   ac_status=$?
1643   echo "$as_me:1643: \$? = $ac_status" >&5
1644   (exit $ac_status); } &&
1645          { ac_try='test -s conftest.$ac_objext'
1646   { (eval echo "$as_me:1646: \"$ac_try\"") >&5
1647   (eval $ac_try) 2>&5
1648   ac_status=$?
1649   echo "$as_me:1649: \$? = $ac_status" >&5
1650   (exit $ac_status); }; }; then
1651   ac_compiler_gnu=yes
1652 else
1653   echo "$as_me: failed program was:" >&5
1654 cat conftest.$ac_ext >&5
1655 ac_compiler_gnu=no
1656 fi
1657 rm -f conftest.$ac_objext conftest.$ac_ext
1658 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1659
1660 fi
1661 echo "$as_me:1661: result: $ac_cv_c_compiler_gnu" >&5
1662 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1663 GCC=`test $ac_compiler_gnu = yes && echo yes`
1664 ac_test_CFLAGS=${CFLAGS+set}
1665 ac_save_CFLAGS=$CFLAGS
1666 CFLAGS="-g"
1667 echo "$as_me:1667: checking whether $CC accepts -g" >&5
1668 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1669 if test "${ac_cv_prog_cc_g+set}" = set; then
1670   echo $ECHO_N "(cached) $ECHO_C" >&6
1671 else
1672   cat >conftest.$ac_ext <<_ACEOF
1673 #line 1673 "configure"
1674 #include "confdefs.h"
1675
1676 int
1677 main ()
1678 {
1679
1680   ;
1681   return 0;
1682 }
1683 _ACEOF
1684 rm -f conftest.$ac_objext
1685 if { (eval echo "$as_me:1685: \"$ac_compile\"") >&5
1686   (eval $ac_compile) 2>&5
1687   ac_status=$?
1688   echo "$as_me:1688: \$? = $ac_status" >&5
1689   (exit $ac_status); } &&
1690          { ac_try='test -s conftest.$ac_objext'
1691   { (eval echo "$as_me:1691: \"$ac_try\"") >&5
1692   (eval $ac_try) 2>&5
1693   ac_status=$?
1694   echo "$as_me:1694: \$? = $ac_status" >&5
1695   (exit $ac_status); }; }; then
1696   ac_cv_prog_cc_g=yes
1697 else
1698   echo "$as_me: failed program was:" >&5
1699 cat conftest.$ac_ext >&5
1700 ac_cv_prog_cc_g=no
1701 fi
1702 rm -f conftest.$ac_objext conftest.$ac_ext
1703 fi
1704 echo "$as_me:1704: result: $ac_cv_prog_cc_g" >&5
1705 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1706 if test "$ac_test_CFLAGS" = set; then
1707   CFLAGS=$ac_save_CFLAGS
1708 elif test $ac_cv_prog_cc_g = yes; then
1709   if test "$GCC" = yes; then
1710     CFLAGS="-g -O2"
1711   else
1712     CFLAGS="-g"
1713   fi
1714 else
1715   if test "$GCC" = yes; then
1716     CFLAGS="-O2"
1717   else
1718     CFLAGS=
1719   fi
1720 fi
1721 # Some people use a C++ compiler to compile C.  Since we use `exit',
1722 # in C++ we need to declare it.  In case someone uses the same compiler
1723 # for both compiling C and C++ we need to have the C++ compiler decide
1724 # the declaration of exit, since it's the most demanding environment.
1725 cat >conftest.$ac_ext <<_ACEOF
1726 #ifndef __cplusplus
1727   choke me
1728 #endif
1729 _ACEOF
1730 rm -f conftest.$ac_objext
1731 if { (eval echo "$as_me:1731: \"$ac_compile\"") >&5
1732   (eval $ac_compile) 2>&5
1733   ac_status=$?
1734   echo "$as_me:1734: \$? = $ac_status" >&5
1735   (exit $ac_status); } &&
1736          { ac_try='test -s conftest.$ac_objext'
1737   { (eval echo "$as_me:1737: \"$ac_try\"") >&5
1738   (eval $ac_try) 2>&5
1739   ac_status=$?
1740   echo "$as_me:1740: \$? = $ac_status" >&5
1741   (exit $ac_status); }; }; then
1742   for ac_declaration in \
1743    ''\
1744    '#include <stdlib.h>' \
1745    'extern "C" void std::exit (int) throw (); using std::exit;' \
1746    'extern "C" void std::exit (int); using std::exit;' \
1747    'extern "C" void exit (int) throw ();' \
1748    'extern "C" void exit (int);' \
1749    'void exit (int);'
1750 do
1751   cat >conftest.$ac_ext <<_ACEOF
1752 #line 1752 "configure"
1753 #include "confdefs.h"
1754 #include <stdlib.h>
1755 $ac_declaration
1756 int
1757 main ()
1758 {
1759 exit (42);
1760   ;
1761   return 0;
1762 }
1763 _ACEOF
1764 rm -f conftest.$ac_objext
1765 if { (eval echo "$as_me:1765: \"$ac_compile\"") >&5
1766   (eval $ac_compile) 2>&5
1767   ac_status=$?
1768   echo "$as_me:1768: \$? = $ac_status" >&5
1769   (exit $ac_status); } &&
1770          { ac_try='test -s conftest.$ac_objext'
1771   { (eval echo "$as_me:1771: \"$ac_try\"") >&5
1772   (eval $ac_try) 2>&5
1773   ac_status=$?
1774   echo "$as_me:1774: \$? = $ac_status" >&5
1775   (exit $ac_status); }; }; then
1776   :
1777 else
1778   echo "$as_me: failed program was:" >&5
1779 cat conftest.$ac_ext >&5
1780 continue
1781 fi
1782 rm -f conftest.$ac_objext conftest.$ac_ext
1783   cat >conftest.$ac_ext <<_ACEOF
1784 #line 1784 "configure"
1785 #include "confdefs.h"
1786 $ac_declaration
1787 int
1788 main ()
1789 {
1790 exit (42);
1791   ;
1792   return 0;
1793 }
1794 _ACEOF
1795 rm -f conftest.$ac_objext
1796 if { (eval echo "$as_me:1796: \"$ac_compile\"") >&5
1797   (eval $ac_compile) 2>&5
1798   ac_status=$?
1799   echo "$as_me:1799: \$? = $ac_status" >&5
1800   (exit $ac_status); } &&
1801          { ac_try='test -s conftest.$ac_objext'
1802   { (eval echo "$as_me:1802: \"$ac_try\"") >&5
1803   (eval $ac_try) 2>&5
1804   ac_status=$?
1805   echo "$as_me:1805: \$? = $ac_status" >&5
1806   (exit $ac_status); }; }; then
1807   break
1808 else
1809   echo "$as_me: failed program was:" >&5
1810 cat conftest.$ac_ext >&5
1811 fi
1812 rm -f conftest.$ac_objext conftest.$ac_ext
1813 done
1814 rm -rf conftest*
1815 if test -n "$ac_declaration"; then
1816   echo '#ifdef __cplusplus' >>confdefs.h
1817   echo $ac_declaration      >>confdefs.h
1818   echo '#endif'             >>confdefs.h
1819 fi
1820
1821 else
1822   echo "$as_me: failed program was:" >&5
1823 cat conftest.$ac_ext >&5
1824 fi
1825 rm -f conftest.$ac_objext conftest.$ac_ext
1826 ac_ext=c
1827 ac_cpp='$CPP $CPPFLAGS'
1828 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1829 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1830 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1831 ac_main_return=return
1832
1833 GCC_VERSION=none
1834 if test "$GCC" = yes ; then
1835         echo "$as_me:1835: checking version of $CC" >&5
1836 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1837         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.].*//'`"
1838         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1839         echo "$as_me:1839: result: $GCC_VERSION" >&5
1840 echo "${ECHO_T}$GCC_VERSION" >&6
1841 fi
1842
1843 echo "$as_me:1843: checking for $CC option to accept ANSI C" >&5
1844 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1845 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1846   echo $ECHO_N "(cached) $ECHO_C" >&6
1847 else
1848   ac_cv_prog_cc_stdc=no
1849 ac_save_CC=$CC
1850 cat >conftest.$ac_ext <<_ACEOF
1851 #line 1851 "configure"
1852 #include "confdefs.h"
1853 #include <stdarg.h>
1854 #include <stdio.h>
1855 #include <sys/types.h>
1856 #include <sys/stat.h>
1857 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1858 struct buf { int x; };
1859 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1860 static char *e (p, i)
1861      char **p;
1862      int i;
1863 {
1864   return p[i];
1865 }
1866 static char *f (char * (*g) (char **, int), char **p, ...)
1867 {
1868   char *s;
1869   va_list v;
1870   va_start (v,p);
1871   s = g (p, va_arg (v,int));
1872   va_end (v);
1873   return s;
1874 }
1875 int test (int i, double x);
1876 struct s1 {int (*f) (int a);};
1877 struct s2 {int (*f) (double a);};
1878 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1879 int argc;
1880 char **argv;
1881 int
1882 main ()
1883 {
1884 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1885   ;
1886   return 0;
1887 }
1888 _ACEOF
1889 # Don't try gcc -ansi; that turns off useful extensions and
1890 # breaks some systems' header files.
1891 # AIX                   -qlanglvl=ansi
1892 # Ultrix and OSF/1      -std1
1893 # HP-UX 10.20 and later -Ae
1894 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1895 # SVR4                  -Xc -D__EXTENSIONS__
1896 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1897 do
1898   CC="$ac_save_CC $ac_arg"
1899   rm -f conftest.$ac_objext
1900 if { (eval echo "$as_me:1900: \"$ac_compile\"") >&5
1901   (eval $ac_compile) 2>&5
1902   ac_status=$?
1903   echo "$as_me:1903: \$? = $ac_status" >&5
1904   (exit $ac_status); } &&
1905          { ac_try='test -s conftest.$ac_objext'
1906   { (eval echo "$as_me:1906: \"$ac_try\"") >&5
1907   (eval $ac_try) 2>&5
1908   ac_status=$?
1909   echo "$as_me:1909: \$? = $ac_status" >&5
1910   (exit $ac_status); }; }; then
1911   ac_cv_prog_cc_stdc=$ac_arg
1912 break
1913 else
1914   echo "$as_me: failed program was:" >&5
1915 cat conftest.$ac_ext >&5
1916 fi
1917 rm -f conftest.$ac_objext
1918 done
1919 rm -f conftest.$ac_ext conftest.$ac_objext
1920 CC=$ac_save_CC
1921
1922 fi
1923
1924 case "x$ac_cv_prog_cc_stdc" in
1925   x|xno)
1926     echo "$as_me:1926: result: none needed" >&5
1927 echo "${ECHO_T}none needed" >&6 ;;
1928   *)
1929     echo "$as_me:1929: result: $ac_cv_prog_cc_stdc" >&5
1930 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1931     CC="$CC $ac_cv_prog_cc_stdc" ;;
1932 esac
1933
1934 # This should have been defined by AC_PROG_CC
1935 : ${CC:=cc}
1936
1937 echo "$as_me:1937: checking \$CC variable" >&5
1938 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1939 case "$CC" in
1940 (*[\ \  ]-*)
1941         echo "$as_me:1941: result: broken" >&5
1942 echo "${ECHO_T}broken" >&6
1943         { echo "$as_me:1943: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1944 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1945         # humor him...
1946         cf_flags=`echo "$CC" | sed -e 's/^.*[   ]\(-[^  ]\)/\1/'`
1947         CC=`echo "$CC " | sed -e 's/[   ]-[^    ].*$//' -e 's/[         ]*$//'`
1948         for cf_arg in $cf_flags
1949         do
1950                 case "x$cf_arg" in
1951                 (x-[IUDfgOW]*)
1952
1953 cf_fix_cppflags=no
1954 cf_new_cflags=
1955 cf_new_cppflags=
1956 cf_new_extra_cppflags=
1957
1958 for cf_add_cflags in $cf_flags
1959 do
1960 case $cf_fix_cppflags in
1961 (no)
1962         case $cf_add_cflags in
1963         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1964                 case $cf_add_cflags in
1965                 (-D*)
1966                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1967
1968                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1969                                 && test -z "${cf_tst_cflags}" \
1970                                 && cf_fix_cppflags=yes
1971
1972                         if test $cf_fix_cppflags = yes ; then
1973                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1974                                 continue
1975                         elif test "${cf_tst_cflags}" = "\"'" ; then
1976                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1977                                 continue
1978                         fi
1979                         ;;
1980                 esac
1981                 case "$CPPFLAGS" in
1982                 (*$cf_add_cflags)
1983                         ;;
1984                 (*)
1985                         case $cf_add_cflags in
1986                         (-D*)
1987                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1988
1989 CPPFLAGS=`echo "$CPPFLAGS" | \
1990         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1991                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1992
1993                                 ;;
1994                         esac
1995                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1996                         ;;
1997                 esac
1998                 ;;
1999         (*)
2000                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2001                 ;;
2002         esac
2003         ;;
2004 (yes)
2005         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2006
2007         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2008
2009         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2010                 && test -z "${cf_tst_cflags}" \
2011                 && cf_fix_cppflags=no
2012         ;;
2013 esac
2014 done
2015
2016 if test -n "$cf_new_cflags" ; then
2017
2018         CFLAGS="$CFLAGS $cf_new_cflags"
2019 fi
2020
2021 if test -n "$cf_new_cppflags" ; then
2022
2023         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2024 fi
2025
2026 if test -n "$cf_new_extra_cppflags" ; then
2027
2028         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2029 fi
2030
2031                         ;;
2032                 (*)
2033                         CC="$CC $cf_arg"
2034                         ;;
2035                 esac
2036         done
2037         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2038
2039 echo "${as_me:-configure}:2039: testing resulting CC: '$CC' ..." 1>&5
2040
2041         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2042
2043 echo "${as_me:-configure}:2043: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2044
2045         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2046
2047 echo "${as_me:-configure}:2047: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2048
2049         ;;
2050 (*)
2051         echo "$as_me:2051: result: ok" >&5
2052 echo "${ECHO_T}ok" >&6
2053         ;;
2054 esac
2055
2056 ac_ext=c
2057 ac_cpp='$CPP $CPPFLAGS'
2058 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2059 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2060 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2061 ac_main_return=return
2062 echo "$as_me:2062: checking how to run the C preprocessor" >&5
2063 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2064 # On Suns, sometimes $CPP names a directory.
2065 if test -n "$CPP" && test -d "$CPP"; then
2066   CPP=
2067 fi
2068 if test -z "$CPP"; then
2069   if test "${ac_cv_prog_CPP+set}" = set; then
2070   echo $ECHO_N "(cached) $ECHO_C" >&6
2071 else
2072       # Double quotes because CPP needs to be expanded
2073     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2074     do
2075       ac_preproc_ok=false
2076 for ac_c_preproc_warn_flag in '' yes
2077 do
2078   # Use a header file that comes with gcc, so configuring glibc
2079   # with a fresh cross-compiler works.
2080   # On the NeXT, cc -E runs the code through the compiler's parser,
2081   # not just through cpp. "Syntax error" is here to catch this case.
2082   cat >conftest.$ac_ext <<_ACEOF
2083 #line 2083 "configure"
2084 #include "confdefs.h"
2085 #include <assert.h>
2086                      Syntax error
2087 _ACEOF
2088 if { (eval echo "$as_me:2088: \"$ac_cpp conftest.$ac_ext\"") >&5
2089   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2090   ac_status=$?
2091   egrep -v '^ *\+' conftest.er1 >conftest.err
2092   rm -f conftest.er1
2093   cat conftest.err >&5
2094   echo "$as_me:2094: \$? = $ac_status" >&5
2095   (exit $ac_status); } >/dev/null; then
2096   if test -s conftest.err; then
2097     ac_cpp_err=$ac_c_preproc_warn_flag
2098   else
2099     ac_cpp_err=
2100   fi
2101 else
2102   ac_cpp_err=yes
2103 fi
2104 if test -z "$ac_cpp_err"; then
2105   :
2106 else
2107   echo "$as_me: failed program was:" >&5
2108   cat conftest.$ac_ext >&5
2109   # Broken: fails on valid input.
2110 continue
2111 fi
2112 rm -f conftest.err conftest.$ac_ext
2113
2114   # OK, works on sane cases.  Now check whether non-existent headers
2115   # can be detected and how.
2116   cat >conftest.$ac_ext <<_ACEOF
2117 #line 2117 "configure"
2118 #include "confdefs.h"
2119 #include <ac_nonexistent.h>
2120 _ACEOF
2121 if { (eval echo "$as_me:2121: \"$ac_cpp conftest.$ac_ext\"") >&5
2122   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2123   ac_status=$?
2124   egrep -v '^ *\+' conftest.er1 >conftest.err
2125   rm -f conftest.er1
2126   cat conftest.err >&5
2127   echo "$as_me:2127: \$? = $ac_status" >&5
2128   (exit $ac_status); } >/dev/null; then
2129   if test -s conftest.err; then
2130     ac_cpp_err=$ac_c_preproc_warn_flag
2131   else
2132     ac_cpp_err=
2133   fi
2134 else
2135   ac_cpp_err=yes
2136 fi
2137 if test -z "$ac_cpp_err"; then
2138   # Broken: success on invalid input.
2139 continue
2140 else
2141   echo "$as_me: failed program was:" >&5
2142   cat conftest.$ac_ext >&5
2143   # Passes both tests.
2144 ac_preproc_ok=:
2145 break
2146 fi
2147 rm -f conftest.err conftest.$ac_ext
2148
2149 done
2150 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2151 rm -f conftest.err conftest.$ac_ext
2152 if $ac_preproc_ok; then
2153   break
2154 fi
2155
2156     done
2157     ac_cv_prog_CPP=$CPP
2158
2159 fi
2160   CPP=$ac_cv_prog_CPP
2161 else
2162   ac_cv_prog_CPP=$CPP
2163 fi
2164 echo "$as_me:2164: result: $CPP" >&5
2165 echo "${ECHO_T}$CPP" >&6
2166 ac_preproc_ok=false
2167 for ac_c_preproc_warn_flag in '' yes
2168 do
2169   # Use a header file that comes with gcc, so configuring glibc
2170   # with a fresh cross-compiler works.
2171   # On the NeXT, cc -E runs the code through the compiler's parser,
2172   # not just through cpp. "Syntax error" is here to catch this case.
2173   cat >conftest.$ac_ext <<_ACEOF
2174 #line 2174 "configure"
2175 #include "confdefs.h"
2176 #include <assert.h>
2177                      Syntax error
2178 _ACEOF
2179 if { (eval echo "$as_me:2179: \"$ac_cpp conftest.$ac_ext\"") >&5
2180   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2181   ac_status=$?
2182   egrep -v '^ *\+' conftest.er1 >conftest.err
2183   rm -f conftest.er1
2184   cat conftest.err >&5
2185   echo "$as_me:2185: \$? = $ac_status" >&5
2186   (exit $ac_status); } >/dev/null; then
2187   if test -s conftest.err; then
2188     ac_cpp_err=$ac_c_preproc_warn_flag
2189   else
2190     ac_cpp_err=
2191   fi
2192 else
2193   ac_cpp_err=yes
2194 fi
2195 if test -z "$ac_cpp_err"; then
2196   :
2197 else
2198   echo "$as_me: failed program was:" >&5
2199   cat conftest.$ac_ext >&5
2200   # Broken: fails on valid input.
2201 continue
2202 fi
2203 rm -f conftest.err conftest.$ac_ext
2204
2205   # OK, works on sane cases.  Now check whether non-existent headers
2206   # can be detected and how.
2207   cat >conftest.$ac_ext <<_ACEOF
2208 #line 2208 "configure"
2209 #include "confdefs.h"
2210 #include <ac_nonexistent.h>
2211 _ACEOF
2212 if { (eval echo "$as_me:2212: \"$ac_cpp conftest.$ac_ext\"") >&5
2213   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2214   ac_status=$?
2215   egrep -v '^ *\+' conftest.er1 >conftest.err
2216   rm -f conftest.er1
2217   cat conftest.err >&5
2218   echo "$as_me:2218: \$? = $ac_status" >&5
2219   (exit $ac_status); } >/dev/null; then
2220   if test -s conftest.err; then
2221     ac_cpp_err=$ac_c_preproc_warn_flag
2222   else
2223     ac_cpp_err=
2224   fi
2225 else
2226   ac_cpp_err=yes
2227 fi
2228 if test -z "$ac_cpp_err"; then
2229   # Broken: success on invalid input.
2230 continue
2231 else
2232   echo "$as_me: failed program was:" >&5
2233   cat conftest.$ac_ext >&5
2234   # Passes both tests.
2235 ac_preproc_ok=:
2236 break
2237 fi
2238 rm -f conftest.err conftest.$ac_ext
2239
2240 done
2241 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2242 rm -f conftest.err conftest.$ac_ext
2243 if $ac_preproc_ok; then
2244   :
2245 else
2246   { { echo "$as_me:2246: error: C preprocessor \"$CPP\" fails sanity check" >&5
2247 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2248    { (exit 1); exit 1; }; }
2249 fi
2250
2251 ac_ext=c
2252 ac_cpp='$CPP $CPPFLAGS'
2253 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2254 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2255 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2256 ac_main_return=return
2257
2258 for ac_prog in mawk gawk nawk awk
2259 do
2260   # Extract the first word of "$ac_prog", so it can be a program name with args.
2261 set dummy $ac_prog; ac_word=$2
2262 echo "$as_me:2262: checking for $ac_word" >&5
2263 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2264 if test "${ac_cv_prog_AWK+set}" = set; then
2265   echo $ECHO_N "(cached) $ECHO_C" >&6
2266 else
2267   if test -n "$AWK"; then
2268   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2269 else
2270   ac_save_IFS=$IFS; IFS=$ac_path_separator
2271 ac_dummy="$PATH"
2272 for ac_dir in $ac_dummy; do
2273   IFS=$ac_save_IFS
2274   test -z "$ac_dir" && ac_dir=.
2275   $as_executable_p "$ac_dir/$ac_word" || continue
2276 ac_cv_prog_AWK="$ac_prog"
2277 echo "$as_me:2277: found $ac_dir/$ac_word" >&5
2278 break
2279 done
2280
2281 fi
2282 fi
2283 AWK=$ac_cv_prog_AWK
2284 if test -n "$AWK"; then
2285   echo "$as_me:2285: result: $AWK" >&5
2286 echo "${ECHO_T}$AWK" >&6
2287 else
2288   echo "$as_me:2288: result: no" >&5
2289 echo "${ECHO_T}no" >&6
2290 fi
2291
2292   test -n "$AWK" && break
2293 done
2294
2295 # Find a good install program.  We prefer a C program (faster),
2296 # so one script is as good as another.  But avoid the broken or
2297 # incompatible versions:
2298 # SysV /etc/install, /usr/sbin/install
2299 # SunOS /usr/etc/install
2300 # IRIX /sbin/install
2301 # AIX /bin/install
2302 # AmigaOS /C/install, which installs bootblocks on floppy discs
2303 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2304 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2305 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2306 # ./install, which can be erroneously created by make from ./install.sh.
2307 echo "$as_me:2307: checking for a BSD compatible install" >&5
2308 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2309 if test -z "$INSTALL"; then
2310 if test "${ac_cv_path_install+set}" = set; then
2311   echo $ECHO_N "(cached) $ECHO_C" >&6
2312 else
2313     ac_save_IFS=$IFS; IFS=$ac_path_separator
2314   for ac_dir in $PATH; do
2315     IFS=$ac_save_IFS
2316     # Account for people who put trailing slashes in PATH elements.
2317     case $ac_dir/ in
2318     / | ./ | .// | /cC/* \
2319     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2320     | /usr/ucb/* ) ;;
2321     *)
2322       # OSF1 and SCO ODT 3.0 have their own names for install.
2323       # Don't use installbsd from OSF since it installs stuff as root
2324       # by default.
2325       for ac_prog in ginstall scoinst install; do
2326         if $as_executable_p "$ac_dir/$ac_prog"; then
2327           if test $ac_prog = install &&
2328             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2329             # AIX install.  It has an incompatible calling convention.
2330             :
2331           elif test $ac_prog = install &&
2332             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2333             # program-specific install script used by HP pwplus--don't use.
2334             :
2335           else
2336             ac_cv_path_install="$ac_dir/$ac_prog -c"
2337             break 2
2338           fi
2339         fi
2340       done
2341       ;;
2342     esac
2343   done
2344
2345 fi
2346   if test "${ac_cv_path_install+set}" = set; then
2347     INSTALL=$ac_cv_path_install
2348   else
2349     # As a last resort, use the slow shell script.  We don't cache a
2350     # path for INSTALL within a source directory, because that will
2351     # break other packages using the cache if that directory is
2352     # removed, or if the path is relative.
2353     INSTALL=$ac_install_sh
2354   fi
2355 fi
2356 echo "$as_me:2356: result: $INSTALL" >&5
2357 echo "${ECHO_T}$INSTALL" >&6
2358
2359 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2360 # It thinks the first close brace ends the variable substitution.
2361 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2362
2363 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2364
2365 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2366
2367 case $INSTALL in
2368 (/*)
2369         ;;
2370 (*)
2371         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2372         test -z "$cf_dir" && cf_dir=.
2373         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2374         ;;
2375 esac
2376
2377 for ac_prog in lint cppcheck splint
2378 do
2379   # Extract the first word of "$ac_prog", so it can be a program name with args.
2380 set dummy $ac_prog; ac_word=$2
2381 echo "$as_me:2381: checking for $ac_word" >&5
2382 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2383 if test "${ac_cv_prog_LINT+set}" = set; then
2384   echo $ECHO_N "(cached) $ECHO_C" >&6
2385 else
2386   if test -n "$LINT"; then
2387   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2388 else
2389   ac_save_IFS=$IFS; IFS=$ac_path_separator
2390 ac_dummy="$PATH"
2391 for ac_dir in $ac_dummy; do
2392   IFS=$ac_save_IFS
2393   test -z "$ac_dir" && ac_dir=.
2394   $as_executable_p "$ac_dir/$ac_word" || continue
2395 ac_cv_prog_LINT="$ac_prog"
2396 echo "$as_me:2396: found $ac_dir/$ac_word" >&5
2397 break
2398 done
2399
2400 fi
2401 fi
2402 LINT=$ac_cv_prog_LINT
2403 if test -n "$LINT"; then
2404   echo "$as_me:2404: result: $LINT" >&5
2405 echo "${ECHO_T}$LINT" >&6
2406 else
2407   echo "$as_me:2407: result: no" >&5
2408 echo "${ECHO_T}no" >&6
2409 fi
2410
2411   test -n "$LINT" && break
2412 done
2413
2414 echo "$as_me:2414: checking if filesystem supports mixed-case filenames" >&5
2415 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2416 if test "${cf_cv_mixedcase+set}" = set; then
2417   echo $ECHO_N "(cached) $ECHO_C" >&6
2418 else
2419
2420 if test "$cross_compiling" = yes ; then
2421         case $target_alias in
2422         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2423                 cf_cv_mixedcase=no
2424                 ;;
2425         (*)
2426                 cf_cv_mixedcase=yes
2427                 ;;
2428         esac
2429 else
2430         rm -f conftest CONFTEST
2431         echo test >conftest
2432         if test -f CONFTEST ; then
2433                 cf_cv_mixedcase=no
2434         else
2435                 cf_cv_mixedcase=yes
2436         fi
2437         rm -f conftest CONFTEST
2438 fi
2439
2440 fi
2441 echo "$as_me:2441: result: $cf_cv_mixedcase" >&5
2442 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2443 test "$cf_cv_mixedcase" = yes &&
2444 cat >>confdefs.h <<\EOF
2445 #define MIXEDCASE_FILENAMES 1
2446 EOF
2447
2448 for ac_prog in exctags ctags
2449 do
2450   # Extract the first word of "$ac_prog", so it can be a program name with args.
2451 set dummy $ac_prog; ac_word=$2
2452 echo "$as_me:2452: checking for $ac_word" >&5
2453 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2454 if test "${ac_cv_prog_CTAGS+set}" = set; then
2455   echo $ECHO_N "(cached) $ECHO_C" >&6
2456 else
2457   if test -n "$CTAGS"; then
2458   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2459 else
2460   ac_save_IFS=$IFS; IFS=$ac_path_separator
2461 ac_dummy="$PATH"
2462 for ac_dir in $ac_dummy; do
2463   IFS=$ac_save_IFS
2464   test -z "$ac_dir" && ac_dir=.
2465   $as_executable_p "$ac_dir/$ac_word" || continue
2466 ac_cv_prog_CTAGS="$ac_prog"
2467 echo "$as_me:2467: found $ac_dir/$ac_word" >&5
2468 break
2469 done
2470
2471 fi
2472 fi
2473 CTAGS=$ac_cv_prog_CTAGS
2474 if test -n "$CTAGS"; then
2475   echo "$as_me:2475: result: $CTAGS" >&5
2476 echo "${ECHO_T}$CTAGS" >&6
2477 else
2478   echo "$as_me:2478: result: no" >&5
2479 echo "${ECHO_T}no" >&6
2480 fi
2481
2482   test -n "$CTAGS" && break
2483 done
2484
2485 for ac_prog in exetags etags
2486 do
2487   # Extract the first word of "$ac_prog", so it can be a program name with args.
2488 set dummy $ac_prog; ac_word=$2
2489 echo "$as_me:2489: checking for $ac_word" >&5
2490 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2491 if test "${ac_cv_prog_ETAGS+set}" = set; then
2492   echo $ECHO_N "(cached) $ECHO_C" >&6
2493 else
2494   if test -n "$ETAGS"; then
2495   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2496 else
2497   ac_save_IFS=$IFS; IFS=$ac_path_separator
2498 ac_dummy="$PATH"
2499 for ac_dir in $ac_dummy; do
2500   IFS=$ac_save_IFS
2501   test -z "$ac_dir" && ac_dir=.
2502   $as_executable_p "$ac_dir/$ac_word" || continue
2503 ac_cv_prog_ETAGS="$ac_prog"
2504 echo "$as_me:2504: found $ac_dir/$ac_word" >&5
2505 break
2506 done
2507
2508 fi
2509 fi
2510 ETAGS=$ac_cv_prog_ETAGS
2511 if test -n "$ETAGS"; then
2512   echo "$as_me:2512: result: $ETAGS" >&5
2513 echo "${ECHO_T}$ETAGS" >&6
2514 else
2515   echo "$as_me:2515: result: no" >&5
2516 echo "${ECHO_T}no" >&6
2517 fi
2518
2519   test -n "$ETAGS" && break
2520 done
2521
2522 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2523 set dummy ${CTAGS:-ctags}; ac_word=$2
2524 echo "$as_me:2524: checking for $ac_word" >&5
2525 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2526 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2527   echo $ECHO_N "(cached) $ECHO_C" >&6
2528 else
2529   if test -n "$MAKE_LOWER_TAGS"; then
2530   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2531 else
2532   ac_save_IFS=$IFS; IFS=$ac_path_separator
2533 ac_dummy="$PATH"
2534 for ac_dir in $ac_dummy; do
2535   IFS=$ac_save_IFS
2536   test -z "$ac_dir" && ac_dir=.
2537   $as_executable_p "$ac_dir/$ac_word" || continue
2538 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2539 echo "$as_me:2539: found $ac_dir/$ac_word" >&5
2540 break
2541 done
2542
2543   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2544 fi
2545 fi
2546 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2547 if test -n "$MAKE_LOWER_TAGS"; then
2548   echo "$as_me:2548: result: $MAKE_LOWER_TAGS" >&5
2549 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2550 else
2551   echo "$as_me:2551: result: no" >&5
2552 echo "${ECHO_T}no" >&6
2553 fi
2554
2555 if test "$cf_cv_mixedcase" = yes ; then
2556         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2557 set dummy ${ETAGS:-etags}; ac_word=$2
2558 echo "$as_me:2558: checking for $ac_word" >&5
2559 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2560 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2561   echo $ECHO_N "(cached) $ECHO_C" >&6
2562 else
2563   if test -n "$MAKE_UPPER_TAGS"; then
2564   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2565 else
2566   ac_save_IFS=$IFS; IFS=$ac_path_separator
2567 ac_dummy="$PATH"
2568 for ac_dir in $ac_dummy; do
2569   IFS=$ac_save_IFS
2570   test -z "$ac_dir" && ac_dir=.
2571   $as_executable_p "$ac_dir/$ac_word" || continue
2572 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2573 echo "$as_me:2573: found $ac_dir/$ac_word" >&5
2574 break
2575 done
2576
2577   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2578 fi
2579 fi
2580 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2581 if test -n "$MAKE_UPPER_TAGS"; then
2582   echo "$as_me:2582: result: $MAKE_UPPER_TAGS" >&5
2583 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2584 else
2585   echo "$as_me:2585: result: no" >&5
2586 echo "${ECHO_T}no" >&6
2587 fi
2588
2589 else
2590         MAKE_UPPER_TAGS=no
2591 fi
2592
2593 if test "$MAKE_UPPER_TAGS" = yes ; then
2594         MAKE_UPPER_TAGS=
2595 else
2596         MAKE_UPPER_TAGS="#"
2597 fi
2598
2599 if test "$MAKE_LOWER_TAGS" = yes ; then
2600         MAKE_LOWER_TAGS=
2601 else
2602         MAKE_LOWER_TAGS="#"
2603 fi
2604
2605 echo "$as_me:2605: checking if -lm needed for math functions" >&5
2606 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2607 if test "${cf_cv_need_libm+set}" = set; then
2608   echo $ECHO_N "(cached) $ECHO_C" >&6
2609 else
2610
2611         cat >conftest.$ac_ext <<_ACEOF
2612 #line 2612 "configure"
2613 #include "confdefs.h"
2614
2615         #include <stdio.h>
2616         #include <math.h>
2617
2618 int
2619 main ()
2620 {
2621 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2622   ;
2623   return 0;
2624 }
2625 _ACEOF
2626 rm -f conftest.$ac_objext conftest$ac_exeext
2627 if { (eval echo "$as_me:2627: \"$ac_link\"") >&5
2628   (eval $ac_link) 2>&5
2629   ac_status=$?
2630   echo "$as_me:2630: \$? = $ac_status" >&5
2631   (exit $ac_status); } &&
2632          { ac_try='test -s conftest$ac_exeext'
2633   { (eval echo "$as_me:2633: \"$ac_try\"") >&5
2634   (eval $ac_try) 2>&5
2635   ac_status=$?
2636   echo "$as_me:2636: \$? = $ac_status" >&5
2637   (exit $ac_status); }; }; then
2638   cf_cv_need_libm=no
2639 else
2640   echo "$as_me: failed program was:" >&5
2641 cat conftest.$ac_ext >&5
2642 cf_cv_need_libm=yes
2643 fi
2644 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2645 fi
2646 echo "$as_me:2646: result: $cf_cv_need_libm" >&5
2647 echo "${ECHO_T}$cf_cv_need_libm" >&6
2648 if test "$cf_cv_need_libm" = yes
2649 then
2650 MATH_LIB=-lm
2651 fi
2652
2653 top_builddir=`pwd`
2654
2655 CC_G_OPT="-g"
2656 CC_SHARED_OPTS=unknown
2657 CPPFLAGS="$CPPFLAGS"
2658 DFT_DEP_SUFFIX=""
2659 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2660 DFT_UPR_MODEL="NORMAL"
2661 LD="ld"
2662 LDFLAGS_SHARED=""
2663 LDFLAGS_STATIC=""
2664 LD_MODEL=""
2665 LD_SHARED_OPTS=""
2666 LIBTOOL=""
2667 LIBTOOL_OPTS=""
2668 LIB_CLEAN=""
2669 LIB_COMPILE=""
2670 LIB_LINK='${CC}'
2671 LINK_TESTS=""
2672 LOCAL_LDFLAGS=""
2673 PACKAGE="ncurses-examples"
2674 PTHREAD="-lm"
2675 TEST_ARGS=""
2676 TEST_DEPS=""
2677 TEST_LIBS=""
2678 TINFO_LDFLAGS=''
2679 TINFO_LIBS='$(LIBS_CURSES)'
2680 cf_cv_abi_version=""
2681 cf_cv_rel_version=""
2682 includesubdir=""
2683
2684 cf_cv_screen=curses
2685 cf_cv_libtype=
2686
2687 if test "$GCC" = yes
2688 then
2689 cat > conftest.i <<EOF
2690 #ifndef GCC_PRINTF
2691 #define GCC_PRINTF 0
2692 #endif
2693 #ifndef GCC_SCANF
2694 #define GCC_SCANF 0
2695 #endif
2696 #ifndef GCC_NORETURN
2697 #define GCC_NORETURN /* nothing */
2698 #endif
2699 #ifndef GCC_UNUSED
2700 #define GCC_UNUSED /* nothing */
2701 #endif
2702 EOF
2703 if test "$GCC" = yes
2704 then
2705         { echo "$as_me:2705: checking for $CC __attribute__ directives..." >&5
2706 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2707 cat > conftest.$ac_ext <<EOF
2708 #line 2708 "${as_me:-configure}"
2709 #include "confdefs.h"
2710 #include "conftest.h"
2711 #include "conftest.i"
2712 #if     GCC_PRINTF
2713 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2714 #else
2715 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2716 #endif
2717 #if     GCC_SCANF
2718 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2719 #else
2720 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2721 #endif
2722 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2723 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2724 extern void foo(void) GCC_NORETURN;
2725 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2726 EOF
2727         cf_printf_attribute=no
2728         cf_scanf_attribute=no
2729         for cf_attribute in scanf printf unused noreturn
2730         do
2731
2732 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2733
2734                 cf_directive="__attribute__(($cf_attribute))"
2735                 echo "checking for $CC $cf_directive" 1>&5
2736
2737                 case $cf_attribute in
2738                 (printf)
2739                         cf_printf_attribute=yes
2740                         cat >conftest.h <<EOF
2741 #define GCC_$cf_ATTRIBUTE 1
2742 EOF
2743                         ;;
2744                 (scanf)
2745                         cf_scanf_attribute=yes
2746                         cat >conftest.h <<EOF
2747 #define GCC_$cf_ATTRIBUTE 1
2748 EOF
2749                         ;;
2750                 (*)
2751                         cat >conftest.h <<EOF
2752 #define GCC_$cf_ATTRIBUTE $cf_directive
2753 EOF
2754                         ;;
2755                 esac
2756
2757                 if { (eval echo "$as_me:2757: \"$ac_compile\"") >&5
2758   (eval $ac_compile) 2>&5
2759   ac_status=$?
2760   echo "$as_me:2760: \$? = $ac_status" >&5
2761   (exit $ac_status); }; then
2762                         test -n "$verbose" && echo "$as_me:2762: result: ... $cf_attribute" >&5
2763 echo "${ECHO_T}... $cf_attribute" >&6
2764                         cat conftest.h >>confdefs.h
2765                         case $cf_attribute in
2766                         (noreturn)
2767
2768 cat >>confdefs.h <<EOF
2769 #define GCC_NORETURN $cf_directive
2770 EOF
2771
2772                                 ;;
2773                         (printf)
2774                                 cf_value='/* nothing */'
2775                                 if test "$cf_printf_attribute" != no ; then
2776                                         cf_value='__attribute__((format(printf,fmt,var)))'
2777
2778 cat >>confdefs.h <<\EOF
2779 #define GCC_PRINTF 1
2780 EOF
2781
2782                                 fi
2783
2784 cat >>confdefs.h <<EOF
2785 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2786 EOF
2787
2788                                 ;;
2789                         (scanf)
2790                                 cf_value='/* nothing */'
2791                                 if test "$cf_scanf_attribute" != no ; then
2792                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2793
2794 cat >>confdefs.h <<\EOF
2795 #define GCC_SCANF 1
2796 EOF
2797
2798                                 fi
2799
2800 cat >>confdefs.h <<EOF
2801 #define GCC_SCANFLIKE(fmt,var) $cf_value
2802 EOF
2803
2804                                 ;;
2805                         (unused)
2806
2807 cat >>confdefs.h <<EOF
2808 #define GCC_UNUSED $cf_directive
2809 EOF
2810
2811                                 ;;
2812                         esac
2813                 fi
2814         done
2815 else
2816         fgrep define conftest.i >>confdefs.h
2817 fi
2818 rm -rf conftest*
2819 fi
2820
2821 echo "$as_me:2821: checking if you want to work around bogus compiler/loader warnings" >&5
2822 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
2823
2824 # Check whether --enable-string-hacks or --disable-string-hacks was given.
2825 if test "${enable_string_hacks+set}" = set; then
2826   enableval="$enable_string_hacks"
2827   with_string_hacks=$enableval
2828 else
2829   with_string_hacks=no
2830 fi;
2831 echo "$as_me:2831: result: $with_string_hacks" >&5
2832 echo "${ECHO_T}$with_string_hacks" >&6
2833
2834 if test "x$with_string_hacks" = "xyes"; then
2835
2836 cat >>confdefs.h <<\EOF
2837 #define USE_STRING_HACKS 1
2838 EOF
2839
2840         { echo "$as_me:2840: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
2841 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
2842         echo "$as_me:2842: checking for strlcat" >&5
2843 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
2844 if test "${ac_cv_func_strlcat+set}" = set; then
2845   echo $ECHO_N "(cached) $ECHO_C" >&6
2846 else
2847   cat >conftest.$ac_ext <<_ACEOF
2848 #line 2848 "configure"
2849 #include "confdefs.h"
2850 /* System header to define __stub macros and hopefully few prototypes,
2851     which can conflict with char strlcat (); below.  */
2852 #include <assert.h>
2853 /* Override any gcc2 internal prototype to avoid an error.  */
2854 #ifdef __cplusplus
2855 extern "C"
2856 #endif
2857 /* We use char because int might match the return type of a gcc2
2858    builtin and then its argument prototype would still apply.  */
2859 char strlcat ();
2860 char (*f) ();
2861
2862 int
2863 main ()
2864 {
2865 /* The GNU C library defines this for functions which it implements
2866     to always fail with ENOSYS.  Some functions are actually named
2867     something starting with __ and the normal name is an alias.  */
2868 #if defined (__stub_strlcat) || defined (__stub___strlcat)
2869 choke me
2870 #else
2871 f = strlcat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
2872 #endif
2873
2874   ;
2875   return 0;
2876 }
2877 _ACEOF
2878 rm -f conftest.$ac_objext conftest$ac_exeext
2879 if { (eval echo "$as_me:2879: \"$ac_link\"") >&5
2880   (eval $ac_link) 2>&5
2881   ac_status=$?
2882   echo "$as_me:2882: \$? = $ac_status" >&5
2883   (exit $ac_status); } &&
2884          { ac_try='test -s conftest$ac_exeext'
2885   { (eval echo "$as_me:2885: \"$ac_try\"") >&5
2886   (eval $ac_try) 2>&5
2887   ac_status=$?
2888   echo "$as_me:2888: \$? = $ac_status" >&5
2889   (exit $ac_status); }; }; then
2890   ac_cv_func_strlcat=yes
2891 else
2892   echo "$as_me: failed program was:" >&5
2893 cat conftest.$ac_ext >&5
2894 ac_cv_func_strlcat=no
2895 fi
2896 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2897 fi
2898 echo "$as_me:2898: result: $ac_cv_func_strlcat" >&5
2899 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
2900 if test $ac_cv_func_strlcat = yes; then
2901
2902 cat >>confdefs.h <<\EOF
2903 #define HAVE_STRLCAT 1
2904 EOF
2905
2906 else
2907
2908                 echo "$as_me:2908: checking for strlcat in -lbsd" >&5
2909 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
2910 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
2911   echo $ECHO_N "(cached) $ECHO_C" >&6
2912 else
2913   ac_check_lib_save_LIBS=$LIBS
2914 LIBS="-lbsd  $LIBS"
2915 cat >conftest.$ac_ext <<_ACEOF
2916 #line 2916 "configure"
2917 #include "confdefs.h"
2918
2919 /* Override any gcc2 internal prototype to avoid an error.  */
2920 #ifdef __cplusplus
2921 extern "C"
2922 #endif
2923 /* We use char because int might match the return type of a gcc2
2924    builtin and then its argument prototype would still apply.  */
2925 char strlcat ();
2926 int
2927 main ()
2928 {
2929 strlcat ();
2930   ;
2931   return 0;
2932 }
2933 _ACEOF
2934 rm -f conftest.$ac_objext conftest$ac_exeext
2935 if { (eval echo "$as_me:2935: \"$ac_link\"") >&5
2936   (eval $ac_link) 2>&5
2937   ac_status=$?
2938   echo "$as_me:2938: \$? = $ac_status" >&5
2939   (exit $ac_status); } &&
2940          { ac_try='test -s conftest$ac_exeext'
2941   { (eval echo "$as_me:2941: \"$ac_try\"") >&5
2942   (eval $ac_try) 2>&5
2943   ac_status=$?
2944   echo "$as_me:2944: \$? = $ac_status" >&5
2945   (exit $ac_status); }; }; then
2946   ac_cv_lib_bsd_strlcat=yes
2947 else
2948   echo "$as_me: failed program was:" >&5
2949 cat conftest.$ac_ext >&5
2950 ac_cv_lib_bsd_strlcat=no
2951 fi
2952 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2953 LIBS=$ac_check_lib_save_LIBS
2954 fi
2955 echo "$as_me:2955: result: $ac_cv_lib_bsd_strlcat" >&5
2956 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
2957 if test $ac_cv_lib_bsd_strlcat = yes; then
2958
2959 cf_add_libs="-lbsd"
2960 # Filter out duplicates - this happens with badly-designed ".pc" files...
2961 for cf_add_1lib in $LIBS
2962 do
2963         for cf_add_2lib in $cf_add_libs
2964         do
2965                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
2966                 then
2967                         cf_add_1lib=
2968                         break
2969                 fi
2970         done
2971         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
2972 done
2973 LIBS="$cf_add_libs"
2974
2975 for ac_header in bsd/string.h
2976 do
2977 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
2978 echo "$as_me:2978: checking for $ac_header" >&5
2979 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
2980 if eval "test \"\${$as_ac_Header+set}\" = set"; then
2981   echo $ECHO_N "(cached) $ECHO_C" >&6
2982 else
2983   cat >conftest.$ac_ext <<_ACEOF
2984 #line 2984 "configure"
2985 #include "confdefs.h"
2986 #include <$ac_header>
2987 _ACEOF
2988 if { (eval echo "$as_me:2988: \"$ac_cpp conftest.$ac_ext\"") >&5
2989   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2990   ac_status=$?
2991   egrep -v '^ *\+' conftest.er1 >conftest.err
2992   rm -f conftest.er1
2993   cat conftest.err >&5
2994   echo "$as_me:2994: \$? = $ac_status" >&5
2995   (exit $ac_status); } >/dev/null; then
2996   if test -s conftest.err; then
2997     ac_cpp_err=$ac_c_preproc_warn_flag
2998   else
2999     ac_cpp_err=
3000   fi
3001 else
3002   ac_cpp_err=yes
3003 fi
3004 if test -z "$ac_cpp_err"; then
3005   eval "$as_ac_Header=yes"
3006 else
3007   echo "$as_me: failed program was:" >&5
3008   cat conftest.$ac_ext >&5
3009   eval "$as_ac_Header=no"
3010 fi
3011 rm -f conftest.err conftest.$ac_ext
3012 fi
3013 echo "$as_me:3013: result: `eval echo '${'$as_ac_Header'}'`" >&5
3014 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3015 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3016   cat >>confdefs.h <<EOF
3017 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3018 EOF
3019
3020 fi
3021 done
3022
3023 cat >>confdefs.h <<\EOF
3024 #define HAVE_STRLCAT 1
3025 EOF
3026
3027 fi
3028
3029 fi
3030
3031 for ac_func in strlcpy snprintf
3032 do
3033 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3034 echo "$as_me:3034: checking for $ac_func" >&5
3035 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3036 if eval "test \"\${$as_ac_var+set}\" = set"; then
3037   echo $ECHO_N "(cached) $ECHO_C" >&6
3038 else
3039   cat >conftest.$ac_ext <<_ACEOF
3040 #line 3040 "configure"
3041 #include "confdefs.h"
3042 /* System header to define __stub macros and hopefully few prototypes,
3043     which can conflict with char $ac_func (); below.  */
3044 #include <assert.h>
3045 /* Override any gcc2 internal prototype to avoid an error.  */
3046 #ifdef __cplusplus
3047 extern "C"
3048 #endif
3049 /* We use char because int might match the return type of a gcc2
3050    builtin and then its argument prototype would still apply.  */
3051 char $ac_func ();
3052 char (*f) ();
3053
3054 int
3055 main ()
3056 {
3057 /* The GNU C library defines this for functions which it implements
3058     to always fail with ENOSYS.  Some functions are actually named
3059     something starting with __ and the normal name is an alias.  */
3060 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3061 choke me
3062 #else
3063 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
3064 #endif
3065
3066   ;
3067   return 0;
3068 }
3069 _ACEOF
3070 rm -f conftest.$ac_objext conftest$ac_exeext
3071 if { (eval echo "$as_me:3071: \"$ac_link\"") >&5
3072   (eval $ac_link) 2>&5
3073   ac_status=$?
3074   echo "$as_me:3074: \$? = $ac_status" >&5
3075   (exit $ac_status); } &&
3076          { ac_try='test -s conftest$ac_exeext'
3077   { (eval echo "$as_me:3077: \"$ac_try\"") >&5
3078   (eval $ac_try) 2>&5
3079   ac_status=$?
3080   echo "$as_me:3080: \$? = $ac_status" >&5
3081   (exit $ac_status); }; }; then
3082   eval "$as_ac_var=yes"
3083 else
3084   echo "$as_me: failed program was:" >&5
3085 cat conftest.$ac_ext >&5
3086 eval "$as_ac_var=no"
3087 fi
3088 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3089 fi
3090 echo "$as_me:3090: result: `eval echo '${'$as_ac_var'}'`" >&5
3091 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3092 if test `eval echo '${'$as_ac_var'}'` = yes; then
3093   cat >>confdefs.h <<EOF
3094 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3095 EOF
3096
3097 fi
3098 done
3099
3100 fi
3101
3102 cf_XOPEN_SOURCE=500
3103 cf_POSIX_C_SOURCE=199506L
3104 cf_xopen_source=
3105
3106 case $host_os in
3107 (aix[4-7]*)
3108         cf_xopen_source="-D_ALL_SOURCE"
3109         ;;
3110 (msys)
3111         cf_XOPEN_SOURCE=600
3112         ;;
3113 (darwin[0-8].*)
3114         cf_xopen_source="-D_APPLE_C_SOURCE"
3115         ;;
3116 (darwin*)
3117         cf_xopen_source="-D_DARWIN_C_SOURCE"
3118         cf_XOPEN_SOURCE=
3119         ;;
3120 (freebsd*|dragonfly*)
3121         # 5.x headers associate
3122         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3123         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3124         cf_POSIX_C_SOURCE=200112L
3125         cf_XOPEN_SOURCE=600
3126         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3127         ;;
3128 (hpux11*)
3129         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3130         ;;
3131 (hpux*)
3132         cf_xopen_source="-D_HPUX_SOURCE"
3133         ;;
3134 (irix[56].*)
3135         cf_xopen_source="-D_SGI_SOURCE"
3136         cf_XOPEN_SOURCE=
3137         ;;
3138 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3139
3140 echo "$as_me:3140: checking if we must define _GNU_SOURCE" >&5
3141 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3142 if test "${cf_cv_gnu_source+set}" = set; then
3143   echo $ECHO_N "(cached) $ECHO_C" >&6
3144 else
3145
3146 cat >conftest.$ac_ext <<_ACEOF
3147 #line 3147 "configure"
3148 #include "confdefs.h"
3149 #include <sys/types.h>
3150 int
3151 main ()
3152 {
3153
3154 #ifndef _XOPEN_SOURCE
3155 make an error
3156 #endif
3157   ;
3158   return 0;
3159 }
3160 _ACEOF
3161 rm -f conftest.$ac_objext
3162 if { (eval echo "$as_me:3162: \"$ac_compile\"") >&5
3163   (eval $ac_compile) 2>&5
3164   ac_status=$?
3165   echo "$as_me:3165: \$? = $ac_status" >&5
3166   (exit $ac_status); } &&
3167          { ac_try='test -s conftest.$ac_objext'
3168   { (eval echo "$as_me:3168: \"$ac_try\"") >&5
3169   (eval $ac_try) 2>&5
3170   ac_status=$?
3171   echo "$as_me:3171: \$? = $ac_status" >&5
3172   (exit $ac_status); }; }; then
3173   cf_cv_gnu_source=no
3174 else
3175   echo "$as_me: failed program was:" >&5
3176 cat conftest.$ac_ext >&5
3177 cf_save="$CPPFLAGS"
3178          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3179          cat >conftest.$ac_ext <<_ACEOF
3180 #line 3180 "configure"
3181 #include "confdefs.h"
3182 #include <sys/types.h>
3183 int
3184 main ()
3185 {
3186
3187 #ifdef _XOPEN_SOURCE
3188 make an error
3189 #endif
3190   ;
3191   return 0;
3192 }
3193 _ACEOF
3194 rm -f conftest.$ac_objext
3195 if { (eval echo "$as_me:3195: \"$ac_compile\"") >&5
3196   (eval $ac_compile) 2>&5
3197   ac_status=$?
3198   echo "$as_me:3198: \$? = $ac_status" >&5
3199   (exit $ac_status); } &&
3200          { ac_try='test -s conftest.$ac_objext'
3201   { (eval echo "$as_me:3201: \"$ac_try\"") >&5
3202   (eval $ac_try) 2>&5
3203   ac_status=$?
3204   echo "$as_me:3204: \$? = $ac_status" >&5
3205   (exit $ac_status); }; }; then
3206   cf_cv_gnu_source=no
3207 else
3208   echo "$as_me: failed program was:" >&5
3209 cat conftest.$ac_ext >&5
3210 cf_cv_gnu_source=yes
3211 fi
3212 rm -f conftest.$ac_objext conftest.$ac_ext
3213         CPPFLAGS="$cf_save"
3214
3215 fi
3216 rm -f conftest.$ac_objext conftest.$ac_ext
3217
3218 fi
3219 echo "$as_me:3219: result: $cf_cv_gnu_source" >&5
3220 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3221
3222 if test "$cf_cv_gnu_source" = yes
3223 then
3224 echo "$as_me:3224: checking if we should also define _DEFAULT_SOURCE" >&5
3225 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
3226 if test "${cf_cv_default_source+set}" = set; then
3227   echo $ECHO_N "(cached) $ECHO_C" >&6
3228 else
3229
3230 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3231         cat >conftest.$ac_ext <<_ACEOF
3232 #line 3232 "configure"
3233 #include "confdefs.h"
3234 #include <sys/types.h>
3235 int
3236 main ()
3237 {
3238
3239 #ifdef _DEFAULT_SOURCE
3240 make an error
3241 #endif
3242   ;
3243   return 0;
3244 }
3245 _ACEOF
3246 rm -f conftest.$ac_objext
3247 if { (eval echo "$as_me:3247: \"$ac_compile\"") >&5
3248   (eval $ac_compile) 2>&5
3249   ac_status=$?
3250   echo "$as_me:3250: \$? = $ac_status" >&5
3251   (exit $ac_status); } &&
3252          { ac_try='test -s conftest.$ac_objext'
3253   { (eval echo "$as_me:3253: \"$ac_try\"") >&5
3254   (eval $ac_try) 2>&5
3255   ac_status=$?
3256   echo "$as_me:3256: \$? = $ac_status" >&5
3257   (exit $ac_status); }; }; then
3258   cf_cv_default_source=no
3259 else
3260   echo "$as_me: failed program was:" >&5
3261 cat conftest.$ac_ext >&5
3262 cf_cv_default_source=yes
3263 fi
3264 rm -f conftest.$ac_objext conftest.$ac_ext
3265
3266 fi
3267 echo "$as_me:3267: result: $cf_cv_default_source" >&5
3268 echo "${ECHO_T}$cf_cv_default_source" >&6
3269 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
3270 fi
3271
3272         ;;
3273 (minix*)
3274         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
3275         ;;
3276 (mirbsd*)
3277         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3278         cf_XOPEN_SOURCE=
3279
3280 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3281
3282 cf_save_CFLAGS="$CFLAGS"
3283 cf_save_CPPFLAGS="$CPPFLAGS"
3284
3285 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3286         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3287                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3288
3289 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3290         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3291                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3292
3293 echo "$as_me:3293: checking if we should define _POSIX_C_SOURCE" >&5
3294 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3295 if test "${cf_cv_posix_c_source+set}" = set; then
3296   echo $ECHO_N "(cached) $ECHO_C" >&6
3297 else
3298
3299 echo "${as_me:-configure}:3299: testing if the symbol is already defined go no further ..." 1>&5
3300
3301         cat >conftest.$ac_ext <<_ACEOF
3302 #line 3302 "configure"
3303 #include "confdefs.h"
3304 #include <sys/types.h>
3305 int
3306 main ()
3307 {
3308
3309 #ifndef _POSIX_C_SOURCE
3310 make an error
3311 #endif
3312   ;
3313   return 0;
3314 }
3315 _ACEOF
3316 rm -f conftest.$ac_objext
3317 if { (eval echo "$as_me:3317: \"$ac_compile\"") >&5
3318   (eval $ac_compile) 2>&5
3319   ac_status=$?
3320   echo "$as_me:3320: \$? = $ac_status" >&5
3321   (exit $ac_status); } &&
3322          { ac_try='test -s conftest.$ac_objext'
3323   { (eval echo "$as_me:3323: \"$ac_try\"") >&5
3324   (eval $ac_try) 2>&5
3325   ac_status=$?
3326   echo "$as_me:3326: \$? = $ac_status" >&5
3327   (exit $ac_status); }; }; then
3328   cf_cv_posix_c_source=no
3329 else
3330   echo "$as_me: failed program was:" >&5
3331 cat conftest.$ac_ext >&5
3332 cf_want_posix_source=no
3333          case .$cf_POSIX_C_SOURCE in
3334          (.[12]??*)
3335                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3336                 ;;
3337          (.2)
3338                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3339                 cf_want_posix_source=yes
3340                 ;;
3341          (.*)
3342                 cf_want_posix_source=yes
3343                 ;;
3344          esac
3345          if test "$cf_want_posix_source" = yes ; then
3346                 cat >conftest.$ac_ext <<_ACEOF
3347 #line 3347 "configure"
3348 #include "confdefs.h"
3349 #include <sys/types.h>
3350 int
3351 main ()
3352 {
3353
3354 #ifdef _POSIX_SOURCE
3355 make an error
3356 #endif
3357   ;
3358   return 0;
3359 }
3360 _ACEOF
3361 rm -f conftest.$ac_objext
3362 if { (eval echo "$as_me:3362: \"$ac_compile\"") >&5
3363   (eval $ac_compile) 2>&5
3364   ac_status=$?
3365   echo "$as_me:3365: \$? = $ac_status" >&5
3366   (exit $ac_status); } &&
3367          { ac_try='test -s conftest.$ac_objext'
3368   { (eval echo "$as_me:3368: \"$ac_try\"") >&5
3369   (eval $ac_try) 2>&5
3370   ac_status=$?
3371   echo "$as_me:3371: \$? = $ac_status" >&5
3372   (exit $ac_status); }; }; then
3373   :
3374 else
3375   echo "$as_me: failed program was:" >&5
3376 cat conftest.$ac_ext >&5
3377 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3378 fi
3379 rm -f conftest.$ac_objext conftest.$ac_ext
3380          fi
3381
3382 echo "${as_me:-configure}:3382: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3383
3384          CFLAGS="$cf_trim_CFLAGS"
3385          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3386
3387 echo "${as_me:-configure}:3387: testing if the second compile does not leave our definition intact error ..." 1>&5
3388
3389          cat >conftest.$ac_ext <<_ACEOF
3390 #line 3390 "configure"
3391 #include "confdefs.h"
3392 #include <sys/types.h>
3393 int
3394 main ()
3395 {
3396
3397 #ifndef _POSIX_C_SOURCE
3398 make an error
3399 #endif
3400   ;
3401   return 0;
3402 }
3403 _ACEOF
3404 rm -f conftest.$ac_objext
3405 if { (eval echo "$as_me:3405: \"$ac_compile\"") >&5
3406   (eval $ac_compile) 2>&5
3407   ac_status=$?
3408   echo "$as_me:3408: \$? = $ac_status" >&5
3409   (exit $ac_status); } &&
3410          { ac_try='test -s conftest.$ac_objext'
3411   { (eval echo "$as_me:3411: \"$ac_try\"") >&5
3412   (eval $ac_try) 2>&5
3413   ac_status=$?
3414   echo "$as_me:3414: \$? = $ac_status" >&5
3415   (exit $ac_status); }; }; then
3416   :
3417 else
3418   echo "$as_me: failed program was:" >&5
3419 cat conftest.$ac_ext >&5
3420 cf_cv_posix_c_source=no
3421 fi
3422 rm -f conftest.$ac_objext conftest.$ac_ext
3423          CFLAGS="$cf_save_CFLAGS"
3424          CPPFLAGS="$cf_save_CPPFLAGS"
3425
3426 fi
3427 rm -f conftest.$ac_objext conftest.$ac_ext
3428
3429 fi
3430 echo "$as_me:3430: result: $cf_cv_posix_c_source" >&5
3431 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3432
3433 if test "$cf_cv_posix_c_source" != no ; then
3434         CFLAGS="$cf_trim_CFLAGS"
3435         CPPFLAGS="$cf_trim_CPPFLAGS"
3436
3437 cf_fix_cppflags=no
3438 cf_new_cflags=
3439 cf_new_cppflags=
3440 cf_new_extra_cppflags=
3441
3442 for cf_add_cflags in $cf_cv_posix_c_source
3443 do
3444 case $cf_fix_cppflags in
3445 (no)
3446         case $cf_add_cflags in
3447         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3448                 case $cf_add_cflags in
3449                 (-D*)
3450                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3451
3452                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3453                                 && test -z "${cf_tst_cflags}" \
3454                                 && cf_fix_cppflags=yes
3455
3456                         if test $cf_fix_cppflags = yes ; then
3457                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3458                                 continue
3459                         elif test "${cf_tst_cflags}" = "\"'" ; then
3460                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3461                                 continue
3462                         fi
3463                         ;;
3464                 esac
3465                 case "$CPPFLAGS" in
3466                 (*$cf_add_cflags)
3467                         ;;
3468                 (*)
3469                         case $cf_add_cflags in
3470                         (-D*)
3471                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3472
3473 CPPFLAGS=`echo "$CPPFLAGS" | \
3474         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3475                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3476
3477                                 ;;
3478                         esac
3479                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3480                         ;;
3481                 esac
3482                 ;;
3483         (*)
3484                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3485                 ;;
3486         esac
3487         ;;
3488 (yes)
3489         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3490
3491         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3492
3493         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3494                 && test -z "${cf_tst_cflags}" \
3495                 && cf_fix_cppflags=no
3496         ;;
3497 esac
3498 done
3499
3500 if test -n "$cf_new_cflags" ; then
3501
3502         CFLAGS="$CFLAGS $cf_new_cflags"
3503 fi
3504
3505 if test -n "$cf_new_cppflags" ; then
3506
3507         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3508 fi
3509
3510 if test -n "$cf_new_extra_cppflags" ; then
3511
3512         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3513 fi
3514
3515 fi
3516
3517         ;;
3518 (netbsd*)
3519         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3520         ;;
3521 (openbsd[4-9]*)
3522         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3523         cf_xopen_source="-D_BSD_SOURCE"
3524         cf_XOPEN_SOURCE=600
3525         ;;
3526 (openbsd*)
3527         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3528         ;;
3529 (osf[45]*)
3530         cf_xopen_source="-D_OSF_SOURCE"
3531         ;;
3532 (nto-qnx*)
3533         cf_xopen_source="-D_QNX_SOURCE"
3534         ;;
3535 (sco*)
3536         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3537         ;;
3538 (solaris2.*)
3539         cf_xopen_source="-D__EXTENSIONS__"
3540         cf_cv_xopen_source=broken
3541         ;;
3542 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3543         cf_XOPEN_SOURCE=
3544         cf_POSIX_C_SOURCE=
3545         ;;
3546 (*)
3547
3548 echo "$as_me:3548: checking if we should define _XOPEN_SOURCE" >&5
3549 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3550 if test "${cf_cv_xopen_source+set}" = set; then
3551   echo $ECHO_N "(cached) $ECHO_C" >&6
3552 else
3553
3554         cat >conftest.$ac_ext <<_ACEOF
3555 #line 3555 "configure"
3556 #include "confdefs.h"
3557
3558 #include <stdlib.h>
3559 #include <string.h>
3560 #include <sys/types.h>
3561
3562 int
3563 main ()
3564 {
3565
3566 #ifndef _XOPEN_SOURCE
3567 make an error
3568 #endif
3569   ;
3570   return 0;
3571 }
3572 _ACEOF
3573 rm -f conftest.$ac_objext
3574 if { (eval echo "$as_me:3574: \"$ac_compile\"") >&5
3575   (eval $ac_compile) 2>&5
3576   ac_status=$?
3577   echo "$as_me:3577: \$? = $ac_status" >&5
3578   (exit $ac_status); } &&
3579          { ac_try='test -s conftest.$ac_objext'
3580   { (eval echo "$as_me:3580: \"$ac_try\"") >&5
3581   (eval $ac_try) 2>&5
3582   ac_status=$?
3583   echo "$as_me:3583: \$? = $ac_status" >&5
3584   (exit $ac_status); }; }; then
3585   cf_cv_xopen_source=no
3586 else
3587   echo "$as_me: failed program was:" >&5
3588 cat conftest.$ac_ext >&5
3589 cf_save="$CPPFLAGS"
3590          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3591          cat >conftest.$ac_ext <<_ACEOF
3592 #line 3592 "configure"
3593 #include "confdefs.h"
3594
3595 #include <stdlib.h>
3596 #include <string.h>
3597 #include <sys/types.h>
3598
3599 int
3600 main ()
3601 {
3602
3603 #ifdef _XOPEN_SOURCE
3604 make an error
3605 #endif
3606   ;
3607   return 0;
3608 }
3609 _ACEOF
3610 rm -f conftest.$ac_objext
3611 if { (eval echo "$as_me:3611: \"$ac_compile\"") >&5
3612   (eval $ac_compile) 2>&5
3613   ac_status=$?
3614   echo "$as_me:3614: \$? = $ac_status" >&5
3615   (exit $ac_status); } &&
3616          { ac_try='test -s conftest.$ac_objext'
3617   { (eval echo "$as_me:3617: \"$ac_try\"") >&5
3618   (eval $ac_try) 2>&5
3619   ac_status=$?
3620   echo "$as_me:3620: \$? = $ac_status" >&5
3621   (exit $ac_status); }; }; then
3622   cf_cv_xopen_source=no
3623 else
3624   echo "$as_me: failed program was:" >&5
3625 cat conftest.$ac_ext >&5
3626 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3627 fi
3628 rm -f conftest.$ac_objext conftest.$ac_ext
3629         CPPFLAGS="$cf_save"
3630
3631 fi
3632 rm -f conftest.$ac_objext conftest.$ac_ext
3633
3634 fi
3635 echo "$as_me:3635: result: $cf_cv_xopen_source" >&5
3636 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3637
3638 if test "$cf_cv_xopen_source" != no ; then
3639
3640 CFLAGS=`echo "$CFLAGS" | \
3641         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3642                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3643
3644 CPPFLAGS=`echo "$CPPFLAGS" | \
3645         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3646                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3647
3648         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3649
3650 cf_fix_cppflags=no
3651 cf_new_cflags=
3652 cf_new_cppflags=
3653 cf_new_extra_cppflags=
3654
3655 for cf_add_cflags in $cf_temp_xopen_source
3656 do
3657 case $cf_fix_cppflags in
3658 (no)
3659         case $cf_add_cflags in
3660         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3661                 case $cf_add_cflags in
3662                 (-D*)
3663                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3664
3665                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3666                                 && test -z "${cf_tst_cflags}" \
3667                                 && cf_fix_cppflags=yes
3668
3669                         if test $cf_fix_cppflags = yes ; then
3670                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3671                                 continue
3672                         elif test "${cf_tst_cflags}" = "\"'" ; then
3673                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3674                                 continue
3675                         fi
3676                         ;;
3677                 esac
3678                 case "$CPPFLAGS" in
3679                 (*$cf_add_cflags)
3680                         ;;
3681                 (*)
3682                         case $cf_add_cflags in
3683                         (-D*)
3684                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3685
3686 CPPFLAGS=`echo "$CPPFLAGS" | \
3687         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3688                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3689
3690                                 ;;
3691                         esac
3692                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3693                         ;;
3694                 esac
3695                 ;;
3696         (*)
3697                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3698                 ;;
3699         esac
3700         ;;
3701 (yes)
3702         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3703
3704         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3705
3706         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3707                 && test -z "${cf_tst_cflags}" \
3708                 && cf_fix_cppflags=no
3709         ;;
3710 esac
3711 done
3712
3713 if test -n "$cf_new_cflags" ; then
3714
3715         CFLAGS="$CFLAGS $cf_new_cflags"
3716 fi
3717
3718 if test -n "$cf_new_cppflags" ; then
3719
3720         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3721 fi
3722
3723 if test -n "$cf_new_extra_cppflags" ; then
3724
3725         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3726 fi
3727
3728 fi
3729
3730 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3731
3732 cf_save_CFLAGS="$CFLAGS"
3733 cf_save_CPPFLAGS="$CPPFLAGS"
3734
3735 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3736         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3737                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3738
3739 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3740         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3741                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3742
3743 echo "$as_me:3743: checking if we should define _POSIX_C_SOURCE" >&5
3744 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3745 if test "${cf_cv_posix_c_source+set}" = set; then
3746   echo $ECHO_N "(cached) $ECHO_C" >&6
3747 else
3748
3749 echo "${as_me:-configure}:3749: testing if the symbol is already defined go no further ..." 1>&5
3750
3751         cat >conftest.$ac_ext <<_ACEOF
3752 #line 3752 "configure"
3753 #include "confdefs.h"
3754 #include <sys/types.h>
3755 int
3756 main ()
3757 {
3758
3759 #ifndef _POSIX_C_SOURCE
3760 make an error
3761 #endif
3762   ;
3763   return 0;
3764 }
3765 _ACEOF
3766 rm -f conftest.$ac_objext
3767 if { (eval echo "$as_me:3767: \"$ac_compile\"") >&5
3768   (eval $ac_compile) 2>&5
3769   ac_status=$?
3770   echo "$as_me:3770: \$? = $ac_status" >&5
3771   (exit $ac_status); } &&
3772          { ac_try='test -s conftest.$ac_objext'
3773   { (eval echo "$as_me:3773: \"$ac_try\"") >&5
3774   (eval $ac_try) 2>&5
3775   ac_status=$?
3776   echo "$as_me:3776: \$? = $ac_status" >&5
3777   (exit $ac_status); }; }; then
3778   cf_cv_posix_c_source=no
3779 else
3780   echo "$as_me: failed program was:" >&5
3781 cat conftest.$ac_ext >&5
3782 cf_want_posix_source=no
3783          case .$cf_POSIX_C_SOURCE in
3784          (.[12]??*)
3785                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3786                 ;;
3787          (.2)
3788                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3789                 cf_want_posix_source=yes
3790                 ;;
3791          (.*)
3792                 cf_want_posix_source=yes
3793                 ;;
3794          esac
3795          if test "$cf_want_posix_source" = yes ; then
3796                 cat >conftest.$ac_ext <<_ACEOF
3797 #line 3797 "configure"
3798 #include "confdefs.h"
3799 #include <sys/types.h>
3800 int
3801 main ()
3802 {
3803
3804 #ifdef _POSIX_SOURCE
3805 make an error
3806 #endif
3807   ;
3808   return 0;
3809 }
3810 _ACEOF
3811 rm -f conftest.$ac_objext
3812 if { (eval echo "$as_me:3812: \"$ac_compile\"") >&5
3813   (eval $ac_compile) 2>&5
3814   ac_status=$?
3815   echo "$as_me:3815: \$? = $ac_status" >&5
3816   (exit $ac_status); } &&
3817          { ac_try='test -s conftest.$ac_objext'
3818   { (eval echo "$as_me:3818: \"$ac_try\"") >&5
3819   (eval $ac_try) 2>&5
3820   ac_status=$?
3821   echo "$as_me:3821: \$? = $ac_status" >&5
3822   (exit $ac_status); }; }; then
3823   :
3824 else
3825   echo "$as_me: failed program was:" >&5
3826 cat conftest.$ac_ext >&5
3827 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3828 fi
3829 rm -f conftest.$ac_objext conftest.$ac_ext
3830          fi
3831
3832 echo "${as_me:-configure}:3832: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3833
3834          CFLAGS="$cf_trim_CFLAGS"
3835          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3836
3837 echo "${as_me:-configure}:3837: testing if the second compile does not leave our definition intact error ..." 1>&5
3838
3839          cat >conftest.$ac_ext <<_ACEOF
3840 #line 3840 "configure"
3841 #include "confdefs.h"
3842 #include <sys/types.h>
3843 int
3844 main ()
3845 {
3846
3847 #ifndef _POSIX_C_SOURCE
3848 make an error
3849 #endif
3850   ;
3851   return 0;
3852 }
3853 _ACEOF
3854 rm -f conftest.$ac_objext
3855 if { (eval echo "$as_me:3855: \"$ac_compile\"") >&5
3856   (eval $ac_compile) 2>&5
3857   ac_status=$?
3858   echo "$as_me:3858: \$? = $ac_status" >&5
3859   (exit $ac_status); } &&
3860          { ac_try='test -s conftest.$ac_objext'
3861   { (eval echo "$as_me:3861: \"$ac_try\"") >&5
3862   (eval $ac_try) 2>&5
3863   ac_status=$?
3864   echo "$as_me:3864: \$? = $ac_status" >&5
3865   (exit $ac_status); }; }; then
3866   :
3867 else
3868   echo "$as_me: failed program was:" >&5
3869 cat conftest.$ac_ext >&5
3870 cf_cv_posix_c_source=no
3871 fi
3872 rm -f conftest.$ac_objext conftest.$ac_ext
3873          CFLAGS="$cf_save_CFLAGS"
3874          CPPFLAGS="$cf_save_CPPFLAGS"
3875
3876 fi
3877 rm -f conftest.$ac_objext conftest.$ac_ext
3878
3879 fi
3880 echo "$as_me:3880: result: $cf_cv_posix_c_source" >&5
3881 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3882
3883 if test "$cf_cv_posix_c_source" != no ; then
3884         CFLAGS="$cf_trim_CFLAGS"
3885         CPPFLAGS="$cf_trim_CPPFLAGS"
3886
3887 cf_fix_cppflags=no
3888 cf_new_cflags=
3889 cf_new_cppflags=
3890 cf_new_extra_cppflags=
3891
3892 for cf_add_cflags in $cf_cv_posix_c_source
3893 do
3894 case $cf_fix_cppflags in
3895 (no)
3896         case $cf_add_cflags in
3897         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3898                 case $cf_add_cflags in
3899                 (-D*)
3900                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3901
3902                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3903                                 && test -z "${cf_tst_cflags}" \
3904                                 && cf_fix_cppflags=yes
3905
3906                         if test $cf_fix_cppflags = yes ; then
3907                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3908                                 continue
3909                         elif test "${cf_tst_cflags}" = "\"'" ; then
3910                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3911                                 continue
3912                         fi
3913                         ;;
3914                 esac
3915                 case "$CPPFLAGS" in
3916                 (*$cf_add_cflags)
3917                         ;;
3918                 (*)
3919                         case $cf_add_cflags in
3920                         (-D*)
3921                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3922
3923 CPPFLAGS=`echo "$CPPFLAGS" | \
3924         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3925                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3926
3927                                 ;;
3928                         esac
3929                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3930                         ;;
3931                 esac
3932                 ;;
3933         (*)
3934                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3935                 ;;
3936         esac
3937         ;;
3938 (yes)
3939         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3940
3941         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3942
3943         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3944                 && test -z "${cf_tst_cflags}" \
3945                 && cf_fix_cppflags=no
3946         ;;
3947 esac
3948 done
3949
3950 if test -n "$cf_new_cflags" ; then
3951
3952         CFLAGS="$CFLAGS $cf_new_cflags"
3953 fi
3954
3955 if test -n "$cf_new_cppflags" ; then
3956
3957         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3958 fi
3959
3960 if test -n "$cf_new_extra_cppflags" ; then
3961
3962         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3963 fi
3964
3965 fi
3966
3967         ;;
3968 esac
3969
3970 if test -n "$cf_xopen_source" ; then
3971
3972 cf_fix_cppflags=no
3973 cf_new_cflags=
3974 cf_new_cppflags=
3975 cf_new_extra_cppflags=
3976
3977 for cf_add_cflags in $cf_xopen_source
3978 do
3979 case $cf_fix_cppflags in
3980 (no)
3981         case $cf_add_cflags in
3982         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3983                 case $cf_add_cflags in
3984                 (-D*)
3985                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3986
3987                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3988                                 && test -z "${cf_tst_cflags}" \
3989                                 && cf_fix_cppflags=yes
3990
3991                         if test $cf_fix_cppflags = yes ; then
3992                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3993                                 continue
3994                         elif test "${cf_tst_cflags}" = "\"'" ; then
3995                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3996                                 continue
3997                         fi
3998                         ;;
3999                 esac
4000                 case "$CPPFLAGS" in
4001                 (*$cf_add_cflags)
4002                         ;;
4003                 (*)
4004                         case $cf_add_cflags in
4005                         (-D*)
4006                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4007
4008 CPPFLAGS=`echo "$CPPFLAGS" | \
4009         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4010                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4011
4012                                 ;;
4013                         esac
4014                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4015                         ;;
4016                 esac
4017                 ;;
4018         (*)
4019                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4020                 ;;
4021         esac
4022         ;;
4023 (yes)
4024         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4025
4026         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4027
4028         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4029                 && test -z "${cf_tst_cflags}" \
4030                 && cf_fix_cppflags=no
4031         ;;
4032 esac
4033 done
4034
4035 if test -n "$cf_new_cflags" ; then
4036         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4037
4038 echo "${as_me:-configure}:4038: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4039
4040         CFLAGS="$CFLAGS $cf_new_cflags"
4041 fi
4042
4043 if test -n "$cf_new_cppflags" ; then
4044         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4045
4046 echo "${as_me:-configure}:4046: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4047
4048         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4049 fi
4050
4051 if test -n "$cf_new_extra_cppflags" ; then
4052         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4053
4054 echo "${as_me:-configure}:4054: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4055
4056         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4057 fi
4058
4059 fi
4060
4061 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4062         echo "$as_me:4062: checking if _XOPEN_SOURCE really is set" >&5
4063 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4064         cat >conftest.$ac_ext <<_ACEOF
4065 #line 4065 "configure"
4066 #include "confdefs.h"
4067 #include <stdlib.h>
4068 int
4069 main ()
4070 {
4071
4072 #ifndef _XOPEN_SOURCE
4073 make an error
4074 #endif
4075   ;
4076   return 0;
4077 }
4078 _ACEOF
4079 rm -f conftest.$ac_objext
4080 if { (eval echo "$as_me:4080: \"$ac_compile\"") >&5
4081   (eval $ac_compile) 2>&5
4082   ac_status=$?
4083   echo "$as_me:4083: \$? = $ac_status" >&5
4084   (exit $ac_status); } &&
4085          { ac_try='test -s conftest.$ac_objext'
4086   { (eval echo "$as_me:4086: \"$ac_try\"") >&5
4087   (eval $ac_try) 2>&5
4088   ac_status=$?
4089   echo "$as_me:4089: \$? = $ac_status" >&5
4090   (exit $ac_status); }; }; then
4091   cf_XOPEN_SOURCE_set=yes
4092 else
4093   echo "$as_me: failed program was:" >&5
4094 cat conftest.$ac_ext >&5
4095 cf_XOPEN_SOURCE_set=no
4096 fi
4097 rm -f conftest.$ac_objext conftest.$ac_ext
4098         echo "$as_me:4098: result: $cf_XOPEN_SOURCE_set" >&5
4099 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
4100         if test $cf_XOPEN_SOURCE_set = yes
4101         then
4102                 cat >conftest.$ac_ext <<_ACEOF
4103 #line 4103 "configure"
4104 #include "confdefs.h"
4105 #include <stdlib.h>
4106 int
4107 main ()
4108 {
4109
4110 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
4111 make an error
4112 #endif
4113   ;
4114   return 0;
4115 }
4116 _ACEOF
4117 rm -f conftest.$ac_objext
4118 if { (eval echo "$as_me:4118: \"$ac_compile\"") >&5
4119   (eval $ac_compile) 2>&5
4120   ac_status=$?
4121   echo "$as_me:4121: \$? = $ac_status" >&5
4122   (exit $ac_status); } &&
4123          { ac_try='test -s conftest.$ac_objext'
4124   { (eval echo "$as_me:4124: \"$ac_try\"") >&5
4125   (eval $ac_try) 2>&5
4126   ac_status=$?
4127   echo "$as_me:4127: \$? = $ac_status" >&5
4128   (exit $ac_status); }; }; then
4129   cf_XOPEN_SOURCE_set_ok=yes
4130 else
4131   echo "$as_me: failed program was:" >&5
4132 cat conftest.$ac_ext >&5
4133 cf_XOPEN_SOURCE_set_ok=no
4134 fi
4135 rm -f conftest.$ac_objext conftest.$ac_ext
4136                 if test $cf_XOPEN_SOURCE_set_ok = no
4137                 then
4138                         { echo "$as_me:4138: WARNING: _XOPEN_SOURCE is lower than requested" >&5
4139 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
4140                 fi
4141         else
4142
4143 echo "$as_me:4143: checking if we should define _XOPEN_SOURCE" >&5
4144 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4145 if test "${cf_cv_xopen_source+set}" = set; then
4146   echo $ECHO_N "(cached) $ECHO_C" >&6
4147 else
4148
4149         cat >conftest.$ac_ext <<_ACEOF
4150 #line 4150 "configure"
4151 #include "confdefs.h"
4152
4153 #include <stdlib.h>
4154 #include <string.h>
4155 #include <sys/types.h>
4156
4157 int
4158 main ()
4159 {
4160
4161 #ifndef _XOPEN_SOURCE
4162 make an error
4163 #endif
4164   ;
4165   return 0;
4166 }
4167 _ACEOF
4168 rm -f conftest.$ac_objext
4169 if { (eval echo "$as_me:4169: \"$ac_compile\"") >&5
4170   (eval $ac_compile) 2>&5
4171   ac_status=$?
4172   echo "$as_me:4172: \$? = $ac_status" >&5
4173   (exit $ac_status); } &&
4174          { ac_try='test -s conftest.$ac_objext'
4175   { (eval echo "$as_me:4175: \"$ac_try\"") >&5
4176   (eval $ac_try) 2>&5
4177   ac_status=$?
4178   echo "$as_me:4178: \$? = $ac_status" >&5
4179   (exit $ac_status); }; }; then
4180   cf_cv_xopen_source=no
4181 else
4182   echo "$as_me: failed program was:" >&5
4183 cat conftest.$ac_ext >&5
4184 cf_save="$CPPFLAGS"
4185          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4186          cat >conftest.$ac_ext <<_ACEOF
4187 #line 4187 "configure"
4188 #include "confdefs.h"
4189
4190 #include <stdlib.h>
4191 #include <string.h>
4192 #include <sys/types.h>
4193
4194 int
4195 main ()
4196 {
4197
4198 #ifdef _XOPEN_SOURCE
4199 make an error
4200 #endif
4201   ;
4202   return 0;
4203 }
4204 _ACEOF
4205 rm -f conftest.$ac_objext
4206 if { (eval echo "$as_me:4206: \"$ac_compile\"") >&5
4207   (eval $ac_compile) 2>&5
4208   ac_status=$?
4209   echo "$as_me:4209: \$? = $ac_status" >&5
4210   (exit $ac_status); } &&
4211          { ac_try='test -s conftest.$ac_objext'
4212   { (eval echo "$as_me:4212: \"$ac_try\"") >&5
4213   (eval $ac_try) 2>&5
4214   ac_status=$?
4215   echo "$as_me:4215: \$? = $ac_status" >&5
4216   (exit $ac_status); }; }; then
4217   cf_cv_xopen_source=no
4218 else
4219   echo "$as_me: failed program was:" >&5
4220 cat conftest.$ac_ext >&5
4221 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4222 fi
4223 rm -f conftest.$ac_objext conftest.$ac_ext
4224         CPPFLAGS="$cf_save"
4225
4226 fi
4227 rm -f conftest.$ac_objext conftest.$ac_ext
4228
4229 fi
4230 echo "$as_me:4230: result: $cf_cv_xopen_source" >&5
4231 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4232
4233 if test "$cf_cv_xopen_source" != no ; then
4234
4235 CFLAGS=`echo "$CFLAGS" | \
4236         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4237                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4238
4239 CPPFLAGS=`echo "$CPPFLAGS" | \
4240         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4241                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4242
4243         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4244
4245 cf_fix_cppflags=no
4246 cf_new_cflags=
4247 cf_new_cppflags=
4248 cf_new_extra_cppflags=
4249
4250 for cf_add_cflags in $cf_temp_xopen_source
4251 do
4252 case $cf_fix_cppflags in
4253 (no)
4254         case $cf_add_cflags in
4255         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4256                 case $cf_add_cflags in
4257                 (-D*)
4258                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4259
4260                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4261                                 && test -z "${cf_tst_cflags}" \
4262                                 && cf_fix_cppflags=yes
4263
4264                         if test $cf_fix_cppflags = yes ; then
4265                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4266                                 continue
4267                         elif test "${cf_tst_cflags}" = "\"'" ; then
4268                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4269                                 continue
4270                         fi
4271                         ;;
4272                 esac
4273                 case "$CPPFLAGS" in
4274                 (*$cf_add_cflags)
4275                         ;;
4276                 (*)
4277                         case $cf_add_cflags in
4278                         (-D*)
4279                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4280
4281 CPPFLAGS=`echo "$CPPFLAGS" | \
4282         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4283                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4284
4285                                 ;;
4286                         esac
4287                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4288                         ;;
4289                 esac
4290                 ;;
4291         (*)
4292                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4293                 ;;
4294         esac
4295         ;;
4296 (yes)
4297         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4298
4299         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4300
4301         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4302                 && test -z "${cf_tst_cflags}" \
4303                 && cf_fix_cppflags=no
4304         ;;
4305 esac
4306 done
4307
4308 if test -n "$cf_new_cflags" ; then
4309
4310         CFLAGS="$CFLAGS $cf_new_cflags"
4311 fi
4312
4313 if test -n "$cf_new_cppflags" ; then
4314
4315         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4316 fi
4317
4318 if test -n "$cf_new_extra_cppflags" ; then
4319
4320         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4321 fi
4322
4323 fi
4324
4325         fi
4326 fi
4327
4328 echo "$as_me:4328: checking for signal global datatype" >&5
4329 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4330 if test "${cf_cv_sig_atomic_t+set}" = set; then
4331   echo $ECHO_N "(cached) $ECHO_C" >&6
4332 else
4333
4334         for cf_type in \
4335                 "volatile sig_atomic_t" \
4336                 "sig_atomic_t" \
4337                 "int"
4338         do
4339         cat >conftest.$ac_ext <<_ACEOF
4340 #line 4340 "configure"
4341 #include "confdefs.h"
4342
4343 #include <sys/types.h>
4344 #include <signal.h>
4345 #include <stdio.h>
4346
4347 extern $cf_type x;
4348 $cf_type x;
4349 static void handler(int sig)
4350 {
4351         x = 5;
4352 }
4353 int
4354 main ()
4355 {
4356 signal(SIGINT, handler);
4357                  x = 1
4358   ;
4359   return 0;
4360 }
4361 _ACEOF
4362 rm -f conftest.$ac_objext
4363 if { (eval echo "$as_me:4363: \"$ac_compile\"") >&5
4364   (eval $ac_compile) 2>&5
4365   ac_status=$?
4366   echo "$as_me:4366: \$? = $ac_status" >&5
4367   (exit $ac_status); } &&
4368          { ac_try='test -s conftest.$ac_objext'
4369   { (eval echo "$as_me:4369: \"$ac_try\"") >&5
4370   (eval $ac_try) 2>&5
4371   ac_status=$?
4372   echo "$as_me:4372: \$? = $ac_status" >&5
4373   (exit $ac_status); }; }; then
4374   cf_cv_sig_atomic_t=$cf_type
4375 else
4376   echo "$as_me: failed program was:" >&5
4377 cat conftest.$ac_ext >&5
4378 cf_cv_sig_atomic_t=no
4379 fi
4380 rm -f conftest.$ac_objext conftest.$ac_ext
4381                 test "$cf_cv_sig_atomic_t" != no && break
4382         done
4383
4384 fi
4385
4386 echo "$as_me:4386: result: $cf_cv_sig_atomic_t" >&5
4387 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4388 test "$cf_cv_sig_atomic_t" != no &&
4389 cat >>confdefs.h <<EOF
4390 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4391 EOF
4392
4393 # Work around breakage on OS X
4394
4395 echo "$as_me:4395: checking if SIGWINCH is defined" >&5
4396 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
4397 if test "${cf_cv_define_sigwinch+set}" = set; then
4398   echo $ECHO_N "(cached) $ECHO_C" >&6
4399 else
4400
4401         cat >conftest.$ac_ext <<_ACEOF
4402 #line 4402 "configure"
4403 #include "confdefs.h"
4404
4405 #include <sys/types.h>
4406 #include <sys/signal.h>
4407
4408 int
4409 main ()
4410 {
4411 int x = SIGWINCH
4412   ;
4413   return 0;
4414 }
4415 _ACEOF
4416 rm -f conftest.$ac_objext
4417 if { (eval echo "$as_me:4417: \"$ac_compile\"") >&5
4418   (eval $ac_compile) 2>&5
4419   ac_status=$?
4420   echo "$as_me:4420: \$? = $ac_status" >&5
4421   (exit $ac_status); } &&
4422          { ac_try='test -s conftest.$ac_objext'
4423   { (eval echo "$as_me:4423: \"$ac_try\"") >&5
4424   (eval $ac_try) 2>&5
4425   ac_status=$?
4426   echo "$as_me:4426: \$? = $ac_status" >&5
4427   (exit $ac_status); }; }; then
4428   cf_cv_define_sigwinch=yes
4429 else
4430   echo "$as_me: failed program was:" >&5
4431 cat conftest.$ac_ext >&5
4432 cat >conftest.$ac_ext <<_ACEOF
4433 #line 4433 "configure"
4434 #include "confdefs.h"
4435
4436 #undef _XOPEN_SOURCE
4437 #undef _POSIX_SOURCE
4438 #undef _POSIX_C_SOURCE
4439 #include <sys/types.h>
4440 #include <sys/signal.h>
4441
4442 int
4443 main ()
4444 {
4445 int x = SIGWINCH
4446   ;
4447   return 0;
4448 }
4449 _ACEOF
4450 rm -f conftest.$ac_objext
4451 if { (eval echo "$as_me:4451: \"$ac_compile\"") >&5
4452   (eval $ac_compile) 2>&5
4453   ac_status=$?
4454   echo "$as_me:4454: \$? = $ac_status" >&5
4455   (exit $ac_status); } &&
4456          { ac_try='test -s conftest.$ac_objext'
4457   { (eval echo "$as_me:4457: \"$ac_try\"") >&5
4458   (eval $ac_try) 2>&5
4459   ac_status=$?
4460   echo "$as_me:4460: \$? = $ac_status" >&5
4461   (exit $ac_status); }; }; then
4462   cf_cv_define_sigwinch=maybe
4463 else
4464   echo "$as_me: failed program was:" >&5
4465 cat conftest.$ac_ext >&5
4466 cf_cv_define_sigwinch=no
4467 fi
4468 rm -f conftest.$ac_objext conftest.$ac_ext
4469
4470 fi
4471 rm -f conftest.$ac_objext conftest.$ac_ext
4472
4473 fi
4474 echo "$as_me:4474: result: $cf_cv_define_sigwinch" >&5
4475 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
4476
4477 if test "$cf_cv_define_sigwinch" = maybe ; then
4478 echo "$as_me:4478: checking for actual SIGWINCH definition" >&5
4479 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
4480 if test "${cf_cv_fixup_sigwinch+set}" = set; then
4481   echo $ECHO_N "(cached) $ECHO_C" >&6
4482 else
4483
4484 cf_cv_fixup_sigwinch=unknown
4485 cf_sigwinch=32
4486 while test $cf_sigwinch != 1
4487 do
4488         cat >conftest.$ac_ext <<_ACEOF
4489 #line 4489 "configure"
4490 #include "confdefs.h"
4491
4492 #undef _XOPEN_SOURCE
4493 #undef _POSIX_SOURCE
4494 #undef _POSIX_C_SOURCE
4495 #include <sys/types.h>
4496 #include <sys/signal.h>
4497
4498 int
4499 main ()
4500 {
4501
4502 #if SIGWINCH != $cf_sigwinch
4503 make an error
4504 #endif
4505 int x = SIGWINCH
4506   ;
4507   return 0;
4508 }
4509 _ACEOF
4510 rm -f conftest.$ac_objext
4511 if { (eval echo "$as_me:4511: \"$ac_compile\"") >&5
4512   (eval $ac_compile) 2>&5
4513   ac_status=$?
4514   echo "$as_me:4514: \$? = $ac_status" >&5
4515   (exit $ac_status); } &&
4516          { ac_try='test -s conftest.$ac_objext'
4517   { (eval echo "$as_me:4517: \"$ac_try\"") >&5
4518   (eval $ac_try) 2>&5
4519   ac_status=$?
4520   echo "$as_me:4520: \$? = $ac_status" >&5
4521   (exit $ac_status); }; }; then
4522   cf_cv_fixup_sigwinch=$cf_sigwinch
4523          break
4524 else
4525   echo "$as_me: failed program was:" >&5
4526 cat conftest.$ac_ext >&5
4527 fi
4528 rm -f conftest.$ac_objext conftest.$ac_ext
4529
4530 cf_sigwinch=`expr $cf_sigwinch - 1`
4531 done
4532
4533 fi
4534 echo "$as_me:4534: result: $cf_cv_fixup_sigwinch" >&5
4535 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
4536
4537         if test "$cf_cv_fixup_sigwinch" != unknown ; then
4538                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
4539         fi
4540 fi
4541
4542 # Checks for CODESET support.
4543
4544 echo "$as_me:4544: checking for nl_langinfo and CODESET" >&5
4545 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
4546 if test "${am_cv_langinfo_codeset+set}" = set; then
4547   echo $ECHO_N "(cached) $ECHO_C" >&6
4548 else
4549   cat >conftest.$ac_ext <<_ACEOF
4550 #line 4550 "configure"
4551 #include "confdefs.h"
4552 #include <langinfo.h>
4553 int
4554 main ()
4555 {
4556 char* cs = nl_langinfo(CODESET);
4557   ;
4558   return 0;
4559 }
4560 _ACEOF
4561 rm -f conftest.$ac_objext conftest$ac_exeext
4562 if { (eval echo "$as_me:4562: \"$ac_link\"") >&5
4563   (eval $ac_link) 2>&5
4564   ac_status=$?
4565   echo "$as_me:4565: \$? = $ac_status" >&5
4566   (exit $ac_status); } &&
4567          { ac_try='test -s conftest$ac_exeext'
4568   { (eval echo "$as_me:4568: \"$ac_try\"") >&5
4569   (eval $ac_try) 2>&5
4570   ac_status=$?
4571   echo "$as_me:4571: \$? = $ac_status" >&5
4572   (exit $ac_status); }; }; then
4573   am_cv_langinfo_codeset=yes
4574 else
4575   echo "$as_me: failed program was:" >&5
4576 cat conftest.$ac_ext >&5
4577 am_cv_langinfo_codeset=no
4578 fi
4579 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4580
4581 fi
4582 echo "$as_me:4582: result: $am_cv_langinfo_codeset" >&5
4583 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
4584         if test $am_cv_langinfo_codeset = yes; then
4585
4586 cat >>confdefs.h <<\EOF
4587 #define HAVE_LANGINFO_CODESET 1
4588 EOF
4589
4590         fi
4591
4592 echo "$as_me:4592: checking if you want to use pkg-config" >&5
4593 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4594
4595 # Check whether --with-pkg-config or --without-pkg-config was given.
4596 if test "${with_pkg_config+set}" = set; then
4597   withval="$with_pkg_config"
4598   cf_pkg_config=$withval
4599 else
4600   cf_pkg_config=yes
4601 fi;
4602 echo "$as_me:4602: result: $cf_pkg_config" >&5
4603 echo "${ECHO_T}$cf_pkg_config" >&6
4604
4605 case $cf_pkg_config in
4606 (no)
4607         PKG_CONFIG=none
4608         ;;
4609 (yes)
4610
4611 if test -n "$ac_tool_prefix"; then
4612   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4613 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4614 echo "$as_me:4614: checking for $ac_word" >&5
4615 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4616 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4617   echo $ECHO_N "(cached) $ECHO_C" >&6
4618 else
4619   case $PKG_CONFIG in
4620   [\\/]* | ?:[\\/]*)
4621   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4622   ;;
4623   *)
4624   ac_save_IFS=$IFS; IFS=$ac_path_separator
4625 ac_dummy="$PATH"
4626 for ac_dir in $ac_dummy; do
4627   IFS=$ac_save_IFS
4628   test -z "$ac_dir" && ac_dir=.
4629   if $as_executable_p "$ac_dir/$ac_word"; then
4630    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4631    echo "$as_me:4631: found $ac_dir/$ac_word" >&5
4632    break
4633 fi
4634 done
4635
4636   ;;
4637 esac
4638 fi
4639 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4640
4641 if test -n "$PKG_CONFIG"; then
4642   echo "$as_me:4642: result: $PKG_CONFIG" >&5
4643 echo "${ECHO_T}$PKG_CONFIG" >&6
4644 else
4645   echo "$as_me:4645: result: no" >&5
4646 echo "${ECHO_T}no" >&6
4647 fi
4648
4649 fi
4650 if test -z "$ac_cv_path_PKG_CONFIG"; then
4651   ac_pt_PKG_CONFIG=$PKG_CONFIG
4652   # Extract the first word of "pkg-config", so it can be a program name with args.
4653 set dummy pkg-config; ac_word=$2
4654 echo "$as_me:4654: checking for $ac_word" >&5
4655 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4656 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4657   echo $ECHO_N "(cached) $ECHO_C" >&6
4658 else
4659   case $ac_pt_PKG_CONFIG in
4660   [\\/]* | ?:[\\/]*)
4661   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4662   ;;
4663   *)
4664   ac_save_IFS=$IFS; IFS=$ac_path_separator
4665 ac_dummy="$PATH"
4666 for ac_dir in $ac_dummy; do
4667   IFS=$ac_save_IFS
4668   test -z "$ac_dir" && ac_dir=.
4669   if $as_executable_p "$ac_dir/$ac_word"; then
4670    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4671    echo "$as_me:4671: found $ac_dir/$ac_word" >&5
4672    break
4673 fi
4674 done
4675
4676   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4677   ;;
4678 esac
4679 fi
4680 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4681
4682 if test -n "$ac_pt_PKG_CONFIG"; then
4683   echo "$as_me:4683: result: $ac_pt_PKG_CONFIG" >&5
4684 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4685 else
4686   echo "$as_me:4686: result: no" >&5
4687 echo "${ECHO_T}no" >&6
4688 fi
4689
4690   PKG_CONFIG=$ac_pt_PKG_CONFIG
4691 else
4692   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4693 fi
4694
4695         ;;
4696 (*)
4697         PKG_CONFIG=$withval
4698         ;;
4699 esac
4700
4701 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4702 if test "$PKG_CONFIG" != none ; then
4703
4704 if test "x$prefix" != xNONE; then
4705         cf_path_syntax="$prefix"
4706 else
4707         cf_path_syntax="$ac_default_prefix"
4708 fi
4709
4710 case ".$PKG_CONFIG" in
4711 (.\$\(*\)*|.\'*\'*)
4712         ;;
4713 (..|./*|.\\*)
4714         ;;
4715 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4716         ;;
4717 (.\${*prefix}*|.\${*dir}*)
4718         eval PKG_CONFIG="$PKG_CONFIG"
4719         case ".$PKG_CONFIG" in
4720         (.NONE/*)
4721                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4722                 ;;
4723         esac
4724         ;;
4725 (.no|.NONE/*)
4726         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4727         ;;
4728 (*)
4729         { { echo "$as_me:4729: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4730 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4731    { (exit 1); exit 1; }; }
4732         ;;
4733 esac
4734
4735 elif test "x$cf_pkg_config" != xno ; then
4736         { echo "$as_me:4736: WARNING: pkg-config is not installed" >&5
4737 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4738 fi
4739
4740 echo "$as_me:4740: checking if you want to see long compiling messages" >&5
4741 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4742
4743 # Check whether --enable-echo or --disable-echo was given.
4744 if test "${enable_echo+set}" = set; then
4745   enableval="$enable_echo"
4746   test "$enableval" != no && enableval=yes
4747         if test "$enableval" != "yes" ; then
4748
4749         ECHO_LT='--silent'
4750         ECHO_LD='@echo linking $@;'
4751         RULE_CC='@echo compiling $<'
4752         SHOW_CC='@echo compiling $@'
4753         ECHO_CC='@'
4754
4755         else
4756
4757         ECHO_LT=''
4758         ECHO_LD=''
4759         RULE_CC=''
4760         SHOW_CC=''
4761         ECHO_CC=''
4762
4763         fi
4764 else
4765   enableval=yes
4766
4767         ECHO_LT=''
4768         ECHO_LD=''
4769         RULE_CC=''
4770         SHOW_CC=''
4771         ECHO_CC=''
4772
4773 fi;
4774 echo "$as_me:4774: result: $enableval" >&5
4775 echo "${ECHO_T}$enableval" >&6
4776
4777 echo "$as_me:4777: checking for ncurses wrap-prefix" >&5
4778 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4779
4780 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4781 if test "${with_ncurses_wrap_prefix+set}" = set; then
4782   withval="$with_ncurses_wrap_prefix"
4783   NCURSES_WRAP_PREFIX=$withval
4784 else
4785   NCURSES_WRAP_PREFIX=_nc_
4786 fi;
4787 echo "$as_me:4787: result: $NCURSES_WRAP_PREFIX" >&5
4788 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4789
4790 echo "$as_me:4790: checking if you want to check for wide-character functions" >&5
4791 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4792
4793 # Check whether --enable-widec or --disable-widec was given.
4794 if test "${enable_widec+set}" = set; then
4795   enableval="$enable_widec"
4796   test "$enableval" != no && enableval=yes
4797         if test "$enableval" != "yes" ; then
4798     cf_enable_widec=no
4799         else
4800                 cf_enable_widec=yes
4801         fi
4802 else
4803   enableval=yes
4804         cf_enable_widec=yes
4805
4806 fi;
4807 echo "$as_me:4807: result: $cf_enable_widec" >&5
4808 echo "${ECHO_T}$cf_enable_widec" >&6
4809
4810 echo "$as_me:4810: checking for specific curses-directory" >&5
4811 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4812
4813 # Check whether --with-curses-dir or --without-curses-dir was given.
4814 if test "${with_curses_dir+set}" = set; then
4815   withval="$with_curses_dir"
4816   cf_cv_curses_dir=$withval
4817 else
4818   cf_cv_curses_dir=no
4819 fi;
4820 echo "$as_me:4820: result: $cf_cv_curses_dir" >&5
4821 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4822
4823 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4824 then
4825
4826 if test "x$prefix" != xNONE; then
4827         cf_path_syntax="$prefix"
4828 else
4829         cf_path_syntax="$ac_default_prefix"
4830 fi
4831
4832 case ".$withval" in
4833 (.\$\(*\)*|.\'*\'*)
4834         ;;
4835 (..|./*|.\\*)
4836         ;;
4837 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4838         ;;
4839 (.\${*prefix}*|.\${*dir}*)
4840         eval withval="$withval"
4841         case ".$withval" in
4842         (.NONE/*)
4843                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4844                 ;;
4845         esac
4846         ;;
4847 (.no|.NONE/*)
4848         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4849         ;;
4850 (*)
4851         { { echo "$as_me:4851: error: expected a pathname, not \"$withval\"" >&5
4852 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4853    { (exit 1); exit 1; }; }
4854         ;;
4855 esac
4856
4857         if test -d "$cf_cv_curses_dir"
4858         then
4859
4860 if test -n "$cf_cv_curses_dir/include" ; then
4861   for cf_add_incdir in $cf_cv_curses_dir/include
4862   do
4863         while test $cf_add_incdir != /usr/include
4864         do
4865           if test -d $cf_add_incdir
4866           then
4867                 cf_have_incdir=no
4868                 if test -n "$CFLAGS$CPPFLAGS" ; then
4869                   # a loop is needed to ensure we can add subdirs of existing dirs
4870                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4871                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4872                           cf_have_incdir=yes; break
4873                         fi
4874                   done
4875                 fi
4876
4877                 if test "$cf_have_incdir" = no ; then
4878                   if test "$cf_add_incdir" = /usr/local/include ; then
4879                         if test "$GCC" = yes
4880                         then
4881                           cf_save_CPPFLAGS=$CPPFLAGS
4882                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4883                           cat >conftest.$ac_ext <<_ACEOF
4884 #line 4884 "configure"
4885 #include "confdefs.h"
4886 #include <stdio.h>
4887 int
4888 main ()
4889 {
4890 printf("Hello")
4891   ;
4892   return 0;
4893 }
4894 _ACEOF
4895 rm -f conftest.$ac_objext
4896 if { (eval echo "$as_me:4896: \"$ac_compile\"") >&5
4897   (eval $ac_compile) 2>&5
4898   ac_status=$?
4899   echo "$as_me:4899: \$? = $ac_status" >&5
4900   (exit $ac_status); } &&
4901          { ac_try='test -s conftest.$ac_objext'
4902   { (eval echo "$as_me:4902: \"$ac_try\"") >&5
4903   (eval $ac_try) 2>&5
4904   ac_status=$?
4905   echo "$as_me:4905: \$? = $ac_status" >&5
4906   (exit $ac_status); }; }; then
4907   :
4908 else
4909   echo "$as_me: failed program was:" >&5
4910 cat conftest.$ac_ext >&5
4911 cf_have_incdir=yes
4912 fi
4913 rm -f conftest.$ac_objext conftest.$ac_ext
4914                           CPPFLAGS=$cf_save_CPPFLAGS
4915                         fi
4916                   fi
4917                 fi
4918
4919                 if test "$cf_have_incdir" = no ; then
4920                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4921
4922 echo "${as_me:-configure}:4922: testing adding $cf_add_incdir to include-path ..." 1>&5
4923
4924                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4925
4926                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4927                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4928                   cf_add_incdir="$cf_top_incdir"
4929                 else
4930                   break
4931                 fi
4932           else
4933                 break
4934           fi
4935         done
4936   done
4937 fi
4938
4939 if test -n "$cf_cv_curses_dir/lib" ; then
4940         for cf_add_libdir in $cf_cv_curses_dir/lib
4941         do
4942                 if test $cf_add_libdir = /usr/lib ; then
4943                         :
4944                 elif test -d $cf_add_libdir
4945                 then
4946                         cf_have_libdir=no
4947                         if test -n "$LDFLAGS$LIBS" ; then
4948                                 # a loop is needed to ensure we can add subdirs of existing dirs
4949                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4950                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4951                                                 cf_have_libdir=yes; break
4952                                         fi
4953                                 done
4954                         fi
4955                         if test "$cf_have_libdir" = no ; then
4956                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4957
4958 echo "${as_me:-configure}:4958: testing adding $cf_add_libdir to library-path ..." 1>&5
4959
4960                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4961                         fi
4962                 fi
4963         done
4964 fi
4965
4966         fi
4967 fi
4968
4969 cf_cv_screen=curses
4970
4971 echo "$as_me:4971: checking for specified curses library type" >&5
4972 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4973
4974 # Check whether --with-screen or --without-screen was given.
4975 if test "${with_screen+set}" = set; then
4976   withval="$with_screen"
4977   cf_cv_screen=$withval
4978 else
4979
4980 # Check whether --with-ncursesw or --without-ncursesw was given.
4981 if test "${with_ncursesw+set}" = set; then
4982   withval="$with_ncursesw"
4983   cf_cv_screen=ncursesw
4984 else
4985
4986 # Check whether --with-ncurses or --without-ncurses was given.
4987 if test "${with_ncurses+set}" = set; then
4988   withval="$with_ncurses"
4989   cf_cv_screen=ncurses
4990 else
4991
4992 # Check whether --with-pdcurses or --without-pdcurses was given.
4993 if test "${with_pdcurses+set}" = set; then
4994   withval="$with_pdcurses"
4995   cf_cv_screen=pdcurses
4996 else
4997
4998 # Check whether --with-curses-colr or --without-curses-colr was given.
4999 if test "${with_curses_colr+set}" = set; then
5000   withval="$with_curses_colr"
5001   cf_cv_screen=curses_colr
5002 else
5003
5004 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5005 if test "${with_curses_5lib+set}" = set; then
5006   withval="$with_curses_5lib"
5007   cf_cv_screen=curses_5lib
5008 fi;
5009 fi;
5010 fi;
5011 fi;
5012 fi;
5013 fi;
5014
5015 echo "$as_me:5015: result: $cf_cv_screen" >&5
5016 echo "${ECHO_T}$cf_cv_screen" >&6
5017
5018 case $cf_cv_screen in
5019 (curses|curses_*)
5020
5021 echo "$as_me:5021: checking for extra include directories" >&5
5022 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5023 if test "${cf_cv_curses_incdir+set}" = set; then
5024   echo $ECHO_N "(cached) $ECHO_C" >&6
5025 else
5026
5027 cf_cv_curses_incdir=no
5028 case $host_os in
5029 (hpux10.*)
5030         if test "x$cf_cv_screen" = "xcurses_colr"
5031         then
5032                 test -d /usr/include/curses_colr && \
5033                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5034         fi
5035         ;;
5036 (sunos3*|sunos4*)
5037         if test "x$cf_cv_screen" = "xcurses_5lib"
5038         then
5039                 test -d /usr/5lib && \
5040                 test -d /usr/5include && \
5041                 cf_cv_curses_incdir="-I/usr/5include"
5042         fi
5043         ;;
5044 esac
5045
5046 fi
5047 echo "$as_me:5047: result: $cf_cv_curses_incdir" >&5
5048 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5049 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
5050
5051 echo "$as_me:5051: checking if we have identified curses headers" >&5
5052 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5053 if test "${cf_cv_ncurses_header+set}" = set; then
5054   echo $ECHO_N "(cached) $ECHO_C" >&6
5055 else
5056
5057 cf_cv_ncurses_header=none
5058 for cf_header in \
5059         ncurses.h  \
5060         curses.h  ncurses/ncurses.h ncurses/curses.h
5061 do
5062 cat >conftest.$ac_ext <<_ACEOF
5063 #line 5063 "configure"
5064 #include "confdefs.h"
5065 #include <${cf_header}>
5066 int
5067 main ()
5068 {
5069 initscr(); tgoto("?", 0,0)
5070   ;
5071   return 0;
5072 }
5073 _ACEOF
5074 rm -f conftest.$ac_objext
5075 if { (eval echo "$as_me:5075: \"$ac_compile\"") >&5
5076   (eval $ac_compile) 2>&5
5077   ac_status=$?
5078   echo "$as_me:5078: \$? = $ac_status" >&5
5079   (exit $ac_status); } &&
5080          { ac_try='test -s conftest.$ac_objext'
5081   { (eval echo "$as_me:5081: \"$ac_try\"") >&5
5082   (eval $ac_try) 2>&5
5083   ac_status=$?
5084   echo "$as_me:5084: \$? = $ac_status" >&5
5085   (exit $ac_status); }; }; then
5086   cf_cv_ncurses_header=$cf_header; break
5087 else
5088   echo "$as_me: failed program was:" >&5
5089 cat conftest.$ac_ext >&5
5090 fi
5091 rm -f conftest.$ac_objext conftest.$ac_ext
5092 done
5093
5094 fi
5095 echo "$as_me:5095: result: $cf_cv_ncurses_header" >&5
5096 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5097
5098 if test "$cf_cv_ncurses_header" = none ; then
5099         { { echo "$as_me:5099: error: No curses header-files found" >&5
5100 echo "$as_me: error: No curses header-files found" >&2;}
5101    { (exit 1); exit 1; }; }
5102 fi
5103
5104 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5105
5106 for ac_header in $cf_cv_ncurses_header
5107 do
5108 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5109 echo "$as_me:5109: checking for $ac_header" >&5
5110 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5111 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5112   echo $ECHO_N "(cached) $ECHO_C" >&6
5113 else
5114   cat >conftest.$ac_ext <<_ACEOF
5115 #line 5115 "configure"
5116 #include "confdefs.h"
5117 #include <$ac_header>
5118 _ACEOF
5119 if { (eval echo "$as_me:5119: \"$ac_cpp conftest.$ac_ext\"") >&5
5120   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5121   ac_status=$?
5122   egrep -v '^ *\+' conftest.er1 >conftest.err
5123   rm -f conftest.er1
5124   cat conftest.err >&5
5125   echo "$as_me:5125: \$? = $ac_status" >&5
5126   (exit $ac_status); } >/dev/null; then
5127   if test -s conftest.err; then
5128     ac_cpp_err=$ac_c_preproc_warn_flag
5129   else
5130     ac_cpp_err=
5131   fi
5132 else
5133   ac_cpp_err=yes
5134 fi
5135 if test -z "$ac_cpp_err"; then
5136   eval "$as_ac_Header=yes"
5137 else
5138   echo "$as_me: failed program was:" >&5
5139   cat conftest.$ac_ext >&5
5140   eval "$as_ac_Header=no"
5141 fi
5142 rm -f conftest.err conftest.$ac_ext
5143 fi
5144 echo "$as_me:5144: result: `eval echo '${'$as_ac_Header'}'`" >&5
5145 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5146 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5147   cat >>confdefs.h <<EOF
5148 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5149 EOF
5150
5151 fi
5152 done
5153
5154 echo "$as_me:5154: checking for terminfo header" >&5
5155 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5156 if test "${cf_cv_term_header+set}" = set; then
5157   echo $ECHO_N "(cached) $ECHO_C" >&6
5158 else
5159
5160 case ${cf_cv_ncurses_header} in
5161 (*/ncurses.h|*/ncursesw.h)
5162         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5163         ;;
5164 (*)
5165         cf_term_header=term.h
5166         ;;
5167 esac
5168
5169 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5170 do
5171 cat >conftest.$ac_ext <<_ACEOF
5172 #line 5172 "configure"
5173 #include "confdefs.h"
5174 #include <stdio.h>
5175 #include <${cf_cv_ncurses_header:-curses.h}>
5176 #include <$cf_test>
5177
5178 int
5179 main ()
5180 {
5181 int x = auto_left_margin
5182   ;
5183   return 0;
5184 }
5185 _ACEOF
5186 rm -f conftest.$ac_objext
5187 if { (eval echo "$as_me:5187: \"$ac_compile\"") >&5
5188   (eval $ac_compile) 2>&5
5189   ac_status=$?
5190   echo "$as_me:5190: \$? = $ac_status" >&5
5191   (exit $ac_status); } &&
5192          { ac_try='test -s conftest.$ac_objext'
5193   { (eval echo "$as_me:5193: \"$ac_try\"") >&5
5194   (eval $ac_try) 2>&5
5195   ac_status=$?
5196   echo "$as_me:5196: \$? = $ac_status" >&5
5197   (exit $ac_status); }; }; then
5198
5199         cf_cv_term_header="$cf_test"
5200 else
5201   echo "$as_me: failed program was:" >&5
5202 cat conftest.$ac_ext >&5
5203
5204         cf_cv_term_header=unknown
5205
5206 fi
5207 rm -f conftest.$ac_objext conftest.$ac_ext
5208         test "$cf_cv_term_header" != unknown && break
5209 done
5210
5211 fi
5212 echo "$as_me:5212: result: $cf_cv_term_header" >&5
5213 echo "${ECHO_T}$cf_cv_term_header" >&6
5214
5215 # Set definitions to allow ifdef'ing to accommodate subdirectories
5216
5217 case $cf_cv_term_header in
5218 (*term.h)
5219
5220 cat >>confdefs.h <<\EOF
5221 #define HAVE_TERM_H 1
5222 EOF
5223
5224         ;;
5225 esac
5226
5227 case $cf_cv_term_header in
5228 (ncurses/term.h)
5229
5230 cat >>confdefs.h <<\EOF
5231 #define HAVE_NCURSES_TERM_H 1
5232 EOF
5233
5234         ;;
5235 (ncursesw/term.h)
5236
5237 cat >>confdefs.h <<\EOF
5238 #define HAVE_NCURSESW_TERM_H 1
5239 EOF
5240
5241         ;;
5242 esac
5243
5244 echo "$as_me:5244: checking for ncurses version" >&5
5245 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5246 if test "${cf_cv_ncurses_version+set}" = set; then
5247   echo $ECHO_N "(cached) $ECHO_C" >&6
5248 else
5249
5250         cf_cv_ncurses_version=no
5251         cf_tempfile=out$$
5252         rm -f $cf_tempfile
5253         if test "$cross_compiling" = yes; then
5254
5255         # This will not work if the preprocessor splits the line after the
5256         # Autoconf token.  The 'unproto' program does that.
5257         cat > conftest.$ac_ext <<EOF
5258 #include <${cf_cv_ncurses_header:-curses.h}>
5259 #undef Autoconf
5260 #ifdef NCURSES_VERSION
5261 Autoconf NCURSES_VERSION
5262 #else
5263 #ifdef __NCURSES_H
5264 Autoconf "old"
5265 #endif
5266 ;
5267 #endif
5268 EOF
5269         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5270         { (eval echo "$as_me:5270: \"$cf_try\"") >&5
5271   (eval $cf_try) 2>&5
5272   ac_status=$?
5273   echo "$as_me:5273: \$? = $ac_status" >&5
5274   (exit $ac_status); }
5275         if test -f conftest.out ; then
5276                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5277                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5278                 rm -f conftest.out
5279         fi
5280
5281 else
5282   cat >conftest.$ac_ext <<_ACEOF
5283 #line 5283 "configure"
5284 #include "confdefs.h"
5285
5286 #include <${cf_cv_ncurses_header:-curses.h}>
5287 #include <stdio.h>
5288 int main()
5289 {
5290         FILE *fp = fopen("$cf_tempfile", "w");
5291 #ifdef NCURSES_VERSION
5292 # ifdef NCURSES_VERSION_PATCH
5293         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5294 # else
5295         fprintf(fp, "%s\n", NCURSES_VERSION);
5296 # endif
5297 #else
5298 # ifdef __NCURSES_H
5299         fprintf(fp, "old\n");
5300 # else
5301         make an error
5302 # endif
5303 #endif
5304         ${cf_cv_main_return:-return}(0);
5305 }
5306 _ACEOF
5307 rm -f conftest$ac_exeext
5308 if { (eval echo "$as_me:5308: \"$ac_link\"") >&5
5309   (eval $ac_link) 2>&5
5310   ac_status=$?
5311   echo "$as_me:5311: \$? = $ac_status" >&5
5312   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5313   { (eval echo "$as_me:5313: \"$ac_try\"") >&5
5314   (eval $ac_try) 2>&5
5315   ac_status=$?
5316   echo "$as_me:5316: \$? = $ac_status" >&5
5317   (exit $ac_status); }; }; then
5318
5319         cf_cv_ncurses_version=`cat $cf_tempfile`
5320 else
5321   echo "$as_me: program exited with status $ac_status" >&5
5322 echo "$as_me: failed program was:" >&5
5323 cat conftest.$ac_ext >&5
5324 fi
5325 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5326 fi
5327         rm -f $cf_tempfile
5328
5329 fi
5330 echo "$as_me:5330: result: $cf_cv_ncurses_version" >&5
5331 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5332 test "$cf_cv_ncurses_version" = no ||
5333 cat >>confdefs.h <<\EOF
5334 #define NCURSES 1
5335 EOF
5336
5337 echo "$as_me:5337: checking if we have identified curses libraries" >&5
5338 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5339 cat >conftest.$ac_ext <<_ACEOF
5340 #line 5340 "configure"
5341 #include "confdefs.h"
5342 #include <${cf_cv_ncurses_header:-curses.h}>
5343 int
5344 main ()
5345 {
5346 initscr(); tgoto("?", 0,0)
5347   ;
5348   return 0;
5349 }
5350 _ACEOF
5351 rm -f conftest.$ac_objext conftest$ac_exeext
5352 if { (eval echo "$as_me:5352: \"$ac_link\"") >&5
5353   (eval $ac_link) 2>&5
5354   ac_status=$?
5355   echo "$as_me:5355: \$? = $ac_status" >&5
5356   (exit $ac_status); } &&
5357          { ac_try='test -s conftest$ac_exeext'
5358   { (eval echo "$as_me:5358: \"$ac_try\"") >&5
5359   (eval $ac_try) 2>&5
5360   ac_status=$?
5361   echo "$as_me:5361: \$? = $ac_status" >&5
5362   (exit $ac_status); }; }; then
5363   cf_result=yes
5364 else
5365   echo "$as_me: failed program was:" >&5
5366 cat conftest.$ac_ext >&5
5367 cf_result=no
5368 fi
5369 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5370 echo "$as_me:5370: result: $cf_result" >&5
5371 echo "${ECHO_T}$cf_result" >&6
5372
5373 if test "$cf_result" = no ; then
5374 case $host_os in
5375 (freebsd*)
5376         echo "$as_me:5376: checking for tgoto in -lmytinfo" >&5
5377 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5378 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5379   echo $ECHO_N "(cached) $ECHO_C" >&6
5380 else
5381   ac_check_lib_save_LIBS=$LIBS
5382 LIBS="-lmytinfo  $LIBS"
5383 cat >conftest.$ac_ext <<_ACEOF
5384 #line 5384 "configure"
5385 #include "confdefs.h"
5386
5387 /* Override any gcc2 internal prototype to avoid an error.  */
5388 #ifdef __cplusplus
5389 extern "C"
5390 #endif
5391 /* We use char because int might match the return type of a gcc2
5392    builtin and then its argument prototype would still apply.  */
5393 char tgoto ();
5394 int
5395 main ()
5396 {
5397 tgoto ();
5398   ;
5399   return 0;
5400 }
5401 _ACEOF
5402 rm -f conftest.$ac_objext conftest$ac_exeext
5403 if { (eval echo "$as_me:5403: \"$ac_link\"") >&5
5404   (eval $ac_link) 2>&5
5405   ac_status=$?
5406   echo "$as_me:5406: \$? = $ac_status" >&5
5407   (exit $ac_status); } &&
5408          { ac_try='test -s conftest$ac_exeext'
5409   { (eval echo "$as_me:5409: \"$ac_try\"") >&5
5410   (eval $ac_try) 2>&5
5411   ac_status=$?
5412   echo "$as_me:5412: \$? = $ac_status" >&5
5413   (exit $ac_status); }; }; then
5414   ac_cv_lib_mytinfo_tgoto=yes
5415 else
5416   echo "$as_me: failed program was:" >&5
5417 cat conftest.$ac_ext >&5
5418 ac_cv_lib_mytinfo_tgoto=no
5419 fi
5420 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5421 LIBS=$ac_check_lib_save_LIBS
5422 fi
5423 echo "$as_me:5423: result: $ac_cv_lib_mytinfo_tgoto" >&5
5424 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5425 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5426
5427 cf_add_libs="-lmytinfo"
5428 # Filter out duplicates - this happens with badly-designed ".pc" files...
5429 for cf_add_1lib in $LIBS
5430 do
5431         for cf_add_2lib in $cf_add_libs
5432         do
5433                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5434                 then
5435                         cf_add_1lib=
5436                         break
5437                 fi
5438         done
5439         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5440 done
5441 LIBS="$cf_add_libs"
5442
5443 fi
5444
5445         ;;
5446 (hpux10.*)
5447         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5448         # next (1998), and xcurses "newer" (2000).  There is no header file for
5449         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5450         # term.h) for cur_colr
5451         if test "x$cf_cv_screen" = "xcurses_colr"
5452         then
5453                 echo "$as_me:5453: checking for initscr in -lcur_colr" >&5
5454 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5455 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5456   echo $ECHO_N "(cached) $ECHO_C" >&6
5457 else
5458   ac_check_lib_save_LIBS=$LIBS
5459 LIBS="-lcur_colr  $LIBS"
5460 cat >conftest.$ac_ext <<_ACEOF
5461 #line 5461 "configure"
5462 #include "confdefs.h"
5463
5464 /* Override any gcc2 internal prototype to avoid an error.  */
5465 #ifdef __cplusplus
5466 extern "C"
5467 #endif
5468 /* We use char because int might match the return type of a gcc2
5469    builtin and then its argument prototype would still apply.  */
5470 char initscr ();
5471 int
5472 main ()
5473 {
5474 initscr ();
5475   ;
5476   return 0;
5477 }
5478 _ACEOF
5479 rm -f conftest.$ac_objext conftest$ac_exeext
5480 if { (eval echo "$as_me:5480: \"$ac_link\"") >&5
5481   (eval $ac_link) 2>&5
5482   ac_status=$?
5483   echo "$as_me:5483: \$? = $ac_status" >&5
5484   (exit $ac_status); } &&
5485          { ac_try='test -s conftest$ac_exeext'
5486   { (eval echo "$as_me:5486: \"$ac_try\"") >&5
5487   (eval $ac_try) 2>&5
5488   ac_status=$?
5489   echo "$as_me:5489: \$? = $ac_status" >&5
5490   (exit $ac_status); }; }; then
5491   ac_cv_lib_cur_colr_initscr=yes
5492 else
5493   echo "$as_me: failed program was:" >&5
5494 cat conftest.$ac_ext >&5
5495 ac_cv_lib_cur_colr_initscr=no
5496 fi
5497 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5498 LIBS=$ac_check_lib_save_LIBS
5499 fi
5500 echo "$as_me:5500: result: $ac_cv_lib_cur_colr_initscr" >&5
5501 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5502 if test $ac_cv_lib_cur_colr_initscr = yes; then
5503
5504 cf_add_libs="-lcur_colr"
5505 # Filter out duplicates - this happens with badly-designed ".pc" files...
5506 for cf_add_1lib in $LIBS
5507 do
5508         for cf_add_2lib in $cf_add_libs
5509         do
5510                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5511                 then
5512                         cf_add_1lib=
5513                         break
5514                 fi
5515         done
5516         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5517 done
5518 LIBS="$cf_add_libs"
5519
5520                         ac_cv_func_initscr=yes
5521
5522 else
5523
5524                 echo "$as_me:5524: checking for initscr in -lHcurses" >&5
5525 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5526 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5527   echo $ECHO_N "(cached) $ECHO_C" >&6
5528 else
5529   ac_check_lib_save_LIBS=$LIBS
5530 LIBS="-lHcurses  $LIBS"
5531 cat >conftest.$ac_ext <<_ACEOF
5532 #line 5532 "configure"
5533 #include "confdefs.h"
5534
5535 /* Override any gcc2 internal prototype to avoid an error.  */
5536 #ifdef __cplusplus
5537 extern "C"
5538 #endif
5539 /* We use char because int might match the return type of a gcc2
5540    builtin and then its argument prototype would still apply.  */
5541 char initscr ();
5542 int
5543 main ()
5544 {
5545 initscr ();
5546   ;
5547   return 0;
5548 }
5549 _ACEOF
5550 rm -f conftest.$ac_objext conftest$ac_exeext
5551 if { (eval echo "$as_me:5551: \"$ac_link\"") >&5
5552   (eval $ac_link) 2>&5
5553   ac_status=$?
5554   echo "$as_me:5554: \$? = $ac_status" >&5
5555   (exit $ac_status); } &&
5556          { ac_try='test -s conftest$ac_exeext'
5557   { (eval echo "$as_me:5557: \"$ac_try\"") >&5
5558   (eval $ac_try) 2>&5
5559   ac_status=$?
5560   echo "$as_me:5560: \$? = $ac_status" >&5
5561   (exit $ac_status); }; }; then
5562   ac_cv_lib_Hcurses_initscr=yes
5563 else
5564   echo "$as_me: failed program was:" >&5
5565 cat conftest.$ac_ext >&5
5566 ac_cv_lib_Hcurses_initscr=no
5567 fi
5568 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5569 LIBS=$ac_check_lib_save_LIBS
5570 fi
5571 echo "$as_me:5571: result: $ac_cv_lib_Hcurses_initscr" >&5
5572 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5573 if test $ac_cv_lib_Hcurses_initscr = yes; then
5574
5575                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5576
5577 cf_add_libs="-lHcurses"
5578 # Filter out duplicates - this happens with badly-designed ".pc" files...
5579 for cf_add_1lib in $LIBS
5580 do
5581         for cf_add_2lib in $cf_add_libs
5582         do
5583                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5584                 then
5585                         cf_add_1lib=
5586                         break
5587                 fi
5588         done
5589         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5590 done
5591 LIBS="$cf_add_libs"
5592
5593                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5594                         ac_cv_func_initscr=yes
5595
5596 fi
5597
5598 fi
5599
5600         fi
5601         ;;
5602 (linux*)
5603         case `arch 2>/dev/null` in
5604         (x86_64)
5605                 if test -d /lib64
5606                 then
5607
5608 if test -n "/lib64" ; then
5609         for cf_add_libdir in /lib64
5610         do
5611                 if test $cf_add_libdir = /usr/lib ; then
5612                         :
5613                 elif test -d $cf_add_libdir
5614                 then
5615                         cf_have_libdir=no
5616                         if test -n "$LDFLAGS$LIBS" ; then
5617                                 # a loop is needed to ensure we can add subdirs of existing dirs
5618                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5619                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5620                                                 cf_have_libdir=yes; break
5621                                         fi
5622                                 done
5623                         fi
5624                         if test "$cf_have_libdir" = no ; then
5625                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5626
5627 echo "${as_me:-configure}:5627: testing adding $cf_add_libdir to library-path ..." 1>&5
5628
5629                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5630                         fi
5631                 fi
5632         done
5633 fi
5634
5635                 else
5636
5637 if test -n "/lib" ; then
5638         for cf_add_libdir in /lib
5639         do
5640                 if test $cf_add_libdir = /usr/lib ; then
5641                         :
5642                 elif test -d $cf_add_libdir
5643                 then
5644                         cf_have_libdir=no
5645                         if test -n "$LDFLAGS$LIBS" ; then
5646                                 # a loop is needed to ensure we can add subdirs of existing dirs
5647                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5648                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5649                                                 cf_have_libdir=yes; break
5650                                         fi
5651                                 done
5652                         fi
5653                         if test "$cf_have_libdir" = no ; then
5654                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5655
5656 echo "${as_me:-configure}:5656: testing adding $cf_add_libdir to library-path ..." 1>&5
5657
5658                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5659                         fi
5660                 fi
5661         done
5662 fi
5663
5664                 fi
5665                 ;;
5666         (*)
5667
5668 if test -n "/lib" ; then
5669         for cf_add_libdir in /lib
5670         do
5671                 if test $cf_add_libdir = /usr/lib ; then
5672                         :
5673                 elif test -d $cf_add_libdir
5674                 then
5675                         cf_have_libdir=no
5676                         if test -n "$LDFLAGS$LIBS" ; then
5677                                 # a loop is needed to ensure we can add subdirs of existing dirs
5678                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5679                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5680                                                 cf_have_libdir=yes; break
5681                                         fi
5682                                 done
5683                         fi
5684                         if test "$cf_have_libdir" = no ; then
5685                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5686
5687 echo "${as_me:-configure}:5687: testing adding $cf_add_libdir to library-path ..." 1>&5
5688
5689                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5690                         fi
5691                 fi
5692         done
5693 fi
5694
5695                 ;;
5696         esac
5697         ;;
5698 (sunos3*|sunos4*)
5699         if test "x$cf_cv_screen" = "xcurses_5lib"
5700         then
5701                 if test -d /usr/5lib ; then
5702
5703 if test -n "/usr/5lib" ; then
5704         for cf_add_libdir in /usr/5lib
5705         do
5706                 if test $cf_add_libdir = /usr/lib ; then
5707                         :
5708                 elif test -d $cf_add_libdir
5709                 then
5710                         cf_have_libdir=no
5711                         if test -n "$LDFLAGS$LIBS" ; then
5712                                 # a loop is needed to ensure we can add subdirs of existing dirs
5713                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5714                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5715                                                 cf_have_libdir=yes; break
5716                                         fi
5717                                 done
5718                         fi
5719                         if test "$cf_have_libdir" = no ; then
5720                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5721
5722 echo "${as_me:-configure}:5722: testing adding $cf_add_libdir to library-path ..." 1>&5
5723
5724                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5725                         fi
5726                 fi
5727         done
5728 fi
5729
5730 cf_add_libs="-lcurses -ltermcap"
5731 # Filter out duplicates - this happens with badly-designed ".pc" files...
5732 for cf_add_1lib in $LIBS
5733 do
5734         for cf_add_2lib in $cf_add_libs
5735         do
5736                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5737                 then
5738                         cf_add_1lib=
5739                         break
5740                 fi
5741         done
5742         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5743 done
5744 LIBS="$cf_add_libs"
5745
5746                 fi
5747         fi
5748         ac_cv_func_initscr=yes
5749         ;;
5750 esac
5751
5752 if test ".$ac_cv_func_initscr" != .yes ; then
5753         cf_save_LIBS="$LIBS"
5754
5755         if test ".${cf_cv_ncurses_version:-no}" != .no
5756         then
5757                 cf_check_list="ncurses curses cursesX"
5758         else
5759                 cf_check_list="cursesX curses ncurses"
5760         fi
5761
5762         # Check for library containing tgoto.  Do this before curses library
5763         # because it may be needed to link the test-case for initscr.
5764         if test "x$cf_term_lib" = x
5765         then
5766                 echo "$as_me:5766: checking for tgoto" >&5
5767 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5768 if test "${ac_cv_func_tgoto+set}" = set; then
5769   echo $ECHO_N "(cached) $ECHO_C" >&6
5770 else
5771   cat >conftest.$ac_ext <<_ACEOF
5772 #line 5772 "configure"
5773 #include "confdefs.h"
5774 /* System header to define __stub macros and hopefully few prototypes,
5775     which can conflict with char tgoto (); below.  */
5776 #include <assert.h>
5777 /* Override any gcc2 internal prototype to avoid an error.  */
5778 #ifdef __cplusplus
5779 extern "C"
5780 #endif
5781 /* We use char because int might match the return type of a gcc2
5782    builtin and then its argument prototype would still apply.  */
5783 char tgoto ();
5784 char (*f) ();
5785
5786 int
5787 main ()
5788 {
5789 /* The GNU C library defines this for functions which it implements
5790     to always fail with ENOSYS.  Some functions are actually named
5791     something starting with __ and the normal name is an alias.  */
5792 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5793 choke me
5794 #else
5795 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5796 #endif
5797
5798   ;
5799   return 0;
5800 }
5801 _ACEOF
5802 rm -f conftest.$ac_objext conftest$ac_exeext
5803 if { (eval echo "$as_me:5803: \"$ac_link\"") >&5
5804   (eval $ac_link) 2>&5
5805   ac_status=$?
5806   echo "$as_me:5806: \$? = $ac_status" >&5
5807   (exit $ac_status); } &&
5808          { ac_try='test -s conftest$ac_exeext'
5809   { (eval echo "$as_me:5809: \"$ac_try\"") >&5
5810   (eval $ac_try) 2>&5
5811   ac_status=$?
5812   echo "$as_me:5812: \$? = $ac_status" >&5
5813   (exit $ac_status); }; }; then
5814   ac_cv_func_tgoto=yes
5815 else
5816   echo "$as_me: failed program was:" >&5
5817 cat conftest.$ac_ext >&5
5818 ac_cv_func_tgoto=no
5819 fi
5820 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5821 fi
5822 echo "$as_me:5822: result: $ac_cv_func_tgoto" >&5
5823 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5824 if test $ac_cv_func_tgoto = yes; then
5825   cf_term_lib=predefined
5826 else
5827
5828                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5829                         do
5830                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5831 echo "$as_me:5831: checking for tgoto in -l$cf_term_lib" >&5
5832 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5833 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5834   echo $ECHO_N "(cached) $ECHO_C" >&6
5835 else
5836   ac_check_lib_save_LIBS=$LIBS
5837 LIBS="-l$cf_term_lib  $LIBS"
5838 cat >conftest.$ac_ext <<_ACEOF
5839 #line 5839 "configure"
5840 #include "confdefs.h"
5841
5842 /* Override any gcc2 internal prototype to avoid an error.  */
5843 #ifdef __cplusplus
5844 extern "C"
5845 #endif
5846 /* We use char because int might match the return type of a gcc2
5847    builtin and then its argument prototype would still apply.  */
5848 char tgoto ();
5849 int
5850 main ()
5851 {
5852 tgoto ();
5853   ;
5854   return 0;
5855 }
5856 _ACEOF
5857 rm -f conftest.$ac_objext conftest$ac_exeext
5858 if { (eval echo "$as_me:5858: \"$ac_link\"") >&5
5859   (eval $ac_link) 2>&5
5860   ac_status=$?
5861   echo "$as_me:5861: \$? = $ac_status" >&5
5862   (exit $ac_status); } &&
5863          { ac_try='test -s conftest$ac_exeext'
5864   { (eval echo "$as_me:5864: \"$ac_try\"") >&5
5865   (eval $ac_try) 2>&5
5866   ac_status=$?
5867   echo "$as_me:5867: \$? = $ac_status" >&5
5868   (exit $ac_status); }; }; then
5869   eval "$as_ac_Lib=yes"
5870 else
5871   echo "$as_me: failed program was:" >&5
5872 cat conftest.$ac_ext >&5
5873 eval "$as_ac_Lib=no"
5874 fi
5875 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5876 LIBS=$ac_check_lib_save_LIBS
5877 fi
5878 echo "$as_me:5878: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5879 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5880 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5881   break
5882 fi
5883
5884                         done
5885
5886 fi
5887
5888         fi
5889
5890         # Check for library containing initscr
5891         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5892         if test "x$cf_curs_lib" = x
5893         then
5894                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5895                 do
5896                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5897 echo "$as_me:5897: checking for initscr in -l$cf_curs_lib" >&5
5898 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5899 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5900   echo $ECHO_N "(cached) $ECHO_C" >&6
5901 else
5902   ac_check_lib_save_LIBS=$LIBS
5903 LIBS="-l$cf_curs_lib  $LIBS"
5904 cat >conftest.$ac_ext <<_ACEOF
5905 #line 5905 "configure"
5906 #include "confdefs.h"
5907
5908 /* Override any gcc2 internal prototype to avoid an error.  */
5909 #ifdef __cplusplus
5910 extern "C"
5911 #endif
5912 /* We use char because int might match the return type of a gcc2
5913    builtin and then its argument prototype would still apply.  */
5914 char initscr ();
5915 int
5916 main ()
5917 {
5918 initscr ();
5919   ;
5920   return 0;
5921 }
5922 _ACEOF
5923 rm -f conftest.$ac_objext conftest$ac_exeext
5924 if { (eval echo "$as_me:5924: \"$ac_link\"") >&5
5925   (eval $ac_link) 2>&5
5926   ac_status=$?
5927   echo "$as_me:5927: \$? = $ac_status" >&5
5928   (exit $ac_status); } &&
5929          { ac_try='test -s conftest$ac_exeext'
5930   { (eval echo "$as_me:5930: \"$ac_try\"") >&5
5931   (eval $ac_try) 2>&5
5932   ac_status=$?
5933   echo "$as_me:5933: \$? = $ac_status" >&5
5934   (exit $ac_status); }; }; then
5935   eval "$as_ac_Lib=yes"
5936 else
5937   echo "$as_me: failed program was:" >&5
5938 cat conftest.$ac_ext >&5
5939 eval "$as_ac_Lib=no"
5940 fi
5941 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5942 LIBS=$ac_check_lib_save_LIBS
5943 fi
5944 echo "$as_me:5944: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5945 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5946 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5947   break
5948 fi
5949
5950                 done
5951         fi
5952         test $cf_curs_lib = unknown && { { echo "$as_me:5952: error: no curses library found" >&5
5953 echo "$as_me: error: no curses library found" >&2;}
5954    { (exit 1); exit 1; }; }
5955
5956         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5957         if test "$cf_term_lib" = unknown ; then
5958                 echo "$as_me:5958: checking if we can link with $cf_curs_lib library" >&5
5959 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5960                 cat >conftest.$ac_ext <<_ACEOF
5961 #line 5961 "configure"
5962 #include "confdefs.h"
5963 #include <${cf_cv_ncurses_header:-curses.h}>
5964 int
5965 main ()
5966 {
5967 initscr()
5968   ;
5969   return 0;
5970 }
5971 _ACEOF
5972 rm -f conftest.$ac_objext conftest$ac_exeext
5973 if { (eval echo "$as_me:5973: \"$ac_link\"") >&5
5974   (eval $ac_link) 2>&5
5975   ac_status=$?
5976   echo "$as_me:5976: \$? = $ac_status" >&5
5977   (exit $ac_status); } &&
5978          { ac_try='test -s conftest$ac_exeext'
5979   { (eval echo "$as_me:5979: \"$ac_try\"") >&5
5980   (eval $ac_try) 2>&5
5981   ac_status=$?
5982   echo "$as_me:5982: \$? = $ac_status" >&5
5983   (exit $ac_status); }; }; then
5984   cf_result=yes
5985 else
5986   echo "$as_me: failed program was:" >&5
5987 cat conftest.$ac_ext >&5
5988 cf_result=no
5989 fi
5990 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5991                 echo "$as_me:5991: result: $cf_result" >&5
5992 echo "${ECHO_T}$cf_result" >&6
5993                 test $cf_result = no && { { echo "$as_me:5993: error: Cannot link curses library" >&5
5994 echo "$as_me: error: Cannot link curses library" >&2;}
5995    { (exit 1); exit 1; }; }
5996         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5997                 :
5998         elif test "$cf_term_lib" != predefined ; then
5999                 echo "$as_me:5999: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6000 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6001                 cat >conftest.$ac_ext <<_ACEOF
6002 #line 6002 "configure"
6003 #include "confdefs.h"
6004 #include <${cf_cv_ncurses_header:-curses.h}>
6005 int
6006 main ()
6007 {
6008 initscr(); tgoto((char *)0, 0, 0);
6009   ;
6010   return 0;
6011 }
6012 _ACEOF
6013 rm -f conftest.$ac_objext conftest$ac_exeext
6014 if { (eval echo "$as_me:6014: \"$ac_link\"") >&5
6015   (eval $ac_link) 2>&5
6016   ac_status=$?
6017   echo "$as_me:6017: \$? = $ac_status" >&5
6018   (exit $ac_status); } &&
6019          { ac_try='test -s conftest$ac_exeext'
6020   { (eval echo "$as_me:6020: \"$ac_try\"") >&5
6021   (eval $ac_try) 2>&5
6022   ac_status=$?
6023   echo "$as_me:6023: \$? = $ac_status" >&5
6024   (exit $ac_status); }; }; then
6025   cf_result=no
6026 else
6027   echo "$as_me: failed program was:" >&5
6028 cat conftest.$ac_ext >&5
6029
6030                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6031                         cat >conftest.$ac_ext <<_ACEOF
6032 #line 6032 "configure"
6033 #include "confdefs.h"
6034 #include <${cf_cv_ncurses_header:-curses.h}>
6035 int
6036 main ()
6037 {
6038 initscr()
6039   ;
6040   return 0;
6041 }
6042 _ACEOF
6043 rm -f conftest.$ac_objext conftest$ac_exeext
6044 if { (eval echo "$as_me:6044: \"$ac_link\"") >&5
6045   (eval $ac_link) 2>&5
6046   ac_status=$?
6047   echo "$as_me:6047: \$? = $ac_status" >&5
6048   (exit $ac_status); } &&
6049          { ac_try='test -s conftest$ac_exeext'
6050   { (eval echo "$as_me:6050: \"$ac_try\"") >&5
6051   (eval $ac_try) 2>&5
6052   ac_status=$?
6053   echo "$as_me:6053: \$? = $ac_status" >&5
6054   (exit $ac_status); }; }; then
6055   cf_result=yes
6056 else
6057   echo "$as_me: failed program was:" >&5
6058 cat conftest.$ac_ext >&5
6059 cf_result=error
6060 fi
6061 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6062
6063 fi
6064 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6065                 echo "$as_me:6065: result: $cf_result" >&5
6066 echo "${ECHO_T}$cf_result" >&6
6067         fi
6068 fi
6069 fi
6070
6071         ;;
6072 (ncursesw*)
6073
6074 echo "$as_me:6074: checking for multibyte character support" >&5
6075 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6076 if test "${cf_cv_utf8_lib+set}" = set; then
6077   echo $ECHO_N "(cached) $ECHO_C" >&6
6078 else
6079
6080         cf_save_LIBS="$LIBS"
6081         cat >conftest.$ac_ext <<_ACEOF
6082 #line 6082 "configure"
6083 #include "confdefs.h"
6084
6085 #include <stdlib.h>
6086 int
6087 main ()
6088 {
6089 putwc(0,0);
6090   ;
6091   return 0;
6092 }
6093 _ACEOF
6094 rm -f conftest.$ac_objext conftest$ac_exeext
6095 if { (eval echo "$as_me:6095: \"$ac_link\"") >&5
6096   (eval $ac_link) 2>&5
6097   ac_status=$?
6098   echo "$as_me:6098: \$? = $ac_status" >&5
6099   (exit $ac_status); } &&
6100          { ac_try='test -s conftest$ac_exeext'
6101   { (eval echo "$as_me:6101: \"$ac_try\"") >&5
6102   (eval $ac_try) 2>&5
6103   ac_status=$?
6104   echo "$as_me:6104: \$? = $ac_status" >&5
6105   (exit $ac_status); }; }; then
6106   cf_cv_utf8_lib=yes
6107 else
6108   echo "$as_me: failed program was:" >&5
6109 cat conftest.$ac_ext >&5
6110
6111 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6112 # will be set on completion of the AC_TRY_LINK below.
6113 cf_cv_header_path_utf8=
6114 cf_cv_library_path_utf8=
6115
6116 echo "${as_me:-configure}:6116: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6117
6118 cf_save_LIBS="$LIBS"
6119
6120 cat >conftest.$ac_ext <<_ACEOF
6121 #line 6121 "configure"
6122 #include "confdefs.h"
6123
6124 #include <libutf8.h>
6125 int
6126 main ()
6127 {
6128 putwc(0,0);
6129   ;
6130   return 0;
6131 }
6132 _ACEOF
6133 rm -f conftest.$ac_objext conftest$ac_exeext
6134 if { (eval echo "$as_me:6134: \"$ac_link\"") >&5
6135   (eval $ac_link) 2>&5
6136   ac_status=$?
6137   echo "$as_me:6137: \$? = $ac_status" >&5
6138   (exit $ac_status); } &&
6139          { ac_try='test -s conftest$ac_exeext'
6140   { (eval echo "$as_me:6140: \"$ac_try\"") >&5
6141   (eval $ac_try) 2>&5
6142   ac_status=$?
6143   echo "$as_me:6143: \$? = $ac_status" >&5
6144   (exit $ac_status); }; }; then
6145
6146         cf_cv_find_linkage_utf8=yes
6147         cf_cv_header_path_utf8=/usr/include
6148         cf_cv_library_path_utf8=/usr/lib
6149
6150 else
6151   echo "$as_me: failed program was:" >&5
6152 cat conftest.$ac_ext >&5
6153
6154 LIBS="-lutf8  $cf_save_LIBS"
6155
6156 cat >conftest.$ac_ext <<_ACEOF
6157 #line 6157 "configure"
6158 #include "confdefs.h"
6159
6160 #include <libutf8.h>
6161 int
6162 main ()
6163 {
6164 putwc(0,0);
6165   ;
6166   return 0;
6167 }
6168 _ACEOF
6169 rm -f conftest.$ac_objext conftest$ac_exeext
6170 if { (eval echo "$as_me:6170: \"$ac_link\"") >&5
6171   (eval $ac_link) 2>&5
6172   ac_status=$?
6173   echo "$as_me:6173: \$? = $ac_status" >&5
6174   (exit $ac_status); } &&
6175          { ac_try='test -s conftest$ac_exeext'
6176   { (eval echo "$as_me:6176: \"$ac_try\"") >&5
6177   (eval $ac_try) 2>&5
6178   ac_status=$?
6179   echo "$as_me:6179: \$? = $ac_status" >&5
6180   (exit $ac_status); }; }; then
6181
6182         cf_cv_find_linkage_utf8=yes
6183         cf_cv_header_path_utf8=/usr/include
6184         cf_cv_library_path_utf8=/usr/lib
6185         cf_cv_library_file_utf8="-lutf8"
6186
6187 else
6188   echo "$as_me: failed program was:" >&5
6189 cat conftest.$ac_ext >&5
6190
6191         cf_cv_find_linkage_utf8=no
6192         LIBS="$cf_save_LIBS"
6193
6194         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6195
6196 echo "${as_me:-configure}:6196: testing find linkage for utf8 library ..." 1>&5
6197
6198 echo "${as_me:-configure}:6198: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6199
6200         cf_save_CPPFLAGS="$CPPFLAGS"
6201         cf_test_CPPFLAGS="$CPPFLAGS"
6202
6203 cf_search=
6204
6205 # collect the current set of include-directories from compiler flags
6206 cf_header_path_list=""
6207 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6208         for cf_header_path in $CPPFLAGS $CFLAGS
6209         do
6210                 case $cf_header_path in
6211                 (-I*)
6212                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6213
6214 test "x$cf_header_path" != "xNONE" && \
6215 test -d "$cf_header_path" && \
6216  {
6217         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6218         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6219         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6220         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6221         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6222         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6223 }
6224
6225                         cf_header_path_list="$cf_header_path_list $cf_search"
6226                         ;;
6227                 esac
6228         done
6229 fi
6230
6231 # add the variations for the package we are looking for
6232
6233 cf_search=
6234
6235 test "x$prefix" != "xNONE" && \
6236 test -d "$prefix" && \
6237  {
6238         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6239         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6240         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6241         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6242         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6243         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6244 }
6245
6246 for cf_subdir_prefix in \
6247         /usr \
6248         /usr/local \
6249         /usr/pkg \
6250         /opt \
6251         /opt/local \
6252         $HOME
6253 do
6254
6255 test "x$cf_subdir_prefix" != "x$prefix" && \
6256 test -d "$cf_subdir_prefix" && \
6257 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6258         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6259         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6260         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6261         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6262         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6263         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6264 }
6265
6266 done
6267
6268 test "$includedir" != NONE && \
6269 test "$includedir" != "/usr/include" && \
6270 test -d "$includedir" && {
6271         test -d $includedir &&    cf_search="$cf_search $includedir"
6272         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6273 }
6274
6275 test "$oldincludedir" != NONE && \
6276 test "$oldincludedir" != "/usr/include" && \
6277 test -d "$oldincludedir" && {
6278         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6279         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6280 }
6281
6282 cf_search="$cf_search $cf_header_path_list"
6283
6284         for cf_cv_header_path_utf8 in $cf_search
6285         do
6286                 if test -d $cf_cv_header_path_utf8 ; then
6287                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6288
6289 echo "${as_me:-configure}:6289: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6290
6291                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
6292                         cat >conftest.$ac_ext <<_ACEOF
6293 #line 6293 "configure"
6294 #include "confdefs.h"
6295
6296 #include <libutf8.h>
6297 int
6298 main ()
6299 {
6300 putwc(0,0);
6301   ;
6302   return 0;
6303 }
6304 _ACEOF
6305 rm -f conftest.$ac_objext
6306 if { (eval echo "$as_me:6306: \"$ac_compile\"") >&5
6307   (eval $ac_compile) 2>&5
6308   ac_status=$?
6309   echo "$as_me:6309: \$? = $ac_status" >&5
6310   (exit $ac_status); } &&
6311          { ac_try='test -s conftest.$ac_objext'
6312   { (eval echo "$as_me:6312: \"$ac_try\"") >&5
6313   (eval $ac_try) 2>&5
6314   ac_status=$?
6315   echo "$as_me:6315: \$? = $ac_status" >&5
6316   (exit $ac_status); }; }; then
6317
6318                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6319
6320 echo "${as_me:-configure}:6320: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6321
6322                                 cf_cv_find_linkage_utf8=maybe
6323                                 cf_test_CPPFLAGS="$CPPFLAGS"
6324                                 break
6325 else
6326   echo "$as_me: failed program was:" >&5
6327 cat conftest.$ac_ext >&5
6328
6329                                 CPPFLAGS="$cf_save_CPPFLAGS"
6330
6331 fi
6332 rm -f conftest.$ac_objext conftest.$ac_ext
6333                 fi
6334         done
6335
6336         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6337
6338 echo "${as_me:-configure}:6338: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6339
6340                 cf_save_LIBS="$LIBS"
6341                 cf_save_LDFLAGS="$LDFLAGS"
6342
6343                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6344
6345 cf_search=
6346 cf_library_path_list=""
6347 if test -n "${LDFLAGS}${LIBS}" ; then
6348         for cf_library_path in $LDFLAGS $LIBS
6349         do
6350                 case $cf_library_path in
6351                 (-L*)
6352                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6353
6354 test "x$cf_library_path" != "xNONE" && \
6355 test -d "$cf_library_path" && \
6356  {
6357         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6358         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6359         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6360         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6361         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6362         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6363 }
6364
6365                         cf_library_path_list="$cf_library_path_list $cf_search"
6366                         ;;
6367                 esac
6368         done
6369 fi
6370
6371 cf_search=
6372
6373 test "x$prefix" != "xNONE" && \
6374 test -d "$prefix" && \
6375  {
6376         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6377         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6378         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6379         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6380         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6381         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6382 }
6383
6384 for cf_subdir_prefix in \
6385         /usr \
6386         /usr/local \
6387         /usr/pkg \
6388         /opt \
6389         /opt/local \
6390         $HOME
6391 do
6392
6393 test "x$cf_subdir_prefix" != "x$prefix" && \
6394 test -d "$cf_subdir_prefix" && \
6395 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6396         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6397         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6398         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6399         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6400         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6401         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6402 }
6403
6404 done
6405
6406 cf_search="$cf_library_path_list $cf_search"
6407
6408                         for cf_cv_library_path_utf8 in $cf_search
6409                         do
6410                                 if test -d $cf_cv_library_path_utf8 ; then
6411                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6412
6413 echo "${as_me:-configure}:6413: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6414
6415                                         CPPFLAGS="$cf_test_CPPFLAGS"
6416                                         LIBS="-lutf8  $cf_save_LIBS"
6417                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6418                                         cat >conftest.$ac_ext <<_ACEOF
6419 #line 6419 "configure"
6420 #include "confdefs.h"
6421
6422 #include <libutf8.h>
6423 int
6424 main ()
6425 {
6426 putwc(0,0);
6427   ;
6428   return 0;
6429 }
6430 _ACEOF
6431 rm -f conftest.$ac_objext conftest$ac_exeext
6432 if { (eval echo "$as_me:6432: \"$ac_link\"") >&5
6433   (eval $ac_link) 2>&5
6434   ac_status=$?
6435   echo "$as_me:6435: \$? = $ac_status" >&5
6436   (exit $ac_status); } &&
6437          { ac_try='test -s conftest$ac_exeext'
6438   { (eval echo "$as_me:6438: \"$ac_try\"") >&5
6439   (eval $ac_try) 2>&5
6440   ac_status=$?
6441   echo "$as_me:6441: \$? = $ac_status" >&5
6442   (exit $ac_status); }; }; then
6443
6444                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6445
6446 echo "${as_me:-configure}:6446: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6447
6448                                         cf_cv_find_linkage_utf8=yes
6449                                         cf_cv_library_file_utf8="-lutf8"
6450                                         break
6451 else
6452   echo "$as_me: failed program was:" >&5
6453 cat conftest.$ac_ext >&5
6454
6455                                         CPPFLAGS="$cf_save_CPPFLAGS"
6456                                         LIBS="$cf_save_LIBS"
6457                                         LDFLAGS="$cf_save_LDFLAGS"
6458
6459 fi
6460 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6461                                 fi
6462                         done
6463                         CPPFLAGS="$cf_save_CPPFLAGS"
6464                         LDFLAGS="$cf_save_LDFLAGS"
6465                 fi
6466
6467         else
6468                 cf_cv_find_linkage_utf8=no
6469         fi
6470
6471 fi
6472 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6473
6474 fi
6475 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6476
6477 LIBS="$cf_save_LIBS"
6478
6479 if test "$cf_cv_find_linkage_utf8" = yes ; then
6480 cf_cv_utf8_lib=add-on
6481 else
6482 cf_cv_utf8_lib=no
6483 fi
6484
6485 fi
6486 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6487 fi
6488 echo "$as_me:6488: result: $cf_cv_utf8_lib" >&5
6489 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6490
6491 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6492 # ncurses/ncursesw:
6493 if test "$cf_cv_utf8_lib" = "add-on" ; then
6494
6495 cat >>confdefs.h <<\EOF
6496 #define HAVE_LIBUTF8_H 1
6497 EOF
6498
6499 if test -n "$cf_cv_header_path_utf8" ; then
6500   for cf_add_incdir in $cf_cv_header_path_utf8
6501   do
6502         while test $cf_add_incdir != /usr/include
6503         do
6504           if test -d $cf_add_incdir
6505           then
6506                 cf_have_incdir=no
6507                 if test -n "$CFLAGS$CPPFLAGS" ; then
6508                   # a loop is needed to ensure we can add subdirs of existing dirs
6509                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6510                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6511                           cf_have_incdir=yes; break
6512                         fi
6513                   done
6514                 fi
6515
6516                 if test "$cf_have_incdir" = no ; then
6517                   if test "$cf_add_incdir" = /usr/local/include ; then
6518                         if test "$GCC" = yes
6519                         then
6520                           cf_save_CPPFLAGS=$CPPFLAGS
6521                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6522                           cat >conftest.$ac_ext <<_ACEOF
6523 #line 6523 "configure"
6524 #include "confdefs.h"
6525 #include <stdio.h>
6526 int
6527 main ()
6528 {
6529 printf("Hello")
6530   ;
6531   return 0;
6532 }
6533 _ACEOF
6534 rm -f conftest.$ac_objext
6535 if { (eval echo "$as_me:6535: \"$ac_compile\"") >&5
6536   (eval $ac_compile) 2>&5
6537   ac_status=$?
6538   echo "$as_me:6538: \$? = $ac_status" >&5
6539   (exit $ac_status); } &&
6540          { ac_try='test -s conftest.$ac_objext'
6541   { (eval echo "$as_me:6541: \"$ac_try\"") >&5
6542   (eval $ac_try) 2>&5
6543   ac_status=$?
6544   echo "$as_me:6544: \$? = $ac_status" >&5
6545   (exit $ac_status); }; }; then
6546   :
6547 else
6548   echo "$as_me: failed program was:" >&5
6549 cat conftest.$ac_ext >&5
6550 cf_have_incdir=yes
6551 fi
6552 rm -f conftest.$ac_objext conftest.$ac_ext
6553                           CPPFLAGS=$cf_save_CPPFLAGS
6554                         fi
6555                   fi
6556                 fi
6557
6558                 if test "$cf_have_incdir" = no ; then
6559                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6560
6561 echo "${as_me:-configure}:6561: testing adding $cf_add_incdir to include-path ..." 1>&5
6562
6563                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6564
6565                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6566                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6567                   cf_add_incdir="$cf_top_incdir"
6568                 else
6569                   break
6570                 fi
6571           else
6572                 break
6573           fi
6574         done
6575   done
6576 fi
6577
6578 if test -n "$cf_cv_library_path_utf8" ; then
6579         for cf_add_libdir in $cf_cv_library_path_utf8
6580         do
6581                 if test $cf_add_libdir = /usr/lib ; then
6582                         :
6583                 elif test -d $cf_add_libdir
6584                 then
6585                         cf_have_libdir=no
6586                         if test -n "$LDFLAGS$LIBS" ; then
6587                                 # a loop is needed to ensure we can add subdirs of existing dirs
6588                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6589                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6590                                                 cf_have_libdir=yes; break
6591                                         fi
6592                                 done
6593                         fi
6594                         if test "$cf_have_libdir" = no ; then
6595                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6596
6597 echo "${as_me:-configure}:6597: testing adding $cf_add_libdir to library-path ..." 1>&5
6598
6599                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6600                         fi
6601                 fi
6602         done
6603 fi
6604
6605 cf_add_libs="$cf_cv_library_file_utf8"
6606 # Filter out duplicates - this happens with badly-designed ".pc" files...
6607 for cf_add_1lib in $LIBS
6608 do
6609         for cf_add_2lib in $cf_add_libs
6610         do
6611                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6612                 then
6613                         cf_add_1lib=
6614                         break
6615                 fi
6616         done
6617         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6618 done
6619 LIBS="$cf_add_libs"
6620
6621 fi
6622
6623 cf_ncuconfig_root=$cf_cv_screen
6624 cf_have_ncuconfig=no
6625
6626 if test "x${PKG_CONFIG:=none}" != xnone; then
6627         echo "$as_me:6627: checking pkg-config for $cf_ncuconfig_root" >&5
6628 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6629         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6630                 echo "$as_me:6630: result: yes" >&5
6631 echo "${ECHO_T}yes" >&6
6632
6633                 echo "$as_me:6633: checking if the $cf_ncuconfig_root package files work" >&5
6634 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6635                 cf_have_ncuconfig=unknown
6636
6637                 cf_save_CPPFLAGS="$CPPFLAGS"
6638                 cf_save_LIBS="$LIBS"
6639
6640                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6641
6642 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6643 # Filter out duplicates - this happens with badly-designed ".pc" files...
6644 for cf_add_1lib in $LIBS
6645 do
6646         for cf_add_2lib in $cf_add_libs
6647         do
6648                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6649                 then
6650                         cf_add_1lib=
6651                         break
6652                 fi
6653         done
6654         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6655 done
6656 LIBS="$cf_add_libs"
6657
6658                 cat >conftest.$ac_ext <<_ACEOF
6659 #line 6659 "configure"
6660 #include "confdefs.h"
6661 #include <${cf_cv_ncurses_header:-curses.h}>
6662 int
6663 main ()
6664 {
6665 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6666   ;
6667   return 0;
6668 }
6669 _ACEOF
6670 rm -f conftest.$ac_objext conftest$ac_exeext
6671 if { (eval echo "$as_me:6671: \"$ac_link\"") >&5
6672   (eval $ac_link) 2>&5
6673   ac_status=$?
6674   echo "$as_me:6674: \$? = $ac_status" >&5
6675   (exit $ac_status); } &&
6676          { ac_try='test -s conftest$ac_exeext'
6677   { (eval echo "$as_me:6677: \"$ac_try\"") >&5
6678   (eval $ac_try) 2>&5
6679   ac_status=$?
6680   echo "$as_me:6680: \$? = $ac_status" >&5
6681   (exit $ac_status); }; }; then
6682   if test "$cross_compiling" = yes; then
6683   cf_have_ncuconfig=maybe
6684 else
6685   cat >conftest.$ac_ext <<_ACEOF
6686 #line 6686 "configure"
6687 #include "confdefs.h"
6688 #include <${cf_cv_ncurses_header:-curses.h}>
6689                                 int main(void)
6690                                 { char *xx = curses_version(); return (xx == 0); }
6691 _ACEOF
6692 rm -f conftest$ac_exeext
6693 if { (eval echo "$as_me:6693: \"$ac_link\"") >&5
6694   (eval $ac_link) 2>&5
6695   ac_status=$?
6696   echo "$as_me:6696: \$? = $ac_status" >&5
6697   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6698   { (eval echo "$as_me:6698: \"$ac_try\"") >&5
6699   (eval $ac_try) 2>&5
6700   ac_status=$?
6701   echo "$as_me:6701: \$? = $ac_status" >&5
6702   (exit $ac_status); }; }; then
6703   cf_have_ncuconfig=yes
6704 else
6705   echo "$as_me: program exited with status $ac_status" >&5
6706 echo "$as_me: failed program was:" >&5
6707 cat conftest.$ac_ext >&5
6708 cf_have_ncuconfig=no
6709 fi
6710 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6711 fi
6712 else
6713   echo "$as_me: failed program was:" >&5
6714 cat conftest.$ac_ext >&5
6715 cf_have_ncuconfig=no
6716 fi
6717 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6718                 echo "$as_me:6718: result: $cf_have_ncuconfig" >&5
6719 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6720                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6721                 if test "$cf_have_ncuconfig" != "yes"
6722                 then
6723                         CPPFLAGS="$cf_save_CPPFLAGS"
6724                         LIBS="$cf_save_LIBS"
6725                         NCURSES_CONFIG_PKG=none
6726                 else
6727
6728 cat >>confdefs.h <<\EOF
6729 #define NCURSES 1
6730 EOF
6731
6732                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6733                 fi
6734
6735         else
6736                 echo "$as_me:6736: result: no" >&5
6737 echo "${ECHO_T}no" >&6
6738                 NCURSES_CONFIG_PKG=none
6739         fi
6740 else
6741         NCURSES_CONFIG_PKG=none
6742 fi
6743
6744 if test "x$cf_have_ncuconfig" = "xno"; then
6745         echo "Looking for ${cf_ncuconfig_root}-config"
6746
6747 if test -n "$ac_tool_prefix"; then
6748   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6749   do
6750     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6751 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6752 echo "$as_me:6752: checking for $ac_word" >&5
6753 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6754 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6755   echo $ECHO_N "(cached) $ECHO_C" >&6
6756 else
6757   if test -n "$NCURSES_CONFIG"; then
6758   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6759 else
6760   ac_save_IFS=$IFS; IFS=$ac_path_separator
6761 ac_dummy="$PATH"
6762 for ac_dir in $ac_dummy; do
6763   IFS=$ac_save_IFS
6764   test -z "$ac_dir" && ac_dir=.
6765   $as_executable_p "$ac_dir/$ac_word" || continue
6766 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6767 echo "$as_me:6767: found $ac_dir/$ac_word" >&5
6768 break
6769 done
6770
6771 fi
6772 fi
6773 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6774 if test -n "$NCURSES_CONFIG"; then
6775   echo "$as_me:6775: result: $NCURSES_CONFIG" >&5
6776 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6777 else
6778   echo "$as_me:6778: result: no" >&5
6779 echo "${ECHO_T}no" >&6
6780 fi
6781
6782     test -n "$NCURSES_CONFIG" && break
6783   done
6784 fi
6785 if test -z "$NCURSES_CONFIG"; then
6786   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6787   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6788 do
6789   # Extract the first word of "$ac_prog", so it can be a program name with args.
6790 set dummy $ac_prog; ac_word=$2
6791 echo "$as_me:6791: checking for $ac_word" >&5
6792 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6793 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6794   echo $ECHO_N "(cached) $ECHO_C" >&6
6795 else
6796   if test -n "$ac_ct_NCURSES_CONFIG"; then
6797   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6798 else
6799   ac_save_IFS=$IFS; IFS=$ac_path_separator
6800 ac_dummy="$PATH"
6801 for ac_dir in $ac_dummy; do
6802   IFS=$ac_save_IFS
6803   test -z "$ac_dir" && ac_dir=.
6804   $as_executable_p "$ac_dir/$ac_word" || continue
6805 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6806 echo "$as_me:6806: found $ac_dir/$ac_word" >&5
6807 break
6808 done
6809
6810 fi
6811 fi
6812 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6813 if test -n "$ac_ct_NCURSES_CONFIG"; then
6814   echo "$as_me:6814: result: $ac_ct_NCURSES_CONFIG" >&5
6815 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6816 else
6817   echo "$as_me:6817: result: no" >&5
6818 echo "${ECHO_T}no" >&6
6819 fi
6820
6821   test -n "$ac_ct_NCURSES_CONFIG" && break
6822 done
6823 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6824
6825   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6826 fi
6827
6828         if test "$NCURSES_CONFIG" != none ; then
6829
6830                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6831
6832 cf_add_libs="`$NCURSES_CONFIG --libs`"
6833 # Filter out duplicates - this happens with badly-designed ".pc" files...
6834 for cf_add_1lib in $LIBS
6835 do
6836         for cf_add_2lib in $cf_add_libs
6837         do
6838                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6839                 then
6840                         cf_add_1lib=
6841                         break
6842                 fi
6843         done
6844         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6845 done
6846 LIBS="$cf_add_libs"
6847
6848                 # even with config script, some packages use no-override for curses.h
6849
6850 echo "$as_me:6850: checking if we have identified curses headers" >&5
6851 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6852 if test "${cf_cv_ncurses_header+set}" = set; then
6853   echo $ECHO_N "(cached) $ECHO_C" >&6
6854 else
6855
6856 cf_cv_ncurses_header=none
6857 for cf_header in \
6858         ncurses.h $cf_cv_screen/ncurses.h \
6859         curses.h $cf_cv_screen/curses.h
6860 do
6861 cat >conftest.$ac_ext <<_ACEOF
6862 #line 6862 "configure"
6863 #include "confdefs.h"
6864 #include <${cf_header}>
6865 int
6866 main ()
6867 {
6868 initscr(); tgoto("?", 0,0)
6869   ;
6870   return 0;
6871 }
6872 _ACEOF
6873 rm -f conftest.$ac_objext
6874 if { (eval echo "$as_me:6874: \"$ac_compile\"") >&5
6875   (eval $ac_compile) 2>&5
6876   ac_status=$?
6877   echo "$as_me:6877: \$? = $ac_status" >&5
6878   (exit $ac_status); } &&
6879          { ac_try='test -s conftest.$ac_objext'
6880   { (eval echo "$as_me:6880: \"$ac_try\"") >&5
6881   (eval $ac_try) 2>&5
6882   ac_status=$?
6883   echo "$as_me:6883: \$? = $ac_status" >&5
6884   (exit $ac_status); }; }; then
6885   cf_cv_ncurses_header=$cf_header; break
6886 else
6887   echo "$as_me: failed program was:" >&5
6888 cat conftest.$ac_ext >&5
6889 fi
6890 rm -f conftest.$ac_objext conftest.$ac_ext
6891 done
6892
6893 fi
6894 echo "$as_me:6894: result: $cf_cv_ncurses_header" >&5
6895 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6896
6897 if test "$cf_cv_ncurses_header" = none ; then
6898         { { echo "$as_me:6898: error: No curses header-files found" >&5
6899 echo "$as_me: error: No curses header-files found" >&2;}
6900    { (exit 1); exit 1; }; }
6901 fi
6902
6903 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6904
6905 for ac_header in $cf_cv_ncurses_header
6906 do
6907 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6908 echo "$as_me:6908: checking for $ac_header" >&5
6909 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6910 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6911   echo $ECHO_N "(cached) $ECHO_C" >&6
6912 else
6913   cat >conftest.$ac_ext <<_ACEOF
6914 #line 6914 "configure"
6915 #include "confdefs.h"
6916 #include <$ac_header>
6917 _ACEOF
6918 if { (eval echo "$as_me:6918: \"$ac_cpp conftest.$ac_ext\"") >&5
6919   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6920   ac_status=$?
6921   egrep -v '^ *\+' conftest.er1 >conftest.err
6922   rm -f conftest.er1
6923   cat conftest.err >&5
6924   echo "$as_me:6924: \$? = $ac_status" >&5
6925   (exit $ac_status); } >/dev/null; then
6926   if test -s conftest.err; then
6927     ac_cpp_err=$ac_c_preproc_warn_flag
6928   else
6929     ac_cpp_err=
6930   fi
6931 else
6932   ac_cpp_err=yes
6933 fi
6934 if test -z "$ac_cpp_err"; then
6935   eval "$as_ac_Header=yes"
6936 else
6937   echo "$as_me: failed program was:" >&5
6938   cat conftest.$ac_ext >&5
6939   eval "$as_ac_Header=no"
6940 fi
6941 rm -f conftest.err conftest.$ac_ext
6942 fi
6943 echo "$as_me:6943: result: `eval echo '${'$as_ac_Header'}'`" >&5
6944 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6945 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6946   cat >>confdefs.h <<EOF
6947 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6948 EOF
6949
6950 fi
6951 done
6952
6953 cat >>confdefs.h <<\EOF
6954 #define NCURSES 1
6955 EOF
6956
6957 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6958
6959                 cat >>confdefs.h <<EOF
6960 #define $cf_nculib_ROOT 1
6961 EOF
6962
6963                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6964
6965         else
6966
6967 cf_ncuhdr_root=$cf_cv_screen
6968
6969 test -n "$cf_cv_curses_dir" && \
6970 test "$cf_cv_curses_dir" != "no" && { \
6971
6972 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6973   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6974   do
6975         while test $cf_add_incdir != /usr/include
6976         do
6977           if test -d $cf_add_incdir
6978           then
6979                 cf_have_incdir=no
6980                 if test -n "$CFLAGS$CPPFLAGS" ; then
6981                   # a loop is needed to ensure we can add subdirs of existing dirs
6982                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6983                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6984                           cf_have_incdir=yes; break
6985                         fi
6986                   done
6987                 fi
6988
6989                 if test "$cf_have_incdir" = no ; then
6990                   if test "$cf_add_incdir" = /usr/local/include ; then
6991                         if test "$GCC" = yes
6992                         then
6993                           cf_save_CPPFLAGS=$CPPFLAGS
6994                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6995                           cat >conftest.$ac_ext <<_ACEOF
6996 #line 6996 "configure"
6997 #include "confdefs.h"
6998 #include <stdio.h>
6999 int
7000 main ()
7001 {
7002 printf("Hello")
7003   ;
7004   return 0;
7005 }
7006 _ACEOF
7007 rm -f conftest.$ac_objext
7008 if { (eval echo "$as_me:7008: \"$ac_compile\"") >&5
7009   (eval $ac_compile) 2>&5
7010   ac_status=$?
7011   echo "$as_me:7011: \$? = $ac_status" >&5
7012   (exit $ac_status); } &&
7013          { ac_try='test -s conftest.$ac_objext'
7014   { (eval echo "$as_me:7014: \"$ac_try\"") >&5
7015   (eval $ac_try) 2>&5
7016   ac_status=$?
7017   echo "$as_me:7017: \$? = $ac_status" >&5
7018   (exit $ac_status); }; }; then
7019   :
7020 else
7021   echo "$as_me: failed program was:" >&5
7022 cat conftest.$ac_ext >&5
7023 cf_have_incdir=yes
7024 fi
7025 rm -f conftest.$ac_objext conftest.$ac_ext
7026                           CPPFLAGS=$cf_save_CPPFLAGS
7027                         fi
7028                   fi
7029                 fi
7030
7031                 if test "$cf_have_incdir" = no ; then
7032                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7033
7034 echo "${as_me:-configure}:7034: testing adding $cf_add_incdir to include-path ..." 1>&5
7035
7036                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7037
7038                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7039                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7040                   cf_add_incdir="$cf_top_incdir"
7041                 else
7042                   break
7043                 fi
7044           else
7045                 break
7046           fi
7047         done
7048   done
7049 fi
7050
7051 }
7052
7053 echo "$as_me:7053: checking for $cf_ncuhdr_root header in include-path" >&5
7054 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7055 if test "${cf_cv_ncurses_h+set}" = set; then
7056   echo $ECHO_N "(cached) $ECHO_C" >&6
7057 else
7058
7059         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7060         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7061         for cf_header in $cf_header_list
7062         do
7063
7064         cat >conftest.$ac_ext <<_ACEOF
7065 #line 7065 "configure"
7066 #include "confdefs.h"
7067
7068 #include <$cf_header>
7069 int
7070 main ()
7071 {
7072
7073 #ifdef NCURSES_VERSION
7074
7075 printf("%s\n", NCURSES_VERSION);
7076 #else
7077 #ifdef __NCURSES_H
7078 printf("old\n");
7079 #else
7080         make an error
7081 #endif
7082 #endif
7083
7084   ;
7085   return 0;
7086 }
7087 _ACEOF
7088 rm -f conftest.$ac_objext
7089 if { (eval echo "$as_me:7089: \"$ac_compile\"") >&5
7090   (eval $ac_compile) 2>&5
7091   ac_status=$?
7092   echo "$as_me:7092: \$? = $ac_status" >&5
7093   (exit $ac_status); } &&
7094          { ac_try='test -s conftest.$ac_objext'
7095   { (eval echo "$as_me:7095: \"$ac_try\"") >&5
7096   (eval $ac_try) 2>&5
7097   ac_status=$?
7098   echo "$as_me:7098: \$? = $ac_status" >&5
7099   (exit $ac_status); }; }; then
7100   cf_cv_ncurses_h=$cf_header
7101
7102 else
7103   echo "$as_me: failed program was:" >&5
7104 cat conftest.$ac_ext >&5
7105 cf_cv_ncurses_h=no
7106 fi
7107 rm -f conftest.$ac_objext conftest.$ac_ext
7108
7109                 test "$cf_cv_ncurses_h" != no && break
7110         done
7111
7112 fi
7113 echo "$as_me:7113: result: $cf_cv_ncurses_h" >&5
7114 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7115
7116 if test "$cf_cv_ncurses_h" != no ; then
7117         cf_cv_ncurses_header=$cf_cv_ncurses_h
7118 else
7119
7120 echo "$as_me:7120: checking for $cf_ncuhdr_root include-path" >&5
7121 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7122 if test "${cf_cv_ncurses_h2+set}" = set; then
7123   echo $ECHO_N "(cached) $ECHO_C" >&6
7124 else
7125
7126         test -n "$verbose" && echo
7127
7128 cf_search=
7129
7130 # collect the current set of include-directories from compiler flags
7131 cf_header_path_list=""
7132 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7133         for cf_header_path in $CPPFLAGS $CFLAGS
7134         do
7135                 case $cf_header_path in
7136                 (-I*)
7137                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7138
7139 test "x$cf_header_path" != "xNONE" && \
7140 test -d "$cf_header_path" && \
7141  {
7142         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7143         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7144         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7145         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7146         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7147         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"
7148 }
7149
7150                         cf_header_path_list="$cf_header_path_list $cf_search"
7151                         ;;
7152                 esac
7153         done
7154 fi
7155
7156 # add the variations for the package we are looking for
7157
7158 cf_search=
7159
7160 test "x$prefix" != "xNONE" && \
7161 test -d "$prefix" && \
7162  {
7163         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7164         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7165         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7166         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7167         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7168         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7169 }
7170
7171 for cf_subdir_prefix in \
7172         /usr \
7173         /usr/local \
7174         /usr/pkg \
7175         /opt \
7176         /opt/local \
7177         $HOME
7178 do
7179
7180 test "x$cf_subdir_prefix" != "x$prefix" && \
7181 test -d "$cf_subdir_prefix" && \
7182 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7183         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7184         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7185         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7186         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7187         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7188         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7189 }
7190
7191 done
7192
7193 test "$includedir" != NONE && \
7194 test "$includedir" != "/usr/include" && \
7195 test -d "$includedir" && {
7196         test -d $includedir &&    cf_search="$cf_search $includedir"
7197         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7198 }
7199
7200 test "$oldincludedir" != NONE && \
7201 test "$oldincludedir" != "/usr/include" && \
7202 test -d "$oldincludedir" && {
7203         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7204         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7205 }
7206
7207 cf_search="$cf_search $cf_header_path_list"
7208
7209         test -n "$verbose" && echo search path $cf_search
7210         cf_save2_CPPFLAGS="$CPPFLAGS"
7211         for cf_incdir in $cf_search
7212         do
7213
7214 if test -n "$cf_incdir" ; then
7215   for cf_add_incdir in $cf_incdir
7216   do
7217         while test $cf_add_incdir != /usr/include
7218         do
7219           if test -d $cf_add_incdir
7220           then
7221                 cf_have_incdir=no
7222                 if test -n "$CFLAGS$CPPFLAGS" ; then
7223                   # a loop is needed to ensure we can add subdirs of existing dirs
7224                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7225                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7226                           cf_have_incdir=yes; break
7227                         fi
7228                   done
7229                 fi
7230
7231                 if test "$cf_have_incdir" = no ; then
7232                   if test "$cf_add_incdir" = /usr/local/include ; then
7233                         if test "$GCC" = yes
7234                         then
7235                           cf_save_CPPFLAGS=$CPPFLAGS
7236                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7237                           cat >conftest.$ac_ext <<_ACEOF
7238 #line 7238 "configure"
7239 #include "confdefs.h"
7240 #include <stdio.h>
7241 int
7242 main ()
7243 {
7244 printf("Hello")
7245   ;
7246   return 0;
7247 }
7248 _ACEOF
7249 rm -f conftest.$ac_objext
7250 if { (eval echo "$as_me:7250: \"$ac_compile\"") >&5
7251   (eval $ac_compile) 2>&5
7252   ac_status=$?
7253   echo "$as_me:7253: \$? = $ac_status" >&5
7254   (exit $ac_status); } &&
7255          { ac_try='test -s conftest.$ac_objext'
7256   { (eval echo "$as_me:7256: \"$ac_try\"") >&5
7257   (eval $ac_try) 2>&5
7258   ac_status=$?
7259   echo "$as_me:7259: \$? = $ac_status" >&5
7260   (exit $ac_status); }; }; then
7261   :
7262 else
7263   echo "$as_me: failed program was:" >&5
7264 cat conftest.$ac_ext >&5
7265 cf_have_incdir=yes
7266 fi
7267 rm -f conftest.$ac_objext conftest.$ac_ext
7268                           CPPFLAGS=$cf_save_CPPFLAGS
7269                         fi
7270                   fi
7271                 fi
7272
7273                 if test "$cf_have_incdir" = no ; then
7274                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7275
7276 echo "${as_me:-configure}:7276: testing adding $cf_add_incdir to include-path ..." 1>&5
7277
7278                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7279
7280                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7281                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7282                   cf_add_incdir="$cf_top_incdir"
7283                 else
7284                   break
7285                 fi
7286           else
7287                 break
7288           fi
7289         done
7290   done
7291 fi
7292
7293                 for cf_header in \
7294                         ncurses.h \
7295                         curses.h
7296                 do
7297
7298         cat >conftest.$ac_ext <<_ACEOF
7299 #line 7299 "configure"
7300 #include "confdefs.h"
7301
7302 #include <$cf_header>
7303 int
7304 main ()
7305 {
7306
7307 #ifdef NCURSES_VERSION
7308
7309 printf("%s\n", NCURSES_VERSION);
7310 #else
7311 #ifdef __NCURSES_H
7312 printf("old\n");
7313 #else
7314         make an error
7315 #endif
7316 #endif
7317
7318   ;
7319   return 0;
7320 }
7321 _ACEOF
7322 rm -f conftest.$ac_objext
7323 if { (eval echo "$as_me:7323: \"$ac_compile\"") >&5
7324   (eval $ac_compile) 2>&5
7325   ac_status=$?
7326   echo "$as_me:7326: \$? = $ac_status" >&5
7327   (exit $ac_status); } &&
7328          { ac_try='test -s conftest.$ac_objext'
7329   { (eval echo "$as_me:7329: \"$ac_try\"") >&5
7330   (eval $ac_try) 2>&5
7331   ac_status=$?
7332   echo "$as_me:7332: \$? = $ac_status" >&5
7333   (exit $ac_status); }; }; then
7334   cf_cv_ncurses_h2=$cf_header
7335
7336 else
7337   echo "$as_me: failed program was:" >&5
7338 cat conftest.$ac_ext >&5
7339 cf_cv_ncurses_h2=no
7340 fi
7341 rm -f conftest.$ac_objext conftest.$ac_ext
7342
7343                         if test "$cf_cv_ncurses_h2" != no ; then
7344                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7345                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7346                                 break
7347                         fi
7348                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7349                 done
7350                 CPPFLAGS="$cf_save2_CPPFLAGS"
7351                 test "$cf_cv_ncurses_h2" != no && break
7352         done
7353         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7353: error: not found" >&5
7354 echo "$as_me: error: not found" >&2;}
7355    { (exit 1); exit 1; }; }
7356
7357 fi
7358 echo "$as_me:7358: result: $cf_cv_ncurses_h2" >&5
7359 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7360
7361         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7362         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7363         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7364                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7365         fi
7366
7367 if test -n "$cf_1st_incdir" ; then
7368   for cf_add_incdir in $cf_1st_incdir
7369   do
7370         while test $cf_add_incdir != /usr/include
7371         do
7372           if test -d $cf_add_incdir
7373           then
7374                 cf_have_incdir=no
7375                 if test -n "$CFLAGS$CPPFLAGS" ; then
7376                   # a loop is needed to ensure we can add subdirs of existing dirs
7377                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7378                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7379                           cf_have_incdir=yes; break
7380                         fi
7381                   done
7382                 fi
7383
7384                 if test "$cf_have_incdir" = no ; then
7385                   if test "$cf_add_incdir" = /usr/local/include ; then
7386                         if test "$GCC" = yes
7387                         then
7388                           cf_save_CPPFLAGS=$CPPFLAGS
7389                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7390                           cat >conftest.$ac_ext <<_ACEOF
7391 #line 7391 "configure"
7392 #include "confdefs.h"
7393 #include <stdio.h>
7394 int
7395 main ()
7396 {
7397 printf("Hello")
7398   ;
7399   return 0;
7400 }
7401 _ACEOF
7402 rm -f conftest.$ac_objext
7403 if { (eval echo "$as_me:7403: \"$ac_compile\"") >&5
7404   (eval $ac_compile) 2>&5
7405   ac_status=$?
7406   echo "$as_me:7406: \$? = $ac_status" >&5
7407   (exit $ac_status); } &&
7408          { ac_try='test -s conftest.$ac_objext'
7409   { (eval echo "$as_me:7409: \"$ac_try\"") >&5
7410   (eval $ac_try) 2>&5
7411   ac_status=$?
7412   echo "$as_me:7412: \$? = $ac_status" >&5
7413   (exit $ac_status); }; }; then
7414   :
7415 else
7416   echo "$as_me: failed program was:" >&5
7417 cat conftest.$ac_ext >&5
7418 cf_have_incdir=yes
7419 fi
7420 rm -f conftest.$ac_objext conftest.$ac_ext
7421                           CPPFLAGS=$cf_save_CPPFLAGS
7422                         fi
7423                   fi
7424                 fi
7425
7426                 if test "$cf_have_incdir" = no ; then
7427                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7428
7429 echo "${as_me:-configure}:7429: testing adding $cf_add_incdir to include-path ..." 1>&5
7430
7431                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7432
7433                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7434                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7435                   cf_add_incdir="$cf_top_incdir"
7436                 else
7437                   break
7438                 fi
7439           else
7440                 break
7441           fi
7442         done
7443   done
7444 fi
7445
7446 fi
7447
7448 # Set definitions to allow ifdef'ing for ncurses.h
7449
7450 case $cf_cv_ncurses_header in
7451 (*ncurses.h)
7452
7453 cat >>confdefs.h <<\EOF
7454 #define HAVE_NCURSES_H 1
7455 EOF
7456
7457         ;;
7458 esac
7459
7460 case $cf_cv_ncurses_header in
7461 (ncurses/curses.h|ncurses/ncurses.h)
7462
7463 cat >>confdefs.h <<\EOF
7464 #define HAVE_NCURSES_NCURSES_H 1
7465 EOF
7466
7467         ;;
7468 (ncursesw/curses.h|ncursesw/ncurses.h)
7469
7470 cat >>confdefs.h <<\EOF
7471 #define HAVE_NCURSESW_NCURSES_H 1
7472 EOF
7473
7474         ;;
7475 esac
7476
7477 echo "$as_me:7477: checking for terminfo header" >&5
7478 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7479 if test "${cf_cv_term_header+set}" = set; then
7480   echo $ECHO_N "(cached) $ECHO_C" >&6
7481 else
7482
7483 case ${cf_cv_ncurses_header} in
7484 (*/ncurses.h|*/ncursesw.h)
7485         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7486         ;;
7487 (*)
7488         cf_term_header=term.h
7489         ;;
7490 esac
7491
7492 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7493 do
7494 cat >conftest.$ac_ext <<_ACEOF
7495 #line 7495 "configure"
7496 #include "confdefs.h"
7497 #include <stdio.h>
7498 #include <${cf_cv_ncurses_header:-curses.h}>
7499 #include <$cf_test>
7500
7501 int
7502 main ()
7503 {
7504 int x = auto_left_margin
7505   ;
7506   return 0;
7507 }
7508 _ACEOF
7509 rm -f conftest.$ac_objext
7510 if { (eval echo "$as_me:7510: \"$ac_compile\"") >&5
7511   (eval $ac_compile) 2>&5
7512   ac_status=$?
7513   echo "$as_me:7513: \$? = $ac_status" >&5
7514   (exit $ac_status); } &&
7515          { ac_try='test -s conftest.$ac_objext'
7516   { (eval echo "$as_me:7516: \"$ac_try\"") >&5
7517   (eval $ac_try) 2>&5
7518   ac_status=$?
7519   echo "$as_me:7519: \$? = $ac_status" >&5
7520   (exit $ac_status); }; }; then
7521
7522         cf_cv_term_header="$cf_test"
7523 else
7524   echo "$as_me: failed program was:" >&5
7525 cat conftest.$ac_ext >&5
7526
7527         cf_cv_term_header=unknown
7528
7529 fi
7530 rm -f conftest.$ac_objext conftest.$ac_ext
7531         test "$cf_cv_term_header" != unknown && break
7532 done
7533
7534 fi
7535 echo "$as_me:7535: result: $cf_cv_term_header" >&5
7536 echo "${ECHO_T}$cf_cv_term_header" >&6
7537
7538 # Set definitions to allow ifdef'ing to accommodate subdirectories
7539
7540 case $cf_cv_term_header in
7541 (*term.h)
7542
7543 cat >>confdefs.h <<\EOF
7544 #define HAVE_TERM_H 1
7545 EOF
7546
7547         ;;
7548 esac
7549
7550 case $cf_cv_term_header in
7551 (ncurses/term.h)
7552
7553 cat >>confdefs.h <<\EOF
7554 #define HAVE_NCURSES_TERM_H 1
7555 EOF
7556
7557         ;;
7558 (ncursesw/term.h)
7559
7560 cat >>confdefs.h <<\EOF
7561 #define HAVE_NCURSESW_TERM_H 1
7562 EOF
7563
7564         ;;
7565 esac
7566
7567 # some applications need this, but should check for NCURSES_VERSION
7568
7569 cat >>confdefs.h <<\EOF
7570 #define NCURSES 1
7571 EOF
7572
7573 echo "$as_me:7573: checking for ncurses version" >&5
7574 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7575 if test "${cf_cv_ncurses_version+set}" = set; then
7576   echo $ECHO_N "(cached) $ECHO_C" >&6
7577 else
7578
7579         cf_cv_ncurses_version=no
7580         cf_tempfile=out$$
7581         rm -f $cf_tempfile
7582         if test "$cross_compiling" = yes; then
7583
7584         # This will not work if the preprocessor splits the line after the
7585         # Autoconf token.  The 'unproto' program does that.
7586         cat > conftest.$ac_ext <<EOF
7587 #include <${cf_cv_ncurses_header:-curses.h}>
7588 #undef Autoconf
7589 #ifdef NCURSES_VERSION
7590 Autoconf NCURSES_VERSION
7591 #else
7592 #ifdef __NCURSES_H
7593 Autoconf "old"
7594 #endif
7595 ;
7596 #endif
7597 EOF
7598         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7599         { (eval echo "$as_me:7599: \"$cf_try\"") >&5
7600   (eval $cf_try) 2>&5
7601   ac_status=$?
7602   echo "$as_me:7602: \$? = $ac_status" >&5
7603   (exit $ac_status); }
7604         if test -f conftest.out ; then
7605                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7606                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7607                 rm -f conftest.out
7608         fi
7609
7610 else
7611   cat >conftest.$ac_ext <<_ACEOF
7612 #line 7612 "configure"
7613 #include "confdefs.h"
7614
7615 #include <${cf_cv_ncurses_header:-curses.h}>
7616 #include <stdio.h>
7617 int main()
7618 {
7619         FILE *fp = fopen("$cf_tempfile", "w");
7620 #ifdef NCURSES_VERSION
7621 # ifdef NCURSES_VERSION_PATCH
7622         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7623 # else
7624         fprintf(fp, "%s\n", NCURSES_VERSION);
7625 # endif
7626 #else
7627 # ifdef __NCURSES_H
7628         fprintf(fp, "old\n");
7629 # else
7630         make an error
7631 # endif
7632 #endif
7633         ${cf_cv_main_return:-return}(0);
7634 }
7635 _ACEOF
7636 rm -f conftest$ac_exeext
7637 if { (eval echo "$as_me:7637: \"$ac_link\"") >&5
7638   (eval $ac_link) 2>&5
7639   ac_status=$?
7640   echo "$as_me:7640: \$? = $ac_status" >&5
7641   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7642   { (eval echo "$as_me:7642: \"$ac_try\"") >&5
7643   (eval $ac_try) 2>&5
7644   ac_status=$?
7645   echo "$as_me:7645: \$? = $ac_status" >&5
7646   (exit $ac_status); }; }; then
7647
7648         cf_cv_ncurses_version=`cat $cf_tempfile`
7649 else
7650   echo "$as_me: program exited with status $ac_status" >&5
7651 echo "$as_me: failed program was:" >&5
7652 cat conftest.$ac_ext >&5
7653 fi
7654 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7655 fi
7656         rm -f $cf_tempfile
7657
7658 fi
7659 echo "$as_me:7659: result: $cf_cv_ncurses_version" >&5
7660 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7661 test "$cf_cv_ncurses_version" = no ||
7662 cat >>confdefs.h <<\EOF
7663 #define NCURSES 1
7664 EOF
7665
7666 cf_nculib_root=$cf_cv_screen
7667         # This works, except for the special case where we find gpm, but
7668         # ncurses is in a nonstandard location via $LIBS, and we really want
7669         # to link gpm.
7670 cf_ncurses_LIBS=""
7671 cf_ncurses_SAVE="$LIBS"
7672 echo "$as_me:7672: checking for Gpm_Open in -lgpm" >&5
7673 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7674 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7675   echo $ECHO_N "(cached) $ECHO_C" >&6
7676 else
7677   ac_check_lib_save_LIBS=$LIBS
7678 LIBS="-lgpm  $LIBS"
7679 cat >conftest.$ac_ext <<_ACEOF
7680 #line 7680 "configure"
7681 #include "confdefs.h"
7682
7683 /* Override any gcc2 internal prototype to avoid an error.  */
7684 #ifdef __cplusplus
7685 extern "C"
7686 #endif
7687 /* We use char because int might match the return type of a gcc2
7688    builtin and then its argument prototype would still apply.  */
7689 char Gpm_Open ();
7690 int
7691 main ()
7692 {
7693 Gpm_Open ();
7694   ;
7695   return 0;
7696 }
7697 _ACEOF
7698 rm -f conftest.$ac_objext conftest$ac_exeext
7699 if { (eval echo "$as_me:7699: \"$ac_link\"") >&5
7700   (eval $ac_link) 2>&5
7701   ac_status=$?
7702   echo "$as_me:7702: \$? = $ac_status" >&5
7703   (exit $ac_status); } &&
7704          { ac_try='test -s conftest$ac_exeext'
7705   { (eval echo "$as_me:7705: \"$ac_try\"") >&5
7706   (eval $ac_try) 2>&5
7707   ac_status=$?
7708   echo "$as_me:7708: \$? = $ac_status" >&5
7709   (exit $ac_status); }; }; then
7710   ac_cv_lib_gpm_Gpm_Open=yes
7711 else
7712   echo "$as_me: failed program was:" >&5
7713 cat conftest.$ac_ext >&5
7714 ac_cv_lib_gpm_Gpm_Open=no
7715 fi
7716 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7717 LIBS=$ac_check_lib_save_LIBS
7718 fi
7719 echo "$as_me:7719: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7720 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7721 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7722   echo "$as_me:7722: checking for initscr in -lgpm" >&5
7723 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7724 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7725   echo $ECHO_N "(cached) $ECHO_C" >&6
7726 else
7727   ac_check_lib_save_LIBS=$LIBS
7728 LIBS="-lgpm  $LIBS"
7729 cat >conftest.$ac_ext <<_ACEOF
7730 #line 7730 "configure"
7731 #include "confdefs.h"
7732
7733 /* Override any gcc2 internal prototype to avoid an error.  */
7734 #ifdef __cplusplus
7735 extern "C"
7736 #endif
7737 /* We use char because int might match the return type of a gcc2
7738    builtin and then its argument prototype would still apply.  */
7739 char initscr ();
7740 int
7741 main ()
7742 {
7743 initscr ();
7744   ;
7745   return 0;
7746 }
7747 _ACEOF
7748 rm -f conftest.$ac_objext conftest$ac_exeext
7749 if { (eval echo "$as_me:7749: \"$ac_link\"") >&5
7750   (eval $ac_link) 2>&5
7751   ac_status=$?
7752   echo "$as_me:7752: \$? = $ac_status" >&5
7753   (exit $ac_status); } &&
7754          { ac_try='test -s conftest$ac_exeext'
7755   { (eval echo "$as_me:7755: \"$ac_try\"") >&5
7756   (eval $ac_try) 2>&5
7757   ac_status=$?
7758   echo "$as_me:7758: \$? = $ac_status" >&5
7759   (exit $ac_status); }; }; then
7760   ac_cv_lib_gpm_initscr=yes
7761 else
7762   echo "$as_me: failed program was:" >&5
7763 cat conftest.$ac_ext >&5
7764 ac_cv_lib_gpm_initscr=no
7765 fi
7766 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7767 LIBS=$ac_check_lib_save_LIBS
7768 fi
7769 echo "$as_me:7769: result: $ac_cv_lib_gpm_initscr" >&5
7770 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7771 if test $ac_cv_lib_gpm_initscr = yes; then
7772   LIBS="$cf_ncurses_SAVE"
7773 else
7774   cf_ncurses_LIBS="-lgpm"
7775 fi
7776
7777 fi
7778
7779 case $host_os in
7780 (freebsd*)
7781         # This is only necessary if you are linking against an obsolete
7782         # version of ncurses (but it should do no harm, since it's static).
7783         if test "$cf_nculib_root" = ncurses ; then
7784                 echo "$as_me:7784: checking for tgoto in -lmytinfo" >&5
7785 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7786 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7787   echo $ECHO_N "(cached) $ECHO_C" >&6
7788 else
7789   ac_check_lib_save_LIBS=$LIBS
7790 LIBS="-lmytinfo  $LIBS"
7791 cat >conftest.$ac_ext <<_ACEOF
7792 #line 7792 "configure"
7793 #include "confdefs.h"
7794
7795 /* Override any gcc2 internal prototype to avoid an error.  */
7796 #ifdef __cplusplus
7797 extern "C"
7798 #endif
7799 /* We use char because int might match the return type of a gcc2
7800    builtin and then its argument prototype would still apply.  */
7801 char tgoto ();
7802 int
7803 main ()
7804 {
7805 tgoto ();
7806   ;
7807   return 0;
7808 }
7809 _ACEOF
7810 rm -f conftest.$ac_objext conftest$ac_exeext
7811 if { (eval echo "$as_me:7811: \"$ac_link\"") >&5
7812   (eval $ac_link) 2>&5
7813   ac_status=$?
7814   echo "$as_me:7814: \$? = $ac_status" >&5
7815   (exit $ac_status); } &&
7816          { ac_try='test -s conftest$ac_exeext'
7817   { (eval echo "$as_me:7817: \"$ac_try\"") >&5
7818   (eval $ac_try) 2>&5
7819   ac_status=$?
7820   echo "$as_me:7820: \$? = $ac_status" >&5
7821   (exit $ac_status); }; }; then
7822   ac_cv_lib_mytinfo_tgoto=yes
7823 else
7824   echo "$as_me: failed program was:" >&5
7825 cat conftest.$ac_ext >&5
7826 ac_cv_lib_mytinfo_tgoto=no
7827 fi
7828 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7829 LIBS=$ac_check_lib_save_LIBS
7830 fi
7831 echo "$as_me:7831: result: $ac_cv_lib_mytinfo_tgoto" >&5
7832 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7833 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7834   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7835 fi
7836
7837         fi
7838         ;;
7839 esac
7840
7841 cf_add_libs="$cf_ncurses_LIBS"
7842 # Filter out duplicates - this happens with badly-designed ".pc" files...
7843 for cf_add_1lib in $LIBS
7844 do
7845         for cf_add_2lib in $cf_add_libs
7846         do
7847                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7848                 then
7849                         cf_add_1lib=
7850                         break
7851                 fi
7852         done
7853         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7854 done
7855 LIBS="$cf_add_libs"
7856
7857 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7858 then
7859
7860 cf_add_libs="-l$cf_nculib_root"
7861 # Filter out duplicates - this happens with badly-designed ".pc" files...
7862 for cf_add_1lib in $LIBS
7863 do
7864         for cf_add_2lib in $cf_add_libs
7865         do
7866                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7867                 then
7868                         cf_add_1lib=
7869                         break
7870                 fi
7871         done
7872         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7873 done
7874 LIBS="$cf_add_libs"
7875
7876 else
7877
7878         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7879         cf_libdir=""
7880         echo "$as_me:7880: checking for initscr" >&5
7881 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7882 if test "${ac_cv_func_initscr+set}" = set; then
7883   echo $ECHO_N "(cached) $ECHO_C" >&6
7884 else
7885   cat >conftest.$ac_ext <<_ACEOF
7886 #line 7886 "configure"
7887 #include "confdefs.h"
7888 /* System header to define __stub macros and hopefully few prototypes,
7889     which can conflict with char initscr (); below.  */
7890 #include <assert.h>
7891 /* Override any gcc2 internal prototype to avoid an error.  */
7892 #ifdef __cplusplus
7893 extern "C"
7894 #endif
7895 /* We use char because int might match the return type of a gcc2
7896    builtin and then its argument prototype would still apply.  */
7897 char initscr ();
7898 char (*f) ();
7899
7900 int
7901 main ()
7902 {
7903 /* The GNU C library defines this for functions which it implements
7904     to always fail with ENOSYS.  Some functions are actually named
7905     something starting with __ and the normal name is an alias.  */
7906 #if defined (__stub_initscr) || defined (__stub___initscr)
7907 choke me
7908 #else
7909 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7910 #endif
7911
7912   ;
7913   return 0;
7914 }
7915 _ACEOF
7916 rm -f conftest.$ac_objext conftest$ac_exeext
7917 if { (eval echo "$as_me:7917: \"$ac_link\"") >&5
7918   (eval $ac_link) 2>&5
7919   ac_status=$?
7920   echo "$as_me:7920: \$? = $ac_status" >&5
7921   (exit $ac_status); } &&
7922          { ac_try='test -s conftest$ac_exeext'
7923   { (eval echo "$as_me:7923: \"$ac_try\"") >&5
7924   (eval $ac_try) 2>&5
7925   ac_status=$?
7926   echo "$as_me:7926: \$? = $ac_status" >&5
7927   (exit $ac_status); }; }; then
7928   ac_cv_func_initscr=yes
7929 else
7930   echo "$as_me: failed program was:" >&5
7931 cat conftest.$ac_ext >&5
7932 ac_cv_func_initscr=no
7933 fi
7934 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7935 fi
7936 echo "$as_me:7936: result: $ac_cv_func_initscr" >&5
7937 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7938 if test $ac_cv_func_initscr = yes; then
7939   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7940 else
7941
7942                 cf_save_LIBS="$LIBS"
7943                 echo "$as_me:7943: checking for initscr in -l$cf_nculib_root" >&5
7944 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7945                 LIBS="-l$cf_nculib_root $LIBS"
7946                 cat >conftest.$ac_ext <<_ACEOF
7947 #line 7947 "configure"
7948 #include "confdefs.h"
7949 #include <${cf_cv_ncurses_header:-curses.h}>
7950 int
7951 main ()
7952 {
7953 initscr()
7954   ;
7955   return 0;
7956 }
7957 _ACEOF
7958 rm -f conftest.$ac_objext conftest$ac_exeext
7959 if { (eval echo "$as_me:7959: \"$ac_link\"") >&5
7960   (eval $ac_link) 2>&5
7961   ac_status=$?
7962   echo "$as_me:7962: \$? = $ac_status" >&5
7963   (exit $ac_status); } &&
7964          { ac_try='test -s conftest$ac_exeext'
7965   { (eval echo "$as_me:7965: \"$ac_try\"") >&5
7966   (eval $ac_try) 2>&5
7967   ac_status=$?
7968   echo "$as_me:7968: \$? = $ac_status" >&5
7969   (exit $ac_status); }; }; then
7970   echo "$as_me:7970: result: yes" >&5
7971 echo "${ECHO_T}yes" >&6
7972                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7973
7974 else
7975   echo "$as_me: failed program was:" >&5
7976 cat conftest.$ac_ext >&5
7977 echo "$as_me:7977: result: no" >&5
7978 echo "${ECHO_T}no" >&6
7979
7980 cf_search=
7981 cf_library_path_list=""
7982 if test -n "${LDFLAGS}${LIBS}" ; then
7983         for cf_library_path in $LDFLAGS $LIBS
7984         do
7985                 case $cf_library_path in
7986                 (-L*)
7987                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7988
7989 test "x$cf_library_path" != "xNONE" && \
7990 test -d "$cf_library_path" && \
7991  {
7992         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7993         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7994         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7995         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7996         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7997         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"
7998 }
7999
8000                         cf_library_path_list="$cf_library_path_list $cf_search"
8001                         ;;
8002                 esac
8003         done
8004 fi
8005
8006 cf_search=
8007
8008 test "x$prefix" != "xNONE" && \
8009 test -d "$prefix" && \
8010  {
8011         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8012         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8013         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8014         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8015         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8016         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8017 }
8018
8019 for cf_subdir_prefix in \
8020         /usr \
8021         /usr/local \
8022         /usr/pkg \
8023         /opt \
8024         /opt/local \
8025         $HOME
8026 do
8027
8028 test "x$cf_subdir_prefix" != "x$prefix" && \
8029 test -d "$cf_subdir_prefix" && \
8030 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8031         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8032         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8033         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8034         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8035         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8036         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
8037 }
8038
8039 done
8040
8041 cf_search="$cf_library_path_list $cf_search"
8042
8043                         for cf_libdir in $cf_search
8044                         do
8045                                 echo "$as_me:8045: checking for -l$cf_nculib_root in $cf_libdir" >&5
8046 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8047                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8048                                 cat >conftest.$ac_ext <<_ACEOF
8049 #line 8049 "configure"
8050 #include "confdefs.h"
8051 #include <${cf_cv_ncurses_header:-curses.h}>
8052 int
8053 main ()
8054 {
8055 initscr()
8056   ;
8057   return 0;
8058 }
8059 _ACEOF
8060 rm -f conftest.$ac_objext conftest$ac_exeext
8061 if { (eval echo "$as_me:8061: \"$ac_link\"") >&5
8062   (eval $ac_link) 2>&5
8063   ac_status=$?
8064   echo "$as_me:8064: \$? = $ac_status" >&5
8065   (exit $ac_status); } &&
8066          { ac_try='test -s conftest$ac_exeext'
8067   { (eval echo "$as_me:8067: \"$ac_try\"") >&5
8068   (eval $ac_try) 2>&5
8069   ac_status=$?
8070   echo "$as_me:8070: \$? = $ac_status" >&5
8071   (exit $ac_status); }; }; then
8072   echo "$as_me:8072: result: yes" >&5
8073 echo "${ECHO_T}yes" >&6
8074                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8075                                          break
8076 else
8077   echo "$as_me: failed program was:" >&5
8078 cat conftest.$ac_ext >&5
8079 echo "$as_me:8079: result: no" >&5
8080 echo "${ECHO_T}no" >&6
8081                                          LIBS="$cf_save_LIBS"
8082 fi
8083 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8084                         done
8085
8086 fi
8087 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8088
8089 fi
8090
8091 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8092
8093 if test $cf_found_library = no ; then
8094         { { echo "$as_me:8094: error: Cannot link $cf_nculib_root library" >&5
8095 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8096    { (exit 1); exit 1; }; }
8097 fi
8098
8099 fi
8100
8101 if test -n "$cf_ncurses_LIBS" ; then
8102         echo "$as_me:8102: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8103 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8104         cf_ncurses_SAVE="$LIBS"
8105         for p in $cf_ncurses_LIBS ; do
8106                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8107                 if test "$q" != "$LIBS" ; then
8108                         LIBS="$q"
8109                 fi
8110         done
8111         cat >conftest.$ac_ext <<_ACEOF
8112 #line 8112 "configure"
8113 #include "confdefs.h"
8114 #include <${cf_cv_ncurses_header:-curses.h}>
8115 int
8116 main ()
8117 {
8118 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8119   ;
8120   return 0;
8121 }
8122 _ACEOF
8123 rm -f conftest.$ac_objext conftest$ac_exeext
8124 if { (eval echo "$as_me:8124: \"$ac_link\"") >&5
8125   (eval $ac_link) 2>&5
8126   ac_status=$?
8127   echo "$as_me:8127: \$? = $ac_status" >&5
8128   (exit $ac_status); } &&
8129          { ac_try='test -s conftest$ac_exeext'
8130   { (eval echo "$as_me:8130: \"$ac_try\"") >&5
8131   (eval $ac_try) 2>&5
8132   ac_status=$?
8133   echo "$as_me:8133: \$? = $ac_status" >&5
8134   (exit $ac_status); }; }; then
8135   echo "$as_me:8135: result: yes" >&5
8136 echo "${ECHO_T}yes" >&6
8137 else
8138   echo "$as_me: failed program was:" >&5
8139 cat conftest.$ac_ext >&5
8140 echo "$as_me:8140: result: no" >&5
8141 echo "${ECHO_T}no" >&6
8142                  LIBS="$cf_ncurses_SAVE"
8143 fi
8144 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8145 fi
8146
8147 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8148
8149 cat >>confdefs.h <<EOF
8150 #define $cf_nculib_ROOT 1
8151 EOF
8152
8153         fi
8154 else
8155         NCURSES_CONFIG=none
8156 fi
8157
8158         ;;
8159 (ncurses*)
8160
8161 cf_ncuconfig_root=$cf_cv_screen
8162 cf_have_ncuconfig=no
8163
8164 if test "x${PKG_CONFIG:=none}" != xnone; then
8165         echo "$as_me:8165: checking pkg-config for $cf_ncuconfig_root" >&5
8166 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8167         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8168                 echo "$as_me:8168: result: yes" >&5
8169 echo "${ECHO_T}yes" >&6
8170
8171                 echo "$as_me:8171: checking if the $cf_ncuconfig_root package files work" >&5
8172 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8173                 cf_have_ncuconfig=unknown
8174
8175                 cf_save_CPPFLAGS="$CPPFLAGS"
8176                 cf_save_LIBS="$LIBS"
8177
8178                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8179
8180 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8181 # Filter out duplicates - this happens with badly-designed ".pc" files...
8182 for cf_add_1lib in $LIBS
8183 do
8184         for cf_add_2lib in $cf_add_libs
8185         do
8186                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8187                 then
8188                         cf_add_1lib=
8189                         break
8190                 fi
8191         done
8192         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8193 done
8194 LIBS="$cf_add_libs"
8195
8196                 cat >conftest.$ac_ext <<_ACEOF
8197 #line 8197 "configure"
8198 #include "confdefs.h"
8199 #include <${cf_cv_ncurses_header:-curses.h}>
8200 int
8201 main ()
8202 {
8203 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8204   ;
8205   return 0;
8206 }
8207 _ACEOF
8208 rm -f conftest.$ac_objext conftest$ac_exeext
8209 if { (eval echo "$as_me:8209: \"$ac_link\"") >&5
8210   (eval $ac_link) 2>&5
8211   ac_status=$?
8212   echo "$as_me:8212: \$? = $ac_status" >&5
8213   (exit $ac_status); } &&
8214          { ac_try='test -s conftest$ac_exeext'
8215   { (eval echo "$as_me:8215: \"$ac_try\"") >&5
8216   (eval $ac_try) 2>&5
8217   ac_status=$?
8218   echo "$as_me:8218: \$? = $ac_status" >&5
8219   (exit $ac_status); }; }; then
8220   if test "$cross_compiling" = yes; then
8221   cf_have_ncuconfig=maybe
8222 else
8223   cat >conftest.$ac_ext <<_ACEOF
8224 #line 8224 "configure"
8225 #include "confdefs.h"
8226 #include <${cf_cv_ncurses_header:-curses.h}>
8227                                 int main(void)
8228                                 { char *xx = curses_version(); return (xx == 0); }
8229 _ACEOF
8230 rm -f conftest$ac_exeext
8231 if { (eval echo "$as_me:8231: \"$ac_link\"") >&5
8232   (eval $ac_link) 2>&5
8233   ac_status=$?
8234   echo "$as_me:8234: \$? = $ac_status" >&5
8235   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8236   { (eval echo "$as_me:8236: \"$ac_try\"") >&5
8237   (eval $ac_try) 2>&5
8238   ac_status=$?
8239   echo "$as_me:8239: \$? = $ac_status" >&5
8240   (exit $ac_status); }; }; then
8241   cf_have_ncuconfig=yes
8242 else
8243   echo "$as_me: program exited with status $ac_status" >&5
8244 echo "$as_me: failed program was:" >&5
8245 cat conftest.$ac_ext >&5
8246 cf_have_ncuconfig=no
8247 fi
8248 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8249 fi
8250 else
8251   echo "$as_me: failed program was:" >&5
8252 cat conftest.$ac_ext >&5
8253 cf_have_ncuconfig=no
8254 fi
8255 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8256                 echo "$as_me:8256: result: $cf_have_ncuconfig" >&5
8257 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8258                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8259                 if test "$cf_have_ncuconfig" != "yes"
8260                 then
8261                         CPPFLAGS="$cf_save_CPPFLAGS"
8262                         LIBS="$cf_save_LIBS"
8263                         NCURSES_CONFIG_PKG=none
8264                 else
8265
8266 cat >>confdefs.h <<\EOF
8267 #define NCURSES 1
8268 EOF
8269
8270                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8271                 fi
8272
8273         else
8274                 echo "$as_me:8274: result: no" >&5
8275 echo "${ECHO_T}no" >&6
8276                 NCURSES_CONFIG_PKG=none
8277         fi
8278 else
8279         NCURSES_CONFIG_PKG=none
8280 fi
8281
8282 if test "x$cf_have_ncuconfig" = "xno"; then
8283         echo "Looking for ${cf_ncuconfig_root}-config"
8284
8285 if test -n "$ac_tool_prefix"; then
8286   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8287   do
8288     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8289 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8290 echo "$as_me:8290: checking for $ac_word" >&5
8291 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8292 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8293   echo $ECHO_N "(cached) $ECHO_C" >&6
8294 else
8295   if test -n "$NCURSES_CONFIG"; then
8296   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8297 else
8298   ac_save_IFS=$IFS; IFS=$ac_path_separator
8299 ac_dummy="$PATH"
8300 for ac_dir in $ac_dummy; do
8301   IFS=$ac_save_IFS
8302   test -z "$ac_dir" && ac_dir=.
8303   $as_executable_p "$ac_dir/$ac_word" || continue
8304 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8305 echo "$as_me:8305: found $ac_dir/$ac_word" >&5
8306 break
8307 done
8308
8309 fi
8310 fi
8311 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8312 if test -n "$NCURSES_CONFIG"; then
8313   echo "$as_me:8313: result: $NCURSES_CONFIG" >&5
8314 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8315 else
8316   echo "$as_me:8316: result: no" >&5
8317 echo "${ECHO_T}no" >&6
8318 fi
8319
8320     test -n "$NCURSES_CONFIG" && break
8321   done
8322 fi
8323 if test -z "$NCURSES_CONFIG"; then
8324   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8325   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8326 do
8327   # Extract the first word of "$ac_prog", so it can be a program name with args.
8328 set dummy $ac_prog; ac_word=$2
8329 echo "$as_me:8329: checking for $ac_word" >&5
8330 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8331 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8332   echo $ECHO_N "(cached) $ECHO_C" >&6
8333 else
8334   if test -n "$ac_ct_NCURSES_CONFIG"; then
8335   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8336 else
8337   ac_save_IFS=$IFS; IFS=$ac_path_separator
8338 ac_dummy="$PATH"
8339 for ac_dir in $ac_dummy; do
8340   IFS=$ac_save_IFS
8341   test -z "$ac_dir" && ac_dir=.
8342   $as_executable_p "$ac_dir/$ac_word" || continue
8343 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8344 echo "$as_me:8344: found $ac_dir/$ac_word" >&5
8345 break
8346 done
8347
8348 fi
8349 fi
8350 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8351 if test -n "$ac_ct_NCURSES_CONFIG"; then
8352   echo "$as_me:8352: result: $ac_ct_NCURSES_CONFIG" >&5
8353 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8354 else
8355   echo "$as_me:8355: result: no" >&5
8356 echo "${ECHO_T}no" >&6
8357 fi
8358
8359   test -n "$ac_ct_NCURSES_CONFIG" && break
8360 done
8361 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8362
8363   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8364 fi
8365
8366         if test "$NCURSES_CONFIG" != none ; then
8367
8368                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8369
8370 cf_add_libs="`$NCURSES_CONFIG --libs`"
8371 # Filter out duplicates - this happens with badly-designed ".pc" files...
8372 for cf_add_1lib in $LIBS
8373 do
8374         for cf_add_2lib in $cf_add_libs
8375         do
8376                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8377                 then
8378                         cf_add_1lib=
8379                         break
8380                 fi
8381         done
8382         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8383 done
8384 LIBS="$cf_add_libs"
8385
8386                 # even with config script, some packages use no-override for curses.h
8387
8388 echo "$as_me:8388: checking if we have identified curses headers" >&5
8389 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8390 if test "${cf_cv_ncurses_header+set}" = set; then
8391   echo $ECHO_N "(cached) $ECHO_C" >&6
8392 else
8393
8394 cf_cv_ncurses_header=none
8395 for cf_header in \
8396         ncurses.h $cf_cv_screen/ncurses.h \
8397         curses.h $cf_cv_screen/curses.h
8398 do
8399 cat >conftest.$ac_ext <<_ACEOF
8400 #line 8400 "configure"
8401 #include "confdefs.h"
8402 #include <${cf_header}>
8403 int
8404 main ()
8405 {
8406 initscr(); tgoto("?", 0,0)
8407   ;
8408   return 0;
8409 }
8410 _ACEOF
8411 rm -f conftest.$ac_objext
8412 if { (eval echo "$as_me:8412: \"$ac_compile\"") >&5
8413   (eval $ac_compile) 2>&5
8414   ac_status=$?
8415   echo "$as_me:8415: \$? = $ac_status" >&5
8416   (exit $ac_status); } &&
8417          { ac_try='test -s conftest.$ac_objext'
8418   { (eval echo "$as_me:8418: \"$ac_try\"") >&5
8419   (eval $ac_try) 2>&5
8420   ac_status=$?
8421   echo "$as_me:8421: \$? = $ac_status" >&5
8422   (exit $ac_status); }; }; then
8423   cf_cv_ncurses_header=$cf_header; break
8424 else
8425   echo "$as_me: failed program was:" >&5
8426 cat conftest.$ac_ext >&5
8427 fi
8428 rm -f conftest.$ac_objext conftest.$ac_ext
8429 done
8430
8431 fi
8432 echo "$as_me:8432: result: $cf_cv_ncurses_header" >&5
8433 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8434
8435 if test "$cf_cv_ncurses_header" = none ; then
8436         { { echo "$as_me:8436: error: No curses header-files found" >&5
8437 echo "$as_me: error: No curses header-files found" >&2;}
8438    { (exit 1); exit 1; }; }
8439 fi
8440
8441 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8442
8443 for ac_header in $cf_cv_ncurses_header
8444 do
8445 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8446 echo "$as_me:8446: checking for $ac_header" >&5
8447 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8448 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8449   echo $ECHO_N "(cached) $ECHO_C" >&6
8450 else
8451   cat >conftest.$ac_ext <<_ACEOF
8452 #line 8452 "configure"
8453 #include "confdefs.h"
8454 #include <$ac_header>
8455 _ACEOF
8456 if { (eval echo "$as_me:8456: \"$ac_cpp conftest.$ac_ext\"") >&5
8457   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8458   ac_status=$?
8459   egrep -v '^ *\+' conftest.er1 >conftest.err
8460   rm -f conftest.er1
8461   cat conftest.err >&5
8462   echo "$as_me:8462: \$? = $ac_status" >&5
8463   (exit $ac_status); } >/dev/null; then
8464   if test -s conftest.err; then
8465     ac_cpp_err=$ac_c_preproc_warn_flag
8466   else
8467     ac_cpp_err=
8468   fi
8469 else
8470   ac_cpp_err=yes
8471 fi
8472 if test -z "$ac_cpp_err"; then
8473   eval "$as_ac_Header=yes"
8474 else
8475   echo "$as_me: failed program was:" >&5
8476   cat conftest.$ac_ext >&5
8477   eval "$as_ac_Header=no"
8478 fi
8479 rm -f conftest.err conftest.$ac_ext
8480 fi
8481 echo "$as_me:8481: result: `eval echo '${'$as_ac_Header'}'`" >&5
8482 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8483 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8484   cat >>confdefs.h <<EOF
8485 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8486 EOF
8487
8488 fi
8489 done
8490
8491 cat >>confdefs.h <<\EOF
8492 #define NCURSES 1
8493 EOF
8494
8495 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8496
8497                 cat >>confdefs.h <<EOF
8498 #define $cf_nculib_ROOT 1
8499 EOF
8500
8501                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8502
8503         else
8504
8505 cf_ncuhdr_root=$cf_cv_screen
8506
8507 test -n "$cf_cv_curses_dir" && \
8508 test "$cf_cv_curses_dir" != "no" && { \
8509
8510 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8511   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8512   do
8513         while test $cf_add_incdir != /usr/include
8514         do
8515           if test -d $cf_add_incdir
8516           then
8517                 cf_have_incdir=no
8518                 if test -n "$CFLAGS$CPPFLAGS" ; then
8519                   # a loop is needed to ensure we can add subdirs of existing dirs
8520                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8521                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8522                           cf_have_incdir=yes; break
8523                         fi
8524                   done
8525                 fi
8526
8527                 if test "$cf_have_incdir" = no ; then
8528                   if test "$cf_add_incdir" = /usr/local/include ; then
8529                         if test "$GCC" = yes
8530                         then
8531                           cf_save_CPPFLAGS=$CPPFLAGS
8532                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8533                           cat >conftest.$ac_ext <<_ACEOF
8534 #line 8534 "configure"
8535 #include "confdefs.h"
8536 #include <stdio.h>
8537 int
8538 main ()
8539 {
8540 printf("Hello")
8541   ;
8542   return 0;
8543 }
8544 _ACEOF
8545 rm -f conftest.$ac_objext
8546 if { (eval echo "$as_me:8546: \"$ac_compile\"") >&5
8547   (eval $ac_compile) 2>&5
8548   ac_status=$?
8549   echo "$as_me:8549: \$? = $ac_status" >&5
8550   (exit $ac_status); } &&
8551          { ac_try='test -s conftest.$ac_objext'
8552   { (eval echo "$as_me:8552: \"$ac_try\"") >&5
8553   (eval $ac_try) 2>&5
8554   ac_status=$?
8555   echo "$as_me:8555: \$? = $ac_status" >&5
8556   (exit $ac_status); }; }; then
8557   :
8558 else
8559   echo "$as_me: failed program was:" >&5
8560 cat conftest.$ac_ext >&5
8561 cf_have_incdir=yes
8562 fi
8563 rm -f conftest.$ac_objext conftest.$ac_ext
8564                           CPPFLAGS=$cf_save_CPPFLAGS
8565                         fi
8566                   fi
8567                 fi
8568
8569                 if test "$cf_have_incdir" = no ; then
8570                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8571
8572 echo "${as_me:-configure}:8572: testing adding $cf_add_incdir to include-path ..." 1>&5
8573
8574                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8575
8576                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8577                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8578                   cf_add_incdir="$cf_top_incdir"
8579                 else
8580                   break
8581                 fi
8582           else
8583                 break
8584           fi
8585         done
8586   done
8587 fi
8588
8589 }
8590
8591 echo "$as_me:8591: checking for $cf_ncuhdr_root header in include-path" >&5
8592 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8593 if test "${cf_cv_ncurses_h+set}" = set; then
8594   echo $ECHO_N "(cached) $ECHO_C" >&6
8595 else
8596
8597         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8598         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8599         for cf_header in $cf_header_list
8600         do
8601
8602         cat >conftest.$ac_ext <<_ACEOF
8603 #line 8603 "configure"
8604 #include "confdefs.h"
8605
8606 #include <$cf_header>
8607 int
8608 main ()
8609 {
8610
8611 #ifdef NCURSES_VERSION
8612
8613 printf("%s\n", NCURSES_VERSION);
8614 #else
8615 #ifdef __NCURSES_H
8616 printf("old\n");
8617 #else
8618         make an error
8619 #endif
8620 #endif
8621
8622   ;
8623   return 0;
8624 }
8625 _ACEOF
8626 rm -f conftest.$ac_objext
8627 if { (eval echo "$as_me:8627: \"$ac_compile\"") >&5
8628   (eval $ac_compile) 2>&5
8629   ac_status=$?
8630   echo "$as_me:8630: \$? = $ac_status" >&5
8631   (exit $ac_status); } &&
8632          { ac_try='test -s conftest.$ac_objext'
8633   { (eval echo "$as_me:8633: \"$ac_try\"") >&5
8634   (eval $ac_try) 2>&5
8635   ac_status=$?
8636   echo "$as_me:8636: \$? = $ac_status" >&5
8637   (exit $ac_status); }; }; then
8638   cf_cv_ncurses_h=$cf_header
8639
8640 else
8641   echo "$as_me: failed program was:" >&5
8642 cat conftest.$ac_ext >&5
8643 cf_cv_ncurses_h=no
8644 fi
8645 rm -f conftest.$ac_objext conftest.$ac_ext
8646
8647                 test "$cf_cv_ncurses_h" != no && break
8648         done
8649
8650 fi
8651 echo "$as_me:8651: result: $cf_cv_ncurses_h" >&5
8652 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8653
8654 if test "$cf_cv_ncurses_h" != no ; then
8655         cf_cv_ncurses_header=$cf_cv_ncurses_h
8656 else
8657
8658 echo "$as_me:8658: checking for $cf_ncuhdr_root include-path" >&5
8659 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8660 if test "${cf_cv_ncurses_h2+set}" = set; then
8661   echo $ECHO_N "(cached) $ECHO_C" >&6
8662 else
8663
8664         test -n "$verbose" && echo
8665
8666 cf_search=
8667
8668 # collect the current set of include-directories from compiler flags
8669 cf_header_path_list=""
8670 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8671         for cf_header_path in $CPPFLAGS $CFLAGS
8672         do
8673                 case $cf_header_path in
8674                 (-I*)
8675                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8676
8677 test "x$cf_header_path" != "xNONE" && \
8678 test -d "$cf_header_path" && \
8679  {
8680         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8681         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8682         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8683         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8684         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8685         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"
8686 }
8687
8688                         cf_header_path_list="$cf_header_path_list $cf_search"
8689                         ;;
8690                 esac
8691         done
8692 fi
8693
8694 # add the variations for the package we are looking for
8695
8696 cf_search=
8697
8698 test "x$prefix" != "xNONE" && \
8699 test -d "$prefix" && \
8700  {
8701         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8702         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8703         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8704         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8705         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8706         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8707 }
8708
8709 for cf_subdir_prefix in \
8710         /usr \
8711         /usr/local \
8712         /usr/pkg \
8713         /opt \
8714         /opt/local \
8715         $HOME
8716 do
8717
8718 test "x$cf_subdir_prefix" != "x$prefix" && \
8719 test -d "$cf_subdir_prefix" && \
8720 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8721         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8722         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8723         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8724         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8725         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8726         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8727 }
8728
8729 done
8730
8731 test "$includedir" != NONE && \
8732 test "$includedir" != "/usr/include" && \
8733 test -d "$includedir" && {
8734         test -d $includedir &&    cf_search="$cf_search $includedir"
8735         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8736 }
8737
8738 test "$oldincludedir" != NONE && \
8739 test "$oldincludedir" != "/usr/include" && \
8740 test -d "$oldincludedir" && {
8741         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8742         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8743 }
8744
8745 cf_search="$cf_search $cf_header_path_list"
8746
8747         test -n "$verbose" && echo search path $cf_search
8748         cf_save2_CPPFLAGS="$CPPFLAGS"
8749         for cf_incdir in $cf_search
8750         do
8751
8752 if test -n "$cf_incdir" ; then
8753   for cf_add_incdir in $cf_incdir
8754   do
8755         while test $cf_add_incdir != /usr/include
8756         do
8757           if test -d $cf_add_incdir
8758           then
8759                 cf_have_incdir=no
8760                 if test -n "$CFLAGS$CPPFLAGS" ; then
8761                   # a loop is needed to ensure we can add subdirs of existing dirs
8762                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8763                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8764                           cf_have_incdir=yes; break
8765                         fi
8766                   done
8767                 fi
8768
8769                 if test "$cf_have_incdir" = no ; then
8770                   if test "$cf_add_incdir" = /usr/local/include ; then
8771                         if test "$GCC" = yes
8772                         then
8773                           cf_save_CPPFLAGS=$CPPFLAGS
8774                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8775                           cat >conftest.$ac_ext <<_ACEOF
8776 #line 8776 "configure"
8777 #include "confdefs.h"
8778 #include <stdio.h>
8779 int
8780 main ()
8781 {
8782 printf("Hello")
8783   ;
8784   return 0;
8785 }
8786 _ACEOF
8787 rm -f conftest.$ac_objext
8788 if { (eval echo "$as_me:8788: \"$ac_compile\"") >&5
8789   (eval $ac_compile) 2>&5
8790   ac_status=$?
8791   echo "$as_me:8791: \$? = $ac_status" >&5
8792   (exit $ac_status); } &&
8793          { ac_try='test -s conftest.$ac_objext'
8794   { (eval echo "$as_me:8794: \"$ac_try\"") >&5
8795   (eval $ac_try) 2>&5
8796   ac_status=$?
8797   echo "$as_me:8797: \$? = $ac_status" >&5
8798   (exit $ac_status); }; }; then
8799   :
8800 else
8801   echo "$as_me: failed program was:" >&5
8802 cat conftest.$ac_ext >&5
8803 cf_have_incdir=yes
8804 fi
8805 rm -f conftest.$ac_objext conftest.$ac_ext
8806                           CPPFLAGS=$cf_save_CPPFLAGS
8807                         fi
8808                   fi
8809                 fi
8810
8811                 if test "$cf_have_incdir" = no ; then
8812                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8813
8814 echo "${as_me:-configure}:8814: testing adding $cf_add_incdir to include-path ..." 1>&5
8815
8816                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8817
8818                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8819                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8820                   cf_add_incdir="$cf_top_incdir"
8821                 else
8822                   break
8823                 fi
8824           else
8825                 break
8826           fi
8827         done
8828   done
8829 fi
8830
8831                 for cf_header in \
8832                         ncurses.h \
8833                         curses.h
8834                 do
8835
8836         cat >conftest.$ac_ext <<_ACEOF
8837 #line 8837 "configure"
8838 #include "confdefs.h"
8839
8840 #include <$cf_header>
8841 int
8842 main ()
8843 {
8844
8845 #ifdef NCURSES_VERSION
8846
8847 printf("%s\n", NCURSES_VERSION);
8848 #else
8849 #ifdef __NCURSES_H
8850 printf("old\n");
8851 #else
8852         make an error
8853 #endif
8854 #endif
8855
8856   ;
8857   return 0;
8858 }
8859 _ACEOF
8860 rm -f conftest.$ac_objext
8861 if { (eval echo "$as_me:8861: \"$ac_compile\"") >&5
8862   (eval $ac_compile) 2>&5
8863   ac_status=$?
8864   echo "$as_me:8864: \$? = $ac_status" >&5
8865   (exit $ac_status); } &&
8866          { ac_try='test -s conftest.$ac_objext'
8867   { (eval echo "$as_me:8867: \"$ac_try\"") >&5
8868   (eval $ac_try) 2>&5
8869   ac_status=$?
8870   echo "$as_me:8870: \$? = $ac_status" >&5
8871   (exit $ac_status); }; }; then
8872   cf_cv_ncurses_h2=$cf_header
8873
8874 else
8875   echo "$as_me: failed program was:" >&5
8876 cat conftest.$ac_ext >&5
8877 cf_cv_ncurses_h2=no
8878 fi
8879 rm -f conftest.$ac_objext conftest.$ac_ext
8880
8881                         if test "$cf_cv_ncurses_h2" != no ; then
8882                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8883                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8884                                 break
8885                         fi
8886                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8887                 done
8888                 CPPFLAGS="$cf_save2_CPPFLAGS"
8889                 test "$cf_cv_ncurses_h2" != no && break
8890         done
8891         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8891: error: not found" >&5
8892 echo "$as_me: error: not found" >&2;}
8893    { (exit 1); exit 1; }; }
8894
8895 fi
8896 echo "$as_me:8896: result: $cf_cv_ncurses_h2" >&5
8897 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8898
8899         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8900         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8901         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8902                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8903         fi
8904
8905 if test -n "$cf_1st_incdir" ; then
8906   for cf_add_incdir in $cf_1st_incdir
8907   do
8908         while test $cf_add_incdir != /usr/include
8909         do
8910           if test -d $cf_add_incdir
8911           then
8912                 cf_have_incdir=no
8913                 if test -n "$CFLAGS$CPPFLAGS" ; then
8914                   # a loop is needed to ensure we can add subdirs of existing dirs
8915                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8916                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8917                           cf_have_incdir=yes; break
8918                         fi
8919                   done
8920                 fi
8921
8922                 if test "$cf_have_incdir" = no ; then
8923                   if test "$cf_add_incdir" = /usr/local/include ; then
8924                         if test "$GCC" = yes
8925                         then
8926                           cf_save_CPPFLAGS=$CPPFLAGS
8927                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8928                           cat >conftest.$ac_ext <<_ACEOF
8929 #line 8929 "configure"
8930 #include "confdefs.h"
8931 #include <stdio.h>
8932 int
8933 main ()
8934 {
8935 printf("Hello")
8936   ;
8937   return 0;
8938 }
8939 _ACEOF
8940 rm -f conftest.$ac_objext
8941 if { (eval echo "$as_me:8941: \"$ac_compile\"") >&5
8942   (eval $ac_compile) 2>&5
8943   ac_status=$?
8944   echo "$as_me:8944: \$? = $ac_status" >&5
8945   (exit $ac_status); } &&
8946          { ac_try='test -s conftest.$ac_objext'
8947   { (eval echo "$as_me:8947: \"$ac_try\"") >&5
8948   (eval $ac_try) 2>&5
8949   ac_status=$?
8950   echo "$as_me:8950: \$? = $ac_status" >&5
8951   (exit $ac_status); }; }; then
8952   :
8953 else
8954   echo "$as_me: failed program was:" >&5
8955 cat conftest.$ac_ext >&5
8956 cf_have_incdir=yes
8957 fi
8958 rm -f conftest.$ac_objext conftest.$ac_ext
8959                           CPPFLAGS=$cf_save_CPPFLAGS
8960                         fi
8961                   fi
8962                 fi
8963
8964                 if test "$cf_have_incdir" = no ; then
8965                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8966
8967 echo "${as_me:-configure}:8967: testing adding $cf_add_incdir to include-path ..." 1>&5
8968
8969                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8970
8971                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8972                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8973                   cf_add_incdir="$cf_top_incdir"
8974                 else
8975                   break
8976                 fi
8977           else
8978                 break
8979           fi
8980         done
8981   done
8982 fi
8983
8984 fi
8985
8986 # Set definitions to allow ifdef'ing for ncurses.h
8987
8988 case $cf_cv_ncurses_header in
8989 (*ncurses.h)
8990
8991 cat >>confdefs.h <<\EOF
8992 #define HAVE_NCURSES_H 1
8993 EOF
8994
8995         ;;
8996 esac
8997
8998 case $cf_cv_ncurses_header in
8999 (ncurses/curses.h|ncurses/ncurses.h)
9000
9001 cat >>confdefs.h <<\EOF
9002 #define HAVE_NCURSES_NCURSES_H 1
9003 EOF
9004
9005         ;;
9006 (ncursesw/curses.h|ncursesw/ncurses.h)
9007
9008 cat >>confdefs.h <<\EOF
9009 #define HAVE_NCURSESW_NCURSES_H 1
9010 EOF
9011
9012         ;;
9013 esac
9014
9015 echo "$as_me:9015: checking for terminfo header" >&5
9016 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9017 if test "${cf_cv_term_header+set}" = set; then
9018   echo $ECHO_N "(cached) $ECHO_C" >&6
9019 else
9020
9021 case ${cf_cv_ncurses_header} in
9022 (*/ncurses.h|*/ncursesw.h)
9023         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9024         ;;
9025 (*)
9026         cf_term_header=term.h
9027         ;;
9028 esac
9029
9030 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9031 do
9032 cat >conftest.$ac_ext <<_ACEOF
9033 #line 9033 "configure"
9034 #include "confdefs.h"
9035 #include <stdio.h>
9036 #include <${cf_cv_ncurses_header:-curses.h}>
9037 #include <$cf_test>
9038
9039 int
9040 main ()
9041 {
9042 int x = auto_left_margin
9043   ;
9044   return 0;
9045 }
9046 _ACEOF
9047 rm -f conftest.$ac_objext
9048 if { (eval echo "$as_me:9048: \"$ac_compile\"") >&5
9049   (eval $ac_compile) 2>&5
9050   ac_status=$?
9051   echo "$as_me:9051: \$? = $ac_status" >&5
9052   (exit $ac_status); } &&
9053          { ac_try='test -s conftest.$ac_objext'
9054   { (eval echo "$as_me:9054: \"$ac_try\"") >&5
9055   (eval $ac_try) 2>&5
9056   ac_status=$?
9057   echo "$as_me:9057: \$? = $ac_status" >&5
9058   (exit $ac_status); }; }; then
9059
9060         cf_cv_term_header="$cf_test"
9061 else
9062   echo "$as_me: failed program was:" >&5
9063 cat conftest.$ac_ext >&5
9064
9065         cf_cv_term_header=unknown
9066
9067 fi
9068 rm -f conftest.$ac_objext conftest.$ac_ext
9069         test "$cf_cv_term_header" != unknown && break
9070 done
9071
9072 fi
9073 echo "$as_me:9073: result: $cf_cv_term_header" >&5
9074 echo "${ECHO_T}$cf_cv_term_header" >&6
9075
9076 # Set definitions to allow ifdef'ing to accommodate subdirectories
9077
9078 case $cf_cv_term_header in
9079 (*term.h)
9080
9081 cat >>confdefs.h <<\EOF
9082 #define HAVE_TERM_H 1
9083 EOF
9084
9085         ;;
9086 esac
9087
9088 case $cf_cv_term_header in
9089 (ncurses/term.h)
9090
9091 cat >>confdefs.h <<\EOF
9092 #define HAVE_NCURSES_TERM_H 1
9093 EOF
9094
9095         ;;
9096 (ncursesw/term.h)
9097
9098 cat >>confdefs.h <<\EOF
9099 #define HAVE_NCURSESW_TERM_H 1
9100 EOF
9101
9102         ;;
9103 esac
9104
9105 # some applications need this, but should check for NCURSES_VERSION
9106
9107 cat >>confdefs.h <<\EOF
9108 #define NCURSES 1
9109 EOF
9110
9111 echo "$as_me:9111: checking for ncurses version" >&5
9112 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9113 if test "${cf_cv_ncurses_version+set}" = set; then
9114   echo $ECHO_N "(cached) $ECHO_C" >&6
9115 else
9116
9117         cf_cv_ncurses_version=no
9118         cf_tempfile=out$$
9119         rm -f $cf_tempfile
9120         if test "$cross_compiling" = yes; then
9121
9122         # This will not work if the preprocessor splits the line after the
9123         # Autoconf token.  The 'unproto' program does that.
9124         cat > conftest.$ac_ext <<EOF
9125 #include <${cf_cv_ncurses_header:-curses.h}>
9126 #undef Autoconf
9127 #ifdef NCURSES_VERSION
9128 Autoconf NCURSES_VERSION
9129 #else
9130 #ifdef __NCURSES_H
9131 Autoconf "old"
9132 #endif
9133 ;
9134 #endif
9135 EOF
9136         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9137         { (eval echo "$as_me:9137: \"$cf_try\"") >&5
9138   (eval $cf_try) 2>&5
9139   ac_status=$?
9140   echo "$as_me:9140: \$? = $ac_status" >&5
9141   (exit $ac_status); }
9142         if test -f conftest.out ; then
9143                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9144                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9145                 rm -f conftest.out
9146         fi
9147
9148 else
9149   cat >conftest.$ac_ext <<_ACEOF
9150 #line 9150 "configure"
9151 #include "confdefs.h"
9152
9153 #include <${cf_cv_ncurses_header:-curses.h}>
9154 #include <stdio.h>
9155 int main()
9156 {
9157         FILE *fp = fopen("$cf_tempfile", "w");
9158 #ifdef NCURSES_VERSION
9159 # ifdef NCURSES_VERSION_PATCH
9160         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9161 # else
9162         fprintf(fp, "%s\n", NCURSES_VERSION);
9163 # endif
9164 #else
9165 # ifdef __NCURSES_H
9166         fprintf(fp, "old\n");
9167 # else
9168         make an error
9169 # endif
9170 #endif
9171         ${cf_cv_main_return:-return}(0);
9172 }
9173 _ACEOF
9174 rm -f conftest$ac_exeext
9175 if { (eval echo "$as_me:9175: \"$ac_link\"") >&5
9176   (eval $ac_link) 2>&5
9177   ac_status=$?
9178   echo "$as_me:9178: \$? = $ac_status" >&5
9179   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9180   { (eval echo "$as_me:9180: \"$ac_try\"") >&5
9181   (eval $ac_try) 2>&5
9182   ac_status=$?
9183   echo "$as_me:9183: \$? = $ac_status" >&5
9184   (exit $ac_status); }; }; then
9185
9186         cf_cv_ncurses_version=`cat $cf_tempfile`
9187 else
9188   echo "$as_me: program exited with status $ac_status" >&5
9189 echo "$as_me: failed program was:" >&5
9190 cat conftest.$ac_ext >&5
9191 fi
9192 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9193 fi
9194         rm -f $cf_tempfile
9195
9196 fi
9197 echo "$as_me:9197: result: $cf_cv_ncurses_version" >&5
9198 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9199 test "$cf_cv_ncurses_version" = no ||
9200 cat >>confdefs.h <<\EOF
9201 #define NCURSES 1
9202 EOF
9203
9204 cf_nculib_root=$cf_cv_screen
9205         # This works, except for the special case where we find gpm, but
9206         # ncurses is in a nonstandard location via $LIBS, and we really want
9207         # to link gpm.
9208 cf_ncurses_LIBS=""
9209 cf_ncurses_SAVE="$LIBS"
9210 echo "$as_me:9210: checking for Gpm_Open in -lgpm" >&5
9211 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9212 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9213   echo $ECHO_N "(cached) $ECHO_C" >&6
9214 else
9215   ac_check_lib_save_LIBS=$LIBS
9216 LIBS="-lgpm  $LIBS"
9217 cat >conftest.$ac_ext <<_ACEOF
9218 #line 9218 "configure"
9219 #include "confdefs.h"
9220
9221 /* Override any gcc2 internal prototype to avoid an error.  */
9222 #ifdef __cplusplus
9223 extern "C"
9224 #endif
9225 /* We use char because int might match the return type of a gcc2
9226    builtin and then its argument prototype would still apply.  */
9227 char Gpm_Open ();
9228 int
9229 main ()
9230 {
9231 Gpm_Open ();
9232   ;
9233   return 0;
9234 }
9235 _ACEOF
9236 rm -f conftest.$ac_objext conftest$ac_exeext
9237 if { (eval echo "$as_me:9237: \"$ac_link\"") >&5
9238   (eval $ac_link) 2>&5
9239   ac_status=$?
9240   echo "$as_me:9240: \$? = $ac_status" >&5
9241   (exit $ac_status); } &&
9242          { ac_try='test -s conftest$ac_exeext'
9243   { (eval echo "$as_me:9243: \"$ac_try\"") >&5
9244   (eval $ac_try) 2>&5
9245   ac_status=$?
9246   echo "$as_me:9246: \$? = $ac_status" >&5
9247   (exit $ac_status); }; }; then
9248   ac_cv_lib_gpm_Gpm_Open=yes
9249 else
9250   echo "$as_me: failed program was:" >&5
9251 cat conftest.$ac_ext >&5
9252 ac_cv_lib_gpm_Gpm_Open=no
9253 fi
9254 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9255 LIBS=$ac_check_lib_save_LIBS
9256 fi
9257 echo "$as_me:9257: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9258 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9259 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9260   echo "$as_me:9260: checking for initscr in -lgpm" >&5
9261 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9262 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9263   echo $ECHO_N "(cached) $ECHO_C" >&6
9264 else
9265   ac_check_lib_save_LIBS=$LIBS
9266 LIBS="-lgpm  $LIBS"
9267 cat >conftest.$ac_ext <<_ACEOF
9268 #line 9268 "configure"
9269 #include "confdefs.h"
9270
9271 /* Override any gcc2 internal prototype to avoid an error.  */
9272 #ifdef __cplusplus
9273 extern "C"
9274 #endif
9275 /* We use char because int might match the return type of a gcc2
9276    builtin and then its argument prototype would still apply.  */
9277 char initscr ();
9278 int
9279 main ()
9280 {
9281 initscr ();
9282   ;
9283   return 0;
9284 }
9285 _ACEOF
9286 rm -f conftest.$ac_objext conftest$ac_exeext
9287 if { (eval echo "$as_me:9287: \"$ac_link\"") >&5
9288   (eval $ac_link) 2>&5
9289   ac_status=$?
9290   echo "$as_me:9290: \$? = $ac_status" >&5
9291   (exit $ac_status); } &&
9292          { ac_try='test -s conftest$ac_exeext'
9293   { (eval echo "$as_me:9293: \"$ac_try\"") >&5
9294   (eval $ac_try) 2>&5
9295   ac_status=$?
9296   echo "$as_me:9296: \$? = $ac_status" >&5
9297   (exit $ac_status); }; }; then
9298   ac_cv_lib_gpm_initscr=yes
9299 else
9300   echo "$as_me: failed program was:" >&5
9301 cat conftest.$ac_ext >&5
9302 ac_cv_lib_gpm_initscr=no
9303 fi
9304 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9305 LIBS=$ac_check_lib_save_LIBS
9306 fi
9307 echo "$as_me:9307: result: $ac_cv_lib_gpm_initscr" >&5
9308 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9309 if test $ac_cv_lib_gpm_initscr = yes; then
9310   LIBS="$cf_ncurses_SAVE"
9311 else
9312   cf_ncurses_LIBS="-lgpm"
9313 fi
9314
9315 fi
9316
9317 case $host_os in
9318 (freebsd*)
9319         # This is only necessary if you are linking against an obsolete
9320         # version of ncurses (but it should do no harm, since it's static).
9321         if test "$cf_nculib_root" = ncurses ; then
9322                 echo "$as_me:9322: checking for tgoto in -lmytinfo" >&5
9323 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9324 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9325   echo $ECHO_N "(cached) $ECHO_C" >&6
9326 else
9327   ac_check_lib_save_LIBS=$LIBS
9328 LIBS="-lmytinfo  $LIBS"
9329 cat >conftest.$ac_ext <<_ACEOF
9330 #line 9330 "configure"
9331 #include "confdefs.h"
9332
9333 /* Override any gcc2 internal prototype to avoid an error.  */
9334 #ifdef __cplusplus
9335 extern "C"
9336 #endif
9337 /* We use char because int might match the return type of a gcc2
9338    builtin and then its argument prototype would still apply.  */
9339 char tgoto ();
9340 int
9341 main ()
9342 {
9343 tgoto ();
9344   ;
9345   return 0;
9346 }
9347 _ACEOF
9348 rm -f conftest.$ac_objext conftest$ac_exeext
9349 if { (eval echo "$as_me:9349: \"$ac_link\"") >&5
9350   (eval $ac_link) 2>&5
9351   ac_status=$?
9352   echo "$as_me:9352: \$? = $ac_status" >&5
9353   (exit $ac_status); } &&
9354          { ac_try='test -s conftest$ac_exeext'
9355   { (eval echo "$as_me:9355: \"$ac_try\"") >&5
9356   (eval $ac_try) 2>&5
9357   ac_status=$?
9358   echo "$as_me:9358: \$? = $ac_status" >&5
9359   (exit $ac_status); }; }; then
9360   ac_cv_lib_mytinfo_tgoto=yes
9361 else
9362   echo "$as_me: failed program was:" >&5
9363 cat conftest.$ac_ext >&5
9364 ac_cv_lib_mytinfo_tgoto=no
9365 fi
9366 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9367 LIBS=$ac_check_lib_save_LIBS
9368 fi
9369 echo "$as_me:9369: result: $ac_cv_lib_mytinfo_tgoto" >&5
9370 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9371 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9372   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9373 fi
9374
9375         fi
9376         ;;
9377 esac
9378
9379 cf_add_libs="$cf_ncurses_LIBS"
9380 # Filter out duplicates - this happens with badly-designed ".pc" files...
9381 for cf_add_1lib in $LIBS
9382 do
9383         for cf_add_2lib in $cf_add_libs
9384         do
9385                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9386                 then
9387                         cf_add_1lib=
9388                         break
9389                 fi
9390         done
9391         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9392 done
9393 LIBS="$cf_add_libs"
9394
9395 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9396 then
9397
9398 cf_add_libs="-l$cf_nculib_root"
9399 # Filter out duplicates - this happens with badly-designed ".pc" files...
9400 for cf_add_1lib in $LIBS
9401 do
9402         for cf_add_2lib in $cf_add_libs
9403         do
9404                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9405                 then
9406                         cf_add_1lib=
9407                         break
9408                 fi
9409         done
9410         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9411 done
9412 LIBS="$cf_add_libs"
9413
9414 else
9415
9416         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9417         cf_libdir=""
9418         echo "$as_me:9418: checking for initscr" >&5
9419 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9420 if test "${ac_cv_func_initscr+set}" = set; then
9421   echo $ECHO_N "(cached) $ECHO_C" >&6
9422 else
9423   cat >conftest.$ac_ext <<_ACEOF
9424 #line 9424 "configure"
9425 #include "confdefs.h"
9426 /* System header to define __stub macros and hopefully few prototypes,
9427     which can conflict with char initscr (); below.  */
9428 #include <assert.h>
9429 /* Override any gcc2 internal prototype to avoid an error.  */
9430 #ifdef __cplusplus
9431 extern "C"
9432 #endif
9433 /* We use char because int might match the return type of a gcc2
9434    builtin and then its argument prototype would still apply.  */
9435 char initscr ();
9436 char (*f) ();
9437
9438 int
9439 main ()
9440 {
9441 /* The GNU C library defines this for functions which it implements
9442     to always fail with ENOSYS.  Some functions are actually named
9443     something starting with __ and the normal name is an alias.  */
9444 #if defined (__stub_initscr) || defined (__stub___initscr)
9445 choke me
9446 #else
9447 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9448 #endif
9449
9450   ;
9451   return 0;
9452 }
9453 _ACEOF
9454 rm -f conftest.$ac_objext conftest$ac_exeext
9455 if { (eval echo "$as_me:9455: \"$ac_link\"") >&5
9456   (eval $ac_link) 2>&5
9457   ac_status=$?
9458   echo "$as_me:9458: \$? = $ac_status" >&5
9459   (exit $ac_status); } &&
9460          { ac_try='test -s conftest$ac_exeext'
9461   { (eval echo "$as_me:9461: \"$ac_try\"") >&5
9462   (eval $ac_try) 2>&5
9463   ac_status=$?
9464   echo "$as_me:9464: \$? = $ac_status" >&5
9465   (exit $ac_status); }; }; then
9466   ac_cv_func_initscr=yes
9467 else
9468   echo "$as_me: failed program was:" >&5
9469 cat conftest.$ac_ext >&5
9470 ac_cv_func_initscr=no
9471 fi
9472 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9473 fi
9474 echo "$as_me:9474: result: $ac_cv_func_initscr" >&5
9475 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9476 if test $ac_cv_func_initscr = yes; then
9477   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9478 else
9479
9480                 cf_save_LIBS="$LIBS"
9481                 echo "$as_me:9481: checking for initscr in -l$cf_nculib_root" >&5
9482 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9483                 LIBS="-l$cf_nculib_root $LIBS"
9484                 cat >conftest.$ac_ext <<_ACEOF
9485 #line 9485 "configure"
9486 #include "confdefs.h"
9487 #include <${cf_cv_ncurses_header:-curses.h}>
9488 int
9489 main ()
9490 {
9491 initscr()
9492   ;
9493   return 0;
9494 }
9495 _ACEOF
9496 rm -f conftest.$ac_objext conftest$ac_exeext
9497 if { (eval echo "$as_me:9497: \"$ac_link\"") >&5
9498   (eval $ac_link) 2>&5
9499   ac_status=$?
9500   echo "$as_me:9500: \$? = $ac_status" >&5
9501   (exit $ac_status); } &&
9502          { ac_try='test -s conftest$ac_exeext'
9503   { (eval echo "$as_me:9503: \"$ac_try\"") >&5
9504   (eval $ac_try) 2>&5
9505   ac_status=$?
9506   echo "$as_me:9506: \$? = $ac_status" >&5
9507   (exit $ac_status); }; }; then
9508   echo "$as_me:9508: result: yes" >&5
9509 echo "${ECHO_T}yes" >&6
9510                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9511
9512 else
9513   echo "$as_me: failed program was:" >&5
9514 cat conftest.$ac_ext >&5
9515 echo "$as_me:9515: result: no" >&5
9516 echo "${ECHO_T}no" >&6
9517
9518 cf_search=
9519 cf_library_path_list=""
9520 if test -n "${LDFLAGS}${LIBS}" ; then
9521         for cf_library_path in $LDFLAGS $LIBS
9522         do
9523                 case $cf_library_path in
9524                 (-L*)
9525                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9526
9527 test "x$cf_library_path" != "xNONE" && \
9528 test -d "$cf_library_path" && \
9529  {
9530         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9531         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9532         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9533         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9534         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9535         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"
9536 }
9537
9538                         cf_library_path_list="$cf_library_path_list $cf_search"
9539                         ;;
9540                 esac
9541         done
9542 fi
9543
9544 cf_search=
9545
9546 test "x$prefix" != "xNONE" && \
9547 test -d "$prefix" && \
9548  {
9549         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9550         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9551         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9552         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9553         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9554         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9555 }
9556
9557 for cf_subdir_prefix in \
9558         /usr \
9559         /usr/local \
9560         /usr/pkg \
9561         /opt \
9562         /opt/local \
9563         $HOME
9564 do
9565
9566 test "x$cf_subdir_prefix" != "x$prefix" && \
9567 test -d "$cf_subdir_prefix" && \
9568 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9569         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9570         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9571         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9572         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9573         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9574         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
9575 }
9576
9577 done
9578
9579 cf_search="$cf_library_path_list $cf_search"
9580
9581                         for cf_libdir in $cf_search
9582                         do
9583                                 echo "$as_me:9583: checking for -l$cf_nculib_root in $cf_libdir" >&5
9584 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9585                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9586                                 cat >conftest.$ac_ext <<_ACEOF
9587 #line 9587 "configure"
9588 #include "confdefs.h"
9589 #include <${cf_cv_ncurses_header:-curses.h}>
9590 int
9591 main ()
9592 {
9593 initscr()
9594   ;
9595   return 0;
9596 }
9597 _ACEOF
9598 rm -f conftest.$ac_objext conftest$ac_exeext
9599 if { (eval echo "$as_me:9599: \"$ac_link\"") >&5
9600   (eval $ac_link) 2>&5
9601   ac_status=$?
9602   echo "$as_me:9602: \$? = $ac_status" >&5
9603   (exit $ac_status); } &&
9604          { ac_try='test -s conftest$ac_exeext'
9605   { (eval echo "$as_me:9605: \"$ac_try\"") >&5
9606   (eval $ac_try) 2>&5
9607   ac_status=$?
9608   echo "$as_me:9608: \$? = $ac_status" >&5
9609   (exit $ac_status); }; }; then
9610   echo "$as_me:9610: result: yes" >&5
9611 echo "${ECHO_T}yes" >&6
9612                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9613                                          break
9614 else
9615   echo "$as_me: failed program was:" >&5
9616 cat conftest.$ac_ext >&5
9617 echo "$as_me:9617: result: no" >&5
9618 echo "${ECHO_T}no" >&6
9619                                          LIBS="$cf_save_LIBS"
9620 fi
9621 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9622                         done
9623
9624 fi
9625 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9626
9627 fi
9628
9629 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9630
9631 if test $cf_found_library = no ; then
9632         { { echo "$as_me:9632: error: Cannot link $cf_nculib_root library" >&5
9633 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9634    { (exit 1); exit 1; }; }
9635 fi
9636
9637 fi
9638
9639 if test -n "$cf_ncurses_LIBS" ; then
9640         echo "$as_me:9640: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9641 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9642         cf_ncurses_SAVE="$LIBS"
9643         for p in $cf_ncurses_LIBS ; do
9644                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9645                 if test "$q" != "$LIBS" ; then
9646                         LIBS="$q"
9647                 fi
9648         done
9649         cat >conftest.$ac_ext <<_ACEOF
9650 #line 9650 "configure"
9651 #include "confdefs.h"
9652 #include <${cf_cv_ncurses_header:-curses.h}>
9653 int
9654 main ()
9655 {
9656 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9657   ;
9658   return 0;
9659 }
9660 _ACEOF
9661 rm -f conftest.$ac_objext conftest$ac_exeext
9662 if { (eval echo "$as_me:9662: \"$ac_link\"") >&5
9663   (eval $ac_link) 2>&5
9664   ac_status=$?
9665   echo "$as_me:9665: \$? = $ac_status" >&5
9666   (exit $ac_status); } &&
9667          { ac_try='test -s conftest$ac_exeext'
9668   { (eval echo "$as_me:9668: \"$ac_try\"") >&5
9669   (eval $ac_try) 2>&5
9670   ac_status=$?
9671   echo "$as_me:9671: \$? = $ac_status" >&5
9672   (exit $ac_status); }; }; then
9673   echo "$as_me:9673: result: yes" >&5
9674 echo "${ECHO_T}yes" >&6
9675 else
9676   echo "$as_me: failed program was:" >&5
9677 cat conftest.$ac_ext >&5
9678 echo "$as_me:9678: result: no" >&5
9679 echo "${ECHO_T}no" >&6
9680                  LIBS="$cf_ncurses_SAVE"
9681 fi
9682 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9683 fi
9684
9685 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9686
9687 cat >>confdefs.h <<EOF
9688 #define $cf_nculib_ROOT 1
9689 EOF
9690
9691         fi
9692 else
9693         NCURSES_CONFIG=none
9694 fi
9695
9696         ;;
9697 (pdcurses)
9698         echo "$as_me:9698: checking for X" >&5
9699 echo $ECHO_N "checking for X... $ECHO_C" >&6
9700
9701 # Check whether --with-x or --without-x was given.
9702 if test "${with_x+set}" = set; then
9703   withval="$with_x"
9704
9705 fi;
9706 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9707 if test "x$with_x" = xno; then
9708   # The user explicitly disabled X.
9709   have_x=disabled
9710 else
9711   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9712     # Both variables are already set.
9713     have_x=yes
9714   else
9715     if test "${ac_cv_have_x+set}" = set; then
9716   echo $ECHO_N "(cached) $ECHO_C" >&6
9717 else
9718   # One or both of the vars are not set, and there is no cached value.
9719 ac_x_includes=no ac_x_libraries=no
9720 rm -fr conftest.dir
9721 if mkdir conftest.dir; then
9722   cd conftest.dir
9723   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9724   cat >Imakefile <<'EOF'
9725 acfindx:
9726         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9727 EOF
9728   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9729     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9730     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9731     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9732     for ac_extension in a so sl dylib dll; do
9733       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9734          test -f $ac_im_libdir/libX11.$ac_extension; then
9735         ac_im_usrlibdir=$ac_im_libdir; break
9736       fi
9737     done
9738     # Screen out bogus values from the imake configuration.  They are
9739     # bogus both because they are the default anyway, and because
9740     # using them would break gcc on systems where it needs fixed includes.
9741     case $ac_im_incroot in
9742         /usr/include) ;;
9743         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9744     esac
9745     case $ac_im_usrlibdir in
9746         /usr/lib | /lib) ;;
9747         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9748     esac
9749   fi
9750   cd ..
9751   rm -fr conftest.dir
9752 fi
9753
9754 # Standard set of common directories for X headers.
9755 # Check X11 before X11Rn because it is often a symlink to the current release.
9756 ac_x_header_dirs='
9757 /usr/X11/include
9758 /usr/X11R6/include
9759 /usr/X11R5/include
9760 /usr/X11R4/include
9761
9762 /usr/include/X11
9763 /usr/include/X11R6
9764 /usr/include/X11R5
9765 /usr/include/X11R4
9766
9767 /usr/local/X11/include
9768 /usr/local/X11R6/include
9769 /usr/local/X11R5/include
9770 /usr/local/X11R4/include
9771
9772 /usr/local/include/X11
9773 /usr/local/include/X11R6
9774 /usr/local/include/X11R5
9775 /usr/local/include/X11R4
9776
9777 /usr/X386/include
9778 /usr/x386/include
9779 /usr/XFree86/include/X11
9780
9781 /usr/include
9782 /usr/local/include
9783 /usr/unsupported/include
9784 /usr/athena/include
9785 /usr/local/x11r5/include
9786 /usr/lpp/Xamples/include
9787
9788 /usr/openwin/include
9789 /usr/openwin/share/include'
9790
9791 if test "$ac_x_includes" = no; then
9792   # Guess where to find include files, by looking for Intrinsic.h.
9793   # First, try using that file with no special directory specified.
9794   cat >conftest.$ac_ext <<_ACEOF
9795 #line 9795 "configure"
9796 #include "confdefs.h"
9797 #include <X11/Intrinsic.h>
9798 _ACEOF
9799 if { (eval echo "$as_me:9799: \"$ac_cpp conftest.$ac_ext\"") >&5
9800   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9801   ac_status=$?
9802   egrep -v '^ *\+' conftest.er1 >conftest.err
9803   rm -f conftest.er1
9804   cat conftest.err >&5
9805   echo "$as_me:9805: \$? = $ac_status" >&5
9806   (exit $ac_status); } >/dev/null; then
9807   if test -s conftest.err; then
9808     ac_cpp_err=$ac_c_preproc_warn_flag
9809   else
9810     ac_cpp_err=
9811   fi
9812 else
9813   ac_cpp_err=yes
9814 fi
9815 if test -z "$ac_cpp_err"; then
9816   # We can compile using X headers with no special include directory.
9817 ac_x_includes=
9818 else
9819   echo "$as_me: failed program was:" >&5
9820   cat conftest.$ac_ext >&5
9821   for ac_dir in $ac_x_header_dirs; do
9822   if test -r "$ac_dir/X11/Intrinsic.h"; then
9823     ac_x_includes=$ac_dir
9824     break
9825   fi
9826 done
9827 fi
9828 rm -f conftest.err conftest.$ac_ext
9829 fi # $ac_x_includes = no
9830
9831 if test "$ac_x_libraries" = no; then
9832   # Check for the libraries.
9833   # See if we find them without any special options.
9834   # Don't add to $LIBS permanently.
9835   ac_save_LIBS=$LIBS
9836   LIBS="-lXt $LIBS"
9837   cat >conftest.$ac_ext <<_ACEOF
9838 #line 9838 "configure"
9839 #include "confdefs.h"
9840 #include <X11/Intrinsic.h>
9841 int
9842 main ()
9843 {
9844 XtMalloc (0)
9845   ;
9846   return 0;
9847 }
9848 _ACEOF
9849 rm -f conftest.$ac_objext conftest$ac_exeext
9850 if { (eval echo "$as_me:9850: \"$ac_link\"") >&5
9851   (eval $ac_link) 2>&5
9852   ac_status=$?
9853   echo "$as_me:9853: \$? = $ac_status" >&5
9854   (exit $ac_status); } &&
9855          { ac_try='test -s conftest$ac_exeext'
9856   { (eval echo "$as_me:9856: \"$ac_try\"") >&5
9857   (eval $ac_try) 2>&5
9858   ac_status=$?
9859   echo "$as_me:9859: \$? = $ac_status" >&5
9860   (exit $ac_status); }; }; then
9861   LIBS=$ac_save_LIBS
9862 # We can link X programs with no special library path.
9863 ac_x_libraries=
9864 else
9865   echo "$as_me: failed program was:" >&5
9866 cat conftest.$ac_ext >&5
9867 LIBS=$ac_save_LIBS
9868 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9869 do
9870   # Don't even attempt the hair of trying to link an X program!
9871   for ac_extension in a so sl dylib dll; do
9872     if test -r $ac_dir/libXt.$ac_extension; then
9873       ac_x_libraries=$ac_dir
9874       break 2
9875     fi
9876   done
9877 done
9878 fi
9879 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9880 fi # $ac_x_libraries = no
9881
9882 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9883   # Didn't find X anywhere.  Cache the known absence of X.
9884   ac_cv_have_x="have_x=no"
9885 else
9886   # Record where we found X for the cache.
9887   ac_cv_have_x="have_x=yes \
9888                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9889 fi
9890 fi
9891
9892   fi
9893   eval "$ac_cv_have_x"
9894 fi # $with_x != no
9895
9896 if test "$have_x" != yes; then
9897   echo "$as_me:9897: result: $have_x" >&5
9898 echo "${ECHO_T}$have_x" >&6
9899   no_x=yes
9900 else
9901   # If each of the values was on the command line, it overrides each guess.
9902   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9903   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9904   # Update the cache value to reflect the command line values.
9905   ac_cv_have_x="have_x=yes \
9906                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9907   echo "$as_me:9907: result: libraries $x_libraries, headers $x_includes" >&5
9908 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9909 fi
9910
9911 if test "$no_x" = yes; then
9912   # Not all programs may use this symbol, but it does not hurt to define it.
9913
9914 cat >>confdefs.h <<\EOF
9915 #define X_DISPLAY_MISSING 1
9916 EOF
9917
9918   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9919 else
9920   if test -n "$x_includes"; then
9921     X_CFLAGS="$X_CFLAGS -I$x_includes"
9922   fi
9923
9924   # It would also be nice to do this for all -L options, not just this one.
9925   if test -n "$x_libraries"; then
9926     X_LIBS="$X_LIBS -L$x_libraries"
9927     # For Solaris; some versions of Sun CC require a space after -R and
9928     # others require no space.  Words are not sufficient . . . .
9929     case `(uname -sr) 2>/dev/null` in
9930     "SunOS 5"*)
9931       echo "$as_me:9931: checking whether -R must be followed by a space" >&5
9932 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9933       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9934       cat >conftest.$ac_ext <<_ACEOF
9935 #line 9935 "configure"
9936 #include "confdefs.h"
9937
9938 int
9939 main ()
9940 {
9941
9942   ;
9943   return 0;
9944 }
9945 _ACEOF
9946 rm -f conftest.$ac_objext conftest$ac_exeext
9947 if { (eval echo "$as_me:9947: \"$ac_link\"") >&5
9948   (eval $ac_link) 2>&5
9949   ac_status=$?
9950   echo "$as_me:9950: \$? = $ac_status" >&5
9951   (exit $ac_status); } &&
9952          { ac_try='test -s conftest$ac_exeext'
9953   { (eval echo "$as_me:9953: \"$ac_try\"") >&5
9954   (eval $ac_try) 2>&5
9955   ac_status=$?
9956   echo "$as_me:9956: \$? = $ac_status" >&5
9957   (exit $ac_status); }; }; then
9958   ac_R_nospace=yes
9959 else
9960   echo "$as_me: failed program was:" >&5
9961 cat conftest.$ac_ext >&5
9962 ac_R_nospace=no
9963 fi
9964 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9965       if test $ac_R_nospace = yes; then
9966         echo "$as_me:9966: result: no" >&5
9967 echo "${ECHO_T}no" >&6
9968         X_LIBS="$X_LIBS -R$x_libraries"
9969       else
9970         LIBS="$ac_xsave_LIBS -R $x_libraries"
9971         cat >conftest.$ac_ext <<_ACEOF
9972 #line 9972 "configure"
9973 #include "confdefs.h"
9974
9975 int
9976 main ()
9977 {
9978
9979   ;
9980   return 0;
9981 }
9982 _ACEOF
9983 rm -f conftest.$ac_objext conftest$ac_exeext
9984 if { (eval echo "$as_me:9984: \"$ac_link\"") >&5
9985   (eval $ac_link) 2>&5
9986   ac_status=$?
9987   echo "$as_me:9987: \$? = $ac_status" >&5
9988   (exit $ac_status); } &&
9989          { ac_try='test -s conftest$ac_exeext'
9990   { (eval echo "$as_me:9990: \"$ac_try\"") >&5
9991   (eval $ac_try) 2>&5
9992   ac_status=$?
9993   echo "$as_me:9993: \$? = $ac_status" >&5
9994   (exit $ac_status); }; }; then
9995   ac_R_space=yes
9996 else
9997   echo "$as_me: failed program was:" >&5
9998 cat conftest.$ac_ext >&5
9999 ac_R_space=no
10000 fi
10001 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10002         if test $ac_R_space = yes; then
10003           echo "$as_me:10003: result: yes" >&5
10004 echo "${ECHO_T}yes" >&6
10005           X_LIBS="$X_LIBS -R $x_libraries"
10006         else
10007           echo "$as_me:10007: result: neither works" >&5
10008 echo "${ECHO_T}neither works" >&6
10009         fi
10010       fi
10011       LIBS=$ac_xsave_LIBS
10012     esac
10013   fi
10014
10015   # Check for system-dependent libraries X programs must link with.
10016   # Do this before checking for the system-independent R6 libraries
10017   # (-lICE), since we may need -lsocket or whatever for X linking.
10018
10019   if test "$ISC" = yes; then
10020     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10021   else
10022     # Martyn Johnson says this is needed for Ultrix, if the X
10023     # libraries were built with DECnet support.  And Karl Berry says
10024     # the Alpha needs dnet_stub (dnet does not exist).
10025     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10026     cat >conftest.$ac_ext <<_ACEOF
10027 #line 10027 "configure"
10028 #include "confdefs.h"
10029
10030 /* Override any gcc2 internal prototype to avoid an error.  */
10031 #ifdef __cplusplus
10032 extern "C"
10033 #endif
10034 /* We use char because int might match the return type of a gcc2
10035    builtin and then its argument prototype would still apply.  */
10036 char XOpenDisplay ();
10037 int
10038 main ()
10039 {
10040 XOpenDisplay ();
10041   ;
10042   return 0;
10043 }
10044 _ACEOF
10045 rm -f conftest.$ac_objext conftest$ac_exeext
10046 if { (eval echo "$as_me:10046: \"$ac_link\"") >&5
10047   (eval $ac_link) 2>&5
10048   ac_status=$?
10049   echo "$as_me:10049: \$? = $ac_status" >&5
10050   (exit $ac_status); } &&
10051          { ac_try='test -s conftest$ac_exeext'
10052   { (eval echo "$as_me:10052: \"$ac_try\"") >&5
10053   (eval $ac_try) 2>&5
10054   ac_status=$?
10055   echo "$as_me:10055: \$? = $ac_status" >&5
10056   (exit $ac_status); }; }; then
10057   :
10058 else
10059   echo "$as_me: failed program was:" >&5
10060 cat conftest.$ac_ext >&5
10061 echo "$as_me:10061: checking for dnet_ntoa in -ldnet" >&5
10062 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10063 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10064   echo $ECHO_N "(cached) $ECHO_C" >&6
10065 else
10066   ac_check_lib_save_LIBS=$LIBS
10067 LIBS="-ldnet  $LIBS"
10068 cat >conftest.$ac_ext <<_ACEOF
10069 #line 10069 "configure"
10070 #include "confdefs.h"
10071
10072 /* Override any gcc2 internal prototype to avoid an error.  */
10073 #ifdef __cplusplus
10074 extern "C"
10075 #endif
10076 /* We use char because int might match the return type of a gcc2
10077    builtin and then its argument prototype would still apply.  */
10078 char dnet_ntoa ();
10079 int
10080 main ()
10081 {
10082 dnet_ntoa ();
10083   ;
10084   return 0;
10085 }
10086 _ACEOF
10087 rm -f conftest.$ac_objext conftest$ac_exeext
10088 if { (eval echo "$as_me:10088: \"$ac_link\"") >&5
10089   (eval $ac_link) 2>&5
10090   ac_status=$?
10091   echo "$as_me:10091: \$? = $ac_status" >&5
10092   (exit $ac_status); } &&
10093          { ac_try='test -s conftest$ac_exeext'
10094   { (eval echo "$as_me:10094: \"$ac_try\"") >&5
10095   (eval $ac_try) 2>&5
10096   ac_status=$?
10097   echo "$as_me:10097: \$? = $ac_status" >&5
10098   (exit $ac_status); }; }; then
10099   ac_cv_lib_dnet_dnet_ntoa=yes
10100 else
10101   echo "$as_me: failed program was:" >&5
10102 cat conftest.$ac_ext >&5
10103 ac_cv_lib_dnet_dnet_ntoa=no
10104 fi
10105 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10106 LIBS=$ac_check_lib_save_LIBS
10107 fi
10108 echo "$as_me:10108: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10109 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10110 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10111   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10112 fi
10113
10114     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10115       echo "$as_me:10115: checking for dnet_ntoa in -ldnet_stub" >&5
10116 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10117 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10118   echo $ECHO_N "(cached) $ECHO_C" >&6
10119 else
10120   ac_check_lib_save_LIBS=$LIBS
10121 LIBS="-ldnet_stub  $LIBS"
10122 cat >conftest.$ac_ext <<_ACEOF
10123 #line 10123 "configure"
10124 #include "confdefs.h"
10125
10126 /* Override any gcc2 internal prototype to avoid an error.  */
10127 #ifdef __cplusplus
10128 extern "C"
10129 #endif
10130 /* We use char because int might match the return type of a gcc2
10131    builtin and then its argument prototype would still apply.  */
10132 char dnet_ntoa ();
10133 int
10134 main ()
10135 {
10136 dnet_ntoa ();
10137   ;
10138   return 0;
10139 }
10140 _ACEOF
10141 rm -f conftest.$ac_objext conftest$ac_exeext
10142 if { (eval echo "$as_me:10142: \"$ac_link\"") >&5
10143   (eval $ac_link) 2>&5
10144   ac_status=$?
10145   echo "$as_me:10145: \$? = $ac_status" >&5
10146   (exit $ac_status); } &&
10147          { ac_try='test -s conftest$ac_exeext'
10148   { (eval echo "$as_me:10148: \"$ac_try\"") >&5
10149   (eval $ac_try) 2>&5
10150   ac_status=$?
10151   echo "$as_me:10151: \$? = $ac_status" >&5
10152   (exit $ac_status); }; }; then
10153   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10154 else
10155   echo "$as_me: failed program was:" >&5
10156 cat conftest.$ac_ext >&5
10157 ac_cv_lib_dnet_stub_dnet_ntoa=no
10158 fi
10159 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10160 LIBS=$ac_check_lib_save_LIBS
10161 fi
10162 echo "$as_me:10162: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10163 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10164 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10165   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10166 fi
10167
10168     fi
10169 fi
10170 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10171     LIBS="$ac_xsave_LIBS"
10172
10173     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10174     # to get the SysV transport functions.
10175     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10176     # needs -lnsl.
10177     # The nsl library prevents programs from opening the X display
10178     # on Irix 5.2, according to T.E. Dickey.
10179     # The functions gethostbyname, getservbyname, and inet_addr are
10180     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10181     echo "$as_me:10181: checking for gethostbyname" >&5
10182 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10183 if test "${ac_cv_func_gethostbyname+set}" = set; then
10184   echo $ECHO_N "(cached) $ECHO_C" >&6
10185 else
10186   cat >conftest.$ac_ext <<_ACEOF
10187 #line 10187 "configure"
10188 #include "confdefs.h"
10189 /* System header to define __stub macros and hopefully few prototypes,
10190     which can conflict with char gethostbyname (); below.  */
10191 #include <assert.h>
10192 /* Override any gcc2 internal prototype to avoid an error.  */
10193 #ifdef __cplusplus
10194 extern "C"
10195 #endif
10196 /* We use char because int might match the return type of a gcc2
10197    builtin and then its argument prototype would still apply.  */
10198 char gethostbyname ();
10199 char (*f) ();
10200
10201 int
10202 main ()
10203 {
10204 /* The GNU C library defines this for functions which it implements
10205     to always fail with ENOSYS.  Some functions are actually named
10206     something starting with __ and the normal name is an alias.  */
10207 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10208 choke me
10209 #else
10210 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10211 #endif
10212
10213   ;
10214   return 0;
10215 }
10216 _ACEOF
10217 rm -f conftest.$ac_objext conftest$ac_exeext
10218 if { (eval echo "$as_me:10218: \"$ac_link\"") >&5
10219   (eval $ac_link) 2>&5
10220   ac_status=$?
10221   echo "$as_me:10221: \$? = $ac_status" >&5
10222   (exit $ac_status); } &&
10223          { ac_try='test -s conftest$ac_exeext'
10224   { (eval echo "$as_me:10224: \"$ac_try\"") >&5
10225   (eval $ac_try) 2>&5
10226   ac_status=$?
10227   echo "$as_me:10227: \$? = $ac_status" >&5
10228   (exit $ac_status); }; }; then
10229   ac_cv_func_gethostbyname=yes
10230 else
10231   echo "$as_me: failed program was:" >&5
10232 cat conftest.$ac_ext >&5
10233 ac_cv_func_gethostbyname=no
10234 fi
10235 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10236 fi
10237 echo "$as_me:10237: result: $ac_cv_func_gethostbyname" >&5
10238 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10239
10240     if test $ac_cv_func_gethostbyname = no; then
10241       echo "$as_me:10241: checking for gethostbyname in -lnsl" >&5
10242 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10243 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10244   echo $ECHO_N "(cached) $ECHO_C" >&6
10245 else
10246   ac_check_lib_save_LIBS=$LIBS
10247 LIBS="-lnsl  $LIBS"
10248 cat >conftest.$ac_ext <<_ACEOF
10249 #line 10249 "configure"
10250 #include "confdefs.h"
10251
10252 /* Override any gcc2 internal prototype to avoid an error.  */
10253 #ifdef __cplusplus
10254 extern "C"
10255 #endif
10256 /* We use char because int might match the return type of a gcc2
10257    builtin and then its argument prototype would still apply.  */
10258 char gethostbyname ();
10259 int
10260 main ()
10261 {
10262 gethostbyname ();
10263   ;
10264   return 0;
10265 }
10266 _ACEOF
10267 rm -f conftest.$ac_objext conftest$ac_exeext
10268 if { (eval echo "$as_me:10268: \"$ac_link\"") >&5
10269   (eval $ac_link) 2>&5
10270   ac_status=$?
10271   echo "$as_me:10271: \$? = $ac_status" >&5
10272   (exit $ac_status); } &&
10273          { ac_try='test -s conftest$ac_exeext'
10274   { (eval echo "$as_me:10274: \"$ac_try\"") >&5
10275   (eval $ac_try) 2>&5
10276   ac_status=$?
10277   echo "$as_me:10277: \$? = $ac_status" >&5
10278   (exit $ac_status); }; }; then
10279   ac_cv_lib_nsl_gethostbyname=yes
10280 else
10281   echo "$as_me: failed program was:" >&5
10282 cat conftest.$ac_ext >&5
10283 ac_cv_lib_nsl_gethostbyname=no
10284 fi
10285 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10286 LIBS=$ac_check_lib_save_LIBS
10287 fi
10288 echo "$as_me:10288: result: $ac_cv_lib_nsl_gethostbyname" >&5
10289 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10290 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10291   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10292 fi
10293
10294       if test $ac_cv_lib_nsl_gethostbyname = no; then
10295         echo "$as_me:10295: checking for gethostbyname in -lbsd" >&5
10296 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10297 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10298   echo $ECHO_N "(cached) $ECHO_C" >&6
10299 else
10300   ac_check_lib_save_LIBS=$LIBS
10301 LIBS="-lbsd  $LIBS"
10302 cat >conftest.$ac_ext <<_ACEOF
10303 #line 10303 "configure"
10304 #include "confdefs.h"
10305
10306 /* Override any gcc2 internal prototype to avoid an error.  */
10307 #ifdef __cplusplus
10308 extern "C"
10309 #endif
10310 /* We use char because int might match the return type of a gcc2
10311    builtin and then its argument prototype would still apply.  */
10312 char gethostbyname ();
10313 int
10314 main ()
10315 {
10316 gethostbyname ();
10317   ;
10318   return 0;
10319 }
10320 _ACEOF
10321 rm -f conftest.$ac_objext conftest$ac_exeext
10322 if { (eval echo "$as_me:10322: \"$ac_link\"") >&5
10323   (eval $ac_link) 2>&5
10324   ac_status=$?
10325   echo "$as_me:10325: \$? = $ac_status" >&5
10326   (exit $ac_status); } &&
10327          { ac_try='test -s conftest$ac_exeext'
10328   { (eval echo "$as_me:10328: \"$ac_try\"") >&5
10329   (eval $ac_try) 2>&5
10330   ac_status=$?
10331   echo "$as_me:10331: \$? = $ac_status" >&5
10332   (exit $ac_status); }; }; then
10333   ac_cv_lib_bsd_gethostbyname=yes
10334 else
10335   echo "$as_me: failed program was:" >&5
10336 cat conftest.$ac_ext >&5
10337 ac_cv_lib_bsd_gethostbyname=no
10338 fi
10339 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10340 LIBS=$ac_check_lib_save_LIBS
10341 fi
10342 echo "$as_me:10342: result: $ac_cv_lib_bsd_gethostbyname" >&5
10343 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10344 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10345   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10346 fi
10347
10348       fi
10349     fi
10350
10351     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10352     # socket/setsockopt and other routines are undefined under SCO ODT
10353     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10354     # on later versions), says Simon Leinen: it contains gethostby*
10355     # variants that don't use the nameserver (or something).  -lsocket
10356     # must be given before -lnsl if both are needed.  We assume that
10357     # if connect needs -lnsl, so does gethostbyname.
10358     echo "$as_me:10358: checking for connect" >&5
10359 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10360 if test "${ac_cv_func_connect+set}" = set; then
10361   echo $ECHO_N "(cached) $ECHO_C" >&6
10362 else
10363   cat >conftest.$ac_ext <<_ACEOF
10364 #line 10364 "configure"
10365 #include "confdefs.h"
10366 /* System header to define __stub macros and hopefully few prototypes,
10367     which can conflict with char connect (); below.  */
10368 #include <assert.h>
10369 /* Override any gcc2 internal prototype to avoid an error.  */
10370 #ifdef __cplusplus
10371 extern "C"
10372 #endif
10373 /* We use char because int might match the return type of a gcc2
10374    builtin and then its argument prototype would still apply.  */
10375 char connect ();
10376 char (*f) ();
10377
10378 int
10379 main ()
10380 {
10381 /* The GNU C library defines this for functions which it implements
10382     to always fail with ENOSYS.  Some functions are actually named
10383     something starting with __ and the normal name is an alias.  */
10384 #if defined (__stub_connect) || defined (__stub___connect)
10385 choke me
10386 #else
10387 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10388 #endif
10389
10390   ;
10391   return 0;
10392 }
10393 _ACEOF
10394 rm -f conftest.$ac_objext conftest$ac_exeext
10395 if { (eval echo "$as_me:10395: \"$ac_link\"") >&5
10396   (eval $ac_link) 2>&5
10397   ac_status=$?
10398   echo "$as_me:10398: \$? = $ac_status" >&5
10399   (exit $ac_status); } &&
10400          { ac_try='test -s conftest$ac_exeext'
10401   { (eval echo "$as_me:10401: \"$ac_try\"") >&5
10402   (eval $ac_try) 2>&5
10403   ac_status=$?
10404   echo "$as_me:10404: \$? = $ac_status" >&5
10405   (exit $ac_status); }; }; then
10406   ac_cv_func_connect=yes
10407 else
10408   echo "$as_me: failed program was:" >&5
10409 cat conftest.$ac_ext >&5
10410 ac_cv_func_connect=no
10411 fi
10412 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10413 fi
10414 echo "$as_me:10414: result: $ac_cv_func_connect" >&5
10415 echo "${ECHO_T}$ac_cv_func_connect" >&6
10416
10417     if test $ac_cv_func_connect = no; then
10418       echo "$as_me:10418: checking for connect in -lsocket" >&5
10419 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10420 if test "${ac_cv_lib_socket_connect+set}" = set; then
10421   echo $ECHO_N "(cached) $ECHO_C" >&6
10422 else
10423   ac_check_lib_save_LIBS=$LIBS
10424 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10425 cat >conftest.$ac_ext <<_ACEOF
10426 #line 10426 "configure"
10427 #include "confdefs.h"
10428
10429 /* Override any gcc2 internal prototype to avoid an error.  */
10430 #ifdef __cplusplus
10431 extern "C"
10432 #endif
10433 /* We use char because int might match the return type of a gcc2
10434    builtin and then its argument prototype would still apply.  */
10435 char connect ();
10436 int
10437 main ()
10438 {
10439 connect ();
10440   ;
10441   return 0;
10442 }
10443 _ACEOF
10444 rm -f conftest.$ac_objext conftest$ac_exeext
10445 if { (eval echo "$as_me:10445: \"$ac_link\"") >&5
10446   (eval $ac_link) 2>&5
10447   ac_status=$?
10448   echo "$as_me:10448: \$? = $ac_status" >&5
10449   (exit $ac_status); } &&
10450          { ac_try='test -s conftest$ac_exeext'
10451   { (eval echo "$as_me:10451: \"$ac_try\"") >&5
10452   (eval $ac_try) 2>&5
10453   ac_status=$?
10454   echo "$as_me:10454: \$? = $ac_status" >&5
10455   (exit $ac_status); }; }; then
10456   ac_cv_lib_socket_connect=yes
10457 else
10458   echo "$as_me: failed program was:" >&5
10459 cat conftest.$ac_ext >&5
10460 ac_cv_lib_socket_connect=no
10461 fi
10462 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10463 LIBS=$ac_check_lib_save_LIBS
10464 fi
10465 echo "$as_me:10465: result: $ac_cv_lib_socket_connect" >&5
10466 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10467 if test $ac_cv_lib_socket_connect = yes; then
10468   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10469 fi
10470
10471     fi
10472
10473     # Guillermo Gomez says -lposix is necessary on A/UX.
10474     echo "$as_me:10474: checking for remove" >&5
10475 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10476 if test "${ac_cv_func_remove+set}" = set; then
10477   echo $ECHO_N "(cached) $ECHO_C" >&6
10478 else
10479   cat >conftest.$ac_ext <<_ACEOF
10480 #line 10480 "configure"
10481 #include "confdefs.h"
10482 /* System header to define __stub macros and hopefully few prototypes,
10483     which can conflict with char remove (); below.  */
10484 #include <assert.h>
10485 /* Override any gcc2 internal prototype to avoid an error.  */
10486 #ifdef __cplusplus
10487 extern "C"
10488 #endif
10489 /* We use char because int might match the return type of a gcc2
10490    builtin and then its argument prototype would still apply.  */
10491 char remove ();
10492 char (*f) ();
10493
10494 int
10495 main ()
10496 {
10497 /* The GNU C library defines this for functions which it implements
10498     to always fail with ENOSYS.  Some functions are actually named
10499     something starting with __ and the normal name is an alias.  */
10500 #if defined (__stub_remove) || defined (__stub___remove)
10501 choke me
10502 #else
10503 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10504 #endif
10505
10506   ;
10507   return 0;
10508 }
10509 _ACEOF
10510 rm -f conftest.$ac_objext conftest$ac_exeext
10511 if { (eval echo "$as_me:10511: \"$ac_link\"") >&5
10512   (eval $ac_link) 2>&5
10513   ac_status=$?
10514   echo "$as_me:10514: \$? = $ac_status" >&5
10515   (exit $ac_status); } &&
10516          { ac_try='test -s conftest$ac_exeext'
10517   { (eval echo "$as_me:10517: \"$ac_try\"") >&5
10518   (eval $ac_try) 2>&5
10519   ac_status=$?
10520   echo "$as_me:10520: \$? = $ac_status" >&5
10521   (exit $ac_status); }; }; then
10522   ac_cv_func_remove=yes
10523 else
10524   echo "$as_me: failed program was:" >&5
10525 cat conftest.$ac_ext >&5
10526 ac_cv_func_remove=no
10527 fi
10528 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10529 fi
10530 echo "$as_me:10530: result: $ac_cv_func_remove" >&5
10531 echo "${ECHO_T}$ac_cv_func_remove" >&6
10532
10533     if test $ac_cv_func_remove = no; then
10534       echo "$as_me:10534: checking for remove in -lposix" >&5
10535 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10536 if test "${ac_cv_lib_posix_remove+set}" = set; then
10537   echo $ECHO_N "(cached) $ECHO_C" >&6
10538 else
10539   ac_check_lib_save_LIBS=$LIBS
10540 LIBS="-lposix  $LIBS"
10541 cat >conftest.$ac_ext <<_ACEOF
10542 #line 10542 "configure"
10543 #include "confdefs.h"
10544
10545 /* Override any gcc2 internal prototype to avoid an error.  */
10546 #ifdef __cplusplus
10547 extern "C"
10548 #endif
10549 /* We use char because int might match the return type of a gcc2
10550    builtin and then its argument prototype would still apply.  */
10551 char remove ();
10552 int
10553 main ()
10554 {
10555 remove ();
10556   ;
10557   return 0;
10558 }
10559 _ACEOF
10560 rm -f conftest.$ac_objext conftest$ac_exeext
10561 if { (eval echo "$as_me:10561: \"$ac_link\"") >&5
10562   (eval $ac_link) 2>&5
10563   ac_status=$?
10564   echo "$as_me:10564: \$? = $ac_status" >&5
10565   (exit $ac_status); } &&
10566          { ac_try='test -s conftest$ac_exeext'
10567   { (eval echo "$as_me:10567: \"$ac_try\"") >&5
10568   (eval $ac_try) 2>&5
10569   ac_status=$?
10570   echo "$as_me:10570: \$? = $ac_status" >&5
10571   (exit $ac_status); }; }; then
10572   ac_cv_lib_posix_remove=yes
10573 else
10574   echo "$as_me: failed program was:" >&5
10575 cat conftest.$ac_ext >&5
10576 ac_cv_lib_posix_remove=no
10577 fi
10578 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10579 LIBS=$ac_check_lib_save_LIBS
10580 fi
10581 echo "$as_me:10581: result: $ac_cv_lib_posix_remove" >&5
10582 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10583 if test $ac_cv_lib_posix_remove = yes; then
10584   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10585 fi
10586
10587     fi
10588
10589     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10590     echo "$as_me:10590: checking for shmat" >&5
10591 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10592 if test "${ac_cv_func_shmat+set}" = set; then
10593   echo $ECHO_N "(cached) $ECHO_C" >&6
10594 else
10595   cat >conftest.$ac_ext <<_ACEOF
10596 #line 10596 "configure"
10597 #include "confdefs.h"
10598 /* System header to define __stub macros and hopefully few prototypes,
10599     which can conflict with char shmat (); below.  */
10600 #include <assert.h>
10601 /* Override any gcc2 internal prototype to avoid an error.  */
10602 #ifdef __cplusplus
10603 extern "C"
10604 #endif
10605 /* We use char because int might match the return type of a gcc2
10606    builtin and then its argument prototype would still apply.  */
10607 char shmat ();
10608 char (*f) ();
10609
10610 int
10611 main ()
10612 {
10613 /* The GNU C library defines this for functions which it implements
10614     to always fail with ENOSYS.  Some functions are actually named
10615     something starting with __ and the normal name is an alias.  */
10616 #if defined (__stub_shmat) || defined (__stub___shmat)
10617 choke me
10618 #else
10619 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10620 #endif
10621
10622   ;
10623   return 0;
10624 }
10625 _ACEOF
10626 rm -f conftest.$ac_objext conftest$ac_exeext
10627 if { (eval echo "$as_me:10627: \"$ac_link\"") >&5
10628   (eval $ac_link) 2>&5
10629   ac_status=$?
10630   echo "$as_me:10630: \$? = $ac_status" >&5
10631   (exit $ac_status); } &&
10632          { ac_try='test -s conftest$ac_exeext'
10633   { (eval echo "$as_me:10633: \"$ac_try\"") >&5
10634   (eval $ac_try) 2>&5
10635   ac_status=$?
10636   echo "$as_me:10636: \$? = $ac_status" >&5
10637   (exit $ac_status); }; }; then
10638   ac_cv_func_shmat=yes
10639 else
10640   echo "$as_me: failed program was:" >&5
10641 cat conftest.$ac_ext >&5
10642 ac_cv_func_shmat=no
10643 fi
10644 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10645 fi
10646 echo "$as_me:10646: result: $ac_cv_func_shmat" >&5
10647 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10648
10649     if test $ac_cv_func_shmat = no; then
10650       echo "$as_me:10650: checking for shmat in -lipc" >&5
10651 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10652 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10653   echo $ECHO_N "(cached) $ECHO_C" >&6
10654 else
10655   ac_check_lib_save_LIBS=$LIBS
10656 LIBS="-lipc  $LIBS"
10657 cat >conftest.$ac_ext <<_ACEOF
10658 #line 10658 "configure"
10659 #include "confdefs.h"
10660
10661 /* Override any gcc2 internal prototype to avoid an error.  */
10662 #ifdef __cplusplus
10663 extern "C"
10664 #endif
10665 /* We use char because int might match the return type of a gcc2
10666    builtin and then its argument prototype would still apply.  */
10667 char shmat ();
10668 int
10669 main ()
10670 {
10671 shmat ();
10672   ;
10673   return 0;
10674 }
10675 _ACEOF
10676 rm -f conftest.$ac_objext conftest$ac_exeext
10677 if { (eval echo "$as_me:10677: \"$ac_link\"") >&5
10678   (eval $ac_link) 2>&5
10679   ac_status=$?
10680   echo "$as_me:10680: \$? = $ac_status" >&5
10681   (exit $ac_status); } &&
10682          { ac_try='test -s conftest$ac_exeext'
10683   { (eval echo "$as_me:10683: \"$ac_try\"") >&5
10684   (eval $ac_try) 2>&5
10685   ac_status=$?
10686   echo "$as_me:10686: \$? = $ac_status" >&5
10687   (exit $ac_status); }; }; then
10688   ac_cv_lib_ipc_shmat=yes
10689 else
10690   echo "$as_me: failed program was:" >&5
10691 cat conftest.$ac_ext >&5
10692 ac_cv_lib_ipc_shmat=no
10693 fi
10694 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10695 LIBS=$ac_check_lib_save_LIBS
10696 fi
10697 echo "$as_me:10697: result: $ac_cv_lib_ipc_shmat" >&5
10698 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10699 if test $ac_cv_lib_ipc_shmat = yes; then
10700   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10701 fi
10702
10703     fi
10704   fi
10705
10706   # Check for libraries that X11R6 Xt/Xaw programs need.
10707   ac_save_LDFLAGS=$LDFLAGS
10708   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10709   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10710   # check for ICE first), but we must link in the order -lSM -lICE or
10711   # we get undefined symbols.  So assume we have SM if we have ICE.
10712   # These have to be linked with before -lX11, unlike the other
10713   # libraries we check for below, so use a different variable.
10714   # John Interrante, Karl Berry
10715   echo "$as_me:10715: checking for IceConnectionNumber in -lICE" >&5
10716 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10717 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10718   echo $ECHO_N "(cached) $ECHO_C" >&6
10719 else
10720   ac_check_lib_save_LIBS=$LIBS
10721 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10722 cat >conftest.$ac_ext <<_ACEOF
10723 #line 10723 "configure"
10724 #include "confdefs.h"
10725
10726 /* Override any gcc2 internal prototype to avoid an error.  */
10727 #ifdef __cplusplus
10728 extern "C"
10729 #endif
10730 /* We use char because int might match the return type of a gcc2
10731    builtin and then its argument prototype would still apply.  */
10732 char IceConnectionNumber ();
10733 int
10734 main ()
10735 {
10736 IceConnectionNumber ();
10737   ;
10738   return 0;
10739 }
10740 _ACEOF
10741 rm -f conftest.$ac_objext conftest$ac_exeext
10742 if { (eval echo "$as_me:10742: \"$ac_link\"") >&5
10743   (eval $ac_link) 2>&5
10744   ac_status=$?
10745   echo "$as_me:10745: \$? = $ac_status" >&5
10746   (exit $ac_status); } &&
10747          { ac_try='test -s conftest$ac_exeext'
10748   { (eval echo "$as_me:10748: \"$ac_try\"") >&5
10749   (eval $ac_try) 2>&5
10750   ac_status=$?
10751   echo "$as_me:10751: \$? = $ac_status" >&5
10752   (exit $ac_status); }; }; then
10753   ac_cv_lib_ICE_IceConnectionNumber=yes
10754 else
10755   echo "$as_me: failed program was:" >&5
10756 cat conftest.$ac_ext >&5
10757 ac_cv_lib_ICE_IceConnectionNumber=no
10758 fi
10759 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10760 LIBS=$ac_check_lib_save_LIBS
10761 fi
10762 echo "$as_me:10762: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10763 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10764 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10765   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10766 fi
10767
10768   LDFLAGS=$ac_save_LDFLAGS
10769
10770 fi
10771
10772 cf_x_athena=${cf_x_athena:-Xaw}
10773
10774 echo "$as_me:10774: checking if you want to link with Xaw 3d library" >&5
10775 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10776 withval=
10777
10778 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10779 if test "${with_Xaw3d+set}" = set; then
10780   withval="$with_Xaw3d"
10781
10782 fi;
10783 if test "$withval" = yes ; then
10784         cf_x_athena=Xaw3d
10785         echo "$as_me:10785: result: yes" >&5
10786 echo "${ECHO_T}yes" >&6
10787 else
10788         echo "$as_me:10788: result: no" >&5
10789 echo "${ECHO_T}no" >&6
10790 fi
10791
10792 echo "$as_me:10792: checking if you want to link with Xaw 3d xft library" >&5
10793 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
10794 withval=
10795
10796 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
10797 if test "${with_Xaw3dxft+set}" = set; then
10798   withval="$with_Xaw3dxft"
10799
10800 fi;
10801 if test "$withval" = yes ; then
10802         cf_x_athena=Xaw3dxft
10803         echo "$as_me:10803: result: yes" >&5
10804 echo "${ECHO_T}yes" >&6
10805 else
10806         echo "$as_me:10806: result: no" >&5
10807 echo "${ECHO_T}no" >&6
10808 fi
10809
10810 echo "$as_me:10810: checking if you want to link with neXT Athena library" >&5
10811 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10812 withval=
10813
10814 # Check whether --with-neXtaw or --without-neXtaw was given.
10815 if test "${with_neXtaw+set}" = set; then
10816   withval="$with_neXtaw"
10817
10818 fi;
10819 if test "$withval" = yes ; then
10820         cf_x_athena=neXtaw
10821         echo "$as_me:10821: result: yes" >&5
10822 echo "${ECHO_T}yes" >&6
10823 else
10824         echo "$as_me:10824: result: no" >&5
10825 echo "${ECHO_T}no" >&6
10826 fi
10827
10828 echo "$as_me:10828: checking if you want to link with Athena-Plus library" >&5
10829 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10830 withval=
10831
10832 # Check whether --with-XawPlus or --without-XawPlus was given.
10833 if test "${with_XawPlus+set}" = set; then
10834   withval="$with_XawPlus"
10835
10836 fi;
10837 if test "$withval" = yes ; then
10838         cf_x_athena=XawPlus
10839         echo "$as_me:10839: result: yes" >&5
10840 echo "${ECHO_T}yes" >&6
10841 else
10842         echo "$as_me:10842: result: no" >&5
10843 echo "${ECHO_T}no" >&6
10844 fi
10845
10846 cf_x_athena_lib=""
10847
10848 if test "$PKG_CONFIG" != none ; then
10849         cf_athena_list=
10850         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10851         for cf_athena_pkg in \
10852                 $cf_athena_list \
10853                 ${cf_x_athena} \
10854                 ${cf_x_athena}-devel \
10855                 lib${cf_x_athena} \
10856                 lib${cf_x_athena}-devel
10857         do
10858
10859 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10860         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10861
10862 echo "${as_me:-configure}:10862: testing found package $cf_athena_pkg ..." 1>&5
10863
10864         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10865         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10866         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10867
10868 echo "${as_me:-configure}:10868: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10869
10870         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10871
10872 echo "${as_me:-configure}:10872: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10873
10874 cf_fix_cppflags=no
10875 cf_new_cflags=
10876 cf_new_cppflags=
10877 cf_new_extra_cppflags=
10878
10879 for cf_add_cflags in $cf_pkgconfig_incs
10880 do
10881 case $cf_fix_cppflags in
10882 (no)
10883         case $cf_add_cflags in
10884         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10885                 case $cf_add_cflags in
10886                 (-D*)
10887                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10888
10889                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10890                                 && test -z "${cf_tst_cflags}" \
10891                                 && cf_fix_cppflags=yes
10892
10893                         if test $cf_fix_cppflags = yes ; then
10894                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10895                                 continue
10896                         elif test "${cf_tst_cflags}" = "\"'" ; then
10897                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10898                                 continue
10899                         fi
10900                         ;;
10901                 esac
10902                 case "$CPPFLAGS" in
10903                 (*$cf_add_cflags)
10904                         ;;
10905                 (*)
10906                         case $cf_add_cflags in
10907                         (-D*)
10908                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10909
10910 CPPFLAGS=`echo "$CPPFLAGS" | \
10911         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10912                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10913
10914                                 ;;
10915                         esac
10916                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10917                         ;;
10918                 esac
10919                 ;;
10920         (*)
10921                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10922                 ;;
10923         esac
10924         ;;
10925 (yes)
10926         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10927
10928         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10929
10930         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10931                 && test -z "${cf_tst_cflags}" \
10932                 && cf_fix_cppflags=no
10933         ;;
10934 esac
10935 done
10936
10937 if test -n "$cf_new_cflags" ; then
10938
10939         CFLAGS="$CFLAGS $cf_new_cflags"
10940 fi
10941
10942 if test -n "$cf_new_cppflags" ; then
10943
10944         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10945 fi
10946
10947 if test -n "$cf_new_extra_cppflags" ; then
10948
10949         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10950 fi
10951
10952 cf_add_libs="$cf_pkgconfig_libs"
10953 # Filter out duplicates - this happens with badly-designed ".pc" files...
10954 for cf_add_1lib in $LIBS
10955 do
10956         for cf_add_2lib in $cf_add_libs
10957         do
10958                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10959                 then
10960                         cf_add_1lib=
10961                         break
10962                 fi
10963         done
10964         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10965 done
10966 LIBS="$cf_add_libs"
10967
10968                         cf_x_athena_lib="$cf_pkgconfig_libs"
10969
10970 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10971
10972                         cat >>confdefs.h <<EOF
10973 #define $cf_x_athena_LIBS 1
10974 EOF
10975
10976         for cf_trim_lib in Xmu Xt X11
10977         do
10978                 case "$LIBS" in
10979                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10980                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10981                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10982
10983 echo "${as_me:-configure}:10983: testing ..trimmed $LIBS ..." 1>&5
10984
10985                         ;;
10986                 esac
10987         done
10988
10989 echo "$as_me:10989: checking for usable $cf_x_athena/Xmu package" >&5
10990 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10991 if test "${cf_cv_xaw_compat+set}" = set; then
10992   echo $ECHO_N "(cached) $ECHO_C" >&6
10993 else
10994
10995 cat >conftest.$ac_ext <<_ACEOF
10996 #line 10996 "configure"
10997 #include "confdefs.h"
10998
10999 #include <X11/Xmu/CharSet.h>
11000
11001 int
11002 main ()
11003 {
11004
11005 int check = XmuCompareISOLatin1("big", "small")
11006
11007   ;
11008   return 0;
11009 }
11010 _ACEOF
11011 rm -f conftest.$ac_objext conftest$ac_exeext
11012 if { (eval echo "$as_me:11012: \"$ac_link\"") >&5
11013   (eval $ac_link) 2>&5
11014   ac_status=$?
11015   echo "$as_me:11015: \$? = $ac_status" >&5
11016   (exit $ac_status); } &&
11017          { ac_try='test -s conftest$ac_exeext'
11018   { (eval echo "$as_me:11018: \"$ac_try\"") >&5
11019   (eval $ac_try) 2>&5
11020   ac_status=$?
11021   echo "$as_me:11021: \$? = $ac_status" >&5
11022   (exit $ac_status); }; }; then
11023   cf_cv_xaw_compat=yes
11024 else
11025   echo "$as_me: failed program was:" >&5
11026 cat conftest.$ac_ext >&5
11027 cf_cv_xaw_compat=no
11028 fi
11029 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11030 fi
11031 echo "$as_me:11031: result: $cf_cv_xaw_compat" >&5
11032 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11033
11034                         if test "$cf_cv_xaw_compat" = no
11035                         then
11036                                 # workaround for broken ".pc" files...
11037                                 case "$cf_x_athena_lib" in
11038                                 (*-lXmu*)
11039                                         ;;
11040                                 (*)
11041                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11042
11043 echo "${as_me:-configure}:11043: testing work around broken package ..." 1>&5
11044
11045                                         cf_save_xmu="$LIBS"
11046                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
11047
11048 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11049         test -n "$verbose" && echo "    found package xmu" 1>&6
11050
11051 echo "${as_me:-configure}:11051: testing found package xmu ..." 1>&5
11052
11053         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11054         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11055         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11056
11057 echo "${as_me:-configure}:11057: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11058
11059         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11060
11061 echo "${as_me:-configure}:11061: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11062
11063 cf_fix_cppflags=no
11064 cf_new_cflags=
11065 cf_new_cppflags=
11066 cf_new_extra_cppflags=
11067
11068 for cf_add_cflags in $cf_pkgconfig_incs
11069 do
11070 case $cf_fix_cppflags in
11071 (no)
11072         case $cf_add_cflags in
11073         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11074                 case $cf_add_cflags in
11075                 (-D*)
11076                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11077
11078                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11079                                 && test -z "${cf_tst_cflags}" \
11080                                 && cf_fix_cppflags=yes
11081
11082                         if test $cf_fix_cppflags = yes ; then
11083                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11084                                 continue
11085                         elif test "${cf_tst_cflags}" = "\"'" ; then
11086                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11087                                 continue
11088                         fi
11089                         ;;
11090                 esac
11091                 case "$CPPFLAGS" in
11092                 (*$cf_add_cflags)
11093                         ;;
11094                 (*)
11095                         case $cf_add_cflags in
11096                         (-D*)
11097                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11098
11099 CPPFLAGS=`echo "$CPPFLAGS" | \
11100         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11101                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11102
11103                                 ;;
11104                         esac
11105                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11106                         ;;
11107                 esac
11108                 ;;
11109         (*)
11110                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11111                 ;;
11112         esac
11113         ;;
11114 (yes)
11115         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11116
11117         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11118
11119         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11120                 && test -z "${cf_tst_cflags}" \
11121                 && cf_fix_cppflags=no
11122         ;;
11123 esac
11124 done
11125
11126 if test -n "$cf_new_cflags" ; then
11127
11128         CFLAGS="$CFLAGS $cf_new_cflags"
11129 fi
11130
11131 if test -n "$cf_new_cppflags" ; then
11132
11133         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11134 fi
11135
11136 if test -n "$cf_new_extra_cppflags" ; then
11137
11138         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11139 fi
11140
11141 cf_add_libs="$cf_pkgconfig_libs"
11142 # Filter out duplicates - this happens with badly-designed ".pc" files...
11143 for cf_add_1lib in $LIBS
11144 do
11145         for cf_add_2lib in $cf_add_libs
11146         do
11147                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11148                 then
11149                         cf_add_1lib=
11150                         break
11151                 fi
11152         done
11153         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11154 done
11155 LIBS="$cf_add_libs"
11156
11157                                                         LIBS="$cf_save_xmu"
11158
11159 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11160
11161 echo "${as_me:-configure}:11161: testing ...before $LIBS ..." 1>&5
11162
11163 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
11164 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11165
11166 echo "${as_me:-configure}:11166: testing ...after  $LIBS ..." 1>&5
11167
11168 else
11169         cf_pkgconfig_incs=
11170         cf_pkgconfig_libs=
11171
11172 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11173
11174 echo "${as_me:-configure}:11174: testing ...before $LIBS ..." 1>&5
11175
11176 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
11177 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11178
11179 echo "${as_me:-configure}:11179: testing ...after  $LIBS ..." 1>&5
11180
11181 fi
11182
11183         for cf_trim_lib in Xmu Xt X11
11184         do
11185                 case "$LIBS" in
11186                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11187                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11188                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11189
11190 echo "${as_me:-configure}:11190: testing ..trimmed $LIBS ..." 1>&5
11191
11192                         ;;
11193                 esac
11194         done
11195
11196                                         ;;
11197                                 esac
11198                         fi
11199
11200                         break
11201 else
11202         cf_pkgconfig_incs=
11203         cf_pkgconfig_libs=
11204         :
11205 fi
11206
11207         done
11208 fi
11209
11210 if test -z "$cf_x_athena_lib" ; then
11211
11212 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11213         test -n "$verbose" && echo "    found package Xext" 1>&6
11214
11215 echo "${as_me:-configure}:11215: testing found package Xext ..." 1>&5
11216
11217         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11218         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11219         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11220
11221 echo "${as_me:-configure}:11221: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11222
11223         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11224
11225 echo "${as_me:-configure}:11225: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11226
11227 cf_fix_cppflags=no
11228 cf_new_cflags=
11229 cf_new_cppflags=
11230 cf_new_extra_cppflags=
11231
11232 for cf_add_cflags in $cf_pkgconfig_incs
11233 do
11234 case $cf_fix_cppflags in
11235 (no)
11236         case $cf_add_cflags in
11237         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11238                 case $cf_add_cflags in
11239                 (-D*)
11240                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11241
11242                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11243                                 && test -z "${cf_tst_cflags}" \
11244                                 && cf_fix_cppflags=yes
11245
11246                         if test $cf_fix_cppflags = yes ; then
11247                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11248                                 continue
11249                         elif test "${cf_tst_cflags}" = "\"'" ; then
11250                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11251                                 continue
11252                         fi
11253                         ;;
11254                 esac
11255                 case "$CPPFLAGS" in
11256                 (*$cf_add_cflags)
11257                         ;;
11258                 (*)
11259                         case $cf_add_cflags in
11260                         (-D*)
11261                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11262
11263 CPPFLAGS=`echo "$CPPFLAGS" | \
11264         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11265                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11266
11267                                 ;;
11268                         esac
11269                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11270                         ;;
11271                 esac
11272                 ;;
11273         (*)
11274                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11275                 ;;
11276         esac
11277         ;;
11278 (yes)
11279         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11280
11281         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11282
11283         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11284                 && test -z "${cf_tst_cflags}" \
11285                 && cf_fix_cppflags=no
11286         ;;
11287 esac
11288 done
11289
11290 if test -n "$cf_new_cflags" ; then
11291
11292         CFLAGS="$CFLAGS $cf_new_cflags"
11293 fi
11294
11295 if test -n "$cf_new_cppflags" ; then
11296
11297         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11298 fi
11299
11300 if test -n "$cf_new_extra_cppflags" ; then
11301
11302         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11303 fi
11304
11305 cf_add_libs="$cf_pkgconfig_libs"
11306 # Filter out duplicates - this happens with badly-designed ".pc" files...
11307 for cf_add_1lib in $LIBS
11308 do
11309         for cf_add_2lib in $cf_add_libs
11310         do
11311                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11312                 then
11313                         cf_add_1lib=
11314                         break
11315                 fi
11316         done
11317         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11318 done
11319 LIBS="$cf_add_libs"
11320
11321         :
11322 else
11323         cf_pkgconfig_incs=
11324         cf_pkgconfig_libs=
11325
11326         echo "$as_me:11326: checking for XextCreateExtension in -lXext" >&5
11327 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11328 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11329   echo $ECHO_N "(cached) $ECHO_C" >&6
11330 else
11331   ac_check_lib_save_LIBS=$LIBS
11332 LIBS="-lXext  $LIBS"
11333 cat >conftest.$ac_ext <<_ACEOF
11334 #line 11334 "configure"
11335 #include "confdefs.h"
11336
11337 /* Override any gcc2 internal prototype to avoid an error.  */
11338 #ifdef __cplusplus
11339 extern "C"
11340 #endif
11341 /* We use char because int might match the return type of a gcc2
11342    builtin and then its argument prototype would still apply.  */
11343 char XextCreateExtension ();
11344 int
11345 main ()
11346 {
11347 XextCreateExtension ();
11348   ;
11349   return 0;
11350 }
11351 _ACEOF
11352 rm -f conftest.$ac_objext conftest$ac_exeext
11353 if { (eval echo "$as_me:11353: \"$ac_link\"") >&5
11354   (eval $ac_link) 2>&5
11355   ac_status=$?
11356   echo "$as_me:11356: \$? = $ac_status" >&5
11357   (exit $ac_status); } &&
11358          { ac_try='test -s conftest$ac_exeext'
11359   { (eval echo "$as_me:11359: \"$ac_try\"") >&5
11360   (eval $ac_try) 2>&5
11361   ac_status=$?
11362   echo "$as_me:11362: \$? = $ac_status" >&5
11363   (exit $ac_status); }; }; then
11364   ac_cv_lib_Xext_XextCreateExtension=yes
11365 else
11366   echo "$as_me: failed program was:" >&5
11367 cat conftest.$ac_ext >&5
11368 ac_cv_lib_Xext_XextCreateExtension=no
11369 fi
11370 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11371 LIBS=$ac_check_lib_save_LIBS
11372 fi
11373 echo "$as_me:11373: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11374 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11375 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11376
11377 cf_add_libs="-lXext"
11378 # Filter out duplicates - this happens with badly-designed ".pc" files...
11379 for cf_add_1lib in $LIBS
11380 do
11381         for cf_add_2lib in $cf_add_libs
11382         do
11383                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11384                 then
11385                         cf_add_1lib=
11386                         break
11387                 fi
11388         done
11389         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11390 done
11391 LIBS="$cf_add_libs"
11392
11393 fi
11394
11395 fi
11396
11397 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11398 # in some cases has installed dummy files in the former, other cases replaced
11399 # it with a link to the new location).  This complicates the configure script.
11400 # Check for that pitfall, and recover using pkg-config
11401 #
11402 # If none of these are set, the configuration is almost certainly broken.
11403 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11404 then
11405
11406 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11407         test -n "$verbose" && echo "    found package x11" 1>&6
11408
11409 echo "${as_me:-configure}:11409: testing found package x11 ..." 1>&5
11410
11411         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11412         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11413         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11414
11415 echo "${as_me:-configure}:11415: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11416
11417         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11418
11419 echo "${as_me:-configure}:11419: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11420
11421 cf_fix_cppflags=no
11422 cf_new_cflags=
11423 cf_new_cppflags=
11424 cf_new_extra_cppflags=
11425
11426 for cf_add_cflags in $cf_pkgconfig_incs
11427 do
11428 case $cf_fix_cppflags in
11429 (no)
11430         case $cf_add_cflags in
11431         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11432                 case $cf_add_cflags in
11433                 (-D*)
11434                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11435
11436                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11437                                 && test -z "${cf_tst_cflags}" \
11438                                 && cf_fix_cppflags=yes
11439
11440                         if test $cf_fix_cppflags = yes ; then
11441                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11442                                 continue
11443                         elif test "${cf_tst_cflags}" = "\"'" ; then
11444                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11445                                 continue
11446                         fi
11447                         ;;
11448                 esac
11449                 case "$CPPFLAGS" in
11450                 (*$cf_add_cflags)
11451                         ;;
11452                 (*)
11453                         case $cf_add_cflags in
11454                         (-D*)
11455                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11456
11457 CPPFLAGS=`echo "$CPPFLAGS" | \
11458         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11459                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11460
11461                                 ;;
11462                         esac
11463                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11464                         ;;
11465                 esac
11466                 ;;
11467         (*)
11468                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11469                 ;;
11470         esac
11471         ;;
11472 (yes)
11473         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11474
11475         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11476
11477         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11478                 && test -z "${cf_tst_cflags}" \
11479                 && cf_fix_cppflags=no
11480         ;;
11481 esac
11482 done
11483
11484 if test -n "$cf_new_cflags" ; then
11485
11486         CFLAGS="$CFLAGS $cf_new_cflags"
11487 fi
11488
11489 if test -n "$cf_new_cppflags" ; then
11490
11491         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11492 fi
11493
11494 if test -n "$cf_new_extra_cppflags" ; then
11495
11496         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11497 fi
11498
11499 cf_add_libs="$cf_pkgconfig_libs"
11500 # Filter out duplicates - this happens with badly-designed ".pc" files...
11501 for cf_add_1lib in $LIBS
11502 do
11503         for cf_add_2lib in $cf_add_libs
11504         do
11505                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11506                 then
11507                         cf_add_1lib=
11508                         break
11509                 fi
11510         done
11511         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11512 done
11513 LIBS="$cf_add_libs"
11514
11515         :
11516 else
11517         cf_pkgconfig_incs=
11518         cf_pkgconfig_libs=
11519         { echo "$as_me:11519: WARNING: unable to find X11 library" >&5
11520 echo "$as_me: WARNING: unable to find X11 library" >&2;}
11521 fi
11522
11523 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11524         test -n "$verbose" && echo "    found package ice" 1>&6
11525
11526 echo "${as_me:-configure}:11526: testing found package ice ..." 1>&5
11527
11528         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11529         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11530         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11531
11532 echo "${as_me:-configure}:11532: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11533
11534         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11535
11536 echo "${as_me:-configure}:11536: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11537
11538 cf_fix_cppflags=no
11539 cf_new_cflags=
11540 cf_new_cppflags=
11541 cf_new_extra_cppflags=
11542
11543 for cf_add_cflags in $cf_pkgconfig_incs
11544 do
11545 case $cf_fix_cppflags in
11546 (no)
11547         case $cf_add_cflags in
11548         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11549                 case $cf_add_cflags in
11550                 (-D*)
11551                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11552
11553                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11554                                 && test -z "${cf_tst_cflags}" \
11555                                 && cf_fix_cppflags=yes
11556
11557                         if test $cf_fix_cppflags = yes ; then
11558                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11559                                 continue
11560                         elif test "${cf_tst_cflags}" = "\"'" ; then
11561                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11562                                 continue
11563                         fi
11564                         ;;
11565                 esac
11566                 case "$CPPFLAGS" in
11567                 (*$cf_add_cflags)
11568                         ;;
11569                 (*)
11570                         case $cf_add_cflags in
11571                         (-D*)
11572                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11573
11574 CPPFLAGS=`echo "$CPPFLAGS" | \
11575         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11576                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11577
11578                                 ;;
11579                         esac
11580                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11581                         ;;
11582                 esac
11583                 ;;
11584         (*)
11585                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11586                 ;;
11587         esac
11588         ;;
11589 (yes)
11590         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11591
11592         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11593
11594         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11595                 && test -z "${cf_tst_cflags}" \
11596                 && cf_fix_cppflags=no
11597         ;;
11598 esac
11599 done
11600
11601 if test -n "$cf_new_cflags" ; then
11602
11603         CFLAGS="$CFLAGS $cf_new_cflags"
11604 fi
11605
11606 if test -n "$cf_new_cppflags" ; then
11607
11608         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11609 fi
11610
11611 if test -n "$cf_new_extra_cppflags" ; then
11612
11613         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11614 fi
11615
11616 cf_add_libs="$cf_pkgconfig_libs"
11617 # Filter out duplicates - this happens with badly-designed ".pc" files...
11618 for cf_add_1lib in $LIBS
11619 do
11620         for cf_add_2lib in $cf_add_libs
11621         do
11622                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11623                 then
11624                         cf_add_1lib=
11625                         break
11626                 fi
11627         done
11628         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11629 done
11630 LIBS="$cf_add_libs"
11631
11632         :
11633 else
11634         cf_pkgconfig_incs=
11635         cf_pkgconfig_libs=
11636         { echo "$as_me:11636: WARNING: unable to find ICE library" >&5
11637 echo "$as_me: WARNING: unable to find ICE library" >&2;}
11638 fi
11639
11640 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11641         test -n "$verbose" && echo "    found package sm" 1>&6
11642
11643 echo "${as_me:-configure}:11643: testing found package sm ..." 1>&5
11644
11645         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11646         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11647         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11648
11649 echo "${as_me:-configure}:11649: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11650
11651         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11652
11653 echo "${as_me:-configure}:11653: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11654
11655 cf_fix_cppflags=no
11656 cf_new_cflags=
11657 cf_new_cppflags=
11658 cf_new_extra_cppflags=
11659
11660 for cf_add_cflags in $cf_pkgconfig_incs
11661 do
11662 case $cf_fix_cppflags in
11663 (no)
11664         case $cf_add_cflags in
11665         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11666                 case $cf_add_cflags in
11667                 (-D*)
11668                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11669
11670                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11671                                 && test -z "${cf_tst_cflags}" \
11672                                 && cf_fix_cppflags=yes
11673
11674                         if test $cf_fix_cppflags = yes ; then
11675                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11676                                 continue
11677                         elif test "${cf_tst_cflags}" = "\"'" ; then
11678                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11679                                 continue
11680                         fi
11681                         ;;
11682                 esac
11683                 case "$CPPFLAGS" in
11684                 (*$cf_add_cflags)
11685                         ;;
11686                 (*)
11687                         case $cf_add_cflags in
11688                         (-D*)
11689                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11690
11691 CPPFLAGS=`echo "$CPPFLAGS" | \
11692         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11693                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11694
11695                                 ;;
11696                         esac
11697                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11698                         ;;
11699                 esac
11700                 ;;
11701         (*)
11702                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11703                 ;;
11704         esac
11705         ;;
11706 (yes)
11707         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11708
11709         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11710
11711         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11712                 && test -z "${cf_tst_cflags}" \
11713                 && cf_fix_cppflags=no
11714         ;;
11715 esac
11716 done
11717
11718 if test -n "$cf_new_cflags" ; then
11719
11720         CFLAGS="$CFLAGS $cf_new_cflags"
11721 fi
11722
11723 if test -n "$cf_new_cppflags" ; then
11724
11725         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11726 fi
11727
11728 if test -n "$cf_new_extra_cppflags" ; then
11729
11730         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11731 fi
11732
11733 cf_add_libs="$cf_pkgconfig_libs"
11734 # Filter out duplicates - this happens with badly-designed ".pc" files...
11735 for cf_add_1lib in $LIBS
11736 do
11737         for cf_add_2lib in $cf_add_libs
11738         do
11739                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11740                 then
11741                         cf_add_1lib=
11742                         break
11743                 fi
11744         done
11745         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11746 done
11747 LIBS="$cf_add_libs"
11748
11749         :
11750 else
11751         cf_pkgconfig_incs=
11752         cf_pkgconfig_libs=
11753         { echo "$as_me:11753: WARNING: unable to find SM library" >&5
11754 echo "$as_me: WARNING: unable to find SM library" >&2;}
11755 fi
11756
11757 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11758         test -n "$verbose" && echo "    found package xt" 1>&6
11759
11760 echo "${as_me:-configure}:11760: testing found package xt ..." 1>&5
11761
11762         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11763         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11764         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11765
11766 echo "${as_me:-configure}:11766: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11767
11768         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11769
11770 echo "${as_me:-configure}:11770: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11771
11772 cf_fix_cppflags=no
11773 cf_new_cflags=
11774 cf_new_cppflags=
11775 cf_new_extra_cppflags=
11776
11777 for cf_add_cflags in $cf_pkgconfig_incs
11778 do
11779 case $cf_fix_cppflags in
11780 (no)
11781         case $cf_add_cflags in
11782         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11783                 case $cf_add_cflags in
11784                 (-D*)
11785                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11786
11787                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11788                                 && test -z "${cf_tst_cflags}" \
11789                                 && cf_fix_cppflags=yes
11790
11791                         if test $cf_fix_cppflags = yes ; then
11792                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11793                                 continue
11794                         elif test "${cf_tst_cflags}" = "\"'" ; then
11795                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11796                                 continue
11797                         fi
11798                         ;;
11799                 esac
11800                 case "$CPPFLAGS" in
11801                 (*$cf_add_cflags)
11802                         ;;
11803                 (*)
11804                         case $cf_add_cflags in
11805                         (-D*)
11806                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11807
11808 CPPFLAGS=`echo "$CPPFLAGS" | \
11809         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11810                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11811
11812                                 ;;
11813                         esac
11814                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11815                         ;;
11816                 esac
11817                 ;;
11818         (*)
11819                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11820                 ;;
11821         esac
11822         ;;
11823 (yes)
11824         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11825
11826         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11827
11828         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11829                 && test -z "${cf_tst_cflags}" \
11830                 && cf_fix_cppflags=no
11831         ;;
11832 esac
11833 done
11834
11835 if test -n "$cf_new_cflags" ; then
11836
11837         CFLAGS="$CFLAGS $cf_new_cflags"
11838 fi
11839
11840 if test -n "$cf_new_cppflags" ; then
11841
11842         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11843 fi
11844
11845 if test -n "$cf_new_extra_cppflags" ; then
11846
11847         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11848 fi
11849
11850 cf_add_libs="$cf_pkgconfig_libs"
11851 # Filter out duplicates - this happens with badly-designed ".pc" files...
11852 for cf_add_1lib in $LIBS
11853 do
11854         for cf_add_2lib in $cf_add_libs
11855         do
11856                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11857                 then
11858                         cf_add_1lib=
11859                         break
11860                 fi
11861         done
11862         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11863 done
11864 LIBS="$cf_add_libs"
11865
11866         :
11867 else
11868         cf_pkgconfig_incs=
11869         cf_pkgconfig_libs=
11870         { echo "$as_me:11870: WARNING: unable to find Xt library" >&5
11871 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11872 fi
11873
11874 fi
11875
11876 cf_have_X_LIBS=no
11877
11878 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11879         test -n "$verbose" && echo "    found package xt" 1>&6
11880
11881 echo "${as_me:-configure}:11881: testing found package xt ..." 1>&5
11882
11883         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11884         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11885         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11886
11887 echo "${as_me:-configure}:11887: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11888
11889         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11890
11891 echo "${as_me:-configure}:11891: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11892
11893 cf_fix_cppflags=no
11894 cf_new_cflags=
11895 cf_new_cppflags=
11896 cf_new_extra_cppflags=
11897
11898 for cf_add_cflags in $cf_pkgconfig_incs
11899 do
11900 case $cf_fix_cppflags in
11901 (no)
11902         case $cf_add_cflags in
11903         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11904                 case $cf_add_cflags in
11905                 (-D*)
11906                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11907
11908                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11909                                 && test -z "${cf_tst_cflags}" \
11910                                 && cf_fix_cppflags=yes
11911
11912                         if test $cf_fix_cppflags = yes ; then
11913                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11914                                 continue
11915                         elif test "${cf_tst_cflags}" = "\"'" ; then
11916                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11917                                 continue
11918                         fi
11919                         ;;
11920                 esac
11921                 case "$CPPFLAGS" in
11922                 (*$cf_add_cflags)
11923                         ;;
11924                 (*)
11925                         case $cf_add_cflags in
11926                         (-D*)
11927                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11928
11929 CPPFLAGS=`echo "$CPPFLAGS" | \
11930         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11931                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11932
11933                                 ;;
11934                         esac
11935                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11936                         ;;
11937                 esac
11938                 ;;
11939         (*)
11940                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11941                 ;;
11942         esac
11943         ;;
11944 (yes)
11945         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11946
11947         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11948
11949         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11950                 && test -z "${cf_tst_cflags}" \
11951                 && cf_fix_cppflags=no
11952         ;;
11953 esac
11954 done
11955
11956 if test -n "$cf_new_cflags" ; then
11957
11958         CFLAGS="$CFLAGS $cf_new_cflags"
11959 fi
11960
11961 if test -n "$cf_new_cppflags" ; then
11962
11963         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11964 fi
11965
11966 if test -n "$cf_new_extra_cppflags" ; then
11967
11968         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11969 fi
11970
11971 cf_add_libs="$cf_pkgconfig_libs"
11972 # Filter out duplicates - this happens with badly-designed ".pc" files...
11973 for cf_add_1lib in $LIBS
11974 do
11975         for cf_add_2lib in $cf_add_libs
11976         do
11977                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11978                 then
11979                         cf_add_1lib=
11980                         break
11981                 fi
11982         done
11983         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11984 done
11985 LIBS="$cf_add_libs"
11986
11987         case "x$LIBS" in
11988         (*-lX11*)
11989                 ;;
11990         (*)
11991 # we have an "xt" package, but it may omit Xt's dependency on X11
11992 echo "$as_me:11992: checking for usable X dependency" >&5
11993 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11994 if test "${cf_cv_xt_x11_compat+set}" = set; then
11995   echo $ECHO_N "(cached) $ECHO_C" >&6
11996 else
11997
11998 cat >conftest.$ac_ext <<_ACEOF
11999 #line 11999 "configure"
12000 #include "confdefs.h"
12001
12002 #include <X11/Xlib.h>
12003
12004 int
12005 main ()
12006 {
12007
12008         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
12009         int rc2 = XClearWindow((Display*) 0, (Window) 0);
12010         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
12011         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
12012
12013   ;
12014   return 0;
12015 }
12016 _ACEOF
12017 rm -f conftest.$ac_objext conftest$ac_exeext
12018 if { (eval echo "$as_me:12018: \"$ac_link\"") >&5
12019   (eval $ac_link) 2>&5
12020   ac_status=$?
12021   echo "$as_me:12021: \$? = $ac_status" >&5
12022   (exit $ac_status); } &&
12023          { ac_try='test -s conftest$ac_exeext'
12024   { (eval echo "$as_me:12024: \"$ac_try\"") >&5
12025   (eval $ac_try) 2>&5
12026   ac_status=$?
12027   echo "$as_me:12027: \$? = $ac_status" >&5
12028   (exit $ac_status); }; }; then
12029   cf_cv_xt_x11_compat=yes
12030 else
12031   echo "$as_me: failed program was:" >&5
12032 cat conftest.$ac_ext >&5
12033 cf_cv_xt_x11_compat=no
12034 fi
12035 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12036 fi
12037 echo "$as_me:12037: result: $cf_cv_xt_x11_compat" >&5
12038 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
12039                 if test "$cf_cv_xt_x11_compat" = no
12040                 then
12041                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
12042
12043 echo "${as_me:-configure}:12043: testing work around broken X11 dependency ..." 1>&5
12044
12045                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
12046
12047 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12048         test -n "$verbose" && echo "    found package x11" 1>&6
12049
12050 echo "${as_me:-configure}:12050: testing found package x11 ..." 1>&5
12051
12052         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12053         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12054         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12055
12056 echo "${as_me:-configure}:12056: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12057
12058         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12059
12060 echo "${as_me:-configure}:12060: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12061
12062 cf_fix_cppflags=no
12063 cf_new_cflags=
12064 cf_new_cppflags=
12065 cf_new_extra_cppflags=
12066
12067 for cf_add_cflags in $cf_pkgconfig_incs
12068 do
12069 case $cf_fix_cppflags in
12070 (no)
12071         case $cf_add_cflags in
12072         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12073                 case $cf_add_cflags in
12074                 (-D*)
12075                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12076
12077                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12078                                 && test -z "${cf_tst_cflags}" \
12079                                 && cf_fix_cppflags=yes
12080
12081                         if test $cf_fix_cppflags = yes ; then
12082                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12083                                 continue
12084                         elif test "${cf_tst_cflags}" = "\"'" ; then
12085                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12086                                 continue
12087                         fi
12088                         ;;
12089                 esac
12090                 case "$CPPFLAGS" in
12091                 (*$cf_add_cflags)
12092                         ;;
12093                 (*)
12094                         case $cf_add_cflags in
12095                         (-D*)
12096                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12097
12098 CPPFLAGS=`echo "$CPPFLAGS" | \
12099         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12100                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12101
12102                                 ;;
12103                         esac
12104                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12105                         ;;
12106                 esac
12107                 ;;
12108         (*)
12109                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12110                 ;;
12111         esac
12112         ;;
12113 (yes)
12114         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12115
12116         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12117
12118         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12119                 && test -z "${cf_tst_cflags}" \
12120                 && cf_fix_cppflags=no
12121         ;;
12122 esac
12123 done
12124
12125 if test -n "$cf_new_cflags" ; then
12126
12127         CFLAGS="$CFLAGS $cf_new_cflags"
12128 fi
12129
12130 if test -n "$cf_new_cppflags" ; then
12131
12132         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12133 fi
12134
12135 if test -n "$cf_new_extra_cppflags" ; then
12136
12137         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12138 fi
12139
12140 cf_add_libs="$cf_pkgconfig_libs"
12141 # Filter out duplicates - this happens with badly-designed ".pc" files...
12142 for cf_add_1lib in $LIBS
12143 do
12144         for cf_add_2lib in $cf_add_libs
12145         do
12146                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12147                 then
12148                         cf_add_1lib=
12149                         break
12150                 fi
12151         done
12152         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12153 done
12154 LIBS="$cf_add_libs"
12155
12156         :
12157 else
12158         cf_pkgconfig_incs=
12159         cf_pkgconfig_libs=
12160
12161 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12162
12163 echo "${as_me:-configure}:12163: testing ...before $LIBS ..." 1>&5
12164
12165 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
12166 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12167
12168 echo "${as_me:-configure}:12168: testing ...after  $LIBS ..." 1>&5
12169
12170 fi
12171
12172                 fi
12173                 ;;
12174         esac
12175
12176 echo "$as_me:12176: checking for usable X Toolkit package" >&5
12177 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
12178 if test "${cf_cv_xt_ice_compat+set}" = set; then
12179   echo $ECHO_N "(cached) $ECHO_C" >&6
12180 else
12181
12182 cat >conftest.$ac_ext <<_ACEOF
12183 #line 12183 "configure"
12184 #include "confdefs.h"
12185
12186 #include <X11/Shell.h>
12187
12188 int
12189 main ()
12190 {
12191 int num = IceConnectionNumber(0)
12192
12193   ;
12194   return 0;
12195 }
12196 _ACEOF
12197 rm -f conftest.$ac_objext conftest$ac_exeext
12198 if { (eval echo "$as_me:12198: \"$ac_link\"") >&5
12199   (eval $ac_link) 2>&5
12200   ac_status=$?
12201   echo "$as_me:12201: \$? = $ac_status" >&5
12202   (exit $ac_status); } &&
12203          { ac_try='test -s conftest$ac_exeext'
12204   { (eval echo "$as_me:12204: \"$ac_try\"") >&5
12205   (eval $ac_try) 2>&5
12206   ac_status=$?
12207   echo "$as_me:12207: \$? = $ac_status" >&5
12208   (exit $ac_status); }; }; then
12209   cf_cv_xt_ice_compat=yes
12210 else
12211   echo "$as_me: failed program was:" >&5
12212 cat conftest.$ac_ext >&5
12213 cf_cv_xt_ice_compat=no
12214 fi
12215 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12216 fi
12217 echo "$as_me:12217: result: $cf_cv_xt_ice_compat" >&5
12218 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
12219
12220         if test "$cf_cv_xt_ice_compat" = no
12221         then
12222                 # workaround for broken ".pc" files used for X Toolkit.
12223                 case "x$X_PRE_LIBS" in
12224                 (*-lICE*)
12225                         case "x$LIBS" in
12226                         (*-lICE*)
12227                                 ;;
12228                         (*)
12229                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
12230
12231 echo "${as_me:-configure}:12231: testing work around broken ICE dependency ..." 1>&5
12232
12233 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12234         test -n "$verbose" && echo "    found package ice" 1>&6
12235
12236 echo "${as_me:-configure}:12236: testing found package ice ..." 1>&5
12237
12238         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12239         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12240         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12241
12242 echo "${as_me:-configure}:12242: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12243
12244         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
12245
12246 echo "${as_me:-configure}:12246: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
12247
12248 cf_fix_cppflags=no
12249 cf_new_cflags=
12250 cf_new_cppflags=
12251 cf_new_extra_cppflags=
12252
12253 for cf_add_cflags in $cf_pkgconfig_incs
12254 do
12255 case $cf_fix_cppflags in
12256 (no)
12257         case $cf_add_cflags in
12258         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12259                 case $cf_add_cflags in
12260                 (-D*)
12261                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12262
12263                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12264                                 && test -z "${cf_tst_cflags}" \
12265                                 && cf_fix_cppflags=yes
12266
12267                         if test $cf_fix_cppflags = yes ; then
12268                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12269                                 continue
12270                         elif test "${cf_tst_cflags}" = "\"'" ; then
12271                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12272                                 continue
12273                         fi
12274                         ;;
12275                 esac
12276                 case "$CPPFLAGS" in
12277                 (*$cf_add_cflags)
12278                         ;;
12279                 (*)
12280                         case $cf_add_cflags in
12281                         (-D*)
12282                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12283
12284 CPPFLAGS=`echo "$CPPFLAGS" | \
12285         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12286                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12287
12288                                 ;;
12289                         esac
12290                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12291                         ;;
12292                 esac
12293                 ;;
12294         (*)
12295                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12296                 ;;
12297         esac
12298         ;;
12299 (yes)
12300         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12301
12302         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12303
12304         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12305                 && test -z "${cf_tst_cflags}" \
12306                 && cf_fix_cppflags=no
12307         ;;
12308 esac
12309 done
12310
12311 if test -n "$cf_new_cflags" ; then
12312
12313         CFLAGS="$CFLAGS $cf_new_cflags"
12314 fi
12315
12316 if test -n "$cf_new_cppflags" ; then
12317
12318         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12319 fi
12320
12321 if test -n "$cf_new_extra_cppflags" ; then
12322
12323         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12324 fi
12325
12326 cf_add_libs="$cf_pkgconfig_libs"
12327 # Filter out duplicates - this happens with badly-designed ".pc" files...
12328 for cf_add_1lib in $LIBS
12329 do
12330         for cf_add_2lib in $cf_add_libs
12331         do
12332                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12333                 then
12334                         cf_add_1lib=
12335                         break
12336                 fi
12337         done
12338         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12339 done
12340 LIBS="$cf_add_libs"
12341
12342 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12343         test -n "$verbose" && echo "    found package sm" 1>&6
12344
12345 echo "${as_me:-configure}:12345: testing found package sm ..." 1>&5
12346
12347         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12348         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12349         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12350
12351 echo "${as_me:-configure}:12351: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12352
12353         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12354
12355 echo "${as_me:-configure}:12355: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12356
12357 cf_fix_cppflags=no
12358 cf_new_cflags=
12359 cf_new_cppflags=
12360 cf_new_extra_cppflags=
12361
12362 for cf_add_cflags in $cf_pkgconfig_incs
12363 do
12364 case $cf_fix_cppflags in
12365 (no)
12366         case $cf_add_cflags in
12367         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12368                 case $cf_add_cflags in
12369                 (-D*)
12370                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12371
12372                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12373                                 && test -z "${cf_tst_cflags}" \
12374                                 && cf_fix_cppflags=yes
12375
12376                         if test $cf_fix_cppflags = yes ; then
12377                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12378                                 continue
12379                         elif test "${cf_tst_cflags}" = "\"'" ; then
12380                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12381                                 continue
12382                         fi
12383                         ;;
12384                 esac
12385                 case "$CPPFLAGS" in
12386                 (*$cf_add_cflags)
12387                         ;;
12388                 (*)
12389                         case $cf_add_cflags in
12390                         (-D*)
12391                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12392
12393 CPPFLAGS=`echo "$CPPFLAGS" | \
12394         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12395                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12396
12397                                 ;;
12398                         esac
12399                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12400                         ;;
12401                 esac
12402                 ;;
12403         (*)
12404                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12405                 ;;
12406         esac
12407         ;;
12408 (yes)
12409         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12410
12411         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12412
12413         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12414                 && test -z "${cf_tst_cflags}" \
12415                 && cf_fix_cppflags=no
12416         ;;
12417 esac
12418 done
12419
12420 if test -n "$cf_new_cflags" ; then
12421
12422         CFLAGS="$CFLAGS $cf_new_cflags"
12423 fi
12424
12425 if test -n "$cf_new_cppflags" ; then
12426
12427         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12428 fi
12429
12430 if test -n "$cf_new_extra_cppflags" ; then
12431
12432         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12433 fi
12434
12435 cf_add_libs="$cf_pkgconfig_libs"
12436 # Filter out duplicates - this happens with badly-designed ".pc" files...
12437 for cf_add_1lib in $LIBS
12438 do
12439         for cf_add_2lib in $cf_add_libs
12440         do
12441                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12442                 then
12443                         cf_add_1lib=
12444                         break
12445                 fi
12446         done
12447         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12448 done
12449 LIBS="$cf_add_libs"
12450
12451         :
12452 else
12453         cf_pkgconfig_incs=
12454         cf_pkgconfig_libs=
12455         :
12456 fi
12457
12458 else
12459         cf_pkgconfig_incs=
12460         cf_pkgconfig_libs=
12461
12462 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12463
12464 echo "${as_me:-configure}:12464: testing ...before $LIBS ..." 1>&5
12465
12466 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
12467 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12468
12469 echo "${as_me:-configure}:12469: testing ...after  $LIBS ..." 1>&5
12470
12471 fi
12472
12473                                 ;;
12474                         esac
12475                         ;;
12476                 esac
12477         fi
12478
12479         cf_have_X_LIBS=yes
12480
12481 else
12482         cf_pkgconfig_incs=
12483         cf_pkgconfig_libs=
12484
12485         LDFLAGS="$X_LIBS $LDFLAGS"
12486
12487 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12488
12489 echo "${as_me:-configure}:12489: testing checking additions to CFLAGS ..." 1>&5
12490
12491 cf_check_cflags="$CFLAGS"
12492 cf_check_cppflags="$CPPFLAGS"
12493
12494 cf_fix_cppflags=no
12495 cf_new_cflags=
12496 cf_new_cppflags=
12497 cf_new_extra_cppflags=
12498
12499 for cf_add_cflags in $X_CFLAGS
12500 do
12501 case $cf_fix_cppflags in
12502 (no)
12503         case $cf_add_cflags in
12504         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12505                 case $cf_add_cflags in
12506                 (-D*)
12507                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12508
12509                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12510                                 && test -z "${cf_tst_cflags}" \
12511                                 && cf_fix_cppflags=yes
12512
12513                         if test $cf_fix_cppflags = yes ; then
12514                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12515                                 continue
12516                         elif test "${cf_tst_cflags}" = "\"'" ; then
12517                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12518                                 continue
12519                         fi
12520                         ;;
12521                 esac
12522                 case "$CPPFLAGS" in
12523                 (*$cf_add_cflags)
12524                         ;;
12525                 (*)
12526                         case $cf_add_cflags in
12527                         (-D*)
12528                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12529
12530 CPPFLAGS=`echo "$CPPFLAGS" | \
12531         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12532                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12533
12534                                 ;;
12535                         esac
12536                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12537                         ;;
12538                 esac
12539                 ;;
12540         (*)
12541                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12542                 ;;
12543         esac
12544         ;;
12545 (yes)
12546         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12547
12548         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12549
12550         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12551                 && test -z "${cf_tst_cflags}" \
12552                 && cf_fix_cppflags=no
12553         ;;
12554 esac
12555 done
12556
12557 if test -n "$cf_new_cflags" ; then
12558         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12559
12560 echo "${as_me:-configure}:12560: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12561
12562         CFLAGS="$CFLAGS $cf_new_cflags"
12563 fi
12564
12565 if test -n "$cf_new_cppflags" ; then
12566         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12567
12568 echo "${as_me:-configure}:12568: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12569
12570         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12571 fi
12572
12573 if test -n "$cf_new_extra_cppflags" ; then
12574         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12575
12576 echo "${as_me:-configure}:12576: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12577
12578         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12579 fi
12580
12581 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12582 cat >conftest.$ac_ext <<_ACEOF
12583 #line 12583 "configure"
12584 #include "confdefs.h"
12585 #include <stdio.h>
12586 int
12587 main ()
12588 {
12589 printf("Hello world");
12590   ;
12591   return 0;
12592 }
12593 _ACEOF
12594 rm -f conftest.$ac_objext conftest$ac_exeext
12595 if { (eval echo "$as_me:12595: \"$ac_link\"") >&5
12596   (eval $ac_link) 2>&5
12597   ac_status=$?
12598   echo "$as_me:12598: \$? = $ac_status" >&5
12599   (exit $ac_status); } &&
12600          { ac_try='test -s conftest$ac_exeext'
12601   { (eval echo "$as_me:12601: \"$ac_try\"") >&5
12602   (eval $ac_try) 2>&5
12603   ac_status=$?
12604   echo "$as_me:12604: \$? = $ac_status" >&5
12605   (exit $ac_status); }; }; then
12606   :
12607 else
12608   echo "$as_me: failed program was:" >&5
12609 cat conftest.$ac_ext >&5
12610 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12611
12612 echo "${as_me:-configure}:12612: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12613
12614          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12615                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12616
12617 echo "${as_me:-configure}:12617: testing but keeping change to \$CPPFLAGS ..." 1>&5
12618
12619          fi
12620          CFLAGS="$cf_check_flags"
12621 fi
12622 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12623 fi
12624
12625         echo "$as_me:12625: checking for XOpenDisplay" >&5
12626 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12627 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12628   echo $ECHO_N "(cached) $ECHO_C" >&6
12629 else
12630   cat >conftest.$ac_ext <<_ACEOF
12631 #line 12631 "configure"
12632 #include "confdefs.h"
12633 /* System header to define __stub macros and hopefully few prototypes,
12634     which can conflict with char XOpenDisplay (); below.  */
12635 #include <assert.h>
12636 /* Override any gcc2 internal prototype to avoid an error.  */
12637 #ifdef __cplusplus
12638 extern "C"
12639 #endif
12640 /* We use char because int might match the return type of a gcc2
12641    builtin and then its argument prototype would still apply.  */
12642 char XOpenDisplay ();
12643 char (*f) ();
12644
12645 int
12646 main ()
12647 {
12648 /* The GNU C library defines this for functions which it implements
12649     to always fail with ENOSYS.  Some functions are actually named
12650     something starting with __ and the normal name is an alias.  */
12651 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12652 choke me
12653 #else
12654 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12655 #endif
12656
12657   ;
12658   return 0;
12659 }
12660 _ACEOF
12661 rm -f conftest.$ac_objext conftest$ac_exeext
12662 if { (eval echo "$as_me:12662: \"$ac_link\"") >&5
12663   (eval $ac_link) 2>&5
12664   ac_status=$?
12665   echo "$as_me:12665: \$? = $ac_status" >&5
12666   (exit $ac_status); } &&
12667          { ac_try='test -s conftest$ac_exeext'
12668   { (eval echo "$as_me:12668: \"$ac_try\"") >&5
12669   (eval $ac_try) 2>&5
12670   ac_status=$?
12671   echo "$as_me:12671: \$? = $ac_status" >&5
12672   (exit $ac_status); }; }; then
12673   ac_cv_func_XOpenDisplay=yes
12674 else
12675   echo "$as_me: failed program was:" >&5
12676 cat conftest.$ac_ext >&5
12677 ac_cv_func_XOpenDisplay=no
12678 fi
12679 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12680 fi
12681 echo "$as_me:12681: result: $ac_cv_func_XOpenDisplay" >&5
12682 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12683 if test $ac_cv_func_XOpenDisplay = yes; then
12684   :
12685 else
12686
12687         echo "$as_me:12687: checking for XOpenDisplay in -lX11" >&5
12688 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12689 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12690   echo $ECHO_N "(cached) $ECHO_C" >&6
12691 else
12692   ac_check_lib_save_LIBS=$LIBS
12693 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12694 cat >conftest.$ac_ext <<_ACEOF
12695 #line 12695 "configure"
12696 #include "confdefs.h"
12697
12698 /* Override any gcc2 internal prototype to avoid an error.  */
12699 #ifdef __cplusplus
12700 extern "C"
12701 #endif
12702 /* We use char because int might match the return type of a gcc2
12703    builtin and then its argument prototype would still apply.  */
12704 char XOpenDisplay ();
12705 int
12706 main ()
12707 {
12708 XOpenDisplay ();
12709   ;
12710   return 0;
12711 }
12712 _ACEOF
12713 rm -f conftest.$ac_objext conftest$ac_exeext
12714 if { (eval echo "$as_me:12714: \"$ac_link\"") >&5
12715   (eval $ac_link) 2>&5
12716   ac_status=$?
12717   echo "$as_me:12717: \$? = $ac_status" >&5
12718   (exit $ac_status); } &&
12719          { ac_try='test -s conftest$ac_exeext'
12720   { (eval echo "$as_me:12720: \"$ac_try\"") >&5
12721   (eval $ac_try) 2>&5
12722   ac_status=$?
12723   echo "$as_me:12723: \$? = $ac_status" >&5
12724   (exit $ac_status); }; }; then
12725   ac_cv_lib_X11_XOpenDisplay=yes
12726 else
12727   echo "$as_me: failed program was:" >&5
12728 cat conftest.$ac_ext >&5
12729 ac_cv_lib_X11_XOpenDisplay=no
12730 fi
12731 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12732 LIBS=$ac_check_lib_save_LIBS
12733 fi
12734 echo "$as_me:12734: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12735 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12736 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12737
12738 cf_add_libs="-lX11"
12739 # Filter out duplicates - this happens with badly-designed ".pc" files...
12740 for cf_add_1lib in $LIBS
12741 do
12742         for cf_add_2lib in $cf_add_libs
12743         do
12744                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12745                 then
12746                         cf_add_1lib=
12747                         break
12748                 fi
12749         done
12750         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12751 done
12752 LIBS="$cf_add_libs"
12753
12754 fi
12755
12756 fi
12757
12758         echo "$as_me:12758: checking for XtAppInitialize" >&5
12759 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12760 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12761   echo $ECHO_N "(cached) $ECHO_C" >&6
12762 else
12763   cat >conftest.$ac_ext <<_ACEOF
12764 #line 12764 "configure"
12765 #include "confdefs.h"
12766 /* System header to define __stub macros and hopefully few prototypes,
12767     which can conflict with char XtAppInitialize (); below.  */
12768 #include <assert.h>
12769 /* Override any gcc2 internal prototype to avoid an error.  */
12770 #ifdef __cplusplus
12771 extern "C"
12772 #endif
12773 /* We use char because int might match the return type of a gcc2
12774    builtin and then its argument prototype would still apply.  */
12775 char XtAppInitialize ();
12776 char (*f) ();
12777
12778 int
12779 main ()
12780 {
12781 /* The GNU C library defines this for functions which it implements
12782     to always fail with ENOSYS.  Some functions are actually named
12783     something starting with __ and the normal name is an alias.  */
12784 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12785 choke me
12786 #else
12787 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12788 #endif
12789
12790   ;
12791   return 0;
12792 }
12793 _ACEOF
12794 rm -f conftest.$ac_objext conftest$ac_exeext
12795 if { (eval echo "$as_me:12795: \"$ac_link\"") >&5
12796   (eval $ac_link) 2>&5
12797   ac_status=$?
12798   echo "$as_me:12798: \$? = $ac_status" >&5
12799   (exit $ac_status); } &&
12800          { ac_try='test -s conftest$ac_exeext'
12801   { (eval echo "$as_me:12801: \"$ac_try\"") >&5
12802   (eval $ac_try) 2>&5
12803   ac_status=$?
12804   echo "$as_me:12804: \$? = $ac_status" >&5
12805   (exit $ac_status); }; }; then
12806   ac_cv_func_XtAppInitialize=yes
12807 else
12808   echo "$as_me: failed program was:" >&5
12809 cat conftest.$ac_ext >&5
12810 ac_cv_func_XtAppInitialize=no
12811 fi
12812 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12813 fi
12814 echo "$as_me:12814: result: $ac_cv_func_XtAppInitialize" >&5
12815 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12816 if test $ac_cv_func_XtAppInitialize = yes; then
12817   :
12818 else
12819
12820         echo "$as_me:12820: checking for XtAppInitialize in -lXt" >&5
12821 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12822 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12823   echo $ECHO_N "(cached) $ECHO_C" >&6
12824 else
12825   ac_check_lib_save_LIBS=$LIBS
12826 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12827 cat >conftest.$ac_ext <<_ACEOF
12828 #line 12828 "configure"
12829 #include "confdefs.h"
12830
12831 /* Override any gcc2 internal prototype to avoid an error.  */
12832 #ifdef __cplusplus
12833 extern "C"
12834 #endif
12835 /* We use char because int might match the return type of a gcc2
12836    builtin and then its argument prototype would still apply.  */
12837 char XtAppInitialize ();
12838 int
12839 main ()
12840 {
12841 XtAppInitialize ();
12842   ;
12843   return 0;
12844 }
12845 _ACEOF
12846 rm -f conftest.$ac_objext conftest$ac_exeext
12847 if { (eval echo "$as_me:12847: \"$ac_link\"") >&5
12848   (eval $ac_link) 2>&5
12849   ac_status=$?
12850   echo "$as_me:12850: \$? = $ac_status" >&5
12851   (exit $ac_status); } &&
12852          { ac_try='test -s conftest$ac_exeext'
12853   { (eval echo "$as_me:12853: \"$ac_try\"") >&5
12854   (eval $ac_try) 2>&5
12855   ac_status=$?
12856   echo "$as_me:12856: \$? = $ac_status" >&5
12857   (exit $ac_status); }; }; then
12858   ac_cv_lib_Xt_XtAppInitialize=yes
12859 else
12860   echo "$as_me: failed program was:" >&5
12861 cat conftest.$ac_ext >&5
12862 ac_cv_lib_Xt_XtAppInitialize=no
12863 fi
12864 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12865 LIBS=$ac_check_lib_save_LIBS
12866 fi
12867 echo "$as_me:12867: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12868 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12869 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12870
12871 cat >>confdefs.h <<\EOF
12872 #define HAVE_LIBXT 1
12873 EOF
12874
12875                  cf_have_X_LIBS=Xt
12876                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12877 fi
12878
12879 fi
12880
12881 fi
12882
12883 if test $cf_have_X_LIBS = no ; then
12884         { echo "$as_me:12884: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12885 test program.  You will have to check and add the proper libraries by hand
12886 to makefile." >&5
12887 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12888 test program.  You will have to check and add the proper libraries by hand
12889 to makefile." >&2;}
12890 fi
12891
12892 cf_x_athena_root=$cf_x_athena
12893 cf_x_athena_inc=""
12894
12895 for cf_path in default \
12896         /usr/contrib/X11R6 \
12897         /usr/contrib/X11R5 \
12898         /usr/lib/X11R5 \
12899         /usr/local
12900 do
12901         if test -z "$cf_x_athena_inc" ; then
12902                 cf_save="$CPPFLAGS"
12903                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12904                 if test $cf_path != default ; then
12905                         CPPFLAGS="$cf_save -I$cf_path/include"
12906                         echo "$as_me:12906: checking for $cf_test in $cf_path" >&5
12907 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12908                 else
12909                         echo "$as_me:12909: checking for $cf_test" >&5
12910 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12911                 fi
12912                 cat >conftest.$ac_ext <<_ACEOF
12913 #line 12913 "configure"
12914 #include "confdefs.h"
12915
12916 #include <X11/Intrinsic.h>
12917 #include <$cf_test>
12918 int
12919 main ()
12920 {
12921
12922   ;
12923   return 0;
12924 }
12925 _ACEOF
12926 rm -f conftest.$ac_objext
12927 if { (eval echo "$as_me:12927: \"$ac_compile\"") >&5
12928   (eval $ac_compile) 2>&5
12929   ac_status=$?
12930   echo "$as_me:12930: \$? = $ac_status" >&5
12931   (exit $ac_status); } &&
12932          { ac_try='test -s conftest.$ac_objext'
12933   { (eval echo "$as_me:12933: \"$ac_try\"") >&5
12934   (eval $ac_try) 2>&5
12935   ac_status=$?
12936   echo "$as_me:12936: \$? = $ac_status" >&5
12937   (exit $ac_status); }; }; then
12938   cf_result=yes
12939 else
12940   echo "$as_me: failed program was:" >&5
12941 cat conftest.$ac_ext >&5
12942 cf_result=no
12943 fi
12944 rm -f conftest.$ac_objext conftest.$ac_ext
12945                 echo "$as_me:12945: result: $cf_result" >&5
12946 echo "${ECHO_T}$cf_result" >&6
12947                 if test "$cf_result" = yes ; then
12948                         cf_x_athena_inc=$cf_path
12949                         break
12950                 else
12951                         CPPFLAGS="$cf_save"
12952                 fi
12953         fi
12954 done
12955
12956 if test -z "$cf_x_athena_inc" ; then
12957         { echo "$as_me:12957: WARNING: Unable to successfully find Athena header files with test program" >&5
12958 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12959 elif test "$cf_x_athena_inc" != default ; then
12960         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12961 fi
12962
12963 cf_x_athena_root=$cf_x_athena
12964 cf_x_athena_lib=""
12965
12966 for cf_path in default \
12967         /usr/contrib/X11R6 \
12968         /usr/contrib/X11R5 \
12969         /usr/lib/X11R5 \
12970         /usr/local
12971 do
12972         for cf_lib in \
12973                 ${cf_x_athena_root} \
12974                 ${cf_x_athena_root}7 \
12975                 ${cf_x_athena_root}6
12976         do
12977         for cf_libs in \
12978                 "-l$cf_lib -lXmu" \
12979                 "-l$cf_lib -lXpm -lXmu" \
12980                 "-l${cf_lib}_s -lXmu_s"
12981         do
12982                 if test -z "$cf_x_athena_lib" ; then
12983                         cf_save="$LIBS"
12984                         cf_test=XawSimpleMenuAddGlobalActions
12985                         if test $cf_path != default ; then
12986
12987 cf_add_libs="-L$cf_path/lib $cf_libs"
12988 # Filter out duplicates - this happens with badly-designed ".pc" files...
12989 for cf_add_1lib in $LIBS
12990 do
12991         for cf_add_2lib in $cf_add_libs
12992         do
12993                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12994                 then
12995                         cf_add_1lib=
12996                         break
12997                 fi
12998         done
12999         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13000 done
13001 LIBS="$cf_add_libs"
13002
13003                                 echo "$as_me:13003: checking for $cf_libs in $cf_path" >&5
13004 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
13005                         else
13006
13007 cf_add_libs="$cf_libs"
13008 # Filter out duplicates - this happens with badly-designed ".pc" files...
13009 for cf_add_1lib in $LIBS
13010 do
13011         for cf_add_2lib in $cf_add_libs
13012         do
13013                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13014                 then
13015                         cf_add_1lib=
13016                         break
13017                 fi
13018         done
13019         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13020 done
13021 LIBS="$cf_add_libs"
13022
13023                                 echo "$as_me:13023: checking for $cf_test in $cf_libs" >&5
13024 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
13025                         fi
13026                         cat >conftest.$ac_ext <<_ACEOF
13027 #line 13027 "configure"
13028 #include "confdefs.h"
13029
13030 #include <X11/Intrinsic.h>
13031 #include <X11/$cf_x_athena_root/SimpleMenu.h>
13032
13033 int
13034 main ()
13035 {
13036
13037 $cf_test((XtAppContext) 0)
13038   ;
13039   return 0;
13040 }
13041 _ACEOF
13042 rm -f conftest.$ac_objext conftest$ac_exeext
13043 if { (eval echo "$as_me:13043: \"$ac_link\"") >&5
13044   (eval $ac_link) 2>&5
13045   ac_status=$?
13046   echo "$as_me:13046: \$? = $ac_status" >&5
13047   (exit $ac_status); } &&
13048          { ac_try='test -s conftest$ac_exeext'
13049   { (eval echo "$as_me:13049: \"$ac_try\"") >&5
13050   (eval $ac_try) 2>&5
13051   ac_status=$?
13052   echo "$as_me:13052: \$? = $ac_status" >&5
13053   (exit $ac_status); }; }; then
13054   cf_result=yes
13055 else
13056   echo "$as_me: failed program was:" >&5
13057 cat conftest.$ac_ext >&5
13058 cf_result=no
13059 fi
13060 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13061                         echo "$as_me:13061: result: $cf_result" >&5
13062 echo "${ECHO_T}$cf_result" >&6
13063                         if test "$cf_result" = yes ; then
13064                                 cf_x_athena_lib="$cf_libs"
13065                                 break
13066                         fi
13067                         LIBS="$cf_save"
13068                 fi
13069         done # cf_libs
13070                 test -n "$cf_x_athena_lib" && break
13071         done # cf_lib
13072 done
13073
13074 if test -z "$cf_x_athena_lib" ; then
13075         { { echo "$as_me:13075: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
13076 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
13077    { (exit 1); exit 1; }; }
13078 fi
13079
13080 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13081
13082 cat >>confdefs.h <<EOF
13083 #define $cf_x_athena_LIBS 1
13084 EOF
13085
13086 fi
13087
13088 if test -n "$ac_tool_prefix"; then
13089   for ac_prog in xcurses-config
13090   do
13091     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
13092 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
13093 echo "$as_me:13093: checking for $ac_word" >&5
13094 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13095 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
13096   echo $ECHO_N "(cached) $ECHO_C" >&6
13097 else
13098   if test -n "$XCURSES_CONFIG"; then
13099   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
13100 else
13101   ac_save_IFS=$IFS; IFS=$ac_path_separator
13102 ac_dummy="$PATH"
13103 for ac_dir in $ac_dummy; do
13104   IFS=$ac_save_IFS
13105   test -z "$ac_dir" && ac_dir=.
13106   $as_executable_p "$ac_dir/$ac_word" || continue
13107 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
13108 echo "$as_me:13108: found $ac_dir/$ac_word" >&5
13109 break
13110 done
13111
13112 fi
13113 fi
13114 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
13115 if test -n "$XCURSES_CONFIG"; then
13116   echo "$as_me:13116: result: $XCURSES_CONFIG" >&5
13117 echo "${ECHO_T}$XCURSES_CONFIG" >&6
13118 else
13119   echo "$as_me:13119: result: no" >&5
13120 echo "${ECHO_T}no" >&6
13121 fi
13122
13123     test -n "$XCURSES_CONFIG" && break
13124   done
13125 fi
13126 if test -z "$XCURSES_CONFIG"; then
13127   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
13128   for ac_prog in xcurses-config
13129 do
13130   # Extract the first word of "$ac_prog", so it can be a program name with args.
13131 set dummy $ac_prog; ac_word=$2
13132 echo "$as_me:13132: checking for $ac_word" >&5
13133 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13134 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
13135   echo $ECHO_N "(cached) $ECHO_C" >&6
13136 else
13137   if test -n "$ac_ct_XCURSES_CONFIG"; then
13138   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
13139 else
13140   ac_save_IFS=$IFS; IFS=$ac_path_separator
13141 ac_dummy="$PATH"
13142 for ac_dir in $ac_dummy; do
13143   IFS=$ac_save_IFS
13144   test -z "$ac_dir" && ac_dir=.
13145   $as_executable_p "$ac_dir/$ac_word" || continue
13146 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
13147 echo "$as_me:13147: found $ac_dir/$ac_word" >&5
13148 break
13149 done
13150
13151 fi
13152 fi
13153 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
13154 if test -n "$ac_ct_XCURSES_CONFIG"; then
13155   echo "$as_me:13155: result: $ac_ct_XCURSES_CONFIG" >&5
13156 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
13157 else
13158   echo "$as_me:13158: result: no" >&5
13159 echo "${ECHO_T}no" >&6
13160 fi
13161
13162   test -n "$ac_ct_XCURSES_CONFIG" && break
13163 done
13164 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
13165
13166   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
13167 fi
13168
13169 if test "$XCURSES_CONFIG" != none ; then
13170
13171 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
13172
13173 cf_add_libs="`$XCURSES_CONFIG --libs`"
13174 # Filter out duplicates - this happens with badly-designed ".pc" files...
13175 for cf_add_1lib in $LIBS
13176 do
13177         for cf_add_2lib in $cf_add_libs
13178         do
13179                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13180                 then
13181                         cf_add_1lib=
13182                         break
13183                 fi
13184         done
13185         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13186 done
13187 LIBS="$cf_add_libs"
13188
13189 cf_cv_lib_XCurses=yes
13190
13191 else
13192
13193 LDFLAGS="$LDFLAGS $X_LIBS"
13194
13195 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13196
13197 echo "${as_me:-configure}:13197: testing checking additions to CFLAGS ..." 1>&5
13198
13199 cf_check_cflags="$CFLAGS"
13200 cf_check_cppflags="$CPPFLAGS"
13201
13202 cf_fix_cppflags=no
13203 cf_new_cflags=
13204 cf_new_cppflags=
13205 cf_new_extra_cppflags=
13206
13207 for cf_add_cflags in $X_CFLAGS
13208 do
13209 case $cf_fix_cppflags in
13210 (no)
13211         case $cf_add_cflags in
13212         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13213                 case $cf_add_cflags in
13214                 (-D*)
13215                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13216
13217                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13218                                 && test -z "${cf_tst_cflags}" \
13219                                 && cf_fix_cppflags=yes
13220
13221                         if test $cf_fix_cppflags = yes ; then
13222                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13223                                 continue
13224                         elif test "${cf_tst_cflags}" = "\"'" ; then
13225                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13226                                 continue
13227                         fi
13228                         ;;
13229                 esac
13230                 case "$CPPFLAGS" in
13231                 (*$cf_add_cflags)
13232                         ;;
13233                 (*)
13234                         case $cf_add_cflags in
13235                         (-D*)
13236                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13237
13238 CPPFLAGS=`echo "$CPPFLAGS" | \
13239         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13240                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13241
13242                                 ;;
13243                         esac
13244                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
13245                         ;;
13246                 esac
13247                 ;;
13248         (*)
13249                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
13250                 ;;
13251         esac
13252         ;;
13253 (yes)
13254         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13255
13256         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13257
13258         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13259                 && test -z "${cf_tst_cflags}" \
13260                 && cf_fix_cppflags=no
13261         ;;
13262 esac
13263 done
13264
13265 if test -n "$cf_new_cflags" ; then
13266         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13267
13268 echo "${as_me:-configure}:13268: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13269
13270         CFLAGS="$CFLAGS $cf_new_cflags"
13271 fi
13272
13273 if test -n "$cf_new_cppflags" ; then
13274         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13275
13276 echo "${as_me:-configure}:13276: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13277
13278         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
13279 fi
13280
13281 if test -n "$cf_new_extra_cppflags" ; then
13282         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13283
13284 echo "${as_me:-configure}:13284: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13285
13286         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
13287 fi
13288
13289 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13290 cat >conftest.$ac_ext <<_ACEOF
13291 #line 13291 "configure"
13292 #include "confdefs.h"
13293 #include <stdio.h>
13294 int
13295 main ()
13296 {
13297 printf("Hello world");
13298   ;
13299   return 0;
13300 }
13301 _ACEOF
13302 rm -f conftest.$ac_objext conftest$ac_exeext
13303 if { (eval echo "$as_me:13303: \"$ac_link\"") >&5
13304   (eval $ac_link) 2>&5
13305   ac_status=$?
13306   echo "$as_me:13306: \$? = $ac_status" >&5
13307   (exit $ac_status); } &&
13308          { ac_try='test -s conftest$ac_exeext'
13309   { (eval echo "$as_me:13309: \"$ac_try\"") >&5
13310   (eval $ac_try) 2>&5
13311   ac_status=$?
13312   echo "$as_me:13312: \$? = $ac_status" >&5
13313   (exit $ac_status); }; }; then
13314   :
13315 else
13316   echo "$as_me: failed program was:" >&5
13317 cat conftest.$ac_ext >&5
13318 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13319
13320 echo "${as_me:-configure}:13320: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13321
13322          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13323                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13324
13325 echo "${as_me:-configure}:13325: testing but keeping change to \$CPPFLAGS ..." 1>&5
13326
13327          fi
13328          CFLAGS="$cf_check_flags"
13329 fi
13330 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13331 fi
13332
13333 echo "$as_me:13333: checking for XOpenDisplay in -lX11" >&5
13334 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13335 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13336   echo $ECHO_N "(cached) $ECHO_C" >&6
13337 else
13338   ac_check_lib_save_LIBS=$LIBS
13339 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13340 cat >conftest.$ac_ext <<_ACEOF
13341 #line 13341 "configure"
13342 #include "confdefs.h"
13343
13344 /* Override any gcc2 internal prototype to avoid an error.  */
13345 #ifdef __cplusplus
13346 extern "C"
13347 #endif
13348 /* We use char because int might match the return type of a gcc2
13349    builtin and then its argument prototype would still apply.  */
13350 char XOpenDisplay ();
13351 int
13352 main ()
13353 {
13354 XOpenDisplay ();
13355   ;
13356   return 0;
13357 }
13358 _ACEOF
13359 rm -f conftest.$ac_objext conftest$ac_exeext
13360 if { (eval echo "$as_me:13360: \"$ac_link\"") >&5
13361   (eval $ac_link) 2>&5
13362   ac_status=$?
13363   echo "$as_me:13363: \$? = $ac_status" >&5
13364   (exit $ac_status); } &&
13365          { ac_try='test -s conftest$ac_exeext'
13366   { (eval echo "$as_me:13366: \"$ac_try\"") >&5
13367   (eval $ac_try) 2>&5
13368   ac_status=$?
13369   echo "$as_me:13369: \$? = $ac_status" >&5
13370   (exit $ac_status); }; }; then
13371   ac_cv_lib_X11_XOpenDisplay=yes
13372 else
13373   echo "$as_me: failed program was:" >&5
13374 cat conftest.$ac_ext >&5
13375 ac_cv_lib_X11_XOpenDisplay=no
13376 fi
13377 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13378 LIBS=$ac_check_lib_save_LIBS
13379 fi
13380 echo "$as_me:13380: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13381 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13382 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13383
13384 cf_add_libs="-lX11"
13385 # Filter out duplicates - this happens with badly-designed ".pc" files...
13386 for cf_add_1lib in $LIBS
13387 do
13388         for cf_add_2lib in $cf_add_libs
13389         do
13390                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13391                 then
13392                         cf_add_1lib=
13393                         break
13394                 fi
13395         done
13396         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13397 done
13398 LIBS="$cf_add_libs"
13399
13400 fi
13401
13402 echo "$as_me:13402: checking for XCurses library" >&5
13403 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13404 if test "${cf_cv_lib_XCurses+set}" = set; then
13405   echo $ECHO_N "(cached) $ECHO_C" >&6
13406 else
13407
13408 cf_add_libs="-lXCurses"
13409 # Filter out duplicates - this happens with badly-designed ".pc" files...
13410 for cf_add_1lib in $LIBS
13411 do
13412         for cf_add_2lib in $cf_add_libs
13413         do
13414                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13415                 then
13416                         cf_add_1lib=
13417                         break
13418                 fi
13419         done
13420         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13421 done
13422 LIBS="$cf_add_libs"
13423
13424 cat >conftest.$ac_ext <<_ACEOF
13425 #line 13425 "configure"
13426 #include "confdefs.h"
13427
13428 #include <xcurses.h>
13429 char *XCursesProgramName = "test";
13430
13431 int
13432 main ()
13433 {
13434 XCursesExit();
13435   ;
13436   return 0;
13437 }
13438 _ACEOF
13439 rm -f conftest.$ac_objext conftest$ac_exeext
13440 if { (eval echo "$as_me:13440: \"$ac_link\"") >&5
13441   (eval $ac_link) 2>&5
13442   ac_status=$?
13443   echo "$as_me:13443: \$? = $ac_status" >&5
13444   (exit $ac_status); } &&
13445          { ac_try='test -s conftest$ac_exeext'
13446   { (eval echo "$as_me:13446: \"$ac_try\"") >&5
13447   (eval $ac_try) 2>&5
13448   ac_status=$?
13449   echo "$as_me:13449: \$? = $ac_status" >&5
13450   (exit $ac_status); }; }; then
13451   cf_cv_lib_XCurses=yes
13452 else
13453   echo "$as_me: failed program was:" >&5
13454 cat conftest.$ac_ext >&5
13455 cf_cv_lib_XCurses=no
13456 fi
13457 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13458
13459 fi
13460 echo "$as_me:13460: result: $cf_cv_lib_XCurses" >&5
13461 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
13462
13463 fi
13464
13465 if test $cf_cv_lib_XCurses = yes ; then
13466
13467 cat >>confdefs.h <<\EOF
13468 #define UNIX 1
13469 EOF
13470
13471 cat >>confdefs.h <<\EOF
13472 #define XCURSES 1
13473 EOF
13474
13475         echo "$as_me:13475: checking for xcurses.h" >&5
13476 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
13477 if test "${ac_cv_header_xcurses_h+set}" = set; then
13478   echo $ECHO_N "(cached) $ECHO_C" >&6
13479 else
13480   cat >conftest.$ac_ext <<_ACEOF
13481 #line 13481 "configure"
13482 #include "confdefs.h"
13483 #include <xcurses.h>
13484 _ACEOF
13485 if { (eval echo "$as_me:13485: \"$ac_cpp conftest.$ac_ext\"") >&5
13486   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13487   ac_status=$?
13488   egrep -v '^ *\+' conftest.er1 >conftest.err
13489   rm -f conftest.er1
13490   cat conftest.err >&5
13491   echo "$as_me:13491: \$? = $ac_status" >&5
13492   (exit $ac_status); } >/dev/null; then
13493   if test -s conftest.err; then
13494     ac_cpp_err=$ac_c_preproc_warn_flag
13495   else
13496     ac_cpp_err=
13497   fi
13498 else
13499   ac_cpp_err=yes
13500 fi
13501 if test -z "$ac_cpp_err"; then
13502   ac_cv_header_xcurses_h=yes
13503 else
13504   echo "$as_me: failed program was:" >&5
13505   cat conftest.$ac_ext >&5
13506   ac_cv_header_xcurses_h=no
13507 fi
13508 rm -f conftest.err conftest.$ac_ext
13509 fi
13510 echo "$as_me:13510: result: $ac_cv_header_xcurses_h" >&5
13511 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
13512 if test $ac_cv_header_xcurses_h = yes; then
13513
13514 cat >>confdefs.h <<\EOF
13515 #define HAVE_XCURSES 1
13516 EOF
13517
13518 fi
13519
13520 else
13521         { { echo "$as_me:13521: error: Cannot link with XCurses" >&5
13522 echo "$as_me: error: Cannot link with XCurses" >&2;}
13523    { (exit 1); exit 1; }; }
13524 fi
13525
13526         ;;
13527 (*)
13528         { { echo "$as_me:13528: error: unexpected screen-value: $cf_cv_screen" >&5
13529 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
13530    { (exit 1); exit 1; }; }
13531         ;;
13532 esac
13533
13534 : ${cf_nculib_root:=$cf_cv_screen}
13535 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
13536 echo "$as_me:13536: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
13537 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
13538 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13539   echo $ECHO_N "(cached) $ECHO_C" >&6
13540 else
13541   ac_check_lib_save_LIBS=$LIBS
13542 LIBS="-l$cf_nculib_root  $LIBS"
13543 cat >conftest.$ac_ext <<_ACEOF
13544 #line 13544 "configure"
13545 #include "confdefs.h"
13546
13547 /* Override any gcc2 internal prototype to avoid an error.  */
13548 #ifdef __cplusplus
13549 extern "C"
13550 #endif
13551 /* We use char because int might match the return type of a gcc2
13552    builtin and then its argument prototype would still apply.  */
13553 char _nc_init_pthreads ();
13554 int
13555 main ()
13556 {
13557 _nc_init_pthreads ();
13558   ;
13559   return 0;
13560 }
13561 _ACEOF
13562 rm -f conftest.$ac_objext conftest$ac_exeext
13563 if { (eval echo "$as_me:13563: \"$ac_link\"") >&5
13564   (eval $ac_link) 2>&5
13565   ac_status=$?
13566   echo "$as_me:13566: \$? = $ac_status" >&5
13567   (exit $ac_status); } &&
13568          { ac_try='test -s conftest$ac_exeext'
13569   { (eval echo "$as_me:13569: \"$ac_try\"") >&5
13570   (eval $ac_try) 2>&5
13571   ac_status=$?
13572   echo "$as_me:13572: \$? = $ac_status" >&5
13573   (exit $ac_status); }; }; then
13574   eval "$as_ac_Lib=yes"
13575 else
13576   echo "$as_me: failed program was:" >&5
13577 cat conftest.$ac_ext >&5
13578 eval "$as_ac_Lib=no"
13579 fi
13580 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13581 LIBS=$ac_check_lib_save_LIBS
13582 fi
13583 echo "$as_me:13583: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13584 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13585 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13586   cf_cv_ncurses_pthreads=yes
13587 else
13588   cf_cv_ncurses_pthreads=no
13589 fi
13590
13591 if test "$cf_cv_ncurses_pthreads" = yes
13592 then
13593
13594 cf_add_libs="-lpthread"
13595 # Filter out duplicates - this happens with badly-designed ".pc" files...
13596 for cf_add_1lib in $LIBS
13597 do
13598         for cf_add_2lib in $cf_add_libs
13599         do
13600                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13601                 then
13602                         cf_add_1lib=
13603                         break
13604                 fi
13605         done
13606         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13607 done
13608 LIBS="$cf_add_libs"
13609
13610 fi
13611
13612 case $cf_cv_screen in
13613 (ncurses*)
13614         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
13615         ;;
13616 (curses|curses_*)
13617
13618 echo "$as_me:13618: checking for NetBSD form.h" >&5
13619 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
13620 if test "${cf_cv_netbsd_form_h+set}" = set; then
13621   echo $ECHO_N "(cached) $ECHO_C" >&6
13622 else
13623
13624 cat >conftest.$ac_ext <<_ACEOF
13625 #line 13625 "configure"
13626 #include "confdefs.h"
13627
13628 #include <${cf_cv_ncurses_header:-curses.h}>
13629 #include <form.h>
13630
13631 int
13632 main ()
13633 {
13634
13635         FORM *form;
13636         int y = current_field(form)->cursor_ypos;
13637         int x = current_field(form)->cursor_xpos;
13638
13639   ;
13640   return 0;
13641 }
13642 _ACEOF
13643 rm -f conftest.$ac_objext
13644 if { (eval echo "$as_me:13644: \"$ac_compile\"") >&5
13645   (eval $ac_compile) 2>&5
13646   ac_status=$?
13647   echo "$as_me:13647: \$? = $ac_status" >&5
13648   (exit $ac_status); } &&
13649          { ac_try='test -s conftest.$ac_objext'
13650   { (eval echo "$as_me:13650: \"$ac_try\"") >&5
13651   (eval $ac_try) 2>&5
13652   ac_status=$?
13653   echo "$as_me:13653: \$? = $ac_status" >&5
13654   (exit $ac_status); }; }; then
13655   cf_cv_netbsd_form_h=yes
13656
13657 else
13658   echo "$as_me: failed program was:" >&5
13659 cat conftest.$ac_ext >&5
13660 cf_cv_netbsd_form_h=no
13661 fi
13662 rm -f conftest.$ac_objext conftest.$ac_ext
13663
13664 fi
13665 echo "$as_me:13665: result: $cf_cv_netbsd_form_h" >&5
13666 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13667
13668 test "$cf_cv_netbsd_form_h" = yes &&
13669 cat >>confdefs.h <<\EOF
13670 #define HAVE_NETBSD_FORM_H 1
13671 EOF
13672
13673 echo "$as_me:13673: checking for NetBSD menu.h" >&5
13674 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13675 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13676   echo $ECHO_N "(cached) $ECHO_C" >&6
13677 else
13678
13679 cat >conftest.$ac_ext <<_ACEOF
13680 #line 13680 "configure"
13681 #include "confdefs.h"
13682
13683 #include <${cf_cv_ncurses_header:-curses.h}>
13684 #include <menu.h>
13685
13686 int
13687 main ()
13688 {
13689
13690         MENU *menu;
13691         int y = menu->max_item_width;
13692
13693   ;
13694   return 0;
13695 }
13696 _ACEOF
13697 rm -f conftest.$ac_objext
13698 if { (eval echo "$as_me:13698: \"$ac_compile\"") >&5
13699   (eval $ac_compile) 2>&5
13700   ac_status=$?
13701   echo "$as_me:13701: \$? = $ac_status" >&5
13702   (exit $ac_status); } &&
13703          { ac_try='test -s conftest.$ac_objext'
13704   { (eval echo "$as_me:13704: \"$ac_try\"") >&5
13705   (eval $ac_try) 2>&5
13706   ac_status=$?
13707   echo "$as_me:13707: \$? = $ac_status" >&5
13708   (exit $ac_status); }; }; then
13709   cf_cv_netbsd_menu_h=yes
13710
13711 else
13712   echo "$as_me: failed program was:" >&5
13713 cat conftest.$ac_ext >&5
13714 cf_cv_netbsd_menu_h=no
13715 fi
13716 rm -f conftest.$ac_objext conftest.$ac_ext
13717
13718 fi
13719 echo "$as_me:13719: result: $cf_cv_netbsd_menu_h" >&5
13720 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13721
13722 test "$cf_cv_netbsd_menu_h" = yes &&
13723 cat >>confdefs.h <<\EOF
13724 #define HAVE_NETBSD_MENU_H 1
13725 EOF
13726
13727         ;;
13728 esac
13729
13730 case $cf_cv_screen in
13731 (pdcurses)
13732         ;;
13733 (*)
13734         # look for curses-related libraries
13735
13736 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13737 echo "$as_me:13737: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13738 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13739 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13740   echo $ECHO_N "(cached) $ECHO_C" >&6
13741 else
13742   ac_check_lib_save_LIBS=$LIBS
13743 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13744 cat >conftest.$ac_ext <<_ACEOF
13745 #line 13745 "configure"
13746 #include "confdefs.h"
13747
13748 /* Override any gcc2 internal prototype to avoid an error.  */
13749 #ifdef __cplusplus
13750 extern "C"
13751 #endif
13752 /* We use char because int might match the return type of a gcc2
13753    builtin and then its argument prototype would still apply.  */
13754 char new_panel ();
13755 int
13756 main ()
13757 {
13758 new_panel ();
13759   ;
13760   return 0;
13761 }
13762 _ACEOF
13763 rm -f conftest.$ac_objext conftest$ac_exeext
13764 if { (eval echo "$as_me:13764: \"$ac_link\"") >&5
13765   (eval $ac_link) 2>&5
13766   ac_status=$?
13767   echo "$as_me:13767: \$? = $ac_status" >&5
13768   (exit $ac_status); } &&
13769          { ac_try='test -s conftest$ac_exeext'
13770   { (eval echo "$as_me:13770: \"$ac_try\"") >&5
13771   (eval $ac_try) 2>&5
13772   ac_status=$?
13773   echo "$as_me:13773: \$? = $ac_status" >&5
13774   (exit $ac_status); }; }; then
13775   eval "$as_ac_Lib=yes"
13776 else
13777   echo "$as_me: failed program was:" >&5
13778 cat conftest.$ac_ext >&5
13779 eval "$as_ac_Lib=no"
13780 fi
13781 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13782 LIBS=$ac_check_lib_save_LIBS
13783 fi
13784 echo "$as_me:13784: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13785 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13786 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13787
13788 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13789
13790 cf_add_libs="-lpanel$cf_cv_libtype"
13791 # Filter out duplicates - this happens with badly-designed ".pc" files...
13792 for cf_add_1lib in $LIBS
13793 do
13794         for cf_add_2lib in $cf_add_libs
13795         do
13796                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13797                 then
13798                         cf_add_1lib=
13799                         break
13800                 fi
13801         done
13802         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13803 done
13804 LIBS="$cf_add_libs"
13805
13806 cat >>confdefs.h <<EOF
13807 #define $cf_upper 1
13808 EOF
13809
13810 fi
13811
13812 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13813 echo "$as_me:13813: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13814 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13815 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13816   echo $ECHO_N "(cached) $ECHO_C" >&6
13817 else
13818   ac_check_lib_save_LIBS=$LIBS
13819 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13820 cat >conftest.$ac_ext <<_ACEOF
13821 #line 13821 "configure"
13822 #include "confdefs.h"
13823
13824 /* Override any gcc2 internal prototype to avoid an error.  */
13825 #ifdef __cplusplus
13826 extern "C"
13827 #endif
13828 /* We use char because int might match the return type of a gcc2
13829    builtin and then its argument prototype would still apply.  */
13830 char menu_driver ();
13831 int
13832 main ()
13833 {
13834 menu_driver ();
13835   ;
13836   return 0;
13837 }
13838 _ACEOF
13839 rm -f conftest.$ac_objext conftest$ac_exeext
13840 if { (eval echo "$as_me:13840: \"$ac_link\"") >&5
13841   (eval $ac_link) 2>&5
13842   ac_status=$?
13843   echo "$as_me:13843: \$? = $ac_status" >&5
13844   (exit $ac_status); } &&
13845          { ac_try='test -s conftest$ac_exeext'
13846   { (eval echo "$as_me:13846: \"$ac_try\"") >&5
13847   (eval $ac_try) 2>&5
13848   ac_status=$?
13849   echo "$as_me:13849: \$? = $ac_status" >&5
13850   (exit $ac_status); }; }; then
13851   eval "$as_ac_Lib=yes"
13852 else
13853   echo "$as_me: failed program was:" >&5
13854 cat conftest.$ac_ext >&5
13855 eval "$as_ac_Lib=no"
13856 fi
13857 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13858 LIBS=$ac_check_lib_save_LIBS
13859 fi
13860 echo "$as_me:13860: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13861 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13862 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13863
13864 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13865
13866 cf_add_libs="-lmenu$cf_cv_libtype"
13867 # Filter out duplicates - this happens with badly-designed ".pc" files...
13868 for cf_add_1lib in $LIBS
13869 do
13870         for cf_add_2lib in $cf_add_libs
13871         do
13872                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13873                 then
13874                         cf_add_1lib=
13875                         break
13876                 fi
13877         done
13878         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13879 done
13880 LIBS="$cf_add_libs"
13881
13882 cat >>confdefs.h <<EOF
13883 #define $cf_upper 1
13884 EOF
13885
13886 fi
13887
13888 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13889 echo "$as_me:13889: checking for form_driver in -lform$cf_cv_libtype" >&5
13890 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13891 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13892   echo $ECHO_N "(cached) $ECHO_C" >&6
13893 else
13894   ac_check_lib_save_LIBS=$LIBS
13895 LIBS="-lform$cf_cv_libtype  $LIBS"
13896 cat >conftest.$ac_ext <<_ACEOF
13897 #line 13897 "configure"
13898 #include "confdefs.h"
13899
13900 /* Override any gcc2 internal prototype to avoid an error.  */
13901 #ifdef __cplusplus
13902 extern "C"
13903 #endif
13904 /* We use char because int might match the return type of a gcc2
13905    builtin and then its argument prototype would still apply.  */
13906 char form_driver ();
13907 int
13908 main ()
13909 {
13910 form_driver ();
13911   ;
13912   return 0;
13913 }
13914 _ACEOF
13915 rm -f conftest.$ac_objext conftest$ac_exeext
13916 if { (eval echo "$as_me:13916: \"$ac_link\"") >&5
13917   (eval $ac_link) 2>&5
13918   ac_status=$?
13919   echo "$as_me:13919: \$? = $ac_status" >&5
13920   (exit $ac_status); } &&
13921          { ac_try='test -s conftest$ac_exeext'
13922   { (eval echo "$as_me:13922: \"$ac_try\"") >&5
13923   (eval $ac_try) 2>&5
13924   ac_status=$?
13925   echo "$as_me:13925: \$? = $ac_status" >&5
13926   (exit $ac_status); }; }; then
13927   eval "$as_ac_Lib=yes"
13928 else
13929   echo "$as_me: failed program was:" >&5
13930 cat conftest.$ac_ext >&5
13931 eval "$as_ac_Lib=no"
13932 fi
13933 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13934 LIBS=$ac_check_lib_save_LIBS
13935 fi
13936 echo "$as_me:13936: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13937 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13938 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13939
13940 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13941
13942 cf_add_libs="-lform$cf_cv_libtype"
13943 # Filter out duplicates - this happens with badly-designed ".pc" files...
13944 for cf_add_1lib in $LIBS
13945 do
13946         for cf_add_2lib in $cf_add_libs
13947         do
13948                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13949                 then
13950                         cf_add_1lib=
13951                         break
13952                 fi
13953         done
13954         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13955 done
13956 LIBS="$cf_add_libs"
13957
13958 cat >>confdefs.h <<EOF
13959 #define $cf_upper 1
13960 EOF
13961
13962 fi
13963
13964         # look for curses-related headers
13965
13966 for ac_header in \
13967                 nc_alloc.h \
13968                 nomacros.h \
13969                 form.h \
13970                 menu.h \
13971                 panel.h \
13972                 term_entry.h \
13973
13974 do
13975 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13976 echo "$as_me:13976: checking for $ac_header" >&5
13977 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13978 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13979   echo $ECHO_N "(cached) $ECHO_C" >&6
13980 else
13981   cat >conftest.$ac_ext <<_ACEOF
13982 #line 13982 "configure"
13983 #include "confdefs.h"
13984 #include <$ac_header>
13985 _ACEOF
13986 if { (eval echo "$as_me:13986: \"$ac_cpp conftest.$ac_ext\"") >&5
13987   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13988   ac_status=$?
13989   egrep -v '^ *\+' conftest.er1 >conftest.err
13990   rm -f conftest.er1
13991   cat conftest.err >&5
13992   echo "$as_me:13992: \$? = $ac_status" >&5
13993   (exit $ac_status); } >/dev/null; then
13994   if test -s conftest.err; then
13995     ac_cpp_err=$ac_c_preproc_warn_flag
13996   else
13997     ac_cpp_err=
13998   fi
13999 else
14000   ac_cpp_err=yes
14001 fi
14002 if test -z "$ac_cpp_err"; then
14003   eval "$as_ac_Header=yes"
14004 else
14005   echo "$as_me: failed program was:" >&5
14006   cat conftest.$ac_ext >&5
14007   eval "$as_ac_Header=no"
14008 fi
14009 rm -f conftest.err conftest.$ac_ext
14010 fi
14011 echo "$as_me:14011: result: `eval echo '${'$as_ac_Header'}'`" >&5
14012 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14013 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14014   cat >>confdefs.h <<EOF
14015 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14016 EOF
14017
14018 fi
14019 done
14020
14021         ;;
14022 esac
14023
14024 echo "$as_me:14024: checking for ANSI C header files" >&5
14025 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14026 if test "${ac_cv_header_stdc+set}" = set; then
14027   echo $ECHO_N "(cached) $ECHO_C" >&6
14028 else
14029   cat >conftest.$ac_ext <<_ACEOF
14030 #line 14030 "configure"
14031 #include "confdefs.h"
14032 #include <stdlib.h>
14033 #include <stdarg.h>
14034 #include <string.h>
14035 #include <float.h>
14036
14037 _ACEOF
14038 if { (eval echo "$as_me:14038: \"$ac_cpp conftest.$ac_ext\"") >&5
14039   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14040   ac_status=$?
14041   egrep -v '^ *\+' conftest.er1 >conftest.err
14042   rm -f conftest.er1
14043   cat conftest.err >&5
14044   echo "$as_me:14044: \$? = $ac_status" >&5
14045   (exit $ac_status); } >/dev/null; then
14046   if test -s conftest.err; then
14047     ac_cpp_err=$ac_c_preproc_warn_flag
14048   else
14049     ac_cpp_err=
14050   fi
14051 else
14052   ac_cpp_err=yes
14053 fi
14054 if test -z "$ac_cpp_err"; then
14055   ac_cv_header_stdc=yes
14056 else
14057   echo "$as_me: failed program was:" >&5
14058   cat conftest.$ac_ext >&5
14059   ac_cv_header_stdc=no
14060 fi
14061 rm -f conftest.err conftest.$ac_ext
14062
14063 if test $ac_cv_header_stdc = yes; then
14064   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14065   cat >conftest.$ac_ext <<_ACEOF
14066 #line 14066 "configure"
14067 #include "confdefs.h"
14068 #include <string.h>
14069
14070 _ACEOF
14071 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14072   egrep "memchr" >/dev/null 2>&1; then
14073   :
14074 else
14075   ac_cv_header_stdc=no
14076 fi
14077 rm -rf conftest*
14078
14079 fi
14080
14081 if test $ac_cv_header_stdc = yes; then
14082   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14083   cat >conftest.$ac_ext <<_ACEOF
14084 #line 14084 "configure"
14085 #include "confdefs.h"
14086 #include <stdlib.h>
14087
14088 _ACEOF
14089 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14090   egrep "free" >/dev/null 2>&1; then
14091   :
14092 else
14093   ac_cv_header_stdc=no
14094 fi
14095 rm -rf conftest*
14096
14097 fi
14098
14099 if test $ac_cv_header_stdc = yes; then
14100   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14101   if test "$cross_compiling" = yes; then
14102   :
14103 else
14104   cat >conftest.$ac_ext <<_ACEOF
14105 #line 14105 "configure"
14106 #include "confdefs.h"
14107 #include <ctype.h>
14108 #if ((' ' & 0x0FF) == 0x020)
14109 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14110 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14111 #else
14112 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14113                      || ('j' <= (c) && (c) <= 'r') \
14114                      || ('s' <= (c) && (c) <= 'z'))
14115 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14116 #endif
14117
14118 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14119 int
14120 main ()
14121 {
14122   int i;
14123   for (i = 0; i < 256; i++)
14124     if (XOR (islower (i), ISLOWER (i))
14125         || toupper (i) != TOUPPER (i))
14126       $ac_main_return(2);
14127   $ac_main_return (0);
14128 }
14129 _ACEOF
14130 rm -f conftest$ac_exeext
14131 if { (eval echo "$as_me:14131: \"$ac_link\"") >&5
14132   (eval $ac_link) 2>&5
14133   ac_status=$?
14134   echo "$as_me:14134: \$? = $ac_status" >&5
14135   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14136   { (eval echo "$as_me:14136: \"$ac_try\"") >&5
14137   (eval $ac_try) 2>&5
14138   ac_status=$?
14139   echo "$as_me:14139: \$? = $ac_status" >&5
14140   (exit $ac_status); }; }; then
14141   :
14142 else
14143   echo "$as_me: program exited with status $ac_status" >&5
14144 echo "$as_me: failed program was:" >&5
14145 cat conftest.$ac_ext >&5
14146 ac_cv_header_stdc=no
14147 fi
14148 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14149 fi
14150 fi
14151 fi
14152 echo "$as_me:14152: result: $ac_cv_header_stdc" >&5
14153 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14154 if test $ac_cv_header_stdc = yes; then
14155
14156 cat >>confdefs.h <<\EOF
14157 #define STDC_HEADERS 1
14158 EOF
14159
14160 fi
14161
14162 echo "$as_me:14162: checking whether time.h and sys/time.h may both be included" >&5
14163 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
14164 if test "${ac_cv_header_time+set}" = set; then
14165   echo $ECHO_N "(cached) $ECHO_C" >&6
14166 else
14167   cat >conftest.$ac_ext <<_ACEOF
14168 #line 14168 "configure"
14169 #include "confdefs.h"
14170 #include <sys/types.h>
14171 #include <sys/time.h>
14172 #include <time.h>
14173
14174 int
14175 main ()
14176 {
14177 if ((struct tm *) 0)
14178 return 0;
14179   ;
14180   return 0;
14181 }
14182 _ACEOF
14183 rm -f conftest.$ac_objext
14184 if { (eval echo "$as_me:14184: \"$ac_compile\"") >&5
14185   (eval $ac_compile) 2>&5
14186   ac_status=$?
14187   echo "$as_me:14187: \$? = $ac_status" >&5
14188   (exit $ac_status); } &&
14189          { ac_try='test -s conftest.$ac_objext'
14190   { (eval echo "$as_me:14190: \"$ac_try\"") >&5
14191   (eval $ac_try) 2>&5
14192   ac_status=$?
14193   echo "$as_me:14193: \$? = $ac_status" >&5
14194   (exit $ac_status); }; }; then
14195   ac_cv_header_time=yes
14196 else
14197   echo "$as_me: failed program was:" >&5
14198 cat conftest.$ac_ext >&5
14199 ac_cv_header_time=no
14200 fi
14201 rm -f conftest.$ac_objext conftest.$ac_ext
14202 fi
14203 echo "$as_me:14203: result: $ac_cv_header_time" >&5
14204 echo "${ECHO_T}$ac_cv_header_time" >&6
14205 if test $ac_cv_header_time = yes; then
14206
14207 cat >>confdefs.h <<\EOF
14208 #define TIME_WITH_SYS_TIME 1
14209 EOF
14210
14211 fi
14212
14213 for ac_header in \
14214 getopt.h \
14215 locale.h \
14216 math.h \
14217 stdarg.h \
14218 sys/ioctl.h \
14219 sys/select.h \
14220 sys/time.h \
14221 termios.h \
14222 unistd.h \
14223
14224 do
14225 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14226 echo "$as_me:14226: checking for $ac_header" >&5
14227 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14228 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14229   echo $ECHO_N "(cached) $ECHO_C" >&6
14230 else
14231   cat >conftest.$ac_ext <<_ACEOF
14232 #line 14232 "configure"
14233 #include "confdefs.h"
14234 #include <$ac_header>
14235 _ACEOF
14236 if { (eval echo "$as_me:14236: \"$ac_cpp conftest.$ac_ext\"") >&5
14237   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14238   ac_status=$?
14239   egrep -v '^ *\+' conftest.er1 >conftest.err
14240   rm -f conftest.er1
14241   cat conftest.err >&5
14242   echo "$as_me:14242: \$? = $ac_status" >&5
14243   (exit $ac_status); } >/dev/null; then
14244   if test -s conftest.err; then
14245     ac_cpp_err=$ac_c_preproc_warn_flag
14246   else
14247     ac_cpp_err=
14248   fi
14249 else
14250   ac_cpp_err=yes
14251 fi
14252 if test -z "$ac_cpp_err"; then
14253   eval "$as_ac_Header=yes"
14254 else
14255   echo "$as_me: failed program was:" >&5
14256   cat conftest.$ac_ext >&5
14257   eval "$as_ac_Header=no"
14258 fi
14259 rm -f conftest.err conftest.$ac_ext
14260 fi
14261 echo "$as_me:14261: result: `eval echo '${'$as_ac_Header'}'`" >&5
14262 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14263 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14264   cat >>confdefs.h <<EOF
14265 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14266 EOF
14267
14268 fi
14269 done
14270
14271 for ac_header in unistd.h getopt.h
14272 do
14273 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14274 echo "$as_me:14274: checking for $ac_header" >&5
14275 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14276 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14277   echo $ECHO_N "(cached) $ECHO_C" >&6
14278 else
14279   cat >conftest.$ac_ext <<_ACEOF
14280 #line 14280 "configure"
14281 #include "confdefs.h"
14282 #include <$ac_header>
14283 _ACEOF
14284 if { (eval echo "$as_me:14284: \"$ac_cpp conftest.$ac_ext\"") >&5
14285   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14286   ac_status=$?
14287   egrep -v '^ *\+' conftest.er1 >conftest.err
14288   rm -f conftest.er1
14289   cat conftest.err >&5
14290   echo "$as_me:14290: \$? = $ac_status" >&5
14291   (exit $ac_status); } >/dev/null; then
14292   if test -s conftest.err; then
14293     ac_cpp_err=$ac_c_preproc_warn_flag
14294   else
14295     ac_cpp_err=
14296   fi
14297 else
14298   ac_cpp_err=yes
14299 fi
14300 if test -z "$ac_cpp_err"; then
14301   eval "$as_ac_Header=yes"
14302 else
14303   echo "$as_me: failed program was:" >&5
14304   cat conftest.$ac_ext >&5
14305   eval "$as_ac_Header=no"
14306 fi
14307 rm -f conftest.err conftest.$ac_ext
14308 fi
14309 echo "$as_me:14309: result: `eval echo '${'$as_ac_Header'}'`" >&5
14310 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14311 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14312   cat >>confdefs.h <<EOF
14313 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14314 EOF
14315
14316 fi
14317 done
14318
14319 echo "$as_me:14319: checking for header declaring getopt variables" >&5
14320 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
14321 if test "${cf_cv_getopt_header+set}" = set; then
14322   echo $ECHO_N "(cached) $ECHO_C" >&6
14323 else
14324
14325 cf_cv_getopt_header=none
14326 for cf_header in stdio.h stdlib.h unistd.h getopt.h
14327 do
14328 cat >conftest.$ac_ext <<_ACEOF
14329 #line 14329 "configure"
14330 #include "confdefs.h"
14331
14332 #include <$cf_header>
14333 int
14334 main ()
14335 {
14336 int x = optind; char *y = optarg
14337   ;
14338   return 0;
14339 }
14340 _ACEOF
14341 rm -f conftest.$ac_objext
14342 if { (eval echo "$as_me:14342: \"$ac_compile\"") >&5
14343   (eval $ac_compile) 2>&5
14344   ac_status=$?
14345   echo "$as_me:14345: \$? = $ac_status" >&5
14346   (exit $ac_status); } &&
14347          { ac_try='test -s conftest.$ac_objext'
14348   { (eval echo "$as_me:14348: \"$ac_try\"") >&5
14349   (eval $ac_try) 2>&5
14350   ac_status=$?
14351   echo "$as_me:14351: \$? = $ac_status" >&5
14352   (exit $ac_status); }; }; then
14353   cf_cv_getopt_header=$cf_header
14354  break
14355 else
14356   echo "$as_me: failed program was:" >&5
14357 cat conftest.$ac_ext >&5
14358 fi
14359 rm -f conftest.$ac_objext conftest.$ac_ext
14360 done
14361
14362 fi
14363 echo "$as_me:14363: result: $cf_cv_getopt_header" >&5
14364 echo "${ECHO_T}$cf_cv_getopt_header" >&6
14365 if test $cf_cv_getopt_header != none ; then
14366
14367 cat >>confdefs.h <<\EOF
14368 #define HAVE_GETOPT_HEADER 1
14369 EOF
14370
14371 fi
14372 if test $cf_cv_getopt_header = getopt.h ; then
14373
14374 cat >>confdefs.h <<\EOF
14375 #define NEED_GETOPT_H 1
14376 EOF
14377
14378 fi
14379
14380 for ac_func in \
14381 getopt \
14382 gettimeofday \
14383
14384 do
14385 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14386 echo "$as_me:14386: checking for $ac_func" >&5
14387 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14388 if eval "test \"\${$as_ac_var+set}\" = set"; then
14389   echo $ECHO_N "(cached) $ECHO_C" >&6
14390 else
14391   cat >conftest.$ac_ext <<_ACEOF
14392 #line 14392 "configure"
14393 #include "confdefs.h"
14394 /* System header to define __stub macros and hopefully few prototypes,
14395     which can conflict with char $ac_func (); below.  */
14396 #include <assert.h>
14397 /* Override any gcc2 internal prototype to avoid an error.  */
14398 #ifdef __cplusplus
14399 extern "C"
14400 #endif
14401 /* We use char because int might match the return type of a gcc2
14402    builtin and then its argument prototype would still apply.  */
14403 char $ac_func ();
14404 char (*f) ();
14405
14406 int
14407 main ()
14408 {
14409 /* The GNU C library defines this for functions which it implements
14410     to always fail with ENOSYS.  Some functions are actually named
14411     something starting with __ and the normal name is an alias.  */
14412 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14413 choke me
14414 #else
14415 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14416 #endif
14417
14418   ;
14419   return 0;
14420 }
14421 _ACEOF
14422 rm -f conftest.$ac_objext conftest$ac_exeext
14423 if { (eval echo "$as_me:14423: \"$ac_link\"") >&5
14424   (eval $ac_link) 2>&5
14425   ac_status=$?
14426   echo "$as_me:14426: \$? = $ac_status" >&5
14427   (exit $ac_status); } &&
14428          { ac_try='test -s conftest$ac_exeext'
14429   { (eval echo "$as_me:14429: \"$ac_try\"") >&5
14430   (eval $ac_try) 2>&5
14431   ac_status=$?
14432   echo "$as_me:14432: \$? = $ac_status" >&5
14433   (exit $ac_status); }; }; then
14434   eval "$as_ac_var=yes"
14435 else
14436   echo "$as_me: failed program was:" >&5
14437 cat conftest.$ac_ext >&5
14438 eval "$as_ac_var=no"
14439 fi
14440 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14441 fi
14442 echo "$as_me:14442: result: `eval echo '${'$as_ac_var'}'`" >&5
14443 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14444 if test `eval echo '${'$as_ac_var'}'` = yes; then
14445   cat >>confdefs.h <<EOF
14446 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14447 EOF
14448
14449 fi
14450 done
14451
14452 if test "x$ac_cv_func_getopt" = xno; then
14453         { { echo "$as_me:14453: error: getopt is required for building programs" >&5
14454 echo "$as_me: error: getopt is required for building programs" >&2;}
14455    { (exit 1); exit 1; }; }
14456 fi
14457
14458 if test "$cf_enable_widec" = yes; then
14459
14460 for ac_func in \
14461 mblen \
14462 mbrlen \
14463 mbrtowc \
14464 mbsrtowcs \
14465 mbstowcs \
14466 mbtowc \
14467 wcsrtombs \
14468 wcstombs \
14469
14470 do
14471 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14472 echo "$as_me:14472: checking for $ac_func" >&5
14473 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14474 if eval "test \"\${$as_ac_var+set}\" = set"; then
14475   echo $ECHO_N "(cached) $ECHO_C" >&6
14476 else
14477   cat >conftest.$ac_ext <<_ACEOF
14478 #line 14478 "configure"
14479 #include "confdefs.h"
14480 /* System header to define __stub macros and hopefully few prototypes,
14481     which can conflict with char $ac_func (); below.  */
14482 #include <assert.h>
14483 /* Override any gcc2 internal prototype to avoid an error.  */
14484 #ifdef __cplusplus
14485 extern "C"
14486 #endif
14487 /* We use char because int might match the return type of a gcc2
14488    builtin and then its argument prototype would still apply.  */
14489 char $ac_func ();
14490 char (*f) ();
14491
14492 int
14493 main ()
14494 {
14495 /* The GNU C library defines this for functions which it implements
14496     to always fail with ENOSYS.  Some functions are actually named
14497     something starting with __ and the normal name is an alias.  */
14498 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14499 choke me
14500 #else
14501 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14502 #endif
14503
14504   ;
14505   return 0;
14506 }
14507 _ACEOF
14508 rm -f conftest.$ac_objext conftest$ac_exeext
14509 if { (eval echo "$as_me:14509: \"$ac_link\"") >&5
14510   (eval $ac_link) 2>&5
14511   ac_status=$?
14512   echo "$as_me:14512: \$? = $ac_status" >&5
14513   (exit $ac_status); } &&
14514          { ac_try='test -s conftest$ac_exeext'
14515   { (eval echo "$as_me:14515: \"$ac_try\"") >&5
14516   (eval $ac_try) 2>&5
14517   ac_status=$?
14518   echo "$as_me:14518: \$? = $ac_status" >&5
14519   (exit $ac_status); }; }; then
14520   eval "$as_ac_var=yes"
14521 else
14522   echo "$as_me: failed program was:" >&5
14523 cat conftest.$ac_ext >&5
14524 eval "$as_ac_var=no"
14525 fi
14526 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14527 fi
14528 echo "$as_me:14528: result: `eval echo '${'$as_ac_var'}'`" >&5
14529 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14530 if test `eval echo '${'$as_ac_var'}'` = yes; then
14531   cat >>confdefs.h <<EOF
14532 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14533 EOF
14534
14535 fi
14536 done
14537
14538 fi
14539
14540 echo "$as_me:14540: checking definition to turn on extended curses functions" >&5
14541 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
14542 if test "${cf_cv_need_xopen_extension+set}" = set; then
14543   echo $ECHO_N "(cached) $ECHO_C" >&6
14544 else
14545
14546 cf_cv_need_xopen_extension=unknown
14547 cat >conftest.$ac_ext <<_ACEOF
14548 #line 14548 "configure"
14549 #include "confdefs.h"
14550
14551 #include <stdlib.h>
14552 #include <${cf_cv_ncurses_header:-curses.h}>
14553 int
14554 main ()
14555 {
14556
14557 #if defined(NCURSES_VERSION_PATCH)
14558 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
14559         make an error
14560 #endif
14561 #endif
14562 #ifdef NCURSES_VERSION
14563         cchar_t check;
14564         int check2 = curs_set((int)sizeof(check));
14565 #endif
14566         long x = winnstr(stdscr, "", 0);
14567         int x1, y1;
14568         getbegyx(stdscr, y1, x1)
14569   ;
14570   return 0;
14571 }
14572 _ACEOF
14573 rm -f conftest.$ac_objext conftest$ac_exeext
14574 if { (eval echo "$as_me:14574: \"$ac_link\"") >&5
14575   (eval $ac_link) 2>&5
14576   ac_status=$?
14577   echo "$as_me:14577: \$? = $ac_status" >&5
14578   (exit $ac_status); } &&
14579          { ac_try='test -s conftest$ac_exeext'
14580   { (eval echo "$as_me:14580: \"$ac_try\"") >&5
14581   (eval $ac_try) 2>&5
14582   ac_status=$?
14583   echo "$as_me:14583: \$? = $ac_status" >&5
14584   (exit $ac_status); }; }; then
14585   cf_cv_need_xopen_extension=none
14586 else
14587   echo "$as_me: failed program was:" >&5
14588 cat conftest.$ac_ext >&5
14589
14590         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
14591         do
14592                 cat >conftest.$ac_ext <<_ACEOF
14593 #line 14593 "configure"
14594 #include "confdefs.h"
14595
14596 #define $cf_try_xopen_extension 1
14597 #include <stdlib.h>
14598 #include <${cf_cv_ncurses_header:-curses.h}>
14599 int
14600 main ()
14601 {
14602
14603 #ifdef NCURSES_VERSION
14604                 cchar_t check;
14605                 int check2 = curs_set((int)sizeof(check));
14606 #endif
14607                 long x = winnstr(stdscr, "", 0);
14608                 int x1, y1;
14609                 getbegyx(stdscr, y1, x1)
14610   ;
14611   return 0;
14612 }
14613 _ACEOF
14614 rm -f conftest.$ac_objext conftest$ac_exeext
14615 if { (eval echo "$as_me:14615: \"$ac_link\"") >&5
14616   (eval $ac_link) 2>&5
14617   ac_status=$?
14618   echo "$as_me:14618: \$? = $ac_status" >&5
14619   (exit $ac_status); } &&
14620          { ac_try='test -s conftest$ac_exeext'
14621   { (eval echo "$as_me:14621: \"$ac_try\"") >&5
14622   (eval $ac_try) 2>&5
14623   ac_status=$?
14624   echo "$as_me:14624: \$? = $ac_status" >&5
14625   (exit $ac_status); }; }; then
14626   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
14627 else
14628   echo "$as_me: failed program was:" >&5
14629 cat conftest.$ac_ext >&5
14630 fi
14631 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14632         done
14633
14634 fi
14635 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14636
14637 fi
14638 echo "$as_me:14638: result: $cf_cv_need_xopen_extension" >&5
14639 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14640
14641 case $cf_cv_need_xopen_extension in
14642 (*_*)
14643         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
14644         ;;
14645 esac
14646
14647 echo "$as_me:14647: checking for term.h" >&5
14648 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14649 if test "${cf_cv_term_header+set}" = set; then
14650   echo $ECHO_N "(cached) $ECHO_C" >&6
14651 else
14652
14653 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14654 # for <term.h> if we do not find the variant.
14655
14656 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14657
14658 case ${cf_cv_ncurses_header:-curses.h} in
14659 (*/*)
14660         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14661         cf_header_list="$cf_header_item $cf_header_list"
14662         ;;
14663 esac
14664
14665 for cf_header in $cf_header_list
14666 do
14667         cat >conftest.$ac_ext <<_ACEOF
14668 #line 14668 "configure"
14669 #include "confdefs.h"
14670
14671 #include <${cf_cv_ncurses_header:-curses.h}>
14672 #include <${cf_header}>
14673 int
14674 main ()
14675 {
14676 WINDOW *x
14677   ;
14678   return 0;
14679 }
14680 _ACEOF
14681 rm -f conftest.$ac_objext
14682 if { (eval echo "$as_me:14682: \"$ac_compile\"") >&5
14683   (eval $ac_compile) 2>&5
14684   ac_status=$?
14685   echo "$as_me:14685: \$? = $ac_status" >&5
14686   (exit $ac_status); } &&
14687          { ac_try='test -s conftest.$ac_objext'
14688   { (eval echo "$as_me:14688: \"$ac_try\"") >&5
14689   (eval $ac_try) 2>&5
14690   ac_status=$?
14691   echo "$as_me:14691: \$? = $ac_status" >&5
14692   (exit $ac_status); }; }; then
14693   cf_cv_term_header=$cf_header
14694          break
14695 else
14696   echo "$as_me: failed program was:" >&5
14697 cat conftest.$ac_ext >&5
14698 cf_cv_term_header=no
14699 fi
14700 rm -f conftest.$ac_objext conftest.$ac_ext
14701 done
14702
14703 case $cf_cv_term_header in
14704 (no)
14705         # If curses is ncurses, some packagers still mess it up by trying to make
14706         # us use GNU termcap.  This handles the most common case.
14707         for cf_header in ncurses/term.h ncursesw/term.h
14708         do
14709                 cat >conftest.$ac_ext <<_ACEOF
14710 #line 14710 "configure"
14711 #include "confdefs.h"
14712
14713 #include <${cf_cv_ncurses_header:-curses.h}>
14714 #ifdef NCURSES_VERSION
14715 #include <${cf_header}>
14716 #else
14717 make an error
14718 #endif
14719 int
14720 main ()
14721 {
14722 WINDOW *x
14723   ;
14724   return 0;
14725 }
14726 _ACEOF
14727 rm -f conftest.$ac_objext
14728 if { (eval echo "$as_me:14728: \"$ac_compile\"") >&5
14729   (eval $ac_compile) 2>&5
14730   ac_status=$?
14731   echo "$as_me:14731: \$? = $ac_status" >&5
14732   (exit $ac_status); } &&
14733          { ac_try='test -s conftest.$ac_objext'
14734   { (eval echo "$as_me:14734: \"$ac_try\"") >&5
14735   (eval $ac_try) 2>&5
14736   ac_status=$?
14737   echo "$as_me:14737: \$? = $ac_status" >&5
14738   (exit $ac_status); }; }; then
14739   cf_cv_term_header=$cf_header
14740                          break
14741 else
14742   echo "$as_me: failed program was:" >&5
14743 cat conftest.$ac_ext >&5
14744 cf_cv_term_header=no
14745 fi
14746 rm -f conftest.$ac_objext conftest.$ac_ext
14747         done
14748         ;;
14749 esac
14750
14751 fi
14752 echo "$as_me:14752: result: $cf_cv_term_header" >&5
14753 echo "${ECHO_T}$cf_cv_term_header" >&6
14754
14755 case $cf_cv_term_header in
14756 (term.h)
14757
14758 cat >>confdefs.h <<\EOF
14759 #define HAVE_TERM_H 1
14760 EOF
14761
14762         ;;
14763 (ncurses/term.h)
14764
14765 cat >>confdefs.h <<\EOF
14766 #define HAVE_NCURSES_TERM_H 1
14767 EOF
14768
14769         ;;
14770 (ncursesw/term.h)
14771
14772 cat >>confdefs.h <<\EOF
14773 #define HAVE_NCURSESW_TERM_H 1
14774 EOF
14775
14776         ;;
14777 esac
14778
14779 echo "$as_me:14779: checking for unctrl.h" >&5
14780 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14781 if test "${cf_cv_unctrl_header+set}" = set; then
14782   echo $ECHO_N "(cached) $ECHO_C" >&6
14783 else
14784
14785 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14786 # for <unctrl.h> if we do not find the variant.
14787
14788 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14789
14790 case ${cf_cv_ncurses_header:-curses.h} in
14791 (*/*)
14792         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14793         cf_header_list="$cf_header_item $cf_header_list"
14794         ;;
14795 esac
14796
14797 for cf_header in $cf_header_list
14798 do
14799         cat >conftest.$ac_ext <<_ACEOF
14800 #line 14800 "configure"
14801 #include "confdefs.h"
14802
14803 #include <${cf_cv_ncurses_header:-curses.h}>
14804 #include <${cf_header}>
14805 int
14806 main ()
14807 {
14808 WINDOW *x
14809   ;
14810   return 0;
14811 }
14812 _ACEOF
14813 rm -f conftest.$ac_objext
14814 if { (eval echo "$as_me:14814: \"$ac_compile\"") >&5
14815   (eval $ac_compile) 2>&5
14816   ac_status=$?
14817   echo "$as_me:14817: \$? = $ac_status" >&5
14818   (exit $ac_status); } &&
14819          { ac_try='test -s conftest.$ac_objext'
14820   { (eval echo "$as_me:14820: \"$ac_try\"") >&5
14821   (eval $ac_try) 2>&5
14822   ac_status=$?
14823   echo "$as_me:14823: \$? = $ac_status" >&5
14824   (exit $ac_status); }; }; then
14825   cf_cv_unctrl_header=$cf_header
14826          break
14827 else
14828   echo "$as_me: failed program was:" >&5
14829 cat conftest.$ac_ext >&5
14830 cf_cv_unctrl_header=no
14831 fi
14832 rm -f conftest.$ac_objext conftest.$ac_ext
14833 done
14834
14835 fi
14836 echo "$as_me:14836: result: $cf_cv_unctrl_header" >&5
14837 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14838
14839 case $cf_cv_unctrl_header in
14840 (no)
14841         { echo "$as_me:14841: WARNING: unctrl.h header not found" >&5
14842 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14843         ;;
14844 esac
14845
14846 case $cf_cv_unctrl_header in
14847 (unctrl.h)
14848
14849 cat >>confdefs.h <<\EOF
14850 #define HAVE_UNCTRL_H 1
14851 EOF
14852
14853         ;;
14854 (ncurses/unctrl.h)
14855
14856 cat >>confdefs.h <<\EOF
14857 #define HAVE_NCURSES_UNCTRL_H 1
14858 EOF
14859
14860         ;;
14861 (ncursesw/unctrl.h)
14862
14863 cat >>confdefs.h <<\EOF
14864 #define HAVE_NCURSESW_UNCTRL_H 1
14865 EOF
14866
14867         ;;
14868 esac
14869
14870 for cf_func in \
14871 assume_default_colors \
14872 chgat \
14873 color_set \
14874 filter \
14875 getbegx \
14876 getcurx \
14877 getmaxx \
14878 getnstr \
14879 getparx \
14880 getwin \
14881 mvvline \
14882 mvwvline \
14883 napms \
14884 putwin \
14885 resize_term \
14886 resizeterm \
14887 restartterm \
14888 ripoffline \
14889 scr_dump \
14890 setupterm \
14891 slk_color \
14892 slk_init \
14893 termattrs \
14894 tgetent \
14895 tigetnum \
14896 tigetstr \
14897 typeahead \
14898 use_default_colors \
14899 use_env \
14900 use_extended_names \
14901 use_screen \
14902 use_window \
14903 vid_puts \
14904 vidputs \
14905 vsscanf \
14906 vw_printw \
14907 wchgat \
14908 winsstr \
14909 wresize \
14910 wsyncdown \
14911
14912 do
14913
14914 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14915
14916         echo "$as_me:14916: checking for ${cf_func}" >&5
14917 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14918
14919 echo "${as_me:-configure}:14919: testing ${cf_func} ..." 1>&5
14920
14921         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14922   echo $ECHO_N "(cached) $ECHO_C" >&6
14923 else
14924
14925                 eval cf_result='$ac_cv_func_'$cf_func
14926                 if test ".$cf_result" != ".no"; then
14927                         cat >conftest.$ac_ext <<_ACEOF
14928 #line 14928 "configure"
14929 #include "confdefs.h"
14930
14931 #ifdef HAVE_XCURSES
14932 #include <xcurses.h>
14933 char * XCursesProgramName = "test";
14934 #else
14935 #include <${cf_cv_ncurses_header:-curses.h}>
14936 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14937 #include <ncursesw/term.h>
14938 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14939 #include <ncurses/term.h>
14940 #elif defined(HAVE_TERM_H)
14941 #include <term.h>
14942 #endif
14943 #endif
14944
14945 int
14946 main ()
14947 {
14948
14949 #ifndef ${cf_func}
14950 long foo = (long)(&${cf_func});
14951 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14952 if (foo + 1234 > 5678)
14953         ${cf_cv_main_return:-return}(foo);
14954 #endif
14955
14956   ;
14957   return 0;
14958 }
14959 _ACEOF
14960 rm -f conftest.$ac_objext conftest$ac_exeext
14961 if { (eval echo "$as_me:14961: \"$ac_link\"") >&5
14962   (eval $ac_link) 2>&5
14963   ac_status=$?
14964   echo "$as_me:14964: \$? = $ac_status" >&5
14965   (exit $ac_status); } &&
14966          { ac_try='test -s conftest$ac_exeext'
14967   { (eval echo "$as_me:14967: \"$ac_try\"") >&5
14968   (eval $ac_try) 2>&5
14969   ac_status=$?
14970   echo "$as_me:14970: \$? = $ac_status" >&5
14971   (exit $ac_status); }; }; then
14972   cf_result=yes
14973 else
14974   echo "$as_me: failed program was:" >&5
14975 cat conftest.$ac_ext >&5
14976 cf_result=no
14977 fi
14978 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14979                 fi
14980                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14981
14982 fi
14983
14984         # use the computed/retrieved cache-value:
14985         eval 'cf_result=$cf_cv_func_'$cf_func
14986         echo "$as_me:14986: result: $cf_result" >&5
14987 echo "${ECHO_T}$cf_result" >&6
14988         if test $cf_result != no; then
14989                 cat >>confdefs.h <<EOF
14990 #define HAVE_${cf_tr_func} 1
14991 EOF
14992
14993         fi
14994 done
14995
14996 for cf_func in tputs
14997 do
14998
14999 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15000
15001         echo "$as_me:15001: checking for ${cf_func}" >&5
15002 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
15003
15004 echo "${as_me:-configure}:15004: testing ${cf_func} ..." 1>&5
15005
15006         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
15007   echo $ECHO_N "(cached) $ECHO_C" >&6
15008 else
15009
15010                 eval cf_result='$ac_cv_func_'$cf_func
15011                 if test ".$cf_result" != ".no"; then
15012                         cat >conftest.$ac_ext <<_ACEOF
15013 #line 15013 "configure"
15014 #include "confdefs.h"
15015
15016 #ifdef HAVE_XCURSES
15017 #include <xcurses.h>
15018 char * XCursesProgramName = "test";
15019 #else
15020 #include <${cf_cv_ncurses_header:-curses.h}>
15021 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15022 #include <ncursesw/term.h>
15023 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15024 #include <ncurses/term.h>
15025 #elif defined(HAVE_TERM_H)
15026 #include <term.h>
15027 #endif
15028 #endif
15029
15030 int
15031 main ()
15032 {
15033
15034 #ifndef ${cf_func}
15035 long foo = (long)(&${cf_func});
15036 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
15037 if (foo + 1234 > 5678)
15038         ${cf_cv_main_return:-return}(foo);
15039 #endif
15040
15041   ;
15042   return 0;
15043 }
15044 _ACEOF
15045 rm -f conftest.$ac_objext conftest$ac_exeext
15046 if { (eval echo "$as_me:15046: \"$ac_link\"") >&5
15047   (eval $ac_link) 2>&5
15048   ac_status=$?
15049   echo "$as_me:15049: \$? = $ac_status" >&5
15050   (exit $ac_status); } &&
15051          { ac_try='test -s conftest$ac_exeext'
15052   { (eval echo "$as_me:15052: \"$ac_try\"") >&5
15053   (eval $ac_try) 2>&5
15054   ac_status=$?
15055   echo "$as_me:15055: \$? = $ac_status" >&5
15056   (exit $ac_status); }; }; then
15057   cf_result=yes
15058 else
15059   echo "$as_me: failed program was:" >&5
15060 cat conftest.$ac_ext >&5
15061 cf_result=no
15062 fi
15063 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15064                 fi
15065                 eval 'cf_cv_func_'$cf_func'=$cf_result'
15066
15067 fi
15068
15069         # use the computed/retrieved cache-value:
15070         eval 'cf_result=$cf_cv_func_'$cf_func
15071         echo "$as_me:15071: result: $cf_result" >&5
15072 echo "${ECHO_T}$cf_result" >&6
15073         if test $cf_result != no; then
15074                 cat >>confdefs.h <<EOF
15075 #define HAVE_${cf_tr_func} 1
15076 EOF
15077
15078         fi
15079 done
15080
15081 if test x$cf_cv_func_tputs = xyes
15082 then
15083         cf_done=no
15084         for cf_arg in int char
15085         do
15086                 for cf_ret in int void
15087                 do
15088                         if test $cf_ret = void
15089                         then
15090                                 cf_return="/* nothing */"
15091                         else
15092                                 cf_return="return value"
15093                         fi
15094                         cat >conftest.$ac_ext <<_ACEOF
15095 #line 15095 "configure"
15096 #include "confdefs.h"
15097
15098 #include <${cf_cv_ncurses_header:-curses.h}>
15099 #include <$cf_cv_term_header>
15100
15101 static $cf_ret outc($cf_arg value) { $cf_return; }
15102
15103 int
15104 main ()
15105 {
15106
15107         tputs("hello", 0, outc);
15108         ${cf_cv_main_return:-return}(0);
15109
15110   ;
15111   return 0;
15112 }
15113 _ACEOF
15114 rm -f conftest.$ac_objext
15115 if { (eval echo "$as_me:15115: \"$ac_compile\"") >&5
15116   (eval $ac_compile) 2>&5
15117   ac_status=$?
15118   echo "$as_me:15118: \$? = $ac_status" >&5
15119   (exit $ac_status); } &&
15120          { ac_try='test -s conftest.$ac_objext'
15121   { (eval echo "$as_me:15121: \"$ac_try\"") >&5
15122   (eval $ac_try) 2>&5
15123   ac_status=$?
15124   echo "$as_me:15124: \$? = $ac_status" >&5
15125   (exit $ac_status); }; }; then
15126
15127                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
15128
15129 echo "${as_me:-configure}:15129: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
15130
15131                 cat >>confdefs.h <<EOF
15132 #define TPUTS_ARG               $cf_arg
15133 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
15134 #define TPUTS_RETURN(value)     $cf_return
15135 EOF
15136                 cf_done=yes
15137                 break
15138
15139 else
15140   echo "$as_me: failed program was:" >&5
15141 cat conftest.$ac_ext >&5
15142 fi
15143 rm -f conftest.$ac_objext conftest.$ac_ext
15144                 done
15145                 test $cf_done = yes && break
15146         done
15147 fi
15148
15149 echo "$as_me:15149: checking for ncurses extended functions" >&5
15150 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
15151 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
15152   echo $ECHO_N "(cached) $ECHO_C" >&6
15153 else
15154
15155 cat >conftest.$ac_ext <<_ACEOF
15156 #line 15156 "configure"
15157 #include "confdefs.h"
15158
15159 #include <${cf_cv_ncurses_header:-curses.h}>
15160 int
15161 main ()
15162 {
15163
15164 int x = NCURSES_EXT_FUNCS
15165
15166   ;
15167   return 0;
15168 }
15169 _ACEOF
15170 rm -f conftest.$ac_objext
15171 if { (eval echo "$as_me:15171: \"$ac_compile\"") >&5
15172   (eval $ac_compile) 2>&5
15173   ac_status=$?
15174   echo "$as_me:15174: \$? = $ac_status" >&5
15175   (exit $ac_status); } &&
15176          { ac_try='test -s conftest.$ac_objext'
15177   { (eval echo "$as_me:15177: \"$ac_try\"") >&5
15178   (eval $ac_try) 2>&5
15179   ac_status=$?
15180   echo "$as_me:15180: \$? = $ac_status" >&5
15181   (exit $ac_status); }; }; then
15182   cf_cv_ncurses_ext_funcs=defined
15183 else
15184   echo "$as_me: failed program was:" >&5
15185 cat conftest.$ac_ext >&5
15186
15187 cat >conftest.$ac_ext <<_ACEOF
15188 #line 15188 "configure"
15189 #include "confdefs.h"
15190
15191 #include <${cf_cv_ncurses_header:-curses.h}>
15192 int
15193 main ()
15194 {
15195
15196         (void) assume_default_colors (0, 0);
15197         (void) curses_version ();
15198         (void) define_key (0, 0);
15199         (void) is_term_resized (0, 0);
15200         (void) key_defined (0);
15201         (void) keybound (0, 0);
15202         (void) keyok (0, 0);
15203         (void) resize_term (0, 0);
15204         (void) resizeterm (0, 0);
15205         (void) use_default_colors ();
15206         (void) use_extended_names (0);
15207         (void) wresize (0, 0, 0);
15208   ;
15209   return 0;
15210 }
15211 _ACEOF
15212 rm -f conftest.$ac_objext conftest$ac_exeext
15213 if { (eval echo "$as_me:15213: \"$ac_link\"") >&5
15214   (eval $ac_link) 2>&5
15215   ac_status=$?
15216   echo "$as_me:15216: \$? = $ac_status" >&5
15217   (exit $ac_status); } &&
15218          { ac_try='test -s conftest$ac_exeext'
15219   { (eval echo "$as_me:15219: \"$ac_try\"") >&5
15220   (eval $ac_try) 2>&5
15221   ac_status=$?
15222   echo "$as_me:15222: \$? = $ac_status" >&5
15223   (exit $ac_status); }; }; then
15224   cf_cv_ncurses_ext_funcs=yes
15225 else
15226   echo "$as_me: failed program was:" >&5
15227 cat conftest.$ac_ext >&5
15228 cf_cv_ncurses_ext_funcs=no
15229 fi
15230 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15231
15232 fi
15233 rm -f conftest.$ac_objext conftest.$ac_ext
15234
15235 fi
15236 echo "$as_me:15236: result: $cf_cv_ncurses_ext_funcs" >&5
15237 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
15238 test "$cf_cv_ncurses_ext_funcs" = yes &&
15239 cat >>confdefs.h <<\EOF
15240 #define NCURSES_EXT_FUNCS 1
15241 EOF
15242
15243 if test "$cf_enable_widec" = yes
15244 then
15245         # workaround for systems with ncurses before 20111029, due to change of
15246         # feature test macro from _XPG5 to _XOPEN_SOURCE
15247         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
15248         then
15249                 cf_define_xpg5=no
15250                 echo "$as_me:15250: checking if _XPG5 should be defined to enable wide-characters" >&5
15251 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
15252
15253                 cat >conftest.$ac_ext <<_ACEOF
15254 #line 15254 "configure"
15255 #include "confdefs.h"
15256
15257 #include <${cf_cv_ncurses_header:-curses.h}>
15258 int
15259 main ()
15260 {
15261 int x = _XPG5
15262   ;
15263   return 0;
15264 }
15265 _ACEOF
15266 rm -f conftest.$ac_objext
15267 if { (eval echo "$as_me:15267: \"$ac_compile\"") >&5
15268   (eval $ac_compile) 2>&5
15269   ac_status=$?
15270   echo "$as_me:15270: \$? = $ac_status" >&5
15271   (exit $ac_status); } &&
15272          { ac_try='test -s conftest.$ac_objext'
15273   { (eval echo "$as_me:15273: \"$ac_try\"") >&5
15274   (eval $ac_try) 2>&5
15275   ac_status=$?
15276   echo "$as_me:15276: \$? = $ac_status" >&5
15277   (exit $ac_status); }; }; then
15278   :
15279 else
15280   echo "$as_me: failed program was:" >&5
15281 cat conftest.$ac_ext >&5
15282 cf_save_cppflags="$CPPFLAGS"
15283                          CPPFLAGS="$CPPFLAGS -D_XPG5"
15284                          cat >conftest.$ac_ext <<_ACEOF
15285 #line 15285 "configure"
15286 #include "confdefs.h"
15287
15288 #include <${cf_cv_ncurses_header:-curses.h}>
15289 int
15290 main ()
15291 {
15292 int x = _XPG5
15293   ;
15294   return 0;
15295 }
15296 _ACEOF
15297 rm -f conftest.$ac_objext
15298 if { (eval echo "$as_me:15298: \"$ac_compile\"") >&5
15299   (eval $ac_compile) 2>&5
15300   ac_status=$?
15301   echo "$as_me:15301: \$? = $ac_status" >&5
15302   (exit $ac_status); } &&
15303          { ac_try='test -s conftest.$ac_objext'
15304   { (eval echo "$as_me:15304: \"$ac_try\"") >&5
15305   (eval $ac_try) 2>&5
15306   ac_status=$?
15307   echo "$as_me:15307: \$? = $ac_status" >&5
15308   (exit $ac_status); }; }; then
15309   cf_define_xpg5=yes
15310 else
15311   echo "$as_me: failed program was:" >&5
15312 cat conftest.$ac_ext >&5
15313 fi
15314 rm -f conftest.$ac_objext conftest.$ac_ext
15315                          CPPFLAGS="$cf_save_cppflags"
15316 fi
15317 rm -f conftest.$ac_objext conftest.$ac_ext
15318                 echo "$as_me:15318: result: $cf_define_xpg5" >&5
15319 echo "${ECHO_T}$cf_define_xpg5" >&6
15320
15321                 if test "$cf_define_xpg5" = yes
15322                 then
15323                         CPPFLAGS="$CPPFLAGS -D_XPG5"
15324                 fi
15325         fi
15326
15327         echo "$as_me:15327: checking for wide-character functions" >&5
15328 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
15329 if test "${cf_cv_widechar_funcs+set}" = set; then
15330   echo $ECHO_N "(cached) $ECHO_C" >&6
15331 else
15332
15333         cat >conftest.$ac_ext <<_ACEOF
15334 #line 15334 "configure"
15335 #include "confdefs.h"
15336
15337 #include <${cf_cv_ncurses_header:-curses.h}>
15338 int
15339 main ()
15340 {
15341
15342                 static wchar_t src_wchar[2];
15343                 static cchar_t dst_cchar;
15344                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
15345
15346   ;
15347   return 0;
15348 }
15349 _ACEOF
15350 rm -f conftest.$ac_objext conftest$ac_exeext
15351 if { (eval echo "$as_me:15351: \"$ac_link\"") >&5
15352   (eval $ac_link) 2>&5
15353   ac_status=$?
15354   echo "$as_me:15354: \$? = $ac_status" >&5
15355   (exit $ac_status); } &&
15356          { ac_try='test -s conftest$ac_exeext'
15357   { (eval echo "$as_me:15357: \"$ac_try\"") >&5
15358   (eval $ac_try) 2>&5
15359   ac_status=$?
15360   echo "$as_me:15360: \$? = $ac_status" >&5
15361   (exit $ac_status); }; }; then
15362   cf_cv_widechar_funcs=yes
15363 else
15364   echo "$as_me: failed program was:" >&5
15365 cat conftest.$ac_ext >&5
15366 cf_cv_widechar_funcs=no
15367 fi
15368 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15369
15370 fi
15371 echo "$as_me:15371: result: $cf_cv_widechar_funcs" >&5
15372 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
15373         if test "$cf_cv_widechar_funcs" != no ; then
15374
15375 cat >>confdefs.h <<\EOF
15376 #define USE_WIDEC_SUPPORT 1
15377 EOF
15378
15379         else
15380                 cat >>confdefs.h <<\EOF
15381 #define USE_WIDEC_SUPPORT 0
15382 EOF
15383
15384         fi
15385 else
15386         cat >>confdefs.h <<\EOF
15387 #define USE_WIDEC_SUPPORT 0
15388 EOF
15389
15390 fi
15391
15392 echo "$as_me:15392: checking if $cf_cv_screen library uses pthreads" >&5
15393 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
15394 if test "${cf_cv_use_pthreads+set}" = set; then
15395   echo $ECHO_N "(cached) $ECHO_C" >&6
15396 else
15397
15398 cat >conftest.$ac_ext <<_ACEOF
15399 #line 15399 "configure"
15400 #include "confdefs.h"
15401
15402 #include <${cf_cv_ncurses_header:-curses.h}>
15403 extern void _nc_init_pthreads(void);
15404
15405 int
15406 main ()
15407 {
15408
15409         initscr();
15410         _nc_init_pthreads();
15411
15412   ;
15413   return 0;
15414 }
15415 _ACEOF
15416 rm -f conftest.$ac_objext conftest$ac_exeext
15417 if { (eval echo "$as_me:15417: \"$ac_link\"") >&5
15418   (eval $ac_link) 2>&5
15419   ac_status=$?
15420   echo "$as_me:15420: \$? = $ac_status" >&5
15421   (exit $ac_status); } &&
15422          { ac_try='test -s conftest$ac_exeext'
15423   { (eval echo "$as_me:15423: \"$ac_try\"") >&5
15424   (eval $ac_try) 2>&5
15425   ac_status=$?
15426   echo "$as_me:15426: \$? = $ac_status" >&5
15427   (exit $ac_status); }; }; then
15428   cf_cv_use_pthreads=yes
15429 else
15430   echo "$as_me: failed program was:" >&5
15431 cat conftest.$ac_ext >&5
15432 cf_cv_use_pthreads=no
15433 fi
15434 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15435
15436 fi
15437 echo "$as_me:15437: result: $cf_cv_use_pthreads" >&5
15438 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
15439 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
15440 #define USE_PTHREADS 1
15441 EOF
15442
15443 echo "$as_me:15443: checking if sys/time.h works with sys/select.h" >&5
15444 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
15445 if test "${cf_cv_sys_time_select+set}" = set; then
15446   echo $ECHO_N "(cached) $ECHO_C" >&6
15447 else
15448
15449 cat >conftest.$ac_ext <<_ACEOF
15450 #line 15450 "configure"
15451 #include "confdefs.h"
15452
15453 #include <sys/types.h>
15454 #ifdef HAVE_SYS_TIME_H
15455 #include <sys/time.h>
15456 #endif
15457 #ifdef HAVE_SYS_SELECT_H
15458 #include <sys/select.h>
15459 #endif
15460
15461 int
15462 main ()
15463 {
15464
15465   ;
15466   return 0;
15467 }
15468 _ACEOF
15469 rm -f conftest.$ac_objext
15470 if { (eval echo "$as_me:15470: \"$ac_compile\"") >&5
15471   (eval $ac_compile) 2>&5
15472   ac_status=$?
15473   echo "$as_me:15473: \$? = $ac_status" >&5
15474   (exit $ac_status); } &&
15475          { ac_try='test -s conftest.$ac_objext'
15476   { (eval echo "$as_me:15476: \"$ac_try\"") >&5
15477   (eval $ac_try) 2>&5
15478   ac_status=$?
15479   echo "$as_me:15479: \$? = $ac_status" >&5
15480   (exit $ac_status); }; }; then
15481   cf_cv_sys_time_select=yes
15482 else
15483   echo "$as_me: failed program was:" >&5
15484 cat conftest.$ac_ext >&5
15485 cf_cv_sys_time_select=no
15486 fi
15487 rm -f conftest.$ac_objext conftest.$ac_ext
15488
15489 fi
15490
15491 echo "$as_me:15491: result: $cf_cv_sys_time_select" >&5
15492 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
15493 test "$cf_cv_sys_time_select" = yes &&
15494 cat >>confdefs.h <<\EOF
15495 #define HAVE_SYS_TIME_SELECT 1
15496 EOF
15497
15498 # special check for test/ditto.c
15499
15500 echo "$as_me:15500: checking for openpty in -lutil" >&5
15501 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
15502 if test "${ac_cv_lib_util_openpty+set}" = set; then
15503   echo $ECHO_N "(cached) $ECHO_C" >&6
15504 else
15505   ac_check_lib_save_LIBS=$LIBS
15506 LIBS="-lutil  $LIBS"
15507 cat >conftest.$ac_ext <<_ACEOF
15508 #line 15508 "configure"
15509 #include "confdefs.h"
15510
15511 /* Override any gcc2 internal prototype to avoid an error.  */
15512 #ifdef __cplusplus
15513 extern "C"
15514 #endif
15515 /* We use char because int might match the return type of a gcc2
15516    builtin and then its argument prototype would still apply.  */
15517 char openpty ();
15518 int
15519 main ()
15520 {
15521 openpty ();
15522   ;
15523   return 0;
15524 }
15525 _ACEOF
15526 rm -f conftest.$ac_objext conftest$ac_exeext
15527 if { (eval echo "$as_me:15527: \"$ac_link\"") >&5
15528   (eval $ac_link) 2>&5
15529   ac_status=$?
15530   echo "$as_me:15530: \$? = $ac_status" >&5
15531   (exit $ac_status); } &&
15532          { ac_try='test -s conftest$ac_exeext'
15533   { (eval echo "$as_me:15533: \"$ac_try\"") >&5
15534   (eval $ac_try) 2>&5
15535   ac_status=$?
15536   echo "$as_me:15536: \$? = $ac_status" >&5
15537   (exit $ac_status); }; }; then
15538   ac_cv_lib_util_openpty=yes
15539 else
15540   echo "$as_me: failed program was:" >&5
15541 cat conftest.$ac_ext >&5
15542 ac_cv_lib_util_openpty=no
15543 fi
15544 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15545 LIBS=$ac_check_lib_save_LIBS
15546 fi
15547 echo "$as_me:15547: result: $ac_cv_lib_util_openpty" >&5
15548 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
15549 if test $ac_cv_lib_util_openpty = yes; then
15550   cf_cv_lib_util=yes
15551 else
15552   cf_cv_lib_util=no
15553 fi
15554
15555 echo "$as_me:15555: checking for openpty header" >&5
15556 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
15557 if test "${cf_cv_func_openpty+set}" = set; then
15558   echo $ECHO_N "(cached) $ECHO_C" >&6
15559 else
15560
15561         cf_save_LIBS="$LIBS"
15562         test $cf_cv_lib_util = yes && {
15563 cf_add_libs="-lutil"
15564 # Filter out duplicates - this happens with badly-designed ".pc" files...
15565 for cf_add_1lib in $LIBS
15566 do
15567         for cf_add_2lib in $cf_add_libs
15568         do
15569                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15570                 then
15571                         cf_add_1lib=
15572                         break
15573                 fi
15574         done
15575         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15576 done
15577 LIBS="$cf_add_libs"
15578  }
15579         for cf_header in pty.h libutil.h util.h
15580         do
15581         cat >conftest.$ac_ext <<_ACEOF
15582 #line 15582 "configure"
15583 #include "confdefs.h"
15584
15585 #include <$cf_header>
15586
15587 int
15588 main ()
15589 {
15590
15591         int x = openpty((int *)0, (int *)0, (char *)0,
15592                                    (struct termios *)0, (struct winsize *)0);
15593
15594   ;
15595   return 0;
15596 }
15597 _ACEOF
15598 rm -f conftest.$ac_objext conftest$ac_exeext
15599 if { (eval echo "$as_me:15599: \"$ac_link\"") >&5
15600   (eval $ac_link) 2>&5
15601   ac_status=$?
15602   echo "$as_me:15602: \$? = $ac_status" >&5
15603   (exit $ac_status); } &&
15604          { ac_try='test -s conftest$ac_exeext'
15605   { (eval echo "$as_me:15605: \"$ac_try\"") >&5
15606   (eval $ac_try) 2>&5
15607   ac_status=$?
15608   echo "$as_me:15608: \$? = $ac_status" >&5
15609   (exit $ac_status); }; }; then
15610
15611                 cf_cv_func_openpty=$cf_header
15612                 break
15613
15614 else
15615   echo "$as_me: failed program was:" >&5
15616 cat conftest.$ac_ext >&5
15617
15618                 cf_cv_func_openpty=no
15619
15620 fi
15621 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15622         done
15623         LIBS="$cf_save_LIBS"
15624
15625 fi
15626 echo "$as_me:15626: result: $cf_cv_func_openpty" >&5
15627 echo "${ECHO_T}$cf_cv_func_openpty" >&6
15628
15629 if test "$cf_cv_func_openpty" != no ; then
15630
15631 cat >>confdefs.h <<EOF
15632 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
15633 EOF
15634
15635 cat >>confdefs.h <<\EOF
15636 #define USE_XTERM_PTY 1
15637 EOF
15638
15639         if test "x$cf_cv_lib_util" = xyes ; then
15640
15641 cf_add_libs="-lutil"
15642 # Filter out duplicates - this happens with badly-designed ".pc" files...
15643 for cf_add_1lib in $TEST_LIBS
15644 do
15645         for cf_add_2lib in $cf_add_libs
15646         do
15647                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15648                 then
15649                         cf_add_1lib=
15650                         break
15651                 fi
15652         done
15653         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15654 done
15655 TEST_LIBS="$cf_add_libs"
15656
15657         fi
15658 fi
15659
15660 echo "$as_me:15660: checking for function curses_version" >&5
15661 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
15662 if test "${cf_cv_func_curses_version+set}" = set; then
15663   echo $ECHO_N "(cached) $ECHO_C" >&6
15664 else
15665
15666 if test "$cross_compiling" = yes; then
15667   cf_cv_func_curses_version=unknown
15668 else
15669   cat >conftest.$ac_ext <<_ACEOF
15670 #line 15670 "configure"
15671 #include "confdefs.h"
15672
15673 #include <${cf_cv_ncurses_header:-curses.h}>
15674 int main()
15675 {
15676         char temp[1024];
15677         sprintf(temp, "%s\n", curses_version());
15678         ${cf_cv_main_return:-return}(0);
15679 }
15680
15681 _ACEOF
15682 rm -f conftest$ac_exeext
15683 if { (eval echo "$as_me:15683: \"$ac_link\"") >&5
15684   (eval $ac_link) 2>&5
15685   ac_status=$?
15686   echo "$as_me:15686: \$? = $ac_status" >&5
15687   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15688   { (eval echo "$as_me:15688: \"$ac_try\"") >&5
15689   (eval $ac_try) 2>&5
15690   ac_status=$?
15691   echo "$as_me:15691: \$? = $ac_status" >&5
15692   (exit $ac_status); }; }; then
15693   cf_cv_func_curses_version=yes
15694
15695 else
15696   echo "$as_me: program exited with status $ac_status" >&5
15697 echo "$as_me: failed program was:" >&5
15698 cat conftest.$ac_ext >&5
15699 cf_cv_func_curses_version=no
15700
15701 fi
15702 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15703 fi
15704 rm -f core
15705 fi
15706 echo "$as_me:15706: result: $cf_cv_func_curses_version" >&5
15707 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
15708 test "$cf_cv_func_curses_version" = yes &&
15709 cat >>confdefs.h <<\EOF
15710 #define HAVE_CURSES_VERSION 1
15711 EOF
15712
15713 echo "$as_me:15713: checking for alternate character set array" >&5
15714 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
15715 if test "${cf_cv_curses_acs_map+set}" = set; then
15716   echo $ECHO_N "(cached) $ECHO_C" >&6
15717 else
15718
15719 cf_cv_curses_acs_map=unknown
15720 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
15721 do
15722 cat >conftest.$ac_ext <<_ACEOF
15723 #line 15723 "configure"
15724 #include "confdefs.h"
15725
15726 #include <${cf_cv_ncurses_header:-curses.h}>
15727
15728 int
15729 main ()
15730 {
15731
15732 $name['k'] = ACS_PLUS
15733
15734   ;
15735   return 0;
15736 }
15737 _ACEOF
15738 rm -f conftest.$ac_objext conftest$ac_exeext
15739 if { (eval echo "$as_me:15739: \"$ac_link\"") >&5
15740   (eval $ac_link) 2>&5
15741   ac_status=$?
15742   echo "$as_me:15742: \$? = $ac_status" >&5
15743   (exit $ac_status); } &&
15744          { ac_try='test -s conftest$ac_exeext'
15745   { (eval echo "$as_me:15745: \"$ac_try\"") >&5
15746   (eval $ac_try) 2>&5
15747   ac_status=$?
15748   echo "$as_me:15748: \$? = $ac_status" >&5
15749   (exit $ac_status); }; }; then
15750   cf_cv_curses_acs_map=$name; break
15751 else
15752   echo "$as_me: failed program was:" >&5
15753 cat conftest.$ac_ext >&5
15754 fi
15755 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15756 done
15757
15758 fi
15759 echo "$as_me:15759: result: $cf_cv_curses_acs_map" >&5
15760 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
15761
15762 test "$cf_cv_curses_acs_map" != unknown &&
15763 cat >>confdefs.h <<EOF
15764 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
15765 EOF
15766
15767 if test "$cf_enable_widec" = yes; then
15768
15769 echo "$as_me:15769: checking for wide alternate character set array" >&5
15770 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
15771 if test "${cf_cv_curses_wacs_map+set}" = set; then
15772   echo $ECHO_N "(cached) $ECHO_C" >&6
15773 else
15774
15775         cf_cv_curses_wacs_map=unknown
15776         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
15777         do
15778         cat >conftest.$ac_ext <<_ACEOF
15779 #line 15779 "configure"
15780 #include "confdefs.h"
15781
15782 #ifndef _XOPEN_SOURCE_EXTENDED
15783 #define _XOPEN_SOURCE_EXTENDED
15784 #endif
15785 #include <${cf_cv_ncurses_header:-curses.h}>
15786 int
15787 main ()
15788 {
15789 void *foo = &($name['k'])
15790   ;
15791   return 0;
15792 }
15793 _ACEOF
15794 rm -f conftest.$ac_objext conftest$ac_exeext
15795 if { (eval echo "$as_me:15795: \"$ac_link\"") >&5
15796   (eval $ac_link) 2>&5
15797   ac_status=$?
15798   echo "$as_me:15798: \$? = $ac_status" >&5
15799   (exit $ac_status); } &&
15800          { ac_try='test -s conftest$ac_exeext'
15801   { (eval echo "$as_me:15801: \"$ac_try\"") >&5
15802   (eval $ac_try) 2>&5
15803   ac_status=$?
15804   echo "$as_me:15804: \$? = $ac_status" >&5
15805   (exit $ac_status); }; }; then
15806   cf_cv_curses_wacs_map=$name
15807          break
15808 else
15809   echo "$as_me: failed program was:" >&5
15810 cat conftest.$ac_ext >&5
15811 fi
15812 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15813         done
15814 fi
15815 echo "$as_me:15815: result: $cf_cv_curses_wacs_map" >&5
15816 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
15817
15818 test "$cf_cv_curses_wacs_map" != unknown &&
15819 cat >>confdefs.h <<EOF
15820 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
15821 EOF
15822
15823 echo "$as_me:15823: checking for wide alternate character constants" >&5
15824 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
15825 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
15826   echo $ECHO_N "(cached) $ECHO_C" >&6
15827 else
15828
15829 cf_cv_curses_wacs_symbols=no
15830 if test "$cf_cv_curses_wacs_map" != unknown
15831 then
15832         cat >conftest.$ac_ext <<_ACEOF
15833 #line 15833 "configure"
15834 #include "confdefs.h"
15835
15836 #ifndef _XOPEN_SOURCE_EXTENDED
15837 #define _XOPEN_SOURCE_EXTENDED
15838 #endif
15839 #include <${cf_cv_ncurses_header:-curses.h}>
15840 int
15841 main ()
15842 {
15843 cchar_t *foo = WACS_PLUS;
15844          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
15845   ;
15846   return 0;
15847 }
15848 _ACEOF
15849 rm -f conftest.$ac_objext conftest$ac_exeext
15850 if { (eval echo "$as_me:15850: \"$ac_link\"") >&5
15851   (eval $ac_link) 2>&5
15852   ac_status=$?
15853   echo "$as_me:15853: \$? = $ac_status" >&5
15854   (exit $ac_status); } &&
15855          { ac_try='test -s conftest$ac_exeext'
15856   { (eval echo "$as_me:15856: \"$ac_try\"") >&5
15857   (eval $ac_try) 2>&5
15858   ac_status=$?
15859   echo "$as_me:15859: \$? = $ac_status" >&5
15860   (exit $ac_status); }; }; then
15861   cf_cv_curses_wacs_symbols=yes
15862 else
15863   echo "$as_me: failed program was:" >&5
15864 cat conftest.$ac_ext >&5
15865 fi
15866 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15867 else
15868         cat >conftest.$ac_ext <<_ACEOF
15869 #line 15869 "configure"
15870 #include "confdefs.h"
15871
15872 #ifndef _XOPEN_SOURCE_EXTENDED
15873 #define _XOPEN_SOURCE_EXTENDED
15874 #endif
15875 #include <${cf_cv_ncurses_header:-curses.h}>
15876 int
15877 main ()
15878 {
15879 cchar_t *foo = WACS_PLUS
15880   ;
15881   return 0;
15882 }
15883 _ACEOF
15884 rm -f conftest.$ac_objext conftest$ac_exeext
15885 if { (eval echo "$as_me:15885: \"$ac_link\"") >&5
15886   (eval $ac_link) 2>&5
15887   ac_status=$?
15888   echo "$as_me:15888: \$? = $ac_status" >&5
15889   (exit $ac_status); } &&
15890          { ac_try='test -s conftest$ac_exeext'
15891   { (eval echo "$as_me:15891: \"$ac_try\"") >&5
15892   (eval $ac_try) 2>&5
15893   ac_status=$?
15894   echo "$as_me:15894: \$? = $ac_status" >&5
15895   (exit $ac_status); }; }; then
15896   cf_cv_curses_wacs_symbols=yes
15897 else
15898   echo "$as_me: failed program was:" >&5
15899 cat conftest.$ac_ext >&5
15900 fi
15901 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15902 fi
15903
15904 fi
15905 echo "$as_me:15905: result: $cf_cv_curses_wacs_symbols" >&5
15906 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15907
15908 test "$cf_cv_curses_wacs_symbols" != no &&
15909 cat >>confdefs.h <<\EOF
15910 #define CURSES_WACS_SYMBOLS 1
15911 EOF
15912
15913 fi
15914
15915 echo "$as_me:15915: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15916 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15917 cat >conftest.$ac_ext <<_ACEOF
15918 #line 15918 "configure"
15919 #include "confdefs.h"
15920
15921 #ifndef _XOPEN_SOURCE_EXTENDED
15922 #define _XOPEN_SOURCE_EXTENDED
15923 #endif
15924 #include <${cf_cv_ncurses_header:-curses.h}>
15925 int
15926 main ()
15927 {
15928
15929 attr_t foo
15930
15931   ;
15932   return 0;
15933 }
15934 _ACEOF
15935 rm -f conftest.$ac_objext
15936 if { (eval echo "$as_me:15936: \"$ac_compile\"") >&5
15937   (eval $ac_compile) 2>&5
15938   ac_status=$?
15939   echo "$as_me:15939: \$? = $ac_status" >&5
15940   (exit $ac_status); } &&
15941          { ac_try='test -s conftest.$ac_objext'
15942   { (eval echo "$as_me:15942: \"$ac_try\"") >&5
15943   (eval $ac_try) 2>&5
15944   ac_status=$?
15945   echo "$as_me:15945: \$? = $ac_status" >&5
15946   (exit $ac_status); }; }; then
15947   cf_result=yes
15948 else
15949   echo "$as_me: failed program was:" >&5
15950 cat conftest.$ac_ext >&5
15951 cf_result=no
15952 fi
15953 rm -f conftest.$ac_objext conftest.$ac_ext
15954 echo "$as_me:15954: result: $cf_result" >&5
15955 echo "${ECHO_T}$cf_result" >&6
15956 if test $cf_result = yes ; then
15957
15958 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15959
15960 cat >>confdefs.h <<EOF
15961 #define $cf_result 1
15962 EOF
15963
15964 else
15965
15966 cat >>confdefs.h <<EOF
15967 #define attr_t long
15968 EOF
15969
15970 fi
15971
15972 if test "$cf_enable_widec" = yes; then
15973
15974 # This is needed on Tru64 5.0 to declare mbstate_t
15975 echo "$as_me:15975: checking if we must include wchar.h to declare mbstate_t" >&5
15976 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15977 if test "${cf_cv_mbstate_t+set}" = set; then
15978   echo $ECHO_N "(cached) $ECHO_C" >&6
15979 else
15980
15981 cat >conftest.$ac_ext <<_ACEOF
15982 #line 15982 "configure"
15983 #include "confdefs.h"
15984
15985 #include <stdlib.h>
15986 #include <stdarg.h>
15987 #include <stdio.h>
15988 #ifdef HAVE_LIBUTF8_H
15989 #include <libutf8.h>
15990 #endif
15991 int
15992 main ()
15993 {
15994 mbstate_t state
15995   ;
15996   return 0;
15997 }
15998 _ACEOF
15999 rm -f conftest.$ac_objext
16000 if { (eval echo "$as_me:16000: \"$ac_compile\"") >&5
16001   (eval $ac_compile) 2>&5
16002   ac_status=$?
16003   echo "$as_me:16003: \$? = $ac_status" >&5
16004   (exit $ac_status); } &&
16005          { ac_try='test -s conftest.$ac_objext'
16006   { (eval echo "$as_me:16006: \"$ac_try\"") >&5
16007   (eval $ac_try) 2>&5
16008   ac_status=$?
16009   echo "$as_me:16009: \$? = $ac_status" >&5
16010   (exit $ac_status); }; }; then
16011   cf_cv_mbstate_t=no
16012 else
16013   echo "$as_me: failed program was:" >&5
16014 cat conftest.$ac_ext >&5
16015 cat >conftest.$ac_ext <<_ACEOF
16016 #line 16016 "configure"
16017 #include "confdefs.h"
16018
16019 #include <stdlib.h>
16020 #include <stdarg.h>
16021 #include <stdio.h>
16022 #include <wchar.h>
16023 #ifdef HAVE_LIBUTF8_H
16024 #include <libutf8.h>
16025 #endif
16026 int
16027 main ()
16028 {
16029 mbstate_t value
16030   ;
16031   return 0;
16032 }
16033 _ACEOF
16034 rm -f conftest.$ac_objext
16035 if { (eval echo "$as_me:16035: \"$ac_compile\"") >&5
16036   (eval $ac_compile) 2>&5
16037   ac_status=$?
16038   echo "$as_me:16038: \$? = $ac_status" >&5
16039   (exit $ac_status); } &&
16040          { ac_try='test -s conftest.$ac_objext'
16041   { (eval echo "$as_me:16041: \"$ac_try\"") >&5
16042   (eval $ac_try) 2>&5
16043   ac_status=$?
16044   echo "$as_me:16044: \$? = $ac_status" >&5
16045   (exit $ac_status); }; }; then
16046   cf_cv_mbstate_t=yes
16047 else
16048   echo "$as_me: failed program was:" >&5
16049 cat conftest.$ac_ext >&5
16050 cf_cv_mbstate_t=unknown
16051 fi
16052 rm -f conftest.$ac_objext conftest.$ac_ext
16053 fi
16054 rm -f conftest.$ac_objext conftest.$ac_ext
16055 fi
16056 echo "$as_me:16056: result: $cf_cv_mbstate_t" >&5
16057 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
16058
16059 if test "$cf_cv_mbstate_t" = yes ; then
16060
16061 cat >>confdefs.h <<\EOF
16062 #define NEED_WCHAR_H 1
16063 EOF
16064
16065         NEED_WCHAR_H=1
16066 fi
16067
16068 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
16069 if test "$cf_cv_mbstate_t" = unknown ; then
16070         NCURSES_MBSTATE_T=1
16071 fi
16072
16073 # if we find mbstate_t in either place, use substitution to provide a fallback.
16074 if test "$cf_cv_mbstate_t" != unknown ; then
16075         NCURSES_OK_MBSTATE_T=1
16076 fi
16077
16078 # This is needed on Tru64 5.0 to declare wchar_t
16079 echo "$as_me:16079: checking if we must include wchar.h to declare wchar_t" >&5
16080 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
16081 if test "${cf_cv_wchar_t+set}" = set; then
16082   echo $ECHO_N "(cached) $ECHO_C" >&6
16083 else
16084
16085 cat >conftest.$ac_ext <<_ACEOF
16086 #line 16086 "configure"
16087 #include "confdefs.h"
16088
16089 #include <stdlib.h>
16090 #include <stdarg.h>
16091 #include <stdio.h>
16092 #ifdef HAVE_LIBUTF8_H
16093 #include <libutf8.h>
16094 #endif
16095 int
16096 main ()
16097 {
16098 wchar_t state
16099   ;
16100   return 0;
16101 }
16102 _ACEOF
16103 rm -f conftest.$ac_objext
16104 if { (eval echo "$as_me:16104: \"$ac_compile\"") >&5
16105   (eval $ac_compile) 2>&5
16106   ac_status=$?
16107   echo "$as_me:16107: \$? = $ac_status" >&5
16108   (exit $ac_status); } &&
16109          { ac_try='test -s conftest.$ac_objext'
16110   { (eval echo "$as_me:16110: \"$ac_try\"") >&5
16111   (eval $ac_try) 2>&5
16112   ac_status=$?
16113   echo "$as_me:16113: \$? = $ac_status" >&5
16114   (exit $ac_status); }; }; then
16115   cf_cv_wchar_t=no
16116 else
16117   echo "$as_me: failed program was:" >&5
16118 cat conftest.$ac_ext >&5
16119 cat >conftest.$ac_ext <<_ACEOF
16120 #line 16120 "configure"
16121 #include "confdefs.h"
16122
16123 #include <stdlib.h>
16124 #include <stdarg.h>
16125 #include <stdio.h>
16126 #include <wchar.h>
16127 #ifdef HAVE_LIBUTF8_H
16128 #include <libutf8.h>
16129 #endif
16130 int
16131 main ()
16132 {
16133 wchar_t value
16134   ;
16135   return 0;
16136 }
16137 _ACEOF
16138 rm -f conftest.$ac_objext
16139 if { (eval echo "$as_me:16139: \"$ac_compile\"") >&5
16140   (eval $ac_compile) 2>&5
16141   ac_status=$?
16142   echo "$as_me:16142: \$? = $ac_status" >&5
16143   (exit $ac_status); } &&
16144          { ac_try='test -s conftest.$ac_objext'
16145   { (eval echo "$as_me:16145: \"$ac_try\"") >&5
16146   (eval $ac_try) 2>&5
16147   ac_status=$?
16148   echo "$as_me:16148: \$? = $ac_status" >&5
16149   (exit $ac_status); }; }; then
16150   cf_cv_wchar_t=yes
16151 else
16152   echo "$as_me: failed program was:" >&5
16153 cat conftest.$ac_ext >&5
16154 cf_cv_wchar_t=unknown
16155 fi
16156 rm -f conftest.$ac_objext conftest.$ac_ext
16157 fi
16158 rm -f conftest.$ac_objext conftest.$ac_ext
16159 fi
16160 echo "$as_me:16160: result: $cf_cv_wchar_t" >&5
16161 echo "${ECHO_T}$cf_cv_wchar_t" >&6
16162
16163 if test "$cf_cv_wchar_t" = yes ; then
16164
16165 cat >>confdefs.h <<\EOF
16166 #define NEED_WCHAR_H 1
16167 EOF
16168
16169         NEED_WCHAR_H=1
16170 fi
16171
16172 # if we do not find wchar_t in either place, use substitution to provide a fallback.
16173 if test "$cf_cv_wchar_t" = unknown ; then
16174         NCURSES_WCHAR_T=1
16175 fi
16176
16177 # if we find wchar_t in either place, use substitution to provide a fallback.
16178 if test "$cf_cv_wchar_t" != unknown ; then
16179         NCURSES_OK_WCHAR_T=1
16180 fi
16181
16182 # This is needed on Tru64 5.0 to declare wint_t
16183 echo "$as_me:16183: checking if we must include wchar.h to declare wint_t" >&5
16184 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
16185 if test "${cf_cv_wint_t+set}" = set; then
16186   echo $ECHO_N "(cached) $ECHO_C" >&6
16187 else
16188
16189 cat >conftest.$ac_ext <<_ACEOF
16190 #line 16190 "configure"
16191 #include "confdefs.h"
16192
16193 #include <stdlib.h>
16194 #include <stdarg.h>
16195 #include <stdio.h>
16196 #ifdef HAVE_LIBUTF8_H
16197 #include <libutf8.h>
16198 #endif
16199 int
16200 main ()
16201 {
16202 wint_t state
16203   ;
16204   return 0;
16205 }
16206 _ACEOF
16207 rm -f conftest.$ac_objext
16208 if { (eval echo "$as_me:16208: \"$ac_compile\"") >&5
16209   (eval $ac_compile) 2>&5
16210   ac_status=$?
16211   echo "$as_me:16211: \$? = $ac_status" >&5
16212   (exit $ac_status); } &&
16213          { ac_try='test -s conftest.$ac_objext'
16214   { (eval echo "$as_me:16214: \"$ac_try\"") >&5
16215   (eval $ac_try) 2>&5
16216   ac_status=$?
16217   echo "$as_me:16217: \$? = $ac_status" >&5
16218   (exit $ac_status); }; }; then
16219   cf_cv_wint_t=no
16220 else
16221   echo "$as_me: failed program was:" >&5
16222 cat conftest.$ac_ext >&5
16223 cat >conftest.$ac_ext <<_ACEOF
16224 #line 16224 "configure"
16225 #include "confdefs.h"
16226
16227 #include <stdlib.h>
16228 #include <stdarg.h>
16229 #include <stdio.h>
16230 #include <wchar.h>
16231 #ifdef HAVE_LIBUTF8_H
16232 #include <libutf8.h>
16233 #endif
16234 int
16235 main ()
16236 {
16237 wint_t value
16238   ;
16239   return 0;
16240 }
16241 _ACEOF
16242 rm -f conftest.$ac_objext
16243 if { (eval echo "$as_me:16243: \"$ac_compile\"") >&5
16244   (eval $ac_compile) 2>&5
16245   ac_status=$?
16246   echo "$as_me:16246: \$? = $ac_status" >&5
16247   (exit $ac_status); } &&
16248          { ac_try='test -s conftest.$ac_objext'
16249   { (eval echo "$as_me:16249: \"$ac_try\"") >&5
16250   (eval $ac_try) 2>&5
16251   ac_status=$?
16252   echo "$as_me:16252: \$? = $ac_status" >&5
16253   (exit $ac_status); }; }; then
16254   cf_cv_wint_t=yes
16255 else
16256   echo "$as_me: failed program was:" >&5
16257 cat conftest.$ac_ext >&5
16258 cf_cv_wint_t=unknown
16259 fi
16260 rm -f conftest.$ac_objext conftest.$ac_ext
16261 fi
16262 rm -f conftest.$ac_objext conftest.$ac_ext
16263 fi
16264 echo "$as_me:16264: result: $cf_cv_wint_t" >&5
16265 echo "${ECHO_T}$cf_cv_wint_t" >&6
16266
16267 if test "$cf_cv_wint_t" = yes ; then
16268
16269 cat >>confdefs.h <<\EOF
16270 #define NEED_WCHAR_H 1
16271 EOF
16272
16273         NEED_WCHAR_H=1
16274 fi
16275
16276 # if we do not find wint_t in either place, use substitution to provide a fallback.
16277 if test "$cf_cv_wint_t" = unknown ; then
16278         NCURSES_WINT_T=1
16279 fi
16280
16281 # if we find wint_t in either place, use substitution to provide a fallback.
16282 if test "$cf_cv_wint_t" != unknown ; then
16283         NCURSES_OK_WINT_T=1
16284 fi
16285
16286         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
16287
16288 echo "$as_me:16288: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16289 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16290 cat >conftest.$ac_ext <<_ACEOF
16291 #line 16291 "configure"
16292 #include "confdefs.h"
16293
16294 #ifndef _XOPEN_SOURCE_EXTENDED
16295 #define _XOPEN_SOURCE_EXTENDED
16296 #endif
16297 #include <${cf_cv_ncurses_header:-curses.h}>
16298 int
16299 main ()
16300 {
16301
16302 mbstate_t foo
16303
16304   ;
16305   return 0;
16306 }
16307 _ACEOF
16308 rm -f conftest.$ac_objext
16309 if { (eval echo "$as_me:16309: \"$ac_compile\"") >&5
16310   (eval $ac_compile) 2>&5
16311   ac_status=$?
16312   echo "$as_me:16312: \$? = $ac_status" >&5
16313   (exit $ac_status); } &&
16314          { ac_try='test -s conftest.$ac_objext'
16315   { (eval echo "$as_me:16315: \"$ac_try\"") >&5
16316   (eval $ac_try) 2>&5
16317   ac_status=$?
16318   echo "$as_me:16318: \$? = $ac_status" >&5
16319   (exit $ac_status); }; }; then
16320   cf_result=yes
16321 else
16322   echo "$as_me: failed program was:" >&5
16323 cat conftest.$ac_ext >&5
16324 cf_result=no
16325 fi
16326 rm -f conftest.$ac_objext conftest.$ac_ext
16327 echo "$as_me:16327: result: $cf_result" >&5
16328 echo "${ECHO_T}$cf_result" >&6
16329 if test $cf_result = yes ; then
16330
16331 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16332
16333 cat >>confdefs.h <<EOF
16334 #define $cf_result 1
16335 EOF
16336
16337 else
16338
16339 cat >>confdefs.h <<EOF
16340 #define mbstate_t long
16341 EOF
16342
16343 fi
16344
16345         fi
16346
16347         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
16348
16349 echo "$as_me:16349: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16350 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16351 cat >conftest.$ac_ext <<_ACEOF
16352 #line 16352 "configure"
16353 #include "confdefs.h"
16354
16355 #ifndef _XOPEN_SOURCE_EXTENDED
16356 #define _XOPEN_SOURCE_EXTENDED
16357 #endif
16358 #include <${cf_cv_ncurses_header:-curses.h}>
16359 int
16360 main ()
16361 {
16362
16363 wchar_t foo
16364
16365   ;
16366   return 0;
16367 }
16368 _ACEOF
16369 rm -f conftest.$ac_objext
16370 if { (eval echo "$as_me:16370: \"$ac_compile\"") >&5
16371   (eval $ac_compile) 2>&5
16372   ac_status=$?
16373   echo "$as_me:16373: \$? = $ac_status" >&5
16374   (exit $ac_status); } &&
16375          { ac_try='test -s conftest.$ac_objext'
16376   { (eval echo "$as_me:16376: \"$ac_try\"") >&5
16377   (eval $ac_try) 2>&5
16378   ac_status=$?
16379   echo "$as_me:16379: \$? = $ac_status" >&5
16380   (exit $ac_status); }; }; then
16381   cf_result=yes
16382 else
16383   echo "$as_me: failed program was:" >&5
16384 cat conftest.$ac_ext >&5
16385 cf_result=no
16386 fi
16387 rm -f conftest.$ac_objext conftest.$ac_ext
16388 echo "$as_me:16388: result: $cf_result" >&5
16389 echo "${ECHO_T}$cf_result" >&6
16390 if test $cf_result = yes ; then
16391
16392 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16393
16394 cat >>confdefs.h <<EOF
16395 #define $cf_result 1
16396 EOF
16397
16398 else
16399
16400 cat >>confdefs.h <<EOF
16401 #define wchar_t long
16402 EOF
16403
16404 fi
16405
16406         fi
16407
16408         if test "$NCURSES_OK_WINT_T" = 0 ; then
16409
16410 echo "$as_me:16410: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16411 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16412 cat >conftest.$ac_ext <<_ACEOF
16413 #line 16413 "configure"
16414 #include "confdefs.h"
16415
16416 #ifndef _XOPEN_SOURCE_EXTENDED
16417 #define _XOPEN_SOURCE_EXTENDED
16418 #endif
16419 #include <${cf_cv_ncurses_header:-curses.h}>
16420 int
16421 main ()
16422 {
16423
16424 wint_t foo
16425
16426   ;
16427   return 0;
16428 }
16429 _ACEOF
16430 rm -f conftest.$ac_objext
16431 if { (eval echo "$as_me:16431: \"$ac_compile\"") >&5
16432   (eval $ac_compile) 2>&5
16433   ac_status=$?
16434   echo "$as_me:16434: \$? = $ac_status" >&5
16435   (exit $ac_status); } &&
16436          { ac_try='test -s conftest.$ac_objext'
16437   { (eval echo "$as_me:16437: \"$ac_try\"") >&5
16438   (eval $ac_try) 2>&5
16439   ac_status=$?
16440   echo "$as_me:16440: \$? = $ac_status" >&5
16441   (exit $ac_status); }; }; then
16442   cf_result=yes
16443 else
16444   echo "$as_me: failed program was:" >&5
16445 cat conftest.$ac_ext >&5
16446 cf_result=no
16447 fi
16448 rm -f conftest.$ac_objext conftest.$ac_ext
16449 echo "$as_me:16449: result: $cf_result" >&5
16450 echo "${ECHO_T}$cf_result" >&6
16451 if test $cf_result = yes ; then
16452
16453 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16454
16455 cat >>confdefs.h <<EOF
16456 #define $cf_result 1
16457 EOF
16458
16459 else
16460
16461 cat >>confdefs.h <<EOF
16462 #define wint_t long
16463 EOF
16464
16465 fi
16466
16467         fi
16468 fi
16469
16470 echo "$as_me:16470: checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16471 echo $ECHO_N "checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16472
16473 cat >conftest.$ac_ext <<_ACEOF
16474 #line 16474 "configure"
16475 #include "confdefs.h"
16476
16477 #ifdef HAVE_XCURSES
16478 #include <xcurses.h>
16479 char * XCursesProgramName = "test";
16480 #else
16481 #include <${cf_cv_ncurses_header:-curses.h}>
16482 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16483 #include <ncursesw/term.h>
16484 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16485 #include <ncurses/term.h>
16486 #elif defined(HAVE_TERM_H)
16487 #include <term.h>
16488 #endif
16489 #endif
16490
16491 int
16492 main ()
16493 {
16494
16495 void *foo = &(ospeed)
16496
16497   ;
16498   return 0;
16499 }
16500 _ACEOF
16501 rm -f conftest.$ac_objext
16502 if { (eval echo "$as_me:16502: \"$ac_compile\"") >&5
16503   (eval $ac_compile) 2>&5
16504   ac_status=$?
16505   echo "$as_me:16505: \$? = $ac_status" >&5
16506   (exit $ac_status); } &&
16507          { ac_try='test -s conftest.$ac_objext'
16508   { (eval echo "$as_me:16508: \"$ac_try\"") >&5
16509   (eval $ac_try) 2>&5
16510   ac_status=$?
16511   echo "$as_me:16511: \$? = $ac_status" >&5
16512   (exit $ac_status); }; }; then
16513   cf_result=yes
16514 else
16515   echo "$as_me: failed program was:" >&5
16516 cat conftest.$ac_ext >&5
16517 cf_result=no
16518 fi
16519 rm -f conftest.$ac_objext conftest.$ac_ext
16520 echo "$as_me:16520: result: $cf_result" >&5
16521 echo "${ECHO_T}$cf_result" >&6
16522
16523 if test $cf_result = yes ; then
16524
16525 cf_result=`echo "have_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16526
16527         cat >>confdefs.h <<EOF
16528 #define $cf_result 1
16529 EOF
16530
16531 else
16532         echo "$as_me:16532: checking for data ospeed in library" >&5
16533 echo $ECHO_N "checking for data ospeed in library... $ECHO_C" >&6
16534         # BSD linkers insist on making weak linkage, but resolve at runtime.
16535         if test "$cross_compiling" = yes; then
16536
16537         # cross-compiling
16538         cat >conftest.$ac_ext <<_ACEOF
16539 #line 16539 "configure"
16540 #include "confdefs.h"
16541
16542 #ifdef HAVE_XCURSES
16543 #include <xcurses.h>
16544 char * XCursesProgramName = "test";
16545 #else
16546 #include <${cf_cv_ncurses_header:-curses.h}>
16547 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16548 #include <ncursesw/term.h>
16549 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16550 #include <ncurses/term.h>
16551 #elif defined(HAVE_TERM_H)
16552 #include <term.h>
16553 #endif
16554 #endif
16555
16556 extern char ospeed;
16557 int
16558 main ()
16559 {
16560
16561         do {
16562                 void *foo = &(ospeed);
16563                 fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16564                 ${cf_cv_main_return:-return}(foo == 0);
16565         } while (0)
16566
16567   ;
16568   return 0;
16569 }
16570 _ACEOF
16571 rm -f conftest.$ac_objext conftest$ac_exeext
16572 if { (eval echo "$as_me:16572: \"$ac_link\"") >&5
16573   (eval $ac_link) 2>&5
16574   ac_status=$?
16575   echo "$as_me:16575: \$? = $ac_status" >&5
16576   (exit $ac_status); } &&
16577          { ac_try='test -s conftest$ac_exeext'
16578   { (eval echo "$as_me:16578: \"$ac_try\"") >&5
16579   (eval $ac_try) 2>&5
16580   ac_status=$?
16581   echo "$as_me:16581: \$? = $ac_status" >&5
16582   (exit $ac_status); }; }; then
16583   cf_result=yes
16584 else
16585   echo "$as_me: failed program was:" >&5
16586 cat conftest.$ac_ext >&5
16587 cf_result=no
16588 fi
16589 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16590
16591 else
16592   cat >conftest.$ac_ext <<_ACEOF
16593 #line 16593 "configure"
16594 #include "confdefs.h"
16595
16596 #ifdef HAVE_XCURSES
16597 #include <xcurses.h>
16598 char * XCursesProgramName = "test";
16599 #else
16600 #include <${cf_cv_ncurses_header:-curses.h}>
16601 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16602 #include <ncursesw/term.h>
16603 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16604 #include <ncurses/term.h>
16605 #elif defined(HAVE_TERM_H)
16606 #include <term.h>
16607 #endif
16608 #endif
16609
16610 extern char ospeed;
16611 int main(void)
16612 {
16613         void *foo = &(ospeed);
16614         fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16615         ${cf_cv_main_return:-return}(foo == 0);
16616 }
16617 _ACEOF
16618 rm -f conftest$ac_exeext
16619 if { (eval echo "$as_me:16619: \"$ac_link\"") >&5
16620   (eval $ac_link) 2>&5
16621   ac_status=$?
16622   echo "$as_me:16622: \$? = $ac_status" >&5
16623   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16624   { (eval echo "$as_me:16624: \"$ac_try\"") >&5
16625   (eval $ac_try) 2>&5
16626   ac_status=$?
16627   echo "$as_me:16627: \$? = $ac_status" >&5
16628   (exit $ac_status); }; }; then
16629   cf_result=yes
16630 else
16631   echo "$as_me: program exited with status $ac_status" >&5
16632 echo "$as_me: failed program was:" >&5
16633 cat conftest.$ac_ext >&5
16634 cf_result=no
16635 fi
16636 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16637 fi
16638         echo "$as_me:16638: result: $cf_result" >&5
16639 echo "${ECHO_T}$cf_result" >&6
16640         if test $cf_result = yes ; then
16641
16642 cf_result=`echo "decl_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16643
16644                 cat >>confdefs.h <<EOF
16645 #define $cf_result 1
16646 EOF
16647
16648         fi
16649 fi
16650
16651 echo "$as_me:16651: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16652 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16653
16654 cat >conftest.$ac_ext <<_ACEOF
16655 #line 16655 "configure"
16656 #include "confdefs.h"
16657
16658 #ifdef HAVE_XCURSES
16659 #include <xcurses.h>
16660 char * XCursesProgramName = "test";
16661 #else
16662 #include <${cf_cv_ncurses_header:-curses.h}>
16663 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16664 #include <ncursesw/term.h>
16665 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16666 #include <ncurses/term.h>
16667 #elif defined(HAVE_TERM_H)
16668 #include <term.h>
16669 #endif
16670 #endif
16671
16672 int
16673 main ()
16674 {
16675
16676 void *foo = &(boolnames)
16677
16678   ;
16679   return 0;
16680 }
16681 _ACEOF
16682 rm -f conftest.$ac_objext
16683 if { (eval echo "$as_me:16683: \"$ac_compile\"") >&5
16684   (eval $ac_compile) 2>&5
16685   ac_status=$?
16686   echo "$as_me:16686: \$? = $ac_status" >&5
16687   (exit $ac_status); } &&
16688          { ac_try='test -s conftest.$ac_objext'
16689   { (eval echo "$as_me:16689: \"$ac_try\"") >&5
16690   (eval $ac_try) 2>&5
16691   ac_status=$?
16692   echo "$as_me:16692: \$? = $ac_status" >&5
16693   (exit $ac_status); }; }; then
16694   cf_result=yes
16695 else
16696   echo "$as_me: failed program was:" >&5
16697 cat conftest.$ac_ext >&5
16698 cf_result=no
16699 fi
16700 rm -f conftest.$ac_objext conftest.$ac_ext
16701 echo "$as_me:16701: result: $cf_result" >&5
16702 echo "${ECHO_T}$cf_result" >&6
16703
16704 if test $cf_result = yes ; then
16705
16706 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16707
16708         cat >>confdefs.h <<EOF
16709 #define $cf_result 1
16710 EOF
16711
16712 else
16713         echo "$as_me:16713: checking for data boolnames in library" >&5
16714 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
16715         # BSD linkers insist on making weak linkage, but resolve at runtime.
16716         if test "$cross_compiling" = yes; then
16717
16718         # cross-compiling
16719         cat >conftest.$ac_ext <<_ACEOF
16720 #line 16720 "configure"
16721 #include "confdefs.h"
16722
16723 #ifdef HAVE_XCURSES
16724 #include <xcurses.h>
16725 char * XCursesProgramName = "test";
16726 #else
16727 #include <${cf_cv_ncurses_header:-curses.h}>
16728 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16729 #include <ncursesw/term.h>
16730 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16731 #include <ncurses/term.h>
16732 #elif defined(HAVE_TERM_H)
16733 #include <term.h>
16734 #endif
16735 #endif
16736
16737 extern char boolnames;
16738 int
16739 main ()
16740 {
16741
16742         do {
16743                 void *foo = &(boolnames);
16744                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16745                 ${cf_cv_main_return:-return}(foo == 0);
16746         } while (0)
16747
16748   ;
16749   return 0;
16750 }
16751 _ACEOF
16752 rm -f conftest.$ac_objext conftest$ac_exeext
16753 if { (eval echo "$as_me:16753: \"$ac_link\"") >&5
16754   (eval $ac_link) 2>&5
16755   ac_status=$?
16756   echo "$as_me:16756: \$? = $ac_status" >&5
16757   (exit $ac_status); } &&
16758          { ac_try='test -s conftest$ac_exeext'
16759   { (eval echo "$as_me:16759: \"$ac_try\"") >&5
16760   (eval $ac_try) 2>&5
16761   ac_status=$?
16762   echo "$as_me:16762: \$? = $ac_status" >&5
16763   (exit $ac_status); }; }; then
16764   cf_result=yes
16765 else
16766   echo "$as_me: failed program was:" >&5
16767 cat conftest.$ac_ext >&5
16768 cf_result=no
16769 fi
16770 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16771
16772 else
16773   cat >conftest.$ac_ext <<_ACEOF
16774 #line 16774 "configure"
16775 #include "confdefs.h"
16776
16777 #ifdef HAVE_XCURSES
16778 #include <xcurses.h>
16779 char * XCursesProgramName = "test";
16780 #else
16781 #include <${cf_cv_ncurses_header:-curses.h}>
16782 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16783 #include <ncursesw/term.h>
16784 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16785 #include <ncurses/term.h>
16786 #elif defined(HAVE_TERM_H)
16787 #include <term.h>
16788 #endif
16789 #endif
16790
16791 extern char boolnames;
16792 int main(void)
16793 {
16794         void *foo = &(boolnames);
16795         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16796         ${cf_cv_main_return:-return}(foo == 0);
16797 }
16798 _ACEOF
16799 rm -f conftest$ac_exeext
16800 if { (eval echo "$as_me:16800: \"$ac_link\"") >&5
16801   (eval $ac_link) 2>&5
16802   ac_status=$?
16803   echo "$as_me:16803: \$? = $ac_status" >&5
16804   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16805   { (eval echo "$as_me:16805: \"$ac_try\"") >&5
16806   (eval $ac_try) 2>&5
16807   ac_status=$?
16808   echo "$as_me:16808: \$? = $ac_status" >&5
16809   (exit $ac_status); }; }; then
16810   cf_result=yes
16811 else
16812   echo "$as_me: program exited with status $ac_status" >&5
16813 echo "$as_me: failed program was:" >&5
16814 cat conftest.$ac_ext >&5
16815 cf_result=no
16816 fi
16817 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16818 fi
16819         echo "$as_me:16819: result: $cf_result" >&5
16820 echo "${ECHO_T}$cf_result" >&6
16821         if test $cf_result = yes ; then
16822
16823 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16824
16825                 cat >>confdefs.h <<EOF
16826 #define $cf_result 1
16827 EOF
16828
16829         fi
16830 fi
16831
16832 echo "$as_me:16832: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16833 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16834
16835 cat >conftest.$ac_ext <<_ACEOF
16836 #line 16836 "configure"
16837 #include "confdefs.h"
16838
16839 #ifdef HAVE_XCURSES
16840 #include <xcurses.h>
16841 char * XCursesProgramName = "test";
16842 #else
16843 #include <${cf_cv_ncurses_header:-curses.h}>
16844 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16845 #include <ncursesw/term.h>
16846 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16847 #include <ncurses/term.h>
16848 #elif defined(HAVE_TERM_H)
16849 #include <term.h>
16850 #endif
16851 #endif
16852
16853 int
16854 main ()
16855 {
16856
16857 void *foo = &(boolfnames)
16858
16859   ;
16860   return 0;
16861 }
16862 _ACEOF
16863 rm -f conftest.$ac_objext
16864 if { (eval echo "$as_me:16864: \"$ac_compile\"") >&5
16865   (eval $ac_compile) 2>&5
16866   ac_status=$?
16867   echo "$as_me:16867: \$? = $ac_status" >&5
16868   (exit $ac_status); } &&
16869          { ac_try='test -s conftest.$ac_objext'
16870   { (eval echo "$as_me:16870: \"$ac_try\"") >&5
16871   (eval $ac_try) 2>&5
16872   ac_status=$?
16873   echo "$as_me:16873: \$? = $ac_status" >&5
16874   (exit $ac_status); }; }; then
16875   cf_result=yes
16876 else
16877   echo "$as_me: failed program was:" >&5
16878 cat conftest.$ac_ext >&5
16879 cf_result=no
16880 fi
16881 rm -f conftest.$ac_objext conftest.$ac_ext
16882 echo "$as_me:16882: result: $cf_result" >&5
16883 echo "${ECHO_T}$cf_result" >&6
16884
16885 if test $cf_result = yes ; then
16886
16887 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16888
16889         cat >>confdefs.h <<EOF
16890 #define $cf_result 1
16891 EOF
16892
16893 else
16894         echo "$as_me:16894: checking for data boolfnames in library" >&5
16895 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
16896         # BSD linkers insist on making weak linkage, but resolve at runtime.
16897         if test "$cross_compiling" = yes; then
16898
16899         # cross-compiling
16900         cat >conftest.$ac_ext <<_ACEOF
16901 #line 16901 "configure"
16902 #include "confdefs.h"
16903
16904 #ifdef HAVE_XCURSES
16905 #include <xcurses.h>
16906 char * XCursesProgramName = "test";
16907 #else
16908 #include <${cf_cv_ncurses_header:-curses.h}>
16909 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16910 #include <ncursesw/term.h>
16911 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16912 #include <ncurses/term.h>
16913 #elif defined(HAVE_TERM_H)
16914 #include <term.h>
16915 #endif
16916 #endif
16917
16918 extern char boolfnames;
16919 int
16920 main ()
16921 {
16922
16923         do {
16924                 void *foo = &(boolfnames);
16925                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16926                 ${cf_cv_main_return:-return}(foo == 0);
16927         } while (0)
16928
16929   ;
16930   return 0;
16931 }
16932 _ACEOF
16933 rm -f conftest.$ac_objext conftest$ac_exeext
16934 if { (eval echo "$as_me:16934: \"$ac_link\"") >&5
16935   (eval $ac_link) 2>&5
16936   ac_status=$?
16937   echo "$as_me:16937: \$? = $ac_status" >&5
16938   (exit $ac_status); } &&
16939          { ac_try='test -s conftest$ac_exeext'
16940   { (eval echo "$as_me:16940: \"$ac_try\"") >&5
16941   (eval $ac_try) 2>&5
16942   ac_status=$?
16943   echo "$as_me:16943: \$? = $ac_status" >&5
16944   (exit $ac_status); }; }; then
16945   cf_result=yes
16946 else
16947   echo "$as_me: failed program was:" >&5
16948 cat conftest.$ac_ext >&5
16949 cf_result=no
16950 fi
16951 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16952
16953 else
16954   cat >conftest.$ac_ext <<_ACEOF
16955 #line 16955 "configure"
16956 #include "confdefs.h"
16957
16958 #ifdef HAVE_XCURSES
16959 #include <xcurses.h>
16960 char * XCursesProgramName = "test";
16961 #else
16962 #include <${cf_cv_ncurses_header:-curses.h}>
16963 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16964 #include <ncursesw/term.h>
16965 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16966 #include <ncurses/term.h>
16967 #elif defined(HAVE_TERM_H)
16968 #include <term.h>
16969 #endif
16970 #endif
16971
16972 extern char boolfnames;
16973 int main(void)
16974 {
16975         void *foo = &(boolfnames);
16976         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16977         ${cf_cv_main_return:-return}(foo == 0);
16978 }
16979 _ACEOF
16980 rm -f conftest$ac_exeext
16981 if { (eval echo "$as_me:16981: \"$ac_link\"") >&5
16982   (eval $ac_link) 2>&5
16983   ac_status=$?
16984   echo "$as_me:16984: \$? = $ac_status" >&5
16985   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16986   { (eval echo "$as_me:16986: \"$ac_try\"") >&5
16987   (eval $ac_try) 2>&5
16988   ac_status=$?
16989   echo "$as_me:16989: \$? = $ac_status" >&5
16990   (exit $ac_status); }; }; then
16991   cf_result=yes
16992 else
16993   echo "$as_me: program exited with status $ac_status" >&5
16994 echo "$as_me: failed program was:" >&5
16995 cat conftest.$ac_ext >&5
16996 cf_result=no
16997 fi
16998 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16999 fi
17000         echo "$as_me:17000: result: $cf_result" >&5
17001 echo "${ECHO_T}$cf_result" >&6
17002         if test $cf_result = yes ; then
17003
17004 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17005
17006                 cat >>confdefs.h <<EOF
17007 #define $cf_result 1
17008 EOF
17009
17010         fi
17011 fi
17012
17013 echo "$as_me:17013: checking for data ttytype declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17014 echo $ECHO_N "checking for data ttytype declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17015
17016 cat >conftest.$ac_ext <<_ACEOF
17017 #line 17017 "configure"
17018 #include "confdefs.h"
17019
17020 #ifdef HAVE_XCURSES
17021 #include <xcurses.h>
17022 char * XCursesProgramName = "test";
17023 #else
17024 #include <${cf_cv_ncurses_header:-curses.h}>
17025 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17026 #include <ncursesw/term.h>
17027 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17028 #include <ncurses/term.h>
17029 #elif defined(HAVE_TERM_H)
17030 #include <term.h>
17031 #endif
17032 #endif
17033
17034 int
17035 main ()
17036 {
17037
17038 void *foo = &(ttytype)
17039
17040   ;
17041   return 0;
17042 }
17043 _ACEOF
17044 rm -f conftest.$ac_objext
17045 if { (eval echo "$as_me:17045: \"$ac_compile\"") >&5
17046   (eval $ac_compile) 2>&5
17047   ac_status=$?
17048   echo "$as_me:17048: \$? = $ac_status" >&5
17049   (exit $ac_status); } &&
17050          { ac_try='test -s conftest.$ac_objext'
17051   { (eval echo "$as_me:17051: \"$ac_try\"") >&5
17052   (eval $ac_try) 2>&5
17053   ac_status=$?
17054   echo "$as_me:17054: \$? = $ac_status" >&5
17055   (exit $ac_status); }; }; then
17056   cf_result=yes
17057 else
17058   echo "$as_me: failed program was:" >&5
17059 cat conftest.$ac_ext >&5
17060 cf_result=no
17061 fi
17062 rm -f conftest.$ac_objext conftest.$ac_ext
17063 echo "$as_me:17063: result: $cf_result" >&5
17064 echo "${ECHO_T}$cf_result" >&6
17065
17066 if test $cf_result = yes ; then
17067
17068 cf_result=`echo "have_curses_data_ttytype" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17069
17070         cat >>confdefs.h <<EOF
17071 #define $cf_result 1
17072 EOF
17073
17074 else
17075         echo "$as_me:17075: checking for data ttytype in library" >&5
17076 echo $ECHO_N "checking for data ttytype in library... $ECHO_C" >&6
17077         # BSD linkers insist on making weak linkage, but resolve at runtime.
17078         if test "$cross_compiling" = yes; then
17079
17080         # cross-compiling
17081         cat >conftest.$ac_ext <<_ACEOF
17082 #line 17082 "configure"
17083 #include "confdefs.h"
17084
17085 #ifdef HAVE_XCURSES
17086 #include <xcurses.h>
17087 char * XCursesProgramName = "test";
17088 #else
17089 #include <${cf_cv_ncurses_header:-curses.h}>
17090 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17091 #include <ncursesw/term.h>
17092 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17093 #include <ncurses/term.h>
17094 #elif defined(HAVE_TERM_H)
17095 #include <term.h>
17096 #endif
17097 #endif
17098
17099 extern char ttytype;
17100 int
17101 main ()
17102 {
17103
17104         do {
17105                 void *foo = &(ttytype);
17106                 fprintf(stderr, "testing linkage of ttytype:%p\n", foo);
17107                 ${cf_cv_main_return:-return}(foo == 0);
17108         } while (0)
17109
17110   ;
17111   return 0;
17112 }
17113 _ACEOF
17114 rm -f conftest.$ac_objext conftest$ac_exeext
17115 if { (eval echo "$as_me:17115: \"$ac_link\"") >&5
17116   (eval $ac_link) 2>&5
17117   ac_status=$?
17118   echo "$as_me:17118: \$? = $ac_status" >&5
17119   (exit $ac_status); } &&
17120          { ac_try='test -s conftest$ac_exeext'
17121   { (eval echo "$as_me:17121: \"$ac_try\"") >&5
17122   (eval $ac_try) 2>&5
17123   ac_status=$?
17124   echo "$as_me:17124: \$? = $ac_status" >&5
17125   (exit $ac_status); }; }; then
17126   cf_result=yes
17127 else
17128   echo "$as_me: failed program was:" >&5
17129 cat conftest.$ac_ext >&5
17130 cf_result=no
17131 fi
17132 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17133
17134 else
17135   cat >conftest.$ac_ext <<_ACEOF
17136 #line 17136 "configure"
17137 #include "confdefs.h"
17138
17139 #ifdef HAVE_XCURSES
17140 #include <xcurses.h>
17141 char * XCursesProgramName = "test";
17142 #else
17143 #include <${cf_cv_ncurses_header:-curses.h}>
17144 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17145 #include <ncursesw/term.h>
17146 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17147 #include <ncurses/term.h>
17148 #elif defined(HAVE_TERM_H)
17149 #include <term.h>
17150 #endif
17151 #endif
17152
17153 extern char ttytype;
17154 int main(void)
17155 {
17156         void *foo = &(ttytype);
17157         fprintf(stderr, "testing linkage of ttytype:%p\n", foo);
17158         ${cf_cv_main_return:-return}(foo == 0);
17159 }
17160 _ACEOF
17161 rm -f conftest$ac_exeext
17162 if { (eval echo "$as_me:17162: \"$ac_link\"") >&5
17163   (eval $ac_link) 2>&5
17164   ac_status=$?
17165   echo "$as_me:17165: \$? = $ac_status" >&5
17166   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17167   { (eval echo "$as_me:17167: \"$ac_try\"") >&5
17168   (eval $ac_try) 2>&5
17169   ac_status=$?
17170   echo "$as_me:17170: \$? = $ac_status" >&5
17171   (exit $ac_status); }; }; then
17172   cf_result=yes
17173 else
17174   echo "$as_me: program exited with status $ac_status" >&5
17175 echo "$as_me: failed program was:" >&5
17176 cat conftest.$ac_ext >&5
17177 cf_result=no
17178 fi
17179 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17180 fi
17181         echo "$as_me:17181: result: $cf_result" >&5
17182 echo "${ECHO_T}$cf_result" >&6
17183         if test $cf_result = yes ; then
17184
17185 cf_result=`echo "decl_curses_data_ttytype" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17186
17187                 cat >>confdefs.h <<EOF
17188 #define $cf_result 1
17189 EOF
17190
17191         fi
17192 fi
17193
17194 if ( test "$GCC" = yes || test "$GXX" = yes )
17195 then
17196 echo "$as_me:17196: checking if you want to turn on gcc warnings" >&5
17197 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
17198
17199 # Check whether --enable-warnings or --disable-warnings was given.
17200 if test "${enable_warnings+set}" = set; then
17201   enableval="$enable_warnings"
17202   test "$enableval" != yes && enableval=no
17203         if test "$enableval" != "no" ; then
17204     with_warnings=yes
17205         else
17206                 with_warnings=no
17207         fi
17208 else
17209   enableval=no
17210         with_warnings=no
17211
17212 fi;
17213 echo "$as_me:17213: result: $with_warnings" >&5
17214 echo "${ECHO_T}$with_warnings" >&6
17215 if test "$with_warnings" = "yes"
17216 then
17217
17218 if test "$GCC" = yes
17219 then
17220 cat > conftest.i <<EOF
17221 #ifndef GCC_PRINTF
17222 #define GCC_PRINTF 0
17223 #endif
17224 #ifndef GCC_SCANF
17225 #define GCC_SCANF 0
17226 #endif
17227 #ifndef GCC_NORETURN
17228 #define GCC_NORETURN /* nothing */
17229 #endif
17230 #ifndef GCC_UNUSED
17231 #define GCC_UNUSED /* nothing */
17232 #endif
17233 EOF
17234 if test "$GCC" = yes
17235 then
17236         { echo "$as_me:17236: checking for $CC __attribute__ directives..." >&5
17237 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
17238 cat > conftest.$ac_ext <<EOF
17239 #line 17239 "${as_me:-configure}"
17240 #include "confdefs.h"
17241 #include "conftest.h"
17242 #include "conftest.i"
17243 #if     GCC_PRINTF
17244 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
17245 #else
17246 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
17247 #endif
17248 #if     GCC_SCANF
17249 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
17250 #else
17251 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
17252 #endif
17253 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
17254 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
17255 extern void foo(void) GCC_NORETURN;
17256 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
17257 EOF
17258         cf_printf_attribute=no
17259         cf_scanf_attribute=no
17260         for cf_attribute in scanf printf unused noreturn
17261         do
17262
17263 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17264
17265                 cf_directive="__attribute__(($cf_attribute))"
17266                 echo "checking for $CC $cf_directive" 1>&5
17267
17268                 case $cf_attribute in
17269                 (printf)
17270                         cf_printf_attribute=yes
17271                         cat >conftest.h <<EOF
17272 #define GCC_$cf_ATTRIBUTE 1
17273 EOF
17274                         ;;
17275                 (scanf)
17276                         cf_scanf_attribute=yes
17277                         cat >conftest.h <<EOF
17278 #define GCC_$cf_ATTRIBUTE 1
17279 EOF
17280                         ;;
17281                 (*)
17282                         cat >conftest.h <<EOF
17283 #define GCC_$cf_ATTRIBUTE $cf_directive
17284 EOF
17285                         ;;
17286                 esac
17287
17288                 if { (eval echo "$as_me:17288: \"$ac_compile\"") >&5
17289   (eval $ac_compile) 2>&5
17290   ac_status=$?
17291   echo "$as_me:17291: \$? = $ac_status" >&5
17292   (exit $ac_status); }; then
17293                         test -n "$verbose" && echo "$as_me:17293: result: ... $cf_attribute" >&5
17294 echo "${ECHO_T}... $cf_attribute" >&6
17295                         cat conftest.h >>confdefs.h
17296                         case $cf_attribute in
17297                         (noreturn)
17298
17299 cat >>confdefs.h <<EOF
17300 #define GCC_NORETURN $cf_directive
17301 EOF
17302
17303                                 ;;
17304                         (printf)
17305                                 cf_value='/* nothing */'
17306                                 if test "$cf_printf_attribute" != no ; then
17307                                         cf_value='__attribute__((format(printf,fmt,var)))'
17308
17309 cat >>confdefs.h <<\EOF
17310 #define GCC_PRINTF 1
17311 EOF
17312
17313                                 fi
17314
17315 cat >>confdefs.h <<EOF
17316 #define GCC_PRINTFLIKE(fmt,var) $cf_value
17317 EOF
17318
17319                                 ;;
17320                         (scanf)
17321                                 cf_value='/* nothing */'
17322                                 if test "$cf_scanf_attribute" != no ; then
17323                                         cf_value='__attribute__((format(scanf,fmt,var)))'
17324
17325 cat >>confdefs.h <<\EOF
17326 #define GCC_SCANF 1
17327 EOF
17328
17329                                 fi
17330
17331 cat >>confdefs.h <<EOF
17332 #define GCC_SCANFLIKE(fmt,var) $cf_value
17333 EOF
17334
17335                                 ;;
17336                         (unused)
17337
17338 cat >>confdefs.h <<EOF
17339 #define GCC_UNUSED $cf_directive
17340 EOF
17341
17342                                 ;;
17343                         esac
17344                 fi
17345         done
17346 else
17347         fgrep define conftest.i >>confdefs.h
17348 fi
17349 rm -rf conftest*
17350 fi
17351
17352 INTEL_COMPILER=no
17353
17354 if test "$GCC" = yes ; then
17355         case $host_os in
17356         (linux*|gnu*)
17357                 echo "$as_me:17357: checking if this is really Intel C compiler" >&5
17358 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
17359                 cf_save_CFLAGS="$CFLAGS"
17360                 CFLAGS="$CFLAGS -no-gcc"
17361                 cat >conftest.$ac_ext <<_ACEOF
17362 #line 17362 "configure"
17363 #include "confdefs.h"
17364
17365 int
17366 main ()
17367 {
17368
17369 #ifdef __INTEL_COMPILER
17370 #else
17371 make an error
17372 #endif
17373
17374   ;
17375   return 0;
17376 }
17377 _ACEOF
17378 rm -f conftest.$ac_objext
17379 if { (eval echo "$as_me:17379: \"$ac_compile\"") >&5
17380   (eval $ac_compile) 2>&5
17381   ac_status=$?
17382   echo "$as_me:17382: \$? = $ac_status" >&5
17383   (exit $ac_status); } &&
17384          { ac_try='test -s conftest.$ac_objext'
17385   { (eval echo "$as_me:17385: \"$ac_try\"") >&5
17386   (eval $ac_try) 2>&5
17387   ac_status=$?
17388   echo "$as_me:17388: \$? = $ac_status" >&5
17389   (exit $ac_status); }; }; then
17390   INTEL_COMPILER=yes
17391 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
17392
17393 else
17394   echo "$as_me: failed program was:" >&5
17395 cat conftest.$ac_ext >&5
17396 fi
17397 rm -f conftest.$ac_objext conftest.$ac_ext
17398                 CFLAGS="$cf_save_CFLAGS"
17399                 echo "$as_me:17399: result: $INTEL_COMPILER" >&5
17400 echo "${ECHO_T}$INTEL_COMPILER" >&6
17401                 ;;
17402         esac
17403 fi
17404
17405 CLANG_COMPILER=no
17406
17407 if test "$GCC" = yes ; then
17408         echo "$as_me:17408: checking if this is really Clang C compiler" >&5
17409 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
17410         cf_save_CFLAGS="$CFLAGS"
17411         CFLAGS="$CFLAGS -Qunused-arguments"
17412         cat >conftest.$ac_ext <<_ACEOF
17413 #line 17413 "configure"
17414 #include "confdefs.h"
17415
17416 int
17417 main ()
17418 {
17419
17420 #ifdef __clang__
17421 #else
17422 make an error
17423 #endif
17424
17425   ;
17426   return 0;
17427 }
17428 _ACEOF
17429 rm -f conftest.$ac_objext
17430 if { (eval echo "$as_me:17430: \"$ac_compile\"") >&5
17431   (eval $ac_compile) 2>&5
17432   ac_status=$?
17433   echo "$as_me:17433: \$? = $ac_status" >&5
17434   (exit $ac_status); } &&
17435          { ac_try='test -s conftest.$ac_objext'
17436   { (eval echo "$as_me:17436: \"$ac_try\"") >&5
17437   (eval $ac_try) 2>&5
17438   ac_status=$?
17439   echo "$as_me:17439: \$? = $ac_status" >&5
17440   (exit $ac_status); }; }; then
17441   CLANG_COMPILER=yes
17442 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
17443
17444 else
17445   echo "$as_me: failed program was:" >&5
17446 cat conftest.$ac_ext >&5
17447 fi
17448 rm -f conftest.$ac_objext conftest.$ac_ext
17449         CFLAGS="$cf_save_CFLAGS"
17450         echo "$as_me:17450: result: $CLANG_COMPILER" >&5
17451 echo "${ECHO_T}$CLANG_COMPILER" >&6
17452 fi
17453
17454 cat > conftest.$ac_ext <<EOF
17455 #line 17455 "${as_me:-configure}"
17456 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
17457 EOF
17458
17459 if test "$INTEL_COMPILER" = yes
17460 then
17461 # The "-wdXXX" options suppress warnings:
17462 # remark #1419: external declaration in primary source file
17463 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
17464 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
17465 # remark #193: zero used for undefined preprocessing identifier
17466 # remark #593: variable "curs_sb_left_arrow" was set but never used
17467 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
17468 # remark #869: parameter "tw" was never referenced
17469 # remark #981: operands are evaluated in unspecified order
17470 # warning #279: controlling expression is constant
17471
17472         { echo "$as_me:17472: checking for $CC warning options..." >&5
17473 echo "$as_me: checking for $CC warning options..." >&6;}
17474         cf_save_CFLAGS="$CFLAGS"
17475         EXTRA_CFLAGS="-Wall"
17476         for cf_opt in \
17477                 wd1419 \
17478                 wd1683 \
17479                 wd1684 \
17480                 wd193 \
17481                 wd593 \
17482                 wd279 \
17483                 wd810 \
17484                 wd869 \
17485                 wd981
17486         do
17487                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17488                 if { (eval echo "$as_me:17488: \"$ac_compile\"") >&5
17489   (eval $ac_compile) 2>&5
17490   ac_status=$?
17491   echo "$as_me:17491: \$? = $ac_status" >&5
17492   (exit $ac_status); }; then
17493                         test -n "$verbose" && echo "$as_me:17493: result: ... -$cf_opt" >&5
17494 echo "${ECHO_T}... -$cf_opt" >&6
17495                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17496                 fi
17497         done
17498         CFLAGS="$cf_save_CFLAGS"
17499
17500 elif test "$GCC" = yes
17501 then
17502         { echo "$as_me:17502: checking for $CC warning options..." >&5
17503 echo "$as_me: checking for $CC warning options..." >&6;}
17504         cf_save_CFLAGS="$CFLAGS"
17505         EXTRA_CFLAGS=
17506         cf_warn_CONST=""
17507         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
17508         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
17509         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
17510         for cf_opt in W Wall \
17511                 Wbad-function-cast \
17512                 Wcast-align \
17513                 Wcast-qual \
17514                 Wdeclaration-after-statement \
17515                 Wextra \
17516                 Winline \
17517                 Wmissing-declarations \
17518                 Wmissing-prototypes \
17519                 Wnested-externs \
17520                 Wpointer-arith \
17521                 Wshadow \
17522                 Wstrict-prototypes \
17523                 Wundef $cf_gcc_warnings $cf_warn_CONST
17524         do
17525                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17526                 if { (eval echo "$as_me:17526: \"$ac_compile\"") >&5
17527   (eval $ac_compile) 2>&5
17528   ac_status=$?
17529   echo "$as_me:17529: \$? = $ac_status" >&5
17530   (exit $ac_status); }; then
17531                         test -n "$verbose" && echo "$as_me:17531: result: ... -$cf_opt" >&5
17532 echo "${ECHO_T}... -$cf_opt" >&6
17533                         case $cf_opt in
17534                         (Wcast-qual)
17535                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
17536                                 ;;
17537                         (Winline)
17538                                 case $GCC_VERSION in
17539                                 ([34].*)
17540                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17541
17542 echo "${as_me:-configure}:17542: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17543
17544                                         continue;;
17545                                 esac
17546                                 ;;
17547                         (Wpointer-arith)
17548                                 case $GCC_VERSION in
17549                                 ([12].*)
17550                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17551
17552 echo "${as_me:-configure}:17552: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17553
17554                                         continue;;
17555                                 esac
17556                                 ;;
17557                         esac
17558                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17559                 fi
17560         done
17561         CFLAGS="$cf_save_CFLAGS"
17562 fi
17563 rm -rf conftest*
17564
17565 fi
17566 fi
17567
17568 echo "$as_me:17568: checking if you want to use dmalloc for testing" >&5
17569 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
17570
17571 # Check whether --with-dmalloc or --without-dmalloc was given.
17572 if test "${with_dmalloc+set}" = set; then
17573   withval="$with_dmalloc"
17574
17575 cat >>confdefs.h <<EOF
17576 #define USE_DMALLOC 1
17577 EOF
17578
17579         : ${with_cflags:=-g}
17580         : ${with_no_leaks:=yes}
17581          with_dmalloc=yes
17582 else
17583   with_dmalloc=
17584 fi;
17585 echo "$as_me:17585: result: ${with_dmalloc:-no}" >&5
17586 echo "${ECHO_T}${with_dmalloc:-no}" >&6
17587
17588 case .$with_cflags in
17589 (.*-g*)
17590         case .$CFLAGS in
17591         (.*-g*)
17592                 ;;
17593         (*)
17594
17595 cf_fix_cppflags=no
17596 cf_new_cflags=
17597 cf_new_cppflags=
17598 cf_new_extra_cppflags=
17599
17600 for cf_add_cflags in -g
17601 do
17602 case $cf_fix_cppflags in
17603 (no)
17604         case $cf_add_cflags in
17605         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17606                 case $cf_add_cflags in
17607                 (-D*)
17608                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17609
17610                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17611                                 && test -z "${cf_tst_cflags}" \
17612                                 && cf_fix_cppflags=yes
17613
17614                         if test $cf_fix_cppflags = yes ; then
17615                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17616                                 continue
17617                         elif test "${cf_tst_cflags}" = "\"'" ; then
17618                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17619                                 continue
17620                         fi
17621                         ;;
17622                 esac
17623                 case "$CPPFLAGS" in
17624                 (*$cf_add_cflags)
17625                         ;;
17626                 (*)
17627                         case $cf_add_cflags in
17628                         (-D*)
17629                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17630
17631 CPPFLAGS=`echo "$CPPFLAGS" | \
17632         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17633                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17634
17635                                 ;;
17636                         esac
17637                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17638                         ;;
17639                 esac
17640                 ;;
17641         (*)
17642                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17643                 ;;
17644         esac
17645         ;;
17646 (yes)
17647         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17648
17649         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17650
17651         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17652                 && test -z "${cf_tst_cflags}" \
17653                 && cf_fix_cppflags=no
17654         ;;
17655 esac
17656 done
17657
17658 if test -n "$cf_new_cflags" ; then
17659
17660         CFLAGS="$CFLAGS $cf_new_cflags"
17661 fi
17662
17663 if test -n "$cf_new_cppflags" ; then
17664
17665         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17666 fi
17667
17668 if test -n "$cf_new_extra_cppflags" ; then
17669
17670         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17671 fi
17672
17673                 ;;
17674         esac
17675         ;;
17676 esac
17677
17678 if test "$with_dmalloc" = yes ; then
17679         echo "$as_me:17679: checking for dmalloc.h" >&5
17680 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
17681 if test "${ac_cv_header_dmalloc_h+set}" = set; then
17682   echo $ECHO_N "(cached) $ECHO_C" >&6
17683 else
17684   cat >conftest.$ac_ext <<_ACEOF
17685 #line 17685 "configure"
17686 #include "confdefs.h"
17687 #include <dmalloc.h>
17688 _ACEOF
17689 if { (eval echo "$as_me:17689: \"$ac_cpp conftest.$ac_ext\"") >&5
17690   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17691   ac_status=$?
17692   egrep -v '^ *\+' conftest.er1 >conftest.err
17693   rm -f conftest.er1
17694   cat conftest.err >&5
17695   echo "$as_me:17695: \$? = $ac_status" >&5
17696   (exit $ac_status); } >/dev/null; then
17697   if test -s conftest.err; then
17698     ac_cpp_err=$ac_c_preproc_warn_flag
17699   else
17700     ac_cpp_err=
17701   fi
17702 else
17703   ac_cpp_err=yes
17704 fi
17705 if test -z "$ac_cpp_err"; then
17706   ac_cv_header_dmalloc_h=yes
17707 else
17708   echo "$as_me: failed program was:" >&5
17709   cat conftest.$ac_ext >&5
17710   ac_cv_header_dmalloc_h=no
17711 fi
17712 rm -f conftest.err conftest.$ac_ext
17713 fi
17714 echo "$as_me:17714: result: $ac_cv_header_dmalloc_h" >&5
17715 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
17716 if test $ac_cv_header_dmalloc_h = yes; then
17717
17718 echo "$as_me:17718: checking for dmalloc_debug in -ldmalloc" >&5
17719 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
17720 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
17721   echo $ECHO_N "(cached) $ECHO_C" >&6
17722 else
17723   ac_check_lib_save_LIBS=$LIBS
17724 LIBS="-ldmalloc  $LIBS"
17725 cat >conftest.$ac_ext <<_ACEOF
17726 #line 17726 "configure"
17727 #include "confdefs.h"
17728
17729 /* Override any gcc2 internal prototype to avoid an error.  */
17730 #ifdef __cplusplus
17731 extern "C"
17732 #endif
17733 /* We use char because int might match the return type of a gcc2
17734    builtin and then its argument prototype would still apply.  */
17735 char dmalloc_debug ();
17736 int
17737 main ()
17738 {
17739 dmalloc_debug ();
17740   ;
17741   return 0;
17742 }
17743 _ACEOF
17744 rm -f conftest.$ac_objext conftest$ac_exeext
17745 if { (eval echo "$as_me:17745: \"$ac_link\"") >&5
17746   (eval $ac_link) 2>&5
17747   ac_status=$?
17748   echo "$as_me:17748: \$? = $ac_status" >&5
17749   (exit $ac_status); } &&
17750          { ac_try='test -s conftest$ac_exeext'
17751   { (eval echo "$as_me:17751: \"$ac_try\"") >&5
17752   (eval $ac_try) 2>&5
17753   ac_status=$?
17754   echo "$as_me:17754: \$? = $ac_status" >&5
17755   (exit $ac_status); }; }; then
17756   ac_cv_lib_dmalloc_dmalloc_debug=yes
17757 else
17758   echo "$as_me: failed program was:" >&5
17759 cat conftest.$ac_ext >&5
17760 ac_cv_lib_dmalloc_dmalloc_debug=no
17761 fi
17762 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17763 LIBS=$ac_check_lib_save_LIBS
17764 fi
17765 echo "$as_me:17765: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
17766 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
17767 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
17768   cat >>confdefs.h <<EOF
17769 #define HAVE_LIBDMALLOC 1
17770 EOF
17771
17772   LIBS="-ldmalloc $LIBS"
17773
17774 fi
17775
17776 fi
17777
17778 fi
17779
17780 echo "$as_me:17780: checking if you want to use dbmalloc for testing" >&5
17781 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
17782
17783 # Check whether --with-dbmalloc or --without-dbmalloc was given.
17784 if test "${with_dbmalloc+set}" = set; then
17785   withval="$with_dbmalloc"
17786
17787 cat >>confdefs.h <<EOF
17788 #define USE_DBMALLOC 1
17789 EOF
17790
17791         : ${with_cflags:=-g}
17792         : ${with_no_leaks:=yes}
17793          with_dbmalloc=yes
17794 else
17795   with_dbmalloc=
17796 fi;
17797 echo "$as_me:17797: result: ${with_dbmalloc:-no}" >&5
17798 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
17799
17800 case .$with_cflags in
17801 (.*-g*)
17802         case .$CFLAGS in
17803         (.*-g*)
17804                 ;;
17805         (*)
17806
17807 cf_fix_cppflags=no
17808 cf_new_cflags=
17809 cf_new_cppflags=
17810 cf_new_extra_cppflags=
17811
17812 for cf_add_cflags in -g
17813 do
17814 case $cf_fix_cppflags in
17815 (no)
17816         case $cf_add_cflags in
17817         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17818                 case $cf_add_cflags in
17819                 (-D*)
17820                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17821
17822                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17823                                 && test -z "${cf_tst_cflags}" \
17824                                 && cf_fix_cppflags=yes
17825
17826                         if test $cf_fix_cppflags = yes ; then
17827                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17828                                 continue
17829                         elif test "${cf_tst_cflags}" = "\"'" ; then
17830                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17831                                 continue
17832                         fi
17833                         ;;
17834                 esac
17835                 case "$CPPFLAGS" in
17836                 (*$cf_add_cflags)
17837                         ;;
17838                 (*)
17839                         case $cf_add_cflags in
17840                         (-D*)
17841                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17842
17843 CPPFLAGS=`echo "$CPPFLAGS" | \
17844         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17845                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17846
17847                                 ;;
17848                         esac
17849                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17850                         ;;
17851                 esac
17852                 ;;
17853         (*)
17854                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17855                 ;;
17856         esac
17857         ;;
17858 (yes)
17859         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17860
17861         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17862
17863         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17864                 && test -z "${cf_tst_cflags}" \
17865                 && cf_fix_cppflags=no
17866         ;;
17867 esac
17868 done
17869
17870 if test -n "$cf_new_cflags" ; then
17871
17872         CFLAGS="$CFLAGS $cf_new_cflags"
17873 fi
17874
17875 if test -n "$cf_new_cppflags" ; then
17876
17877         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17878 fi
17879
17880 if test -n "$cf_new_extra_cppflags" ; then
17881
17882         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17883 fi
17884
17885                 ;;
17886         esac
17887         ;;
17888 esac
17889
17890 if test "$with_dbmalloc" = yes ; then
17891         echo "$as_me:17891: checking for dbmalloc.h" >&5
17892 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
17893 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
17894   echo $ECHO_N "(cached) $ECHO_C" >&6
17895 else
17896   cat >conftest.$ac_ext <<_ACEOF
17897 #line 17897 "configure"
17898 #include "confdefs.h"
17899 #include <dbmalloc.h>
17900 _ACEOF
17901 if { (eval echo "$as_me:17901: \"$ac_cpp conftest.$ac_ext\"") >&5
17902   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17903   ac_status=$?
17904   egrep -v '^ *\+' conftest.er1 >conftest.err
17905   rm -f conftest.er1
17906   cat conftest.err >&5
17907   echo "$as_me:17907: \$? = $ac_status" >&5
17908   (exit $ac_status); } >/dev/null; then
17909   if test -s conftest.err; then
17910     ac_cpp_err=$ac_c_preproc_warn_flag
17911   else
17912     ac_cpp_err=
17913   fi
17914 else
17915   ac_cpp_err=yes
17916 fi
17917 if test -z "$ac_cpp_err"; then
17918   ac_cv_header_dbmalloc_h=yes
17919 else
17920   echo "$as_me: failed program was:" >&5
17921   cat conftest.$ac_ext >&5
17922   ac_cv_header_dbmalloc_h=no
17923 fi
17924 rm -f conftest.err conftest.$ac_ext
17925 fi
17926 echo "$as_me:17926: result: $ac_cv_header_dbmalloc_h" >&5
17927 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
17928 if test $ac_cv_header_dbmalloc_h = yes; then
17929
17930 echo "$as_me:17930: checking for debug_malloc in -ldbmalloc" >&5
17931 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
17932 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
17933   echo $ECHO_N "(cached) $ECHO_C" >&6
17934 else
17935   ac_check_lib_save_LIBS=$LIBS
17936 LIBS="-ldbmalloc  $LIBS"
17937 cat >conftest.$ac_ext <<_ACEOF
17938 #line 17938 "configure"
17939 #include "confdefs.h"
17940
17941 /* Override any gcc2 internal prototype to avoid an error.  */
17942 #ifdef __cplusplus
17943 extern "C"
17944 #endif
17945 /* We use char because int might match the return type of a gcc2
17946    builtin and then its argument prototype would still apply.  */
17947 char debug_malloc ();
17948 int
17949 main ()
17950 {
17951 debug_malloc ();
17952   ;
17953   return 0;
17954 }
17955 _ACEOF
17956 rm -f conftest.$ac_objext conftest$ac_exeext
17957 if { (eval echo "$as_me:17957: \"$ac_link\"") >&5
17958   (eval $ac_link) 2>&5
17959   ac_status=$?
17960   echo "$as_me:17960: \$? = $ac_status" >&5
17961   (exit $ac_status); } &&
17962          { ac_try='test -s conftest$ac_exeext'
17963   { (eval echo "$as_me:17963: \"$ac_try\"") >&5
17964   (eval $ac_try) 2>&5
17965   ac_status=$?
17966   echo "$as_me:17966: \$? = $ac_status" >&5
17967   (exit $ac_status); }; }; then
17968   ac_cv_lib_dbmalloc_debug_malloc=yes
17969 else
17970   echo "$as_me: failed program was:" >&5
17971 cat conftest.$ac_ext >&5
17972 ac_cv_lib_dbmalloc_debug_malloc=no
17973 fi
17974 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17975 LIBS=$ac_check_lib_save_LIBS
17976 fi
17977 echo "$as_me:17977: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
17978 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
17979 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
17980   cat >>confdefs.h <<EOF
17981 #define HAVE_LIBDBMALLOC 1
17982 EOF
17983
17984   LIBS="-ldbmalloc $LIBS"
17985
17986 fi
17987
17988 fi
17989
17990 fi
17991
17992 echo "$as_me:17992: checking if you want to use valgrind for testing" >&5
17993 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
17994
17995 # Check whether --with-valgrind or --without-valgrind was given.
17996 if test "${with_valgrind+set}" = set; then
17997   withval="$with_valgrind"
17998
17999 cat >>confdefs.h <<EOF
18000 #define USE_VALGRIND 1
18001 EOF
18002
18003         : ${with_cflags:=-g}
18004         : ${with_no_leaks:=yes}
18005          with_valgrind=yes
18006 else
18007   with_valgrind=
18008 fi;
18009 echo "$as_me:18009: result: ${with_valgrind:-no}" >&5
18010 echo "${ECHO_T}${with_valgrind:-no}" >&6
18011
18012 case .$with_cflags in
18013 (.*-g*)
18014         case .$CFLAGS in
18015         (.*-g*)
18016                 ;;
18017         (*)
18018
18019 cf_fix_cppflags=no
18020 cf_new_cflags=
18021 cf_new_cppflags=
18022 cf_new_extra_cppflags=
18023
18024 for cf_add_cflags in -g
18025 do
18026 case $cf_fix_cppflags in
18027 (no)
18028         case $cf_add_cflags in
18029         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18030                 case $cf_add_cflags in
18031                 (-D*)
18032                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18033
18034                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18035                                 && test -z "${cf_tst_cflags}" \
18036                                 && cf_fix_cppflags=yes
18037
18038                         if test $cf_fix_cppflags = yes ; then
18039                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
18040                                 continue
18041                         elif test "${cf_tst_cflags}" = "\"'" ; then
18042                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
18043                                 continue
18044                         fi
18045                         ;;
18046                 esac
18047                 case "$CPPFLAGS" in
18048                 (*$cf_add_cflags)
18049                         ;;
18050                 (*)
18051                         case $cf_add_cflags in
18052                         (-D*)
18053                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18054
18055 CPPFLAGS=`echo "$CPPFLAGS" | \
18056         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18057                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18058
18059                                 ;;
18060                         esac
18061                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
18062                         ;;
18063                 esac
18064                 ;;
18065         (*)
18066                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
18067                 ;;
18068         esac
18069         ;;
18070 (yes)
18071         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
18072
18073         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18074
18075         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18076                 && test -z "${cf_tst_cflags}" \
18077                 && cf_fix_cppflags=no
18078         ;;
18079 esac
18080 done
18081
18082 if test -n "$cf_new_cflags" ; then
18083
18084         CFLAGS="$CFLAGS $cf_new_cflags"
18085 fi
18086
18087 if test -n "$cf_new_cppflags" ; then
18088
18089         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
18090 fi
18091
18092 if test -n "$cf_new_extra_cppflags" ; then
18093
18094         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
18095 fi
18096
18097                 ;;
18098         esac
18099         ;;
18100 esac
18101
18102 echo "$as_me:18102: checking if you want to perform memory-leak testing" >&5
18103 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
18104
18105 # Check whether --enable-leaks or --disable-leaks was given.
18106 if test "${enable_leaks+set}" = set; then
18107   enableval="$enable_leaks"
18108   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
18109 else
18110   : ${with_no_leaks:=no}
18111 fi;
18112 echo "$as_me:18112: result: $with_no_leaks" >&5
18113 echo "${ECHO_T}$with_no_leaks" >&6
18114
18115 if test "$with_no_leaks" = yes ; then
18116
18117 cat >>confdefs.h <<\EOF
18118 #define NO_LEAKS 1
18119 EOF
18120
18121 cat >>confdefs.h <<\EOF
18122 #define YY_NO_LEAKS 1
18123 EOF
18124
18125 fi
18126
18127 LD_RPATH_OPT=
18128 echo "$as_me:18128: checking for an rpath option" >&5
18129 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
18130 case $cf_cv_system_name in
18131 (irix*)
18132         if test "$GCC" = yes; then
18133                 LD_RPATH_OPT="-Wl,-rpath,"
18134         else
18135                 LD_RPATH_OPT="-rpath "
18136         fi
18137         ;;
18138 (linux*|gnu*|k*bsd*-gnu|freebsd*)
18139         LD_RPATH_OPT="-Wl,-rpath,"
18140         ;;
18141 (openbsd[2-9].*|mirbsd*)
18142         LD_RPATH_OPT="-Wl,-rpath,"
18143         ;;
18144 (dragonfly*)
18145         LD_RPATH_OPT="-rpath "
18146         ;;
18147 (netbsd*)
18148         LD_RPATH_OPT="-Wl,-rpath,"
18149         ;;
18150 (osf*|mls+*)
18151         LD_RPATH_OPT="-rpath "
18152         ;;
18153 (solaris2*)
18154         LD_RPATH_OPT="-R"
18155         ;;
18156 (*)
18157         ;;
18158 esac
18159 echo "$as_me:18159: result: $LD_RPATH_OPT" >&5
18160 echo "${ECHO_T}$LD_RPATH_OPT" >&6
18161
18162 case "x$LD_RPATH_OPT" in
18163 (x-R*)
18164         echo "$as_me:18164: checking if we need a space after rpath option" >&5
18165 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
18166         cf_save_LIBS="$LIBS"
18167
18168 cf_add_libs="${LD_RPATH_OPT}$libdir"
18169 # Filter out duplicates - this happens with badly-designed ".pc" files...
18170 for cf_add_1lib in $LIBS
18171 do
18172         for cf_add_2lib in $cf_add_libs
18173         do
18174                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18175                 then
18176                         cf_add_1lib=
18177                         break
18178                 fi
18179         done
18180         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18181 done
18182 LIBS="$cf_add_libs"
18183
18184         cat >conftest.$ac_ext <<_ACEOF
18185 #line 18185 "configure"
18186 #include "confdefs.h"
18187
18188 int
18189 main ()
18190 {
18191
18192   ;
18193   return 0;
18194 }
18195 _ACEOF
18196 rm -f conftest.$ac_objext conftest$ac_exeext
18197 if { (eval echo "$as_me:18197: \"$ac_link\"") >&5
18198   (eval $ac_link) 2>&5
18199   ac_status=$?
18200   echo "$as_me:18200: \$? = $ac_status" >&5
18201   (exit $ac_status); } &&
18202          { ac_try='test -s conftest$ac_exeext'
18203   { (eval echo "$as_me:18203: \"$ac_try\"") >&5
18204   (eval $ac_try) 2>&5
18205   ac_status=$?
18206   echo "$as_me:18206: \$? = $ac_status" >&5
18207   (exit $ac_status); }; }; then
18208   cf_rpath_space=no
18209 else
18210   echo "$as_me: failed program was:" >&5
18211 cat conftest.$ac_ext >&5
18212 cf_rpath_space=yes
18213 fi
18214 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18215         LIBS="$cf_save_LIBS"
18216         echo "$as_me:18216: result: $cf_rpath_space" >&5
18217 echo "${ECHO_T}$cf_rpath_space" >&6
18218         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
18219         ;;
18220 esac
18221
18222 echo "$as_me:18222: checking if rpath-hack should be disabled" >&5
18223 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
18224
18225 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
18226 if test "${enable_rpath_hack+set}" = set; then
18227   enableval="$enable_rpath_hack"
18228   test "$enableval" != no && enableval=yes
18229         if test "$enableval" != "yes" ; then
18230     cf_disable_rpath_hack=yes
18231         else
18232                 cf_disable_rpath_hack=no
18233         fi
18234 else
18235   enableval=yes
18236         cf_disable_rpath_hack=no
18237
18238 fi;
18239 echo "$as_me:18239: result: $cf_disable_rpath_hack" >&5
18240 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
18241 if test "$cf_disable_rpath_hack" = no ; then
18242
18243 echo "$as_me:18243: checking for updated LDFLAGS" >&5
18244 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
18245 if test -n "$LD_RPATH_OPT" ; then
18246         echo "$as_me:18246: result: maybe" >&5
18247 echo "${ECHO_T}maybe" >&6
18248
18249         for ac_prog in ldd
18250 do
18251   # Extract the first word of "$ac_prog", so it can be a program name with args.
18252 set dummy $ac_prog; ac_word=$2
18253 echo "$as_me:18253: checking for $ac_word" >&5
18254 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
18255 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
18256   echo $ECHO_N "(cached) $ECHO_C" >&6
18257 else
18258   if test -n "$cf_ldd_prog"; then
18259   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
18260 else
18261   ac_save_IFS=$IFS; IFS=$ac_path_separator
18262 ac_dummy="$PATH"
18263 for ac_dir in $ac_dummy; do
18264   IFS=$ac_save_IFS
18265   test -z "$ac_dir" && ac_dir=.
18266   $as_executable_p "$ac_dir/$ac_word" || continue
18267 ac_cv_prog_cf_ldd_prog="$ac_prog"
18268 echo "$as_me:18268: found $ac_dir/$ac_word" >&5
18269 break
18270 done
18271
18272 fi
18273 fi
18274 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
18275 if test -n "$cf_ldd_prog"; then
18276   echo "$as_me:18276: result: $cf_ldd_prog" >&5
18277 echo "${ECHO_T}$cf_ldd_prog" >&6
18278 else
18279   echo "$as_me:18279: result: no" >&5
18280 echo "${ECHO_T}no" >&6
18281 fi
18282
18283   test -n "$cf_ldd_prog" && break
18284 done
18285 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
18286
18287         cf_rpath_list="/usr/lib /lib"
18288         if test "$cf_ldd_prog" != no
18289         then
18290                 cf_rpath_oops=
18291
18292 cat >conftest.$ac_ext <<_ACEOF
18293 #line 18293 "configure"
18294 #include "confdefs.h"
18295 #include <stdio.h>
18296 int
18297 main ()
18298 {
18299 printf("Hello");
18300   ;
18301   return 0;
18302 }
18303 _ACEOF
18304 rm -f conftest.$ac_objext conftest$ac_exeext
18305 if { (eval echo "$as_me:18305: \"$ac_link\"") >&5
18306   (eval $ac_link) 2>&5
18307   ac_status=$?
18308   echo "$as_me:18308: \$? = $ac_status" >&5
18309   (exit $ac_status); } &&
18310          { ac_try='test -s conftest$ac_exeext'
18311   { (eval echo "$as_me:18311: \"$ac_try\"") >&5
18312   (eval $ac_try) 2>&5
18313   ac_status=$?
18314   echo "$as_me:18314: \$? = $ac_status" >&5
18315   (exit $ac_status); }; }; then
18316   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
18317                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
18318 else
18319   echo "$as_me: failed program was:" >&5
18320 cat conftest.$ac_ext >&5
18321 fi
18322 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18323
18324                 # If we passed the link-test, but get a "not found" on a given library,
18325                 # this could be due to inept reconfiguration of gcc to make it only
18326                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
18327                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
18328                 # /usr/local libraries.
18329                 if test -n "$cf_rpath_oops"
18330                 then
18331                         for cf_rpath_src in $cf_rpath_oops
18332                         do
18333                                 for cf_rpath_dir in \
18334                                         /usr/local \
18335                                         /usr/pkg \
18336                                         /opt/sfw
18337                                 do
18338                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
18339                                         then
18340                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
18341
18342 echo "${as_me:-configure}:18342: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
18343
18344                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
18345                                                 break
18346                                         fi
18347                                 done
18348                         done
18349                 fi
18350         fi
18351
18352         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18353
18354 echo "${as_me:-configure}:18354: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18355
18356 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
18357
18358 echo "${as_me:-configure}:18358: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
18359
18360 cf_rpath_dst=
18361 for cf_rpath_src in $LDFLAGS
18362 do
18363         case $cf_rpath_src in
18364         (-L*)
18365
18366                 # check if this refers to a directory which we will ignore
18367                 cf_rpath_skip=no
18368                 if test -n "$cf_rpath_list"
18369                 then
18370                         for cf_rpath_item in $cf_rpath_list
18371                         do
18372                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18373                                 then
18374                                         cf_rpath_skip=yes
18375                                         break
18376                                 fi
18377                         done
18378                 fi
18379
18380                 if test "$cf_rpath_skip" = no
18381                 then
18382                         # transform the option
18383                         if test "$LD_RPATH_OPT" = "-R " ; then
18384                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18385                         else
18386                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18387                         fi
18388
18389                         # if we have not already added this, add it now
18390                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18391                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18392                         then
18393                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18394
18395 echo "${as_me:-configure}:18395: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18396
18397                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18398                         fi
18399                 fi
18400                 ;;
18401         esac
18402         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18403 done
18404 LDFLAGS=$cf_rpath_dst
18405
18406 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
18407
18408 echo "${as_me:-configure}:18408: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
18409
18410 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
18411
18412 echo "${as_me:-configure}:18412: testing ...checking LIBS $LIBS ..." 1>&5
18413
18414 cf_rpath_dst=
18415 for cf_rpath_src in $LIBS
18416 do
18417         case $cf_rpath_src in
18418         (-L*)
18419
18420                 # check if this refers to a directory which we will ignore
18421                 cf_rpath_skip=no
18422                 if test -n "$cf_rpath_list"
18423                 then
18424                         for cf_rpath_item in $cf_rpath_list
18425                         do
18426                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18427                                 then
18428                                         cf_rpath_skip=yes
18429                                         break
18430                                 fi
18431                         done
18432                 fi
18433
18434                 if test "$cf_rpath_skip" = no
18435                 then
18436                         # transform the option
18437                         if test "$LD_RPATH_OPT" = "-R " ; then
18438                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18439                         else
18440                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18441                         fi
18442
18443                         # if we have not already added this, add it now
18444                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18445                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18446                         then
18447                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18448
18449 echo "${as_me:-configure}:18449: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18450
18451                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18452                         fi
18453                 fi
18454                 ;;
18455         esac
18456         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18457 done
18458 LIBS=$cf_rpath_dst
18459
18460 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
18461
18462 echo "${as_me:-configure}:18462: testing ...checked LIBS $LIBS ..." 1>&5
18463
18464         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18465
18466 echo "${as_me:-configure}:18466: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18467
18468 else
18469         echo "$as_me:18469: result: no" >&5
18470 echo "${ECHO_T}no" >&6
18471 fi
18472
18473 fi
18474
18475 TEST_ARGS="$LIBS"
18476 LIBS=
18477
18478 ac_config_files="$ac_config_files Makefile"
18479 ac_config_commands="$ac_config_commands default"
18480 cat >confcache <<\_ACEOF
18481 # This file is a shell script that caches the results of configure
18482 # tests run on this system so they can be shared between configure
18483 # scripts and configure runs, see configure's option --config-cache.
18484 # It is not useful on other systems.  If it contains results you don't
18485 # want to keep, you may remove or edit it.
18486 #
18487 # config.status only pays attention to the cache file if you give it
18488 # the --recheck option to rerun configure.
18489 #
18490 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18491 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18492 # following values.
18493
18494 _ACEOF
18495
18496 # The following way of writing the cache mishandles newlines in values,
18497 # but we know of no workaround that is simple, portable, and efficient.
18498 # So, don't put newlines in cache variables' values.
18499 # Ultrix sh set writes to stderr and can't be redirected directly,
18500 # and sets the high bit in the cache file unless we assign to the vars.
18501 {
18502   (set) 2>&1 |
18503     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18504     *ac_space=\ *)
18505       # `set' does not quote correctly, so add quotes (double-quote
18506       # substitution turns \\\\ into \\, and sed turns \\ into \).
18507       sed -n \
18508         "s/'/'\\\\''/g;
18509           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18510       ;;
18511     *)
18512       # `set' quotes correctly as required by POSIX, so do not add quotes.
18513       sed -n \
18514         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18515       ;;
18516     esac;
18517 } |
18518   sed '
18519      t clear
18520      : clear
18521      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18522      t end
18523      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18524      : end' >>confcache
18525 if cmp -s $cache_file confcache; then :; else
18526   if test -w $cache_file; then
18527     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18528     cat confcache >$cache_file
18529   else
18530     echo "not updating unwritable cache $cache_file"
18531   fi
18532 fi
18533 rm -f confcache
18534
18535 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18536 # Let make expand exec_prefix.
18537 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18538
18539 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18540 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18541 # trailing colons and then remove the whole line if VPATH becomes empty
18542 # (actually we leave an empty line to preserve line numbers).
18543 if test "x$srcdir" = x.; then
18544   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18545 s/:*\$(srcdir):*/:/;
18546 s/:*\${srcdir}:*/:/;
18547 s/:*@srcdir@:*/:/;
18548 s/^\([^=]*=[    ]*\):*/\1/;
18549 s/:*$//;
18550 s/^[^=]*=[      ]*$//;
18551 }'
18552 fi
18553
18554 DEFS=-DHAVE_CONFIG_H
18555
18556 : ${CONFIG_STATUS=./config.status}
18557 ac_clean_files_save=$ac_clean_files
18558 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18559 { echo "$as_me:18559: creating $CONFIG_STATUS" >&5
18560 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18561 cat >$CONFIG_STATUS <<_ACEOF
18562 #! $SHELL
18563 # Generated automatically by configure.
18564 # Run this file to recreate the current configuration.
18565 # Compiler output produced by configure, useful for debugging
18566 # configure, is in config.log if it exists.
18567
18568 debug=false
18569 SHELL=\${CONFIG_SHELL-$SHELL}
18570 ac_cs_invocation="\$0 \$@"
18571
18572 _ACEOF
18573
18574 cat >>$CONFIG_STATUS <<\_ACEOF
18575 # Be Bourne compatible
18576 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18577   emulate sh
18578   NULLCMD=:
18579 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18580   set -o posix
18581 fi
18582
18583 # Name of the executable.
18584 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18585
18586 if expr a : '\(a\)' >/dev/null 2>&1; then
18587   as_expr=expr
18588 else
18589   as_expr=false
18590 fi
18591
18592 rm -f conf$$ conf$$.exe conf$$.file
18593 echo >conf$$.file
18594 if ln -s conf$$.file conf$$ 2>/dev/null; then
18595   # We could just check for DJGPP; but this test a) works b) is more generic
18596   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18597   if test -f conf$$.exe; then
18598     # Don't use ln at all; we don't have any links
18599     as_ln_s='cp -p'
18600   else
18601     as_ln_s='ln -s'
18602   fi
18603 elif ln conf$$.file conf$$ 2>/dev/null; then
18604   as_ln_s=ln
18605 else
18606   as_ln_s='cp -p'
18607 fi
18608 rm -f conf$$ conf$$.exe conf$$.file
18609
18610 as_executable_p="test -f"
18611
18612 # Support unset when possible.
18613 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18614   as_unset=unset
18615 else
18616   as_unset=false
18617 fi
18618
18619 # NLS nuisances.
18620 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18621 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18622 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18623 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18624 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18625 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18626 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18627 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18628
18629 # IFS
18630 # We need space, tab and new line, in precisely that order.
18631 as_nl='
18632 '
18633 IFS="   $as_nl"
18634
18635 # CDPATH.
18636 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18637
18638 exec 6>&1
18639
18640 _ACEOF
18641
18642 # Files that config.status was made for.
18643 if test -n "$ac_config_files"; then
18644   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
18645 fi
18646
18647 if test -n "$ac_config_headers"; then
18648   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
18649 fi
18650
18651 if test -n "$ac_config_links"; then
18652   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
18653 fi
18654
18655 if test -n "$ac_config_commands"; then
18656   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
18657 fi
18658
18659 cat >>$CONFIG_STATUS <<\EOF
18660
18661 ac_cs_usage="\
18662 \`$as_me' instantiates files from templates according to the
18663 current configuration.
18664
18665 Usage: $0 [OPTIONS] [FILE]...
18666
18667   -h, --help       print this help, then exit
18668   -V, --version    print version number, then exit
18669   -d, --debug      don't remove temporary files
18670       --recheck    update $as_me by reconfiguring in the same conditions
18671   --file=FILE[:TEMPLATE]
18672                    instantiate the configuration file FILE
18673   --header=FILE[:TEMPLATE]
18674                    instantiate the configuration header FILE
18675
18676 Configuration files:
18677 $config_files
18678
18679 Configuration headers:
18680 $config_headers
18681
18682 Configuration commands:
18683 $config_commands
18684
18685 Report bugs to <dickey@invisible-island.net>."
18686 EOF
18687
18688 cat >>$CONFIG_STATUS <<EOF
18689 ac_cs_version="\\
18690 config.status
18691 configured by $0, generated by GNU Autoconf 2.52.20150926,
18692   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18693
18694 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18695 Free Software Foundation, Inc.
18696 This config.status script is free software; the Free Software Foundation
18697 gives unlimited permission to copy, distribute and modify it."
18698 srcdir=$srcdir
18699 INSTALL="$INSTALL"
18700 EOF
18701
18702 cat >>$CONFIG_STATUS <<\EOF
18703 # If no file are specified by the user, then we need to provide default
18704 # value.  By we need to know if files were specified by the user.
18705 ac_need_defaults=:
18706 while test $# != 0
18707 do
18708   case $1 in
18709   --*=*)
18710     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18711     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18712     shift
18713     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18714     shift
18715     ;;
18716   -*);;
18717   *) # This is not an option, so the user has probably given explicit
18718      # arguments.
18719      ac_need_defaults=false;;
18720   esac
18721
18722   case $1 in
18723   # Handling of the options.
18724 EOF
18725 cat >>$CONFIG_STATUS <<EOF
18726   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18727     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18728     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18729 EOF
18730 cat >>$CONFIG_STATUS <<\EOF
18731   --version | --vers* | -V )
18732     echo "$ac_cs_version"; exit 0 ;;
18733   --he | --h)
18734     # Conflict between --help and --header
18735     { { echo "$as_me:18735: error: ambiguous option: $1
18736 Try \`$0 --help' for more information." >&5
18737 echo "$as_me: error: ambiguous option: $1
18738 Try \`$0 --help' for more information." >&2;}
18739    { (exit 1); exit 1; }; };;
18740   --help | --hel | -h )
18741     echo "$ac_cs_usage"; exit 0 ;;
18742   --debug | --d* | -d )
18743     debug=: ;;
18744   --file | --fil | --fi | --f )
18745     shift
18746     CONFIG_FILES="$CONFIG_FILES $1"
18747     ac_need_defaults=false;;
18748   --header | --heade | --head | --hea )
18749     shift
18750     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18751     ac_need_defaults=false;;
18752
18753   # This is an error.
18754   -*) { { echo "$as_me:18754: error: unrecognized option: $1
18755 Try \`$0 --help' for more information." >&5
18756 echo "$as_me: error: unrecognized option: $1
18757 Try \`$0 --help' for more information." >&2;}
18758    { (exit 1); exit 1; }; } ;;
18759
18760   *) ac_config_targets="$ac_config_targets $1" ;;
18761
18762   esac
18763   shift
18764 done
18765
18766 exec 5>>config.log
18767 cat >&5 << _ACEOF
18768
18769 ## ----------------------- ##
18770 ## Running config.status.  ##
18771 ## ----------------------- ##
18772
18773 This file was extended by $as_me 2.52.20150926, executed with
18774   CONFIG_FILES    = $CONFIG_FILES
18775   CONFIG_HEADERS  = $CONFIG_HEADERS
18776   CONFIG_LINKS    = $CONFIG_LINKS
18777   CONFIG_COMMANDS = $CONFIG_COMMANDS
18778   > $ac_cs_invocation
18779 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18780
18781 _ACEOF
18782 EOF
18783
18784 cat >>$CONFIG_STATUS <<EOF
18785 #
18786 # INIT-COMMANDS section.
18787 #
18788
18789 AWK="$AWK"
18790 ECHO_CC="$ECHO_CC"
18791 ECHO_LD="$ECHO_LD"
18792 SHOW_CC="$SHOW_LD"
18793
18794 EOF
18795
18796 cat >>$CONFIG_STATUS <<\EOF
18797 for ac_config_target in $ac_config_targets
18798 do
18799   case "$ac_config_target" in
18800   # Handling of arguments.
18801   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18802   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18803   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
18804   *) { { echo "$as_me:18804: error: invalid argument: $ac_config_target" >&5
18805 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18806    { (exit 1); exit 1; }; };;
18807   esac
18808 done
18809
18810 # If the user did not use the arguments to specify the items to instantiate,
18811 # then the envvar interface is used.  Set only those that are not.
18812 # We use the long form for the default assignment because of an extremely
18813 # bizarre bug on SunOS 4.1.3.
18814 if $ac_need_defaults; then
18815   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18816   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18817   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18818 fi
18819
18820 # Create a temporary directory, and hook for its removal unless debugging.
18821 $debug ||
18822 {
18823   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18824   trap '{ (exit 1); exit 1; }' 1 2 13 15
18825 }
18826
18827 # Create a (secure) tmp directory for tmp files.
18828 : ${TMPDIR=/tmp}
18829 {
18830   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18831   test -n "$tmp" && test -d "$tmp"
18832 }  ||
18833 {
18834   tmp=$TMPDIR/cs$$-$RANDOM
18835   (umask 077 && mkdir $tmp)
18836 } ||
18837 {
18838    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18839    { (exit 1); exit 1; }
18840 }
18841
18842 EOF
18843
18844 cat >>$CONFIG_STATUS <<EOF
18845
18846 #
18847 # CONFIG_FILES section.
18848 #
18849
18850 # No need to generate the scripts if there are no CONFIG_FILES.
18851 # This happens for instance when ./config.status config.h
18852 if test -n "\$CONFIG_FILES"; then
18853   # Protect against being on the right side of a sed subst in config.status.
18854   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18855    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18856 s,@SHELL@,$SHELL,;t t
18857 s,@exec_prefix@,$exec_prefix,;t t
18858 s,@prefix@,$prefix,;t t
18859 s,@program_transform_name@,$program_transform_name,;t t
18860 s,@bindir@,$bindir,;t t
18861 s,@sbindir@,$sbindir,;t t
18862 s,@libexecdir@,$libexecdir,;t t
18863 s,@datarootdir@,$datarootdir,;t t
18864 s,@datadir@,$datadir,;t t
18865 s,@sysconfdir@,$sysconfdir,;t t
18866 s,@sharedstatedir@,$sharedstatedir,;t t
18867 s,@localstatedir@,$localstatedir,;t t
18868 s,@libdir@,$libdir,;t t
18869 s,@includedir@,$includedir,;t t
18870 s,@oldincludedir@,$oldincludedir,;t t
18871 s,@infodir@,$infodir,;t t
18872 s,@mandir@,$mandir,;t t
18873 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18874 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18875 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18876 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18877 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18878 s,@build_alias@,$build_alias,;t t
18879 s,@host_alias@,$host_alias,;t t
18880 s,@target_alias@,$target_alias,;t t
18881 s,@ECHO_C@,$ECHO_C,;t t
18882 s,@ECHO_N@,$ECHO_N,;t t
18883 s,@ECHO_T@,$ECHO_T,;t t
18884 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18885 s,@DEFS@,$DEFS,;t t
18886 s,@LIBS@,$LIBS,;t t
18887 s,@build@,$build,;t t
18888 s,@build_cpu@,$build_cpu,;t t
18889 s,@build_vendor@,$build_vendor,;t t
18890 s,@build_os@,$build_os,;t t
18891 s,@host@,$host,;t t
18892 s,@host_cpu@,$host_cpu,;t t
18893 s,@host_vendor@,$host_vendor,;t t
18894 s,@host_os@,$host_os,;t t
18895 s,@SET_MAKE@,$SET_MAKE,;t t
18896 s,@CC@,$CC,;t t
18897 s,@CFLAGS@,$CFLAGS,;t t
18898 s,@LDFLAGS@,$LDFLAGS,;t t
18899 s,@CPPFLAGS@,$CPPFLAGS,;t t
18900 s,@ac_ct_CC@,$ac_ct_CC,;t t
18901 s,@EXEEXT@,$EXEEXT,;t t
18902 s,@OBJEXT@,$OBJEXT,;t t
18903 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18904 s,@CPP@,$CPP,;t t
18905 s,@AWK@,$AWK,;t t
18906 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18907 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18908 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18909 s,@LINT@,$LINT,;t t
18910 s,@LINT_OPTS@,$LINT_OPTS,;t t
18911 s,@CTAGS@,$CTAGS,;t t
18912 s,@ETAGS@,$ETAGS,;t t
18913 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18914 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18915 s,@MATH_LIB@,$MATH_LIB,;t t
18916 s,@top_builddir@,$top_builddir,;t t
18917 s,@CC_G_OPT@,$CC_G_OPT,;t t
18918 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18919 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18920 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18921 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18922 s,@LD@,$LD,;t t
18923 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
18924 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
18925 s,@LD_MODEL@,$LD_MODEL,;t t
18926 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18927 s,@LIBTOOL@,$LIBTOOL,;t t
18928 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
18929 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
18930 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
18931 s,@LIB_LINK@,$LIB_LINK,;t t
18932 s,@LINK_TESTS@,$LINK_TESTS,;t t
18933 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18934 s,@PACKAGE@,$PACKAGE,;t t
18935 s,@PTHREAD@,$PTHREAD,;t t
18936 s,@TEST_ARGS@,$TEST_ARGS,;t t
18937 s,@TEST_DEPS@,$TEST_DEPS,;t t
18938 s,@TEST_LIBS@,$TEST_LIBS,;t t
18939 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
18940 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18941 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18942 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18943 s,@includesubdir@,$includesubdir,;t t
18944 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18945 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18946 s,@ECHO_LT@,$ECHO_LT,;t t
18947 s,@ECHO_LD@,$ECHO_LD,;t t
18948 s,@RULE_CC@,$RULE_CC,;t t
18949 s,@SHOW_CC@,$SHOW_CC,;t t
18950 s,@ECHO_CC@,$ECHO_CC,;t t
18951 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18952 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18953 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18954 s,@X_CFLAGS@,$X_CFLAGS,;t t
18955 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
18956 s,@X_LIBS@,$X_LIBS,;t t
18957 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
18958 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
18959 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
18960 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18961 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
18962 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18963 CEOF
18964
18965 EOF
18966
18967   cat >>$CONFIG_STATUS <<\EOF
18968   # Split the substitutions into bite-sized pieces for seds with
18969   # small command number limits, like on Digital OSF/1 and HP-UX.
18970   ac_max_sed_lines=48
18971   ac_sed_frag=1 # Number of current file.
18972   ac_beg=1 # First line for current file.
18973   ac_end=$ac_max_sed_lines # Line after last line for current file.
18974   ac_more_lines=:
18975   ac_sed_cmds=
18976   while $ac_more_lines; do
18977     if test $ac_beg -gt 1; then
18978       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18979     else
18980       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18981     fi
18982     if test ! -s $tmp/subs.frag; then
18983       ac_more_lines=false
18984     else
18985       # The purpose of the label and of the branching condition is to
18986       # speed up the sed processing (if there are no `@' at all, there
18987       # is no need to browse any of the substitutions).
18988       # These are the two extra sed commands mentioned above.
18989       (echo ':t
18990   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18991       # It is possible to make a multiline substitution using escaped newlines.
18992       # Ensure that we do not split the substitution between script fragments.
18993       ac_BEG=$ac_end
18994       ac_END=`expr $ac_end + $ac_max_sed_lines`
18995       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18996       if test -s $tmp/subs.next; then
18997         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18998         if test ! -s $tmp/subs.edit; then
18999           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
19000           if test ! -s $tmp/subs.edit; then
19001             if test $ac_beg -gt 1; then
19002               ac_end=`expr $ac_end - 1`
19003               continue
19004             fi
19005           fi
19006         fi
19007       fi
19008
19009       if test -z "$ac_sed_cmds"; then
19010         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
19011       else
19012         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
19013       fi
19014       ac_sed_frag=`expr $ac_sed_frag + 1`
19015       ac_beg=$ac_end
19016       ac_end=`expr $ac_end + $ac_max_sed_lines`
19017     fi
19018   done
19019   if test -z "$ac_sed_cmds"; then
19020     ac_sed_cmds=cat
19021   fi
19022 fi # test -n "$CONFIG_FILES"
19023
19024 EOF
19025 cat >>$CONFIG_STATUS <<\EOF
19026 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19027   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19028   case $ac_file in
19029   - | *:- | *:-:* ) # input from stdin
19030         cat >$tmp/stdin
19031         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19032         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19033   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19034         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19035   * )   ac_file_in=$ac_file.in ;;
19036   esac
19037
19038   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19039   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19040          X"$ac_file" : 'X\(//\)[^/]' \| \
19041          X"$ac_file" : 'X\(//\)$' \| \
19042          X"$ac_file" : 'X\(/\)' \| \
19043          .     : '\(.\)' 2>/dev/null ||
19044 echo X"$ac_file" |
19045     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19046           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19047           /^X\(\/\/\)$/{ s//\1/; q; }
19048           /^X\(\/\).*/{ s//\1/; q; }
19049           s/.*/./; q'`
19050   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19051     { case "$ac_dir" in
19052   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19053   *)                      as_incr_dir=.;;
19054 esac
19055 as_dummy="$ac_dir"
19056 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19057   case $as_mkdir_dir in
19058     # Skip DOS drivespec
19059     ?:) as_incr_dir=$as_mkdir_dir ;;
19060     *)
19061       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19062       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19063     ;;
19064   esac
19065 done; }
19066
19067     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
19068     # A "../" for each directory in $ac_dir_suffix.
19069     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19070   else
19071     ac_dir_suffix= ac_dots=
19072   fi
19073
19074   case $srcdir in
19075   .)  ac_srcdir=.
19076       if test -z "$ac_dots"; then
19077          ac_top_srcdir=.
19078       else
19079          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
19080       fi ;;
19081   [\\/]* | ?:[\\/]* )
19082       ac_srcdir=$srcdir$ac_dir_suffix;
19083       ac_top_srcdir=$srcdir ;;
19084   *) # Relative path.
19085     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
19086     ac_top_srcdir=$ac_dots$srcdir ;;
19087   esac
19088
19089   case $INSTALL in
19090   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19091   *) ac_INSTALL=$ac_dots$INSTALL ;;
19092   esac
19093
19094   if test x"$ac_file" != x-; then
19095     { echo "$as_me:19095: creating $ac_file" >&5
19096 echo "$as_me: creating $ac_file" >&6;}
19097     rm -f "$ac_file"
19098   fi
19099   # Let's still pretend it is `configure' which instantiates (i.e., don't
19100   # use $as_me), people would be surprised to read:
19101   #    /* config.h.  Generated automatically by config.status.  */
19102   configure_input="Generated automatically from `echo $ac_file_in |
19103                                                  sed 's,.*/,,'` by configure."
19104
19105   # First look for the input files in the build tree, otherwise in the
19106   # src tree.
19107   ac_file_inputs=`IFS=:
19108     for f in $ac_file_in; do
19109       case $f in
19110       -) echo $tmp/stdin ;;
19111       [\\/$]*)
19112          # Absolute (can't be DOS-style, as IFS=:)
19113          test -f "$f" || { { echo "$as_me:19113: error: cannot find input file: $f" >&5
19114 echo "$as_me: error: cannot find input file: $f" >&2;}
19115    { (exit 1); exit 1; }; }
19116          echo $f;;
19117       *) # Relative
19118          if test -f "$f"; then
19119            # Build tree
19120            echo $f
19121          elif test -f "$srcdir/$f"; then
19122            # Source tree
19123            echo $srcdir/$f
19124          else
19125            # /dev/null tree
19126            { { echo "$as_me:19126: error: cannot find input file: $f" >&5
19127 echo "$as_me: error: cannot find input file: $f" >&2;}
19128    { (exit 1); exit 1; }; }
19129          fi;;
19130       esac
19131     done` || { (exit 1); exit 1; }
19132 EOF
19133 cat >>$CONFIG_STATUS <<\EOF
19134   ac_warn_datarootdir=no
19135   if test x"$ac_file" != x-; then
19136     for ac_item in $ac_file_inputs
19137     do
19138       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
19139       if test -n "$ac_seen"; then
19140         ac_used=`grep '@datarootdir@' $ac_item`
19141         if test -z "$ac_used"; then
19142           { echo "$as_me:19142: WARNING: datarootdir was used implicitly but not set:
19143 $ac_seen" >&5
19144 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19145 $ac_seen" >&2;}
19146           ac_warn_datarootdir=yes
19147         fi
19148       fi
19149       ac_seen=`grep '${datarootdir}' $ac_item`
19150       if test -n "$ac_seen"; then
19151         { echo "$as_me:19151: WARNING: datarootdir was used explicitly but not set:
19152 $ac_seen" >&5
19153 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19154 $ac_seen" >&2;}
19155         ac_warn_datarootdir=yes
19156       fi
19157     done
19158   fi
19159
19160 if test "x$ac_warn_datarootdir" = xyes; then
19161   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19162 fi
19163
19164 EOF
19165 cat >>$CONFIG_STATUS <<EOF
19166   sed "$ac_vpsub
19167 $extrasub
19168 EOF
19169 cat >>$CONFIG_STATUS <<\EOF
19170 :t
19171 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19172 s,@configure_input@,$configure_input,;t t
19173 s,@srcdir@,$ac_srcdir,;t t
19174 s,@top_srcdir@,$ac_top_srcdir,;t t
19175 s,@INSTALL@,$ac_INSTALL,;t t
19176 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
19177   rm -f $tmp/stdin
19178   if test x"$ac_file" != x-; then
19179     cp $tmp/out $ac_file
19180
19181     for ac_name in prefix exec_prefix datarootdir
19182     do
19183         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
19184         if test -n "$ac_seen"; then
19185             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
19186             if test -z "$ac_init"; then
19187               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
19188               { echo "$as_me:19188: WARNING: Variable $ac_name is used but was not set:
19189 $ac_seen" >&5
19190 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19191 $ac_seen" >&2;}
19192             fi
19193         fi
19194     done
19195     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
19196     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
19197     if test -s $tmp/out; then
19198       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
19199       { echo "$as_me:19199: WARNING: Some variables may not be substituted:
19200 $ac_seen" >&5
19201 echo "$as_me: WARNING: Some variables may not be substituted:
19202 $ac_seen" >&2;}
19203     fi
19204   else
19205     cat $tmp/out
19206   fi
19207   rm -f $tmp/out
19208
19209 done
19210 EOF
19211 cat >>$CONFIG_STATUS <<\EOF
19212
19213 #
19214 # CONFIG_HEADER section.
19215 #
19216
19217 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19218 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19219 #
19220 # ac_d sets the value in "#define NAME VALUE" lines.
19221 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19222 ac_dB='[        ].*$,\1#\2'
19223 ac_dC=' '
19224 ac_dD=',;t'
19225 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19226 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19227 ac_iB='\([      ]\),\1#\2define\3'
19228 ac_iC=' '
19229 ac_iD='\4,;t'
19230 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19231 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19232 ac_uB='$,\1#\2define\3'
19233 ac_uC=' '
19234 ac_uD=',;t'
19235
19236 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19237   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19238   case $ac_file in
19239   - | *:- | *:-:* ) # input from stdin
19240         cat >$tmp/stdin
19241         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19242         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19243   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19244         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19245   * )   ac_file_in=$ac_file.in ;;
19246   esac
19247
19248   test x"$ac_file" != x- && { echo "$as_me:19248: creating $ac_file" >&5
19249 echo "$as_me: creating $ac_file" >&6;}
19250
19251   # First look for the input files in the build tree, otherwise in the
19252   # src tree.
19253   ac_file_inputs=`IFS=:
19254     for f in $ac_file_in; do
19255       case $f in
19256       -) echo $tmp/stdin ;;
19257       [\\/$]*)
19258          # Absolute (can't be DOS-style, as IFS=:)
19259          test -f "$f" || { { echo "$as_me:19259: error: cannot find input file: $f" >&5
19260 echo "$as_me: error: cannot find input file: $f" >&2;}
19261    { (exit 1); exit 1; }; }
19262          echo $f;;
19263       *) # Relative
19264          if test -f "$f"; then
19265            # Build tree
19266            echo $f
19267          elif test -f "$srcdir/$f"; then
19268            # Source tree
19269            echo $srcdir/$f
19270          else
19271            # /dev/null tree
19272            { { echo "$as_me:19272: error: cannot find input file: $f" >&5
19273 echo "$as_me: error: cannot find input file: $f" >&2;}
19274    { (exit 1); exit 1; }; }
19275          fi;;
19276       esac
19277     done` || { (exit 1); exit 1; }
19278   # Remove the trailing spaces.
19279   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
19280
19281 EOF
19282
19283 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19284 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19285 # be either 'cat' or 'sort'.
19286 cat confdefs.h | uniq >conftest.vals
19287
19288 # Break up conftest.vals because some shells have a limit on
19289 # the size of here documents, and old seds have small limits too.
19290
19291 rm -f conftest.tail
19292 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
19293 while grep . conftest.vals >/dev/null
19294 do
19295   # Write chunks of a limited-size here document to conftest.frag.
19296   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
19297   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
19298   echo 'CEOF' >> $CONFIG_STATUS
19299   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
19300   rm -f conftest.vals
19301   mv conftest.tail conftest.vals
19302 done
19303 rm -f conftest.vals
19304
19305 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19306 # marker @DEFS@.
19307 echo '  cat >> conftest.edit <<CEOF
19308 /@DEFS@/r conftest.frag
19309 /@DEFS@/d
19310 CEOF
19311 sed -f conftest.edit $tmp/in > $tmp/out
19312 rm -f $tmp/in
19313 mv $tmp/out $tmp/in
19314 rm -f conftest.edit conftest.frag
19315 ' >> $CONFIG_STATUS
19316
19317 cat >>$CONFIG_STATUS <<\EOF
19318   # Let's still pretend it is `configure' which instantiates (i.e., don't
19319   # use $as_me), people would be surprised to read:
19320   #    /* config.h.  Generated automatically by config.status.  */
19321   if test x"$ac_file" = x-; then
19322     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19323   else
19324     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19325   fi
19326   cat $tmp/in >>$tmp/config.h
19327   rm -f $tmp/in
19328   if test x"$ac_file" != x-; then
19329     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
19330       { echo "$as_me:19330: $ac_file is unchanged" >&5
19331 echo "$as_me: $ac_file is unchanged" >&6;}
19332     else
19333       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19334          X"$ac_file" : 'X\(//\)[^/]' \| \
19335          X"$ac_file" : 'X\(//\)$' \| \
19336          X"$ac_file" : 'X\(/\)' \| \
19337          .     : '\(.\)' 2>/dev/null ||
19338 echo X"$ac_file" |
19339     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19340           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19341           /^X\(\/\/\)$/{ s//\1/; q; }
19342           /^X\(\/\).*/{ s//\1/; q; }
19343           s/.*/./; q'`
19344       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19345         { case "$ac_dir" in
19346   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19347   *)                      as_incr_dir=.;;
19348 esac
19349 as_dummy="$ac_dir"
19350 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19351   case $as_mkdir_dir in
19352     # Skip DOS drivespec
19353     ?:) as_incr_dir=$as_mkdir_dir ;;
19354     *)
19355       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19356       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19357     ;;
19358   esac
19359 done; }
19360
19361       fi
19362       rm -f $ac_file
19363       mv $tmp/config.h $ac_file
19364     fi
19365   else
19366     cat $tmp/config.h
19367     rm -f $tmp/config.h
19368   fi
19369 done
19370 EOF
19371 cat >>$CONFIG_STATUS <<\EOF
19372 #
19373 # CONFIG_COMMANDS section.
19374 #
19375 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19376   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19377   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19378
19379   case $ac_dest in
19380     default )
19381
19382 for cf_dir in .
19383 do
19384         if test ! -d $srcdir/$cf_dir; then
19385                 continue
19386         elif test -f $srcdir/$cf_dir/programs; then
19387                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
19388         fi
19389 done
19390
19391         cat >>Makefile <<TEST_EOF
19392
19393 # These rules are generated so we do not rely on suffix rules, which do not
19394 # work consistently for different make-programs (the '\$(MODEL)/' confuses
19395 # some, and the '\$x' confuses others).
19396 TEST_EOF
19397
19398 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
19399 for N in $LIST
19400 do
19401         cat >>Makefile <<TEST_EOF
19402
19403 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
19404         \$(srcdir)/test.priv.h \\
19405         ncurses_cfg.h
19406         $SHOW_CC
19407         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
19408 TEST_EOF
19409 done
19410
19411 if test -f ../config.guess && test -f ../config.sub
19412 then
19413         cat >>Makefile <<TEST_EOF
19414
19415 # if we used CF_INHERIT for getting these files, we can remove them
19416 distclean::
19417         rm -f config.guess config.sub
19418 TEST_EOF
19419 fi
19420  ;;
19421   esac
19422 done
19423 EOF
19424
19425 cat >>$CONFIG_STATUS <<\EOF
19426
19427 { (exit 0); exit 0; }
19428 EOF
19429 chmod +x $CONFIG_STATUS
19430 ac_clean_files=$ac_clean_files_save
19431
19432 # configure is writing to config.log, and then calls config.status.
19433 # config.status does its own redirection, appending to config.log.
19434 # Unfortunately, on DOS this fails, as config.log is still kept open
19435 # by configure, so config.status won't be able to write to it; its
19436 # output is simply discarded.  So we exec the FD to /dev/null,
19437 # effectively closing config.log, so it can be properly (re)opened and
19438 # appended to by config.status.  When coming back to configure, we
19439 # need to make the FD available again.
19440 if test "$no_create" != yes; then
19441   ac_cs_success=:
19442   exec 5>/dev/null
19443   $SHELL $CONFIG_STATUS || ac_cs_success=false
19444   exec 5>>config.log
19445   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19446   # would make configure fail if this is the last instruction.
19447   $ac_cs_success || { (exit 1); exit 1; }
19448 fi
19449