]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
9f42cc1b22650407f4162f813a0412bdc764c4d9
[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 else
2903
2904                 echo "$as_me:2904: checking for strlcat in -lbsd" >&5
2905 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
2906 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
2907   echo $ECHO_N "(cached) $ECHO_C" >&6
2908 else
2909   ac_check_lib_save_LIBS=$LIBS
2910 LIBS="-lbsd  $LIBS"
2911 cat >conftest.$ac_ext <<_ACEOF
2912 #line 2912 "configure"
2913 #include "confdefs.h"
2914
2915 /* Override any gcc2 internal prototype to avoid an error.  */
2916 #ifdef __cplusplus
2917 extern "C"
2918 #endif
2919 /* We use char because int might match the return type of a gcc2
2920    builtin and then its argument prototype would still apply.  */
2921 char strlcat ();
2922 int
2923 main ()
2924 {
2925 strlcat ();
2926   ;
2927   return 0;
2928 }
2929 _ACEOF
2930 rm -f conftest.$ac_objext conftest$ac_exeext
2931 if { (eval echo "$as_me:2931: \"$ac_link\"") >&5
2932   (eval $ac_link) 2>&5
2933   ac_status=$?
2934   echo "$as_me:2934: \$? = $ac_status" >&5
2935   (exit $ac_status); } &&
2936          { ac_try='test -s conftest$ac_exeext'
2937   { (eval echo "$as_me:2937: \"$ac_try\"") >&5
2938   (eval $ac_try) 2>&5
2939   ac_status=$?
2940   echo "$as_me:2940: \$? = $ac_status" >&5
2941   (exit $ac_status); }; }; then
2942   ac_cv_lib_bsd_strlcat=yes
2943 else
2944   echo "$as_me: failed program was:" >&5
2945 cat conftest.$ac_ext >&5
2946 ac_cv_lib_bsd_strlcat=no
2947 fi
2948 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2949 LIBS=$ac_check_lib_save_LIBS
2950 fi
2951 echo "$as_me:2951: result: $ac_cv_lib_bsd_strlcat" >&5
2952 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
2953 if test $ac_cv_lib_bsd_strlcat = yes; then
2954
2955 cf_add_libs="-lbsd"
2956 # Filter out duplicates - this happens with badly-designed ".pc" files...
2957 for cf_add_1lib in $LIBS
2958 do
2959         for cf_add_2lib in $cf_add_libs
2960         do
2961                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
2962                 then
2963                         cf_add_1lib=
2964                         break
2965                 fi
2966         done
2967         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
2968 done
2969 LIBS="$cf_add_libs"
2970
2971 for ac_header in bsd/string.h
2972 do
2973 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
2974 echo "$as_me:2974: checking for $ac_header" >&5
2975 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
2976 if eval "test \"\${$as_ac_Header+set}\" = set"; then
2977   echo $ECHO_N "(cached) $ECHO_C" >&6
2978 else
2979   cat >conftest.$ac_ext <<_ACEOF
2980 #line 2980 "configure"
2981 #include "confdefs.h"
2982 #include <$ac_header>
2983 _ACEOF
2984 if { (eval echo "$as_me:2984: \"$ac_cpp conftest.$ac_ext\"") >&5
2985   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2986   ac_status=$?
2987   egrep -v '^ *\+' conftest.er1 >conftest.err
2988   rm -f conftest.er1
2989   cat conftest.err >&5
2990   echo "$as_me:2990: \$? = $ac_status" >&5
2991   (exit $ac_status); } >/dev/null; then
2992   if test -s conftest.err; then
2993     ac_cpp_err=$ac_c_preproc_warn_flag
2994   else
2995     ac_cpp_err=
2996   fi
2997 else
2998   ac_cpp_err=yes
2999 fi
3000 if test -z "$ac_cpp_err"; then
3001   eval "$as_ac_Header=yes"
3002 else
3003   echo "$as_me: failed program was:" >&5
3004   cat conftest.$ac_ext >&5
3005   eval "$as_ac_Header=no"
3006 fi
3007 rm -f conftest.err conftest.$ac_ext
3008 fi
3009 echo "$as_me:3009: result: `eval echo '${'$as_ac_Header'}'`" >&5
3010 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3011 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3012   cat >>confdefs.h <<EOF
3013 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3014 EOF
3015
3016 fi
3017 done
3018
3019 cat >>confdefs.h <<\EOF
3020 #define HAVE_STRLCAT 1
3021 EOF
3022
3023 fi
3024
3025 fi
3026
3027 for ac_func in strlcpy snprintf
3028 do
3029 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3030 echo "$as_me:3030: checking for $ac_func" >&5
3031 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3032 if eval "test \"\${$as_ac_var+set}\" = set"; then
3033   echo $ECHO_N "(cached) $ECHO_C" >&6
3034 else
3035   cat >conftest.$ac_ext <<_ACEOF
3036 #line 3036 "configure"
3037 #include "confdefs.h"
3038 /* System header to define __stub macros and hopefully few prototypes,
3039     which can conflict with char $ac_func (); below.  */
3040 #include <assert.h>
3041 /* Override any gcc2 internal prototype to avoid an error.  */
3042 #ifdef __cplusplus
3043 extern "C"
3044 #endif
3045 /* We use char because int might match the return type of a gcc2
3046    builtin and then its argument prototype would still apply.  */
3047 char $ac_func ();
3048 char (*f) ();
3049
3050 int
3051 main ()
3052 {
3053 /* The GNU C library defines this for functions which it implements
3054     to always fail with ENOSYS.  Some functions are actually named
3055     something starting with __ and the normal name is an alias.  */
3056 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3057 choke me
3058 #else
3059 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
3060 #endif
3061
3062   ;
3063   return 0;
3064 }
3065 _ACEOF
3066 rm -f conftest.$ac_objext conftest$ac_exeext
3067 if { (eval echo "$as_me:3067: \"$ac_link\"") >&5
3068   (eval $ac_link) 2>&5
3069   ac_status=$?
3070   echo "$as_me:3070: \$? = $ac_status" >&5
3071   (exit $ac_status); } &&
3072          { ac_try='test -s conftest$ac_exeext'
3073   { (eval echo "$as_me:3073: \"$ac_try\"") >&5
3074   (eval $ac_try) 2>&5
3075   ac_status=$?
3076   echo "$as_me:3076: \$? = $ac_status" >&5
3077   (exit $ac_status); }; }; then
3078   eval "$as_ac_var=yes"
3079 else
3080   echo "$as_me: failed program was:" >&5
3081 cat conftest.$ac_ext >&5
3082 eval "$as_ac_var=no"
3083 fi
3084 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3085 fi
3086 echo "$as_me:3086: result: `eval echo '${'$as_ac_var'}'`" >&5
3087 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3088 if test `eval echo '${'$as_ac_var'}'` = yes; then
3089   cat >>confdefs.h <<EOF
3090 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3091 EOF
3092
3093 fi
3094 done
3095
3096 fi
3097
3098 cf_XOPEN_SOURCE=500
3099 cf_POSIX_C_SOURCE=199506L
3100 cf_xopen_source=
3101
3102 case $host_os in
3103 (aix[4-7]*)
3104         cf_xopen_source="-D_ALL_SOURCE"
3105         ;;
3106 (msys)
3107         cf_XOPEN_SOURCE=600
3108         ;;
3109 (darwin[0-8].*)
3110         cf_xopen_source="-D_APPLE_C_SOURCE"
3111         ;;
3112 (darwin*)
3113         cf_xopen_source="-D_DARWIN_C_SOURCE"
3114         cf_XOPEN_SOURCE=
3115         ;;
3116 (freebsd*|dragonfly*)
3117         # 5.x headers associate
3118         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3119         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3120         cf_POSIX_C_SOURCE=200112L
3121         cf_XOPEN_SOURCE=600
3122         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3123         ;;
3124 (hpux11*)
3125         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3126         ;;
3127 (hpux*)
3128         cf_xopen_source="-D_HPUX_SOURCE"
3129         ;;
3130 (irix[56].*)
3131         cf_xopen_source="-D_SGI_SOURCE"
3132         cf_XOPEN_SOURCE=
3133         ;;
3134 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3135
3136 echo "$as_me:3136: checking if we must define _GNU_SOURCE" >&5
3137 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3138 if test "${cf_cv_gnu_source+set}" = set; then
3139   echo $ECHO_N "(cached) $ECHO_C" >&6
3140 else
3141
3142 cat >conftest.$ac_ext <<_ACEOF
3143 #line 3143 "configure"
3144 #include "confdefs.h"
3145 #include <sys/types.h>
3146 int
3147 main ()
3148 {
3149
3150 #ifndef _XOPEN_SOURCE
3151 make an error
3152 #endif
3153   ;
3154   return 0;
3155 }
3156 _ACEOF
3157 rm -f conftest.$ac_objext
3158 if { (eval echo "$as_me:3158: \"$ac_compile\"") >&5
3159   (eval $ac_compile) 2>&5
3160   ac_status=$?
3161   echo "$as_me:3161: \$? = $ac_status" >&5
3162   (exit $ac_status); } &&
3163          { ac_try='test -s conftest.$ac_objext'
3164   { (eval echo "$as_me:3164: \"$ac_try\"") >&5
3165   (eval $ac_try) 2>&5
3166   ac_status=$?
3167   echo "$as_me:3167: \$? = $ac_status" >&5
3168   (exit $ac_status); }; }; then
3169   cf_cv_gnu_source=no
3170 else
3171   echo "$as_me: failed program was:" >&5
3172 cat conftest.$ac_ext >&5
3173 cf_save="$CPPFLAGS"
3174          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3175          cat >conftest.$ac_ext <<_ACEOF
3176 #line 3176 "configure"
3177 #include "confdefs.h"
3178 #include <sys/types.h>
3179 int
3180 main ()
3181 {
3182
3183 #ifdef _XOPEN_SOURCE
3184 make an error
3185 #endif
3186   ;
3187   return 0;
3188 }
3189 _ACEOF
3190 rm -f conftest.$ac_objext
3191 if { (eval echo "$as_me:3191: \"$ac_compile\"") >&5
3192   (eval $ac_compile) 2>&5
3193   ac_status=$?
3194   echo "$as_me:3194: \$? = $ac_status" >&5
3195   (exit $ac_status); } &&
3196          { ac_try='test -s conftest.$ac_objext'
3197   { (eval echo "$as_me:3197: \"$ac_try\"") >&5
3198   (eval $ac_try) 2>&5
3199   ac_status=$?
3200   echo "$as_me:3200: \$? = $ac_status" >&5
3201   (exit $ac_status); }; }; then
3202   cf_cv_gnu_source=no
3203 else
3204   echo "$as_me: failed program was:" >&5
3205 cat conftest.$ac_ext >&5
3206 cf_cv_gnu_source=yes
3207 fi
3208 rm -f conftest.$ac_objext conftest.$ac_ext
3209         CPPFLAGS="$cf_save"
3210
3211 fi
3212 rm -f conftest.$ac_objext conftest.$ac_ext
3213
3214 fi
3215 echo "$as_me:3215: result: $cf_cv_gnu_source" >&5
3216 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3217
3218 if test "$cf_cv_gnu_source" = yes
3219 then
3220 echo "$as_me:3220: checking if we should also define _DEFAULT_SOURCE" >&5
3221 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
3222 if test "${cf_cv_default_source+set}" = set; then
3223   echo $ECHO_N "(cached) $ECHO_C" >&6
3224 else
3225
3226 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3227         cat >conftest.$ac_ext <<_ACEOF
3228 #line 3228 "configure"
3229 #include "confdefs.h"
3230 #include <sys/types.h>
3231 int
3232 main ()
3233 {
3234
3235 #ifdef _DEFAULT_SOURCE
3236 make an error
3237 #endif
3238   ;
3239   return 0;
3240 }
3241 _ACEOF
3242 rm -f conftest.$ac_objext
3243 if { (eval echo "$as_me:3243: \"$ac_compile\"") >&5
3244   (eval $ac_compile) 2>&5
3245   ac_status=$?
3246   echo "$as_me:3246: \$? = $ac_status" >&5
3247   (exit $ac_status); } &&
3248          { ac_try='test -s conftest.$ac_objext'
3249   { (eval echo "$as_me:3249: \"$ac_try\"") >&5
3250   (eval $ac_try) 2>&5
3251   ac_status=$?
3252   echo "$as_me:3252: \$? = $ac_status" >&5
3253   (exit $ac_status); }; }; then
3254   cf_cv_default_source=no
3255 else
3256   echo "$as_me: failed program was:" >&5
3257 cat conftest.$ac_ext >&5
3258 cf_cv_default_source=yes
3259 fi
3260 rm -f conftest.$ac_objext conftest.$ac_ext
3261
3262 fi
3263 echo "$as_me:3263: result: $cf_cv_default_source" >&5
3264 echo "${ECHO_T}$cf_cv_default_source" >&6
3265 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
3266 fi
3267
3268         ;;
3269 (minix*)
3270         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
3271         ;;
3272 (mirbsd*)
3273         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3274         cf_XOPEN_SOURCE=
3275
3276 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3277
3278 cf_save_CFLAGS="$CFLAGS"
3279 cf_save_CPPFLAGS="$CPPFLAGS"
3280
3281 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3282         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3283                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3284
3285 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3286         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3287                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3288
3289 echo "$as_me:3289: checking if we should define _POSIX_C_SOURCE" >&5
3290 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3291 if test "${cf_cv_posix_c_source+set}" = set; then
3292   echo $ECHO_N "(cached) $ECHO_C" >&6
3293 else
3294
3295 echo "${as_me:-configure}:3295: testing if the symbol is already defined go no further ..." 1>&5
3296
3297         cat >conftest.$ac_ext <<_ACEOF
3298 #line 3298 "configure"
3299 #include "confdefs.h"
3300 #include <sys/types.h>
3301 int
3302 main ()
3303 {
3304
3305 #ifndef _POSIX_C_SOURCE
3306 make an error
3307 #endif
3308   ;
3309   return 0;
3310 }
3311 _ACEOF
3312 rm -f conftest.$ac_objext
3313 if { (eval echo "$as_me:3313: \"$ac_compile\"") >&5
3314   (eval $ac_compile) 2>&5
3315   ac_status=$?
3316   echo "$as_me:3316: \$? = $ac_status" >&5
3317   (exit $ac_status); } &&
3318          { ac_try='test -s conftest.$ac_objext'
3319   { (eval echo "$as_me:3319: \"$ac_try\"") >&5
3320   (eval $ac_try) 2>&5
3321   ac_status=$?
3322   echo "$as_me:3322: \$? = $ac_status" >&5
3323   (exit $ac_status); }; }; then
3324   cf_cv_posix_c_source=no
3325 else
3326   echo "$as_me: failed program was:" >&5
3327 cat conftest.$ac_ext >&5
3328 cf_want_posix_source=no
3329          case .$cf_POSIX_C_SOURCE in
3330          (.[12]??*)
3331                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3332                 ;;
3333          (.2)
3334                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3335                 cf_want_posix_source=yes
3336                 ;;
3337          (.*)
3338                 cf_want_posix_source=yes
3339                 ;;
3340          esac
3341          if test "$cf_want_posix_source" = yes ; then
3342                 cat >conftest.$ac_ext <<_ACEOF
3343 #line 3343 "configure"
3344 #include "confdefs.h"
3345 #include <sys/types.h>
3346 int
3347 main ()
3348 {
3349
3350 #ifdef _POSIX_SOURCE
3351 make an error
3352 #endif
3353   ;
3354   return 0;
3355 }
3356 _ACEOF
3357 rm -f conftest.$ac_objext
3358 if { (eval echo "$as_me:3358: \"$ac_compile\"") >&5
3359   (eval $ac_compile) 2>&5
3360   ac_status=$?
3361   echo "$as_me:3361: \$? = $ac_status" >&5
3362   (exit $ac_status); } &&
3363          { ac_try='test -s conftest.$ac_objext'
3364   { (eval echo "$as_me:3364: \"$ac_try\"") >&5
3365   (eval $ac_try) 2>&5
3366   ac_status=$?
3367   echo "$as_me:3367: \$? = $ac_status" >&5
3368   (exit $ac_status); }; }; then
3369   :
3370 else
3371   echo "$as_me: failed program was:" >&5
3372 cat conftest.$ac_ext >&5
3373 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3374 fi
3375 rm -f conftest.$ac_objext conftest.$ac_ext
3376          fi
3377
3378 echo "${as_me:-configure}:3378: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3379
3380          CFLAGS="$cf_trim_CFLAGS"
3381          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3382
3383 echo "${as_me:-configure}:3383: testing if the second compile does not leave our definition intact error ..." 1>&5
3384
3385          cat >conftest.$ac_ext <<_ACEOF
3386 #line 3386 "configure"
3387 #include "confdefs.h"
3388 #include <sys/types.h>
3389 int
3390 main ()
3391 {
3392
3393 #ifndef _POSIX_C_SOURCE
3394 make an error
3395 #endif
3396   ;
3397   return 0;
3398 }
3399 _ACEOF
3400 rm -f conftest.$ac_objext
3401 if { (eval echo "$as_me:3401: \"$ac_compile\"") >&5
3402   (eval $ac_compile) 2>&5
3403   ac_status=$?
3404   echo "$as_me:3404: \$? = $ac_status" >&5
3405   (exit $ac_status); } &&
3406          { ac_try='test -s conftest.$ac_objext'
3407   { (eval echo "$as_me:3407: \"$ac_try\"") >&5
3408   (eval $ac_try) 2>&5
3409   ac_status=$?
3410   echo "$as_me:3410: \$? = $ac_status" >&5
3411   (exit $ac_status); }; }; then
3412   :
3413 else
3414   echo "$as_me: failed program was:" >&5
3415 cat conftest.$ac_ext >&5
3416 cf_cv_posix_c_source=no
3417 fi
3418 rm -f conftest.$ac_objext conftest.$ac_ext
3419          CFLAGS="$cf_save_CFLAGS"
3420          CPPFLAGS="$cf_save_CPPFLAGS"
3421
3422 fi
3423 rm -f conftest.$ac_objext conftest.$ac_ext
3424
3425 fi
3426 echo "$as_me:3426: result: $cf_cv_posix_c_source" >&5
3427 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3428
3429 if test "$cf_cv_posix_c_source" != no ; then
3430         CFLAGS="$cf_trim_CFLAGS"
3431         CPPFLAGS="$cf_trim_CPPFLAGS"
3432
3433 cf_fix_cppflags=no
3434 cf_new_cflags=
3435 cf_new_cppflags=
3436 cf_new_extra_cppflags=
3437
3438 for cf_add_cflags in $cf_cv_posix_c_source
3439 do
3440 case $cf_fix_cppflags in
3441 (no)
3442         case $cf_add_cflags in
3443         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3444                 case $cf_add_cflags in
3445                 (-D*)
3446                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3447
3448                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3449                                 && test -z "${cf_tst_cflags}" \
3450                                 && cf_fix_cppflags=yes
3451
3452                         if test $cf_fix_cppflags = yes ; then
3453                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3454                                 continue
3455                         elif test "${cf_tst_cflags}" = "\"'" ; then
3456                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3457                                 continue
3458                         fi
3459                         ;;
3460                 esac
3461                 case "$CPPFLAGS" in
3462                 (*$cf_add_cflags)
3463                         ;;
3464                 (*)
3465                         case $cf_add_cflags in
3466                         (-D*)
3467                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3468
3469 CPPFLAGS=`echo "$CPPFLAGS" | \
3470         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3471                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3472
3473                                 ;;
3474                         esac
3475                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3476                         ;;
3477                 esac
3478                 ;;
3479         (*)
3480                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3481                 ;;
3482         esac
3483         ;;
3484 (yes)
3485         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3486
3487         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3488
3489         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3490                 && test -z "${cf_tst_cflags}" \
3491                 && cf_fix_cppflags=no
3492         ;;
3493 esac
3494 done
3495
3496 if test -n "$cf_new_cflags" ; then
3497
3498         CFLAGS="$CFLAGS $cf_new_cflags"
3499 fi
3500
3501 if test -n "$cf_new_cppflags" ; then
3502
3503         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3504 fi
3505
3506 if test -n "$cf_new_extra_cppflags" ; then
3507
3508         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3509 fi
3510
3511 fi
3512
3513         ;;
3514 (netbsd*)
3515         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3516         ;;
3517 (openbsd[4-9]*)
3518         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3519         cf_xopen_source="-D_BSD_SOURCE"
3520         cf_XOPEN_SOURCE=600
3521         ;;
3522 (openbsd*)
3523         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3524         ;;
3525 (osf[45]*)
3526         cf_xopen_source="-D_OSF_SOURCE"
3527         ;;
3528 (nto-qnx*)
3529         cf_xopen_source="-D_QNX_SOURCE"
3530         ;;
3531 (sco*)
3532         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3533         ;;
3534 (solaris2.*)
3535         cf_xopen_source="-D__EXTENSIONS__"
3536         cf_cv_xopen_source=broken
3537         ;;
3538 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3539         cf_XOPEN_SOURCE=
3540         cf_POSIX_C_SOURCE=
3541         ;;
3542 (*)
3543
3544 echo "$as_me:3544: checking if we should define _XOPEN_SOURCE" >&5
3545 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3546 if test "${cf_cv_xopen_source+set}" = set; then
3547   echo $ECHO_N "(cached) $ECHO_C" >&6
3548 else
3549
3550         cat >conftest.$ac_ext <<_ACEOF
3551 #line 3551 "configure"
3552 #include "confdefs.h"
3553
3554 #include <stdlib.h>
3555 #include <string.h>
3556 #include <sys/types.h>
3557
3558 int
3559 main ()
3560 {
3561
3562 #ifndef _XOPEN_SOURCE
3563 make an error
3564 #endif
3565   ;
3566   return 0;
3567 }
3568 _ACEOF
3569 rm -f conftest.$ac_objext
3570 if { (eval echo "$as_me:3570: \"$ac_compile\"") >&5
3571   (eval $ac_compile) 2>&5
3572   ac_status=$?
3573   echo "$as_me:3573: \$? = $ac_status" >&5
3574   (exit $ac_status); } &&
3575          { ac_try='test -s conftest.$ac_objext'
3576   { (eval echo "$as_me:3576: \"$ac_try\"") >&5
3577   (eval $ac_try) 2>&5
3578   ac_status=$?
3579   echo "$as_me:3579: \$? = $ac_status" >&5
3580   (exit $ac_status); }; }; then
3581   cf_cv_xopen_source=no
3582 else
3583   echo "$as_me: failed program was:" >&5
3584 cat conftest.$ac_ext >&5
3585 cf_save="$CPPFLAGS"
3586          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3587          cat >conftest.$ac_ext <<_ACEOF
3588 #line 3588 "configure"
3589 #include "confdefs.h"
3590
3591 #include <stdlib.h>
3592 #include <string.h>
3593 #include <sys/types.h>
3594
3595 int
3596 main ()
3597 {
3598
3599 #ifdef _XOPEN_SOURCE
3600 make an error
3601 #endif
3602   ;
3603   return 0;
3604 }
3605 _ACEOF
3606 rm -f conftest.$ac_objext
3607 if { (eval echo "$as_me:3607: \"$ac_compile\"") >&5
3608   (eval $ac_compile) 2>&5
3609   ac_status=$?
3610   echo "$as_me:3610: \$? = $ac_status" >&5
3611   (exit $ac_status); } &&
3612          { ac_try='test -s conftest.$ac_objext'
3613   { (eval echo "$as_me:3613: \"$ac_try\"") >&5
3614   (eval $ac_try) 2>&5
3615   ac_status=$?
3616   echo "$as_me:3616: \$? = $ac_status" >&5
3617   (exit $ac_status); }; }; then
3618   cf_cv_xopen_source=no
3619 else
3620   echo "$as_me: failed program was:" >&5
3621 cat conftest.$ac_ext >&5
3622 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3623 fi
3624 rm -f conftest.$ac_objext conftest.$ac_ext
3625         CPPFLAGS="$cf_save"
3626
3627 fi
3628 rm -f conftest.$ac_objext conftest.$ac_ext
3629
3630 fi
3631 echo "$as_me:3631: result: $cf_cv_xopen_source" >&5
3632 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3633
3634 if test "$cf_cv_xopen_source" != no ; then
3635
3636 CFLAGS=`echo "$CFLAGS" | \
3637         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3638                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3639
3640 CPPFLAGS=`echo "$CPPFLAGS" | \
3641         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3642                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3643
3644         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3645
3646 cf_fix_cppflags=no
3647 cf_new_cflags=
3648 cf_new_cppflags=
3649 cf_new_extra_cppflags=
3650
3651 for cf_add_cflags in $cf_temp_xopen_source
3652 do
3653 case $cf_fix_cppflags in
3654 (no)
3655         case $cf_add_cflags in
3656         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3657                 case $cf_add_cflags in
3658                 (-D*)
3659                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3660
3661                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3662                                 && test -z "${cf_tst_cflags}" \
3663                                 && cf_fix_cppflags=yes
3664
3665                         if test $cf_fix_cppflags = yes ; then
3666                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3667                                 continue
3668                         elif test "${cf_tst_cflags}" = "\"'" ; then
3669                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3670                                 continue
3671                         fi
3672                         ;;
3673                 esac
3674                 case "$CPPFLAGS" in
3675                 (*$cf_add_cflags)
3676                         ;;
3677                 (*)
3678                         case $cf_add_cflags in
3679                         (-D*)
3680                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3681
3682 CPPFLAGS=`echo "$CPPFLAGS" | \
3683         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3684                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3685
3686                                 ;;
3687                         esac
3688                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3689                         ;;
3690                 esac
3691                 ;;
3692         (*)
3693                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3694                 ;;
3695         esac
3696         ;;
3697 (yes)
3698         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3699
3700         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3701
3702         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3703                 && test -z "${cf_tst_cflags}" \
3704                 && cf_fix_cppflags=no
3705         ;;
3706 esac
3707 done
3708
3709 if test -n "$cf_new_cflags" ; then
3710
3711         CFLAGS="$CFLAGS $cf_new_cflags"
3712 fi
3713
3714 if test -n "$cf_new_cppflags" ; then
3715
3716         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3717 fi
3718
3719 if test -n "$cf_new_extra_cppflags" ; then
3720
3721         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3722 fi
3723
3724 fi
3725
3726 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3727
3728 cf_save_CFLAGS="$CFLAGS"
3729 cf_save_CPPFLAGS="$CPPFLAGS"
3730
3731 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3732         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3733                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3734
3735 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3736         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3737                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3738
3739 echo "$as_me:3739: checking if we should define _POSIX_C_SOURCE" >&5
3740 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3741 if test "${cf_cv_posix_c_source+set}" = set; then
3742   echo $ECHO_N "(cached) $ECHO_C" >&6
3743 else
3744
3745 echo "${as_me:-configure}:3745: testing if the symbol is already defined go no further ..." 1>&5
3746
3747         cat >conftest.$ac_ext <<_ACEOF
3748 #line 3748 "configure"
3749 #include "confdefs.h"
3750 #include <sys/types.h>
3751 int
3752 main ()
3753 {
3754
3755 #ifndef _POSIX_C_SOURCE
3756 make an error
3757 #endif
3758   ;
3759   return 0;
3760 }
3761 _ACEOF
3762 rm -f conftest.$ac_objext
3763 if { (eval echo "$as_me:3763: \"$ac_compile\"") >&5
3764   (eval $ac_compile) 2>&5
3765   ac_status=$?
3766   echo "$as_me:3766: \$? = $ac_status" >&5
3767   (exit $ac_status); } &&
3768          { ac_try='test -s conftest.$ac_objext'
3769   { (eval echo "$as_me:3769: \"$ac_try\"") >&5
3770   (eval $ac_try) 2>&5
3771   ac_status=$?
3772   echo "$as_me:3772: \$? = $ac_status" >&5
3773   (exit $ac_status); }; }; then
3774   cf_cv_posix_c_source=no
3775 else
3776   echo "$as_me: failed program was:" >&5
3777 cat conftest.$ac_ext >&5
3778 cf_want_posix_source=no
3779          case .$cf_POSIX_C_SOURCE in
3780          (.[12]??*)
3781                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3782                 ;;
3783          (.2)
3784                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3785                 cf_want_posix_source=yes
3786                 ;;
3787          (.*)
3788                 cf_want_posix_source=yes
3789                 ;;
3790          esac
3791          if test "$cf_want_posix_source" = yes ; then
3792                 cat >conftest.$ac_ext <<_ACEOF
3793 #line 3793 "configure"
3794 #include "confdefs.h"
3795 #include <sys/types.h>
3796 int
3797 main ()
3798 {
3799
3800 #ifdef _POSIX_SOURCE
3801 make an error
3802 #endif
3803   ;
3804   return 0;
3805 }
3806 _ACEOF
3807 rm -f conftest.$ac_objext
3808 if { (eval echo "$as_me:3808: \"$ac_compile\"") >&5
3809   (eval $ac_compile) 2>&5
3810   ac_status=$?
3811   echo "$as_me:3811: \$? = $ac_status" >&5
3812   (exit $ac_status); } &&
3813          { ac_try='test -s conftest.$ac_objext'
3814   { (eval echo "$as_me:3814: \"$ac_try\"") >&5
3815   (eval $ac_try) 2>&5
3816   ac_status=$?
3817   echo "$as_me:3817: \$? = $ac_status" >&5
3818   (exit $ac_status); }; }; then
3819   :
3820 else
3821   echo "$as_me: failed program was:" >&5
3822 cat conftest.$ac_ext >&5
3823 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3824 fi
3825 rm -f conftest.$ac_objext conftest.$ac_ext
3826          fi
3827
3828 echo "${as_me:-configure}:3828: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3829
3830          CFLAGS="$cf_trim_CFLAGS"
3831          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3832
3833 echo "${as_me:-configure}:3833: testing if the second compile does not leave our definition intact error ..." 1>&5
3834
3835          cat >conftest.$ac_ext <<_ACEOF
3836 #line 3836 "configure"
3837 #include "confdefs.h"
3838 #include <sys/types.h>
3839 int
3840 main ()
3841 {
3842
3843 #ifndef _POSIX_C_SOURCE
3844 make an error
3845 #endif
3846   ;
3847   return 0;
3848 }
3849 _ACEOF
3850 rm -f conftest.$ac_objext
3851 if { (eval echo "$as_me:3851: \"$ac_compile\"") >&5
3852   (eval $ac_compile) 2>&5
3853   ac_status=$?
3854   echo "$as_me:3854: \$? = $ac_status" >&5
3855   (exit $ac_status); } &&
3856          { ac_try='test -s conftest.$ac_objext'
3857   { (eval echo "$as_me:3857: \"$ac_try\"") >&5
3858   (eval $ac_try) 2>&5
3859   ac_status=$?
3860   echo "$as_me:3860: \$? = $ac_status" >&5
3861   (exit $ac_status); }; }; then
3862   :
3863 else
3864   echo "$as_me: failed program was:" >&5
3865 cat conftest.$ac_ext >&5
3866 cf_cv_posix_c_source=no
3867 fi
3868 rm -f conftest.$ac_objext conftest.$ac_ext
3869          CFLAGS="$cf_save_CFLAGS"
3870          CPPFLAGS="$cf_save_CPPFLAGS"
3871
3872 fi
3873 rm -f conftest.$ac_objext conftest.$ac_ext
3874
3875 fi
3876 echo "$as_me:3876: result: $cf_cv_posix_c_source" >&5
3877 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3878
3879 if test "$cf_cv_posix_c_source" != no ; then
3880         CFLAGS="$cf_trim_CFLAGS"
3881         CPPFLAGS="$cf_trim_CPPFLAGS"
3882
3883 cf_fix_cppflags=no
3884 cf_new_cflags=
3885 cf_new_cppflags=
3886 cf_new_extra_cppflags=
3887
3888 for cf_add_cflags in $cf_cv_posix_c_source
3889 do
3890 case $cf_fix_cppflags in
3891 (no)
3892         case $cf_add_cflags in
3893         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3894                 case $cf_add_cflags in
3895                 (-D*)
3896                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3897
3898                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3899                                 && test -z "${cf_tst_cflags}" \
3900                                 && cf_fix_cppflags=yes
3901
3902                         if test $cf_fix_cppflags = yes ; then
3903                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3904                                 continue
3905                         elif test "${cf_tst_cflags}" = "\"'" ; then
3906                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3907                                 continue
3908                         fi
3909                         ;;
3910                 esac
3911                 case "$CPPFLAGS" in
3912                 (*$cf_add_cflags)
3913                         ;;
3914                 (*)
3915                         case $cf_add_cflags in
3916                         (-D*)
3917                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3918
3919 CPPFLAGS=`echo "$CPPFLAGS" | \
3920         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3921                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3922
3923                                 ;;
3924                         esac
3925                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3926                         ;;
3927                 esac
3928                 ;;
3929         (*)
3930                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3931                 ;;
3932         esac
3933         ;;
3934 (yes)
3935         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3936
3937         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3938
3939         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3940                 && test -z "${cf_tst_cflags}" \
3941                 && cf_fix_cppflags=no
3942         ;;
3943 esac
3944 done
3945
3946 if test -n "$cf_new_cflags" ; then
3947
3948         CFLAGS="$CFLAGS $cf_new_cflags"
3949 fi
3950
3951 if test -n "$cf_new_cppflags" ; then
3952
3953         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3954 fi
3955
3956 if test -n "$cf_new_extra_cppflags" ; then
3957
3958         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3959 fi
3960
3961 fi
3962
3963         ;;
3964 esac
3965
3966 if test -n "$cf_xopen_source" ; then
3967
3968 cf_fix_cppflags=no
3969 cf_new_cflags=
3970 cf_new_cppflags=
3971 cf_new_extra_cppflags=
3972
3973 for cf_add_cflags in $cf_xopen_source
3974 do
3975 case $cf_fix_cppflags in
3976 (no)
3977         case $cf_add_cflags in
3978         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3979                 case $cf_add_cflags in
3980                 (-D*)
3981                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3982
3983                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3984                                 && test -z "${cf_tst_cflags}" \
3985                                 && cf_fix_cppflags=yes
3986
3987                         if test $cf_fix_cppflags = yes ; then
3988                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3989                                 continue
3990                         elif test "${cf_tst_cflags}" = "\"'" ; then
3991                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3992                                 continue
3993                         fi
3994                         ;;
3995                 esac
3996                 case "$CPPFLAGS" in
3997                 (*$cf_add_cflags)
3998                         ;;
3999                 (*)
4000                         case $cf_add_cflags in
4001                         (-D*)
4002                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4003
4004 CPPFLAGS=`echo "$CPPFLAGS" | \
4005         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4006                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4007
4008                                 ;;
4009                         esac
4010                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4011                         ;;
4012                 esac
4013                 ;;
4014         (*)
4015                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4016                 ;;
4017         esac
4018         ;;
4019 (yes)
4020         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4021
4022         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4023
4024         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4025                 && test -z "${cf_tst_cflags}" \
4026                 && cf_fix_cppflags=no
4027         ;;
4028 esac
4029 done
4030
4031 if test -n "$cf_new_cflags" ; then
4032         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4033
4034 echo "${as_me:-configure}:4034: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4035
4036         CFLAGS="$CFLAGS $cf_new_cflags"
4037 fi
4038
4039 if test -n "$cf_new_cppflags" ; then
4040         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4041
4042 echo "${as_me:-configure}:4042: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4043
4044         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4045 fi
4046
4047 if test -n "$cf_new_extra_cppflags" ; then
4048         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4049
4050 echo "${as_me:-configure}:4050: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4051
4052         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4053 fi
4054
4055 fi
4056
4057 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4058         echo "$as_me:4058: checking if _XOPEN_SOURCE really is set" >&5
4059 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4060         cat >conftest.$ac_ext <<_ACEOF
4061 #line 4061 "configure"
4062 #include "confdefs.h"
4063 #include <stdlib.h>
4064 int
4065 main ()
4066 {
4067
4068 #ifndef _XOPEN_SOURCE
4069 make an error
4070 #endif
4071   ;
4072   return 0;
4073 }
4074 _ACEOF
4075 rm -f conftest.$ac_objext
4076 if { (eval echo "$as_me:4076: \"$ac_compile\"") >&5
4077   (eval $ac_compile) 2>&5
4078   ac_status=$?
4079   echo "$as_me:4079: \$? = $ac_status" >&5
4080   (exit $ac_status); } &&
4081          { ac_try='test -s conftest.$ac_objext'
4082   { (eval echo "$as_me:4082: \"$ac_try\"") >&5
4083   (eval $ac_try) 2>&5
4084   ac_status=$?
4085   echo "$as_me:4085: \$? = $ac_status" >&5
4086   (exit $ac_status); }; }; then
4087   cf_XOPEN_SOURCE_set=yes
4088 else
4089   echo "$as_me: failed program was:" >&5
4090 cat conftest.$ac_ext >&5
4091 cf_XOPEN_SOURCE_set=no
4092 fi
4093 rm -f conftest.$ac_objext conftest.$ac_ext
4094         echo "$as_me:4094: result: $cf_XOPEN_SOURCE_set" >&5
4095 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
4096         if test $cf_XOPEN_SOURCE_set = yes
4097         then
4098                 cat >conftest.$ac_ext <<_ACEOF
4099 #line 4099 "configure"
4100 #include "confdefs.h"
4101 #include <stdlib.h>
4102 int
4103 main ()
4104 {
4105
4106 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
4107 make an error
4108 #endif
4109   ;
4110   return 0;
4111 }
4112 _ACEOF
4113 rm -f conftest.$ac_objext
4114 if { (eval echo "$as_me:4114: \"$ac_compile\"") >&5
4115   (eval $ac_compile) 2>&5
4116   ac_status=$?
4117   echo "$as_me:4117: \$? = $ac_status" >&5
4118   (exit $ac_status); } &&
4119          { ac_try='test -s conftest.$ac_objext'
4120   { (eval echo "$as_me:4120: \"$ac_try\"") >&5
4121   (eval $ac_try) 2>&5
4122   ac_status=$?
4123   echo "$as_me:4123: \$? = $ac_status" >&5
4124   (exit $ac_status); }; }; then
4125   cf_XOPEN_SOURCE_set_ok=yes
4126 else
4127   echo "$as_me: failed program was:" >&5
4128 cat conftest.$ac_ext >&5
4129 cf_XOPEN_SOURCE_set_ok=no
4130 fi
4131 rm -f conftest.$ac_objext conftest.$ac_ext
4132                 if test $cf_XOPEN_SOURCE_set_ok = no
4133                 then
4134                         { echo "$as_me:4134: WARNING: _XOPEN_SOURCE is lower than requested" >&5
4135 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
4136                 fi
4137         else
4138
4139 echo "$as_me:4139: checking if we should define _XOPEN_SOURCE" >&5
4140 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4141 if test "${cf_cv_xopen_source+set}" = set; then
4142   echo $ECHO_N "(cached) $ECHO_C" >&6
4143 else
4144
4145         cat >conftest.$ac_ext <<_ACEOF
4146 #line 4146 "configure"
4147 #include "confdefs.h"
4148
4149 #include <stdlib.h>
4150 #include <string.h>
4151 #include <sys/types.h>
4152
4153 int
4154 main ()
4155 {
4156
4157 #ifndef _XOPEN_SOURCE
4158 make an error
4159 #endif
4160   ;
4161   return 0;
4162 }
4163 _ACEOF
4164 rm -f conftest.$ac_objext
4165 if { (eval echo "$as_me:4165: \"$ac_compile\"") >&5
4166   (eval $ac_compile) 2>&5
4167   ac_status=$?
4168   echo "$as_me:4168: \$? = $ac_status" >&5
4169   (exit $ac_status); } &&
4170          { ac_try='test -s conftest.$ac_objext'
4171   { (eval echo "$as_me:4171: \"$ac_try\"") >&5
4172   (eval $ac_try) 2>&5
4173   ac_status=$?
4174   echo "$as_me:4174: \$? = $ac_status" >&5
4175   (exit $ac_status); }; }; then
4176   cf_cv_xopen_source=no
4177 else
4178   echo "$as_me: failed program was:" >&5
4179 cat conftest.$ac_ext >&5
4180 cf_save="$CPPFLAGS"
4181          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4182          cat >conftest.$ac_ext <<_ACEOF
4183 #line 4183 "configure"
4184 #include "confdefs.h"
4185
4186 #include <stdlib.h>
4187 #include <string.h>
4188 #include <sys/types.h>
4189
4190 int
4191 main ()
4192 {
4193
4194 #ifdef _XOPEN_SOURCE
4195 make an error
4196 #endif
4197   ;
4198   return 0;
4199 }
4200 _ACEOF
4201 rm -f conftest.$ac_objext
4202 if { (eval echo "$as_me:4202: \"$ac_compile\"") >&5
4203   (eval $ac_compile) 2>&5
4204   ac_status=$?
4205   echo "$as_me:4205: \$? = $ac_status" >&5
4206   (exit $ac_status); } &&
4207          { ac_try='test -s conftest.$ac_objext'
4208   { (eval echo "$as_me:4208: \"$ac_try\"") >&5
4209   (eval $ac_try) 2>&5
4210   ac_status=$?
4211   echo "$as_me:4211: \$? = $ac_status" >&5
4212   (exit $ac_status); }; }; then
4213   cf_cv_xopen_source=no
4214 else
4215   echo "$as_me: failed program was:" >&5
4216 cat conftest.$ac_ext >&5
4217 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4218 fi
4219 rm -f conftest.$ac_objext conftest.$ac_ext
4220         CPPFLAGS="$cf_save"
4221
4222 fi
4223 rm -f conftest.$ac_objext conftest.$ac_ext
4224
4225 fi
4226 echo "$as_me:4226: result: $cf_cv_xopen_source" >&5
4227 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4228
4229 if test "$cf_cv_xopen_source" != no ; then
4230
4231 CFLAGS=`echo "$CFLAGS" | \
4232         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4233                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4234
4235 CPPFLAGS=`echo "$CPPFLAGS" | \
4236         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4237                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4238
4239         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4240
4241 cf_fix_cppflags=no
4242 cf_new_cflags=
4243 cf_new_cppflags=
4244 cf_new_extra_cppflags=
4245
4246 for cf_add_cflags in $cf_temp_xopen_source
4247 do
4248 case $cf_fix_cppflags in
4249 (no)
4250         case $cf_add_cflags in
4251         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4252                 case $cf_add_cflags in
4253                 (-D*)
4254                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4255
4256                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4257                                 && test -z "${cf_tst_cflags}" \
4258                                 && cf_fix_cppflags=yes
4259
4260                         if test $cf_fix_cppflags = yes ; then
4261                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4262                                 continue
4263                         elif test "${cf_tst_cflags}" = "\"'" ; then
4264                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4265                                 continue
4266                         fi
4267                         ;;
4268                 esac
4269                 case "$CPPFLAGS" in
4270                 (*$cf_add_cflags)
4271                         ;;
4272                 (*)
4273                         case $cf_add_cflags in
4274                         (-D*)
4275                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4276
4277 CPPFLAGS=`echo "$CPPFLAGS" | \
4278         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4279                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4280
4281                                 ;;
4282                         esac
4283                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4284                         ;;
4285                 esac
4286                 ;;
4287         (*)
4288                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4289                 ;;
4290         esac
4291         ;;
4292 (yes)
4293         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4294
4295         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4296
4297         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4298                 && test -z "${cf_tst_cflags}" \
4299                 && cf_fix_cppflags=no
4300         ;;
4301 esac
4302 done
4303
4304 if test -n "$cf_new_cflags" ; then
4305
4306         CFLAGS="$CFLAGS $cf_new_cflags"
4307 fi
4308
4309 if test -n "$cf_new_cppflags" ; then
4310
4311         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4312 fi
4313
4314 if test -n "$cf_new_extra_cppflags" ; then
4315
4316         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4317 fi
4318
4319 fi
4320
4321         fi
4322 fi
4323
4324 echo "$as_me:4324: checking for signal global datatype" >&5
4325 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4326 if test "${cf_cv_sig_atomic_t+set}" = set; then
4327   echo $ECHO_N "(cached) $ECHO_C" >&6
4328 else
4329
4330         for cf_type in \
4331                 "volatile sig_atomic_t" \
4332                 "sig_atomic_t" \
4333                 "int"
4334         do
4335         cat >conftest.$ac_ext <<_ACEOF
4336 #line 4336 "configure"
4337 #include "confdefs.h"
4338
4339 #include <sys/types.h>
4340 #include <signal.h>
4341 #include <stdio.h>
4342
4343 extern $cf_type x;
4344 $cf_type x;
4345 static void handler(int sig)
4346 {
4347         x = 5;
4348 }
4349 int
4350 main ()
4351 {
4352 signal(SIGINT, handler);
4353                  x = 1
4354   ;
4355   return 0;
4356 }
4357 _ACEOF
4358 rm -f conftest.$ac_objext
4359 if { (eval echo "$as_me:4359: \"$ac_compile\"") >&5
4360   (eval $ac_compile) 2>&5
4361   ac_status=$?
4362   echo "$as_me:4362: \$? = $ac_status" >&5
4363   (exit $ac_status); } &&
4364          { ac_try='test -s conftest.$ac_objext'
4365   { (eval echo "$as_me:4365: \"$ac_try\"") >&5
4366   (eval $ac_try) 2>&5
4367   ac_status=$?
4368   echo "$as_me:4368: \$? = $ac_status" >&5
4369   (exit $ac_status); }; }; then
4370   cf_cv_sig_atomic_t=$cf_type
4371 else
4372   echo "$as_me: failed program was:" >&5
4373 cat conftest.$ac_ext >&5
4374 cf_cv_sig_atomic_t=no
4375 fi
4376 rm -f conftest.$ac_objext conftest.$ac_ext
4377                 test "$cf_cv_sig_atomic_t" != no && break
4378         done
4379
4380 fi
4381
4382 echo "$as_me:4382: result: $cf_cv_sig_atomic_t" >&5
4383 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4384 test "$cf_cv_sig_atomic_t" != no &&
4385 cat >>confdefs.h <<EOF
4386 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4387 EOF
4388
4389 # Work around breakage on OS X
4390
4391 echo "$as_me:4391: checking if SIGWINCH is defined" >&5
4392 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
4393 if test "${cf_cv_define_sigwinch+set}" = set; then
4394   echo $ECHO_N "(cached) $ECHO_C" >&6
4395 else
4396
4397         cat >conftest.$ac_ext <<_ACEOF
4398 #line 4398 "configure"
4399 #include "confdefs.h"
4400
4401 #include <sys/types.h>
4402 #include <sys/signal.h>
4403
4404 int
4405 main ()
4406 {
4407 int x = SIGWINCH
4408   ;
4409   return 0;
4410 }
4411 _ACEOF
4412 rm -f conftest.$ac_objext
4413 if { (eval echo "$as_me:4413: \"$ac_compile\"") >&5
4414   (eval $ac_compile) 2>&5
4415   ac_status=$?
4416   echo "$as_me:4416: \$? = $ac_status" >&5
4417   (exit $ac_status); } &&
4418          { ac_try='test -s conftest.$ac_objext'
4419   { (eval echo "$as_me:4419: \"$ac_try\"") >&5
4420   (eval $ac_try) 2>&5
4421   ac_status=$?
4422   echo "$as_me:4422: \$? = $ac_status" >&5
4423   (exit $ac_status); }; }; then
4424   cf_cv_define_sigwinch=yes
4425 else
4426   echo "$as_me: failed program was:" >&5
4427 cat conftest.$ac_ext >&5
4428 cat >conftest.$ac_ext <<_ACEOF
4429 #line 4429 "configure"
4430 #include "confdefs.h"
4431
4432 #undef _XOPEN_SOURCE
4433 #undef _POSIX_SOURCE
4434 #undef _POSIX_C_SOURCE
4435 #include <sys/types.h>
4436 #include <sys/signal.h>
4437
4438 int
4439 main ()
4440 {
4441 int x = SIGWINCH
4442   ;
4443   return 0;
4444 }
4445 _ACEOF
4446 rm -f conftest.$ac_objext
4447 if { (eval echo "$as_me:4447: \"$ac_compile\"") >&5
4448   (eval $ac_compile) 2>&5
4449   ac_status=$?
4450   echo "$as_me:4450: \$? = $ac_status" >&5
4451   (exit $ac_status); } &&
4452          { ac_try='test -s conftest.$ac_objext'
4453   { (eval echo "$as_me:4453: \"$ac_try\"") >&5
4454   (eval $ac_try) 2>&5
4455   ac_status=$?
4456   echo "$as_me:4456: \$? = $ac_status" >&5
4457   (exit $ac_status); }; }; then
4458   cf_cv_define_sigwinch=maybe
4459 else
4460   echo "$as_me: failed program was:" >&5
4461 cat conftest.$ac_ext >&5
4462 cf_cv_define_sigwinch=no
4463 fi
4464 rm -f conftest.$ac_objext conftest.$ac_ext
4465
4466 fi
4467 rm -f conftest.$ac_objext conftest.$ac_ext
4468
4469 fi
4470 echo "$as_me:4470: result: $cf_cv_define_sigwinch" >&5
4471 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
4472
4473 if test "$cf_cv_define_sigwinch" = maybe ; then
4474 echo "$as_me:4474: checking for actual SIGWINCH definition" >&5
4475 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
4476 if test "${cf_cv_fixup_sigwinch+set}" = set; then
4477   echo $ECHO_N "(cached) $ECHO_C" >&6
4478 else
4479
4480 cf_cv_fixup_sigwinch=unknown
4481 cf_sigwinch=32
4482 while test $cf_sigwinch != 1
4483 do
4484         cat >conftest.$ac_ext <<_ACEOF
4485 #line 4485 "configure"
4486 #include "confdefs.h"
4487
4488 #undef _XOPEN_SOURCE
4489 #undef _POSIX_SOURCE
4490 #undef _POSIX_C_SOURCE
4491 #include <sys/types.h>
4492 #include <sys/signal.h>
4493
4494 int
4495 main ()
4496 {
4497
4498 #if SIGWINCH != $cf_sigwinch
4499 make an error
4500 #endif
4501 int x = SIGWINCH
4502   ;
4503   return 0;
4504 }
4505 _ACEOF
4506 rm -f conftest.$ac_objext
4507 if { (eval echo "$as_me:4507: \"$ac_compile\"") >&5
4508   (eval $ac_compile) 2>&5
4509   ac_status=$?
4510   echo "$as_me:4510: \$? = $ac_status" >&5
4511   (exit $ac_status); } &&
4512          { ac_try='test -s conftest.$ac_objext'
4513   { (eval echo "$as_me:4513: \"$ac_try\"") >&5
4514   (eval $ac_try) 2>&5
4515   ac_status=$?
4516   echo "$as_me:4516: \$? = $ac_status" >&5
4517   (exit $ac_status); }; }; then
4518   cf_cv_fixup_sigwinch=$cf_sigwinch
4519          break
4520 else
4521   echo "$as_me: failed program was:" >&5
4522 cat conftest.$ac_ext >&5
4523 fi
4524 rm -f conftest.$ac_objext conftest.$ac_ext
4525
4526 cf_sigwinch=`expr $cf_sigwinch - 1`
4527 done
4528
4529 fi
4530 echo "$as_me:4530: result: $cf_cv_fixup_sigwinch" >&5
4531 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
4532
4533         if test "$cf_cv_fixup_sigwinch" != unknown ; then
4534                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
4535         fi
4536 fi
4537
4538 # Checks for CODESET support.
4539
4540 echo "$as_me:4540: checking for nl_langinfo and CODESET" >&5
4541 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
4542 if test "${am_cv_langinfo_codeset+set}" = set; then
4543   echo $ECHO_N "(cached) $ECHO_C" >&6
4544 else
4545   cat >conftest.$ac_ext <<_ACEOF
4546 #line 4546 "configure"
4547 #include "confdefs.h"
4548 #include <langinfo.h>
4549 int
4550 main ()
4551 {
4552 char* cs = nl_langinfo(CODESET);
4553   ;
4554   return 0;
4555 }
4556 _ACEOF
4557 rm -f conftest.$ac_objext conftest$ac_exeext
4558 if { (eval echo "$as_me:4558: \"$ac_link\"") >&5
4559   (eval $ac_link) 2>&5
4560   ac_status=$?
4561   echo "$as_me:4561: \$? = $ac_status" >&5
4562   (exit $ac_status); } &&
4563          { ac_try='test -s conftest$ac_exeext'
4564   { (eval echo "$as_me:4564: \"$ac_try\"") >&5
4565   (eval $ac_try) 2>&5
4566   ac_status=$?
4567   echo "$as_me:4567: \$? = $ac_status" >&5
4568   (exit $ac_status); }; }; then
4569   am_cv_langinfo_codeset=yes
4570 else
4571   echo "$as_me: failed program was:" >&5
4572 cat conftest.$ac_ext >&5
4573 am_cv_langinfo_codeset=no
4574 fi
4575 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4576
4577 fi
4578 echo "$as_me:4578: result: $am_cv_langinfo_codeset" >&5
4579 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
4580         if test $am_cv_langinfo_codeset = yes; then
4581
4582 cat >>confdefs.h <<\EOF
4583 #define HAVE_LANGINFO_CODESET 1
4584 EOF
4585
4586         fi
4587
4588 echo "$as_me:4588: checking if you want to use pkg-config" >&5
4589 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4590
4591 # Check whether --with-pkg-config or --without-pkg-config was given.
4592 if test "${with_pkg_config+set}" = set; then
4593   withval="$with_pkg_config"
4594   cf_pkg_config=$withval
4595 else
4596   cf_pkg_config=yes
4597 fi;
4598 echo "$as_me:4598: result: $cf_pkg_config" >&5
4599 echo "${ECHO_T}$cf_pkg_config" >&6
4600
4601 case $cf_pkg_config in
4602 (no)
4603         PKG_CONFIG=none
4604         ;;
4605 (yes)
4606
4607 if test -n "$ac_tool_prefix"; then
4608   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4609 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4610 echo "$as_me:4610: checking for $ac_word" >&5
4611 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4612 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4613   echo $ECHO_N "(cached) $ECHO_C" >&6
4614 else
4615   case $PKG_CONFIG in
4616   [\\/]* | ?:[\\/]*)
4617   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4618   ;;
4619   *)
4620   ac_save_IFS=$IFS; IFS=$ac_path_separator
4621 ac_dummy="$PATH"
4622 for ac_dir in $ac_dummy; do
4623   IFS=$ac_save_IFS
4624   test -z "$ac_dir" && ac_dir=.
4625   if $as_executable_p "$ac_dir/$ac_word"; then
4626    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4627    echo "$as_me:4627: found $ac_dir/$ac_word" >&5
4628    break
4629 fi
4630 done
4631
4632   ;;
4633 esac
4634 fi
4635 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4636
4637 if test -n "$PKG_CONFIG"; then
4638   echo "$as_me:4638: result: $PKG_CONFIG" >&5
4639 echo "${ECHO_T}$PKG_CONFIG" >&6
4640 else
4641   echo "$as_me:4641: result: no" >&5
4642 echo "${ECHO_T}no" >&6
4643 fi
4644
4645 fi
4646 if test -z "$ac_cv_path_PKG_CONFIG"; then
4647   ac_pt_PKG_CONFIG=$PKG_CONFIG
4648   # Extract the first word of "pkg-config", so it can be a program name with args.
4649 set dummy pkg-config; ac_word=$2
4650 echo "$as_me:4650: checking for $ac_word" >&5
4651 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4652 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4653   echo $ECHO_N "(cached) $ECHO_C" >&6
4654 else
4655   case $ac_pt_PKG_CONFIG in
4656   [\\/]* | ?:[\\/]*)
4657   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4658   ;;
4659   *)
4660   ac_save_IFS=$IFS; IFS=$ac_path_separator
4661 ac_dummy="$PATH"
4662 for ac_dir in $ac_dummy; do
4663   IFS=$ac_save_IFS
4664   test -z "$ac_dir" && ac_dir=.
4665   if $as_executable_p "$ac_dir/$ac_word"; then
4666    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4667    echo "$as_me:4667: found $ac_dir/$ac_word" >&5
4668    break
4669 fi
4670 done
4671
4672   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4673   ;;
4674 esac
4675 fi
4676 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4677
4678 if test -n "$ac_pt_PKG_CONFIG"; then
4679   echo "$as_me:4679: result: $ac_pt_PKG_CONFIG" >&5
4680 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4681 else
4682   echo "$as_me:4682: result: no" >&5
4683 echo "${ECHO_T}no" >&6
4684 fi
4685
4686   PKG_CONFIG=$ac_pt_PKG_CONFIG
4687 else
4688   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4689 fi
4690
4691         ;;
4692 (*)
4693         PKG_CONFIG=$withval
4694         ;;
4695 esac
4696
4697 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4698 if test "$PKG_CONFIG" != none ; then
4699
4700 if test "x$prefix" != xNONE; then
4701         cf_path_syntax="$prefix"
4702 else
4703         cf_path_syntax="$ac_default_prefix"
4704 fi
4705
4706 case ".$PKG_CONFIG" in
4707 (.\$\(*\)*|.\'*\'*)
4708         ;;
4709 (..|./*|.\\*)
4710         ;;
4711 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4712         ;;
4713 (.\${*prefix}*|.\${*dir}*)
4714         eval PKG_CONFIG="$PKG_CONFIG"
4715         case ".$PKG_CONFIG" in
4716         (.NONE/*)
4717                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4718                 ;;
4719         esac
4720         ;;
4721 (.no|.NONE/*)
4722         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4723         ;;
4724 (*)
4725         { { echo "$as_me:4725: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4726 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4727    { (exit 1); exit 1; }; }
4728         ;;
4729 esac
4730
4731 elif test "x$cf_pkg_config" != xno ; then
4732         { echo "$as_me:4732: WARNING: pkg-config is not installed" >&5
4733 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4734 fi
4735
4736 echo "$as_me:4736: checking if you want to see long compiling messages" >&5
4737 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4738
4739 # Check whether --enable-echo or --disable-echo was given.
4740 if test "${enable_echo+set}" = set; then
4741   enableval="$enable_echo"
4742   test "$enableval" != no && enableval=yes
4743         if test "$enableval" != "yes" ; then
4744
4745         ECHO_LT='--silent'
4746         ECHO_LD='@echo linking $@;'
4747         RULE_CC='@echo compiling $<'
4748         SHOW_CC='@echo compiling $@'
4749         ECHO_CC='@'
4750
4751         else
4752
4753         ECHO_LT=''
4754         ECHO_LD=''
4755         RULE_CC=''
4756         SHOW_CC=''
4757         ECHO_CC=''
4758
4759         fi
4760 else
4761   enableval=yes
4762
4763         ECHO_LT=''
4764         ECHO_LD=''
4765         RULE_CC=''
4766         SHOW_CC=''
4767         ECHO_CC=''
4768
4769 fi;
4770 echo "$as_me:4770: result: $enableval" >&5
4771 echo "${ECHO_T}$enableval" >&6
4772
4773 echo "$as_me:4773: checking for ncurses wrap-prefix" >&5
4774 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4775
4776 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4777 if test "${with_ncurses_wrap_prefix+set}" = set; then
4778   withval="$with_ncurses_wrap_prefix"
4779   NCURSES_WRAP_PREFIX=$withval
4780 else
4781   NCURSES_WRAP_PREFIX=_nc_
4782 fi;
4783 echo "$as_me:4783: result: $NCURSES_WRAP_PREFIX" >&5
4784 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4785
4786 echo "$as_me:4786: checking if you want to check for wide-character functions" >&5
4787 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4788
4789 # Check whether --enable-widec or --disable-widec was given.
4790 if test "${enable_widec+set}" = set; then
4791   enableval="$enable_widec"
4792   test "$enableval" != no && enableval=yes
4793         if test "$enableval" != "yes" ; then
4794     cf_enable_widec=no
4795         else
4796                 cf_enable_widec=yes
4797         fi
4798 else
4799   enableval=yes
4800         cf_enable_widec=yes
4801
4802 fi;
4803 echo "$as_me:4803: result: $cf_enable_widec" >&5
4804 echo "${ECHO_T}$cf_enable_widec" >&6
4805
4806 echo "$as_me:4806: checking for specific curses-directory" >&5
4807 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4808
4809 # Check whether --with-curses-dir or --without-curses-dir was given.
4810 if test "${with_curses_dir+set}" = set; then
4811   withval="$with_curses_dir"
4812   cf_cv_curses_dir=$withval
4813 else
4814   cf_cv_curses_dir=no
4815 fi;
4816 echo "$as_me:4816: result: $cf_cv_curses_dir" >&5
4817 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4818
4819 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4820 then
4821
4822 if test "x$prefix" != xNONE; then
4823         cf_path_syntax="$prefix"
4824 else
4825         cf_path_syntax="$ac_default_prefix"
4826 fi
4827
4828 case ".$withval" in
4829 (.\$\(*\)*|.\'*\'*)
4830         ;;
4831 (..|./*|.\\*)
4832         ;;
4833 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4834         ;;
4835 (.\${*prefix}*|.\${*dir}*)
4836         eval withval="$withval"
4837         case ".$withval" in
4838         (.NONE/*)
4839                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4840                 ;;
4841         esac
4842         ;;
4843 (.no|.NONE/*)
4844         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4845         ;;
4846 (*)
4847         { { echo "$as_me:4847: error: expected a pathname, not \"$withval\"" >&5
4848 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4849    { (exit 1); exit 1; }; }
4850         ;;
4851 esac
4852
4853         if test -d "$cf_cv_curses_dir"
4854         then
4855
4856 if test -n "$cf_cv_curses_dir/include" ; then
4857   for cf_add_incdir in $cf_cv_curses_dir/include
4858   do
4859         while test $cf_add_incdir != /usr/include
4860         do
4861           if test -d $cf_add_incdir
4862           then
4863                 cf_have_incdir=no
4864                 if test -n "$CFLAGS$CPPFLAGS" ; then
4865                   # a loop is needed to ensure we can add subdirs of existing dirs
4866                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4867                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4868                           cf_have_incdir=yes; break
4869                         fi
4870                   done
4871                 fi
4872
4873                 if test "$cf_have_incdir" = no ; then
4874                   if test "$cf_add_incdir" = /usr/local/include ; then
4875                         if test "$GCC" = yes
4876                         then
4877                           cf_save_CPPFLAGS=$CPPFLAGS
4878                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4879                           cat >conftest.$ac_ext <<_ACEOF
4880 #line 4880 "configure"
4881 #include "confdefs.h"
4882 #include <stdio.h>
4883 int
4884 main ()
4885 {
4886 printf("Hello")
4887   ;
4888   return 0;
4889 }
4890 _ACEOF
4891 rm -f conftest.$ac_objext
4892 if { (eval echo "$as_me:4892: \"$ac_compile\"") >&5
4893   (eval $ac_compile) 2>&5
4894   ac_status=$?
4895   echo "$as_me:4895: \$? = $ac_status" >&5
4896   (exit $ac_status); } &&
4897          { ac_try='test -s conftest.$ac_objext'
4898   { (eval echo "$as_me:4898: \"$ac_try\"") >&5
4899   (eval $ac_try) 2>&5
4900   ac_status=$?
4901   echo "$as_me:4901: \$? = $ac_status" >&5
4902   (exit $ac_status); }; }; then
4903   :
4904 else
4905   echo "$as_me: failed program was:" >&5
4906 cat conftest.$ac_ext >&5
4907 cf_have_incdir=yes
4908 fi
4909 rm -f conftest.$ac_objext conftest.$ac_ext
4910                           CPPFLAGS=$cf_save_CPPFLAGS
4911                         fi
4912                   fi
4913                 fi
4914
4915                 if test "$cf_have_incdir" = no ; then
4916                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4917
4918 echo "${as_me:-configure}:4918: testing adding $cf_add_incdir to include-path ..." 1>&5
4919
4920                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4921
4922                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4923                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4924                   cf_add_incdir="$cf_top_incdir"
4925                 else
4926                   break
4927                 fi
4928           else
4929                 break
4930           fi
4931         done
4932   done
4933 fi
4934
4935 if test -n "$cf_cv_curses_dir/lib" ; then
4936         for cf_add_libdir in $cf_cv_curses_dir/lib
4937         do
4938                 if test $cf_add_libdir = /usr/lib ; then
4939                         :
4940                 elif test -d $cf_add_libdir
4941                 then
4942                         cf_have_libdir=no
4943                         if test -n "$LDFLAGS$LIBS" ; then
4944                                 # a loop is needed to ensure we can add subdirs of existing dirs
4945                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4946                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4947                                                 cf_have_libdir=yes; break
4948                                         fi
4949                                 done
4950                         fi
4951                         if test "$cf_have_libdir" = no ; then
4952                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4953
4954 echo "${as_me:-configure}:4954: testing adding $cf_add_libdir to library-path ..." 1>&5
4955
4956                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4957                         fi
4958                 fi
4959         done
4960 fi
4961
4962         fi
4963 fi
4964
4965 cf_cv_screen=curses
4966
4967 echo "$as_me:4967: checking for specified curses library type" >&5
4968 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4969
4970 # Check whether --with-screen or --without-screen was given.
4971 if test "${with_screen+set}" = set; then
4972   withval="$with_screen"
4973   cf_cv_screen=$withval
4974 else
4975
4976 # Check whether --with-ncursesw or --without-ncursesw was given.
4977 if test "${with_ncursesw+set}" = set; then
4978   withval="$with_ncursesw"
4979   cf_cv_screen=ncursesw
4980 else
4981
4982 # Check whether --with-ncurses or --without-ncurses was given.
4983 if test "${with_ncurses+set}" = set; then
4984   withval="$with_ncurses"
4985   cf_cv_screen=ncurses
4986 else
4987
4988 # Check whether --with-pdcurses or --without-pdcurses was given.
4989 if test "${with_pdcurses+set}" = set; then
4990   withval="$with_pdcurses"
4991   cf_cv_screen=pdcurses
4992 else
4993
4994 # Check whether --with-curses-colr or --without-curses-colr was given.
4995 if test "${with_curses_colr+set}" = set; then
4996   withval="$with_curses_colr"
4997   cf_cv_screen=curses_colr
4998 else
4999
5000 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5001 if test "${with_curses_5lib+set}" = set; then
5002   withval="$with_curses_5lib"
5003   cf_cv_screen=curses_5lib
5004 fi;
5005 fi;
5006 fi;
5007 fi;
5008 fi;
5009 fi;
5010
5011 echo "$as_me:5011: result: $cf_cv_screen" >&5
5012 echo "${ECHO_T}$cf_cv_screen" >&6
5013
5014 case $cf_cv_screen in
5015 (curses|curses_*)
5016
5017 echo "$as_me:5017: checking for extra include directories" >&5
5018 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5019 if test "${cf_cv_curses_incdir+set}" = set; then
5020   echo $ECHO_N "(cached) $ECHO_C" >&6
5021 else
5022
5023 cf_cv_curses_incdir=no
5024 case $host_os in
5025 (hpux10.*)
5026         if test "x$cf_cv_screen" = "xcurses_colr"
5027         then
5028                 test -d /usr/include/curses_colr && \
5029                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5030         fi
5031         ;;
5032 (sunos3*|sunos4*)
5033         if test "x$cf_cv_screen" = "xcurses_5lib"
5034         then
5035                 test -d /usr/5lib && \
5036                 test -d /usr/5include && \
5037                 cf_cv_curses_incdir="-I/usr/5include"
5038         fi
5039         ;;
5040 esac
5041
5042 fi
5043 echo "$as_me:5043: result: $cf_cv_curses_incdir" >&5
5044 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5045 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
5046
5047 echo "$as_me:5047: checking if we have identified curses headers" >&5
5048 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5049 if test "${cf_cv_ncurses_header+set}" = set; then
5050   echo $ECHO_N "(cached) $ECHO_C" >&6
5051 else
5052
5053 cf_cv_ncurses_header=none
5054 for cf_header in \
5055         ncurses.h  \
5056         curses.h  ncurses/ncurses.h ncurses/curses.h
5057 do
5058 cat >conftest.$ac_ext <<_ACEOF
5059 #line 5059 "configure"
5060 #include "confdefs.h"
5061 #include <${cf_header}>
5062 int
5063 main ()
5064 {
5065 initscr(); tgoto("?", 0,0)
5066   ;
5067   return 0;
5068 }
5069 _ACEOF
5070 rm -f conftest.$ac_objext
5071 if { (eval echo "$as_me:5071: \"$ac_compile\"") >&5
5072   (eval $ac_compile) 2>&5
5073   ac_status=$?
5074   echo "$as_me:5074: \$? = $ac_status" >&5
5075   (exit $ac_status); } &&
5076          { ac_try='test -s conftest.$ac_objext'
5077   { (eval echo "$as_me:5077: \"$ac_try\"") >&5
5078   (eval $ac_try) 2>&5
5079   ac_status=$?
5080   echo "$as_me:5080: \$? = $ac_status" >&5
5081   (exit $ac_status); }; }; then
5082   cf_cv_ncurses_header=$cf_header; break
5083 else
5084   echo "$as_me: failed program was:" >&5
5085 cat conftest.$ac_ext >&5
5086 fi
5087 rm -f conftest.$ac_objext conftest.$ac_ext
5088 done
5089
5090 fi
5091 echo "$as_me:5091: result: $cf_cv_ncurses_header" >&5
5092 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5093
5094 if test "$cf_cv_ncurses_header" = none ; then
5095         { { echo "$as_me:5095: error: No curses header-files found" >&5
5096 echo "$as_me: error: No curses header-files found" >&2;}
5097    { (exit 1); exit 1; }; }
5098 fi
5099
5100 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5101
5102 for ac_header in $cf_cv_ncurses_header
5103 do
5104 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5105 echo "$as_me:5105: checking for $ac_header" >&5
5106 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5107 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5108   echo $ECHO_N "(cached) $ECHO_C" >&6
5109 else
5110   cat >conftest.$ac_ext <<_ACEOF
5111 #line 5111 "configure"
5112 #include "confdefs.h"
5113 #include <$ac_header>
5114 _ACEOF
5115 if { (eval echo "$as_me:5115: \"$ac_cpp conftest.$ac_ext\"") >&5
5116   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5117   ac_status=$?
5118   egrep -v '^ *\+' conftest.er1 >conftest.err
5119   rm -f conftest.er1
5120   cat conftest.err >&5
5121   echo "$as_me:5121: \$? = $ac_status" >&5
5122   (exit $ac_status); } >/dev/null; then
5123   if test -s conftest.err; then
5124     ac_cpp_err=$ac_c_preproc_warn_flag
5125   else
5126     ac_cpp_err=
5127   fi
5128 else
5129   ac_cpp_err=yes
5130 fi
5131 if test -z "$ac_cpp_err"; then
5132   eval "$as_ac_Header=yes"
5133 else
5134   echo "$as_me: failed program was:" >&5
5135   cat conftest.$ac_ext >&5
5136   eval "$as_ac_Header=no"
5137 fi
5138 rm -f conftest.err conftest.$ac_ext
5139 fi
5140 echo "$as_me:5140: result: `eval echo '${'$as_ac_Header'}'`" >&5
5141 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5142 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5143   cat >>confdefs.h <<EOF
5144 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5145 EOF
5146
5147 fi
5148 done
5149
5150 echo "$as_me:5150: checking for terminfo header" >&5
5151 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5152 if test "${cf_cv_term_header+set}" = set; then
5153   echo $ECHO_N "(cached) $ECHO_C" >&6
5154 else
5155
5156 case ${cf_cv_ncurses_header} in
5157 (*/ncurses.h|*/ncursesw.h)
5158         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5159         ;;
5160 (*)
5161         cf_term_header=term.h
5162         ;;
5163 esac
5164
5165 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5166 do
5167 cat >conftest.$ac_ext <<_ACEOF
5168 #line 5168 "configure"
5169 #include "confdefs.h"
5170 #include <stdio.h>
5171 #include <${cf_cv_ncurses_header:-curses.h}>
5172 #include <$cf_test>
5173
5174 int
5175 main ()
5176 {
5177 int x = auto_left_margin
5178   ;
5179   return 0;
5180 }
5181 _ACEOF
5182 rm -f conftest.$ac_objext
5183 if { (eval echo "$as_me:5183: \"$ac_compile\"") >&5
5184   (eval $ac_compile) 2>&5
5185   ac_status=$?
5186   echo "$as_me:5186: \$? = $ac_status" >&5
5187   (exit $ac_status); } &&
5188          { ac_try='test -s conftest.$ac_objext'
5189   { (eval echo "$as_me:5189: \"$ac_try\"") >&5
5190   (eval $ac_try) 2>&5
5191   ac_status=$?
5192   echo "$as_me:5192: \$? = $ac_status" >&5
5193   (exit $ac_status); }; }; then
5194
5195         cf_cv_term_header="$cf_test"
5196 else
5197   echo "$as_me: failed program was:" >&5
5198 cat conftest.$ac_ext >&5
5199
5200         cf_cv_term_header=unknown
5201
5202 fi
5203 rm -f conftest.$ac_objext conftest.$ac_ext
5204         test "$cf_cv_term_header" != unknown && break
5205 done
5206
5207 fi
5208 echo "$as_me:5208: result: $cf_cv_term_header" >&5
5209 echo "${ECHO_T}$cf_cv_term_header" >&6
5210
5211 # Set definitions to allow ifdef'ing to accommodate subdirectories
5212
5213 case $cf_cv_term_header in
5214 (*term.h)
5215
5216 cat >>confdefs.h <<\EOF
5217 #define HAVE_TERM_H 1
5218 EOF
5219
5220         ;;
5221 esac
5222
5223 case $cf_cv_term_header in
5224 (ncurses/term.h)
5225
5226 cat >>confdefs.h <<\EOF
5227 #define HAVE_NCURSES_TERM_H 1
5228 EOF
5229
5230         ;;
5231 (ncursesw/term.h)
5232
5233 cat >>confdefs.h <<\EOF
5234 #define HAVE_NCURSESW_TERM_H 1
5235 EOF
5236
5237         ;;
5238 esac
5239
5240 echo "$as_me:5240: checking for ncurses version" >&5
5241 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5242 if test "${cf_cv_ncurses_version+set}" = set; then
5243   echo $ECHO_N "(cached) $ECHO_C" >&6
5244 else
5245
5246         cf_cv_ncurses_version=no
5247         cf_tempfile=out$$
5248         rm -f $cf_tempfile
5249         if test "$cross_compiling" = yes; then
5250
5251         # This will not work if the preprocessor splits the line after the
5252         # Autoconf token.  The 'unproto' program does that.
5253         cat > conftest.$ac_ext <<EOF
5254 #include <${cf_cv_ncurses_header:-curses.h}>
5255 #undef Autoconf
5256 #ifdef NCURSES_VERSION
5257 Autoconf NCURSES_VERSION
5258 #else
5259 #ifdef __NCURSES_H
5260 Autoconf "old"
5261 #endif
5262 ;
5263 #endif
5264 EOF
5265         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5266         { (eval echo "$as_me:5266: \"$cf_try\"") >&5
5267   (eval $cf_try) 2>&5
5268   ac_status=$?
5269   echo "$as_me:5269: \$? = $ac_status" >&5
5270   (exit $ac_status); }
5271         if test -f conftest.out ; then
5272                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5273                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5274                 rm -f conftest.out
5275         fi
5276
5277 else
5278   cat >conftest.$ac_ext <<_ACEOF
5279 #line 5279 "configure"
5280 #include "confdefs.h"
5281
5282 #include <${cf_cv_ncurses_header:-curses.h}>
5283 #include <stdio.h>
5284 int main()
5285 {
5286         FILE *fp = fopen("$cf_tempfile", "w");
5287 #ifdef NCURSES_VERSION
5288 # ifdef NCURSES_VERSION_PATCH
5289         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5290 # else
5291         fprintf(fp, "%s\n", NCURSES_VERSION);
5292 # endif
5293 #else
5294 # ifdef __NCURSES_H
5295         fprintf(fp, "old\n");
5296 # else
5297         make an error
5298 # endif
5299 #endif
5300         ${cf_cv_main_return:-return}(0);
5301 }
5302 _ACEOF
5303 rm -f conftest$ac_exeext
5304 if { (eval echo "$as_me:5304: \"$ac_link\"") >&5
5305   (eval $ac_link) 2>&5
5306   ac_status=$?
5307   echo "$as_me:5307: \$? = $ac_status" >&5
5308   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5309   { (eval echo "$as_me:5309: \"$ac_try\"") >&5
5310   (eval $ac_try) 2>&5
5311   ac_status=$?
5312   echo "$as_me:5312: \$? = $ac_status" >&5
5313   (exit $ac_status); }; }; then
5314
5315         cf_cv_ncurses_version=`cat $cf_tempfile`
5316 else
5317   echo "$as_me: program exited with status $ac_status" >&5
5318 echo "$as_me: failed program was:" >&5
5319 cat conftest.$ac_ext >&5
5320 fi
5321 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5322 fi
5323         rm -f $cf_tempfile
5324
5325 fi
5326 echo "$as_me:5326: result: $cf_cv_ncurses_version" >&5
5327 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5328 test "$cf_cv_ncurses_version" = no ||
5329 cat >>confdefs.h <<\EOF
5330 #define NCURSES 1
5331 EOF
5332
5333 echo "$as_me:5333: checking if we have identified curses libraries" >&5
5334 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5335 cat >conftest.$ac_ext <<_ACEOF
5336 #line 5336 "configure"
5337 #include "confdefs.h"
5338 #include <${cf_cv_ncurses_header:-curses.h}>
5339 int
5340 main ()
5341 {
5342 initscr(); tgoto("?", 0,0)
5343   ;
5344   return 0;
5345 }
5346 _ACEOF
5347 rm -f conftest.$ac_objext conftest$ac_exeext
5348 if { (eval echo "$as_me:5348: \"$ac_link\"") >&5
5349   (eval $ac_link) 2>&5
5350   ac_status=$?
5351   echo "$as_me:5351: \$? = $ac_status" >&5
5352   (exit $ac_status); } &&
5353          { ac_try='test -s conftest$ac_exeext'
5354   { (eval echo "$as_me:5354: \"$ac_try\"") >&5
5355   (eval $ac_try) 2>&5
5356   ac_status=$?
5357   echo "$as_me:5357: \$? = $ac_status" >&5
5358   (exit $ac_status); }; }; then
5359   cf_result=yes
5360 else
5361   echo "$as_me: failed program was:" >&5
5362 cat conftest.$ac_ext >&5
5363 cf_result=no
5364 fi
5365 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5366 echo "$as_me:5366: result: $cf_result" >&5
5367 echo "${ECHO_T}$cf_result" >&6
5368
5369 if test "$cf_result" = no ; then
5370 case $host_os in
5371 (freebsd*)
5372         echo "$as_me:5372: checking for tgoto in -lmytinfo" >&5
5373 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5374 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5375   echo $ECHO_N "(cached) $ECHO_C" >&6
5376 else
5377   ac_check_lib_save_LIBS=$LIBS
5378 LIBS="-lmytinfo  $LIBS"
5379 cat >conftest.$ac_ext <<_ACEOF
5380 #line 5380 "configure"
5381 #include "confdefs.h"
5382
5383 /* Override any gcc2 internal prototype to avoid an error.  */
5384 #ifdef __cplusplus
5385 extern "C"
5386 #endif
5387 /* We use char because int might match the return type of a gcc2
5388    builtin and then its argument prototype would still apply.  */
5389 char tgoto ();
5390 int
5391 main ()
5392 {
5393 tgoto ();
5394   ;
5395   return 0;
5396 }
5397 _ACEOF
5398 rm -f conftest.$ac_objext conftest$ac_exeext
5399 if { (eval echo "$as_me:5399: \"$ac_link\"") >&5
5400   (eval $ac_link) 2>&5
5401   ac_status=$?
5402   echo "$as_me:5402: \$? = $ac_status" >&5
5403   (exit $ac_status); } &&
5404          { ac_try='test -s conftest$ac_exeext'
5405   { (eval echo "$as_me:5405: \"$ac_try\"") >&5
5406   (eval $ac_try) 2>&5
5407   ac_status=$?
5408   echo "$as_me:5408: \$? = $ac_status" >&5
5409   (exit $ac_status); }; }; then
5410   ac_cv_lib_mytinfo_tgoto=yes
5411 else
5412   echo "$as_me: failed program was:" >&5
5413 cat conftest.$ac_ext >&5
5414 ac_cv_lib_mytinfo_tgoto=no
5415 fi
5416 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5417 LIBS=$ac_check_lib_save_LIBS
5418 fi
5419 echo "$as_me:5419: result: $ac_cv_lib_mytinfo_tgoto" >&5
5420 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5421 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5422
5423 cf_add_libs="-lmytinfo"
5424 # Filter out duplicates - this happens with badly-designed ".pc" files...
5425 for cf_add_1lib in $LIBS
5426 do
5427         for cf_add_2lib in $cf_add_libs
5428         do
5429                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5430                 then
5431                         cf_add_1lib=
5432                         break
5433                 fi
5434         done
5435         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5436 done
5437 LIBS="$cf_add_libs"
5438
5439 fi
5440
5441         ;;
5442 (hpux10.*)
5443         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5444         # next (1998), and xcurses "newer" (2000).  There is no header file for
5445         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5446         # term.h) for cur_colr
5447         if test "x$cf_cv_screen" = "xcurses_colr"
5448         then
5449                 echo "$as_me:5449: checking for initscr in -lcur_colr" >&5
5450 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5451 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5452   echo $ECHO_N "(cached) $ECHO_C" >&6
5453 else
5454   ac_check_lib_save_LIBS=$LIBS
5455 LIBS="-lcur_colr  $LIBS"
5456 cat >conftest.$ac_ext <<_ACEOF
5457 #line 5457 "configure"
5458 #include "confdefs.h"
5459
5460 /* Override any gcc2 internal prototype to avoid an error.  */
5461 #ifdef __cplusplus
5462 extern "C"
5463 #endif
5464 /* We use char because int might match the return type of a gcc2
5465    builtin and then its argument prototype would still apply.  */
5466 char initscr ();
5467 int
5468 main ()
5469 {
5470 initscr ();
5471   ;
5472   return 0;
5473 }
5474 _ACEOF
5475 rm -f conftest.$ac_objext conftest$ac_exeext
5476 if { (eval echo "$as_me:5476: \"$ac_link\"") >&5
5477   (eval $ac_link) 2>&5
5478   ac_status=$?
5479   echo "$as_me:5479: \$? = $ac_status" >&5
5480   (exit $ac_status); } &&
5481          { ac_try='test -s conftest$ac_exeext'
5482   { (eval echo "$as_me:5482: \"$ac_try\"") >&5
5483   (eval $ac_try) 2>&5
5484   ac_status=$?
5485   echo "$as_me:5485: \$? = $ac_status" >&5
5486   (exit $ac_status); }; }; then
5487   ac_cv_lib_cur_colr_initscr=yes
5488 else
5489   echo "$as_me: failed program was:" >&5
5490 cat conftest.$ac_ext >&5
5491 ac_cv_lib_cur_colr_initscr=no
5492 fi
5493 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5494 LIBS=$ac_check_lib_save_LIBS
5495 fi
5496 echo "$as_me:5496: result: $ac_cv_lib_cur_colr_initscr" >&5
5497 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5498 if test $ac_cv_lib_cur_colr_initscr = yes; then
5499
5500 cf_add_libs="-lcur_colr"
5501 # Filter out duplicates - this happens with badly-designed ".pc" files...
5502 for cf_add_1lib in $LIBS
5503 do
5504         for cf_add_2lib in $cf_add_libs
5505         do
5506                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5507                 then
5508                         cf_add_1lib=
5509                         break
5510                 fi
5511         done
5512         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5513 done
5514 LIBS="$cf_add_libs"
5515
5516                         ac_cv_func_initscr=yes
5517
5518 else
5519
5520                 echo "$as_me:5520: checking for initscr in -lHcurses" >&5
5521 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5522 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5523   echo $ECHO_N "(cached) $ECHO_C" >&6
5524 else
5525   ac_check_lib_save_LIBS=$LIBS
5526 LIBS="-lHcurses  $LIBS"
5527 cat >conftest.$ac_ext <<_ACEOF
5528 #line 5528 "configure"
5529 #include "confdefs.h"
5530
5531 /* Override any gcc2 internal prototype to avoid an error.  */
5532 #ifdef __cplusplus
5533 extern "C"
5534 #endif
5535 /* We use char because int might match the return type of a gcc2
5536    builtin and then its argument prototype would still apply.  */
5537 char initscr ();
5538 int
5539 main ()
5540 {
5541 initscr ();
5542   ;
5543   return 0;
5544 }
5545 _ACEOF
5546 rm -f conftest.$ac_objext conftest$ac_exeext
5547 if { (eval echo "$as_me:5547: \"$ac_link\"") >&5
5548   (eval $ac_link) 2>&5
5549   ac_status=$?
5550   echo "$as_me:5550: \$? = $ac_status" >&5
5551   (exit $ac_status); } &&
5552          { ac_try='test -s conftest$ac_exeext'
5553   { (eval echo "$as_me:5553: \"$ac_try\"") >&5
5554   (eval $ac_try) 2>&5
5555   ac_status=$?
5556   echo "$as_me:5556: \$? = $ac_status" >&5
5557   (exit $ac_status); }; }; then
5558   ac_cv_lib_Hcurses_initscr=yes
5559 else
5560   echo "$as_me: failed program was:" >&5
5561 cat conftest.$ac_ext >&5
5562 ac_cv_lib_Hcurses_initscr=no
5563 fi
5564 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5565 LIBS=$ac_check_lib_save_LIBS
5566 fi
5567 echo "$as_me:5567: result: $ac_cv_lib_Hcurses_initscr" >&5
5568 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5569 if test $ac_cv_lib_Hcurses_initscr = yes; then
5570
5571                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5572
5573 cf_add_libs="-lHcurses"
5574 # Filter out duplicates - this happens with badly-designed ".pc" files...
5575 for cf_add_1lib in $LIBS
5576 do
5577         for cf_add_2lib in $cf_add_libs
5578         do
5579                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5580                 then
5581                         cf_add_1lib=
5582                         break
5583                 fi
5584         done
5585         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5586 done
5587 LIBS="$cf_add_libs"
5588
5589                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5590                         ac_cv_func_initscr=yes
5591
5592 fi
5593
5594 fi
5595
5596         fi
5597         ;;
5598 (linux*)
5599         case `arch 2>/dev/null` in
5600         (x86_64)
5601                 if test -d /lib64
5602                 then
5603
5604 if test -n "/lib64" ; then
5605         for cf_add_libdir in /lib64
5606         do
5607                 if test $cf_add_libdir = /usr/lib ; then
5608                         :
5609                 elif test -d $cf_add_libdir
5610                 then
5611                         cf_have_libdir=no
5612                         if test -n "$LDFLAGS$LIBS" ; then
5613                                 # a loop is needed to ensure we can add subdirs of existing dirs
5614                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5615                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5616                                                 cf_have_libdir=yes; break
5617                                         fi
5618                                 done
5619                         fi
5620                         if test "$cf_have_libdir" = no ; then
5621                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5622
5623 echo "${as_me:-configure}:5623: testing adding $cf_add_libdir to library-path ..." 1>&5
5624
5625                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5626                         fi
5627                 fi
5628         done
5629 fi
5630
5631                 else
5632
5633 if test -n "/lib" ; then
5634         for cf_add_libdir in /lib
5635         do
5636                 if test $cf_add_libdir = /usr/lib ; then
5637                         :
5638                 elif test -d $cf_add_libdir
5639                 then
5640                         cf_have_libdir=no
5641                         if test -n "$LDFLAGS$LIBS" ; then
5642                                 # a loop is needed to ensure we can add subdirs of existing dirs
5643                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5644                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5645                                                 cf_have_libdir=yes; break
5646                                         fi
5647                                 done
5648                         fi
5649                         if test "$cf_have_libdir" = no ; then
5650                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5651
5652 echo "${as_me:-configure}:5652: testing adding $cf_add_libdir to library-path ..." 1>&5
5653
5654                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5655                         fi
5656                 fi
5657         done
5658 fi
5659
5660                 fi
5661                 ;;
5662         (*)
5663
5664 if test -n "/lib" ; then
5665         for cf_add_libdir in /lib
5666         do
5667                 if test $cf_add_libdir = /usr/lib ; then
5668                         :
5669                 elif test -d $cf_add_libdir
5670                 then
5671                         cf_have_libdir=no
5672                         if test -n "$LDFLAGS$LIBS" ; then
5673                                 # a loop is needed to ensure we can add subdirs of existing dirs
5674                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5675                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5676                                                 cf_have_libdir=yes; break
5677                                         fi
5678                                 done
5679                         fi
5680                         if test "$cf_have_libdir" = no ; then
5681                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5682
5683 echo "${as_me:-configure}:5683: testing adding $cf_add_libdir to library-path ..." 1>&5
5684
5685                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5686                         fi
5687                 fi
5688         done
5689 fi
5690
5691                 ;;
5692         esac
5693         ;;
5694 (sunos3*|sunos4*)
5695         if test "x$cf_cv_screen" = "xcurses_5lib"
5696         then
5697                 if test -d /usr/5lib ; then
5698
5699 if test -n "/usr/5lib" ; then
5700         for cf_add_libdir in /usr/5lib
5701         do
5702                 if test $cf_add_libdir = /usr/lib ; then
5703                         :
5704                 elif test -d $cf_add_libdir
5705                 then
5706                         cf_have_libdir=no
5707                         if test -n "$LDFLAGS$LIBS" ; then
5708                                 # a loop is needed to ensure we can add subdirs of existing dirs
5709                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5710                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5711                                                 cf_have_libdir=yes; break
5712                                         fi
5713                                 done
5714                         fi
5715                         if test "$cf_have_libdir" = no ; then
5716                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5717
5718 echo "${as_me:-configure}:5718: testing adding $cf_add_libdir to library-path ..." 1>&5
5719
5720                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5721                         fi
5722                 fi
5723         done
5724 fi
5725
5726 cf_add_libs="-lcurses -ltermcap"
5727 # Filter out duplicates - this happens with badly-designed ".pc" files...
5728 for cf_add_1lib in $LIBS
5729 do
5730         for cf_add_2lib in $cf_add_libs
5731         do
5732                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5733                 then
5734                         cf_add_1lib=
5735                         break
5736                 fi
5737         done
5738         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5739 done
5740 LIBS="$cf_add_libs"
5741
5742                 fi
5743         fi
5744         ac_cv_func_initscr=yes
5745         ;;
5746 esac
5747
5748 if test ".$ac_cv_func_initscr" != .yes ; then
5749         cf_save_LIBS="$LIBS"
5750
5751         if test ".${cf_cv_ncurses_version:-no}" != .no
5752         then
5753                 cf_check_list="ncurses curses cursesX"
5754         else
5755                 cf_check_list="cursesX curses ncurses"
5756         fi
5757
5758         # Check for library containing tgoto.  Do this before curses library
5759         # because it may be needed to link the test-case for initscr.
5760         if test "x$cf_term_lib" = x
5761         then
5762                 echo "$as_me:5762: checking for tgoto" >&5
5763 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5764 if test "${ac_cv_func_tgoto+set}" = set; then
5765   echo $ECHO_N "(cached) $ECHO_C" >&6
5766 else
5767   cat >conftest.$ac_ext <<_ACEOF
5768 #line 5768 "configure"
5769 #include "confdefs.h"
5770 /* System header to define __stub macros and hopefully few prototypes,
5771     which can conflict with char tgoto (); below.  */
5772 #include <assert.h>
5773 /* Override any gcc2 internal prototype to avoid an error.  */
5774 #ifdef __cplusplus
5775 extern "C"
5776 #endif
5777 /* We use char because int might match the return type of a gcc2
5778    builtin and then its argument prototype would still apply.  */
5779 char tgoto ();
5780 char (*f) ();
5781
5782 int
5783 main ()
5784 {
5785 /* The GNU C library defines this for functions which it implements
5786     to always fail with ENOSYS.  Some functions are actually named
5787     something starting with __ and the normal name is an alias.  */
5788 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5789 choke me
5790 #else
5791 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5792 #endif
5793
5794   ;
5795   return 0;
5796 }
5797 _ACEOF
5798 rm -f conftest.$ac_objext conftest$ac_exeext
5799 if { (eval echo "$as_me:5799: \"$ac_link\"") >&5
5800   (eval $ac_link) 2>&5
5801   ac_status=$?
5802   echo "$as_me:5802: \$? = $ac_status" >&5
5803   (exit $ac_status); } &&
5804          { ac_try='test -s conftest$ac_exeext'
5805   { (eval echo "$as_me:5805: \"$ac_try\"") >&5
5806   (eval $ac_try) 2>&5
5807   ac_status=$?
5808   echo "$as_me:5808: \$? = $ac_status" >&5
5809   (exit $ac_status); }; }; then
5810   ac_cv_func_tgoto=yes
5811 else
5812   echo "$as_me: failed program was:" >&5
5813 cat conftest.$ac_ext >&5
5814 ac_cv_func_tgoto=no
5815 fi
5816 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5817 fi
5818 echo "$as_me:5818: result: $ac_cv_func_tgoto" >&5
5819 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5820 if test $ac_cv_func_tgoto = yes; then
5821   cf_term_lib=predefined
5822 else
5823
5824                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5825                         do
5826                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5827 echo "$as_me:5827: checking for tgoto in -l$cf_term_lib" >&5
5828 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5829 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5830   echo $ECHO_N "(cached) $ECHO_C" >&6
5831 else
5832   ac_check_lib_save_LIBS=$LIBS
5833 LIBS="-l$cf_term_lib  $LIBS"
5834 cat >conftest.$ac_ext <<_ACEOF
5835 #line 5835 "configure"
5836 #include "confdefs.h"
5837
5838 /* Override any gcc2 internal prototype to avoid an error.  */
5839 #ifdef __cplusplus
5840 extern "C"
5841 #endif
5842 /* We use char because int might match the return type of a gcc2
5843    builtin and then its argument prototype would still apply.  */
5844 char tgoto ();
5845 int
5846 main ()
5847 {
5848 tgoto ();
5849   ;
5850   return 0;
5851 }
5852 _ACEOF
5853 rm -f conftest.$ac_objext conftest$ac_exeext
5854 if { (eval echo "$as_me:5854: \"$ac_link\"") >&5
5855   (eval $ac_link) 2>&5
5856   ac_status=$?
5857   echo "$as_me:5857: \$? = $ac_status" >&5
5858   (exit $ac_status); } &&
5859          { ac_try='test -s conftest$ac_exeext'
5860   { (eval echo "$as_me:5860: \"$ac_try\"") >&5
5861   (eval $ac_try) 2>&5
5862   ac_status=$?
5863   echo "$as_me:5863: \$? = $ac_status" >&5
5864   (exit $ac_status); }; }; then
5865   eval "$as_ac_Lib=yes"
5866 else
5867   echo "$as_me: failed program was:" >&5
5868 cat conftest.$ac_ext >&5
5869 eval "$as_ac_Lib=no"
5870 fi
5871 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5872 LIBS=$ac_check_lib_save_LIBS
5873 fi
5874 echo "$as_me:5874: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5875 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5876 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5877   break
5878 fi
5879
5880                         done
5881
5882 fi
5883
5884         fi
5885
5886         # Check for library containing initscr
5887         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5888         if test "x$cf_curs_lib" = x
5889         then
5890                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5891                 do
5892                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5893 echo "$as_me:5893: checking for initscr in -l$cf_curs_lib" >&5
5894 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5895 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5896   echo $ECHO_N "(cached) $ECHO_C" >&6
5897 else
5898   ac_check_lib_save_LIBS=$LIBS
5899 LIBS="-l$cf_curs_lib  $LIBS"
5900 cat >conftest.$ac_ext <<_ACEOF
5901 #line 5901 "configure"
5902 #include "confdefs.h"
5903
5904 /* Override any gcc2 internal prototype to avoid an error.  */
5905 #ifdef __cplusplus
5906 extern "C"
5907 #endif
5908 /* We use char because int might match the return type of a gcc2
5909    builtin and then its argument prototype would still apply.  */
5910 char initscr ();
5911 int
5912 main ()
5913 {
5914 initscr ();
5915   ;
5916   return 0;
5917 }
5918 _ACEOF
5919 rm -f conftest.$ac_objext conftest$ac_exeext
5920 if { (eval echo "$as_me:5920: \"$ac_link\"") >&5
5921   (eval $ac_link) 2>&5
5922   ac_status=$?
5923   echo "$as_me:5923: \$? = $ac_status" >&5
5924   (exit $ac_status); } &&
5925          { ac_try='test -s conftest$ac_exeext'
5926   { (eval echo "$as_me:5926: \"$ac_try\"") >&5
5927   (eval $ac_try) 2>&5
5928   ac_status=$?
5929   echo "$as_me:5929: \$? = $ac_status" >&5
5930   (exit $ac_status); }; }; then
5931   eval "$as_ac_Lib=yes"
5932 else
5933   echo "$as_me: failed program was:" >&5
5934 cat conftest.$ac_ext >&5
5935 eval "$as_ac_Lib=no"
5936 fi
5937 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5938 LIBS=$ac_check_lib_save_LIBS
5939 fi
5940 echo "$as_me:5940: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5941 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5942 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5943   break
5944 fi
5945
5946                 done
5947         fi
5948         test $cf_curs_lib = unknown && { { echo "$as_me:5948: error: no curses library found" >&5
5949 echo "$as_me: error: no curses library found" >&2;}
5950    { (exit 1); exit 1; }; }
5951
5952         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5953         if test "$cf_term_lib" = unknown ; then
5954                 echo "$as_me:5954: checking if we can link with $cf_curs_lib library" >&5
5955 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5956                 cat >conftest.$ac_ext <<_ACEOF
5957 #line 5957 "configure"
5958 #include "confdefs.h"
5959 #include <${cf_cv_ncurses_header:-curses.h}>
5960 int
5961 main ()
5962 {
5963 initscr()
5964   ;
5965   return 0;
5966 }
5967 _ACEOF
5968 rm -f conftest.$ac_objext conftest$ac_exeext
5969 if { (eval echo "$as_me:5969: \"$ac_link\"") >&5
5970   (eval $ac_link) 2>&5
5971   ac_status=$?
5972   echo "$as_me:5972: \$? = $ac_status" >&5
5973   (exit $ac_status); } &&
5974          { ac_try='test -s conftest$ac_exeext'
5975   { (eval echo "$as_me:5975: \"$ac_try\"") >&5
5976   (eval $ac_try) 2>&5
5977   ac_status=$?
5978   echo "$as_me:5978: \$? = $ac_status" >&5
5979   (exit $ac_status); }; }; then
5980   cf_result=yes
5981 else
5982   echo "$as_me: failed program was:" >&5
5983 cat conftest.$ac_ext >&5
5984 cf_result=no
5985 fi
5986 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5987                 echo "$as_me:5987: result: $cf_result" >&5
5988 echo "${ECHO_T}$cf_result" >&6
5989                 test $cf_result = no && { { echo "$as_me:5989: error: Cannot link curses library" >&5
5990 echo "$as_me: error: Cannot link curses library" >&2;}
5991    { (exit 1); exit 1; }; }
5992         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5993                 :
5994         elif test "$cf_term_lib" != predefined ; then
5995                 echo "$as_me:5995: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5996 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5997                 cat >conftest.$ac_ext <<_ACEOF
5998 #line 5998 "configure"
5999 #include "confdefs.h"
6000 #include <${cf_cv_ncurses_header:-curses.h}>
6001 int
6002 main ()
6003 {
6004 initscr(); tgoto((char *)0, 0, 0);
6005   ;
6006   return 0;
6007 }
6008 _ACEOF
6009 rm -f conftest.$ac_objext conftest$ac_exeext
6010 if { (eval echo "$as_me:6010: \"$ac_link\"") >&5
6011   (eval $ac_link) 2>&5
6012   ac_status=$?
6013   echo "$as_me:6013: \$? = $ac_status" >&5
6014   (exit $ac_status); } &&
6015          { ac_try='test -s conftest$ac_exeext'
6016   { (eval echo "$as_me:6016: \"$ac_try\"") >&5
6017   (eval $ac_try) 2>&5
6018   ac_status=$?
6019   echo "$as_me:6019: \$? = $ac_status" >&5
6020   (exit $ac_status); }; }; then
6021   cf_result=no
6022 else
6023   echo "$as_me: failed program was:" >&5
6024 cat conftest.$ac_ext >&5
6025
6026                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6027                         cat >conftest.$ac_ext <<_ACEOF
6028 #line 6028 "configure"
6029 #include "confdefs.h"
6030 #include <${cf_cv_ncurses_header:-curses.h}>
6031 int
6032 main ()
6033 {
6034 initscr()
6035   ;
6036   return 0;
6037 }
6038 _ACEOF
6039 rm -f conftest.$ac_objext conftest$ac_exeext
6040 if { (eval echo "$as_me:6040: \"$ac_link\"") >&5
6041   (eval $ac_link) 2>&5
6042   ac_status=$?
6043   echo "$as_me:6043: \$? = $ac_status" >&5
6044   (exit $ac_status); } &&
6045          { ac_try='test -s conftest$ac_exeext'
6046   { (eval echo "$as_me:6046: \"$ac_try\"") >&5
6047   (eval $ac_try) 2>&5
6048   ac_status=$?
6049   echo "$as_me:6049: \$? = $ac_status" >&5
6050   (exit $ac_status); }; }; then
6051   cf_result=yes
6052 else
6053   echo "$as_me: failed program was:" >&5
6054 cat conftest.$ac_ext >&5
6055 cf_result=error
6056 fi
6057 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6058
6059 fi
6060 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6061                 echo "$as_me:6061: result: $cf_result" >&5
6062 echo "${ECHO_T}$cf_result" >&6
6063         fi
6064 fi
6065 fi
6066
6067         ;;
6068 (ncursesw*)
6069
6070 echo "$as_me:6070: checking for multibyte character support" >&5
6071 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6072 if test "${cf_cv_utf8_lib+set}" = set; then
6073   echo $ECHO_N "(cached) $ECHO_C" >&6
6074 else
6075
6076         cf_save_LIBS="$LIBS"
6077         cat >conftest.$ac_ext <<_ACEOF
6078 #line 6078 "configure"
6079 #include "confdefs.h"
6080
6081 #include <stdlib.h>
6082 int
6083 main ()
6084 {
6085 putwc(0,0);
6086   ;
6087   return 0;
6088 }
6089 _ACEOF
6090 rm -f conftest.$ac_objext conftest$ac_exeext
6091 if { (eval echo "$as_me:6091: \"$ac_link\"") >&5
6092   (eval $ac_link) 2>&5
6093   ac_status=$?
6094   echo "$as_me:6094: \$? = $ac_status" >&5
6095   (exit $ac_status); } &&
6096          { ac_try='test -s conftest$ac_exeext'
6097   { (eval echo "$as_me:6097: \"$ac_try\"") >&5
6098   (eval $ac_try) 2>&5
6099   ac_status=$?
6100   echo "$as_me:6100: \$? = $ac_status" >&5
6101   (exit $ac_status); }; }; then
6102   cf_cv_utf8_lib=yes
6103 else
6104   echo "$as_me: failed program was:" >&5
6105 cat conftest.$ac_ext >&5
6106
6107 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6108 # will be set on completion of the AC_TRY_LINK below.
6109 cf_cv_header_path_utf8=
6110 cf_cv_library_path_utf8=
6111
6112 echo "${as_me:-configure}:6112: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6113
6114 cf_save_LIBS="$LIBS"
6115
6116 cat >conftest.$ac_ext <<_ACEOF
6117 #line 6117 "configure"
6118 #include "confdefs.h"
6119
6120 #include <libutf8.h>
6121 int
6122 main ()
6123 {
6124 putwc(0,0);
6125   ;
6126   return 0;
6127 }
6128 _ACEOF
6129 rm -f conftest.$ac_objext conftest$ac_exeext
6130 if { (eval echo "$as_me:6130: \"$ac_link\"") >&5
6131   (eval $ac_link) 2>&5
6132   ac_status=$?
6133   echo "$as_me:6133: \$? = $ac_status" >&5
6134   (exit $ac_status); } &&
6135          { ac_try='test -s conftest$ac_exeext'
6136   { (eval echo "$as_me:6136: \"$ac_try\"") >&5
6137   (eval $ac_try) 2>&5
6138   ac_status=$?
6139   echo "$as_me:6139: \$? = $ac_status" >&5
6140   (exit $ac_status); }; }; then
6141
6142         cf_cv_find_linkage_utf8=yes
6143         cf_cv_header_path_utf8=/usr/include
6144         cf_cv_library_path_utf8=/usr/lib
6145
6146 else
6147   echo "$as_me: failed program was:" >&5
6148 cat conftest.$ac_ext >&5
6149
6150 LIBS="-lutf8  $cf_save_LIBS"
6151
6152 cat >conftest.$ac_ext <<_ACEOF
6153 #line 6153 "configure"
6154 #include "confdefs.h"
6155
6156 #include <libutf8.h>
6157 int
6158 main ()
6159 {
6160 putwc(0,0);
6161   ;
6162   return 0;
6163 }
6164 _ACEOF
6165 rm -f conftest.$ac_objext conftest$ac_exeext
6166 if { (eval echo "$as_me:6166: \"$ac_link\"") >&5
6167   (eval $ac_link) 2>&5
6168   ac_status=$?
6169   echo "$as_me:6169: \$? = $ac_status" >&5
6170   (exit $ac_status); } &&
6171          { ac_try='test -s conftest$ac_exeext'
6172   { (eval echo "$as_me:6172: \"$ac_try\"") >&5
6173   (eval $ac_try) 2>&5
6174   ac_status=$?
6175   echo "$as_me:6175: \$? = $ac_status" >&5
6176   (exit $ac_status); }; }; then
6177
6178         cf_cv_find_linkage_utf8=yes
6179         cf_cv_header_path_utf8=/usr/include
6180         cf_cv_library_path_utf8=/usr/lib
6181         cf_cv_library_file_utf8="-lutf8"
6182
6183 else
6184   echo "$as_me: failed program was:" >&5
6185 cat conftest.$ac_ext >&5
6186
6187         cf_cv_find_linkage_utf8=no
6188         LIBS="$cf_save_LIBS"
6189
6190         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6191
6192 echo "${as_me:-configure}:6192: testing find linkage for utf8 library ..." 1>&5
6193
6194 echo "${as_me:-configure}:6194: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6195
6196         cf_save_CPPFLAGS="$CPPFLAGS"
6197         cf_test_CPPFLAGS="$CPPFLAGS"
6198
6199 cf_search=
6200
6201 # collect the current set of include-directories from compiler flags
6202 cf_header_path_list=""
6203 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6204         for cf_header_path in $CPPFLAGS $CFLAGS
6205         do
6206                 case $cf_header_path in
6207                 (-I*)
6208                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6209
6210 test "x$cf_header_path" != "xNONE" && \
6211 test -d "$cf_header_path" && \
6212  {
6213         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6214         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6215         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6216         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6217         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6218         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6219 }
6220
6221                         cf_header_path_list="$cf_header_path_list $cf_search"
6222                         ;;
6223                 esac
6224         done
6225 fi
6226
6227 # add the variations for the package we are looking for
6228
6229 cf_search=
6230
6231 test "x$prefix" != "xNONE" && \
6232 test -d "$prefix" && \
6233  {
6234         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6235         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6236         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6237         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6238         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6239         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6240 }
6241
6242 for cf_subdir_prefix in \
6243         /usr \
6244         /usr/local \
6245         /usr/pkg \
6246         /opt \
6247         /opt/local \
6248         $HOME
6249 do
6250
6251 test "x$cf_subdir_prefix" != "x$prefix" && \
6252 test -d "$cf_subdir_prefix" && \
6253 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6254         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6255         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6256         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6257         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6258         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6259         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6260 }
6261
6262 done
6263
6264 test "$includedir" != NONE && \
6265 test "$includedir" != "/usr/include" && \
6266 test -d "$includedir" && {
6267         test -d $includedir &&    cf_search="$cf_search $includedir"
6268         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6269 }
6270
6271 test "$oldincludedir" != NONE && \
6272 test "$oldincludedir" != "/usr/include" && \
6273 test -d "$oldincludedir" && {
6274         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6275         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6276 }
6277
6278 cf_search="$cf_search $cf_header_path_list"
6279
6280         for cf_cv_header_path_utf8 in $cf_search
6281         do
6282                 if test -d $cf_cv_header_path_utf8 ; then
6283                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6284
6285 echo "${as_me:-configure}:6285: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6286
6287                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
6288                         cat >conftest.$ac_ext <<_ACEOF
6289 #line 6289 "configure"
6290 #include "confdefs.h"
6291
6292 #include <libutf8.h>
6293 int
6294 main ()
6295 {
6296 putwc(0,0);
6297   ;
6298   return 0;
6299 }
6300 _ACEOF
6301 rm -f conftest.$ac_objext
6302 if { (eval echo "$as_me:6302: \"$ac_compile\"") >&5
6303   (eval $ac_compile) 2>&5
6304   ac_status=$?
6305   echo "$as_me:6305: \$? = $ac_status" >&5
6306   (exit $ac_status); } &&
6307          { ac_try='test -s conftest.$ac_objext'
6308   { (eval echo "$as_me:6308: \"$ac_try\"") >&5
6309   (eval $ac_try) 2>&5
6310   ac_status=$?
6311   echo "$as_me:6311: \$? = $ac_status" >&5
6312   (exit $ac_status); }; }; then
6313
6314                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6315
6316 echo "${as_me:-configure}:6316: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6317
6318                                 cf_cv_find_linkage_utf8=maybe
6319                                 cf_test_CPPFLAGS="$CPPFLAGS"
6320                                 break
6321 else
6322   echo "$as_me: failed program was:" >&5
6323 cat conftest.$ac_ext >&5
6324
6325                                 CPPFLAGS="$cf_save_CPPFLAGS"
6326
6327 fi
6328 rm -f conftest.$ac_objext conftest.$ac_ext
6329                 fi
6330         done
6331
6332         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6333
6334 echo "${as_me:-configure}:6334: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6335
6336                 cf_save_LIBS="$LIBS"
6337                 cf_save_LDFLAGS="$LDFLAGS"
6338
6339                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6340
6341 cf_search=
6342 cf_library_path_list=""
6343 if test -n "${LDFLAGS}${LIBS}" ; then
6344         for cf_library_path in $LDFLAGS $LIBS
6345         do
6346                 case $cf_library_path in
6347                 (-L*)
6348                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6349
6350 test "x$cf_library_path" != "xNONE" && \
6351 test -d "$cf_library_path" && \
6352  {
6353         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6354         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6355         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6356         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6357         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6358         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6359 }
6360
6361                         cf_library_path_list="$cf_library_path_list $cf_search"
6362                         ;;
6363                 esac
6364         done
6365 fi
6366
6367 cf_search=
6368
6369 test "x$prefix" != "xNONE" && \
6370 test -d "$prefix" && \
6371  {
6372         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6373         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6374         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6375         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6376         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6377         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6378 }
6379
6380 for cf_subdir_prefix in \
6381         /usr \
6382         /usr/local \
6383         /usr/pkg \
6384         /opt \
6385         /opt/local \
6386         $HOME
6387 do
6388
6389 test "x$cf_subdir_prefix" != "x$prefix" && \
6390 test -d "$cf_subdir_prefix" && \
6391 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6392         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6393         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6394         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6395         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6396         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6397         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6398 }
6399
6400 done
6401
6402 cf_search="$cf_library_path_list $cf_search"
6403
6404                         for cf_cv_library_path_utf8 in $cf_search
6405                         do
6406                                 if test -d $cf_cv_library_path_utf8 ; then
6407                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6408
6409 echo "${as_me:-configure}:6409: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6410
6411                                         CPPFLAGS="$cf_test_CPPFLAGS"
6412                                         LIBS="-lutf8  $cf_save_LIBS"
6413                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6414                                         cat >conftest.$ac_ext <<_ACEOF
6415 #line 6415 "configure"
6416 #include "confdefs.h"
6417
6418 #include <libutf8.h>
6419 int
6420 main ()
6421 {
6422 putwc(0,0);
6423   ;
6424   return 0;
6425 }
6426 _ACEOF
6427 rm -f conftest.$ac_objext conftest$ac_exeext
6428 if { (eval echo "$as_me:6428: \"$ac_link\"") >&5
6429   (eval $ac_link) 2>&5
6430   ac_status=$?
6431   echo "$as_me:6431: \$? = $ac_status" >&5
6432   (exit $ac_status); } &&
6433          { ac_try='test -s conftest$ac_exeext'
6434   { (eval echo "$as_me:6434: \"$ac_try\"") >&5
6435   (eval $ac_try) 2>&5
6436   ac_status=$?
6437   echo "$as_me:6437: \$? = $ac_status" >&5
6438   (exit $ac_status); }; }; then
6439
6440                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6441
6442 echo "${as_me:-configure}:6442: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6443
6444                                         cf_cv_find_linkage_utf8=yes
6445                                         cf_cv_library_file_utf8="-lutf8"
6446                                         break
6447 else
6448   echo "$as_me: failed program was:" >&5
6449 cat conftest.$ac_ext >&5
6450
6451                                         CPPFLAGS="$cf_save_CPPFLAGS"
6452                                         LIBS="$cf_save_LIBS"
6453                                         LDFLAGS="$cf_save_LDFLAGS"
6454
6455 fi
6456 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6457                                 fi
6458                         done
6459                         CPPFLAGS="$cf_save_CPPFLAGS"
6460                         LDFLAGS="$cf_save_LDFLAGS"
6461                 fi
6462
6463         else
6464                 cf_cv_find_linkage_utf8=no
6465         fi
6466
6467 fi
6468 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6469
6470 fi
6471 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6472
6473 LIBS="$cf_save_LIBS"
6474
6475 if test "$cf_cv_find_linkage_utf8" = yes ; then
6476 cf_cv_utf8_lib=add-on
6477 else
6478 cf_cv_utf8_lib=no
6479 fi
6480
6481 fi
6482 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6483 fi
6484 echo "$as_me:6484: result: $cf_cv_utf8_lib" >&5
6485 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6486
6487 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6488 # ncurses/ncursesw:
6489 if test "$cf_cv_utf8_lib" = "add-on" ; then
6490
6491 cat >>confdefs.h <<\EOF
6492 #define HAVE_LIBUTF8_H 1
6493 EOF
6494
6495 if test -n "$cf_cv_header_path_utf8" ; then
6496   for cf_add_incdir in $cf_cv_header_path_utf8
6497   do
6498         while test $cf_add_incdir != /usr/include
6499         do
6500           if test -d $cf_add_incdir
6501           then
6502                 cf_have_incdir=no
6503                 if test -n "$CFLAGS$CPPFLAGS" ; then
6504                   # a loop is needed to ensure we can add subdirs of existing dirs
6505                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6506                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6507                           cf_have_incdir=yes; break
6508                         fi
6509                   done
6510                 fi
6511
6512                 if test "$cf_have_incdir" = no ; then
6513                   if test "$cf_add_incdir" = /usr/local/include ; then
6514                         if test "$GCC" = yes
6515                         then
6516                           cf_save_CPPFLAGS=$CPPFLAGS
6517                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6518                           cat >conftest.$ac_ext <<_ACEOF
6519 #line 6519 "configure"
6520 #include "confdefs.h"
6521 #include <stdio.h>
6522 int
6523 main ()
6524 {
6525 printf("Hello")
6526   ;
6527   return 0;
6528 }
6529 _ACEOF
6530 rm -f conftest.$ac_objext
6531 if { (eval echo "$as_me:6531: \"$ac_compile\"") >&5
6532   (eval $ac_compile) 2>&5
6533   ac_status=$?
6534   echo "$as_me:6534: \$? = $ac_status" >&5
6535   (exit $ac_status); } &&
6536          { ac_try='test -s conftest.$ac_objext'
6537   { (eval echo "$as_me:6537: \"$ac_try\"") >&5
6538   (eval $ac_try) 2>&5
6539   ac_status=$?
6540   echo "$as_me:6540: \$? = $ac_status" >&5
6541   (exit $ac_status); }; }; then
6542   :
6543 else
6544   echo "$as_me: failed program was:" >&5
6545 cat conftest.$ac_ext >&5
6546 cf_have_incdir=yes
6547 fi
6548 rm -f conftest.$ac_objext conftest.$ac_ext
6549                           CPPFLAGS=$cf_save_CPPFLAGS
6550                         fi
6551                   fi
6552                 fi
6553
6554                 if test "$cf_have_incdir" = no ; then
6555                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6556
6557 echo "${as_me:-configure}:6557: testing adding $cf_add_incdir to include-path ..." 1>&5
6558
6559                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6560
6561                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6562                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6563                   cf_add_incdir="$cf_top_incdir"
6564                 else
6565                   break
6566                 fi
6567           else
6568                 break
6569           fi
6570         done
6571   done
6572 fi
6573
6574 if test -n "$cf_cv_library_path_utf8" ; then
6575         for cf_add_libdir in $cf_cv_library_path_utf8
6576         do
6577                 if test $cf_add_libdir = /usr/lib ; then
6578                         :
6579                 elif test -d $cf_add_libdir
6580                 then
6581                         cf_have_libdir=no
6582                         if test -n "$LDFLAGS$LIBS" ; then
6583                                 # a loop is needed to ensure we can add subdirs of existing dirs
6584                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6585                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6586                                                 cf_have_libdir=yes; break
6587                                         fi
6588                                 done
6589                         fi
6590                         if test "$cf_have_libdir" = no ; then
6591                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6592
6593 echo "${as_me:-configure}:6593: testing adding $cf_add_libdir to library-path ..." 1>&5
6594
6595                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6596                         fi
6597                 fi
6598         done
6599 fi
6600
6601 cf_add_libs="$cf_cv_library_file_utf8"
6602 # Filter out duplicates - this happens with badly-designed ".pc" files...
6603 for cf_add_1lib in $LIBS
6604 do
6605         for cf_add_2lib in $cf_add_libs
6606         do
6607                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6608                 then
6609                         cf_add_1lib=
6610                         break
6611                 fi
6612         done
6613         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6614 done
6615 LIBS="$cf_add_libs"
6616
6617 fi
6618
6619 cf_ncuconfig_root=$cf_cv_screen
6620 cf_have_ncuconfig=no
6621
6622 if test "x${PKG_CONFIG:=none}" != xnone; then
6623         echo "$as_me:6623: checking pkg-config for $cf_ncuconfig_root" >&5
6624 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6625         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6626                 echo "$as_me:6626: result: yes" >&5
6627 echo "${ECHO_T}yes" >&6
6628
6629                 echo "$as_me:6629: checking if the $cf_ncuconfig_root package files work" >&5
6630 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6631                 cf_have_ncuconfig=unknown
6632
6633                 cf_save_CPPFLAGS="$CPPFLAGS"
6634                 cf_save_LIBS="$LIBS"
6635
6636                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6637
6638 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6639 # Filter out duplicates - this happens with badly-designed ".pc" files...
6640 for cf_add_1lib in $LIBS
6641 do
6642         for cf_add_2lib in $cf_add_libs
6643         do
6644                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6645                 then
6646                         cf_add_1lib=
6647                         break
6648                 fi
6649         done
6650         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6651 done
6652 LIBS="$cf_add_libs"
6653
6654                 cat >conftest.$ac_ext <<_ACEOF
6655 #line 6655 "configure"
6656 #include "confdefs.h"
6657 #include <${cf_cv_ncurses_header:-curses.h}>
6658 int
6659 main ()
6660 {
6661 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6662   ;
6663   return 0;
6664 }
6665 _ACEOF
6666 rm -f conftest.$ac_objext conftest$ac_exeext
6667 if { (eval echo "$as_me:6667: \"$ac_link\"") >&5
6668   (eval $ac_link) 2>&5
6669   ac_status=$?
6670   echo "$as_me:6670: \$? = $ac_status" >&5
6671   (exit $ac_status); } &&
6672          { ac_try='test -s conftest$ac_exeext'
6673   { (eval echo "$as_me:6673: \"$ac_try\"") >&5
6674   (eval $ac_try) 2>&5
6675   ac_status=$?
6676   echo "$as_me:6676: \$? = $ac_status" >&5
6677   (exit $ac_status); }; }; then
6678   if test "$cross_compiling" = yes; then
6679   cf_have_ncuconfig=maybe
6680 else
6681   cat >conftest.$ac_ext <<_ACEOF
6682 #line 6682 "configure"
6683 #include "confdefs.h"
6684 #include <${cf_cv_ncurses_header:-curses.h}>
6685                                 int main(void)
6686                                 { char *xx = curses_version(); return (xx == 0); }
6687 _ACEOF
6688 rm -f conftest$ac_exeext
6689 if { (eval echo "$as_me:6689: \"$ac_link\"") >&5
6690   (eval $ac_link) 2>&5
6691   ac_status=$?
6692   echo "$as_me:6692: \$? = $ac_status" >&5
6693   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6694   { (eval echo "$as_me:6694: \"$ac_try\"") >&5
6695   (eval $ac_try) 2>&5
6696   ac_status=$?
6697   echo "$as_me:6697: \$? = $ac_status" >&5
6698   (exit $ac_status); }; }; then
6699   cf_have_ncuconfig=yes
6700 else
6701   echo "$as_me: program exited with status $ac_status" >&5
6702 echo "$as_me: failed program was:" >&5
6703 cat conftest.$ac_ext >&5
6704 cf_have_ncuconfig=no
6705 fi
6706 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6707 fi
6708 else
6709   echo "$as_me: failed program was:" >&5
6710 cat conftest.$ac_ext >&5
6711 cf_have_ncuconfig=no
6712 fi
6713 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6714                 echo "$as_me:6714: result: $cf_have_ncuconfig" >&5
6715 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6716                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6717                 if test "$cf_have_ncuconfig" != "yes"
6718                 then
6719                         CPPFLAGS="$cf_save_CPPFLAGS"
6720                         LIBS="$cf_save_LIBS"
6721                         NCURSES_CONFIG_PKG=none
6722                 else
6723
6724 cat >>confdefs.h <<\EOF
6725 #define NCURSES 1
6726 EOF
6727
6728                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6729                 fi
6730
6731         else
6732                 echo "$as_me:6732: result: no" >&5
6733 echo "${ECHO_T}no" >&6
6734                 NCURSES_CONFIG_PKG=none
6735         fi
6736 else
6737         NCURSES_CONFIG_PKG=none
6738 fi
6739
6740 if test "x$cf_have_ncuconfig" = "xno"; then
6741         echo "Looking for ${cf_ncuconfig_root}-config"
6742
6743 if test -n "$ac_tool_prefix"; then
6744   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6745   do
6746     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6747 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6748 echo "$as_me:6748: checking for $ac_word" >&5
6749 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6750 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6751   echo $ECHO_N "(cached) $ECHO_C" >&6
6752 else
6753   if test -n "$NCURSES_CONFIG"; then
6754   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6755 else
6756   ac_save_IFS=$IFS; IFS=$ac_path_separator
6757 ac_dummy="$PATH"
6758 for ac_dir in $ac_dummy; do
6759   IFS=$ac_save_IFS
6760   test -z "$ac_dir" && ac_dir=.
6761   $as_executable_p "$ac_dir/$ac_word" || continue
6762 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6763 echo "$as_me:6763: found $ac_dir/$ac_word" >&5
6764 break
6765 done
6766
6767 fi
6768 fi
6769 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6770 if test -n "$NCURSES_CONFIG"; then
6771   echo "$as_me:6771: result: $NCURSES_CONFIG" >&5
6772 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6773 else
6774   echo "$as_me:6774: result: no" >&5
6775 echo "${ECHO_T}no" >&6
6776 fi
6777
6778     test -n "$NCURSES_CONFIG" && break
6779   done
6780 fi
6781 if test -z "$NCURSES_CONFIG"; then
6782   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6783   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6784 do
6785   # Extract the first word of "$ac_prog", so it can be a program name with args.
6786 set dummy $ac_prog; ac_word=$2
6787 echo "$as_me:6787: checking for $ac_word" >&5
6788 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6789 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6790   echo $ECHO_N "(cached) $ECHO_C" >&6
6791 else
6792   if test -n "$ac_ct_NCURSES_CONFIG"; then
6793   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6794 else
6795   ac_save_IFS=$IFS; IFS=$ac_path_separator
6796 ac_dummy="$PATH"
6797 for ac_dir in $ac_dummy; do
6798   IFS=$ac_save_IFS
6799   test -z "$ac_dir" && ac_dir=.
6800   $as_executable_p "$ac_dir/$ac_word" || continue
6801 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6802 echo "$as_me:6802: found $ac_dir/$ac_word" >&5
6803 break
6804 done
6805
6806 fi
6807 fi
6808 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6809 if test -n "$ac_ct_NCURSES_CONFIG"; then
6810   echo "$as_me:6810: result: $ac_ct_NCURSES_CONFIG" >&5
6811 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6812 else
6813   echo "$as_me:6813: result: no" >&5
6814 echo "${ECHO_T}no" >&6
6815 fi
6816
6817   test -n "$ac_ct_NCURSES_CONFIG" && break
6818 done
6819 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6820
6821   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6822 fi
6823
6824         if test "$NCURSES_CONFIG" != none ; then
6825
6826                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6827
6828 cf_add_libs="`$NCURSES_CONFIG --libs`"
6829 # Filter out duplicates - this happens with badly-designed ".pc" files...
6830 for cf_add_1lib in $LIBS
6831 do
6832         for cf_add_2lib in $cf_add_libs
6833         do
6834                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6835                 then
6836                         cf_add_1lib=
6837                         break
6838                 fi
6839         done
6840         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6841 done
6842 LIBS="$cf_add_libs"
6843
6844                 # even with config script, some packages use no-override for curses.h
6845
6846 echo "$as_me:6846: checking if we have identified curses headers" >&5
6847 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6848 if test "${cf_cv_ncurses_header+set}" = set; then
6849   echo $ECHO_N "(cached) $ECHO_C" >&6
6850 else
6851
6852 cf_cv_ncurses_header=none
6853 for cf_header in \
6854         ncurses.h $cf_cv_screen/ncurses.h \
6855         curses.h $cf_cv_screen/curses.h
6856 do
6857 cat >conftest.$ac_ext <<_ACEOF
6858 #line 6858 "configure"
6859 #include "confdefs.h"
6860 #include <${cf_header}>
6861 int
6862 main ()
6863 {
6864 initscr(); tgoto("?", 0,0)
6865   ;
6866   return 0;
6867 }
6868 _ACEOF
6869 rm -f conftest.$ac_objext
6870 if { (eval echo "$as_me:6870: \"$ac_compile\"") >&5
6871   (eval $ac_compile) 2>&5
6872   ac_status=$?
6873   echo "$as_me:6873: \$? = $ac_status" >&5
6874   (exit $ac_status); } &&
6875          { ac_try='test -s conftest.$ac_objext'
6876   { (eval echo "$as_me:6876: \"$ac_try\"") >&5
6877   (eval $ac_try) 2>&5
6878   ac_status=$?
6879   echo "$as_me:6879: \$? = $ac_status" >&5
6880   (exit $ac_status); }; }; then
6881   cf_cv_ncurses_header=$cf_header; break
6882 else
6883   echo "$as_me: failed program was:" >&5
6884 cat conftest.$ac_ext >&5
6885 fi
6886 rm -f conftest.$ac_objext conftest.$ac_ext
6887 done
6888
6889 fi
6890 echo "$as_me:6890: result: $cf_cv_ncurses_header" >&5
6891 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6892
6893 if test "$cf_cv_ncurses_header" = none ; then
6894         { { echo "$as_me:6894: error: No curses header-files found" >&5
6895 echo "$as_me: error: No curses header-files found" >&2;}
6896    { (exit 1); exit 1; }; }
6897 fi
6898
6899 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6900
6901 for ac_header in $cf_cv_ncurses_header
6902 do
6903 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6904 echo "$as_me:6904: checking for $ac_header" >&5
6905 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6906 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6907   echo $ECHO_N "(cached) $ECHO_C" >&6
6908 else
6909   cat >conftest.$ac_ext <<_ACEOF
6910 #line 6910 "configure"
6911 #include "confdefs.h"
6912 #include <$ac_header>
6913 _ACEOF
6914 if { (eval echo "$as_me:6914: \"$ac_cpp conftest.$ac_ext\"") >&5
6915   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6916   ac_status=$?
6917   egrep -v '^ *\+' conftest.er1 >conftest.err
6918   rm -f conftest.er1
6919   cat conftest.err >&5
6920   echo "$as_me:6920: \$? = $ac_status" >&5
6921   (exit $ac_status); } >/dev/null; then
6922   if test -s conftest.err; then
6923     ac_cpp_err=$ac_c_preproc_warn_flag
6924   else
6925     ac_cpp_err=
6926   fi
6927 else
6928   ac_cpp_err=yes
6929 fi
6930 if test -z "$ac_cpp_err"; then
6931   eval "$as_ac_Header=yes"
6932 else
6933   echo "$as_me: failed program was:" >&5
6934   cat conftest.$ac_ext >&5
6935   eval "$as_ac_Header=no"
6936 fi
6937 rm -f conftest.err conftest.$ac_ext
6938 fi
6939 echo "$as_me:6939: result: `eval echo '${'$as_ac_Header'}'`" >&5
6940 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6941 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6942   cat >>confdefs.h <<EOF
6943 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6944 EOF
6945
6946 fi
6947 done
6948
6949 cat >>confdefs.h <<\EOF
6950 #define NCURSES 1
6951 EOF
6952
6953 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6954
6955                 cat >>confdefs.h <<EOF
6956 #define $cf_nculib_ROOT 1
6957 EOF
6958
6959                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6960
6961         else
6962
6963 cf_ncuhdr_root=$cf_cv_screen
6964
6965 test -n "$cf_cv_curses_dir" && \
6966 test "$cf_cv_curses_dir" != "no" && { \
6967
6968 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6969   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6970   do
6971         while test $cf_add_incdir != /usr/include
6972         do
6973           if test -d $cf_add_incdir
6974           then
6975                 cf_have_incdir=no
6976                 if test -n "$CFLAGS$CPPFLAGS" ; then
6977                   # a loop is needed to ensure we can add subdirs of existing dirs
6978                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6979                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6980                           cf_have_incdir=yes; break
6981                         fi
6982                   done
6983                 fi
6984
6985                 if test "$cf_have_incdir" = no ; then
6986                   if test "$cf_add_incdir" = /usr/local/include ; then
6987                         if test "$GCC" = yes
6988                         then
6989                           cf_save_CPPFLAGS=$CPPFLAGS
6990                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6991                           cat >conftest.$ac_ext <<_ACEOF
6992 #line 6992 "configure"
6993 #include "confdefs.h"
6994 #include <stdio.h>
6995 int
6996 main ()
6997 {
6998 printf("Hello")
6999   ;
7000   return 0;
7001 }
7002 _ACEOF
7003 rm -f conftest.$ac_objext
7004 if { (eval echo "$as_me:7004: \"$ac_compile\"") >&5
7005   (eval $ac_compile) 2>&5
7006   ac_status=$?
7007   echo "$as_me:7007: \$? = $ac_status" >&5
7008   (exit $ac_status); } &&
7009          { ac_try='test -s conftest.$ac_objext'
7010   { (eval echo "$as_me:7010: \"$ac_try\"") >&5
7011   (eval $ac_try) 2>&5
7012   ac_status=$?
7013   echo "$as_me:7013: \$? = $ac_status" >&5
7014   (exit $ac_status); }; }; then
7015   :
7016 else
7017   echo "$as_me: failed program was:" >&5
7018 cat conftest.$ac_ext >&5
7019 cf_have_incdir=yes
7020 fi
7021 rm -f conftest.$ac_objext conftest.$ac_ext
7022                           CPPFLAGS=$cf_save_CPPFLAGS
7023                         fi
7024                   fi
7025                 fi
7026
7027                 if test "$cf_have_incdir" = no ; then
7028                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7029
7030 echo "${as_me:-configure}:7030: testing adding $cf_add_incdir to include-path ..." 1>&5
7031
7032                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7033
7034                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7035                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7036                   cf_add_incdir="$cf_top_incdir"
7037                 else
7038                   break
7039                 fi
7040           else
7041                 break
7042           fi
7043         done
7044   done
7045 fi
7046
7047 }
7048
7049 echo "$as_me:7049: checking for $cf_ncuhdr_root header in include-path" >&5
7050 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7051 if test "${cf_cv_ncurses_h+set}" = set; then
7052   echo $ECHO_N "(cached) $ECHO_C" >&6
7053 else
7054
7055         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7056         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7057         for cf_header in $cf_header_list
7058         do
7059
7060         cat >conftest.$ac_ext <<_ACEOF
7061 #line 7061 "configure"
7062 #include "confdefs.h"
7063
7064 #include <$cf_header>
7065 int
7066 main ()
7067 {
7068
7069 #ifdef NCURSES_VERSION
7070
7071 printf("%s\n", NCURSES_VERSION);
7072 #else
7073 #ifdef __NCURSES_H
7074 printf("old\n");
7075 #else
7076         make an error
7077 #endif
7078 #endif
7079
7080   ;
7081   return 0;
7082 }
7083 _ACEOF
7084 rm -f conftest.$ac_objext
7085 if { (eval echo "$as_me:7085: \"$ac_compile\"") >&5
7086   (eval $ac_compile) 2>&5
7087   ac_status=$?
7088   echo "$as_me:7088: \$? = $ac_status" >&5
7089   (exit $ac_status); } &&
7090          { ac_try='test -s conftest.$ac_objext'
7091   { (eval echo "$as_me:7091: \"$ac_try\"") >&5
7092   (eval $ac_try) 2>&5
7093   ac_status=$?
7094   echo "$as_me:7094: \$? = $ac_status" >&5
7095   (exit $ac_status); }; }; then
7096   cf_cv_ncurses_h=$cf_header
7097
7098 else
7099   echo "$as_me: failed program was:" >&5
7100 cat conftest.$ac_ext >&5
7101 cf_cv_ncurses_h=no
7102 fi
7103 rm -f conftest.$ac_objext conftest.$ac_ext
7104
7105                 test "$cf_cv_ncurses_h" != no && break
7106         done
7107
7108 fi
7109 echo "$as_me:7109: result: $cf_cv_ncurses_h" >&5
7110 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7111
7112 if test "$cf_cv_ncurses_h" != no ; then
7113         cf_cv_ncurses_header=$cf_cv_ncurses_h
7114 else
7115
7116 echo "$as_me:7116: checking for $cf_ncuhdr_root include-path" >&5
7117 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7118 if test "${cf_cv_ncurses_h2+set}" = set; then
7119   echo $ECHO_N "(cached) $ECHO_C" >&6
7120 else
7121
7122         test -n "$verbose" && echo
7123
7124 cf_search=
7125
7126 # collect the current set of include-directories from compiler flags
7127 cf_header_path_list=""
7128 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7129         for cf_header_path in $CPPFLAGS $CFLAGS
7130         do
7131                 case $cf_header_path in
7132                 (-I*)
7133                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7134
7135 test "x$cf_header_path" != "xNONE" && \
7136 test -d "$cf_header_path" && \
7137  {
7138         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7139         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7140         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7141         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7142         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7143         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"
7144 }
7145
7146                         cf_header_path_list="$cf_header_path_list $cf_search"
7147                         ;;
7148                 esac
7149         done
7150 fi
7151
7152 # add the variations for the package we are looking for
7153
7154 cf_search=
7155
7156 test "x$prefix" != "xNONE" && \
7157 test -d "$prefix" && \
7158  {
7159         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7160         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7161         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7162         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7163         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7164         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7165 }
7166
7167 for cf_subdir_prefix in \
7168         /usr \
7169         /usr/local \
7170         /usr/pkg \
7171         /opt \
7172         /opt/local \
7173         $HOME
7174 do
7175
7176 test "x$cf_subdir_prefix" != "x$prefix" && \
7177 test -d "$cf_subdir_prefix" && \
7178 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7179         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7180         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7181         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7182         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7183         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7184         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"
7185 }
7186
7187 done
7188
7189 test "$includedir" != NONE && \
7190 test "$includedir" != "/usr/include" && \
7191 test -d "$includedir" && {
7192         test -d $includedir &&    cf_search="$cf_search $includedir"
7193         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7194 }
7195
7196 test "$oldincludedir" != NONE && \
7197 test "$oldincludedir" != "/usr/include" && \
7198 test -d "$oldincludedir" && {
7199         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7200         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7201 }
7202
7203 cf_search="$cf_search $cf_header_path_list"
7204
7205         test -n "$verbose" && echo search path $cf_search
7206         cf_save2_CPPFLAGS="$CPPFLAGS"
7207         for cf_incdir in $cf_search
7208         do
7209
7210 if test -n "$cf_incdir" ; then
7211   for cf_add_incdir in $cf_incdir
7212   do
7213         while test $cf_add_incdir != /usr/include
7214         do
7215           if test -d $cf_add_incdir
7216           then
7217                 cf_have_incdir=no
7218                 if test -n "$CFLAGS$CPPFLAGS" ; then
7219                   # a loop is needed to ensure we can add subdirs of existing dirs
7220                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7221                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7222                           cf_have_incdir=yes; break
7223                         fi
7224                   done
7225                 fi
7226
7227                 if test "$cf_have_incdir" = no ; then
7228                   if test "$cf_add_incdir" = /usr/local/include ; then
7229                         if test "$GCC" = yes
7230                         then
7231                           cf_save_CPPFLAGS=$CPPFLAGS
7232                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7233                           cat >conftest.$ac_ext <<_ACEOF
7234 #line 7234 "configure"
7235 #include "confdefs.h"
7236 #include <stdio.h>
7237 int
7238 main ()
7239 {
7240 printf("Hello")
7241   ;
7242   return 0;
7243 }
7244 _ACEOF
7245 rm -f conftest.$ac_objext
7246 if { (eval echo "$as_me:7246: \"$ac_compile\"") >&5
7247   (eval $ac_compile) 2>&5
7248   ac_status=$?
7249   echo "$as_me:7249: \$? = $ac_status" >&5
7250   (exit $ac_status); } &&
7251          { ac_try='test -s conftest.$ac_objext'
7252   { (eval echo "$as_me:7252: \"$ac_try\"") >&5
7253   (eval $ac_try) 2>&5
7254   ac_status=$?
7255   echo "$as_me:7255: \$? = $ac_status" >&5
7256   (exit $ac_status); }; }; then
7257   :
7258 else
7259   echo "$as_me: failed program was:" >&5
7260 cat conftest.$ac_ext >&5
7261 cf_have_incdir=yes
7262 fi
7263 rm -f conftest.$ac_objext conftest.$ac_ext
7264                           CPPFLAGS=$cf_save_CPPFLAGS
7265                         fi
7266                   fi
7267                 fi
7268
7269                 if test "$cf_have_incdir" = no ; then
7270                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7271
7272 echo "${as_me:-configure}:7272: testing adding $cf_add_incdir to include-path ..." 1>&5
7273
7274                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7275
7276                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7277                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7278                   cf_add_incdir="$cf_top_incdir"
7279                 else
7280                   break
7281                 fi
7282           else
7283                 break
7284           fi
7285         done
7286   done
7287 fi
7288
7289                 for cf_header in \
7290                         ncurses.h \
7291                         curses.h
7292                 do
7293
7294         cat >conftest.$ac_ext <<_ACEOF
7295 #line 7295 "configure"
7296 #include "confdefs.h"
7297
7298 #include <$cf_header>
7299 int
7300 main ()
7301 {
7302
7303 #ifdef NCURSES_VERSION
7304
7305 printf("%s\n", NCURSES_VERSION);
7306 #else
7307 #ifdef __NCURSES_H
7308 printf("old\n");
7309 #else
7310         make an error
7311 #endif
7312 #endif
7313
7314   ;
7315   return 0;
7316 }
7317 _ACEOF
7318 rm -f conftest.$ac_objext
7319 if { (eval echo "$as_me:7319: \"$ac_compile\"") >&5
7320   (eval $ac_compile) 2>&5
7321   ac_status=$?
7322   echo "$as_me:7322: \$? = $ac_status" >&5
7323   (exit $ac_status); } &&
7324          { ac_try='test -s conftest.$ac_objext'
7325   { (eval echo "$as_me:7325: \"$ac_try\"") >&5
7326   (eval $ac_try) 2>&5
7327   ac_status=$?
7328   echo "$as_me:7328: \$? = $ac_status" >&5
7329   (exit $ac_status); }; }; then
7330   cf_cv_ncurses_h2=$cf_header
7331
7332 else
7333   echo "$as_me: failed program was:" >&5
7334 cat conftest.$ac_ext >&5
7335 cf_cv_ncurses_h2=no
7336 fi
7337 rm -f conftest.$ac_objext conftest.$ac_ext
7338
7339                         if test "$cf_cv_ncurses_h2" != no ; then
7340                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7341                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7342                                 break
7343                         fi
7344                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7345                 done
7346                 CPPFLAGS="$cf_save2_CPPFLAGS"
7347                 test "$cf_cv_ncurses_h2" != no && break
7348         done
7349         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7349: error: not found" >&5
7350 echo "$as_me: error: not found" >&2;}
7351    { (exit 1); exit 1; }; }
7352
7353 fi
7354 echo "$as_me:7354: result: $cf_cv_ncurses_h2" >&5
7355 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7356
7357         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7358         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7359         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7360                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7361         fi
7362
7363 if test -n "$cf_1st_incdir" ; then
7364   for cf_add_incdir in $cf_1st_incdir
7365   do
7366         while test $cf_add_incdir != /usr/include
7367         do
7368           if test -d $cf_add_incdir
7369           then
7370                 cf_have_incdir=no
7371                 if test -n "$CFLAGS$CPPFLAGS" ; then
7372                   # a loop is needed to ensure we can add subdirs of existing dirs
7373                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7374                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7375                           cf_have_incdir=yes; break
7376                         fi
7377                   done
7378                 fi
7379
7380                 if test "$cf_have_incdir" = no ; then
7381                   if test "$cf_add_incdir" = /usr/local/include ; then
7382                         if test "$GCC" = yes
7383                         then
7384                           cf_save_CPPFLAGS=$CPPFLAGS
7385                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7386                           cat >conftest.$ac_ext <<_ACEOF
7387 #line 7387 "configure"
7388 #include "confdefs.h"
7389 #include <stdio.h>
7390 int
7391 main ()
7392 {
7393 printf("Hello")
7394   ;
7395   return 0;
7396 }
7397 _ACEOF
7398 rm -f conftest.$ac_objext
7399 if { (eval echo "$as_me:7399: \"$ac_compile\"") >&5
7400   (eval $ac_compile) 2>&5
7401   ac_status=$?
7402   echo "$as_me:7402: \$? = $ac_status" >&5
7403   (exit $ac_status); } &&
7404          { ac_try='test -s conftest.$ac_objext'
7405   { (eval echo "$as_me:7405: \"$ac_try\"") >&5
7406   (eval $ac_try) 2>&5
7407   ac_status=$?
7408   echo "$as_me:7408: \$? = $ac_status" >&5
7409   (exit $ac_status); }; }; then
7410   :
7411 else
7412   echo "$as_me: failed program was:" >&5
7413 cat conftest.$ac_ext >&5
7414 cf_have_incdir=yes
7415 fi
7416 rm -f conftest.$ac_objext conftest.$ac_ext
7417                           CPPFLAGS=$cf_save_CPPFLAGS
7418                         fi
7419                   fi
7420                 fi
7421
7422                 if test "$cf_have_incdir" = no ; then
7423                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7424
7425 echo "${as_me:-configure}:7425: testing adding $cf_add_incdir to include-path ..." 1>&5
7426
7427                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7428
7429                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7430                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7431                   cf_add_incdir="$cf_top_incdir"
7432                 else
7433                   break
7434                 fi
7435           else
7436                 break
7437           fi
7438         done
7439   done
7440 fi
7441
7442 fi
7443
7444 # Set definitions to allow ifdef'ing for ncurses.h
7445
7446 case $cf_cv_ncurses_header in
7447 (*ncurses.h)
7448
7449 cat >>confdefs.h <<\EOF
7450 #define HAVE_NCURSES_H 1
7451 EOF
7452
7453         ;;
7454 esac
7455
7456 case $cf_cv_ncurses_header in
7457 (ncurses/curses.h|ncurses/ncurses.h)
7458
7459 cat >>confdefs.h <<\EOF
7460 #define HAVE_NCURSES_NCURSES_H 1
7461 EOF
7462
7463         ;;
7464 (ncursesw/curses.h|ncursesw/ncurses.h)
7465
7466 cat >>confdefs.h <<\EOF
7467 #define HAVE_NCURSESW_NCURSES_H 1
7468 EOF
7469
7470         ;;
7471 esac
7472
7473 echo "$as_me:7473: checking for terminfo header" >&5
7474 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7475 if test "${cf_cv_term_header+set}" = set; then
7476   echo $ECHO_N "(cached) $ECHO_C" >&6
7477 else
7478
7479 case ${cf_cv_ncurses_header} in
7480 (*/ncurses.h|*/ncursesw.h)
7481         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7482         ;;
7483 (*)
7484         cf_term_header=term.h
7485         ;;
7486 esac
7487
7488 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7489 do
7490 cat >conftest.$ac_ext <<_ACEOF
7491 #line 7491 "configure"
7492 #include "confdefs.h"
7493 #include <stdio.h>
7494 #include <${cf_cv_ncurses_header:-curses.h}>
7495 #include <$cf_test>
7496
7497 int
7498 main ()
7499 {
7500 int x = auto_left_margin
7501   ;
7502   return 0;
7503 }
7504 _ACEOF
7505 rm -f conftest.$ac_objext
7506 if { (eval echo "$as_me:7506: \"$ac_compile\"") >&5
7507   (eval $ac_compile) 2>&5
7508   ac_status=$?
7509   echo "$as_me:7509: \$? = $ac_status" >&5
7510   (exit $ac_status); } &&
7511          { ac_try='test -s conftest.$ac_objext'
7512   { (eval echo "$as_me:7512: \"$ac_try\"") >&5
7513   (eval $ac_try) 2>&5
7514   ac_status=$?
7515   echo "$as_me:7515: \$? = $ac_status" >&5
7516   (exit $ac_status); }; }; then
7517
7518         cf_cv_term_header="$cf_test"
7519 else
7520   echo "$as_me: failed program was:" >&5
7521 cat conftest.$ac_ext >&5
7522
7523         cf_cv_term_header=unknown
7524
7525 fi
7526 rm -f conftest.$ac_objext conftest.$ac_ext
7527         test "$cf_cv_term_header" != unknown && break
7528 done
7529
7530 fi
7531 echo "$as_me:7531: result: $cf_cv_term_header" >&5
7532 echo "${ECHO_T}$cf_cv_term_header" >&6
7533
7534 # Set definitions to allow ifdef'ing to accommodate subdirectories
7535
7536 case $cf_cv_term_header in
7537 (*term.h)
7538
7539 cat >>confdefs.h <<\EOF
7540 #define HAVE_TERM_H 1
7541 EOF
7542
7543         ;;
7544 esac
7545
7546 case $cf_cv_term_header in
7547 (ncurses/term.h)
7548
7549 cat >>confdefs.h <<\EOF
7550 #define HAVE_NCURSES_TERM_H 1
7551 EOF
7552
7553         ;;
7554 (ncursesw/term.h)
7555
7556 cat >>confdefs.h <<\EOF
7557 #define HAVE_NCURSESW_TERM_H 1
7558 EOF
7559
7560         ;;
7561 esac
7562
7563 # some applications need this, but should check for NCURSES_VERSION
7564
7565 cat >>confdefs.h <<\EOF
7566 #define NCURSES 1
7567 EOF
7568
7569 echo "$as_me:7569: checking for ncurses version" >&5
7570 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7571 if test "${cf_cv_ncurses_version+set}" = set; then
7572   echo $ECHO_N "(cached) $ECHO_C" >&6
7573 else
7574
7575         cf_cv_ncurses_version=no
7576         cf_tempfile=out$$
7577         rm -f $cf_tempfile
7578         if test "$cross_compiling" = yes; then
7579
7580         # This will not work if the preprocessor splits the line after the
7581         # Autoconf token.  The 'unproto' program does that.
7582         cat > conftest.$ac_ext <<EOF
7583 #include <${cf_cv_ncurses_header:-curses.h}>
7584 #undef Autoconf
7585 #ifdef NCURSES_VERSION
7586 Autoconf NCURSES_VERSION
7587 #else
7588 #ifdef __NCURSES_H
7589 Autoconf "old"
7590 #endif
7591 ;
7592 #endif
7593 EOF
7594         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7595         { (eval echo "$as_me:7595: \"$cf_try\"") >&5
7596   (eval $cf_try) 2>&5
7597   ac_status=$?
7598   echo "$as_me:7598: \$? = $ac_status" >&5
7599   (exit $ac_status); }
7600         if test -f conftest.out ; then
7601                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7602                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7603                 rm -f conftest.out
7604         fi
7605
7606 else
7607   cat >conftest.$ac_ext <<_ACEOF
7608 #line 7608 "configure"
7609 #include "confdefs.h"
7610
7611 #include <${cf_cv_ncurses_header:-curses.h}>
7612 #include <stdio.h>
7613 int main()
7614 {
7615         FILE *fp = fopen("$cf_tempfile", "w");
7616 #ifdef NCURSES_VERSION
7617 # ifdef NCURSES_VERSION_PATCH
7618         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7619 # else
7620         fprintf(fp, "%s\n", NCURSES_VERSION);
7621 # endif
7622 #else
7623 # ifdef __NCURSES_H
7624         fprintf(fp, "old\n");
7625 # else
7626         make an error
7627 # endif
7628 #endif
7629         ${cf_cv_main_return:-return}(0);
7630 }
7631 _ACEOF
7632 rm -f conftest$ac_exeext
7633 if { (eval echo "$as_me:7633: \"$ac_link\"") >&5
7634   (eval $ac_link) 2>&5
7635   ac_status=$?
7636   echo "$as_me:7636: \$? = $ac_status" >&5
7637   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7638   { (eval echo "$as_me:7638: \"$ac_try\"") >&5
7639   (eval $ac_try) 2>&5
7640   ac_status=$?
7641   echo "$as_me:7641: \$? = $ac_status" >&5
7642   (exit $ac_status); }; }; then
7643
7644         cf_cv_ncurses_version=`cat $cf_tempfile`
7645 else
7646   echo "$as_me: program exited with status $ac_status" >&5
7647 echo "$as_me: failed program was:" >&5
7648 cat conftest.$ac_ext >&5
7649 fi
7650 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7651 fi
7652         rm -f $cf_tempfile
7653
7654 fi
7655 echo "$as_me:7655: result: $cf_cv_ncurses_version" >&5
7656 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7657 test "$cf_cv_ncurses_version" = no ||
7658 cat >>confdefs.h <<\EOF
7659 #define NCURSES 1
7660 EOF
7661
7662 cf_nculib_root=$cf_cv_screen
7663         # This works, except for the special case where we find gpm, but
7664         # ncurses is in a nonstandard location via $LIBS, and we really want
7665         # to link gpm.
7666 cf_ncurses_LIBS=""
7667 cf_ncurses_SAVE="$LIBS"
7668 echo "$as_me:7668: checking for Gpm_Open in -lgpm" >&5
7669 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7670 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7671   echo $ECHO_N "(cached) $ECHO_C" >&6
7672 else
7673   ac_check_lib_save_LIBS=$LIBS
7674 LIBS="-lgpm  $LIBS"
7675 cat >conftest.$ac_ext <<_ACEOF
7676 #line 7676 "configure"
7677 #include "confdefs.h"
7678
7679 /* Override any gcc2 internal prototype to avoid an error.  */
7680 #ifdef __cplusplus
7681 extern "C"
7682 #endif
7683 /* We use char because int might match the return type of a gcc2
7684    builtin and then its argument prototype would still apply.  */
7685 char Gpm_Open ();
7686 int
7687 main ()
7688 {
7689 Gpm_Open ();
7690   ;
7691   return 0;
7692 }
7693 _ACEOF
7694 rm -f conftest.$ac_objext conftest$ac_exeext
7695 if { (eval echo "$as_me:7695: \"$ac_link\"") >&5
7696   (eval $ac_link) 2>&5
7697   ac_status=$?
7698   echo "$as_me:7698: \$? = $ac_status" >&5
7699   (exit $ac_status); } &&
7700          { ac_try='test -s conftest$ac_exeext'
7701   { (eval echo "$as_me:7701: \"$ac_try\"") >&5
7702   (eval $ac_try) 2>&5
7703   ac_status=$?
7704   echo "$as_me:7704: \$? = $ac_status" >&5
7705   (exit $ac_status); }; }; then
7706   ac_cv_lib_gpm_Gpm_Open=yes
7707 else
7708   echo "$as_me: failed program was:" >&5
7709 cat conftest.$ac_ext >&5
7710 ac_cv_lib_gpm_Gpm_Open=no
7711 fi
7712 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7713 LIBS=$ac_check_lib_save_LIBS
7714 fi
7715 echo "$as_me:7715: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7716 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7717 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7718   echo "$as_me:7718: checking for initscr in -lgpm" >&5
7719 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7720 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7721   echo $ECHO_N "(cached) $ECHO_C" >&6
7722 else
7723   ac_check_lib_save_LIBS=$LIBS
7724 LIBS="-lgpm  $LIBS"
7725 cat >conftest.$ac_ext <<_ACEOF
7726 #line 7726 "configure"
7727 #include "confdefs.h"
7728
7729 /* Override any gcc2 internal prototype to avoid an error.  */
7730 #ifdef __cplusplus
7731 extern "C"
7732 #endif
7733 /* We use char because int might match the return type of a gcc2
7734    builtin and then its argument prototype would still apply.  */
7735 char initscr ();
7736 int
7737 main ()
7738 {
7739 initscr ();
7740   ;
7741   return 0;
7742 }
7743 _ACEOF
7744 rm -f conftest.$ac_objext conftest$ac_exeext
7745 if { (eval echo "$as_me:7745: \"$ac_link\"") >&5
7746   (eval $ac_link) 2>&5
7747   ac_status=$?
7748   echo "$as_me:7748: \$? = $ac_status" >&5
7749   (exit $ac_status); } &&
7750          { ac_try='test -s conftest$ac_exeext'
7751   { (eval echo "$as_me:7751: \"$ac_try\"") >&5
7752   (eval $ac_try) 2>&5
7753   ac_status=$?
7754   echo "$as_me:7754: \$? = $ac_status" >&5
7755   (exit $ac_status); }; }; then
7756   ac_cv_lib_gpm_initscr=yes
7757 else
7758   echo "$as_me: failed program was:" >&5
7759 cat conftest.$ac_ext >&5
7760 ac_cv_lib_gpm_initscr=no
7761 fi
7762 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7763 LIBS=$ac_check_lib_save_LIBS
7764 fi
7765 echo "$as_me:7765: result: $ac_cv_lib_gpm_initscr" >&5
7766 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7767 if test $ac_cv_lib_gpm_initscr = yes; then
7768   LIBS="$cf_ncurses_SAVE"
7769 else
7770   cf_ncurses_LIBS="-lgpm"
7771 fi
7772
7773 fi
7774
7775 case $host_os in
7776 (freebsd*)
7777         # This is only necessary if you are linking against an obsolete
7778         # version of ncurses (but it should do no harm, since it's static).
7779         if test "$cf_nculib_root" = ncurses ; then
7780                 echo "$as_me:7780: checking for tgoto in -lmytinfo" >&5
7781 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7782 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7783   echo $ECHO_N "(cached) $ECHO_C" >&6
7784 else
7785   ac_check_lib_save_LIBS=$LIBS
7786 LIBS="-lmytinfo  $LIBS"
7787 cat >conftest.$ac_ext <<_ACEOF
7788 #line 7788 "configure"
7789 #include "confdefs.h"
7790
7791 /* Override any gcc2 internal prototype to avoid an error.  */
7792 #ifdef __cplusplus
7793 extern "C"
7794 #endif
7795 /* We use char because int might match the return type of a gcc2
7796    builtin and then its argument prototype would still apply.  */
7797 char tgoto ();
7798 int
7799 main ()
7800 {
7801 tgoto ();
7802   ;
7803   return 0;
7804 }
7805 _ACEOF
7806 rm -f conftest.$ac_objext conftest$ac_exeext
7807 if { (eval echo "$as_me:7807: \"$ac_link\"") >&5
7808   (eval $ac_link) 2>&5
7809   ac_status=$?
7810   echo "$as_me:7810: \$? = $ac_status" >&5
7811   (exit $ac_status); } &&
7812          { ac_try='test -s conftest$ac_exeext'
7813   { (eval echo "$as_me:7813: \"$ac_try\"") >&5
7814   (eval $ac_try) 2>&5
7815   ac_status=$?
7816   echo "$as_me:7816: \$? = $ac_status" >&5
7817   (exit $ac_status); }; }; then
7818   ac_cv_lib_mytinfo_tgoto=yes
7819 else
7820   echo "$as_me: failed program was:" >&5
7821 cat conftest.$ac_ext >&5
7822 ac_cv_lib_mytinfo_tgoto=no
7823 fi
7824 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7825 LIBS=$ac_check_lib_save_LIBS
7826 fi
7827 echo "$as_me:7827: result: $ac_cv_lib_mytinfo_tgoto" >&5
7828 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7829 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7830   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7831 fi
7832
7833         fi
7834         ;;
7835 esac
7836
7837 cf_add_libs="$cf_ncurses_LIBS"
7838 # Filter out duplicates - this happens with badly-designed ".pc" files...
7839 for cf_add_1lib in $LIBS
7840 do
7841         for cf_add_2lib in $cf_add_libs
7842         do
7843                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7844                 then
7845                         cf_add_1lib=
7846                         break
7847                 fi
7848         done
7849         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7850 done
7851 LIBS="$cf_add_libs"
7852
7853 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7854 then
7855
7856 cf_add_libs="-l$cf_nculib_root"
7857 # Filter out duplicates - this happens with badly-designed ".pc" files...
7858 for cf_add_1lib in $LIBS
7859 do
7860         for cf_add_2lib in $cf_add_libs
7861         do
7862                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7863                 then
7864                         cf_add_1lib=
7865                         break
7866                 fi
7867         done
7868         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7869 done
7870 LIBS="$cf_add_libs"
7871
7872 else
7873
7874         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7875         cf_libdir=""
7876         echo "$as_me:7876: checking for initscr" >&5
7877 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7878 if test "${ac_cv_func_initscr+set}" = set; then
7879   echo $ECHO_N "(cached) $ECHO_C" >&6
7880 else
7881   cat >conftest.$ac_ext <<_ACEOF
7882 #line 7882 "configure"
7883 #include "confdefs.h"
7884 /* System header to define __stub macros and hopefully few prototypes,
7885     which can conflict with char initscr (); below.  */
7886 #include <assert.h>
7887 /* Override any gcc2 internal prototype to avoid an error.  */
7888 #ifdef __cplusplus
7889 extern "C"
7890 #endif
7891 /* We use char because int might match the return type of a gcc2
7892    builtin and then its argument prototype would still apply.  */
7893 char initscr ();
7894 char (*f) ();
7895
7896 int
7897 main ()
7898 {
7899 /* The GNU C library defines this for functions which it implements
7900     to always fail with ENOSYS.  Some functions are actually named
7901     something starting with __ and the normal name is an alias.  */
7902 #if defined (__stub_initscr) || defined (__stub___initscr)
7903 choke me
7904 #else
7905 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7906 #endif
7907
7908   ;
7909   return 0;
7910 }
7911 _ACEOF
7912 rm -f conftest.$ac_objext conftest$ac_exeext
7913 if { (eval echo "$as_me:7913: \"$ac_link\"") >&5
7914   (eval $ac_link) 2>&5
7915   ac_status=$?
7916   echo "$as_me:7916: \$? = $ac_status" >&5
7917   (exit $ac_status); } &&
7918          { ac_try='test -s conftest$ac_exeext'
7919   { (eval echo "$as_me:7919: \"$ac_try\"") >&5
7920   (eval $ac_try) 2>&5
7921   ac_status=$?
7922   echo "$as_me:7922: \$? = $ac_status" >&5
7923   (exit $ac_status); }; }; then
7924   ac_cv_func_initscr=yes
7925 else
7926   echo "$as_me: failed program was:" >&5
7927 cat conftest.$ac_ext >&5
7928 ac_cv_func_initscr=no
7929 fi
7930 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7931 fi
7932 echo "$as_me:7932: result: $ac_cv_func_initscr" >&5
7933 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7934 if test $ac_cv_func_initscr = yes; then
7935   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7936 else
7937
7938                 cf_save_LIBS="$LIBS"
7939                 echo "$as_me:7939: checking for initscr in -l$cf_nculib_root" >&5
7940 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7941                 LIBS="-l$cf_nculib_root $LIBS"
7942                 cat >conftest.$ac_ext <<_ACEOF
7943 #line 7943 "configure"
7944 #include "confdefs.h"
7945 #include <${cf_cv_ncurses_header:-curses.h}>
7946 int
7947 main ()
7948 {
7949 initscr()
7950   ;
7951   return 0;
7952 }
7953 _ACEOF
7954 rm -f conftest.$ac_objext conftest$ac_exeext
7955 if { (eval echo "$as_me:7955: \"$ac_link\"") >&5
7956   (eval $ac_link) 2>&5
7957   ac_status=$?
7958   echo "$as_me:7958: \$? = $ac_status" >&5
7959   (exit $ac_status); } &&
7960          { ac_try='test -s conftest$ac_exeext'
7961   { (eval echo "$as_me:7961: \"$ac_try\"") >&5
7962   (eval $ac_try) 2>&5
7963   ac_status=$?
7964   echo "$as_me:7964: \$? = $ac_status" >&5
7965   (exit $ac_status); }; }; then
7966   echo "$as_me:7966: result: yes" >&5
7967 echo "${ECHO_T}yes" >&6
7968                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7969
7970 else
7971   echo "$as_me: failed program was:" >&5
7972 cat conftest.$ac_ext >&5
7973 echo "$as_me:7973: result: no" >&5
7974 echo "${ECHO_T}no" >&6
7975
7976 cf_search=
7977 cf_library_path_list=""
7978 if test -n "${LDFLAGS}${LIBS}" ; then
7979         for cf_library_path in $LDFLAGS $LIBS
7980         do
7981                 case $cf_library_path in
7982                 (-L*)
7983                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7984
7985 test "x$cf_library_path" != "xNONE" && \
7986 test -d "$cf_library_path" && \
7987  {
7988         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7989         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7990         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7991         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7992         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7993         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"
7994 }
7995
7996                         cf_library_path_list="$cf_library_path_list $cf_search"
7997                         ;;
7998                 esac
7999         done
8000 fi
8001
8002 cf_search=
8003
8004 test "x$prefix" != "xNONE" && \
8005 test -d "$prefix" && \
8006  {
8007         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8008         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8009         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8010         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8011         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8012         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8013 }
8014
8015 for cf_subdir_prefix in \
8016         /usr \
8017         /usr/local \
8018         /usr/pkg \
8019         /opt \
8020         /opt/local \
8021         $HOME
8022 do
8023
8024 test "x$cf_subdir_prefix" != "x$prefix" && \
8025 test -d "$cf_subdir_prefix" && \
8026 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8027         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8028         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8029         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8030         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8031         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8032         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"
8033 }
8034
8035 done
8036
8037 cf_search="$cf_library_path_list $cf_search"
8038
8039                         for cf_libdir in $cf_search
8040                         do
8041                                 echo "$as_me:8041: checking for -l$cf_nculib_root in $cf_libdir" >&5
8042 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8043                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8044                                 cat >conftest.$ac_ext <<_ACEOF
8045 #line 8045 "configure"
8046 #include "confdefs.h"
8047 #include <${cf_cv_ncurses_header:-curses.h}>
8048 int
8049 main ()
8050 {
8051 initscr()
8052   ;
8053   return 0;
8054 }
8055 _ACEOF
8056 rm -f conftest.$ac_objext conftest$ac_exeext
8057 if { (eval echo "$as_me:8057: \"$ac_link\"") >&5
8058   (eval $ac_link) 2>&5
8059   ac_status=$?
8060   echo "$as_me:8060: \$? = $ac_status" >&5
8061   (exit $ac_status); } &&
8062          { ac_try='test -s conftest$ac_exeext'
8063   { (eval echo "$as_me:8063: \"$ac_try\"") >&5
8064   (eval $ac_try) 2>&5
8065   ac_status=$?
8066   echo "$as_me:8066: \$? = $ac_status" >&5
8067   (exit $ac_status); }; }; then
8068   echo "$as_me:8068: result: yes" >&5
8069 echo "${ECHO_T}yes" >&6
8070                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8071                                          break
8072 else
8073   echo "$as_me: failed program was:" >&5
8074 cat conftest.$ac_ext >&5
8075 echo "$as_me:8075: result: no" >&5
8076 echo "${ECHO_T}no" >&6
8077                                          LIBS="$cf_save_LIBS"
8078 fi
8079 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8080                         done
8081
8082 fi
8083 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8084
8085 fi
8086
8087 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8088
8089 if test $cf_found_library = no ; then
8090         { { echo "$as_me:8090: error: Cannot link $cf_nculib_root library" >&5
8091 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8092    { (exit 1); exit 1; }; }
8093 fi
8094
8095 fi
8096
8097 if test -n "$cf_ncurses_LIBS" ; then
8098         echo "$as_me:8098: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8099 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8100         cf_ncurses_SAVE="$LIBS"
8101         for p in $cf_ncurses_LIBS ; do
8102                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8103                 if test "$q" != "$LIBS" ; then
8104                         LIBS="$q"
8105                 fi
8106         done
8107         cat >conftest.$ac_ext <<_ACEOF
8108 #line 8108 "configure"
8109 #include "confdefs.h"
8110 #include <${cf_cv_ncurses_header:-curses.h}>
8111 int
8112 main ()
8113 {
8114 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8115   ;
8116   return 0;
8117 }
8118 _ACEOF
8119 rm -f conftest.$ac_objext conftest$ac_exeext
8120 if { (eval echo "$as_me:8120: \"$ac_link\"") >&5
8121   (eval $ac_link) 2>&5
8122   ac_status=$?
8123   echo "$as_me:8123: \$? = $ac_status" >&5
8124   (exit $ac_status); } &&
8125          { ac_try='test -s conftest$ac_exeext'
8126   { (eval echo "$as_me:8126: \"$ac_try\"") >&5
8127   (eval $ac_try) 2>&5
8128   ac_status=$?
8129   echo "$as_me:8129: \$? = $ac_status" >&5
8130   (exit $ac_status); }; }; then
8131   echo "$as_me:8131: result: yes" >&5
8132 echo "${ECHO_T}yes" >&6
8133 else
8134   echo "$as_me: failed program was:" >&5
8135 cat conftest.$ac_ext >&5
8136 echo "$as_me:8136: result: no" >&5
8137 echo "${ECHO_T}no" >&6
8138                  LIBS="$cf_ncurses_SAVE"
8139 fi
8140 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8141 fi
8142
8143 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8144
8145 cat >>confdefs.h <<EOF
8146 #define $cf_nculib_ROOT 1
8147 EOF
8148
8149         fi
8150 else
8151         NCURSES_CONFIG=none
8152 fi
8153
8154         ;;
8155 (ncurses*)
8156
8157 cf_ncuconfig_root=$cf_cv_screen
8158 cf_have_ncuconfig=no
8159
8160 if test "x${PKG_CONFIG:=none}" != xnone; then
8161         echo "$as_me:8161: checking pkg-config for $cf_ncuconfig_root" >&5
8162 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8163         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8164                 echo "$as_me:8164: result: yes" >&5
8165 echo "${ECHO_T}yes" >&6
8166
8167                 echo "$as_me:8167: checking if the $cf_ncuconfig_root package files work" >&5
8168 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8169                 cf_have_ncuconfig=unknown
8170
8171                 cf_save_CPPFLAGS="$CPPFLAGS"
8172                 cf_save_LIBS="$LIBS"
8173
8174                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8175
8176 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8177 # Filter out duplicates - this happens with badly-designed ".pc" files...
8178 for cf_add_1lib in $LIBS
8179 do
8180         for cf_add_2lib in $cf_add_libs
8181         do
8182                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8183                 then
8184                         cf_add_1lib=
8185                         break
8186                 fi
8187         done
8188         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8189 done
8190 LIBS="$cf_add_libs"
8191
8192                 cat >conftest.$ac_ext <<_ACEOF
8193 #line 8193 "configure"
8194 #include "confdefs.h"
8195 #include <${cf_cv_ncurses_header:-curses.h}>
8196 int
8197 main ()
8198 {
8199 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8200   ;
8201   return 0;
8202 }
8203 _ACEOF
8204 rm -f conftest.$ac_objext conftest$ac_exeext
8205 if { (eval echo "$as_me:8205: \"$ac_link\"") >&5
8206   (eval $ac_link) 2>&5
8207   ac_status=$?
8208   echo "$as_me:8208: \$? = $ac_status" >&5
8209   (exit $ac_status); } &&
8210          { ac_try='test -s conftest$ac_exeext'
8211   { (eval echo "$as_me:8211: \"$ac_try\"") >&5
8212   (eval $ac_try) 2>&5
8213   ac_status=$?
8214   echo "$as_me:8214: \$? = $ac_status" >&5
8215   (exit $ac_status); }; }; then
8216   if test "$cross_compiling" = yes; then
8217   cf_have_ncuconfig=maybe
8218 else
8219   cat >conftest.$ac_ext <<_ACEOF
8220 #line 8220 "configure"
8221 #include "confdefs.h"
8222 #include <${cf_cv_ncurses_header:-curses.h}>
8223                                 int main(void)
8224                                 { char *xx = curses_version(); return (xx == 0); }
8225 _ACEOF
8226 rm -f conftest$ac_exeext
8227 if { (eval echo "$as_me:8227: \"$ac_link\"") >&5
8228   (eval $ac_link) 2>&5
8229   ac_status=$?
8230   echo "$as_me:8230: \$? = $ac_status" >&5
8231   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8232   { (eval echo "$as_me:8232: \"$ac_try\"") >&5
8233   (eval $ac_try) 2>&5
8234   ac_status=$?
8235   echo "$as_me:8235: \$? = $ac_status" >&5
8236   (exit $ac_status); }; }; then
8237   cf_have_ncuconfig=yes
8238 else
8239   echo "$as_me: program exited with status $ac_status" >&5
8240 echo "$as_me: failed program was:" >&5
8241 cat conftest.$ac_ext >&5
8242 cf_have_ncuconfig=no
8243 fi
8244 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8245 fi
8246 else
8247   echo "$as_me: failed program was:" >&5
8248 cat conftest.$ac_ext >&5
8249 cf_have_ncuconfig=no
8250 fi
8251 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8252                 echo "$as_me:8252: result: $cf_have_ncuconfig" >&5
8253 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8254                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8255                 if test "$cf_have_ncuconfig" != "yes"
8256                 then
8257                         CPPFLAGS="$cf_save_CPPFLAGS"
8258                         LIBS="$cf_save_LIBS"
8259                         NCURSES_CONFIG_PKG=none
8260                 else
8261
8262 cat >>confdefs.h <<\EOF
8263 #define NCURSES 1
8264 EOF
8265
8266                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8267                 fi
8268
8269         else
8270                 echo "$as_me:8270: result: no" >&5
8271 echo "${ECHO_T}no" >&6
8272                 NCURSES_CONFIG_PKG=none
8273         fi
8274 else
8275         NCURSES_CONFIG_PKG=none
8276 fi
8277
8278 if test "x$cf_have_ncuconfig" = "xno"; then
8279         echo "Looking for ${cf_ncuconfig_root}-config"
8280
8281 if test -n "$ac_tool_prefix"; then
8282   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8283   do
8284     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8285 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8286 echo "$as_me:8286: checking for $ac_word" >&5
8287 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8288 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8289   echo $ECHO_N "(cached) $ECHO_C" >&6
8290 else
8291   if test -n "$NCURSES_CONFIG"; then
8292   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8293 else
8294   ac_save_IFS=$IFS; IFS=$ac_path_separator
8295 ac_dummy="$PATH"
8296 for ac_dir in $ac_dummy; do
8297   IFS=$ac_save_IFS
8298   test -z "$ac_dir" && ac_dir=.
8299   $as_executable_p "$ac_dir/$ac_word" || continue
8300 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8301 echo "$as_me:8301: found $ac_dir/$ac_word" >&5
8302 break
8303 done
8304
8305 fi
8306 fi
8307 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8308 if test -n "$NCURSES_CONFIG"; then
8309   echo "$as_me:8309: result: $NCURSES_CONFIG" >&5
8310 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8311 else
8312   echo "$as_me:8312: result: no" >&5
8313 echo "${ECHO_T}no" >&6
8314 fi
8315
8316     test -n "$NCURSES_CONFIG" && break
8317   done
8318 fi
8319 if test -z "$NCURSES_CONFIG"; then
8320   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8321   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8322 do
8323   # Extract the first word of "$ac_prog", so it can be a program name with args.
8324 set dummy $ac_prog; ac_word=$2
8325 echo "$as_me:8325: checking for $ac_word" >&5
8326 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8327 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8328   echo $ECHO_N "(cached) $ECHO_C" >&6
8329 else
8330   if test -n "$ac_ct_NCURSES_CONFIG"; then
8331   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8332 else
8333   ac_save_IFS=$IFS; IFS=$ac_path_separator
8334 ac_dummy="$PATH"
8335 for ac_dir in $ac_dummy; do
8336   IFS=$ac_save_IFS
8337   test -z "$ac_dir" && ac_dir=.
8338   $as_executable_p "$ac_dir/$ac_word" || continue
8339 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8340 echo "$as_me:8340: found $ac_dir/$ac_word" >&5
8341 break
8342 done
8343
8344 fi
8345 fi
8346 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8347 if test -n "$ac_ct_NCURSES_CONFIG"; then
8348   echo "$as_me:8348: result: $ac_ct_NCURSES_CONFIG" >&5
8349 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8350 else
8351   echo "$as_me:8351: result: no" >&5
8352 echo "${ECHO_T}no" >&6
8353 fi
8354
8355   test -n "$ac_ct_NCURSES_CONFIG" && break
8356 done
8357 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8358
8359   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8360 fi
8361
8362         if test "$NCURSES_CONFIG" != none ; then
8363
8364                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8365
8366 cf_add_libs="`$NCURSES_CONFIG --libs`"
8367 # Filter out duplicates - this happens with badly-designed ".pc" files...
8368 for cf_add_1lib in $LIBS
8369 do
8370         for cf_add_2lib in $cf_add_libs
8371         do
8372                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8373                 then
8374                         cf_add_1lib=
8375                         break
8376                 fi
8377         done
8378         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8379 done
8380 LIBS="$cf_add_libs"
8381
8382                 # even with config script, some packages use no-override for curses.h
8383
8384 echo "$as_me:8384: checking if we have identified curses headers" >&5
8385 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8386 if test "${cf_cv_ncurses_header+set}" = set; then
8387   echo $ECHO_N "(cached) $ECHO_C" >&6
8388 else
8389
8390 cf_cv_ncurses_header=none
8391 for cf_header in \
8392         ncurses.h $cf_cv_screen/ncurses.h \
8393         curses.h $cf_cv_screen/curses.h
8394 do
8395 cat >conftest.$ac_ext <<_ACEOF
8396 #line 8396 "configure"
8397 #include "confdefs.h"
8398 #include <${cf_header}>
8399 int
8400 main ()
8401 {
8402 initscr(); tgoto("?", 0,0)
8403   ;
8404   return 0;
8405 }
8406 _ACEOF
8407 rm -f conftest.$ac_objext
8408 if { (eval echo "$as_me:8408: \"$ac_compile\"") >&5
8409   (eval $ac_compile) 2>&5
8410   ac_status=$?
8411   echo "$as_me:8411: \$? = $ac_status" >&5
8412   (exit $ac_status); } &&
8413          { ac_try='test -s conftest.$ac_objext'
8414   { (eval echo "$as_me:8414: \"$ac_try\"") >&5
8415   (eval $ac_try) 2>&5
8416   ac_status=$?
8417   echo "$as_me:8417: \$? = $ac_status" >&5
8418   (exit $ac_status); }; }; then
8419   cf_cv_ncurses_header=$cf_header; break
8420 else
8421   echo "$as_me: failed program was:" >&5
8422 cat conftest.$ac_ext >&5
8423 fi
8424 rm -f conftest.$ac_objext conftest.$ac_ext
8425 done
8426
8427 fi
8428 echo "$as_me:8428: result: $cf_cv_ncurses_header" >&5
8429 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8430
8431 if test "$cf_cv_ncurses_header" = none ; then
8432         { { echo "$as_me:8432: error: No curses header-files found" >&5
8433 echo "$as_me: error: No curses header-files found" >&2;}
8434    { (exit 1); exit 1; }; }
8435 fi
8436
8437 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8438
8439 for ac_header in $cf_cv_ncurses_header
8440 do
8441 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8442 echo "$as_me:8442: checking for $ac_header" >&5
8443 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8444 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8445   echo $ECHO_N "(cached) $ECHO_C" >&6
8446 else
8447   cat >conftest.$ac_ext <<_ACEOF
8448 #line 8448 "configure"
8449 #include "confdefs.h"
8450 #include <$ac_header>
8451 _ACEOF
8452 if { (eval echo "$as_me:8452: \"$ac_cpp conftest.$ac_ext\"") >&5
8453   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8454   ac_status=$?
8455   egrep -v '^ *\+' conftest.er1 >conftest.err
8456   rm -f conftest.er1
8457   cat conftest.err >&5
8458   echo "$as_me:8458: \$? = $ac_status" >&5
8459   (exit $ac_status); } >/dev/null; then
8460   if test -s conftest.err; then
8461     ac_cpp_err=$ac_c_preproc_warn_flag
8462   else
8463     ac_cpp_err=
8464   fi
8465 else
8466   ac_cpp_err=yes
8467 fi
8468 if test -z "$ac_cpp_err"; then
8469   eval "$as_ac_Header=yes"
8470 else
8471   echo "$as_me: failed program was:" >&5
8472   cat conftest.$ac_ext >&5
8473   eval "$as_ac_Header=no"
8474 fi
8475 rm -f conftest.err conftest.$ac_ext
8476 fi
8477 echo "$as_me:8477: result: `eval echo '${'$as_ac_Header'}'`" >&5
8478 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8479 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8480   cat >>confdefs.h <<EOF
8481 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8482 EOF
8483
8484 fi
8485 done
8486
8487 cat >>confdefs.h <<\EOF
8488 #define NCURSES 1
8489 EOF
8490
8491 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8492
8493                 cat >>confdefs.h <<EOF
8494 #define $cf_nculib_ROOT 1
8495 EOF
8496
8497                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8498
8499         else
8500
8501 cf_ncuhdr_root=$cf_cv_screen
8502
8503 test -n "$cf_cv_curses_dir" && \
8504 test "$cf_cv_curses_dir" != "no" && { \
8505
8506 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8507   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8508   do
8509         while test $cf_add_incdir != /usr/include
8510         do
8511           if test -d $cf_add_incdir
8512           then
8513                 cf_have_incdir=no
8514                 if test -n "$CFLAGS$CPPFLAGS" ; then
8515                   # a loop is needed to ensure we can add subdirs of existing dirs
8516                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8517                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8518                           cf_have_incdir=yes; break
8519                         fi
8520                   done
8521                 fi
8522
8523                 if test "$cf_have_incdir" = no ; then
8524                   if test "$cf_add_incdir" = /usr/local/include ; then
8525                         if test "$GCC" = yes
8526                         then
8527                           cf_save_CPPFLAGS=$CPPFLAGS
8528                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8529                           cat >conftest.$ac_ext <<_ACEOF
8530 #line 8530 "configure"
8531 #include "confdefs.h"
8532 #include <stdio.h>
8533 int
8534 main ()
8535 {
8536 printf("Hello")
8537   ;
8538   return 0;
8539 }
8540 _ACEOF
8541 rm -f conftest.$ac_objext
8542 if { (eval echo "$as_me:8542: \"$ac_compile\"") >&5
8543   (eval $ac_compile) 2>&5
8544   ac_status=$?
8545   echo "$as_me:8545: \$? = $ac_status" >&5
8546   (exit $ac_status); } &&
8547          { ac_try='test -s conftest.$ac_objext'
8548   { (eval echo "$as_me:8548: \"$ac_try\"") >&5
8549   (eval $ac_try) 2>&5
8550   ac_status=$?
8551   echo "$as_me:8551: \$? = $ac_status" >&5
8552   (exit $ac_status); }; }; then
8553   :
8554 else
8555   echo "$as_me: failed program was:" >&5
8556 cat conftest.$ac_ext >&5
8557 cf_have_incdir=yes
8558 fi
8559 rm -f conftest.$ac_objext conftest.$ac_ext
8560                           CPPFLAGS=$cf_save_CPPFLAGS
8561                         fi
8562                   fi
8563                 fi
8564
8565                 if test "$cf_have_incdir" = no ; then
8566                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8567
8568 echo "${as_me:-configure}:8568: testing adding $cf_add_incdir to include-path ..." 1>&5
8569
8570                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8571
8572                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8573                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8574                   cf_add_incdir="$cf_top_incdir"
8575                 else
8576                   break
8577                 fi
8578           else
8579                 break
8580           fi
8581         done
8582   done
8583 fi
8584
8585 }
8586
8587 echo "$as_me:8587: checking for $cf_ncuhdr_root header in include-path" >&5
8588 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8589 if test "${cf_cv_ncurses_h+set}" = set; then
8590   echo $ECHO_N "(cached) $ECHO_C" >&6
8591 else
8592
8593         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8594         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8595         for cf_header in $cf_header_list
8596         do
8597
8598         cat >conftest.$ac_ext <<_ACEOF
8599 #line 8599 "configure"
8600 #include "confdefs.h"
8601
8602 #include <$cf_header>
8603 int
8604 main ()
8605 {
8606
8607 #ifdef NCURSES_VERSION
8608
8609 printf("%s\n", NCURSES_VERSION);
8610 #else
8611 #ifdef __NCURSES_H
8612 printf("old\n");
8613 #else
8614         make an error
8615 #endif
8616 #endif
8617
8618   ;
8619   return 0;
8620 }
8621 _ACEOF
8622 rm -f conftest.$ac_objext
8623 if { (eval echo "$as_me:8623: \"$ac_compile\"") >&5
8624   (eval $ac_compile) 2>&5
8625   ac_status=$?
8626   echo "$as_me:8626: \$? = $ac_status" >&5
8627   (exit $ac_status); } &&
8628          { ac_try='test -s conftest.$ac_objext'
8629   { (eval echo "$as_me:8629: \"$ac_try\"") >&5
8630   (eval $ac_try) 2>&5
8631   ac_status=$?
8632   echo "$as_me:8632: \$? = $ac_status" >&5
8633   (exit $ac_status); }; }; then
8634   cf_cv_ncurses_h=$cf_header
8635
8636 else
8637   echo "$as_me: failed program was:" >&5
8638 cat conftest.$ac_ext >&5
8639 cf_cv_ncurses_h=no
8640 fi
8641 rm -f conftest.$ac_objext conftest.$ac_ext
8642
8643                 test "$cf_cv_ncurses_h" != no && break
8644         done
8645
8646 fi
8647 echo "$as_me:8647: result: $cf_cv_ncurses_h" >&5
8648 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8649
8650 if test "$cf_cv_ncurses_h" != no ; then
8651         cf_cv_ncurses_header=$cf_cv_ncurses_h
8652 else
8653
8654 echo "$as_me:8654: checking for $cf_ncuhdr_root include-path" >&5
8655 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8656 if test "${cf_cv_ncurses_h2+set}" = set; then
8657   echo $ECHO_N "(cached) $ECHO_C" >&6
8658 else
8659
8660         test -n "$verbose" && echo
8661
8662 cf_search=
8663
8664 # collect the current set of include-directories from compiler flags
8665 cf_header_path_list=""
8666 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8667         for cf_header_path in $CPPFLAGS $CFLAGS
8668         do
8669                 case $cf_header_path in
8670                 (-I*)
8671                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8672
8673 test "x$cf_header_path" != "xNONE" && \
8674 test -d "$cf_header_path" && \
8675  {
8676         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8677         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8678         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8679         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8680         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8681         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"
8682 }
8683
8684                         cf_header_path_list="$cf_header_path_list $cf_search"
8685                         ;;
8686                 esac
8687         done
8688 fi
8689
8690 # add the variations for the package we are looking for
8691
8692 cf_search=
8693
8694 test "x$prefix" != "xNONE" && \
8695 test -d "$prefix" && \
8696  {
8697         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8698         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8699         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8700         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8701         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8702         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8703 }
8704
8705 for cf_subdir_prefix in \
8706         /usr \
8707         /usr/local \
8708         /usr/pkg \
8709         /opt \
8710         /opt/local \
8711         $HOME
8712 do
8713
8714 test "x$cf_subdir_prefix" != "x$prefix" && \
8715 test -d "$cf_subdir_prefix" && \
8716 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8717         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8718         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8719         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8720         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8721         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8722         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"
8723 }
8724
8725 done
8726
8727 test "$includedir" != NONE && \
8728 test "$includedir" != "/usr/include" && \
8729 test -d "$includedir" && {
8730         test -d $includedir &&    cf_search="$cf_search $includedir"
8731         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8732 }
8733
8734 test "$oldincludedir" != NONE && \
8735 test "$oldincludedir" != "/usr/include" && \
8736 test -d "$oldincludedir" && {
8737         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8738         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8739 }
8740
8741 cf_search="$cf_search $cf_header_path_list"
8742
8743         test -n "$verbose" && echo search path $cf_search
8744         cf_save2_CPPFLAGS="$CPPFLAGS"
8745         for cf_incdir in $cf_search
8746         do
8747
8748 if test -n "$cf_incdir" ; then
8749   for cf_add_incdir in $cf_incdir
8750   do
8751         while test $cf_add_incdir != /usr/include
8752         do
8753           if test -d $cf_add_incdir
8754           then
8755                 cf_have_incdir=no
8756                 if test -n "$CFLAGS$CPPFLAGS" ; then
8757                   # a loop is needed to ensure we can add subdirs of existing dirs
8758                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8759                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8760                           cf_have_incdir=yes; break
8761                         fi
8762                   done
8763                 fi
8764
8765                 if test "$cf_have_incdir" = no ; then
8766                   if test "$cf_add_incdir" = /usr/local/include ; then
8767                         if test "$GCC" = yes
8768                         then
8769                           cf_save_CPPFLAGS=$CPPFLAGS
8770                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8771                           cat >conftest.$ac_ext <<_ACEOF
8772 #line 8772 "configure"
8773 #include "confdefs.h"
8774 #include <stdio.h>
8775 int
8776 main ()
8777 {
8778 printf("Hello")
8779   ;
8780   return 0;
8781 }
8782 _ACEOF
8783 rm -f conftest.$ac_objext
8784 if { (eval echo "$as_me:8784: \"$ac_compile\"") >&5
8785   (eval $ac_compile) 2>&5
8786   ac_status=$?
8787   echo "$as_me:8787: \$? = $ac_status" >&5
8788   (exit $ac_status); } &&
8789          { ac_try='test -s conftest.$ac_objext'
8790   { (eval echo "$as_me:8790: \"$ac_try\"") >&5
8791   (eval $ac_try) 2>&5
8792   ac_status=$?
8793   echo "$as_me:8793: \$? = $ac_status" >&5
8794   (exit $ac_status); }; }; then
8795   :
8796 else
8797   echo "$as_me: failed program was:" >&5
8798 cat conftest.$ac_ext >&5
8799 cf_have_incdir=yes
8800 fi
8801 rm -f conftest.$ac_objext conftest.$ac_ext
8802                           CPPFLAGS=$cf_save_CPPFLAGS
8803                         fi
8804                   fi
8805                 fi
8806
8807                 if test "$cf_have_incdir" = no ; then
8808                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8809
8810 echo "${as_me:-configure}:8810: testing adding $cf_add_incdir to include-path ..." 1>&5
8811
8812                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8813
8814                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8815                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8816                   cf_add_incdir="$cf_top_incdir"
8817                 else
8818                   break
8819                 fi
8820           else
8821                 break
8822           fi
8823         done
8824   done
8825 fi
8826
8827                 for cf_header in \
8828                         ncurses.h \
8829                         curses.h
8830                 do
8831
8832         cat >conftest.$ac_ext <<_ACEOF
8833 #line 8833 "configure"
8834 #include "confdefs.h"
8835
8836 #include <$cf_header>
8837 int
8838 main ()
8839 {
8840
8841 #ifdef NCURSES_VERSION
8842
8843 printf("%s\n", NCURSES_VERSION);
8844 #else
8845 #ifdef __NCURSES_H
8846 printf("old\n");
8847 #else
8848         make an error
8849 #endif
8850 #endif
8851
8852   ;
8853   return 0;
8854 }
8855 _ACEOF
8856 rm -f conftest.$ac_objext
8857 if { (eval echo "$as_me:8857: \"$ac_compile\"") >&5
8858   (eval $ac_compile) 2>&5
8859   ac_status=$?
8860   echo "$as_me:8860: \$? = $ac_status" >&5
8861   (exit $ac_status); } &&
8862          { ac_try='test -s conftest.$ac_objext'
8863   { (eval echo "$as_me:8863: \"$ac_try\"") >&5
8864   (eval $ac_try) 2>&5
8865   ac_status=$?
8866   echo "$as_me:8866: \$? = $ac_status" >&5
8867   (exit $ac_status); }; }; then
8868   cf_cv_ncurses_h2=$cf_header
8869
8870 else
8871   echo "$as_me: failed program was:" >&5
8872 cat conftest.$ac_ext >&5
8873 cf_cv_ncurses_h2=no
8874 fi
8875 rm -f conftest.$ac_objext conftest.$ac_ext
8876
8877                         if test "$cf_cv_ncurses_h2" != no ; then
8878                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8879                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8880                                 break
8881                         fi
8882                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8883                 done
8884                 CPPFLAGS="$cf_save2_CPPFLAGS"
8885                 test "$cf_cv_ncurses_h2" != no && break
8886         done
8887         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8887: error: not found" >&5
8888 echo "$as_me: error: not found" >&2;}
8889    { (exit 1); exit 1; }; }
8890
8891 fi
8892 echo "$as_me:8892: result: $cf_cv_ncurses_h2" >&5
8893 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8894
8895         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8896         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8897         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8898                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8899         fi
8900
8901 if test -n "$cf_1st_incdir" ; then
8902   for cf_add_incdir in $cf_1st_incdir
8903   do
8904         while test $cf_add_incdir != /usr/include
8905         do
8906           if test -d $cf_add_incdir
8907           then
8908                 cf_have_incdir=no
8909                 if test -n "$CFLAGS$CPPFLAGS" ; then
8910                   # a loop is needed to ensure we can add subdirs of existing dirs
8911                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8912                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8913                           cf_have_incdir=yes; break
8914                         fi
8915                   done
8916                 fi
8917
8918                 if test "$cf_have_incdir" = no ; then
8919                   if test "$cf_add_incdir" = /usr/local/include ; then
8920                         if test "$GCC" = yes
8921                         then
8922                           cf_save_CPPFLAGS=$CPPFLAGS
8923                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8924                           cat >conftest.$ac_ext <<_ACEOF
8925 #line 8925 "configure"
8926 #include "confdefs.h"
8927 #include <stdio.h>
8928 int
8929 main ()
8930 {
8931 printf("Hello")
8932   ;
8933   return 0;
8934 }
8935 _ACEOF
8936 rm -f conftest.$ac_objext
8937 if { (eval echo "$as_me:8937: \"$ac_compile\"") >&5
8938   (eval $ac_compile) 2>&5
8939   ac_status=$?
8940   echo "$as_me:8940: \$? = $ac_status" >&5
8941   (exit $ac_status); } &&
8942          { ac_try='test -s conftest.$ac_objext'
8943   { (eval echo "$as_me:8943: \"$ac_try\"") >&5
8944   (eval $ac_try) 2>&5
8945   ac_status=$?
8946   echo "$as_me:8946: \$? = $ac_status" >&5
8947   (exit $ac_status); }; }; then
8948   :
8949 else
8950   echo "$as_me: failed program was:" >&5
8951 cat conftest.$ac_ext >&5
8952 cf_have_incdir=yes
8953 fi
8954 rm -f conftest.$ac_objext conftest.$ac_ext
8955                           CPPFLAGS=$cf_save_CPPFLAGS
8956                         fi
8957                   fi
8958                 fi
8959
8960                 if test "$cf_have_incdir" = no ; then
8961                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8962
8963 echo "${as_me:-configure}:8963: testing adding $cf_add_incdir to include-path ..." 1>&5
8964
8965                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8966
8967                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8968                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8969                   cf_add_incdir="$cf_top_incdir"
8970                 else
8971                   break
8972                 fi
8973           else
8974                 break
8975           fi
8976         done
8977   done
8978 fi
8979
8980 fi
8981
8982 # Set definitions to allow ifdef'ing for ncurses.h
8983
8984 case $cf_cv_ncurses_header in
8985 (*ncurses.h)
8986
8987 cat >>confdefs.h <<\EOF
8988 #define HAVE_NCURSES_H 1
8989 EOF
8990
8991         ;;
8992 esac
8993
8994 case $cf_cv_ncurses_header in
8995 (ncurses/curses.h|ncurses/ncurses.h)
8996
8997 cat >>confdefs.h <<\EOF
8998 #define HAVE_NCURSES_NCURSES_H 1
8999 EOF
9000
9001         ;;
9002 (ncursesw/curses.h|ncursesw/ncurses.h)
9003
9004 cat >>confdefs.h <<\EOF
9005 #define HAVE_NCURSESW_NCURSES_H 1
9006 EOF
9007
9008         ;;
9009 esac
9010
9011 echo "$as_me:9011: checking for terminfo header" >&5
9012 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9013 if test "${cf_cv_term_header+set}" = set; then
9014   echo $ECHO_N "(cached) $ECHO_C" >&6
9015 else
9016
9017 case ${cf_cv_ncurses_header} in
9018 (*/ncurses.h|*/ncursesw.h)
9019         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9020         ;;
9021 (*)
9022         cf_term_header=term.h
9023         ;;
9024 esac
9025
9026 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9027 do
9028 cat >conftest.$ac_ext <<_ACEOF
9029 #line 9029 "configure"
9030 #include "confdefs.h"
9031 #include <stdio.h>
9032 #include <${cf_cv_ncurses_header:-curses.h}>
9033 #include <$cf_test>
9034
9035 int
9036 main ()
9037 {
9038 int x = auto_left_margin
9039   ;
9040   return 0;
9041 }
9042 _ACEOF
9043 rm -f conftest.$ac_objext
9044 if { (eval echo "$as_me:9044: \"$ac_compile\"") >&5
9045   (eval $ac_compile) 2>&5
9046   ac_status=$?
9047   echo "$as_me:9047: \$? = $ac_status" >&5
9048   (exit $ac_status); } &&
9049          { ac_try='test -s conftest.$ac_objext'
9050   { (eval echo "$as_me:9050: \"$ac_try\"") >&5
9051   (eval $ac_try) 2>&5
9052   ac_status=$?
9053   echo "$as_me:9053: \$? = $ac_status" >&5
9054   (exit $ac_status); }; }; then
9055
9056         cf_cv_term_header="$cf_test"
9057 else
9058   echo "$as_me: failed program was:" >&5
9059 cat conftest.$ac_ext >&5
9060
9061         cf_cv_term_header=unknown
9062
9063 fi
9064 rm -f conftest.$ac_objext conftest.$ac_ext
9065         test "$cf_cv_term_header" != unknown && break
9066 done
9067
9068 fi
9069 echo "$as_me:9069: result: $cf_cv_term_header" >&5
9070 echo "${ECHO_T}$cf_cv_term_header" >&6
9071
9072 # Set definitions to allow ifdef'ing to accommodate subdirectories
9073
9074 case $cf_cv_term_header in
9075 (*term.h)
9076
9077 cat >>confdefs.h <<\EOF
9078 #define HAVE_TERM_H 1
9079 EOF
9080
9081         ;;
9082 esac
9083
9084 case $cf_cv_term_header in
9085 (ncurses/term.h)
9086
9087 cat >>confdefs.h <<\EOF
9088 #define HAVE_NCURSES_TERM_H 1
9089 EOF
9090
9091         ;;
9092 (ncursesw/term.h)
9093
9094 cat >>confdefs.h <<\EOF
9095 #define HAVE_NCURSESW_TERM_H 1
9096 EOF
9097
9098         ;;
9099 esac
9100
9101 # some applications need this, but should check for NCURSES_VERSION
9102
9103 cat >>confdefs.h <<\EOF
9104 #define NCURSES 1
9105 EOF
9106
9107 echo "$as_me:9107: checking for ncurses version" >&5
9108 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9109 if test "${cf_cv_ncurses_version+set}" = set; then
9110   echo $ECHO_N "(cached) $ECHO_C" >&6
9111 else
9112
9113         cf_cv_ncurses_version=no
9114         cf_tempfile=out$$
9115         rm -f $cf_tempfile
9116         if test "$cross_compiling" = yes; then
9117
9118         # This will not work if the preprocessor splits the line after the
9119         # Autoconf token.  The 'unproto' program does that.
9120         cat > conftest.$ac_ext <<EOF
9121 #include <${cf_cv_ncurses_header:-curses.h}>
9122 #undef Autoconf
9123 #ifdef NCURSES_VERSION
9124 Autoconf NCURSES_VERSION
9125 #else
9126 #ifdef __NCURSES_H
9127 Autoconf "old"
9128 #endif
9129 ;
9130 #endif
9131 EOF
9132         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9133         { (eval echo "$as_me:9133: \"$cf_try\"") >&5
9134   (eval $cf_try) 2>&5
9135   ac_status=$?
9136   echo "$as_me:9136: \$? = $ac_status" >&5
9137   (exit $ac_status); }
9138         if test -f conftest.out ; then
9139                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9140                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9141                 rm -f conftest.out
9142         fi
9143
9144 else
9145   cat >conftest.$ac_ext <<_ACEOF
9146 #line 9146 "configure"
9147 #include "confdefs.h"
9148
9149 #include <${cf_cv_ncurses_header:-curses.h}>
9150 #include <stdio.h>
9151 int main()
9152 {
9153         FILE *fp = fopen("$cf_tempfile", "w");
9154 #ifdef NCURSES_VERSION
9155 # ifdef NCURSES_VERSION_PATCH
9156         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9157 # else
9158         fprintf(fp, "%s\n", NCURSES_VERSION);
9159 # endif
9160 #else
9161 # ifdef __NCURSES_H
9162         fprintf(fp, "old\n");
9163 # else
9164         make an error
9165 # endif
9166 #endif
9167         ${cf_cv_main_return:-return}(0);
9168 }
9169 _ACEOF
9170 rm -f conftest$ac_exeext
9171 if { (eval echo "$as_me:9171: \"$ac_link\"") >&5
9172   (eval $ac_link) 2>&5
9173   ac_status=$?
9174   echo "$as_me:9174: \$? = $ac_status" >&5
9175   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9176   { (eval echo "$as_me:9176: \"$ac_try\"") >&5
9177   (eval $ac_try) 2>&5
9178   ac_status=$?
9179   echo "$as_me:9179: \$? = $ac_status" >&5
9180   (exit $ac_status); }; }; then
9181
9182         cf_cv_ncurses_version=`cat $cf_tempfile`
9183 else
9184   echo "$as_me: program exited with status $ac_status" >&5
9185 echo "$as_me: failed program was:" >&5
9186 cat conftest.$ac_ext >&5
9187 fi
9188 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9189 fi
9190         rm -f $cf_tempfile
9191
9192 fi
9193 echo "$as_me:9193: result: $cf_cv_ncurses_version" >&5
9194 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9195 test "$cf_cv_ncurses_version" = no ||
9196 cat >>confdefs.h <<\EOF
9197 #define NCURSES 1
9198 EOF
9199
9200 cf_nculib_root=$cf_cv_screen
9201         # This works, except for the special case where we find gpm, but
9202         # ncurses is in a nonstandard location via $LIBS, and we really want
9203         # to link gpm.
9204 cf_ncurses_LIBS=""
9205 cf_ncurses_SAVE="$LIBS"
9206 echo "$as_me:9206: checking for Gpm_Open in -lgpm" >&5
9207 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9208 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9209   echo $ECHO_N "(cached) $ECHO_C" >&6
9210 else
9211   ac_check_lib_save_LIBS=$LIBS
9212 LIBS="-lgpm  $LIBS"
9213 cat >conftest.$ac_ext <<_ACEOF
9214 #line 9214 "configure"
9215 #include "confdefs.h"
9216
9217 /* Override any gcc2 internal prototype to avoid an error.  */
9218 #ifdef __cplusplus
9219 extern "C"
9220 #endif
9221 /* We use char because int might match the return type of a gcc2
9222    builtin and then its argument prototype would still apply.  */
9223 char Gpm_Open ();
9224 int
9225 main ()
9226 {
9227 Gpm_Open ();
9228   ;
9229   return 0;
9230 }
9231 _ACEOF
9232 rm -f conftest.$ac_objext conftest$ac_exeext
9233 if { (eval echo "$as_me:9233: \"$ac_link\"") >&5
9234   (eval $ac_link) 2>&5
9235   ac_status=$?
9236   echo "$as_me:9236: \$? = $ac_status" >&5
9237   (exit $ac_status); } &&
9238          { ac_try='test -s conftest$ac_exeext'
9239   { (eval echo "$as_me:9239: \"$ac_try\"") >&5
9240   (eval $ac_try) 2>&5
9241   ac_status=$?
9242   echo "$as_me:9242: \$? = $ac_status" >&5
9243   (exit $ac_status); }; }; then
9244   ac_cv_lib_gpm_Gpm_Open=yes
9245 else
9246   echo "$as_me: failed program was:" >&5
9247 cat conftest.$ac_ext >&5
9248 ac_cv_lib_gpm_Gpm_Open=no
9249 fi
9250 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9251 LIBS=$ac_check_lib_save_LIBS
9252 fi
9253 echo "$as_me:9253: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9254 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9255 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9256   echo "$as_me:9256: checking for initscr in -lgpm" >&5
9257 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9258 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9259   echo $ECHO_N "(cached) $ECHO_C" >&6
9260 else
9261   ac_check_lib_save_LIBS=$LIBS
9262 LIBS="-lgpm  $LIBS"
9263 cat >conftest.$ac_ext <<_ACEOF
9264 #line 9264 "configure"
9265 #include "confdefs.h"
9266
9267 /* Override any gcc2 internal prototype to avoid an error.  */
9268 #ifdef __cplusplus
9269 extern "C"
9270 #endif
9271 /* We use char because int might match the return type of a gcc2
9272    builtin and then its argument prototype would still apply.  */
9273 char initscr ();
9274 int
9275 main ()
9276 {
9277 initscr ();
9278   ;
9279   return 0;
9280 }
9281 _ACEOF
9282 rm -f conftest.$ac_objext conftest$ac_exeext
9283 if { (eval echo "$as_me:9283: \"$ac_link\"") >&5
9284   (eval $ac_link) 2>&5
9285   ac_status=$?
9286   echo "$as_me:9286: \$? = $ac_status" >&5
9287   (exit $ac_status); } &&
9288          { ac_try='test -s conftest$ac_exeext'
9289   { (eval echo "$as_me:9289: \"$ac_try\"") >&5
9290   (eval $ac_try) 2>&5
9291   ac_status=$?
9292   echo "$as_me:9292: \$? = $ac_status" >&5
9293   (exit $ac_status); }; }; then
9294   ac_cv_lib_gpm_initscr=yes
9295 else
9296   echo "$as_me: failed program was:" >&5
9297 cat conftest.$ac_ext >&5
9298 ac_cv_lib_gpm_initscr=no
9299 fi
9300 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9301 LIBS=$ac_check_lib_save_LIBS
9302 fi
9303 echo "$as_me:9303: result: $ac_cv_lib_gpm_initscr" >&5
9304 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9305 if test $ac_cv_lib_gpm_initscr = yes; then
9306   LIBS="$cf_ncurses_SAVE"
9307 else
9308   cf_ncurses_LIBS="-lgpm"
9309 fi
9310
9311 fi
9312
9313 case $host_os in
9314 (freebsd*)
9315         # This is only necessary if you are linking against an obsolete
9316         # version of ncurses (but it should do no harm, since it's static).
9317         if test "$cf_nculib_root" = ncurses ; then
9318                 echo "$as_me:9318: checking for tgoto in -lmytinfo" >&5
9319 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9320 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9321   echo $ECHO_N "(cached) $ECHO_C" >&6
9322 else
9323   ac_check_lib_save_LIBS=$LIBS
9324 LIBS="-lmytinfo  $LIBS"
9325 cat >conftest.$ac_ext <<_ACEOF
9326 #line 9326 "configure"
9327 #include "confdefs.h"
9328
9329 /* Override any gcc2 internal prototype to avoid an error.  */
9330 #ifdef __cplusplus
9331 extern "C"
9332 #endif
9333 /* We use char because int might match the return type of a gcc2
9334    builtin and then its argument prototype would still apply.  */
9335 char tgoto ();
9336 int
9337 main ()
9338 {
9339 tgoto ();
9340   ;
9341   return 0;
9342 }
9343 _ACEOF
9344 rm -f conftest.$ac_objext conftest$ac_exeext
9345 if { (eval echo "$as_me:9345: \"$ac_link\"") >&5
9346   (eval $ac_link) 2>&5
9347   ac_status=$?
9348   echo "$as_me:9348: \$? = $ac_status" >&5
9349   (exit $ac_status); } &&
9350          { ac_try='test -s conftest$ac_exeext'
9351   { (eval echo "$as_me:9351: \"$ac_try\"") >&5
9352   (eval $ac_try) 2>&5
9353   ac_status=$?
9354   echo "$as_me:9354: \$? = $ac_status" >&5
9355   (exit $ac_status); }; }; then
9356   ac_cv_lib_mytinfo_tgoto=yes
9357 else
9358   echo "$as_me: failed program was:" >&5
9359 cat conftest.$ac_ext >&5
9360 ac_cv_lib_mytinfo_tgoto=no
9361 fi
9362 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9363 LIBS=$ac_check_lib_save_LIBS
9364 fi
9365 echo "$as_me:9365: result: $ac_cv_lib_mytinfo_tgoto" >&5
9366 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9367 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9368   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9369 fi
9370
9371         fi
9372         ;;
9373 esac
9374
9375 cf_add_libs="$cf_ncurses_LIBS"
9376 # Filter out duplicates - this happens with badly-designed ".pc" files...
9377 for cf_add_1lib in $LIBS
9378 do
9379         for cf_add_2lib in $cf_add_libs
9380         do
9381                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9382                 then
9383                         cf_add_1lib=
9384                         break
9385                 fi
9386         done
9387         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9388 done
9389 LIBS="$cf_add_libs"
9390
9391 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9392 then
9393
9394 cf_add_libs="-l$cf_nculib_root"
9395 # Filter out duplicates - this happens with badly-designed ".pc" files...
9396 for cf_add_1lib in $LIBS
9397 do
9398         for cf_add_2lib in $cf_add_libs
9399         do
9400                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9401                 then
9402                         cf_add_1lib=
9403                         break
9404                 fi
9405         done
9406         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9407 done
9408 LIBS="$cf_add_libs"
9409
9410 else
9411
9412         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9413         cf_libdir=""
9414         echo "$as_me:9414: checking for initscr" >&5
9415 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9416 if test "${ac_cv_func_initscr+set}" = set; then
9417   echo $ECHO_N "(cached) $ECHO_C" >&6
9418 else
9419   cat >conftest.$ac_ext <<_ACEOF
9420 #line 9420 "configure"
9421 #include "confdefs.h"
9422 /* System header to define __stub macros and hopefully few prototypes,
9423     which can conflict with char initscr (); below.  */
9424 #include <assert.h>
9425 /* Override any gcc2 internal prototype to avoid an error.  */
9426 #ifdef __cplusplus
9427 extern "C"
9428 #endif
9429 /* We use char because int might match the return type of a gcc2
9430    builtin and then its argument prototype would still apply.  */
9431 char initscr ();
9432 char (*f) ();
9433
9434 int
9435 main ()
9436 {
9437 /* The GNU C library defines this for functions which it implements
9438     to always fail with ENOSYS.  Some functions are actually named
9439     something starting with __ and the normal name is an alias.  */
9440 #if defined (__stub_initscr) || defined (__stub___initscr)
9441 choke me
9442 #else
9443 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9444 #endif
9445
9446   ;
9447   return 0;
9448 }
9449 _ACEOF
9450 rm -f conftest.$ac_objext conftest$ac_exeext
9451 if { (eval echo "$as_me:9451: \"$ac_link\"") >&5
9452   (eval $ac_link) 2>&5
9453   ac_status=$?
9454   echo "$as_me:9454: \$? = $ac_status" >&5
9455   (exit $ac_status); } &&
9456          { ac_try='test -s conftest$ac_exeext'
9457   { (eval echo "$as_me:9457: \"$ac_try\"") >&5
9458   (eval $ac_try) 2>&5
9459   ac_status=$?
9460   echo "$as_me:9460: \$? = $ac_status" >&5
9461   (exit $ac_status); }; }; then
9462   ac_cv_func_initscr=yes
9463 else
9464   echo "$as_me: failed program was:" >&5
9465 cat conftest.$ac_ext >&5
9466 ac_cv_func_initscr=no
9467 fi
9468 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9469 fi
9470 echo "$as_me:9470: result: $ac_cv_func_initscr" >&5
9471 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9472 if test $ac_cv_func_initscr = yes; then
9473   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9474 else
9475
9476                 cf_save_LIBS="$LIBS"
9477                 echo "$as_me:9477: checking for initscr in -l$cf_nculib_root" >&5
9478 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9479                 LIBS="-l$cf_nculib_root $LIBS"
9480                 cat >conftest.$ac_ext <<_ACEOF
9481 #line 9481 "configure"
9482 #include "confdefs.h"
9483 #include <${cf_cv_ncurses_header:-curses.h}>
9484 int
9485 main ()
9486 {
9487 initscr()
9488   ;
9489   return 0;
9490 }
9491 _ACEOF
9492 rm -f conftest.$ac_objext conftest$ac_exeext
9493 if { (eval echo "$as_me:9493: \"$ac_link\"") >&5
9494   (eval $ac_link) 2>&5
9495   ac_status=$?
9496   echo "$as_me:9496: \$? = $ac_status" >&5
9497   (exit $ac_status); } &&
9498          { ac_try='test -s conftest$ac_exeext'
9499   { (eval echo "$as_me:9499: \"$ac_try\"") >&5
9500   (eval $ac_try) 2>&5
9501   ac_status=$?
9502   echo "$as_me:9502: \$? = $ac_status" >&5
9503   (exit $ac_status); }; }; then
9504   echo "$as_me:9504: result: yes" >&5
9505 echo "${ECHO_T}yes" >&6
9506                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9507
9508 else
9509   echo "$as_me: failed program was:" >&5
9510 cat conftest.$ac_ext >&5
9511 echo "$as_me:9511: result: no" >&5
9512 echo "${ECHO_T}no" >&6
9513
9514 cf_search=
9515 cf_library_path_list=""
9516 if test -n "${LDFLAGS}${LIBS}" ; then
9517         for cf_library_path in $LDFLAGS $LIBS
9518         do
9519                 case $cf_library_path in
9520                 (-L*)
9521                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9522
9523 test "x$cf_library_path" != "xNONE" && \
9524 test -d "$cf_library_path" && \
9525  {
9526         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9527         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9528         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9529         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9530         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9531         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"
9532 }
9533
9534                         cf_library_path_list="$cf_library_path_list $cf_search"
9535                         ;;
9536                 esac
9537         done
9538 fi
9539
9540 cf_search=
9541
9542 test "x$prefix" != "xNONE" && \
9543 test -d "$prefix" && \
9544  {
9545         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9546         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9547         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9548         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9549         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9550         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9551 }
9552
9553 for cf_subdir_prefix in \
9554         /usr \
9555         /usr/local \
9556         /usr/pkg \
9557         /opt \
9558         /opt/local \
9559         $HOME
9560 do
9561
9562 test "x$cf_subdir_prefix" != "x$prefix" && \
9563 test -d "$cf_subdir_prefix" && \
9564 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9565         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9566         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9567         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9568         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9569         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9570         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"
9571 }
9572
9573 done
9574
9575 cf_search="$cf_library_path_list $cf_search"
9576
9577                         for cf_libdir in $cf_search
9578                         do
9579                                 echo "$as_me:9579: checking for -l$cf_nculib_root in $cf_libdir" >&5
9580 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9581                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9582                                 cat >conftest.$ac_ext <<_ACEOF
9583 #line 9583 "configure"
9584 #include "confdefs.h"
9585 #include <${cf_cv_ncurses_header:-curses.h}>
9586 int
9587 main ()
9588 {
9589 initscr()
9590   ;
9591   return 0;
9592 }
9593 _ACEOF
9594 rm -f conftest.$ac_objext conftest$ac_exeext
9595 if { (eval echo "$as_me:9595: \"$ac_link\"") >&5
9596   (eval $ac_link) 2>&5
9597   ac_status=$?
9598   echo "$as_me:9598: \$? = $ac_status" >&5
9599   (exit $ac_status); } &&
9600          { ac_try='test -s conftest$ac_exeext'
9601   { (eval echo "$as_me:9601: \"$ac_try\"") >&5
9602   (eval $ac_try) 2>&5
9603   ac_status=$?
9604   echo "$as_me:9604: \$? = $ac_status" >&5
9605   (exit $ac_status); }; }; then
9606   echo "$as_me:9606: result: yes" >&5
9607 echo "${ECHO_T}yes" >&6
9608                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9609                                          break
9610 else
9611   echo "$as_me: failed program was:" >&5
9612 cat conftest.$ac_ext >&5
9613 echo "$as_me:9613: result: no" >&5
9614 echo "${ECHO_T}no" >&6
9615                                          LIBS="$cf_save_LIBS"
9616 fi
9617 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9618                         done
9619
9620 fi
9621 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9622
9623 fi
9624
9625 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9626
9627 if test $cf_found_library = no ; then
9628         { { echo "$as_me:9628: error: Cannot link $cf_nculib_root library" >&5
9629 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9630    { (exit 1); exit 1; }; }
9631 fi
9632
9633 fi
9634
9635 if test -n "$cf_ncurses_LIBS" ; then
9636         echo "$as_me:9636: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9637 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9638         cf_ncurses_SAVE="$LIBS"
9639         for p in $cf_ncurses_LIBS ; do
9640                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9641                 if test "$q" != "$LIBS" ; then
9642                         LIBS="$q"
9643                 fi
9644         done
9645         cat >conftest.$ac_ext <<_ACEOF
9646 #line 9646 "configure"
9647 #include "confdefs.h"
9648 #include <${cf_cv_ncurses_header:-curses.h}>
9649 int
9650 main ()
9651 {
9652 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9653   ;
9654   return 0;
9655 }
9656 _ACEOF
9657 rm -f conftest.$ac_objext conftest$ac_exeext
9658 if { (eval echo "$as_me:9658: \"$ac_link\"") >&5
9659   (eval $ac_link) 2>&5
9660   ac_status=$?
9661   echo "$as_me:9661: \$? = $ac_status" >&5
9662   (exit $ac_status); } &&
9663          { ac_try='test -s conftest$ac_exeext'
9664   { (eval echo "$as_me:9664: \"$ac_try\"") >&5
9665   (eval $ac_try) 2>&5
9666   ac_status=$?
9667   echo "$as_me:9667: \$? = $ac_status" >&5
9668   (exit $ac_status); }; }; then
9669   echo "$as_me:9669: result: yes" >&5
9670 echo "${ECHO_T}yes" >&6
9671 else
9672   echo "$as_me: failed program was:" >&5
9673 cat conftest.$ac_ext >&5
9674 echo "$as_me:9674: result: no" >&5
9675 echo "${ECHO_T}no" >&6
9676                  LIBS="$cf_ncurses_SAVE"
9677 fi
9678 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9679 fi
9680
9681 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9682
9683 cat >>confdefs.h <<EOF
9684 #define $cf_nculib_ROOT 1
9685 EOF
9686
9687         fi
9688 else
9689         NCURSES_CONFIG=none
9690 fi
9691
9692         ;;
9693 (pdcurses)
9694         echo "$as_me:9694: checking for X" >&5
9695 echo $ECHO_N "checking for X... $ECHO_C" >&6
9696
9697 # Check whether --with-x or --without-x was given.
9698 if test "${with_x+set}" = set; then
9699   withval="$with_x"
9700
9701 fi;
9702 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9703 if test "x$with_x" = xno; then
9704   # The user explicitly disabled X.
9705   have_x=disabled
9706 else
9707   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9708     # Both variables are already set.
9709     have_x=yes
9710   else
9711     if test "${ac_cv_have_x+set}" = set; then
9712   echo $ECHO_N "(cached) $ECHO_C" >&6
9713 else
9714   # One or both of the vars are not set, and there is no cached value.
9715 ac_x_includes=no ac_x_libraries=no
9716 rm -fr conftest.dir
9717 if mkdir conftest.dir; then
9718   cd conftest.dir
9719   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9720   cat >Imakefile <<'EOF'
9721 acfindx:
9722         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9723 EOF
9724   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9725     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9726     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9727     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9728     for ac_extension in a so sl dylib dll; do
9729       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9730          test -f $ac_im_libdir/libX11.$ac_extension; then
9731         ac_im_usrlibdir=$ac_im_libdir; break
9732       fi
9733     done
9734     # Screen out bogus values from the imake configuration.  They are
9735     # bogus both because they are the default anyway, and because
9736     # using them would break gcc on systems where it needs fixed includes.
9737     case $ac_im_incroot in
9738         /usr/include) ;;
9739         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9740     esac
9741     case $ac_im_usrlibdir in
9742         /usr/lib | /lib) ;;
9743         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9744     esac
9745   fi
9746   cd ..
9747   rm -fr conftest.dir
9748 fi
9749
9750 # Standard set of common directories for X headers.
9751 # Check X11 before X11Rn because it is often a symlink to the current release.
9752 ac_x_header_dirs='
9753 /usr/X11/include
9754 /usr/X11R6/include
9755 /usr/X11R5/include
9756 /usr/X11R4/include
9757
9758 /usr/include/X11
9759 /usr/include/X11R6
9760 /usr/include/X11R5
9761 /usr/include/X11R4
9762
9763 /usr/local/X11/include
9764 /usr/local/X11R6/include
9765 /usr/local/X11R5/include
9766 /usr/local/X11R4/include
9767
9768 /usr/local/include/X11
9769 /usr/local/include/X11R6
9770 /usr/local/include/X11R5
9771 /usr/local/include/X11R4
9772
9773 /usr/X386/include
9774 /usr/x386/include
9775 /usr/XFree86/include/X11
9776
9777 /usr/include
9778 /usr/local/include
9779 /usr/unsupported/include
9780 /usr/athena/include
9781 /usr/local/x11r5/include
9782 /usr/lpp/Xamples/include
9783
9784 /usr/openwin/include
9785 /usr/openwin/share/include'
9786
9787 if test "$ac_x_includes" = no; then
9788   # Guess where to find include files, by looking for Intrinsic.h.
9789   # First, try using that file with no special directory specified.
9790   cat >conftest.$ac_ext <<_ACEOF
9791 #line 9791 "configure"
9792 #include "confdefs.h"
9793 #include <X11/Intrinsic.h>
9794 _ACEOF
9795 if { (eval echo "$as_me:9795: \"$ac_cpp conftest.$ac_ext\"") >&5
9796   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9797   ac_status=$?
9798   egrep -v '^ *\+' conftest.er1 >conftest.err
9799   rm -f conftest.er1
9800   cat conftest.err >&5
9801   echo "$as_me:9801: \$? = $ac_status" >&5
9802   (exit $ac_status); } >/dev/null; then
9803   if test -s conftest.err; then
9804     ac_cpp_err=$ac_c_preproc_warn_flag
9805   else
9806     ac_cpp_err=
9807   fi
9808 else
9809   ac_cpp_err=yes
9810 fi
9811 if test -z "$ac_cpp_err"; then
9812   # We can compile using X headers with no special include directory.
9813 ac_x_includes=
9814 else
9815   echo "$as_me: failed program was:" >&5
9816   cat conftest.$ac_ext >&5
9817   for ac_dir in $ac_x_header_dirs; do
9818   if test -r "$ac_dir/X11/Intrinsic.h"; then
9819     ac_x_includes=$ac_dir
9820     break
9821   fi
9822 done
9823 fi
9824 rm -f conftest.err conftest.$ac_ext
9825 fi # $ac_x_includes = no
9826
9827 if test "$ac_x_libraries" = no; then
9828   # Check for the libraries.
9829   # See if we find them without any special options.
9830   # Don't add to $LIBS permanently.
9831   ac_save_LIBS=$LIBS
9832   LIBS="-lXt $LIBS"
9833   cat >conftest.$ac_ext <<_ACEOF
9834 #line 9834 "configure"
9835 #include "confdefs.h"
9836 #include <X11/Intrinsic.h>
9837 int
9838 main ()
9839 {
9840 XtMalloc (0)
9841   ;
9842   return 0;
9843 }
9844 _ACEOF
9845 rm -f conftest.$ac_objext conftest$ac_exeext
9846 if { (eval echo "$as_me:9846: \"$ac_link\"") >&5
9847   (eval $ac_link) 2>&5
9848   ac_status=$?
9849   echo "$as_me:9849: \$? = $ac_status" >&5
9850   (exit $ac_status); } &&
9851          { ac_try='test -s conftest$ac_exeext'
9852   { (eval echo "$as_me:9852: \"$ac_try\"") >&5
9853   (eval $ac_try) 2>&5
9854   ac_status=$?
9855   echo "$as_me:9855: \$? = $ac_status" >&5
9856   (exit $ac_status); }; }; then
9857   LIBS=$ac_save_LIBS
9858 # We can link X programs with no special library path.
9859 ac_x_libraries=
9860 else
9861   echo "$as_me: failed program was:" >&5
9862 cat conftest.$ac_ext >&5
9863 LIBS=$ac_save_LIBS
9864 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9865 do
9866   # Don't even attempt the hair of trying to link an X program!
9867   for ac_extension in a so sl dylib dll; do
9868     if test -r $ac_dir/libXt.$ac_extension; then
9869       ac_x_libraries=$ac_dir
9870       break 2
9871     fi
9872   done
9873 done
9874 fi
9875 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9876 fi # $ac_x_libraries = no
9877
9878 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9879   # Didn't find X anywhere.  Cache the known absence of X.
9880   ac_cv_have_x="have_x=no"
9881 else
9882   # Record where we found X for the cache.
9883   ac_cv_have_x="have_x=yes \
9884                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9885 fi
9886 fi
9887
9888   fi
9889   eval "$ac_cv_have_x"
9890 fi # $with_x != no
9891
9892 if test "$have_x" != yes; then
9893   echo "$as_me:9893: result: $have_x" >&5
9894 echo "${ECHO_T}$have_x" >&6
9895   no_x=yes
9896 else
9897   # If each of the values was on the command line, it overrides each guess.
9898   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9899   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9900   # Update the cache value to reflect the command line values.
9901   ac_cv_have_x="have_x=yes \
9902                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9903   echo "$as_me:9903: result: libraries $x_libraries, headers $x_includes" >&5
9904 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9905 fi
9906
9907 if test "$no_x" = yes; then
9908   # Not all programs may use this symbol, but it does not hurt to define it.
9909
9910 cat >>confdefs.h <<\EOF
9911 #define X_DISPLAY_MISSING 1
9912 EOF
9913
9914   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9915 else
9916   if test -n "$x_includes"; then
9917     X_CFLAGS="$X_CFLAGS -I$x_includes"
9918   fi
9919
9920   # It would also be nice to do this for all -L options, not just this one.
9921   if test -n "$x_libraries"; then
9922     X_LIBS="$X_LIBS -L$x_libraries"
9923     # For Solaris; some versions of Sun CC require a space after -R and
9924     # others require no space.  Words are not sufficient . . . .
9925     case `(uname -sr) 2>/dev/null` in
9926     "SunOS 5"*)
9927       echo "$as_me:9927: checking whether -R must be followed by a space" >&5
9928 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9929       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9930       cat >conftest.$ac_ext <<_ACEOF
9931 #line 9931 "configure"
9932 #include "confdefs.h"
9933
9934 int
9935 main ()
9936 {
9937
9938   ;
9939   return 0;
9940 }
9941 _ACEOF
9942 rm -f conftest.$ac_objext conftest$ac_exeext
9943 if { (eval echo "$as_me:9943: \"$ac_link\"") >&5
9944   (eval $ac_link) 2>&5
9945   ac_status=$?
9946   echo "$as_me:9946: \$? = $ac_status" >&5
9947   (exit $ac_status); } &&
9948          { ac_try='test -s conftest$ac_exeext'
9949   { (eval echo "$as_me:9949: \"$ac_try\"") >&5
9950   (eval $ac_try) 2>&5
9951   ac_status=$?
9952   echo "$as_me:9952: \$? = $ac_status" >&5
9953   (exit $ac_status); }; }; then
9954   ac_R_nospace=yes
9955 else
9956   echo "$as_me: failed program was:" >&5
9957 cat conftest.$ac_ext >&5
9958 ac_R_nospace=no
9959 fi
9960 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9961       if test $ac_R_nospace = yes; then
9962         echo "$as_me:9962: result: no" >&5
9963 echo "${ECHO_T}no" >&6
9964         X_LIBS="$X_LIBS -R$x_libraries"
9965       else
9966         LIBS="$ac_xsave_LIBS -R $x_libraries"
9967         cat >conftest.$ac_ext <<_ACEOF
9968 #line 9968 "configure"
9969 #include "confdefs.h"
9970
9971 int
9972 main ()
9973 {
9974
9975   ;
9976   return 0;
9977 }
9978 _ACEOF
9979 rm -f conftest.$ac_objext conftest$ac_exeext
9980 if { (eval echo "$as_me:9980: \"$ac_link\"") >&5
9981   (eval $ac_link) 2>&5
9982   ac_status=$?
9983   echo "$as_me:9983: \$? = $ac_status" >&5
9984   (exit $ac_status); } &&
9985          { ac_try='test -s conftest$ac_exeext'
9986   { (eval echo "$as_me:9986: \"$ac_try\"") >&5
9987   (eval $ac_try) 2>&5
9988   ac_status=$?
9989   echo "$as_me:9989: \$? = $ac_status" >&5
9990   (exit $ac_status); }; }; then
9991   ac_R_space=yes
9992 else
9993   echo "$as_me: failed program was:" >&5
9994 cat conftest.$ac_ext >&5
9995 ac_R_space=no
9996 fi
9997 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9998         if test $ac_R_space = yes; then
9999           echo "$as_me:9999: result: yes" >&5
10000 echo "${ECHO_T}yes" >&6
10001           X_LIBS="$X_LIBS -R $x_libraries"
10002         else
10003           echo "$as_me:10003: result: neither works" >&5
10004 echo "${ECHO_T}neither works" >&6
10005         fi
10006       fi
10007       LIBS=$ac_xsave_LIBS
10008     esac
10009   fi
10010
10011   # Check for system-dependent libraries X programs must link with.
10012   # Do this before checking for the system-independent R6 libraries
10013   # (-lICE), since we may need -lsocket or whatever for X linking.
10014
10015   if test "$ISC" = yes; then
10016     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10017   else
10018     # Martyn Johnson says this is needed for Ultrix, if the X
10019     # libraries were built with DECnet support.  And Karl Berry says
10020     # the Alpha needs dnet_stub (dnet does not exist).
10021     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10022     cat >conftest.$ac_ext <<_ACEOF
10023 #line 10023 "configure"
10024 #include "confdefs.h"
10025
10026 /* Override any gcc2 internal prototype to avoid an error.  */
10027 #ifdef __cplusplus
10028 extern "C"
10029 #endif
10030 /* We use char because int might match the return type of a gcc2
10031    builtin and then its argument prototype would still apply.  */
10032 char XOpenDisplay ();
10033 int
10034 main ()
10035 {
10036 XOpenDisplay ();
10037   ;
10038   return 0;
10039 }
10040 _ACEOF
10041 rm -f conftest.$ac_objext conftest$ac_exeext
10042 if { (eval echo "$as_me:10042: \"$ac_link\"") >&5
10043   (eval $ac_link) 2>&5
10044   ac_status=$?
10045   echo "$as_me:10045: \$? = $ac_status" >&5
10046   (exit $ac_status); } &&
10047          { ac_try='test -s conftest$ac_exeext'
10048   { (eval echo "$as_me:10048: \"$ac_try\"") >&5
10049   (eval $ac_try) 2>&5
10050   ac_status=$?
10051   echo "$as_me:10051: \$? = $ac_status" >&5
10052   (exit $ac_status); }; }; then
10053   :
10054 else
10055   echo "$as_me: failed program was:" >&5
10056 cat conftest.$ac_ext >&5
10057 echo "$as_me:10057: checking for dnet_ntoa in -ldnet" >&5
10058 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10059 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10060   echo $ECHO_N "(cached) $ECHO_C" >&6
10061 else
10062   ac_check_lib_save_LIBS=$LIBS
10063 LIBS="-ldnet  $LIBS"
10064 cat >conftest.$ac_ext <<_ACEOF
10065 #line 10065 "configure"
10066 #include "confdefs.h"
10067
10068 /* Override any gcc2 internal prototype to avoid an error.  */
10069 #ifdef __cplusplus
10070 extern "C"
10071 #endif
10072 /* We use char because int might match the return type of a gcc2
10073    builtin and then its argument prototype would still apply.  */
10074 char dnet_ntoa ();
10075 int
10076 main ()
10077 {
10078 dnet_ntoa ();
10079   ;
10080   return 0;
10081 }
10082 _ACEOF
10083 rm -f conftest.$ac_objext conftest$ac_exeext
10084 if { (eval echo "$as_me:10084: \"$ac_link\"") >&5
10085   (eval $ac_link) 2>&5
10086   ac_status=$?
10087   echo "$as_me:10087: \$? = $ac_status" >&5
10088   (exit $ac_status); } &&
10089          { ac_try='test -s conftest$ac_exeext'
10090   { (eval echo "$as_me:10090: \"$ac_try\"") >&5
10091   (eval $ac_try) 2>&5
10092   ac_status=$?
10093   echo "$as_me:10093: \$? = $ac_status" >&5
10094   (exit $ac_status); }; }; then
10095   ac_cv_lib_dnet_dnet_ntoa=yes
10096 else
10097   echo "$as_me: failed program was:" >&5
10098 cat conftest.$ac_ext >&5
10099 ac_cv_lib_dnet_dnet_ntoa=no
10100 fi
10101 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10102 LIBS=$ac_check_lib_save_LIBS
10103 fi
10104 echo "$as_me:10104: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10105 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10106 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10107   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10108 fi
10109
10110     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10111       echo "$as_me:10111: checking for dnet_ntoa in -ldnet_stub" >&5
10112 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10113 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10114   echo $ECHO_N "(cached) $ECHO_C" >&6
10115 else
10116   ac_check_lib_save_LIBS=$LIBS
10117 LIBS="-ldnet_stub  $LIBS"
10118 cat >conftest.$ac_ext <<_ACEOF
10119 #line 10119 "configure"
10120 #include "confdefs.h"
10121
10122 /* Override any gcc2 internal prototype to avoid an error.  */
10123 #ifdef __cplusplus
10124 extern "C"
10125 #endif
10126 /* We use char because int might match the return type of a gcc2
10127    builtin and then its argument prototype would still apply.  */
10128 char dnet_ntoa ();
10129 int
10130 main ()
10131 {
10132 dnet_ntoa ();
10133   ;
10134   return 0;
10135 }
10136 _ACEOF
10137 rm -f conftest.$ac_objext conftest$ac_exeext
10138 if { (eval echo "$as_me:10138: \"$ac_link\"") >&5
10139   (eval $ac_link) 2>&5
10140   ac_status=$?
10141   echo "$as_me:10141: \$? = $ac_status" >&5
10142   (exit $ac_status); } &&
10143          { ac_try='test -s conftest$ac_exeext'
10144   { (eval echo "$as_me:10144: \"$ac_try\"") >&5
10145   (eval $ac_try) 2>&5
10146   ac_status=$?
10147   echo "$as_me:10147: \$? = $ac_status" >&5
10148   (exit $ac_status); }; }; then
10149   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10150 else
10151   echo "$as_me: failed program was:" >&5
10152 cat conftest.$ac_ext >&5
10153 ac_cv_lib_dnet_stub_dnet_ntoa=no
10154 fi
10155 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10156 LIBS=$ac_check_lib_save_LIBS
10157 fi
10158 echo "$as_me:10158: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10159 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10160 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10161   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10162 fi
10163
10164     fi
10165 fi
10166 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10167     LIBS="$ac_xsave_LIBS"
10168
10169     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10170     # to get the SysV transport functions.
10171     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10172     # needs -lnsl.
10173     # The nsl library prevents programs from opening the X display
10174     # on Irix 5.2, according to T.E. Dickey.
10175     # The functions gethostbyname, getservbyname, and inet_addr are
10176     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10177     echo "$as_me:10177: checking for gethostbyname" >&5
10178 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10179 if test "${ac_cv_func_gethostbyname+set}" = set; then
10180   echo $ECHO_N "(cached) $ECHO_C" >&6
10181 else
10182   cat >conftest.$ac_ext <<_ACEOF
10183 #line 10183 "configure"
10184 #include "confdefs.h"
10185 /* System header to define __stub macros and hopefully few prototypes,
10186     which can conflict with char gethostbyname (); below.  */
10187 #include <assert.h>
10188 /* Override any gcc2 internal prototype to avoid an error.  */
10189 #ifdef __cplusplus
10190 extern "C"
10191 #endif
10192 /* We use char because int might match the return type of a gcc2
10193    builtin and then its argument prototype would still apply.  */
10194 char gethostbyname ();
10195 char (*f) ();
10196
10197 int
10198 main ()
10199 {
10200 /* The GNU C library defines this for functions which it implements
10201     to always fail with ENOSYS.  Some functions are actually named
10202     something starting with __ and the normal name is an alias.  */
10203 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10204 choke me
10205 #else
10206 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10207 #endif
10208
10209   ;
10210   return 0;
10211 }
10212 _ACEOF
10213 rm -f conftest.$ac_objext conftest$ac_exeext
10214 if { (eval echo "$as_me:10214: \"$ac_link\"") >&5
10215   (eval $ac_link) 2>&5
10216   ac_status=$?
10217   echo "$as_me:10217: \$? = $ac_status" >&5
10218   (exit $ac_status); } &&
10219          { ac_try='test -s conftest$ac_exeext'
10220   { (eval echo "$as_me:10220: \"$ac_try\"") >&5
10221   (eval $ac_try) 2>&5
10222   ac_status=$?
10223   echo "$as_me:10223: \$? = $ac_status" >&5
10224   (exit $ac_status); }; }; then
10225   ac_cv_func_gethostbyname=yes
10226 else
10227   echo "$as_me: failed program was:" >&5
10228 cat conftest.$ac_ext >&5
10229 ac_cv_func_gethostbyname=no
10230 fi
10231 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10232 fi
10233 echo "$as_me:10233: result: $ac_cv_func_gethostbyname" >&5
10234 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10235
10236     if test $ac_cv_func_gethostbyname = no; then
10237       echo "$as_me:10237: checking for gethostbyname in -lnsl" >&5
10238 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10239 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10240   echo $ECHO_N "(cached) $ECHO_C" >&6
10241 else
10242   ac_check_lib_save_LIBS=$LIBS
10243 LIBS="-lnsl  $LIBS"
10244 cat >conftest.$ac_ext <<_ACEOF
10245 #line 10245 "configure"
10246 #include "confdefs.h"
10247
10248 /* Override any gcc2 internal prototype to avoid an error.  */
10249 #ifdef __cplusplus
10250 extern "C"
10251 #endif
10252 /* We use char because int might match the return type of a gcc2
10253    builtin and then its argument prototype would still apply.  */
10254 char gethostbyname ();
10255 int
10256 main ()
10257 {
10258 gethostbyname ();
10259   ;
10260   return 0;
10261 }
10262 _ACEOF
10263 rm -f conftest.$ac_objext conftest$ac_exeext
10264 if { (eval echo "$as_me:10264: \"$ac_link\"") >&5
10265   (eval $ac_link) 2>&5
10266   ac_status=$?
10267   echo "$as_me:10267: \$? = $ac_status" >&5
10268   (exit $ac_status); } &&
10269          { ac_try='test -s conftest$ac_exeext'
10270   { (eval echo "$as_me:10270: \"$ac_try\"") >&5
10271   (eval $ac_try) 2>&5
10272   ac_status=$?
10273   echo "$as_me:10273: \$? = $ac_status" >&5
10274   (exit $ac_status); }; }; then
10275   ac_cv_lib_nsl_gethostbyname=yes
10276 else
10277   echo "$as_me: failed program was:" >&5
10278 cat conftest.$ac_ext >&5
10279 ac_cv_lib_nsl_gethostbyname=no
10280 fi
10281 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10282 LIBS=$ac_check_lib_save_LIBS
10283 fi
10284 echo "$as_me:10284: result: $ac_cv_lib_nsl_gethostbyname" >&5
10285 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10286 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10287   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10288 fi
10289
10290       if test $ac_cv_lib_nsl_gethostbyname = no; then
10291         echo "$as_me:10291: checking for gethostbyname in -lbsd" >&5
10292 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10293 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10294   echo $ECHO_N "(cached) $ECHO_C" >&6
10295 else
10296   ac_check_lib_save_LIBS=$LIBS
10297 LIBS="-lbsd  $LIBS"
10298 cat >conftest.$ac_ext <<_ACEOF
10299 #line 10299 "configure"
10300 #include "confdefs.h"
10301
10302 /* Override any gcc2 internal prototype to avoid an error.  */
10303 #ifdef __cplusplus
10304 extern "C"
10305 #endif
10306 /* We use char because int might match the return type of a gcc2
10307    builtin and then its argument prototype would still apply.  */
10308 char gethostbyname ();
10309 int
10310 main ()
10311 {
10312 gethostbyname ();
10313   ;
10314   return 0;
10315 }
10316 _ACEOF
10317 rm -f conftest.$ac_objext conftest$ac_exeext
10318 if { (eval echo "$as_me:10318: \"$ac_link\"") >&5
10319   (eval $ac_link) 2>&5
10320   ac_status=$?
10321   echo "$as_me:10321: \$? = $ac_status" >&5
10322   (exit $ac_status); } &&
10323          { ac_try='test -s conftest$ac_exeext'
10324   { (eval echo "$as_me:10324: \"$ac_try\"") >&5
10325   (eval $ac_try) 2>&5
10326   ac_status=$?
10327   echo "$as_me:10327: \$? = $ac_status" >&5
10328   (exit $ac_status); }; }; then
10329   ac_cv_lib_bsd_gethostbyname=yes
10330 else
10331   echo "$as_me: failed program was:" >&5
10332 cat conftest.$ac_ext >&5
10333 ac_cv_lib_bsd_gethostbyname=no
10334 fi
10335 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10336 LIBS=$ac_check_lib_save_LIBS
10337 fi
10338 echo "$as_me:10338: result: $ac_cv_lib_bsd_gethostbyname" >&5
10339 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10340 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10341   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10342 fi
10343
10344       fi
10345     fi
10346
10347     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10348     # socket/setsockopt and other routines are undefined under SCO ODT
10349     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10350     # on later versions), says Simon Leinen: it contains gethostby*
10351     # variants that don't use the nameserver (or something).  -lsocket
10352     # must be given before -lnsl if both are needed.  We assume that
10353     # if connect needs -lnsl, so does gethostbyname.
10354     echo "$as_me:10354: checking for connect" >&5
10355 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10356 if test "${ac_cv_func_connect+set}" = set; then
10357   echo $ECHO_N "(cached) $ECHO_C" >&6
10358 else
10359   cat >conftest.$ac_ext <<_ACEOF
10360 #line 10360 "configure"
10361 #include "confdefs.h"
10362 /* System header to define __stub macros and hopefully few prototypes,
10363     which can conflict with char connect (); below.  */
10364 #include <assert.h>
10365 /* Override any gcc2 internal prototype to avoid an error.  */
10366 #ifdef __cplusplus
10367 extern "C"
10368 #endif
10369 /* We use char because int might match the return type of a gcc2
10370    builtin and then its argument prototype would still apply.  */
10371 char connect ();
10372 char (*f) ();
10373
10374 int
10375 main ()
10376 {
10377 /* The GNU C library defines this for functions which it implements
10378     to always fail with ENOSYS.  Some functions are actually named
10379     something starting with __ and the normal name is an alias.  */
10380 #if defined (__stub_connect) || defined (__stub___connect)
10381 choke me
10382 #else
10383 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10384 #endif
10385
10386   ;
10387   return 0;
10388 }
10389 _ACEOF
10390 rm -f conftest.$ac_objext conftest$ac_exeext
10391 if { (eval echo "$as_me:10391: \"$ac_link\"") >&5
10392   (eval $ac_link) 2>&5
10393   ac_status=$?
10394   echo "$as_me:10394: \$? = $ac_status" >&5
10395   (exit $ac_status); } &&
10396          { ac_try='test -s conftest$ac_exeext'
10397   { (eval echo "$as_me:10397: \"$ac_try\"") >&5
10398   (eval $ac_try) 2>&5
10399   ac_status=$?
10400   echo "$as_me:10400: \$? = $ac_status" >&5
10401   (exit $ac_status); }; }; then
10402   ac_cv_func_connect=yes
10403 else
10404   echo "$as_me: failed program was:" >&5
10405 cat conftest.$ac_ext >&5
10406 ac_cv_func_connect=no
10407 fi
10408 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10409 fi
10410 echo "$as_me:10410: result: $ac_cv_func_connect" >&5
10411 echo "${ECHO_T}$ac_cv_func_connect" >&6
10412
10413     if test $ac_cv_func_connect = no; then
10414       echo "$as_me:10414: checking for connect in -lsocket" >&5
10415 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10416 if test "${ac_cv_lib_socket_connect+set}" = set; then
10417   echo $ECHO_N "(cached) $ECHO_C" >&6
10418 else
10419   ac_check_lib_save_LIBS=$LIBS
10420 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10421 cat >conftest.$ac_ext <<_ACEOF
10422 #line 10422 "configure"
10423 #include "confdefs.h"
10424
10425 /* Override any gcc2 internal prototype to avoid an error.  */
10426 #ifdef __cplusplus
10427 extern "C"
10428 #endif
10429 /* We use char because int might match the return type of a gcc2
10430    builtin and then its argument prototype would still apply.  */
10431 char connect ();
10432 int
10433 main ()
10434 {
10435 connect ();
10436   ;
10437   return 0;
10438 }
10439 _ACEOF
10440 rm -f conftest.$ac_objext conftest$ac_exeext
10441 if { (eval echo "$as_me:10441: \"$ac_link\"") >&5
10442   (eval $ac_link) 2>&5
10443   ac_status=$?
10444   echo "$as_me:10444: \$? = $ac_status" >&5
10445   (exit $ac_status); } &&
10446          { ac_try='test -s conftest$ac_exeext'
10447   { (eval echo "$as_me:10447: \"$ac_try\"") >&5
10448   (eval $ac_try) 2>&5
10449   ac_status=$?
10450   echo "$as_me:10450: \$? = $ac_status" >&5
10451   (exit $ac_status); }; }; then
10452   ac_cv_lib_socket_connect=yes
10453 else
10454   echo "$as_me: failed program was:" >&5
10455 cat conftest.$ac_ext >&5
10456 ac_cv_lib_socket_connect=no
10457 fi
10458 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10459 LIBS=$ac_check_lib_save_LIBS
10460 fi
10461 echo "$as_me:10461: result: $ac_cv_lib_socket_connect" >&5
10462 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10463 if test $ac_cv_lib_socket_connect = yes; then
10464   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10465 fi
10466
10467     fi
10468
10469     # Guillermo Gomez says -lposix is necessary on A/UX.
10470     echo "$as_me:10470: checking for remove" >&5
10471 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10472 if test "${ac_cv_func_remove+set}" = set; then
10473   echo $ECHO_N "(cached) $ECHO_C" >&6
10474 else
10475   cat >conftest.$ac_ext <<_ACEOF
10476 #line 10476 "configure"
10477 #include "confdefs.h"
10478 /* System header to define __stub macros and hopefully few prototypes,
10479     which can conflict with char remove (); below.  */
10480 #include <assert.h>
10481 /* Override any gcc2 internal prototype to avoid an error.  */
10482 #ifdef __cplusplus
10483 extern "C"
10484 #endif
10485 /* We use char because int might match the return type of a gcc2
10486    builtin and then its argument prototype would still apply.  */
10487 char remove ();
10488 char (*f) ();
10489
10490 int
10491 main ()
10492 {
10493 /* The GNU C library defines this for functions which it implements
10494     to always fail with ENOSYS.  Some functions are actually named
10495     something starting with __ and the normal name is an alias.  */
10496 #if defined (__stub_remove) || defined (__stub___remove)
10497 choke me
10498 #else
10499 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10500 #endif
10501
10502   ;
10503   return 0;
10504 }
10505 _ACEOF
10506 rm -f conftest.$ac_objext conftest$ac_exeext
10507 if { (eval echo "$as_me:10507: \"$ac_link\"") >&5
10508   (eval $ac_link) 2>&5
10509   ac_status=$?
10510   echo "$as_me:10510: \$? = $ac_status" >&5
10511   (exit $ac_status); } &&
10512          { ac_try='test -s conftest$ac_exeext'
10513   { (eval echo "$as_me:10513: \"$ac_try\"") >&5
10514   (eval $ac_try) 2>&5
10515   ac_status=$?
10516   echo "$as_me:10516: \$? = $ac_status" >&5
10517   (exit $ac_status); }; }; then
10518   ac_cv_func_remove=yes
10519 else
10520   echo "$as_me: failed program was:" >&5
10521 cat conftest.$ac_ext >&5
10522 ac_cv_func_remove=no
10523 fi
10524 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10525 fi
10526 echo "$as_me:10526: result: $ac_cv_func_remove" >&5
10527 echo "${ECHO_T}$ac_cv_func_remove" >&6
10528
10529     if test $ac_cv_func_remove = no; then
10530       echo "$as_me:10530: checking for remove in -lposix" >&5
10531 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10532 if test "${ac_cv_lib_posix_remove+set}" = set; then
10533   echo $ECHO_N "(cached) $ECHO_C" >&6
10534 else
10535   ac_check_lib_save_LIBS=$LIBS
10536 LIBS="-lposix  $LIBS"
10537 cat >conftest.$ac_ext <<_ACEOF
10538 #line 10538 "configure"
10539 #include "confdefs.h"
10540
10541 /* Override any gcc2 internal prototype to avoid an error.  */
10542 #ifdef __cplusplus
10543 extern "C"
10544 #endif
10545 /* We use char because int might match the return type of a gcc2
10546    builtin and then its argument prototype would still apply.  */
10547 char remove ();
10548 int
10549 main ()
10550 {
10551 remove ();
10552   ;
10553   return 0;
10554 }
10555 _ACEOF
10556 rm -f conftest.$ac_objext conftest$ac_exeext
10557 if { (eval echo "$as_me:10557: \"$ac_link\"") >&5
10558   (eval $ac_link) 2>&5
10559   ac_status=$?
10560   echo "$as_me:10560: \$? = $ac_status" >&5
10561   (exit $ac_status); } &&
10562          { ac_try='test -s conftest$ac_exeext'
10563   { (eval echo "$as_me:10563: \"$ac_try\"") >&5
10564   (eval $ac_try) 2>&5
10565   ac_status=$?
10566   echo "$as_me:10566: \$? = $ac_status" >&5
10567   (exit $ac_status); }; }; then
10568   ac_cv_lib_posix_remove=yes
10569 else
10570   echo "$as_me: failed program was:" >&5
10571 cat conftest.$ac_ext >&5
10572 ac_cv_lib_posix_remove=no
10573 fi
10574 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10575 LIBS=$ac_check_lib_save_LIBS
10576 fi
10577 echo "$as_me:10577: result: $ac_cv_lib_posix_remove" >&5
10578 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10579 if test $ac_cv_lib_posix_remove = yes; then
10580   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10581 fi
10582
10583     fi
10584
10585     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10586     echo "$as_me:10586: checking for shmat" >&5
10587 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10588 if test "${ac_cv_func_shmat+set}" = set; then
10589   echo $ECHO_N "(cached) $ECHO_C" >&6
10590 else
10591   cat >conftest.$ac_ext <<_ACEOF
10592 #line 10592 "configure"
10593 #include "confdefs.h"
10594 /* System header to define __stub macros and hopefully few prototypes,
10595     which can conflict with char shmat (); below.  */
10596 #include <assert.h>
10597 /* Override any gcc2 internal prototype to avoid an error.  */
10598 #ifdef __cplusplus
10599 extern "C"
10600 #endif
10601 /* We use char because int might match the return type of a gcc2
10602    builtin and then its argument prototype would still apply.  */
10603 char shmat ();
10604 char (*f) ();
10605
10606 int
10607 main ()
10608 {
10609 /* The GNU C library defines this for functions which it implements
10610     to always fail with ENOSYS.  Some functions are actually named
10611     something starting with __ and the normal name is an alias.  */
10612 #if defined (__stub_shmat) || defined (__stub___shmat)
10613 choke me
10614 #else
10615 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10616 #endif
10617
10618   ;
10619   return 0;
10620 }
10621 _ACEOF
10622 rm -f conftest.$ac_objext conftest$ac_exeext
10623 if { (eval echo "$as_me:10623: \"$ac_link\"") >&5
10624   (eval $ac_link) 2>&5
10625   ac_status=$?
10626   echo "$as_me:10626: \$? = $ac_status" >&5
10627   (exit $ac_status); } &&
10628          { ac_try='test -s conftest$ac_exeext'
10629   { (eval echo "$as_me:10629: \"$ac_try\"") >&5
10630   (eval $ac_try) 2>&5
10631   ac_status=$?
10632   echo "$as_me:10632: \$? = $ac_status" >&5
10633   (exit $ac_status); }; }; then
10634   ac_cv_func_shmat=yes
10635 else
10636   echo "$as_me: failed program was:" >&5
10637 cat conftest.$ac_ext >&5
10638 ac_cv_func_shmat=no
10639 fi
10640 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10641 fi
10642 echo "$as_me:10642: result: $ac_cv_func_shmat" >&5
10643 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10644
10645     if test $ac_cv_func_shmat = no; then
10646       echo "$as_me:10646: checking for shmat in -lipc" >&5
10647 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10648 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10649   echo $ECHO_N "(cached) $ECHO_C" >&6
10650 else
10651   ac_check_lib_save_LIBS=$LIBS
10652 LIBS="-lipc  $LIBS"
10653 cat >conftest.$ac_ext <<_ACEOF
10654 #line 10654 "configure"
10655 #include "confdefs.h"
10656
10657 /* Override any gcc2 internal prototype to avoid an error.  */
10658 #ifdef __cplusplus
10659 extern "C"
10660 #endif
10661 /* We use char because int might match the return type of a gcc2
10662    builtin and then its argument prototype would still apply.  */
10663 char shmat ();
10664 int
10665 main ()
10666 {
10667 shmat ();
10668   ;
10669   return 0;
10670 }
10671 _ACEOF
10672 rm -f conftest.$ac_objext conftest$ac_exeext
10673 if { (eval echo "$as_me:10673: \"$ac_link\"") >&5
10674   (eval $ac_link) 2>&5
10675   ac_status=$?
10676   echo "$as_me:10676: \$? = $ac_status" >&5
10677   (exit $ac_status); } &&
10678          { ac_try='test -s conftest$ac_exeext'
10679   { (eval echo "$as_me:10679: \"$ac_try\"") >&5
10680   (eval $ac_try) 2>&5
10681   ac_status=$?
10682   echo "$as_me:10682: \$? = $ac_status" >&5
10683   (exit $ac_status); }; }; then
10684   ac_cv_lib_ipc_shmat=yes
10685 else
10686   echo "$as_me: failed program was:" >&5
10687 cat conftest.$ac_ext >&5
10688 ac_cv_lib_ipc_shmat=no
10689 fi
10690 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10691 LIBS=$ac_check_lib_save_LIBS
10692 fi
10693 echo "$as_me:10693: result: $ac_cv_lib_ipc_shmat" >&5
10694 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10695 if test $ac_cv_lib_ipc_shmat = yes; then
10696   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10697 fi
10698
10699     fi
10700   fi
10701
10702   # Check for libraries that X11R6 Xt/Xaw programs need.
10703   ac_save_LDFLAGS=$LDFLAGS
10704   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10705   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10706   # check for ICE first), but we must link in the order -lSM -lICE or
10707   # we get undefined symbols.  So assume we have SM if we have ICE.
10708   # These have to be linked with before -lX11, unlike the other
10709   # libraries we check for below, so use a different variable.
10710   # John Interrante, Karl Berry
10711   echo "$as_me:10711: checking for IceConnectionNumber in -lICE" >&5
10712 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10713 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10714   echo $ECHO_N "(cached) $ECHO_C" >&6
10715 else
10716   ac_check_lib_save_LIBS=$LIBS
10717 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10718 cat >conftest.$ac_ext <<_ACEOF
10719 #line 10719 "configure"
10720 #include "confdefs.h"
10721
10722 /* Override any gcc2 internal prototype to avoid an error.  */
10723 #ifdef __cplusplus
10724 extern "C"
10725 #endif
10726 /* We use char because int might match the return type of a gcc2
10727    builtin and then its argument prototype would still apply.  */
10728 char IceConnectionNumber ();
10729 int
10730 main ()
10731 {
10732 IceConnectionNumber ();
10733   ;
10734   return 0;
10735 }
10736 _ACEOF
10737 rm -f conftest.$ac_objext conftest$ac_exeext
10738 if { (eval echo "$as_me:10738: \"$ac_link\"") >&5
10739   (eval $ac_link) 2>&5
10740   ac_status=$?
10741   echo "$as_me:10741: \$? = $ac_status" >&5
10742   (exit $ac_status); } &&
10743          { ac_try='test -s conftest$ac_exeext'
10744   { (eval echo "$as_me:10744: \"$ac_try\"") >&5
10745   (eval $ac_try) 2>&5
10746   ac_status=$?
10747   echo "$as_me:10747: \$? = $ac_status" >&5
10748   (exit $ac_status); }; }; then
10749   ac_cv_lib_ICE_IceConnectionNumber=yes
10750 else
10751   echo "$as_me: failed program was:" >&5
10752 cat conftest.$ac_ext >&5
10753 ac_cv_lib_ICE_IceConnectionNumber=no
10754 fi
10755 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10756 LIBS=$ac_check_lib_save_LIBS
10757 fi
10758 echo "$as_me:10758: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10759 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10760 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10761   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10762 fi
10763
10764   LDFLAGS=$ac_save_LDFLAGS
10765
10766 fi
10767
10768 cf_x_athena=${cf_x_athena:-Xaw}
10769
10770 echo "$as_me:10770: checking if you want to link with Xaw 3d library" >&5
10771 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10772 withval=
10773
10774 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10775 if test "${with_Xaw3d+set}" = set; then
10776   withval="$with_Xaw3d"
10777
10778 fi;
10779 if test "$withval" = yes ; then
10780         cf_x_athena=Xaw3d
10781         echo "$as_me:10781: result: yes" >&5
10782 echo "${ECHO_T}yes" >&6
10783 else
10784         echo "$as_me:10784: result: no" >&5
10785 echo "${ECHO_T}no" >&6
10786 fi
10787
10788 echo "$as_me:10788: checking if you want to link with Xaw 3d xft library" >&5
10789 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
10790 withval=
10791
10792 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
10793 if test "${with_Xaw3dxft+set}" = set; then
10794   withval="$with_Xaw3dxft"
10795
10796 fi;
10797 if test "$withval" = yes ; then
10798         cf_x_athena=Xaw3dxft
10799         echo "$as_me:10799: result: yes" >&5
10800 echo "${ECHO_T}yes" >&6
10801 else
10802         echo "$as_me:10802: result: no" >&5
10803 echo "${ECHO_T}no" >&6
10804 fi
10805
10806 echo "$as_me:10806: checking if you want to link with neXT Athena library" >&5
10807 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10808 withval=
10809
10810 # Check whether --with-neXtaw or --without-neXtaw was given.
10811 if test "${with_neXtaw+set}" = set; then
10812   withval="$with_neXtaw"
10813
10814 fi;
10815 if test "$withval" = yes ; then
10816         cf_x_athena=neXtaw
10817         echo "$as_me:10817: result: yes" >&5
10818 echo "${ECHO_T}yes" >&6
10819 else
10820         echo "$as_me:10820: result: no" >&5
10821 echo "${ECHO_T}no" >&6
10822 fi
10823
10824 echo "$as_me:10824: checking if you want to link with Athena-Plus library" >&5
10825 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10826 withval=
10827
10828 # Check whether --with-XawPlus or --without-XawPlus was given.
10829 if test "${with_XawPlus+set}" = set; then
10830   withval="$with_XawPlus"
10831
10832 fi;
10833 if test "$withval" = yes ; then
10834         cf_x_athena=XawPlus
10835         echo "$as_me:10835: result: yes" >&5
10836 echo "${ECHO_T}yes" >&6
10837 else
10838         echo "$as_me:10838: result: no" >&5
10839 echo "${ECHO_T}no" >&6
10840 fi
10841
10842 cf_x_athena_lib=""
10843
10844 if test "$PKG_CONFIG" != none ; then
10845         cf_athena_list=
10846         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10847         for cf_athena_pkg in \
10848                 $cf_athena_list \
10849                 ${cf_x_athena} \
10850                 ${cf_x_athena}-devel \
10851                 lib${cf_x_athena} \
10852                 lib${cf_x_athena}-devel
10853         do
10854
10855 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10856         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10857
10858 echo "${as_me:-configure}:10858: testing found package $cf_athena_pkg ..." 1>&5
10859
10860         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10861         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10862         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10863
10864 echo "${as_me:-configure}:10864: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10865
10866         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10867
10868 echo "${as_me:-configure}:10868: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10869
10870 cf_fix_cppflags=no
10871 cf_new_cflags=
10872 cf_new_cppflags=
10873 cf_new_extra_cppflags=
10874
10875 for cf_add_cflags in $cf_pkgconfig_incs
10876 do
10877 case $cf_fix_cppflags in
10878 (no)
10879         case $cf_add_cflags in
10880         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10881                 case $cf_add_cflags in
10882                 (-D*)
10883                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10884
10885                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10886                                 && test -z "${cf_tst_cflags}" \
10887                                 && cf_fix_cppflags=yes
10888
10889                         if test $cf_fix_cppflags = yes ; then
10890                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10891                                 continue
10892                         elif test "${cf_tst_cflags}" = "\"'" ; then
10893                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10894                                 continue
10895                         fi
10896                         ;;
10897                 esac
10898                 case "$CPPFLAGS" in
10899                 (*$cf_add_cflags)
10900                         ;;
10901                 (*)
10902                         case $cf_add_cflags in
10903                         (-D*)
10904                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10905
10906 CPPFLAGS=`echo "$CPPFLAGS" | \
10907         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10908                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10909
10910                                 ;;
10911                         esac
10912                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10913                         ;;
10914                 esac
10915                 ;;
10916         (*)
10917                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10918                 ;;
10919         esac
10920         ;;
10921 (yes)
10922         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10923
10924         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10925
10926         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10927                 && test -z "${cf_tst_cflags}" \
10928                 && cf_fix_cppflags=no
10929         ;;
10930 esac
10931 done
10932
10933 if test -n "$cf_new_cflags" ; then
10934
10935         CFLAGS="$CFLAGS $cf_new_cflags"
10936 fi
10937
10938 if test -n "$cf_new_cppflags" ; then
10939
10940         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10941 fi
10942
10943 if test -n "$cf_new_extra_cppflags" ; then
10944
10945         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10946 fi
10947
10948 cf_add_libs="$cf_pkgconfig_libs"
10949 # Filter out duplicates - this happens with badly-designed ".pc" files...
10950 for cf_add_1lib in $LIBS
10951 do
10952         for cf_add_2lib in $cf_add_libs
10953         do
10954                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10955                 then
10956                         cf_add_1lib=
10957                         break
10958                 fi
10959         done
10960         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10961 done
10962 LIBS="$cf_add_libs"
10963
10964                         cf_x_athena_lib="$cf_pkgconfig_libs"
10965
10966 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10967
10968                         cat >>confdefs.h <<EOF
10969 #define $cf_x_athena_LIBS 1
10970 EOF
10971
10972         for cf_trim_lib in Xmu Xt X11
10973         do
10974                 case "$LIBS" in
10975                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10976                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10977                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10978
10979 echo "${as_me:-configure}:10979: testing ..trimmed $LIBS ..." 1>&5
10980
10981                         ;;
10982                 esac
10983         done
10984
10985 echo "$as_me:10985: checking for usable $cf_x_athena/Xmu package" >&5
10986 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10987 if test "${cf_cv_xaw_compat+set}" = set; then
10988   echo $ECHO_N "(cached) $ECHO_C" >&6
10989 else
10990
10991 cat >conftest.$ac_ext <<_ACEOF
10992 #line 10992 "configure"
10993 #include "confdefs.h"
10994
10995 #include <X11/Xmu/CharSet.h>
10996
10997 int
10998 main ()
10999 {
11000
11001 int check = XmuCompareISOLatin1("big", "small")
11002
11003   ;
11004   return 0;
11005 }
11006 _ACEOF
11007 rm -f conftest.$ac_objext conftest$ac_exeext
11008 if { (eval echo "$as_me:11008: \"$ac_link\"") >&5
11009   (eval $ac_link) 2>&5
11010   ac_status=$?
11011   echo "$as_me:11011: \$? = $ac_status" >&5
11012   (exit $ac_status); } &&
11013          { ac_try='test -s conftest$ac_exeext'
11014   { (eval echo "$as_me:11014: \"$ac_try\"") >&5
11015   (eval $ac_try) 2>&5
11016   ac_status=$?
11017   echo "$as_me:11017: \$? = $ac_status" >&5
11018   (exit $ac_status); }; }; then
11019   cf_cv_xaw_compat=yes
11020 else
11021   echo "$as_me: failed program was:" >&5
11022 cat conftest.$ac_ext >&5
11023 cf_cv_xaw_compat=no
11024 fi
11025 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11026 fi
11027 echo "$as_me:11027: result: $cf_cv_xaw_compat" >&5
11028 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11029
11030                         if test "$cf_cv_xaw_compat" = no
11031                         then
11032                                 # workaround for broken ".pc" files...
11033                                 case "$cf_x_athena_lib" in
11034                                 (*-lXmu*)
11035                                         ;;
11036                                 (*)
11037                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11038
11039 echo "${as_me:-configure}:11039: testing work around broken package ..." 1>&5
11040
11041                                         cf_save_xmu="$LIBS"
11042                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
11043
11044 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11045         test -n "$verbose" && echo "    found package xmu" 1>&6
11046
11047 echo "${as_me:-configure}:11047: testing found package xmu ..." 1>&5
11048
11049         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11050         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11051         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11052
11053 echo "${as_me:-configure}:11053: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11054
11055         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11056
11057 echo "${as_me:-configure}:11057: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11058
11059 cf_fix_cppflags=no
11060 cf_new_cflags=
11061 cf_new_cppflags=
11062 cf_new_extra_cppflags=
11063
11064 for cf_add_cflags in $cf_pkgconfig_incs
11065 do
11066 case $cf_fix_cppflags in
11067 (no)
11068         case $cf_add_cflags in
11069         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11070                 case $cf_add_cflags in
11071                 (-D*)
11072                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11073
11074                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11075                                 && test -z "${cf_tst_cflags}" \
11076                                 && cf_fix_cppflags=yes
11077
11078                         if test $cf_fix_cppflags = yes ; then
11079                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11080                                 continue
11081                         elif test "${cf_tst_cflags}" = "\"'" ; then
11082                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11083                                 continue
11084                         fi
11085                         ;;
11086                 esac
11087                 case "$CPPFLAGS" in
11088                 (*$cf_add_cflags)
11089                         ;;
11090                 (*)
11091                         case $cf_add_cflags in
11092                         (-D*)
11093                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11094
11095 CPPFLAGS=`echo "$CPPFLAGS" | \
11096         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11097                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11098
11099                                 ;;
11100                         esac
11101                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11102                         ;;
11103                 esac
11104                 ;;
11105         (*)
11106                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11107                 ;;
11108         esac
11109         ;;
11110 (yes)
11111         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11112
11113         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11114
11115         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11116                 && test -z "${cf_tst_cflags}" \
11117                 && cf_fix_cppflags=no
11118         ;;
11119 esac
11120 done
11121
11122 if test -n "$cf_new_cflags" ; then
11123
11124         CFLAGS="$CFLAGS $cf_new_cflags"
11125 fi
11126
11127 if test -n "$cf_new_cppflags" ; then
11128
11129         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11130 fi
11131
11132 if test -n "$cf_new_extra_cppflags" ; then
11133
11134         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11135 fi
11136
11137 cf_add_libs="$cf_pkgconfig_libs"
11138 # Filter out duplicates - this happens with badly-designed ".pc" files...
11139 for cf_add_1lib in $LIBS
11140 do
11141         for cf_add_2lib in $cf_add_libs
11142         do
11143                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11144                 then
11145                         cf_add_1lib=
11146                         break
11147                 fi
11148         done
11149         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11150 done
11151 LIBS="$cf_add_libs"
11152
11153                                                         LIBS="$cf_save_xmu"
11154
11155 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11156
11157 echo "${as_me:-configure}:11157: testing ...before $LIBS ..." 1>&5
11158
11159 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
11160 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11161
11162 echo "${as_me:-configure}:11162: testing ...after  $LIBS ..." 1>&5
11163
11164 else
11165         cf_pkgconfig_incs=
11166         cf_pkgconfig_libs=
11167
11168 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11169
11170 echo "${as_me:-configure}:11170: testing ...before $LIBS ..." 1>&5
11171
11172 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
11173 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11174
11175 echo "${as_me:-configure}:11175: testing ...after  $LIBS ..." 1>&5
11176
11177 fi
11178
11179         for cf_trim_lib in Xmu Xt X11
11180         do
11181                 case "$LIBS" in
11182                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11183                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11184                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11185
11186 echo "${as_me:-configure}:11186: testing ..trimmed $LIBS ..." 1>&5
11187
11188                         ;;
11189                 esac
11190         done
11191
11192                                         ;;
11193                                 esac
11194                         fi
11195
11196                         break
11197 else
11198         cf_pkgconfig_incs=
11199         cf_pkgconfig_libs=
11200         :
11201 fi
11202
11203         done
11204 fi
11205
11206 if test -z "$cf_x_athena_lib" ; then
11207
11208 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11209         test -n "$verbose" && echo "    found package Xext" 1>&6
11210
11211 echo "${as_me:-configure}:11211: testing found package Xext ..." 1>&5
11212
11213         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11214         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11215         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11216
11217 echo "${as_me:-configure}:11217: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11218
11219         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11220
11221 echo "${as_me:-configure}:11221: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11222
11223 cf_fix_cppflags=no
11224 cf_new_cflags=
11225 cf_new_cppflags=
11226 cf_new_extra_cppflags=
11227
11228 for cf_add_cflags in $cf_pkgconfig_incs
11229 do
11230 case $cf_fix_cppflags in
11231 (no)
11232         case $cf_add_cflags in
11233         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11234                 case $cf_add_cflags in
11235                 (-D*)
11236                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11237
11238                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11239                                 && test -z "${cf_tst_cflags}" \
11240                                 && cf_fix_cppflags=yes
11241
11242                         if test $cf_fix_cppflags = yes ; then
11243                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11244                                 continue
11245                         elif test "${cf_tst_cflags}" = "\"'" ; then
11246                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11247                                 continue
11248                         fi
11249                         ;;
11250                 esac
11251                 case "$CPPFLAGS" in
11252                 (*$cf_add_cflags)
11253                         ;;
11254                 (*)
11255                         case $cf_add_cflags in
11256                         (-D*)
11257                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11258
11259 CPPFLAGS=`echo "$CPPFLAGS" | \
11260         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11261                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11262
11263                                 ;;
11264                         esac
11265                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11266                         ;;
11267                 esac
11268                 ;;
11269         (*)
11270                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11271                 ;;
11272         esac
11273         ;;
11274 (yes)
11275         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11276
11277         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11278
11279         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11280                 && test -z "${cf_tst_cflags}" \
11281                 && cf_fix_cppflags=no
11282         ;;
11283 esac
11284 done
11285
11286 if test -n "$cf_new_cflags" ; then
11287
11288         CFLAGS="$CFLAGS $cf_new_cflags"
11289 fi
11290
11291 if test -n "$cf_new_cppflags" ; then
11292
11293         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11294 fi
11295
11296 if test -n "$cf_new_extra_cppflags" ; then
11297
11298         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11299 fi
11300
11301 cf_add_libs="$cf_pkgconfig_libs"
11302 # Filter out duplicates - this happens with badly-designed ".pc" files...
11303 for cf_add_1lib in $LIBS
11304 do
11305         for cf_add_2lib in $cf_add_libs
11306         do
11307                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11308                 then
11309                         cf_add_1lib=
11310                         break
11311                 fi
11312         done
11313         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11314 done
11315 LIBS="$cf_add_libs"
11316
11317         :
11318 else
11319         cf_pkgconfig_incs=
11320         cf_pkgconfig_libs=
11321
11322         echo "$as_me:11322: checking for XextCreateExtension in -lXext" >&5
11323 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11324 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11325   echo $ECHO_N "(cached) $ECHO_C" >&6
11326 else
11327   ac_check_lib_save_LIBS=$LIBS
11328 LIBS="-lXext  $LIBS"
11329 cat >conftest.$ac_ext <<_ACEOF
11330 #line 11330 "configure"
11331 #include "confdefs.h"
11332
11333 /* Override any gcc2 internal prototype to avoid an error.  */
11334 #ifdef __cplusplus
11335 extern "C"
11336 #endif
11337 /* We use char because int might match the return type of a gcc2
11338    builtin and then its argument prototype would still apply.  */
11339 char XextCreateExtension ();
11340 int
11341 main ()
11342 {
11343 XextCreateExtension ();
11344   ;
11345   return 0;
11346 }
11347 _ACEOF
11348 rm -f conftest.$ac_objext conftest$ac_exeext
11349 if { (eval echo "$as_me:11349: \"$ac_link\"") >&5
11350   (eval $ac_link) 2>&5
11351   ac_status=$?
11352   echo "$as_me:11352: \$? = $ac_status" >&5
11353   (exit $ac_status); } &&
11354          { ac_try='test -s conftest$ac_exeext'
11355   { (eval echo "$as_me:11355: \"$ac_try\"") >&5
11356   (eval $ac_try) 2>&5
11357   ac_status=$?
11358   echo "$as_me:11358: \$? = $ac_status" >&5
11359   (exit $ac_status); }; }; then
11360   ac_cv_lib_Xext_XextCreateExtension=yes
11361 else
11362   echo "$as_me: failed program was:" >&5
11363 cat conftest.$ac_ext >&5
11364 ac_cv_lib_Xext_XextCreateExtension=no
11365 fi
11366 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11367 LIBS=$ac_check_lib_save_LIBS
11368 fi
11369 echo "$as_me:11369: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11370 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11371 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11372
11373 cf_add_libs="-lXext"
11374 # Filter out duplicates - this happens with badly-designed ".pc" files...
11375 for cf_add_1lib in $LIBS
11376 do
11377         for cf_add_2lib in $cf_add_libs
11378         do
11379                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11380                 then
11381                         cf_add_1lib=
11382                         break
11383                 fi
11384         done
11385         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11386 done
11387 LIBS="$cf_add_libs"
11388
11389 fi
11390
11391 fi
11392
11393 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11394 # in some cases has installed dummy files in the former, other cases replaced
11395 # it with a link to the new location).  This complicates the configure script.
11396 # Check for that pitfall, and recover using pkg-config
11397 #
11398 # If none of these are set, the configuration is almost certainly broken.
11399 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11400 then
11401
11402 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11403         test -n "$verbose" && echo "    found package x11" 1>&6
11404
11405 echo "${as_me:-configure}:11405: testing found package x11 ..." 1>&5
11406
11407         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11408         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11409         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11410
11411 echo "${as_me:-configure}:11411: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11412
11413         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11414
11415 echo "${as_me:-configure}:11415: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11416
11417 cf_fix_cppflags=no
11418 cf_new_cflags=
11419 cf_new_cppflags=
11420 cf_new_extra_cppflags=
11421
11422 for cf_add_cflags in $cf_pkgconfig_incs
11423 do
11424 case $cf_fix_cppflags in
11425 (no)
11426         case $cf_add_cflags in
11427         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11428                 case $cf_add_cflags in
11429                 (-D*)
11430                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11431
11432                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11433                                 && test -z "${cf_tst_cflags}" \
11434                                 && cf_fix_cppflags=yes
11435
11436                         if test $cf_fix_cppflags = yes ; then
11437                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11438                                 continue
11439                         elif test "${cf_tst_cflags}" = "\"'" ; then
11440                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11441                                 continue
11442                         fi
11443                         ;;
11444                 esac
11445                 case "$CPPFLAGS" in
11446                 (*$cf_add_cflags)
11447                         ;;
11448                 (*)
11449                         case $cf_add_cflags in
11450                         (-D*)
11451                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11452
11453 CPPFLAGS=`echo "$CPPFLAGS" | \
11454         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11455                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11456
11457                                 ;;
11458                         esac
11459                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11460                         ;;
11461                 esac
11462                 ;;
11463         (*)
11464                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11465                 ;;
11466         esac
11467         ;;
11468 (yes)
11469         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11470
11471         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11472
11473         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11474                 && test -z "${cf_tst_cflags}" \
11475                 && cf_fix_cppflags=no
11476         ;;
11477 esac
11478 done
11479
11480 if test -n "$cf_new_cflags" ; then
11481
11482         CFLAGS="$CFLAGS $cf_new_cflags"
11483 fi
11484
11485 if test -n "$cf_new_cppflags" ; then
11486
11487         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11488 fi
11489
11490 if test -n "$cf_new_extra_cppflags" ; then
11491
11492         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11493 fi
11494
11495 cf_add_libs="$cf_pkgconfig_libs"
11496 # Filter out duplicates - this happens with badly-designed ".pc" files...
11497 for cf_add_1lib in $LIBS
11498 do
11499         for cf_add_2lib in $cf_add_libs
11500         do
11501                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11502                 then
11503                         cf_add_1lib=
11504                         break
11505                 fi
11506         done
11507         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11508 done
11509 LIBS="$cf_add_libs"
11510
11511         :
11512 else
11513         cf_pkgconfig_incs=
11514         cf_pkgconfig_libs=
11515         { echo "$as_me:11515: WARNING: unable to find X11 library" >&5
11516 echo "$as_me: WARNING: unable to find X11 library" >&2;}
11517 fi
11518
11519 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11520         test -n "$verbose" && echo "    found package ice" 1>&6
11521
11522 echo "${as_me:-configure}:11522: testing found package ice ..." 1>&5
11523
11524         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11525         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11526         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11527
11528 echo "${as_me:-configure}:11528: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11529
11530         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11531
11532 echo "${as_me:-configure}:11532: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11533
11534 cf_fix_cppflags=no
11535 cf_new_cflags=
11536 cf_new_cppflags=
11537 cf_new_extra_cppflags=
11538
11539 for cf_add_cflags in $cf_pkgconfig_incs
11540 do
11541 case $cf_fix_cppflags in
11542 (no)
11543         case $cf_add_cflags in
11544         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11545                 case $cf_add_cflags in
11546                 (-D*)
11547                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11548
11549                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11550                                 && test -z "${cf_tst_cflags}" \
11551                                 && cf_fix_cppflags=yes
11552
11553                         if test $cf_fix_cppflags = yes ; then
11554                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11555                                 continue
11556                         elif test "${cf_tst_cflags}" = "\"'" ; then
11557                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11558                                 continue
11559                         fi
11560                         ;;
11561                 esac
11562                 case "$CPPFLAGS" in
11563                 (*$cf_add_cflags)
11564                         ;;
11565                 (*)
11566                         case $cf_add_cflags in
11567                         (-D*)
11568                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11569
11570 CPPFLAGS=`echo "$CPPFLAGS" | \
11571         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11572                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11573
11574                                 ;;
11575                         esac
11576                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11577                         ;;
11578                 esac
11579                 ;;
11580         (*)
11581                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11582                 ;;
11583         esac
11584         ;;
11585 (yes)
11586         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11587
11588         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11589
11590         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11591                 && test -z "${cf_tst_cflags}" \
11592                 && cf_fix_cppflags=no
11593         ;;
11594 esac
11595 done
11596
11597 if test -n "$cf_new_cflags" ; then
11598
11599         CFLAGS="$CFLAGS $cf_new_cflags"
11600 fi
11601
11602 if test -n "$cf_new_cppflags" ; then
11603
11604         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11605 fi
11606
11607 if test -n "$cf_new_extra_cppflags" ; then
11608
11609         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11610 fi
11611
11612 cf_add_libs="$cf_pkgconfig_libs"
11613 # Filter out duplicates - this happens with badly-designed ".pc" files...
11614 for cf_add_1lib in $LIBS
11615 do
11616         for cf_add_2lib in $cf_add_libs
11617         do
11618                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11619                 then
11620                         cf_add_1lib=
11621                         break
11622                 fi
11623         done
11624         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11625 done
11626 LIBS="$cf_add_libs"
11627
11628         :
11629 else
11630         cf_pkgconfig_incs=
11631         cf_pkgconfig_libs=
11632         { echo "$as_me:11632: WARNING: unable to find ICE library" >&5
11633 echo "$as_me: WARNING: unable to find ICE library" >&2;}
11634 fi
11635
11636 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11637         test -n "$verbose" && echo "    found package sm" 1>&6
11638
11639 echo "${as_me:-configure}:11639: testing found package sm ..." 1>&5
11640
11641         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11642         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11643         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11644
11645 echo "${as_me:-configure}:11645: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11646
11647         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11648
11649 echo "${as_me:-configure}:11649: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11650
11651 cf_fix_cppflags=no
11652 cf_new_cflags=
11653 cf_new_cppflags=
11654 cf_new_extra_cppflags=
11655
11656 for cf_add_cflags in $cf_pkgconfig_incs
11657 do
11658 case $cf_fix_cppflags in
11659 (no)
11660         case $cf_add_cflags in
11661         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11662                 case $cf_add_cflags in
11663                 (-D*)
11664                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11665
11666                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11667                                 && test -z "${cf_tst_cflags}" \
11668                                 && cf_fix_cppflags=yes
11669
11670                         if test $cf_fix_cppflags = yes ; then
11671                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11672                                 continue
11673                         elif test "${cf_tst_cflags}" = "\"'" ; then
11674                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11675                                 continue
11676                         fi
11677                         ;;
11678                 esac
11679                 case "$CPPFLAGS" in
11680                 (*$cf_add_cflags)
11681                         ;;
11682                 (*)
11683                         case $cf_add_cflags in
11684                         (-D*)
11685                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11686
11687 CPPFLAGS=`echo "$CPPFLAGS" | \
11688         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11689                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11690
11691                                 ;;
11692                         esac
11693                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11694                         ;;
11695                 esac
11696                 ;;
11697         (*)
11698                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11699                 ;;
11700         esac
11701         ;;
11702 (yes)
11703         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11704
11705         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11706
11707         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11708                 && test -z "${cf_tst_cflags}" \
11709                 && cf_fix_cppflags=no
11710         ;;
11711 esac
11712 done
11713
11714 if test -n "$cf_new_cflags" ; then
11715
11716         CFLAGS="$CFLAGS $cf_new_cflags"
11717 fi
11718
11719 if test -n "$cf_new_cppflags" ; then
11720
11721         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11722 fi
11723
11724 if test -n "$cf_new_extra_cppflags" ; then
11725
11726         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11727 fi
11728
11729 cf_add_libs="$cf_pkgconfig_libs"
11730 # Filter out duplicates - this happens with badly-designed ".pc" files...
11731 for cf_add_1lib in $LIBS
11732 do
11733         for cf_add_2lib in $cf_add_libs
11734         do
11735                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11736                 then
11737                         cf_add_1lib=
11738                         break
11739                 fi
11740         done
11741         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11742 done
11743 LIBS="$cf_add_libs"
11744
11745         :
11746 else
11747         cf_pkgconfig_incs=
11748         cf_pkgconfig_libs=
11749         { echo "$as_me:11749: WARNING: unable to find SM library" >&5
11750 echo "$as_me: WARNING: unable to find SM library" >&2;}
11751 fi
11752
11753 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11754         test -n "$verbose" && echo "    found package xt" 1>&6
11755
11756 echo "${as_me:-configure}:11756: testing found package xt ..." 1>&5
11757
11758         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11759         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11760         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11761
11762 echo "${as_me:-configure}:11762: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11763
11764         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11765
11766 echo "${as_me:-configure}:11766: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11767
11768 cf_fix_cppflags=no
11769 cf_new_cflags=
11770 cf_new_cppflags=
11771 cf_new_extra_cppflags=
11772
11773 for cf_add_cflags in $cf_pkgconfig_incs
11774 do
11775 case $cf_fix_cppflags in
11776 (no)
11777         case $cf_add_cflags in
11778         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11779                 case $cf_add_cflags in
11780                 (-D*)
11781                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11782
11783                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11784                                 && test -z "${cf_tst_cflags}" \
11785                                 && cf_fix_cppflags=yes
11786
11787                         if test $cf_fix_cppflags = yes ; then
11788                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11789                                 continue
11790                         elif test "${cf_tst_cflags}" = "\"'" ; then
11791                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11792                                 continue
11793                         fi
11794                         ;;
11795                 esac
11796                 case "$CPPFLAGS" in
11797                 (*$cf_add_cflags)
11798                         ;;
11799                 (*)
11800                         case $cf_add_cflags in
11801                         (-D*)
11802                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11803
11804 CPPFLAGS=`echo "$CPPFLAGS" | \
11805         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11806                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11807
11808                                 ;;
11809                         esac
11810                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11811                         ;;
11812                 esac
11813                 ;;
11814         (*)
11815                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11816                 ;;
11817         esac
11818         ;;
11819 (yes)
11820         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11821
11822         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11823
11824         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11825                 && test -z "${cf_tst_cflags}" \
11826                 && cf_fix_cppflags=no
11827         ;;
11828 esac
11829 done
11830
11831 if test -n "$cf_new_cflags" ; then
11832
11833         CFLAGS="$CFLAGS $cf_new_cflags"
11834 fi
11835
11836 if test -n "$cf_new_cppflags" ; then
11837
11838         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11839 fi
11840
11841 if test -n "$cf_new_extra_cppflags" ; then
11842
11843         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11844 fi
11845
11846 cf_add_libs="$cf_pkgconfig_libs"
11847 # Filter out duplicates - this happens with badly-designed ".pc" files...
11848 for cf_add_1lib in $LIBS
11849 do
11850         for cf_add_2lib in $cf_add_libs
11851         do
11852                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11853                 then
11854                         cf_add_1lib=
11855                         break
11856                 fi
11857         done
11858         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11859 done
11860 LIBS="$cf_add_libs"
11861
11862         :
11863 else
11864         cf_pkgconfig_incs=
11865         cf_pkgconfig_libs=
11866         { echo "$as_me:11866: WARNING: unable to find Xt library" >&5
11867 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11868 fi
11869
11870 fi
11871
11872 cf_have_X_LIBS=no
11873
11874 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11875         test -n "$verbose" && echo "    found package xt" 1>&6
11876
11877 echo "${as_me:-configure}:11877: testing found package xt ..." 1>&5
11878
11879         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11880         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11881         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11882
11883 echo "${as_me:-configure}:11883: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11884
11885         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11886
11887 echo "${as_me:-configure}:11887: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11888
11889 cf_fix_cppflags=no
11890 cf_new_cflags=
11891 cf_new_cppflags=
11892 cf_new_extra_cppflags=
11893
11894 for cf_add_cflags in $cf_pkgconfig_incs
11895 do
11896 case $cf_fix_cppflags in
11897 (no)
11898         case $cf_add_cflags in
11899         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11900                 case $cf_add_cflags in
11901                 (-D*)
11902                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11903
11904                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11905                                 && test -z "${cf_tst_cflags}" \
11906                                 && cf_fix_cppflags=yes
11907
11908                         if test $cf_fix_cppflags = yes ; then
11909                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11910                                 continue
11911                         elif test "${cf_tst_cflags}" = "\"'" ; then
11912                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11913                                 continue
11914                         fi
11915                         ;;
11916                 esac
11917                 case "$CPPFLAGS" in
11918                 (*$cf_add_cflags)
11919                         ;;
11920                 (*)
11921                         case $cf_add_cflags in
11922                         (-D*)
11923                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11924
11925 CPPFLAGS=`echo "$CPPFLAGS" | \
11926         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11927                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11928
11929                                 ;;
11930                         esac
11931                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11932                         ;;
11933                 esac
11934                 ;;
11935         (*)
11936                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11937                 ;;
11938         esac
11939         ;;
11940 (yes)
11941         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11942
11943         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11944
11945         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11946                 && test -z "${cf_tst_cflags}" \
11947                 && cf_fix_cppflags=no
11948         ;;
11949 esac
11950 done
11951
11952 if test -n "$cf_new_cflags" ; then
11953
11954         CFLAGS="$CFLAGS $cf_new_cflags"
11955 fi
11956
11957 if test -n "$cf_new_cppflags" ; then
11958
11959         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11960 fi
11961
11962 if test -n "$cf_new_extra_cppflags" ; then
11963
11964         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11965 fi
11966
11967 cf_add_libs="$cf_pkgconfig_libs"
11968 # Filter out duplicates - this happens with badly-designed ".pc" files...
11969 for cf_add_1lib in $LIBS
11970 do
11971         for cf_add_2lib in $cf_add_libs
11972         do
11973                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11974                 then
11975                         cf_add_1lib=
11976                         break
11977                 fi
11978         done
11979         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11980 done
11981 LIBS="$cf_add_libs"
11982
11983         case "x$LIBS" in
11984         (*-lX11*)
11985                 ;;
11986         (*)
11987 # we have an "xt" package, but it may omit Xt's dependency on X11
11988 echo "$as_me:11988: checking for usable X dependency" >&5
11989 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11990 if test "${cf_cv_xt_x11_compat+set}" = set; then
11991   echo $ECHO_N "(cached) $ECHO_C" >&6
11992 else
11993
11994 cat >conftest.$ac_ext <<_ACEOF
11995 #line 11995 "configure"
11996 #include "confdefs.h"
11997
11998 #include <X11/Xlib.h>
11999
12000 int
12001 main ()
12002 {
12003
12004         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
12005         int rc2 = XClearWindow((Display*) 0, (Window) 0);
12006         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
12007         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
12008
12009   ;
12010   return 0;
12011 }
12012 _ACEOF
12013 rm -f conftest.$ac_objext conftest$ac_exeext
12014 if { (eval echo "$as_me:12014: \"$ac_link\"") >&5
12015   (eval $ac_link) 2>&5
12016   ac_status=$?
12017   echo "$as_me:12017: \$? = $ac_status" >&5
12018   (exit $ac_status); } &&
12019          { ac_try='test -s conftest$ac_exeext'
12020   { (eval echo "$as_me:12020: \"$ac_try\"") >&5
12021   (eval $ac_try) 2>&5
12022   ac_status=$?
12023   echo "$as_me:12023: \$? = $ac_status" >&5
12024   (exit $ac_status); }; }; then
12025   cf_cv_xt_x11_compat=yes
12026 else
12027   echo "$as_me: failed program was:" >&5
12028 cat conftest.$ac_ext >&5
12029 cf_cv_xt_x11_compat=no
12030 fi
12031 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12032 fi
12033 echo "$as_me:12033: result: $cf_cv_xt_x11_compat" >&5
12034 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
12035                 if test "$cf_cv_xt_x11_compat" = no
12036                 then
12037                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
12038
12039 echo "${as_me:-configure}:12039: testing work around broken X11 dependency ..." 1>&5
12040
12041                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
12042
12043 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12044         test -n "$verbose" && echo "    found package x11" 1>&6
12045
12046 echo "${as_me:-configure}:12046: testing found package x11 ..." 1>&5
12047
12048         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12049         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12050         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12051
12052 echo "${as_me:-configure}:12052: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12053
12054         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12055
12056 echo "${as_me:-configure}:12056: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12057
12058 cf_fix_cppflags=no
12059 cf_new_cflags=
12060 cf_new_cppflags=
12061 cf_new_extra_cppflags=
12062
12063 for cf_add_cflags in $cf_pkgconfig_incs
12064 do
12065 case $cf_fix_cppflags in
12066 (no)
12067         case $cf_add_cflags in
12068         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12069                 case $cf_add_cflags in
12070                 (-D*)
12071                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12072
12073                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12074                                 && test -z "${cf_tst_cflags}" \
12075                                 && cf_fix_cppflags=yes
12076
12077                         if test $cf_fix_cppflags = yes ; then
12078                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12079                                 continue
12080                         elif test "${cf_tst_cflags}" = "\"'" ; then
12081                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12082                                 continue
12083                         fi
12084                         ;;
12085                 esac
12086                 case "$CPPFLAGS" in
12087                 (*$cf_add_cflags)
12088                         ;;
12089                 (*)
12090                         case $cf_add_cflags in
12091                         (-D*)
12092                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12093
12094 CPPFLAGS=`echo "$CPPFLAGS" | \
12095         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12096                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12097
12098                                 ;;
12099                         esac
12100                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12101                         ;;
12102                 esac
12103                 ;;
12104         (*)
12105                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12106                 ;;
12107         esac
12108         ;;
12109 (yes)
12110         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12111
12112         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12113
12114         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12115                 && test -z "${cf_tst_cflags}" \
12116                 && cf_fix_cppflags=no
12117         ;;
12118 esac
12119 done
12120
12121 if test -n "$cf_new_cflags" ; then
12122
12123         CFLAGS="$CFLAGS $cf_new_cflags"
12124 fi
12125
12126 if test -n "$cf_new_cppflags" ; then
12127
12128         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12129 fi
12130
12131 if test -n "$cf_new_extra_cppflags" ; then
12132
12133         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12134 fi
12135
12136 cf_add_libs="$cf_pkgconfig_libs"
12137 # Filter out duplicates - this happens with badly-designed ".pc" files...
12138 for cf_add_1lib in $LIBS
12139 do
12140         for cf_add_2lib in $cf_add_libs
12141         do
12142                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12143                 then
12144                         cf_add_1lib=
12145                         break
12146                 fi
12147         done
12148         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12149 done
12150 LIBS="$cf_add_libs"
12151
12152         :
12153 else
12154         cf_pkgconfig_incs=
12155         cf_pkgconfig_libs=
12156
12157 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12158
12159 echo "${as_me:-configure}:12159: testing ...before $LIBS ..." 1>&5
12160
12161 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
12162 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12163
12164 echo "${as_me:-configure}:12164: testing ...after  $LIBS ..." 1>&5
12165
12166 fi
12167
12168                 fi
12169                 ;;
12170         esac
12171
12172 echo "$as_me:12172: checking for usable X Toolkit package" >&5
12173 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
12174 if test "${cf_cv_xt_ice_compat+set}" = set; then
12175   echo $ECHO_N "(cached) $ECHO_C" >&6
12176 else
12177
12178 cat >conftest.$ac_ext <<_ACEOF
12179 #line 12179 "configure"
12180 #include "confdefs.h"
12181
12182 #include <X11/Shell.h>
12183
12184 int
12185 main ()
12186 {
12187 int num = IceConnectionNumber(0)
12188
12189   ;
12190   return 0;
12191 }
12192 _ACEOF
12193 rm -f conftest.$ac_objext conftest$ac_exeext
12194 if { (eval echo "$as_me:12194: \"$ac_link\"") >&5
12195   (eval $ac_link) 2>&5
12196   ac_status=$?
12197   echo "$as_me:12197: \$? = $ac_status" >&5
12198   (exit $ac_status); } &&
12199          { ac_try='test -s conftest$ac_exeext'
12200   { (eval echo "$as_me:12200: \"$ac_try\"") >&5
12201   (eval $ac_try) 2>&5
12202   ac_status=$?
12203   echo "$as_me:12203: \$? = $ac_status" >&5
12204   (exit $ac_status); }; }; then
12205   cf_cv_xt_ice_compat=yes
12206 else
12207   echo "$as_me: failed program was:" >&5
12208 cat conftest.$ac_ext >&5
12209 cf_cv_xt_ice_compat=no
12210 fi
12211 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12212 fi
12213 echo "$as_me:12213: result: $cf_cv_xt_ice_compat" >&5
12214 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
12215
12216         if test "$cf_cv_xt_ice_compat" = no
12217         then
12218                 # workaround for broken ".pc" files used for X Toolkit.
12219                 case "x$X_PRE_LIBS" in
12220                 (*-lICE*)
12221                         case "x$LIBS" in
12222                         (*-lICE*)
12223                                 ;;
12224                         (*)
12225                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
12226
12227 echo "${as_me:-configure}:12227: testing work around broken ICE dependency ..." 1>&5
12228
12229 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12230         test -n "$verbose" && echo "    found package ice" 1>&6
12231
12232 echo "${as_me:-configure}:12232: testing found package ice ..." 1>&5
12233
12234         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12235         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12236         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12237
12238 echo "${as_me:-configure}:12238: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12239
12240         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
12241
12242 echo "${as_me:-configure}:12242: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
12243
12244 cf_fix_cppflags=no
12245 cf_new_cflags=
12246 cf_new_cppflags=
12247 cf_new_extra_cppflags=
12248
12249 for cf_add_cflags in $cf_pkgconfig_incs
12250 do
12251 case $cf_fix_cppflags in
12252 (no)
12253         case $cf_add_cflags in
12254         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12255                 case $cf_add_cflags in
12256                 (-D*)
12257                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12258
12259                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12260                                 && test -z "${cf_tst_cflags}" \
12261                                 && cf_fix_cppflags=yes
12262
12263                         if test $cf_fix_cppflags = yes ; then
12264                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12265                                 continue
12266                         elif test "${cf_tst_cflags}" = "\"'" ; then
12267                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12268                                 continue
12269                         fi
12270                         ;;
12271                 esac
12272                 case "$CPPFLAGS" in
12273                 (*$cf_add_cflags)
12274                         ;;
12275                 (*)
12276                         case $cf_add_cflags in
12277                         (-D*)
12278                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12279
12280 CPPFLAGS=`echo "$CPPFLAGS" | \
12281         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12282                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12283
12284                                 ;;
12285                         esac
12286                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12287                         ;;
12288                 esac
12289                 ;;
12290         (*)
12291                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12292                 ;;
12293         esac
12294         ;;
12295 (yes)
12296         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12297
12298         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12299
12300         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12301                 && test -z "${cf_tst_cflags}" \
12302                 && cf_fix_cppflags=no
12303         ;;
12304 esac
12305 done
12306
12307 if test -n "$cf_new_cflags" ; then
12308
12309         CFLAGS="$CFLAGS $cf_new_cflags"
12310 fi
12311
12312 if test -n "$cf_new_cppflags" ; then
12313
12314         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12315 fi
12316
12317 if test -n "$cf_new_extra_cppflags" ; then
12318
12319         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12320 fi
12321
12322 cf_add_libs="$cf_pkgconfig_libs"
12323 # Filter out duplicates - this happens with badly-designed ".pc" files...
12324 for cf_add_1lib in $LIBS
12325 do
12326         for cf_add_2lib in $cf_add_libs
12327         do
12328                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12329                 then
12330                         cf_add_1lib=
12331                         break
12332                 fi
12333         done
12334         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12335 done
12336 LIBS="$cf_add_libs"
12337
12338 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12339         test -n "$verbose" && echo "    found package sm" 1>&6
12340
12341 echo "${as_me:-configure}:12341: testing found package sm ..." 1>&5
12342
12343         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12344         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12345         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12346
12347 echo "${as_me:-configure}:12347: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12348
12349         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12350
12351 echo "${as_me:-configure}:12351: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12352
12353 cf_fix_cppflags=no
12354 cf_new_cflags=
12355 cf_new_cppflags=
12356 cf_new_extra_cppflags=
12357
12358 for cf_add_cflags in $cf_pkgconfig_incs
12359 do
12360 case $cf_fix_cppflags in
12361 (no)
12362         case $cf_add_cflags in
12363         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12364                 case $cf_add_cflags in
12365                 (-D*)
12366                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12367
12368                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12369                                 && test -z "${cf_tst_cflags}" \
12370                                 && cf_fix_cppflags=yes
12371
12372                         if test $cf_fix_cppflags = yes ; then
12373                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12374                                 continue
12375                         elif test "${cf_tst_cflags}" = "\"'" ; then
12376                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12377                                 continue
12378                         fi
12379                         ;;
12380                 esac
12381                 case "$CPPFLAGS" in
12382                 (*$cf_add_cflags)
12383                         ;;
12384                 (*)
12385                         case $cf_add_cflags in
12386                         (-D*)
12387                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12388
12389 CPPFLAGS=`echo "$CPPFLAGS" | \
12390         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12391                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12392
12393                                 ;;
12394                         esac
12395                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12396                         ;;
12397                 esac
12398                 ;;
12399         (*)
12400                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12401                 ;;
12402         esac
12403         ;;
12404 (yes)
12405         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12406
12407         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12408
12409         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12410                 && test -z "${cf_tst_cflags}" \
12411                 && cf_fix_cppflags=no
12412         ;;
12413 esac
12414 done
12415
12416 if test -n "$cf_new_cflags" ; then
12417
12418         CFLAGS="$CFLAGS $cf_new_cflags"
12419 fi
12420
12421 if test -n "$cf_new_cppflags" ; then
12422
12423         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12424 fi
12425
12426 if test -n "$cf_new_extra_cppflags" ; then
12427
12428         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12429 fi
12430
12431 cf_add_libs="$cf_pkgconfig_libs"
12432 # Filter out duplicates - this happens with badly-designed ".pc" files...
12433 for cf_add_1lib in $LIBS
12434 do
12435         for cf_add_2lib in $cf_add_libs
12436         do
12437                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12438                 then
12439                         cf_add_1lib=
12440                         break
12441                 fi
12442         done
12443         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12444 done
12445 LIBS="$cf_add_libs"
12446
12447         :
12448 else
12449         cf_pkgconfig_incs=
12450         cf_pkgconfig_libs=
12451         :
12452 fi
12453
12454 else
12455         cf_pkgconfig_incs=
12456         cf_pkgconfig_libs=
12457
12458 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12459
12460 echo "${as_me:-configure}:12460: testing ...before $LIBS ..." 1>&5
12461
12462 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
12463 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12464
12465 echo "${as_me:-configure}:12465: testing ...after  $LIBS ..." 1>&5
12466
12467 fi
12468
12469                                 ;;
12470                         esac
12471                         ;;
12472                 esac
12473         fi
12474
12475         cf_have_X_LIBS=yes
12476
12477 else
12478         cf_pkgconfig_incs=
12479         cf_pkgconfig_libs=
12480
12481         LDFLAGS="$X_LIBS $LDFLAGS"
12482
12483 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12484
12485 echo "${as_me:-configure}:12485: testing checking additions to CFLAGS ..." 1>&5
12486
12487 cf_check_cflags="$CFLAGS"
12488 cf_check_cppflags="$CPPFLAGS"
12489
12490 cf_fix_cppflags=no
12491 cf_new_cflags=
12492 cf_new_cppflags=
12493 cf_new_extra_cppflags=
12494
12495 for cf_add_cflags in $X_CFLAGS
12496 do
12497 case $cf_fix_cppflags in
12498 (no)
12499         case $cf_add_cflags in
12500         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12501                 case $cf_add_cflags in
12502                 (-D*)
12503                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12504
12505                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12506                                 && test -z "${cf_tst_cflags}" \
12507                                 && cf_fix_cppflags=yes
12508
12509                         if test $cf_fix_cppflags = yes ; then
12510                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12511                                 continue
12512                         elif test "${cf_tst_cflags}" = "\"'" ; then
12513                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12514                                 continue
12515                         fi
12516                         ;;
12517                 esac
12518                 case "$CPPFLAGS" in
12519                 (*$cf_add_cflags)
12520                         ;;
12521                 (*)
12522                         case $cf_add_cflags in
12523                         (-D*)
12524                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12525
12526 CPPFLAGS=`echo "$CPPFLAGS" | \
12527         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12528                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12529
12530                                 ;;
12531                         esac
12532                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12533                         ;;
12534                 esac
12535                 ;;
12536         (*)
12537                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12538                 ;;
12539         esac
12540         ;;
12541 (yes)
12542         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12543
12544         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12545
12546         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12547                 && test -z "${cf_tst_cflags}" \
12548                 && cf_fix_cppflags=no
12549         ;;
12550 esac
12551 done
12552
12553 if test -n "$cf_new_cflags" ; then
12554         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12555
12556 echo "${as_me:-configure}:12556: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12557
12558         CFLAGS="$CFLAGS $cf_new_cflags"
12559 fi
12560
12561 if test -n "$cf_new_cppflags" ; then
12562         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12563
12564 echo "${as_me:-configure}:12564: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12565
12566         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12567 fi
12568
12569 if test -n "$cf_new_extra_cppflags" ; then
12570         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12571
12572 echo "${as_me:-configure}:12572: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12573
12574         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12575 fi
12576
12577 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12578 cat >conftest.$ac_ext <<_ACEOF
12579 #line 12579 "configure"
12580 #include "confdefs.h"
12581 #include <stdio.h>
12582 int
12583 main ()
12584 {
12585 printf("Hello world");
12586   ;
12587   return 0;
12588 }
12589 _ACEOF
12590 rm -f conftest.$ac_objext conftest$ac_exeext
12591 if { (eval echo "$as_me:12591: \"$ac_link\"") >&5
12592   (eval $ac_link) 2>&5
12593   ac_status=$?
12594   echo "$as_me:12594: \$? = $ac_status" >&5
12595   (exit $ac_status); } &&
12596          { ac_try='test -s conftest$ac_exeext'
12597   { (eval echo "$as_me:12597: \"$ac_try\"") >&5
12598   (eval $ac_try) 2>&5
12599   ac_status=$?
12600   echo "$as_me:12600: \$? = $ac_status" >&5
12601   (exit $ac_status); }; }; then
12602   :
12603 else
12604   echo "$as_me: failed program was:" >&5
12605 cat conftest.$ac_ext >&5
12606 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12607
12608 echo "${as_me:-configure}:12608: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12609
12610          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12611                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12612
12613 echo "${as_me:-configure}:12613: testing but keeping change to \$CPPFLAGS ..." 1>&5
12614
12615          fi
12616          CFLAGS="$cf_check_flags"
12617 fi
12618 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12619 fi
12620
12621         echo "$as_me:12621: checking for XOpenDisplay" >&5
12622 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12623 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12624   echo $ECHO_N "(cached) $ECHO_C" >&6
12625 else
12626   cat >conftest.$ac_ext <<_ACEOF
12627 #line 12627 "configure"
12628 #include "confdefs.h"
12629 /* System header to define __stub macros and hopefully few prototypes,
12630     which can conflict with char XOpenDisplay (); below.  */
12631 #include <assert.h>
12632 /* Override any gcc2 internal prototype to avoid an error.  */
12633 #ifdef __cplusplus
12634 extern "C"
12635 #endif
12636 /* We use char because int might match the return type of a gcc2
12637    builtin and then its argument prototype would still apply.  */
12638 char XOpenDisplay ();
12639 char (*f) ();
12640
12641 int
12642 main ()
12643 {
12644 /* The GNU C library defines this for functions which it implements
12645     to always fail with ENOSYS.  Some functions are actually named
12646     something starting with __ and the normal name is an alias.  */
12647 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12648 choke me
12649 #else
12650 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12651 #endif
12652
12653   ;
12654   return 0;
12655 }
12656 _ACEOF
12657 rm -f conftest.$ac_objext conftest$ac_exeext
12658 if { (eval echo "$as_me:12658: \"$ac_link\"") >&5
12659   (eval $ac_link) 2>&5
12660   ac_status=$?
12661   echo "$as_me:12661: \$? = $ac_status" >&5
12662   (exit $ac_status); } &&
12663          { ac_try='test -s conftest$ac_exeext'
12664   { (eval echo "$as_me:12664: \"$ac_try\"") >&5
12665   (eval $ac_try) 2>&5
12666   ac_status=$?
12667   echo "$as_me:12667: \$? = $ac_status" >&5
12668   (exit $ac_status); }; }; then
12669   ac_cv_func_XOpenDisplay=yes
12670 else
12671   echo "$as_me: failed program was:" >&5
12672 cat conftest.$ac_ext >&5
12673 ac_cv_func_XOpenDisplay=no
12674 fi
12675 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12676 fi
12677 echo "$as_me:12677: result: $ac_cv_func_XOpenDisplay" >&5
12678 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12679 if test $ac_cv_func_XOpenDisplay = yes; then
12680   :
12681 else
12682
12683         echo "$as_me:12683: checking for XOpenDisplay in -lX11" >&5
12684 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12685 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12686   echo $ECHO_N "(cached) $ECHO_C" >&6
12687 else
12688   ac_check_lib_save_LIBS=$LIBS
12689 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12690 cat >conftest.$ac_ext <<_ACEOF
12691 #line 12691 "configure"
12692 #include "confdefs.h"
12693
12694 /* Override any gcc2 internal prototype to avoid an error.  */
12695 #ifdef __cplusplus
12696 extern "C"
12697 #endif
12698 /* We use char because int might match the return type of a gcc2
12699    builtin and then its argument prototype would still apply.  */
12700 char XOpenDisplay ();
12701 int
12702 main ()
12703 {
12704 XOpenDisplay ();
12705   ;
12706   return 0;
12707 }
12708 _ACEOF
12709 rm -f conftest.$ac_objext conftest$ac_exeext
12710 if { (eval echo "$as_me:12710: \"$ac_link\"") >&5
12711   (eval $ac_link) 2>&5
12712   ac_status=$?
12713   echo "$as_me:12713: \$? = $ac_status" >&5
12714   (exit $ac_status); } &&
12715          { ac_try='test -s conftest$ac_exeext'
12716   { (eval echo "$as_me:12716: \"$ac_try\"") >&5
12717   (eval $ac_try) 2>&5
12718   ac_status=$?
12719   echo "$as_me:12719: \$? = $ac_status" >&5
12720   (exit $ac_status); }; }; then
12721   ac_cv_lib_X11_XOpenDisplay=yes
12722 else
12723   echo "$as_me: failed program was:" >&5
12724 cat conftest.$ac_ext >&5
12725 ac_cv_lib_X11_XOpenDisplay=no
12726 fi
12727 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12728 LIBS=$ac_check_lib_save_LIBS
12729 fi
12730 echo "$as_me:12730: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12731 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12732 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12733
12734 cf_add_libs="-lX11"
12735 # Filter out duplicates - this happens with badly-designed ".pc" files...
12736 for cf_add_1lib in $LIBS
12737 do
12738         for cf_add_2lib in $cf_add_libs
12739         do
12740                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12741                 then
12742                         cf_add_1lib=
12743                         break
12744                 fi
12745         done
12746         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12747 done
12748 LIBS="$cf_add_libs"
12749
12750 fi
12751
12752 fi
12753
12754         echo "$as_me:12754: checking for XtAppInitialize" >&5
12755 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12756 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12757   echo $ECHO_N "(cached) $ECHO_C" >&6
12758 else
12759   cat >conftest.$ac_ext <<_ACEOF
12760 #line 12760 "configure"
12761 #include "confdefs.h"
12762 /* System header to define __stub macros and hopefully few prototypes,
12763     which can conflict with char XtAppInitialize (); below.  */
12764 #include <assert.h>
12765 /* Override any gcc2 internal prototype to avoid an error.  */
12766 #ifdef __cplusplus
12767 extern "C"
12768 #endif
12769 /* We use char because int might match the return type of a gcc2
12770    builtin and then its argument prototype would still apply.  */
12771 char XtAppInitialize ();
12772 char (*f) ();
12773
12774 int
12775 main ()
12776 {
12777 /* The GNU C library defines this for functions which it implements
12778     to always fail with ENOSYS.  Some functions are actually named
12779     something starting with __ and the normal name is an alias.  */
12780 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12781 choke me
12782 #else
12783 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12784 #endif
12785
12786   ;
12787   return 0;
12788 }
12789 _ACEOF
12790 rm -f conftest.$ac_objext conftest$ac_exeext
12791 if { (eval echo "$as_me:12791: \"$ac_link\"") >&5
12792   (eval $ac_link) 2>&5
12793   ac_status=$?
12794   echo "$as_me:12794: \$? = $ac_status" >&5
12795   (exit $ac_status); } &&
12796          { ac_try='test -s conftest$ac_exeext'
12797   { (eval echo "$as_me:12797: \"$ac_try\"") >&5
12798   (eval $ac_try) 2>&5
12799   ac_status=$?
12800   echo "$as_me:12800: \$? = $ac_status" >&5
12801   (exit $ac_status); }; }; then
12802   ac_cv_func_XtAppInitialize=yes
12803 else
12804   echo "$as_me: failed program was:" >&5
12805 cat conftest.$ac_ext >&5
12806 ac_cv_func_XtAppInitialize=no
12807 fi
12808 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12809 fi
12810 echo "$as_me:12810: result: $ac_cv_func_XtAppInitialize" >&5
12811 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12812 if test $ac_cv_func_XtAppInitialize = yes; then
12813   :
12814 else
12815
12816         echo "$as_me:12816: checking for XtAppInitialize in -lXt" >&5
12817 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12818 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12819   echo $ECHO_N "(cached) $ECHO_C" >&6
12820 else
12821   ac_check_lib_save_LIBS=$LIBS
12822 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12823 cat >conftest.$ac_ext <<_ACEOF
12824 #line 12824 "configure"
12825 #include "confdefs.h"
12826
12827 /* Override any gcc2 internal prototype to avoid an error.  */
12828 #ifdef __cplusplus
12829 extern "C"
12830 #endif
12831 /* We use char because int might match the return type of a gcc2
12832    builtin and then its argument prototype would still apply.  */
12833 char XtAppInitialize ();
12834 int
12835 main ()
12836 {
12837 XtAppInitialize ();
12838   ;
12839   return 0;
12840 }
12841 _ACEOF
12842 rm -f conftest.$ac_objext conftest$ac_exeext
12843 if { (eval echo "$as_me:12843: \"$ac_link\"") >&5
12844   (eval $ac_link) 2>&5
12845   ac_status=$?
12846   echo "$as_me:12846: \$? = $ac_status" >&5
12847   (exit $ac_status); } &&
12848          { ac_try='test -s conftest$ac_exeext'
12849   { (eval echo "$as_me:12849: \"$ac_try\"") >&5
12850   (eval $ac_try) 2>&5
12851   ac_status=$?
12852   echo "$as_me:12852: \$? = $ac_status" >&5
12853   (exit $ac_status); }; }; then
12854   ac_cv_lib_Xt_XtAppInitialize=yes
12855 else
12856   echo "$as_me: failed program was:" >&5
12857 cat conftest.$ac_ext >&5
12858 ac_cv_lib_Xt_XtAppInitialize=no
12859 fi
12860 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12861 LIBS=$ac_check_lib_save_LIBS
12862 fi
12863 echo "$as_me:12863: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12864 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12865 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12866
12867 cat >>confdefs.h <<\EOF
12868 #define HAVE_LIBXT 1
12869 EOF
12870
12871                  cf_have_X_LIBS=Xt
12872                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12873 fi
12874
12875 fi
12876
12877 fi
12878
12879 if test $cf_have_X_LIBS = no ; then
12880         { echo "$as_me:12880: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12881 test program.  You will have to check and add the proper libraries by hand
12882 to makefile." >&5
12883 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12884 test program.  You will have to check and add the proper libraries by hand
12885 to makefile." >&2;}
12886 fi
12887
12888 cf_x_athena_root=$cf_x_athena
12889 cf_x_athena_inc=""
12890
12891 for cf_path in default \
12892         /usr/contrib/X11R6 \
12893         /usr/contrib/X11R5 \
12894         /usr/lib/X11R5 \
12895         /usr/local
12896 do
12897         if test -z "$cf_x_athena_inc" ; then
12898                 cf_save="$CPPFLAGS"
12899                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12900                 if test $cf_path != default ; then
12901                         CPPFLAGS="$cf_save -I$cf_path/include"
12902                         echo "$as_me:12902: checking for $cf_test in $cf_path" >&5
12903 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12904                 else
12905                         echo "$as_me:12905: checking for $cf_test" >&5
12906 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12907                 fi
12908                 cat >conftest.$ac_ext <<_ACEOF
12909 #line 12909 "configure"
12910 #include "confdefs.h"
12911
12912 #include <X11/Intrinsic.h>
12913 #include <$cf_test>
12914 int
12915 main ()
12916 {
12917
12918   ;
12919   return 0;
12920 }
12921 _ACEOF
12922 rm -f conftest.$ac_objext
12923 if { (eval echo "$as_me:12923: \"$ac_compile\"") >&5
12924   (eval $ac_compile) 2>&5
12925   ac_status=$?
12926   echo "$as_me:12926: \$? = $ac_status" >&5
12927   (exit $ac_status); } &&
12928          { ac_try='test -s conftest.$ac_objext'
12929   { (eval echo "$as_me:12929: \"$ac_try\"") >&5
12930   (eval $ac_try) 2>&5
12931   ac_status=$?
12932   echo "$as_me:12932: \$? = $ac_status" >&5
12933   (exit $ac_status); }; }; then
12934   cf_result=yes
12935 else
12936   echo "$as_me: failed program was:" >&5
12937 cat conftest.$ac_ext >&5
12938 cf_result=no
12939 fi
12940 rm -f conftest.$ac_objext conftest.$ac_ext
12941                 echo "$as_me:12941: result: $cf_result" >&5
12942 echo "${ECHO_T}$cf_result" >&6
12943                 if test "$cf_result" = yes ; then
12944                         cf_x_athena_inc=$cf_path
12945                         break
12946                 else
12947                         CPPFLAGS="$cf_save"
12948                 fi
12949         fi
12950 done
12951
12952 if test -z "$cf_x_athena_inc" ; then
12953         { echo "$as_me:12953: WARNING: Unable to successfully find Athena header files with test program" >&5
12954 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12955 elif test "$cf_x_athena_inc" != default ; then
12956         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12957 fi
12958
12959 cf_x_athena_root=$cf_x_athena
12960 cf_x_athena_lib=""
12961
12962 for cf_path in default \
12963         /usr/contrib/X11R6 \
12964         /usr/contrib/X11R5 \
12965         /usr/lib/X11R5 \
12966         /usr/local
12967 do
12968         for cf_lib in \
12969                 ${cf_x_athena_root} \
12970                 ${cf_x_athena_root}7 \
12971                 ${cf_x_athena_root}6
12972         do
12973         for cf_libs in \
12974                 "-l$cf_lib -lXmu" \
12975                 "-l$cf_lib -lXpm -lXmu" \
12976                 "-l${cf_lib}_s -lXmu_s"
12977         do
12978                 if test -z "$cf_x_athena_lib" ; then
12979                         cf_save="$LIBS"
12980                         cf_test=XawSimpleMenuAddGlobalActions
12981                         if test $cf_path != default ; then
12982
12983 cf_add_libs="-L$cf_path/lib $cf_libs"
12984 # Filter out duplicates - this happens with badly-designed ".pc" files...
12985 for cf_add_1lib in $LIBS
12986 do
12987         for cf_add_2lib in $cf_add_libs
12988         do
12989                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12990                 then
12991                         cf_add_1lib=
12992                         break
12993                 fi
12994         done
12995         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12996 done
12997 LIBS="$cf_add_libs"
12998
12999                                 echo "$as_me:12999: checking for $cf_libs in $cf_path" >&5
13000 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
13001                         else
13002
13003 cf_add_libs="$cf_libs"
13004 # Filter out duplicates - this happens with badly-designed ".pc" files...
13005 for cf_add_1lib in $LIBS
13006 do
13007         for cf_add_2lib in $cf_add_libs
13008         do
13009                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13010                 then
13011                         cf_add_1lib=
13012                         break
13013                 fi
13014         done
13015         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13016 done
13017 LIBS="$cf_add_libs"
13018
13019                                 echo "$as_me:13019: checking for $cf_test in $cf_libs" >&5
13020 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
13021                         fi
13022                         cat >conftest.$ac_ext <<_ACEOF
13023 #line 13023 "configure"
13024 #include "confdefs.h"
13025
13026 #include <X11/Intrinsic.h>
13027 #include <X11/$cf_x_athena_root/SimpleMenu.h>
13028
13029 int
13030 main ()
13031 {
13032
13033 $cf_test((XtAppContext) 0)
13034   ;
13035   return 0;
13036 }
13037 _ACEOF
13038 rm -f conftest.$ac_objext conftest$ac_exeext
13039 if { (eval echo "$as_me:13039: \"$ac_link\"") >&5
13040   (eval $ac_link) 2>&5
13041   ac_status=$?
13042   echo "$as_me:13042: \$? = $ac_status" >&5
13043   (exit $ac_status); } &&
13044          { ac_try='test -s conftest$ac_exeext'
13045   { (eval echo "$as_me:13045: \"$ac_try\"") >&5
13046   (eval $ac_try) 2>&5
13047   ac_status=$?
13048   echo "$as_me:13048: \$? = $ac_status" >&5
13049   (exit $ac_status); }; }; then
13050   cf_result=yes
13051 else
13052   echo "$as_me: failed program was:" >&5
13053 cat conftest.$ac_ext >&5
13054 cf_result=no
13055 fi
13056 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13057                         echo "$as_me:13057: result: $cf_result" >&5
13058 echo "${ECHO_T}$cf_result" >&6
13059                         if test "$cf_result" = yes ; then
13060                                 cf_x_athena_lib="$cf_libs"
13061                                 break
13062                         fi
13063                         LIBS="$cf_save"
13064                 fi
13065         done # cf_libs
13066                 test -n "$cf_x_athena_lib" && break
13067         done # cf_lib
13068 done
13069
13070 if test -z "$cf_x_athena_lib" ; then
13071         { { echo "$as_me:13071: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
13072 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
13073    { (exit 1); exit 1; }; }
13074 fi
13075
13076 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13077
13078 cat >>confdefs.h <<EOF
13079 #define $cf_x_athena_LIBS 1
13080 EOF
13081
13082 fi
13083
13084 if test -n "$ac_tool_prefix"; then
13085   for ac_prog in xcurses-config
13086   do
13087     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
13088 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
13089 echo "$as_me:13089: checking for $ac_word" >&5
13090 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13091 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
13092   echo $ECHO_N "(cached) $ECHO_C" >&6
13093 else
13094   if test -n "$XCURSES_CONFIG"; then
13095   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
13096 else
13097   ac_save_IFS=$IFS; IFS=$ac_path_separator
13098 ac_dummy="$PATH"
13099 for ac_dir in $ac_dummy; do
13100   IFS=$ac_save_IFS
13101   test -z "$ac_dir" && ac_dir=.
13102   $as_executable_p "$ac_dir/$ac_word" || continue
13103 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
13104 echo "$as_me:13104: found $ac_dir/$ac_word" >&5
13105 break
13106 done
13107
13108 fi
13109 fi
13110 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
13111 if test -n "$XCURSES_CONFIG"; then
13112   echo "$as_me:13112: result: $XCURSES_CONFIG" >&5
13113 echo "${ECHO_T}$XCURSES_CONFIG" >&6
13114 else
13115   echo "$as_me:13115: result: no" >&5
13116 echo "${ECHO_T}no" >&6
13117 fi
13118
13119     test -n "$XCURSES_CONFIG" && break
13120   done
13121 fi
13122 if test -z "$XCURSES_CONFIG"; then
13123   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
13124   for ac_prog in xcurses-config
13125 do
13126   # Extract the first word of "$ac_prog", so it can be a program name with args.
13127 set dummy $ac_prog; ac_word=$2
13128 echo "$as_me:13128: checking for $ac_word" >&5
13129 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13130 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
13131   echo $ECHO_N "(cached) $ECHO_C" >&6
13132 else
13133   if test -n "$ac_ct_XCURSES_CONFIG"; then
13134   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
13135 else
13136   ac_save_IFS=$IFS; IFS=$ac_path_separator
13137 ac_dummy="$PATH"
13138 for ac_dir in $ac_dummy; do
13139   IFS=$ac_save_IFS
13140   test -z "$ac_dir" && ac_dir=.
13141   $as_executable_p "$ac_dir/$ac_word" || continue
13142 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
13143 echo "$as_me:13143: found $ac_dir/$ac_word" >&5
13144 break
13145 done
13146
13147 fi
13148 fi
13149 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
13150 if test -n "$ac_ct_XCURSES_CONFIG"; then
13151   echo "$as_me:13151: result: $ac_ct_XCURSES_CONFIG" >&5
13152 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
13153 else
13154   echo "$as_me:13154: result: no" >&5
13155 echo "${ECHO_T}no" >&6
13156 fi
13157
13158   test -n "$ac_ct_XCURSES_CONFIG" && break
13159 done
13160 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
13161
13162   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
13163 fi
13164
13165 if test "$XCURSES_CONFIG" != none ; then
13166
13167 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
13168
13169 cf_add_libs="`$XCURSES_CONFIG --libs`"
13170 # Filter out duplicates - this happens with badly-designed ".pc" files...
13171 for cf_add_1lib in $LIBS
13172 do
13173         for cf_add_2lib in $cf_add_libs
13174         do
13175                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13176                 then
13177                         cf_add_1lib=
13178                         break
13179                 fi
13180         done
13181         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13182 done
13183 LIBS="$cf_add_libs"
13184
13185 cf_cv_lib_XCurses=yes
13186
13187 else
13188
13189 LDFLAGS="$LDFLAGS $X_LIBS"
13190
13191 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13192
13193 echo "${as_me:-configure}:13193: testing checking additions to CFLAGS ..." 1>&5
13194
13195 cf_check_cflags="$CFLAGS"
13196 cf_check_cppflags="$CPPFLAGS"
13197
13198 cf_fix_cppflags=no
13199 cf_new_cflags=
13200 cf_new_cppflags=
13201 cf_new_extra_cppflags=
13202
13203 for cf_add_cflags in $X_CFLAGS
13204 do
13205 case $cf_fix_cppflags in
13206 (no)
13207         case $cf_add_cflags in
13208         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13209                 case $cf_add_cflags in
13210                 (-D*)
13211                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13212
13213                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13214                                 && test -z "${cf_tst_cflags}" \
13215                                 && cf_fix_cppflags=yes
13216
13217                         if test $cf_fix_cppflags = yes ; then
13218                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13219                                 continue
13220                         elif test "${cf_tst_cflags}" = "\"'" ; then
13221                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13222                                 continue
13223                         fi
13224                         ;;
13225                 esac
13226                 case "$CPPFLAGS" in
13227                 (*$cf_add_cflags)
13228                         ;;
13229                 (*)
13230                         case $cf_add_cflags in
13231                         (-D*)
13232                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13233
13234 CPPFLAGS=`echo "$CPPFLAGS" | \
13235         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13236                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13237
13238                                 ;;
13239                         esac
13240                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
13241                         ;;
13242                 esac
13243                 ;;
13244         (*)
13245                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
13246                 ;;
13247         esac
13248         ;;
13249 (yes)
13250         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13251
13252         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13253
13254         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13255                 && test -z "${cf_tst_cflags}" \
13256                 && cf_fix_cppflags=no
13257         ;;
13258 esac
13259 done
13260
13261 if test -n "$cf_new_cflags" ; then
13262         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13263
13264 echo "${as_me:-configure}:13264: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13265
13266         CFLAGS="$CFLAGS $cf_new_cflags"
13267 fi
13268
13269 if test -n "$cf_new_cppflags" ; then
13270         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13271
13272 echo "${as_me:-configure}:13272: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13273
13274         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
13275 fi
13276
13277 if test -n "$cf_new_extra_cppflags" ; then
13278         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13279
13280 echo "${as_me:-configure}:13280: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13281
13282         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
13283 fi
13284
13285 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13286 cat >conftest.$ac_ext <<_ACEOF
13287 #line 13287 "configure"
13288 #include "confdefs.h"
13289 #include <stdio.h>
13290 int
13291 main ()
13292 {
13293 printf("Hello world");
13294   ;
13295   return 0;
13296 }
13297 _ACEOF
13298 rm -f conftest.$ac_objext conftest$ac_exeext
13299 if { (eval echo "$as_me:13299: \"$ac_link\"") >&5
13300   (eval $ac_link) 2>&5
13301   ac_status=$?
13302   echo "$as_me:13302: \$? = $ac_status" >&5
13303   (exit $ac_status); } &&
13304          { ac_try='test -s conftest$ac_exeext'
13305   { (eval echo "$as_me:13305: \"$ac_try\"") >&5
13306   (eval $ac_try) 2>&5
13307   ac_status=$?
13308   echo "$as_me:13308: \$? = $ac_status" >&5
13309   (exit $ac_status); }; }; then
13310   :
13311 else
13312   echo "$as_me: failed program was:" >&5
13313 cat conftest.$ac_ext >&5
13314 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13315
13316 echo "${as_me:-configure}:13316: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13317
13318          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13319                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13320
13321 echo "${as_me:-configure}:13321: testing but keeping change to \$CPPFLAGS ..." 1>&5
13322
13323          fi
13324          CFLAGS="$cf_check_flags"
13325 fi
13326 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13327 fi
13328
13329 echo "$as_me:13329: checking for XOpenDisplay in -lX11" >&5
13330 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13331 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13332   echo $ECHO_N "(cached) $ECHO_C" >&6
13333 else
13334   ac_check_lib_save_LIBS=$LIBS
13335 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13336 cat >conftest.$ac_ext <<_ACEOF
13337 #line 13337 "configure"
13338 #include "confdefs.h"
13339
13340 /* Override any gcc2 internal prototype to avoid an error.  */
13341 #ifdef __cplusplus
13342 extern "C"
13343 #endif
13344 /* We use char because int might match the return type of a gcc2
13345    builtin and then its argument prototype would still apply.  */
13346 char XOpenDisplay ();
13347 int
13348 main ()
13349 {
13350 XOpenDisplay ();
13351   ;
13352   return 0;
13353 }
13354 _ACEOF
13355 rm -f conftest.$ac_objext conftest$ac_exeext
13356 if { (eval echo "$as_me:13356: \"$ac_link\"") >&5
13357   (eval $ac_link) 2>&5
13358   ac_status=$?
13359   echo "$as_me:13359: \$? = $ac_status" >&5
13360   (exit $ac_status); } &&
13361          { ac_try='test -s conftest$ac_exeext'
13362   { (eval echo "$as_me:13362: \"$ac_try\"") >&5
13363   (eval $ac_try) 2>&5
13364   ac_status=$?
13365   echo "$as_me:13365: \$? = $ac_status" >&5
13366   (exit $ac_status); }; }; then
13367   ac_cv_lib_X11_XOpenDisplay=yes
13368 else
13369   echo "$as_me: failed program was:" >&5
13370 cat conftest.$ac_ext >&5
13371 ac_cv_lib_X11_XOpenDisplay=no
13372 fi
13373 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13374 LIBS=$ac_check_lib_save_LIBS
13375 fi
13376 echo "$as_me:13376: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13377 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13378 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13379
13380 cf_add_libs="-lX11"
13381 # Filter out duplicates - this happens with badly-designed ".pc" files...
13382 for cf_add_1lib in $LIBS
13383 do
13384         for cf_add_2lib in $cf_add_libs
13385         do
13386                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13387                 then
13388                         cf_add_1lib=
13389                         break
13390                 fi
13391         done
13392         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13393 done
13394 LIBS="$cf_add_libs"
13395
13396 fi
13397
13398 echo "$as_me:13398: checking for XCurses library" >&5
13399 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13400 if test "${cf_cv_lib_XCurses+set}" = set; then
13401   echo $ECHO_N "(cached) $ECHO_C" >&6
13402 else
13403
13404 cf_add_libs="-lXCurses"
13405 # Filter out duplicates - this happens with badly-designed ".pc" files...
13406 for cf_add_1lib in $LIBS
13407 do
13408         for cf_add_2lib in $cf_add_libs
13409         do
13410                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13411                 then
13412                         cf_add_1lib=
13413                         break
13414                 fi
13415         done
13416         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13417 done
13418 LIBS="$cf_add_libs"
13419
13420 cat >conftest.$ac_ext <<_ACEOF
13421 #line 13421 "configure"
13422 #include "confdefs.h"
13423
13424 #include <xcurses.h>
13425 char *XCursesProgramName = "test";
13426
13427 int
13428 main ()
13429 {
13430 XCursesExit();
13431   ;
13432   return 0;
13433 }
13434 _ACEOF
13435 rm -f conftest.$ac_objext conftest$ac_exeext
13436 if { (eval echo "$as_me:13436: \"$ac_link\"") >&5
13437   (eval $ac_link) 2>&5
13438   ac_status=$?
13439   echo "$as_me:13439: \$? = $ac_status" >&5
13440   (exit $ac_status); } &&
13441          { ac_try='test -s conftest$ac_exeext'
13442   { (eval echo "$as_me:13442: \"$ac_try\"") >&5
13443   (eval $ac_try) 2>&5
13444   ac_status=$?
13445   echo "$as_me:13445: \$? = $ac_status" >&5
13446   (exit $ac_status); }; }; then
13447   cf_cv_lib_XCurses=yes
13448 else
13449   echo "$as_me: failed program was:" >&5
13450 cat conftest.$ac_ext >&5
13451 cf_cv_lib_XCurses=no
13452 fi
13453 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13454
13455 fi
13456 echo "$as_me:13456: result: $cf_cv_lib_XCurses" >&5
13457 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
13458
13459 fi
13460
13461 if test $cf_cv_lib_XCurses = yes ; then
13462
13463 cat >>confdefs.h <<\EOF
13464 #define UNIX 1
13465 EOF
13466
13467 cat >>confdefs.h <<\EOF
13468 #define XCURSES 1
13469 EOF
13470
13471         echo "$as_me:13471: checking for xcurses.h" >&5
13472 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
13473 if test "${ac_cv_header_xcurses_h+set}" = set; then
13474   echo $ECHO_N "(cached) $ECHO_C" >&6
13475 else
13476   cat >conftest.$ac_ext <<_ACEOF
13477 #line 13477 "configure"
13478 #include "confdefs.h"
13479 #include <xcurses.h>
13480 _ACEOF
13481 if { (eval echo "$as_me:13481: \"$ac_cpp conftest.$ac_ext\"") >&5
13482   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13483   ac_status=$?
13484   egrep -v '^ *\+' conftest.er1 >conftest.err
13485   rm -f conftest.er1
13486   cat conftest.err >&5
13487   echo "$as_me:13487: \$? = $ac_status" >&5
13488   (exit $ac_status); } >/dev/null; then
13489   if test -s conftest.err; then
13490     ac_cpp_err=$ac_c_preproc_warn_flag
13491   else
13492     ac_cpp_err=
13493   fi
13494 else
13495   ac_cpp_err=yes
13496 fi
13497 if test -z "$ac_cpp_err"; then
13498   ac_cv_header_xcurses_h=yes
13499 else
13500   echo "$as_me: failed program was:" >&5
13501   cat conftest.$ac_ext >&5
13502   ac_cv_header_xcurses_h=no
13503 fi
13504 rm -f conftest.err conftest.$ac_ext
13505 fi
13506 echo "$as_me:13506: result: $ac_cv_header_xcurses_h" >&5
13507 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
13508 if test $ac_cv_header_xcurses_h = yes; then
13509
13510 cat >>confdefs.h <<\EOF
13511 #define HAVE_XCURSES 1
13512 EOF
13513
13514 fi
13515
13516 else
13517         { { echo "$as_me:13517: error: Cannot link with XCurses" >&5
13518 echo "$as_me: error: Cannot link with XCurses" >&2;}
13519    { (exit 1); exit 1; }; }
13520 fi
13521
13522         ;;
13523 (*)
13524         { { echo "$as_me:13524: error: unexpected screen-value: $cf_cv_screen" >&5
13525 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
13526    { (exit 1); exit 1; }; }
13527         ;;
13528 esac
13529
13530 : ${cf_nculib_root:=$cf_cv_screen}
13531 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
13532 echo "$as_me:13532: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
13533 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
13534 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13535   echo $ECHO_N "(cached) $ECHO_C" >&6
13536 else
13537   ac_check_lib_save_LIBS=$LIBS
13538 LIBS="-l$cf_nculib_root  $LIBS"
13539 cat >conftest.$ac_ext <<_ACEOF
13540 #line 13540 "configure"
13541 #include "confdefs.h"
13542
13543 /* Override any gcc2 internal prototype to avoid an error.  */
13544 #ifdef __cplusplus
13545 extern "C"
13546 #endif
13547 /* We use char because int might match the return type of a gcc2
13548    builtin and then its argument prototype would still apply.  */
13549 char _nc_init_pthreads ();
13550 int
13551 main ()
13552 {
13553 _nc_init_pthreads ();
13554   ;
13555   return 0;
13556 }
13557 _ACEOF
13558 rm -f conftest.$ac_objext conftest$ac_exeext
13559 if { (eval echo "$as_me:13559: \"$ac_link\"") >&5
13560   (eval $ac_link) 2>&5
13561   ac_status=$?
13562   echo "$as_me:13562: \$? = $ac_status" >&5
13563   (exit $ac_status); } &&
13564          { ac_try='test -s conftest$ac_exeext'
13565   { (eval echo "$as_me:13565: \"$ac_try\"") >&5
13566   (eval $ac_try) 2>&5
13567   ac_status=$?
13568   echo "$as_me:13568: \$? = $ac_status" >&5
13569   (exit $ac_status); }; }; then
13570   eval "$as_ac_Lib=yes"
13571 else
13572   echo "$as_me: failed program was:" >&5
13573 cat conftest.$ac_ext >&5
13574 eval "$as_ac_Lib=no"
13575 fi
13576 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13577 LIBS=$ac_check_lib_save_LIBS
13578 fi
13579 echo "$as_me:13579: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13580 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13581 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13582   cf_cv_ncurses_pthreads=yes
13583 else
13584   cf_cv_ncurses_pthreads=no
13585 fi
13586
13587 if test "$cf_cv_ncurses_pthreads" = yes
13588 then
13589
13590 cf_add_libs="-lpthread"
13591 # Filter out duplicates - this happens with badly-designed ".pc" files...
13592 for cf_add_1lib in $LIBS
13593 do
13594         for cf_add_2lib in $cf_add_libs
13595         do
13596                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13597                 then
13598                         cf_add_1lib=
13599                         break
13600                 fi
13601         done
13602         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13603 done
13604 LIBS="$cf_add_libs"
13605
13606 fi
13607
13608 case $cf_cv_screen in
13609 (ncurses*)
13610         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
13611         ;;
13612 (curses|curses_*)
13613
13614 echo "$as_me:13614: checking for NetBSD form.h" >&5
13615 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
13616 if test "${cf_cv_netbsd_form_h+set}" = set; then
13617   echo $ECHO_N "(cached) $ECHO_C" >&6
13618 else
13619
13620 cat >conftest.$ac_ext <<_ACEOF
13621 #line 13621 "configure"
13622 #include "confdefs.h"
13623
13624 #include <${cf_cv_ncurses_header:-curses.h}>
13625 #include <form.h>
13626
13627 int
13628 main ()
13629 {
13630
13631         FORM *form;
13632         int y = current_field(form)->cursor_ypos;
13633         int x = current_field(form)->cursor_xpos;
13634
13635   ;
13636   return 0;
13637 }
13638 _ACEOF
13639 rm -f conftest.$ac_objext
13640 if { (eval echo "$as_me:13640: \"$ac_compile\"") >&5
13641   (eval $ac_compile) 2>&5
13642   ac_status=$?
13643   echo "$as_me:13643: \$? = $ac_status" >&5
13644   (exit $ac_status); } &&
13645          { ac_try='test -s conftest.$ac_objext'
13646   { (eval echo "$as_me:13646: \"$ac_try\"") >&5
13647   (eval $ac_try) 2>&5
13648   ac_status=$?
13649   echo "$as_me:13649: \$? = $ac_status" >&5
13650   (exit $ac_status); }; }; then
13651   cf_cv_netbsd_form_h=yes
13652
13653 else
13654   echo "$as_me: failed program was:" >&5
13655 cat conftest.$ac_ext >&5
13656 cf_cv_netbsd_form_h=no
13657 fi
13658 rm -f conftest.$ac_objext conftest.$ac_ext
13659
13660 fi
13661 echo "$as_me:13661: result: $cf_cv_netbsd_form_h" >&5
13662 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13663
13664 test "$cf_cv_netbsd_form_h" = yes &&
13665 cat >>confdefs.h <<\EOF
13666 #define HAVE_NETBSD_FORM_H 1
13667 EOF
13668
13669 echo "$as_me:13669: checking for NetBSD menu.h" >&5
13670 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13671 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13672   echo $ECHO_N "(cached) $ECHO_C" >&6
13673 else
13674
13675 cat >conftest.$ac_ext <<_ACEOF
13676 #line 13676 "configure"
13677 #include "confdefs.h"
13678
13679 #include <${cf_cv_ncurses_header:-curses.h}>
13680 #include <menu.h>
13681
13682 int
13683 main ()
13684 {
13685
13686         MENU *menu;
13687         int y = menu->max_item_width;
13688
13689   ;
13690   return 0;
13691 }
13692 _ACEOF
13693 rm -f conftest.$ac_objext
13694 if { (eval echo "$as_me:13694: \"$ac_compile\"") >&5
13695   (eval $ac_compile) 2>&5
13696   ac_status=$?
13697   echo "$as_me:13697: \$? = $ac_status" >&5
13698   (exit $ac_status); } &&
13699          { ac_try='test -s conftest.$ac_objext'
13700   { (eval echo "$as_me:13700: \"$ac_try\"") >&5
13701   (eval $ac_try) 2>&5
13702   ac_status=$?
13703   echo "$as_me:13703: \$? = $ac_status" >&5
13704   (exit $ac_status); }; }; then
13705   cf_cv_netbsd_menu_h=yes
13706
13707 else
13708   echo "$as_me: failed program was:" >&5
13709 cat conftest.$ac_ext >&5
13710 cf_cv_netbsd_menu_h=no
13711 fi
13712 rm -f conftest.$ac_objext conftest.$ac_ext
13713
13714 fi
13715 echo "$as_me:13715: result: $cf_cv_netbsd_menu_h" >&5
13716 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13717
13718 test "$cf_cv_netbsd_menu_h" = yes &&
13719 cat >>confdefs.h <<\EOF
13720 #define HAVE_NETBSD_MENU_H 1
13721 EOF
13722
13723         ;;
13724 esac
13725
13726 case $cf_cv_screen in
13727 (pdcurses)
13728         ;;
13729 (*)
13730         # look for curses-related libraries
13731
13732 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13733 echo "$as_me:13733: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13734 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13735 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13736   echo $ECHO_N "(cached) $ECHO_C" >&6
13737 else
13738   ac_check_lib_save_LIBS=$LIBS
13739 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13740 cat >conftest.$ac_ext <<_ACEOF
13741 #line 13741 "configure"
13742 #include "confdefs.h"
13743
13744 /* Override any gcc2 internal prototype to avoid an error.  */
13745 #ifdef __cplusplus
13746 extern "C"
13747 #endif
13748 /* We use char because int might match the return type of a gcc2
13749    builtin and then its argument prototype would still apply.  */
13750 char new_panel ();
13751 int
13752 main ()
13753 {
13754 new_panel ();
13755   ;
13756   return 0;
13757 }
13758 _ACEOF
13759 rm -f conftest.$ac_objext conftest$ac_exeext
13760 if { (eval echo "$as_me:13760: \"$ac_link\"") >&5
13761   (eval $ac_link) 2>&5
13762   ac_status=$?
13763   echo "$as_me:13763: \$? = $ac_status" >&5
13764   (exit $ac_status); } &&
13765          { ac_try='test -s conftest$ac_exeext'
13766   { (eval echo "$as_me:13766: \"$ac_try\"") >&5
13767   (eval $ac_try) 2>&5
13768   ac_status=$?
13769   echo "$as_me:13769: \$? = $ac_status" >&5
13770   (exit $ac_status); }; }; then
13771   eval "$as_ac_Lib=yes"
13772 else
13773   echo "$as_me: failed program was:" >&5
13774 cat conftest.$ac_ext >&5
13775 eval "$as_ac_Lib=no"
13776 fi
13777 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13778 LIBS=$ac_check_lib_save_LIBS
13779 fi
13780 echo "$as_me:13780: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13781 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13782 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13783
13784 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13785
13786 cf_add_libs="-lpanel$cf_cv_libtype"
13787 # Filter out duplicates - this happens with badly-designed ".pc" files...
13788 for cf_add_1lib in $LIBS
13789 do
13790         for cf_add_2lib in $cf_add_libs
13791         do
13792                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13793                 then
13794                         cf_add_1lib=
13795                         break
13796                 fi
13797         done
13798         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13799 done
13800 LIBS="$cf_add_libs"
13801
13802 cat >>confdefs.h <<EOF
13803 #define $cf_upper 1
13804 EOF
13805
13806 fi
13807
13808 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13809 echo "$as_me:13809: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13810 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13811 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13812   echo $ECHO_N "(cached) $ECHO_C" >&6
13813 else
13814   ac_check_lib_save_LIBS=$LIBS
13815 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13816 cat >conftest.$ac_ext <<_ACEOF
13817 #line 13817 "configure"
13818 #include "confdefs.h"
13819
13820 /* Override any gcc2 internal prototype to avoid an error.  */
13821 #ifdef __cplusplus
13822 extern "C"
13823 #endif
13824 /* We use char because int might match the return type of a gcc2
13825    builtin and then its argument prototype would still apply.  */
13826 char menu_driver ();
13827 int
13828 main ()
13829 {
13830 menu_driver ();
13831   ;
13832   return 0;
13833 }
13834 _ACEOF
13835 rm -f conftest.$ac_objext conftest$ac_exeext
13836 if { (eval echo "$as_me:13836: \"$ac_link\"") >&5
13837   (eval $ac_link) 2>&5
13838   ac_status=$?
13839   echo "$as_me:13839: \$? = $ac_status" >&5
13840   (exit $ac_status); } &&
13841          { ac_try='test -s conftest$ac_exeext'
13842   { (eval echo "$as_me:13842: \"$ac_try\"") >&5
13843   (eval $ac_try) 2>&5
13844   ac_status=$?
13845   echo "$as_me:13845: \$? = $ac_status" >&5
13846   (exit $ac_status); }; }; then
13847   eval "$as_ac_Lib=yes"
13848 else
13849   echo "$as_me: failed program was:" >&5
13850 cat conftest.$ac_ext >&5
13851 eval "$as_ac_Lib=no"
13852 fi
13853 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13854 LIBS=$ac_check_lib_save_LIBS
13855 fi
13856 echo "$as_me:13856: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13857 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13858 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13859
13860 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13861
13862 cf_add_libs="-lmenu$cf_cv_libtype"
13863 # Filter out duplicates - this happens with badly-designed ".pc" files...
13864 for cf_add_1lib in $LIBS
13865 do
13866         for cf_add_2lib in $cf_add_libs
13867         do
13868                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13869                 then
13870                         cf_add_1lib=
13871                         break
13872                 fi
13873         done
13874         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13875 done
13876 LIBS="$cf_add_libs"
13877
13878 cat >>confdefs.h <<EOF
13879 #define $cf_upper 1
13880 EOF
13881
13882 fi
13883
13884 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13885 echo "$as_me:13885: checking for form_driver in -lform$cf_cv_libtype" >&5
13886 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13887 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13888   echo $ECHO_N "(cached) $ECHO_C" >&6
13889 else
13890   ac_check_lib_save_LIBS=$LIBS
13891 LIBS="-lform$cf_cv_libtype  $LIBS"
13892 cat >conftest.$ac_ext <<_ACEOF
13893 #line 13893 "configure"
13894 #include "confdefs.h"
13895
13896 /* Override any gcc2 internal prototype to avoid an error.  */
13897 #ifdef __cplusplus
13898 extern "C"
13899 #endif
13900 /* We use char because int might match the return type of a gcc2
13901    builtin and then its argument prototype would still apply.  */
13902 char form_driver ();
13903 int
13904 main ()
13905 {
13906 form_driver ();
13907   ;
13908   return 0;
13909 }
13910 _ACEOF
13911 rm -f conftest.$ac_objext conftest$ac_exeext
13912 if { (eval echo "$as_me:13912: \"$ac_link\"") >&5
13913   (eval $ac_link) 2>&5
13914   ac_status=$?
13915   echo "$as_me:13915: \$? = $ac_status" >&5
13916   (exit $ac_status); } &&
13917          { ac_try='test -s conftest$ac_exeext'
13918   { (eval echo "$as_me:13918: \"$ac_try\"") >&5
13919   (eval $ac_try) 2>&5
13920   ac_status=$?
13921   echo "$as_me:13921: \$? = $ac_status" >&5
13922   (exit $ac_status); }; }; then
13923   eval "$as_ac_Lib=yes"
13924 else
13925   echo "$as_me: failed program was:" >&5
13926 cat conftest.$ac_ext >&5
13927 eval "$as_ac_Lib=no"
13928 fi
13929 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13930 LIBS=$ac_check_lib_save_LIBS
13931 fi
13932 echo "$as_me:13932: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13933 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13934 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13935
13936 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13937
13938 cf_add_libs="-lform$cf_cv_libtype"
13939 # Filter out duplicates - this happens with badly-designed ".pc" files...
13940 for cf_add_1lib in $LIBS
13941 do
13942         for cf_add_2lib in $cf_add_libs
13943         do
13944                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13945                 then
13946                         cf_add_1lib=
13947                         break
13948                 fi
13949         done
13950         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13951 done
13952 LIBS="$cf_add_libs"
13953
13954 cat >>confdefs.h <<EOF
13955 #define $cf_upper 1
13956 EOF
13957
13958 fi
13959
13960         # look for curses-related headers
13961
13962 for ac_header in \
13963                 nc_alloc.h \
13964                 nomacros.h \
13965                 form.h \
13966                 menu.h \
13967                 panel.h \
13968                 term_entry.h \
13969
13970 do
13971 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13972 echo "$as_me:13972: checking for $ac_header" >&5
13973 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13974 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13975   echo $ECHO_N "(cached) $ECHO_C" >&6
13976 else
13977   cat >conftest.$ac_ext <<_ACEOF
13978 #line 13978 "configure"
13979 #include "confdefs.h"
13980 #include <$ac_header>
13981 _ACEOF
13982 if { (eval echo "$as_me:13982: \"$ac_cpp conftest.$ac_ext\"") >&5
13983   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13984   ac_status=$?
13985   egrep -v '^ *\+' conftest.er1 >conftest.err
13986   rm -f conftest.er1
13987   cat conftest.err >&5
13988   echo "$as_me:13988: \$? = $ac_status" >&5
13989   (exit $ac_status); } >/dev/null; then
13990   if test -s conftest.err; then
13991     ac_cpp_err=$ac_c_preproc_warn_flag
13992   else
13993     ac_cpp_err=
13994   fi
13995 else
13996   ac_cpp_err=yes
13997 fi
13998 if test -z "$ac_cpp_err"; then
13999   eval "$as_ac_Header=yes"
14000 else
14001   echo "$as_me: failed program was:" >&5
14002   cat conftest.$ac_ext >&5
14003   eval "$as_ac_Header=no"
14004 fi
14005 rm -f conftest.err conftest.$ac_ext
14006 fi
14007 echo "$as_me:14007: result: `eval echo '${'$as_ac_Header'}'`" >&5
14008 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14009 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14010   cat >>confdefs.h <<EOF
14011 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14012 EOF
14013
14014 fi
14015 done
14016
14017         ;;
14018 esac
14019
14020 echo "$as_me:14020: checking for ANSI C header files" >&5
14021 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14022 if test "${ac_cv_header_stdc+set}" = set; then
14023   echo $ECHO_N "(cached) $ECHO_C" >&6
14024 else
14025   cat >conftest.$ac_ext <<_ACEOF
14026 #line 14026 "configure"
14027 #include "confdefs.h"
14028 #include <stdlib.h>
14029 #include <stdarg.h>
14030 #include <string.h>
14031 #include <float.h>
14032
14033 _ACEOF
14034 if { (eval echo "$as_me:14034: \"$ac_cpp conftest.$ac_ext\"") >&5
14035   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14036   ac_status=$?
14037   egrep -v '^ *\+' conftest.er1 >conftest.err
14038   rm -f conftest.er1
14039   cat conftest.err >&5
14040   echo "$as_me:14040: \$? = $ac_status" >&5
14041   (exit $ac_status); } >/dev/null; then
14042   if test -s conftest.err; then
14043     ac_cpp_err=$ac_c_preproc_warn_flag
14044   else
14045     ac_cpp_err=
14046   fi
14047 else
14048   ac_cpp_err=yes
14049 fi
14050 if test -z "$ac_cpp_err"; then
14051   ac_cv_header_stdc=yes
14052 else
14053   echo "$as_me: failed program was:" >&5
14054   cat conftest.$ac_ext >&5
14055   ac_cv_header_stdc=no
14056 fi
14057 rm -f conftest.err conftest.$ac_ext
14058
14059 if test $ac_cv_header_stdc = yes; then
14060   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14061   cat >conftest.$ac_ext <<_ACEOF
14062 #line 14062 "configure"
14063 #include "confdefs.h"
14064 #include <string.h>
14065
14066 _ACEOF
14067 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14068   egrep "memchr" >/dev/null 2>&1; then
14069   :
14070 else
14071   ac_cv_header_stdc=no
14072 fi
14073 rm -rf conftest*
14074
14075 fi
14076
14077 if test $ac_cv_header_stdc = yes; then
14078   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14079   cat >conftest.$ac_ext <<_ACEOF
14080 #line 14080 "configure"
14081 #include "confdefs.h"
14082 #include <stdlib.h>
14083
14084 _ACEOF
14085 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14086   egrep "free" >/dev/null 2>&1; then
14087   :
14088 else
14089   ac_cv_header_stdc=no
14090 fi
14091 rm -rf conftest*
14092
14093 fi
14094
14095 if test $ac_cv_header_stdc = yes; then
14096   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14097   if test "$cross_compiling" = yes; then
14098   :
14099 else
14100   cat >conftest.$ac_ext <<_ACEOF
14101 #line 14101 "configure"
14102 #include "confdefs.h"
14103 #include <ctype.h>
14104 #if ((' ' & 0x0FF) == 0x020)
14105 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14106 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14107 #else
14108 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14109                      || ('j' <= (c) && (c) <= 'r') \
14110                      || ('s' <= (c) && (c) <= 'z'))
14111 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14112 #endif
14113
14114 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14115 int
14116 main ()
14117 {
14118   int i;
14119   for (i = 0; i < 256; i++)
14120     if (XOR (islower (i), ISLOWER (i))
14121         || toupper (i) != TOUPPER (i))
14122       $ac_main_return(2);
14123   $ac_main_return (0);
14124 }
14125 _ACEOF
14126 rm -f conftest$ac_exeext
14127 if { (eval echo "$as_me:14127: \"$ac_link\"") >&5
14128   (eval $ac_link) 2>&5
14129   ac_status=$?
14130   echo "$as_me:14130: \$? = $ac_status" >&5
14131   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14132   { (eval echo "$as_me:14132: \"$ac_try\"") >&5
14133   (eval $ac_try) 2>&5
14134   ac_status=$?
14135   echo "$as_me:14135: \$? = $ac_status" >&5
14136   (exit $ac_status); }; }; then
14137   :
14138 else
14139   echo "$as_me: program exited with status $ac_status" >&5
14140 echo "$as_me: failed program was:" >&5
14141 cat conftest.$ac_ext >&5
14142 ac_cv_header_stdc=no
14143 fi
14144 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14145 fi
14146 fi
14147 fi
14148 echo "$as_me:14148: result: $ac_cv_header_stdc" >&5
14149 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14150 if test $ac_cv_header_stdc = yes; then
14151
14152 cat >>confdefs.h <<\EOF
14153 #define STDC_HEADERS 1
14154 EOF
14155
14156 fi
14157
14158 echo "$as_me:14158: checking whether time.h and sys/time.h may both be included" >&5
14159 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
14160 if test "${ac_cv_header_time+set}" = set; then
14161   echo $ECHO_N "(cached) $ECHO_C" >&6
14162 else
14163   cat >conftest.$ac_ext <<_ACEOF
14164 #line 14164 "configure"
14165 #include "confdefs.h"
14166 #include <sys/types.h>
14167 #include <sys/time.h>
14168 #include <time.h>
14169
14170 int
14171 main ()
14172 {
14173 if ((struct tm *) 0)
14174 return 0;
14175   ;
14176   return 0;
14177 }
14178 _ACEOF
14179 rm -f conftest.$ac_objext
14180 if { (eval echo "$as_me:14180: \"$ac_compile\"") >&5
14181   (eval $ac_compile) 2>&5
14182   ac_status=$?
14183   echo "$as_me:14183: \$? = $ac_status" >&5
14184   (exit $ac_status); } &&
14185          { ac_try='test -s conftest.$ac_objext'
14186   { (eval echo "$as_me:14186: \"$ac_try\"") >&5
14187   (eval $ac_try) 2>&5
14188   ac_status=$?
14189   echo "$as_me:14189: \$? = $ac_status" >&5
14190   (exit $ac_status); }; }; then
14191   ac_cv_header_time=yes
14192 else
14193   echo "$as_me: failed program was:" >&5
14194 cat conftest.$ac_ext >&5
14195 ac_cv_header_time=no
14196 fi
14197 rm -f conftest.$ac_objext conftest.$ac_ext
14198 fi
14199 echo "$as_me:14199: result: $ac_cv_header_time" >&5
14200 echo "${ECHO_T}$ac_cv_header_time" >&6
14201 if test $ac_cv_header_time = yes; then
14202
14203 cat >>confdefs.h <<\EOF
14204 #define TIME_WITH_SYS_TIME 1
14205 EOF
14206
14207 fi
14208
14209 for ac_header in \
14210 getopt.h \
14211 locale.h \
14212 math.h \
14213 stdarg.h \
14214 sys/ioctl.h \
14215 sys/select.h \
14216 sys/time.h \
14217 termios.h \
14218 unistd.h \
14219
14220 do
14221 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14222 echo "$as_me:14222: checking for $ac_header" >&5
14223 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14224 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14225   echo $ECHO_N "(cached) $ECHO_C" >&6
14226 else
14227   cat >conftest.$ac_ext <<_ACEOF
14228 #line 14228 "configure"
14229 #include "confdefs.h"
14230 #include <$ac_header>
14231 _ACEOF
14232 if { (eval echo "$as_me:14232: \"$ac_cpp conftest.$ac_ext\"") >&5
14233   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14234   ac_status=$?
14235   egrep -v '^ *\+' conftest.er1 >conftest.err
14236   rm -f conftest.er1
14237   cat conftest.err >&5
14238   echo "$as_me:14238: \$? = $ac_status" >&5
14239   (exit $ac_status); } >/dev/null; then
14240   if test -s conftest.err; then
14241     ac_cpp_err=$ac_c_preproc_warn_flag
14242   else
14243     ac_cpp_err=
14244   fi
14245 else
14246   ac_cpp_err=yes
14247 fi
14248 if test -z "$ac_cpp_err"; then
14249   eval "$as_ac_Header=yes"
14250 else
14251   echo "$as_me: failed program was:" >&5
14252   cat conftest.$ac_ext >&5
14253   eval "$as_ac_Header=no"
14254 fi
14255 rm -f conftest.err conftest.$ac_ext
14256 fi
14257 echo "$as_me:14257: result: `eval echo '${'$as_ac_Header'}'`" >&5
14258 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14259 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14260   cat >>confdefs.h <<EOF
14261 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14262 EOF
14263
14264 fi
14265 done
14266
14267 for ac_header in unistd.h getopt.h
14268 do
14269 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14270 echo "$as_me:14270: checking for $ac_header" >&5
14271 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14272 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14273   echo $ECHO_N "(cached) $ECHO_C" >&6
14274 else
14275   cat >conftest.$ac_ext <<_ACEOF
14276 #line 14276 "configure"
14277 #include "confdefs.h"
14278 #include <$ac_header>
14279 _ACEOF
14280 if { (eval echo "$as_me:14280: \"$ac_cpp conftest.$ac_ext\"") >&5
14281   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14282   ac_status=$?
14283   egrep -v '^ *\+' conftest.er1 >conftest.err
14284   rm -f conftest.er1
14285   cat conftest.err >&5
14286   echo "$as_me:14286: \$? = $ac_status" >&5
14287   (exit $ac_status); } >/dev/null; then
14288   if test -s conftest.err; then
14289     ac_cpp_err=$ac_c_preproc_warn_flag
14290   else
14291     ac_cpp_err=
14292   fi
14293 else
14294   ac_cpp_err=yes
14295 fi
14296 if test -z "$ac_cpp_err"; then
14297   eval "$as_ac_Header=yes"
14298 else
14299   echo "$as_me: failed program was:" >&5
14300   cat conftest.$ac_ext >&5
14301   eval "$as_ac_Header=no"
14302 fi
14303 rm -f conftest.err conftest.$ac_ext
14304 fi
14305 echo "$as_me:14305: result: `eval echo '${'$as_ac_Header'}'`" >&5
14306 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14307 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14308   cat >>confdefs.h <<EOF
14309 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14310 EOF
14311
14312 fi
14313 done
14314
14315 echo "$as_me:14315: checking for header declaring getopt variables" >&5
14316 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
14317 if test "${cf_cv_getopt_header+set}" = set; then
14318   echo $ECHO_N "(cached) $ECHO_C" >&6
14319 else
14320
14321 cf_cv_getopt_header=none
14322 for cf_header in stdio.h stdlib.h unistd.h getopt.h
14323 do
14324 cat >conftest.$ac_ext <<_ACEOF
14325 #line 14325 "configure"
14326 #include "confdefs.h"
14327
14328 #include <$cf_header>
14329 int
14330 main ()
14331 {
14332 int x = optind; char *y = optarg
14333   ;
14334   return 0;
14335 }
14336 _ACEOF
14337 rm -f conftest.$ac_objext
14338 if { (eval echo "$as_me:14338: \"$ac_compile\"") >&5
14339   (eval $ac_compile) 2>&5
14340   ac_status=$?
14341   echo "$as_me:14341: \$? = $ac_status" >&5
14342   (exit $ac_status); } &&
14343          { ac_try='test -s conftest.$ac_objext'
14344   { (eval echo "$as_me:14344: \"$ac_try\"") >&5
14345   (eval $ac_try) 2>&5
14346   ac_status=$?
14347   echo "$as_me:14347: \$? = $ac_status" >&5
14348   (exit $ac_status); }; }; then
14349   cf_cv_getopt_header=$cf_header
14350  break
14351 else
14352   echo "$as_me: failed program was:" >&5
14353 cat conftest.$ac_ext >&5
14354 fi
14355 rm -f conftest.$ac_objext conftest.$ac_ext
14356 done
14357
14358 fi
14359 echo "$as_me:14359: result: $cf_cv_getopt_header" >&5
14360 echo "${ECHO_T}$cf_cv_getopt_header" >&6
14361 if test $cf_cv_getopt_header != none ; then
14362
14363 cat >>confdefs.h <<\EOF
14364 #define HAVE_GETOPT_HEADER 1
14365 EOF
14366
14367 fi
14368 if test $cf_cv_getopt_header = getopt.h ; then
14369
14370 cat >>confdefs.h <<\EOF
14371 #define NEED_GETOPT_H 1
14372 EOF
14373
14374 fi
14375
14376 for ac_func in \
14377 getopt \
14378 gettimeofday \
14379
14380 do
14381 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14382 echo "$as_me:14382: checking for $ac_func" >&5
14383 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14384 if eval "test \"\${$as_ac_var+set}\" = set"; then
14385   echo $ECHO_N "(cached) $ECHO_C" >&6
14386 else
14387   cat >conftest.$ac_ext <<_ACEOF
14388 #line 14388 "configure"
14389 #include "confdefs.h"
14390 /* System header to define __stub macros and hopefully few prototypes,
14391     which can conflict with char $ac_func (); below.  */
14392 #include <assert.h>
14393 /* Override any gcc2 internal prototype to avoid an error.  */
14394 #ifdef __cplusplus
14395 extern "C"
14396 #endif
14397 /* We use char because int might match the return type of a gcc2
14398    builtin and then its argument prototype would still apply.  */
14399 char $ac_func ();
14400 char (*f) ();
14401
14402 int
14403 main ()
14404 {
14405 /* The GNU C library defines this for functions which it implements
14406     to always fail with ENOSYS.  Some functions are actually named
14407     something starting with __ and the normal name is an alias.  */
14408 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14409 choke me
14410 #else
14411 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14412 #endif
14413
14414   ;
14415   return 0;
14416 }
14417 _ACEOF
14418 rm -f conftest.$ac_objext conftest$ac_exeext
14419 if { (eval echo "$as_me:14419: \"$ac_link\"") >&5
14420   (eval $ac_link) 2>&5
14421   ac_status=$?
14422   echo "$as_me:14422: \$? = $ac_status" >&5
14423   (exit $ac_status); } &&
14424          { ac_try='test -s conftest$ac_exeext'
14425   { (eval echo "$as_me:14425: \"$ac_try\"") >&5
14426   (eval $ac_try) 2>&5
14427   ac_status=$?
14428   echo "$as_me:14428: \$? = $ac_status" >&5
14429   (exit $ac_status); }; }; then
14430   eval "$as_ac_var=yes"
14431 else
14432   echo "$as_me: failed program was:" >&5
14433 cat conftest.$ac_ext >&5
14434 eval "$as_ac_var=no"
14435 fi
14436 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14437 fi
14438 echo "$as_me:14438: result: `eval echo '${'$as_ac_var'}'`" >&5
14439 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14440 if test `eval echo '${'$as_ac_var'}'` = yes; then
14441   cat >>confdefs.h <<EOF
14442 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14443 EOF
14444
14445 fi
14446 done
14447
14448 if test "x$ac_cv_func_getopt" = xno; then
14449         { { echo "$as_me:14449: error: getopt is required for building programs" >&5
14450 echo "$as_me: error: getopt is required for building programs" >&2;}
14451    { (exit 1); exit 1; }; }
14452 fi
14453
14454 if test "$cf_enable_widec" = yes; then
14455
14456 for ac_func in \
14457 mblen \
14458 mbrlen \
14459 mbrtowc \
14460 mbsrtowcs \
14461 mbstowcs \
14462 mbtowc \
14463 wcsrtombs \
14464 wcstombs \
14465
14466 do
14467 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14468 echo "$as_me:14468: checking for $ac_func" >&5
14469 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14470 if eval "test \"\${$as_ac_var+set}\" = set"; then
14471   echo $ECHO_N "(cached) $ECHO_C" >&6
14472 else
14473   cat >conftest.$ac_ext <<_ACEOF
14474 #line 14474 "configure"
14475 #include "confdefs.h"
14476 /* System header to define __stub macros and hopefully few prototypes,
14477     which can conflict with char $ac_func (); below.  */
14478 #include <assert.h>
14479 /* Override any gcc2 internal prototype to avoid an error.  */
14480 #ifdef __cplusplus
14481 extern "C"
14482 #endif
14483 /* We use char because int might match the return type of a gcc2
14484    builtin and then its argument prototype would still apply.  */
14485 char $ac_func ();
14486 char (*f) ();
14487
14488 int
14489 main ()
14490 {
14491 /* The GNU C library defines this for functions which it implements
14492     to always fail with ENOSYS.  Some functions are actually named
14493     something starting with __ and the normal name is an alias.  */
14494 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14495 choke me
14496 #else
14497 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14498 #endif
14499
14500   ;
14501   return 0;
14502 }
14503 _ACEOF
14504 rm -f conftest.$ac_objext conftest$ac_exeext
14505 if { (eval echo "$as_me:14505: \"$ac_link\"") >&5
14506   (eval $ac_link) 2>&5
14507   ac_status=$?
14508   echo "$as_me:14508: \$? = $ac_status" >&5
14509   (exit $ac_status); } &&
14510          { ac_try='test -s conftest$ac_exeext'
14511   { (eval echo "$as_me:14511: \"$ac_try\"") >&5
14512   (eval $ac_try) 2>&5
14513   ac_status=$?
14514   echo "$as_me:14514: \$? = $ac_status" >&5
14515   (exit $ac_status); }; }; then
14516   eval "$as_ac_var=yes"
14517 else
14518   echo "$as_me: failed program was:" >&5
14519 cat conftest.$ac_ext >&5
14520 eval "$as_ac_var=no"
14521 fi
14522 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14523 fi
14524 echo "$as_me:14524: result: `eval echo '${'$as_ac_var'}'`" >&5
14525 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14526 if test `eval echo '${'$as_ac_var'}'` = yes; then
14527   cat >>confdefs.h <<EOF
14528 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14529 EOF
14530
14531 fi
14532 done
14533
14534 fi
14535
14536 echo "$as_me:14536: checking definition to turn on extended curses functions" >&5
14537 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
14538 if test "${cf_cv_need_xopen_extension+set}" = set; then
14539   echo $ECHO_N "(cached) $ECHO_C" >&6
14540 else
14541
14542 cf_cv_need_xopen_extension=unknown
14543 cat >conftest.$ac_ext <<_ACEOF
14544 #line 14544 "configure"
14545 #include "confdefs.h"
14546
14547 #include <stdlib.h>
14548 #include <${cf_cv_ncurses_header:-curses.h}>
14549 int
14550 main ()
14551 {
14552
14553 #if defined(NCURSES_VERSION_PATCH)
14554 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
14555         make an error
14556 #endif
14557 #endif
14558 #ifdef NCURSES_VERSION
14559         cchar_t check;
14560         int check2 = curs_set((int)sizeof(check));
14561 #endif
14562         long x = winnstr(stdscr, "", 0);
14563         int x1, y1;
14564         getbegyx(stdscr, y1, x1)
14565   ;
14566   return 0;
14567 }
14568 _ACEOF
14569 rm -f conftest.$ac_objext conftest$ac_exeext
14570 if { (eval echo "$as_me:14570: \"$ac_link\"") >&5
14571   (eval $ac_link) 2>&5
14572   ac_status=$?
14573   echo "$as_me:14573: \$? = $ac_status" >&5
14574   (exit $ac_status); } &&
14575          { ac_try='test -s conftest$ac_exeext'
14576   { (eval echo "$as_me:14576: \"$ac_try\"") >&5
14577   (eval $ac_try) 2>&5
14578   ac_status=$?
14579   echo "$as_me:14579: \$? = $ac_status" >&5
14580   (exit $ac_status); }; }; then
14581   cf_cv_need_xopen_extension=none
14582 else
14583   echo "$as_me: failed program was:" >&5
14584 cat conftest.$ac_ext >&5
14585
14586         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
14587         do
14588                 cat >conftest.$ac_ext <<_ACEOF
14589 #line 14589 "configure"
14590 #include "confdefs.h"
14591
14592 #define $cf_try_xopen_extension 1
14593 #include <stdlib.h>
14594 #include <${cf_cv_ncurses_header:-curses.h}>
14595 int
14596 main ()
14597 {
14598
14599 #ifdef NCURSES_VERSION
14600                 cchar_t check;
14601                 int check2 = curs_set((int)sizeof(check));
14602 #endif
14603                 long x = winnstr(stdscr, "", 0);
14604                 int x1, y1;
14605                 getbegyx(stdscr, y1, x1)
14606   ;
14607   return 0;
14608 }
14609 _ACEOF
14610 rm -f conftest.$ac_objext conftest$ac_exeext
14611 if { (eval echo "$as_me:14611: \"$ac_link\"") >&5
14612   (eval $ac_link) 2>&5
14613   ac_status=$?
14614   echo "$as_me:14614: \$? = $ac_status" >&5
14615   (exit $ac_status); } &&
14616          { ac_try='test -s conftest$ac_exeext'
14617   { (eval echo "$as_me:14617: \"$ac_try\"") >&5
14618   (eval $ac_try) 2>&5
14619   ac_status=$?
14620   echo "$as_me:14620: \$? = $ac_status" >&5
14621   (exit $ac_status); }; }; then
14622   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
14623 else
14624   echo "$as_me: failed program was:" >&5
14625 cat conftest.$ac_ext >&5
14626 fi
14627 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14628         done
14629
14630 fi
14631 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14632
14633 fi
14634 echo "$as_me:14634: result: $cf_cv_need_xopen_extension" >&5
14635 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14636
14637 case $cf_cv_need_xopen_extension in
14638 (*_*)
14639         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
14640         ;;
14641 esac
14642
14643 echo "$as_me:14643: checking for term.h" >&5
14644 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14645 if test "${cf_cv_term_header+set}" = set; then
14646   echo $ECHO_N "(cached) $ECHO_C" >&6
14647 else
14648
14649 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14650 # for <term.h> if we do not find the variant.
14651
14652 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14653
14654 case ${cf_cv_ncurses_header:-curses.h} in
14655 (*/*)
14656         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14657         cf_header_list="$cf_header_item $cf_header_list"
14658         ;;
14659 esac
14660
14661 for cf_header in $cf_header_list
14662 do
14663         cat >conftest.$ac_ext <<_ACEOF
14664 #line 14664 "configure"
14665 #include "confdefs.h"
14666
14667 #include <${cf_cv_ncurses_header:-curses.h}>
14668 #include <${cf_header}>
14669 int
14670 main ()
14671 {
14672 WINDOW *x
14673   ;
14674   return 0;
14675 }
14676 _ACEOF
14677 rm -f conftest.$ac_objext
14678 if { (eval echo "$as_me:14678: \"$ac_compile\"") >&5
14679   (eval $ac_compile) 2>&5
14680   ac_status=$?
14681   echo "$as_me:14681: \$? = $ac_status" >&5
14682   (exit $ac_status); } &&
14683          { ac_try='test -s conftest.$ac_objext'
14684   { (eval echo "$as_me:14684: \"$ac_try\"") >&5
14685   (eval $ac_try) 2>&5
14686   ac_status=$?
14687   echo "$as_me:14687: \$? = $ac_status" >&5
14688   (exit $ac_status); }; }; then
14689   cf_cv_term_header=$cf_header
14690          break
14691 else
14692   echo "$as_me: failed program was:" >&5
14693 cat conftest.$ac_ext >&5
14694 cf_cv_term_header=no
14695 fi
14696 rm -f conftest.$ac_objext conftest.$ac_ext
14697 done
14698
14699 case $cf_cv_term_header in
14700 (no)
14701         # If curses is ncurses, some packagers still mess it up by trying to make
14702         # us use GNU termcap.  This handles the most common case.
14703         for cf_header in ncurses/term.h ncursesw/term.h
14704         do
14705                 cat >conftest.$ac_ext <<_ACEOF
14706 #line 14706 "configure"
14707 #include "confdefs.h"
14708
14709 #include <${cf_cv_ncurses_header:-curses.h}>
14710 #ifdef NCURSES_VERSION
14711 #include <${cf_header}>
14712 #else
14713 make an error
14714 #endif
14715 int
14716 main ()
14717 {
14718 WINDOW *x
14719   ;
14720   return 0;
14721 }
14722 _ACEOF
14723 rm -f conftest.$ac_objext
14724 if { (eval echo "$as_me:14724: \"$ac_compile\"") >&5
14725   (eval $ac_compile) 2>&5
14726   ac_status=$?
14727   echo "$as_me:14727: \$? = $ac_status" >&5
14728   (exit $ac_status); } &&
14729          { ac_try='test -s conftest.$ac_objext'
14730   { (eval echo "$as_me:14730: \"$ac_try\"") >&5
14731   (eval $ac_try) 2>&5
14732   ac_status=$?
14733   echo "$as_me:14733: \$? = $ac_status" >&5
14734   (exit $ac_status); }; }; then
14735   cf_cv_term_header=$cf_header
14736                          break
14737 else
14738   echo "$as_me: failed program was:" >&5
14739 cat conftest.$ac_ext >&5
14740 cf_cv_term_header=no
14741 fi
14742 rm -f conftest.$ac_objext conftest.$ac_ext
14743         done
14744         ;;
14745 esac
14746
14747 fi
14748 echo "$as_me:14748: result: $cf_cv_term_header" >&5
14749 echo "${ECHO_T}$cf_cv_term_header" >&6
14750
14751 case $cf_cv_term_header in
14752 (term.h)
14753
14754 cat >>confdefs.h <<\EOF
14755 #define HAVE_TERM_H 1
14756 EOF
14757
14758         ;;
14759 (ncurses/term.h)
14760
14761 cat >>confdefs.h <<\EOF
14762 #define HAVE_NCURSES_TERM_H 1
14763 EOF
14764
14765         ;;
14766 (ncursesw/term.h)
14767
14768 cat >>confdefs.h <<\EOF
14769 #define HAVE_NCURSESW_TERM_H 1
14770 EOF
14771
14772         ;;
14773 esac
14774
14775 echo "$as_me:14775: checking for unctrl.h" >&5
14776 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14777 if test "${cf_cv_unctrl_header+set}" = set; then
14778   echo $ECHO_N "(cached) $ECHO_C" >&6
14779 else
14780
14781 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14782 # for <unctrl.h> if we do not find the variant.
14783
14784 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14785
14786 case ${cf_cv_ncurses_header:-curses.h} in
14787 (*/*)
14788         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14789         cf_header_list="$cf_header_item $cf_header_list"
14790         ;;
14791 esac
14792
14793 for cf_header in $cf_header_list
14794 do
14795         cat >conftest.$ac_ext <<_ACEOF
14796 #line 14796 "configure"
14797 #include "confdefs.h"
14798
14799 #include <${cf_cv_ncurses_header:-curses.h}>
14800 #include <${cf_header}>
14801 int
14802 main ()
14803 {
14804 WINDOW *x
14805   ;
14806   return 0;
14807 }
14808 _ACEOF
14809 rm -f conftest.$ac_objext
14810 if { (eval echo "$as_me:14810: \"$ac_compile\"") >&5
14811   (eval $ac_compile) 2>&5
14812   ac_status=$?
14813   echo "$as_me:14813: \$? = $ac_status" >&5
14814   (exit $ac_status); } &&
14815          { ac_try='test -s conftest.$ac_objext'
14816   { (eval echo "$as_me:14816: \"$ac_try\"") >&5
14817   (eval $ac_try) 2>&5
14818   ac_status=$?
14819   echo "$as_me:14819: \$? = $ac_status" >&5
14820   (exit $ac_status); }; }; then
14821   cf_cv_unctrl_header=$cf_header
14822          break
14823 else
14824   echo "$as_me: failed program was:" >&5
14825 cat conftest.$ac_ext >&5
14826 cf_cv_unctrl_header=no
14827 fi
14828 rm -f conftest.$ac_objext conftest.$ac_ext
14829 done
14830
14831 fi
14832 echo "$as_me:14832: result: $cf_cv_unctrl_header" >&5
14833 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14834
14835 case $cf_cv_unctrl_header in
14836 (no)
14837         { echo "$as_me:14837: WARNING: unctrl.h header not found" >&5
14838 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14839         ;;
14840 esac
14841
14842 case $cf_cv_unctrl_header in
14843 (unctrl.h)
14844
14845 cat >>confdefs.h <<\EOF
14846 #define HAVE_UNCTRL_H 1
14847 EOF
14848
14849         ;;
14850 (ncurses/unctrl.h)
14851
14852 cat >>confdefs.h <<\EOF
14853 #define HAVE_NCURSES_UNCTRL_H 1
14854 EOF
14855
14856         ;;
14857 (ncursesw/unctrl.h)
14858
14859 cat >>confdefs.h <<\EOF
14860 #define HAVE_NCURSESW_UNCTRL_H 1
14861 EOF
14862
14863         ;;
14864 esac
14865
14866 for cf_func in \
14867 assume_default_colors \
14868 chgat \
14869 color_set \
14870 filter \
14871 getbegx \
14872 getcurx \
14873 getmaxx \
14874 getnstr \
14875 getparx \
14876 getwin \
14877 mvvline \
14878 mvwvline \
14879 napms \
14880 putwin \
14881 resize_term \
14882 resizeterm \
14883 restartterm \
14884 ripoffline \
14885 scr_dump \
14886 setupterm \
14887 slk_color \
14888 slk_init \
14889 termattrs \
14890 tgetent \
14891 tigetnum \
14892 tigetstr \
14893 typeahead \
14894 use_default_colors \
14895 use_env \
14896 use_extended_names \
14897 use_screen \
14898 use_window \
14899 vid_puts \
14900 vidputs \
14901 vsscanf \
14902 vw_printw \
14903 wchgat \
14904 winsstr \
14905 wresize \
14906 wsyncdown \
14907
14908 do
14909
14910 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14911
14912         echo "$as_me:14912: checking for ${cf_func}" >&5
14913 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14914
14915 echo "${as_me:-configure}:14915: testing ${cf_func} ..." 1>&5
14916
14917         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14918   echo $ECHO_N "(cached) $ECHO_C" >&6
14919 else
14920
14921                 eval cf_result='$ac_cv_func_'$cf_func
14922                 if test ".$cf_result" != ".no"; then
14923                         cat >conftest.$ac_ext <<_ACEOF
14924 #line 14924 "configure"
14925 #include "confdefs.h"
14926
14927 #ifdef HAVE_XCURSES
14928 #include <xcurses.h>
14929 char * XCursesProgramName = "test";
14930 #else
14931 #include <${cf_cv_ncurses_header:-curses.h}>
14932 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14933 #include <ncursesw/term.h>
14934 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14935 #include <ncurses/term.h>
14936 #elif defined(HAVE_TERM_H)
14937 #include <term.h>
14938 #endif
14939 #endif
14940
14941 int
14942 main ()
14943 {
14944
14945 #ifndef ${cf_func}
14946 long foo = (long)(&${cf_func});
14947 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14948 if (foo + 1234 > 5678)
14949         ${cf_cv_main_return:-return}(foo);
14950 #endif
14951
14952   ;
14953   return 0;
14954 }
14955 _ACEOF
14956 rm -f conftest.$ac_objext conftest$ac_exeext
14957 if { (eval echo "$as_me:14957: \"$ac_link\"") >&5
14958   (eval $ac_link) 2>&5
14959   ac_status=$?
14960   echo "$as_me:14960: \$? = $ac_status" >&5
14961   (exit $ac_status); } &&
14962          { ac_try='test -s conftest$ac_exeext'
14963   { (eval echo "$as_me:14963: \"$ac_try\"") >&5
14964   (eval $ac_try) 2>&5
14965   ac_status=$?
14966   echo "$as_me:14966: \$? = $ac_status" >&5
14967   (exit $ac_status); }; }; then
14968   cf_result=yes
14969 else
14970   echo "$as_me: failed program was:" >&5
14971 cat conftest.$ac_ext >&5
14972 cf_result=no
14973 fi
14974 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14975                 fi
14976                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14977
14978 fi
14979
14980         # use the computed/retrieved cache-value:
14981         eval 'cf_result=$cf_cv_func_'$cf_func
14982         echo "$as_me:14982: result: $cf_result" >&5
14983 echo "${ECHO_T}$cf_result" >&6
14984         if test $cf_result != no; then
14985                 cat >>confdefs.h <<EOF
14986 #define HAVE_${cf_tr_func} 1
14987 EOF
14988
14989         fi
14990 done
14991
14992 for cf_func in tputs
14993 do
14994
14995 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14996
14997         echo "$as_me:14997: checking for ${cf_func}" >&5
14998 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14999
15000 echo "${as_me:-configure}:15000: testing ${cf_func} ..." 1>&5
15001
15002         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
15003   echo $ECHO_N "(cached) $ECHO_C" >&6
15004 else
15005
15006                 eval cf_result='$ac_cv_func_'$cf_func
15007                 if test ".$cf_result" != ".no"; then
15008                         cat >conftest.$ac_ext <<_ACEOF
15009 #line 15009 "configure"
15010 #include "confdefs.h"
15011
15012 #ifdef HAVE_XCURSES
15013 #include <xcurses.h>
15014 char * XCursesProgramName = "test";
15015 #else
15016 #include <${cf_cv_ncurses_header:-curses.h}>
15017 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15018 #include <ncursesw/term.h>
15019 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15020 #include <ncurses/term.h>
15021 #elif defined(HAVE_TERM_H)
15022 #include <term.h>
15023 #endif
15024 #endif
15025
15026 int
15027 main ()
15028 {
15029
15030 #ifndef ${cf_func}
15031 long foo = (long)(&${cf_func});
15032 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
15033 if (foo + 1234 > 5678)
15034         ${cf_cv_main_return:-return}(foo);
15035 #endif
15036
15037   ;
15038   return 0;
15039 }
15040 _ACEOF
15041 rm -f conftest.$ac_objext conftest$ac_exeext
15042 if { (eval echo "$as_me:15042: \"$ac_link\"") >&5
15043   (eval $ac_link) 2>&5
15044   ac_status=$?
15045   echo "$as_me:15045: \$? = $ac_status" >&5
15046   (exit $ac_status); } &&
15047          { ac_try='test -s conftest$ac_exeext'
15048   { (eval echo "$as_me:15048: \"$ac_try\"") >&5
15049   (eval $ac_try) 2>&5
15050   ac_status=$?
15051   echo "$as_me:15051: \$? = $ac_status" >&5
15052   (exit $ac_status); }; }; then
15053   cf_result=yes
15054 else
15055   echo "$as_me: failed program was:" >&5
15056 cat conftest.$ac_ext >&5
15057 cf_result=no
15058 fi
15059 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15060                 fi
15061                 eval 'cf_cv_func_'$cf_func'=$cf_result'
15062
15063 fi
15064
15065         # use the computed/retrieved cache-value:
15066         eval 'cf_result=$cf_cv_func_'$cf_func
15067         echo "$as_me:15067: result: $cf_result" >&5
15068 echo "${ECHO_T}$cf_result" >&6
15069         if test $cf_result != no; then
15070                 cat >>confdefs.h <<EOF
15071 #define HAVE_${cf_tr_func} 1
15072 EOF
15073
15074         fi
15075 done
15076
15077 if test x$cf_cv_func_tputs = xyes
15078 then
15079         cf_done=no
15080         for cf_arg in int char
15081         do
15082                 for cf_ret in int void
15083                 do
15084                         if test $cf_ret = void
15085                         then
15086                                 cf_return="/* nothing */"
15087                         else
15088                                 cf_return="return value"
15089                         fi
15090                         cat >conftest.$ac_ext <<_ACEOF
15091 #line 15091 "configure"
15092 #include "confdefs.h"
15093
15094 #include <${cf_cv_ncurses_header:-curses.h}>
15095 #include <$cf_cv_term_header>
15096
15097 static $cf_ret outc($cf_arg value) { $cf_return; }
15098
15099 int
15100 main ()
15101 {
15102
15103         tputs("hello", 0, outc);
15104         ${cf_cv_main_return:-return}(0);
15105
15106   ;
15107   return 0;
15108 }
15109 _ACEOF
15110 rm -f conftest.$ac_objext
15111 if { (eval echo "$as_me:15111: \"$ac_compile\"") >&5
15112   (eval $ac_compile) 2>&5
15113   ac_status=$?
15114   echo "$as_me:15114: \$? = $ac_status" >&5
15115   (exit $ac_status); } &&
15116          { ac_try='test -s conftest.$ac_objext'
15117   { (eval echo "$as_me:15117: \"$ac_try\"") >&5
15118   (eval $ac_try) 2>&5
15119   ac_status=$?
15120   echo "$as_me:15120: \$? = $ac_status" >&5
15121   (exit $ac_status); }; }; then
15122
15123                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
15124
15125 echo "${as_me:-configure}:15125: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
15126
15127                 cat >>confdefs.h <<EOF
15128 #define TPUTS_ARG               $cf_arg
15129 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
15130 #define TPUTS_RETURN(value)     $cf_return
15131 EOF
15132                 cf_done=yes
15133                 break
15134
15135 else
15136   echo "$as_me: failed program was:" >&5
15137 cat conftest.$ac_ext >&5
15138 fi
15139 rm -f conftest.$ac_objext conftest.$ac_ext
15140                 done
15141                 test $cf_done = yes && break
15142         done
15143 fi
15144
15145 echo "$as_me:15145: checking for ncurses extended functions" >&5
15146 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
15147 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
15148   echo $ECHO_N "(cached) $ECHO_C" >&6
15149 else
15150
15151 cat >conftest.$ac_ext <<_ACEOF
15152 #line 15152 "configure"
15153 #include "confdefs.h"
15154
15155 #include <${cf_cv_ncurses_header:-curses.h}>
15156 int
15157 main ()
15158 {
15159
15160 int x = NCURSES_EXT_FUNCS
15161
15162   ;
15163   return 0;
15164 }
15165 _ACEOF
15166 rm -f conftest.$ac_objext
15167 if { (eval echo "$as_me:15167: \"$ac_compile\"") >&5
15168   (eval $ac_compile) 2>&5
15169   ac_status=$?
15170   echo "$as_me:15170: \$? = $ac_status" >&5
15171   (exit $ac_status); } &&
15172          { ac_try='test -s conftest.$ac_objext'
15173   { (eval echo "$as_me:15173: \"$ac_try\"") >&5
15174   (eval $ac_try) 2>&5
15175   ac_status=$?
15176   echo "$as_me:15176: \$? = $ac_status" >&5
15177   (exit $ac_status); }; }; then
15178   cf_cv_ncurses_ext_funcs=defined
15179 else
15180   echo "$as_me: failed program was:" >&5
15181 cat conftest.$ac_ext >&5
15182
15183 cat >conftest.$ac_ext <<_ACEOF
15184 #line 15184 "configure"
15185 #include "confdefs.h"
15186
15187 #include <${cf_cv_ncurses_header:-curses.h}>
15188 int
15189 main ()
15190 {
15191
15192         (void) assume_default_colors (0, 0);
15193         (void) curses_version ();
15194         (void) define_key (0, 0);
15195         (void) is_term_resized (0, 0);
15196         (void) key_defined (0);
15197         (void) keybound (0, 0);
15198         (void) keyok (0, 0);
15199         (void) resize_term (0, 0);
15200         (void) resizeterm (0, 0);
15201         (void) use_default_colors ();
15202         (void) use_extended_names (0);
15203         (void) wresize (0, 0, 0);
15204   ;
15205   return 0;
15206 }
15207 _ACEOF
15208 rm -f conftest.$ac_objext conftest$ac_exeext
15209 if { (eval echo "$as_me:15209: \"$ac_link\"") >&5
15210   (eval $ac_link) 2>&5
15211   ac_status=$?
15212   echo "$as_me:15212: \$? = $ac_status" >&5
15213   (exit $ac_status); } &&
15214          { ac_try='test -s conftest$ac_exeext'
15215   { (eval echo "$as_me:15215: \"$ac_try\"") >&5
15216   (eval $ac_try) 2>&5
15217   ac_status=$?
15218   echo "$as_me:15218: \$? = $ac_status" >&5
15219   (exit $ac_status); }; }; then
15220   cf_cv_ncurses_ext_funcs=yes
15221 else
15222   echo "$as_me: failed program was:" >&5
15223 cat conftest.$ac_ext >&5
15224 cf_cv_ncurses_ext_funcs=no
15225 fi
15226 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15227
15228 fi
15229 rm -f conftest.$ac_objext conftest.$ac_ext
15230
15231 fi
15232 echo "$as_me:15232: result: $cf_cv_ncurses_ext_funcs" >&5
15233 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
15234 test "$cf_cv_ncurses_ext_funcs" = yes &&
15235 cat >>confdefs.h <<\EOF
15236 #define NCURSES_EXT_FUNCS 1
15237 EOF
15238
15239 if test "$cf_enable_widec" = yes
15240 then
15241         # workaround for systems with ncurses before 20111029, due to change of
15242         # feature test macro from _XPG5 to _XOPEN_SOURCE
15243         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
15244         then
15245                 cf_define_xpg5=no
15246                 echo "$as_me:15246: checking if _XPG5 should be defined to enable wide-characters" >&5
15247 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
15248
15249                 cat >conftest.$ac_ext <<_ACEOF
15250 #line 15250 "configure"
15251 #include "confdefs.h"
15252
15253 #include <${cf_cv_ncurses_header:-curses.h}>
15254 int
15255 main ()
15256 {
15257 int x = _XPG5
15258   ;
15259   return 0;
15260 }
15261 _ACEOF
15262 rm -f conftest.$ac_objext
15263 if { (eval echo "$as_me:15263: \"$ac_compile\"") >&5
15264   (eval $ac_compile) 2>&5
15265   ac_status=$?
15266   echo "$as_me:15266: \$? = $ac_status" >&5
15267   (exit $ac_status); } &&
15268          { ac_try='test -s conftest.$ac_objext'
15269   { (eval echo "$as_me:15269: \"$ac_try\"") >&5
15270   (eval $ac_try) 2>&5
15271   ac_status=$?
15272   echo "$as_me:15272: \$? = $ac_status" >&5
15273   (exit $ac_status); }; }; then
15274   :
15275 else
15276   echo "$as_me: failed program was:" >&5
15277 cat conftest.$ac_ext >&5
15278 cf_save_cppflags="$CPPFLAGS"
15279                          CPPFLAGS="$CPPFLAGS -D_XPG5"
15280                          cat >conftest.$ac_ext <<_ACEOF
15281 #line 15281 "configure"
15282 #include "confdefs.h"
15283
15284 #include <${cf_cv_ncurses_header:-curses.h}>
15285 int
15286 main ()
15287 {
15288 int x = _XPG5
15289   ;
15290   return 0;
15291 }
15292 _ACEOF
15293 rm -f conftest.$ac_objext
15294 if { (eval echo "$as_me:15294: \"$ac_compile\"") >&5
15295   (eval $ac_compile) 2>&5
15296   ac_status=$?
15297   echo "$as_me:15297: \$? = $ac_status" >&5
15298   (exit $ac_status); } &&
15299          { ac_try='test -s conftest.$ac_objext'
15300   { (eval echo "$as_me:15300: \"$ac_try\"") >&5
15301   (eval $ac_try) 2>&5
15302   ac_status=$?
15303   echo "$as_me:15303: \$? = $ac_status" >&5
15304   (exit $ac_status); }; }; then
15305   cf_define_xpg5=yes
15306 else
15307   echo "$as_me: failed program was:" >&5
15308 cat conftest.$ac_ext >&5
15309 fi
15310 rm -f conftest.$ac_objext conftest.$ac_ext
15311                          CPPFLAGS="$cf_save_cppflags"
15312 fi
15313 rm -f conftest.$ac_objext conftest.$ac_ext
15314                 echo "$as_me:15314: result: $cf_define_xpg5" >&5
15315 echo "${ECHO_T}$cf_define_xpg5" >&6
15316
15317                 if test "$cf_define_xpg5" = yes
15318                 then
15319                         CPPFLAGS="$CPPFLAGS -D_XPG5"
15320                 fi
15321         fi
15322
15323         echo "$as_me:15323: checking for wide-character functions" >&5
15324 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
15325 if test "${cf_cv_widechar_funcs+set}" = set; then
15326   echo $ECHO_N "(cached) $ECHO_C" >&6
15327 else
15328
15329         cat >conftest.$ac_ext <<_ACEOF
15330 #line 15330 "configure"
15331 #include "confdefs.h"
15332
15333 #include <${cf_cv_ncurses_header:-curses.h}>
15334 int
15335 main ()
15336 {
15337
15338                 static wchar_t src_wchar[2];
15339                 static cchar_t dst_cchar;
15340                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
15341
15342   ;
15343   return 0;
15344 }
15345 _ACEOF
15346 rm -f conftest.$ac_objext conftest$ac_exeext
15347 if { (eval echo "$as_me:15347: \"$ac_link\"") >&5
15348   (eval $ac_link) 2>&5
15349   ac_status=$?
15350   echo "$as_me:15350: \$? = $ac_status" >&5
15351   (exit $ac_status); } &&
15352          { ac_try='test -s conftest$ac_exeext'
15353   { (eval echo "$as_me:15353: \"$ac_try\"") >&5
15354   (eval $ac_try) 2>&5
15355   ac_status=$?
15356   echo "$as_me:15356: \$? = $ac_status" >&5
15357   (exit $ac_status); }; }; then
15358   cf_cv_widechar_funcs=yes
15359 else
15360   echo "$as_me: failed program was:" >&5
15361 cat conftest.$ac_ext >&5
15362 cf_cv_widechar_funcs=no
15363 fi
15364 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15365
15366 fi
15367 echo "$as_me:15367: result: $cf_cv_widechar_funcs" >&5
15368 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
15369         if test "$cf_cv_widechar_funcs" != no ; then
15370
15371 cat >>confdefs.h <<\EOF
15372 #define USE_WIDEC_SUPPORT 1
15373 EOF
15374
15375         else
15376                 cat >>confdefs.h <<\EOF
15377 #define USE_WIDEC_SUPPORT 0
15378 EOF
15379
15380         fi
15381 else
15382         cat >>confdefs.h <<\EOF
15383 #define USE_WIDEC_SUPPORT 0
15384 EOF
15385
15386 fi
15387
15388 echo "$as_me:15388: checking if $cf_cv_screen library uses pthreads" >&5
15389 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
15390 if test "${cf_cv_use_pthreads+set}" = set; then
15391   echo $ECHO_N "(cached) $ECHO_C" >&6
15392 else
15393
15394 cat >conftest.$ac_ext <<_ACEOF
15395 #line 15395 "configure"
15396 #include "confdefs.h"
15397
15398 #include <${cf_cv_ncurses_header:-curses.h}>
15399 extern void _nc_init_pthreads(void);
15400
15401 int
15402 main ()
15403 {
15404
15405         initscr();
15406         _nc_init_pthreads();
15407
15408   ;
15409   return 0;
15410 }
15411 _ACEOF
15412 rm -f conftest.$ac_objext conftest$ac_exeext
15413 if { (eval echo "$as_me:15413: \"$ac_link\"") >&5
15414   (eval $ac_link) 2>&5
15415   ac_status=$?
15416   echo "$as_me:15416: \$? = $ac_status" >&5
15417   (exit $ac_status); } &&
15418          { ac_try='test -s conftest$ac_exeext'
15419   { (eval echo "$as_me:15419: \"$ac_try\"") >&5
15420   (eval $ac_try) 2>&5
15421   ac_status=$?
15422   echo "$as_me:15422: \$? = $ac_status" >&5
15423   (exit $ac_status); }; }; then
15424   cf_cv_use_pthreads=yes
15425 else
15426   echo "$as_me: failed program was:" >&5
15427 cat conftest.$ac_ext >&5
15428 cf_cv_use_pthreads=no
15429 fi
15430 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15431
15432 fi
15433 echo "$as_me:15433: result: $cf_cv_use_pthreads" >&5
15434 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
15435 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
15436 #define USE_PTHREADS 1
15437 EOF
15438
15439 echo "$as_me:15439: checking if sys/time.h works with sys/select.h" >&5
15440 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
15441 if test "${cf_cv_sys_time_select+set}" = set; then
15442   echo $ECHO_N "(cached) $ECHO_C" >&6
15443 else
15444
15445 cat >conftest.$ac_ext <<_ACEOF
15446 #line 15446 "configure"
15447 #include "confdefs.h"
15448
15449 #include <sys/types.h>
15450 #ifdef HAVE_SYS_TIME_H
15451 #include <sys/time.h>
15452 #endif
15453 #ifdef HAVE_SYS_SELECT_H
15454 #include <sys/select.h>
15455 #endif
15456
15457 int
15458 main ()
15459 {
15460
15461   ;
15462   return 0;
15463 }
15464 _ACEOF
15465 rm -f conftest.$ac_objext
15466 if { (eval echo "$as_me:15466: \"$ac_compile\"") >&5
15467   (eval $ac_compile) 2>&5
15468   ac_status=$?
15469   echo "$as_me:15469: \$? = $ac_status" >&5
15470   (exit $ac_status); } &&
15471          { ac_try='test -s conftest.$ac_objext'
15472   { (eval echo "$as_me:15472: \"$ac_try\"") >&5
15473   (eval $ac_try) 2>&5
15474   ac_status=$?
15475   echo "$as_me:15475: \$? = $ac_status" >&5
15476   (exit $ac_status); }; }; then
15477   cf_cv_sys_time_select=yes
15478 else
15479   echo "$as_me: failed program was:" >&5
15480 cat conftest.$ac_ext >&5
15481 cf_cv_sys_time_select=no
15482 fi
15483 rm -f conftest.$ac_objext conftest.$ac_ext
15484
15485 fi
15486
15487 echo "$as_me:15487: result: $cf_cv_sys_time_select" >&5
15488 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
15489 test "$cf_cv_sys_time_select" = yes &&
15490 cat >>confdefs.h <<\EOF
15491 #define HAVE_SYS_TIME_SELECT 1
15492 EOF
15493
15494 # special check for test/ditto.c
15495
15496 echo "$as_me:15496: checking for openpty in -lutil" >&5
15497 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
15498 if test "${ac_cv_lib_util_openpty+set}" = set; then
15499   echo $ECHO_N "(cached) $ECHO_C" >&6
15500 else
15501   ac_check_lib_save_LIBS=$LIBS
15502 LIBS="-lutil  $LIBS"
15503 cat >conftest.$ac_ext <<_ACEOF
15504 #line 15504 "configure"
15505 #include "confdefs.h"
15506
15507 /* Override any gcc2 internal prototype to avoid an error.  */
15508 #ifdef __cplusplus
15509 extern "C"
15510 #endif
15511 /* We use char because int might match the return type of a gcc2
15512    builtin and then its argument prototype would still apply.  */
15513 char openpty ();
15514 int
15515 main ()
15516 {
15517 openpty ();
15518   ;
15519   return 0;
15520 }
15521 _ACEOF
15522 rm -f conftest.$ac_objext conftest$ac_exeext
15523 if { (eval echo "$as_me:15523: \"$ac_link\"") >&5
15524   (eval $ac_link) 2>&5
15525   ac_status=$?
15526   echo "$as_me:15526: \$? = $ac_status" >&5
15527   (exit $ac_status); } &&
15528          { ac_try='test -s conftest$ac_exeext'
15529   { (eval echo "$as_me:15529: \"$ac_try\"") >&5
15530   (eval $ac_try) 2>&5
15531   ac_status=$?
15532   echo "$as_me:15532: \$? = $ac_status" >&5
15533   (exit $ac_status); }; }; then
15534   ac_cv_lib_util_openpty=yes
15535 else
15536   echo "$as_me: failed program was:" >&5
15537 cat conftest.$ac_ext >&5
15538 ac_cv_lib_util_openpty=no
15539 fi
15540 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15541 LIBS=$ac_check_lib_save_LIBS
15542 fi
15543 echo "$as_me:15543: result: $ac_cv_lib_util_openpty" >&5
15544 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
15545 if test $ac_cv_lib_util_openpty = yes; then
15546   cf_cv_lib_util=yes
15547 else
15548   cf_cv_lib_util=no
15549 fi
15550
15551 echo "$as_me:15551: checking for openpty header" >&5
15552 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
15553 if test "${cf_cv_func_openpty+set}" = set; then
15554   echo $ECHO_N "(cached) $ECHO_C" >&6
15555 else
15556
15557         cf_save_LIBS="$LIBS"
15558         test $cf_cv_lib_util = yes && {
15559 cf_add_libs="-lutil"
15560 # Filter out duplicates - this happens with badly-designed ".pc" files...
15561 for cf_add_1lib in $LIBS
15562 do
15563         for cf_add_2lib in $cf_add_libs
15564         do
15565                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15566                 then
15567                         cf_add_1lib=
15568                         break
15569                 fi
15570         done
15571         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15572 done
15573 LIBS="$cf_add_libs"
15574  }
15575         for cf_header in pty.h libutil.h util.h
15576         do
15577         cat >conftest.$ac_ext <<_ACEOF
15578 #line 15578 "configure"
15579 #include "confdefs.h"
15580
15581 #include <$cf_header>
15582
15583 int
15584 main ()
15585 {
15586
15587         int x = openpty((int *)0, (int *)0, (char *)0,
15588                                    (struct termios *)0, (struct winsize *)0);
15589
15590   ;
15591   return 0;
15592 }
15593 _ACEOF
15594 rm -f conftest.$ac_objext conftest$ac_exeext
15595 if { (eval echo "$as_me:15595: \"$ac_link\"") >&5
15596   (eval $ac_link) 2>&5
15597   ac_status=$?
15598   echo "$as_me:15598: \$? = $ac_status" >&5
15599   (exit $ac_status); } &&
15600          { ac_try='test -s conftest$ac_exeext'
15601   { (eval echo "$as_me:15601: \"$ac_try\"") >&5
15602   (eval $ac_try) 2>&5
15603   ac_status=$?
15604   echo "$as_me:15604: \$? = $ac_status" >&5
15605   (exit $ac_status); }; }; then
15606
15607                 cf_cv_func_openpty=$cf_header
15608                 break
15609
15610 else
15611   echo "$as_me: failed program was:" >&5
15612 cat conftest.$ac_ext >&5
15613
15614                 cf_cv_func_openpty=no
15615
15616 fi
15617 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15618         done
15619         LIBS="$cf_save_LIBS"
15620
15621 fi
15622 echo "$as_me:15622: result: $cf_cv_func_openpty" >&5
15623 echo "${ECHO_T}$cf_cv_func_openpty" >&6
15624
15625 if test "$cf_cv_func_openpty" != no ; then
15626
15627 cat >>confdefs.h <<EOF
15628 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
15629 EOF
15630
15631 cat >>confdefs.h <<\EOF
15632 #define USE_XTERM_PTY 1
15633 EOF
15634
15635         if test "x$cf_cv_lib_util" = xyes ; then
15636
15637 cf_add_libs="-lutil"
15638 # Filter out duplicates - this happens with badly-designed ".pc" files...
15639 for cf_add_1lib in $TEST_LIBS
15640 do
15641         for cf_add_2lib in $cf_add_libs
15642         do
15643                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15644                 then
15645                         cf_add_1lib=
15646                         break
15647                 fi
15648         done
15649         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15650 done
15651 TEST_LIBS="$cf_add_libs"
15652
15653         fi
15654 fi
15655
15656 echo "$as_me:15656: checking for function curses_version" >&5
15657 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
15658 if test "${cf_cv_func_curses_version+set}" = set; then
15659   echo $ECHO_N "(cached) $ECHO_C" >&6
15660 else
15661
15662 if test "$cross_compiling" = yes; then
15663   cf_cv_func_curses_version=unknown
15664 else
15665   cat >conftest.$ac_ext <<_ACEOF
15666 #line 15666 "configure"
15667 #include "confdefs.h"
15668
15669 #include <${cf_cv_ncurses_header:-curses.h}>
15670 int main()
15671 {
15672         char temp[1024];
15673         sprintf(temp, "%s\n", curses_version());
15674         ${cf_cv_main_return:-return}(0);
15675 }
15676
15677 _ACEOF
15678 rm -f conftest$ac_exeext
15679 if { (eval echo "$as_me:15679: \"$ac_link\"") >&5
15680   (eval $ac_link) 2>&5
15681   ac_status=$?
15682   echo "$as_me:15682: \$? = $ac_status" >&5
15683   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15684   { (eval echo "$as_me:15684: \"$ac_try\"") >&5
15685   (eval $ac_try) 2>&5
15686   ac_status=$?
15687   echo "$as_me:15687: \$? = $ac_status" >&5
15688   (exit $ac_status); }; }; then
15689   cf_cv_func_curses_version=yes
15690
15691 else
15692   echo "$as_me: program exited with status $ac_status" >&5
15693 echo "$as_me: failed program was:" >&5
15694 cat conftest.$ac_ext >&5
15695 cf_cv_func_curses_version=no
15696
15697 fi
15698 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15699 fi
15700 rm -f core
15701 fi
15702 echo "$as_me:15702: result: $cf_cv_func_curses_version" >&5
15703 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
15704 test "$cf_cv_func_curses_version" = yes &&
15705 cat >>confdefs.h <<\EOF
15706 #define HAVE_CURSES_VERSION 1
15707 EOF
15708
15709 echo "$as_me:15709: checking for alternate character set array" >&5
15710 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
15711 if test "${cf_cv_curses_acs_map+set}" = set; then
15712   echo $ECHO_N "(cached) $ECHO_C" >&6
15713 else
15714
15715 cf_cv_curses_acs_map=unknown
15716 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
15717 do
15718 cat >conftest.$ac_ext <<_ACEOF
15719 #line 15719 "configure"
15720 #include "confdefs.h"
15721
15722 #include <${cf_cv_ncurses_header:-curses.h}>
15723
15724 int
15725 main ()
15726 {
15727
15728 $name['k'] = ACS_PLUS
15729
15730   ;
15731   return 0;
15732 }
15733 _ACEOF
15734 rm -f conftest.$ac_objext conftest$ac_exeext
15735 if { (eval echo "$as_me:15735: \"$ac_link\"") >&5
15736   (eval $ac_link) 2>&5
15737   ac_status=$?
15738   echo "$as_me:15738: \$? = $ac_status" >&5
15739   (exit $ac_status); } &&
15740          { ac_try='test -s conftest$ac_exeext'
15741   { (eval echo "$as_me:15741: \"$ac_try\"") >&5
15742   (eval $ac_try) 2>&5
15743   ac_status=$?
15744   echo "$as_me:15744: \$? = $ac_status" >&5
15745   (exit $ac_status); }; }; then
15746   cf_cv_curses_acs_map=$name; break
15747 else
15748   echo "$as_me: failed program was:" >&5
15749 cat conftest.$ac_ext >&5
15750 fi
15751 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15752 done
15753
15754 fi
15755 echo "$as_me:15755: result: $cf_cv_curses_acs_map" >&5
15756 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
15757
15758 test "$cf_cv_curses_acs_map" != unknown &&
15759 cat >>confdefs.h <<EOF
15760 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
15761 EOF
15762
15763 if test "$cf_enable_widec" = yes; then
15764
15765 echo "$as_me:15765: checking for wide alternate character set array" >&5
15766 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
15767 if test "${cf_cv_curses_wacs_map+set}" = set; then
15768   echo $ECHO_N "(cached) $ECHO_C" >&6
15769 else
15770
15771         cf_cv_curses_wacs_map=unknown
15772         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
15773         do
15774         cat >conftest.$ac_ext <<_ACEOF
15775 #line 15775 "configure"
15776 #include "confdefs.h"
15777
15778 #ifndef _XOPEN_SOURCE_EXTENDED
15779 #define _XOPEN_SOURCE_EXTENDED
15780 #endif
15781 #include <${cf_cv_ncurses_header:-curses.h}>
15782 int
15783 main ()
15784 {
15785 void *foo = &($name['k'])
15786   ;
15787   return 0;
15788 }
15789 _ACEOF
15790 rm -f conftest.$ac_objext conftest$ac_exeext
15791 if { (eval echo "$as_me:15791: \"$ac_link\"") >&5
15792   (eval $ac_link) 2>&5
15793   ac_status=$?
15794   echo "$as_me:15794: \$? = $ac_status" >&5
15795   (exit $ac_status); } &&
15796          { ac_try='test -s conftest$ac_exeext'
15797   { (eval echo "$as_me:15797: \"$ac_try\"") >&5
15798   (eval $ac_try) 2>&5
15799   ac_status=$?
15800   echo "$as_me:15800: \$? = $ac_status" >&5
15801   (exit $ac_status); }; }; then
15802   cf_cv_curses_wacs_map=$name
15803          break
15804 else
15805   echo "$as_me: failed program was:" >&5
15806 cat conftest.$ac_ext >&5
15807 fi
15808 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15809         done
15810 fi
15811 echo "$as_me:15811: result: $cf_cv_curses_wacs_map" >&5
15812 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
15813
15814 test "$cf_cv_curses_wacs_map" != unknown &&
15815 cat >>confdefs.h <<EOF
15816 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
15817 EOF
15818
15819 echo "$as_me:15819: checking for wide alternate character constants" >&5
15820 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
15821 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
15822   echo $ECHO_N "(cached) $ECHO_C" >&6
15823 else
15824
15825 cf_cv_curses_wacs_symbols=no
15826 if test "$cf_cv_curses_wacs_map" != unknown
15827 then
15828         cat >conftest.$ac_ext <<_ACEOF
15829 #line 15829 "configure"
15830 #include "confdefs.h"
15831
15832 #ifndef _XOPEN_SOURCE_EXTENDED
15833 #define _XOPEN_SOURCE_EXTENDED
15834 #endif
15835 #include <${cf_cv_ncurses_header:-curses.h}>
15836 int
15837 main ()
15838 {
15839 cchar_t *foo = WACS_PLUS;
15840          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
15841   ;
15842   return 0;
15843 }
15844 _ACEOF
15845 rm -f conftest.$ac_objext conftest$ac_exeext
15846 if { (eval echo "$as_me:15846: \"$ac_link\"") >&5
15847   (eval $ac_link) 2>&5
15848   ac_status=$?
15849   echo "$as_me:15849: \$? = $ac_status" >&5
15850   (exit $ac_status); } &&
15851          { ac_try='test -s conftest$ac_exeext'
15852   { (eval echo "$as_me:15852: \"$ac_try\"") >&5
15853   (eval $ac_try) 2>&5
15854   ac_status=$?
15855   echo "$as_me:15855: \$? = $ac_status" >&5
15856   (exit $ac_status); }; }; then
15857   cf_cv_curses_wacs_symbols=yes
15858 else
15859   echo "$as_me: failed program was:" >&5
15860 cat conftest.$ac_ext >&5
15861 fi
15862 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15863 else
15864         cat >conftest.$ac_ext <<_ACEOF
15865 #line 15865 "configure"
15866 #include "confdefs.h"
15867
15868 #ifndef _XOPEN_SOURCE_EXTENDED
15869 #define _XOPEN_SOURCE_EXTENDED
15870 #endif
15871 #include <${cf_cv_ncurses_header:-curses.h}>
15872 int
15873 main ()
15874 {
15875 cchar_t *foo = WACS_PLUS
15876   ;
15877   return 0;
15878 }
15879 _ACEOF
15880 rm -f conftest.$ac_objext conftest$ac_exeext
15881 if { (eval echo "$as_me:15881: \"$ac_link\"") >&5
15882   (eval $ac_link) 2>&5
15883   ac_status=$?
15884   echo "$as_me:15884: \$? = $ac_status" >&5
15885   (exit $ac_status); } &&
15886          { ac_try='test -s conftest$ac_exeext'
15887   { (eval echo "$as_me:15887: \"$ac_try\"") >&5
15888   (eval $ac_try) 2>&5
15889   ac_status=$?
15890   echo "$as_me:15890: \$? = $ac_status" >&5
15891   (exit $ac_status); }; }; then
15892   cf_cv_curses_wacs_symbols=yes
15893 else
15894   echo "$as_me: failed program was:" >&5
15895 cat conftest.$ac_ext >&5
15896 fi
15897 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15898 fi
15899
15900 fi
15901 echo "$as_me:15901: result: $cf_cv_curses_wacs_symbols" >&5
15902 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15903
15904 test "$cf_cv_curses_wacs_symbols" != no &&
15905 cat >>confdefs.h <<\EOF
15906 #define CURSES_WACS_SYMBOLS 1
15907 EOF
15908
15909 fi
15910
15911 echo "$as_me:15911: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15912 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15913 cat >conftest.$ac_ext <<_ACEOF
15914 #line 15914 "configure"
15915 #include "confdefs.h"
15916
15917 #ifndef _XOPEN_SOURCE_EXTENDED
15918 #define _XOPEN_SOURCE_EXTENDED
15919 #endif
15920 #include <${cf_cv_ncurses_header:-curses.h}>
15921 int
15922 main ()
15923 {
15924
15925 attr_t foo
15926
15927   ;
15928   return 0;
15929 }
15930 _ACEOF
15931 rm -f conftest.$ac_objext
15932 if { (eval echo "$as_me:15932: \"$ac_compile\"") >&5
15933   (eval $ac_compile) 2>&5
15934   ac_status=$?
15935   echo "$as_me:15935: \$? = $ac_status" >&5
15936   (exit $ac_status); } &&
15937          { ac_try='test -s conftest.$ac_objext'
15938   { (eval echo "$as_me:15938: \"$ac_try\"") >&5
15939   (eval $ac_try) 2>&5
15940   ac_status=$?
15941   echo "$as_me:15941: \$? = $ac_status" >&5
15942   (exit $ac_status); }; }; then
15943   cf_result=yes
15944 else
15945   echo "$as_me: failed program was:" >&5
15946 cat conftest.$ac_ext >&5
15947 cf_result=no
15948 fi
15949 rm -f conftest.$ac_objext conftest.$ac_ext
15950 echo "$as_me:15950: result: $cf_result" >&5
15951 echo "${ECHO_T}$cf_result" >&6
15952 if test $cf_result = yes ; then
15953
15954 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15955
15956 cat >>confdefs.h <<EOF
15957 #define $cf_result 1
15958 EOF
15959
15960 else
15961
15962 cat >>confdefs.h <<EOF
15963 #define attr_t long
15964 EOF
15965
15966 fi
15967
15968 if test "$cf_enable_widec" = yes; then
15969
15970 # This is needed on Tru64 5.0 to declare mbstate_t
15971 echo "$as_me:15971: checking if we must include wchar.h to declare mbstate_t" >&5
15972 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15973 if test "${cf_cv_mbstate_t+set}" = set; then
15974   echo $ECHO_N "(cached) $ECHO_C" >&6
15975 else
15976
15977 cat >conftest.$ac_ext <<_ACEOF
15978 #line 15978 "configure"
15979 #include "confdefs.h"
15980
15981 #include <stdlib.h>
15982 #include <stdarg.h>
15983 #include <stdio.h>
15984 #ifdef HAVE_LIBUTF8_H
15985 #include <libutf8.h>
15986 #endif
15987 int
15988 main ()
15989 {
15990 mbstate_t state
15991   ;
15992   return 0;
15993 }
15994 _ACEOF
15995 rm -f conftest.$ac_objext
15996 if { (eval echo "$as_me:15996: \"$ac_compile\"") >&5
15997   (eval $ac_compile) 2>&5
15998   ac_status=$?
15999   echo "$as_me:15999: \$? = $ac_status" >&5
16000   (exit $ac_status); } &&
16001          { ac_try='test -s conftest.$ac_objext'
16002   { (eval echo "$as_me:16002: \"$ac_try\"") >&5
16003   (eval $ac_try) 2>&5
16004   ac_status=$?
16005   echo "$as_me:16005: \$? = $ac_status" >&5
16006   (exit $ac_status); }; }; then
16007   cf_cv_mbstate_t=no
16008 else
16009   echo "$as_me: failed program was:" >&5
16010 cat conftest.$ac_ext >&5
16011 cat >conftest.$ac_ext <<_ACEOF
16012 #line 16012 "configure"
16013 #include "confdefs.h"
16014
16015 #include <stdlib.h>
16016 #include <stdarg.h>
16017 #include <stdio.h>
16018 #include <wchar.h>
16019 #ifdef HAVE_LIBUTF8_H
16020 #include <libutf8.h>
16021 #endif
16022 int
16023 main ()
16024 {
16025 mbstate_t value
16026   ;
16027   return 0;
16028 }
16029 _ACEOF
16030 rm -f conftest.$ac_objext
16031 if { (eval echo "$as_me:16031: \"$ac_compile\"") >&5
16032   (eval $ac_compile) 2>&5
16033   ac_status=$?
16034   echo "$as_me:16034: \$? = $ac_status" >&5
16035   (exit $ac_status); } &&
16036          { ac_try='test -s conftest.$ac_objext'
16037   { (eval echo "$as_me:16037: \"$ac_try\"") >&5
16038   (eval $ac_try) 2>&5
16039   ac_status=$?
16040   echo "$as_me:16040: \$? = $ac_status" >&5
16041   (exit $ac_status); }; }; then
16042   cf_cv_mbstate_t=yes
16043 else
16044   echo "$as_me: failed program was:" >&5
16045 cat conftest.$ac_ext >&5
16046 cf_cv_mbstate_t=unknown
16047 fi
16048 rm -f conftest.$ac_objext conftest.$ac_ext
16049 fi
16050 rm -f conftest.$ac_objext conftest.$ac_ext
16051 fi
16052 echo "$as_me:16052: result: $cf_cv_mbstate_t" >&5
16053 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
16054
16055 if test "$cf_cv_mbstate_t" = yes ; then
16056
16057 cat >>confdefs.h <<\EOF
16058 #define NEED_WCHAR_H 1
16059 EOF
16060
16061         NEED_WCHAR_H=1
16062 fi
16063
16064 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
16065 if test "$cf_cv_mbstate_t" = unknown ; then
16066         NCURSES_MBSTATE_T=1
16067 fi
16068
16069 # if we find mbstate_t in either place, use substitution to provide a fallback.
16070 if test "$cf_cv_mbstate_t" != unknown ; then
16071         NCURSES_OK_MBSTATE_T=1
16072 fi
16073
16074 # This is needed on Tru64 5.0 to declare wchar_t
16075 echo "$as_me:16075: checking if we must include wchar.h to declare wchar_t" >&5
16076 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
16077 if test "${cf_cv_wchar_t+set}" = set; then
16078   echo $ECHO_N "(cached) $ECHO_C" >&6
16079 else
16080
16081 cat >conftest.$ac_ext <<_ACEOF
16082 #line 16082 "configure"
16083 #include "confdefs.h"
16084
16085 #include <stdlib.h>
16086 #include <stdarg.h>
16087 #include <stdio.h>
16088 #ifdef HAVE_LIBUTF8_H
16089 #include <libutf8.h>
16090 #endif
16091 int
16092 main ()
16093 {
16094 wchar_t state
16095   ;
16096   return 0;
16097 }
16098 _ACEOF
16099 rm -f conftest.$ac_objext
16100 if { (eval echo "$as_me:16100: \"$ac_compile\"") >&5
16101   (eval $ac_compile) 2>&5
16102   ac_status=$?
16103   echo "$as_me:16103: \$? = $ac_status" >&5
16104   (exit $ac_status); } &&
16105          { ac_try='test -s conftest.$ac_objext'
16106   { (eval echo "$as_me:16106: \"$ac_try\"") >&5
16107   (eval $ac_try) 2>&5
16108   ac_status=$?
16109   echo "$as_me:16109: \$? = $ac_status" >&5
16110   (exit $ac_status); }; }; then
16111   cf_cv_wchar_t=no
16112 else
16113   echo "$as_me: failed program was:" >&5
16114 cat conftest.$ac_ext >&5
16115 cat >conftest.$ac_ext <<_ACEOF
16116 #line 16116 "configure"
16117 #include "confdefs.h"
16118
16119 #include <stdlib.h>
16120 #include <stdarg.h>
16121 #include <stdio.h>
16122 #include <wchar.h>
16123 #ifdef HAVE_LIBUTF8_H
16124 #include <libutf8.h>
16125 #endif
16126 int
16127 main ()
16128 {
16129 wchar_t value
16130   ;
16131   return 0;
16132 }
16133 _ACEOF
16134 rm -f conftest.$ac_objext
16135 if { (eval echo "$as_me:16135: \"$ac_compile\"") >&5
16136   (eval $ac_compile) 2>&5
16137   ac_status=$?
16138   echo "$as_me:16138: \$? = $ac_status" >&5
16139   (exit $ac_status); } &&
16140          { ac_try='test -s conftest.$ac_objext'
16141   { (eval echo "$as_me:16141: \"$ac_try\"") >&5
16142   (eval $ac_try) 2>&5
16143   ac_status=$?
16144   echo "$as_me:16144: \$? = $ac_status" >&5
16145   (exit $ac_status); }; }; then
16146   cf_cv_wchar_t=yes
16147 else
16148   echo "$as_me: failed program was:" >&5
16149 cat conftest.$ac_ext >&5
16150 cf_cv_wchar_t=unknown
16151 fi
16152 rm -f conftest.$ac_objext conftest.$ac_ext
16153 fi
16154 rm -f conftest.$ac_objext conftest.$ac_ext
16155 fi
16156 echo "$as_me:16156: result: $cf_cv_wchar_t" >&5
16157 echo "${ECHO_T}$cf_cv_wchar_t" >&6
16158
16159 if test "$cf_cv_wchar_t" = yes ; then
16160
16161 cat >>confdefs.h <<\EOF
16162 #define NEED_WCHAR_H 1
16163 EOF
16164
16165         NEED_WCHAR_H=1
16166 fi
16167
16168 # if we do not find wchar_t in either place, use substitution to provide a fallback.
16169 if test "$cf_cv_wchar_t" = unknown ; then
16170         NCURSES_WCHAR_T=1
16171 fi
16172
16173 # if we find wchar_t in either place, use substitution to provide a fallback.
16174 if test "$cf_cv_wchar_t" != unknown ; then
16175         NCURSES_OK_WCHAR_T=1
16176 fi
16177
16178 # This is needed on Tru64 5.0 to declare wint_t
16179 echo "$as_me:16179: checking if we must include wchar.h to declare wint_t" >&5
16180 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
16181 if test "${cf_cv_wint_t+set}" = set; then
16182   echo $ECHO_N "(cached) $ECHO_C" >&6
16183 else
16184
16185 cat >conftest.$ac_ext <<_ACEOF
16186 #line 16186 "configure"
16187 #include "confdefs.h"
16188
16189 #include <stdlib.h>
16190 #include <stdarg.h>
16191 #include <stdio.h>
16192 #ifdef HAVE_LIBUTF8_H
16193 #include <libutf8.h>
16194 #endif
16195 int
16196 main ()
16197 {
16198 wint_t state
16199   ;
16200   return 0;
16201 }
16202 _ACEOF
16203 rm -f conftest.$ac_objext
16204 if { (eval echo "$as_me:16204: \"$ac_compile\"") >&5
16205   (eval $ac_compile) 2>&5
16206   ac_status=$?
16207   echo "$as_me:16207: \$? = $ac_status" >&5
16208   (exit $ac_status); } &&
16209          { ac_try='test -s conftest.$ac_objext'
16210   { (eval echo "$as_me:16210: \"$ac_try\"") >&5
16211   (eval $ac_try) 2>&5
16212   ac_status=$?
16213   echo "$as_me:16213: \$? = $ac_status" >&5
16214   (exit $ac_status); }; }; then
16215   cf_cv_wint_t=no
16216 else
16217   echo "$as_me: failed program was:" >&5
16218 cat conftest.$ac_ext >&5
16219 cat >conftest.$ac_ext <<_ACEOF
16220 #line 16220 "configure"
16221 #include "confdefs.h"
16222
16223 #include <stdlib.h>
16224 #include <stdarg.h>
16225 #include <stdio.h>
16226 #include <wchar.h>
16227 #ifdef HAVE_LIBUTF8_H
16228 #include <libutf8.h>
16229 #endif
16230 int
16231 main ()
16232 {
16233 wint_t value
16234   ;
16235   return 0;
16236 }
16237 _ACEOF
16238 rm -f conftest.$ac_objext
16239 if { (eval echo "$as_me:16239: \"$ac_compile\"") >&5
16240   (eval $ac_compile) 2>&5
16241   ac_status=$?
16242   echo "$as_me:16242: \$? = $ac_status" >&5
16243   (exit $ac_status); } &&
16244          { ac_try='test -s conftest.$ac_objext'
16245   { (eval echo "$as_me:16245: \"$ac_try\"") >&5
16246   (eval $ac_try) 2>&5
16247   ac_status=$?
16248   echo "$as_me:16248: \$? = $ac_status" >&5
16249   (exit $ac_status); }; }; then
16250   cf_cv_wint_t=yes
16251 else
16252   echo "$as_me: failed program was:" >&5
16253 cat conftest.$ac_ext >&5
16254 cf_cv_wint_t=unknown
16255 fi
16256 rm -f conftest.$ac_objext conftest.$ac_ext
16257 fi
16258 rm -f conftest.$ac_objext conftest.$ac_ext
16259 fi
16260 echo "$as_me:16260: result: $cf_cv_wint_t" >&5
16261 echo "${ECHO_T}$cf_cv_wint_t" >&6
16262
16263 if test "$cf_cv_wint_t" = yes ; then
16264
16265 cat >>confdefs.h <<\EOF
16266 #define NEED_WCHAR_H 1
16267 EOF
16268
16269         NEED_WCHAR_H=1
16270 fi
16271
16272 # if we do not find wint_t in either place, use substitution to provide a fallback.
16273 if test "$cf_cv_wint_t" = unknown ; then
16274         NCURSES_WINT_T=1
16275 fi
16276
16277 # if we find wint_t in either place, use substitution to provide a fallback.
16278 if test "$cf_cv_wint_t" != unknown ; then
16279         NCURSES_OK_WINT_T=1
16280 fi
16281
16282         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
16283
16284 echo "$as_me:16284: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16285 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16286 cat >conftest.$ac_ext <<_ACEOF
16287 #line 16287 "configure"
16288 #include "confdefs.h"
16289
16290 #ifndef _XOPEN_SOURCE_EXTENDED
16291 #define _XOPEN_SOURCE_EXTENDED
16292 #endif
16293 #include <${cf_cv_ncurses_header:-curses.h}>
16294 int
16295 main ()
16296 {
16297
16298 mbstate_t foo
16299
16300   ;
16301   return 0;
16302 }
16303 _ACEOF
16304 rm -f conftest.$ac_objext
16305 if { (eval echo "$as_me:16305: \"$ac_compile\"") >&5
16306   (eval $ac_compile) 2>&5
16307   ac_status=$?
16308   echo "$as_me:16308: \$? = $ac_status" >&5
16309   (exit $ac_status); } &&
16310          { ac_try='test -s conftest.$ac_objext'
16311   { (eval echo "$as_me:16311: \"$ac_try\"") >&5
16312   (eval $ac_try) 2>&5
16313   ac_status=$?
16314   echo "$as_me:16314: \$? = $ac_status" >&5
16315   (exit $ac_status); }; }; then
16316   cf_result=yes
16317 else
16318   echo "$as_me: failed program was:" >&5
16319 cat conftest.$ac_ext >&5
16320 cf_result=no
16321 fi
16322 rm -f conftest.$ac_objext conftest.$ac_ext
16323 echo "$as_me:16323: result: $cf_result" >&5
16324 echo "${ECHO_T}$cf_result" >&6
16325 if test $cf_result = yes ; then
16326
16327 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16328
16329 cat >>confdefs.h <<EOF
16330 #define $cf_result 1
16331 EOF
16332
16333 else
16334
16335 cat >>confdefs.h <<EOF
16336 #define mbstate_t long
16337 EOF
16338
16339 fi
16340
16341         fi
16342
16343         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
16344
16345 echo "$as_me:16345: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16346 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16347 cat >conftest.$ac_ext <<_ACEOF
16348 #line 16348 "configure"
16349 #include "confdefs.h"
16350
16351 #ifndef _XOPEN_SOURCE_EXTENDED
16352 #define _XOPEN_SOURCE_EXTENDED
16353 #endif
16354 #include <${cf_cv_ncurses_header:-curses.h}>
16355 int
16356 main ()
16357 {
16358
16359 wchar_t foo
16360
16361   ;
16362   return 0;
16363 }
16364 _ACEOF
16365 rm -f conftest.$ac_objext
16366 if { (eval echo "$as_me:16366: \"$ac_compile\"") >&5
16367   (eval $ac_compile) 2>&5
16368   ac_status=$?
16369   echo "$as_me:16369: \$? = $ac_status" >&5
16370   (exit $ac_status); } &&
16371          { ac_try='test -s conftest.$ac_objext'
16372   { (eval echo "$as_me:16372: \"$ac_try\"") >&5
16373   (eval $ac_try) 2>&5
16374   ac_status=$?
16375   echo "$as_me:16375: \$? = $ac_status" >&5
16376   (exit $ac_status); }; }; then
16377   cf_result=yes
16378 else
16379   echo "$as_me: failed program was:" >&5
16380 cat conftest.$ac_ext >&5
16381 cf_result=no
16382 fi
16383 rm -f conftest.$ac_objext conftest.$ac_ext
16384 echo "$as_me:16384: result: $cf_result" >&5
16385 echo "${ECHO_T}$cf_result" >&6
16386 if test $cf_result = yes ; then
16387
16388 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16389
16390 cat >>confdefs.h <<EOF
16391 #define $cf_result 1
16392 EOF
16393
16394 else
16395
16396 cat >>confdefs.h <<EOF
16397 #define wchar_t long
16398 EOF
16399
16400 fi
16401
16402         fi
16403
16404         if test "$NCURSES_OK_WINT_T" = 0 ; then
16405
16406 echo "$as_me:16406: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16407 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16408 cat >conftest.$ac_ext <<_ACEOF
16409 #line 16409 "configure"
16410 #include "confdefs.h"
16411
16412 #ifndef _XOPEN_SOURCE_EXTENDED
16413 #define _XOPEN_SOURCE_EXTENDED
16414 #endif
16415 #include <${cf_cv_ncurses_header:-curses.h}>
16416 int
16417 main ()
16418 {
16419
16420 wint_t foo
16421
16422   ;
16423   return 0;
16424 }
16425 _ACEOF
16426 rm -f conftest.$ac_objext
16427 if { (eval echo "$as_me:16427: \"$ac_compile\"") >&5
16428   (eval $ac_compile) 2>&5
16429   ac_status=$?
16430   echo "$as_me:16430: \$? = $ac_status" >&5
16431   (exit $ac_status); } &&
16432          { ac_try='test -s conftest.$ac_objext'
16433   { (eval echo "$as_me:16433: \"$ac_try\"") >&5
16434   (eval $ac_try) 2>&5
16435   ac_status=$?
16436   echo "$as_me:16436: \$? = $ac_status" >&5
16437   (exit $ac_status); }; }; then
16438   cf_result=yes
16439 else
16440   echo "$as_me: failed program was:" >&5
16441 cat conftest.$ac_ext >&5
16442 cf_result=no
16443 fi
16444 rm -f conftest.$ac_objext conftest.$ac_ext
16445 echo "$as_me:16445: result: $cf_result" >&5
16446 echo "${ECHO_T}$cf_result" >&6
16447 if test $cf_result = yes ; then
16448
16449 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16450
16451 cat >>confdefs.h <<EOF
16452 #define $cf_result 1
16453 EOF
16454
16455 else
16456
16457 cat >>confdefs.h <<EOF
16458 #define wint_t long
16459 EOF
16460
16461 fi
16462
16463         fi
16464 fi
16465
16466 echo "$as_me:16466: checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16467 echo $ECHO_N "checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16468
16469 cat >conftest.$ac_ext <<_ACEOF
16470 #line 16470 "configure"
16471 #include "confdefs.h"
16472
16473 #ifdef HAVE_XCURSES
16474 #include <xcurses.h>
16475 char * XCursesProgramName = "test";
16476 #else
16477 #include <${cf_cv_ncurses_header:-curses.h}>
16478 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16479 #include <ncursesw/term.h>
16480 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16481 #include <ncurses/term.h>
16482 #elif defined(HAVE_TERM_H)
16483 #include <term.h>
16484 #endif
16485 #endif
16486
16487 int
16488 main ()
16489 {
16490
16491 void *foo = &(ospeed)
16492
16493   ;
16494   return 0;
16495 }
16496 _ACEOF
16497 rm -f conftest.$ac_objext
16498 if { (eval echo "$as_me:16498: \"$ac_compile\"") >&5
16499   (eval $ac_compile) 2>&5
16500   ac_status=$?
16501   echo "$as_me:16501: \$? = $ac_status" >&5
16502   (exit $ac_status); } &&
16503          { ac_try='test -s conftest.$ac_objext'
16504   { (eval echo "$as_me:16504: \"$ac_try\"") >&5
16505   (eval $ac_try) 2>&5
16506   ac_status=$?
16507   echo "$as_me:16507: \$? = $ac_status" >&5
16508   (exit $ac_status); }; }; then
16509   cf_result=yes
16510 else
16511   echo "$as_me: failed program was:" >&5
16512 cat conftest.$ac_ext >&5
16513 cf_result=no
16514 fi
16515 rm -f conftest.$ac_objext conftest.$ac_ext
16516 echo "$as_me:16516: result: $cf_result" >&5
16517 echo "${ECHO_T}$cf_result" >&6
16518
16519 if test $cf_result = yes ; then
16520
16521 cf_result=`echo "have_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16522
16523         cat >>confdefs.h <<EOF
16524 #define $cf_result 1
16525 EOF
16526
16527 else
16528         echo "$as_me:16528: checking for data ospeed in library" >&5
16529 echo $ECHO_N "checking for data ospeed in library... $ECHO_C" >&6
16530         # BSD linkers insist on making weak linkage, but resolve at runtime.
16531         if test "$cross_compiling" = yes; then
16532
16533         # cross-compiling
16534         cat >conftest.$ac_ext <<_ACEOF
16535 #line 16535 "configure"
16536 #include "confdefs.h"
16537
16538 #ifdef HAVE_XCURSES
16539 #include <xcurses.h>
16540 char * XCursesProgramName = "test";
16541 #else
16542 #include <${cf_cv_ncurses_header:-curses.h}>
16543 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16544 #include <ncursesw/term.h>
16545 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16546 #include <ncurses/term.h>
16547 #elif defined(HAVE_TERM_H)
16548 #include <term.h>
16549 #endif
16550 #endif
16551
16552 extern char ospeed;
16553 int
16554 main ()
16555 {
16556
16557         do {
16558                 void *foo = &(ospeed);
16559                 fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16560                 ${cf_cv_main_return:-return}(foo == 0);
16561         } while (0)
16562
16563   ;
16564   return 0;
16565 }
16566 _ACEOF
16567 rm -f conftest.$ac_objext conftest$ac_exeext
16568 if { (eval echo "$as_me:16568: \"$ac_link\"") >&5
16569   (eval $ac_link) 2>&5
16570   ac_status=$?
16571   echo "$as_me:16571: \$? = $ac_status" >&5
16572   (exit $ac_status); } &&
16573          { ac_try='test -s conftest$ac_exeext'
16574   { (eval echo "$as_me:16574: \"$ac_try\"") >&5
16575   (eval $ac_try) 2>&5
16576   ac_status=$?
16577   echo "$as_me:16577: \$? = $ac_status" >&5
16578   (exit $ac_status); }; }; then
16579   cf_result=yes
16580 else
16581   echo "$as_me: failed program was:" >&5
16582 cat conftest.$ac_ext >&5
16583 cf_result=no
16584 fi
16585 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16586
16587 else
16588   cat >conftest.$ac_ext <<_ACEOF
16589 #line 16589 "configure"
16590 #include "confdefs.h"
16591
16592 #ifdef HAVE_XCURSES
16593 #include <xcurses.h>
16594 char * XCursesProgramName = "test";
16595 #else
16596 #include <${cf_cv_ncurses_header:-curses.h}>
16597 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16598 #include <ncursesw/term.h>
16599 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16600 #include <ncurses/term.h>
16601 #elif defined(HAVE_TERM_H)
16602 #include <term.h>
16603 #endif
16604 #endif
16605
16606 extern char ospeed;
16607 int main(void)
16608 {
16609         void *foo = &(ospeed);
16610         fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16611         ${cf_cv_main_return:-return}(foo == 0);
16612 }
16613 _ACEOF
16614 rm -f conftest$ac_exeext
16615 if { (eval echo "$as_me:16615: \"$ac_link\"") >&5
16616   (eval $ac_link) 2>&5
16617   ac_status=$?
16618   echo "$as_me:16618: \$? = $ac_status" >&5
16619   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16620   { (eval echo "$as_me:16620: \"$ac_try\"") >&5
16621   (eval $ac_try) 2>&5
16622   ac_status=$?
16623   echo "$as_me:16623: \$? = $ac_status" >&5
16624   (exit $ac_status); }; }; then
16625   cf_result=yes
16626 else
16627   echo "$as_me: program exited with status $ac_status" >&5
16628 echo "$as_me: failed program was:" >&5
16629 cat conftest.$ac_ext >&5
16630 cf_result=no
16631 fi
16632 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16633 fi
16634         echo "$as_me:16634: result: $cf_result" >&5
16635 echo "${ECHO_T}$cf_result" >&6
16636         if test $cf_result = yes ; then
16637
16638 cf_result=`echo "decl_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16639
16640                 cat >>confdefs.h <<EOF
16641 #define $cf_result 1
16642 EOF
16643
16644         fi
16645 fi
16646
16647 echo "$as_me:16647: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16648 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16649
16650 cat >conftest.$ac_ext <<_ACEOF
16651 #line 16651 "configure"
16652 #include "confdefs.h"
16653
16654 #ifdef HAVE_XCURSES
16655 #include <xcurses.h>
16656 char * XCursesProgramName = "test";
16657 #else
16658 #include <${cf_cv_ncurses_header:-curses.h}>
16659 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16660 #include <ncursesw/term.h>
16661 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16662 #include <ncurses/term.h>
16663 #elif defined(HAVE_TERM_H)
16664 #include <term.h>
16665 #endif
16666 #endif
16667
16668 int
16669 main ()
16670 {
16671
16672 void *foo = &(boolnames)
16673
16674   ;
16675   return 0;
16676 }
16677 _ACEOF
16678 rm -f conftest.$ac_objext
16679 if { (eval echo "$as_me:16679: \"$ac_compile\"") >&5
16680   (eval $ac_compile) 2>&5
16681   ac_status=$?
16682   echo "$as_me:16682: \$? = $ac_status" >&5
16683   (exit $ac_status); } &&
16684          { ac_try='test -s conftest.$ac_objext'
16685   { (eval echo "$as_me:16685: \"$ac_try\"") >&5
16686   (eval $ac_try) 2>&5
16687   ac_status=$?
16688   echo "$as_me:16688: \$? = $ac_status" >&5
16689   (exit $ac_status); }; }; then
16690   cf_result=yes
16691 else
16692   echo "$as_me: failed program was:" >&5
16693 cat conftest.$ac_ext >&5
16694 cf_result=no
16695 fi
16696 rm -f conftest.$ac_objext conftest.$ac_ext
16697 echo "$as_me:16697: result: $cf_result" >&5
16698 echo "${ECHO_T}$cf_result" >&6
16699
16700 if test $cf_result = yes ; then
16701
16702 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16703
16704         cat >>confdefs.h <<EOF
16705 #define $cf_result 1
16706 EOF
16707
16708 else
16709         echo "$as_me:16709: checking for data boolnames in library" >&5
16710 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
16711         # BSD linkers insist on making weak linkage, but resolve at runtime.
16712         if test "$cross_compiling" = yes; then
16713
16714         # cross-compiling
16715         cat >conftest.$ac_ext <<_ACEOF
16716 #line 16716 "configure"
16717 #include "confdefs.h"
16718
16719 #ifdef HAVE_XCURSES
16720 #include <xcurses.h>
16721 char * XCursesProgramName = "test";
16722 #else
16723 #include <${cf_cv_ncurses_header:-curses.h}>
16724 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16725 #include <ncursesw/term.h>
16726 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16727 #include <ncurses/term.h>
16728 #elif defined(HAVE_TERM_H)
16729 #include <term.h>
16730 #endif
16731 #endif
16732
16733 extern char boolnames;
16734 int
16735 main ()
16736 {
16737
16738         do {
16739                 void *foo = &(boolnames);
16740                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16741                 ${cf_cv_main_return:-return}(foo == 0);
16742         } while (0)
16743
16744   ;
16745   return 0;
16746 }
16747 _ACEOF
16748 rm -f conftest.$ac_objext conftest$ac_exeext
16749 if { (eval echo "$as_me:16749: \"$ac_link\"") >&5
16750   (eval $ac_link) 2>&5
16751   ac_status=$?
16752   echo "$as_me:16752: \$? = $ac_status" >&5
16753   (exit $ac_status); } &&
16754          { ac_try='test -s conftest$ac_exeext'
16755   { (eval echo "$as_me:16755: \"$ac_try\"") >&5
16756   (eval $ac_try) 2>&5
16757   ac_status=$?
16758   echo "$as_me:16758: \$? = $ac_status" >&5
16759   (exit $ac_status); }; }; then
16760   cf_result=yes
16761 else
16762   echo "$as_me: failed program was:" >&5
16763 cat conftest.$ac_ext >&5
16764 cf_result=no
16765 fi
16766 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16767
16768 else
16769   cat >conftest.$ac_ext <<_ACEOF
16770 #line 16770 "configure"
16771 #include "confdefs.h"
16772
16773 #ifdef HAVE_XCURSES
16774 #include <xcurses.h>
16775 char * XCursesProgramName = "test";
16776 #else
16777 #include <${cf_cv_ncurses_header:-curses.h}>
16778 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16779 #include <ncursesw/term.h>
16780 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16781 #include <ncurses/term.h>
16782 #elif defined(HAVE_TERM_H)
16783 #include <term.h>
16784 #endif
16785 #endif
16786
16787 extern char boolnames;
16788 int main(void)
16789 {
16790         void *foo = &(boolnames);
16791         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16792         ${cf_cv_main_return:-return}(foo == 0);
16793 }
16794 _ACEOF
16795 rm -f conftest$ac_exeext
16796 if { (eval echo "$as_me:16796: \"$ac_link\"") >&5
16797   (eval $ac_link) 2>&5
16798   ac_status=$?
16799   echo "$as_me:16799: \$? = $ac_status" >&5
16800   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16801   { (eval echo "$as_me:16801: \"$ac_try\"") >&5
16802   (eval $ac_try) 2>&5
16803   ac_status=$?
16804   echo "$as_me:16804: \$? = $ac_status" >&5
16805   (exit $ac_status); }; }; then
16806   cf_result=yes
16807 else
16808   echo "$as_me: program exited with status $ac_status" >&5
16809 echo "$as_me: failed program was:" >&5
16810 cat conftest.$ac_ext >&5
16811 cf_result=no
16812 fi
16813 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16814 fi
16815         echo "$as_me:16815: result: $cf_result" >&5
16816 echo "${ECHO_T}$cf_result" >&6
16817         if test $cf_result = yes ; then
16818
16819 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16820
16821                 cat >>confdefs.h <<EOF
16822 #define $cf_result 1
16823 EOF
16824
16825         fi
16826 fi
16827
16828 echo "$as_me:16828: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16829 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16830
16831 cat >conftest.$ac_ext <<_ACEOF
16832 #line 16832 "configure"
16833 #include "confdefs.h"
16834
16835 #ifdef HAVE_XCURSES
16836 #include <xcurses.h>
16837 char * XCursesProgramName = "test";
16838 #else
16839 #include <${cf_cv_ncurses_header:-curses.h}>
16840 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16841 #include <ncursesw/term.h>
16842 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16843 #include <ncurses/term.h>
16844 #elif defined(HAVE_TERM_H)
16845 #include <term.h>
16846 #endif
16847 #endif
16848
16849 int
16850 main ()
16851 {
16852
16853 void *foo = &(boolfnames)
16854
16855   ;
16856   return 0;
16857 }
16858 _ACEOF
16859 rm -f conftest.$ac_objext
16860 if { (eval echo "$as_me:16860: \"$ac_compile\"") >&5
16861   (eval $ac_compile) 2>&5
16862   ac_status=$?
16863   echo "$as_me:16863: \$? = $ac_status" >&5
16864   (exit $ac_status); } &&
16865          { ac_try='test -s conftest.$ac_objext'
16866   { (eval echo "$as_me:16866: \"$ac_try\"") >&5
16867   (eval $ac_try) 2>&5
16868   ac_status=$?
16869   echo "$as_me:16869: \$? = $ac_status" >&5
16870   (exit $ac_status); }; }; then
16871   cf_result=yes
16872 else
16873   echo "$as_me: failed program was:" >&5
16874 cat conftest.$ac_ext >&5
16875 cf_result=no
16876 fi
16877 rm -f conftest.$ac_objext conftest.$ac_ext
16878 echo "$as_me:16878: result: $cf_result" >&5
16879 echo "${ECHO_T}$cf_result" >&6
16880
16881 if test $cf_result = yes ; then
16882
16883 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16884
16885         cat >>confdefs.h <<EOF
16886 #define $cf_result 1
16887 EOF
16888
16889 else
16890         echo "$as_me:16890: checking for data boolfnames in library" >&5
16891 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
16892         # BSD linkers insist on making weak linkage, but resolve at runtime.
16893         if test "$cross_compiling" = yes; then
16894
16895         # cross-compiling
16896         cat >conftest.$ac_ext <<_ACEOF
16897 #line 16897 "configure"
16898 #include "confdefs.h"
16899
16900 #ifdef HAVE_XCURSES
16901 #include <xcurses.h>
16902 char * XCursesProgramName = "test";
16903 #else
16904 #include <${cf_cv_ncurses_header:-curses.h}>
16905 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16906 #include <ncursesw/term.h>
16907 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16908 #include <ncurses/term.h>
16909 #elif defined(HAVE_TERM_H)
16910 #include <term.h>
16911 #endif
16912 #endif
16913
16914 extern char boolfnames;
16915 int
16916 main ()
16917 {
16918
16919         do {
16920                 void *foo = &(boolfnames);
16921                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16922                 ${cf_cv_main_return:-return}(foo == 0);
16923         } while (0)
16924
16925   ;
16926   return 0;
16927 }
16928 _ACEOF
16929 rm -f conftest.$ac_objext conftest$ac_exeext
16930 if { (eval echo "$as_me:16930: \"$ac_link\"") >&5
16931   (eval $ac_link) 2>&5
16932   ac_status=$?
16933   echo "$as_me:16933: \$? = $ac_status" >&5
16934   (exit $ac_status); } &&
16935          { ac_try='test -s conftest$ac_exeext'
16936   { (eval echo "$as_me:16936: \"$ac_try\"") >&5
16937   (eval $ac_try) 2>&5
16938   ac_status=$?
16939   echo "$as_me:16939: \$? = $ac_status" >&5
16940   (exit $ac_status); }; }; then
16941   cf_result=yes
16942 else
16943   echo "$as_me: failed program was:" >&5
16944 cat conftest.$ac_ext >&5
16945 cf_result=no
16946 fi
16947 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16948
16949 else
16950   cat >conftest.$ac_ext <<_ACEOF
16951 #line 16951 "configure"
16952 #include "confdefs.h"
16953
16954 #ifdef HAVE_XCURSES
16955 #include <xcurses.h>
16956 char * XCursesProgramName = "test";
16957 #else
16958 #include <${cf_cv_ncurses_header:-curses.h}>
16959 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16960 #include <ncursesw/term.h>
16961 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16962 #include <ncurses/term.h>
16963 #elif defined(HAVE_TERM_H)
16964 #include <term.h>
16965 #endif
16966 #endif
16967
16968 extern char boolfnames;
16969 int main(void)
16970 {
16971         void *foo = &(boolfnames);
16972         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16973         ${cf_cv_main_return:-return}(foo == 0);
16974 }
16975 _ACEOF
16976 rm -f conftest$ac_exeext
16977 if { (eval echo "$as_me:16977: \"$ac_link\"") >&5
16978   (eval $ac_link) 2>&5
16979   ac_status=$?
16980   echo "$as_me:16980: \$? = $ac_status" >&5
16981   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16982   { (eval echo "$as_me:16982: \"$ac_try\"") >&5
16983   (eval $ac_try) 2>&5
16984   ac_status=$?
16985   echo "$as_me:16985: \$? = $ac_status" >&5
16986   (exit $ac_status); }; }; then
16987   cf_result=yes
16988 else
16989   echo "$as_me: program exited with status $ac_status" >&5
16990 echo "$as_me: failed program was:" >&5
16991 cat conftest.$ac_ext >&5
16992 cf_result=no
16993 fi
16994 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16995 fi
16996         echo "$as_me:16996: result: $cf_result" >&5
16997 echo "${ECHO_T}$cf_result" >&6
16998         if test $cf_result = yes ; then
16999
17000 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17001
17002                 cat >>confdefs.h <<EOF
17003 #define $cf_result 1
17004 EOF
17005
17006         fi
17007 fi
17008
17009 echo "$as_me:17009: checking for data ttytype declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17010 echo $ECHO_N "checking for data ttytype declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17011
17012 cat >conftest.$ac_ext <<_ACEOF
17013 #line 17013 "configure"
17014 #include "confdefs.h"
17015
17016 #ifdef HAVE_XCURSES
17017 #include <xcurses.h>
17018 char * XCursesProgramName = "test";
17019 #else
17020 #include <${cf_cv_ncurses_header:-curses.h}>
17021 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17022 #include <ncursesw/term.h>
17023 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17024 #include <ncurses/term.h>
17025 #elif defined(HAVE_TERM_H)
17026 #include <term.h>
17027 #endif
17028 #endif
17029
17030 int
17031 main ()
17032 {
17033
17034 void *foo = &(ttytype)
17035
17036   ;
17037   return 0;
17038 }
17039 _ACEOF
17040 rm -f conftest.$ac_objext
17041 if { (eval echo "$as_me:17041: \"$ac_compile\"") >&5
17042   (eval $ac_compile) 2>&5
17043   ac_status=$?
17044   echo "$as_me:17044: \$? = $ac_status" >&5
17045   (exit $ac_status); } &&
17046          { ac_try='test -s conftest.$ac_objext'
17047   { (eval echo "$as_me:17047: \"$ac_try\"") >&5
17048   (eval $ac_try) 2>&5
17049   ac_status=$?
17050   echo "$as_me:17050: \$? = $ac_status" >&5
17051   (exit $ac_status); }; }; then
17052   cf_result=yes
17053 else
17054   echo "$as_me: failed program was:" >&5
17055 cat conftest.$ac_ext >&5
17056 cf_result=no
17057 fi
17058 rm -f conftest.$ac_objext conftest.$ac_ext
17059 echo "$as_me:17059: result: $cf_result" >&5
17060 echo "${ECHO_T}$cf_result" >&6
17061
17062 if test $cf_result = yes ; then
17063
17064 cf_result=`echo "have_curses_data_ttytype" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17065
17066         cat >>confdefs.h <<EOF
17067 #define $cf_result 1
17068 EOF
17069
17070 else
17071         echo "$as_me:17071: checking for data ttytype in library" >&5
17072 echo $ECHO_N "checking for data ttytype in library... $ECHO_C" >&6
17073         # BSD linkers insist on making weak linkage, but resolve at runtime.
17074         if test "$cross_compiling" = yes; then
17075
17076         # cross-compiling
17077         cat >conftest.$ac_ext <<_ACEOF
17078 #line 17078 "configure"
17079 #include "confdefs.h"
17080
17081 #ifdef HAVE_XCURSES
17082 #include <xcurses.h>
17083 char * XCursesProgramName = "test";
17084 #else
17085 #include <${cf_cv_ncurses_header:-curses.h}>
17086 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17087 #include <ncursesw/term.h>
17088 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17089 #include <ncurses/term.h>
17090 #elif defined(HAVE_TERM_H)
17091 #include <term.h>
17092 #endif
17093 #endif
17094
17095 extern char ttytype;
17096 int
17097 main ()
17098 {
17099
17100         do {
17101                 void *foo = &(ttytype);
17102                 fprintf(stderr, "testing linkage of ttytype:%p\n", foo);
17103                 ${cf_cv_main_return:-return}(foo == 0);
17104         } while (0)
17105
17106   ;
17107   return 0;
17108 }
17109 _ACEOF
17110 rm -f conftest.$ac_objext conftest$ac_exeext
17111 if { (eval echo "$as_me:17111: \"$ac_link\"") >&5
17112   (eval $ac_link) 2>&5
17113   ac_status=$?
17114   echo "$as_me:17114: \$? = $ac_status" >&5
17115   (exit $ac_status); } &&
17116          { ac_try='test -s conftest$ac_exeext'
17117   { (eval echo "$as_me:17117: \"$ac_try\"") >&5
17118   (eval $ac_try) 2>&5
17119   ac_status=$?
17120   echo "$as_me:17120: \$? = $ac_status" >&5
17121   (exit $ac_status); }; }; then
17122   cf_result=yes
17123 else
17124   echo "$as_me: failed program was:" >&5
17125 cat conftest.$ac_ext >&5
17126 cf_result=no
17127 fi
17128 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17129
17130 else
17131   cat >conftest.$ac_ext <<_ACEOF
17132 #line 17132 "configure"
17133 #include "confdefs.h"
17134
17135 #ifdef HAVE_XCURSES
17136 #include <xcurses.h>
17137 char * XCursesProgramName = "test";
17138 #else
17139 #include <${cf_cv_ncurses_header:-curses.h}>
17140 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17141 #include <ncursesw/term.h>
17142 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17143 #include <ncurses/term.h>
17144 #elif defined(HAVE_TERM_H)
17145 #include <term.h>
17146 #endif
17147 #endif
17148
17149 extern char ttytype;
17150 int main(void)
17151 {
17152         void *foo = &(ttytype);
17153         fprintf(stderr, "testing linkage of ttytype:%p\n", foo);
17154         ${cf_cv_main_return:-return}(foo == 0);
17155 }
17156 _ACEOF
17157 rm -f conftest$ac_exeext
17158 if { (eval echo "$as_me:17158: \"$ac_link\"") >&5
17159   (eval $ac_link) 2>&5
17160   ac_status=$?
17161   echo "$as_me:17161: \$? = $ac_status" >&5
17162   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17163   { (eval echo "$as_me:17163: \"$ac_try\"") >&5
17164   (eval $ac_try) 2>&5
17165   ac_status=$?
17166   echo "$as_me:17166: \$? = $ac_status" >&5
17167   (exit $ac_status); }; }; then
17168   cf_result=yes
17169 else
17170   echo "$as_me: program exited with status $ac_status" >&5
17171 echo "$as_me: failed program was:" >&5
17172 cat conftest.$ac_ext >&5
17173 cf_result=no
17174 fi
17175 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17176 fi
17177         echo "$as_me:17177: result: $cf_result" >&5
17178 echo "${ECHO_T}$cf_result" >&6
17179         if test $cf_result = yes ; then
17180
17181 cf_result=`echo "decl_curses_data_ttytype" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17182
17183                 cat >>confdefs.h <<EOF
17184 #define $cf_result 1
17185 EOF
17186
17187         fi
17188 fi
17189
17190 if ( test "$GCC" = yes || test "$GXX" = yes )
17191 then
17192 echo "$as_me:17192: checking if you want to turn on gcc warnings" >&5
17193 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
17194
17195 # Check whether --enable-warnings or --disable-warnings was given.
17196 if test "${enable_warnings+set}" = set; then
17197   enableval="$enable_warnings"
17198   test "$enableval" != yes && enableval=no
17199         if test "$enableval" != "no" ; then
17200     with_warnings=yes
17201         else
17202                 with_warnings=no
17203         fi
17204 else
17205   enableval=no
17206         with_warnings=no
17207
17208 fi;
17209 echo "$as_me:17209: result: $with_warnings" >&5
17210 echo "${ECHO_T}$with_warnings" >&6
17211 if test "$with_warnings" = "yes"
17212 then
17213
17214 if test "$GCC" = yes
17215 then
17216 cat > conftest.i <<EOF
17217 #ifndef GCC_PRINTF
17218 #define GCC_PRINTF 0
17219 #endif
17220 #ifndef GCC_SCANF
17221 #define GCC_SCANF 0
17222 #endif
17223 #ifndef GCC_NORETURN
17224 #define GCC_NORETURN /* nothing */
17225 #endif
17226 #ifndef GCC_UNUSED
17227 #define GCC_UNUSED /* nothing */
17228 #endif
17229 EOF
17230 if test "$GCC" = yes
17231 then
17232         { echo "$as_me:17232: checking for $CC __attribute__ directives..." >&5
17233 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
17234 cat > conftest.$ac_ext <<EOF
17235 #line 17235 "${as_me:-configure}"
17236 #include "confdefs.h"
17237 #include "conftest.h"
17238 #include "conftest.i"
17239 #if     GCC_PRINTF
17240 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
17241 #else
17242 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
17243 #endif
17244 #if     GCC_SCANF
17245 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
17246 #else
17247 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
17248 #endif
17249 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
17250 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
17251 extern void foo(void) GCC_NORETURN;
17252 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
17253 EOF
17254         cf_printf_attribute=no
17255         cf_scanf_attribute=no
17256         for cf_attribute in scanf printf unused noreturn
17257         do
17258
17259 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17260
17261                 cf_directive="__attribute__(($cf_attribute))"
17262                 echo "checking for $CC $cf_directive" 1>&5
17263
17264                 case $cf_attribute in
17265                 (printf)
17266                         cf_printf_attribute=yes
17267                         cat >conftest.h <<EOF
17268 #define GCC_$cf_ATTRIBUTE 1
17269 EOF
17270                         ;;
17271                 (scanf)
17272                         cf_scanf_attribute=yes
17273                         cat >conftest.h <<EOF
17274 #define GCC_$cf_ATTRIBUTE 1
17275 EOF
17276                         ;;
17277                 (*)
17278                         cat >conftest.h <<EOF
17279 #define GCC_$cf_ATTRIBUTE $cf_directive
17280 EOF
17281                         ;;
17282                 esac
17283
17284                 if { (eval echo "$as_me:17284: \"$ac_compile\"") >&5
17285   (eval $ac_compile) 2>&5
17286   ac_status=$?
17287   echo "$as_me:17287: \$? = $ac_status" >&5
17288   (exit $ac_status); }; then
17289                         test -n "$verbose" && echo "$as_me:17289: result: ... $cf_attribute" >&5
17290 echo "${ECHO_T}... $cf_attribute" >&6
17291                         cat conftest.h >>confdefs.h
17292                         case $cf_attribute in
17293                         (noreturn)
17294
17295 cat >>confdefs.h <<EOF
17296 #define GCC_NORETURN $cf_directive
17297 EOF
17298
17299                                 ;;
17300                         (printf)
17301                                 cf_value='/* nothing */'
17302                                 if test "$cf_printf_attribute" != no ; then
17303                                         cf_value='__attribute__((format(printf,fmt,var)))'
17304
17305 cat >>confdefs.h <<\EOF
17306 #define GCC_PRINTF 1
17307 EOF
17308
17309                                 fi
17310
17311 cat >>confdefs.h <<EOF
17312 #define GCC_PRINTFLIKE(fmt,var) $cf_value
17313 EOF
17314
17315                                 ;;
17316                         (scanf)
17317                                 cf_value='/* nothing */'
17318                                 if test "$cf_scanf_attribute" != no ; then
17319                                         cf_value='__attribute__((format(scanf,fmt,var)))'
17320
17321 cat >>confdefs.h <<\EOF
17322 #define GCC_SCANF 1
17323 EOF
17324
17325                                 fi
17326
17327 cat >>confdefs.h <<EOF
17328 #define GCC_SCANFLIKE(fmt,var) $cf_value
17329 EOF
17330
17331                                 ;;
17332                         (unused)
17333
17334 cat >>confdefs.h <<EOF
17335 #define GCC_UNUSED $cf_directive
17336 EOF
17337
17338                                 ;;
17339                         esac
17340                 fi
17341         done
17342 else
17343         fgrep define conftest.i >>confdefs.h
17344 fi
17345 rm -rf conftest*
17346 fi
17347
17348 INTEL_COMPILER=no
17349
17350 if test "$GCC" = yes ; then
17351         case $host_os in
17352         (linux*|gnu*)
17353                 echo "$as_me:17353: checking if this is really Intel C compiler" >&5
17354 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
17355                 cf_save_CFLAGS="$CFLAGS"
17356                 CFLAGS="$CFLAGS -no-gcc"
17357                 cat >conftest.$ac_ext <<_ACEOF
17358 #line 17358 "configure"
17359 #include "confdefs.h"
17360
17361 int
17362 main ()
17363 {
17364
17365 #ifdef __INTEL_COMPILER
17366 #else
17367 make an error
17368 #endif
17369
17370   ;
17371   return 0;
17372 }
17373 _ACEOF
17374 rm -f conftest.$ac_objext
17375 if { (eval echo "$as_me:17375: \"$ac_compile\"") >&5
17376   (eval $ac_compile) 2>&5
17377   ac_status=$?
17378   echo "$as_me:17378: \$? = $ac_status" >&5
17379   (exit $ac_status); } &&
17380          { ac_try='test -s conftest.$ac_objext'
17381   { (eval echo "$as_me:17381: \"$ac_try\"") >&5
17382   (eval $ac_try) 2>&5
17383   ac_status=$?
17384   echo "$as_me:17384: \$? = $ac_status" >&5
17385   (exit $ac_status); }; }; then
17386   INTEL_COMPILER=yes
17387 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
17388
17389 else
17390   echo "$as_me: failed program was:" >&5
17391 cat conftest.$ac_ext >&5
17392 fi
17393 rm -f conftest.$ac_objext conftest.$ac_ext
17394                 CFLAGS="$cf_save_CFLAGS"
17395                 echo "$as_me:17395: result: $INTEL_COMPILER" >&5
17396 echo "${ECHO_T}$INTEL_COMPILER" >&6
17397                 ;;
17398         esac
17399 fi
17400
17401 CLANG_COMPILER=no
17402
17403 if test "$GCC" = yes ; then
17404         echo "$as_me:17404: checking if this is really Clang C compiler" >&5
17405 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
17406         cf_save_CFLAGS="$CFLAGS"
17407         CFLAGS="$CFLAGS -Qunused-arguments"
17408         cat >conftest.$ac_ext <<_ACEOF
17409 #line 17409 "configure"
17410 #include "confdefs.h"
17411
17412 int
17413 main ()
17414 {
17415
17416 #ifdef __clang__
17417 #else
17418 make an error
17419 #endif
17420
17421   ;
17422   return 0;
17423 }
17424 _ACEOF
17425 rm -f conftest.$ac_objext
17426 if { (eval echo "$as_me:17426: \"$ac_compile\"") >&5
17427   (eval $ac_compile) 2>&5
17428   ac_status=$?
17429   echo "$as_me:17429: \$? = $ac_status" >&5
17430   (exit $ac_status); } &&
17431          { ac_try='test -s conftest.$ac_objext'
17432   { (eval echo "$as_me:17432: \"$ac_try\"") >&5
17433   (eval $ac_try) 2>&5
17434   ac_status=$?
17435   echo "$as_me:17435: \$? = $ac_status" >&5
17436   (exit $ac_status); }; }; then
17437   CLANG_COMPILER=yes
17438 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
17439
17440 else
17441   echo "$as_me: failed program was:" >&5
17442 cat conftest.$ac_ext >&5
17443 fi
17444 rm -f conftest.$ac_objext conftest.$ac_ext
17445         CFLAGS="$cf_save_CFLAGS"
17446         echo "$as_me:17446: result: $CLANG_COMPILER" >&5
17447 echo "${ECHO_T}$CLANG_COMPILER" >&6
17448 fi
17449
17450 cat > conftest.$ac_ext <<EOF
17451 #line 17451 "${as_me:-configure}"
17452 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
17453 EOF
17454
17455 if test "$INTEL_COMPILER" = yes
17456 then
17457 # The "-wdXXX" options suppress warnings:
17458 # remark #1419: external declaration in primary source file
17459 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
17460 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
17461 # remark #193: zero used for undefined preprocessing identifier
17462 # remark #593: variable "curs_sb_left_arrow" was set but never used
17463 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
17464 # remark #869: parameter "tw" was never referenced
17465 # remark #981: operands are evaluated in unspecified order
17466 # warning #279: controlling expression is constant
17467
17468         { echo "$as_me:17468: checking for $CC warning options..." >&5
17469 echo "$as_me: checking for $CC warning options..." >&6;}
17470         cf_save_CFLAGS="$CFLAGS"
17471         EXTRA_CFLAGS="-Wall"
17472         for cf_opt in \
17473                 wd1419 \
17474                 wd1683 \
17475                 wd1684 \
17476                 wd193 \
17477                 wd593 \
17478                 wd279 \
17479                 wd810 \
17480                 wd869 \
17481                 wd981
17482         do
17483                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17484                 if { (eval echo "$as_me:17484: \"$ac_compile\"") >&5
17485   (eval $ac_compile) 2>&5
17486   ac_status=$?
17487   echo "$as_me:17487: \$? = $ac_status" >&5
17488   (exit $ac_status); }; then
17489                         test -n "$verbose" && echo "$as_me:17489: result: ... -$cf_opt" >&5
17490 echo "${ECHO_T}... -$cf_opt" >&6
17491                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17492                 fi
17493         done
17494         CFLAGS="$cf_save_CFLAGS"
17495
17496 elif test "$GCC" = yes
17497 then
17498         { echo "$as_me:17498: checking for $CC warning options..." >&5
17499 echo "$as_me: checking for $CC warning options..." >&6;}
17500         cf_save_CFLAGS="$CFLAGS"
17501         EXTRA_CFLAGS=
17502         cf_warn_CONST=""
17503         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
17504         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
17505         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
17506         for cf_opt in W Wall \
17507                 Wbad-function-cast \
17508                 Wcast-align \
17509                 Wcast-qual \
17510                 Wdeclaration-after-statement \
17511                 Wextra \
17512                 Winline \
17513                 Wmissing-declarations \
17514                 Wmissing-prototypes \
17515                 Wnested-externs \
17516                 Wpointer-arith \
17517                 Wshadow \
17518                 Wstrict-prototypes \
17519                 Wundef $cf_gcc_warnings $cf_warn_CONST
17520         do
17521                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17522                 if { (eval echo "$as_me:17522: \"$ac_compile\"") >&5
17523   (eval $ac_compile) 2>&5
17524   ac_status=$?
17525   echo "$as_me:17525: \$? = $ac_status" >&5
17526   (exit $ac_status); }; then
17527                         test -n "$verbose" && echo "$as_me:17527: result: ... -$cf_opt" >&5
17528 echo "${ECHO_T}... -$cf_opt" >&6
17529                         case $cf_opt in
17530                         (Wcast-qual)
17531                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
17532                                 ;;
17533                         (Winline)
17534                                 case $GCC_VERSION in
17535                                 ([34].*)
17536                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17537
17538 echo "${as_me:-configure}:17538: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17539
17540                                         continue;;
17541                                 esac
17542                                 ;;
17543                         (Wpointer-arith)
17544                                 case $GCC_VERSION in
17545                                 ([12].*)
17546                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17547
17548 echo "${as_me:-configure}:17548: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17549
17550                                         continue;;
17551                                 esac
17552                                 ;;
17553                         esac
17554                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17555                 fi
17556         done
17557         CFLAGS="$cf_save_CFLAGS"
17558 fi
17559 rm -rf conftest*
17560
17561 fi
17562 fi
17563
17564 echo "$as_me:17564: checking if you want to use dmalloc for testing" >&5
17565 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
17566
17567 # Check whether --with-dmalloc or --without-dmalloc was given.
17568 if test "${with_dmalloc+set}" = set; then
17569   withval="$with_dmalloc"
17570
17571 cat >>confdefs.h <<EOF
17572 #define USE_DMALLOC 1
17573 EOF
17574
17575         : ${with_cflags:=-g}
17576         : ${with_no_leaks:=yes}
17577          with_dmalloc=yes
17578 else
17579   with_dmalloc=
17580 fi;
17581 echo "$as_me:17581: result: ${with_dmalloc:-no}" >&5
17582 echo "${ECHO_T}${with_dmalloc:-no}" >&6
17583
17584 case .$with_cflags in
17585 (.*-g*)
17586         case .$CFLAGS in
17587         (.*-g*)
17588                 ;;
17589         (*)
17590
17591 cf_fix_cppflags=no
17592 cf_new_cflags=
17593 cf_new_cppflags=
17594 cf_new_extra_cppflags=
17595
17596 for cf_add_cflags in -g
17597 do
17598 case $cf_fix_cppflags in
17599 (no)
17600         case $cf_add_cflags in
17601         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17602                 case $cf_add_cflags in
17603                 (-D*)
17604                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17605
17606                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17607                                 && test -z "${cf_tst_cflags}" \
17608                                 && cf_fix_cppflags=yes
17609
17610                         if test $cf_fix_cppflags = yes ; then
17611                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17612                                 continue
17613                         elif test "${cf_tst_cflags}" = "\"'" ; then
17614                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17615                                 continue
17616                         fi
17617                         ;;
17618                 esac
17619                 case "$CPPFLAGS" in
17620                 (*$cf_add_cflags)
17621                         ;;
17622                 (*)
17623                         case $cf_add_cflags in
17624                         (-D*)
17625                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17626
17627 CPPFLAGS=`echo "$CPPFLAGS" | \
17628         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17629                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17630
17631                                 ;;
17632                         esac
17633                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17634                         ;;
17635                 esac
17636                 ;;
17637         (*)
17638                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17639                 ;;
17640         esac
17641         ;;
17642 (yes)
17643         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17644
17645         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17646
17647         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17648                 && test -z "${cf_tst_cflags}" \
17649                 && cf_fix_cppflags=no
17650         ;;
17651 esac
17652 done
17653
17654 if test -n "$cf_new_cflags" ; then
17655
17656         CFLAGS="$CFLAGS $cf_new_cflags"
17657 fi
17658
17659 if test -n "$cf_new_cppflags" ; then
17660
17661         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17662 fi
17663
17664 if test -n "$cf_new_extra_cppflags" ; then
17665
17666         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17667 fi
17668
17669                 ;;
17670         esac
17671         ;;
17672 esac
17673
17674 if test "$with_dmalloc" = yes ; then
17675         echo "$as_me:17675: checking for dmalloc.h" >&5
17676 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
17677 if test "${ac_cv_header_dmalloc_h+set}" = set; then
17678   echo $ECHO_N "(cached) $ECHO_C" >&6
17679 else
17680   cat >conftest.$ac_ext <<_ACEOF
17681 #line 17681 "configure"
17682 #include "confdefs.h"
17683 #include <dmalloc.h>
17684 _ACEOF
17685 if { (eval echo "$as_me:17685: \"$ac_cpp conftest.$ac_ext\"") >&5
17686   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17687   ac_status=$?
17688   egrep -v '^ *\+' conftest.er1 >conftest.err
17689   rm -f conftest.er1
17690   cat conftest.err >&5
17691   echo "$as_me:17691: \$? = $ac_status" >&5
17692   (exit $ac_status); } >/dev/null; then
17693   if test -s conftest.err; then
17694     ac_cpp_err=$ac_c_preproc_warn_flag
17695   else
17696     ac_cpp_err=
17697   fi
17698 else
17699   ac_cpp_err=yes
17700 fi
17701 if test -z "$ac_cpp_err"; then
17702   ac_cv_header_dmalloc_h=yes
17703 else
17704   echo "$as_me: failed program was:" >&5
17705   cat conftest.$ac_ext >&5
17706   ac_cv_header_dmalloc_h=no
17707 fi
17708 rm -f conftest.err conftest.$ac_ext
17709 fi
17710 echo "$as_me:17710: result: $ac_cv_header_dmalloc_h" >&5
17711 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
17712 if test $ac_cv_header_dmalloc_h = yes; then
17713
17714 echo "$as_me:17714: checking for dmalloc_debug in -ldmalloc" >&5
17715 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
17716 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
17717   echo $ECHO_N "(cached) $ECHO_C" >&6
17718 else
17719   ac_check_lib_save_LIBS=$LIBS
17720 LIBS="-ldmalloc  $LIBS"
17721 cat >conftest.$ac_ext <<_ACEOF
17722 #line 17722 "configure"
17723 #include "confdefs.h"
17724
17725 /* Override any gcc2 internal prototype to avoid an error.  */
17726 #ifdef __cplusplus
17727 extern "C"
17728 #endif
17729 /* We use char because int might match the return type of a gcc2
17730    builtin and then its argument prototype would still apply.  */
17731 char dmalloc_debug ();
17732 int
17733 main ()
17734 {
17735 dmalloc_debug ();
17736   ;
17737   return 0;
17738 }
17739 _ACEOF
17740 rm -f conftest.$ac_objext conftest$ac_exeext
17741 if { (eval echo "$as_me:17741: \"$ac_link\"") >&5
17742   (eval $ac_link) 2>&5
17743   ac_status=$?
17744   echo "$as_me:17744: \$? = $ac_status" >&5
17745   (exit $ac_status); } &&
17746          { ac_try='test -s conftest$ac_exeext'
17747   { (eval echo "$as_me:17747: \"$ac_try\"") >&5
17748   (eval $ac_try) 2>&5
17749   ac_status=$?
17750   echo "$as_me:17750: \$? = $ac_status" >&5
17751   (exit $ac_status); }; }; then
17752   ac_cv_lib_dmalloc_dmalloc_debug=yes
17753 else
17754   echo "$as_me: failed program was:" >&5
17755 cat conftest.$ac_ext >&5
17756 ac_cv_lib_dmalloc_dmalloc_debug=no
17757 fi
17758 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17759 LIBS=$ac_check_lib_save_LIBS
17760 fi
17761 echo "$as_me:17761: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
17762 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
17763 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
17764   cat >>confdefs.h <<EOF
17765 #define HAVE_LIBDMALLOC 1
17766 EOF
17767
17768   LIBS="-ldmalloc $LIBS"
17769
17770 fi
17771
17772 fi
17773
17774 fi
17775
17776 echo "$as_me:17776: checking if you want to use dbmalloc for testing" >&5
17777 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
17778
17779 # Check whether --with-dbmalloc or --without-dbmalloc was given.
17780 if test "${with_dbmalloc+set}" = set; then
17781   withval="$with_dbmalloc"
17782
17783 cat >>confdefs.h <<EOF
17784 #define USE_DBMALLOC 1
17785 EOF
17786
17787         : ${with_cflags:=-g}
17788         : ${with_no_leaks:=yes}
17789          with_dbmalloc=yes
17790 else
17791   with_dbmalloc=
17792 fi;
17793 echo "$as_me:17793: result: ${with_dbmalloc:-no}" >&5
17794 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
17795
17796 case .$with_cflags in
17797 (.*-g*)
17798         case .$CFLAGS in
17799         (.*-g*)
17800                 ;;
17801         (*)
17802
17803 cf_fix_cppflags=no
17804 cf_new_cflags=
17805 cf_new_cppflags=
17806 cf_new_extra_cppflags=
17807
17808 for cf_add_cflags in -g
17809 do
17810 case $cf_fix_cppflags in
17811 (no)
17812         case $cf_add_cflags in
17813         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17814                 case $cf_add_cflags in
17815                 (-D*)
17816                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17817
17818                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17819                                 && test -z "${cf_tst_cflags}" \
17820                                 && cf_fix_cppflags=yes
17821
17822                         if test $cf_fix_cppflags = yes ; then
17823                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17824                                 continue
17825                         elif test "${cf_tst_cflags}" = "\"'" ; then
17826                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17827                                 continue
17828                         fi
17829                         ;;
17830                 esac
17831                 case "$CPPFLAGS" in
17832                 (*$cf_add_cflags)
17833                         ;;
17834                 (*)
17835                         case $cf_add_cflags in
17836                         (-D*)
17837                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17838
17839 CPPFLAGS=`echo "$CPPFLAGS" | \
17840         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17841                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17842
17843                                 ;;
17844                         esac
17845                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17846                         ;;
17847                 esac
17848                 ;;
17849         (*)
17850                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17851                 ;;
17852         esac
17853         ;;
17854 (yes)
17855         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17856
17857         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17858
17859         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17860                 && test -z "${cf_tst_cflags}" \
17861                 && cf_fix_cppflags=no
17862         ;;
17863 esac
17864 done
17865
17866 if test -n "$cf_new_cflags" ; then
17867
17868         CFLAGS="$CFLAGS $cf_new_cflags"
17869 fi
17870
17871 if test -n "$cf_new_cppflags" ; then
17872
17873         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17874 fi
17875
17876 if test -n "$cf_new_extra_cppflags" ; then
17877
17878         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17879 fi
17880
17881                 ;;
17882         esac
17883         ;;
17884 esac
17885
17886 if test "$with_dbmalloc" = yes ; then
17887         echo "$as_me:17887: checking for dbmalloc.h" >&5
17888 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
17889 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
17890   echo $ECHO_N "(cached) $ECHO_C" >&6
17891 else
17892   cat >conftest.$ac_ext <<_ACEOF
17893 #line 17893 "configure"
17894 #include "confdefs.h"
17895 #include <dbmalloc.h>
17896 _ACEOF
17897 if { (eval echo "$as_me:17897: \"$ac_cpp conftest.$ac_ext\"") >&5
17898   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17899   ac_status=$?
17900   egrep -v '^ *\+' conftest.er1 >conftest.err
17901   rm -f conftest.er1
17902   cat conftest.err >&5
17903   echo "$as_me:17903: \$? = $ac_status" >&5
17904   (exit $ac_status); } >/dev/null; then
17905   if test -s conftest.err; then
17906     ac_cpp_err=$ac_c_preproc_warn_flag
17907   else
17908     ac_cpp_err=
17909   fi
17910 else
17911   ac_cpp_err=yes
17912 fi
17913 if test -z "$ac_cpp_err"; then
17914   ac_cv_header_dbmalloc_h=yes
17915 else
17916   echo "$as_me: failed program was:" >&5
17917   cat conftest.$ac_ext >&5
17918   ac_cv_header_dbmalloc_h=no
17919 fi
17920 rm -f conftest.err conftest.$ac_ext
17921 fi
17922 echo "$as_me:17922: result: $ac_cv_header_dbmalloc_h" >&5
17923 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
17924 if test $ac_cv_header_dbmalloc_h = yes; then
17925
17926 echo "$as_me:17926: checking for debug_malloc in -ldbmalloc" >&5
17927 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
17928 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
17929   echo $ECHO_N "(cached) $ECHO_C" >&6
17930 else
17931   ac_check_lib_save_LIBS=$LIBS
17932 LIBS="-ldbmalloc  $LIBS"
17933 cat >conftest.$ac_ext <<_ACEOF
17934 #line 17934 "configure"
17935 #include "confdefs.h"
17936
17937 /* Override any gcc2 internal prototype to avoid an error.  */
17938 #ifdef __cplusplus
17939 extern "C"
17940 #endif
17941 /* We use char because int might match the return type of a gcc2
17942    builtin and then its argument prototype would still apply.  */
17943 char debug_malloc ();
17944 int
17945 main ()
17946 {
17947 debug_malloc ();
17948   ;
17949   return 0;
17950 }
17951 _ACEOF
17952 rm -f conftest.$ac_objext conftest$ac_exeext
17953 if { (eval echo "$as_me:17953: \"$ac_link\"") >&5
17954   (eval $ac_link) 2>&5
17955   ac_status=$?
17956   echo "$as_me:17956: \$? = $ac_status" >&5
17957   (exit $ac_status); } &&
17958          { ac_try='test -s conftest$ac_exeext'
17959   { (eval echo "$as_me:17959: \"$ac_try\"") >&5
17960   (eval $ac_try) 2>&5
17961   ac_status=$?
17962   echo "$as_me:17962: \$? = $ac_status" >&5
17963   (exit $ac_status); }; }; then
17964   ac_cv_lib_dbmalloc_debug_malloc=yes
17965 else
17966   echo "$as_me: failed program was:" >&5
17967 cat conftest.$ac_ext >&5
17968 ac_cv_lib_dbmalloc_debug_malloc=no
17969 fi
17970 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17971 LIBS=$ac_check_lib_save_LIBS
17972 fi
17973 echo "$as_me:17973: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
17974 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
17975 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
17976   cat >>confdefs.h <<EOF
17977 #define HAVE_LIBDBMALLOC 1
17978 EOF
17979
17980   LIBS="-ldbmalloc $LIBS"
17981
17982 fi
17983
17984 fi
17985
17986 fi
17987
17988 echo "$as_me:17988: checking if you want to use valgrind for testing" >&5
17989 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
17990
17991 # Check whether --with-valgrind or --without-valgrind was given.
17992 if test "${with_valgrind+set}" = set; then
17993   withval="$with_valgrind"
17994
17995 cat >>confdefs.h <<EOF
17996 #define USE_VALGRIND 1
17997 EOF
17998
17999         : ${with_cflags:=-g}
18000         : ${with_no_leaks:=yes}
18001          with_valgrind=yes
18002 else
18003   with_valgrind=
18004 fi;
18005 echo "$as_me:18005: result: ${with_valgrind:-no}" >&5
18006 echo "${ECHO_T}${with_valgrind:-no}" >&6
18007
18008 case .$with_cflags in
18009 (.*-g*)
18010         case .$CFLAGS in
18011         (.*-g*)
18012                 ;;
18013         (*)
18014
18015 cf_fix_cppflags=no
18016 cf_new_cflags=
18017 cf_new_cppflags=
18018 cf_new_extra_cppflags=
18019
18020 for cf_add_cflags in -g
18021 do
18022 case $cf_fix_cppflags in
18023 (no)
18024         case $cf_add_cflags in
18025         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18026                 case $cf_add_cflags in
18027                 (-D*)
18028                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18029
18030                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18031                                 && test -z "${cf_tst_cflags}" \
18032                                 && cf_fix_cppflags=yes
18033
18034                         if test $cf_fix_cppflags = yes ; then
18035                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
18036                                 continue
18037                         elif test "${cf_tst_cflags}" = "\"'" ; then
18038                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
18039                                 continue
18040                         fi
18041                         ;;
18042                 esac
18043                 case "$CPPFLAGS" in
18044                 (*$cf_add_cflags)
18045                         ;;
18046                 (*)
18047                         case $cf_add_cflags in
18048                         (-D*)
18049                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18050
18051 CPPFLAGS=`echo "$CPPFLAGS" | \
18052         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18053                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18054
18055                                 ;;
18056                         esac
18057                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
18058                         ;;
18059                 esac
18060                 ;;
18061         (*)
18062                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
18063                 ;;
18064         esac
18065         ;;
18066 (yes)
18067         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
18068
18069         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18070
18071         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18072                 && test -z "${cf_tst_cflags}" \
18073                 && cf_fix_cppflags=no
18074         ;;
18075 esac
18076 done
18077
18078 if test -n "$cf_new_cflags" ; then
18079
18080         CFLAGS="$CFLAGS $cf_new_cflags"
18081 fi
18082
18083 if test -n "$cf_new_cppflags" ; then
18084
18085         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
18086 fi
18087
18088 if test -n "$cf_new_extra_cppflags" ; then
18089
18090         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
18091 fi
18092
18093                 ;;
18094         esac
18095         ;;
18096 esac
18097
18098 echo "$as_me:18098: checking if you want to perform memory-leak testing" >&5
18099 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
18100
18101 # Check whether --enable-leaks or --disable-leaks was given.
18102 if test "${enable_leaks+set}" = set; then
18103   enableval="$enable_leaks"
18104   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
18105 else
18106   : ${with_no_leaks:=no}
18107 fi;
18108 echo "$as_me:18108: result: $with_no_leaks" >&5
18109 echo "${ECHO_T}$with_no_leaks" >&6
18110
18111 if test "$with_no_leaks" = yes ; then
18112
18113 cat >>confdefs.h <<\EOF
18114 #define NO_LEAKS 1
18115 EOF
18116
18117 cat >>confdefs.h <<\EOF
18118 #define YY_NO_LEAKS 1
18119 EOF
18120
18121 fi
18122
18123 LD_RPATH_OPT=
18124 echo "$as_me:18124: checking for an rpath option" >&5
18125 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
18126 case $cf_cv_system_name in
18127 (irix*)
18128         if test "$GCC" = yes; then
18129                 LD_RPATH_OPT="-Wl,-rpath,"
18130         else
18131                 LD_RPATH_OPT="-rpath "
18132         fi
18133         ;;
18134 (linux*|gnu*|k*bsd*-gnu|freebsd*)
18135         LD_RPATH_OPT="-Wl,-rpath,"
18136         ;;
18137 (openbsd[2-9].*|mirbsd*)
18138         LD_RPATH_OPT="-Wl,-rpath,"
18139         ;;
18140 (dragonfly*)
18141         LD_RPATH_OPT="-rpath "
18142         ;;
18143 (netbsd*)
18144         LD_RPATH_OPT="-Wl,-rpath,"
18145         ;;
18146 (osf*|mls+*)
18147         LD_RPATH_OPT="-rpath "
18148         ;;
18149 (solaris2*)
18150         LD_RPATH_OPT="-R"
18151         ;;
18152 (*)
18153         ;;
18154 esac
18155 echo "$as_me:18155: result: $LD_RPATH_OPT" >&5
18156 echo "${ECHO_T}$LD_RPATH_OPT" >&6
18157
18158 case "x$LD_RPATH_OPT" in
18159 (x-R*)
18160         echo "$as_me:18160: checking if we need a space after rpath option" >&5
18161 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
18162         cf_save_LIBS="$LIBS"
18163
18164 cf_add_libs="${LD_RPATH_OPT}$libdir"
18165 # Filter out duplicates - this happens with badly-designed ".pc" files...
18166 for cf_add_1lib in $LIBS
18167 do
18168         for cf_add_2lib in $cf_add_libs
18169         do
18170                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18171                 then
18172                         cf_add_1lib=
18173                         break
18174                 fi
18175         done
18176         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18177 done
18178 LIBS="$cf_add_libs"
18179
18180         cat >conftest.$ac_ext <<_ACEOF
18181 #line 18181 "configure"
18182 #include "confdefs.h"
18183
18184 int
18185 main ()
18186 {
18187
18188   ;
18189   return 0;
18190 }
18191 _ACEOF
18192 rm -f conftest.$ac_objext conftest$ac_exeext
18193 if { (eval echo "$as_me:18193: \"$ac_link\"") >&5
18194   (eval $ac_link) 2>&5
18195   ac_status=$?
18196   echo "$as_me:18196: \$? = $ac_status" >&5
18197   (exit $ac_status); } &&
18198          { ac_try='test -s conftest$ac_exeext'
18199   { (eval echo "$as_me:18199: \"$ac_try\"") >&5
18200   (eval $ac_try) 2>&5
18201   ac_status=$?
18202   echo "$as_me:18202: \$? = $ac_status" >&5
18203   (exit $ac_status); }; }; then
18204   cf_rpath_space=no
18205 else
18206   echo "$as_me: failed program was:" >&5
18207 cat conftest.$ac_ext >&5
18208 cf_rpath_space=yes
18209 fi
18210 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18211         LIBS="$cf_save_LIBS"
18212         echo "$as_me:18212: result: $cf_rpath_space" >&5
18213 echo "${ECHO_T}$cf_rpath_space" >&6
18214         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
18215         ;;
18216 esac
18217
18218 echo "$as_me:18218: checking if rpath-hack should be disabled" >&5
18219 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
18220
18221 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
18222 if test "${enable_rpath_hack+set}" = set; then
18223   enableval="$enable_rpath_hack"
18224   test "$enableval" != no && enableval=yes
18225         if test "$enableval" != "yes" ; then
18226     cf_disable_rpath_hack=yes
18227         else
18228                 cf_disable_rpath_hack=no
18229         fi
18230 else
18231   enableval=yes
18232         cf_disable_rpath_hack=no
18233
18234 fi;
18235 echo "$as_me:18235: result: $cf_disable_rpath_hack" >&5
18236 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
18237 if test "$cf_disable_rpath_hack" = no ; then
18238
18239 echo "$as_me:18239: checking for updated LDFLAGS" >&5
18240 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
18241 if test -n "$LD_RPATH_OPT" ; then
18242         echo "$as_me:18242: result: maybe" >&5
18243 echo "${ECHO_T}maybe" >&6
18244
18245         for ac_prog in ldd
18246 do
18247   # Extract the first word of "$ac_prog", so it can be a program name with args.
18248 set dummy $ac_prog; ac_word=$2
18249 echo "$as_me:18249: checking for $ac_word" >&5
18250 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
18251 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
18252   echo $ECHO_N "(cached) $ECHO_C" >&6
18253 else
18254   if test -n "$cf_ldd_prog"; then
18255   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
18256 else
18257   ac_save_IFS=$IFS; IFS=$ac_path_separator
18258 ac_dummy="$PATH"
18259 for ac_dir in $ac_dummy; do
18260   IFS=$ac_save_IFS
18261   test -z "$ac_dir" && ac_dir=.
18262   $as_executable_p "$ac_dir/$ac_word" || continue
18263 ac_cv_prog_cf_ldd_prog="$ac_prog"
18264 echo "$as_me:18264: found $ac_dir/$ac_word" >&5
18265 break
18266 done
18267
18268 fi
18269 fi
18270 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
18271 if test -n "$cf_ldd_prog"; then
18272   echo "$as_me:18272: result: $cf_ldd_prog" >&5
18273 echo "${ECHO_T}$cf_ldd_prog" >&6
18274 else
18275   echo "$as_me:18275: result: no" >&5
18276 echo "${ECHO_T}no" >&6
18277 fi
18278
18279   test -n "$cf_ldd_prog" && break
18280 done
18281 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
18282
18283         cf_rpath_list="/usr/lib /lib"
18284         if test "$cf_ldd_prog" != no
18285         then
18286                 cf_rpath_oops=
18287
18288 cat >conftest.$ac_ext <<_ACEOF
18289 #line 18289 "configure"
18290 #include "confdefs.h"
18291 #include <stdio.h>
18292 int
18293 main ()
18294 {
18295 printf("Hello");
18296   ;
18297   return 0;
18298 }
18299 _ACEOF
18300 rm -f conftest.$ac_objext conftest$ac_exeext
18301 if { (eval echo "$as_me:18301: \"$ac_link\"") >&5
18302   (eval $ac_link) 2>&5
18303   ac_status=$?
18304   echo "$as_me:18304: \$? = $ac_status" >&5
18305   (exit $ac_status); } &&
18306          { ac_try='test -s conftest$ac_exeext'
18307   { (eval echo "$as_me:18307: \"$ac_try\"") >&5
18308   (eval $ac_try) 2>&5
18309   ac_status=$?
18310   echo "$as_me:18310: \$? = $ac_status" >&5
18311   (exit $ac_status); }; }; then
18312   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
18313                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
18314 else
18315   echo "$as_me: failed program was:" >&5
18316 cat conftest.$ac_ext >&5
18317 fi
18318 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18319
18320                 # If we passed the link-test, but get a "not found" on a given library,
18321                 # this could be due to inept reconfiguration of gcc to make it only
18322                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
18323                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
18324                 # /usr/local libraries.
18325                 if test -n "$cf_rpath_oops"
18326                 then
18327                         for cf_rpath_src in $cf_rpath_oops
18328                         do
18329                                 for cf_rpath_dir in \
18330                                         /usr/local \
18331                                         /usr/pkg \
18332                                         /opt/sfw
18333                                 do
18334                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
18335                                         then
18336                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
18337
18338 echo "${as_me:-configure}:18338: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
18339
18340                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
18341                                                 break
18342                                         fi
18343                                 done
18344                         done
18345                 fi
18346         fi
18347
18348         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18349
18350 echo "${as_me:-configure}:18350: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18351
18352 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
18353
18354 echo "${as_me:-configure}:18354: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
18355
18356 cf_rpath_dst=
18357 for cf_rpath_src in $LDFLAGS
18358 do
18359         case $cf_rpath_src in
18360         (-L*)
18361
18362                 # check if this refers to a directory which we will ignore
18363                 cf_rpath_skip=no
18364                 if test -n "$cf_rpath_list"
18365                 then
18366                         for cf_rpath_item in $cf_rpath_list
18367                         do
18368                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18369                                 then
18370                                         cf_rpath_skip=yes
18371                                         break
18372                                 fi
18373                         done
18374                 fi
18375
18376                 if test "$cf_rpath_skip" = no
18377                 then
18378                         # transform the option
18379                         if test "$LD_RPATH_OPT" = "-R " ; then
18380                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18381                         else
18382                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18383                         fi
18384
18385                         # if we have not already added this, add it now
18386                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18387                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18388                         then
18389                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18390
18391 echo "${as_me:-configure}:18391: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18392
18393                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18394                         fi
18395                 fi
18396                 ;;
18397         esac
18398         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18399 done
18400 LDFLAGS=$cf_rpath_dst
18401
18402 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
18403
18404 echo "${as_me:-configure}:18404: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
18405
18406 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
18407
18408 echo "${as_me:-configure}:18408: testing ...checking LIBS $LIBS ..." 1>&5
18409
18410 cf_rpath_dst=
18411 for cf_rpath_src in $LIBS
18412 do
18413         case $cf_rpath_src in
18414         (-L*)
18415
18416                 # check if this refers to a directory which we will ignore
18417                 cf_rpath_skip=no
18418                 if test -n "$cf_rpath_list"
18419                 then
18420                         for cf_rpath_item in $cf_rpath_list
18421                         do
18422                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18423                                 then
18424                                         cf_rpath_skip=yes
18425                                         break
18426                                 fi
18427                         done
18428                 fi
18429
18430                 if test "$cf_rpath_skip" = no
18431                 then
18432                         # transform the option
18433                         if test "$LD_RPATH_OPT" = "-R " ; then
18434                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18435                         else
18436                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18437                         fi
18438
18439                         # if we have not already added this, add it now
18440                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18441                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18442                         then
18443                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18444
18445 echo "${as_me:-configure}:18445: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18446
18447                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18448                         fi
18449                 fi
18450                 ;;
18451         esac
18452         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18453 done
18454 LIBS=$cf_rpath_dst
18455
18456 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
18457
18458 echo "${as_me:-configure}:18458: testing ...checked LIBS $LIBS ..." 1>&5
18459
18460         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18461
18462 echo "${as_me:-configure}:18462: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18463
18464 else
18465         echo "$as_me:18465: result: no" >&5
18466 echo "${ECHO_T}no" >&6
18467 fi
18468
18469 fi
18470
18471 TEST_ARGS="$LIBS"
18472 LIBS=
18473
18474 ac_config_files="$ac_config_files Makefile"
18475 ac_config_commands="$ac_config_commands default"
18476 cat >confcache <<\_ACEOF
18477 # This file is a shell script that caches the results of configure
18478 # tests run on this system so they can be shared between configure
18479 # scripts and configure runs, see configure's option --config-cache.
18480 # It is not useful on other systems.  If it contains results you don't
18481 # want to keep, you may remove or edit it.
18482 #
18483 # config.status only pays attention to the cache file if you give it
18484 # the --recheck option to rerun configure.
18485 #
18486 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18487 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18488 # following values.
18489
18490 _ACEOF
18491
18492 # The following way of writing the cache mishandles newlines in values,
18493 # but we know of no workaround that is simple, portable, and efficient.
18494 # So, don't put newlines in cache variables' values.
18495 # Ultrix sh set writes to stderr and can't be redirected directly,
18496 # and sets the high bit in the cache file unless we assign to the vars.
18497 {
18498   (set) 2>&1 |
18499     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18500     *ac_space=\ *)
18501       # `set' does not quote correctly, so add quotes (double-quote
18502       # substitution turns \\\\ into \\, and sed turns \\ into \).
18503       sed -n \
18504         "s/'/'\\\\''/g;
18505           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18506       ;;
18507     *)
18508       # `set' quotes correctly as required by POSIX, so do not add quotes.
18509       sed -n \
18510         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18511       ;;
18512     esac;
18513 } |
18514   sed '
18515      t clear
18516      : clear
18517      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18518      t end
18519      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18520      : end' >>confcache
18521 if cmp -s $cache_file confcache; then :; else
18522   if test -w $cache_file; then
18523     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18524     cat confcache >$cache_file
18525   else
18526     echo "not updating unwritable cache $cache_file"
18527   fi
18528 fi
18529 rm -f confcache
18530
18531 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18532 # Let make expand exec_prefix.
18533 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18534
18535 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18536 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18537 # trailing colons and then remove the whole line if VPATH becomes empty
18538 # (actually we leave an empty line to preserve line numbers).
18539 if test "x$srcdir" = x.; then
18540   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18541 s/:*\$(srcdir):*/:/;
18542 s/:*\${srcdir}:*/:/;
18543 s/:*@srcdir@:*/:/;
18544 s/^\([^=]*=[    ]*\):*/\1/;
18545 s/:*$//;
18546 s/^[^=]*=[      ]*$//;
18547 }'
18548 fi
18549
18550 DEFS=-DHAVE_CONFIG_H
18551
18552 : ${CONFIG_STATUS=./config.status}
18553 ac_clean_files_save=$ac_clean_files
18554 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18555 { echo "$as_me:18555: creating $CONFIG_STATUS" >&5
18556 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18557 cat >$CONFIG_STATUS <<_ACEOF
18558 #! $SHELL
18559 # Generated automatically by configure.
18560 # Run this file to recreate the current configuration.
18561 # Compiler output produced by configure, useful for debugging
18562 # configure, is in config.log if it exists.
18563
18564 debug=false
18565 SHELL=\${CONFIG_SHELL-$SHELL}
18566 ac_cs_invocation="\$0 \$@"
18567
18568 _ACEOF
18569
18570 cat >>$CONFIG_STATUS <<\_ACEOF
18571 # Be Bourne compatible
18572 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18573   emulate sh
18574   NULLCMD=:
18575 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18576   set -o posix
18577 fi
18578
18579 # Name of the executable.
18580 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18581
18582 if expr a : '\(a\)' >/dev/null 2>&1; then
18583   as_expr=expr
18584 else
18585   as_expr=false
18586 fi
18587
18588 rm -f conf$$ conf$$.exe conf$$.file
18589 echo >conf$$.file
18590 if ln -s conf$$.file conf$$ 2>/dev/null; then
18591   # We could just check for DJGPP; but this test a) works b) is more generic
18592   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18593   if test -f conf$$.exe; then
18594     # Don't use ln at all; we don't have any links
18595     as_ln_s='cp -p'
18596   else
18597     as_ln_s='ln -s'
18598   fi
18599 elif ln conf$$.file conf$$ 2>/dev/null; then
18600   as_ln_s=ln
18601 else
18602   as_ln_s='cp -p'
18603 fi
18604 rm -f conf$$ conf$$.exe conf$$.file
18605
18606 as_executable_p="test -f"
18607
18608 # Support unset when possible.
18609 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18610   as_unset=unset
18611 else
18612   as_unset=false
18613 fi
18614
18615 # NLS nuisances.
18616 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18617 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18618 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18619 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18620 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18621 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18622 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18623 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18624
18625 # IFS
18626 # We need space, tab and new line, in precisely that order.
18627 as_nl='
18628 '
18629 IFS="   $as_nl"
18630
18631 # CDPATH.
18632 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18633
18634 exec 6>&1
18635
18636 _ACEOF
18637
18638 # Files that config.status was made for.
18639 if test -n "$ac_config_files"; then
18640   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
18641 fi
18642
18643 if test -n "$ac_config_headers"; then
18644   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
18645 fi
18646
18647 if test -n "$ac_config_links"; then
18648   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
18649 fi
18650
18651 if test -n "$ac_config_commands"; then
18652   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
18653 fi
18654
18655 cat >>$CONFIG_STATUS <<\EOF
18656
18657 ac_cs_usage="\
18658 \`$as_me' instantiates files from templates according to the
18659 current configuration.
18660
18661 Usage: $0 [OPTIONS] [FILE]...
18662
18663   -h, --help       print this help, then exit
18664   -V, --version    print version number, then exit
18665   -d, --debug      don't remove temporary files
18666       --recheck    update $as_me by reconfiguring in the same conditions
18667   --file=FILE[:TEMPLATE]
18668                    instantiate the configuration file FILE
18669   --header=FILE[:TEMPLATE]
18670                    instantiate the configuration header FILE
18671
18672 Configuration files:
18673 $config_files
18674
18675 Configuration headers:
18676 $config_headers
18677
18678 Configuration commands:
18679 $config_commands
18680
18681 Report bugs to <dickey@invisible-island.net>."
18682 EOF
18683
18684 cat >>$CONFIG_STATUS <<EOF
18685 ac_cs_version="\\
18686 config.status
18687 configured by $0, generated by GNU Autoconf 2.52.20150926,
18688   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18689
18690 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18691 Free Software Foundation, Inc.
18692 This config.status script is free software; the Free Software Foundation
18693 gives unlimited permission to copy, distribute and modify it."
18694 srcdir=$srcdir
18695 INSTALL="$INSTALL"
18696 EOF
18697
18698 cat >>$CONFIG_STATUS <<\EOF
18699 # If no file are specified by the user, then we need to provide default
18700 # value.  By we need to know if files were specified by the user.
18701 ac_need_defaults=:
18702 while test $# != 0
18703 do
18704   case $1 in
18705   --*=*)
18706     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18707     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18708     shift
18709     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18710     shift
18711     ;;
18712   -*);;
18713   *) # This is not an option, so the user has probably given explicit
18714      # arguments.
18715      ac_need_defaults=false;;
18716   esac
18717
18718   case $1 in
18719   # Handling of the options.
18720 EOF
18721 cat >>$CONFIG_STATUS <<EOF
18722   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18723     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18724     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18725 EOF
18726 cat >>$CONFIG_STATUS <<\EOF
18727   --version | --vers* | -V )
18728     echo "$ac_cs_version"; exit 0 ;;
18729   --he | --h)
18730     # Conflict between --help and --header
18731     { { echo "$as_me:18731: error: ambiguous option: $1
18732 Try \`$0 --help' for more information." >&5
18733 echo "$as_me: error: ambiguous option: $1
18734 Try \`$0 --help' for more information." >&2;}
18735    { (exit 1); exit 1; }; };;
18736   --help | --hel | -h )
18737     echo "$ac_cs_usage"; exit 0 ;;
18738   --debug | --d* | -d )
18739     debug=: ;;
18740   --file | --fil | --fi | --f )
18741     shift
18742     CONFIG_FILES="$CONFIG_FILES $1"
18743     ac_need_defaults=false;;
18744   --header | --heade | --head | --hea )
18745     shift
18746     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18747     ac_need_defaults=false;;
18748
18749   # This is an error.
18750   -*) { { echo "$as_me:18750: error: unrecognized option: $1
18751 Try \`$0 --help' for more information." >&5
18752 echo "$as_me: error: unrecognized option: $1
18753 Try \`$0 --help' for more information." >&2;}
18754    { (exit 1); exit 1; }; } ;;
18755
18756   *) ac_config_targets="$ac_config_targets $1" ;;
18757
18758   esac
18759   shift
18760 done
18761
18762 exec 5>>config.log
18763 cat >&5 << _ACEOF
18764
18765 ## ----------------------- ##
18766 ## Running config.status.  ##
18767 ## ----------------------- ##
18768
18769 This file was extended by $as_me 2.52.20150926, executed with
18770   CONFIG_FILES    = $CONFIG_FILES
18771   CONFIG_HEADERS  = $CONFIG_HEADERS
18772   CONFIG_LINKS    = $CONFIG_LINKS
18773   CONFIG_COMMANDS = $CONFIG_COMMANDS
18774   > $ac_cs_invocation
18775 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18776
18777 _ACEOF
18778 EOF
18779
18780 cat >>$CONFIG_STATUS <<EOF
18781 #
18782 # INIT-COMMANDS section.
18783 #
18784
18785 AWK="$AWK"
18786 ECHO_CC="$ECHO_CC"
18787 ECHO_LD="$ECHO_LD"
18788 SHOW_CC="$SHOW_LD"
18789
18790 EOF
18791
18792 cat >>$CONFIG_STATUS <<\EOF
18793 for ac_config_target in $ac_config_targets
18794 do
18795   case "$ac_config_target" in
18796   # Handling of arguments.
18797   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18798   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18799   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
18800   *) { { echo "$as_me:18800: error: invalid argument: $ac_config_target" >&5
18801 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18802    { (exit 1); exit 1; }; };;
18803   esac
18804 done
18805
18806 # If the user did not use the arguments to specify the items to instantiate,
18807 # then the envvar interface is used.  Set only those that are not.
18808 # We use the long form for the default assignment because of an extremely
18809 # bizarre bug on SunOS 4.1.3.
18810 if $ac_need_defaults; then
18811   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18812   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18813   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18814 fi
18815
18816 # Create a temporary directory, and hook for its removal unless debugging.
18817 $debug ||
18818 {
18819   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18820   trap '{ (exit 1); exit 1; }' 1 2 13 15
18821 }
18822
18823 # Create a (secure) tmp directory for tmp files.
18824 : ${TMPDIR=/tmp}
18825 {
18826   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18827   test -n "$tmp" && test -d "$tmp"
18828 }  ||
18829 {
18830   tmp=$TMPDIR/cs$$-$RANDOM
18831   (umask 077 && mkdir $tmp)
18832 } ||
18833 {
18834    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18835    { (exit 1); exit 1; }
18836 }
18837
18838 EOF
18839
18840 cat >>$CONFIG_STATUS <<EOF
18841
18842 #
18843 # CONFIG_FILES section.
18844 #
18845
18846 # No need to generate the scripts if there are no CONFIG_FILES.
18847 # This happens for instance when ./config.status config.h
18848 if test -n "\$CONFIG_FILES"; then
18849   # Protect against being on the right side of a sed subst in config.status.
18850   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18851    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18852 s,@SHELL@,$SHELL,;t t
18853 s,@exec_prefix@,$exec_prefix,;t t
18854 s,@prefix@,$prefix,;t t
18855 s,@program_transform_name@,$program_transform_name,;t t
18856 s,@bindir@,$bindir,;t t
18857 s,@sbindir@,$sbindir,;t t
18858 s,@libexecdir@,$libexecdir,;t t
18859 s,@datarootdir@,$datarootdir,;t t
18860 s,@datadir@,$datadir,;t t
18861 s,@sysconfdir@,$sysconfdir,;t t
18862 s,@sharedstatedir@,$sharedstatedir,;t t
18863 s,@localstatedir@,$localstatedir,;t t
18864 s,@libdir@,$libdir,;t t
18865 s,@includedir@,$includedir,;t t
18866 s,@oldincludedir@,$oldincludedir,;t t
18867 s,@infodir@,$infodir,;t t
18868 s,@mandir@,$mandir,;t t
18869 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18870 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18871 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18872 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18873 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18874 s,@build_alias@,$build_alias,;t t
18875 s,@host_alias@,$host_alias,;t t
18876 s,@target_alias@,$target_alias,;t t
18877 s,@ECHO_C@,$ECHO_C,;t t
18878 s,@ECHO_N@,$ECHO_N,;t t
18879 s,@ECHO_T@,$ECHO_T,;t t
18880 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18881 s,@DEFS@,$DEFS,;t t
18882 s,@LIBS@,$LIBS,;t t
18883 s,@build@,$build,;t t
18884 s,@build_cpu@,$build_cpu,;t t
18885 s,@build_vendor@,$build_vendor,;t t
18886 s,@build_os@,$build_os,;t t
18887 s,@host@,$host,;t t
18888 s,@host_cpu@,$host_cpu,;t t
18889 s,@host_vendor@,$host_vendor,;t t
18890 s,@host_os@,$host_os,;t t
18891 s,@SET_MAKE@,$SET_MAKE,;t t
18892 s,@CC@,$CC,;t t
18893 s,@CFLAGS@,$CFLAGS,;t t
18894 s,@LDFLAGS@,$LDFLAGS,;t t
18895 s,@CPPFLAGS@,$CPPFLAGS,;t t
18896 s,@ac_ct_CC@,$ac_ct_CC,;t t
18897 s,@EXEEXT@,$EXEEXT,;t t
18898 s,@OBJEXT@,$OBJEXT,;t t
18899 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18900 s,@CPP@,$CPP,;t t
18901 s,@AWK@,$AWK,;t t
18902 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18903 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18904 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18905 s,@LINT@,$LINT,;t t
18906 s,@LINT_OPTS@,$LINT_OPTS,;t t
18907 s,@CTAGS@,$CTAGS,;t t
18908 s,@ETAGS@,$ETAGS,;t t
18909 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18910 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18911 s,@MATH_LIB@,$MATH_LIB,;t t
18912 s,@top_builddir@,$top_builddir,;t t
18913 s,@CC_G_OPT@,$CC_G_OPT,;t t
18914 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18915 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18916 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18917 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18918 s,@LD@,$LD,;t t
18919 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
18920 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
18921 s,@LD_MODEL@,$LD_MODEL,;t t
18922 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18923 s,@LIBTOOL@,$LIBTOOL,;t t
18924 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
18925 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
18926 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
18927 s,@LIB_LINK@,$LIB_LINK,;t t
18928 s,@LINK_TESTS@,$LINK_TESTS,;t t
18929 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18930 s,@PACKAGE@,$PACKAGE,;t t
18931 s,@PTHREAD@,$PTHREAD,;t t
18932 s,@TEST_ARGS@,$TEST_ARGS,;t t
18933 s,@TEST_DEPS@,$TEST_DEPS,;t t
18934 s,@TEST_LIBS@,$TEST_LIBS,;t t
18935 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
18936 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18937 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18938 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18939 s,@includesubdir@,$includesubdir,;t t
18940 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18941 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18942 s,@ECHO_LT@,$ECHO_LT,;t t
18943 s,@ECHO_LD@,$ECHO_LD,;t t
18944 s,@RULE_CC@,$RULE_CC,;t t
18945 s,@SHOW_CC@,$SHOW_CC,;t t
18946 s,@ECHO_CC@,$ECHO_CC,;t t
18947 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18948 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18949 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18950 s,@X_CFLAGS@,$X_CFLAGS,;t t
18951 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
18952 s,@X_LIBS@,$X_LIBS,;t t
18953 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
18954 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
18955 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
18956 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18957 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
18958 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18959 CEOF
18960
18961 EOF
18962
18963   cat >>$CONFIG_STATUS <<\EOF
18964   # Split the substitutions into bite-sized pieces for seds with
18965   # small command number limits, like on Digital OSF/1 and HP-UX.
18966   ac_max_sed_lines=48
18967   ac_sed_frag=1 # Number of current file.
18968   ac_beg=1 # First line for current file.
18969   ac_end=$ac_max_sed_lines # Line after last line for current file.
18970   ac_more_lines=:
18971   ac_sed_cmds=
18972   while $ac_more_lines; do
18973     if test $ac_beg -gt 1; then
18974       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18975     else
18976       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18977     fi
18978     if test ! -s $tmp/subs.frag; then
18979       ac_more_lines=false
18980     else
18981       # The purpose of the label and of the branching condition is to
18982       # speed up the sed processing (if there are no `@' at all, there
18983       # is no need to browse any of the substitutions).
18984       # These are the two extra sed commands mentioned above.
18985       (echo ':t
18986   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18987       # It is possible to make a multiline substitution using escaped newlines.
18988       # Ensure that we do not split the substitution between script fragments.
18989       ac_BEG=$ac_end
18990       ac_END=`expr $ac_end + $ac_max_sed_lines`
18991       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18992       if test -s $tmp/subs.next; then
18993         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18994         if test ! -s $tmp/subs.edit; then
18995           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18996           if test ! -s $tmp/subs.edit; then
18997             if test $ac_beg -gt 1; then
18998               ac_end=`expr $ac_end - 1`
18999               continue
19000             fi
19001           fi
19002         fi
19003       fi
19004
19005       if test -z "$ac_sed_cmds"; then
19006         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
19007       else
19008         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
19009       fi
19010       ac_sed_frag=`expr $ac_sed_frag + 1`
19011       ac_beg=$ac_end
19012       ac_end=`expr $ac_end + $ac_max_sed_lines`
19013     fi
19014   done
19015   if test -z "$ac_sed_cmds"; then
19016     ac_sed_cmds=cat
19017   fi
19018 fi # test -n "$CONFIG_FILES"
19019
19020 EOF
19021 cat >>$CONFIG_STATUS <<\EOF
19022 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19023   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19024   case $ac_file in
19025   - | *:- | *:-:* ) # input from stdin
19026         cat >$tmp/stdin
19027         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19028         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19029   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19030         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19031   * )   ac_file_in=$ac_file.in ;;
19032   esac
19033
19034   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19035   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19036          X"$ac_file" : 'X\(//\)[^/]' \| \
19037          X"$ac_file" : 'X\(//\)$' \| \
19038          X"$ac_file" : 'X\(/\)' \| \
19039          .     : '\(.\)' 2>/dev/null ||
19040 echo X"$ac_file" |
19041     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19042           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19043           /^X\(\/\/\)$/{ s//\1/; q; }
19044           /^X\(\/\).*/{ s//\1/; q; }
19045           s/.*/./; q'`
19046   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19047     { case "$ac_dir" in
19048   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19049   *)                      as_incr_dir=.;;
19050 esac
19051 as_dummy="$ac_dir"
19052 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19053   case $as_mkdir_dir in
19054     # Skip DOS drivespec
19055     ?:) as_incr_dir=$as_mkdir_dir ;;
19056     *)
19057       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19058       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19059     ;;
19060   esac
19061 done; }
19062
19063     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
19064     # A "../" for each directory in $ac_dir_suffix.
19065     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19066   else
19067     ac_dir_suffix= ac_dots=
19068   fi
19069
19070   case $srcdir in
19071   .)  ac_srcdir=.
19072       if test -z "$ac_dots"; then
19073          ac_top_srcdir=.
19074       else
19075          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
19076       fi ;;
19077   [\\/]* | ?:[\\/]* )
19078       ac_srcdir=$srcdir$ac_dir_suffix;
19079       ac_top_srcdir=$srcdir ;;
19080   *) # Relative path.
19081     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
19082     ac_top_srcdir=$ac_dots$srcdir ;;
19083   esac
19084
19085   case $INSTALL in
19086   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19087   *) ac_INSTALL=$ac_dots$INSTALL ;;
19088   esac
19089
19090   if test x"$ac_file" != x-; then
19091     { echo "$as_me:19091: creating $ac_file" >&5
19092 echo "$as_me: creating $ac_file" >&6;}
19093     rm -f "$ac_file"
19094   fi
19095   # Let's still pretend it is `configure' which instantiates (i.e., don't
19096   # use $as_me), people would be surprised to read:
19097   #    /* config.h.  Generated automatically by config.status.  */
19098   configure_input="Generated automatically from `echo $ac_file_in |
19099                                                  sed 's,.*/,,'` by configure."
19100
19101   # First look for the input files in the build tree, otherwise in the
19102   # src tree.
19103   ac_file_inputs=`IFS=:
19104     for f in $ac_file_in; do
19105       case $f in
19106       -) echo $tmp/stdin ;;
19107       [\\/$]*)
19108          # Absolute (can't be DOS-style, as IFS=:)
19109          test -f "$f" || { { echo "$as_me:19109: error: cannot find input file: $f" >&5
19110 echo "$as_me: error: cannot find input file: $f" >&2;}
19111    { (exit 1); exit 1; }; }
19112          echo $f;;
19113       *) # Relative
19114          if test -f "$f"; then
19115            # Build tree
19116            echo $f
19117          elif test -f "$srcdir/$f"; then
19118            # Source tree
19119            echo $srcdir/$f
19120          else
19121            # /dev/null tree
19122            { { echo "$as_me:19122: error: cannot find input file: $f" >&5
19123 echo "$as_me: error: cannot find input file: $f" >&2;}
19124    { (exit 1); exit 1; }; }
19125          fi;;
19126       esac
19127     done` || { (exit 1); exit 1; }
19128 EOF
19129 cat >>$CONFIG_STATUS <<\EOF
19130   ac_warn_datarootdir=no
19131   if test x"$ac_file" != x-; then
19132     for ac_item in $ac_file_inputs
19133     do
19134       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
19135       if test -n "$ac_seen"; then
19136         ac_used=`grep '@datarootdir@' $ac_item`
19137         if test -z "$ac_used"; then
19138           { echo "$as_me:19138: WARNING: datarootdir was used implicitly but not set:
19139 $ac_seen" >&5
19140 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19141 $ac_seen" >&2;}
19142           ac_warn_datarootdir=yes
19143         fi
19144       fi
19145       ac_seen=`grep '${datarootdir}' $ac_item`
19146       if test -n "$ac_seen"; then
19147         { echo "$as_me:19147: WARNING: datarootdir was used explicitly but not set:
19148 $ac_seen" >&5
19149 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19150 $ac_seen" >&2;}
19151         ac_warn_datarootdir=yes
19152       fi
19153     done
19154   fi
19155
19156 if test "x$ac_warn_datarootdir" = xyes; then
19157   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19158 fi
19159
19160 EOF
19161 cat >>$CONFIG_STATUS <<EOF
19162   sed "$ac_vpsub
19163 $extrasub
19164 EOF
19165 cat >>$CONFIG_STATUS <<\EOF
19166 :t
19167 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19168 s,@configure_input@,$configure_input,;t t
19169 s,@srcdir@,$ac_srcdir,;t t
19170 s,@top_srcdir@,$ac_top_srcdir,;t t
19171 s,@INSTALL@,$ac_INSTALL,;t t
19172 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
19173   rm -f $tmp/stdin
19174   if test x"$ac_file" != x-; then
19175     cp $tmp/out $ac_file
19176
19177     for ac_name in prefix exec_prefix datarootdir
19178     do
19179         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
19180         if test -n "$ac_seen"; then
19181             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
19182             if test -z "$ac_init"; then
19183               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
19184               { echo "$as_me:19184: WARNING: Variable $ac_name is used but was not set:
19185 $ac_seen" >&5
19186 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19187 $ac_seen" >&2;}
19188             fi
19189         fi
19190     done
19191     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
19192     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
19193     if test -s $tmp/out; then
19194       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
19195       { echo "$as_me:19195: WARNING: Some variables may not be substituted:
19196 $ac_seen" >&5
19197 echo "$as_me: WARNING: Some variables may not be substituted:
19198 $ac_seen" >&2;}
19199     fi
19200   else
19201     cat $tmp/out
19202   fi
19203   rm -f $tmp/out
19204
19205 done
19206 EOF
19207 cat >>$CONFIG_STATUS <<\EOF
19208
19209 #
19210 # CONFIG_HEADER section.
19211 #
19212
19213 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19214 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19215 #
19216 # ac_d sets the value in "#define NAME VALUE" lines.
19217 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19218 ac_dB='[        ].*$,\1#\2'
19219 ac_dC=' '
19220 ac_dD=',;t'
19221 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19222 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19223 ac_iB='\([      ]\),\1#\2define\3'
19224 ac_iC=' '
19225 ac_iD='\4,;t'
19226 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19227 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19228 ac_uB='$,\1#\2define\3'
19229 ac_uC=' '
19230 ac_uD=',;t'
19231
19232 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19233   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19234   case $ac_file in
19235   - | *:- | *:-:* ) # input from stdin
19236         cat >$tmp/stdin
19237         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19238         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19239   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19240         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19241   * )   ac_file_in=$ac_file.in ;;
19242   esac
19243
19244   test x"$ac_file" != x- && { echo "$as_me:19244: creating $ac_file" >&5
19245 echo "$as_me: creating $ac_file" >&6;}
19246
19247   # First look for the input files in the build tree, otherwise in the
19248   # src tree.
19249   ac_file_inputs=`IFS=:
19250     for f in $ac_file_in; do
19251       case $f in
19252       -) echo $tmp/stdin ;;
19253       [\\/$]*)
19254          # Absolute (can't be DOS-style, as IFS=:)
19255          test -f "$f" || { { echo "$as_me:19255: error: cannot find input file: $f" >&5
19256 echo "$as_me: error: cannot find input file: $f" >&2;}
19257    { (exit 1); exit 1; }; }
19258          echo $f;;
19259       *) # Relative
19260          if test -f "$f"; then
19261            # Build tree
19262            echo $f
19263          elif test -f "$srcdir/$f"; then
19264            # Source tree
19265            echo $srcdir/$f
19266          else
19267            # /dev/null tree
19268            { { echo "$as_me:19268: error: cannot find input file: $f" >&5
19269 echo "$as_me: error: cannot find input file: $f" >&2;}
19270    { (exit 1); exit 1; }; }
19271          fi;;
19272       esac
19273     done` || { (exit 1); exit 1; }
19274   # Remove the trailing spaces.
19275   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
19276
19277 EOF
19278
19279 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19280 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19281 # be either 'cat' or 'sort'.
19282 cat confdefs.h | uniq >conftest.vals
19283
19284 # Break up conftest.vals because some shells have a limit on
19285 # the size of here documents, and old seds have small limits too.
19286
19287 rm -f conftest.tail
19288 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
19289 while grep . conftest.vals >/dev/null
19290 do
19291   # Write chunks of a limited-size here document to conftest.frag.
19292   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
19293   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
19294   echo 'CEOF' >> $CONFIG_STATUS
19295   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
19296   rm -f conftest.vals
19297   mv conftest.tail conftest.vals
19298 done
19299 rm -f conftest.vals
19300
19301 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19302 # marker @DEFS@.
19303 echo '  cat >> conftest.edit <<CEOF
19304 /@DEFS@/r conftest.frag
19305 /@DEFS@/d
19306 CEOF
19307 sed -f conftest.edit $tmp/in > $tmp/out
19308 rm -f $tmp/in
19309 mv $tmp/out $tmp/in
19310 rm -f conftest.edit conftest.frag
19311 ' >> $CONFIG_STATUS
19312
19313 cat >>$CONFIG_STATUS <<\EOF
19314   # Let's still pretend it is `configure' which instantiates (i.e., don't
19315   # use $as_me), people would be surprised to read:
19316   #    /* config.h.  Generated automatically by config.status.  */
19317   if test x"$ac_file" = x-; then
19318     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19319   else
19320     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19321   fi
19322   cat $tmp/in >>$tmp/config.h
19323   rm -f $tmp/in
19324   if test x"$ac_file" != x-; then
19325     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
19326       { echo "$as_me:19326: $ac_file is unchanged" >&5
19327 echo "$as_me: $ac_file is unchanged" >&6;}
19328     else
19329       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19330          X"$ac_file" : 'X\(//\)[^/]' \| \
19331          X"$ac_file" : 'X\(//\)$' \| \
19332          X"$ac_file" : 'X\(/\)' \| \
19333          .     : '\(.\)' 2>/dev/null ||
19334 echo X"$ac_file" |
19335     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19336           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19337           /^X\(\/\/\)$/{ s//\1/; q; }
19338           /^X\(\/\).*/{ s//\1/; q; }
19339           s/.*/./; q'`
19340       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19341         { case "$ac_dir" in
19342   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19343   *)                      as_incr_dir=.;;
19344 esac
19345 as_dummy="$ac_dir"
19346 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19347   case $as_mkdir_dir in
19348     # Skip DOS drivespec
19349     ?:) as_incr_dir=$as_mkdir_dir ;;
19350     *)
19351       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19352       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19353     ;;
19354   esac
19355 done; }
19356
19357       fi
19358       rm -f $ac_file
19359       mv $tmp/config.h $ac_file
19360     fi
19361   else
19362     cat $tmp/config.h
19363     rm -f $tmp/config.h
19364   fi
19365 done
19366 EOF
19367 cat >>$CONFIG_STATUS <<\EOF
19368 #
19369 # CONFIG_COMMANDS section.
19370 #
19371 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19372   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19373   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19374
19375   case $ac_dest in
19376     default )
19377
19378 for cf_dir in .
19379 do
19380         if test ! -d $srcdir/$cf_dir; then
19381                 continue
19382         elif test -f $srcdir/$cf_dir/programs; then
19383                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
19384         fi
19385 done
19386
19387         cat >>Makefile <<TEST_EOF
19388
19389 # These rules are generated so we do not rely on suffix rules, which do not
19390 # work consistently for different make-programs (the '\$(MODEL)/' confuses
19391 # some, and the '\$x' confuses others).
19392 TEST_EOF
19393
19394 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
19395 for N in $LIST
19396 do
19397         cat >>Makefile <<TEST_EOF
19398
19399 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
19400         \$(srcdir)/test.priv.h \\
19401         ncurses_cfg.h
19402         $SHOW_CC
19403         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
19404 TEST_EOF
19405 done
19406
19407 if test -f ../config.guess && test -f ../config.sub
19408 then
19409         cat >>Makefile <<TEST_EOF
19410
19411 # if we used CF_INHERIT for getting these files, we can remove them
19412 distclean::
19413         rm -f config.guess config.sub
19414 TEST_EOF
19415 fi
19416  ;;
19417   esac
19418 done
19419 EOF
19420
19421 cat >>$CONFIG_STATUS <<\EOF
19422
19423 { (exit 0); exit 0; }
19424 EOF
19425 chmod +x $CONFIG_STATUS
19426 ac_clean_files=$ac_clean_files_save
19427
19428 # configure is writing to config.log, and then calls config.status.
19429 # config.status does its own redirection, appending to config.log.
19430 # Unfortunately, on DOS this fails, as config.log is still kept open
19431 # by configure, so config.status won't be able to write to it; its
19432 # output is simply discarded.  So we exec the FD to /dev/null,
19433 # effectively closing config.log, so it can be properly (re)opened and
19434 # appended to by config.status.  When coming back to configure, we
19435 # need to make the FD available again.
19436 if test "$no_create" != yes; then
19437   ac_cs_success=:
19438   exec 5>/dev/null
19439   $SHELL $CONFIG_STATUS || ac_cs_success=false
19440   exec 5>>config.log
19441   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19442   # would make configure fail if this is the last instruction.
19443   $ac_cs_success || { (exit 1); exit 1; }
19444 fi
19445