]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.9 - patch 20140831
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20121002.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${datarootdir}/info'
146 mandir='${datarootdir}/man'
147
148 # Identity of this package.
149 PACKAGE_NAME=
150 PACKAGE_TARNAME=
151 PACKAGE_VERSION=
152 PACKAGE_STRING=
153 PACKAGE_BUGREPORT=
154
155 ac_prev=
156 for ac_option
157 do
158   # If the previous option needs an argument, assign it.
159   if test -n "$ac_prev"; then
160     eval "$ac_prev=\$ac_option"
161     ac_prev=
162     continue
163   fi
164
165   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
166
167   # Accept the important Cygnus configure options, so we can diagnose typos.
168
169   case $ac_option in
170
171   -bindir | --bindir | --bindi | --bind | --bin | --bi)
172     ac_prev=bindir ;;
173   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
174     bindir=$ac_optarg ;;
175
176   -build | --build | --buil | --bui | --bu)
177     ac_prev=build_alias ;;
178   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
179     build_alias=$ac_optarg ;;
180
181   -cache-file | --cache-file | --cache-fil | --cache-fi \
182   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
183     ac_prev=cache_file ;;
184   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
185   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
186     cache_file=$ac_optarg ;;
187
188   --config-cache | -C)
189     cache_file=config.cache ;;
190
191   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
192     ac_prev=datadir ;;
193   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
194   | --da=*)
195     datadir=$ac_optarg ;;
196
197   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
198   | --dataroo | --dataro | --datar)
199     ac_prev=datarootdir ;;
200   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
201   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
202     datarootdir=$ac_optarg ;;
203
204   -disable-* | --disable-*)
205     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
206     # Reject names that are not valid shell variable names.
207     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
208       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
209    { (exit 1); exit 1; }; }
210     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
211     eval "enable_$ac_feature=no" ;;
212
213   -enable-* | --enable-*)
214     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
215     # Reject names that are not valid shell variable names.
216     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
217       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
218    { (exit 1); exit 1; }; }
219     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
220     case $ac_option in
221       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
222       *) ac_optarg=yes ;;
223     esac
224     eval "enable_$ac_feature='$ac_optarg'" ;;
225
226   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
227   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
228   | --exec | --exe | --ex)
229     ac_prev=exec_prefix ;;
230   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
231   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
232   | --exec=* | --exe=* | --ex=*)
233     exec_prefix=$ac_optarg ;;
234
235   -gas | --gas | --ga | --g)
236     # Obsolete; use --with-gas.
237     with_gas=yes ;;
238
239   -help | --help | --hel | --he | -h)
240     ac_init_help=long ;;
241   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
242     ac_init_help=recursive ;;
243   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
244     ac_init_help=short ;;
245
246   -host | --host | --hos | --ho)
247     ac_prev=host_alias ;;
248   -host=* | --host=* | --hos=* | --ho=*)
249     host_alias=$ac_optarg ;;
250
251   -includedir | --includedir | --includedi | --included | --include \
252   | --includ | --inclu | --incl | --inc)
253     ac_prev=includedir ;;
254   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
255   | --includ=* | --inclu=* | --incl=* | --inc=*)
256     includedir=$ac_optarg ;;
257
258   -infodir | --infodir | --infodi | --infod | --info | --inf)
259     ac_prev=infodir ;;
260   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
261     infodir=$ac_optarg ;;
262
263   -libdir | --libdir | --libdi | --libd)
264     ac_prev=libdir ;;
265   -libdir=* | --libdir=* | --libdi=* | --libd=*)
266     libdir=$ac_optarg ;;
267
268   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
269   | --libexe | --libex | --libe)
270     ac_prev=libexecdir ;;
271   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
272   | --libexe=* | --libex=* | --libe=*)
273     libexecdir=$ac_optarg ;;
274
275   -localstatedir | --localstatedir | --localstatedi | --localstated \
276   | --localstate | --localstat | --localsta | --localst \
277   | --locals | --local | --loca | --loc | --lo)
278     ac_prev=localstatedir ;;
279   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
280   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
281   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
282     localstatedir=$ac_optarg ;;
283
284   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
285     ac_prev=mandir ;;
286   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
287     mandir=$ac_optarg ;;
288
289   -nfp | --nfp | --nf)
290     # Obsolete; use --without-fp.
291     with_fp=no ;;
292
293   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
294   | --no-cr | --no-c)
295     no_create=yes ;;
296
297   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
298   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
299     no_recursion=yes ;;
300
301   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
302   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
303   | --oldin | --oldi | --old | --ol | --o)
304     ac_prev=oldincludedir ;;
305   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
306   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
307   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
308     oldincludedir=$ac_optarg ;;
309
310   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
311     ac_prev=prefix ;;
312   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
313     prefix=$ac_optarg ;;
314
315   -program-prefix | --program-prefix | --program-prefi | --program-pref \
316   | --program-pre | --program-pr | --program-p)
317     ac_prev=program_prefix ;;
318   -program-prefix=* | --program-prefix=* | --program-prefi=* \
319   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
320     program_prefix=$ac_optarg ;;
321
322   -program-suffix | --program-suffix | --program-suffi | --program-suff \
323   | --program-suf | --program-su | --program-s)
324     ac_prev=program_suffix ;;
325   -program-suffix=* | --program-suffix=* | --program-suffi=* \
326   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
327     program_suffix=$ac_optarg ;;
328
329   -program-transform-name | --program-transform-name \
330   | --program-transform-nam | --program-transform-na \
331   | --program-transform-n | --program-transform- \
332   | --program-transform | --program-transfor \
333   | --program-transfo | --program-transf \
334   | --program-trans | --program-tran \
335   | --progr-tra | --program-tr | --program-t)
336     ac_prev=program_transform_name ;;
337   -program-transform-name=* | --program-transform-name=* \
338   | --program-transform-nam=* | --program-transform-na=* \
339   | --program-transform-n=* | --program-transform-=* \
340   | --program-transform=* | --program-transfor=* \
341   | --program-transfo=* | --program-transf=* \
342   | --program-trans=* | --program-tran=* \
343   | --progr-tra=* | --program-tr=* | --program-t=*)
344     program_transform_name=$ac_optarg ;;
345
346   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
347   | -silent | --silent | --silen | --sile | --sil)
348     silent=yes ;;
349
350   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
351     ac_prev=sbindir ;;
352   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
353   | --sbi=* | --sb=*)
354     sbindir=$ac_optarg ;;
355
356   -sharedstatedir | --sharedstatedir | --sharedstatedi \
357   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
358   | --sharedst | --shareds | --shared | --share | --shar \
359   | --sha | --sh)
360     ac_prev=sharedstatedir ;;
361   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
362   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
363   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
364   | --sha=* | --sh=*)
365     sharedstatedir=$ac_optarg ;;
366
367   -site | --site | --sit)
368     ac_prev=site ;;
369   -site=* | --site=* | --sit=*)
370     site=$ac_optarg ;;
371
372   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
373     ac_prev=srcdir ;;
374   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
375     srcdir=$ac_optarg ;;
376
377   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
378   | --syscon | --sysco | --sysc | --sys | --sy)
379     ac_prev=sysconfdir ;;
380   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
381   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
382     sysconfdir=$ac_optarg ;;
383
384   -target | --target | --targe | --targ | --tar | --ta | --t)
385     ac_prev=target_alias ;;
386   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
387     target_alias=$ac_optarg ;;
388
389   -v | -verbose | --verbose | --verbos | --verbo | --verb)
390     verbose=yes ;;
391
392   -version | --version | --versio | --versi | --vers | -V)
393     ac_init_version=: ;;
394
395   -with-* | --with-*)
396     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
397     # Reject names that are not valid shell variable names.
398     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
399       { echo "$as_me: error: invalid package name: $ac_package" >&2
400    { (exit 1); exit 1; }; }
401     ac_package=`echo $ac_package| sed 's/-/_/g'`
402     case $ac_option in
403       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
404       *) ac_optarg=yes ;;
405     esac
406     eval "with_$ac_package='$ac_optarg'" ;;
407
408   -without-* | --without-*)
409     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
410     # Reject names that are not valid shell variable names.
411     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
412       { echo "$as_me: error: invalid package name: $ac_package" >&2
413    { (exit 1); exit 1; }; }
414     ac_package=`echo $ac_package | sed 's/-/_/g'`
415     eval "with_$ac_package=no" ;;
416
417   --x)
418     # Obsolete; use --with-x.
419     with_x=yes ;;
420
421   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
422   | --x-incl | --x-inc | --x-in | --x-i)
423     ac_prev=x_includes ;;
424   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
425   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
426     x_includes=$ac_optarg ;;
427
428   -x-libraries | --x-libraries | --x-librarie | --x-librari \
429   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
430     ac_prev=x_libraries ;;
431   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
432   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
433     x_libraries=$ac_optarg ;;
434
435   -*) { echo "$as_me: error: unrecognized option: $ac_option
436 Try \`$0 --help' for more information." >&2
437    { (exit 1); exit 1; }; }
438     ;;
439
440   *=*)
441     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
442     # Reject names that are not valid shell variable names.
443     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
444       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
445    { (exit 1); exit 1; }; }
446     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
447     eval "$ac_envvar='$ac_optarg'"
448     export $ac_envvar ;;
449
450   *)
451     # FIXME: should be removed in autoconf 3.0.
452     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
453     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
454       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
455     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
456     ;;
457
458   esac
459 done
460
461 if test -n "$ac_prev"; then
462   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
463   { echo "$as_me: error: missing argument to $ac_option" >&2
464    { (exit 1); exit 1; }; }
465 fi
466
467 # Be sure to have absolute paths.
468 for ac_var in exec_prefix prefix
469 do
470   eval ac_val=$`echo $ac_var`
471   case $ac_val in
472     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
473     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
474    { (exit 1); exit 1; }; };;
475   esac
476 done
477
478 # Be sure to have absolute paths.
479 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
480               localstatedir libdir includedir oldincludedir infodir mandir
481 do
482   eval ac_val=$`echo $ac_var`
483   case $ac_val in
484     [\\/$]* | ?:[\\/]* ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # There might be people who depend on the old broken behavior: `$host'
491 # used to hold the argument of --host etc.
492 build=$build_alias
493 host=$host_alias
494 target=$target_alias
495
496 # FIXME: should be removed in autoconf 3.0.
497 if test "x$host_alias" != x; then
498   if test "x$build_alias" = x; then
499     cross_compiling=maybe
500     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
501     If a cross compiler is detected then cross compile mode will be used." >&2
502   elif test "x$build_alias" != "x$host_alias"; then
503     cross_compiling=yes
504   fi
505 fi
506
507 ac_tool_prefix=
508 test -n "$host_alias" && ac_tool_prefix=$host_alias-
509
510 test "$silent" = yes && exec 6>/dev/null
511
512 # Find the source files, if location was not specified.
513 if test -z "$srcdir"; then
514   ac_srcdir_defaulted=yes
515   # Try the directory containing this script, then its parent.
516   ac_prog=$0
517   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
518   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
519   srcdir=$ac_confdir
520   if test ! -r $srcdir/$ac_unique_file; then
521     srcdir=..
522   fi
523 else
524   ac_srcdir_defaulted=no
525 fi
526 if test ! -r $srcdir/$ac_unique_file; then
527   if test "$ac_srcdir_defaulted" = yes; then
528     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
529    { (exit 1); exit 1; }; }
530   else
531     { echo "$as_me: error: cannot find sources in $srcdir" >&2
532    { (exit 1); exit 1; }; }
533   fi
534 fi
535 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
536 ac_env_build_alias_set=${build_alias+set}
537 ac_env_build_alias_value=$build_alias
538 ac_cv_env_build_alias_set=${build_alias+set}
539 ac_cv_env_build_alias_value=$build_alias
540 ac_env_host_alias_set=${host_alias+set}
541 ac_env_host_alias_value=$host_alias
542 ac_cv_env_host_alias_set=${host_alias+set}
543 ac_cv_env_host_alias_value=$host_alias
544 ac_env_target_alias_set=${target_alias+set}
545 ac_env_target_alias_value=$target_alias
546 ac_cv_env_target_alias_set=${target_alias+set}
547 ac_cv_env_target_alias_value=$target_alias
548 ac_env_CC_set=${CC+set}
549 ac_env_CC_value=$CC
550 ac_cv_env_CC_set=${CC+set}
551 ac_cv_env_CC_value=$CC
552 ac_env_CFLAGS_set=${CFLAGS+set}
553 ac_env_CFLAGS_value=$CFLAGS
554 ac_cv_env_CFLAGS_set=${CFLAGS+set}
555 ac_cv_env_CFLAGS_value=$CFLAGS
556 ac_env_LDFLAGS_set=${LDFLAGS+set}
557 ac_env_LDFLAGS_value=$LDFLAGS
558 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
559 ac_cv_env_LDFLAGS_value=$LDFLAGS
560 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
561 ac_env_CPPFLAGS_value=$CPPFLAGS
562 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
563 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
564 ac_env_CPP_set=${CPP+set}
565 ac_env_CPP_value=$CPP
566 ac_cv_env_CPP_set=${CPP+set}
567 ac_cv_env_CPP_value=$CPP
568
569 #
570 # Report the --help message.
571 #
572 if test "$ac_init_help" = "long"; then
573   # Omit some internal or obsolete options to make the list less imposing.
574   # This message is too long to be a string in the A/UX 3.1 sh.
575   cat <<EOF
576 \`configure' configures this package to adapt to many kinds of systems.
577
578 Usage: $0 [OPTION]... [VAR=VALUE]...
579
580 To assign environment variables (e.g., CC, CFLAGS...), specify them as
581 VAR=VALUE.  See below for descriptions of some of the useful variables.
582
583 Defaults for the options are specified in brackets.
584
585 Configuration:
586   -h, --help              display this help and exit
587       --help=short        display options specific to this package
588       --help=recursive    display the short help of all the included packages
589   -V, --version           display version information and exit
590   -q, --quiet, --silent   do not print \`checking...' messages
591       --cache-file=FILE   cache test results in FILE [disabled]
592   -C, --config-cache      alias for \`--cache-file=config.cache'
593   -n, --no-create         do not create output files
594       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
595
596 EOF
597
598   cat <<EOF
599 Installation directories:
600   --prefix=PREFIX         install architecture-independent files in PREFIX
601                           [$ac_default_prefix]
602   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
603                           [PREFIX]
604
605 By default, \`make install' will install all the files in
606 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
607 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
608 for instance \`--prefix=\$HOME'.
609
610 For better control, use the options below.
611
612 Fine tuning of the installation directories:
613   --bindir=DIR            user executables [EPREFIX/bin]
614   --sbindir=DIR           system admin executables [EPREFIX/sbin]
615   --libexecdir=DIR        program executables [EPREFIX/libexec]
616   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
617   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
618   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
619   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
620   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
621   --libdir=DIR            object code libraries [EPREFIX/lib]
622   --includedir=DIR        C header files [PREFIX/include]
623   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
624   --infodir=DIR           info documentation [DATAROOTDIR/info]
625   --mandir=DIR            man documentation [DATAROOTDIR/man]
626 EOF
627
628   cat <<\EOF
629
630 Program names:
631   --program-prefix=PREFIX            prepend PREFIX to installed program names
632   --program-suffix=SUFFIX            append SUFFIX to installed program names
633   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
634
635 X features:
636   --x-includes=DIR    X include files are in DIR
637   --x-libraries=DIR   X library files are in DIR
638
639 System types:
640   --build=BUILD           configure for building on BUILD [guessed]
641   --host=HOST       build programs to run on HOST [BUILD]
642 EOF
643 fi
644
645 if test -n "$ac_init_help"; then
646
647   cat <<\EOF
648
649 Optional Packages:
650   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
651   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
652
653 Optional Features:
654   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
655   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
656
657 General Options:
658   --with-pkg-config{=path} enable/disable use of pkg-config
659   --disable-echo          do not display "compiling" commands
660 Curses Version-dependent Options:
661   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
662   --disable-widec         disable checks for wide-character functions
663   --with-curses-dir=DIR   directory in which (n)curses is installed
664   --with-ncursesw         use wide ncurses-libraries
665   --with-ncurses          use ncurses-libraries
666   --with-pdcurses         compile/link with pdcurses X11 library
667   --with-curses-colr      compile/link with HPUX 10.x color-curses
668   --with-curses-5lib      compile/link with SunOS 5lib curses
669   --with-Xaw3d            link with Xaw 3d library
670   --with-Xaw3dxft         link with Xaw 3d xft library
671   --with-neXtaw           link with neXT Athena library
672   --with-XawPlus          link with Athena-Plus library
673   --with-x                use the X Window System
674 Testing/development Options:
675   --enable-warnings       test: turn on gcc compiler warnings
676   --with-dmalloc          test: use Gray Watson's dmalloc library
677   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
678   --with-valgrind         test: use valgrind
679   --disable-leaks         test: free permanent memory, analyze leaks
680   --disable-rpath-hack    don't add rpath options for additional libraries
681
682 Some influential environment variables:
683   CC          C compiler command
684   CFLAGS      C compiler flags
685   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
686               nonstandard directory <lib dir>
687   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
688               headers in a nonstandard directory <include dir>
689   CPP         C preprocessor
690
691 Use these variables to override the choices made by `configure' or to help
692 it to find libraries and programs with nonstandard names/locations.
693
694 EOF
695 fi
696
697 if test "$ac_init_help" = "recursive"; then
698   # If there are subdirs, report their specific --help.
699   ac_popdir=`pwd`
700   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
701     cd $ac_subdir
702     # A "../" for each directory in /$ac_subdir.
703     ac_dots=`echo $ac_subdir |
704              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
705
706     case $srcdir in
707     .) # No --srcdir option.  We are building in place.
708       ac_sub_srcdir=$srcdir ;;
709     [\\/]* | ?:[\\/]* ) # Absolute path.
710       ac_sub_srcdir=$srcdir/$ac_subdir ;;
711     *) # Relative path.
712       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
713     esac
714
715     # Check for guested configure; otherwise get Cygnus style configure.
716     if test -f $ac_sub_srcdir/configure.gnu; then
717       echo
718       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
719     elif test -f $ac_sub_srcdir/configure; then
720       echo
721       $SHELL $ac_sub_srcdir/configure  --help=recursive
722     elif test -f $ac_sub_srcdir/configure.ac ||
723            test -f $ac_sub_srcdir/configure.in; then
724       echo
725       $ac_configure --help
726     else
727       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
728     fi
729     cd $ac_popdir
730   done
731 fi
732
733 test -n "$ac_init_help" && exit 0
734 if $ac_init_version; then
735   cat <<\EOF
736
737 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
738 Free Software Foundation, Inc.
739 This configure script is free software; the Free Software Foundation
740 gives unlimited permission to copy, distribute and modify it.
741 EOF
742   exit 0
743 fi
744 exec 5>config.log
745 cat >&5 <<EOF
746 This file contains any messages produced by compilers while
747 running configure, to aid debugging if configure makes a mistake.
748
749 It was created by $as_me, which was
750 generated by GNU Autoconf 2.52.20121002.  Invocation command line was
751
752   $ $0 $@
753
754 EOF
755 {
756 cat <<_ASUNAME
757 ## ---------- ##
758 ## Platform.  ##
759 ## ---------- ##
760
761 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
762 uname -m = `(uname -m) 2>/dev/null || echo unknown`
763 uname -r = `(uname -r) 2>/dev/null || echo unknown`
764 uname -s = `(uname -s) 2>/dev/null || echo unknown`
765 uname -v = `(uname -v) 2>/dev/null || echo unknown`
766
767 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
768 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
769
770 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
771 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
772 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
773 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
774 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
775 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
776 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
777
778 PATH = $PATH
779
780 _ASUNAME
781 } >&5
782
783 cat >&5 <<EOF
784 ## ------------ ##
785 ## Core tests.  ##
786 ## ------------ ##
787
788 EOF
789
790 # Keep a trace of the command line.
791 # Strip out --no-create and --no-recursion so they do not pile up.
792 # Also quote any args containing shell meta-characters.
793 ac_configure_args=
794 ac_sep=
795 for ac_arg
796 do
797   case $ac_arg in
798   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
799   | --no-cr | --no-c) ;;
800   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
801   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
802   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
803     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
804     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
805     ac_sep=" " ;;
806   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
807      ac_sep=" " ;;
808   esac
809   # Get rid of the leading space.
810 done
811
812 # When interrupted or exit'd, cleanup temporary files, and complete
813 # config.log.  We remove comments because anyway the quotes in there
814 # would cause problems or look ugly.
815 trap 'exit_status=$?
816   # Save into config.log some information that might help in debugging.
817   echo >&5
818   echo "## ----------------- ##" >&5
819   echo "## Cache variables.  ##" >&5
820   echo "## ----------------- ##" >&5
821   echo >&5
822   # The following way of writing the cache mishandles newlines in values,
823 {
824   (set) 2>&1 |
825     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
826     *ac_space=\ *)
827       sed -n \
828         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
829           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
830       ;;
831     *)
832       sed -n \
833         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
834       ;;
835     esac;
836 } >&5
837   sed "/^$/d" confdefs.h >conftest.log
838   if test -s conftest.log; then
839     echo >&5
840     echo "## ------------ ##" >&5
841     echo "## confdefs.h.  ##" >&5
842     echo "## ------------ ##" >&5
843     echo >&5
844     cat conftest.log >&5
845   fi
846   (echo; echo) >&5
847   test "$ac_signal" != 0 &&
848     echo "$as_me: caught signal $ac_signal" >&5
849   echo "$as_me: exit $exit_status" >&5
850   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
851     exit $exit_status
852      ' 0
853 for ac_signal in 1 2 13 15; do
854   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
855 done
856 ac_signal=0
857
858 # confdefs.h avoids OS command line length limits that DEFS can exceed.
859 rm -rf conftest* confdefs.h
860 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
861 echo >confdefs.h
862
863 # Let the site file select an alternate cache file if it wants to.
864 # Prefer explicitly selected file to automatically selected ones.
865 if test -z "$CONFIG_SITE"; then
866   if test "x$prefix" != xNONE; then
867     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
868   else
869     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
870   fi
871 fi
872 for ac_site_file in $CONFIG_SITE; do
873   if test -r "$ac_site_file"; then
874     { echo "$as_me:874: loading site script $ac_site_file" >&5
875 echo "$as_me: loading site script $ac_site_file" >&6;}
876     cat "$ac_site_file" >&5
877     . "$ac_site_file"
878   fi
879 done
880
881 if test -r "$cache_file"; then
882   # Some versions of bash will fail to source /dev/null (special
883   # files actually), so we avoid doing that.
884   if test -f "$cache_file"; then
885     { echo "$as_me:885: loading cache $cache_file" >&5
886 echo "$as_me: loading cache $cache_file" >&6;}
887     case $cache_file in
888       [\\/]* | ?:[\\/]* ) . $cache_file;;
889       *)                      . ./$cache_file;;
890     esac
891   fi
892 else
893   { echo "$as_me:893: creating cache $cache_file" >&5
894 echo "$as_me: creating cache $cache_file" >&6;}
895   >$cache_file
896 fi
897
898 # Check that the precious variables saved in the cache have kept the same
899 # value.
900 ac_cache_corrupted=false
901 for ac_var in `(set) 2>&1 |
902                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
903   eval ac_old_set=\$ac_cv_env_${ac_var}_set
904   eval ac_new_set=\$ac_env_${ac_var}_set
905   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
906   eval ac_new_val="\$ac_env_${ac_var}_value"
907   case $ac_old_set,$ac_new_set in
908     set,)
909       { echo "$as_me:909: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
910 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
911       ac_cache_corrupted=: ;;
912     ,set)
913       { echo "$as_me:913: error: \`$ac_var' was not set in the previous run" >&5
914 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
915       ac_cache_corrupted=: ;;
916     ,);;
917     *)
918       if test "x$ac_old_val" != "x$ac_new_val"; then
919         { echo "$as_me:919: error: \`$ac_var' has changed since the previous run:" >&5
920 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
921         { echo "$as_me:921:   former value:  $ac_old_val" >&5
922 echo "$as_me:   former value:  $ac_old_val" >&2;}
923         { echo "$as_me:923:   current value: $ac_new_val" >&5
924 echo "$as_me:   current value: $ac_new_val" >&2;}
925         ac_cache_corrupted=:
926       fi;;
927   esac
928   # Pass precious variables to config.status.  It doesn't matter if
929   # we pass some twice (in addition to the command line arguments).
930   if test "$ac_new_set" = set; then
931     case $ac_new_val in
932     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
933       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
934       ac_configure_args="$ac_configure_args '$ac_arg'"
935       ;;
936     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
937        ;;
938     esac
939   fi
940 done
941 if $ac_cache_corrupted; then
942   { echo "$as_me:942: error: changes in the environment can compromise the build" >&5
943 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
944   { { echo "$as_me:944: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
945 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
946    { (exit 1); exit 1; }; }
947 fi
948
949 ac_ext=c
950 ac_cpp='$CPP $CPPFLAGS'
951 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
952 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
953 ac_compiler_gnu=$ac_cv_c_compiler_gnu
954 ac_main_return=return
955
956 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
957   *c*,-n*) ECHO_N= ECHO_C='
958 ' ECHO_T='      ' ;;
959   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
960   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
961 esac
962 echo "#! $SHELL" >conftest.sh
963 echo  "exit 0"   >>conftest.sh
964 chmod +x conftest.sh
965 if { (echo "$as_me:965: PATH=\".;.\"; conftest.sh") >&5
966   (PATH=".;."; conftest.sh) 2>&5
967   ac_status=$?
968   echo "$as_me:968: \$? = $ac_status" >&5
969   (exit $ac_status); }; then
970   ac_path_separator=';'
971 else
972   ac_path_separator=:
973 fi
974 PATH_SEPARATOR="$ac_path_separator"
975 rm -f conftest.sh
976
977 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
978
979 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
980
981 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
982
983 ac_aux_dir=
984 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
985   if test -f $ac_dir/install-sh; then
986     ac_aux_dir=$ac_dir
987     ac_install_sh="$ac_aux_dir/install-sh -c"
988     break
989   elif test -f $ac_dir/install.sh; then
990     ac_aux_dir=$ac_dir
991     ac_install_sh="$ac_aux_dir/install.sh -c"
992     break
993   elif test -f $ac_dir/shtool; then
994     ac_aux_dir=$ac_dir
995     ac_install_sh="$ac_aux_dir/shtool install -c"
996     break
997   fi
998 done
999 if test -z "$ac_aux_dir"; then
1000   { { echo "$as_me:1000: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1001 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1002    { (exit 1); exit 1; }; }
1003 fi
1004 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1005 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1006 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1007
1008 # Make sure we can run config.sub.
1009 $ac_config_sub sun4 >/dev/null 2>&1 ||
1010   { { echo "$as_me:1010: error: cannot run $ac_config_sub" >&5
1011 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1012    { (exit 1); exit 1; }; }
1013
1014 echo "$as_me:1014: checking build system type" >&5
1015 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1016 if test "${ac_cv_build+set}" = set; then
1017   echo $ECHO_N "(cached) $ECHO_C" >&6
1018 else
1019   ac_cv_build_alias=$build_alias
1020 test -z "$ac_cv_build_alias" &&
1021   ac_cv_build_alias=`$ac_config_guess`
1022 test -z "$ac_cv_build_alias" &&
1023   { { echo "$as_me:1023: error: cannot guess build type; you must specify one" >&5
1024 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1025    { (exit 1); exit 1; }; }
1026 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1027   { { echo "$as_me:1027: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1028 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1029    { (exit 1); exit 1; }; }
1030
1031 fi
1032 echo "$as_me:1032: result: $ac_cv_build" >&5
1033 echo "${ECHO_T}$ac_cv_build" >&6
1034 build=$ac_cv_build
1035 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1036 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1037 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1038
1039 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1040         echo "$as_me:1040: checking host system type" >&5
1041 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1042 if test "${ac_cv_host+set}" = set; then
1043   echo $ECHO_N "(cached) $ECHO_C" >&6
1044 else
1045   ac_cv_host_alias=$host_alias
1046 test -z "$ac_cv_host_alias" &&
1047   ac_cv_host_alias=$ac_cv_build_alias
1048 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1049   { { echo "$as_me:1049: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1050 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1051    { (exit 1); exit 1; }; }
1052
1053 fi
1054 echo "$as_me:1054: result: $ac_cv_host" >&5
1055 echo "${ECHO_T}$ac_cv_host" >&6
1056 host=$ac_cv_host
1057 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1058 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1059 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1060
1061         system_name="$host_os"
1062 else
1063         system_name="`(uname -s -r) 2>/dev/null`"
1064         if test -z "$system_name" ; then
1065                 system_name="`(hostname) 2>/dev/null`"
1066         fi
1067 fi
1068 test -n "$system_name" &&
1069 cat >>confdefs.h <<EOF
1070 #define SYSTEM_NAME "$system_name"
1071 EOF
1072
1073 if test "${cf_cv_system_name+set}" = set; then
1074   echo $ECHO_N "(cached) $ECHO_C" >&6
1075 else
1076   cf_cv_system_name="$system_name"
1077 fi
1078
1079 test -z "$system_name" && system_name="$cf_cv_system_name"
1080 test -n "$cf_cv_system_name" && echo "$as_me:1080: result: Configuring for $cf_cv_system_name" >&5
1081 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1082
1083 if test ".$system_name" != ".$cf_cv_system_name" ; then
1084         echo "$as_me:1084: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1085 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1086         { { echo "$as_me:1086: error: \"Please remove config.cache and try again.\"" >&5
1087 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1088    { (exit 1); exit 1; }; }
1089 fi
1090
1091 test "$program_prefix" != NONE &&
1092   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1093 # Use a double $ so make ignores it.
1094 test "$program_suffix" != NONE &&
1095   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1096 # Double any \ or $.  echo might interpret backslashes.
1097 # By default was `s,x,x', remove it if useless.
1098 cat <<\_ACEOF >conftest.sed
1099 s/[\\$]/&&/g;s/;s,x,x,$//
1100 _ACEOF
1101 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1102 rm conftest.sed
1103
1104 echo "$as_me:1104: checking whether ${MAKE-make} sets \${MAKE}" >&5
1105 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1106 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1107 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1108   echo $ECHO_N "(cached) $ECHO_C" >&6
1109 else
1110   cat >conftest.make <<\EOF
1111 all:
1112         @echo 'ac_maketemp="${MAKE}"'
1113 EOF
1114 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1115 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1116 if test -n "$ac_maketemp"; then
1117   eval ac_cv_prog_make_${ac_make}_set=yes
1118 else
1119   eval ac_cv_prog_make_${ac_make}_set=no
1120 fi
1121 rm -f conftest.make
1122 fi
1123 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1124   echo "$as_me:1124: result: yes" >&5
1125 echo "${ECHO_T}yes" >&6
1126   SET_MAKE=
1127 else
1128   echo "$as_me:1128: result: no" >&5
1129 echo "${ECHO_T}no" >&6
1130   SET_MAKE="MAKE=${MAKE-make}"
1131 fi
1132
1133 ac_ext=c
1134 ac_cpp='$CPP $CPPFLAGS'
1135 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1136 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1137 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1138 ac_main_return=return
1139 if test -n "$ac_tool_prefix"; then
1140   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1141 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1142 echo "$as_me:1142: checking for $ac_word" >&5
1143 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1144 if test "${ac_cv_prog_CC+set}" = set; then
1145   echo $ECHO_N "(cached) $ECHO_C" >&6
1146 else
1147   if test -n "$CC"; then
1148   ac_cv_prog_CC="$CC" # Let the user override the test.
1149 else
1150   ac_save_IFS=$IFS; IFS=$ac_path_separator
1151 ac_dummy="$PATH"
1152 for ac_dir in $ac_dummy; do
1153   IFS=$ac_save_IFS
1154   test -z "$ac_dir" && ac_dir=.
1155   $as_executable_p "$ac_dir/$ac_word" || continue
1156 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1157 echo "$as_me:1157: found $ac_dir/$ac_word" >&5
1158 break
1159 done
1160
1161 fi
1162 fi
1163 CC=$ac_cv_prog_CC
1164 if test -n "$CC"; then
1165   echo "$as_me:1165: result: $CC" >&5
1166 echo "${ECHO_T}$CC" >&6
1167 else
1168   echo "$as_me:1168: result: no" >&5
1169 echo "${ECHO_T}no" >&6
1170 fi
1171
1172 fi
1173 if test -z "$ac_cv_prog_CC"; then
1174   ac_ct_CC=$CC
1175   # Extract the first word of "gcc", so it can be a program name with args.
1176 set dummy gcc; ac_word=$2
1177 echo "$as_me:1177: checking for $ac_word" >&5
1178 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1179 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1180   echo $ECHO_N "(cached) $ECHO_C" >&6
1181 else
1182   if test -n "$ac_ct_CC"; then
1183   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1184 else
1185   ac_save_IFS=$IFS; IFS=$ac_path_separator
1186 ac_dummy="$PATH"
1187 for ac_dir in $ac_dummy; do
1188   IFS=$ac_save_IFS
1189   test -z "$ac_dir" && ac_dir=.
1190   $as_executable_p "$ac_dir/$ac_word" || continue
1191 ac_cv_prog_ac_ct_CC="gcc"
1192 echo "$as_me:1192: found $ac_dir/$ac_word" >&5
1193 break
1194 done
1195
1196 fi
1197 fi
1198 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1199 if test -n "$ac_ct_CC"; then
1200   echo "$as_me:1200: result: $ac_ct_CC" >&5
1201 echo "${ECHO_T}$ac_ct_CC" >&6
1202 else
1203   echo "$as_me:1203: result: no" >&5
1204 echo "${ECHO_T}no" >&6
1205 fi
1206
1207   CC=$ac_ct_CC
1208 else
1209   CC="$ac_cv_prog_CC"
1210 fi
1211
1212 if test -z "$CC"; then
1213   if test -n "$ac_tool_prefix"; then
1214   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1215 set dummy ${ac_tool_prefix}cc; ac_word=$2
1216 echo "$as_me:1216: checking for $ac_word" >&5
1217 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1218 if test "${ac_cv_prog_CC+set}" = set; then
1219   echo $ECHO_N "(cached) $ECHO_C" >&6
1220 else
1221   if test -n "$CC"; then
1222   ac_cv_prog_CC="$CC" # Let the user override the test.
1223 else
1224   ac_save_IFS=$IFS; IFS=$ac_path_separator
1225 ac_dummy="$PATH"
1226 for ac_dir in $ac_dummy; do
1227   IFS=$ac_save_IFS
1228   test -z "$ac_dir" && ac_dir=.
1229   $as_executable_p "$ac_dir/$ac_word" || continue
1230 ac_cv_prog_CC="${ac_tool_prefix}cc"
1231 echo "$as_me:1231: found $ac_dir/$ac_word" >&5
1232 break
1233 done
1234
1235 fi
1236 fi
1237 CC=$ac_cv_prog_CC
1238 if test -n "$CC"; then
1239   echo "$as_me:1239: result: $CC" >&5
1240 echo "${ECHO_T}$CC" >&6
1241 else
1242   echo "$as_me:1242: result: no" >&5
1243 echo "${ECHO_T}no" >&6
1244 fi
1245
1246 fi
1247 if test -z "$ac_cv_prog_CC"; then
1248   ac_ct_CC=$CC
1249   # Extract the first word of "cc", so it can be a program name with args.
1250 set dummy cc; ac_word=$2
1251 echo "$as_me:1251: checking for $ac_word" >&5
1252 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1253 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1254   echo $ECHO_N "(cached) $ECHO_C" >&6
1255 else
1256   if test -n "$ac_ct_CC"; then
1257   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1258 else
1259   ac_save_IFS=$IFS; IFS=$ac_path_separator
1260 ac_dummy="$PATH"
1261 for ac_dir in $ac_dummy; do
1262   IFS=$ac_save_IFS
1263   test -z "$ac_dir" && ac_dir=.
1264   $as_executable_p "$ac_dir/$ac_word" || continue
1265 ac_cv_prog_ac_ct_CC="cc"
1266 echo "$as_me:1266: found $ac_dir/$ac_word" >&5
1267 break
1268 done
1269
1270 fi
1271 fi
1272 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1273 if test -n "$ac_ct_CC"; then
1274   echo "$as_me:1274: result: $ac_ct_CC" >&5
1275 echo "${ECHO_T}$ac_ct_CC" >&6
1276 else
1277   echo "$as_me:1277: result: no" >&5
1278 echo "${ECHO_T}no" >&6
1279 fi
1280
1281   CC=$ac_ct_CC
1282 else
1283   CC="$ac_cv_prog_CC"
1284 fi
1285
1286 fi
1287 if test -z "$CC"; then
1288   # Extract the first word of "cc", so it can be a program name with args.
1289 set dummy cc; ac_word=$2
1290 echo "$as_me:1290: checking for $ac_word" >&5
1291 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1292 if test "${ac_cv_prog_CC+set}" = set; then
1293   echo $ECHO_N "(cached) $ECHO_C" >&6
1294 else
1295   if test -n "$CC"; then
1296   ac_cv_prog_CC="$CC" # Let the user override the test.
1297 else
1298   ac_prog_rejected=no
1299   ac_save_IFS=$IFS; IFS=$ac_path_separator
1300 ac_dummy="$PATH"
1301 for ac_dir in $ac_dummy; do
1302   IFS=$ac_save_IFS
1303   test -z "$ac_dir" && ac_dir=.
1304   $as_executable_p "$ac_dir/$ac_word" || continue
1305 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1306   ac_prog_rejected=yes
1307   continue
1308 fi
1309 ac_cv_prog_CC="cc"
1310 echo "$as_me:1310: found $ac_dir/$ac_word" >&5
1311 break
1312 done
1313
1314 if test $ac_prog_rejected = yes; then
1315   # We found a bogon in the path, so make sure we never use it.
1316   set dummy $ac_cv_prog_CC
1317   shift
1318   if test $# != 0; then
1319     # We chose a different compiler from the bogus one.
1320     # However, it has the same basename, so the bogon will be chosen
1321     # first if we set CC to just the basename; use the full file name.
1322     shift
1323     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1324     shift
1325     ac_cv_prog_CC="$@"
1326   fi
1327 fi
1328 fi
1329 fi
1330 CC=$ac_cv_prog_CC
1331 if test -n "$CC"; then
1332   echo "$as_me:1332: result: $CC" >&5
1333 echo "${ECHO_T}$CC" >&6
1334 else
1335   echo "$as_me:1335: result: no" >&5
1336 echo "${ECHO_T}no" >&6
1337 fi
1338
1339 fi
1340 if test -z "$CC"; then
1341   if test -n "$ac_tool_prefix"; then
1342   for ac_prog in cl
1343   do
1344     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1345 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1346 echo "$as_me:1346: checking for $ac_word" >&5
1347 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1348 if test "${ac_cv_prog_CC+set}" = set; then
1349   echo $ECHO_N "(cached) $ECHO_C" >&6
1350 else
1351   if test -n "$CC"; then
1352   ac_cv_prog_CC="$CC" # Let the user override the test.
1353 else
1354   ac_save_IFS=$IFS; IFS=$ac_path_separator
1355 ac_dummy="$PATH"
1356 for ac_dir in $ac_dummy; do
1357   IFS=$ac_save_IFS
1358   test -z "$ac_dir" && ac_dir=.
1359   $as_executable_p "$ac_dir/$ac_word" || continue
1360 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1361 echo "$as_me:1361: found $ac_dir/$ac_word" >&5
1362 break
1363 done
1364
1365 fi
1366 fi
1367 CC=$ac_cv_prog_CC
1368 if test -n "$CC"; then
1369   echo "$as_me:1369: result: $CC" >&5
1370 echo "${ECHO_T}$CC" >&6
1371 else
1372   echo "$as_me:1372: result: no" >&5
1373 echo "${ECHO_T}no" >&6
1374 fi
1375
1376     test -n "$CC" && break
1377   done
1378 fi
1379 if test -z "$CC"; then
1380   ac_ct_CC=$CC
1381   for ac_prog in cl
1382 do
1383   # Extract the first word of "$ac_prog", so it can be a program name with args.
1384 set dummy $ac_prog; ac_word=$2
1385 echo "$as_me:1385: checking for $ac_word" >&5
1386 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1387 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1388   echo $ECHO_N "(cached) $ECHO_C" >&6
1389 else
1390   if test -n "$ac_ct_CC"; then
1391   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1392 else
1393   ac_save_IFS=$IFS; IFS=$ac_path_separator
1394 ac_dummy="$PATH"
1395 for ac_dir in $ac_dummy; do
1396   IFS=$ac_save_IFS
1397   test -z "$ac_dir" && ac_dir=.
1398   $as_executable_p "$ac_dir/$ac_word" || continue
1399 ac_cv_prog_ac_ct_CC="$ac_prog"
1400 echo "$as_me:1400: found $ac_dir/$ac_word" >&5
1401 break
1402 done
1403
1404 fi
1405 fi
1406 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1407 if test -n "$ac_ct_CC"; then
1408   echo "$as_me:1408: result: $ac_ct_CC" >&5
1409 echo "${ECHO_T}$ac_ct_CC" >&6
1410 else
1411   echo "$as_me:1411: result: no" >&5
1412 echo "${ECHO_T}no" >&6
1413 fi
1414
1415   test -n "$ac_ct_CC" && break
1416 done
1417
1418   CC=$ac_ct_CC
1419 fi
1420
1421 fi
1422
1423 test -z "$CC" && { { echo "$as_me:1423: error: no acceptable cc found in \$PATH" >&5
1424 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1425    { (exit 1); exit 1; }; }
1426
1427 # Provide some information about the compiler.
1428 echo "$as_me:1428:" \
1429      "checking for C compiler version" >&5
1430 ac_compiler=`set X $ac_compile; echo $2`
1431 { (eval echo "$as_me:1431: \"$ac_compiler --version </dev/null >&5\"") >&5
1432   (eval $ac_compiler --version </dev/null >&5) 2>&5
1433   ac_status=$?
1434   echo "$as_me:1434: \$? = $ac_status" >&5
1435   (exit $ac_status); }
1436 { (eval echo "$as_me:1436: \"$ac_compiler -v </dev/null >&5\"") >&5
1437   (eval $ac_compiler -v </dev/null >&5) 2>&5
1438   ac_status=$?
1439   echo "$as_me:1439: \$? = $ac_status" >&5
1440   (exit $ac_status); }
1441 { (eval echo "$as_me:1441: \"$ac_compiler -V </dev/null >&5\"") >&5
1442   (eval $ac_compiler -V </dev/null >&5) 2>&5
1443   ac_status=$?
1444   echo "$as_me:1444: \$? = $ac_status" >&5
1445   (exit $ac_status); }
1446
1447 cat >conftest.$ac_ext <<_ACEOF
1448 #line 1448 "configure"
1449 #include "confdefs.h"
1450
1451 int
1452 main ()
1453 {
1454
1455   ;
1456   return 0;
1457 }
1458 _ACEOF
1459 ac_clean_files_save=$ac_clean_files
1460 ac_clean_files="$ac_clean_files a.out a.exe"
1461 # Try to create an executable without -o first, disregard a.out.
1462 # It will help us diagnose broken compilers, and finding out an intuition
1463 # of exeext.
1464 echo "$as_me:1464: checking for C compiler default output" >&5
1465 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1466 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1467 if { (eval echo "$as_me:1467: \"$ac_link_default\"") >&5
1468   (eval $ac_link_default) 2>&5
1469   ac_status=$?
1470   echo "$as_me:1470: \$? = $ac_status" >&5
1471   (exit $ac_status); }; then
1472   # Find the output, starting from the most likely.  This scheme is
1473 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1474 # resort.
1475 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1476                 ls a.out conftest 2>/dev/null;
1477                 ls a.* conftest.* 2>/dev/null`; do
1478   case $ac_file in
1479     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1480     a.out ) # We found the default executable, but exeext='' is most
1481             # certainly right.
1482             break;;
1483     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1484           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1485           export ac_cv_exeext
1486           break;;
1487     * ) break;;
1488   esac
1489 done
1490 else
1491   echo "$as_me: failed program was:" >&5
1492 cat conftest.$ac_ext >&5
1493 { { echo "$as_me:1493: error: C compiler cannot create executables" >&5
1494 echo "$as_me: error: C compiler cannot create executables" >&2;}
1495    { (exit 77); exit 77; }; }
1496 fi
1497
1498 ac_exeext=$ac_cv_exeext
1499 echo "$as_me:1499: result: $ac_file" >&5
1500 echo "${ECHO_T}$ac_file" >&6
1501
1502 # Check the compiler produces executables we can run.  If not, either
1503 # the compiler is broken, or we cross compile.
1504 echo "$as_me:1504: checking whether the C compiler works" >&5
1505 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1506 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1507 # If not cross compiling, check that we can run a simple program.
1508 if test "$cross_compiling" != yes; then
1509   if { ac_try='./$ac_file'
1510   { (eval echo "$as_me:1510: \"$ac_try\"") >&5
1511   (eval $ac_try) 2>&5
1512   ac_status=$?
1513   echo "$as_me:1513: \$? = $ac_status" >&5
1514   (exit $ac_status); }; }; then
1515     cross_compiling=no
1516   else
1517     if test "$cross_compiling" = maybe; then
1518         cross_compiling=yes
1519     else
1520         { { echo "$as_me:1520: error: cannot run C compiled programs.
1521 If you meant to cross compile, use \`--host'." >&5
1522 echo "$as_me: error: cannot run C compiled programs.
1523 If you meant to cross compile, use \`--host'." >&2;}
1524    { (exit 1); exit 1; }; }
1525     fi
1526   fi
1527 fi
1528 echo "$as_me:1528: result: yes" >&5
1529 echo "${ECHO_T}yes" >&6
1530
1531 rm -f a.out a.exe conftest$ac_cv_exeext
1532 ac_clean_files=$ac_clean_files_save
1533 # Check the compiler produces executables we can run.  If not, either
1534 # the compiler is broken, or we cross compile.
1535 echo "$as_me:1535: checking whether we are cross compiling" >&5
1536 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1537 echo "$as_me:1537: result: $cross_compiling" >&5
1538 echo "${ECHO_T}$cross_compiling" >&6
1539
1540 echo "$as_me:1540: checking for executable suffix" >&5
1541 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1542 if { (eval echo "$as_me:1542: \"$ac_link\"") >&5
1543   (eval $ac_link) 2>&5
1544   ac_status=$?
1545   echo "$as_me:1545: \$? = $ac_status" >&5
1546   (exit $ac_status); }; then
1547   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1548 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1549 # work properly (i.e., refer to `conftest.exe'), while it won't with
1550 # `rm'.
1551 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1552   case $ac_file in
1553     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1554     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1555           export ac_cv_exeext
1556           break;;
1557     * ) break;;
1558   esac
1559 done
1560 else
1561   { { echo "$as_me:1561: error: cannot compute EXEEXT: cannot compile and link" >&5
1562 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1563    { (exit 1); exit 1; }; }
1564 fi
1565
1566 rm -f conftest$ac_cv_exeext
1567 echo "$as_me:1567: result: $ac_cv_exeext" >&5
1568 echo "${ECHO_T}$ac_cv_exeext" >&6
1569
1570 rm -f conftest.$ac_ext
1571 EXEEXT=$ac_cv_exeext
1572 ac_exeext=$EXEEXT
1573 echo "$as_me:1573: checking for object suffix" >&5
1574 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1575 if test "${ac_cv_objext+set}" = set; then
1576   echo $ECHO_N "(cached) $ECHO_C" >&6
1577 else
1578   cat >conftest.$ac_ext <<_ACEOF
1579 #line 1579 "configure"
1580 #include "confdefs.h"
1581
1582 int
1583 main ()
1584 {
1585
1586   ;
1587   return 0;
1588 }
1589 _ACEOF
1590 rm -f conftest.o conftest.obj
1591 if { (eval echo "$as_me:1591: \"$ac_compile\"") >&5
1592   (eval $ac_compile) 2>&5
1593   ac_status=$?
1594   echo "$as_me:1594: \$? = $ac_status" >&5
1595   (exit $ac_status); }; then
1596   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1597   case $ac_file in
1598     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1599     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1600        break;;
1601   esac
1602 done
1603 else
1604   echo "$as_me: failed program was:" >&5
1605 cat conftest.$ac_ext >&5
1606 { { echo "$as_me:1606: error: cannot compute OBJEXT: cannot compile" >&5
1607 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1608    { (exit 1); exit 1; }; }
1609 fi
1610
1611 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1612 fi
1613 echo "$as_me:1613: result: $ac_cv_objext" >&5
1614 echo "${ECHO_T}$ac_cv_objext" >&6
1615 OBJEXT=$ac_cv_objext
1616 ac_objext=$OBJEXT
1617 echo "$as_me:1617: checking whether we are using the GNU C compiler" >&5
1618 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1619 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1620   echo $ECHO_N "(cached) $ECHO_C" >&6
1621 else
1622   cat >conftest.$ac_ext <<_ACEOF
1623 #line 1623 "configure"
1624 #include "confdefs.h"
1625
1626 int
1627 main ()
1628 {
1629 #ifndef __GNUC__
1630        choke me
1631 #endif
1632
1633   ;
1634   return 0;
1635 }
1636 _ACEOF
1637 rm -f conftest.$ac_objext
1638 if { (eval echo "$as_me:1638: \"$ac_compile\"") >&5
1639   (eval $ac_compile) 2>&5
1640   ac_status=$?
1641   echo "$as_me:1641: \$? = $ac_status" >&5
1642   (exit $ac_status); } &&
1643          { ac_try='test -s conftest.$ac_objext'
1644   { (eval echo "$as_me:1644: \"$ac_try\"") >&5
1645   (eval $ac_try) 2>&5
1646   ac_status=$?
1647   echo "$as_me:1647: \$? = $ac_status" >&5
1648   (exit $ac_status); }; }; then
1649   ac_compiler_gnu=yes
1650 else
1651   echo "$as_me: failed program was:" >&5
1652 cat conftest.$ac_ext >&5
1653 ac_compiler_gnu=no
1654 fi
1655 rm -f conftest.$ac_objext conftest.$ac_ext
1656 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1657
1658 fi
1659 echo "$as_me:1659: result: $ac_cv_c_compiler_gnu" >&5
1660 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1661 GCC=`test $ac_compiler_gnu = yes && echo yes`
1662 ac_test_CFLAGS=${CFLAGS+set}
1663 ac_save_CFLAGS=$CFLAGS
1664 CFLAGS="-g"
1665 echo "$as_me:1665: checking whether $CC accepts -g" >&5
1666 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1667 if test "${ac_cv_prog_cc_g+set}" = set; then
1668   echo $ECHO_N "(cached) $ECHO_C" >&6
1669 else
1670   cat >conftest.$ac_ext <<_ACEOF
1671 #line 1671 "configure"
1672 #include "confdefs.h"
1673
1674 int
1675 main ()
1676 {
1677
1678   ;
1679   return 0;
1680 }
1681 _ACEOF
1682 rm -f conftest.$ac_objext
1683 if { (eval echo "$as_me:1683: \"$ac_compile\"") >&5
1684   (eval $ac_compile) 2>&5
1685   ac_status=$?
1686   echo "$as_me:1686: \$? = $ac_status" >&5
1687   (exit $ac_status); } &&
1688          { ac_try='test -s conftest.$ac_objext'
1689   { (eval echo "$as_me:1689: \"$ac_try\"") >&5
1690   (eval $ac_try) 2>&5
1691   ac_status=$?
1692   echo "$as_me:1692: \$? = $ac_status" >&5
1693   (exit $ac_status); }; }; then
1694   ac_cv_prog_cc_g=yes
1695 else
1696   echo "$as_me: failed program was:" >&5
1697 cat conftest.$ac_ext >&5
1698 ac_cv_prog_cc_g=no
1699 fi
1700 rm -f conftest.$ac_objext conftest.$ac_ext
1701 fi
1702 echo "$as_me:1702: result: $ac_cv_prog_cc_g" >&5
1703 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1704 if test "$ac_test_CFLAGS" = set; then
1705   CFLAGS=$ac_save_CFLAGS
1706 elif test $ac_cv_prog_cc_g = yes; then
1707   if test "$GCC" = yes; then
1708     CFLAGS="-g -O2"
1709   else
1710     CFLAGS="-g"
1711   fi
1712 else
1713   if test "$GCC" = yes; then
1714     CFLAGS="-O2"
1715   else
1716     CFLAGS=
1717   fi
1718 fi
1719 # Some people use a C++ compiler to compile C.  Since we use `exit',
1720 # in C++ we need to declare it.  In case someone uses the same compiler
1721 # for both compiling C and C++ we need to have the C++ compiler decide
1722 # the declaration of exit, since it's the most demanding environment.
1723 cat >conftest.$ac_ext <<_ACEOF
1724 #ifndef __cplusplus
1725   choke me
1726 #endif
1727 _ACEOF
1728 rm -f conftest.$ac_objext
1729 if { (eval echo "$as_me:1729: \"$ac_compile\"") >&5
1730   (eval $ac_compile) 2>&5
1731   ac_status=$?
1732   echo "$as_me:1732: \$? = $ac_status" >&5
1733   (exit $ac_status); } &&
1734          { ac_try='test -s conftest.$ac_objext'
1735   { (eval echo "$as_me:1735: \"$ac_try\"") >&5
1736   (eval $ac_try) 2>&5
1737   ac_status=$?
1738   echo "$as_me:1738: \$? = $ac_status" >&5
1739   (exit $ac_status); }; }; then
1740   for ac_declaration in \
1741    ''\
1742    '#include <stdlib.h>' \
1743    'extern "C" void std::exit (int) throw (); using std::exit;' \
1744    'extern "C" void std::exit (int); using std::exit;' \
1745    'extern "C" void exit (int) throw ();' \
1746    'extern "C" void exit (int);' \
1747    'void exit (int);'
1748 do
1749   cat >conftest.$ac_ext <<_ACEOF
1750 #line 1750 "configure"
1751 #include "confdefs.h"
1752 #include <stdlib.h>
1753 $ac_declaration
1754 int
1755 main ()
1756 {
1757 exit (42);
1758   ;
1759   return 0;
1760 }
1761 _ACEOF
1762 rm -f conftest.$ac_objext
1763 if { (eval echo "$as_me:1763: \"$ac_compile\"") >&5
1764   (eval $ac_compile) 2>&5
1765   ac_status=$?
1766   echo "$as_me:1766: \$? = $ac_status" >&5
1767   (exit $ac_status); } &&
1768          { ac_try='test -s conftest.$ac_objext'
1769   { (eval echo "$as_me:1769: \"$ac_try\"") >&5
1770   (eval $ac_try) 2>&5
1771   ac_status=$?
1772   echo "$as_me:1772: \$? = $ac_status" >&5
1773   (exit $ac_status); }; }; then
1774   :
1775 else
1776   echo "$as_me: failed program was:" >&5
1777 cat conftest.$ac_ext >&5
1778 continue
1779 fi
1780 rm -f conftest.$ac_objext conftest.$ac_ext
1781   cat >conftest.$ac_ext <<_ACEOF
1782 #line 1782 "configure"
1783 #include "confdefs.h"
1784 $ac_declaration
1785 int
1786 main ()
1787 {
1788 exit (42);
1789   ;
1790   return 0;
1791 }
1792 _ACEOF
1793 rm -f conftest.$ac_objext
1794 if { (eval echo "$as_me:1794: \"$ac_compile\"") >&5
1795   (eval $ac_compile) 2>&5
1796   ac_status=$?
1797   echo "$as_me:1797: \$? = $ac_status" >&5
1798   (exit $ac_status); } &&
1799          { ac_try='test -s conftest.$ac_objext'
1800   { (eval echo "$as_me:1800: \"$ac_try\"") >&5
1801   (eval $ac_try) 2>&5
1802   ac_status=$?
1803   echo "$as_me:1803: \$? = $ac_status" >&5
1804   (exit $ac_status); }; }; then
1805   break
1806 else
1807   echo "$as_me: failed program was:" >&5
1808 cat conftest.$ac_ext >&5
1809 fi
1810 rm -f conftest.$ac_objext conftest.$ac_ext
1811 done
1812 rm -rf conftest*
1813 if test -n "$ac_declaration"; then
1814   echo '#ifdef __cplusplus' >>confdefs.h
1815   echo $ac_declaration      >>confdefs.h
1816   echo '#endif'             >>confdefs.h
1817 fi
1818
1819 else
1820   echo "$as_me: failed program was:" >&5
1821 cat conftest.$ac_ext >&5
1822 fi
1823 rm -f conftest.$ac_objext conftest.$ac_ext
1824 ac_ext=c
1825 ac_cpp='$CPP $CPPFLAGS'
1826 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1827 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1828 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1829 ac_main_return=return
1830
1831 GCC_VERSION=none
1832 if test "$GCC" = yes ; then
1833         echo "$as_me:1833: checking version of $CC" >&5
1834 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1835         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.].*//'`"
1836         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1837         echo "$as_me:1837: result: $GCC_VERSION" >&5
1838 echo "${ECHO_T}$GCC_VERSION" >&6
1839 fi
1840
1841 echo "$as_me:1841: checking for $CC option to accept ANSI C" >&5
1842 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1843 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1844   echo $ECHO_N "(cached) $ECHO_C" >&6
1845 else
1846   ac_cv_prog_cc_stdc=no
1847 ac_save_CC=$CC
1848 cat >conftest.$ac_ext <<_ACEOF
1849 #line 1849 "configure"
1850 #include "confdefs.h"
1851 #include <stdarg.h>
1852 #include <stdio.h>
1853 #include <sys/types.h>
1854 #include <sys/stat.h>
1855 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1856 struct buf { int x; };
1857 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1858 static char *e (p, i)
1859      char **p;
1860      int i;
1861 {
1862   return p[i];
1863 }
1864 static char *f (char * (*g) (char **, int), char **p, ...)
1865 {
1866   char *s;
1867   va_list v;
1868   va_start (v,p);
1869   s = g (p, va_arg (v,int));
1870   va_end (v);
1871   return s;
1872 }
1873 int test (int i, double x);
1874 struct s1 {int (*f) (int a);};
1875 struct s2 {int (*f) (double a);};
1876 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1877 int argc;
1878 char **argv;
1879 int
1880 main ()
1881 {
1882 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1883   ;
1884   return 0;
1885 }
1886 _ACEOF
1887 # Don't try gcc -ansi; that turns off useful extensions and
1888 # breaks some systems' header files.
1889 # AIX                   -qlanglvl=ansi
1890 # Ultrix and OSF/1      -std1
1891 # HP-UX 10.20 and later -Ae
1892 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1893 # SVR4                  -Xc -D__EXTENSIONS__
1894 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1895 do
1896   CC="$ac_save_CC $ac_arg"
1897   rm -f conftest.$ac_objext
1898 if { (eval echo "$as_me:1898: \"$ac_compile\"") >&5
1899   (eval $ac_compile) 2>&5
1900   ac_status=$?
1901   echo "$as_me:1901: \$? = $ac_status" >&5
1902   (exit $ac_status); } &&
1903          { ac_try='test -s conftest.$ac_objext'
1904   { (eval echo "$as_me:1904: \"$ac_try\"") >&5
1905   (eval $ac_try) 2>&5
1906   ac_status=$?
1907   echo "$as_me:1907: \$? = $ac_status" >&5
1908   (exit $ac_status); }; }; then
1909   ac_cv_prog_cc_stdc=$ac_arg
1910 break
1911 else
1912   echo "$as_me: failed program was:" >&5
1913 cat conftest.$ac_ext >&5
1914 fi
1915 rm -f conftest.$ac_objext
1916 done
1917 rm -f conftest.$ac_ext conftest.$ac_objext
1918 CC=$ac_save_CC
1919
1920 fi
1921
1922 case "x$ac_cv_prog_cc_stdc" in
1923   x|xno)
1924     echo "$as_me:1924: result: none needed" >&5
1925 echo "${ECHO_T}none needed" >&6 ;;
1926   *)
1927     echo "$as_me:1927: result: $ac_cv_prog_cc_stdc" >&5
1928 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1929     CC="$CC $ac_cv_prog_cc_stdc" ;;
1930 esac
1931
1932 # This should have been defined by AC_PROG_CC
1933 : ${CC:=cc}
1934
1935 echo "$as_me:1935: checking \$CC variable" >&5
1936 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1937 case "$CC" in #(vi
1938 *[\ \   ]-[IUD]*)
1939         echo "$as_me:1939: result: broken" >&5
1940 echo "${ECHO_T}broken" >&6
1941         { echo "$as_me:1941: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1942 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1943         # humor him...
1944         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
1945         CC=`echo "$CC" | sed -e 's/[    ].*//'`
1946
1947 cf_fix_cppflags=no
1948 cf_new_cflags=
1949 cf_new_cppflags=
1950 cf_new_extra_cppflags=
1951
1952 for cf_add_cflags in $cf_flags
1953 do
1954 case $cf_fix_cppflags in
1955 no)
1956         case $cf_add_cflags in #(vi
1957         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1958                 case $cf_add_cflags in
1959                 -D*)
1960                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1961
1962                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1963                                 && test -z "${cf_tst_cflags}" \
1964                                 && cf_fix_cppflags=yes
1965
1966                         if test $cf_fix_cppflags = yes ; then
1967                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1968                                 continue
1969                         elif test "${cf_tst_cflags}" = "\"'" ; then
1970                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1971                                 continue
1972                         fi
1973                         ;;
1974                 esac
1975                 case "$CPPFLAGS" in
1976                 *$cf_add_cflags) #(vi
1977                         ;;
1978                 *) #(vi
1979                         case $cf_add_cflags in #(vi
1980                         -D*)
1981                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1982
1983 CPPFLAGS=`echo "$CPPFLAGS" | \
1984         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1985                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1986
1987                                 ;;
1988                         esac
1989                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1990                         ;;
1991                 esac
1992                 ;;
1993         *)
1994                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1995                 ;;
1996         esac
1997         ;;
1998 yes)
1999         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2000
2001         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2002
2003         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2004                 && test -z "${cf_tst_cflags}" \
2005                 && cf_fix_cppflags=no
2006         ;;
2007 esac
2008 done
2009
2010 if test -n "$cf_new_cflags" ; then
2011
2012         CFLAGS="$CFLAGS $cf_new_cflags"
2013 fi
2014
2015 if test -n "$cf_new_cppflags" ; then
2016
2017         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2018 fi
2019
2020 if test -n "$cf_new_extra_cppflags" ; then
2021
2022         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2023 fi
2024
2025         ;;
2026 *)
2027         echo "$as_me:2027: result: ok" >&5
2028 echo "${ECHO_T}ok" >&6
2029         ;;
2030 esac
2031
2032 ac_ext=c
2033 ac_cpp='$CPP $CPPFLAGS'
2034 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2035 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2036 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2037 ac_main_return=return
2038 echo "$as_me:2038: checking how to run the C preprocessor" >&5
2039 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2040 # On Suns, sometimes $CPP names a directory.
2041 if test -n "$CPP" && test -d "$CPP"; then
2042   CPP=
2043 fi
2044 if test -z "$CPP"; then
2045   if test "${ac_cv_prog_CPP+set}" = set; then
2046   echo $ECHO_N "(cached) $ECHO_C" >&6
2047 else
2048       # Double quotes because CPP needs to be expanded
2049     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2050     do
2051       ac_preproc_ok=false
2052 for ac_c_preproc_warn_flag in '' yes
2053 do
2054   # Use a header file that comes with gcc, so configuring glibc
2055   # with a fresh cross-compiler works.
2056   # On the NeXT, cc -E runs the code through the compiler's parser,
2057   # not just through cpp. "Syntax error" is here to catch this case.
2058   cat >conftest.$ac_ext <<_ACEOF
2059 #line 2059 "configure"
2060 #include "confdefs.h"
2061 #include <assert.h>
2062                      Syntax error
2063 _ACEOF
2064 if { (eval echo "$as_me:2064: \"$ac_cpp conftest.$ac_ext\"") >&5
2065   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2066   ac_status=$?
2067   egrep -v '^ *\+' conftest.er1 >conftest.err
2068   rm -f conftest.er1
2069   cat conftest.err >&5
2070   echo "$as_me:2070: \$? = $ac_status" >&5
2071   (exit $ac_status); } >/dev/null; then
2072   if test -s conftest.err; then
2073     ac_cpp_err=$ac_c_preproc_warn_flag
2074   else
2075     ac_cpp_err=
2076   fi
2077 else
2078   ac_cpp_err=yes
2079 fi
2080 if test -z "$ac_cpp_err"; then
2081   :
2082 else
2083   echo "$as_me: failed program was:" >&5
2084   cat conftest.$ac_ext >&5
2085   # Broken: fails on valid input.
2086 continue
2087 fi
2088 rm -f conftest.err conftest.$ac_ext
2089
2090   # OK, works on sane cases.  Now check whether non-existent headers
2091   # can be detected and how.
2092   cat >conftest.$ac_ext <<_ACEOF
2093 #line 2093 "configure"
2094 #include "confdefs.h"
2095 #include <ac_nonexistent.h>
2096 _ACEOF
2097 if { (eval echo "$as_me:2097: \"$ac_cpp conftest.$ac_ext\"") >&5
2098   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2099   ac_status=$?
2100   egrep -v '^ *\+' conftest.er1 >conftest.err
2101   rm -f conftest.er1
2102   cat conftest.err >&5
2103   echo "$as_me:2103: \$? = $ac_status" >&5
2104   (exit $ac_status); } >/dev/null; then
2105   if test -s conftest.err; then
2106     ac_cpp_err=$ac_c_preproc_warn_flag
2107   else
2108     ac_cpp_err=
2109   fi
2110 else
2111   ac_cpp_err=yes
2112 fi
2113 if test -z "$ac_cpp_err"; then
2114   # Broken: success on invalid input.
2115 continue
2116 else
2117   echo "$as_me: failed program was:" >&5
2118   cat conftest.$ac_ext >&5
2119   # Passes both tests.
2120 ac_preproc_ok=:
2121 break
2122 fi
2123 rm -f conftest.err conftest.$ac_ext
2124
2125 done
2126 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2127 rm -f conftest.err conftest.$ac_ext
2128 if $ac_preproc_ok; then
2129   break
2130 fi
2131
2132     done
2133     ac_cv_prog_CPP=$CPP
2134
2135 fi
2136   CPP=$ac_cv_prog_CPP
2137 else
2138   ac_cv_prog_CPP=$CPP
2139 fi
2140 echo "$as_me:2140: result: $CPP" >&5
2141 echo "${ECHO_T}$CPP" >&6
2142 ac_preproc_ok=false
2143 for ac_c_preproc_warn_flag in '' yes
2144 do
2145   # Use a header file that comes with gcc, so configuring glibc
2146   # with a fresh cross-compiler works.
2147   # On the NeXT, cc -E runs the code through the compiler's parser,
2148   # not just through cpp. "Syntax error" is here to catch this case.
2149   cat >conftest.$ac_ext <<_ACEOF
2150 #line 2150 "configure"
2151 #include "confdefs.h"
2152 #include <assert.h>
2153                      Syntax error
2154 _ACEOF
2155 if { (eval echo "$as_me:2155: \"$ac_cpp conftest.$ac_ext\"") >&5
2156   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2157   ac_status=$?
2158   egrep -v '^ *\+' conftest.er1 >conftest.err
2159   rm -f conftest.er1
2160   cat conftest.err >&5
2161   echo "$as_me:2161: \$? = $ac_status" >&5
2162   (exit $ac_status); } >/dev/null; then
2163   if test -s conftest.err; then
2164     ac_cpp_err=$ac_c_preproc_warn_flag
2165   else
2166     ac_cpp_err=
2167   fi
2168 else
2169   ac_cpp_err=yes
2170 fi
2171 if test -z "$ac_cpp_err"; then
2172   :
2173 else
2174   echo "$as_me: failed program was:" >&5
2175   cat conftest.$ac_ext >&5
2176   # Broken: fails on valid input.
2177 continue
2178 fi
2179 rm -f conftest.err conftest.$ac_ext
2180
2181   # OK, works on sane cases.  Now check whether non-existent headers
2182   # can be detected and how.
2183   cat >conftest.$ac_ext <<_ACEOF
2184 #line 2184 "configure"
2185 #include "confdefs.h"
2186 #include <ac_nonexistent.h>
2187 _ACEOF
2188 if { (eval echo "$as_me:2188: \"$ac_cpp conftest.$ac_ext\"") >&5
2189   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2190   ac_status=$?
2191   egrep -v '^ *\+' conftest.er1 >conftest.err
2192   rm -f conftest.er1
2193   cat conftest.err >&5
2194   echo "$as_me:2194: \$? = $ac_status" >&5
2195   (exit $ac_status); } >/dev/null; then
2196   if test -s conftest.err; then
2197     ac_cpp_err=$ac_c_preproc_warn_flag
2198   else
2199     ac_cpp_err=
2200   fi
2201 else
2202   ac_cpp_err=yes
2203 fi
2204 if test -z "$ac_cpp_err"; then
2205   # Broken: success on invalid input.
2206 continue
2207 else
2208   echo "$as_me: failed program was:" >&5
2209   cat conftest.$ac_ext >&5
2210   # Passes both tests.
2211 ac_preproc_ok=:
2212 break
2213 fi
2214 rm -f conftest.err conftest.$ac_ext
2215
2216 done
2217 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2218 rm -f conftest.err conftest.$ac_ext
2219 if $ac_preproc_ok; then
2220   :
2221 else
2222   { { echo "$as_me:2222: error: C preprocessor \"$CPP\" fails sanity check" >&5
2223 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2224    { (exit 1); exit 1; }; }
2225 fi
2226
2227 ac_ext=c
2228 ac_cpp='$CPP $CPPFLAGS'
2229 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2230 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2231 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2232 ac_main_return=return
2233
2234 for ac_prog in mawk gawk nawk awk
2235 do
2236   # Extract the first word of "$ac_prog", so it can be a program name with args.
2237 set dummy $ac_prog; ac_word=$2
2238 echo "$as_me:2238: checking for $ac_word" >&5
2239 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2240 if test "${ac_cv_prog_AWK+set}" = set; then
2241   echo $ECHO_N "(cached) $ECHO_C" >&6
2242 else
2243   if test -n "$AWK"; then
2244   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2245 else
2246   ac_save_IFS=$IFS; IFS=$ac_path_separator
2247 ac_dummy="$PATH"
2248 for ac_dir in $ac_dummy; do
2249   IFS=$ac_save_IFS
2250   test -z "$ac_dir" && ac_dir=.
2251   $as_executable_p "$ac_dir/$ac_word" || continue
2252 ac_cv_prog_AWK="$ac_prog"
2253 echo "$as_me:2253: found $ac_dir/$ac_word" >&5
2254 break
2255 done
2256
2257 fi
2258 fi
2259 AWK=$ac_cv_prog_AWK
2260 if test -n "$AWK"; then
2261   echo "$as_me:2261: result: $AWK" >&5
2262 echo "${ECHO_T}$AWK" >&6
2263 else
2264   echo "$as_me:2264: result: no" >&5
2265 echo "${ECHO_T}no" >&6
2266 fi
2267
2268   test -n "$AWK" && break
2269 done
2270
2271 # Find a good install program.  We prefer a C program (faster),
2272 # so one script is as good as another.  But avoid the broken or
2273 # incompatible versions:
2274 # SysV /etc/install, /usr/sbin/install
2275 # SunOS /usr/etc/install
2276 # IRIX /sbin/install
2277 # AIX /bin/install
2278 # AmigaOS /C/install, which installs bootblocks on floppy discs
2279 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2280 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2281 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2282 # ./install, which can be erroneously created by make from ./install.sh.
2283 echo "$as_me:2283: checking for a BSD compatible install" >&5
2284 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2285 if test -z "$INSTALL"; then
2286 if test "${ac_cv_path_install+set}" = set; then
2287   echo $ECHO_N "(cached) $ECHO_C" >&6
2288 else
2289     ac_save_IFS=$IFS; IFS=$ac_path_separator
2290   for ac_dir in $PATH; do
2291     IFS=$ac_save_IFS
2292     # Account for people who put trailing slashes in PATH elements.
2293     case $ac_dir/ in
2294     / | ./ | .// | /cC/* \
2295     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2296     | /usr/ucb/* ) ;;
2297     *)
2298       # OSF1 and SCO ODT 3.0 have their own names for install.
2299       # Don't use installbsd from OSF since it installs stuff as root
2300       # by default.
2301       for ac_prog in ginstall scoinst install; do
2302         if $as_executable_p "$ac_dir/$ac_prog"; then
2303           if test $ac_prog = install &&
2304             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2305             # AIX install.  It has an incompatible calling convention.
2306             :
2307           elif test $ac_prog = install &&
2308             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2309             # program-specific install script used by HP pwplus--don't use.
2310             :
2311           else
2312             ac_cv_path_install="$ac_dir/$ac_prog -c"
2313             break 2
2314           fi
2315         fi
2316       done
2317       ;;
2318     esac
2319   done
2320
2321 fi
2322   if test "${ac_cv_path_install+set}" = set; then
2323     INSTALL=$ac_cv_path_install
2324   else
2325     # As a last resort, use the slow shell script.  We don't cache a
2326     # path for INSTALL within a source directory, because that will
2327     # break other packages using the cache if that directory is
2328     # removed, or if the path is relative.
2329     INSTALL=$ac_install_sh
2330   fi
2331 fi
2332 echo "$as_me:2332: result: $INSTALL" >&5
2333 echo "${ECHO_T}$INSTALL" >&6
2334
2335 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2336 # It thinks the first close brace ends the variable substitution.
2337 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2338
2339 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2340
2341 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2342
2343 case $INSTALL in
2344 /*)
2345   ;;
2346 *)
2347   cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2348   test -z "$cf_dir" && cf_dir=.
2349   INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2350   ;;
2351 esac
2352
2353 for ac_prog in tdlint lint alint splint lclint
2354 do
2355   # Extract the first word of "$ac_prog", so it can be a program name with args.
2356 set dummy $ac_prog; ac_word=$2
2357 echo "$as_me:2357: checking for $ac_word" >&5
2358 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2359 if test "${ac_cv_prog_LINT+set}" = set; then
2360   echo $ECHO_N "(cached) $ECHO_C" >&6
2361 else
2362   if test -n "$LINT"; then
2363   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2364 else
2365   ac_save_IFS=$IFS; IFS=$ac_path_separator
2366 ac_dummy="$PATH"
2367 for ac_dir in $ac_dummy; do
2368   IFS=$ac_save_IFS
2369   test -z "$ac_dir" && ac_dir=.
2370   $as_executable_p "$ac_dir/$ac_word" || continue
2371 ac_cv_prog_LINT="$ac_prog"
2372 echo "$as_me:2372: found $ac_dir/$ac_word" >&5
2373 break
2374 done
2375
2376 fi
2377 fi
2378 LINT=$ac_cv_prog_LINT
2379 if test -n "$LINT"; then
2380   echo "$as_me:2380: result: $LINT" >&5
2381 echo "${ECHO_T}$LINT" >&6
2382 else
2383   echo "$as_me:2383: result: no" >&5
2384 echo "${ECHO_T}no" >&6
2385 fi
2386
2387   test -n "$LINT" && break
2388 done
2389
2390 echo "$as_me:2390: checking if filesystem supports mixed-case filenames" >&5
2391 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2392 if test "${cf_cv_mixedcase+set}" = set; then
2393   echo $ECHO_N "(cached) $ECHO_C" >&6
2394 else
2395
2396 if test "$cross_compiling" = yes ; then
2397         case $target_alias in #(vi
2398         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) #(vi
2399                 cf_cv_mixedcase=no
2400                 ;;
2401         *)
2402                 cf_cv_mixedcase=yes
2403                 ;;
2404         esac
2405 else
2406         rm -f conftest CONFTEST
2407         echo test >conftest
2408         if test -f CONFTEST ; then
2409                 cf_cv_mixedcase=no
2410         else
2411                 cf_cv_mixedcase=yes
2412         fi
2413         rm -f conftest CONFTEST
2414 fi
2415
2416 fi
2417 echo "$as_me:2417: result: $cf_cv_mixedcase" >&5
2418 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2419 test "$cf_cv_mixedcase" = yes &&
2420 cat >>confdefs.h <<\EOF
2421 #define MIXEDCASE_FILENAMES 1
2422 EOF
2423
2424 for ac_prog in exctags ctags
2425 do
2426   # Extract the first word of "$ac_prog", so it can be a program name with args.
2427 set dummy $ac_prog; ac_word=$2
2428 echo "$as_me:2428: checking for $ac_word" >&5
2429 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2430 if test "${ac_cv_prog_CTAGS+set}" = set; then
2431   echo $ECHO_N "(cached) $ECHO_C" >&6
2432 else
2433   if test -n "$CTAGS"; then
2434   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2435 else
2436   ac_save_IFS=$IFS; IFS=$ac_path_separator
2437 ac_dummy="$PATH"
2438 for ac_dir in $ac_dummy; do
2439   IFS=$ac_save_IFS
2440   test -z "$ac_dir" && ac_dir=.
2441   $as_executable_p "$ac_dir/$ac_word" || continue
2442 ac_cv_prog_CTAGS="$ac_prog"
2443 echo "$as_me:2443: found $ac_dir/$ac_word" >&5
2444 break
2445 done
2446
2447 fi
2448 fi
2449 CTAGS=$ac_cv_prog_CTAGS
2450 if test -n "$CTAGS"; then
2451   echo "$as_me:2451: result: $CTAGS" >&5
2452 echo "${ECHO_T}$CTAGS" >&6
2453 else
2454   echo "$as_me:2454: result: no" >&5
2455 echo "${ECHO_T}no" >&6
2456 fi
2457
2458   test -n "$CTAGS" && break
2459 done
2460
2461 for ac_prog in exetags etags
2462 do
2463   # Extract the first word of "$ac_prog", so it can be a program name with args.
2464 set dummy $ac_prog; ac_word=$2
2465 echo "$as_me:2465: checking for $ac_word" >&5
2466 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2467 if test "${ac_cv_prog_ETAGS+set}" = set; then
2468   echo $ECHO_N "(cached) $ECHO_C" >&6
2469 else
2470   if test -n "$ETAGS"; then
2471   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2472 else
2473   ac_save_IFS=$IFS; IFS=$ac_path_separator
2474 ac_dummy="$PATH"
2475 for ac_dir in $ac_dummy; do
2476   IFS=$ac_save_IFS
2477   test -z "$ac_dir" && ac_dir=.
2478   $as_executable_p "$ac_dir/$ac_word" || continue
2479 ac_cv_prog_ETAGS="$ac_prog"
2480 echo "$as_me:2480: found $ac_dir/$ac_word" >&5
2481 break
2482 done
2483
2484 fi
2485 fi
2486 ETAGS=$ac_cv_prog_ETAGS
2487 if test -n "$ETAGS"; then
2488   echo "$as_me:2488: result: $ETAGS" >&5
2489 echo "${ECHO_T}$ETAGS" >&6
2490 else
2491   echo "$as_me:2491: result: no" >&5
2492 echo "${ECHO_T}no" >&6
2493 fi
2494
2495   test -n "$ETAGS" && break
2496 done
2497
2498 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2499 set dummy ${CTAGS:-ctags}; ac_word=$2
2500 echo "$as_me:2500: checking for $ac_word" >&5
2501 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2502 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2503   echo $ECHO_N "(cached) $ECHO_C" >&6
2504 else
2505   if test -n "$MAKE_LOWER_TAGS"; then
2506   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2507 else
2508   ac_save_IFS=$IFS; IFS=$ac_path_separator
2509 ac_dummy="$PATH"
2510 for ac_dir in $ac_dummy; do
2511   IFS=$ac_save_IFS
2512   test -z "$ac_dir" && ac_dir=.
2513   $as_executable_p "$ac_dir/$ac_word" || continue
2514 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2515 echo "$as_me:2515: found $ac_dir/$ac_word" >&5
2516 break
2517 done
2518
2519   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2520 fi
2521 fi
2522 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2523 if test -n "$MAKE_LOWER_TAGS"; then
2524   echo "$as_me:2524: result: $MAKE_LOWER_TAGS" >&5
2525 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2526 else
2527   echo "$as_me:2527: result: no" >&5
2528 echo "${ECHO_T}no" >&6
2529 fi
2530
2531 if test "$cf_cv_mixedcase" = yes ; then
2532         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2533 set dummy ${ETAGS:-etags}; ac_word=$2
2534 echo "$as_me:2534: checking for $ac_word" >&5
2535 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2536 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2537   echo $ECHO_N "(cached) $ECHO_C" >&6
2538 else
2539   if test -n "$MAKE_UPPER_TAGS"; then
2540   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2541 else
2542   ac_save_IFS=$IFS; IFS=$ac_path_separator
2543 ac_dummy="$PATH"
2544 for ac_dir in $ac_dummy; do
2545   IFS=$ac_save_IFS
2546   test -z "$ac_dir" && ac_dir=.
2547   $as_executable_p "$ac_dir/$ac_word" || continue
2548 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2549 echo "$as_me:2549: found $ac_dir/$ac_word" >&5
2550 break
2551 done
2552
2553   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2554 fi
2555 fi
2556 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2557 if test -n "$MAKE_UPPER_TAGS"; then
2558   echo "$as_me:2558: result: $MAKE_UPPER_TAGS" >&5
2559 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2560 else
2561   echo "$as_me:2561: result: no" >&5
2562 echo "${ECHO_T}no" >&6
2563 fi
2564
2565 else
2566         MAKE_UPPER_TAGS=no
2567 fi
2568
2569 if test "$MAKE_UPPER_TAGS" = yes ; then
2570         MAKE_UPPER_TAGS=
2571 else
2572         MAKE_UPPER_TAGS="#"
2573 fi
2574
2575 if test "$MAKE_LOWER_TAGS" = yes ; then
2576         MAKE_LOWER_TAGS=
2577 else
2578         MAKE_LOWER_TAGS="#"
2579 fi
2580
2581 echo "$as_me:2581: checking if -lm needed for math functions" >&5
2582 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2583 if test "${cf_cv_need_libm+set}" = set; then
2584   echo $ECHO_N "(cached) $ECHO_C" >&6
2585 else
2586
2587         cat >conftest.$ac_ext <<_ACEOF
2588 #line 2588 "configure"
2589 #include "confdefs.h"
2590
2591         #include <stdio.h>
2592         #include <math.h>
2593
2594 int
2595 main ()
2596 {
2597 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2598   ;
2599   return 0;
2600 }
2601 _ACEOF
2602 rm -f conftest.$ac_objext conftest$ac_exeext
2603 if { (eval echo "$as_me:2603: \"$ac_link\"") >&5
2604   (eval $ac_link) 2>&5
2605   ac_status=$?
2606   echo "$as_me:2606: \$? = $ac_status" >&5
2607   (exit $ac_status); } &&
2608          { ac_try='test -s conftest$ac_exeext'
2609   { (eval echo "$as_me:2609: \"$ac_try\"") >&5
2610   (eval $ac_try) 2>&5
2611   ac_status=$?
2612   echo "$as_me:2612: \$? = $ac_status" >&5
2613   (exit $ac_status); }; }; then
2614   cf_cv_need_libm=no
2615 else
2616   echo "$as_me: failed program was:" >&5
2617 cat conftest.$ac_ext >&5
2618 cf_cv_need_libm=yes
2619 fi
2620 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2621 fi
2622 echo "$as_me:2622: result: $cf_cv_need_libm" >&5
2623 echo "${ECHO_T}$cf_cv_need_libm" >&6
2624 if test "$cf_cv_need_libm" = yes
2625 then
2626 MATH_LIB=-lm
2627 fi
2628
2629 top_builddir=`pwd`
2630
2631 CC_G_OPT="-g"
2632 CC_SHARED_OPTS=unknown
2633 CPPFLAGS="$CPPFLAGS"
2634 DFT_DEP_SUFFIX=""
2635 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2636 DFT_UPR_MODEL="NORMAL"
2637 LD="ld"
2638 LDFLAGS_SHARED=""
2639 LDFLAGS_STATIC=""
2640 LD_MODEL=""
2641 LD_SHARED_OPTS=""
2642 LIBTOOL=""
2643 LIB_CLEAN=""
2644 LIB_COMPILE=""
2645 LIB_LINK='${CC}'
2646 LINK_TESTS=""
2647 LOCAL_LDFLAGS=""
2648 PTHREAD="-lm"
2649 TEST_ARGS=""
2650 TEST_DEPS=""
2651 TEST_LIBS=""
2652 TINFO_LDFLAGS=''
2653 TINFO_LIBS='$(LIBS_CURSES)'
2654 cf_cv_abi_version=""
2655 cf_cv_rel_version=""
2656 includesubdir=""
2657
2658 cf_cv_screen=curses
2659 cf_cv_libtype=
2660
2661 if test "$GCC" = yes
2662 then
2663 cat > conftest.i <<EOF
2664 #ifndef GCC_PRINTF
2665 #define GCC_PRINTF 0
2666 #endif
2667 #ifndef GCC_SCANF
2668 #define GCC_SCANF 0
2669 #endif
2670 #ifndef GCC_NORETURN
2671 #define GCC_NORETURN /* nothing */
2672 #endif
2673 #ifndef GCC_UNUSED
2674 #define GCC_UNUSED /* nothing */
2675 #endif
2676 EOF
2677 if test "$GCC" = yes
2678 then
2679         { echo "$as_me:2679: checking for $CC __attribute__ directives..." >&5
2680 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2681 cat > conftest.$ac_ext <<EOF
2682 #line 2682 "${as_me:-configure}"
2683 #include "confdefs.h"
2684 #include "conftest.h"
2685 #include "conftest.i"
2686 #if     GCC_PRINTF
2687 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2688 #else
2689 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2690 #endif
2691 #if     GCC_SCANF
2692 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2693 #else
2694 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2695 #endif
2696 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2697 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2698 extern void foo(void) GCC_NORETURN;
2699 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2700 EOF
2701         cf_printf_attribute=no
2702         cf_scanf_attribute=no
2703         for cf_attribute in scanf printf unused noreturn
2704         do
2705
2706 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2707
2708                 cf_directive="__attribute__(($cf_attribute))"
2709                 echo "checking for $CC $cf_directive" 1>&5
2710
2711                 case $cf_attribute in #(vi
2712                 printf) #(vi
2713                         cf_printf_attribute=yes
2714                         cat >conftest.h <<EOF
2715 #define GCC_$cf_ATTRIBUTE 1
2716 EOF
2717                         ;;
2718                 scanf) #(vi
2719                         cf_scanf_attribute=yes
2720                         cat >conftest.h <<EOF
2721 #define GCC_$cf_ATTRIBUTE 1
2722 EOF
2723                         ;;
2724                 *) #(vi
2725                         cat >conftest.h <<EOF
2726 #define GCC_$cf_ATTRIBUTE $cf_directive
2727 EOF
2728                         ;;
2729                 esac
2730
2731                 if { (eval echo "$as_me:2731: \"$ac_compile\"") >&5
2732   (eval $ac_compile) 2>&5
2733   ac_status=$?
2734   echo "$as_me:2734: \$? = $ac_status" >&5
2735   (exit $ac_status); }; then
2736                         test -n "$verbose" && echo "$as_me:2736: result: ... $cf_attribute" >&5
2737 echo "${ECHO_T}... $cf_attribute" >&6
2738                         cat conftest.h >>confdefs.h
2739                         case $cf_attribute in #(vi
2740                         noreturn) #(vi
2741
2742 cat >>confdefs.h <<EOF
2743 #define GCC_NORETURN $cf_directive
2744 EOF
2745
2746                                 ;;
2747                         printf) #(vi
2748                                 cf_value='/* nothing */'
2749                                 if test "$cf_printf_attribute" != no ; then
2750                                         cf_value='__attribute__((format(printf,fmt,var)))'
2751
2752 cat >>confdefs.h <<\EOF
2753 #define GCC_PRINTF 1
2754 EOF
2755
2756                                 fi
2757
2758 cat >>confdefs.h <<EOF
2759 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2760 EOF
2761
2762                                 ;;
2763                         scanf) #(vi
2764                                 cf_value='/* nothing */'
2765                                 if test "$cf_scanf_attribute" != no ; then
2766                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2767
2768 cat >>confdefs.h <<\EOF
2769 #define GCC_SCANF 1
2770 EOF
2771
2772                                 fi
2773
2774 cat >>confdefs.h <<EOF
2775 #define GCC_SCANFLIKE(fmt,var) $cf_value
2776 EOF
2777
2778                                 ;;
2779                         unused) #(vi
2780
2781 cat >>confdefs.h <<EOF
2782 #define GCC_UNUSED $cf_directive
2783 EOF
2784
2785                                 ;;
2786                         esac
2787                 fi
2788         done
2789 else
2790         fgrep define conftest.i >>confdefs.h
2791 fi
2792 rm -rf conftest*
2793 fi
2794
2795 cf_XOPEN_SOURCE=500
2796 cf_POSIX_C_SOURCE=199506L
2797 cf_xopen_source=
2798
2799 case $host_os in #(vi
2800 aix[4-7]*) #(vi
2801         cf_xopen_source="-D_ALL_SOURCE"
2802         ;;
2803 cygwin|msys) #(vi
2804         cf_XOPEN_SOURCE=600
2805         ;;
2806 darwin[0-8].*) #(vi
2807         cf_xopen_source="-D_APPLE_C_SOURCE"
2808         ;;
2809 darwin*) #(vi
2810         cf_xopen_source="-D_DARWIN_C_SOURCE"
2811         cf_XOPEN_SOURCE=
2812         ;;
2813 freebsd*|dragonfly*) #(vi
2814         # 5.x headers associate
2815         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2816         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2817         cf_POSIX_C_SOURCE=200112L
2818         cf_XOPEN_SOURCE=600
2819         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2820         ;;
2821 hpux11*) #(vi
2822         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2823         ;;
2824 hpux*) #(vi
2825         cf_xopen_source="-D_HPUX_SOURCE"
2826         ;;
2827 irix[56].*) #(vi
2828         cf_xopen_source="-D_SGI_SOURCE"
2829         cf_XOPEN_SOURCE=
2830         ;;
2831 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
2832
2833 echo "$as_me:2833: checking if we must define _GNU_SOURCE" >&5
2834 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2835 if test "${cf_cv_gnu_source+set}" = set; then
2836   echo $ECHO_N "(cached) $ECHO_C" >&6
2837 else
2838
2839 cat >conftest.$ac_ext <<_ACEOF
2840 #line 2840 "configure"
2841 #include "confdefs.h"
2842 #include <sys/types.h>
2843 int
2844 main ()
2845 {
2846
2847 #ifndef _XOPEN_SOURCE
2848 make an error
2849 #endif
2850   ;
2851   return 0;
2852 }
2853 _ACEOF
2854 rm -f conftest.$ac_objext
2855 if { (eval echo "$as_me:2855: \"$ac_compile\"") >&5
2856   (eval $ac_compile) 2>&5
2857   ac_status=$?
2858   echo "$as_me:2858: \$? = $ac_status" >&5
2859   (exit $ac_status); } &&
2860          { ac_try='test -s conftest.$ac_objext'
2861   { (eval echo "$as_me:2861: \"$ac_try\"") >&5
2862   (eval $ac_try) 2>&5
2863   ac_status=$?
2864   echo "$as_me:2864: \$? = $ac_status" >&5
2865   (exit $ac_status); }; }; then
2866   cf_cv_gnu_source=no
2867 else
2868   echo "$as_me: failed program was:" >&5
2869 cat conftest.$ac_ext >&5
2870 cf_save="$CPPFLAGS"
2871          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2872          cat >conftest.$ac_ext <<_ACEOF
2873 #line 2873 "configure"
2874 #include "confdefs.h"
2875 #include <sys/types.h>
2876 int
2877 main ()
2878 {
2879
2880 #ifdef _XOPEN_SOURCE
2881 make an error
2882 #endif
2883   ;
2884   return 0;
2885 }
2886 _ACEOF
2887 rm -f conftest.$ac_objext
2888 if { (eval echo "$as_me:2888: \"$ac_compile\"") >&5
2889   (eval $ac_compile) 2>&5
2890   ac_status=$?
2891   echo "$as_me:2891: \$? = $ac_status" >&5
2892   (exit $ac_status); } &&
2893          { ac_try='test -s conftest.$ac_objext'
2894   { (eval echo "$as_me:2894: \"$ac_try\"") >&5
2895   (eval $ac_try) 2>&5
2896   ac_status=$?
2897   echo "$as_me:2897: \$? = $ac_status" >&5
2898   (exit $ac_status); }; }; then
2899   cf_cv_gnu_source=no
2900 else
2901   echo "$as_me: failed program was:" >&5
2902 cat conftest.$ac_ext >&5
2903 cf_cv_gnu_source=yes
2904 fi
2905 rm -f conftest.$ac_objext conftest.$ac_ext
2906         CPPFLAGS="$cf_save"
2907
2908 fi
2909 rm -f conftest.$ac_objext conftest.$ac_ext
2910
2911 fi
2912 echo "$as_me:2912: result: $cf_cv_gnu_source" >&5
2913 echo "${ECHO_T}$cf_cv_gnu_source" >&6
2914 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2915
2916         ;;
2917 minix*) #(vi
2918         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
2919         ;;
2920 mirbsd*) #(vi
2921         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
2922         cf_XOPEN_SOURCE=
2923
2924 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2925
2926 cf_save_CFLAGS="$CFLAGS"
2927 cf_save_CPPFLAGS="$CPPFLAGS"
2928
2929 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2930         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2931                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2932
2933 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2934         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2935                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2936
2937 echo "$as_me:2937: checking if we should define _POSIX_C_SOURCE" >&5
2938 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
2939 if test "${cf_cv_posix_c_source+set}" = set; then
2940   echo $ECHO_N "(cached) $ECHO_C" >&6
2941 else
2942
2943 echo "${as_me:-configure}:2943: testing if the symbol is already defined go no further ..." 1>&5
2944
2945         cat >conftest.$ac_ext <<_ACEOF
2946 #line 2946 "configure"
2947 #include "confdefs.h"
2948 #include <sys/types.h>
2949 int
2950 main ()
2951 {
2952
2953 #ifndef _POSIX_C_SOURCE
2954 make an error
2955 #endif
2956   ;
2957   return 0;
2958 }
2959 _ACEOF
2960 rm -f conftest.$ac_objext
2961 if { (eval echo "$as_me:2961: \"$ac_compile\"") >&5
2962   (eval $ac_compile) 2>&5
2963   ac_status=$?
2964   echo "$as_me:2964: \$? = $ac_status" >&5
2965   (exit $ac_status); } &&
2966          { ac_try='test -s conftest.$ac_objext'
2967   { (eval echo "$as_me:2967: \"$ac_try\"") >&5
2968   (eval $ac_try) 2>&5
2969   ac_status=$?
2970   echo "$as_me:2970: \$? = $ac_status" >&5
2971   (exit $ac_status); }; }; then
2972   cf_cv_posix_c_source=no
2973 else
2974   echo "$as_me: failed program was:" >&5
2975 cat conftest.$ac_ext >&5
2976 cf_want_posix_source=no
2977          case .$cf_POSIX_C_SOURCE in #(vi
2978          .[12]??*) #(vi
2979                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2980                 ;;
2981          .2) #(vi
2982                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2983                 cf_want_posix_source=yes
2984                 ;;
2985          .*)
2986                 cf_want_posix_source=yes
2987                 ;;
2988          esac
2989          if test "$cf_want_posix_source" = yes ; then
2990                 cat >conftest.$ac_ext <<_ACEOF
2991 #line 2991 "configure"
2992 #include "confdefs.h"
2993 #include <sys/types.h>
2994 int
2995 main ()
2996 {
2997
2998 #ifdef _POSIX_SOURCE
2999 make an error
3000 #endif
3001   ;
3002   return 0;
3003 }
3004 _ACEOF
3005 rm -f conftest.$ac_objext
3006 if { (eval echo "$as_me:3006: \"$ac_compile\"") >&5
3007   (eval $ac_compile) 2>&5
3008   ac_status=$?
3009   echo "$as_me:3009: \$? = $ac_status" >&5
3010   (exit $ac_status); } &&
3011          { ac_try='test -s conftest.$ac_objext'
3012   { (eval echo "$as_me:3012: \"$ac_try\"") >&5
3013   (eval $ac_try) 2>&5
3014   ac_status=$?
3015   echo "$as_me:3015: \$? = $ac_status" >&5
3016   (exit $ac_status); }; }; then
3017   :
3018 else
3019   echo "$as_me: failed program was:" >&5
3020 cat conftest.$ac_ext >&5
3021 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3022 fi
3023 rm -f conftest.$ac_objext conftest.$ac_ext
3024          fi
3025
3026 echo "${as_me:-configure}:3026: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3027
3028          CFLAGS="$cf_trim_CFLAGS"
3029          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3030
3031 echo "${as_me:-configure}:3031: testing if the second compile does not leave our definition intact error ..." 1>&5
3032
3033          cat >conftest.$ac_ext <<_ACEOF
3034 #line 3034 "configure"
3035 #include "confdefs.h"
3036 #include <sys/types.h>
3037 int
3038 main ()
3039 {
3040
3041 #ifndef _POSIX_C_SOURCE
3042 make an error
3043 #endif
3044   ;
3045   return 0;
3046 }
3047 _ACEOF
3048 rm -f conftest.$ac_objext
3049 if { (eval echo "$as_me:3049: \"$ac_compile\"") >&5
3050   (eval $ac_compile) 2>&5
3051   ac_status=$?
3052   echo "$as_me:3052: \$? = $ac_status" >&5
3053   (exit $ac_status); } &&
3054          { ac_try='test -s conftest.$ac_objext'
3055   { (eval echo "$as_me:3055: \"$ac_try\"") >&5
3056   (eval $ac_try) 2>&5
3057   ac_status=$?
3058   echo "$as_me:3058: \$? = $ac_status" >&5
3059   (exit $ac_status); }; }; then
3060   :
3061 else
3062   echo "$as_me: failed program was:" >&5
3063 cat conftest.$ac_ext >&5
3064 cf_cv_posix_c_source=no
3065 fi
3066 rm -f conftest.$ac_objext conftest.$ac_ext
3067          CFLAGS="$cf_save_CFLAGS"
3068          CPPFLAGS="$cf_save_CPPFLAGS"
3069
3070 fi
3071 rm -f conftest.$ac_objext conftest.$ac_ext
3072
3073 fi
3074 echo "$as_me:3074: result: $cf_cv_posix_c_source" >&5
3075 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3076
3077 if test "$cf_cv_posix_c_source" != no ; then
3078         CFLAGS="$cf_trim_CFLAGS"
3079         CPPFLAGS="$cf_trim_CPPFLAGS"
3080
3081 cf_fix_cppflags=no
3082 cf_new_cflags=
3083 cf_new_cppflags=
3084 cf_new_extra_cppflags=
3085
3086 for cf_add_cflags in $cf_cv_posix_c_source
3087 do
3088 case $cf_fix_cppflags in
3089 no)
3090         case $cf_add_cflags in #(vi
3091         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3092                 case $cf_add_cflags in
3093                 -D*)
3094                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3095
3096                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3097                                 && test -z "${cf_tst_cflags}" \
3098                                 && cf_fix_cppflags=yes
3099
3100                         if test $cf_fix_cppflags = yes ; then
3101                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3102                                 continue
3103                         elif test "${cf_tst_cflags}" = "\"'" ; then
3104                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3105                                 continue
3106                         fi
3107                         ;;
3108                 esac
3109                 case "$CPPFLAGS" in
3110                 *$cf_add_cflags) #(vi
3111                         ;;
3112                 *) #(vi
3113                         case $cf_add_cflags in #(vi
3114                         -D*)
3115                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3116
3117 CPPFLAGS=`echo "$CPPFLAGS" | \
3118         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3119                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3120
3121                                 ;;
3122                         esac
3123                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3124                         ;;
3125                 esac
3126                 ;;
3127         *)
3128                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3129                 ;;
3130         esac
3131         ;;
3132 yes)
3133         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3134
3135         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3136
3137         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3138                 && test -z "${cf_tst_cflags}" \
3139                 && cf_fix_cppflags=no
3140         ;;
3141 esac
3142 done
3143
3144 if test -n "$cf_new_cflags" ; then
3145
3146         CFLAGS="$CFLAGS $cf_new_cflags"
3147 fi
3148
3149 if test -n "$cf_new_cppflags" ; then
3150
3151         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3152 fi
3153
3154 if test -n "$cf_new_extra_cppflags" ; then
3155
3156         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3157 fi
3158
3159 fi
3160
3161         ;;
3162 netbsd*) #(vi
3163         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3164         ;;
3165 openbsd[4-9]*) #(vi
3166         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3167         cf_xopen_source="-D_BSD_SOURCE"
3168         cf_XOPEN_SOURCE=600
3169         ;;
3170 openbsd*) #(vi
3171         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3172         ;;
3173 osf[45]*) #(vi
3174         cf_xopen_source="-D_OSF_SOURCE"
3175         ;;
3176 nto-qnx*) #(vi
3177         cf_xopen_source="-D_QNX_SOURCE"
3178         ;;
3179 sco*) #(vi
3180         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3181         ;;
3182 solaris2.*) #(vi
3183         cf_xopen_source="-D__EXTENSIONS__"
3184         cf_cv_xopen_source=broken
3185         ;;
3186 *)
3187
3188 echo "$as_me:3188: checking if we should define _XOPEN_SOURCE" >&5
3189 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3190 if test "${cf_cv_xopen_source+set}" = set; then
3191   echo $ECHO_N "(cached) $ECHO_C" >&6
3192 else
3193
3194         cat >conftest.$ac_ext <<_ACEOF
3195 #line 3195 "configure"
3196 #include "confdefs.h"
3197
3198 #include <stdlib.h>
3199 #include <string.h>
3200 #include <sys/types.h>
3201
3202 int
3203 main ()
3204 {
3205
3206 #ifndef _XOPEN_SOURCE
3207 make an error
3208 #endif
3209   ;
3210   return 0;
3211 }
3212 _ACEOF
3213 rm -f conftest.$ac_objext
3214 if { (eval echo "$as_me:3214: \"$ac_compile\"") >&5
3215   (eval $ac_compile) 2>&5
3216   ac_status=$?
3217   echo "$as_me:3217: \$? = $ac_status" >&5
3218   (exit $ac_status); } &&
3219          { ac_try='test -s conftest.$ac_objext'
3220   { (eval echo "$as_me:3220: \"$ac_try\"") >&5
3221   (eval $ac_try) 2>&5
3222   ac_status=$?
3223   echo "$as_me:3223: \$? = $ac_status" >&5
3224   (exit $ac_status); }; }; then
3225   cf_cv_xopen_source=no
3226 else
3227   echo "$as_me: failed program was:" >&5
3228 cat conftest.$ac_ext >&5
3229 cf_save="$CPPFLAGS"
3230          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3231          cat >conftest.$ac_ext <<_ACEOF
3232 #line 3232 "configure"
3233 #include "confdefs.h"
3234
3235 #include <stdlib.h>
3236 #include <string.h>
3237 #include <sys/types.h>
3238
3239 int
3240 main ()
3241 {
3242
3243 #ifdef _XOPEN_SOURCE
3244 make an error
3245 #endif
3246   ;
3247   return 0;
3248 }
3249 _ACEOF
3250 rm -f conftest.$ac_objext
3251 if { (eval echo "$as_me:3251: \"$ac_compile\"") >&5
3252   (eval $ac_compile) 2>&5
3253   ac_status=$?
3254   echo "$as_me:3254: \$? = $ac_status" >&5
3255   (exit $ac_status); } &&
3256          { ac_try='test -s conftest.$ac_objext'
3257   { (eval echo "$as_me:3257: \"$ac_try\"") >&5
3258   (eval $ac_try) 2>&5
3259   ac_status=$?
3260   echo "$as_me:3260: \$? = $ac_status" >&5
3261   (exit $ac_status); }; }; then
3262   cf_cv_xopen_source=no
3263 else
3264   echo "$as_me: failed program was:" >&5
3265 cat conftest.$ac_ext >&5
3266 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3267 fi
3268 rm -f conftest.$ac_objext conftest.$ac_ext
3269         CPPFLAGS="$cf_save"
3270
3271 fi
3272 rm -f conftest.$ac_objext conftest.$ac_ext
3273
3274 fi
3275 echo "$as_me:3275: result: $cf_cv_xopen_source" >&5
3276 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3277
3278 if test "$cf_cv_xopen_source" != no ; then
3279
3280 CFLAGS=`echo "$CFLAGS" | \
3281         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3282                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3283
3284 CPPFLAGS=`echo "$CPPFLAGS" | \
3285         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3286                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3287
3288         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3289
3290 cf_fix_cppflags=no
3291 cf_new_cflags=
3292 cf_new_cppflags=
3293 cf_new_extra_cppflags=
3294
3295 for cf_add_cflags in $cf_temp_xopen_source
3296 do
3297 case $cf_fix_cppflags in
3298 no)
3299         case $cf_add_cflags in #(vi
3300         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3301                 case $cf_add_cflags in
3302                 -D*)
3303                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3304
3305                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3306                                 && test -z "${cf_tst_cflags}" \
3307                                 && cf_fix_cppflags=yes
3308
3309                         if test $cf_fix_cppflags = yes ; then
3310                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3311                                 continue
3312                         elif test "${cf_tst_cflags}" = "\"'" ; then
3313                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3314                                 continue
3315                         fi
3316                         ;;
3317                 esac
3318                 case "$CPPFLAGS" in
3319                 *$cf_add_cflags) #(vi
3320                         ;;
3321                 *) #(vi
3322                         case $cf_add_cflags in #(vi
3323                         -D*)
3324                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3325
3326 CPPFLAGS=`echo "$CPPFLAGS" | \
3327         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3328                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3329
3330                                 ;;
3331                         esac
3332                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3333                         ;;
3334                 esac
3335                 ;;
3336         *)
3337                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3338                 ;;
3339         esac
3340         ;;
3341 yes)
3342         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3343
3344         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3345
3346         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3347                 && test -z "${cf_tst_cflags}" \
3348                 && cf_fix_cppflags=no
3349         ;;
3350 esac
3351 done
3352
3353 if test -n "$cf_new_cflags" ; then
3354
3355         CFLAGS="$CFLAGS $cf_new_cflags"
3356 fi
3357
3358 if test -n "$cf_new_cppflags" ; then
3359
3360         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3361 fi
3362
3363 if test -n "$cf_new_extra_cppflags" ; then
3364
3365         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3366 fi
3367
3368 fi
3369
3370 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3371
3372 cf_save_CFLAGS="$CFLAGS"
3373 cf_save_CPPFLAGS="$CPPFLAGS"
3374
3375 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3376         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3377                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3378
3379 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3380         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3381                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3382
3383 echo "$as_me:3383: checking if we should define _POSIX_C_SOURCE" >&5
3384 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3385 if test "${cf_cv_posix_c_source+set}" = set; then
3386   echo $ECHO_N "(cached) $ECHO_C" >&6
3387 else
3388
3389 echo "${as_me:-configure}:3389: testing if the symbol is already defined go no further ..." 1>&5
3390
3391         cat >conftest.$ac_ext <<_ACEOF
3392 #line 3392 "configure"
3393 #include "confdefs.h"
3394 #include <sys/types.h>
3395 int
3396 main ()
3397 {
3398
3399 #ifndef _POSIX_C_SOURCE
3400 make an error
3401 #endif
3402   ;
3403   return 0;
3404 }
3405 _ACEOF
3406 rm -f conftest.$ac_objext
3407 if { (eval echo "$as_me:3407: \"$ac_compile\"") >&5
3408   (eval $ac_compile) 2>&5
3409   ac_status=$?
3410   echo "$as_me:3410: \$? = $ac_status" >&5
3411   (exit $ac_status); } &&
3412          { ac_try='test -s conftest.$ac_objext'
3413   { (eval echo "$as_me:3413: \"$ac_try\"") >&5
3414   (eval $ac_try) 2>&5
3415   ac_status=$?
3416   echo "$as_me:3416: \$? = $ac_status" >&5
3417   (exit $ac_status); }; }; then
3418   cf_cv_posix_c_source=no
3419 else
3420   echo "$as_me: failed program was:" >&5
3421 cat conftest.$ac_ext >&5
3422 cf_want_posix_source=no
3423          case .$cf_POSIX_C_SOURCE in #(vi
3424          .[12]??*) #(vi
3425                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3426                 ;;
3427          .2) #(vi
3428                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3429                 cf_want_posix_source=yes
3430                 ;;
3431          .*)
3432                 cf_want_posix_source=yes
3433                 ;;
3434          esac
3435          if test "$cf_want_posix_source" = yes ; then
3436                 cat >conftest.$ac_ext <<_ACEOF
3437 #line 3437 "configure"
3438 #include "confdefs.h"
3439 #include <sys/types.h>
3440 int
3441 main ()
3442 {
3443
3444 #ifdef _POSIX_SOURCE
3445 make an error
3446 #endif
3447   ;
3448   return 0;
3449 }
3450 _ACEOF
3451 rm -f conftest.$ac_objext
3452 if { (eval echo "$as_me:3452: \"$ac_compile\"") >&5
3453   (eval $ac_compile) 2>&5
3454   ac_status=$?
3455   echo "$as_me:3455: \$? = $ac_status" >&5
3456   (exit $ac_status); } &&
3457          { ac_try='test -s conftest.$ac_objext'
3458   { (eval echo "$as_me:3458: \"$ac_try\"") >&5
3459   (eval $ac_try) 2>&5
3460   ac_status=$?
3461   echo "$as_me:3461: \$? = $ac_status" >&5
3462   (exit $ac_status); }; }; then
3463   :
3464 else
3465   echo "$as_me: failed program was:" >&5
3466 cat conftest.$ac_ext >&5
3467 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3468 fi
3469 rm -f conftest.$ac_objext conftest.$ac_ext
3470          fi
3471
3472 echo "${as_me:-configure}:3472: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3473
3474          CFLAGS="$cf_trim_CFLAGS"
3475          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3476
3477 echo "${as_me:-configure}:3477: testing if the second compile does not leave our definition intact error ..." 1>&5
3478
3479          cat >conftest.$ac_ext <<_ACEOF
3480 #line 3480 "configure"
3481 #include "confdefs.h"
3482 #include <sys/types.h>
3483 int
3484 main ()
3485 {
3486
3487 #ifndef _POSIX_C_SOURCE
3488 make an error
3489 #endif
3490   ;
3491   return 0;
3492 }
3493 _ACEOF
3494 rm -f conftest.$ac_objext
3495 if { (eval echo "$as_me:3495: \"$ac_compile\"") >&5
3496   (eval $ac_compile) 2>&5
3497   ac_status=$?
3498   echo "$as_me:3498: \$? = $ac_status" >&5
3499   (exit $ac_status); } &&
3500          { ac_try='test -s conftest.$ac_objext'
3501   { (eval echo "$as_me:3501: \"$ac_try\"") >&5
3502   (eval $ac_try) 2>&5
3503   ac_status=$?
3504   echo "$as_me:3504: \$? = $ac_status" >&5
3505   (exit $ac_status); }; }; then
3506   :
3507 else
3508   echo "$as_me: failed program was:" >&5
3509 cat conftest.$ac_ext >&5
3510 cf_cv_posix_c_source=no
3511 fi
3512 rm -f conftest.$ac_objext conftest.$ac_ext
3513          CFLAGS="$cf_save_CFLAGS"
3514          CPPFLAGS="$cf_save_CPPFLAGS"
3515
3516 fi
3517 rm -f conftest.$ac_objext conftest.$ac_ext
3518
3519 fi
3520 echo "$as_me:3520: result: $cf_cv_posix_c_source" >&5
3521 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3522
3523 if test "$cf_cv_posix_c_source" != no ; then
3524         CFLAGS="$cf_trim_CFLAGS"
3525         CPPFLAGS="$cf_trim_CPPFLAGS"
3526
3527 cf_fix_cppflags=no
3528 cf_new_cflags=
3529 cf_new_cppflags=
3530 cf_new_extra_cppflags=
3531
3532 for cf_add_cflags in $cf_cv_posix_c_source
3533 do
3534 case $cf_fix_cppflags in
3535 no)
3536         case $cf_add_cflags in #(vi
3537         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3538                 case $cf_add_cflags in
3539                 -D*)
3540                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3541
3542                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3543                                 && test -z "${cf_tst_cflags}" \
3544                                 && cf_fix_cppflags=yes
3545
3546                         if test $cf_fix_cppflags = yes ; then
3547                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3548                                 continue
3549                         elif test "${cf_tst_cflags}" = "\"'" ; then
3550                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3551                                 continue
3552                         fi
3553                         ;;
3554                 esac
3555                 case "$CPPFLAGS" in
3556                 *$cf_add_cflags) #(vi
3557                         ;;
3558                 *) #(vi
3559                         case $cf_add_cflags in #(vi
3560                         -D*)
3561                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3562
3563 CPPFLAGS=`echo "$CPPFLAGS" | \
3564         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3565                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3566
3567                                 ;;
3568                         esac
3569                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3570                         ;;
3571                 esac
3572                 ;;
3573         *)
3574                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3575                 ;;
3576         esac
3577         ;;
3578 yes)
3579         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3580
3581         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3582
3583         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3584                 && test -z "${cf_tst_cflags}" \
3585                 && cf_fix_cppflags=no
3586         ;;
3587 esac
3588 done
3589
3590 if test -n "$cf_new_cflags" ; then
3591
3592         CFLAGS="$CFLAGS $cf_new_cflags"
3593 fi
3594
3595 if test -n "$cf_new_cppflags" ; then
3596
3597         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3598 fi
3599
3600 if test -n "$cf_new_extra_cppflags" ; then
3601
3602         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3603 fi
3604
3605 fi
3606
3607         ;;
3608 esac
3609
3610 if test -n "$cf_xopen_source" ; then
3611
3612 cf_fix_cppflags=no
3613 cf_new_cflags=
3614 cf_new_cppflags=
3615 cf_new_extra_cppflags=
3616
3617 for cf_add_cflags in $cf_xopen_source
3618 do
3619 case $cf_fix_cppflags in
3620 no)
3621         case $cf_add_cflags in #(vi
3622         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3623                 case $cf_add_cflags in
3624                 -D*)
3625                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3626
3627                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3628                                 && test -z "${cf_tst_cflags}" \
3629                                 && cf_fix_cppflags=yes
3630
3631                         if test $cf_fix_cppflags = yes ; then
3632                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3633                                 continue
3634                         elif test "${cf_tst_cflags}" = "\"'" ; then
3635                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3636                                 continue
3637                         fi
3638                         ;;
3639                 esac
3640                 case "$CPPFLAGS" in
3641                 *$cf_add_cflags) #(vi
3642                         ;;
3643                 *) #(vi
3644                         case $cf_add_cflags in #(vi
3645                         -D*)
3646                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3647
3648 CPPFLAGS=`echo "$CPPFLAGS" | \
3649         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3650                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3651
3652                                 ;;
3653                         esac
3654                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3655                         ;;
3656                 esac
3657                 ;;
3658         *)
3659                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3660                 ;;
3661         esac
3662         ;;
3663 yes)
3664         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3665
3666         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3667
3668         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3669                 && test -z "${cf_tst_cflags}" \
3670                 && cf_fix_cppflags=no
3671         ;;
3672 esac
3673 done
3674
3675 if test -n "$cf_new_cflags" ; then
3676         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
3677
3678 echo "${as_me:-configure}:3678: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
3679
3680         CFLAGS="$CFLAGS $cf_new_cflags"
3681 fi
3682
3683 if test -n "$cf_new_cppflags" ; then
3684         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
3685
3686 echo "${as_me:-configure}:3686: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
3687
3688         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3689 fi
3690
3691 if test -n "$cf_new_extra_cppflags" ; then
3692         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
3693
3694 echo "${as_me:-configure}:3694: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
3695
3696         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3697 fi
3698
3699 fi
3700
3701 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3702         echo "$as_me:3702: checking if _XOPEN_SOURCE really is set" >&5
3703 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3704         cat >conftest.$ac_ext <<_ACEOF
3705 #line 3705 "configure"
3706 #include "confdefs.h"
3707 #include <stdlib.h>
3708 int
3709 main ()
3710 {
3711
3712 #ifndef _XOPEN_SOURCE
3713 make an error
3714 #endif
3715   ;
3716   return 0;
3717 }
3718 _ACEOF
3719 rm -f conftest.$ac_objext
3720 if { (eval echo "$as_me:3720: \"$ac_compile\"") >&5
3721   (eval $ac_compile) 2>&5
3722   ac_status=$?
3723   echo "$as_me:3723: \$? = $ac_status" >&5
3724   (exit $ac_status); } &&
3725          { ac_try='test -s conftest.$ac_objext'
3726   { (eval echo "$as_me:3726: \"$ac_try\"") >&5
3727   (eval $ac_try) 2>&5
3728   ac_status=$?
3729   echo "$as_me:3729: \$? = $ac_status" >&5
3730   (exit $ac_status); }; }; then
3731   cf_XOPEN_SOURCE_set=yes
3732 else
3733   echo "$as_me: failed program was:" >&5
3734 cat conftest.$ac_ext >&5
3735 cf_XOPEN_SOURCE_set=no
3736 fi
3737 rm -f conftest.$ac_objext conftest.$ac_ext
3738         echo "$as_me:3738: result: $cf_XOPEN_SOURCE_set" >&5
3739 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3740         if test $cf_XOPEN_SOURCE_set = yes
3741         then
3742                 cat >conftest.$ac_ext <<_ACEOF
3743 #line 3743 "configure"
3744 #include "confdefs.h"
3745 #include <stdlib.h>
3746 int
3747 main ()
3748 {
3749
3750 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3751 make an error
3752 #endif
3753   ;
3754   return 0;
3755 }
3756 _ACEOF
3757 rm -f conftest.$ac_objext
3758 if { (eval echo "$as_me:3758: \"$ac_compile\"") >&5
3759   (eval $ac_compile) 2>&5
3760   ac_status=$?
3761   echo "$as_me:3761: \$? = $ac_status" >&5
3762   (exit $ac_status); } &&
3763          { ac_try='test -s conftest.$ac_objext'
3764   { (eval echo "$as_me:3764: \"$ac_try\"") >&5
3765   (eval $ac_try) 2>&5
3766   ac_status=$?
3767   echo "$as_me:3767: \$? = $ac_status" >&5
3768   (exit $ac_status); }; }; then
3769   cf_XOPEN_SOURCE_set_ok=yes
3770 else
3771   echo "$as_me: failed program was:" >&5
3772 cat conftest.$ac_ext >&5
3773 cf_XOPEN_SOURCE_set_ok=no
3774 fi
3775 rm -f conftest.$ac_objext conftest.$ac_ext
3776                 if test $cf_XOPEN_SOURCE_set_ok = no
3777                 then
3778                         { echo "$as_me:3778: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3779 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3780                 fi
3781         else
3782
3783 echo "$as_me:3783: checking if we should define _XOPEN_SOURCE" >&5
3784 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3785 if test "${cf_cv_xopen_source+set}" = set; then
3786   echo $ECHO_N "(cached) $ECHO_C" >&6
3787 else
3788
3789         cat >conftest.$ac_ext <<_ACEOF
3790 #line 3790 "configure"
3791 #include "confdefs.h"
3792
3793 #include <stdlib.h>
3794 #include <string.h>
3795 #include <sys/types.h>
3796
3797 int
3798 main ()
3799 {
3800
3801 #ifndef _XOPEN_SOURCE
3802 make an error
3803 #endif
3804   ;
3805   return 0;
3806 }
3807 _ACEOF
3808 rm -f conftest.$ac_objext
3809 if { (eval echo "$as_me:3809: \"$ac_compile\"") >&5
3810   (eval $ac_compile) 2>&5
3811   ac_status=$?
3812   echo "$as_me:3812: \$? = $ac_status" >&5
3813   (exit $ac_status); } &&
3814          { ac_try='test -s conftest.$ac_objext'
3815   { (eval echo "$as_me:3815: \"$ac_try\"") >&5
3816   (eval $ac_try) 2>&5
3817   ac_status=$?
3818   echo "$as_me:3818: \$? = $ac_status" >&5
3819   (exit $ac_status); }; }; then
3820   cf_cv_xopen_source=no
3821 else
3822   echo "$as_me: failed program was:" >&5
3823 cat conftest.$ac_ext >&5
3824 cf_save="$CPPFLAGS"
3825          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3826          cat >conftest.$ac_ext <<_ACEOF
3827 #line 3827 "configure"
3828 #include "confdefs.h"
3829
3830 #include <stdlib.h>
3831 #include <string.h>
3832 #include <sys/types.h>
3833
3834 int
3835 main ()
3836 {
3837
3838 #ifdef _XOPEN_SOURCE
3839 make an error
3840 #endif
3841   ;
3842   return 0;
3843 }
3844 _ACEOF
3845 rm -f conftest.$ac_objext
3846 if { (eval echo "$as_me:3846: \"$ac_compile\"") >&5
3847   (eval $ac_compile) 2>&5
3848   ac_status=$?
3849   echo "$as_me:3849: \$? = $ac_status" >&5
3850   (exit $ac_status); } &&
3851          { ac_try='test -s conftest.$ac_objext'
3852   { (eval echo "$as_me:3852: \"$ac_try\"") >&5
3853   (eval $ac_try) 2>&5
3854   ac_status=$?
3855   echo "$as_me:3855: \$? = $ac_status" >&5
3856   (exit $ac_status); }; }; then
3857   cf_cv_xopen_source=no
3858 else
3859   echo "$as_me: failed program was:" >&5
3860 cat conftest.$ac_ext >&5
3861 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3862 fi
3863 rm -f conftest.$ac_objext conftest.$ac_ext
3864         CPPFLAGS="$cf_save"
3865
3866 fi
3867 rm -f conftest.$ac_objext conftest.$ac_ext
3868
3869 fi
3870 echo "$as_me:3870: result: $cf_cv_xopen_source" >&5
3871 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3872
3873 if test "$cf_cv_xopen_source" != no ; then
3874
3875 CFLAGS=`echo "$CFLAGS" | \
3876         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3877                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3878
3879 CPPFLAGS=`echo "$CPPFLAGS" | \
3880         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3881                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3882
3883         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3884
3885 cf_fix_cppflags=no
3886 cf_new_cflags=
3887 cf_new_cppflags=
3888 cf_new_extra_cppflags=
3889
3890 for cf_add_cflags in $cf_temp_xopen_source
3891 do
3892 case $cf_fix_cppflags in
3893 no)
3894         case $cf_add_cflags in #(vi
3895         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3896                 case $cf_add_cflags in
3897                 -D*)
3898                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3899
3900                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3901                                 && test -z "${cf_tst_cflags}" \
3902                                 && cf_fix_cppflags=yes
3903
3904                         if test $cf_fix_cppflags = yes ; then
3905                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3906                                 continue
3907                         elif test "${cf_tst_cflags}" = "\"'" ; then
3908                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3909                                 continue
3910                         fi
3911                         ;;
3912                 esac
3913                 case "$CPPFLAGS" in
3914                 *$cf_add_cflags) #(vi
3915                         ;;
3916                 *) #(vi
3917                         case $cf_add_cflags in #(vi
3918                         -D*)
3919                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3920
3921 CPPFLAGS=`echo "$CPPFLAGS" | \
3922         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3923                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3924
3925                                 ;;
3926                         esac
3927                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3928                         ;;
3929                 esac
3930                 ;;
3931         *)
3932                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3933                 ;;
3934         esac
3935         ;;
3936 yes)
3937         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3938
3939         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3940
3941         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3942                 && test -z "${cf_tst_cflags}" \
3943                 && cf_fix_cppflags=no
3944         ;;
3945 esac
3946 done
3947
3948 if test -n "$cf_new_cflags" ; then
3949
3950         CFLAGS="$CFLAGS $cf_new_cflags"
3951 fi
3952
3953 if test -n "$cf_new_cppflags" ; then
3954
3955         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3956 fi
3957
3958 if test -n "$cf_new_extra_cppflags" ; then
3959
3960         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3961 fi
3962
3963 fi
3964
3965         fi
3966 fi
3967
3968 echo "$as_me:3968: checking for signal global datatype" >&5
3969 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
3970 if test "${cf_cv_sig_atomic_t+set}" = set; then
3971   echo $ECHO_N "(cached) $ECHO_C" >&6
3972 else
3973
3974         for cf_type in \
3975                 "volatile sig_atomic_t" \
3976                 "sig_atomic_t" \
3977                 "int"
3978         do
3979         cat >conftest.$ac_ext <<_ACEOF
3980 #line 3980 "configure"
3981 #include "confdefs.h"
3982
3983 #include <sys/types.h>
3984 #include <signal.h>
3985 #include <stdio.h>
3986
3987 extern $cf_type x;
3988 $cf_type x;
3989 static void handler(int sig)
3990 {
3991         x = 5;
3992 }
3993 int
3994 main ()
3995 {
3996 signal(SIGINT, handler);
3997                  x = 1
3998   ;
3999   return 0;
4000 }
4001 _ACEOF
4002 rm -f conftest.$ac_objext
4003 if { (eval echo "$as_me:4003: \"$ac_compile\"") >&5
4004   (eval $ac_compile) 2>&5
4005   ac_status=$?
4006   echo "$as_me:4006: \$? = $ac_status" >&5
4007   (exit $ac_status); } &&
4008          { ac_try='test -s conftest.$ac_objext'
4009   { (eval echo "$as_me:4009: \"$ac_try\"") >&5
4010   (eval $ac_try) 2>&5
4011   ac_status=$?
4012   echo "$as_me:4012: \$? = $ac_status" >&5
4013   (exit $ac_status); }; }; then
4014   cf_cv_sig_atomic_t=$cf_type
4015 else
4016   echo "$as_me: failed program was:" >&5
4017 cat conftest.$ac_ext >&5
4018 cf_cv_sig_atomic_t=no
4019 fi
4020 rm -f conftest.$ac_objext conftest.$ac_ext
4021                 test "$cf_cv_sig_atomic_t" != no && break
4022         done
4023
4024 fi
4025
4026 echo "$as_me:4026: result: $cf_cv_sig_atomic_t" >&5
4027 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4028 test "$cf_cv_sig_atomic_t" != no &&
4029 cat >>confdefs.h <<EOF
4030 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4031 EOF
4032
4033 echo "$as_me:4033: checking if you want to use pkg-config" >&5
4034 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4035
4036 # Check whether --with-pkg-config or --without-pkg-config was given.
4037 if test "${with_pkg_config+set}" = set; then
4038   withval="$with_pkg_config"
4039   cf_pkg_config=$withval
4040 else
4041   cf_pkg_config=yes
4042 fi;
4043 echo "$as_me:4043: result: $cf_pkg_config" >&5
4044 echo "${ECHO_T}$cf_pkg_config" >&6
4045
4046 case $cf_pkg_config in #(vi
4047 no) #(vi
4048         PKG_CONFIG=none
4049         ;;
4050 yes) #(vi
4051
4052 if test -n "$ac_tool_prefix"; then
4053   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4054 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4055 echo "$as_me:4055: checking for $ac_word" >&5
4056 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4057 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4058   echo $ECHO_N "(cached) $ECHO_C" >&6
4059 else
4060   case $PKG_CONFIG in
4061   [\\/]* | ?:[\\/]*)
4062   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4063   ;;
4064   *)
4065   ac_save_IFS=$IFS; IFS=$ac_path_separator
4066 ac_dummy="$PATH"
4067 for ac_dir in $ac_dummy; do
4068   IFS=$ac_save_IFS
4069   test -z "$ac_dir" && ac_dir=.
4070   if $as_executable_p "$ac_dir/$ac_word"; then
4071    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4072    echo "$as_me:4072: found $ac_dir/$ac_word" >&5
4073    break
4074 fi
4075 done
4076
4077   ;;
4078 esac
4079 fi
4080 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4081
4082 if test -n "$PKG_CONFIG"; then
4083   echo "$as_me:4083: result: $PKG_CONFIG" >&5
4084 echo "${ECHO_T}$PKG_CONFIG" >&6
4085 else
4086   echo "$as_me:4086: result: no" >&5
4087 echo "${ECHO_T}no" >&6
4088 fi
4089
4090 fi
4091 if test -z "$ac_cv_path_PKG_CONFIG"; then
4092   ac_pt_PKG_CONFIG=$PKG_CONFIG
4093   # Extract the first word of "pkg-config", so it can be a program name with args.
4094 set dummy pkg-config; ac_word=$2
4095 echo "$as_me:4095: checking for $ac_word" >&5
4096 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4097 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4098   echo $ECHO_N "(cached) $ECHO_C" >&6
4099 else
4100   case $ac_pt_PKG_CONFIG in
4101   [\\/]* | ?:[\\/]*)
4102   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4103   ;;
4104   *)
4105   ac_save_IFS=$IFS; IFS=$ac_path_separator
4106 ac_dummy="$PATH"
4107 for ac_dir in $ac_dummy; do
4108   IFS=$ac_save_IFS
4109   test -z "$ac_dir" && ac_dir=.
4110   if $as_executable_p "$ac_dir/$ac_word"; then
4111    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4112    echo "$as_me:4112: found $ac_dir/$ac_word" >&5
4113    break
4114 fi
4115 done
4116
4117   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4118   ;;
4119 esac
4120 fi
4121 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4122
4123 if test -n "$ac_pt_PKG_CONFIG"; then
4124   echo "$as_me:4124: result: $ac_pt_PKG_CONFIG" >&5
4125 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4126 else
4127   echo "$as_me:4127: result: no" >&5
4128 echo "${ECHO_T}no" >&6
4129 fi
4130
4131   PKG_CONFIG=$ac_pt_PKG_CONFIG
4132 else
4133   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4134 fi
4135
4136         ;;
4137 *)
4138         PKG_CONFIG=$withval
4139         ;;
4140 esac
4141
4142 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4143 if test "$PKG_CONFIG" != none ; then
4144
4145 if test "x$prefix" != xNONE; then
4146   cf_path_syntax="$prefix"
4147 else
4148   cf_path_syntax="$ac_default_prefix"
4149 fi
4150
4151 case ".$PKG_CONFIG" in #(vi
4152 .\$\(*\)*|.\'*\'*) #(vi
4153   ;;
4154 ..|./*|.\\*) #(vi
4155   ;;
4156 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
4157   ;;
4158 .\${*prefix}*|.\${*dir}*) #(vi
4159   eval PKG_CONFIG="$PKG_CONFIG"
4160   case ".$PKG_CONFIG" in #(vi
4161   .NONE/*)
4162     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4163     ;;
4164   esac
4165   ;; #(vi
4166 .no|.NONE/*)
4167   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4168   ;;
4169 *)
4170   { { echo "$as_me:4170: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4171 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4172    { (exit 1); exit 1; }; }
4173   ;;
4174 esac
4175
4176 fi
4177
4178 echo "$as_me:4178: checking if you want to see long compiling messages" >&5
4179 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4180
4181 # Check whether --enable-echo or --disable-echo was given.
4182 if test "${enable_echo+set}" = set; then
4183   enableval="$enable_echo"
4184   test "$enableval" != no && enableval=yes
4185   if test "$enableval" != "yes" ; then
4186
4187     ECHO_LT='--silent'
4188     ECHO_LD='@echo linking $@;'
4189     RULE_CC='@echo compiling $<'
4190     SHOW_CC='@echo compiling $@'
4191     ECHO_CC='@'
4192
4193   else
4194
4195     ECHO_LT=''
4196     ECHO_LD=''
4197     RULE_CC=''
4198     SHOW_CC=''
4199     ECHO_CC=''
4200
4201   fi
4202 else
4203   enableval=yes
4204
4205     ECHO_LT=''
4206     ECHO_LD=''
4207     RULE_CC=''
4208     SHOW_CC=''
4209     ECHO_CC=''
4210
4211 fi;
4212 echo "$as_me:4212: result: $enableval" >&5
4213 echo "${ECHO_T}$enableval" >&6
4214
4215 echo "$as_me:4215: checking for ncurses wrap-prefix" >&5
4216 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4217
4218 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4219 if test "${with_ncurses_wrap_prefix+set}" = set; then
4220   withval="$with_ncurses_wrap_prefix"
4221   NCURSES_WRAP_PREFIX=$withval
4222 else
4223   NCURSES_WRAP_PREFIX=_nc_
4224 fi;
4225 echo "$as_me:4225: result: $NCURSES_WRAP_PREFIX" >&5
4226 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4227
4228 echo "$as_me:4228: checking if you want to check for wide-character functions" >&5
4229 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4230
4231 # Check whether --enable-widec or --disable-widec was given.
4232 if test "${enable_widec+set}" = set; then
4233   enableval="$enable_widec"
4234   test "$enableval" != no && enableval=yes
4235   if test "$enableval" != "yes" ; then
4236     cf_enable_widec=no
4237   else
4238     cf_enable_widec=yes
4239   fi
4240 else
4241   enableval=yes
4242   cf_enable_widec=yes
4243
4244 fi;
4245 echo "$as_me:4245: result: $cf_enable_widec" >&5
4246 echo "${ECHO_T}$cf_enable_widec" >&6
4247
4248 echo "$as_me:4248: checking for specific curses-directory" >&5
4249 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4250
4251 # Check whether --with-curses-dir or --without-curses-dir was given.
4252 if test "${with_curses_dir+set}" = set; then
4253   withval="$with_curses_dir"
4254   cf_cv_curses_dir=$withval
4255 else
4256   cf_cv_curses_dir=no
4257 fi;
4258 echo "$as_me:4258: result: $cf_cv_curses_dir" >&5
4259 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4260
4261 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4262 then
4263
4264 if test "x$prefix" != xNONE; then
4265   cf_path_syntax="$prefix"
4266 else
4267   cf_path_syntax="$ac_default_prefix"
4268 fi
4269
4270 case ".$withval" in #(vi
4271 .\$\(*\)*|.\'*\'*) #(vi
4272   ;;
4273 ..|./*|.\\*) #(vi
4274   ;;
4275 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
4276   ;;
4277 .\${*prefix}*|.\${*dir}*) #(vi
4278   eval withval="$withval"
4279   case ".$withval" in #(vi
4280   .NONE/*)
4281     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4282     ;;
4283   esac
4284   ;; #(vi
4285 .no|.NONE/*)
4286   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4287   ;;
4288 *)
4289   { { echo "$as_me:4289: error: expected a pathname, not \"$withval\"" >&5
4290 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4291    { (exit 1); exit 1; }; }
4292   ;;
4293 esac
4294
4295         if test -d "$cf_cv_curses_dir"
4296         then
4297
4298 if test -n "$cf_cv_curses_dir/include" ; then
4299   for cf_add_incdir in $cf_cv_curses_dir/include
4300   do
4301         while test $cf_add_incdir != /usr/include
4302         do
4303           if test -d $cf_add_incdir
4304           then
4305                 cf_have_incdir=no
4306                 if test -n "$CFLAGS$CPPFLAGS" ; then
4307                   # a loop is needed to ensure we can add subdirs of existing dirs
4308                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4309                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4310                           cf_have_incdir=yes; break
4311                         fi
4312                   done
4313                 fi
4314
4315                 if test "$cf_have_incdir" = no ; then
4316                   if test "$cf_add_incdir" = /usr/local/include ; then
4317                         if test "$GCC" = yes
4318                         then
4319                           cf_save_CPPFLAGS=$CPPFLAGS
4320                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4321                           cat >conftest.$ac_ext <<_ACEOF
4322 #line 4322 "configure"
4323 #include "confdefs.h"
4324 #include <stdio.h>
4325 int
4326 main ()
4327 {
4328 printf("Hello")
4329   ;
4330   return 0;
4331 }
4332 _ACEOF
4333 rm -f conftest.$ac_objext
4334 if { (eval echo "$as_me:4334: \"$ac_compile\"") >&5
4335   (eval $ac_compile) 2>&5
4336   ac_status=$?
4337   echo "$as_me:4337: \$? = $ac_status" >&5
4338   (exit $ac_status); } &&
4339          { ac_try='test -s conftest.$ac_objext'
4340   { (eval echo "$as_me:4340: \"$ac_try\"") >&5
4341   (eval $ac_try) 2>&5
4342   ac_status=$?
4343   echo "$as_me:4343: \$? = $ac_status" >&5
4344   (exit $ac_status); }; }; then
4345   :
4346 else
4347   echo "$as_me: failed program was:" >&5
4348 cat conftest.$ac_ext >&5
4349 cf_have_incdir=yes
4350 fi
4351 rm -f conftest.$ac_objext conftest.$ac_ext
4352                           CPPFLAGS=$cf_save_CPPFLAGS
4353                         fi
4354                   fi
4355                 fi
4356
4357                 if test "$cf_have_incdir" = no ; then
4358                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4359
4360 echo "${as_me:-configure}:4360: testing adding $cf_add_incdir to include-path ..." 1>&5
4361
4362                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4363
4364                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4365                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4366                   cf_add_incdir="$cf_top_incdir"
4367                 else
4368                   break
4369                 fi
4370           fi
4371         done
4372   done
4373 fi
4374
4375 if test -n "$cf_cv_curses_dir/lib" ; then
4376   for cf_add_libdir in $cf_cv_curses_dir/lib
4377   do
4378     if test $cf_add_libdir = /usr/lib ; then
4379       :
4380     elif test -d $cf_add_libdir
4381     then
4382       cf_have_libdir=no
4383       if test -n "$LDFLAGS$LIBS" ; then
4384         # a loop is needed to ensure we can add subdirs of existing dirs
4385         for cf_test_libdir in $LDFLAGS $LIBS ; do
4386           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4387             cf_have_libdir=yes; break
4388           fi
4389         done
4390       fi
4391       if test "$cf_have_libdir" = no ; then
4392         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4393
4394 echo "${as_me:-configure}:4394: testing adding $cf_add_libdir to library-path ..." 1>&5
4395
4396         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4397       fi
4398     fi
4399   done
4400 fi
4401
4402         fi
4403 fi
4404
4405 cf_cv_screen=curses
4406
4407 echo "$as_me:4407: checking for specified curses library type" >&5
4408 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4409
4410 # Check whether --with-ncursesw or --without-ncursesw was given.
4411 if test "${with_ncursesw+set}" = set; then
4412   withval="$with_ncursesw"
4413   cf_cv_screen=ncursesw
4414 else
4415
4416 # Check whether --with-ncurses or --without-ncurses was given.
4417 if test "${with_ncurses+set}" = set; then
4418   withval="$with_ncurses"
4419   cf_cv_screen=ncurses
4420 else
4421
4422 # Check whether --with-pdcurses or --without-pdcurses was given.
4423 if test "${with_pdcurses+set}" = set; then
4424   withval="$with_pdcurses"
4425   cf_cv_screen=pdcurses
4426 else
4427
4428 # Check whether --with-curses-colr or --without-curses-colr was given.
4429 if test "${with_curses_colr+set}" = set; then
4430   withval="$with_curses_colr"
4431   cf_cv_screen=curses_colr
4432 else
4433
4434 # Check whether --with-curses-5lib or --without-curses-5lib was given.
4435 if test "${with_curses_5lib+set}" = set; then
4436   withval="$with_curses_5lib"
4437   cf_cv_screen=curses_5lib
4438 fi;
4439 fi;
4440 fi;
4441 fi;
4442 fi;
4443
4444 echo "$as_me:4444: result: $cf_cv_screen" >&5
4445 echo "${ECHO_T}$cf_cv_screen" >&6
4446
4447 case $cf_cv_screen in #(vi
4448 curses|curses_*) #(vi
4449
4450 echo "$as_me:4450: checking for extra include directories" >&5
4451 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4452 if test "${cf_cv_curses_incdir+set}" = set; then
4453   echo $ECHO_N "(cached) $ECHO_C" >&6
4454 else
4455
4456 cf_cv_curses_incdir=no
4457 case $host_os in #(vi
4458 hpux10.*) #(vi
4459         if test "x$cf_cv_screen" = "xcurses_colr"
4460         then
4461                 test -d /usr/include/curses_colr && \
4462                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
4463         fi
4464         ;;
4465 sunos3*|sunos4*)
4466         if test "x$cf_cv_screen" = "xcurses_5lib"
4467         then
4468                 test -d /usr/5lib && \
4469                 test -d /usr/5include && \
4470                 cf_cv_curses_incdir="-I/usr/5include"
4471         fi
4472         ;;
4473 esac
4474
4475 fi
4476 echo "$as_me:4476: result: $cf_cv_curses_incdir" >&5
4477 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4478 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4479
4480 echo "$as_me:4480: checking if we have identified curses headers" >&5
4481 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4482 if test "${cf_cv_ncurses_header+set}" = set; then
4483   echo $ECHO_N "(cached) $ECHO_C" >&6
4484 else
4485
4486 cf_cv_ncurses_header=none
4487 for cf_header in  \
4488         ncurses.h \
4489         curses.h ncurses/ncurses.h ncurses/curses.h
4490 do
4491 cat >conftest.$ac_ext <<_ACEOF
4492 #line 4492 "configure"
4493 #include "confdefs.h"
4494 #include <${cf_header}>
4495 int
4496 main ()
4497 {
4498 initscr(); tgoto("?", 0,0)
4499   ;
4500   return 0;
4501 }
4502 _ACEOF
4503 rm -f conftest.$ac_objext
4504 if { (eval echo "$as_me:4504: \"$ac_compile\"") >&5
4505   (eval $ac_compile) 2>&5
4506   ac_status=$?
4507   echo "$as_me:4507: \$? = $ac_status" >&5
4508   (exit $ac_status); } &&
4509          { ac_try='test -s conftest.$ac_objext'
4510   { (eval echo "$as_me:4510: \"$ac_try\"") >&5
4511   (eval $ac_try) 2>&5
4512   ac_status=$?
4513   echo "$as_me:4513: \$? = $ac_status" >&5
4514   (exit $ac_status); }; }; then
4515   cf_cv_ncurses_header=$cf_header; break
4516 else
4517   echo "$as_me: failed program was:" >&5
4518 cat conftest.$ac_ext >&5
4519 fi
4520 rm -f conftest.$ac_objext conftest.$ac_ext
4521 done
4522
4523 fi
4524 echo "$as_me:4524: result: $cf_cv_ncurses_header" >&5
4525 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4526
4527 if test "$cf_cv_ncurses_header" = none ; then
4528         { { echo "$as_me:4528: error: No curses header-files found" >&5
4529 echo "$as_me: error: No curses header-files found" >&2;}
4530    { (exit 1); exit 1; }; }
4531 fi
4532
4533 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4534
4535 for ac_header in $cf_cv_ncurses_header
4536 do
4537 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4538 echo "$as_me:4538: checking for $ac_header" >&5
4539 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4540 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4541   echo $ECHO_N "(cached) $ECHO_C" >&6
4542 else
4543   cat >conftest.$ac_ext <<_ACEOF
4544 #line 4544 "configure"
4545 #include "confdefs.h"
4546 #include <$ac_header>
4547 _ACEOF
4548 if { (eval echo "$as_me:4548: \"$ac_cpp conftest.$ac_ext\"") >&5
4549   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4550   ac_status=$?
4551   egrep -v '^ *\+' conftest.er1 >conftest.err
4552   rm -f conftest.er1
4553   cat conftest.err >&5
4554   echo "$as_me:4554: \$? = $ac_status" >&5
4555   (exit $ac_status); } >/dev/null; then
4556   if test -s conftest.err; then
4557     ac_cpp_err=$ac_c_preproc_warn_flag
4558   else
4559     ac_cpp_err=
4560   fi
4561 else
4562   ac_cpp_err=yes
4563 fi
4564 if test -z "$ac_cpp_err"; then
4565   eval "$as_ac_Header=yes"
4566 else
4567   echo "$as_me: failed program was:" >&5
4568   cat conftest.$ac_ext >&5
4569   eval "$as_ac_Header=no"
4570 fi
4571 rm -f conftest.err conftest.$ac_ext
4572 fi
4573 echo "$as_me:4573: result: `eval echo '${'$as_ac_Header'}'`" >&5
4574 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4575 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4576   cat >>confdefs.h <<EOF
4577 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4578 EOF
4579
4580 fi
4581 done
4582
4583 echo "$as_me:4583: checking for terminfo header" >&5
4584 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4585 if test "${cf_cv_term_header+set}" = set; then
4586   echo $ECHO_N "(cached) $ECHO_C" >&6
4587 else
4588
4589 case ${cf_cv_ncurses_header} in #(vi
4590 */ncurses.h|*/ncursesw.h) #(vi
4591         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4592         ;;
4593 *)
4594         cf_term_header=term.h
4595         ;;
4596 esac
4597
4598 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4599 do
4600 cat >conftest.$ac_ext <<_ACEOF
4601 #line 4601 "configure"
4602 #include "confdefs.h"
4603 #include <stdio.h>
4604 #include <${cf_cv_ncurses_header:-curses.h}>
4605 #include <$cf_test>
4606
4607 int
4608 main ()
4609 {
4610 int x = auto_left_margin
4611   ;
4612   return 0;
4613 }
4614 _ACEOF
4615 rm -f conftest.$ac_objext
4616 if { (eval echo "$as_me:4616: \"$ac_compile\"") >&5
4617   (eval $ac_compile) 2>&5
4618   ac_status=$?
4619   echo "$as_me:4619: \$? = $ac_status" >&5
4620   (exit $ac_status); } &&
4621          { ac_try='test -s conftest.$ac_objext'
4622   { (eval echo "$as_me:4622: \"$ac_try\"") >&5
4623   (eval $ac_try) 2>&5
4624   ac_status=$?
4625   echo "$as_me:4625: \$? = $ac_status" >&5
4626   (exit $ac_status); }; }; then
4627
4628         cf_cv_term_header="$cf_test"
4629 else
4630   echo "$as_me: failed program was:" >&5
4631 cat conftest.$ac_ext >&5
4632
4633         cf_cv_term_header=unknown
4634
4635 fi
4636 rm -f conftest.$ac_objext conftest.$ac_ext
4637         test "$cf_cv_term_header" != unknown && break
4638 done
4639
4640 fi
4641 echo "$as_me:4641: result: $cf_cv_term_header" >&5
4642 echo "${ECHO_T}$cf_cv_term_header" >&6
4643
4644 # Set definitions to allow ifdef'ing to accommodate subdirectories
4645
4646 case $cf_cv_term_header in # (vi
4647 *term.h)
4648
4649 cat >>confdefs.h <<\EOF
4650 #define HAVE_TERM_H 1
4651 EOF
4652
4653         ;;
4654 esac
4655
4656 case $cf_cv_term_header in # (vi
4657 ncurses/term.h) #(vi
4658
4659 cat >>confdefs.h <<\EOF
4660 #define HAVE_NCURSES_TERM_H 1
4661 EOF
4662
4663         ;;
4664 ncursesw/term.h)
4665
4666 cat >>confdefs.h <<\EOF
4667 #define HAVE_NCURSESW_TERM_H 1
4668 EOF
4669
4670         ;;
4671 esac
4672
4673 echo "$as_me:4673: checking for ncurses version" >&5
4674 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4675 if test "${cf_cv_ncurses_version+set}" = set; then
4676   echo $ECHO_N "(cached) $ECHO_C" >&6
4677 else
4678
4679         cf_cv_ncurses_version=no
4680         cf_tempfile=out$$
4681         rm -f $cf_tempfile
4682         if test "$cross_compiling" = yes; then
4683
4684         # This will not work if the preprocessor splits the line after the
4685         # Autoconf token.  The 'unproto' program does that.
4686         cat > conftest.$ac_ext <<EOF
4687 #include <${cf_cv_ncurses_header:-curses.h}>
4688 #undef Autoconf
4689 #ifdef NCURSES_VERSION
4690 Autoconf NCURSES_VERSION
4691 #else
4692 #ifdef __NCURSES_H
4693 Autoconf "old"
4694 #endif
4695 ;
4696 #endif
4697 EOF
4698         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4699         { (eval echo "$as_me:4699: \"$cf_try\"") >&5
4700   (eval $cf_try) 2>&5
4701   ac_status=$?
4702   echo "$as_me:4702: \$? = $ac_status" >&5
4703   (exit $ac_status); }
4704         if test -f conftest.out ; then
4705                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4706                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4707                 rm -f conftest.out
4708         fi
4709
4710 else
4711   cat >conftest.$ac_ext <<_ACEOF
4712 #line 4712 "configure"
4713 #include "confdefs.h"
4714
4715 #include <${cf_cv_ncurses_header:-curses.h}>
4716 #include <stdio.h>
4717 int main()
4718 {
4719         FILE *fp = fopen("$cf_tempfile", "w");
4720 #ifdef NCURSES_VERSION
4721 # ifdef NCURSES_VERSION_PATCH
4722         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4723 # else
4724         fprintf(fp, "%s\n", NCURSES_VERSION);
4725 # endif
4726 #else
4727 # ifdef __NCURSES_H
4728         fprintf(fp, "old\n");
4729 # else
4730         make an error
4731 # endif
4732 #endif
4733         ${cf_cv_main_return:-return}(0);
4734 }
4735 _ACEOF
4736 rm -f conftest$ac_exeext
4737 if { (eval echo "$as_me:4737: \"$ac_link\"") >&5
4738   (eval $ac_link) 2>&5
4739   ac_status=$?
4740   echo "$as_me:4740: \$? = $ac_status" >&5
4741   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4742   { (eval echo "$as_me:4742: \"$ac_try\"") >&5
4743   (eval $ac_try) 2>&5
4744   ac_status=$?
4745   echo "$as_me:4745: \$? = $ac_status" >&5
4746   (exit $ac_status); }; }; then
4747
4748         cf_cv_ncurses_version=`cat $cf_tempfile`
4749 else
4750   echo "$as_me: program exited with status $ac_status" >&5
4751 echo "$as_me: failed program was:" >&5
4752 cat conftest.$ac_ext >&5
4753 fi
4754 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4755 fi
4756         rm -f $cf_tempfile
4757
4758 fi
4759 echo "$as_me:4759: result: $cf_cv_ncurses_version" >&5
4760 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4761 test "$cf_cv_ncurses_version" = no ||
4762 cat >>confdefs.h <<\EOF
4763 #define NCURSES 1
4764 EOF
4765
4766 echo "$as_me:4766: checking if we have identified curses libraries" >&5
4767 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
4768 cat >conftest.$ac_ext <<_ACEOF
4769 #line 4769 "configure"
4770 #include "confdefs.h"
4771 #include <${cf_cv_ncurses_header:-curses.h}>
4772 int
4773 main ()
4774 {
4775 initscr(); tgoto("?", 0,0)
4776   ;
4777   return 0;
4778 }
4779 _ACEOF
4780 rm -f conftest.$ac_objext conftest$ac_exeext
4781 if { (eval echo "$as_me:4781: \"$ac_link\"") >&5
4782   (eval $ac_link) 2>&5
4783   ac_status=$?
4784   echo "$as_me:4784: \$? = $ac_status" >&5
4785   (exit $ac_status); } &&
4786          { ac_try='test -s conftest$ac_exeext'
4787   { (eval echo "$as_me:4787: \"$ac_try\"") >&5
4788   (eval $ac_try) 2>&5
4789   ac_status=$?
4790   echo "$as_me:4790: \$? = $ac_status" >&5
4791   (exit $ac_status); }; }; then
4792   cf_result=yes
4793 else
4794   echo "$as_me: failed program was:" >&5
4795 cat conftest.$ac_ext >&5
4796 cf_result=no
4797 fi
4798 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4799 echo "$as_me:4799: result: $cf_result" >&5
4800 echo "${ECHO_T}$cf_result" >&6
4801
4802 if test "$cf_result" = no ; then
4803 case $host_os in #(vi
4804 freebsd*) #(vi
4805     echo "$as_me:4805: checking for tgoto in -lmytinfo" >&5
4806 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4807 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4808   echo $ECHO_N "(cached) $ECHO_C" >&6
4809 else
4810   ac_check_lib_save_LIBS=$LIBS
4811 LIBS="-lmytinfo  $LIBS"
4812 cat >conftest.$ac_ext <<_ACEOF
4813 #line 4813 "configure"
4814 #include "confdefs.h"
4815
4816 /* Override any gcc2 internal prototype to avoid an error.  */
4817 #ifdef __cplusplus
4818 extern "C"
4819 #endif
4820 /* We use char because int might match the return type of a gcc2
4821    builtin and then its argument prototype would still apply.  */
4822 char tgoto ();
4823 int
4824 main ()
4825 {
4826 tgoto ();
4827   ;
4828   return 0;
4829 }
4830 _ACEOF
4831 rm -f conftest.$ac_objext conftest$ac_exeext
4832 if { (eval echo "$as_me:4832: \"$ac_link\"") >&5
4833   (eval $ac_link) 2>&5
4834   ac_status=$?
4835   echo "$as_me:4835: \$? = $ac_status" >&5
4836   (exit $ac_status); } &&
4837          { ac_try='test -s conftest$ac_exeext'
4838   { (eval echo "$as_me:4838: \"$ac_try\"") >&5
4839   (eval $ac_try) 2>&5
4840   ac_status=$?
4841   echo "$as_me:4841: \$? = $ac_status" >&5
4842   (exit $ac_status); }; }; then
4843   ac_cv_lib_mytinfo_tgoto=yes
4844 else
4845   echo "$as_me: failed program was:" >&5
4846 cat conftest.$ac_ext >&5
4847 ac_cv_lib_mytinfo_tgoto=no
4848 fi
4849 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4850 LIBS=$ac_check_lib_save_LIBS
4851 fi
4852 echo "$as_me:4852: result: $ac_cv_lib_mytinfo_tgoto" >&5
4853 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4854 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4855
4856 cf_add_libs="-lmytinfo"
4857 # Filter out duplicates - this happens with badly-designed ".pc" files...
4858 for cf_add_1lib in $LIBS
4859 do
4860         for cf_add_2lib in $cf_add_libs
4861         do
4862                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4863                 then
4864                         cf_add_1lib=
4865                         break
4866                 fi
4867         done
4868         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4869 done
4870 LIBS="$cf_add_libs"
4871
4872 fi
4873
4874     ;;
4875 hpux10.*) #(vi
4876         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
4877         # next (1998), and xcurses "newer" (2000).  There is no header file for
4878         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
4879         # term.h) for cur_colr
4880         if test "x$cf_cv_screen" = "xcurses_colr"
4881         then
4882                 echo "$as_me:4882: checking for initscr in -lcur_colr" >&5
4883 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
4884 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
4885   echo $ECHO_N "(cached) $ECHO_C" >&6
4886 else
4887   ac_check_lib_save_LIBS=$LIBS
4888 LIBS="-lcur_colr  $LIBS"
4889 cat >conftest.$ac_ext <<_ACEOF
4890 #line 4890 "configure"
4891 #include "confdefs.h"
4892
4893 /* Override any gcc2 internal prototype to avoid an error.  */
4894 #ifdef __cplusplus
4895 extern "C"
4896 #endif
4897 /* We use char because int might match the return type of a gcc2
4898    builtin and then its argument prototype would still apply.  */
4899 char initscr ();
4900 int
4901 main ()
4902 {
4903 initscr ();
4904   ;
4905   return 0;
4906 }
4907 _ACEOF
4908 rm -f conftest.$ac_objext conftest$ac_exeext
4909 if { (eval echo "$as_me:4909: \"$ac_link\"") >&5
4910   (eval $ac_link) 2>&5
4911   ac_status=$?
4912   echo "$as_me:4912: \$? = $ac_status" >&5
4913   (exit $ac_status); } &&
4914          { ac_try='test -s conftest$ac_exeext'
4915   { (eval echo "$as_me:4915: \"$ac_try\"") >&5
4916   (eval $ac_try) 2>&5
4917   ac_status=$?
4918   echo "$as_me:4918: \$? = $ac_status" >&5
4919   (exit $ac_status); }; }; then
4920   ac_cv_lib_cur_colr_initscr=yes
4921 else
4922   echo "$as_me: failed program was:" >&5
4923 cat conftest.$ac_ext >&5
4924 ac_cv_lib_cur_colr_initscr=no
4925 fi
4926 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4927 LIBS=$ac_check_lib_save_LIBS
4928 fi
4929 echo "$as_me:4929: result: $ac_cv_lib_cur_colr_initscr" >&5
4930 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
4931 if test $ac_cv_lib_cur_colr_initscr = yes; then
4932
4933 cf_add_libs="-lcur_colr"
4934 # Filter out duplicates - this happens with badly-designed ".pc" files...
4935 for cf_add_1lib in $LIBS
4936 do
4937         for cf_add_2lib in $cf_add_libs
4938         do
4939                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4940                 then
4941                         cf_add_1lib=
4942                         break
4943                 fi
4944         done
4945         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4946 done
4947 LIBS="$cf_add_libs"
4948
4949                         ac_cv_func_initscr=yes
4950
4951 else
4952
4953                 echo "$as_me:4953: checking for initscr in -lHcurses" >&5
4954 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
4955 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
4956   echo $ECHO_N "(cached) $ECHO_C" >&6
4957 else
4958   ac_check_lib_save_LIBS=$LIBS
4959 LIBS="-lHcurses  $LIBS"
4960 cat >conftest.$ac_ext <<_ACEOF
4961 #line 4961 "configure"
4962 #include "confdefs.h"
4963
4964 /* Override any gcc2 internal prototype to avoid an error.  */
4965 #ifdef __cplusplus
4966 extern "C"
4967 #endif
4968 /* We use char because int might match the return type of a gcc2
4969    builtin and then its argument prototype would still apply.  */
4970 char initscr ();
4971 int
4972 main ()
4973 {
4974 initscr ();
4975   ;
4976   return 0;
4977 }
4978 _ACEOF
4979 rm -f conftest.$ac_objext conftest$ac_exeext
4980 if { (eval echo "$as_me:4980: \"$ac_link\"") >&5
4981   (eval $ac_link) 2>&5
4982   ac_status=$?
4983   echo "$as_me:4983: \$? = $ac_status" >&5
4984   (exit $ac_status); } &&
4985          { ac_try='test -s conftest$ac_exeext'
4986   { (eval echo "$as_me:4986: \"$ac_try\"") >&5
4987   (eval $ac_try) 2>&5
4988   ac_status=$?
4989   echo "$as_me:4989: \$? = $ac_status" >&5
4990   (exit $ac_status); }; }; then
4991   ac_cv_lib_Hcurses_initscr=yes
4992 else
4993   echo "$as_me: failed program was:" >&5
4994 cat conftest.$ac_ext >&5
4995 ac_cv_lib_Hcurses_initscr=no
4996 fi
4997 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4998 LIBS=$ac_check_lib_save_LIBS
4999 fi
5000 echo "$as_me:5000: result: $ac_cv_lib_Hcurses_initscr" >&5
5001 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5002 if test $ac_cv_lib_Hcurses_initscr = yes; then
5003
5004                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5005
5006 cf_add_libs="-lHcurses"
5007 # Filter out duplicates - this happens with badly-designed ".pc" files...
5008 for cf_add_1lib in $LIBS
5009 do
5010         for cf_add_2lib in $cf_add_libs
5011         do
5012                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5013                 then
5014                         cf_add_1lib=
5015                         break
5016                 fi
5017         done
5018         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5019 done
5020 LIBS="$cf_add_libs"
5021
5022                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5023                         ac_cv_func_initscr=yes
5024
5025 fi
5026
5027 fi
5028
5029         fi
5030         ;;
5031 linux*)
5032         case `arch 2>/dev/null` in
5033         x86_64)
5034                 if test -d /lib64
5035                 then
5036
5037 if test -n "/lib64" ; then
5038   for cf_add_libdir in /lib64
5039   do
5040     if test $cf_add_libdir = /usr/lib ; then
5041       :
5042     elif test -d $cf_add_libdir
5043     then
5044       cf_have_libdir=no
5045       if test -n "$LDFLAGS$LIBS" ; then
5046         # a loop is needed to ensure we can add subdirs of existing dirs
5047         for cf_test_libdir in $LDFLAGS $LIBS ; do
5048           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5049             cf_have_libdir=yes; break
5050           fi
5051         done
5052       fi
5053       if test "$cf_have_libdir" = no ; then
5054         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5055
5056 echo "${as_me:-configure}:5056: testing adding $cf_add_libdir to library-path ..." 1>&5
5057
5058         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5059       fi
5060     fi
5061   done
5062 fi
5063
5064                 else
5065
5066 if test -n "/lib" ; then
5067   for cf_add_libdir in /lib
5068   do
5069     if test $cf_add_libdir = /usr/lib ; then
5070       :
5071     elif test -d $cf_add_libdir
5072     then
5073       cf_have_libdir=no
5074       if test -n "$LDFLAGS$LIBS" ; then
5075         # a loop is needed to ensure we can add subdirs of existing dirs
5076         for cf_test_libdir in $LDFLAGS $LIBS ; do
5077           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5078             cf_have_libdir=yes; break
5079           fi
5080         done
5081       fi
5082       if test "$cf_have_libdir" = no ; then
5083         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5084
5085 echo "${as_me:-configure}:5085: testing adding $cf_add_libdir to library-path ..." 1>&5
5086
5087         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5088       fi
5089     fi
5090   done
5091 fi
5092
5093                 fi
5094                 ;;
5095         *)
5096
5097 if test -n "/lib" ; then
5098   for cf_add_libdir in /lib
5099   do
5100     if test $cf_add_libdir = /usr/lib ; then
5101       :
5102     elif test -d $cf_add_libdir
5103     then
5104       cf_have_libdir=no
5105       if test -n "$LDFLAGS$LIBS" ; then
5106         # a loop is needed to ensure we can add subdirs of existing dirs
5107         for cf_test_libdir in $LDFLAGS $LIBS ; do
5108           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5109             cf_have_libdir=yes; break
5110           fi
5111         done
5112       fi
5113       if test "$cf_have_libdir" = no ; then
5114         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5115
5116 echo "${as_me:-configure}:5116: testing adding $cf_add_libdir to library-path ..." 1>&5
5117
5118         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5119       fi
5120     fi
5121   done
5122 fi
5123
5124                 ;;
5125         esac
5126         ;;
5127 sunos3*|sunos4*)
5128         if test "x$cf_cv_screen" = "xcurses_5lib"
5129         then
5130                 if test -d /usr/5lib ; then
5131
5132 if test -n "/usr/5lib" ; then
5133   for cf_add_libdir in /usr/5lib
5134   do
5135     if test $cf_add_libdir = /usr/lib ; then
5136       :
5137     elif test -d $cf_add_libdir
5138     then
5139       cf_have_libdir=no
5140       if test -n "$LDFLAGS$LIBS" ; then
5141         # a loop is needed to ensure we can add subdirs of existing dirs
5142         for cf_test_libdir in $LDFLAGS $LIBS ; do
5143           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5144             cf_have_libdir=yes; break
5145           fi
5146         done
5147       fi
5148       if test "$cf_have_libdir" = no ; then
5149         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5150
5151 echo "${as_me:-configure}:5151: testing adding $cf_add_libdir to library-path ..." 1>&5
5152
5153         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5154       fi
5155     fi
5156   done
5157 fi
5158
5159 cf_add_libs="-lcurses -ltermcap"
5160 # Filter out duplicates - this happens with badly-designed ".pc" files...
5161 for cf_add_1lib in $LIBS
5162 do
5163         for cf_add_2lib in $cf_add_libs
5164         do
5165                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5166                 then
5167                         cf_add_1lib=
5168                         break
5169                 fi
5170         done
5171         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5172 done
5173 LIBS="$cf_add_libs"
5174
5175                 fi
5176     fi
5177     ac_cv_func_initscr=yes
5178     ;;
5179 esac
5180
5181 if test ".$ac_cv_func_initscr" != .yes ; then
5182         cf_save_LIBS="$LIBS"
5183
5184         if test ".${cf_cv_ncurses_version:-no}" != .no
5185         then
5186                 cf_check_list="ncurses curses cursesX"
5187         else
5188                 cf_check_list="cursesX curses ncurses"
5189         fi
5190
5191         # Check for library containing tgoto.  Do this before curses library
5192         # because it may be needed to link the test-case for initscr.
5193         if test "x$cf_term_lib" = x
5194         then
5195                 echo "$as_me:5195: checking for tgoto" >&5
5196 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5197 if test "${ac_cv_func_tgoto+set}" = set; then
5198   echo $ECHO_N "(cached) $ECHO_C" >&6
5199 else
5200   cat >conftest.$ac_ext <<_ACEOF
5201 #line 5201 "configure"
5202 #include "confdefs.h"
5203 /* System header to define __stub macros and hopefully few prototypes,
5204     which can conflict with char tgoto (); below.  */
5205 #include <assert.h>
5206 /* Override any gcc2 internal prototype to avoid an error.  */
5207 #ifdef __cplusplus
5208 extern "C"
5209 #endif
5210 /* We use char because int might match the return type of a gcc2
5211    builtin and then its argument prototype would still apply.  */
5212 char tgoto ();
5213 char (*f) ();
5214
5215 int
5216 main ()
5217 {
5218 /* The GNU C library defines this for functions which it implements
5219     to always fail with ENOSYS.  Some functions are actually named
5220     something starting with __ and the normal name is an alias.  */
5221 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5222 choke me
5223 #else
5224 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5225 #endif
5226
5227   ;
5228   return 0;
5229 }
5230 _ACEOF
5231 rm -f conftest.$ac_objext conftest$ac_exeext
5232 if { (eval echo "$as_me:5232: \"$ac_link\"") >&5
5233   (eval $ac_link) 2>&5
5234   ac_status=$?
5235   echo "$as_me:5235: \$? = $ac_status" >&5
5236   (exit $ac_status); } &&
5237          { ac_try='test -s conftest$ac_exeext'
5238   { (eval echo "$as_me:5238: \"$ac_try\"") >&5
5239   (eval $ac_try) 2>&5
5240   ac_status=$?
5241   echo "$as_me:5241: \$? = $ac_status" >&5
5242   (exit $ac_status); }; }; then
5243   ac_cv_func_tgoto=yes
5244 else
5245   echo "$as_me: failed program was:" >&5
5246 cat conftest.$ac_ext >&5
5247 ac_cv_func_tgoto=no
5248 fi
5249 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5250 fi
5251 echo "$as_me:5251: result: $ac_cv_func_tgoto" >&5
5252 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5253 if test $ac_cv_func_tgoto = yes; then
5254   cf_term_lib=predefined
5255 else
5256
5257                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5258                         do
5259                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5260 echo "$as_me:5260: checking for tgoto in -l$cf_term_lib" >&5
5261 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5262 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5263   echo $ECHO_N "(cached) $ECHO_C" >&6
5264 else
5265   ac_check_lib_save_LIBS=$LIBS
5266 LIBS="-l$cf_term_lib  $LIBS"
5267 cat >conftest.$ac_ext <<_ACEOF
5268 #line 5268 "configure"
5269 #include "confdefs.h"
5270
5271 /* Override any gcc2 internal prototype to avoid an error.  */
5272 #ifdef __cplusplus
5273 extern "C"
5274 #endif
5275 /* We use char because int might match the return type of a gcc2
5276    builtin and then its argument prototype would still apply.  */
5277 char tgoto ();
5278 int
5279 main ()
5280 {
5281 tgoto ();
5282   ;
5283   return 0;
5284 }
5285 _ACEOF
5286 rm -f conftest.$ac_objext conftest$ac_exeext
5287 if { (eval echo "$as_me:5287: \"$ac_link\"") >&5
5288   (eval $ac_link) 2>&5
5289   ac_status=$?
5290   echo "$as_me:5290: \$? = $ac_status" >&5
5291   (exit $ac_status); } &&
5292          { ac_try='test -s conftest$ac_exeext'
5293   { (eval echo "$as_me:5293: \"$ac_try\"") >&5
5294   (eval $ac_try) 2>&5
5295   ac_status=$?
5296   echo "$as_me:5296: \$? = $ac_status" >&5
5297   (exit $ac_status); }; }; then
5298   eval "$as_ac_Lib=yes"
5299 else
5300   echo "$as_me: failed program was:" >&5
5301 cat conftest.$ac_ext >&5
5302 eval "$as_ac_Lib=no"
5303 fi
5304 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5305 LIBS=$ac_check_lib_save_LIBS
5306 fi
5307 echo "$as_me:5307: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5308 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5309 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5310   break
5311 fi
5312
5313                         done
5314
5315 fi
5316
5317         fi
5318
5319         # Check for library containing initscr
5320         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5321         if test "x$cf_curs_lib" = x
5322         then
5323                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5324                 do
5325                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5326 echo "$as_me:5326: checking for initscr in -l$cf_curs_lib" >&5
5327 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5328 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5329   echo $ECHO_N "(cached) $ECHO_C" >&6
5330 else
5331   ac_check_lib_save_LIBS=$LIBS
5332 LIBS="-l$cf_curs_lib  $LIBS"
5333 cat >conftest.$ac_ext <<_ACEOF
5334 #line 5334 "configure"
5335 #include "confdefs.h"
5336
5337 /* Override any gcc2 internal prototype to avoid an error.  */
5338 #ifdef __cplusplus
5339 extern "C"
5340 #endif
5341 /* We use char because int might match the return type of a gcc2
5342    builtin and then its argument prototype would still apply.  */
5343 char initscr ();
5344 int
5345 main ()
5346 {
5347 initscr ();
5348   ;
5349   return 0;
5350 }
5351 _ACEOF
5352 rm -f conftest.$ac_objext conftest$ac_exeext
5353 if { (eval echo "$as_me:5353: \"$ac_link\"") >&5
5354   (eval $ac_link) 2>&5
5355   ac_status=$?
5356   echo "$as_me:5356: \$? = $ac_status" >&5
5357   (exit $ac_status); } &&
5358          { ac_try='test -s conftest$ac_exeext'
5359   { (eval echo "$as_me:5359: \"$ac_try\"") >&5
5360   (eval $ac_try) 2>&5
5361   ac_status=$?
5362   echo "$as_me:5362: \$? = $ac_status" >&5
5363   (exit $ac_status); }; }; then
5364   eval "$as_ac_Lib=yes"
5365 else
5366   echo "$as_me: failed program was:" >&5
5367 cat conftest.$ac_ext >&5
5368 eval "$as_ac_Lib=no"
5369 fi
5370 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5371 LIBS=$ac_check_lib_save_LIBS
5372 fi
5373 echo "$as_me:5373: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5374 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5375 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5376   break
5377 fi
5378
5379                 done
5380         fi
5381         test $cf_curs_lib = unknown && { { echo "$as_me:5381: error: no curses library found" >&5
5382 echo "$as_me: error: no curses library found" >&2;}
5383    { (exit 1); exit 1; }; }
5384
5385         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5386         if test "$cf_term_lib" = unknown ; then
5387                 echo "$as_me:5387: checking if we can link with $cf_curs_lib library" >&5
5388 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5389                 cat >conftest.$ac_ext <<_ACEOF
5390 #line 5390 "configure"
5391 #include "confdefs.h"
5392 #include <${cf_cv_ncurses_header:-curses.h}>
5393 int
5394 main ()
5395 {
5396 initscr()
5397   ;
5398   return 0;
5399 }
5400 _ACEOF
5401 rm -f conftest.$ac_objext conftest$ac_exeext
5402 if { (eval echo "$as_me:5402: \"$ac_link\"") >&5
5403   (eval $ac_link) 2>&5
5404   ac_status=$?
5405   echo "$as_me:5405: \$? = $ac_status" >&5
5406   (exit $ac_status); } &&
5407          { ac_try='test -s conftest$ac_exeext'
5408   { (eval echo "$as_me:5408: \"$ac_try\"") >&5
5409   (eval $ac_try) 2>&5
5410   ac_status=$?
5411   echo "$as_me:5411: \$? = $ac_status" >&5
5412   (exit $ac_status); }; }; then
5413   cf_result=yes
5414 else
5415   echo "$as_me: failed program was:" >&5
5416 cat conftest.$ac_ext >&5
5417 cf_result=no
5418 fi
5419 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5420                 echo "$as_me:5420: result: $cf_result" >&5
5421 echo "${ECHO_T}$cf_result" >&6
5422                 test $cf_result = no && { { echo "$as_me:5422: error: Cannot link curses library" >&5
5423 echo "$as_me: error: Cannot link curses library" >&2;}
5424    { (exit 1); exit 1; }; }
5425         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5426                 :
5427         elif test "$cf_term_lib" != predefined ; then
5428                 echo "$as_me:5428: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5429 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5430                 cat >conftest.$ac_ext <<_ACEOF
5431 #line 5431 "configure"
5432 #include "confdefs.h"
5433 #include <${cf_cv_ncurses_header:-curses.h}>
5434 int
5435 main ()
5436 {
5437 initscr(); tgoto((char *)0, 0, 0);
5438   ;
5439   return 0;
5440 }
5441 _ACEOF
5442 rm -f conftest.$ac_objext conftest$ac_exeext
5443 if { (eval echo "$as_me:5443: \"$ac_link\"") >&5
5444   (eval $ac_link) 2>&5
5445   ac_status=$?
5446   echo "$as_me:5446: \$? = $ac_status" >&5
5447   (exit $ac_status); } &&
5448          { ac_try='test -s conftest$ac_exeext'
5449   { (eval echo "$as_me:5449: \"$ac_try\"") >&5
5450   (eval $ac_try) 2>&5
5451   ac_status=$?
5452   echo "$as_me:5452: \$? = $ac_status" >&5
5453   (exit $ac_status); }; }; then
5454   cf_result=no
5455 else
5456   echo "$as_me: failed program was:" >&5
5457 cat conftest.$ac_ext >&5
5458
5459                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5460                         cat >conftest.$ac_ext <<_ACEOF
5461 #line 5461 "configure"
5462 #include "confdefs.h"
5463 #include <${cf_cv_ncurses_header:-curses.h}>
5464 int
5465 main ()
5466 {
5467 initscr()
5468   ;
5469   return 0;
5470 }
5471 _ACEOF
5472 rm -f conftest.$ac_objext conftest$ac_exeext
5473 if { (eval echo "$as_me:5473: \"$ac_link\"") >&5
5474   (eval $ac_link) 2>&5
5475   ac_status=$?
5476   echo "$as_me:5476: \$? = $ac_status" >&5
5477   (exit $ac_status); } &&
5478          { ac_try='test -s conftest$ac_exeext'
5479   { (eval echo "$as_me:5479: \"$ac_try\"") >&5
5480   (eval $ac_try) 2>&5
5481   ac_status=$?
5482   echo "$as_me:5482: \$? = $ac_status" >&5
5483   (exit $ac_status); }; }; then
5484   cf_result=yes
5485 else
5486   echo "$as_me: failed program was:" >&5
5487 cat conftest.$ac_ext >&5
5488 cf_result=error
5489 fi
5490 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5491
5492 fi
5493 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5494                 echo "$as_me:5494: result: $cf_result" >&5
5495 echo "${ECHO_T}$cf_result" >&6
5496         fi
5497 fi
5498 fi
5499
5500         ;;
5501 ncurses) #(vi
5502
5503 cf_ncuconfig_root=ncurses
5504
5505 echo "Looking for ${cf_ncuconfig_root}-config"
5506
5507 if test -n "$ac_tool_prefix"; then
5508   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5509   do
5510     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5511 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5512 echo "$as_me:5512: checking for $ac_word" >&5
5513 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5514 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5515   echo $ECHO_N "(cached) $ECHO_C" >&6
5516 else
5517   if test -n "$NCURSES_CONFIG"; then
5518   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5519 else
5520   ac_save_IFS=$IFS; IFS=$ac_path_separator
5521 ac_dummy="$PATH"
5522 for ac_dir in $ac_dummy; do
5523   IFS=$ac_save_IFS
5524   test -z "$ac_dir" && ac_dir=.
5525   $as_executable_p "$ac_dir/$ac_word" || continue
5526 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5527 echo "$as_me:5527: found $ac_dir/$ac_word" >&5
5528 break
5529 done
5530
5531 fi
5532 fi
5533 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5534 if test -n "$NCURSES_CONFIG"; then
5535   echo "$as_me:5535: result: $NCURSES_CONFIG" >&5
5536 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5537 else
5538   echo "$as_me:5538: result: no" >&5
5539 echo "${ECHO_T}no" >&6
5540 fi
5541
5542     test -n "$NCURSES_CONFIG" && break
5543   done
5544 fi
5545 if test -z "$NCURSES_CONFIG"; then
5546   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5547   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5548 do
5549   # Extract the first word of "$ac_prog", so it can be a program name with args.
5550 set dummy $ac_prog; ac_word=$2
5551 echo "$as_me:5551: checking for $ac_word" >&5
5552 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5553 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5554   echo $ECHO_N "(cached) $ECHO_C" >&6
5555 else
5556   if test -n "$ac_ct_NCURSES_CONFIG"; then
5557   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5558 else
5559   ac_save_IFS=$IFS; IFS=$ac_path_separator
5560 ac_dummy="$PATH"
5561 for ac_dir in $ac_dummy; do
5562   IFS=$ac_save_IFS
5563   test -z "$ac_dir" && ac_dir=.
5564   $as_executable_p "$ac_dir/$ac_word" || continue
5565 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5566 echo "$as_me:5566: found $ac_dir/$ac_word" >&5
5567 break
5568 done
5569
5570 fi
5571 fi
5572 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5573 if test -n "$ac_ct_NCURSES_CONFIG"; then
5574   echo "$as_me:5574: result: $ac_ct_NCURSES_CONFIG" >&5
5575 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5576 else
5577   echo "$as_me:5577: result: no" >&5
5578 echo "${ECHO_T}no" >&6
5579 fi
5580
5581   test -n "$ac_ct_NCURSES_CONFIG" && break
5582 done
5583 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5584
5585   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5586 fi
5587
5588 if test "$NCURSES_CONFIG" != none ; then
5589
5590 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5591
5592 cf_add_libs="`$NCURSES_CONFIG --libs`"
5593 # Filter out duplicates - this happens with badly-designed ".pc" files...
5594 for cf_add_1lib in $LIBS
5595 do
5596         for cf_add_2lib in $cf_add_libs
5597         do
5598                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5599                 then
5600                         cf_add_1lib=
5601                         break
5602                 fi
5603         done
5604         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5605 done
5606 LIBS="$cf_add_libs"
5607
5608 # even with config script, some packages use no-override for curses.h
5609
5610 echo "$as_me:5610: checking if we have identified curses headers" >&5
5611 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5612 if test "${cf_cv_ncurses_header+set}" = set; then
5613   echo $ECHO_N "(cached) $ECHO_C" >&6
5614 else
5615
5616 cf_cv_ncurses_header=none
5617 for cf_header in  \
5618     ncurses/ncurses.h \
5619         ncurses/curses.h \
5620         ncurses.h \
5621         curses.h
5622 do
5623 cat >conftest.$ac_ext <<_ACEOF
5624 #line 5624 "configure"
5625 #include "confdefs.h"
5626 #include <${cf_header}>
5627 int
5628 main ()
5629 {
5630 initscr(); tgoto("?", 0,0)
5631   ;
5632   return 0;
5633 }
5634 _ACEOF
5635 rm -f conftest.$ac_objext
5636 if { (eval echo "$as_me:5636: \"$ac_compile\"") >&5
5637   (eval $ac_compile) 2>&5
5638   ac_status=$?
5639   echo "$as_me:5639: \$? = $ac_status" >&5
5640   (exit $ac_status); } &&
5641          { ac_try='test -s conftest.$ac_objext'
5642   { (eval echo "$as_me:5642: \"$ac_try\"") >&5
5643   (eval $ac_try) 2>&5
5644   ac_status=$?
5645   echo "$as_me:5645: \$? = $ac_status" >&5
5646   (exit $ac_status); }; }; then
5647   cf_cv_ncurses_header=$cf_header; break
5648 else
5649   echo "$as_me: failed program was:" >&5
5650 cat conftest.$ac_ext >&5
5651 fi
5652 rm -f conftest.$ac_objext conftest.$ac_ext
5653 done
5654
5655 fi
5656 echo "$as_me:5656: result: $cf_cv_ncurses_header" >&5
5657 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5658
5659 if test "$cf_cv_ncurses_header" = none ; then
5660         { { echo "$as_me:5660: error: No curses header-files found" >&5
5661 echo "$as_me: error: No curses header-files found" >&2;}
5662    { (exit 1); exit 1; }; }
5663 fi
5664
5665 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5666
5667 for ac_header in $cf_cv_ncurses_header
5668 do
5669 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5670 echo "$as_me:5670: checking for $ac_header" >&5
5671 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5672 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5673   echo $ECHO_N "(cached) $ECHO_C" >&6
5674 else
5675   cat >conftest.$ac_ext <<_ACEOF
5676 #line 5676 "configure"
5677 #include "confdefs.h"
5678 #include <$ac_header>
5679 _ACEOF
5680 if { (eval echo "$as_me:5680: \"$ac_cpp conftest.$ac_ext\"") >&5
5681   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5682   ac_status=$?
5683   egrep -v '^ *\+' conftest.er1 >conftest.err
5684   rm -f conftest.er1
5685   cat conftest.err >&5
5686   echo "$as_me:5686: \$? = $ac_status" >&5
5687   (exit $ac_status); } >/dev/null; then
5688   if test -s conftest.err; then
5689     ac_cpp_err=$ac_c_preproc_warn_flag
5690   else
5691     ac_cpp_err=
5692   fi
5693 else
5694   ac_cpp_err=yes
5695 fi
5696 if test -z "$ac_cpp_err"; then
5697   eval "$as_ac_Header=yes"
5698 else
5699   echo "$as_me: failed program was:" >&5
5700   cat conftest.$ac_ext >&5
5701   eval "$as_ac_Header=no"
5702 fi
5703 rm -f conftest.err conftest.$ac_ext
5704 fi
5705 echo "$as_me:5705: result: `eval echo '${'$as_ac_Header'}'`" >&5
5706 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5707 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5708   cat >>confdefs.h <<EOF
5709 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5710 EOF
5711
5712 fi
5713 done
5714
5715 cat >>confdefs.h <<\EOF
5716 #define NCURSES 1
5717 EOF
5718
5719 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5720
5721 cat >>confdefs.h <<EOF
5722 #define $cf_nculib_ROOT 1
5723 EOF
5724
5725 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5726
5727 else
5728
5729 cf_ncuhdr_root=ncurses
5730
5731 test -n "$cf_cv_curses_dir" && \
5732 test "$cf_cv_curses_dir" != "no" && { \
5733
5734 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5735   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5736   do
5737         while test $cf_add_incdir != /usr/include
5738         do
5739           if test -d $cf_add_incdir
5740           then
5741                 cf_have_incdir=no
5742                 if test -n "$CFLAGS$CPPFLAGS" ; then
5743                   # a loop is needed to ensure we can add subdirs of existing dirs
5744                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5745                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5746                           cf_have_incdir=yes; break
5747                         fi
5748                   done
5749                 fi
5750
5751                 if test "$cf_have_incdir" = no ; then
5752                   if test "$cf_add_incdir" = /usr/local/include ; then
5753                         if test "$GCC" = yes
5754                         then
5755                           cf_save_CPPFLAGS=$CPPFLAGS
5756                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5757                           cat >conftest.$ac_ext <<_ACEOF
5758 #line 5758 "configure"
5759 #include "confdefs.h"
5760 #include <stdio.h>
5761 int
5762 main ()
5763 {
5764 printf("Hello")
5765   ;
5766   return 0;
5767 }
5768 _ACEOF
5769 rm -f conftest.$ac_objext
5770 if { (eval echo "$as_me:5770: \"$ac_compile\"") >&5
5771   (eval $ac_compile) 2>&5
5772   ac_status=$?
5773   echo "$as_me:5773: \$? = $ac_status" >&5
5774   (exit $ac_status); } &&
5775          { ac_try='test -s conftest.$ac_objext'
5776   { (eval echo "$as_me:5776: \"$ac_try\"") >&5
5777   (eval $ac_try) 2>&5
5778   ac_status=$?
5779   echo "$as_me:5779: \$? = $ac_status" >&5
5780   (exit $ac_status); }; }; then
5781   :
5782 else
5783   echo "$as_me: failed program was:" >&5
5784 cat conftest.$ac_ext >&5
5785 cf_have_incdir=yes
5786 fi
5787 rm -f conftest.$ac_objext conftest.$ac_ext
5788                           CPPFLAGS=$cf_save_CPPFLAGS
5789                         fi
5790                   fi
5791                 fi
5792
5793                 if test "$cf_have_incdir" = no ; then
5794                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5795
5796 echo "${as_me:-configure}:5796: testing adding $cf_add_incdir to include-path ..." 1>&5
5797
5798                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5799
5800                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5801                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5802                   cf_add_incdir="$cf_top_incdir"
5803                 else
5804                   break
5805                 fi
5806           fi
5807         done
5808   done
5809 fi
5810
5811 }
5812
5813 echo "$as_me:5813: checking for $cf_ncuhdr_root header in include-path" >&5
5814 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5815 if test "${cf_cv_ncurses_h+set}" = set; then
5816   echo $ECHO_N "(cached) $ECHO_C" >&6
5817 else
5818
5819         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5820         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5821         for cf_header in $cf_header_list
5822         do
5823
5824         cat >conftest.$ac_ext <<_ACEOF
5825 #line 5825 "configure"
5826 #include "confdefs.h"
5827
5828 #include <$cf_header>
5829 int
5830 main ()
5831 {
5832
5833 #ifdef NCURSES_VERSION
5834
5835 printf("%s\n", NCURSES_VERSION);
5836 #else
5837 #ifdef __NCURSES_H
5838 printf("old\n");
5839 #else
5840         make an error
5841 #endif
5842 #endif
5843
5844   ;
5845   return 0;
5846 }
5847 _ACEOF
5848 rm -f conftest.$ac_objext
5849 if { (eval echo "$as_me:5849: \"$ac_compile\"") >&5
5850   (eval $ac_compile) 2>&5
5851   ac_status=$?
5852   echo "$as_me:5852: \$? = $ac_status" >&5
5853   (exit $ac_status); } &&
5854          { ac_try='test -s conftest.$ac_objext'
5855   { (eval echo "$as_me:5855: \"$ac_try\"") >&5
5856   (eval $ac_try) 2>&5
5857   ac_status=$?
5858   echo "$as_me:5858: \$? = $ac_status" >&5
5859   (exit $ac_status); }; }; then
5860   cf_cv_ncurses_h=$cf_header
5861
5862 else
5863   echo "$as_me: failed program was:" >&5
5864 cat conftest.$ac_ext >&5
5865 cf_cv_ncurses_h=no
5866 fi
5867 rm -f conftest.$ac_objext conftest.$ac_ext
5868
5869                 test "$cf_cv_ncurses_h" != no && break
5870         done
5871
5872 fi
5873 echo "$as_me:5873: result: $cf_cv_ncurses_h" >&5
5874 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5875
5876 if test "$cf_cv_ncurses_h" != no ; then
5877         cf_cv_ncurses_header=$cf_cv_ncurses_h
5878 else
5879
5880 echo "$as_me:5880: checking for $cf_ncuhdr_root include-path" >&5
5881 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5882 if test "${cf_cv_ncurses_h2+set}" = set; then
5883   echo $ECHO_N "(cached) $ECHO_C" >&6
5884 else
5885
5886         test -n "$verbose" && echo
5887
5888 cf_search=
5889
5890 # collect the current set of include-directories from compiler flags
5891 cf_header_path_list=""
5892 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5893         for cf_header_path in $CPPFLAGS $CFLAGS
5894         do
5895                 case $cf_header_path in #(vi
5896                 -I*)
5897                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5898
5899 test "x$cf_header_path" != "xNONE" && \
5900 test -d "$cf_header_path" && \
5901  {
5902         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5903         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5904         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5905         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5906         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5907         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"
5908 }
5909
5910                         cf_header_path_list="$cf_header_path_list $cf_search"
5911                         ;;
5912                 esac
5913         done
5914 fi
5915
5916 # add the variations for the package we are looking for
5917
5918 cf_search=
5919
5920 test "x/usr" != "x$prefix" && \
5921 test -d "/usr" && \
5922 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
5923         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
5924         test -d /usr/include &&          cf_search="$cf_search /usr/include"
5925         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
5926         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
5927         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
5928         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5929 }
5930
5931 test "x$prefix" != "xNONE" && \
5932 test -d "$prefix" && \
5933  {
5934         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5935         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5936         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5937         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5938         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5939         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5940 }
5941
5942 test "x/usr/local" != "x$prefix" && \
5943 test -d "/usr/local" && \
5944 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
5945         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
5946         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
5947         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
5948         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
5949         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
5950         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5951 }
5952
5953 test "x/opt" != "x$prefix" && \
5954 test -d "/opt" && \
5955 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
5956         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
5957         test -d /opt/include &&          cf_search="$cf_search /opt/include"
5958         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
5959         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
5960         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
5961         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5962 }
5963
5964 test "x$HOME" != "x$prefix" && \
5965 test -d "$HOME" && \
5966 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
5967         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
5968         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
5969         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
5970         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
5971         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
5972         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5973 }
5974
5975 test "$includedir" != NONE && \
5976 test "$includedir" != "/usr/include" && \
5977 test -d "$includedir" && {
5978         test -d $includedir &&    cf_search="$cf_search $includedir"
5979         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5980 }
5981
5982 test "$oldincludedir" != NONE && \
5983 test "$oldincludedir" != "/usr/include" && \
5984 test -d "$oldincludedir" && {
5985         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5986         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5987 }
5988
5989 cf_search="$cf_search $cf_header_path_list"
5990
5991         test -n "$verbose" && echo search path $cf_search
5992         cf_save2_CPPFLAGS="$CPPFLAGS"
5993         for cf_incdir in $cf_search
5994         do
5995
5996 if test -n "$cf_incdir" ; then
5997   for cf_add_incdir in $cf_incdir
5998   do
5999         while test $cf_add_incdir != /usr/include
6000         do
6001           if test -d $cf_add_incdir
6002           then
6003                 cf_have_incdir=no
6004                 if test -n "$CFLAGS$CPPFLAGS" ; then
6005                   # a loop is needed to ensure we can add subdirs of existing dirs
6006                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6007                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6008                           cf_have_incdir=yes; break
6009                         fi
6010                   done
6011                 fi
6012
6013                 if test "$cf_have_incdir" = no ; then
6014                   if test "$cf_add_incdir" = /usr/local/include ; then
6015                         if test "$GCC" = yes
6016                         then
6017                           cf_save_CPPFLAGS=$CPPFLAGS
6018                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6019                           cat >conftest.$ac_ext <<_ACEOF
6020 #line 6020 "configure"
6021 #include "confdefs.h"
6022 #include <stdio.h>
6023 int
6024 main ()
6025 {
6026 printf("Hello")
6027   ;
6028   return 0;
6029 }
6030 _ACEOF
6031 rm -f conftest.$ac_objext
6032 if { (eval echo "$as_me:6032: \"$ac_compile\"") >&5
6033   (eval $ac_compile) 2>&5
6034   ac_status=$?
6035   echo "$as_me:6035: \$? = $ac_status" >&5
6036   (exit $ac_status); } &&
6037          { ac_try='test -s conftest.$ac_objext'
6038   { (eval echo "$as_me:6038: \"$ac_try\"") >&5
6039   (eval $ac_try) 2>&5
6040   ac_status=$?
6041   echo "$as_me:6041: \$? = $ac_status" >&5
6042   (exit $ac_status); }; }; then
6043   :
6044 else
6045   echo "$as_me: failed program was:" >&5
6046 cat conftest.$ac_ext >&5
6047 cf_have_incdir=yes
6048 fi
6049 rm -f conftest.$ac_objext conftest.$ac_ext
6050                           CPPFLAGS=$cf_save_CPPFLAGS
6051                         fi
6052                   fi
6053                 fi
6054
6055                 if test "$cf_have_incdir" = no ; then
6056                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6057
6058 echo "${as_me:-configure}:6058: testing adding $cf_add_incdir to include-path ..." 1>&5
6059
6060                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6061
6062                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6063                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6064                   cf_add_incdir="$cf_top_incdir"
6065                 else
6066                   break
6067                 fi
6068           fi
6069         done
6070   done
6071 fi
6072
6073                 for cf_header in \
6074                         ncurses.h \
6075                         curses.h
6076                 do
6077
6078         cat >conftest.$ac_ext <<_ACEOF
6079 #line 6079 "configure"
6080 #include "confdefs.h"
6081
6082 #include <$cf_header>
6083 int
6084 main ()
6085 {
6086
6087 #ifdef NCURSES_VERSION
6088
6089 printf("%s\n", NCURSES_VERSION);
6090 #else
6091 #ifdef __NCURSES_H
6092 printf("old\n");
6093 #else
6094         make an error
6095 #endif
6096 #endif
6097
6098   ;
6099   return 0;
6100 }
6101 _ACEOF
6102 rm -f conftest.$ac_objext
6103 if { (eval echo "$as_me:6103: \"$ac_compile\"") >&5
6104   (eval $ac_compile) 2>&5
6105   ac_status=$?
6106   echo "$as_me:6106: \$? = $ac_status" >&5
6107   (exit $ac_status); } &&
6108          { ac_try='test -s conftest.$ac_objext'
6109   { (eval echo "$as_me:6109: \"$ac_try\"") >&5
6110   (eval $ac_try) 2>&5
6111   ac_status=$?
6112   echo "$as_me:6112: \$? = $ac_status" >&5
6113   (exit $ac_status); }; }; then
6114   cf_cv_ncurses_h2=$cf_header
6115
6116 else
6117   echo "$as_me: failed program was:" >&5
6118 cat conftest.$ac_ext >&5
6119 cf_cv_ncurses_h2=no
6120 fi
6121 rm -f conftest.$ac_objext conftest.$ac_ext
6122
6123                         if test "$cf_cv_ncurses_h2" != no ; then
6124                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6125                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6126                                 break
6127                         fi
6128                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6129                 done
6130                 CPPFLAGS="$cf_save2_CPPFLAGS"
6131                 test "$cf_cv_ncurses_h2" != no && break
6132         done
6133         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6133: error: not found" >&5
6134 echo "$as_me: error: not found" >&2;}
6135    { (exit 1); exit 1; }; }
6136
6137 fi
6138 echo "$as_me:6138: result: $cf_cv_ncurses_h2" >&5
6139 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6140
6141         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6142         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6143         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6144                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6145         fi
6146
6147 if test -n "$cf_1st_incdir" ; then
6148   for cf_add_incdir in $cf_1st_incdir
6149   do
6150         while test $cf_add_incdir != /usr/include
6151         do
6152           if test -d $cf_add_incdir
6153           then
6154                 cf_have_incdir=no
6155                 if test -n "$CFLAGS$CPPFLAGS" ; then
6156                   # a loop is needed to ensure we can add subdirs of existing dirs
6157                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6158                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6159                           cf_have_incdir=yes; break
6160                         fi
6161                   done
6162                 fi
6163
6164                 if test "$cf_have_incdir" = no ; then
6165                   if test "$cf_add_incdir" = /usr/local/include ; then
6166                         if test "$GCC" = yes
6167                         then
6168                           cf_save_CPPFLAGS=$CPPFLAGS
6169                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6170                           cat >conftest.$ac_ext <<_ACEOF
6171 #line 6171 "configure"
6172 #include "confdefs.h"
6173 #include <stdio.h>
6174 int
6175 main ()
6176 {
6177 printf("Hello")
6178   ;
6179   return 0;
6180 }
6181 _ACEOF
6182 rm -f conftest.$ac_objext
6183 if { (eval echo "$as_me:6183: \"$ac_compile\"") >&5
6184   (eval $ac_compile) 2>&5
6185   ac_status=$?
6186   echo "$as_me:6186: \$? = $ac_status" >&5
6187   (exit $ac_status); } &&
6188          { ac_try='test -s conftest.$ac_objext'
6189   { (eval echo "$as_me:6189: \"$ac_try\"") >&5
6190   (eval $ac_try) 2>&5
6191   ac_status=$?
6192   echo "$as_me:6192: \$? = $ac_status" >&5
6193   (exit $ac_status); }; }; then
6194   :
6195 else
6196   echo "$as_me: failed program was:" >&5
6197 cat conftest.$ac_ext >&5
6198 cf_have_incdir=yes
6199 fi
6200 rm -f conftest.$ac_objext conftest.$ac_ext
6201                           CPPFLAGS=$cf_save_CPPFLAGS
6202                         fi
6203                   fi
6204                 fi
6205
6206                 if test "$cf_have_incdir" = no ; then
6207                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6208
6209 echo "${as_me:-configure}:6209: testing adding $cf_add_incdir to include-path ..." 1>&5
6210
6211                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6212
6213                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6214                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6215                   cf_add_incdir="$cf_top_incdir"
6216                 else
6217                   break
6218                 fi
6219           fi
6220         done
6221   done
6222 fi
6223
6224 fi
6225
6226 # Set definitions to allow ifdef'ing for ncurses.h
6227
6228 case $cf_cv_ncurses_header in # (vi
6229 *ncurses.h)
6230
6231 cat >>confdefs.h <<\EOF
6232 #define HAVE_NCURSES_H 1
6233 EOF
6234
6235         ;;
6236 esac
6237
6238 case $cf_cv_ncurses_header in # (vi
6239 ncurses/curses.h|ncurses/ncurses.h)
6240
6241 cat >>confdefs.h <<\EOF
6242 #define HAVE_NCURSES_NCURSES_H 1
6243 EOF
6244
6245         ;;
6246 ncursesw/curses.h|ncursesw/ncurses.h)
6247
6248 cat >>confdefs.h <<\EOF
6249 #define HAVE_NCURSESW_NCURSES_H 1
6250 EOF
6251
6252         ;;
6253 esac
6254
6255 echo "$as_me:6255: checking for terminfo header" >&5
6256 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6257 if test "${cf_cv_term_header+set}" = set; then
6258   echo $ECHO_N "(cached) $ECHO_C" >&6
6259 else
6260
6261 case ${cf_cv_ncurses_header} in #(vi
6262 */ncurses.h|*/ncursesw.h) #(vi
6263         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6264         ;;
6265 *)
6266         cf_term_header=term.h
6267         ;;
6268 esac
6269
6270 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6271 do
6272 cat >conftest.$ac_ext <<_ACEOF
6273 #line 6273 "configure"
6274 #include "confdefs.h"
6275 #include <stdio.h>
6276 #include <${cf_cv_ncurses_header:-curses.h}>
6277 #include <$cf_test>
6278
6279 int
6280 main ()
6281 {
6282 int x = auto_left_margin
6283   ;
6284   return 0;
6285 }
6286 _ACEOF
6287 rm -f conftest.$ac_objext
6288 if { (eval echo "$as_me:6288: \"$ac_compile\"") >&5
6289   (eval $ac_compile) 2>&5
6290   ac_status=$?
6291   echo "$as_me:6291: \$? = $ac_status" >&5
6292   (exit $ac_status); } &&
6293          { ac_try='test -s conftest.$ac_objext'
6294   { (eval echo "$as_me:6294: \"$ac_try\"") >&5
6295   (eval $ac_try) 2>&5
6296   ac_status=$?
6297   echo "$as_me:6297: \$? = $ac_status" >&5
6298   (exit $ac_status); }; }; then
6299
6300         cf_cv_term_header="$cf_test"
6301 else
6302   echo "$as_me: failed program was:" >&5
6303 cat conftest.$ac_ext >&5
6304
6305         cf_cv_term_header=unknown
6306
6307 fi
6308 rm -f conftest.$ac_objext conftest.$ac_ext
6309         test "$cf_cv_term_header" != unknown && break
6310 done
6311
6312 fi
6313 echo "$as_me:6313: result: $cf_cv_term_header" >&5
6314 echo "${ECHO_T}$cf_cv_term_header" >&6
6315
6316 # Set definitions to allow ifdef'ing to accommodate subdirectories
6317
6318 case $cf_cv_term_header in # (vi
6319 *term.h)
6320
6321 cat >>confdefs.h <<\EOF
6322 #define HAVE_TERM_H 1
6323 EOF
6324
6325         ;;
6326 esac
6327
6328 case $cf_cv_term_header in # (vi
6329 ncurses/term.h) #(vi
6330
6331 cat >>confdefs.h <<\EOF
6332 #define HAVE_NCURSES_TERM_H 1
6333 EOF
6334
6335         ;;
6336 ncursesw/term.h)
6337
6338 cat >>confdefs.h <<\EOF
6339 #define HAVE_NCURSESW_TERM_H 1
6340 EOF
6341
6342         ;;
6343 esac
6344
6345 # some applications need this, but should check for NCURSES_VERSION
6346
6347 cat >>confdefs.h <<\EOF
6348 #define NCURSES 1
6349 EOF
6350
6351 echo "$as_me:6351: checking for ncurses version" >&5
6352 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6353 if test "${cf_cv_ncurses_version+set}" = set; then
6354   echo $ECHO_N "(cached) $ECHO_C" >&6
6355 else
6356
6357         cf_cv_ncurses_version=no
6358         cf_tempfile=out$$
6359         rm -f $cf_tempfile
6360         if test "$cross_compiling" = yes; then
6361
6362         # This will not work if the preprocessor splits the line after the
6363         # Autoconf token.  The 'unproto' program does that.
6364         cat > conftest.$ac_ext <<EOF
6365 #include <${cf_cv_ncurses_header:-curses.h}>
6366 #undef Autoconf
6367 #ifdef NCURSES_VERSION
6368 Autoconf NCURSES_VERSION
6369 #else
6370 #ifdef __NCURSES_H
6371 Autoconf "old"
6372 #endif
6373 ;
6374 #endif
6375 EOF
6376         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6377         { (eval echo "$as_me:6377: \"$cf_try\"") >&5
6378   (eval $cf_try) 2>&5
6379   ac_status=$?
6380   echo "$as_me:6380: \$? = $ac_status" >&5
6381   (exit $ac_status); }
6382         if test -f conftest.out ; then
6383                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6384                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6385                 rm -f conftest.out
6386         fi
6387
6388 else
6389   cat >conftest.$ac_ext <<_ACEOF
6390 #line 6390 "configure"
6391 #include "confdefs.h"
6392
6393 #include <${cf_cv_ncurses_header:-curses.h}>
6394 #include <stdio.h>
6395 int main()
6396 {
6397         FILE *fp = fopen("$cf_tempfile", "w");
6398 #ifdef NCURSES_VERSION
6399 # ifdef NCURSES_VERSION_PATCH
6400         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6401 # else
6402         fprintf(fp, "%s\n", NCURSES_VERSION);
6403 # endif
6404 #else
6405 # ifdef __NCURSES_H
6406         fprintf(fp, "old\n");
6407 # else
6408         make an error
6409 # endif
6410 #endif
6411         ${cf_cv_main_return:-return}(0);
6412 }
6413 _ACEOF
6414 rm -f conftest$ac_exeext
6415 if { (eval echo "$as_me:6415: \"$ac_link\"") >&5
6416   (eval $ac_link) 2>&5
6417   ac_status=$?
6418   echo "$as_me:6418: \$? = $ac_status" >&5
6419   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6420   { (eval echo "$as_me:6420: \"$ac_try\"") >&5
6421   (eval $ac_try) 2>&5
6422   ac_status=$?
6423   echo "$as_me:6423: \$? = $ac_status" >&5
6424   (exit $ac_status); }; }; then
6425
6426         cf_cv_ncurses_version=`cat $cf_tempfile`
6427 else
6428   echo "$as_me: program exited with status $ac_status" >&5
6429 echo "$as_me: failed program was:" >&5
6430 cat conftest.$ac_ext >&5
6431 fi
6432 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6433 fi
6434         rm -f $cf_tempfile
6435
6436 fi
6437 echo "$as_me:6437: result: $cf_cv_ncurses_version" >&5
6438 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6439 test "$cf_cv_ncurses_version" = no ||
6440 cat >>confdefs.h <<\EOF
6441 #define NCURSES 1
6442 EOF
6443
6444 cf_nculib_root=ncurses
6445         # This works, except for the special case where we find gpm, but
6446         # ncurses is in a nonstandard location via $LIBS, and we really want
6447         # to link gpm.
6448 cf_ncurses_LIBS=""
6449 cf_ncurses_SAVE="$LIBS"
6450 echo "$as_me:6450: checking for Gpm_Open in -lgpm" >&5
6451 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6452 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6453   echo $ECHO_N "(cached) $ECHO_C" >&6
6454 else
6455   ac_check_lib_save_LIBS=$LIBS
6456 LIBS="-lgpm  $LIBS"
6457 cat >conftest.$ac_ext <<_ACEOF
6458 #line 6458 "configure"
6459 #include "confdefs.h"
6460
6461 /* Override any gcc2 internal prototype to avoid an error.  */
6462 #ifdef __cplusplus
6463 extern "C"
6464 #endif
6465 /* We use char because int might match the return type of a gcc2
6466    builtin and then its argument prototype would still apply.  */
6467 char Gpm_Open ();
6468 int
6469 main ()
6470 {
6471 Gpm_Open ();
6472   ;
6473   return 0;
6474 }
6475 _ACEOF
6476 rm -f conftest.$ac_objext conftest$ac_exeext
6477 if { (eval echo "$as_me:6477: \"$ac_link\"") >&5
6478   (eval $ac_link) 2>&5
6479   ac_status=$?
6480   echo "$as_me:6480: \$? = $ac_status" >&5
6481   (exit $ac_status); } &&
6482          { ac_try='test -s conftest$ac_exeext'
6483   { (eval echo "$as_me:6483: \"$ac_try\"") >&5
6484   (eval $ac_try) 2>&5
6485   ac_status=$?
6486   echo "$as_me:6486: \$? = $ac_status" >&5
6487   (exit $ac_status); }; }; then
6488   ac_cv_lib_gpm_Gpm_Open=yes
6489 else
6490   echo "$as_me: failed program was:" >&5
6491 cat conftest.$ac_ext >&5
6492 ac_cv_lib_gpm_Gpm_Open=no
6493 fi
6494 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6495 LIBS=$ac_check_lib_save_LIBS
6496 fi
6497 echo "$as_me:6497: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6498 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6499 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6500   echo "$as_me:6500: checking for initscr in -lgpm" >&5
6501 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6502 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6503   echo $ECHO_N "(cached) $ECHO_C" >&6
6504 else
6505   ac_check_lib_save_LIBS=$LIBS
6506 LIBS="-lgpm  $LIBS"
6507 cat >conftest.$ac_ext <<_ACEOF
6508 #line 6508 "configure"
6509 #include "confdefs.h"
6510
6511 /* Override any gcc2 internal prototype to avoid an error.  */
6512 #ifdef __cplusplus
6513 extern "C"
6514 #endif
6515 /* We use char because int might match the return type of a gcc2
6516    builtin and then its argument prototype would still apply.  */
6517 char initscr ();
6518 int
6519 main ()
6520 {
6521 initscr ();
6522   ;
6523   return 0;
6524 }
6525 _ACEOF
6526 rm -f conftest.$ac_objext conftest$ac_exeext
6527 if { (eval echo "$as_me:6527: \"$ac_link\"") >&5
6528   (eval $ac_link) 2>&5
6529   ac_status=$?
6530   echo "$as_me:6530: \$? = $ac_status" >&5
6531   (exit $ac_status); } &&
6532          { ac_try='test -s conftest$ac_exeext'
6533   { (eval echo "$as_me:6533: \"$ac_try\"") >&5
6534   (eval $ac_try) 2>&5
6535   ac_status=$?
6536   echo "$as_me:6536: \$? = $ac_status" >&5
6537   (exit $ac_status); }; }; then
6538   ac_cv_lib_gpm_initscr=yes
6539 else
6540   echo "$as_me: failed program was:" >&5
6541 cat conftest.$ac_ext >&5
6542 ac_cv_lib_gpm_initscr=no
6543 fi
6544 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6545 LIBS=$ac_check_lib_save_LIBS
6546 fi
6547 echo "$as_me:6547: result: $ac_cv_lib_gpm_initscr" >&5
6548 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6549 if test $ac_cv_lib_gpm_initscr = yes; then
6550   LIBS="$cf_ncurses_SAVE"
6551 else
6552   cf_ncurses_LIBS="-lgpm"
6553 fi
6554
6555 fi
6556
6557 case $host_os in #(vi
6558 freebsd*)
6559         # This is only necessary if you are linking against an obsolete
6560         # version of ncurses (but it should do no harm, since it's static).
6561         if test "$cf_nculib_root" = ncurses ; then
6562                 echo "$as_me:6562: checking for tgoto in -lmytinfo" >&5
6563 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6564 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6565   echo $ECHO_N "(cached) $ECHO_C" >&6
6566 else
6567   ac_check_lib_save_LIBS=$LIBS
6568 LIBS="-lmytinfo  $LIBS"
6569 cat >conftest.$ac_ext <<_ACEOF
6570 #line 6570 "configure"
6571 #include "confdefs.h"
6572
6573 /* Override any gcc2 internal prototype to avoid an error.  */
6574 #ifdef __cplusplus
6575 extern "C"
6576 #endif
6577 /* We use char because int might match the return type of a gcc2
6578    builtin and then its argument prototype would still apply.  */
6579 char tgoto ();
6580 int
6581 main ()
6582 {
6583 tgoto ();
6584   ;
6585   return 0;
6586 }
6587 _ACEOF
6588 rm -f conftest.$ac_objext conftest$ac_exeext
6589 if { (eval echo "$as_me:6589: \"$ac_link\"") >&5
6590   (eval $ac_link) 2>&5
6591   ac_status=$?
6592   echo "$as_me:6592: \$? = $ac_status" >&5
6593   (exit $ac_status); } &&
6594          { ac_try='test -s conftest$ac_exeext'
6595   { (eval echo "$as_me:6595: \"$ac_try\"") >&5
6596   (eval $ac_try) 2>&5
6597   ac_status=$?
6598   echo "$as_me:6598: \$? = $ac_status" >&5
6599   (exit $ac_status); }; }; then
6600   ac_cv_lib_mytinfo_tgoto=yes
6601 else
6602   echo "$as_me: failed program was:" >&5
6603 cat conftest.$ac_ext >&5
6604 ac_cv_lib_mytinfo_tgoto=no
6605 fi
6606 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6607 LIBS=$ac_check_lib_save_LIBS
6608 fi
6609 echo "$as_me:6609: result: $ac_cv_lib_mytinfo_tgoto" >&5
6610 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6611 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6612   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6613 fi
6614
6615         fi
6616         ;;
6617 esac
6618
6619 cf_add_libs="$cf_ncurses_LIBS"
6620 # Filter out duplicates - this happens with badly-designed ".pc" files...
6621 for cf_add_1lib in $LIBS
6622 do
6623         for cf_add_2lib in $cf_add_libs
6624         do
6625                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6626                 then
6627                         cf_add_1lib=
6628                         break
6629                 fi
6630         done
6631         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6632 done
6633 LIBS="$cf_add_libs"
6634
6635 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6636 then
6637
6638 cf_add_libs="-l$cf_nculib_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 else
6655
6656         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6657         cf_libdir=""
6658         echo "$as_me:6658: checking for initscr" >&5
6659 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6660 if test "${ac_cv_func_initscr+set}" = set; then
6661   echo $ECHO_N "(cached) $ECHO_C" >&6
6662 else
6663   cat >conftest.$ac_ext <<_ACEOF
6664 #line 6664 "configure"
6665 #include "confdefs.h"
6666 /* System header to define __stub macros and hopefully few prototypes,
6667     which can conflict with char initscr (); below.  */
6668 #include <assert.h>
6669 /* Override any gcc2 internal prototype to avoid an error.  */
6670 #ifdef __cplusplus
6671 extern "C"
6672 #endif
6673 /* We use char because int might match the return type of a gcc2
6674    builtin and then its argument prototype would still apply.  */
6675 char initscr ();
6676 char (*f) ();
6677
6678 int
6679 main ()
6680 {
6681 /* The GNU C library defines this for functions which it implements
6682     to always fail with ENOSYS.  Some functions are actually named
6683     something starting with __ and the normal name is an alias.  */
6684 #if defined (__stub_initscr) || defined (__stub___initscr)
6685 choke me
6686 #else
6687 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6688 #endif
6689
6690   ;
6691   return 0;
6692 }
6693 _ACEOF
6694 rm -f conftest.$ac_objext conftest$ac_exeext
6695 if { (eval echo "$as_me:6695: \"$ac_link\"") >&5
6696   (eval $ac_link) 2>&5
6697   ac_status=$?
6698   echo "$as_me:6698: \$? = $ac_status" >&5
6699   (exit $ac_status); } &&
6700          { ac_try='test -s conftest$ac_exeext'
6701   { (eval echo "$as_me:6701: \"$ac_try\"") >&5
6702   (eval $ac_try) 2>&5
6703   ac_status=$?
6704   echo "$as_me:6704: \$? = $ac_status" >&5
6705   (exit $ac_status); }; }; then
6706   ac_cv_func_initscr=yes
6707 else
6708   echo "$as_me: failed program was:" >&5
6709 cat conftest.$ac_ext >&5
6710 ac_cv_func_initscr=no
6711 fi
6712 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6713 fi
6714 echo "$as_me:6714: result: $ac_cv_func_initscr" >&5
6715 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6716 if test $ac_cv_func_initscr = yes; then
6717   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6718 else
6719
6720                 cf_save_LIBS="$LIBS"
6721                 echo "$as_me:6721: checking for initscr in -l$cf_nculib_root" >&5
6722 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6723                 LIBS="-l$cf_nculib_root $LIBS"
6724                 cat >conftest.$ac_ext <<_ACEOF
6725 #line 6725 "configure"
6726 #include "confdefs.h"
6727 #include <${cf_cv_ncurses_header:-curses.h}>
6728 int
6729 main ()
6730 {
6731 initscr()
6732   ;
6733   return 0;
6734 }
6735 _ACEOF
6736 rm -f conftest.$ac_objext conftest$ac_exeext
6737 if { (eval echo "$as_me:6737: \"$ac_link\"") >&5
6738   (eval $ac_link) 2>&5
6739   ac_status=$?
6740   echo "$as_me:6740: \$? = $ac_status" >&5
6741   (exit $ac_status); } &&
6742          { ac_try='test -s conftest$ac_exeext'
6743   { (eval echo "$as_me:6743: \"$ac_try\"") >&5
6744   (eval $ac_try) 2>&5
6745   ac_status=$?
6746   echo "$as_me:6746: \$? = $ac_status" >&5
6747   (exit $ac_status); }; }; then
6748   echo "$as_me:6748: result: yes" >&5
6749 echo "${ECHO_T}yes" >&6
6750                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6751
6752 else
6753   echo "$as_me: failed program was:" >&5
6754 cat conftest.$ac_ext >&5
6755 echo "$as_me:6755: result: no" >&5
6756 echo "${ECHO_T}no" >&6
6757
6758 cf_search=
6759 cf_library_path_list=""
6760 if test -n "${LDFLAGS}${LIBS}" ; then
6761         for cf_library_path in $LDFLAGS $LIBS
6762         do
6763                 case $cf_library_path in #(vi
6764                 -L*)
6765                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6766
6767 test "x$cf_library_path" != "xNONE" && \
6768 test -d "$cf_library_path" && \
6769  {
6770         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6771         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6772         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6773         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6774         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6775         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"
6776 }
6777
6778                         cf_library_path_list="$cf_library_path_list $cf_search"
6779                         ;;
6780                 esac
6781         done
6782 fi
6783
6784 cf_search=
6785
6786 test "x/usr" != "x$prefix" && \
6787 test -d "/usr" && \
6788 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
6789         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6790         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6791         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
6792         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
6793         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
6794         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
6795 }
6796
6797 test "x$prefix" != "xNONE" && \
6798 test -d "$prefix" && \
6799  {
6800         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6801         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6802         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6803         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6804         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6805         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6806 }
6807
6808 test "x/usr/local" != "x$prefix" && \
6809 test -d "/usr/local" && \
6810 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
6811         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6812         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6813         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
6814         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
6815         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
6816         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
6817 }
6818
6819 test "x/opt" != "x$prefix" && \
6820 test -d "/opt" && \
6821 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
6822         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6823         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6824         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
6825         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
6826         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
6827         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
6828 }
6829
6830 test "x$HOME" != "x$prefix" && \
6831 test -d "$HOME" && \
6832 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
6833         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6834         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6835         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
6836         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
6837         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
6838         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
6839 }
6840
6841 cf_search="$cf_library_path_list $cf_search"
6842
6843                         for cf_libdir in $cf_search
6844                         do
6845                                 echo "$as_me:6845: checking for -l$cf_nculib_root in $cf_libdir" >&5
6846 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6847                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6848                                 cat >conftest.$ac_ext <<_ACEOF
6849 #line 6849 "configure"
6850 #include "confdefs.h"
6851 #include <${cf_cv_ncurses_header:-curses.h}>
6852 int
6853 main ()
6854 {
6855 initscr()
6856   ;
6857   return 0;
6858 }
6859 _ACEOF
6860 rm -f conftest.$ac_objext conftest$ac_exeext
6861 if { (eval echo "$as_me:6861: \"$ac_link\"") >&5
6862   (eval $ac_link) 2>&5
6863   ac_status=$?
6864   echo "$as_me:6864: \$? = $ac_status" >&5
6865   (exit $ac_status); } &&
6866          { ac_try='test -s conftest$ac_exeext'
6867   { (eval echo "$as_me:6867: \"$ac_try\"") >&5
6868   (eval $ac_try) 2>&5
6869   ac_status=$?
6870   echo "$as_me:6870: \$? = $ac_status" >&5
6871   (exit $ac_status); }; }; then
6872   echo "$as_me:6872: result: yes" >&5
6873 echo "${ECHO_T}yes" >&6
6874                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6875                                          break
6876 else
6877   echo "$as_me: failed program was:" >&5
6878 cat conftest.$ac_ext >&5
6879 echo "$as_me:6879: result: no" >&5
6880 echo "${ECHO_T}no" >&6
6881                                          LIBS="$cf_save_LIBS"
6882 fi
6883 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6884                         done
6885
6886 fi
6887 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6888
6889 fi
6890
6891 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6892
6893 if test $cf_found_library = no ; then
6894         { { echo "$as_me:6894: error: Cannot link $cf_nculib_root library" >&5
6895 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6896    { (exit 1); exit 1; }; }
6897 fi
6898
6899 fi
6900
6901 if test -n "$cf_ncurses_LIBS" ; then
6902         echo "$as_me:6902: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6903 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6904         cf_ncurses_SAVE="$LIBS"
6905         for p in $cf_ncurses_LIBS ; do
6906                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6907                 if test "$q" != "$LIBS" ; then
6908                         LIBS="$q"
6909                 fi
6910         done
6911         cat >conftest.$ac_ext <<_ACEOF
6912 #line 6912 "configure"
6913 #include "confdefs.h"
6914 #include <${cf_cv_ncurses_header:-curses.h}>
6915 int
6916 main ()
6917 {
6918 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6919   ;
6920   return 0;
6921 }
6922 _ACEOF
6923 rm -f conftest.$ac_objext conftest$ac_exeext
6924 if { (eval echo "$as_me:6924: \"$ac_link\"") >&5
6925   (eval $ac_link) 2>&5
6926   ac_status=$?
6927   echo "$as_me:6927: \$? = $ac_status" >&5
6928   (exit $ac_status); } &&
6929          { ac_try='test -s conftest$ac_exeext'
6930   { (eval echo "$as_me:6930: \"$ac_try\"") >&5
6931   (eval $ac_try) 2>&5
6932   ac_status=$?
6933   echo "$as_me:6933: \$? = $ac_status" >&5
6934   (exit $ac_status); }; }; then
6935   echo "$as_me:6935: result: yes" >&5
6936 echo "${ECHO_T}yes" >&6
6937 else
6938   echo "$as_me: failed program was:" >&5
6939 cat conftest.$ac_ext >&5
6940 echo "$as_me:6940: result: no" >&5
6941 echo "${ECHO_T}no" >&6
6942                  LIBS="$cf_ncurses_SAVE"
6943 fi
6944 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6945 fi
6946
6947 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6948
6949 cat >>confdefs.h <<EOF
6950 #define $cf_nculib_ROOT 1
6951 EOF
6952
6953 fi
6954
6955         ;;
6956 ncursesw) #(vi
6957
6958 echo "$as_me:6958: checking for multibyte character support" >&5
6959 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6960 if test "${cf_cv_utf8_lib+set}" = set; then
6961   echo $ECHO_N "(cached) $ECHO_C" >&6
6962 else
6963
6964         cf_save_LIBS="$LIBS"
6965         cat >conftest.$ac_ext <<_ACEOF
6966 #line 6966 "configure"
6967 #include "confdefs.h"
6968
6969 #include <stdlib.h>
6970 int
6971 main ()
6972 {
6973 putwc(0,0);
6974   ;
6975   return 0;
6976 }
6977 _ACEOF
6978 rm -f conftest.$ac_objext conftest$ac_exeext
6979 if { (eval echo "$as_me:6979: \"$ac_link\"") >&5
6980   (eval $ac_link) 2>&5
6981   ac_status=$?
6982   echo "$as_me:6982: \$? = $ac_status" >&5
6983   (exit $ac_status); } &&
6984          { ac_try='test -s conftest$ac_exeext'
6985   { (eval echo "$as_me:6985: \"$ac_try\"") >&5
6986   (eval $ac_try) 2>&5
6987   ac_status=$?
6988   echo "$as_me:6988: \$? = $ac_status" >&5
6989   (exit $ac_status); }; }; then
6990   cf_cv_utf8_lib=yes
6991 else
6992   echo "$as_me: failed program was:" >&5
6993 cat conftest.$ac_ext >&5
6994
6995 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6996 # will be set on completion of the AC_TRY_LINK below.
6997 cf_cv_header_path_utf8=
6998 cf_cv_library_path_utf8=
6999
7000 echo "${as_me:-configure}:7000: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7001
7002 cf_save_LIBS="$LIBS"
7003
7004 cat >conftest.$ac_ext <<_ACEOF
7005 #line 7005 "configure"
7006 #include "confdefs.h"
7007
7008 #include <libutf8.h>
7009 int
7010 main ()
7011 {
7012 putwc(0,0);
7013   ;
7014   return 0;
7015 }
7016 _ACEOF
7017 rm -f conftest.$ac_objext conftest$ac_exeext
7018 if { (eval echo "$as_me:7018: \"$ac_link\"") >&5
7019   (eval $ac_link) 2>&5
7020   ac_status=$?
7021   echo "$as_me:7021: \$? = $ac_status" >&5
7022   (exit $ac_status); } &&
7023          { ac_try='test -s conftest$ac_exeext'
7024   { (eval echo "$as_me:7024: \"$ac_try\"") >&5
7025   (eval $ac_try) 2>&5
7026   ac_status=$?
7027   echo "$as_me:7027: \$? = $ac_status" >&5
7028   (exit $ac_status); }; }; then
7029
7030         cf_cv_find_linkage_utf8=yes
7031         cf_cv_header_path_utf8=/usr/include
7032         cf_cv_library_path_utf8=/usr/lib
7033
7034 else
7035   echo "$as_me: failed program was:" >&5
7036 cat conftest.$ac_ext >&5
7037
7038 LIBS="-lutf8  $cf_save_LIBS"
7039
7040 cat >conftest.$ac_ext <<_ACEOF
7041 #line 7041 "configure"
7042 #include "confdefs.h"
7043
7044 #include <libutf8.h>
7045 int
7046 main ()
7047 {
7048 putwc(0,0);
7049   ;
7050   return 0;
7051 }
7052 _ACEOF
7053 rm -f conftest.$ac_objext conftest$ac_exeext
7054 if { (eval echo "$as_me:7054: \"$ac_link\"") >&5
7055   (eval $ac_link) 2>&5
7056   ac_status=$?
7057   echo "$as_me:7057: \$? = $ac_status" >&5
7058   (exit $ac_status); } &&
7059          { ac_try='test -s conftest$ac_exeext'
7060   { (eval echo "$as_me:7060: \"$ac_try\"") >&5
7061   (eval $ac_try) 2>&5
7062   ac_status=$?
7063   echo "$as_me:7063: \$? = $ac_status" >&5
7064   (exit $ac_status); }; }; then
7065
7066         cf_cv_find_linkage_utf8=yes
7067         cf_cv_header_path_utf8=/usr/include
7068         cf_cv_library_path_utf8=/usr/lib
7069         cf_cv_library_file_utf8="-lutf8"
7070
7071 else
7072   echo "$as_me: failed program was:" >&5
7073 cat conftest.$ac_ext >&5
7074
7075         cf_cv_find_linkage_utf8=no
7076         LIBS="$cf_save_LIBS"
7077
7078     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
7079
7080 echo "${as_me:-configure}:7080: testing find linkage for utf8 library ..." 1>&5
7081
7082 echo "${as_me:-configure}:7082: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7083
7084     cf_save_CPPFLAGS="$CPPFLAGS"
7085     cf_test_CPPFLAGS="$CPPFLAGS"
7086
7087 cf_search=
7088
7089 # collect the current set of include-directories from compiler flags
7090 cf_header_path_list=""
7091 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7092         for cf_header_path in $CPPFLAGS $CFLAGS
7093         do
7094                 case $cf_header_path in #(vi
7095                 -I*)
7096                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7097
7098 test "x$cf_header_path" != "xNONE" && \
7099 test -d "$cf_header_path" && \
7100  {
7101         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7102         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7103         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7104         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7105         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7106         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7107 }
7108
7109                         cf_header_path_list="$cf_header_path_list $cf_search"
7110                         ;;
7111                 esac
7112         done
7113 fi
7114
7115 # add the variations for the package we are looking for
7116
7117 cf_search=
7118
7119 test "x/usr" != "x$prefix" && \
7120 test -d "/usr" && \
7121 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
7122         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7123         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7124         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
7125         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
7126         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
7127         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
7128 }
7129
7130 test "x$prefix" != "xNONE" && \
7131 test -d "$prefix" && \
7132  {
7133         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7134         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7135         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7136         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7137         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7138         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7139 }
7140
7141 test "x/usr/local" != "x$prefix" && \
7142 test -d "/usr/local" && \
7143 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
7144         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
7145         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
7146         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
7147         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
7148         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
7149         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
7150 }
7151
7152 test "x/opt" != "x$prefix" && \
7153 test -d "/opt" && \
7154 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
7155         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
7156         test -d /opt/include &&          cf_search="$cf_search /opt/include"
7157         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
7158         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
7159         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
7160         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
7161 }
7162
7163 test "x$HOME" != "x$prefix" && \
7164 test -d "$HOME" && \
7165 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
7166         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
7167         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
7168         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
7169         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
7170         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
7171         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
7172 }
7173
7174 test "$includedir" != NONE && \
7175 test "$includedir" != "/usr/include" && \
7176 test -d "$includedir" && {
7177         test -d $includedir &&    cf_search="$cf_search $includedir"
7178         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7179 }
7180
7181 test "$oldincludedir" != NONE && \
7182 test "$oldincludedir" != "/usr/include" && \
7183 test -d "$oldincludedir" && {
7184         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7185         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7186 }
7187
7188 cf_search="$cf_search $cf_header_path_list"
7189
7190     for cf_cv_header_path_utf8 in $cf_search
7191     do
7192       if test -d $cf_cv_header_path_utf8 ; then
7193         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7194
7195 echo "${as_me:-configure}:7195: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7196
7197         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
7198         cat >conftest.$ac_ext <<_ACEOF
7199 #line 7199 "configure"
7200 #include "confdefs.h"
7201
7202 #include <libutf8.h>
7203 int
7204 main ()
7205 {
7206 putwc(0,0);
7207   ;
7208   return 0;
7209 }
7210 _ACEOF
7211 rm -f conftest.$ac_objext
7212 if { (eval echo "$as_me:7212: \"$ac_compile\"") >&5
7213   (eval $ac_compile) 2>&5
7214   ac_status=$?
7215   echo "$as_me:7215: \$? = $ac_status" >&5
7216   (exit $ac_status); } &&
7217          { ac_try='test -s conftest.$ac_objext'
7218   { (eval echo "$as_me:7218: \"$ac_try\"") >&5
7219   (eval $ac_try) 2>&5
7220   ac_status=$?
7221   echo "$as_me:7221: \$? = $ac_status" >&5
7222   (exit $ac_status); }; }; then
7223
7224             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7225
7226 echo "${as_me:-configure}:7226: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7227
7228             cf_cv_find_linkage_utf8=maybe
7229             cf_test_CPPFLAGS="$CPPFLAGS"
7230             break
7231 else
7232   echo "$as_me: failed program was:" >&5
7233 cat conftest.$ac_ext >&5
7234
7235             CPPFLAGS="$cf_save_CPPFLAGS"
7236
7237 fi
7238 rm -f conftest.$ac_objext conftest.$ac_ext
7239       fi
7240     done
7241
7242     if test "$cf_cv_find_linkage_utf8" = maybe ; then
7243
7244 echo "${as_me:-configure}:7244: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7245
7246       cf_save_LIBS="$LIBS"
7247       cf_save_LDFLAGS="$LDFLAGS"
7248
7249       if test "$cf_cv_find_linkage_utf8" != yes ; then
7250
7251 cf_search=
7252 cf_library_path_list=""
7253 if test -n "${LDFLAGS}${LIBS}" ; then
7254         for cf_library_path in $LDFLAGS $LIBS
7255         do
7256                 case $cf_library_path in #(vi
7257                 -L*)
7258                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7259
7260 test "x$cf_library_path" != "xNONE" && \
7261 test -d "$cf_library_path" && \
7262  {
7263         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7264         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7265         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7266         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7267         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7268         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7269 }
7270
7271                         cf_library_path_list="$cf_library_path_list $cf_search"
7272                         ;;
7273                 esac
7274         done
7275 fi
7276
7277 cf_search=
7278
7279 test "x/usr" != "x$prefix" && \
7280 test -d "/usr" && \
7281 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
7282         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7283         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7284         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
7285         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
7286         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
7287         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
7288 }
7289
7290 test "x$prefix" != "xNONE" && \
7291 test -d "$prefix" && \
7292  {
7293         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7294         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7295         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7296         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7297         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7298         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7299 }
7300
7301 test "x/usr/local" != "x$prefix" && \
7302 test -d "/usr/local" && \
7303 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
7304         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7305         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7306         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
7307         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
7308         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
7309         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
7310 }
7311
7312 test "x/opt" != "x$prefix" && \
7313 test -d "/opt" && \
7314 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
7315         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7316         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7317         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
7318         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
7319         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
7320         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
7321 }
7322
7323 test "x$HOME" != "x$prefix" && \
7324 test -d "$HOME" && \
7325 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
7326         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7327         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7328         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
7329         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
7330         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
7331         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
7332 }
7333
7334 cf_search="$cf_library_path_list $cf_search"
7335
7336         for cf_cv_library_path_utf8 in $cf_search
7337         do
7338           if test -d $cf_cv_library_path_utf8 ; then
7339             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
7340
7341 echo "${as_me:-configure}:7341: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7342
7343             CPPFLAGS="$cf_test_CPPFLAGS"
7344             LIBS="-lutf8  $cf_save_LIBS"
7345             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7346             cat >conftest.$ac_ext <<_ACEOF
7347 #line 7347 "configure"
7348 #include "confdefs.h"
7349
7350 #include <libutf8.h>
7351 int
7352 main ()
7353 {
7354 putwc(0,0);
7355   ;
7356   return 0;
7357 }
7358 _ACEOF
7359 rm -f conftest.$ac_objext conftest$ac_exeext
7360 if { (eval echo "$as_me:7360: \"$ac_link\"") >&5
7361   (eval $ac_link) 2>&5
7362   ac_status=$?
7363   echo "$as_me:7363: \$? = $ac_status" >&5
7364   (exit $ac_status); } &&
7365          { ac_try='test -s conftest$ac_exeext'
7366   { (eval echo "$as_me:7366: \"$ac_try\"") >&5
7367   (eval $ac_try) 2>&5
7368   ac_status=$?
7369   echo "$as_me:7369: \$? = $ac_status" >&5
7370   (exit $ac_status); }; }; then
7371
7372                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7373
7374 echo "${as_me:-configure}:7374: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7375
7376                 cf_cv_find_linkage_utf8=yes
7377                 cf_cv_library_file_utf8="-lutf8"
7378                 break
7379 else
7380   echo "$as_me: failed program was:" >&5
7381 cat conftest.$ac_ext >&5
7382
7383                 CPPFLAGS="$cf_save_CPPFLAGS"
7384                 LIBS="$cf_save_LIBS"
7385                 LDFLAGS="$cf_save_LDFLAGS"
7386
7387 fi
7388 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7389           fi
7390         done
7391         CPPFLAGS="$cf_save_CPPFLAGS"
7392         LDFLAGS="$cf_save_LDFLAGS"
7393       fi
7394
7395     else
7396       cf_cv_find_linkage_utf8=no
7397     fi
7398
7399 fi
7400 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7401
7402 fi
7403 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7404
7405 LIBS="$cf_save_LIBS"
7406
7407 if test "$cf_cv_find_linkage_utf8" = yes ; then
7408 cf_cv_utf8_lib=add-on
7409 else
7410 cf_cv_utf8_lib=no
7411 fi
7412
7413 fi
7414 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7415 fi
7416 echo "$as_me:7416: result: $cf_cv_utf8_lib" >&5
7417 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7418
7419 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7420 # ncurses/ncursesw:
7421 if test "$cf_cv_utf8_lib" = "add-on" ; then
7422
7423 cat >>confdefs.h <<\EOF
7424 #define HAVE_LIBUTF8_H 1
7425 EOF
7426
7427 if test -n "$cf_cv_header_path_utf8" ; then
7428   for cf_add_incdir in $cf_cv_header_path_utf8
7429   do
7430         while test $cf_add_incdir != /usr/include
7431         do
7432           if test -d $cf_add_incdir
7433           then
7434                 cf_have_incdir=no
7435                 if test -n "$CFLAGS$CPPFLAGS" ; then
7436                   # a loop is needed to ensure we can add subdirs of existing dirs
7437                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7438                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7439                           cf_have_incdir=yes; break
7440                         fi
7441                   done
7442                 fi
7443
7444                 if test "$cf_have_incdir" = no ; then
7445                   if test "$cf_add_incdir" = /usr/local/include ; then
7446                         if test "$GCC" = yes
7447                         then
7448                           cf_save_CPPFLAGS=$CPPFLAGS
7449                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7450                           cat >conftest.$ac_ext <<_ACEOF
7451 #line 7451 "configure"
7452 #include "confdefs.h"
7453 #include <stdio.h>
7454 int
7455 main ()
7456 {
7457 printf("Hello")
7458   ;
7459   return 0;
7460 }
7461 _ACEOF
7462 rm -f conftest.$ac_objext
7463 if { (eval echo "$as_me:7463: \"$ac_compile\"") >&5
7464   (eval $ac_compile) 2>&5
7465   ac_status=$?
7466   echo "$as_me:7466: \$? = $ac_status" >&5
7467   (exit $ac_status); } &&
7468          { ac_try='test -s conftest.$ac_objext'
7469   { (eval echo "$as_me:7469: \"$ac_try\"") >&5
7470   (eval $ac_try) 2>&5
7471   ac_status=$?
7472   echo "$as_me:7472: \$? = $ac_status" >&5
7473   (exit $ac_status); }; }; then
7474   :
7475 else
7476   echo "$as_me: failed program was:" >&5
7477 cat conftest.$ac_ext >&5
7478 cf_have_incdir=yes
7479 fi
7480 rm -f conftest.$ac_objext conftest.$ac_ext
7481                           CPPFLAGS=$cf_save_CPPFLAGS
7482                         fi
7483                   fi
7484                 fi
7485
7486                 if test "$cf_have_incdir" = no ; then
7487                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7488
7489 echo "${as_me:-configure}:7489: testing adding $cf_add_incdir to include-path ..." 1>&5
7490
7491                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7492
7493                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7494                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7495                   cf_add_incdir="$cf_top_incdir"
7496                 else
7497                   break
7498                 fi
7499           fi
7500         done
7501   done
7502 fi
7503
7504 if test -n "$cf_cv_library_path_utf8" ; then
7505   for cf_add_libdir in $cf_cv_library_path_utf8
7506   do
7507     if test $cf_add_libdir = /usr/lib ; then
7508       :
7509     elif test -d $cf_add_libdir
7510     then
7511       cf_have_libdir=no
7512       if test -n "$LDFLAGS$LIBS" ; then
7513         # a loop is needed to ensure we can add subdirs of existing dirs
7514         for cf_test_libdir in $LDFLAGS $LIBS ; do
7515           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7516             cf_have_libdir=yes; break
7517           fi
7518         done
7519       fi
7520       if test "$cf_have_libdir" = no ; then
7521         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7522
7523 echo "${as_me:-configure}:7523: testing adding $cf_add_libdir to library-path ..." 1>&5
7524
7525         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7526       fi
7527     fi
7528   done
7529 fi
7530
7531 cf_add_libs="$cf_cv_library_file_utf8"
7532 # Filter out duplicates - this happens with badly-designed ".pc" files...
7533 for cf_add_1lib in $LIBS
7534 do
7535         for cf_add_2lib in $cf_add_libs
7536         do
7537                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7538                 then
7539                         cf_add_1lib=
7540                         break
7541                 fi
7542         done
7543         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7544 done
7545 LIBS="$cf_add_libs"
7546
7547 fi
7548
7549 cf_ncuconfig_root=ncursesw
7550
7551 echo "Looking for ${cf_ncuconfig_root}-config"
7552
7553 if test -n "$ac_tool_prefix"; then
7554   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7555   do
7556     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7557 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7558 echo "$as_me:7558: checking for $ac_word" >&5
7559 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7560 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7561   echo $ECHO_N "(cached) $ECHO_C" >&6
7562 else
7563   if test -n "$NCURSES_CONFIG"; then
7564   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7565 else
7566   ac_save_IFS=$IFS; IFS=$ac_path_separator
7567 ac_dummy="$PATH"
7568 for ac_dir in $ac_dummy; do
7569   IFS=$ac_save_IFS
7570   test -z "$ac_dir" && ac_dir=.
7571   $as_executable_p "$ac_dir/$ac_word" || continue
7572 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7573 echo "$as_me:7573: found $ac_dir/$ac_word" >&5
7574 break
7575 done
7576
7577 fi
7578 fi
7579 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7580 if test -n "$NCURSES_CONFIG"; then
7581   echo "$as_me:7581: result: $NCURSES_CONFIG" >&5
7582 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7583 else
7584   echo "$as_me:7584: result: no" >&5
7585 echo "${ECHO_T}no" >&6
7586 fi
7587
7588     test -n "$NCURSES_CONFIG" && break
7589   done
7590 fi
7591 if test -z "$NCURSES_CONFIG"; then
7592   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7593   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7594 do
7595   # Extract the first word of "$ac_prog", so it can be a program name with args.
7596 set dummy $ac_prog; ac_word=$2
7597 echo "$as_me:7597: checking for $ac_word" >&5
7598 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7599 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7600   echo $ECHO_N "(cached) $ECHO_C" >&6
7601 else
7602   if test -n "$ac_ct_NCURSES_CONFIG"; then
7603   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7604 else
7605   ac_save_IFS=$IFS; IFS=$ac_path_separator
7606 ac_dummy="$PATH"
7607 for ac_dir in $ac_dummy; do
7608   IFS=$ac_save_IFS
7609   test -z "$ac_dir" && ac_dir=.
7610   $as_executable_p "$ac_dir/$ac_word" || continue
7611 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7612 echo "$as_me:7612: found $ac_dir/$ac_word" >&5
7613 break
7614 done
7615
7616 fi
7617 fi
7618 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7619 if test -n "$ac_ct_NCURSES_CONFIG"; then
7620   echo "$as_me:7620: result: $ac_ct_NCURSES_CONFIG" >&5
7621 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7622 else
7623   echo "$as_me:7623: result: no" >&5
7624 echo "${ECHO_T}no" >&6
7625 fi
7626
7627   test -n "$ac_ct_NCURSES_CONFIG" && break
7628 done
7629 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7630
7631   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7632 fi
7633
7634 if test "$NCURSES_CONFIG" != none ; then
7635
7636 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7637
7638 cf_add_libs="`$NCURSES_CONFIG --libs`"
7639 # Filter out duplicates - this happens with badly-designed ".pc" files...
7640 for cf_add_1lib in $LIBS
7641 do
7642         for cf_add_2lib in $cf_add_libs
7643         do
7644                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7645                 then
7646                         cf_add_1lib=
7647                         break
7648                 fi
7649         done
7650         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7651 done
7652 LIBS="$cf_add_libs"
7653
7654 # even with config script, some packages use no-override for curses.h
7655
7656 echo "$as_me:7656: checking if we have identified curses headers" >&5
7657 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7658 if test "${cf_cv_ncurses_header+set}" = set; then
7659   echo $ECHO_N "(cached) $ECHO_C" >&6
7660 else
7661
7662 cf_cv_ncurses_header=none
7663 for cf_header in  \
7664     ncursesw/ncurses.h \
7665         ncursesw/curses.h \
7666         ncurses.h \
7667         curses.h
7668 do
7669 cat >conftest.$ac_ext <<_ACEOF
7670 #line 7670 "configure"
7671 #include "confdefs.h"
7672 #include <${cf_header}>
7673 int
7674 main ()
7675 {
7676 initscr(); tgoto("?", 0,0)
7677   ;
7678   return 0;
7679 }
7680 _ACEOF
7681 rm -f conftest.$ac_objext
7682 if { (eval echo "$as_me:7682: \"$ac_compile\"") >&5
7683   (eval $ac_compile) 2>&5
7684   ac_status=$?
7685   echo "$as_me:7685: \$? = $ac_status" >&5
7686   (exit $ac_status); } &&
7687          { ac_try='test -s conftest.$ac_objext'
7688   { (eval echo "$as_me:7688: \"$ac_try\"") >&5
7689   (eval $ac_try) 2>&5
7690   ac_status=$?
7691   echo "$as_me:7691: \$? = $ac_status" >&5
7692   (exit $ac_status); }; }; then
7693   cf_cv_ncurses_header=$cf_header; break
7694 else
7695   echo "$as_me: failed program was:" >&5
7696 cat conftest.$ac_ext >&5
7697 fi
7698 rm -f conftest.$ac_objext conftest.$ac_ext
7699 done
7700
7701 fi
7702 echo "$as_me:7702: result: $cf_cv_ncurses_header" >&5
7703 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7704
7705 if test "$cf_cv_ncurses_header" = none ; then
7706         { { echo "$as_me:7706: error: No curses header-files found" >&5
7707 echo "$as_me: error: No curses header-files found" >&2;}
7708    { (exit 1); exit 1; }; }
7709 fi
7710
7711 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7712
7713 for ac_header in $cf_cv_ncurses_header
7714 do
7715 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7716 echo "$as_me:7716: checking for $ac_header" >&5
7717 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7718 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7719   echo $ECHO_N "(cached) $ECHO_C" >&6
7720 else
7721   cat >conftest.$ac_ext <<_ACEOF
7722 #line 7722 "configure"
7723 #include "confdefs.h"
7724 #include <$ac_header>
7725 _ACEOF
7726 if { (eval echo "$as_me:7726: \"$ac_cpp conftest.$ac_ext\"") >&5
7727   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7728   ac_status=$?
7729   egrep -v '^ *\+' conftest.er1 >conftest.err
7730   rm -f conftest.er1
7731   cat conftest.err >&5
7732   echo "$as_me:7732: \$? = $ac_status" >&5
7733   (exit $ac_status); } >/dev/null; then
7734   if test -s conftest.err; then
7735     ac_cpp_err=$ac_c_preproc_warn_flag
7736   else
7737     ac_cpp_err=
7738   fi
7739 else
7740   ac_cpp_err=yes
7741 fi
7742 if test -z "$ac_cpp_err"; then
7743   eval "$as_ac_Header=yes"
7744 else
7745   echo "$as_me: failed program was:" >&5
7746   cat conftest.$ac_ext >&5
7747   eval "$as_ac_Header=no"
7748 fi
7749 rm -f conftest.err conftest.$ac_ext
7750 fi
7751 echo "$as_me:7751: result: `eval echo '${'$as_ac_Header'}'`" >&5
7752 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7753 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7754   cat >>confdefs.h <<EOF
7755 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7756 EOF
7757
7758 fi
7759 done
7760
7761 cat >>confdefs.h <<\EOF
7762 #define NCURSES 1
7763 EOF
7764
7765 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7766
7767 cat >>confdefs.h <<EOF
7768 #define $cf_nculib_ROOT 1
7769 EOF
7770
7771 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7772
7773 else
7774
7775 cf_ncuhdr_root=ncursesw
7776
7777 test -n "$cf_cv_curses_dir" && \
7778 test "$cf_cv_curses_dir" != "no" && { \
7779
7780 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7781   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7782   do
7783         while test $cf_add_incdir != /usr/include
7784         do
7785           if test -d $cf_add_incdir
7786           then
7787                 cf_have_incdir=no
7788                 if test -n "$CFLAGS$CPPFLAGS" ; then
7789                   # a loop is needed to ensure we can add subdirs of existing dirs
7790                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7791                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7792                           cf_have_incdir=yes; break
7793                         fi
7794                   done
7795                 fi
7796
7797                 if test "$cf_have_incdir" = no ; then
7798                   if test "$cf_add_incdir" = /usr/local/include ; then
7799                         if test "$GCC" = yes
7800                         then
7801                           cf_save_CPPFLAGS=$CPPFLAGS
7802                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7803                           cat >conftest.$ac_ext <<_ACEOF
7804 #line 7804 "configure"
7805 #include "confdefs.h"
7806 #include <stdio.h>
7807 int
7808 main ()
7809 {
7810 printf("Hello")
7811   ;
7812   return 0;
7813 }
7814 _ACEOF
7815 rm -f conftest.$ac_objext
7816 if { (eval echo "$as_me:7816: \"$ac_compile\"") >&5
7817   (eval $ac_compile) 2>&5
7818   ac_status=$?
7819   echo "$as_me:7819: \$? = $ac_status" >&5
7820   (exit $ac_status); } &&
7821          { ac_try='test -s conftest.$ac_objext'
7822   { (eval echo "$as_me:7822: \"$ac_try\"") >&5
7823   (eval $ac_try) 2>&5
7824   ac_status=$?
7825   echo "$as_me:7825: \$? = $ac_status" >&5
7826   (exit $ac_status); }; }; then
7827   :
7828 else
7829   echo "$as_me: failed program was:" >&5
7830 cat conftest.$ac_ext >&5
7831 cf_have_incdir=yes
7832 fi
7833 rm -f conftest.$ac_objext conftest.$ac_ext
7834                           CPPFLAGS=$cf_save_CPPFLAGS
7835                         fi
7836                   fi
7837                 fi
7838
7839                 if test "$cf_have_incdir" = no ; then
7840                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7841
7842 echo "${as_me:-configure}:7842: testing adding $cf_add_incdir to include-path ..." 1>&5
7843
7844                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7845
7846                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7847                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7848                   cf_add_incdir="$cf_top_incdir"
7849                 else
7850                   break
7851                 fi
7852           fi
7853         done
7854   done
7855 fi
7856
7857 }
7858
7859 echo "$as_me:7859: checking for $cf_ncuhdr_root header in include-path" >&5
7860 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7861 if test "${cf_cv_ncurses_h+set}" = set; then
7862   echo $ECHO_N "(cached) $ECHO_C" >&6
7863 else
7864
7865         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7866         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7867         for cf_header in $cf_header_list
7868         do
7869
7870         cat >conftest.$ac_ext <<_ACEOF
7871 #line 7871 "configure"
7872 #include "confdefs.h"
7873
7874 #define _XOPEN_SOURCE_EXTENDED
7875 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7876 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7877
7878 #include <$cf_header>
7879 int
7880 main ()
7881 {
7882
7883 #ifdef NCURSES_VERSION
7884
7885 #ifndef WACS_BSSB
7886         make an error
7887 #endif
7888
7889 printf("%s\n", NCURSES_VERSION);
7890 #else
7891 #ifdef __NCURSES_H
7892 printf("old\n");
7893 #else
7894         make an error
7895 #endif
7896 #endif
7897
7898   ;
7899   return 0;
7900 }
7901 _ACEOF
7902 rm -f conftest.$ac_objext
7903 if { (eval echo "$as_me:7903: \"$ac_compile\"") >&5
7904   (eval $ac_compile) 2>&5
7905   ac_status=$?
7906   echo "$as_me:7906: \$? = $ac_status" >&5
7907   (exit $ac_status); } &&
7908          { ac_try='test -s conftest.$ac_objext'
7909   { (eval echo "$as_me:7909: \"$ac_try\"") >&5
7910   (eval $ac_try) 2>&5
7911   ac_status=$?
7912   echo "$as_me:7912: \$? = $ac_status" >&5
7913   (exit $ac_status); }; }; then
7914   cf_cv_ncurses_h=$cf_header
7915
7916 else
7917   echo "$as_me: failed program was:" >&5
7918 cat conftest.$ac_ext >&5
7919 cf_cv_ncurses_h=no
7920 fi
7921 rm -f conftest.$ac_objext conftest.$ac_ext
7922
7923                 test "$cf_cv_ncurses_h" != no && break
7924         done
7925
7926 fi
7927 echo "$as_me:7927: result: $cf_cv_ncurses_h" >&5
7928 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7929
7930 if test "$cf_cv_ncurses_h" != no ; then
7931         cf_cv_ncurses_header=$cf_cv_ncurses_h
7932 else
7933
7934 echo "$as_me:7934: checking for $cf_ncuhdr_root include-path" >&5
7935 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7936 if test "${cf_cv_ncurses_h2+set}" = set; then
7937   echo $ECHO_N "(cached) $ECHO_C" >&6
7938 else
7939
7940         test -n "$verbose" && echo
7941
7942 cf_search=
7943
7944 # collect the current set of include-directories from compiler flags
7945 cf_header_path_list=""
7946 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7947         for cf_header_path in $CPPFLAGS $CFLAGS
7948         do
7949                 case $cf_header_path in #(vi
7950                 -I*)
7951                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7952
7953 test "x$cf_header_path" != "xNONE" && \
7954 test -d "$cf_header_path" && \
7955  {
7956         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7957         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7958         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7959         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7960         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7961         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"
7962 }
7963
7964                         cf_header_path_list="$cf_header_path_list $cf_search"
7965                         ;;
7966                 esac
7967         done
7968 fi
7969
7970 # add the variations for the package we are looking for
7971
7972 cf_search=
7973
7974 test "x/usr" != "x$prefix" && \
7975 test -d "/usr" && \
7976 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
7977         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7978         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7979         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
7980         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
7981         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
7982         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7983 }
7984
7985 test "x$prefix" != "xNONE" && \
7986 test -d "$prefix" && \
7987  {
7988         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7989         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7990         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7991         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7992         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7993         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7994 }
7995
7996 test "x/usr/local" != "x$prefix" && \
7997 test -d "/usr/local" && \
7998 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
7999         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
8000         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
8001         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
8002         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
8003         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
8004         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8005 }
8006
8007 test "x/opt" != "x$prefix" && \
8008 test -d "/opt" && \
8009 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
8010         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
8011         test -d /opt/include &&          cf_search="$cf_search /opt/include"
8012         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
8013         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
8014         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
8015         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8016 }
8017
8018 test "x$HOME" != "x$prefix" && \
8019 test -d "$HOME" && \
8020 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
8021         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
8022         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
8023         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
8024         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
8025         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
8026         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8027 }
8028
8029 test "$includedir" != NONE && \
8030 test "$includedir" != "/usr/include" && \
8031 test -d "$includedir" && {
8032         test -d $includedir &&    cf_search="$cf_search $includedir"
8033         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8034 }
8035
8036 test "$oldincludedir" != NONE && \
8037 test "$oldincludedir" != "/usr/include" && \
8038 test -d "$oldincludedir" && {
8039         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8040         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8041 }
8042
8043 cf_search="$cf_search $cf_header_path_list"
8044
8045         test -n "$verbose" && echo search path $cf_search
8046         cf_save2_CPPFLAGS="$CPPFLAGS"
8047         for cf_incdir in $cf_search
8048         do
8049
8050 if test -n "$cf_incdir" ; then
8051   for cf_add_incdir in $cf_incdir
8052   do
8053         while test $cf_add_incdir != /usr/include
8054         do
8055           if test -d $cf_add_incdir
8056           then
8057                 cf_have_incdir=no
8058                 if test -n "$CFLAGS$CPPFLAGS" ; then
8059                   # a loop is needed to ensure we can add subdirs of existing dirs
8060                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8061                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8062                           cf_have_incdir=yes; break
8063                         fi
8064                   done
8065                 fi
8066
8067                 if test "$cf_have_incdir" = no ; then
8068                   if test "$cf_add_incdir" = /usr/local/include ; then
8069                         if test "$GCC" = yes
8070                         then
8071                           cf_save_CPPFLAGS=$CPPFLAGS
8072                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8073                           cat >conftest.$ac_ext <<_ACEOF
8074 #line 8074 "configure"
8075 #include "confdefs.h"
8076 #include <stdio.h>
8077 int
8078 main ()
8079 {
8080 printf("Hello")
8081   ;
8082   return 0;
8083 }
8084 _ACEOF
8085 rm -f conftest.$ac_objext
8086 if { (eval echo "$as_me:8086: \"$ac_compile\"") >&5
8087   (eval $ac_compile) 2>&5
8088   ac_status=$?
8089   echo "$as_me:8089: \$? = $ac_status" >&5
8090   (exit $ac_status); } &&
8091          { ac_try='test -s conftest.$ac_objext'
8092   { (eval echo "$as_me:8092: \"$ac_try\"") >&5
8093   (eval $ac_try) 2>&5
8094   ac_status=$?
8095   echo "$as_me:8095: \$? = $ac_status" >&5
8096   (exit $ac_status); }; }; then
8097   :
8098 else
8099   echo "$as_me: failed program was:" >&5
8100 cat conftest.$ac_ext >&5
8101 cf_have_incdir=yes
8102 fi
8103 rm -f conftest.$ac_objext conftest.$ac_ext
8104                           CPPFLAGS=$cf_save_CPPFLAGS
8105                         fi
8106                   fi
8107                 fi
8108
8109                 if test "$cf_have_incdir" = no ; then
8110                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8111
8112 echo "${as_me:-configure}:8112: testing adding $cf_add_incdir to include-path ..." 1>&5
8113
8114                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8115
8116                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8117                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8118                   cf_add_incdir="$cf_top_incdir"
8119                 else
8120                   break
8121                 fi
8122           fi
8123         done
8124   done
8125 fi
8126
8127                 for cf_header in \
8128                         ncurses.h \
8129                         curses.h
8130                 do
8131
8132         cat >conftest.$ac_ext <<_ACEOF
8133 #line 8133 "configure"
8134 #include "confdefs.h"
8135
8136 #include <$cf_header>
8137 int
8138 main ()
8139 {
8140
8141 #ifdef NCURSES_VERSION
8142
8143 printf("%s\n", NCURSES_VERSION);
8144 #else
8145 #ifdef __NCURSES_H
8146 printf("old\n");
8147 #else
8148         make an error
8149 #endif
8150 #endif
8151
8152   ;
8153   return 0;
8154 }
8155 _ACEOF
8156 rm -f conftest.$ac_objext
8157 if { (eval echo "$as_me:8157: \"$ac_compile\"") >&5
8158   (eval $ac_compile) 2>&5
8159   ac_status=$?
8160   echo "$as_me:8160: \$? = $ac_status" >&5
8161   (exit $ac_status); } &&
8162          { ac_try='test -s conftest.$ac_objext'
8163   { (eval echo "$as_me:8163: \"$ac_try\"") >&5
8164   (eval $ac_try) 2>&5
8165   ac_status=$?
8166   echo "$as_me:8166: \$? = $ac_status" >&5
8167   (exit $ac_status); }; }; then
8168   cf_cv_ncurses_h2=$cf_header
8169
8170 else
8171   echo "$as_me: failed program was:" >&5
8172 cat conftest.$ac_ext >&5
8173 cf_cv_ncurses_h2=no
8174 fi
8175 rm -f conftest.$ac_objext conftest.$ac_ext
8176
8177                         if test "$cf_cv_ncurses_h2" != no ; then
8178                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8179                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8180                                 break
8181                         fi
8182                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8183                 done
8184                 CPPFLAGS="$cf_save2_CPPFLAGS"
8185                 test "$cf_cv_ncurses_h2" != no && break
8186         done
8187         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8187: error: not found" >&5
8188 echo "$as_me: error: not found" >&2;}
8189    { (exit 1); exit 1; }; }
8190
8191 fi
8192 echo "$as_me:8192: result: $cf_cv_ncurses_h2" >&5
8193 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8194
8195         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8196         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8197         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8198                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8199         fi
8200
8201 if test -n "$cf_1st_incdir" ; then
8202   for cf_add_incdir in $cf_1st_incdir
8203   do
8204         while test $cf_add_incdir != /usr/include
8205         do
8206           if test -d $cf_add_incdir
8207           then
8208                 cf_have_incdir=no
8209                 if test -n "$CFLAGS$CPPFLAGS" ; then
8210                   # a loop is needed to ensure we can add subdirs of existing dirs
8211                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8212                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8213                           cf_have_incdir=yes; break
8214                         fi
8215                   done
8216                 fi
8217
8218                 if test "$cf_have_incdir" = no ; then
8219                   if test "$cf_add_incdir" = /usr/local/include ; then
8220                         if test "$GCC" = yes
8221                         then
8222                           cf_save_CPPFLAGS=$CPPFLAGS
8223                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8224                           cat >conftest.$ac_ext <<_ACEOF
8225 #line 8225 "configure"
8226 #include "confdefs.h"
8227 #include <stdio.h>
8228 int
8229 main ()
8230 {
8231 printf("Hello")
8232   ;
8233   return 0;
8234 }
8235 _ACEOF
8236 rm -f conftest.$ac_objext
8237 if { (eval echo "$as_me:8237: \"$ac_compile\"") >&5
8238   (eval $ac_compile) 2>&5
8239   ac_status=$?
8240   echo "$as_me:8240: \$? = $ac_status" >&5
8241   (exit $ac_status); } &&
8242          { ac_try='test -s conftest.$ac_objext'
8243   { (eval echo "$as_me:8243: \"$ac_try\"") >&5
8244   (eval $ac_try) 2>&5
8245   ac_status=$?
8246   echo "$as_me:8246: \$? = $ac_status" >&5
8247   (exit $ac_status); }; }; then
8248   :
8249 else
8250   echo "$as_me: failed program was:" >&5
8251 cat conftest.$ac_ext >&5
8252 cf_have_incdir=yes
8253 fi
8254 rm -f conftest.$ac_objext conftest.$ac_ext
8255                           CPPFLAGS=$cf_save_CPPFLAGS
8256                         fi
8257                   fi
8258                 fi
8259
8260                 if test "$cf_have_incdir" = no ; then
8261                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8262
8263 echo "${as_me:-configure}:8263: testing adding $cf_add_incdir to include-path ..." 1>&5
8264
8265                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8266
8267                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8268                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8269                   cf_add_incdir="$cf_top_incdir"
8270                 else
8271                   break
8272                 fi
8273           fi
8274         done
8275   done
8276 fi
8277
8278 fi
8279
8280 # Set definitions to allow ifdef'ing for ncurses.h
8281
8282 case $cf_cv_ncurses_header in # (vi
8283 *ncurses.h)
8284
8285 cat >>confdefs.h <<\EOF
8286 #define HAVE_NCURSES_H 1
8287 EOF
8288
8289         ;;
8290 esac
8291
8292 case $cf_cv_ncurses_header in # (vi
8293 ncurses/curses.h|ncurses/ncurses.h)
8294
8295 cat >>confdefs.h <<\EOF
8296 #define HAVE_NCURSES_NCURSES_H 1
8297 EOF
8298
8299         ;;
8300 ncursesw/curses.h|ncursesw/ncurses.h)
8301
8302 cat >>confdefs.h <<\EOF
8303 #define HAVE_NCURSESW_NCURSES_H 1
8304 EOF
8305
8306         ;;
8307 esac
8308
8309 echo "$as_me:8309: checking for terminfo header" >&5
8310 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8311 if test "${cf_cv_term_header+set}" = set; then
8312   echo $ECHO_N "(cached) $ECHO_C" >&6
8313 else
8314
8315 case ${cf_cv_ncurses_header} in #(vi
8316 */ncurses.h|*/ncursesw.h) #(vi
8317         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8318         ;;
8319 *)
8320         cf_term_header=term.h
8321         ;;
8322 esac
8323
8324 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8325 do
8326 cat >conftest.$ac_ext <<_ACEOF
8327 #line 8327 "configure"
8328 #include "confdefs.h"
8329 #include <stdio.h>
8330 #include <${cf_cv_ncurses_header:-curses.h}>
8331 #include <$cf_test>
8332
8333 int
8334 main ()
8335 {
8336 int x = auto_left_margin
8337   ;
8338   return 0;
8339 }
8340 _ACEOF
8341 rm -f conftest.$ac_objext
8342 if { (eval echo "$as_me:8342: \"$ac_compile\"") >&5
8343   (eval $ac_compile) 2>&5
8344   ac_status=$?
8345   echo "$as_me:8345: \$? = $ac_status" >&5
8346   (exit $ac_status); } &&
8347          { ac_try='test -s conftest.$ac_objext'
8348   { (eval echo "$as_me:8348: \"$ac_try\"") >&5
8349   (eval $ac_try) 2>&5
8350   ac_status=$?
8351   echo "$as_me:8351: \$? = $ac_status" >&5
8352   (exit $ac_status); }; }; then
8353
8354         cf_cv_term_header="$cf_test"
8355 else
8356   echo "$as_me: failed program was:" >&5
8357 cat conftest.$ac_ext >&5
8358
8359         cf_cv_term_header=unknown
8360
8361 fi
8362 rm -f conftest.$ac_objext conftest.$ac_ext
8363         test "$cf_cv_term_header" != unknown && break
8364 done
8365
8366 fi
8367 echo "$as_me:8367: result: $cf_cv_term_header" >&5
8368 echo "${ECHO_T}$cf_cv_term_header" >&6
8369
8370 # Set definitions to allow ifdef'ing to accommodate subdirectories
8371
8372 case $cf_cv_term_header in # (vi
8373 *term.h)
8374
8375 cat >>confdefs.h <<\EOF
8376 #define HAVE_TERM_H 1
8377 EOF
8378
8379         ;;
8380 esac
8381
8382 case $cf_cv_term_header in # (vi
8383 ncurses/term.h) #(vi
8384
8385 cat >>confdefs.h <<\EOF
8386 #define HAVE_NCURSES_TERM_H 1
8387 EOF
8388
8389         ;;
8390 ncursesw/term.h)
8391
8392 cat >>confdefs.h <<\EOF
8393 #define HAVE_NCURSESW_TERM_H 1
8394 EOF
8395
8396         ;;
8397 esac
8398
8399 # some applications need this, but should check for NCURSES_VERSION
8400
8401 cat >>confdefs.h <<\EOF
8402 #define NCURSES 1
8403 EOF
8404
8405 echo "$as_me:8405: checking for ncurses version" >&5
8406 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8407 if test "${cf_cv_ncurses_version+set}" = set; then
8408   echo $ECHO_N "(cached) $ECHO_C" >&6
8409 else
8410
8411         cf_cv_ncurses_version=no
8412         cf_tempfile=out$$
8413         rm -f $cf_tempfile
8414         if test "$cross_compiling" = yes; then
8415
8416         # This will not work if the preprocessor splits the line after the
8417         # Autoconf token.  The 'unproto' program does that.
8418         cat > conftest.$ac_ext <<EOF
8419 #include <${cf_cv_ncurses_header:-curses.h}>
8420 #undef Autoconf
8421 #ifdef NCURSES_VERSION
8422 Autoconf NCURSES_VERSION
8423 #else
8424 #ifdef __NCURSES_H
8425 Autoconf "old"
8426 #endif
8427 ;
8428 #endif
8429 EOF
8430         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8431         { (eval echo "$as_me:8431: \"$cf_try\"") >&5
8432   (eval $cf_try) 2>&5
8433   ac_status=$?
8434   echo "$as_me:8434: \$? = $ac_status" >&5
8435   (exit $ac_status); }
8436         if test -f conftest.out ; then
8437                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8438                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8439                 rm -f conftest.out
8440         fi
8441
8442 else
8443   cat >conftest.$ac_ext <<_ACEOF
8444 #line 8444 "configure"
8445 #include "confdefs.h"
8446
8447 #include <${cf_cv_ncurses_header:-curses.h}>
8448 #include <stdio.h>
8449 int main()
8450 {
8451         FILE *fp = fopen("$cf_tempfile", "w");
8452 #ifdef NCURSES_VERSION
8453 # ifdef NCURSES_VERSION_PATCH
8454         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8455 # else
8456         fprintf(fp, "%s\n", NCURSES_VERSION);
8457 # endif
8458 #else
8459 # ifdef __NCURSES_H
8460         fprintf(fp, "old\n");
8461 # else
8462         make an error
8463 # endif
8464 #endif
8465         ${cf_cv_main_return:-return}(0);
8466 }
8467 _ACEOF
8468 rm -f conftest$ac_exeext
8469 if { (eval echo "$as_me:8469: \"$ac_link\"") >&5
8470   (eval $ac_link) 2>&5
8471   ac_status=$?
8472   echo "$as_me:8472: \$? = $ac_status" >&5
8473   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8474   { (eval echo "$as_me:8474: \"$ac_try\"") >&5
8475   (eval $ac_try) 2>&5
8476   ac_status=$?
8477   echo "$as_me:8477: \$? = $ac_status" >&5
8478   (exit $ac_status); }; }; then
8479
8480         cf_cv_ncurses_version=`cat $cf_tempfile`
8481 else
8482   echo "$as_me: program exited with status $ac_status" >&5
8483 echo "$as_me: failed program was:" >&5
8484 cat conftest.$ac_ext >&5
8485 fi
8486 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8487 fi
8488         rm -f $cf_tempfile
8489
8490 fi
8491 echo "$as_me:8491: result: $cf_cv_ncurses_version" >&5
8492 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8493 test "$cf_cv_ncurses_version" = no ||
8494 cat >>confdefs.h <<\EOF
8495 #define NCURSES 1
8496 EOF
8497
8498 cf_nculib_root=ncursesw
8499         # This works, except for the special case where we find gpm, but
8500         # ncurses is in a nonstandard location via $LIBS, and we really want
8501         # to link gpm.
8502 cf_ncurses_LIBS=""
8503 cf_ncurses_SAVE="$LIBS"
8504 echo "$as_me:8504: checking for Gpm_Open in -lgpm" >&5
8505 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8506 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8507   echo $ECHO_N "(cached) $ECHO_C" >&6
8508 else
8509   ac_check_lib_save_LIBS=$LIBS
8510 LIBS="-lgpm  $LIBS"
8511 cat >conftest.$ac_ext <<_ACEOF
8512 #line 8512 "configure"
8513 #include "confdefs.h"
8514
8515 /* Override any gcc2 internal prototype to avoid an error.  */
8516 #ifdef __cplusplus
8517 extern "C"
8518 #endif
8519 /* We use char because int might match the return type of a gcc2
8520    builtin and then its argument prototype would still apply.  */
8521 char Gpm_Open ();
8522 int
8523 main ()
8524 {
8525 Gpm_Open ();
8526   ;
8527   return 0;
8528 }
8529 _ACEOF
8530 rm -f conftest.$ac_objext conftest$ac_exeext
8531 if { (eval echo "$as_me:8531: \"$ac_link\"") >&5
8532   (eval $ac_link) 2>&5
8533   ac_status=$?
8534   echo "$as_me:8534: \$? = $ac_status" >&5
8535   (exit $ac_status); } &&
8536          { ac_try='test -s conftest$ac_exeext'
8537   { (eval echo "$as_me:8537: \"$ac_try\"") >&5
8538   (eval $ac_try) 2>&5
8539   ac_status=$?
8540   echo "$as_me:8540: \$? = $ac_status" >&5
8541   (exit $ac_status); }; }; then
8542   ac_cv_lib_gpm_Gpm_Open=yes
8543 else
8544   echo "$as_me: failed program was:" >&5
8545 cat conftest.$ac_ext >&5
8546 ac_cv_lib_gpm_Gpm_Open=no
8547 fi
8548 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8549 LIBS=$ac_check_lib_save_LIBS
8550 fi
8551 echo "$as_me:8551: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8552 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8553 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8554   echo "$as_me:8554: checking for initscr in -lgpm" >&5
8555 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8556 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8557   echo $ECHO_N "(cached) $ECHO_C" >&6
8558 else
8559   ac_check_lib_save_LIBS=$LIBS
8560 LIBS="-lgpm  $LIBS"
8561 cat >conftest.$ac_ext <<_ACEOF
8562 #line 8562 "configure"
8563 #include "confdefs.h"
8564
8565 /* Override any gcc2 internal prototype to avoid an error.  */
8566 #ifdef __cplusplus
8567 extern "C"
8568 #endif
8569 /* We use char because int might match the return type of a gcc2
8570    builtin and then its argument prototype would still apply.  */
8571 char initscr ();
8572 int
8573 main ()
8574 {
8575 initscr ();
8576   ;
8577   return 0;
8578 }
8579 _ACEOF
8580 rm -f conftest.$ac_objext conftest$ac_exeext
8581 if { (eval echo "$as_me:8581: \"$ac_link\"") >&5
8582   (eval $ac_link) 2>&5
8583   ac_status=$?
8584   echo "$as_me:8584: \$? = $ac_status" >&5
8585   (exit $ac_status); } &&
8586          { ac_try='test -s conftest$ac_exeext'
8587   { (eval echo "$as_me:8587: \"$ac_try\"") >&5
8588   (eval $ac_try) 2>&5
8589   ac_status=$?
8590   echo "$as_me:8590: \$? = $ac_status" >&5
8591   (exit $ac_status); }; }; then
8592   ac_cv_lib_gpm_initscr=yes
8593 else
8594   echo "$as_me: failed program was:" >&5
8595 cat conftest.$ac_ext >&5
8596 ac_cv_lib_gpm_initscr=no
8597 fi
8598 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8599 LIBS=$ac_check_lib_save_LIBS
8600 fi
8601 echo "$as_me:8601: result: $ac_cv_lib_gpm_initscr" >&5
8602 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8603 if test $ac_cv_lib_gpm_initscr = yes; then
8604   LIBS="$cf_ncurses_SAVE"
8605 else
8606   cf_ncurses_LIBS="-lgpm"
8607 fi
8608
8609 fi
8610
8611 case $host_os in #(vi
8612 freebsd*)
8613         # This is only necessary if you are linking against an obsolete
8614         # version of ncurses (but it should do no harm, since it's static).
8615         if test "$cf_nculib_root" = ncurses ; then
8616                 echo "$as_me:8616: checking for tgoto in -lmytinfo" >&5
8617 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8618 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8619   echo $ECHO_N "(cached) $ECHO_C" >&6
8620 else
8621   ac_check_lib_save_LIBS=$LIBS
8622 LIBS="-lmytinfo  $LIBS"
8623 cat >conftest.$ac_ext <<_ACEOF
8624 #line 8624 "configure"
8625 #include "confdefs.h"
8626
8627 /* Override any gcc2 internal prototype to avoid an error.  */
8628 #ifdef __cplusplus
8629 extern "C"
8630 #endif
8631 /* We use char because int might match the return type of a gcc2
8632    builtin and then its argument prototype would still apply.  */
8633 char tgoto ();
8634 int
8635 main ()
8636 {
8637 tgoto ();
8638   ;
8639   return 0;
8640 }
8641 _ACEOF
8642 rm -f conftest.$ac_objext conftest$ac_exeext
8643 if { (eval echo "$as_me:8643: \"$ac_link\"") >&5
8644   (eval $ac_link) 2>&5
8645   ac_status=$?
8646   echo "$as_me:8646: \$? = $ac_status" >&5
8647   (exit $ac_status); } &&
8648          { ac_try='test -s conftest$ac_exeext'
8649   { (eval echo "$as_me:8649: \"$ac_try\"") >&5
8650   (eval $ac_try) 2>&5
8651   ac_status=$?
8652   echo "$as_me:8652: \$? = $ac_status" >&5
8653   (exit $ac_status); }; }; then
8654   ac_cv_lib_mytinfo_tgoto=yes
8655 else
8656   echo "$as_me: failed program was:" >&5
8657 cat conftest.$ac_ext >&5
8658 ac_cv_lib_mytinfo_tgoto=no
8659 fi
8660 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8661 LIBS=$ac_check_lib_save_LIBS
8662 fi
8663 echo "$as_me:8663: result: $ac_cv_lib_mytinfo_tgoto" >&5
8664 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8665 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8666   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8667 fi
8668
8669         fi
8670         ;;
8671 esac
8672
8673 cf_add_libs="$cf_ncurses_LIBS"
8674 # Filter out duplicates - this happens with badly-designed ".pc" files...
8675 for cf_add_1lib in $LIBS
8676 do
8677         for cf_add_2lib in $cf_add_libs
8678         do
8679                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8680                 then
8681                         cf_add_1lib=
8682                         break
8683                 fi
8684         done
8685         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8686 done
8687 LIBS="$cf_add_libs"
8688
8689 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8690 then
8691
8692 cf_add_libs="-l$cf_nculib_root"
8693 # Filter out duplicates - this happens with badly-designed ".pc" files...
8694 for cf_add_1lib in $LIBS
8695 do
8696         for cf_add_2lib in $cf_add_libs
8697         do
8698                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8699                 then
8700                         cf_add_1lib=
8701                         break
8702                 fi
8703         done
8704         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8705 done
8706 LIBS="$cf_add_libs"
8707
8708 else
8709
8710         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8711         cf_libdir=""
8712         echo "$as_me:8712: checking for initscr" >&5
8713 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8714 if test "${ac_cv_func_initscr+set}" = set; then
8715   echo $ECHO_N "(cached) $ECHO_C" >&6
8716 else
8717   cat >conftest.$ac_ext <<_ACEOF
8718 #line 8718 "configure"
8719 #include "confdefs.h"
8720 /* System header to define __stub macros and hopefully few prototypes,
8721     which can conflict with char initscr (); below.  */
8722 #include <assert.h>
8723 /* Override any gcc2 internal prototype to avoid an error.  */
8724 #ifdef __cplusplus
8725 extern "C"
8726 #endif
8727 /* We use char because int might match the return type of a gcc2
8728    builtin and then its argument prototype would still apply.  */
8729 char initscr ();
8730 char (*f) ();
8731
8732 int
8733 main ()
8734 {
8735 /* The GNU C library defines this for functions which it implements
8736     to always fail with ENOSYS.  Some functions are actually named
8737     something starting with __ and the normal name is an alias.  */
8738 #if defined (__stub_initscr) || defined (__stub___initscr)
8739 choke me
8740 #else
8741 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8742 #endif
8743
8744   ;
8745   return 0;
8746 }
8747 _ACEOF
8748 rm -f conftest.$ac_objext conftest$ac_exeext
8749 if { (eval echo "$as_me:8749: \"$ac_link\"") >&5
8750   (eval $ac_link) 2>&5
8751   ac_status=$?
8752   echo "$as_me:8752: \$? = $ac_status" >&5
8753   (exit $ac_status); } &&
8754          { ac_try='test -s conftest$ac_exeext'
8755   { (eval echo "$as_me:8755: \"$ac_try\"") >&5
8756   (eval $ac_try) 2>&5
8757   ac_status=$?
8758   echo "$as_me:8758: \$? = $ac_status" >&5
8759   (exit $ac_status); }; }; then
8760   ac_cv_func_initscr=yes
8761 else
8762   echo "$as_me: failed program was:" >&5
8763 cat conftest.$ac_ext >&5
8764 ac_cv_func_initscr=no
8765 fi
8766 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8767 fi
8768 echo "$as_me:8768: result: $ac_cv_func_initscr" >&5
8769 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8770 if test $ac_cv_func_initscr = yes; then
8771   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8772 else
8773
8774                 cf_save_LIBS="$LIBS"
8775                 echo "$as_me:8775: checking for initscr in -l$cf_nculib_root" >&5
8776 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8777                 LIBS="-l$cf_nculib_root $LIBS"
8778                 cat >conftest.$ac_ext <<_ACEOF
8779 #line 8779 "configure"
8780 #include "confdefs.h"
8781 #include <${cf_cv_ncurses_header:-curses.h}>
8782 int
8783 main ()
8784 {
8785 initscr()
8786   ;
8787   return 0;
8788 }
8789 _ACEOF
8790 rm -f conftest.$ac_objext conftest$ac_exeext
8791 if { (eval echo "$as_me:8791: \"$ac_link\"") >&5
8792   (eval $ac_link) 2>&5
8793   ac_status=$?
8794   echo "$as_me:8794: \$? = $ac_status" >&5
8795   (exit $ac_status); } &&
8796          { ac_try='test -s conftest$ac_exeext'
8797   { (eval echo "$as_me:8797: \"$ac_try\"") >&5
8798   (eval $ac_try) 2>&5
8799   ac_status=$?
8800   echo "$as_me:8800: \$? = $ac_status" >&5
8801   (exit $ac_status); }; }; then
8802   echo "$as_me:8802: result: yes" >&5
8803 echo "${ECHO_T}yes" >&6
8804                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8805
8806 else
8807   echo "$as_me: failed program was:" >&5
8808 cat conftest.$ac_ext >&5
8809 echo "$as_me:8809: result: no" >&5
8810 echo "${ECHO_T}no" >&6
8811
8812 cf_search=
8813 cf_library_path_list=""
8814 if test -n "${LDFLAGS}${LIBS}" ; then
8815         for cf_library_path in $LDFLAGS $LIBS
8816         do
8817                 case $cf_library_path in #(vi
8818                 -L*)
8819                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8820
8821 test "x$cf_library_path" != "xNONE" && \
8822 test -d "$cf_library_path" && \
8823  {
8824         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8825         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8826         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8827         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8828         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8829         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"
8830 }
8831
8832                         cf_library_path_list="$cf_library_path_list $cf_search"
8833                         ;;
8834                 esac
8835         done
8836 fi
8837
8838 cf_search=
8839
8840 test "x/usr" != "x$prefix" && \
8841 test -d "/usr" && \
8842 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
8843         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
8844         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
8845         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
8846         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
8847         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
8848         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
8849 }
8850
8851 test "x$prefix" != "xNONE" && \
8852 test -d "$prefix" && \
8853  {
8854         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8855         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8856         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8857         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8858         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8859         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8860 }
8861
8862 test "x/usr/local" != "x$prefix" && \
8863 test -d "/usr/local" && \
8864 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
8865         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
8866         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
8867         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
8868         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
8869         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
8870         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
8871 }
8872
8873 test "x/opt" != "x$prefix" && \
8874 test -d "/opt" && \
8875 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
8876         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
8877         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
8878         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
8879         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
8880         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
8881         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
8882 }
8883
8884 test "x$HOME" != "x$prefix" && \
8885 test -d "$HOME" && \
8886 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
8887         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
8888         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
8889         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
8890         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
8891         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
8892         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
8893 }
8894
8895 cf_search="$cf_library_path_list $cf_search"
8896
8897                         for cf_libdir in $cf_search
8898                         do
8899                                 echo "$as_me:8899: checking for -l$cf_nculib_root in $cf_libdir" >&5
8900 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8901                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8902                                 cat >conftest.$ac_ext <<_ACEOF
8903 #line 8903 "configure"
8904 #include "confdefs.h"
8905 #include <${cf_cv_ncurses_header:-curses.h}>
8906 int
8907 main ()
8908 {
8909 initscr()
8910   ;
8911   return 0;
8912 }
8913 _ACEOF
8914 rm -f conftest.$ac_objext conftest$ac_exeext
8915 if { (eval echo "$as_me:8915: \"$ac_link\"") >&5
8916   (eval $ac_link) 2>&5
8917   ac_status=$?
8918   echo "$as_me:8918: \$? = $ac_status" >&5
8919   (exit $ac_status); } &&
8920          { ac_try='test -s conftest$ac_exeext'
8921   { (eval echo "$as_me:8921: \"$ac_try\"") >&5
8922   (eval $ac_try) 2>&5
8923   ac_status=$?
8924   echo "$as_me:8924: \$? = $ac_status" >&5
8925   (exit $ac_status); }; }; then
8926   echo "$as_me:8926: result: yes" >&5
8927 echo "${ECHO_T}yes" >&6
8928                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8929                                          break
8930 else
8931   echo "$as_me: failed program was:" >&5
8932 cat conftest.$ac_ext >&5
8933 echo "$as_me:8933: result: no" >&5
8934 echo "${ECHO_T}no" >&6
8935                                          LIBS="$cf_save_LIBS"
8936 fi
8937 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8938                         done
8939
8940 fi
8941 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8942
8943 fi
8944
8945 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8946
8947 if test $cf_found_library = no ; then
8948         { { echo "$as_me:8948: error: Cannot link $cf_nculib_root library" >&5
8949 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8950    { (exit 1); exit 1; }; }
8951 fi
8952
8953 fi
8954
8955 if test -n "$cf_ncurses_LIBS" ; then
8956         echo "$as_me:8956: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8957 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8958         cf_ncurses_SAVE="$LIBS"
8959         for p in $cf_ncurses_LIBS ; do
8960                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8961                 if test "$q" != "$LIBS" ; then
8962                         LIBS="$q"
8963                 fi
8964         done
8965         cat >conftest.$ac_ext <<_ACEOF
8966 #line 8966 "configure"
8967 #include "confdefs.h"
8968 #include <${cf_cv_ncurses_header:-curses.h}>
8969 int
8970 main ()
8971 {
8972 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8973   ;
8974   return 0;
8975 }
8976 _ACEOF
8977 rm -f conftest.$ac_objext conftest$ac_exeext
8978 if { (eval echo "$as_me:8978: \"$ac_link\"") >&5
8979   (eval $ac_link) 2>&5
8980   ac_status=$?
8981   echo "$as_me:8981: \$? = $ac_status" >&5
8982   (exit $ac_status); } &&
8983          { ac_try='test -s conftest$ac_exeext'
8984   { (eval echo "$as_me:8984: \"$ac_try\"") >&5
8985   (eval $ac_try) 2>&5
8986   ac_status=$?
8987   echo "$as_me:8987: \$? = $ac_status" >&5
8988   (exit $ac_status); }; }; then
8989   echo "$as_me:8989: result: yes" >&5
8990 echo "${ECHO_T}yes" >&6
8991 else
8992   echo "$as_me: failed program was:" >&5
8993 cat conftest.$ac_ext >&5
8994 echo "$as_me:8994: result: no" >&5
8995 echo "${ECHO_T}no" >&6
8996                  LIBS="$cf_ncurses_SAVE"
8997 fi
8998 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8999 fi
9000
9001 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9002
9003 cat >>confdefs.h <<EOF
9004 #define $cf_nculib_ROOT 1
9005 EOF
9006
9007 fi
9008
9009         ;;
9010 pdcurses)
9011         echo "$as_me:9011: checking for X" >&5
9012 echo $ECHO_N "checking for X... $ECHO_C" >&6
9013
9014 # Check whether --with-x or --without-x was given.
9015 if test "${with_x+set}" = set; then
9016   withval="$with_x"
9017
9018 fi;
9019 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9020 if test "x$with_x" = xno; then
9021   # The user explicitly disabled X.
9022   have_x=disabled
9023 else
9024   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9025     # Both variables are already set.
9026     have_x=yes
9027   else
9028     if test "${ac_cv_have_x+set}" = set; then
9029   echo $ECHO_N "(cached) $ECHO_C" >&6
9030 else
9031   # One or both of the vars are not set, and there is no cached value.
9032 ac_x_includes=no ac_x_libraries=no
9033 rm -fr conftest.dir
9034 if mkdir conftest.dir; then
9035   cd conftest.dir
9036   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9037   cat >Imakefile <<'EOF'
9038 acfindx:
9039         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9040 EOF
9041   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9042     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9043     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9044     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9045     for ac_extension in a so sl dylib dll; do
9046       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9047          test -f $ac_im_libdir/libX11.$ac_extension; then
9048         ac_im_usrlibdir=$ac_im_libdir; break
9049       fi
9050     done
9051     # Screen out bogus values from the imake configuration.  They are
9052     # bogus both because they are the default anyway, and because
9053     # using them would break gcc on systems where it needs fixed includes.
9054     case $ac_im_incroot in
9055         /usr/include) ;;
9056         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9057     esac
9058     case $ac_im_usrlibdir in
9059         /usr/lib | /lib) ;;
9060         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9061     esac
9062   fi
9063   cd ..
9064   rm -fr conftest.dir
9065 fi
9066
9067 # Standard set of common directories for X headers.
9068 # Check X11 before X11Rn because it is often a symlink to the current release.
9069 ac_x_header_dirs='
9070 /usr/X11/include
9071 /usr/X11R6/include
9072 /usr/X11R5/include
9073 /usr/X11R4/include
9074
9075 /usr/include/X11
9076 /usr/include/X11R6
9077 /usr/include/X11R5
9078 /usr/include/X11R4
9079
9080 /usr/local/X11/include
9081 /usr/local/X11R6/include
9082 /usr/local/X11R5/include
9083 /usr/local/X11R4/include
9084
9085 /usr/local/include/X11
9086 /usr/local/include/X11R6
9087 /usr/local/include/X11R5
9088 /usr/local/include/X11R4
9089
9090 /usr/X386/include
9091 /usr/x386/include
9092 /usr/XFree86/include/X11
9093
9094 /usr/include
9095 /usr/local/include
9096 /usr/unsupported/include
9097 /usr/athena/include
9098 /usr/local/x11r5/include
9099 /usr/lpp/Xamples/include
9100
9101 /usr/openwin/include
9102 /usr/openwin/share/include'
9103
9104 if test "$ac_x_includes" = no; then
9105   # Guess where to find include files, by looking for Intrinsic.h.
9106   # First, try using that file with no special directory specified.
9107   cat >conftest.$ac_ext <<_ACEOF
9108 #line 9108 "configure"
9109 #include "confdefs.h"
9110 #include <X11/Intrinsic.h>
9111 _ACEOF
9112 if { (eval echo "$as_me:9112: \"$ac_cpp conftest.$ac_ext\"") >&5
9113   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9114   ac_status=$?
9115   egrep -v '^ *\+' conftest.er1 >conftest.err
9116   rm -f conftest.er1
9117   cat conftest.err >&5
9118   echo "$as_me:9118: \$? = $ac_status" >&5
9119   (exit $ac_status); } >/dev/null; then
9120   if test -s conftest.err; then
9121     ac_cpp_err=$ac_c_preproc_warn_flag
9122   else
9123     ac_cpp_err=
9124   fi
9125 else
9126   ac_cpp_err=yes
9127 fi
9128 if test -z "$ac_cpp_err"; then
9129   # We can compile using X headers with no special include directory.
9130 ac_x_includes=
9131 else
9132   echo "$as_me: failed program was:" >&5
9133   cat conftest.$ac_ext >&5
9134   for ac_dir in $ac_x_header_dirs; do
9135   if test -r "$ac_dir/X11/Intrinsic.h"; then
9136     ac_x_includes=$ac_dir
9137     break
9138   fi
9139 done
9140 fi
9141 rm -f conftest.err conftest.$ac_ext
9142 fi # $ac_x_includes = no
9143
9144 if test "$ac_x_libraries" = no; then
9145   # Check for the libraries.
9146   # See if we find them without any special options.
9147   # Don't add to $LIBS permanently.
9148   ac_save_LIBS=$LIBS
9149   LIBS="-lXt $LIBS"
9150   cat >conftest.$ac_ext <<_ACEOF
9151 #line 9151 "configure"
9152 #include "confdefs.h"
9153 #include <X11/Intrinsic.h>
9154 int
9155 main ()
9156 {
9157 XtMalloc (0)
9158   ;
9159   return 0;
9160 }
9161 _ACEOF
9162 rm -f conftest.$ac_objext conftest$ac_exeext
9163 if { (eval echo "$as_me:9163: \"$ac_link\"") >&5
9164   (eval $ac_link) 2>&5
9165   ac_status=$?
9166   echo "$as_me:9166: \$? = $ac_status" >&5
9167   (exit $ac_status); } &&
9168          { ac_try='test -s conftest$ac_exeext'
9169   { (eval echo "$as_me:9169: \"$ac_try\"") >&5
9170   (eval $ac_try) 2>&5
9171   ac_status=$?
9172   echo "$as_me:9172: \$? = $ac_status" >&5
9173   (exit $ac_status); }; }; then
9174   LIBS=$ac_save_LIBS
9175 # We can link X programs with no special library path.
9176 ac_x_libraries=
9177 else
9178   echo "$as_me: failed program was:" >&5
9179 cat conftest.$ac_ext >&5
9180 LIBS=$ac_save_LIBS
9181 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9182 do
9183   # Don't even attempt the hair of trying to link an X program!
9184   for ac_extension in a so sl dylib dll; do
9185     if test -r $ac_dir/libXt.$ac_extension; then
9186       ac_x_libraries=$ac_dir
9187       break 2
9188     fi
9189   done
9190 done
9191 fi
9192 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9193 fi # $ac_x_libraries = no
9194
9195 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9196   # Didn't find X anywhere.  Cache the known absence of X.
9197   ac_cv_have_x="have_x=no"
9198 else
9199   # Record where we found X for the cache.
9200   ac_cv_have_x="have_x=yes \
9201                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9202 fi
9203 fi
9204
9205   fi
9206   eval "$ac_cv_have_x"
9207 fi # $with_x != no
9208
9209 if test "$have_x" != yes; then
9210   echo "$as_me:9210: result: $have_x" >&5
9211 echo "${ECHO_T}$have_x" >&6
9212   no_x=yes
9213 else
9214   # If each of the values was on the command line, it overrides each guess.
9215   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9216   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9217   # Update the cache value to reflect the command line values.
9218   ac_cv_have_x="have_x=yes \
9219                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9220   echo "$as_me:9220: result: libraries $x_libraries, headers $x_includes" >&5
9221 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9222 fi
9223
9224 if test "$no_x" = yes; then
9225   # Not all programs may use this symbol, but it does not hurt to define it.
9226
9227 cat >>confdefs.h <<\EOF
9228 #define X_DISPLAY_MISSING 1
9229 EOF
9230
9231   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9232 else
9233   if test -n "$x_includes"; then
9234     X_CFLAGS="$X_CFLAGS -I$x_includes"
9235   fi
9236
9237   # It would also be nice to do this for all -L options, not just this one.
9238   if test -n "$x_libraries"; then
9239     X_LIBS="$X_LIBS -L$x_libraries"
9240     # For Solaris; some versions of Sun CC require a space after -R and
9241     # others require no space.  Words are not sufficient . . . .
9242     case `(uname -sr) 2>/dev/null` in
9243     "SunOS 5"*)
9244       echo "$as_me:9244: checking whether -R must be followed by a space" >&5
9245 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9246       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9247       cat >conftest.$ac_ext <<_ACEOF
9248 #line 9248 "configure"
9249 #include "confdefs.h"
9250
9251 int
9252 main ()
9253 {
9254
9255   ;
9256   return 0;
9257 }
9258 _ACEOF
9259 rm -f conftest.$ac_objext conftest$ac_exeext
9260 if { (eval echo "$as_me:9260: \"$ac_link\"") >&5
9261   (eval $ac_link) 2>&5
9262   ac_status=$?
9263   echo "$as_me:9263: \$? = $ac_status" >&5
9264   (exit $ac_status); } &&
9265          { ac_try='test -s conftest$ac_exeext'
9266   { (eval echo "$as_me:9266: \"$ac_try\"") >&5
9267   (eval $ac_try) 2>&5
9268   ac_status=$?
9269   echo "$as_me:9269: \$? = $ac_status" >&5
9270   (exit $ac_status); }; }; then
9271   ac_R_nospace=yes
9272 else
9273   echo "$as_me: failed program was:" >&5
9274 cat conftest.$ac_ext >&5
9275 ac_R_nospace=no
9276 fi
9277 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9278       if test $ac_R_nospace = yes; then
9279         echo "$as_me:9279: result: no" >&5
9280 echo "${ECHO_T}no" >&6
9281         X_LIBS="$X_LIBS -R$x_libraries"
9282       else
9283         LIBS="$ac_xsave_LIBS -R $x_libraries"
9284         cat >conftest.$ac_ext <<_ACEOF
9285 #line 9285 "configure"
9286 #include "confdefs.h"
9287
9288 int
9289 main ()
9290 {
9291
9292   ;
9293   return 0;
9294 }
9295 _ACEOF
9296 rm -f conftest.$ac_objext conftest$ac_exeext
9297 if { (eval echo "$as_me:9297: \"$ac_link\"") >&5
9298   (eval $ac_link) 2>&5
9299   ac_status=$?
9300   echo "$as_me:9300: \$? = $ac_status" >&5
9301   (exit $ac_status); } &&
9302          { ac_try='test -s conftest$ac_exeext'
9303   { (eval echo "$as_me:9303: \"$ac_try\"") >&5
9304   (eval $ac_try) 2>&5
9305   ac_status=$?
9306   echo "$as_me:9306: \$? = $ac_status" >&5
9307   (exit $ac_status); }; }; then
9308   ac_R_space=yes
9309 else
9310   echo "$as_me: failed program was:" >&5
9311 cat conftest.$ac_ext >&5
9312 ac_R_space=no
9313 fi
9314 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9315         if test $ac_R_space = yes; then
9316           echo "$as_me:9316: result: yes" >&5
9317 echo "${ECHO_T}yes" >&6
9318           X_LIBS="$X_LIBS -R $x_libraries"
9319         else
9320           echo "$as_me:9320: result: neither works" >&5
9321 echo "${ECHO_T}neither works" >&6
9322         fi
9323       fi
9324       LIBS=$ac_xsave_LIBS
9325     esac
9326   fi
9327
9328   # Check for system-dependent libraries X programs must link with.
9329   # Do this before checking for the system-independent R6 libraries
9330   # (-lICE), since we may need -lsocket or whatever for X linking.
9331
9332   if test "$ISC" = yes; then
9333     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9334   else
9335     # Martyn Johnson says this is needed for Ultrix, if the X
9336     # libraries were built with DECnet support.  And Karl Berry says
9337     # the Alpha needs dnet_stub (dnet does not exist).
9338     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9339     cat >conftest.$ac_ext <<_ACEOF
9340 #line 9340 "configure"
9341 #include "confdefs.h"
9342
9343 /* Override any gcc2 internal prototype to avoid an error.  */
9344 #ifdef __cplusplus
9345 extern "C"
9346 #endif
9347 /* We use char because int might match the return type of a gcc2
9348    builtin and then its argument prototype would still apply.  */
9349 char XOpenDisplay ();
9350 int
9351 main ()
9352 {
9353 XOpenDisplay ();
9354   ;
9355   return 0;
9356 }
9357 _ACEOF
9358 rm -f conftest.$ac_objext conftest$ac_exeext
9359 if { (eval echo "$as_me:9359: \"$ac_link\"") >&5
9360   (eval $ac_link) 2>&5
9361   ac_status=$?
9362   echo "$as_me:9362: \$? = $ac_status" >&5
9363   (exit $ac_status); } &&
9364          { ac_try='test -s conftest$ac_exeext'
9365   { (eval echo "$as_me:9365: \"$ac_try\"") >&5
9366   (eval $ac_try) 2>&5
9367   ac_status=$?
9368   echo "$as_me:9368: \$? = $ac_status" >&5
9369   (exit $ac_status); }; }; then
9370   :
9371 else
9372   echo "$as_me: failed program was:" >&5
9373 cat conftest.$ac_ext >&5
9374 echo "$as_me:9374: checking for dnet_ntoa in -ldnet" >&5
9375 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9376 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9377   echo $ECHO_N "(cached) $ECHO_C" >&6
9378 else
9379   ac_check_lib_save_LIBS=$LIBS
9380 LIBS="-ldnet  $LIBS"
9381 cat >conftest.$ac_ext <<_ACEOF
9382 #line 9382 "configure"
9383 #include "confdefs.h"
9384
9385 /* Override any gcc2 internal prototype to avoid an error.  */
9386 #ifdef __cplusplus
9387 extern "C"
9388 #endif
9389 /* We use char because int might match the return type of a gcc2
9390    builtin and then its argument prototype would still apply.  */
9391 char dnet_ntoa ();
9392 int
9393 main ()
9394 {
9395 dnet_ntoa ();
9396   ;
9397   return 0;
9398 }
9399 _ACEOF
9400 rm -f conftest.$ac_objext conftest$ac_exeext
9401 if { (eval echo "$as_me:9401: \"$ac_link\"") >&5
9402   (eval $ac_link) 2>&5
9403   ac_status=$?
9404   echo "$as_me:9404: \$? = $ac_status" >&5
9405   (exit $ac_status); } &&
9406          { ac_try='test -s conftest$ac_exeext'
9407   { (eval echo "$as_me:9407: \"$ac_try\"") >&5
9408   (eval $ac_try) 2>&5
9409   ac_status=$?
9410   echo "$as_me:9410: \$? = $ac_status" >&5
9411   (exit $ac_status); }; }; then
9412   ac_cv_lib_dnet_dnet_ntoa=yes
9413 else
9414   echo "$as_me: failed program was:" >&5
9415 cat conftest.$ac_ext >&5
9416 ac_cv_lib_dnet_dnet_ntoa=no
9417 fi
9418 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9419 LIBS=$ac_check_lib_save_LIBS
9420 fi
9421 echo "$as_me:9421: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9422 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9423 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9424   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9425 fi
9426
9427     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9428       echo "$as_me:9428: checking for dnet_ntoa in -ldnet_stub" >&5
9429 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9430 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9431   echo $ECHO_N "(cached) $ECHO_C" >&6
9432 else
9433   ac_check_lib_save_LIBS=$LIBS
9434 LIBS="-ldnet_stub  $LIBS"
9435 cat >conftest.$ac_ext <<_ACEOF
9436 #line 9436 "configure"
9437 #include "confdefs.h"
9438
9439 /* Override any gcc2 internal prototype to avoid an error.  */
9440 #ifdef __cplusplus
9441 extern "C"
9442 #endif
9443 /* We use char because int might match the return type of a gcc2
9444    builtin and then its argument prototype would still apply.  */
9445 char dnet_ntoa ();
9446 int
9447 main ()
9448 {
9449 dnet_ntoa ();
9450   ;
9451   return 0;
9452 }
9453 _ACEOF
9454 rm -f conftest.$ac_objext conftest$ac_exeext
9455 if { (eval echo "$as_me:9455: \"$ac_link\"") >&5
9456   (eval $ac_link) 2>&5
9457   ac_status=$?
9458   echo "$as_me:9458: \$? = $ac_status" >&5
9459   (exit $ac_status); } &&
9460          { ac_try='test -s conftest$ac_exeext'
9461   { (eval echo "$as_me:9461: \"$ac_try\"") >&5
9462   (eval $ac_try) 2>&5
9463   ac_status=$?
9464   echo "$as_me:9464: \$? = $ac_status" >&5
9465   (exit $ac_status); }; }; then
9466   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9467 else
9468   echo "$as_me: failed program was:" >&5
9469 cat conftest.$ac_ext >&5
9470 ac_cv_lib_dnet_stub_dnet_ntoa=no
9471 fi
9472 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9473 LIBS=$ac_check_lib_save_LIBS
9474 fi
9475 echo "$as_me:9475: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9476 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9477 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9478   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9479 fi
9480
9481     fi
9482 fi
9483 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9484     LIBS="$ac_xsave_LIBS"
9485
9486     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9487     # to get the SysV transport functions.
9488     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9489     # needs -lnsl.
9490     # The nsl library prevents programs from opening the X display
9491     # on Irix 5.2, according to T.E. Dickey.
9492     # The functions gethostbyname, getservbyname, and inet_addr are
9493     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9494     echo "$as_me:9494: checking for gethostbyname" >&5
9495 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9496 if test "${ac_cv_func_gethostbyname+set}" = set; then
9497   echo $ECHO_N "(cached) $ECHO_C" >&6
9498 else
9499   cat >conftest.$ac_ext <<_ACEOF
9500 #line 9500 "configure"
9501 #include "confdefs.h"
9502 /* System header to define __stub macros and hopefully few prototypes,
9503     which can conflict with char gethostbyname (); below.  */
9504 #include <assert.h>
9505 /* Override any gcc2 internal prototype to avoid an error.  */
9506 #ifdef __cplusplus
9507 extern "C"
9508 #endif
9509 /* We use char because int might match the return type of a gcc2
9510    builtin and then its argument prototype would still apply.  */
9511 char gethostbyname ();
9512 char (*f) ();
9513
9514 int
9515 main ()
9516 {
9517 /* The GNU C library defines this for functions which it implements
9518     to always fail with ENOSYS.  Some functions are actually named
9519     something starting with __ and the normal name is an alias.  */
9520 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9521 choke me
9522 #else
9523 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9524 #endif
9525
9526   ;
9527   return 0;
9528 }
9529 _ACEOF
9530 rm -f conftest.$ac_objext conftest$ac_exeext
9531 if { (eval echo "$as_me:9531: \"$ac_link\"") >&5
9532   (eval $ac_link) 2>&5
9533   ac_status=$?
9534   echo "$as_me:9534: \$? = $ac_status" >&5
9535   (exit $ac_status); } &&
9536          { ac_try='test -s conftest$ac_exeext'
9537   { (eval echo "$as_me:9537: \"$ac_try\"") >&5
9538   (eval $ac_try) 2>&5
9539   ac_status=$?
9540   echo "$as_me:9540: \$? = $ac_status" >&5
9541   (exit $ac_status); }; }; then
9542   ac_cv_func_gethostbyname=yes
9543 else
9544   echo "$as_me: failed program was:" >&5
9545 cat conftest.$ac_ext >&5
9546 ac_cv_func_gethostbyname=no
9547 fi
9548 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9549 fi
9550 echo "$as_me:9550: result: $ac_cv_func_gethostbyname" >&5
9551 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9552
9553     if test $ac_cv_func_gethostbyname = no; then
9554       echo "$as_me:9554: checking for gethostbyname in -lnsl" >&5
9555 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9556 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9557   echo $ECHO_N "(cached) $ECHO_C" >&6
9558 else
9559   ac_check_lib_save_LIBS=$LIBS
9560 LIBS="-lnsl  $LIBS"
9561 cat >conftest.$ac_ext <<_ACEOF
9562 #line 9562 "configure"
9563 #include "confdefs.h"
9564
9565 /* Override any gcc2 internal prototype to avoid an error.  */
9566 #ifdef __cplusplus
9567 extern "C"
9568 #endif
9569 /* We use char because int might match the return type of a gcc2
9570    builtin and then its argument prototype would still apply.  */
9571 char gethostbyname ();
9572 int
9573 main ()
9574 {
9575 gethostbyname ();
9576   ;
9577   return 0;
9578 }
9579 _ACEOF
9580 rm -f conftest.$ac_objext conftest$ac_exeext
9581 if { (eval echo "$as_me:9581: \"$ac_link\"") >&5
9582   (eval $ac_link) 2>&5
9583   ac_status=$?
9584   echo "$as_me:9584: \$? = $ac_status" >&5
9585   (exit $ac_status); } &&
9586          { ac_try='test -s conftest$ac_exeext'
9587   { (eval echo "$as_me:9587: \"$ac_try\"") >&5
9588   (eval $ac_try) 2>&5
9589   ac_status=$?
9590   echo "$as_me:9590: \$? = $ac_status" >&5
9591   (exit $ac_status); }; }; then
9592   ac_cv_lib_nsl_gethostbyname=yes
9593 else
9594   echo "$as_me: failed program was:" >&5
9595 cat conftest.$ac_ext >&5
9596 ac_cv_lib_nsl_gethostbyname=no
9597 fi
9598 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9599 LIBS=$ac_check_lib_save_LIBS
9600 fi
9601 echo "$as_me:9601: result: $ac_cv_lib_nsl_gethostbyname" >&5
9602 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9603 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9604   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9605 fi
9606
9607       if test $ac_cv_lib_nsl_gethostbyname = no; then
9608         echo "$as_me:9608: checking for gethostbyname in -lbsd" >&5
9609 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9610 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9611   echo $ECHO_N "(cached) $ECHO_C" >&6
9612 else
9613   ac_check_lib_save_LIBS=$LIBS
9614 LIBS="-lbsd  $LIBS"
9615 cat >conftest.$ac_ext <<_ACEOF
9616 #line 9616 "configure"
9617 #include "confdefs.h"
9618
9619 /* Override any gcc2 internal prototype to avoid an error.  */
9620 #ifdef __cplusplus
9621 extern "C"
9622 #endif
9623 /* We use char because int might match the return type of a gcc2
9624    builtin and then its argument prototype would still apply.  */
9625 char gethostbyname ();
9626 int
9627 main ()
9628 {
9629 gethostbyname ();
9630   ;
9631   return 0;
9632 }
9633 _ACEOF
9634 rm -f conftest.$ac_objext conftest$ac_exeext
9635 if { (eval echo "$as_me:9635: \"$ac_link\"") >&5
9636   (eval $ac_link) 2>&5
9637   ac_status=$?
9638   echo "$as_me:9638: \$? = $ac_status" >&5
9639   (exit $ac_status); } &&
9640          { ac_try='test -s conftest$ac_exeext'
9641   { (eval echo "$as_me:9641: \"$ac_try\"") >&5
9642   (eval $ac_try) 2>&5
9643   ac_status=$?
9644   echo "$as_me:9644: \$? = $ac_status" >&5
9645   (exit $ac_status); }; }; then
9646   ac_cv_lib_bsd_gethostbyname=yes
9647 else
9648   echo "$as_me: failed program was:" >&5
9649 cat conftest.$ac_ext >&5
9650 ac_cv_lib_bsd_gethostbyname=no
9651 fi
9652 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9653 LIBS=$ac_check_lib_save_LIBS
9654 fi
9655 echo "$as_me:9655: result: $ac_cv_lib_bsd_gethostbyname" >&5
9656 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
9657 if test $ac_cv_lib_bsd_gethostbyname = yes; then
9658   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
9659 fi
9660
9661       fi
9662     fi
9663
9664     # lieder@skyler.mavd.honeywell.com says without -lsocket,
9665     # socket/setsockopt and other routines are undefined under SCO ODT
9666     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
9667     # on later versions), says Simon Leinen: it contains gethostby*
9668     # variants that don't use the nameserver (or something).  -lsocket
9669     # must be given before -lnsl if both are needed.  We assume that
9670     # if connect needs -lnsl, so does gethostbyname.
9671     echo "$as_me:9671: checking for connect" >&5
9672 echo $ECHO_N "checking for connect... $ECHO_C" >&6
9673 if test "${ac_cv_func_connect+set}" = set; then
9674   echo $ECHO_N "(cached) $ECHO_C" >&6
9675 else
9676   cat >conftest.$ac_ext <<_ACEOF
9677 #line 9677 "configure"
9678 #include "confdefs.h"
9679 /* System header to define __stub macros and hopefully few prototypes,
9680     which can conflict with char connect (); below.  */
9681 #include <assert.h>
9682 /* Override any gcc2 internal prototype to avoid an error.  */
9683 #ifdef __cplusplus
9684 extern "C"
9685 #endif
9686 /* We use char because int might match the return type of a gcc2
9687    builtin and then its argument prototype would still apply.  */
9688 char connect ();
9689 char (*f) ();
9690
9691 int
9692 main ()
9693 {
9694 /* The GNU C library defines this for functions which it implements
9695     to always fail with ENOSYS.  Some functions are actually named
9696     something starting with __ and the normal name is an alias.  */
9697 #if defined (__stub_connect) || defined (__stub___connect)
9698 choke me
9699 #else
9700 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9701 #endif
9702
9703   ;
9704   return 0;
9705 }
9706 _ACEOF
9707 rm -f conftest.$ac_objext conftest$ac_exeext
9708 if { (eval echo "$as_me:9708: \"$ac_link\"") >&5
9709   (eval $ac_link) 2>&5
9710   ac_status=$?
9711   echo "$as_me:9711: \$? = $ac_status" >&5
9712   (exit $ac_status); } &&
9713          { ac_try='test -s conftest$ac_exeext'
9714   { (eval echo "$as_me:9714: \"$ac_try\"") >&5
9715   (eval $ac_try) 2>&5
9716   ac_status=$?
9717   echo "$as_me:9717: \$? = $ac_status" >&5
9718   (exit $ac_status); }; }; then
9719   ac_cv_func_connect=yes
9720 else
9721   echo "$as_me: failed program was:" >&5
9722 cat conftest.$ac_ext >&5
9723 ac_cv_func_connect=no
9724 fi
9725 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9726 fi
9727 echo "$as_me:9727: result: $ac_cv_func_connect" >&5
9728 echo "${ECHO_T}$ac_cv_func_connect" >&6
9729
9730     if test $ac_cv_func_connect = no; then
9731       echo "$as_me:9731: checking for connect in -lsocket" >&5
9732 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
9733 if test "${ac_cv_lib_socket_connect+set}" = set; then
9734   echo $ECHO_N "(cached) $ECHO_C" >&6
9735 else
9736   ac_check_lib_save_LIBS=$LIBS
9737 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
9738 cat >conftest.$ac_ext <<_ACEOF
9739 #line 9739 "configure"
9740 #include "confdefs.h"
9741
9742 /* Override any gcc2 internal prototype to avoid an error.  */
9743 #ifdef __cplusplus
9744 extern "C"
9745 #endif
9746 /* We use char because int might match the return type of a gcc2
9747    builtin and then its argument prototype would still apply.  */
9748 char connect ();
9749 int
9750 main ()
9751 {
9752 connect ();
9753   ;
9754   return 0;
9755 }
9756 _ACEOF
9757 rm -f conftest.$ac_objext conftest$ac_exeext
9758 if { (eval echo "$as_me:9758: \"$ac_link\"") >&5
9759   (eval $ac_link) 2>&5
9760   ac_status=$?
9761   echo "$as_me:9761: \$? = $ac_status" >&5
9762   (exit $ac_status); } &&
9763          { ac_try='test -s conftest$ac_exeext'
9764   { (eval echo "$as_me:9764: \"$ac_try\"") >&5
9765   (eval $ac_try) 2>&5
9766   ac_status=$?
9767   echo "$as_me:9767: \$? = $ac_status" >&5
9768   (exit $ac_status); }; }; then
9769   ac_cv_lib_socket_connect=yes
9770 else
9771   echo "$as_me: failed program was:" >&5
9772 cat conftest.$ac_ext >&5
9773 ac_cv_lib_socket_connect=no
9774 fi
9775 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9776 LIBS=$ac_check_lib_save_LIBS
9777 fi
9778 echo "$as_me:9778: result: $ac_cv_lib_socket_connect" >&5
9779 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
9780 if test $ac_cv_lib_socket_connect = yes; then
9781   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
9782 fi
9783
9784     fi
9785
9786     # Guillermo Gomez says -lposix is necessary on A/UX.
9787     echo "$as_me:9787: checking for remove" >&5
9788 echo $ECHO_N "checking for remove... $ECHO_C" >&6
9789 if test "${ac_cv_func_remove+set}" = set; then
9790   echo $ECHO_N "(cached) $ECHO_C" >&6
9791 else
9792   cat >conftest.$ac_ext <<_ACEOF
9793 #line 9793 "configure"
9794 #include "confdefs.h"
9795 /* System header to define __stub macros and hopefully few prototypes,
9796     which can conflict with char remove (); below.  */
9797 #include <assert.h>
9798 /* Override any gcc2 internal prototype to avoid an error.  */
9799 #ifdef __cplusplus
9800 extern "C"
9801 #endif
9802 /* We use char because int might match the return type of a gcc2
9803    builtin and then its argument prototype would still apply.  */
9804 char remove ();
9805 char (*f) ();
9806
9807 int
9808 main ()
9809 {
9810 /* The GNU C library defines this for functions which it implements
9811     to always fail with ENOSYS.  Some functions are actually named
9812     something starting with __ and the normal name is an alias.  */
9813 #if defined (__stub_remove) || defined (__stub___remove)
9814 choke me
9815 #else
9816 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9817 #endif
9818
9819   ;
9820   return 0;
9821 }
9822 _ACEOF
9823 rm -f conftest.$ac_objext conftest$ac_exeext
9824 if { (eval echo "$as_me:9824: \"$ac_link\"") >&5
9825   (eval $ac_link) 2>&5
9826   ac_status=$?
9827   echo "$as_me:9827: \$? = $ac_status" >&5
9828   (exit $ac_status); } &&
9829          { ac_try='test -s conftest$ac_exeext'
9830   { (eval echo "$as_me:9830: \"$ac_try\"") >&5
9831   (eval $ac_try) 2>&5
9832   ac_status=$?
9833   echo "$as_me:9833: \$? = $ac_status" >&5
9834   (exit $ac_status); }; }; then
9835   ac_cv_func_remove=yes
9836 else
9837   echo "$as_me: failed program was:" >&5
9838 cat conftest.$ac_ext >&5
9839 ac_cv_func_remove=no
9840 fi
9841 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9842 fi
9843 echo "$as_me:9843: result: $ac_cv_func_remove" >&5
9844 echo "${ECHO_T}$ac_cv_func_remove" >&6
9845
9846     if test $ac_cv_func_remove = no; then
9847       echo "$as_me:9847: checking for remove in -lposix" >&5
9848 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
9849 if test "${ac_cv_lib_posix_remove+set}" = set; then
9850   echo $ECHO_N "(cached) $ECHO_C" >&6
9851 else
9852   ac_check_lib_save_LIBS=$LIBS
9853 LIBS="-lposix  $LIBS"
9854 cat >conftest.$ac_ext <<_ACEOF
9855 #line 9855 "configure"
9856 #include "confdefs.h"
9857
9858 /* Override any gcc2 internal prototype to avoid an error.  */
9859 #ifdef __cplusplus
9860 extern "C"
9861 #endif
9862 /* We use char because int might match the return type of a gcc2
9863    builtin and then its argument prototype would still apply.  */
9864 char remove ();
9865 int
9866 main ()
9867 {
9868 remove ();
9869   ;
9870   return 0;
9871 }
9872 _ACEOF
9873 rm -f conftest.$ac_objext conftest$ac_exeext
9874 if { (eval echo "$as_me:9874: \"$ac_link\"") >&5
9875   (eval $ac_link) 2>&5
9876   ac_status=$?
9877   echo "$as_me:9877: \$? = $ac_status" >&5
9878   (exit $ac_status); } &&
9879          { ac_try='test -s conftest$ac_exeext'
9880   { (eval echo "$as_me:9880: \"$ac_try\"") >&5
9881   (eval $ac_try) 2>&5
9882   ac_status=$?
9883   echo "$as_me:9883: \$? = $ac_status" >&5
9884   (exit $ac_status); }; }; then
9885   ac_cv_lib_posix_remove=yes
9886 else
9887   echo "$as_me: failed program was:" >&5
9888 cat conftest.$ac_ext >&5
9889 ac_cv_lib_posix_remove=no
9890 fi
9891 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9892 LIBS=$ac_check_lib_save_LIBS
9893 fi
9894 echo "$as_me:9894: result: $ac_cv_lib_posix_remove" >&5
9895 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
9896 if test $ac_cv_lib_posix_remove = yes; then
9897   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
9898 fi
9899
9900     fi
9901
9902     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
9903     echo "$as_me:9903: checking for shmat" >&5
9904 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
9905 if test "${ac_cv_func_shmat+set}" = set; then
9906   echo $ECHO_N "(cached) $ECHO_C" >&6
9907 else
9908   cat >conftest.$ac_ext <<_ACEOF
9909 #line 9909 "configure"
9910 #include "confdefs.h"
9911 /* System header to define __stub macros and hopefully few prototypes,
9912     which can conflict with char shmat (); below.  */
9913 #include <assert.h>
9914 /* Override any gcc2 internal prototype to avoid an error.  */
9915 #ifdef __cplusplus
9916 extern "C"
9917 #endif
9918 /* We use char because int might match the return type of a gcc2
9919    builtin and then its argument prototype would still apply.  */
9920 char shmat ();
9921 char (*f) ();
9922
9923 int
9924 main ()
9925 {
9926 /* The GNU C library defines this for functions which it implements
9927     to always fail with ENOSYS.  Some functions are actually named
9928     something starting with __ and the normal name is an alias.  */
9929 #if defined (__stub_shmat) || defined (__stub___shmat)
9930 choke me
9931 #else
9932 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9933 #endif
9934
9935   ;
9936   return 0;
9937 }
9938 _ACEOF
9939 rm -f conftest.$ac_objext conftest$ac_exeext
9940 if { (eval echo "$as_me:9940: \"$ac_link\"") >&5
9941   (eval $ac_link) 2>&5
9942   ac_status=$?
9943   echo "$as_me:9943: \$? = $ac_status" >&5
9944   (exit $ac_status); } &&
9945          { ac_try='test -s conftest$ac_exeext'
9946   { (eval echo "$as_me:9946: \"$ac_try\"") >&5
9947   (eval $ac_try) 2>&5
9948   ac_status=$?
9949   echo "$as_me:9949: \$? = $ac_status" >&5
9950   (exit $ac_status); }; }; then
9951   ac_cv_func_shmat=yes
9952 else
9953   echo "$as_me: failed program was:" >&5
9954 cat conftest.$ac_ext >&5
9955 ac_cv_func_shmat=no
9956 fi
9957 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9958 fi
9959 echo "$as_me:9959: result: $ac_cv_func_shmat" >&5
9960 echo "${ECHO_T}$ac_cv_func_shmat" >&6
9961
9962     if test $ac_cv_func_shmat = no; then
9963       echo "$as_me:9963: checking for shmat in -lipc" >&5
9964 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
9965 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
9966   echo $ECHO_N "(cached) $ECHO_C" >&6
9967 else
9968   ac_check_lib_save_LIBS=$LIBS
9969 LIBS="-lipc  $LIBS"
9970 cat >conftest.$ac_ext <<_ACEOF
9971 #line 9971 "configure"
9972 #include "confdefs.h"
9973
9974 /* Override any gcc2 internal prototype to avoid an error.  */
9975 #ifdef __cplusplus
9976 extern "C"
9977 #endif
9978 /* We use char because int might match the return type of a gcc2
9979    builtin and then its argument prototype would still apply.  */
9980 char shmat ();
9981 int
9982 main ()
9983 {
9984 shmat ();
9985   ;
9986   return 0;
9987 }
9988 _ACEOF
9989 rm -f conftest.$ac_objext conftest$ac_exeext
9990 if { (eval echo "$as_me:9990: \"$ac_link\"") >&5
9991   (eval $ac_link) 2>&5
9992   ac_status=$?
9993   echo "$as_me:9993: \$? = $ac_status" >&5
9994   (exit $ac_status); } &&
9995          { ac_try='test -s conftest$ac_exeext'
9996   { (eval echo "$as_me:9996: \"$ac_try\"") >&5
9997   (eval $ac_try) 2>&5
9998   ac_status=$?
9999   echo "$as_me:9999: \$? = $ac_status" >&5
10000   (exit $ac_status); }; }; then
10001   ac_cv_lib_ipc_shmat=yes
10002 else
10003   echo "$as_me: failed program was:" >&5
10004 cat conftest.$ac_ext >&5
10005 ac_cv_lib_ipc_shmat=no
10006 fi
10007 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10008 LIBS=$ac_check_lib_save_LIBS
10009 fi
10010 echo "$as_me:10010: result: $ac_cv_lib_ipc_shmat" >&5
10011 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10012 if test $ac_cv_lib_ipc_shmat = yes; then
10013   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10014 fi
10015
10016     fi
10017   fi
10018
10019   # Check for libraries that X11R6 Xt/Xaw programs need.
10020   ac_save_LDFLAGS=$LDFLAGS
10021   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10022   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10023   # check for ICE first), but we must link in the order -lSM -lICE or
10024   # we get undefined symbols.  So assume we have SM if we have ICE.
10025   # These have to be linked with before -lX11, unlike the other
10026   # libraries we check for below, so use a different variable.
10027   # John Interrante, Karl Berry
10028   echo "$as_me:10028: checking for IceConnectionNumber in -lICE" >&5
10029 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10030 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10031   echo $ECHO_N "(cached) $ECHO_C" >&6
10032 else
10033   ac_check_lib_save_LIBS=$LIBS
10034 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10035 cat >conftest.$ac_ext <<_ACEOF
10036 #line 10036 "configure"
10037 #include "confdefs.h"
10038
10039 /* Override any gcc2 internal prototype to avoid an error.  */
10040 #ifdef __cplusplus
10041 extern "C"
10042 #endif
10043 /* We use char because int might match the return type of a gcc2
10044    builtin and then its argument prototype would still apply.  */
10045 char IceConnectionNumber ();
10046 int
10047 main ()
10048 {
10049 IceConnectionNumber ();
10050   ;
10051   return 0;
10052 }
10053 _ACEOF
10054 rm -f conftest.$ac_objext conftest$ac_exeext
10055 if { (eval echo "$as_me:10055: \"$ac_link\"") >&5
10056   (eval $ac_link) 2>&5
10057   ac_status=$?
10058   echo "$as_me:10058: \$? = $ac_status" >&5
10059   (exit $ac_status); } &&
10060          { ac_try='test -s conftest$ac_exeext'
10061   { (eval echo "$as_me:10061: \"$ac_try\"") >&5
10062   (eval $ac_try) 2>&5
10063   ac_status=$?
10064   echo "$as_me:10064: \$? = $ac_status" >&5
10065   (exit $ac_status); }; }; then
10066   ac_cv_lib_ICE_IceConnectionNumber=yes
10067 else
10068   echo "$as_me: failed program was:" >&5
10069 cat conftest.$ac_ext >&5
10070 ac_cv_lib_ICE_IceConnectionNumber=no
10071 fi
10072 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10073 LIBS=$ac_check_lib_save_LIBS
10074 fi
10075 echo "$as_me:10075: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10076 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10077 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10078   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10079 fi
10080
10081   LDFLAGS=$ac_save_LDFLAGS
10082
10083 fi
10084
10085 cf_x_athena=${cf_x_athena:-Xaw}
10086
10087 echo "$as_me:10087: checking if you want to link with Xaw 3d library" >&5
10088 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10089 withval=
10090
10091 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10092 if test "${with_Xaw3d+set}" = set; then
10093   withval="$with_Xaw3d"
10094
10095 fi;
10096 if test "$withval" = yes ; then
10097         cf_x_athena=Xaw3d
10098         echo "$as_me:10098: result: yes" >&5
10099 echo "${ECHO_T}yes" >&6
10100 else
10101         echo "$as_me:10101: result: no" >&5
10102 echo "${ECHO_T}no" >&6
10103 fi
10104
10105 echo "$as_me:10105: checking if you want to link with Xaw 3d xft library" >&5
10106 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
10107 withval=
10108
10109 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
10110 if test "${with_Xaw3dxft+set}" = set; then
10111   withval="$with_Xaw3dxft"
10112
10113 fi;
10114 if test "$withval" = yes ; then
10115         cf_x_athena=Xaw3dxft
10116         echo "$as_me:10116: result: yes" >&5
10117 echo "${ECHO_T}yes" >&6
10118 else
10119         echo "$as_me:10119: result: no" >&5
10120 echo "${ECHO_T}no" >&6
10121 fi
10122
10123 echo "$as_me:10123: checking if you want to link with neXT Athena library" >&5
10124 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10125 withval=
10126
10127 # Check whether --with-neXtaw or --without-neXtaw was given.
10128 if test "${with_neXtaw+set}" = set; then
10129   withval="$with_neXtaw"
10130
10131 fi;
10132 if test "$withval" = yes ; then
10133         cf_x_athena=neXtaw
10134         echo "$as_me:10134: result: yes" >&5
10135 echo "${ECHO_T}yes" >&6
10136 else
10137         echo "$as_me:10137: result: no" >&5
10138 echo "${ECHO_T}no" >&6
10139 fi
10140
10141 echo "$as_me:10141: checking if you want to link with Athena-Plus library" >&5
10142 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10143 withval=
10144
10145 # Check whether --with-XawPlus or --without-XawPlus was given.
10146 if test "${with_XawPlus+set}" = set; then
10147   withval="$with_XawPlus"
10148
10149 fi;
10150 if test "$withval" = yes ; then
10151         cf_x_athena=XawPlus
10152         echo "$as_me:10152: result: yes" >&5
10153 echo "${ECHO_T}yes" >&6
10154 else
10155         echo "$as_me:10155: result: no" >&5
10156 echo "${ECHO_T}no" >&6
10157 fi
10158
10159 cf_x_athena_lib=""
10160
10161 if test "$PKG_CONFIG" != none ; then
10162         cf_athena_list=
10163         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10164         for cf_athena_pkg in \
10165                 $cf_athena_list \
10166                 ${cf_x_athena} \
10167                 ${cf_x_athena}-devel \
10168                 lib${cf_x_athena} \
10169                 lib${cf_x_athena}-devel
10170         do
10171
10172 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10173         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10174
10175 echo "${as_me:-configure}:10175: testing found package $cf_athena_pkg ..." 1>&5
10176
10177         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10178         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10179         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10180
10181 echo "${as_me:-configure}:10181: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10182
10183         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10184
10185 echo "${as_me:-configure}:10185: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10186
10187 cf_fix_cppflags=no
10188 cf_new_cflags=
10189 cf_new_cppflags=
10190 cf_new_extra_cppflags=
10191
10192 for cf_add_cflags in $cf_pkgconfig_incs
10193 do
10194 case $cf_fix_cppflags in
10195 no)
10196         case $cf_add_cflags in #(vi
10197         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10198                 case $cf_add_cflags in
10199                 -D*)
10200                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10201
10202                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10203                                 && test -z "${cf_tst_cflags}" \
10204                                 && cf_fix_cppflags=yes
10205
10206                         if test $cf_fix_cppflags = yes ; then
10207                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10208                                 continue
10209                         elif test "${cf_tst_cflags}" = "\"'" ; then
10210                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10211                                 continue
10212                         fi
10213                         ;;
10214                 esac
10215                 case "$CPPFLAGS" in
10216                 *$cf_add_cflags) #(vi
10217                         ;;
10218                 *) #(vi
10219                         case $cf_add_cflags in #(vi
10220                         -D*)
10221                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10222
10223 CPPFLAGS=`echo "$CPPFLAGS" | \
10224         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10225                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10226
10227                                 ;;
10228                         esac
10229                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10230                         ;;
10231                 esac
10232                 ;;
10233         *)
10234                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10235                 ;;
10236         esac
10237         ;;
10238 yes)
10239         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10240
10241         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10242
10243         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10244                 && test -z "${cf_tst_cflags}" \
10245                 && cf_fix_cppflags=no
10246         ;;
10247 esac
10248 done
10249
10250 if test -n "$cf_new_cflags" ; then
10251
10252         CFLAGS="$CFLAGS $cf_new_cflags"
10253 fi
10254
10255 if test -n "$cf_new_cppflags" ; then
10256
10257         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10258 fi
10259
10260 if test -n "$cf_new_extra_cppflags" ; then
10261
10262         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10263 fi
10264
10265 cf_add_libs="$cf_pkgconfig_libs"
10266 # Filter out duplicates - this happens with badly-designed ".pc" files...
10267 for cf_add_1lib in $LIBS
10268 do
10269         for cf_add_2lib in $cf_add_libs
10270         do
10271                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10272                 then
10273                         cf_add_1lib=
10274                         break
10275                 fi
10276         done
10277         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10278 done
10279 LIBS="$cf_add_libs"
10280
10281                         cf_x_athena_lib="$cf_pkgconfig_libs"
10282
10283 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10284
10285                         cat >>confdefs.h <<EOF
10286 #define $cf_x_athena_LIBS 1
10287 EOF
10288
10289         for cf_trim_lib in Xmu Xt X11
10290         do
10291                 case "$LIBS" in
10292                 *-l$cf_trim_lib\ *-l$cf_trim_lib*)
10293                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10294                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10295
10296 echo "${as_me:-configure}:10296: testing ..trimmed $LIBS ..." 1>&5
10297
10298                         ;;
10299                 esac
10300         done
10301
10302 echo "$as_me:10302: checking for usable $cf_x_athena/Xmu package" >&5
10303 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10304 if test "${cf_cv_xaw_compat+set}" = set; then
10305   echo $ECHO_N "(cached) $ECHO_C" >&6
10306 else
10307
10308 cat >conftest.$ac_ext <<_ACEOF
10309 #line 10309 "configure"
10310 #include "confdefs.h"
10311
10312 #include <X11/Xmu/CharSet.h>
10313
10314 int
10315 main ()
10316 {
10317
10318 int check = XmuCompareISOLatin1("big", "small")
10319
10320   ;
10321   return 0;
10322 }
10323 _ACEOF
10324 rm -f conftest.$ac_objext conftest$ac_exeext
10325 if { (eval echo "$as_me:10325: \"$ac_link\"") >&5
10326   (eval $ac_link) 2>&5
10327   ac_status=$?
10328   echo "$as_me:10328: \$? = $ac_status" >&5
10329   (exit $ac_status); } &&
10330          { ac_try='test -s conftest$ac_exeext'
10331   { (eval echo "$as_me:10331: \"$ac_try\"") >&5
10332   (eval $ac_try) 2>&5
10333   ac_status=$?
10334   echo "$as_me:10334: \$? = $ac_status" >&5
10335   (exit $ac_status); }; }; then
10336   cf_cv_xaw_compat=yes
10337 else
10338   echo "$as_me: failed program was:" >&5
10339 cat conftest.$ac_ext >&5
10340 cf_cv_xaw_compat=no
10341 fi
10342 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10343 fi
10344 echo "$as_me:10344: result: $cf_cv_xaw_compat" >&5
10345 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10346
10347                         if test "$cf_cv_xaw_compat" = no
10348                         then
10349                                 # workaround for broken ".pc" files...
10350                                 case "$cf_x_athena_lib" in #(vi
10351                                 *-lXmu*) #(vi
10352                                         ;;
10353                                 *)
10354                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10355
10356 echo "${as_me:-configure}:10356: testing work around broken package ..." 1>&5
10357
10358                                         cf_save_xmu="$LIBS"
10359                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
10360
10361 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10362         test -n "$verbose" && echo "    found package xmu" 1>&6
10363
10364 echo "${as_me:-configure}:10364: testing found package xmu ..." 1>&5
10365
10366         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10367         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10368         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10369
10370 echo "${as_me:-configure}:10370: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10371
10372         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10373
10374 echo "${as_me:-configure}:10374: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10375
10376 cf_fix_cppflags=no
10377 cf_new_cflags=
10378 cf_new_cppflags=
10379 cf_new_extra_cppflags=
10380
10381 for cf_add_cflags in $cf_pkgconfig_incs
10382 do
10383 case $cf_fix_cppflags in
10384 no)
10385         case $cf_add_cflags in #(vi
10386         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10387                 case $cf_add_cflags in
10388                 -D*)
10389                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10390
10391                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10392                                 && test -z "${cf_tst_cflags}" \
10393                                 && cf_fix_cppflags=yes
10394
10395                         if test $cf_fix_cppflags = yes ; then
10396                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10397                                 continue
10398                         elif test "${cf_tst_cflags}" = "\"'" ; then
10399                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10400                                 continue
10401                         fi
10402                         ;;
10403                 esac
10404                 case "$CPPFLAGS" in
10405                 *$cf_add_cflags) #(vi
10406                         ;;
10407                 *) #(vi
10408                         case $cf_add_cflags in #(vi
10409                         -D*)
10410                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10411
10412 CPPFLAGS=`echo "$CPPFLAGS" | \
10413         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10414                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10415
10416                                 ;;
10417                         esac
10418                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10419                         ;;
10420                 esac
10421                 ;;
10422         *)
10423                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10424                 ;;
10425         esac
10426         ;;
10427 yes)
10428         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10429
10430         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10431
10432         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10433                 && test -z "${cf_tst_cflags}" \
10434                 && cf_fix_cppflags=no
10435         ;;
10436 esac
10437 done
10438
10439 if test -n "$cf_new_cflags" ; then
10440
10441         CFLAGS="$CFLAGS $cf_new_cflags"
10442 fi
10443
10444 if test -n "$cf_new_cppflags" ; then
10445
10446         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10447 fi
10448
10449 if test -n "$cf_new_extra_cppflags" ; then
10450
10451         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10452 fi
10453
10454 cf_add_libs="$cf_pkgconfig_libs"
10455 # Filter out duplicates - this happens with badly-designed ".pc" files...
10456 for cf_add_1lib in $LIBS
10457 do
10458         for cf_add_2lib in $cf_add_libs
10459         do
10460                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10461                 then
10462                         cf_add_1lib=
10463                         break
10464                 fi
10465         done
10466         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10467 done
10468 LIBS="$cf_add_libs"
10469
10470                                                         LIBS="$cf_save_xmu"
10471
10472 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10473
10474 echo "${as_me:-configure}:10474: testing ...before $LIBS ..." 1>&5
10475
10476 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
10477 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10478
10479 echo "${as_me:-configure}:10479: testing ...after  $LIBS ..." 1>&5
10480
10481 else
10482         cf_pkgconfig_incs=
10483         cf_pkgconfig_libs=
10484
10485 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10486
10487 echo "${as_me:-configure}:10487: testing ...before $LIBS ..." 1>&5
10488
10489 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
10490 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10491
10492 echo "${as_me:-configure}:10492: testing ...after  $LIBS ..." 1>&5
10493
10494 fi
10495
10496         for cf_trim_lib in Xmu Xt X11
10497         do
10498                 case "$LIBS" in
10499                 *-l$cf_trim_lib\ *-l$cf_trim_lib*)
10500                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10501                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10502
10503 echo "${as_me:-configure}:10503: testing ..trimmed $LIBS ..." 1>&5
10504
10505                         ;;
10506                 esac
10507         done
10508
10509                                         ;;
10510                                 esac
10511                         fi
10512
10513                         break
10514 else
10515         cf_pkgconfig_incs=
10516         cf_pkgconfig_libs=
10517         :
10518 fi
10519
10520         done
10521 fi
10522
10523 if test -z "$cf_x_athena_lib" ; then
10524
10525 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10526         test -n "$verbose" && echo "    found package Xext" 1>&6
10527
10528 echo "${as_me:-configure}:10528: testing found package Xext ..." 1>&5
10529
10530         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10531         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10532         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10533
10534 echo "${as_me:-configure}:10534: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10535
10536         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10537
10538 echo "${as_me:-configure}:10538: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10539
10540 cf_fix_cppflags=no
10541 cf_new_cflags=
10542 cf_new_cppflags=
10543 cf_new_extra_cppflags=
10544
10545 for cf_add_cflags in $cf_pkgconfig_incs
10546 do
10547 case $cf_fix_cppflags in
10548 no)
10549         case $cf_add_cflags in #(vi
10550         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10551                 case $cf_add_cflags in
10552                 -D*)
10553                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10554
10555                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10556                                 && test -z "${cf_tst_cflags}" \
10557                                 && cf_fix_cppflags=yes
10558
10559                         if test $cf_fix_cppflags = yes ; then
10560                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10561                                 continue
10562                         elif test "${cf_tst_cflags}" = "\"'" ; then
10563                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10564                                 continue
10565                         fi
10566                         ;;
10567                 esac
10568                 case "$CPPFLAGS" in
10569                 *$cf_add_cflags) #(vi
10570                         ;;
10571                 *) #(vi
10572                         case $cf_add_cflags in #(vi
10573                         -D*)
10574                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10575
10576 CPPFLAGS=`echo "$CPPFLAGS" | \
10577         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10578                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10579
10580                                 ;;
10581                         esac
10582                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10583                         ;;
10584                 esac
10585                 ;;
10586         *)
10587                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10588                 ;;
10589         esac
10590         ;;
10591 yes)
10592         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10593
10594         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10595
10596         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10597                 && test -z "${cf_tst_cflags}" \
10598                 && cf_fix_cppflags=no
10599         ;;
10600 esac
10601 done
10602
10603 if test -n "$cf_new_cflags" ; then
10604
10605         CFLAGS="$CFLAGS $cf_new_cflags"
10606 fi
10607
10608 if test -n "$cf_new_cppflags" ; then
10609
10610         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10611 fi
10612
10613 if test -n "$cf_new_extra_cppflags" ; then
10614
10615         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10616 fi
10617
10618 cf_add_libs="$cf_pkgconfig_libs"
10619 # Filter out duplicates - this happens with badly-designed ".pc" files...
10620 for cf_add_1lib in $LIBS
10621 do
10622         for cf_add_2lib in $cf_add_libs
10623         do
10624                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10625                 then
10626                         cf_add_1lib=
10627                         break
10628                 fi
10629         done
10630         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10631 done
10632 LIBS="$cf_add_libs"
10633
10634         :
10635 else
10636         cf_pkgconfig_incs=
10637         cf_pkgconfig_libs=
10638
10639         echo "$as_me:10639: checking for XextCreateExtension in -lXext" >&5
10640 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10641 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10642   echo $ECHO_N "(cached) $ECHO_C" >&6
10643 else
10644   ac_check_lib_save_LIBS=$LIBS
10645 LIBS="-lXext  $LIBS"
10646 cat >conftest.$ac_ext <<_ACEOF
10647 #line 10647 "configure"
10648 #include "confdefs.h"
10649
10650 /* Override any gcc2 internal prototype to avoid an error.  */
10651 #ifdef __cplusplus
10652 extern "C"
10653 #endif
10654 /* We use char because int might match the return type of a gcc2
10655    builtin and then its argument prototype would still apply.  */
10656 char XextCreateExtension ();
10657 int
10658 main ()
10659 {
10660 XextCreateExtension ();
10661   ;
10662   return 0;
10663 }
10664 _ACEOF
10665 rm -f conftest.$ac_objext conftest$ac_exeext
10666 if { (eval echo "$as_me:10666: \"$ac_link\"") >&5
10667   (eval $ac_link) 2>&5
10668   ac_status=$?
10669   echo "$as_me:10669: \$? = $ac_status" >&5
10670   (exit $ac_status); } &&
10671          { ac_try='test -s conftest$ac_exeext'
10672   { (eval echo "$as_me:10672: \"$ac_try\"") >&5
10673   (eval $ac_try) 2>&5
10674   ac_status=$?
10675   echo "$as_me:10675: \$? = $ac_status" >&5
10676   (exit $ac_status); }; }; then
10677   ac_cv_lib_Xext_XextCreateExtension=yes
10678 else
10679   echo "$as_me: failed program was:" >&5
10680 cat conftest.$ac_ext >&5
10681 ac_cv_lib_Xext_XextCreateExtension=no
10682 fi
10683 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10684 LIBS=$ac_check_lib_save_LIBS
10685 fi
10686 echo "$as_me:10686: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
10687 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
10688 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
10689
10690 cf_add_libs="-lXext"
10691 # Filter out duplicates - this happens with badly-designed ".pc" files...
10692 for cf_add_1lib in $LIBS
10693 do
10694         for cf_add_2lib in $cf_add_libs
10695         do
10696                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10697                 then
10698                         cf_add_1lib=
10699                         break
10700                 fi
10701         done
10702         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10703 done
10704 LIBS="$cf_add_libs"
10705
10706 fi
10707
10708 fi
10709
10710 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
10711 # in some cases has installed dummy files in the former, other cases replaced
10712 # it with a link to the new location).  This complicates the configure script.
10713 # Check for that pitfall, and recover using pkg-config
10714 #
10715 # If none of these are set, the configuration is almost certainly broken.
10716 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
10717 then
10718
10719 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
10720         test -n "$verbose" && echo "    found package x11" 1>&6
10721
10722 echo "${as_me:-configure}:10722: testing found package x11 ..." 1>&5
10723
10724         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
10725         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
10726         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
10727
10728 echo "${as_me:-configure}:10728: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10729
10730         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
10731
10732 echo "${as_me:-configure}:10732: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
10733
10734 cf_fix_cppflags=no
10735 cf_new_cflags=
10736 cf_new_cppflags=
10737 cf_new_extra_cppflags=
10738
10739 for cf_add_cflags in $cf_pkgconfig_incs
10740 do
10741 case $cf_fix_cppflags in
10742 no)
10743         case $cf_add_cflags in #(vi
10744         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10745                 case $cf_add_cflags in
10746                 -D*)
10747                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10748
10749                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10750                                 && test -z "${cf_tst_cflags}" \
10751                                 && cf_fix_cppflags=yes
10752
10753                         if test $cf_fix_cppflags = yes ; then
10754                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10755                                 continue
10756                         elif test "${cf_tst_cflags}" = "\"'" ; then
10757                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10758                                 continue
10759                         fi
10760                         ;;
10761                 esac
10762                 case "$CPPFLAGS" in
10763                 *$cf_add_cflags) #(vi
10764                         ;;
10765                 *) #(vi
10766                         case $cf_add_cflags in #(vi
10767                         -D*)
10768                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10769
10770 CPPFLAGS=`echo "$CPPFLAGS" | \
10771         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10772                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10773
10774                                 ;;
10775                         esac
10776                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10777                         ;;
10778                 esac
10779                 ;;
10780         *)
10781                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10782                 ;;
10783         esac
10784         ;;
10785 yes)
10786         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10787
10788         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10789
10790         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10791                 && test -z "${cf_tst_cflags}" \
10792                 && cf_fix_cppflags=no
10793         ;;
10794 esac
10795 done
10796
10797 if test -n "$cf_new_cflags" ; then
10798
10799         CFLAGS="$CFLAGS $cf_new_cflags"
10800 fi
10801
10802 if test -n "$cf_new_cppflags" ; then
10803
10804         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10805 fi
10806
10807 if test -n "$cf_new_extra_cppflags" ; then
10808
10809         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10810 fi
10811
10812 cf_add_libs="$cf_pkgconfig_libs"
10813 # Filter out duplicates - this happens with badly-designed ".pc" files...
10814 for cf_add_1lib in $LIBS
10815 do
10816         for cf_add_2lib in $cf_add_libs
10817         do
10818                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10819                 then
10820                         cf_add_1lib=
10821                         break
10822                 fi
10823         done
10824         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10825 done
10826 LIBS="$cf_add_libs"
10827
10828         :
10829 else
10830         cf_pkgconfig_incs=
10831         cf_pkgconfig_libs=
10832         { echo "$as_me:10832: WARNING: unable to find X11 library" >&5
10833 echo "$as_me: WARNING: unable to find X11 library" >&2;}
10834 fi
10835
10836 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
10837         test -n "$verbose" && echo "    found package ice" 1>&6
10838
10839 echo "${as_me:-configure}:10839: testing found package ice ..." 1>&5
10840
10841         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
10842         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
10843         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
10844
10845 echo "${as_me:-configure}:10845: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10846
10847         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
10848
10849 echo "${as_me:-configure}:10849: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
10850
10851 cf_fix_cppflags=no
10852 cf_new_cflags=
10853 cf_new_cppflags=
10854 cf_new_extra_cppflags=
10855
10856 for cf_add_cflags in $cf_pkgconfig_incs
10857 do
10858 case $cf_fix_cppflags in
10859 no)
10860         case $cf_add_cflags in #(vi
10861         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10862                 case $cf_add_cflags in
10863                 -D*)
10864                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10865
10866                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10867                                 && test -z "${cf_tst_cflags}" \
10868                                 && cf_fix_cppflags=yes
10869
10870                         if test $cf_fix_cppflags = yes ; then
10871                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10872                                 continue
10873                         elif test "${cf_tst_cflags}" = "\"'" ; then
10874                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10875                                 continue
10876                         fi
10877                         ;;
10878                 esac
10879                 case "$CPPFLAGS" in
10880                 *$cf_add_cflags) #(vi
10881                         ;;
10882                 *) #(vi
10883                         case $cf_add_cflags in #(vi
10884                         -D*)
10885                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10886
10887 CPPFLAGS=`echo "$CPPFLAGS" | \
10888         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10889                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10890
10891                                 ;;
10892                         esac
10893                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10894                         ;;
10895                 esac
10896                 ;;
10897         *)
10898                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10899                 ;;
10900         esac
10901         ;;
10902 yes)
10903         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10904
10905         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10906
10907         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10908                 && test -z "${cf_tst_cflags}" \
10909                 && cf_fix_cppflags=no
10910         ;;
10911 esac
10912 done
10913
10914 if test -n "$cf_new_cflags" ; then
10915
10916         CFLAGS="$CFLAGS $cf_new_cflags"
10917 fi
10918
10919 if test -n "$cf_new_cppflags" ; then
10920
10921         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10922 fi
10923
10924 if test -n "$cf_new_extra_cppflags" ; then
10925
10926         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10927 fi
10928
10929 cf_add_libs="$cf_pkgconfig_libs"
10930 # Filter out duplicates - this happens with badly-designed ".pc" files...
10931 for cf_add_1lib in $LIBS
10932 do
10933         for cf_add_2lib in $cf_add_libs
10934         do
10935                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10936                 then
10937                         cf_add_1lib=
10938                         break
10939                 fi
10940         done
10941         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10942 done
10943 LIBS="$cf_add_libs"
10944
10945         :
10946 else
10947         cf_pkgconfig_incs=
10948         cf_pkgconfig_libs=
10949         { echo "$as_me:10949: WARNING: unable to find ICE library" >&5
10950 echo "$as_me: WARNING: unable to find ICE library" >&2;}
10951 fi
10952
10953 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
10954         test -n "$verbose" && echo "    found package sm" 1>&6
10955
10956 echo "${as_me:-configure}:10956: testing found package sm ..." 1>&5
10957
10958         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
10959         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
10960         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
10961
10962 echo "${as_me:-configure}:10962: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10963
10964         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
10965
10966 echo "${as_me:-configure}:10966: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
10967
10968 cf_fix_cppflags=no
10969 cf_new_cflags=
10970 cf_new_cppflags=
10971 cf_new_extra_cppflags=
10972
10973 for cf_add_cflags in $cf_pkgconfig_incs
10974 do
10975 case $cf_fix_cppflags in
10976 no)
10977         case $cf_add_cflags in #(vi
10978         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10979                 case $cf_add_cflags in
10980                 -D*)
10981                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10982
10983                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10984                                 && test -z "${cf_tst_cflags}" \
10985                                 && cf_fix_cppflags=yes
10986
10987                         if test $cf_fix_cppflags = yes ; then
10988                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10989                                 continue
10990                         elif test "${cf_tst_cflags}" = "\"'" ; then
10991                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10992                                 continue
10993                         fi
10994                         ;;
10995                 esac
10996                 case "$CPPFLAGS" in
10997                 *$cf_add_cflags) #(vi
10998                         ;;
10999                 *) #(vi
11000                         case $cf_add_cflags in #(vi
11001                         -D*)
11002                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11003
11004 CPPFLAGS=`echo "$CPPFLAGS" | \
11005         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11006                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11007
11008                                 ;;
11009                         esac
11010                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11011                         ;;
11012                 esac
11013                 ;;
11014         *)
11015                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11016                 ;;
11017         esac
11018         ;;
11019 yes)
11020         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11021
11022         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11023
11024         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11025                 && test -z "${cf_tst_cflags}" \
11026                 && cf_fix_cppflags=no
11027         ;;
11028 esac
11029 done
11030
11031 if test -n "$cf_new_cflags" ; then
11032
11033         CFLAGS="$CFLAGS $cf_new_cflags"
11034 fi
11035
11036 if test -n "$cf_new_cppflags" ; then
11037
11038         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11039 fi
11040
11041 if test -n "$cf_new_extra_cppflags" ; then
11042
11043         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11044 fi
11045
11046 cf_add_libs="$cf_pkgconfig_libs"
11047 # Filter out duplicates - this happens with badly-designed ".pc" files...
11048 for cf_add_1lib in $LIBS
11049 do
11050         for cf_add_2lib in $cf_add_libs
11051         do
11052                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11053                 then
11054                         cf_add_1lib=
11055                         break
11056                 fi
11057         done
11058         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11059 done
11060 LIBS="$cf_add_libs"
11061
11062         :
11063 else
11064         cf_pkgconfig_incs=
11065         cf_pkgconfig_libs=
11066         { echo "$as_me:11066: WARNING: unable to find SM library" >&5
11067 echo "$as_me: WARNING: unable to find SM library" >&2;}
11068 fi
11069
11070 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11071         test -n "$verbose" && echo "    found package xt" 1>&6
11072
11073 echo "${as_me:-configure}:11073: testing found package xt ..." 1>&5
11074
11075         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11076         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11077         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11078
11079 echo "${as_me:-configure}:11079: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11080
11081         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11082
11083 echo "${as_me:-configure}:11083: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11084
11085 cf_fix_cppflags=no
11086 cf_new_cflags=
11087 cf_new_cppflags=
11088 cf_new_extra_cppflags=
11089
11090 for cf_add_cflags in $cf_pkgconfig_incs
11091 do
11092 case $cf_fix_cppflags in
11093 no)
11094         case $cf_add_cflags in #(vi
11095         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11096                 case $cf_add_cflags in
11097                 -D*)
11098                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11099
11100                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11101                                 && test -z "${cf_tst_cflags}" \
11102                                 && cf_fix_cppflags=yes
11103
11104                         if test $cf_fix_cppflags = yes ; then
11105                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11106                                 continue
11107                         elif test "${cf_tst_cflags}" = "\"'" ; then
11108                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11109                                 continue
11110                         fi
11111                         ;;
11112                 esac
11113                 case "$CPPFLAGS" in
11114                 *$cf_add_cflags) #(vi
11115                         ;;
11116                 *) #(vi
11117                         case $cf_add_cflags in #(vi
11118                         -D*)
11119                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11120
11121 CPPFLAGS=`echo "$CPPFLAGS" | \
11122         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11123                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11124
11125                                 ;;
11126                         esac
11127                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11128                         ;;
11129                 esac
11130                 ;;
11131         *)
11132                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11133                 ;;
11134         esac
11135         ;;
11136 yes)
11137         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11138
11139         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11140
11141         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11142                 && test -z "${cf_tst_cflags}" \
11143                 && cf_fix_cppflags=no
11144         ;;
11145 esac
11146 done
11147
11148 if test -n "$cf_new_cflags" ; then
11149
11150         CFLAGS="$CFLAGS $cf_new_cflags"
11151 fi
11152
11153 if test -n "$cf_new_cppflags" ; then
11154
11155         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11156 fi
11157
11158 if test -n "$cf_new_extra_cppflags" ; then
11159
11160         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11161 fi
11162
11163 cf_add_libs="$cf_pkgconfig_libs"
11164 # Filter out duplicates - this happens with badly-designed ".pc" files...
11165 for cf_add_1lib in $LIBS
11166 do
11167         for cf_add_2lib in $cf_add_libs
11168         do
11169                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11170                 then
11171                         cf_add_1lib=
11172                         break
11173                 fi
11174         done
11175         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11176 done
11177 LIBS="$cf_add_libs"
11178
11179         :
11180 else
11181         cf_pkgconfig_incs=
11182         cf_pkgconfig_libs=
11183         { echo "$as_me:11183: WARNING: unable to find Xt library" >&5
11184 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11185 fi
11186
11187 fi
11188
11189 cf_have_X_LIBS=no
11190
11191 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11192         test -n "$verbose" && echo "    found package xt" 1>&6
11193
11194 echo "${as_me:-configure}:11194: testing found package xt ..." 1>&5
11195
11196         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11197         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11198         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11199
11200 echo "${as_me:-configure}:11200: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11201
11202         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11203
11204 echo "${as_me:-configure}:11204: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11205
11206 cf_fix_cppflags=no
11207 cf_new_cflags=
11208 cf_new_cppflags=
11209 cf_new_extra_cppflags=
11210
11211 for cf_add_cflags in $cf_pkgconfig_incs
11212 do
11213 case $cf_fix_cppflags in
11214 no)
11215         case $cf_add_cflags in #(vi
11216         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11217                 case $cf_add_cflags in
11218                 -D*)
11219                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11220
11221                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11222                                 && test -z "${cf_tst_cflags}" \
11223                                 && cf_fix_cppflags=yes
11224
11225                         if test $cf_fix_cppflags = yes ; then
11226                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11227                                 continue
11228                         elif test "${cf_tst_cflags}" = "\"'" ; then
11229                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11230                                 continue
11231                         fi
11232                         ;;
11233                 esac
11234                 case "$CPPFLAGS" in
11235                 *$cf_add_cflags) #(vi
11236                         ;;
11237                 *) #(vi
11238                         case $cf_add_cflags in #(vi
11239                         -D*)
11240                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11241
11242 CPPFLAGS=`echo "$CPPFLAGS" | \
11243         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11244                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11245
11246                                 ;;
11247                         esac
11248                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11249                         ;;
11250                 esac
11251                 ;;
11252         *)
11253                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11254                 ;;
11255         esac
11256         ;;
11257 yes)
11258         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11259
11260         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11261
11262         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11263                 && test -z "${cf_tst_cflags}" \
11264                 && cf_fix_cppflags=no
11265         ;;
11266 esac
11267 done
11268
11269 if test -n "$cf_new_cflags" ; then
11270
11271         CFLAGS="$CFLAGS $cf_new_cflags"
11272 fi
11273
11274 if test -n "$cf_new_cppflags" ; then
11275
11276         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11277 fi
11278
11279 if test -n "$cf_new_extra_cppflags" ; then
11280
11281         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11282 fi
11283
11284 cf_add_libs="$cf_pkgconfig_libs"
11285 # Filter out duplicates - this happens with badly-designed ".pc" files...
11286 for cf_add_1lib in $LIBS
11287 do
11288         for cf_add_2lib in $cf_add_libs
11289         do
11290                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11291                 then
11292                         cf_add_1lib=
11293                         break
11294                 fi
11295         done
11296         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11297 done
11298 LIBS="$cf_add_libs"
11299
11300         case "x$LIBS" in #(vi
11301         *-lX11*) #(vi
11302                 ;;
11303         *)
11304 # we have an "xt" package, but it may omit Xt's dependency on X11
11305 echo "$as_me:11305: checking for usable X dependency" >&5
11306 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11307 if test "${cf_cv_xt_x11_compat+set}" = set; then
11308   echo $ECHO_N "(cached) $ECHO_C" >&6
11309 else
11310
11311 cat >conftest.$ac_ext <<_ACEOF
11312 #line 11312 "configure"
11313 #include "confdefs.h"
11314
11315 #include <X11/Xlib.h>
11316
11317 int
11318 main ()
11319 {
11320
11321         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11322         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11323         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11324         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11325
11326   ;
11327   return 0;
11328 }
11329 _ACEOF
11330 rm -f conftest.$ac_objext conftest$ac_exeext
11331 if { (eval echo "$as_me:11331: \"$ac_link\"") >&5
11332   (eval $ac_link) 2>&5
11333   ac_status=$?
11334   echo "$as_me:11334: \$? = $ac_status" >&5
11335   (exit $ac_status); } &&
11336          { ac_try='test -s conftest$ac_exeext'
11337   { (eval echo "$as_me:11337: \"$ac_try\"") >&5
11338   (eval $ac_try) 2>&5
11339   ac_status=$?
11340   echo "$as_me:11340: \$? = $ac_status" >&5
11341   (exit $ac_status); }; }; then
11342   cf_cv_xt_x11_compat=yes
11343 else
11344   echo "$as_me: failed program was:" >&5
11345 cat conftest.$ac_ext >&5
11346 cf_cv_xt_x11_compat=no
11347 fi
11348 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11349 fi
11350 echo "$as_me:11350: result: $cf_cv_xt_x11_compat" >&5
11351 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11352                 if test "$cf_cv_xt_x11_compat" = no
11353                 then
11354                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11355
11356 echo "${as_me:-configure}:11356: testing work around broken X11 dependency ..." 1>&5
11357
11358                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11359
11360 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11361         test -n "$verbose" && echo "    found package x11" 1>&6
11362
11363 echo "${as_me:-configure}:11363: testing found package x11 ..." 1>&5
11364
11365         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11366         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11367         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11368
11369 echo "${as_me:-configure}:11369: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11370
11371         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11372
11373 echo "${as_me:-configure}:11373: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11374
11375 cf_fix_cppflags=no
11376 cf_new_cflags=
11377 cf_new_cppflags=
11378 cf_new_extra_cppflags=
11379
11380 for cf_add_cflags in $cf_pkgconfig_incs
11381 do
11382 case $cf_fix_cppflags in
11383 no)
11384         case $cf_add_cflags in #(vi
11385         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11386                 case $cf_add_cflags in
11387                 -D*)
11388                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11389
11390                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11391                                 && test -z "${cf_tst_cflags}" \
11392                                 && cf_fix_cppflags=yes
11393
11394                         if test $cf_fix_cppflags = yes ; then
11395                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11396                                 continue
11397                         elif test "${cf_tst_cflags}" = "\"'" ; then
11398                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11399                                 continue
11400                         fi
11401                         ;;
11402                 esac
11403                 case "$CPPFLAGS" in
11404                 *$cf_add_cflags) #(vi
11405                         ;;
11406                 *) #(vi
11407                         case $cf_add_cflags in #(vi
11408                         -D*)
11409                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11410
11411 CPPFLAGS=`echo "$CPPFLAGS" | \
11412         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11413                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11414
11415                                 ;;
11416                         esac
11417                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11418                         ;;
11419                 esac
11420                 ;;
11421         *)
11422                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11423                 ;;
11424         esac
11425         ;;
11426 yes)
11427         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11428
11429         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11430
11431         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11432                 && test -z "${cf_tst_cflags}" \
11433                 && cf_fix_cppflags=no
11434         ;;
11435 esac
11436 done
11437
11438 if test -n "$cf_new_cflags" ; then
11439
11440         CFLAGS="$CFLAGS $cf_new_cflags"
11441 fi
11442
11443 if test -n "$cf_new_cppflags" ; then
11444
11445         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11446 fi
11447
11448 if test -n "$cf_new_extra_cppflags" ; then
11449
11450         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11451 fi
11452
11453 cf_add_libs="$cf_pkgconfig_libs"
11454 # Filter out duplicates - this happens with badly-designed ".pc" files...
11455 for cf_add_1lib in $LIBS
11456 do
11457         for cf_add_2lib in $cf_add_libs
11458         do
11459                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11460                 then
11461                         cf_add_1lib=
11462                         break
11463                 fi
11464         done
11465         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11466 done
11467 LIBS="$cf_add_libs"
11468
11469         :
11470 else
11471         cf_pkgconfig_incs=
11472         cf_pkgconfig_libs=
11473
11474 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11475
11476 echo "${as_me:-configure}:11476: testing ...before $LIBS ..." 1>&5
11477
11478 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
11479 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11480
11481 echo "${as_me:-configure}:11481: testing ...after  $LIBS ..." 1>&5
11482
11483 fi
11484
11485                 fi
11486                 ;;
11487         esac
11488
11489 echo "$as_me:11489: checking for usable X Toolkit package" >&5
11490 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11491 if test "${cf_cv_xt_ice_compat+set}" = set; then
11492   echo $ECHO_N "(cached) $ECHO_C" >&6
11493 else
11494
11495 cat >conftest.$ac_ext <<_ACEOF
11496 #line 11496 "configure"
11497 #include "confdefs.h"
11498
11499 #include <X11/Shell.h>
11500
11501 int
11502 main ()
11503 {
11504 int num = IceConnectionNumber(0)
11505
11506   ;
11507   return 0;
11508 }
11509 _ACEOF
11510 rm -f conftest.$ac_objext conftest$ac_exeext
11511 if { (eval echo "$as_me:11511: \"$ac_link\"") >&5
11512   (eval $ac_link) 2>&5
11513   ac_status=$?
11514   echo "$as_me:11514: \$? = $ac_status" >&5
11515   (exit $ac_status); } &&
11516          { ac_try='test -s conftest$ac_exeext'
11517   { (eval echo "$as_me:11517: \"$ac_try\"") >&5
11518   (eval $ac_try) 2>&5
11519   ac_status=$?
11520   echo "$as_me:11520: \$? = $ac_status" >&5
11521   (exit $ac_status); }; }; then
11522   cf_cv_xt_ice_compat=yes
11523 else
11524   echo "$as_me: failed program was:" >&5
11525 cat conftest.$ac_ext >&5
11526 cf_cv_xt_ice_compat=no
11527 fi
11528 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11529 fi
11530 echo "$as_me:11530: result: $cf_cv_xt_ice_compat" >&5
11531 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11532
11533         if test "$cf_cv_xt_ice_compat" = no
11534         then
11535                 # workaround for broken ".pc" files used for X Toolkit.
11536                 case "x$X_PRE_LIBS" in #(vi
11537                 *-lICE*)
11538                         case "x$LIBS" in #(vi
11539                         *-lICE*) #(vi
11540                                 ;;
11541                         *)
11542                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11543
11544 echo "${as_me:-configure}:11544: testing work around broken ICE dependency ..." 1>&5
11545
11546 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11547         test -n "$verbose" && echo "    found package ice" 1>&6
11548
11549 echo "${as_me:-configure}:11549: testing found package ice ..." 1>&5
11550
11551         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11552         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11553         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11554
11555 echo "${as_me:-configure}:11555: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11556
11557         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11558
11559 echo "${as_me:-configure}:11559: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11560
11561 cf_fix_cppflags=no
11562 cf_new_cflags=
11563 cf_new_cppflags=
11564 cf_new_extra_cppflags=
11565
11566 for cf_add_cflags in $cf_pkgconfig_incs
11567 do
11568 case $cf_fix_cppflags in
11569 no)
11570         case $cf_add_cflags in #(vi
11571         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11572                 case $cf_add_cflags in
11573                 -D*)
11574                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11575
11576                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11577                                 && test -z "${cf_tst_cflags}" \
11578                                 && cf_fix_cppflags=yes
11579
11580                         if test $cf_fix_cppflags = yes ; then
11581                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11582                                 continue
11583                         elif test "${cf_tst_cflags}" = "\"'" ; then
11584                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11585                                 continue
11586                         fi
11587                         ;;
11588                 esac
11589                 case "$CPPFLAGS" in
11590                 *$cf_add_cflags) #(vi
11591                         ;;
11592                 *) #(vi
11593                         case $cf_add_cflags in #(vi
11594                         -D*)
11595                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11596
11597 CPPFLAGS=`echo "$CPPFLAGS" | \
11598         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11599                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11600
11601                                 ;;
11602                         esac
11603                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11604                         ;;
11605                 esac
11606                 ;;
11607         *)
11608                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11609                 ;;
11610         esac
11611         ;;
11612 yes)
11613         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11614
11615         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11616
11617         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11618                 && test -z "${cf_tst_cflags}" \
11619                 && cf_fix_cppflags=no
11620         ;;
11621 esac
11622 done
11623
11624 if test -n "$cf_new_cflags" ; then
11625
11626         CFLAGS="$CFLAGS $cf_new_cflags"
11627 fi
11628
11629 if test -n "$cf_new_cppflags" ; then
11630
11631         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11632 fi
11633
11634 if test -n "$cf_new_extra_cppflags" ; then
11635
11636         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11637 fi
11638
11639 cf_add_libs="$cf_pkgconfig_libs"
11640 # Filter out duplicates - this happens with badly-designed ".pc" files...
11641 for cf_add_1lib in $LIBS
11642 do
11643         for cf_add_2lib in $cf_add_libs
11644         do
11645                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11646                 then
11647                         cf_add_1lib=
11648                         break
11649                 fi
11650         done
11651         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11652 done
11653 LIBS="$cf_add_libs"
11654
11655 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11656         test -n "$verbose" && echo "    found package sm" 1>&6
11657
11658 echo "${as_me:-configure}:11658: testing found package sm ..." 1>&5
11659
11660         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11661         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11662         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11663
11664 echo "${as_me:-configure}:11664: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11665
11666         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11667
11668 echo "${as_me:-configure}:11668: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11669
11670 cf_fix_cppflags=no
11671 cf_new_cflags=
11672 cf_new_cppflags=
11673 cf_new_extra_cppflags=
11674
11675 for cf_add_cflags in $cf_pkgconfig_incs
11676 do
11677 case $cf_fix_cppflags in
11678 no)
11679         case $cf_add_cflags in #(vi
11680         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11681                 case $cf_add_cflags in
11682                 -D*)
11683                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11684
11685                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11686                                 && test -z "${cf_tst_cflags}" \
11687                                 && cf_fix_cppflags=yes
11688
11689                         if test $cf_fix_cppflags = yes ; then
11690                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11691                                 continue
11692                         elif test "${cf_tst_cflags}" = "\"'" ; then
11693                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11694                                 continue
11695                         fi
11696                         ;;
11697                 esac
11698                 case "$CPPFLAGS" in
11699                 *$cf_add_cflags) #(vi
11700                         ;;
11701                 *) #(vi
11702                         case $cf_add_cflags in #(vi
11703                         -D*)
11704                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11705
11706 CPPFLAGS=`echo "$CPPFLAGS" | \
11707         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11708                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11709
11710                                 ;;
11711                         esac
11712                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11713                         ;;
11714                 esac
11715                 ;;
11716         *)
11717                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11718                 ;;
11719         esac
11720         ;;
11721 yes)
11722         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11723
11724         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11725
11726         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11727                 && test -z "${cf_tst_cflags}" \
11728                 && cf_fix_cppflags=no
11729         ;;
11730 esac
11731 done
11732
11733 if test -n "$cf_new_cflags" ; then
11734
11735         CFLAGS="$CFLAGS $cf_new_cflags"
11736 fi
11737
11738 if test -n "$cf_new_cppflags" ; then
11739
11740         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11741 fi
11742
11743 if test -n "$cf_new_extra_cppflags" ; then
11744
11745         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11746 fi
11747
11748 cf_add_libs="$cf_pkgconfig_libs"
11749 # Filter out duplicates - this happens with badly-designed ".pc" files...
11750 for cf_add_1lib in $LIBS
11751 do
11752         for cf_add_2lib in $cf_add_libs
11753         do
11754                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11755                 then
11756                         cf_add_1lib=
11757                         break
11758                 fi
11759         done
11760         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11761 done
11762 LIBS="$cf_add_libs"
11763
11764         :
11765 else
11766         cf_pkgconfig_incs=
11767         cf_pkgconfig_libs=
11768         :
11769 fi
11770
11771 else
11772         cf_pkgconfig_incs=
11773         cf_pkgconfig_libs=
11774
11775 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11776
11777 echo "${as_me:-configure}:11777: testing ...before $LIBS ..." 1>&5
11778
11779 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
11780 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11781
11782 echo "${as_me:-configure}:11782: testing ...after  $LIBS ..." 1>&5
11783
11784 fi
11785
11786                                 ;;
11787                         esac
11788                         ;;
11789                 esac
11790         fi
11791
11792         cf_have_X_LIBS=yes
11793
11794 else
11795         cf_pkgconfig_incs=
11796         cf_pkgconfig_libs=
11797
11798         LDFLAGS="$X_LIBS $LDFLAGS"
11799
11800 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11801
11802 echo "${as_me:-configure}:11802: testing checking additions to CFLAGS ..." 1>&5
11803
11804 cf_check_cflags="$CFLAGS"
11805 cf_check_cppflags="$CPPFLAGS"
11806
11807 cf_fix_cppflags=no
11808 cf_new_cflags=
11809 cf_new_cppflags=
11810 cf_new_extra_cppflags=
11811
11812 for cf_add_cflags in $X_CFLAGS
11813 do
11814 case $cf_fix_cppflags in
11815 no)
11816         case $cf_add_cflags in #(vi
11817         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11818                 case $cf_add_cflags in
11819                 -D*)
11820                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11821
11822                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11823                                 && test -z "${cf_tst_cflags}" \
11824                                 && cf_fix_cppflags=yes
11825
11826                         if test $cf_fix_cppflags = yes ; then
11827                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11828                                 continue
11829                         elif test "${cf_tst_cflags}" = "\"'" ; then
11830                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11831                                 continue
11832                         fi
11833                         ;;
11834                 esac
11835                 case "$CPPFLAGS" in
11836                 *$cf_add_cflags) #(vi
11837                         ;;
11838                 *) #(vi
11839                         case $cf_add_cflags in #(vi
11840                         -D*)
11841                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11842
11843 CPPFLAGS=`echo "$CPPFLAGS" | \
11844         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11845                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11846
11847                                 ;;
11848                         esac
11849                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11850                         ;;
11851                 esac
11852                 ;;
11853         *)
11854                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11855                 ;;
11856         esac
11857         ;;
11858 yes)
11859         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11860
11861         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11862
11863         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11864                 && test -z "${cf_tst_cflags}" \
11865                 && cf_fix_cppflags=no
11866         ;;
11867 esac
11868 done
11869
11870 if test -n "$cf_new_cflags" ; then
11871         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11872
11873 echo "${as_me:-configure}:11873: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11874
11875         CFLAGS="$CFLAGS $cf_new_cflags"
11876 fi
11877
11878 if test -n "$cf_new_cppflags" ; then
11879         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11880
11881 echo "${as_me:-configure}:11881: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11882
11883         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11884 fi
11885
11886 if test -n "$cf_new_extra_cppflags" ; then
11887         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11888
11889 echo "${as_me:-configure}:11889: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11890
11891         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11892 fi
11893
11894 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
11895 cat >conftest.$ac_ext <<_ACEOF
11896 #line 11896 "configure"
11897 #include "confdefs.h"
11898 #include <stdio.h>
11899 int
11900 main ()
11901 {
11902 printf("Hello world");
11903   ;
11904   return 0;
11905 }
11906 _ACEOF
11907 rm -f conftest.$ac_objext conftest$ac_exeext
11908 if { (eval echo "$as_me:11908: \"$ac_link\"") >&5
11909   (eval $ac_link) 2>&5
11910   ac_status=$?
11911   echo "$as_me:11911: \$? = $ac_status" >&5
11912   (exit $ac_status); } &&
11913          { ac_try='test -s conftest$ac_exeext'
11914   { (eval echo "$as_me:11914: \"$ac_try\"") >&5
11915   (eval $ac_try) 2>&5
11916   ac_status=$?
11917   echo "$as_me:11917: \$? = $ac_status" >&5
11918   (exit $ac_status); }; }; then
11919   :
11920 else
11921   echo "$as_me: failed program was:" >&5
11922 cat conftest.$ac_ext >&5
11923 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
11924
11925 echo "${as_me:-configure}:11925: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
11926
11927          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
11928                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
11929
11930 echo "${as_me:-configure}:11930: testing but keeping change to \$CPPFLAGS ..." 1>&5
11931
11932          fi
11933          CFLAGS="$cf_check_flags"
11934 fi
11935 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11936 fi
11937
11938         echo "$as_me:11938: checking for XOpenDisplay" >&5
11939 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
11940 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
11941   echo $ECHO_N "(cached) $ECHO_C" >&6
11942 else
11943   cat >conftest.$ac_ext <<_ACEOF
11944 #line 11944 "configure"
11945 #include "confdefs.h"
11946 /* System header to define __stub macros and hopefully few prototypes,
11947     which can conflict with char XOpenDisplay (); below.  */
11948 #include <assert.h>
11949 /* Override any gcc2 internal prototype to avoid an error.  */
11950 #ifdef __cplusplus
11951 extern "C"
11952 #endif
11953 /* We use char because int might match the return type of a gcc2
11954    builtin and then its argument prototype would still apply.  */
11955 char XOpenDisplay ();
11956 char (*f) ();
11957
11958 int
11959 main ()
11960 {
11961 /* The GNU C library defines this for functions which it implements
11962     to always fail with ENOSYS.  Some functions are actually named
11963     something starting with __ and the normal name is an alias.  */
11964 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
11965 choke me
11966 #else
11967 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11968 #endif
11969
11970   ;
11971   return 0;
11972 }
11973 _ACEOF
11974 rm -f conftest.$ac_objext conftest$ac_exeext
11975 if { (eval echo "$as_me:11975: \"$ac_link\"") >&5
11976   (eval $ac_link) 2>&5
11977   ac_status=$?
11978   echo "$as_me:11978: \$? = $ac_status" >&5
11979   (exit $ac_status); } &&
11980          { ac_try='test -s conftest$ac_exeext'
11981   { (eval echo "$as_me:11981: \"$ac_try\"") >&5
11982   (eval $ac_try) 2>&5
11983   ac_status=$?
11984   echo "$as_me:11984: \$? = $ac_status" >&5
11985   (exit $ac_status); }; }; then
11986   ac_cv_func_XOpenDisplay=yes
11987 else
11988   echo "$as_me: failed program was:" >&5
11989 cat conftest.$ac_ext >&5
11990 ac_cv_func_XOpenDisplay=no
11991 fi
11992 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11993 fi
11994 echo "$as_me:11994: result: $ac_cv_func_XOpenDisplay" >&5
11995 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
11996 if test $ac_cv_func_XOpenDisplay = yes; then
11997   :
11998 else
11999
12000         echo "$as_me:12000: checking for XOpenDisplay in -lX11" >&5
12001 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12002 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12003   echo $ECHO_N "(cached) $ECHO_C" >&6
12004 else
12005   ac_check_lib_save_LIBS=$LIBS
12006 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12007 cat >conftest.$ac_ext <<_ACEOF
12008 #line 12008 "configure"
12009 #include "confdefs.h"
12010
12011 /* Override any gcc2 internal prototype to avoid an error.  */
12012 #ifdef __cplusplus
12013 extern "C"
12014 #endif
12015 /* We use char because int might match the return type of a gcc2
12016    builtin and then its argument prototype would still apply.  */
12017 char XOpenDisplay ();
12018 int
12019 main ()
12020 {
12021 XOpenDisplay ();
12022   ;
12023   return 0;
12024 }
12025 _ACEOF
12026 rm -f conftest.$ac_objext conftest$ac_exeext
12027 if { (eval echo "$as_me:12027: \"$ac_link\"") >&5
12028   (eval $ac_link) 2>&5
12029   ac_status=$?
12030   echo "$as_me:12030: \$? = $ac_status" >&5
12031   (exit $ac_status); } &&
12032          { ac_try='test -s conftest$ac_exeext'
12033   { (eval echo "$as_me:12033: \"$ac_try\"") >&5
12034   (eval $ac_try) 2>&5
12035   ac_status=$?
12036   echo "$as_me:12036: \$? = $ac_status" >&5
12037   (exit $ac_status); }; }; then
12038   ac_cv_lib_X11_XOpenDisplay=yes
12039 else
12040   echo "$as_me: failed program was:" >&5
12041 cat conftest.$ac_ext >&5
12042 ac_cv_lib_X11_XOpenDisplay=no
12043 fi
12044 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12045 LIBS=$ac_check_lib_save_LIBS
12046 fi
12047 echo "$as_me:12047: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12048 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12049 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12050
12051 cf_add_libs="-lX11"
12052 # Filter out duplicates - this happens with badly-designed ".pc" files...
12053 for cf_add_1lib in $LIBS
12054 do
12055         for cf_add_2lib in $cf_add_libs
12056         do
12057                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12058                 then
12059                         cf_add_1lib=
12060                         break
12061                 fi
12062         done
12063         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12064 done
12065 LIBS="$cf_add_libs"
12066
12067 fi
12068
12069 fi
12070
12071         echo "$as_me:12071: checking for XtAppInitialize" >&5
12072 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12073 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12074   echo $ECHO_N "(cached) $ECHO_C" >&6
12075 else
12076   cat >conftest.$ac_ext <<_ACEOF
12077 #line 12077 "configure"
12078 #include "confdefs.h"
12079 /* System header to define __stub macros and hopefully few prototypes,
12080     which can conflict with char XtAppInitialize (); below.  */
12081 #include <assert.h>
12082 /* Override any gcc2 internal prototype to avoid an error.  */
12083 #ifdef __cplusplus
12084 extern "C"
12085 #endif
12086 /* We use char because int might match the return type of a gcc2
12087    builtin and then its argument prototype would still apply.  */
12088 char XtAppInitialize ();
12089 char (*f) ();
12090
12091 int
12092 main ()
12093 {
12094 /* The GNU C library defines this for functions which it implements
12095     to always fail with ENOSYS.  Some functions are actually named
12096     something starting with __ and the normal name is an alias.  */
12097 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12098 choke me
12099 #else
12100 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12101 #endif
12102
12103   ;
12104   return 0;
12105 }
12106 _ACEOF
12107 rm -f conftest.$ac_objext conftest$ac_exeext
12108 if { (eval echo "$as_me:12108: \"$ac_link\"") >&5
12109   (eval $ac_link) 2>&5
12110   ac_status=$?
12111   echo "$as_me:12111: \$? = $ac_status" >&5
12112   (exit $ac_status); } &&
12113          { ac_try='test -s conftest$ac_exeext'
12114   { (eval echo "$as_me:12114: \"$ac_try\"") >&5
12115   (eval $ac_try) 2>&5
12116   ac_status=$?
12117   echo "$as_me:12117: \$? = $ac_status" >&5
12118   (exit $ac_status); }; }; then
12119   ac_cv_func_XtAppInitialize=yes
12120 else
12121   echo "$as_me: failed program was:" >&5
12122 cat conftest.$ac_ext >&5
12123 ac_cv_func_XtAppInitialize=no
12124 fi
12125 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12126 fi
12127 echo "$as_me:12127: result: $ac_cv_func_XtAppInitialize" >&5
12128 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12129 if test $ac_cv_func_XtAppInitialize = yes; then
12130   :
12131 else
12132
12133         echo "$as_me:12133: checking for XtAppInitialize in -lXt" >&5
12134 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12135 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12136   echo $ECHO_N "(cached) $ECHO_C" >&6
12137 else
12138   ac_check_lib_save_LIBS=$LIBS
12139 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12140 cat >conftest.$ac_ext <<_ACEOF
12141 #line 12141 "configure"
12142 #include "confdefs.h"
12143
12144 /* Override any gcc2 internal prototype to avoid an error.  */
12145 #ifdef __cplusplus
12146 extern "C"
12147 #endif
12148 /* We use char because int might match the return type of a gcc2
12149    builtin and then its argument prototype would still apply.  */
12150 char XtAppInitialize ();
12151 int
12152 main ()
12153 {
12154 XtAppInitialize ();
12155   ;
12156   return 0;
12157 }
12158 _ACEOF
12159 rm -f conftest.$ac_objext conftest$ac_exeext
12160 if { (eval echo "$as_me:12160: \"$ac_link\"") >&5
12161   (eval $ac_link) 2>&5
12162   ac_status=$?
12163   echo "$as_me:12163: \$? = $ac_status" >&5
12164   (exit $ac_status); } &&
12165          { ac_try='test -s conftest$ac_exeext'
12166   { (eval echo "$as_me:12166: \"$ac_try\"") >&5
12167   (eval $ac_try) 2>&5
12168   ac_status=$?
12169   echo "$as_me:12169: \$? = $ac_status" >&5
12170   (exit $ac_status); }; }; then
12171   ac_cv_lib_Xt_XtAppInitialize=yes
12172 else
12173   echo "$as_me: failed program was:" >&5
12174 cat conftest.$ac_ext >&5
12175 ac_cv_lib_Xt_XtAppInitialize=no
12176 fi
12177 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12178 LIBS=$ac_check_lib_save_LIBS
12179 fi
12180 echo "$as_me:12180: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12181 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12182 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12183
12184 cat >>confdefs.h <<\EOF
12185 #define HAVE_LIBXT 1
12186 EOF
12187
12188                  cf_have_X_LIBS=Xt
12189                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12190 fi
12191
12192 fi
12193
12194 fi
12195
12196 if test $cf_have_X_LIBS = no ; then
12197         { echo "$as_me:12197: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12198 test program.  You will have to check and add the proper libraries by hand
12199 to makefile." >&5
12200 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12201 test program.  You will have to check and add the proper libraries by hand
12202 to makefile." >&2;}
12203 fi
12204
12205 cf_x_athena_root=$cf_x_athena
12206 cf_x_athena_inc=""
12207
12208 for cf_path in default \
12209         /usr/contrib/X11R6 \
12210         /usr/contrib/X11R5 \
12211         /usr/lib/X11R5 \
12212         /usr/local
12213 do
12214         if test -z "$cf_x_athena_inc" ; then
12215                 cf_save="$CPPFLAGS"
12216                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12217                 if test $cf_path != default ; then
12218                         CPPFLAGS="$cf_save -I$cf_path/include"
12219                         echo "$as_me:12219: checking for $cf_test in $cf_path" >&5
12220 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12221                 else
12222                         echo "$as_me:12222: checking for $cf_test" >&5
12223 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12224                 fi
12225                 cat >conftest.$ac_ext <<_ACEOF
12226 #line 12226 "configure"
12227 #include "confdefs.h"
12228
12229 #include <X11/Intrinsic.h>
12230 #include <$cf_test>
12231 int
12232 main ()
12233 {
12234
12235   ;
12236   return 0;
12237 }
12238 _ACEOF
12239 rm -f conftest.$ac_objext
12240 if { (eval echo "$as_me:12240: \"$ac_compile\"") >&5
12241   (eval $ac_compile) 2>&5
12242   ac_status=$?
12243   echo "$as_me:12243: \$? = $ac_status" >&5
12244   (exit $ac_status); } &&
12245          { ac_try='test -s conftest.$ac_objext'
12246   { (eval echo "$as_me:12246: \"$ac_try\"") >&5
12247   (eval $ac_try) 2>&5
12248   ac_status=$?
12249   echo "$as_me:12249: \$? = $ac_status" >&5
12250   (exit $ac_status); }; }; then
12251   cf_result=yes
12252 else
12253   echo "$as_me: failed program was:" >&5
12254 cat conftest.$ac_ext >&5
12255 cf_result=no
12256 fi
12257 rm -f conftest.$ac_objext conftest.$ac_ext
12258                 echo "$as_me:12258: result: $cf_result" >&5
12259 echo "${ECHO_T}$cf_result" >&6
12260                 if test "$cf_result" = yes ; then
12261                         cf_x_athena_inc=$cf_path
12262                         break
12263                 else
12264                         CPPFLAGS="$cf_save"
12265                 fi
12266         fi
12267 done
12268
12269 if test -z "$cf_x_athena_inc" ; then
12270         { echo "$as_me:12270: WARNING: Unable to successfully find Athena header files with test program" >&5
12271 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12272 elif test "$cf_x_athena_inc" != default ; then
12273         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12274 fi
12275
12276 cf_x_athena_root=$cf_x_athena
12277 cf_x_athena_lib=""
12278
12279 for cf_path in default \
12280         /usr/contrib/X11R6 \
12281         /usr/contrib/X11R5 \
12282         /usr/lib/X11R5 \
12283         /usr/local
12284 do
12285         for cf_lib in \
12286                 ${cf_x_athena_root} \
12287                 ${cf_x_athena_root}7 \
12288                 ${cf_x_athena_root}6
12289         do
12290         for cf_libs in \
12291                 "-l$cf_lib -lXmu" \
12292                 "-l$cf_lib -lXpm -lXmu" \
12293                 "-l${cf_lib}_s -lXmu_s"
12294         do
12295                 if test -z "$cf_x_athena_lib" ; then
12296                         cf_save="$LIBS"
12297                         cf_test=XawSimpleMenuAddGlobalActions
12298                         if test $cf_path != default ; then
12299
12300 cf_add_libs="-L$cf_path/lib $cf_libs"
12301 # Filter out duplicates - this happens with badly-designed ".pc" files...
12302 for cf_add_1lib in $LIBS
12303 do
12304         for cf_add_2lib in $cf_add_libs
12305         do
12306                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12307                 then
12308                         cf_add_1lib=
12309                         break
12310                 fi
12311         done
12312         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12313 done
12314 LIBS="$cf_add_libs"
12315
12316                                 echo "$as_me:12316: checking for $cf_libs in $cf_path" >&5
12317 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12318                         else
12319
12320 cf_add_libs="$cf_libs"
12321 # Filter out duplicates - this happens with badly-designed ".pc" files...
12322 for cf_add_1lib in $LIBS
12323 do
12324         for cf_add_2lib in $cf_add_libs
12325         do
12326                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12327                 then
12328                         cf_add_1lib=
12329                         break
12330                 fi
12331         done
12332         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12333 done
12334 LIBS="$cf_add_libs"
12335
12336                                 echo "$as_me:12336: checking for $cf_test in $cf_libs" >&5
12337 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12338                         fi
12339                         cat >conftest.$ac_ext <<_ACEOF
12340 #line 12340 "configure"
12341 #include "confdefs.h"
12342
12343 #include <X11/Intrinsic.h>
12344 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12345
12346 int
12347 main ()
12348 {
12349
12350 $cf_test((XtAppContext) 0)
12351   ;
12352   return 0;
12353 }
12354 _ACEOF
12355 rm -f conftest.$ac_objext conftest$ac_exeext
12356 if { (eval echo "$as_me:12356: \"$ac_link\"") >&5
12357   (eval $ac_link) 2>&5
12358   ac_status=$?
12359   echo "$as_me:12359: \$? = $ac_status" >&5
12360   (exit $ac_status); } &&
12361          { ac_try='test -s conftest$ac_exeext'
12362   { (eval echo "$as_me:12362: \"$ac_try\"") >&5
12363   (eval $ac_try) 2>&5
12364   ac_status=$?
12365   echo "$as_me:12365: \$? = $ac_status" >&5
12366   (exit $ac_status); }; }; then
12367   cf_result=yes
12368 else
12369   echo "$as_me: failed program was:" >&5
12370 cat conftest.$ac_ext >&5
12371 cf_result=no
12372 fi
12373 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12374                         echo "$as_me:12374: result: $cf_result" >&5
12375 echo "${ECHO_T}$cf_result" >&6
12376                         if test "$cf_result" = yes ; then
12377                                 cf_x_athena_lib="$cf_libs"
12378                                 break
12379                         fi
12380                         LIBS="$cf_save"
12381                 fi
12382         done # cf_libs
12383                 test -n "$cf_x_athena_lib" && break
12384         done # cf_lib
12385 done
12386
12387 if test -z "$cf_x_athena_lib" ; then
12388         { { echo "$as_me:12388: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12389 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12390    { (exit 1); exit 1; }; }
12391 fi
12392
12393 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12394
12395 cat >>confdefs.h <<EOF
12396 #define $cf_x_athena_LIBS 1
12397 EOF
12398
12399 fi
12400
12401 if test -n "$ac_tool_prefix"; then
12402   for ac_prog in xcurses-config
12403   do
12404     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12405 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12406 echo "$as_me:12406: checking for $ac_word" >&5
12407 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12408 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12409   echo $ECHO_N "(cached) $ECHO_C" >&6
12410 else
12411   if test -n "$XCURSES_CONFIG"; then
12412   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12413 else
12414   ac_save_IFS=$IFS; IFS=$ac_path_separator
12415 ac_dummy="$PATH"
12416 for ac_dir in $ac_dummy; do
12417   IFS=$ac_save_IFS
12418   test -z "$ac_dir" && ac_dir=.
12419   $as_executable_p "$ac_dir/$ac_word" || continue
12420 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12421 echo "$as_me:12421: found $ac_dir/$ac_word" >&5
12422 break
12423 done
12424
12425 fi
12426 fi
12427 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12428 if test -n "$XCURSES_CONFIG"; then
12429   echo "$as_me:12429: result: $XCURSES_CONFIG" >&5
12430 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12431 else
12432   echo "$as_me:12432: result: no" >&5
12433 echo "${ECHO_T}no" >&6
12434 fi
12435
12436     test -n "$XCURSES_CONFIG" && break
12437   done
12438 fi
12439 if test -z "$XCURSES_CONFIG"; then
12440   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12441   for ac_prog in xcurses-config
12442 do
12443   # Extract the first word of "$ac_prog", so it can be a program name with args.
12444 set dummy $ac_prog; ac_word=$2
12445 echo "$as_me:12445: checking for $ac_word" >&5
12446 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12447 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12448   echo $ECHO_N "(cached) $ECHO_C" >&6
12449 else
12450   if test -n "$ac_ct_XCURSES_CONFIG"; then
12451   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12452 else
12453   ac_save_IFS=$IFS; IFS=$ac_path_separator
12454 ac_dummy="$PATH"
12455 for ac_dir in $ac_dummy; do
12456   IFS=$ac_save_IFS
12457   test -z "$ac_dir" && ac_dir=.
12458   $as_executable_p "$ac_dir/$ac_word" || continue
12459 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12460 echo "$as_me:12460: found $ac_dir/$ac_word" >&5
12461 break
12462 done
12463
12464 fi
12465 fi
12466 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12467 if test -n "$ac_ct_XCURSES_CONFIG"; then
12468   echo "$as_me:12468: result: $ac_ct_XCURSES_CONFIG" >&5
12469 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12470 else
12471   echo "$as_me:12471: result: no" >&5
12472 echo "${ECHO_T}no" >&6
12473 fi
12474
12475   test -n "$ac_ct_XCURSES_CONFIG" && break
12476 done
12477 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12478
12479   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12480 fi
12481
12482 if test "$XCURSES_CONFIG" != none ; then
12483
12484 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12485
12486 cf_add_libs="`$XCURSES_CONFIG --libs`"
12487 # Filter out duplicates - this happens with badly-designed ".pc" files...
12488 for cf_add_1lib in $LIBS
12489 do
12490         for cf_add_2lib in $cf_add_libs
12491         do
12492                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12493                 then
12494                         cf_add_1lib=
12495                         break
12496                 fi
12497         done
12498         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12499 done
12500 LIBS="$cf_add_libs"
12501
12502 cf_cv_lib_XCurses=yes
12503
12504 else
12505
12506 LDFLAGS="$LDFLAGS $X_LIBS"
12507
12508 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12509
12510 echo "${as_me:-configure}:12510: testing checking additions to CFLAGS ..." 1>&5
12511
12512 cf_check_cflags="$CFLAGS"
12513 cf_check_cppflags="$CPPFLAGS"
12514
12515 cf_fix_cppflags=no
12516 cf_new_cflags=
12517 cf_new_cppflags=
12518 cf_new_extra_cppflags=
12519
12520 for cf_add_cflags in $X_CFLAGS
12521 do
12522 case $cf_fix_cppflags in
12523 no)
12524         case $cf_add_cflags in #(vi
12525         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12526                 case $cf_add_cflags in
12527                 -D*)
12528                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12529
12530                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12531                                 && test -z "${cf_tst_cflags}" \
12532                                 && cf_fix_cppflags=yes
12533
12534                         if test $cf_fix_cppflags = yes ; then
12535                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12536                                 continue
12537                         elif test "${cf_tst_cflags}" = "\"'" ; then
12538                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12539                                 continue
12540                         fi
12541                         ;;
12542                 esac
12543                 case "$CPPFLAGS" in
12544                 *$cf_add_cflags) #(vi
12545                         ;;
12546                 *) #(vi
12547                         case $cf_add_cflags in #(vi
12548                         -D*)
12549                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12550
12551 CPPFLAGS=`echo "$CPPFLAGS" | \
12552         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12553                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12554
12555                                 ;;
12556                         esac
12557                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12558                         ;;
12559                 esac
12560                 ;;
12561         *)
12562                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12563                 ;;
12564         esac
12565         ;;
12566 yes)
12567         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12568
12569         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12570
12571         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12572                 && test -z "${cf_tst_cflags}" \
12573                 && cf_fix_cppflags=no
12574         ;;
12575 esac
12576 done
12577
12578 if test -n "$cf_new_cflags" ; then
12579         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12580
12581 echo "${as_me:-configure}:12581: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12582
12583         CFLAGS="$CFLAGS $cf_new_cflags"
12584 fi
12585
12586 if test -n "$cf_new_cppflags" ; then
12587         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12588
12589 echo "${as_me:-configure}:12589: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12590
12591         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12592 fi
12593
12594 if test -n "$cf_new_extra_cppflags" ; then
12595         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12596
12597 echo "${as_me:-configure}:12597: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12598
12599         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12600 fi
12601
12602 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12603 cat >conftest.$ac_ext <<_ACEOF
12604 #line 12604 "configure"
12605 #include "confdefs.h"
12606 #include <stdio.h>
12607 int
12608 main ()
12609 {
12610 printf("Hello world");
12611   ;
12612   return 0;
12613 }
12614 _ACEOF
12615 rm -f conftest.$ac_objext conftest$ac_exeext
12616 if { (eval echo "$as_me:12616: \"$ac_link\"") >&5
12617   (eval $ac_link) 2>&5
12618   ac_status=$?
12619   echo "$as_me:12619: \$? = $ac_status" >&5
12620   (exit $ac_status); } &&
12621          { ac_try='test -s conftest$ac_exeext'
12622   { (eval echo "$as_me:12622: \"$ac_try\"") >&5
12623   (eval $ac_try) 2>&5
12624   ac_status=$?
12625   echo "$as_me:12625: \$? = $ac_status" >&5
12626   (exit $ac_status); }; }; then
12627   :
12628 else
12629   echo "$as_me: failed program was:" >&5
12630 cat conftest.$ac_ext >&5
12631 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12632
12633 echo "${as_me:-configure}:12633: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12634
12635          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12636                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12637
12638 echo "${as_me:-configure}:12638: testing but keeping change to \$CPPFLAGS ..." 1>&5
12639
12640          fi
12641          CFLAGS="$cf_check_flags"
12642 fi
12643 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12644 fi
12645
12646 echo "$as_me:12646: checking for XOpenDisplay in -lX11" >&5
12647 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12648 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12649   echo $ECHO_N "(cached) $ECHO_C" >&6
12650 else
12651   ac_check_lib_save_LIBS=$LIBS
12652 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12653 cat >conftest.$ac_ext <<_ACEOF
12654 #line 12654 "configure"
12655 #include "confdefs.h"
12656
12657 /* Override any gcc2 internal prototype to avoid an error.  */
12658 #ifdef __cplusplus
12659 extern "C"
12660 #endif
12661 /* We use char because int might match the return type of a gcc2
12662    builtin and then its argument prototype would still apply.  */
12663 char XOpenDisplay ();
12664 int
12665 main ()
12666 {
12667 XOpenDisplay ();
12668   ;
12669   return 0;
12670 }
12671 _ACEOF
12672 rm -f conftest.$ac_objext conftest$ac_exeext
12673 if { (eval echo "$as_me:12673: \"$ac_link\"") >&5
12674   (eval $ac_link) 2>&5
12675   ac_status=$?
12676   echo "$as_me:12676: \$? = $ac_status" >&5
12677   (exit $ac_status); } &&
12678          { ac_try='test -s conftest$ac_exeext'
12679   { (eval echo "$as_me:12679: \"$ac_try\"") >&5
12680   (eval $ac_try) 2>&5
12681   ac_status=$?
12682   echo "$as_me:12682: \$? = $ac_status" >&5
12683   (exit $ac_status); }; }; then
12684   ac_cv_lib_X11_XOpenDisplay=yes
12685 else
12686   echo "$as_me: failed program was:" >&5
12687 cat conftest.$ac_ext >&5
12688 ac_cv_lib_X11_XOpenDisplay=no
12689 fi
12690 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12691 LIBS=$ac_check_lib_save_LIBS
12692 fi
12693 echo "$as_me:12693: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12694 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12695 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12696
12697 cf_add_libs="-lX11"
12698 # Filter out duplicates - this happens with badly-designed ".pc" files...
12699 for cf_add_1lib in $LIBS
12700 do
12701         for cf_add_2lib in $cf_add_libs
12702         do
12703                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12704                 then
12705                         cf_add_1lib=
12706                         break
12707                 fi
12708         done
12709         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12710 done
12711 LIBS="$cf_add_libs"
12712
12713 fi
12714
12715 echo "$as_me:12715: checking for XCurses library" >&5
12716 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
12717 if test "${cf_cv_lib_XCurses+set}" = set; then
12718   echo $ECHO_N "(cached) $ECHO_C" >&6
12719 else
12720
12721 cf_add_libs="-lXCurses"
12722 # Filter out duplicates - this happens with badly-designed ".pc" files...
12723 for cf_add_1lib in $LIBS
12724 do
12725         for cf_add_2lib in $cf_add_libs
12726         do
12727                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12728                 then
12729                         cf_add_1lib=
12730                         break
12731                 fi
12732         done
12733         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12734 done
12735 LIBS="$cf_add_libs"
12736
12737 cat >conftest.$ac_ext <<_ACEOF
12738 #line 12738 "configure"
12739 #include "confdefs.h"
12740
12741 #include <xcurses.h>
12742 char *XCursesProgramName = "test";
12743
12744 int
12745 main ()
12746 {
12747 XCursesExit();
12748   ;
12749   return 0;
12750 }
12751 _ACEOF
12752 rm -f conftest.$ac_objext conftest$ac_exeext
12753 if { (eval echo "$as_me:12753: \"$ac_link\"") >&5
12754   (eval $ac_link) 2>&5
12755   ac_status=$?
12756   echo "$as_me:12756: \$? = $ac_status" >&5
12757   (exit $ac_status); } &&
12758          { ac_try='test -s conftest$ac_exeext'
12759   { (eval echo "$as_me:12759: \"$ac_try\"") >&5
12760   (eval $ac_try) 2>&5
12761   ac_status=$?
12762   echo "$as_me:12762: \$? = $ac_status" >&5
12763   (exit $ac_status); }; }; then
12764   cf_cv_lib_XCurses=yes
12765 else
12766   echo "$as_me: failed program was:" >&5
12767 cat conftest.$ac_ext >&5
12768 cf_cv_lib_XCurses=no
12769 fi
12770 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12771
12772 fi
12773 echo "$as_me:12773: result: $cf_cv_lib_XCurses" >&5
12774 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
12775
12776 fi
12777
12778 if test $cf_cv_lib_XCurses = yes ; then
12779
12780 cat >>confdefs.h <<\EOF
12781 #define UNIX 1
12782 EOF
12783
12784 cat >>confdefs.h <<\EOF
12785 #define XCURSES 1
12786 EOF
12787
12788         echo "$as_me:12788: checking for xcurses.h" >&5
12789 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
12790 if test "${ac_cv_header_xcurses_h+set}" = set; then
12791   echo $ECHO_N "(cached) $ECHO_C" >&6
12792 else
12793   cat >conftest.$ac_ext <<_ACEOF
12794 #line 12794 "configure"
12795 #include "confdefs.h"
12796 #include <xcurses.h>
12797 _ACEOF
12798 if { (eval echo "$as_me:12798: \"$ac_cpp conftest.$ac_ext\"") >&5
12799   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12800   ac_status=$?
12801   egrep -v '^ *\+' conftest.er1 >conftest.err
12802   rm -f conftest.er1
12803   cat conftest.err >&5
12804   echo "$as_me:12804: \$? = $ac_status" >&5
12805   (exit $ac_status); } >/dev/null; then
12806   if test -s conftest.err; then
12807     ac_cpp_err=$ac_c_preproc_warn_flag
12808   else
12809     ac_cpp_err=
12810   fi
12811 else
12812   ac_cpp_err=yes
12813 fi
12814 if test -z "$ac_cpp_err"; then
12815   ac_cv_header_xcurses_h=yes
12816 else
12817   echo "$as_me: failed program was:" >&5
12818   cat conftest.$ac_ext >&5
12819   ac_cv_header_xcurses_h=no
12820 fi
12821 rm -f conftest.err conftest.$ac_ext
12822 fi
12823 echo "$as_me:12823: result: $ac_cv_header_xcurses_h" >&5
12824 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
12825 if test $ac_cv_header_xcurses_h = yes; then
12826
12827 cat >>confdefs.h <<\EOF
12828 #define HAVE_XCURSES 1
12829 EOF
12830
12831 fi
12832
12833 else
12834         { { echo "$as_me:12834: error: Cannot link with XCurses" >&5
12835 echo "$as_me: error: Cannot link with XCurses" >&2;}
12836    { (exit 1); exit 1; }; }
12837 fi
12838
12839         ;;
12840 esac
12841
12842 case $cf_cv_screen in
12843 curses|curses_*)
12844
12845 echo "$as_me:12845: checking for NetBSD form.h" >&5
12846 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
12847 if test "${cf_cv_netbsd_form_h+set}" = set; then
12848   echo $ECHO_N "(cached) $ECHO_C" >&6
12849 else
12850
12851 cat >conftest.$ac_ext <<_ACEOF
12852 #line 12852 "configure"
12853 #include "confdefs.h"
12854
12855 #include <${cf_cv_ncurses_header:-curses.h}>
12856 #include <form.h>
12857
12858 int
12859 main ()
12860 {
12861
12862         FORM *form;
12863         int y = current_field(form)->cursor_ypos;
12864         int x = current_field(form)->cursor_xpos;
12865
12866   ;
12867   return 0;
12868 }
12869 _ACEOF
12870 rm -f conftest.$ac_objext
12871 if { (eval echo "$as_me:12871: \"$ac_compile\"") >&5
12872   (eval $ac_compile) 2>&5
12873   ac_status=$?
12874   echo "$as_me:12874: \$? = $ac_status" >&5
12875   (exit $ac_status); } &&
12876          { ac_try='test -s conftest.$ac_objext'
12877   { (eval echo "$as_me:12877: \"$ac_try\"") >&5
12878   (eval $ac_try) 2>&5
12879   ac_status=$?
12880   echo "$as_me:12880: \$? = $ac_status" >&5
12881   (exit $ac_status); }; }; then
12882   cf_cv_netbsd_form_h=yes
12883
12884 else
12885   echo "$as_me: failed program was:" >&5
12886 cat conftest.$ac_ext >&5
12887 cf_cv_netbsd_form_h=no
12888 fi
12889 rm -f conftest.$ac_objext conftest.$ac_ext
12890
12891 fi
12892 echo "$as_me:12892: result: $cf_cv_netbsd_form_h" >&5
12893 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
12894
12895 test "$cf_cv_netbsd_form_h" = yes &&
12896 cat >>confdefs.h <<\EOF
12897 #define HAVE_NETBSD_FORM_H 1
12898 EOF
12899
12900 echo "$as_me:12900: checking for NetBSD menu.h" >&5
12901 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
12902 if test "${cf_cv_netbsd_menu_h+set}" = set; then
12903   echo $ECHO_N "(cached) $ECHO_C" >&6
12904 else
12905
12906 cat >conftest.$ac_ext <<_ACEOF
12907 #line 12907 "configure"
12908 #include "confdefs.h"
12909
12910 #include <${cf_cv_ncurses_header:-curses.h}>
12911 #include <menu.h>
12912
12913 int
12914 main ()
12915 {
12916
12917         MENU *menu;
12918         int y = menu->max_item_width;
12919
12920   ;
12921   return 0;
12922 }
12923 _ACEOF
12924 rm -f conftest.$ac_objext
12925 if { (eval echo "$as_me:12925: \"$ac_compile\"") >&5
12926   (eval $ac_compile) 2>&5
12927   ac_status=$?
12928   echo "$as_me:12928: \$? = $ac_status" >&5
12929   (exit $ac_status); } &&
12930          { ac_try='test -s conftest.$ac_objext'
12931   { (eval echo "$as_me:12931: \"$ac_try\"") >&5
12932   (eval $ac_try) 2>&5
12933   ac_status=$?
12934   echo "$as_me:12934: \$? = $ac_status" >&5
12935   (exit $ac_status); }; }; then
12936   cf_cv_netbsd_menu_h=yes
12937
12938 else
12939   echo "$as_me: failed program was:" >&5
12940 cat conftest.$ac_ext >&5
12941 cf_cv_netbsd_menu_h=no
12942 fi
12943 rm -f conftest.$ac_objext conftest.$ac_ext
12944
12945 fi
12946 echo "$as_me:12946: result: $cf_cv_netbsd_menu_h" >&5
12947 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
12948
12949 test "$cf_cv_netbsd_menu_h" = yes &&
12950 cat >>confdefs.h <<\EOF
12951 #define HAVE_NETBSD_MENU_H 1
12952 EOF
12953
12954         ;;
12955 ncursesw)
12956         cf_cv_libtype=w
12957         ;;
12958 esac
12959
12960 case $cf_cv_screen in #(vi
12961 pdcurses) #(vi
12962         ;;
12963 *)
12964         # look for curses-related libraries
12965         : ${cf_panel_lib:=panel}
12966         : ${cf_menu_lib:=menu}
12967         : ${cf_form_lib:=form}
12968
12969 as_ac_Lib=`echo "ac_cv_lib_$cf_panel_lib$cf_cv_libtype''_new_panel" | $as_tr_sh`
12970 echo "$as_me:12970: checking for new_panel in -l$cf_panel_lib$cf_cv_libtype" >&5
12971 echo $ECHO_N "checking for new_panel in -l$cf_panel_lib$cf_cv_libtype... $ECHO_C" >&6
12972 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12973   echo $ECHO_N "(cached) $ECHO_C" >&6
12974 else
12975   ac_check_lib_save_LIBS=$LIBS
12976 LIBS="-l$cf_panel_lib$cf_cv_libtype  $LIBS"
12977 cat >conftest.$ac_ext <<_ACEOF
12978 #line 12978 "configure"
12979 #include "confdefs.h"
12980
12981 /* Override any gcc2 internal prototype to avoid an error.  */
12982 #ifdef __cplusplus
12983 extern "C"
12984 #endif
12985 /* We use char because int might match the return type of a gcc2
12986    builtin and then its argument prototype would still apply.  */
12987 char new_panel ();
12988 int
12989 main ()
12990 {
12991 new_panel ();
12992   ;
12993   return 0;
12994 }
12995 _ACEOF
12996 rm -f conftest.$ac_objext conftest$ac_exeext
12997 if { (eval echo "$as_me:12997: \"$ac_link\"") >&5
12998   (eval $ac_link) 2>&5
12999   ac_status=$?
13000   echo "$as_me:13000: \$? = $ac_status" >&5
13001   (exit $ac_status); } &&
13002          { ac_try='test -s conftest$ac_exeext'
13003   { (eval echo "$as_me:13003: \"$ac_try\"") >&5
13004   (eval $ac_try) 2>&5
13005   ac_status=$?
13006   echo "$as_me:13006: \$? = $ac_status" >&5
13007   (exit $ac_status); }; }; then
13008   eval "$as_ac_Lib=yes"
13009 else
13010   echo "$as_me: failed program was:" >&5
13011 cat conftest.$ac_ext >&5
13012 eval "$as_ac_Lib=no"
13013 fi
13014 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13015 LIBS=$ac_check_lib_save_LIBS
13016 fi
13017 echo "$as_me:13017: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13018 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13019 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13020   cat >>confdefs.h <<EOF
13021 #define `echo "HAVE_LIB$cf_panel_lib$cf_cv_libtype" | $as_tr_cpp` 1
13022 EOF
13023
13024   LIBS="-l$cf_panel_lib$cf_cv_libtype $LIBS"
13025
13026 fi
13027
13028 as_ac_Lib=`echo "ac_cv_lib_$cf_menu_lib$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13029 echo "$as_me:13029: checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype" >&5
13030 echo $ECHO_N "checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype... $ECHO_C" >&6
13031 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13032   echo $ECHO_N "(cached) $ECHO_C" >&6
13033 else
13034   ac_check_lib_save_LIBS=$LIBS
13035 LIBS="-l$cf_menu_lib$cf_cv_libtype  $LIBS"
13036 cat >conftest.$ac_ext <<_ACEOF
13037 #line 13037 "configure"
13038 #include "confdefs.h"
13039
13040 /* Override any gcc2 internal prototype to avoid an error.  */
13041 #ifdef __cplusplus
13042 extern "C"
13043 #endif
13044 /* We use char because int might match the return type of a gcc2
13045    builtin and then its argument prototype would still apply.  */
13046 char menu_driver ();
13047 int
13048 main ()
13049 {
13050 menu_driver ();
13051   ;
13052   return 0;
13053 }
13054 _ACEOF
13055 rm -f conftest.$ac_objext conftest$ac_exeext
13056 if { (eval echo "$as_me:13056: \"$ac_link\"") >&5
13057   (eval $ac_link) 2>&5
13058   ac_status=$?
13059   echo "$as_me:13059: \$? = $ac_status" >&5
13060   (exit $ac_status); } &&
13061          { ac_try='test -s conftest$ac_exeext'
13062   { (eval echo "$as_me:13062: \"$ac_try\"") >&5
13063   (eval $ac_try) 2>&5
13064   ac_status=$?
13065   echo "$as_me:13065: \$? = $ac_status" >&5
13066   (exit $ac_status); }; }; then
13067   eval "$as_ac_Lib=yes"
13068 else
13069   echo "$as_me: failed program was:" >&5
13070 cat conftest.$ac_ext >&5
13071 eval "$as_ac_Lib=no"
13072 fi
13073 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13074 LIBS=$ac_check_lib_save_LIBS
13075 fi
13076 echo "$as_me:13076: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13077 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13078 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13079   cat >>confdefs.h <<EOF
13080 #define `echo "HAVE_LIB$cf_menu_lib$cf_cv_libtype" | $as_tr_cpp` 1
13081 EOF
13082
13083   LIBS="-l$cf_menu_lib$cf_cv_libtype $LIBS"
13084
13085 fi
13086
13087 as_ac_Lib=`echo "ac_cv_lib_$cf_form_lib$cf_cv_libtype''_form_driver" | $as_tr_sh`
13088 echo "$as_me:13088: checking for form_driver in -l$cf_form_lib$cf_cv_libtype" >&5
13089 echo $ECHO_N "checking for form_driver in -l$cf_form_lib$cf_cv_libtype... $ECHO_C" >&6
13090 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13091   echo $ECHO_N "(cached) $ECHO_C" >&6
13092 else
13093   ac_check_lib_save_LIBS=$LIBS
13094 LIBS="-l$cf_form_lib$cf_cv_libtype  $LIBS"
13095 cat >conftest.$ac_ext <<_ACEOF
13096 #line 13096 "configure"
13097 #include "confdefs.h"
13098
13099 /* Override any gcc2 internal prototype to avoid an error.  */
13100 #ifdef __cplusplus
13101 extern "C"
13102 #endif
13103 /* We use char because int might match the return type of a gcc2
13104    builtin and then its argument prototype would still apply.  */
13105 char form_driver ();
13106 int
13107 main ()
13108 {
13109 form_driver ();
13110   ;
13111   return 0;
13112 }
13113 _ACEOF
13114 rm -f conftest.$ac_objext conftest$ac_exeext
13115 if { (eval echo "$as_me:13115: \"$ac_link\"") >&5
13116   (eval $ac_link) 2>&5
13117   ac_status=$?
13118   echo "$as_me:13118: \$? = $ac_status" >&5
13119   (exit $ac_status); } &&
13120          { ac_try='test -s conftest$ac_exeext'
13121   { (eval echo "$as_me:13121: \"$ac_try\"") >&5
13122   (eval $ac_try) 2>&5
13123   ac_status=$?
13124   echo "$as_me:13124: \$? = $ac_status" >&5
13125   (exit $ac_status); }; }; then
13126   eval "$as_ac_Lib=yes"
13127 else
13128   echo "$as_me: failed program was:" >&5
13129 cat conftest.$ac_ext >&5
13130 eval "$as_ac_Lib=no"
13131 fi
13132 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13133 LIBS=$ac_check_lib_save_LIBS
13134 fi
13135 echo "$as_me:13135: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13136 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13137 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13138   cat >>confdefs.h <<EOF
13139 #define `echo "HAVE_LIB$cf_form_lib$cf_cv_libtype" | $as_tr_cpp` 1
13140 EOF
13141
13142   LIBS="-l$cf_form_lib$cf_cv_libtype $LIBS"
13143
13144 fi
13145
13146         # look for curses-related headers
13147
13148 for ac_header in \
13149                 nc_alloc.h \
13150                 nomacros.h \
13151                 form.h \
13152                 menu.h \
13153                 panel.h \
13154                 term_entry.h \
13155
13156 do
13157 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13158 echo "$as_me:13158: checking for $ac_header" >&5
13159 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13160 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13161   echo $ECHO_N "(cached) $ECHO_C" >&6
13162 else
13163   cat >conftest.$ac_ext <<_ACEOF
13164 #line 13164 "configure"
13165 #include "confdefs.h"
13166 #include <$ac_header>
13167 _ACEOF
13168 if { (eval echo "$as_me:13168: \"$ac_cpp conftest.$ac_ext\"") >&5
13169   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13170   ac_status=$?
13171   egrep -v '^ *\+' conftest.er1 >conftest.err
13172   rm -f conftest.er1
13173   cat conftest.err >&5
13174   echo "$as_me:13174: \$? = $ac_status" >&5
13175   (exit $ac_status); } >/dev/null; then
13176   if test -s conftest.err; then
13177     ac_cpp_err=$ac_c_preproc_warn_flag
13178   else
13179     ac_cpp_err=
13180   fi
13181 else
13182   ac_cpp_err=yes
13183 fi
13184 if test -z "$ac_cpp_err"; then
13185   eval "$as_ac_Header=yes"
13186 else
13187   echo "$as_me: failed program was:" >&5
13188   cat conftest.$ac_ext >&5
13189   eval "$as_ac_Header=no"
13190 fi
13191 rm -f conftest.err conftest.$ac_ext
13192 fi
13193 echo "$as_me:13193: result: `eval echo '${'$as_ac_Header'}'`" >&5
13194 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13195 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13196   cat >>confdefs.h <<EOF
13197 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13198 EOF
13199
13200 fi
13201 done
13202
13203         ;;
13204 esac
13205
13206 echo "$as_me:13206: checking for ANSI C header files" >&5
13207 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13208 if test "${ac_cv_header_stdc+set}" = set; then
13209   echo $ECHO_N "(cached) $ECHO_C" >&6
13210 else
13211   cat >conftest.$ac_ext <<_ACEOF
13212 #line 13212 "configure"
13213 #include "confdefs.h"
13214 #include <stdlib.h>
13215 #include <stdarg.h>
13216 #include <string.h>
13217 #include <float.h>
13218
13219 _ACEOF
13220 if { (eval echo "$as_me:13220: \"$ac_cpp conftest.$ac_ext\"") >&5
13221   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13222   ac_status=$?
13223   egrep -v '^ *\+' conftest.er1 >conftest.err
13224   rm -f conftest.er1
13225   cat conftest.err >&5
13226   echo "$as_me:13226: \$? = $ac_status" >&5
13227   (exit $ac_status); } >/dev/null; then
13228   if test -s conftest.err; then
13229     ac_cpp_err=$ac_c_preproc_warn_flag
13230   else
13231     ac_cpp_err=
13232   fi
13233 else
13234   ac_cpp_err=yes
13235 fi
13236 if test -z "$ac_cpp_err"; then
13237   ac_cv_header_stdc=yes
13238 else
13239   echo "$as_me: failed program was:" >&5
13240   cat conftest.$ac_ext >&5
13241   ac_cv_header_stdc=no
13242 fi
13243 rm -f conftest.err conftest.$ac_ext
13244
13245 if test $ac_cv_header_stdc = yes; then
13246   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13247   cat >conftest.$ac_ext <<_ACEOF
13248 #line 13248 "configure"
13249 #include "confdefs.h"
13250 #include <string.h>
13251
13252 _ACEOF
13253 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13254   egrep "memchr" >/dev/null 2>&1; then
13255   :
13256 else
13257   ac_cv_header_stdc=no
13258 fi
13259 rm -rf conftest*
13260
13261 fi
13262
13263 if test $ac_cv_header_stdc = yes; then
13264   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13265   cat >conftest.$ac_ext <<_ACEOF
13266 #line 13266 "configure"
13267 #include "confdefs.h"
13268 #include <stdlib.h>
13269
13270 _ACEOF
13271 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13272   egrep "free" >/dev/null 2>&1; then
13273   :
13274 else
13275   ac_cv_header_stdc=no
13276 fi
13277 rm -rf conftest*
13278
13279 fi
13280
13281 if test $ac_cv_header_stdc = yes; then
13282   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13283   if test "$cross_compiling" = yes; then
13284   :
13285 else
13286   cat >conftest.$ac_ext <<_ACEOF
13287 #line 13287 "configure"
13288 #include "confdefs.h"
13289 #include <ctype.h>
13290 #if ((' ' & 0x0FF) == 0x020)
13291 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13292 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13293 #else
13294 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13295                      || ('j' <= (c) && (c) <= 'r') \
13296                      || ('s' <= (c) && (c) <= 'z'))
13297 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13298 #endif
13299
13300 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13301 int
13302 main ()
13303 {
13304   int i;
13305   for (i = 0; i < 256; i++)
13306     if (XOR (islower (i), ISLOWER (i))
13307         || toupper (i) != TOUPPER (i))
13308       $ac_main_return(2);
13309   $ac_main_return (0);
13310 }
13311 _ACEOF
13312 rm -f conftest$ac_exeext
13313 if { (eval echo "$as_me:13313: \"$ac_link\"") >&5
13314   (eval $ac_link) 2>&5
13315   ac_status=$?
13316   echo "$as_me:13316: \$? = $ac_status" >&5
13317   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13318   { (eval echo "$as_me:13318: \"$ac_try\"") >&5
13319   (eval $ac_try) 2>&5
13320   ac_status=$?
13321   echo "$as_me:13321: \$? = $ac_status" >&5
13322   (exit $ac_status); }; }; then
13323   :
13324 else
13325   echo "$as_me: program exited with status $ac_status" >&5
13326 echo "$as_me: failed program was:" >&5
13327 cat conftest.$ac_ext >&5
13328 ac_cv_header_stdc=no
13329 fi
13330 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13331 fi
13332 fi
13333 fi
13334 echo "$as_me:13334: result: $ac_cv_header_stdc" >&5
13335 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13336 if test $ac_cv_header_stdc = yes; then
13337
13338 cat >>confdefs.h <<\EOF
13339 #define STDC_HEADERS 1
13340 EOF
13341
13342 fi
13343
13344 echo "$as_me:13344: checking whether time.h and sys/time.h may both be included" >&5
13345 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13346 if test "${ac_cv_header_time+set}" = set; then
13347   echo $ECHO_N "(cached) $ECHO_C" >&6
13348 else
13349   cat >conftest.$ac_ext <<_ACEOF
13350 #line 13350 "configure"
13351 #include "confdefs.h"
13352 #include <sys/types.h>
13353 #include <sys/time.h>
13354 #include <time.h>
13355
13356 int
13357 main ()
13358 {
13359 if ((struct tm *) 0)
13360 return 0;
13361   ;
13362   return 0;
13363 }
13364 _ACEOF
13365 rm -f conftest.$ac_objext
13366 if { (eval echo "$as_me:13366: \"$ac_compile\"") >&5
13367   (eval $ac_compile) 2>&5
13368   ac_status=$?
13369   echo "$as_me:13369: \$? = $ac_status" >&5
13370   (exit $ac_status); } &&
13371          { ac_try='test -s conftest.$ac_objext'
13372   { (eval echo "$as_me:13372: \"$ac_try\"") >&5
13373   (eval $ac_try) 2>&5
13374   ac_status=$?
13375   echo "$as_me:13375: \$? = $ac_status" >&5
13376   (exit $ac_status); }; }; then
13377   ac_cv_header_time=yes
13378 else
13379   echo "$as_me: failed program was:" >&5
13380 cat conftest.$ac_ext >&5
13381 ac_cv_header_time=no
13382 fi
13383 rm -f conftest.$ac_objext conftest.$ac_ext
13384 fi
13385 echo "$as_me:13385: result: $ac_cv_header_time" >&5
13386 echo "${ECHO_T}$ac_cv_header_time" >&6
13387 if test $ac_cv_header_time = yes; then
13388
13389 cat >>confdefs.h <<\EOF
13390 #define TIME_WITH_SYS_TIME 1
13391 EOF
13392
13393 fi
13394
13395 for ac_header in \
13396 getopt.h \
13397 locale.h \
13398 math.h \
13399 stdarg.h \
13400 sys/ioctl.h \
13401 sys/select.h \
13402 sys/time.h \
13403 termios.h \
13404 unistd.h \
13405
13406 do
13407 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13408 echo "$as_me:13408: checking for $ac_header" >&5
13409 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13410 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13411   echo $ECHO_N "(cached) $ECHO_C" >&6
13412 else
13413   cat >conftest.$ac_ext <<_ACEOF
13414 #line 13414 "configure"
13415 #include "confdefs.h"
13416 #include <$ac_header>
13417 _ACEOF
13418 if { (eval echo "$as_me:13418: \"$ac_cpp conftest.$ac_ext\"") >&5
13419   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13420   ac_status=$?
13421   egrep -v '^ *\+' conftest.er1 >conftest.err
13422   rm -f conftest.er1
13423   cat conftest.err >&5
13424   echo "$as_me:13424: \$? = $ac_status" >&5
13425   (exit $ac_status); } >/dev/null; then
13426   if test -s conftest.err; then
13427     ac_cpp_err=$ac_c_preproc_warn_flag
13428   else
13429     ac_cpp_err=
13430   fi
13431 else
13432   ac_cpp_err=yes
13433 fi
13434 if test -z "$ac_cpp_err"; then
13435   eval "$as_ac_Header=yes"
13436 else
13437   echo "$as_me: failed program was:" >&5
13438   cat conftest.$ac_ext >&5
13439   eval "$as_ac_Header=no"
13440 fi
13441 rm -f conftest.err conftest.$ac_ext
13442 fi
13443 echo "$as_me:13443: result: `eval echo '${'$as_ac_Header'}'`" >&5
13444 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13445 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13446   cat >>confdefs.h <<EOF
13447 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13448 EOF
13449
13450 fi
13451 done
13452
13453 for ac_header in unistd.h getopt.h
13454 do
13455 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13456 echo "$as_me:13456: checking for $ac_header" >&5
13457 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13458 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13459   echo $ECHO_N "(cached) $ECHO_C" >&6
13460 else
13461   cat >conftest.$ac_ext <<_ACEOF
13462 #line 13462 "configure"
13463 #include "confdefs.h"
13464 #include <$ac_header>
13465 _ACEOF
13466 if { (eval echo "$as_me:13466: \"$ac_cpp conftest.$ac_ext\"") >&5
13467   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13468   ac_status=$?
13469   egrep -v '^ *\+' conftest.er1 >conftest.err
13470   rm -f conftest.er1
13471   cat conftest.err >&5
13472   echo "$as_me:13472: \$? = $ac_status" >&5
13473   (exit $ac_status); } >/dev/null; then
13474   if test -s conftest.err; then
13475     ac_cpp_err=$ac_c_preproc_warn_flag
13476   else
13477     ac_cpp_err=
13478   fi
13479 else
13480   ac_cpp_err=yes
13481 fi
13482 if test -z "$ac_cpp_err"; then
13483   eval "$as_ac_Header=yes"
13484 else
13485   echo "$as_me: failed program was:" >&5
13486   cat conftest.$ac_ext >&5
13487   eval "$as_ac_Header=no"
13488 fi
13489 rm -f conftest.err conftest.$ac_ext
13490 fi
13491 echo "$as_me:13491: result: `eval echo '${'$as_ac_Header'}'`" >&5
13492 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13493 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13494   cat >>confdefs.h <<EOF
13495 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13496 EOF
13497
13498 fi
13499 done
13500
13501 echo "$as_me:13501: checking for header declaring getopt variables" >&5
13502 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13503 if test "${cf_cv_getopt_header+set}" = set; then
13504   echo $ECHO_N "(cached) $ECHO_C" >&6
13505 else
13506
13507 cf_cv_getopt_header=none
13508 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13509 do
13510 cat >conftest.$ac_ext <<_ACEOF
13511 #line 13511 "configure"
13512 #include "confdefs.h"
13513
13514 #include <$cf_header>
13515 int
13516 main ()
13517 {
13518 int x = optind; char *y = optarg
13519   ;
13520   return 0;
13521 }
13522 _ACEOF
13523 rm -f conftest.$ac_objext
13524 if { (eval echo "$as_me:13524: \"$ac_compile\"") >&5
13525   (eval $ac_compile) 2>&5
13526   ac_status=$?
13527   echo "$as_me:13527: \$? = $ac_status" >&5
13528   (exit $ac_status); } &&
13529          { ac_try='test -s conftest.$ac_objext'
13530   { (eval echo "$as_me:13530: \"$ac_try\"") >&5
13531   (eval $ac_try) 2>&5
13532   ac_status=$?
13533   echo "$as_me:13533: \$? = $ac_status" >&5
13534   (exit $ac_status); }; }; then
13535   cf_cv_getopt_header=$cf_header
13536  break
13537 else
13538   echo "$as_me: failed program was:" >&5
13539 cat conftest.$ac_ext >&5
13540 fi
13541 rm -f conftest.$ac_objext conftest.$ac_ext
13542 done
13543
13544 fi
13545 echo "$as_me:13545: result: $cf_cv_getopt_header" >&5
13546 echo "${ECHO_T}$cf_cv_getopt_header" >&6
13547 if test $cf_cv_getopt_header != none ; then
13548
13549 cat >>confdefs.h <<\EOF
13550 #define HAVE_GETOPT_HEADER 1
13551 EOF
13552
13553 fi
13554 if test $cf_cv_getopt_header = getopt.h ; then
13555
13556 cat >>confdefs.h <<\EOF
13557 #define NEED_GETOPT_H 1
13558 EOF
13559
13560 fi
13561
13562 for ac_func in \
13563 gettimeofday \
13564
13565 do
13566 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13567 echo "$as_me:13567: checking for $ac_func" >&5
13568 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13569 if eval "test \"\${$as_ac_var+set}\" = set"; then
13570   echo $ECHO_N "(cached) $ECHO_C" >&6
13571 else
13572   cat >conftest.$ac_ext <<_ACEOF
13573 #line 13573 "configure"
13574 #include "confdefs.h"
13575 /* System header to define __stub macros and hopefully few prototypes,
13576     which can conflict with char $ac_func (); below.  */
13577 #include <assert.h>
13578 /* Override any gcc2 internal prototype to avoid an error.  */
13579 #ifdef __cplusplus
13580 extern "C"
13581 #endif
13582 /* We use char because int might match the return type of a gcc2
13583    builtin and then its argument prototype would still apply.  */
13584 char $ac_func ();
13585 char (*f) ();
13586
13587 int
13588 main ()
13589 {
13590 /* The GNU C library defines this for functions which it implements
13591     to always fail with ENOSYS.  Some functions are actually named
13592     something starting with __ and the normal name is an alias.  */
13593 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13594 choke me
13595 #else
13596 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13597 #endif
13598
13599   ;
13600   return 0;
13601 }
13602 _ACEOF
13603 rm -f conftest.$ac_objext conftest$ac_exeext
13604 if { (eval echo "$as_me:13604: \"$ac_link\"") >&5
13605   (eval $ac_link) 2>&5
13606   ac_status=$?
13607   echo "$as_me:13607: \$? = $ac_status" >&5
13608   (exit $ac_status); } &&
13609          { ac_try='test -s conftest$ac_exeext'
13610   { (eval echo "$as_me:13610: \"$ac_try\"") >&5
13611   (eval $ac_try) 2>&5
13612   ac_status=$?
13613   echo "$as_me:13613: \$? = $ac_status" >&5
13614   (exit $ac_status); }; }; then
13615   eval "$as_ac_var=yes"
13616 else
13617   echo "$as_me: failed program was:" >&5
13618 cat conftest.$ac_ext >&5
13619 eval "$as_ac_var=no"
13620 fi
13621 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13622 fi
13623 echo "$as_me:13623: result: `eval echo '${'$as_ac_var'}'`" >&5
13624 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13625 if test `eval echo '${'$as_ac_var'}'` = yes; then
13626   cat >>confdefs.h <<EOF
13627 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13628 EOF
13629
13630 fi
13631 done
13632
13633 if test "$cf_enable_widec" = yes; then
13634
13635 for ac_func in \
13636 mblen \
13637 mbrlen \
13638 mbrtowc \
13639 mbsrtowcs \
13640 mbstowcs \
13641 mbtowc \
13642 wcsrtombs \
13643 wcstombs \
13644
13645 do
13646 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13647 echo "$as_me:13647: checking for $ac_func" >&5
13648 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13649 if eval "test \"\${$as_ac_var+set}\" = set"; then
13650   echo $ECHO_N "(cached) $ECHO_C" >&6
13651 else
13652   cat >conftest.$ac_ext <<_ACEOF
13653 #line 13653 "configure"
13654 #include "confdefs.h"
13655 /* System header to define __stub macros and hopefully few prototypes,
13656     which can conflict with char $ac_func (); below.  */
13657 #include <assert.h>
13658 /* Override any gcc2 internal prototype to avoid an error.  */
13659 #ifdef __cplusplus
13660 extern "C"
13661 #endif
13662 /* We use char because int might match the return type of a gcc2
13663    builtin and then its argument prototype would still apply.  */
13664 char $ac_func ();
13665 char (*f) ();
13666
13667 int
13668 main ()
13669 {
13670 /* The GNU C library defines this for functions which it implements
13671     to always fail with ENOSYS.  Some functions are actually named
13672     something starting with __ and the normal name is an alias.  */
13673 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13674 choke me
13675 #else
13676 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13677 #endif
13678
13679   ;
13680   return 0;
13681 }
13682 _ACEOF
13683 rm -f conftest.$ac_objext conftest$ac_exeext
13684 if { (eval echo "$as_me:13684: \"$ac_link\"") >&5
13685   (eval $ac_link) 2>&5
13686   ac_status=$?
13687   echo "$as_me:13687: \$? = $ac_status" >&5
13688   (exit $ac_status); } &&
13689          { ac_try='test -s conftest$ac_exeext'
13690   { (eval echo "$as_me:13690: \"$ac_try\"") >&5
13691   (eval $ac_try) 2>&5
13692   ac_status=$?
13693   echo "$as_me:13693: \$? = $ac_status" >&5
13694   (exit $ac_status); }; }; then
13695   eval "$as_ac_var=yes"
13696 else
13697   echo "$as_me: failed program was:" >&5
13698 cat conftest.$ac_ext >&5
13699 eval "$as_ac_var=no"
13700 fi
13701 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13702 fi
13703 echo "$as_me:13703: result: `eval echo '${'$as_ac_var'}'`" >&5
13704 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13705 if test `eval echo '${'$as_ac_var'}'` = yes; then
13706   cat >>confdefs.h <<EOF
13707 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13708 EOF
13709
13710 fi
13711 done
13712
13713 fi
13714
13715 echo "$as_me:13715: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
13716 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
13717 if test "${cf_cv_need_xopen_extension+set}" = set; then
13718   echo $ECHO_N "(cached) $ECHO_C" >&6
13719 else
13720
13721 cat >conftest.$ac_ext <<_ACEOF
13722 #line 13722 "configure"
13723 #include "confdefs.h"
13724
13725 #include <stdlib.h>
13726 #include <${cf_cv_ncurses_header:-curses.h}>
13727 int
13728 main ()
13729 {
13730
13731 #if defined(NCURSES_VERSION_PATCH)
13732 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
13733         make an error
13734 #endif
13735 #endif
13736         long x = winnstr(stdscr, "", 0);
13737         int x1, y1;
13738         getbegyx(stdscr, y1, x1)
13739   ;
13740   return 0;
13741 }
13742 _ACEOF
13743 rm -f conftest.$ac_objext conftest$ac_exeext
13744 if { (eval echo "$as_me:13744: \"$ac_link\"") >&5
13745   (eval $ac_link) 2>&5
13746   ac_status=$?
13747   echo "$as_me:13747: \$? = $ac_status" >&5
13748   (exit $ac_status); } &&
13749          { ac_try='test -s conftest$ac_exeext'
13750   { (eval echo "$as_me:13750: \"$ac_try\"") >&5
13751   (eval $ac_try) 2>&5
13752   ac_status=$?
13753   echo "$as_me:13753: \$? = $ac_status" >&5
13754   (exit $ac_status); }; }; then
13755   cf_cv_need_xopen_extension=no
13756 else
13757   echo "$as_me: failed program was:" >&5
13758 cat conftest.$ac_ext >&5
13759 cat >conftest.$ac_ext <<_ACEOF
13760 #line 13760 "configure"
13761 #include "confdefs.h"
13762
13763 #define _XOPEN_SOURCE_EXTENDED
13764 #include <stdlib.h>
13765 #include <${cf_cv_ncurses_header:-curses.h}>
13766 int
13767 main ()
13768 {
13769
13770 #ifdef NCURSES_VERSION
13771         cchar_t check;
13772         int check2 = curs_set((int)sizeof(check));
13773 #endif
13774         long x = winnstr(stdscr, "", 0);
13775         int x1, y1;
13776         getbegyx(stdscr, y1, x1)
13777   ;
13778   return 0;
13779 }
13780 _ACEOF
13781 rm -f conftest.$ac_objext conftest$ac_exeext
13782 if { (eval echo "$as_me:13782: \"$ac_link\"") >&5
13783   (eval $ac_link) 2>&5
13784   ac_status=$?
13785   echo "$as_me:13785: \$? = $ac_status" >&5
13786   (exit $ac_status); } &&
13787          { ac_try='test -s conftest$ac_exeext'
13788   { (eval echo "$as_me:13788: \"$ac_try\"") >&5
13789   (eval $ac_try) 2>&5
13790   ac_status=$?
13791   echo "$as_me:13791: \$? = $ac_status" >&5
13792   (exit $ac_status); }; }; then
13793   cf_cv_need_xopen_extension=yes
13794 else
13795   echo "$as_me: failed program was:" >&5
13796 cat conftest.$ac_ext >&5
13797 cf_cv_need_xopen_extension=unknown
13798 fi
13799 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13800 fi
13801 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13802 fi
13803 echo "$as_me:13803: result: $cf_cv_need_xopen_extension" >&5
13804 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
13805 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
13806
13807 echo "$as_me:13807: checking for term.h" >&5
13808 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
13809 if test "${cf_cv_term_header+set}" = set; then
13810   echo $ECHO_N "(cached) $ECHO_C" >&6
13811 else
13812
13813 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
13814 # for <term.h> if we do not find the variant.
13815
13816 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
13817
13818 case ${cf_cv_ncurses_header:-curses.h} in #(vi
13819 */*)
13820         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
13821         cf_header_list="$cf_header_item $cf_header_list"
13822         ;;
13823 esac
13824
13825 for cf_header in $cf_header_list
13826 do
13827         cat >conftest.$ac_ext <<_ACEOF
13828 #line 13828 "configure"
13829 #include "confdefs.h"
13830
13831 #include <${cf_cv_ncurses_header:-curses.h}>
13832 #include <${cf_header}>
13833 int
13834 main ()
13835 {
13836 WINDOW *x
13837   ;
13838   return 0;
13839 }
13840 _ACEOF
13841 rm -f conftest.$ac_objext
13842 if { (eval echo "$as_me:13842: \"$ac_compile\"") >&5
13843   (eval $ac_compile) 2>&5
13844   ac_status=$?
13845   echo "$as_me:13845: \$? = $ac_status" >&5
13846   (exit $ac_status); } &&
13847          { ac_try='test -s conftest.$ac_objext'
13848   { (eval echo "$as_me:13848: \"$ac_try\"") >&5
13849   (eval $ac_try) 2>&5
13850   ac_status=$?
13851   echo "$as_me:13851: \$? = $ac_status" >&5
13852   (exit $ac_status); }; }; then
13853   cf_cv_term_header=$cf_header
13854          break
13855 else
13856   echo "$as_me: failed program was:" >&5
13857 cat conftest.$ac_ext >&5
13858 cf_cv_term_header=no
13859 fi
13860 rm -f conftest.$ac_objext conftest.$ac_ext
13861 done
13862
13863 case $cf_cv_term_header in #(vi
13864 no)
13865         # If curses is ncurses, some packagers still mess it up by trying to make
13866         # us use GNU termcap.  This handles the most common case.
13867         for cf_header in ncurses/term.h ncursesw/term.h
13868         do
13869                 cat >conftest.$ac_ext <<_ACEOF
13870 #line 13870 "configure"
13871 #include "confdefs.h"
13872
13873 #include <${cf_cv_ncurses_header:-curses.h}>
13874 #ifdef NCURSES_VERSION
13875 #include <${cf_header}>
13876 #else
13877 make an error
13878 #endif
13879 int
13880 main ()
13881 {
13882 WINDOW *x
13883   ;
13884   return 0;
13885 }
13886 _ACEOF
13887 rm -f conftest.$ac_objext
13888 if { (eval echo "$as_me:13888: \"$ac_compile\"") >&5
13889   (eval $ac_compile) 2>&5
13890   ac_status=$?
13891   echo "$as_me:13891: \$? = $ac_status" >&5
13892   (exit $ac_status); } &&
13893          { ac_try='test -s conftest.$ac_objext'
13894   { (eval echo "$as_me:13894: \"$ac_try\"") >&5
13895   (eval $ac_try) 2>&5
13896   ac_status=$?
13897   echo "$as_me:13897: \$? = $ac_status" >&5
13898   (exit $ac_status); }; }; then
13899   cf_cv_term_header=$cf_header
13900                          break
13901 else
13902   echo "$as_me: failed program was:" >&5
13903 cat conftest.$ac_ext >&5
13904 cf_cv_term_header=no
13905 fi
13906 rm -f conftest.$ac_objext conftest.$ac_ext
13907         done
13908         ;;
13909 esac
13910
13911 fi
13912 echo "$as_me:13912: result: $cf_cv_term_header" >&5
13913 echo "${ECHO_T}$cf_cv_term_header" >&6
13914
13915 case $cf_cv_term_header in #(vi
13916 term.h) #(vi
13917
13918 cat >>confdefs.h <<\EOF
13919 #define HAVE_TERM_H 1
13920 EOF
13921
13922         ;;
13923 ncurses/term.h) #(vi
13924
13925 cat >>confdefs.h <<\EOF
13926 #define HAVE_NCURSES_TERM_H 1
13927 EOF
13928
13929         ;;
13930 ncursesw/term.h)
13931
13932 cat >>confdefs.h <<\EOF
13933 #define HAVE_NCURSESW_TERM_H 1
13934 EOF
13935
13936         ;;
13937 esac
13938
13939 echo "$as_me:13939: checking for unctrl.h" >&5
13940 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
13941 if test "${cf_cv_unctrl_header+set}" = set; then
13942   echo $ECHO_N "(cached) $ECHO_C" >&6
13943 else
13944
13945 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
13946 # for <unctrl.h> if we do not find the variant.
13947
13948 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
13949
13950 case ${cf_cv_ncurses_header:-curses.h} in #(vi
13951 */*)
13952         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
13953         cf_header_list="$cf_header_item $cf_header_list"
13954         ;;
13955 esac
13956
13957 for cf_header in $cf_header_list
13958 do
13959         cat >conftest.$ac_ext <<_ACEOF
13960 #line 13960 "configure"
13961 #include "confdefs.h"
13962
13963 #include <${cf_cv_ncurses_header:-curses.h}>
13964 #include <${cf_header}>
13965 int
13966 main ()
13967 {
13968 WINDOW *x
13969   ;
13970   return 0;
13971 }
13972 _ACEOF
13973 rm -f conftest.$ac_objext
13974 if { (eval echo "$as_me:13974: \"$ac_compile\"") >&5
13975   (eval $ac_compile) 2>&5
13976   ac_status=$?
13977   echo "$as_me:13977: \$? = $ac_status" >&5
13978   (exit $ac_status); } &&
13979          { ac_try='test -s conftest.$ac_objext'
13980   { (eval echo "$as_me:13980: \"$ac_try\"") >&5
13981   (eval $ac_try) 2>&5
13982   ac_status=$?
13983   echo "$as_me:13983: \$? = $ac_status" >&5
13984   (exit $ac_status); }; }; then
13985   cf_cv_unctrl_header=$cf_header
13986          break
13987 else
13988   echo "$as_me: failed program was:" >&5
13989 cat conftest.$ac_ext >&5
13990 cf_cv_unctrl_header=no
13991 fi
13992 rm -f conftest.$ac_objext conftest.$ac_ext
13993 done
13994
13995 fi
13996 echo "$as_me:13996: result: $cf_cv_unctrl_header" >&5
13997 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
13998
13999 case $cf_cv_unctrl_header in #(vi
14000 no)
14001         { echo "$as_me:14001: WARNING: unctrl.h header not found" >&5
14002 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14003         ;;
14004 esac
14005
14006 case $cf_cv_unctrl_header in #(vi
14007 unctrl.h) #(vi
14008
14009 cat >>confdefs.h <<\EOF
14010 #define HAVE_UNCTRL_H 1
14011 EOF
14012
14013         ;;
14014 ncurses/unctrl.h) #(vi
14015
14016 cat >>confdefs.h <<\EOF
14017 #define HAVE_NCURSES_UNCTRL_H 1
14018 EOF
14019
14020         ;;
14021 ncursesw/unctrl.h)
14022
14023 cat >>confdefs.h <<\EOF
14024 #define HAVE_NCURSESW_UNCTRL_H 1
14025 EOF
14026
14027         ;;
14028 esac
14029
14030 for cf_func in \
14031 assume_default_colors \
14032 chgat \
14033 color_set \
14034 filter \
14035 getbegx \
14036 getcurx \
14037 getmaxx \
14038 getnstr \
14039 getparx \
14040 getwin \
14041 mvvline \
14042 mvwvline \
14043 napms \
14044 putwin \
14045 resize_term \
14046 resizeterm \
14047 ripoffline \
14048 scr_dump \
14049 setupterm \
14050 slk_color \
14051 slk_init \
14052 termattrs \
14053 tgetent \
14054 tigetnum \
14055 tigetstr \
14056 typeahead \
14057 use_default_colors \
14058 use_env \
14059 use_screen \
14060 use_window \
14061 vid_puts \
14062 vidputs \
14063 vsscanf \
14064 vw_printw \
14065 wchgat \
14066 winsstr \
14067 wresize \
14068 wsyncdown \
14069
14070 do
14071
14072 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14073
14074         echo "$as_me:14074: checking for ${cf_func}" >&5
14075 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14076
14077 echo "${as_me:-configure}:14077: testing ${cf_func} ..." 1>&5
14078
14079         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14080   echo $ECHO_N "(cached) $ECHO_C" >&6
14081 else
14082
14083                 eval cf_result='$ac_cv_func_'$cf_func
14084                 if test ".$cf_result" != ".no"; then
14085                         cat >conftest.$ac_ext <<_ACEOF
14086 #line 14086 "configure"
14087 #include "confdefs.h"
14088
14089 #ifdef HAVE_XCURSES
14090 #include <xcurses.h>
14091 char * XCursesProgramName = "test";
14092 #else
14093 #include <${cf_cv_ncurses_header:-curses.h}>
14094 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14095 #include <ncursesw/term.h>
14096 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14097 #include <ncurses/term.h>
14098 #elif defined(HAVE_TERM_H)
14099 #include <term.h>
14100 #endif
14101 #endif
14102
14103 int
14104 main ()
14105 {
14106
14107 #ifndef ${cf_func}
14108 long foo = (long)(&${cf_func});
14109 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14110 if (foo + 1234 > 5678)
14111         ${cf_cv_main_return:-return}(foo);
14112 #endif
14113
14114   ;
14115   return 0;
14116 }
14117 _ACEOF
14118 rm -f conftest.$ac_objext conftest$ac_exeext
14119 if { (eval echo "$as_me:14119: \"$ac_link\"") >&5
14120   (eval $ac_link) 2>&5
14121   ac_status=$?
14122   echo "$as_me:14122: \$? = $ac_status" >&5
14123   (exit $ac_status); } &&
14124          { ac_try='test -s conftest$ac_exeext'
14125   { (eval echo "$as_me:14125: \"$ac_try\"") >&5
14126   (eval $ac_try) 2>&5
14127   ac_status=$?
14128   echo "$as_me:14128: \$? = $ac_status" >&5
14129   (exit $ac_status); }; }; then
14130   cf_result=yes
14131 else
14132   echo "$as_me: failed program was:" >&5
14133 cat conftest.$ac_ext >&5
14134 cf_result=no
14135 fi
14136 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14137                 fi
14138                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14139
14140 fi
14141
14142         # use the computed/retrieved cache-value:
14143         eval 'cf_result=$cf_cv_func_'$cf_func
14144         echo "$as_me:14144: result: $cf_result" >&5
14145 echo "${ECHO_T}$cf_result" >&6
14146         if test $cf_result != no; then
14147                 cat >>confdefs.h <<EOF
14148 #define HAVE_${cf_tr_func} 1
14149 EOF
14150
14151         fi
14152 done
14153
14154 for cf_func in tputs
14155 do
14156
14157 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14158
14159         echo "$as_me:14159: checking for ${cf_func}" >&5
14160 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14161
14162 echo "${as_me:-configure}:14162: testing ${cf_func} ..." 1>&5
14163
14164         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14165   echo $ECHO_N "(cached) $ECHO_C" >&6
14166 else
14167
14168                 eval cf_result='$ac_cv_func_'$cf_func
14169                 if test ".$cf_result" != ".no"; then
14170                         cat >conftest.$ac_ext <<_ACEOF
14171 #line 14171 "configure"
14172 #include "confdefs.h"
14173
14174 #ifdef HAVE_XCURSES
14175 #include <xcurses.h>
14176 char * XCursesProgramName = "test";
14177 #else
14178 #include <${cf_cv_ncurses_header:-curses.h}>
14179 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14180 #include <ncursesw/term.h>
14181 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14182 #include <ncurses/term.h>
14183 #elif defined(HAVE_TERM_H)
14184 #include <term.h>
14185 #endif
14186 #endif
14187
14188 int
14189 main ()
14190 {
14191
14192 #ifndef ${cf_func}
14193 long foo = (long)(&${cf_func});
14194 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14195 if (foo + 1234 > 5678)
14196         ${cf_cv_main_return:-return}(foo);
14197 #endif
14198
14199   ;
14200   return 0;
14201 }
14202 _ACEOF
14203 rm -f conftest.$ac_objext conftest$ac_exeext
14204 if { (eval echo "$as_me:14204: \"$ac_link\"") >&5
14205   (eval $ac_link) 2>&5
14206   ac_status=$?
14207   echo "$as_me:14207: \$? = $ac_status" >&5
14208   (exit $ac_status); } &&
14209          { ac_try='test -s conftest$ac_exeext'
14210   { (eval echo "$as_me:14210: \"$ac_try\"") >&5
14211   (eval $ac_try) 2>&5
14212   ac_status=$?
14213   echo "$as_me:14213: \$? = $ac_status" >&5
14214   (exit $ac_status); }; }; then
14215   cf_result=yes
14216 else
14217   echo "$as_me: failed program was:" >&5
14218 cat conftest.$ac_ext >&5
14219 cf_result=no
14220 fi
14221 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14222                 fi
14223                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14224
14225 fi
14226
14227         # use the computed/retrieved cache-value:
14228         eval 'cf_result=$cf_cv_func_'$cf_func
14229         echo "$as_me:14229: result: $cf_result" >&5
14230 echo "${ECHO_T}$cf_result" >&6
14231         if test $cf_result != no; then
14232                 cat >>confdefs.h <<EOF
14233 #define HAVE_${cf_tr_func} 1
14234 EOF
14235
14236         fi
14237 done
14238
14239 if test x$cf_cv_func_tputs = xyes
14240 then
14241         cf_done=no
14242         for cf_arg in int char
14243         do
14244                 for cf_ret in int void
14245                 do
14246                         if test $cf_ret = void
14247                         then
14248                                 cf_return="/* nothing */"
14249                         else
14250                                 cf_return="return value"
14251                         fi
14252                         cat >conftest.$ac_ext <<_ACEOF
14253 #line 14253 "configure"
14254 #include "confdefs.h"
14255
14256 #include <${cf_cv_ncurses_header:-curses.h}>
14257 #include <$cf_cv_term_header>
14258
14259 static $cf_ret outc($cf_arg value) { $cf_return; }
14260
14261 int
14262 main ()
14263 {
14264
14265         tputs("hello", 0, outc);
14266         ${cf_cv_main_return:-return}(0);
14267
14268   ;
14269   return 0;
14270 }
14271 _ACEOF
14272 rm -f conftest.$ac_objext
14273 if { (eval echo "$as_me:14273: \"$ac_compile\"") >&5
14274   (eval $ac_compile) 2>&5
14275   ac_status=$?
14276   echo "$as_me:14276: \$? = $ac_status" >&5
14277   (exit $ac_status); } &&
14278          { ac_try='test -s conftest.$ac_objext'
14279   { (eval echo "$as_me:14279: \"$ac_try\"") >&5
14280   (eval $ac_try) 2>&5
14281   ac_status=$?
14282   echo "$as_me:14282: \$? = $ac_status" >&5
14283   (exit $ac_status); }; }; then
14284
14285                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14286
14287 echo "${as_me:-configure}:14287: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14288
14289                 cat >>confdefs.h <<EOF
14290 #define TPUTS_ARG               $cf_arg
14291 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14292 #define TPUTS_RETURN(value)     $cf_return
14293 EOF
14294                 cf_done=yes
14295                 break
14296
14297 else
14298   echo "$as_me: failed program was:" >&5
14299 cat conftest.$ac_ext >&5
14300 fi
14301 rm -f conftest.$ac_objext conftest.$ac_ext
14302                 done
14303                 test $cf_done = yes && break
14304         done
14305 fi
14306
14307 echo "$as_me:14307: checking for ncurses extended functions" >&5
14308 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14309 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14310   echo $ECHO_N "(cached) $ECHO_C" >&6
14311 else
14312
14313 cat >conftest.$ac_ext <<_ACEOF
14314 #line 14314 "configure"
14315 #include "confdefs.h"
14316
14317 #include <${cf_cv_ncurses_header:-curses.h}>
14318 int
14319 main ()
14320 {
14321
14322 int x = NCURSES_EXT_FUNCS
14323
14324   ;
14325   return 0;
14326 }
14327 _ACEOF
14328 rm -f conftest.$ac_objext
14329 if { (eval echo "$as_me:14329: \"$ac_compile\"") >&5
14330   (eval $ac_compile) 2>&5
14331   ac_status=$?
14332   echo "$as_me:14332: \$? = $ac_status" >&5
14333   (exit $ac_status); } &&
14334          { ac_try='test -s conftest.$ac_objext'
14335   { (eval echo "$as_me:14335: \"$ac_try\"") >&5
14336   (eval $ac_try) 2>&5
14337   ac_status=$?
14338   echo "$as_me:14338: \$? = $ac_status" >&5
14339   (exit $ac_status); }; }; then
14340   cf_cv_ncurses_ext_funcs=defined
14341 else
14342   echo "$as_me: failed program was:" >&5
14343 cat conftest.$ac_ext >&5
14344
14345 cat >conftest.$ac_ext <<_ACEOF
14346 #line 14346 "configure"
14347 #include "confdefs.h"
14348
14349 #include <${cf_cv_ncurses_header:-curses.h}>
14350 int
14351 main ()
14352 {
14353
14354         (void) assume_default_colors (0, 0);
14355         (void) curses_version ();
14356         (void) define_key (0, 0);
14357         (void) is_term_resized (0, 0);
14358         (void) key_defined (0);
14359         (void) keybound (0, 0);
14360         (void) keyok (0, 0);
14361         (void) resize_term (0, 0);
14362         (void) resizeterm (0, 0);
14363         (void) use_default_colors ();
14364         (void) use_extended_names (0);
14365         (void) wresize (0, 0, 0);
14366   ;
14367   return 0;
14368 }
14369 _ACEOF
14370 rm -f conftest.$ac_objext conftest$ac_exeext
14371 if { (eval echo "$as_me:14371: \"$ac_link\"") >&5
14372   (eval $ac_link) 2>&5
14373   ac_status=$?
14374   echo "$as_me:14374: \$? = $ac_status" >&5
14375   (exit $ac_status); } &&
14376          { ac_try='test -s conftest$ac_exeext'
14377   { (eval echo "$as_me:14377: \"$ac_try\"") >&5
14378   (eval $ac_try) 2>&5
14379   ac_status=$?
14380   echo "$as_me:14380: \$? = $ac_status" >&5
14381   (exit $ac_status); }; }; then
14382   cf_cv_ncurses_ext_funcs=yes
14383 else
14384   echo "$as_me: failed program was:" >&5
14385 cat conftest.$ac_ext >&5
14386 cf_cv_ncurses_ext_funcs=no
14387 fi
14388 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14389
14390 fi
14391 rm -f conftest.$ac_objext conftest.$ac_ext
14392
14393 fi
14394 echo "$as_me:14394: result: $cf_cv_ncurses_ext_funcs" >&5
14395 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14396 test "$cf_cv_ncurses_ext_funcs" = yes &&
14397 cat >>confdefs.h <<\EOF
14398 #define NCURSES_EXT_FUNCS 1
14399 EOF
14400
14401 if test "$cf_enable_widec" = yes
14402 then
14403         # workaround for systems with ncurses before 20111029, due to change of
14404         # feature test macro from _XPG5 to _XOPEN_SOURCE
14405         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14406         then
14407                 cf_define_xpg5=no
14408                 echo "$as_me:14408: checking if _XPG5 should be defined to enable wide-characters" >&5
14409 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14410
14411                 cat >conftest.$ac_ext <<_ACEOF
14412 #line 14412 "configure"
14413 #include "confdefs.h"
14414
14415 #include <${cf_cv_ncurses_header:-curses.h}>
14416 int
14417 main ()
14418 {
14419 int x = _XPG5
14420   ;
14421   return 0;
14422 }
14423 _ACEOF
14424 rm -f conftest.$ac_objext
14425 if { (eval echo "$as_me:14425: \"$ac_compile\"") >&5
14426   (eval $ac_compile) 2>&5
14427   ac_status=$?
14428   echo "$as_me:14428: \$? = $ac_status" >&5
14429   (exit $ac_status); } &&
14430          { ac_try='test -s conftest.$ac_objext'
14431   { (eval echo "$as_me:14431: \"$ac_try\"") >&5
14432   (eval $ac_try) 2>&5
14433   ac_status=$?
14434   echo "$as_me:14434: \$? = $ac_status" >&5
14435   (exit $ac_status); }; }; then
14436   :
14437 else
14438   echo "$as_me: failed program was:" >&5
14439 cat conftest.$ac_ext >&5
14440 cf_save_cppflags="$CPPFLAGS"
14441                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14442                          cat >conftest.$ac_ext <<_ACEOF
14443 #line 14443 "configure"
14444 #include "confdefs.h"
14445
14446 #include <${cf_cv_ncurses_header:-curses.h}>
14447 int
14448 main ()
14449 {
14450 int x = _XPG5
14451   ;
14452   return 0;
14453 }
14454 _ACEOF
14455 rm -f conftest.$ac_objext
14456 if { (eval echo "$as_me:14456: \"$ac_compile\"") >&5
14457   (eval $ac_compile) 2>&5
14458   ac_status=$?
14459   echo "$as_me:14459: \$? = $ac_status" >&5
14460   (exit $ac_status); } &&
14461          { ac_try='test -s conftest.$ac_objext'
14462   { (eval echo "$as_me:14462: \"$ac_try\"") >&5
14463   (eval $ac_try) 2>&5
14464   ac_status=$?
14465   echo "$as_me:14465: \$? = $ac_status" >&5
14466   (exit $ac_status); }; }; then
14467   cf_define_xpg5=yes
14468 else
14469   echo "$as_me: failed program was:" >&5
14470 cat conftest.$ac_ext >&5
14471 fi
14472 rm -f conftest.$ac_objext conftest.$ac_ext
14473                          CPPFLAGS="$cf_save_cppflags"
14474 fi
14475 rm -f conftest.$ac_objext conftest.$ac_ext
14476                 echo "$as_me:14476: result: $cf_define_xpg5" >&5
14477 echo "${ECHO_T}$cf_define_xpg5" >&6
14478
14479                 if test "$cf_define_xpg5" = yes
14480                 then
14481                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14482                 fi
14483         fi
14484
14485         echo "$as_me:14485: checking for wide-character functions" >&5
14486 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14487 if test "${cf_cv_widechar_funcs+set}" = set; then
14488   echo $ECHO_N "(cached) $ECHO_C" >&6
14489 else
14490
14491         cat >conftest.$ac_ext <<_ACEOF
14492 #line 14492 "configure"
14493 #include "confdefs.h"
14494
14495 #include <${cf_cv_ncurses_header:-curses.h}>
14496 int
14497 main ()
14498 {
14499
14500                 static wchar_t src_wchar[2];
14501                 static cchar_t dst_cchar;
14502                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
14503
14504   ;
14505   return 0;
14506 }
14507 _ACEOF
14508 rm -f conftest.$ac_objext conftest$ac_exeext
14509 if { (eval echo "$as_me:14509: \"$ac_link\"") >&5
14510   (eval $ac_link) 2>&5
14511   ac_status=$?
14512   echo "$as_me:14512: \$? = $ac_status" >&5
14513   (exit $ac_status); } &&
14514          { ac_try='test -s conftest$ac_exeext'
14515   { (eval echo "$as_me:14515: \"$ac_try\"") >&5
14516   (eval $ac_try) 2>&5
14517   ac_status=$?
14518   echo "$as_me:14518: \$? = $ac_status" >&5
14519   (exit $ac_status); }; }; then
14520   cf_cv_widechar_funcs=yes
14521 else
14522   echo "$as_me: failed program was:" >&5
14523 cat conftest.$ac_ext >&5
14524 cf_cv_widechar_funcs=no
14525 fi
14526 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14527
14528 fi
14529 echo "$as_me:14529: result: $cf_cv_widechar_funcs" >&5
14530 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
14531         if test "$cf_cv_widechar_funcs" != no ; then
14532
14533 cat >>confdefs.h <<\EOF
14534 #define USE_WIDEC_SUPPORT 1
14535 EOF
14536
14537         else
14538                 cat >>confdefs.h <<\EOF
14539 #define USE_WIDEC_SUPPORT 0
14540 EOF
14541
14542         fi
14543 else
14544         cat >>confdefs.h <<\EOF
14545 #define USE_WIDEC_SUPPORT 0
14546 EOF
14547
14548 fi
14549
14550 echo "$as_me:14550: checking if sys/time.h works with sys/select.h" >&5
14551 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
14552 if test "${cf_cv_sys_time_select+set}" = set; then
14553   echo $ECHO_N "(cached) $ECHO_C" >&6
14554 else
14555
14556 cat >conftest.$ac_ext <<_ACEOF
14557 #line 14557 "configure"
14558 #include "confdefs.h"
14559
14560 #include <sys/types.h>
14561 #ifdef HAVE_SYS_TIME_H
14562 #include <sys/time.h>
14563 #endif
14564 #ifdef HAVE_SYS_SELECT_H
14565 #include <sys/select.h>
14566 #endif
14567
14568 int
14569 main ()
14570 {
14571
14572   ;
14573   return 0;
14574 }
14575 _ACEOF
14576 rm -f conftest.$ac_objext
14577 if { (eval echo "$as_me:14577: \"$ac_compile\"") >&5
14578   (eval $ac_compile) 2>&5
14579   ac_status=$?
14580   echo "$as_me:14580: \$? = $ac_status" >&5
14581   (exit $ac_status); } &&
14582          { ac_try='test -s conftest.$ac_objext'
14583   { (eval echo "$as_me:14583: \"$ac_try\"") >&5
14584   (eval $ac_try) 2>&5
14585   ac_status=$?
14586   echo "$as_me:14586: \$? = $ac_status" >&5
14587   (exit $ac_status); }; }; then
14588   cf_cv_sys_time_select=yes
14589 else
14590   echo "$as_me: failed program was:" >&5
14591 cat conftest.$ac_ext >&5
14592 cf_cv_sys_time_select=no
14593 fi
14594 rm -f conftest.$ac_objext conftest.$ac_ext
14595
14596 fi
14597
14598 echo "$as_me:14598: result: $cf_cv_sys_time_select" >&5
14599 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
14600 test "$cf_cv_sys_time_select" = yes &&
14601 cat >>confdefs.h <<\EOF
14602 #define HAVE_SYS_TIME_SELECT 1
14603 EOF
14604
14605 echo "$as_me:14605: checking for function curses_version" >&5
14606 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
14607 if test "${cf_cv_func_curses_version+set}" = set; then
14608   echo $ECHO_N "(cached) $ECHO_C" >&6
14609 else
14610
14611 if test "$cross_compiling" = yes; then
14612   cf_cv_func_curses_version=unknown
14613 else
14614   cat >conftest.$ac_ext <<_ACEOF
14615 #line 14615 "configure"
14616 #include "confdefs.h"
14617
14618 #include <${cf_cv_ncurses_header:-curses.h}>
14619 int main()
14620 {
14621         char temp[1024];
14622         sprintf(temp, "%s\n", curses_version());
14623         ${cf_cv_main_return:-return}(0);
14624 }
14625
14626 _ACEOF
14627 rm -f conftest$ac_exeext
14628 if { (eval echo "$as_me:14628: \"$ac_link\"") >&5
14629   (eval $ac_link) 2>&5
14630   ac_status=$?
14631   echo "$as_me:14631: \$? = $ac_status" >&5
14632   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14633   { (eval echo "$as_me:14633: \"$ac_try\"") >&5
14634   (eval $ac_try) 2>&5
14635   ac_status=$?
14636   echo "$as_me:14636: \$? = $ac_status" >&5
14637   (exit $ac_status); }; }; then
14638   cf_cv_func_curses_version=yes
14639
14640 else
14641   echo "$as_me: program exited with status $ac_status" >&5
14642 echo "$as_me: failed program was:" >&5
14643 cat conftest.$ac_ext >&5
14644 cf_cv_func_curses_version=no
14645
14646 fi
14647 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14648 fi
14649 rm -f core
14650 fi
14651 echo "$as_me:14651: result: $cf_cv_func_curses_version" >&5
14652 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
14653 test "$cf_cv_func_curses_version" = yes &&
14654 cat >>confdefs.h <<\EOF
14655 #define HAVE_CURSES_VERSION 1
14656 EOF
14657
14658 echo "$as_me:14658: checking for alternate character set array" >&5
14659 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
14660 if test "${cf_cv_curses_acs_map+set}" = set; then
14661   echo $ECHO_N "(cached) $ECHO_C" >&6
14662 else
14663
14664 cf_cv_curses_acs_map=unknown
14665 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
14666 do
14667 cat >conftest.$ac_ext <<_ACEOF
14668 #line 14668 "configure"
14669 #include "confdefs.h"
14670
14671 #include <${cf_cv_ncurses_header:-curses.h}>
14672
14673 int
14674 main ()
14675 {
14676
14677 $name['k'] = ACS_PLUS
14678
14679   ;
14680   return 0;
14681 }
14682 _ACEOF
14683 rm -f conftest.$ac_objext conftest$ac_exeext
14684 if { (eval echo "$as_me:14684: \"$ac_link\"") >&5
14685   (eval $ac_link) 2>&5
14686   ac_status=$?
14687   echo "$as_me:14687: \$? = $ac_status" >&5
14688   (exit $ac_status); } &&
14689          { ac_try='test -s conftest$ac_exeext'
14690   { (eval echo "$as_me:14690: \"$ac_try\"") >&5
14691   (eval $ac_try) 2>&5
14692   ac_status=$?
14693   echo "$as_me:14693: \$? = $ac_status" >&5
14694   (exit $ac_status); }; }; then
14695   cf_cv_curses_acs_map=$name; break
14696 else
14697   echo "$as_me: failed program was:" >&5
14698 cat conftest.$ac_ext >&5
14699 fi
14700 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14701 done
14702
14703 fi
14704 echo "$as_me:14704: result: $cf_cv_curses_acs_map" >&5
14705 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
14706
14707 test "$cf_cv_curses_acs_map" != unknown &&
14708 cat >>confdefs.h <<EOF
14709 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
14710 EOF
14711
14712 if test "$cf_enable_widec" = yes; then
14713
14714 echo "$as_me:14714: checking for wide alternate character set array" >&5
14715 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
14716 if test "${cf_cv_curses_wacs_map+set}" = set; then
14717   echo $ECHO_N "(cached) $ECHO_C" >&6
14718 else
14719
14720         cf_cv_curses_wacs_map=unknown
14721         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
14722         do
14723         cat >conftest.$ac_ext <<_ACEOF
14724 #line 14724 "configure"
14725 #include "confdefs.h"
14726
14727 #ifndef _XOPEN_SOURCE_EXTENDED
14728 #define _XOPEN_SOURCE_EXTENDED
14729 #endif
14730 #include <${cf_cv_ncurses_header:-curses.h}>
14731 int
14732 main ()
14733 {
14734 void *foo = &($name['k'])
14735   ;
14736   return 0;
14737 }
14738 _ACEOF
14739 rm -f conftest.$ac_objext conftest$ac_exeext
14740 if { (eval echo "$as_me:14740: \"$ac_link\"") >&5
14741   (eval $ac_link) 2>&5
14742   ac_status=$?
14743   echo "$as_me:14743: \$? = $ac_status" >&5
14744   (exit $ac_status); } &&
14745          { ac_try='test -s conftest$ac_exeext'
14746   { (eval echo "$as_me:14746: \"$ac_try\"") >&5
14747   (eval $ac_try) 2>&5
14748   ac_status=$?
14749   echo "$as_me:14749: \$? = $ac_status" >&5
14750   (exit $ac_status); }; }; then
14751   cf_cv_curses_wacs_map=$name
14752          break
14753 else
14754   echo "$as_me: failed program was:" >&5
14755 cat conftest.$ac_ext >&5
14756 fi
14757 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14758         done
14759 fi
14760 echo "$as_me:14760: result: $cf_cv_curses_wacs_map" >&5
14761 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
14762
14763 test "$cf_cv_curses_wacs_map" != unknown &&
14764 cat >>confdefs.h <<EOF
14765 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
14766 EOF
14767
14768 echo "$as_me:14768: checking for wide alternate character constants" >&5
14769 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
14770 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
14771   echo $ECHO_N "(cached) $ECHO_C" >&6
14772 else
14773
14774 cf_cv_curses_wacs_symbols=no
14775 if test "$cf_cv_curses_wacs_map" != unknown
14776 then
14777         cat >conftest.$ac_ext <<_ACEOF
14778 #line 14778 "configure"
14779 #include "confdefs.h"
14780
14781 #ifndef _XOPEN_SOURCE_EXTENDED
14782 #define _XOPEN_SOURCE_EXTENDED
14783 #endif
14784 #include <${cf_cv_ncurses_header:-curses.h}>
14785 int
14786 main ()
14787 {
14788 cchar_t *foo = WACS_PLUS;
14789          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
14790   ;
14791   return 0;
14792 }
14793 _ACEOF
14794 rm -f conftest.$ac_objext conftest$ac_exeext
14795 if { (eval echo "$as_me:14795: \"$ac_link\"") >&5
14796   (eval $ac_link) 2>&5
14797   ac_status=$?
14798   echo "$as_me:14798: \$? = $ac_status" >&5
14799   (exit $ac_status); } &&
14800          { ac_try='test -s conftest$ac_exeext'
14801   { (eval echo "$as_me:14801: \"$ac_try\"") >&5
14802   (eval $ac_try) 2>&5
14803   ac_status=$?
14804   echo "$as_me:14804: \$? = $ac_status" >&5
14805   (exit $ac_status); }; }; then
14806   cf_cv_curses_wacs_symbols=yes
14807 else
14808   echo "$as_me: failed program was:" >&5
14809 cat conftest.$ac_ext >&5
14810 fi
14811 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14812 else
14813         cat >conftest.$ac_ext <<_ACEOF
14814 #line 14814 "configure"
14815 #include "confdefs.h"
14816
14817 #ifndef _XOPEN_SOURCE_EXTENDED
14818 #define _XOPEN_SOURCE_EXTENDED
14819 #endif
14820 #include <${cf_cv_ncurses_header:-curses.h}>
14821 int
14822 main ()
14823 {
14824 cchar_t *foo = WACS_PLUS
14825   ;
14826   return 0;
14827 }
14828 _ACEOF
14829 rm -f conftest.$ac_objext conftest$ac_exeext
14830 if { (eval echo "$as_me:14830: \"$ac_link\"") >&5
14831   (eval $ac_link) 2>&5
14832   ac_status=$?
14833   echo "$as_me:14833: \$? = $ac_status" >&5
14834   (exit $ac_status); } &&
14835          { ac_try='test -s conftest$ac_exeext'
14836   { (eval echo "$as_me:14836: \"$ac_try\"") >&5
14837   (eval $ac_try) 2>&5
14838   ac_status=$?
14839   echo "$as_me:14839: \$? = $ac_status" >&5
14840   (exit $ac_status); }; }; then
14841   cf_cv_curses_wacs_symbols=yes
14842 else
14843   echo "$as_me: failed program was:" >&5
14844 cat conftest.$ac_ext >&5
14845 fi
14846 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14847 fi
14848
14849 fi
14850 echo "$as_me:14850: result: $cf_cv_curses_wacs_symbols" >&5
14851 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
14852
14853 test "$cf_cv_curses_wacs_symbols" != no &&
14854 cat >>confdefs.h <<\EOF
14855 #define CURSES_WACS_SYMBOLS 1
14856 EOF
14857
14858 fi
14859
14860 echo "$as_me:14860: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14861 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14862 cat >conftest.$ac_ext <<_ACEOF
14863 #line 14863 "configure"
14864 #include "confdefs.h"
14865
14866 #ifndef _XOPEN_SOURCE_EXTENDED
14867 #define _XOPEN_SOURCE_EXTENDED
14868 #endif
14869 #include <${cf_cv_ncurses_header:-curses.h}>
14870 int
14871 main ()
14872 {
14873
14874 attr_t foo
14875
14876   ;
14877   return 0;
14878 }
14879 _ACEOF
14880 rm -f conftest.$ac_objext
14881 if { (eval echo "$as_me:14881: \"$ac_compile\"") >&5
14882   (eval $ac_compile) 2>&5
14883   ac_status=$?
14884   echo "$as_me:14884: \$? = $ac_status" >&5
14885   (exit $ac_status); } &&
14886          { ac_try='test -s conftest.$ac_objext'
14887   { (eval echo "$as_me:14887: \"$ac_try\"") >&5
14888   (eval $ac_try) 2>&5
14889   ac_status=$?
14890   echo "$as_me:14890: \$? = $ac_status" >&5
14891   (exit $ac_status); }; }; then
14892   cf_result=yes
14893 else
14894   echo "$as_me: failed program was:" >&5
14895 cat conftest.$ac_ext >&5
14896 cf_result=no
14897 fi
14898 rm -f conftest.$ac_objext conftest.$ac_ext
14899 echo "$as_me:14899: result: $cf_result" >&5
14900 echo "${ECHO_T}$cf_result" >&6
14901 if test $cf_result = yes ; then
14902
14903 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14904
14905 cat >>confdefs.h <<EOF
14906 #define $cf_result 1
14907 EOF
14908
14909 else
14910
14911 cat >>confdefs.h <<EOF
14912 #define attr_t long
14913 EOF
14914
14915 fi
14916
14917 if test "$cf_enable_widec" = yes; then
14918
14919 # This is needed on Tru64 5.0 to declare mbstate_t
14920 echo "$as_me:14920: checking if we must include wchar.h to declare mbstate_t" >&5
14921 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
14922 if test "${cf_cv_mbstate_t+set}" = set; then
14923   echo $ECHO_N "(cached) $ECHO_C" >&6
14924 else
14925
14926 cat >conftest.$ac_ext <<_ACEOF
14927 #line 14927 "configure"
14928 #include "confdefs.h"
14929
14930 #include <stdlib.h>
14931 #include <stdarg.h>
14932 #include <stdio.h>
14933 #ifdef HAVE_LIBUTF8_H
14934 #include <libutf8.h>
14935 #endif
14936 int
14937 main ()
14938 {
14939 mbstate_t state
14940   ;
14941   return 0;
14942 }
14943 _ACEOF
14944 rm -f conftest.$ac_objext
14945 if { (eval echo "$as_me:14945: \"$ac_compile\"") >&5
14946   (eval $ac_compile) 2>&5
14947   ac_status=$?
14948   echo "$as_me:14948: \$? = $ac_status" >&5
14949   (exit $ac_status); } &&
14950          { ac_try='test -s conftest.$ac_objext'
14951   { (eval echo "$as_me:14951: \"$ac_try\"") >&5
14952   (eval $ac_try) 2>&5
14953   ac_status=$?
14954   echo "$as_me:14954: \$? = $ac_status" >&5
14955   (exit $ac_status); }; }; then
14956   cf_cv_mbstate_t=no
14957 else
14958   echo "$as_me: failed program was:" >&5
14959 cat conftest.$ac_ext >&5
14960 cat >conftest.$ac_ext <<_ACEOF
14961 #line 14961 "configure"
14962 #include "confdefs.h"
14963
14964 #include <stdlib.h>
14965 #include <stdarg.h>
14966 #include <stdio.h>
14967 #include <wchar.h>
14968 #ifdef HAVE_LIBUTF8_H
14969 #include <libutf8.h>
14970 #endif
14971 int
14972 main ()
14973 {
14974 mbstate_t value
14975   ;
14976   return 0;
14977 }
14978 _ACEOF
14979 rm -f conftest.$ac_objext
14980 if { (eval echo "$as_me:14980: \"$ac_compile\"") >&5
14981   (eval $ac_compile) 2>&5
14982   ac_status=$?
14983   echo "$as_me:14983: \$? = $ac_status" >&5
14984   (exit $ac_status); } &&
14985          { ac_try='test -s conftest.$ac_objext'
14986   { (eval echo "$as_me:14986: \"$ac_try\"") >&5
14987   (eval $ac_try) 2>&5
14988   ac_status=$?
14989   echo "$as_me:14989: \$? = $ac_status" >&5
14990   (exit $ac_status); }; }; then
14991   cf_cv_mbstate_t=yes
14992 else
14993   echo "$as_me: failed program was:" >&5
14994 cat conftest.$ac_ext >&5
14995 cf_cv_mbstate_t=unknown
14996 fi
14997 rm -f conftest.$ac_objext conftest.$ac_ext
14998 fi
14999 rm -f conftest.$ac_objext conftest.$ac_ext
15000 fi
15001 echo "$as_me:15001: result: $cf_cv_mbstate_t" >&5
15002 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15003
15004 if test "$cf_cv_mbstate_t" = yes ; then
15005
15006 cat >>confdefs.h <<\EOF
15007 #define NEED_WCHAR_H 1
15008 EOF
15009
15010         NEED_WCHAR_H=1
15011 fi
15012
15013 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15014 if test "$cf_cv_mbstate_t" = unknown ; then
15015         NCURSES_MBSTATE_T=1
15016 fi
15017
15018 # if we find mbstate_t in either place, use substitution to provide a fallback.
15019 if test "$cf_cv_mbstate_t" != unknown ; then
15020         NCURSES_OK_MBSTATE_T=1
15021 fi
15022
15023 # This is needed on Tru64 5.0 to declare wchar_t
15024 echo "$as_me:15024: checking if we must include wchar.h to declare wchar_t" >&5
15025 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15026 if test "${cf_cv_wchar_t+set}" = set; then
15027   echo $ECHO_N "(cached) $ECHO_C" >&6
15028 else
15029
15030 cat >conftest.$ac_ext <<_ACEOF
15031 #line 15031 "configure"
15032 #include "confdefs.h"
15033
15034 #include <stdlib.h>
15035 #include <stdarg.h>
15036 #include <stdio.h>
15037 #ifdef HAVE_LIBUTF8_H
15038 #include <libutf8.h>
15039 #endif
15040 int
15041 main ()
15042 {
15043 wchar_t state
15044   ;
15045   return 0;
15046 }
15047 _ACEOF
15048 rm -f conftest.$ac_objext
15049 if { (eval echo "$as_me:15049: \"$ac_compile\"") >&5
15050   (eval $ac_compile) 2>&5
15051   ac_status=$?
15052   echo "$as_me:15052: \$? = $ac_status" >&5
15053   (exit $ac_status); } &&
15054          { ac_try='test -s conftest.$ac_objext'
15055   { (eval echo "$as_me:15055: \"$ac_try\"") >&5
15056   (eval $ac_try) 2>&5
15057   ac_status=$?
15058   echo "$as_me:15058: \$? = $ac_status" >&5
15059   (exit $ac_status); }; }; then
15060   cf_cv_wchar_t=no
15061 else
15062   echo "$as_me: failed program was:" >&5
15063 cat conftest.$ac_ext >&5
15064 cat >conftest.$ac_ext <<_ACEOF
15065 #line 15065 "configure"
15066 #include "confdefs.h"
15067
15068 #include <stdlib.h>
15069 #include <stdarg.h>
15070 #include <stdio.h>
15071 #include <wchar.h>
15072 #ifdef HAVE_LIBUTF8_H
15073 #include <libutf8.h>
15074 #endif
15075 int
15076 main ()
15077 {
15078 wchar_t value
15079   ;
15080   return 0;
15081 }
15082 _ACEOF
15083 rm -f conftest.$ac_objext
15084 if { (eval echo "$as_me:15084: \"$ac_compile\"") >&5
15085   (eval $ac_compile) 2>&5
15086   ac_status=$?
15087   echo "$as_me:15087: \$? = $ac_status" >&5
15088   (exit $ac_status); } &&
15089          { ac_try='test -s conftest.$ac_objext'
15090   { (eval echo "$as_me:15090: \"$ac_try\"") >&5
15091   (eval $ac_try) 2>&5
15092   ac_status=$?
15093   echo "$as_me:15093: \$? = $ac_status" >&5
15094   (exit $ac_status); }; }; then
15095   cf_cv_wchar_t=yes
15096 else
15097   echo "$as_me: failed program was:" >&5
15098 cat conftest.$ac_ext >&5
15099 cf_cv_wchar_t=unknown
15100 fi
15101 rm -f conftest.$ac_objext conftest.$ac_ext
15102 fi
15103 rm -f conftest.$ac_objext conftest.$ac_ext
15104 fi
15105 echo "$as_me:15105: result: $cf_cv_wchar_t" >&5
15106 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15107
15108 if test "$cf_cv_wchar_t" = yes ; then
15109
15110 cat >>confdefs.h <<\EOF
15111 #define NEED_WCHAR_H 1
15112 EOF
15113
15114         NEED_WCHAR_H=1
15115 fi
15116
15117 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15118 if test "$cf_cv_wchar_t" = unknown ; then
15119         NCURSES_WCHAR_T=1
15120 fi
15121
15122 # if we find wchar_t in either place, use substitution to provide a fallback.
15123 if test "$cf_cv_wchar_t" != unknown ; then
15124         NCURSES_OK_WCHAR_T=1
15125 fi
15126
15127 # This is needed on Tru64 5.0 to declare wint_t
15128 echo "$as_me:15128: checking if we must include wchar.h to declare wint_t" >&5
15129 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15130 if test "${cf_cv_wint_t+set}" = set; then
15131   echo $ECHO_N "(cached) $ECHO_C" >&6
15132 else
15133
15134 cat >conftest.$ac_ext <<_ACEOF
15135 #line 15135 "configure"
15136 #include "confdefs.h"
15137
15138 #include <stdlib.h>
15139 #include <stdarg.h>
15140 #include <stdio.h>
15141 #ifdef HAVE_LIBUTF8_H
15142 #include <libutf8.h>
15143 #endif
15144 int
15145 main ()
15146 {
15147 wint_t state
15148   ;
15149   return 0;
15150 }
15151 _ACEOF
15152 rm -f conftest.$ac_objext
15153 if { (eval echo "$as_me:15153: \"$ac_compile\"") >&5
15154   (eval $ac_compile) 2>&5
15155   ac_status=$?
15156   echo "$as_me:15156: \$? = $ac_status" >&5
15157   (exit $ac_status); } &&
15158          { ac_try='test -s conftest.$ac_objext'
15159   { (eval echo "$as_me:15159: \"$ac_try\"") >&5
15160   (eval $ac_try) 2>&5
15161   ac_status=$?
15162   echo "$as_me:15162: \$? = $ac_status" >&5
15163   (exit $ac_status); }; }; then
15164   cf_cv_wint_t=no
15165 else
15166   echo "$as_me: failed program was:" >&5
15167 cat conftest.$ac_ext >&5
15168 cat >conftest.$ac_ext <<_ACEOF
15169 #line 15169 "configure"
15170 #include "confdefs.h"
15171
15172 #include <stdlib.h>
15173 #include <stdarg.h>
15174 #include <stdio.h>
15175 #include <wchar.h>
15176 #ifdef HAVE_LIBUTF8_H
15177 #include <libutf8.h>
15178 #endif
15179 int
15180 main ()
15181 {
15182 wint_t value
15183   ;
15184   return 0;
15185 }
15186 _ACEOF
15187 rm -f conftest.$ac_objext
15188 if { (eval echo "$as_me:15188: \"$ac_compile\"") >&5
15189   (eval $ac_compile) 2>&5
15190   ac_status=$?
15191   echo "$as_me:15191: \$? = $ac_status" >&5
15192   (exit $ac_status); } &&
15193          { ac_try='test -s conftest.$ac_objext'
15194   { (eval echo "$as_me:15194: \"$ac_try\"") >&5
15195   (eval $ac_try) 2>&5
15196   ac_status=$?
15197   echo "$as_me:15197: \$? = $ac_status" >&5
15198   (exit $ac_status); }; }; then
15199   cf_cv_wint_t=yes
15200 else
15201   echo "$as_me: failed program was:" >&5
15202 cat conftest.$ac_ext >&5
15203 cf_cv_wint_t=unknown
15204 fi
15205 rm -f conftest.$ac_objext conftest.$ac_ext
15206 fi
15207 rm -f conftest.$ac_objext conftest.$ac_ext
15208 fi
15209 echo "$as_me:15209: result: $cf_cv_wint_t" >&5
15210 echo "${ECHO_T}$cf_cv_wint_t" >&6
15211
15212 if test "$cf_cv_wint_t" = yes ; then
15213
15214 cat >>confdefs.h <<\EOF
15215 #define NEED_WCHAR_H 1
15216 EOF
15217
15218         NEED_WCHAR_H=1
15219 fi
15220
15221 # if we do not find wint_t in either place, use substitution to provide a fallback.
15222 if test "$cf_cv_wint_t" = unknown ; then
15223         NCURSES_WINT_T=1
15224 fi
15225
15226 # if we find wint_t in either place, use substitution to provide a fallback.
15227 if test "$cf_cv_wint_t" != unknown ; then
15228         NCURSES_OK_WINT_T=1
15229 fi
15230
15231         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15232
15233 echo "$as_me:15233: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15234 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15235 cat >conftest.$ac_ext <<_ACEOF
15236 #line 15236 "configure"
15237 #include "confdefs.h"
15238
15239 #ifndef _XOPEN_SOURCE_EXTENDED
15240 #define _XOPEN_SOURCE_EXTENDED
15241 #endif
15242 #include <${cf_cv_ncurses_header:-curses.h}>
15243 int
15244 main ()
15245 {
15246
15247 mbstate_t foo
15248
15249   ;
15250   return 0;
15251 }
15252 _ACEOF
15253 rm -f conftest.$ac_objext
15254 if { (eval echo "$as_me:15254: \"$ac_compile\"") >&5
15255   (eval $ac_compile) 2>&5
15256   ac_status=$?
15257   echo "$as_me:15257: \$? = $ac_status" >&5
15258   (exit $ac_status); } &&
15259          { ac_try='test -s conftest.$ac_objext'
15260   { (eval echo "$as_me:15260: \"$ac_try\"") >&5
15261   (eval $ac_try) 2>&5
15262   ac_status=$?
15263   echo "$as_me:15263: \$? = $ac_status" >&5
15264   (exit $ac_status); }; }; then
15265   cf_result=yes
15266 else
15267   echo "$as_me: failed program was:" >&5
15268 cat conftest.$ac_ext >&5
15269 cf_result=no
15270 fi
15271 rm -f conftest.$ac_objext conftest.$ac_ext
15272 echo "$as_me:15272: result: $cf_result" >&5
15273 echo "${ECHO_T}$cf_result" >&6
15274 if test $cf_result = yes ; then
15275
15276 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15277
15278 cat >>confdefs.h <<EOF
15279 #define $cf_result 1
15280 EOF
15281
15282 else
15283
15284 cat >>confdefs.h <<EOF
15285 #define mbstate_t long
15286 EOF
15287
15288 fi
15289
15290         fi
15291
15292         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
15293
15294 echo "$as_me:15294: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15295 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15296 cat >conftest.$ac_ext <<_ACEOF
15297 #line 15297 "configure"
15298 #include "confdefs.h"
15299
15300 #ifndef _XOPEN_SOURCE_EXTENDED
15301 #define _XOPEN_SOURCE_EXTENDED
15302 #endif
15303 #include <${cf_cv_ncurses_header:-curses.h}>
15304 int
15305 main ()
15306 {
15307
15308 wchar_t foo
15309
15310   ;
15311   return 0;
15312 }
15313 _ACEOF
15314 rm -f conftest.$ac_objext
15315 if { (eval echo "$as_me:15315: \"$ac_compile\"") >&5
15316   (eval $ac_compile) 2>&5
15317   ac_status=$?
15318   echo "$as_me:15318: \$? = $ac_status" >&5
15319   (exit $ac_status); } &&
15320          { ac_try='test -s conftest.$ac_objext'
15321   { (eval echo "$as_me:15321: \"$ac_try\"") >&5
15322   (eval $ac_try) 2>&5
15323   ac_status=$?
15324   echo "$as_me:15324: \$? = $ac_status" >&5
15325   (exit $ac_status); }; }; then
15326   cf_result=yes
15327 else
15328   echo "$as_me: failed program was:" >&5
15329 cat conftest.$ac_ext >&5
15330 cf_result=no
15331 fi
15332 rm -f conftest.$ac_objext conftest.$ac_ext
15333 echo "$as_me:15333: result: $cf_result" >&5
15334 echo "${ECHO_T}$cf_result" >&6
15335 if test $cf_result = yes ; then
15336
15337 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15338
15339 cat >>confdefs.h <<EOF
15340 #define $cf_result 1
15341 EOF
15342
15343 else
15344
15345 cat >>confdefs.h <<EOF
15346 #define wchar_t long
15347 EOF
15348
15349 fi
15350
15351         fi
15352
15353         if test "$NCURSES_OK_WINT_T" = 0 ; then
15354
15355 echo "$as_me:15355: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15356 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15357 cat >conftest.$ac_ext <<_ACEOF
15358 #line 15358 "configure"
15359 #include "confdefs.h"
15360
15361 #ifndef _XOPEN_SOURCE_EXTENDED
15362 #define _XOPEN_SOURCE_EXTENDED
15363 #endif
15364 #include <${cf_cv_ncurses_header:-curses.h}>
15365 int
15366 main ()
15367 {
15368
15369 wint_t foo
15370
15371   ;
15372   return 0;
15373 }
15374 _ACEOF
15375 rm -f conftest.$ac_objext
15376 if { (eval echo "$as_me:15376: \"$ac_compile\"") >&5
15377   (eval $ac_compile) 2>&5
15378   ac_status=$?
15379   echo "$as_me:15379: \$? = $ac_status" >&5
15380   (exit $ac_status); } &&
15381          { ac_try='test -s conftest.$ac_objext'
15382   { (eval echo "$as_me:15382: \"$ac_try\"") >&5
15383   (eval $ac_try) 2>&5
15384   ac_status=$?
15385   echo "$as_me:15385: \$? = $ac_status" >&5
15386   (exit $ac_status); }; }; then
15387   cf_result=yes
15388 else
15389   echo "$as_me: failed program was:" >&5
15390 cat conftest.$ac_ext >&5
15391 cf_result=no
15392 fi
15393 rm -f conftest.$ac_objext conftest.$ac_ext
15394 echo "$as_me:15394: result: $cf_result" >&5
15395 echo "${ECHO_T}$cf_result" >&6
15396 if test $cf_result = yes ; then
15397
15398 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15399
15400 cat >>confdefs.h <<EOF
15401 #define $cf_result 1
15402 EOF
15403
15404 else
15405
15406 cat >>confdefs.h <<EOF
15407 #define wint_t long
15408 EOF
15409
15410 fi
15411
15412         fi
15413 fi
15414
15415 echo "$as_me:15415: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15416 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15417
15418 cat >conftest.$ac_ext <<_ACEOF
15419 #line 15419 "configure"
15420 #include "confdefs.h"
15421
15422 #ifdef HAVE_XCURSES
15423 #include <xcurses.h>
15424 char * XCursesProgramName = "test";
15425 #else
15426 #include <${cf_cv_ncurses_header:-curses.h}>
15427 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15428 #include <ncursesw/term.h>
15429 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15430 #include <ncurses/term.h>
15431 #elif defined(HAVE_TERM_H)
15432 #include <term.h>
15433 #endif
15434 #endif
15435
15436 int
15437 main ()
15438 {
15439
15440 void *foo = &(boolnames)
15441
15442   ;
15443   return 0;
15444 }
15445 _ACEOF
15446 rm -f conftest.$ac_objext
15447 if { (eval echo "$as_me:15447: \"$ac_compile\"") >&5
15448   (eval $ac_compile) 2>&5
15449   ac_status=$?
15450   echo "$as_me:15450: \$? = $ac_status" >&5
15451   (exit $ac_status); } &&
15452          { ac_try='test -s conftest.$ac_objext'
15453   { (eval echo "$as_me:15453: \"$ac_try\"") >&5
15454   (eval $ac_try) 2>&5
15455   ac_status=$?
15456   echo "$as_me:15456: \$? = $ac_status" >&5
15457   (exit $ac_status); }; }; then
15458   cf_result=yes
15459 else
15460   echo "$as_me: failed program was:" >&5
15461 cat conftest.$ac_ext >&5
15462 cf_result=no
15463 fi
15464 rm -f conftest.$ac_objext conftest.$ac_ext
15465 echo "$as_me:15465: result: $cf_result" >&5
15466 echo "${ECHO_T}$cf_result" >&6
15467
15468 if test $cf_result = yes ; then
15469
15470 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15471
15472         cat >>confdefs.h <<EOF
15473 #define $cf_result 1
15474 EOF
15475
15476 else
15477         echo "$as_me:15477: checking for data boolnames in library" >&5
15478 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
15479         # BSD linkers insist on making weak linkage, but resolve at runtime.
15480         if test "$cross_compiling" = yes; then
15481
15482         # cross-compiling
15483         cat >conftest.$ac_ext <<_ACEOF
15484 #line 15484 "configure"
15485 #include "confdefs.h"
15486
15487 #ifdef HAVE_XCURSES
15488 #include <xcurses.h>
15489 char * XCursesProgramName = "test";
15490 #else
15491 #include <${cf_cv_ncurses_header:-curses.h}>
15492 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15493 #include <ncursesw/term.h>
15494 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15495 #include <ncurses/term.h>
15496 #elif defined(HAVE_TERM_H)
15497 #include <term.h>
15498 #endif
15499 #endif
15500
15501 extern char boolnames;
15502 int
15503 main ()
15504 {
15505
15506         do {
15507                 void *foo = &(boolnames);
15508                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
15509                 ${cf_cv_main_return:-return}(foo == 0);
15510         } while (0)
15511
15512   ;
15513   return 0;
15514 }
15515 _ACEOF
15516 rm -f conftest.$ac_objext conftest$ac_exeext
15517 if { (eval echo "$as_me:15517: \"$ac_link\"") >&5
15518   (eval $ac_link) 2>&5
15519   ac_status=$?
15520   echo "$as_me:15520: \$? = $ac_status" >&5
15521   (exit $ac_status); } &&
15522          { ac_try='test -s conftest$ac_exeext'
15523   { (eval echo "$as_me:15523: \"$ac_try\"") >&5
15524   (eval $ac_try) 2>&5
15525   ac_status=$?
15526   echo "$as_me:15526: \$? = $ac_status" >&5
15527   (exit $ac_status); }; }; then
15528   cf_result=yes
15529 else
15530   echo "$as_me: failed program was:" >&5
15531 cat conftest.$ac_ext >&5
15532 cf_result=no
15533 fi
15534 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15535
15536 else
15537   cat >conftest.$ac_ext <<_ACEOF
15538 #line 15538 "configure"
15539 #include "confdefs.h"
15540
15541 #ifdef HAVE_XCURSES
15542 #include <xcurses.h>
15543 char * XCursesProgramName = "test";
15544 #else
15545 #include <${cf_cv_ncurses_header:-curses.h}>
15546 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15547 #include <ncursesw/term.h>
15548 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15549 #include <ncurses/term.h>
15550 #elif defined(HAVE_TERM_H)
15551 #include <term.h>
15552 #endif
15553 #endif
15554
15555 extern char boolnames;
15556 int main(void)
15557 {
15558         void *foo = &(boolnames);
15559         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
15560         ${cf_cv_main_return:-return}(foo == 0);
15561 }
15562 _ACEOF
15563 rm -f conftest$ac_exeext
15564 if { (eval echo "$as_me:15564: \"$ac_link\"") >&5
15565   (eval $ac_link) 2>&5
15566   ac_status=$?
15567   echo "$as_me:15567: \$? = $ac_status" >&5
15568   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15569   { (eval echo "$as_me:15569: \"$ac_try\"") >&5
15570   (eval $ac_try) 2>&5
15571   ac_status=$?
15572   echo "$as_me:15572: \$? = $ac_status" >&5
15573   (exit $ac_status); }; }; then
15574   cf_result=yes
15575 else
15576   echo "$as_me: program exited with status $ac_status" >&5
15577 echo "$as_me: failed program was:" >&5
15578 cat conftest.$ac_ext >&5
15579 cf_result=no
15580 fi
15581 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15582 fi
15583         echo "$as_me:15583: result: $cf_result" >&5
15584 echo "${ECHO_T}$cf_result" >&6
15585         if test $cf_result = yes ; then
15586
15587 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15588
15589                 cat >>confdefs.h <<EOF
15590 #define $cf_result 1
15591 EOF
15592
15593         fi
15594 fi
15595
15596 echo "$as_me:15596: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15597 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15598
15599 cat >conftest.$ac_ext <<_ACEOF
15600 #line 15600 "configure"
15601 #include "confdefs.h"
15602
15603 #ifdef HAVE_XCURSES
15604 #include <xcurses.h>
15605 char * XCursesProgramName = "test";
15606 #else
15607 #include <${cf_cv_ncurses_header:-curses.h}>
15608 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15609 #include <ncursesw/term.h>
15610 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15611 #include <ncurses/term.h>
15612 #elif defined(HAVE_TERM_H)
15613 #include <term.h>
15614 #endif
15615 #endif
15616
15617 int
15618 main ()
15619 {
15620
15621 void *foo = &(boolfnames)
15622
15623   ;
15624   return 0;
15625 }
15626 _ACEOF
15627 rm -f conftest.$ac_objext
15628 if { (eval echo "$as_me:15628: \"$ac_compile\"") >&5
15629   (eval $ac_compile) 2>&5
15630   ac_status=$?
15631   echo "$as_me:15631: \$? = $ac_status" >&5
15632   (exit $ac_status); } &&
15633          { ac_try='test -s conftest.$ac_objext'
15634   { (eval echo "$as_me:15634: \"$ac_try\"") >&5
15635   (eval $ac_try) 2>&5
15636   ac_status=$?
15637   echo "$as_me:15637: \$? = $ac_status" >&5
15638   (exit $ac_status); }; }; then
15639   cf_result=yes
15640 else
15641   echo "$as_me: failed program was:" >&5
15642 cat conftest.$ac_ext >&5
15643 cf_result=no
15644 fi
15645 rm -f conftest.$ac_objext conftest.$ac_ext
15646 echo "$as_me:15646: result: $cf_result" >&5
15647 echo "${ECHO_T}$cf_result" >&6
15648
15649 if test $cf_result = yes ; then
15650
15651 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15652
15653         cat >>confdefs.h <<EOF
15654 #define $cf_result 1
15655 EOF
15656
15657 else
15658         echo "$as_me:15658: checking for data boolfnames in library" >&5
15659 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
15660         # BSD linkers insist on making weak linkage, but resolve at runtime.
15661         if test "$cross_compiling" = yes; then
15662
15663         # cross-compiling
15664         cat >conftest.$ac_ext <<_ACEOF
15665 #line 15665 "configure"
15666 #include "confdefs.h"
15667
15668 #ifdef HAVE_XCURSES
15669 #include <xcurses.h>
15670 char * XCursesProgramName = "test";
15671 #else
15672 #include <${cf_cv_ncurses_header:-curses.h}>
15673 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15674 #include <ncursesw/term.h>
15675 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15676 #include <ncurses/term.h>
15677 #elif defined(HAVE_TERM_H)
15678 #include <term.h>
15679 #endif
15680 #endif
15681
15682 extern char boolfnames;
15683 int
15684 main ()
15685 {
15686
15687         do {
15688                 void *foo = &(boolfnames);
15689                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
15690                 ${cf_cv_main_return:-return}(foo == 0);
15691         } while (0)
15692
15693   ;
15694   return 0;
15695 }
15696 _ACEOF
15697 rm -f conftest.$ac_objext conftest$ac_exeext
15698 if { (eval echo "$as_me:15698: \"$ac_link\"") >&5
15699   (eval $ac_link) 2>&5
15700   ac_status=$?
15701   echo "$as_me:15701: \$? = $ac_status" >&5
15702   (exit $ac_status); } &&
15703          { ac_try='test -s conftest$ac_exeext'
15704   { (eval echo "$as_me:15704: \"$ac_try\"") >&5
15705   (eval $ac_try) 2>&5
15706   ac_status=$?
15707   echo "$as_me:15707: \$? = $ac_status" >&5
15708   (exit $ac_status); }; }; then
15709   cf_result=yes
15710 else
15711   echo "$as_me: failed program was:" >&5
15712 cat conftest.$ac_ext >&5
15713 cf_result=no
15714 fi
15715 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15716
15717 else
15718   cat >conftest.$ac_ext <<_ACEOF
15719 #line 15719 "configure"
15720 #include "confdefs.h"
15721
15722 #ifdef HAVE_XCURSES
15723 #include <xcurses.h>
15724 char * XCursesProgramName = "test";
15725 #else
15726 #include <${cf_cv_ncurses_header:-curses.h}>
15727 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15728 #include <ncursesw/term.h>
15729 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15730 #include <ncurses/term.h>
15731 #elif defined(HAVE_TERM_H)
15732 #include <term.h>
15733 #endif
15734 #endif
15735
15736 extern char boolfnames;
15737 int main(void)
15738 {
15739         void *foo = &(boolfnames);
15740         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
15741         ${cf_cv_main_return:-return}(foo == 0);
15742 }
15743 _ACEOF
15744 rm -f conftest$ac_exeext
15745 if { (eval echo "$as_me:15745: \"$ac_link\"") >&5
15746   (eval $ac_link) 2>&5
15747   ac_status=$?
15748   echo "$as_me:15748: \$? = $ac_status" >&5
15749   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15750   { (eval echo "$as_me:15750: \"$ac_try\"") >&5
15751   (eval $ac_try) 2>&5
15752   ac_status=$?
15753   echo "$as_me:15753: \$? = $ac_status" >&5
15754   (exit $ac_status); }; }; then
15755   cf_result=yes
15756 else
15757   echo "$as_me: program exited with status $ac_status" >&5
15758 echo "$as_me: failed program was:" >&5
15759 cat conftest.$ac_ext >&5
15760 cf_result=no
15761 fi
15762 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15763 fi
15764         echo "$as_me:15764: result: $cf_result" >&5
15765 echo "${ECHO_T}$cf_result" >&6
15766         if test $cf_result = yes ; then
15767
15768 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15769
15770                 cat >>confdefs.h <<EOF
15771 #define $cf_result 1
15772 EOF
15773
15774         fi
15775 fi
15776
15777 if ( test "$GCC" = yes || test "$GXX" = yes )
15778 then
15779 echo "$as_me:15779: checking if you want to turn on gcc warnings" >&5
15780 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15781
15782 # Check whether --enable-warnings or --disable-warnings was given.
15783 if test "${enable_warnings+set}" = set; then
15784   enableval="$enable_warnings"
15785   test "$enableval" != yes && enableval=no
15786   if test "$enableval" != "no" ; then
15787     with_warnings=yes
15788   else
15789     with_warnings=no
15790   fi
15791 else
15792   enableval=no
15793   with_warnings=no
15794
15795 fi;
15796 echo "$as_me:15796: result: $with_warnings" >&5
15797 echo "${ECHO_T}$with_warnings" >&6
15798 if test "$with_warnings" = "yes"
15799 then
15800
15801 if test "$GCC" = yes
15802 then
15803 cat > conftest.i <<EOF
15804 #ifndef GCC_PRINTF
15805 #define GCC_PRINTF 0
15806 #endif
15807 #ifndef GCC_SCANF
15808 #define GCC_SCANF 0
15809 #endif
15810 #ifndef GCC_NORETURN
15811 #define GCC_NORETURN /* nothing */
15812 #endif
15813 #ifndef GCC_UNUSED
15814 #define GCC_UNUSED /* nothing */
15815 #endif
15816 EOF
15817 if test "$GCC" = yes
15818 then
15819         { echo "$as_me:15819: checking for $CC __attribute__ directives..." >&5
15820 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15821 cat > conftest.$ac_ext <<EOF
15822 #line 15822 "${as_me:-configure}"
15823 #include "confdefs.h"
15824 #include "conftest.h"
15825 #include "conftest.i"
15826 #if     GCC_PRINTF
15827 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15828 #else
15829 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15830 #endif
15831 #if     GCC_SCANF
15832 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15833 #else
15834 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15835 #endif
15836 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15837 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
15838 extern void foo(void) GCC_NORETURN;
15839 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
15840 EOF
15841         cf_printf_attribute=no
15842         cf_scanf_attribute=no
15843         for cf_attribute in scanf printf unused noreturn
15844         do
15845
15846 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15847
15848                 cf_directive="__attribute__(($cf_attribute))"
15849                 echo "checking for $CC $cf_directive" 1>&5
15850
15851                 case $cf_attribute in #(vi
15852                 printf) #(vi
15853                         cf_printf_attribute=yes
15854                         cat >conftest.h <<EOF
15855 #define GCC_$cf_ATTRIBUTE 1
15856 EOF
15857                         ;;
15858                 scanf) #(vi
15859                         cf_scanf_attribute=yes
15860                         cat >conftest.h <<EOF
15861 #define GCC_$cf_ATTRIBUTE 1
15862 EOF
15863                         ;;
15864                 *) #(vi
15865                         cat >conftest.h <<EOF
15866 #define GCC_$cf_ATTRIBUTE $cf_directive
15867 EOF
15868                         ;;
15869                 esac
15870
15871                 if { (eval echo "$as_me:15871: \"$ac_compile\"") >&5
15872   (eval $ac_compile) 2>&5
15873   ac_status=$?
15874   echo "$as_me:15874: \$? = $ac_status" >&5
15875   (exit $ac_status); }; then
15876                         test -n "$verbose" && echo "$as_me:15876: result: ... $cf_attribute" >&5
15877 echo "${ECHO_T}... $cf_attribute" >&6
15878                         cat conftest.h >>confdefs.h
15879                         case $cf_attribute in #(vi
15880                         noreturn) #(vi
15881
15882 cat >>confdefs.h <<EOF
15883 #define GCC_NORETURN $cf_directive
15884 EOF
15885
15886                                 ;;
15887                         printf) #(vi
15888                                 cf_value='/* nothing */'
15889                                 if test "$cf_printf_attribute" != no ; then
15890                                         cf_value='__attribute__((format(printf,fmt,var)))'
15891
15892 cat >>confdefs.h <<\EOF
15893 #define GCC_PRINTF 1
15894 EOF
15895
15896                                 fi
15897
15898 cat >>confdefs.h <<EOF
15899 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15900 EOF
15901
15902                                 ;;
15903                         scanf) #(vi
15904                                 cf_value='/* nothing */'
15905                                 if test "$cf_scanf_attribute" != no ; then
15906                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15907
15908 cat >>confdefs.h <<\EOF
15909 #define GCC_SCANF 1
15910 EOF
15911
15912                                 fi
15913
15914 cat >>confdefs.h <<EOF
15915 #define GCC_SCANFLIKE(fmt,var) $cf_value
15916 EOF
15917
15918                                 ;;
15919                         unused) #(vi
15920
15921 cat >>confdefs.h <<EOF
15922 #define GCC_UNUSED $cf_directive
15923 EOF
15924
15925                                 ;;
15926                         esac
15927                 fi
15928         done
15929 else
15930         fgrep define conftest.i >>confdefs.h
15931 fi
15932 rm -rf conftest*
15933 fi
15934
15935 INTEL_COMPILER=no
15936
15937 if test "$GCC" = yes ; then
15938         case $host_os in
15939         linux*|gnu*)
15940                 echo "$as_me:15940: checking if this is really Intel C compiler" >&5
15941 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
15942                 cf_save_CFLAGS="$CFLAGS"
15943                 CFLAGS="$CFLAGS -no-gcc"
15944                 cat >conftest.$ac_ext <<_ACEOF
15945 #line 15945 "configure"
15946 #include "confdefs.h"
15947
15948 int
15949 main ()
15950 {
15951
15952 #ifdef __INTEL_COMPILER
15953 #else
15954 make an error
15955 #endif
15956
15957   ;
15958   return 0;
15959 }
15960 _ACEOF
15961 rm -f conftest.$ac_objext
15962 if { (eval echo "$as_me:15962: \"$ac_compile\"") >&5
15963   (eval $ac_compile) 2>&5
15964   ac_status=$?
15965   echo "$as_me:15965: \$? = $ac_status" >&5
15966   (exit $ac_status); } &&
15967          { ac_try='test -s conftest.$ac_objext'
15968   { (eval echo "$as_me:15968: \"$ac_try\"") >&5
15969   (eval $ac_try) 2>&5
15970   ac_status=$?
15971   echo "$as_me:15971: \$? = $ac_status" >&5
15972   (exit $ac_status); }; }; then
15973   INTEL_COMPILER=yes
15974 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
15975
15976 else
15977   echo "$as_me: failed program was:" >&5
15978 cat conftest.$ac_ext >&5
15979 fi
15980 rm -f conftest.$ac_objext conftest.$ac_ext
15981                 CFLAGS="$cf_save_CFLAGS"
15982                 echo "$as_me:15982: result: $INTEL_COMPILER" >&5
15983 echo "${ECHO_T}$INTEL_COMPILER" >&6
15984                 ;;
15985         esac
15986 fi
15987
15988 CLANG_COMPILER=no
15989
15990 if test "$GCC" = yes ; then
15991         echo "$as_me:15991: checking if this is really Clang C compiler" >&5
15992 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
15993         cf_save_CFLAGS="$CFLAGS"
15994         CFLAGS="$CFLAGS -Qunused-arguments"
15995         cat >conftest.$ac_ext <<_ACEOF
15996 #line 15996 "configure"
15997 #include "confdefs.h"
15998
15999 int
16000 main ()
16001 {
16002
16003 #ifdef __clang__
16004 #else
16005 make an error
16006 #endif
16007
16008   ;
16009   return 0;
16010 }
16011 _ACEOF
16012 rm -f conftest.$ac_objext
16013 if { (eval echo "$as_me:16013: \"$ac_compile\"") >&5
16014   (eval $ac_compile) 2>&5
16015   ac_status=$?
16016   echo "$as_me:16016: \$? = $ac_status" >&5
16017   (exit $ac_status); } &&
16018          { ac_try='test -s conftest.$ac_objext'
16019   { (eval echo "$as_me:16019: \"$ac_try\"") >&5
16020   (eval $ac_try) 2>&5
16021   ac_status=$?
16022   echo "$as_me:16022: \$? = $ac_status" >&5
16023   (exit $ac_status); }; }; then
16024   CLANG_COMPILER=yes
16025 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
16026
16027 else
16028   echo "$as_me: failed program was:" >&5
16029 cat conftest.$ac_ext >&5
16030 fi
16031 rm -f conftest.$ac_objext conftest.$ac_ext
16032         CFLAGS="$cf_save_CFLAGS"
16033         echo "$as_me:16033: result: $CLANG_COMPILER" >&5
16034 echo "${ECHO_T}$CLANG_COMPILER" >&6
16035 fi
16036
16037 cat > conftest.$ac_ext <<EOF
16038 #line 16038 "${as_me:-configure}"
16039 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
16040 EOF
16041
16042 if test "$INTEL_COMPILER" = yes
16043 then
16044 # The "-wdXXX" options suppress warnings:
16045 # remark #1419: external declaration in primary source file
16046 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
16047 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
16048 # remark #193: zero used for undefined preprocessing identifier
16049 # remark #593: variable "curs_sb_left_arrow" was set but never used
16050 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
16051 # remark #869: parameter "tw" was never referenced
16052 # remark #981: operands are evaluated in unspecified order
16053 # warning #279: controlling expression is constant
16054
16055         { echo "$as_me:16055: checking for $CC warning options..." >&5
16056 echo "$as_me: checking for $CC warning options..." >&6;}
16057         cf_save_CFLAGS="$CFLAGS"
16058         EXTRA_CFLAGS="-Wall"
16059         for cf_opt in \
16060                 wd1419 \
16061                 wd1683 \
16062                 wd1684 \
16063                 wd193 \
16064                 wd593 \
16065                 wd279 \
16066                 wd810 \
16067                 wd869 \
16068                 wd981
16069         do
16070                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16071                 if { (eval echo "$as_me:16071: \"$ac_compile\"") >&5
16072   (eval $ac_compile) 2>&5
16073   ac_status=$?
16074   echo "$as_me:16074: \$? = $ac_status" >&5
16075   (exit $ac_status); }; then
16076                         test -n "$verbose" && echo "$as_me:16076: result: ... -$cf_opt" >&5
16077 echo "${ECHO_T}... -$cf_opt" >&6
16078                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16079                 fi
16080         done
16081         CFLAGS="$cf_save_CFLAGS"
16082
16083 elif test "$GCC" = yes
16084 then
16085         { echo "$as_me:16085: checking for $CC warning options..." >&5
16086 echo "$as_me: checking for $CC warning options..." >&6;}
16087         cf_save_CFLAGS="$CFLAGS"
16088         EXTRA_CFLAGS=
16089         cf_warn_CONST=""
16090         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
16091         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
16092         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
16093         for cf_opt in W Wall \
16094                 Wbad-function-cast \
16095                 Wcast-align \
16096                 Wcast-qual \
16097                 Wdeclaration-after-statement \
16098                 Wextra \
16099                 Winline \
16100                 Wmissing-declarations \
16101                 Wmissing-prototypes \
16102                 Wnested-externs \
16103                 Wpointer-arith \
16104                 Wshadow \
16105                 Wstrict-prototypes \
16106                 Wundef $cf_gcc_warnings $cf_warn_CONST
16107         do
16108                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16109                 if { (eval echo "$as_me:16109: \"$ac_compile\"") >&5
16110   (eval $ac_compile) 2>&5
16111   ac_status=$?
16112   echo "$as_me:16112: \$? = $ac_status" >&5
16113   (exit $ac_status); }; then
16114                         test -n "$verbose" && echo "$as_me:16114: result: ... -$cf_opt" >&5
16115 echo "${ECHO_T}... -$cf_opt" >&6
16116                         case $cf_opt in #(vi
16117                         Wcast-qual) #(vi
16118                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
16119                                 ;;
16120                         Winline) #(vi
16121                                 case $GCC_VERSION in
16122                                 [34].*)
16123                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16124
16125 echo "${as_me:-configure}:16125: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16126
16127                                         continue;;
16128                                 esac
16129                                 ;;
16130                         Wpointer-arith) #(vi
16131                                 case $GCC_VERSION in
16132                                 [12].*)
16133                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16134
16135 echo "${as_me:-configure}:16135: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16136
16137                                         continue;;
16138                                 esac
16139                                 ;;
16140                         esac
16141                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16142                 fi
16143         done
16144         CFLAGS="$cf_save_CFLAGS"
16145 fi
16146 rm -rf conftest*
16147
16148 fi
16149 fi
16150
16151 echo "$as_me:16151: checking if you want to use dmalloc for testing" >&5
16152 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
16153
16154 # Check whether --with-dmalloc or --without-dmalloc was given.
16155 if test "${with_dmalloc+set}" = set; then
16156   withval="$with_dmalloc"
16157
16158 cat >>confdefs.h <<EOF
16159 #define USE_DMALLOC 1
16160 EOF
16161
16162         : ${with_cflags:=-g}
16163         : ${with_no_leaks:=yes}
16164          with_dmalloc=yes
16165 else
16166   with_dmalloc=
16167 fi;
16168 echo "$as_me:16168: result: ${with_dmalloc:-no}" >&5
16169 echo "${ECHO_T}${with_dmalloc:-no}" >&6
16170
16171 case .$with_cflags in #(vi
16172 .*-g*)
16173         case .$CFLAGS in #(vi
16174         .*-g*) #(vi
16175                 ;;
16176         *)
16177
16178 cf_fix_cppflags=no
16179 cf_new_cflags=
16180 cf_new_cppflags=
16181 cf_new_extra_cppflags=
16182
16183 for cf_add_cflags in -g
16184 do
16185 case $cf_fix_cppflags in
16186 no)
16187         case $cf_add_cflags in #(vi
16188         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
16189                 case $cf_add_cflags in
16190                 -D*)
16191                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16192
16193                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16194                                 && test -z "${cf_tst_cflags}" \
16195                                 && cf_fix_cppflags=yes
16196
16197                         if test $cf_fix_cppflags = yes ; then
16198                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16199                                 continue
16200                         elif test "${cf_tst_cflags}" = "\"'" ; then
16201                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16202                                 continue
16203                         fi
16204                         ;;
16205                 esac
16206                 case "$CPPFLAGS" in
16207                 *$cf_add_cflags) #(vi
16208                         ;;
16209                 *) #(vi
16210                         case $cf_add_cflags in #(vi
16211                         -D*)
16212                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16213
16214 CPPFLAGS=`echo "$CPPFLAGS" | \
16215         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16216                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16217
16218                                 ;;
16219                         esac
16220                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16221                         ;;
16222                 esac
16223                 ;;
16224         *)
16225                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16226                 ;;
16227         esac
16228         ;;
16229 yes)
16230         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16231
16232         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16233
16234         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16235                 && test -z "${cf_tst_cflags}" \
16236                 && cf_fix_cppflags=no
16237         ;;
16238 esac
16239 done
16240
16241 if test -n "$cf_new_cflags" ; then
16242
16243         CFLAGS="$CFLAGS $cf_new_cflags"
16244 fi
16245
16246 if test -n "$cf_new_cppflags" ; then
16247
16248         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16249 fi
16250
16251 if test -n "$cf_new_extra_cppflags" ; then
16252
16253         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16254 fi
16255
16256                 ;;
16257         esac
16258         ;;
16259 esac
16260
16261 if test "$with_dmalloc" = yes ; then
16262         echo "$as_me:16262: checking for dmalloc.h" >&5
16263 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
16264 if test "${ac_cv_header_dmalloc_h+set}" = set; then
16265   echo $ECHO_N "(cached) $ECHO_C" >&6
16266 else
16267   cat >conftest.$ac_ext <<_ACEOF
16268 #line 16268 "configure"
16269 #include "confdefs.h"
16270 #include <dmalloc.h>
16271 _ACEOF
16272 if { (eval echo "$as_me:16272: \"$ac_cpp conftest.$ac_ext\"") >&5
16273   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16274   ac_status=$?
16275   egrep -v '^ *\+' conftest.er1 >conftest.err
16276   rm -f conftest.er1
16277   cat conftest.err >&5
16278   echo "$as_me:16278: \$? = $ac_status" >&5
16279   (exit $ac_status); } >/dev/null; then
16280   if test -s conftest.err; then
16281     ac_cpp_err=$ac_c_preproc_warn_flag
16282   else
16283     ac_cpp_err=
16284   fi
16285 else
16286   ac_cpp_err=yes
16287 fi
16288 if test -z "$ac_cpp_err"; then
16289   ac_cv_header_dmalloc_h=yes
16290 else
16291   echo "$as_me: failed program was:" >&5
16292   cat conftest.$ac_ext >&5
16293   ac_cv_header_dmalloc_h=no
16294 fi
16295 rm -f conftest.err conftest.$ac_ext
16296 fi
16297 echo "$as_me:16297: result: $ac_cv_header_dmalloc_h" >&5
16298 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
16299 if test $ac_cv_header_dmalloc_h = yes; then
16300
16301 echo "$as_me:16301: checking for dmalloc_debug in -ldmalloc" >&5
16302 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
16303 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
16304   echo $ECHO_N "(cached) $ECHO_C" >&6
16305 else
16306   ac_check_lib_save_LIBS=$LIBS
16307 LIBS="-ldmalloc  $LIBS"
16308 cat >conftest.$ac_ext <<_ACEOF
16309 #line 16309 "configure"
16310 #include "confdefs.h"
16311
16312 /* Override any gcc2 internal prototype to avoid an error.  */
16313 #ifdef __cplusplus
16314 extern "C"
16315 #endif
16316 /* We use char because int might match the return type of a gcc2
16317    builtin and then its argument prototype would still apply.  */
16318 char dmalloc_debug ();
16319 int
16320 main ()
16321 {
16322 dmalloc_debug ();
16323   ;
16324   return 0;
16325 }
16326 _ACEOF
16327 rm -f conftest.$ac_objext conftest$ac_exeext
16328 if { (eval echo "$as_me:16328: \"$ac_link\"") >&5
16329   (eval $ac_link) 2>&5
16330   ac_status=$?
16331   echo "$as_me:16331: \$? = $ac_status" >&5
16332   (exit $ac_status); } &&
16333          { ac_try='test -s conftest$ac_exeext'
16334   { (eval echo "$as_me:16334: \"$ac_try\"") >&5
16335   (eval $ac_try) 2>&5
16336   ac_status=$?
16337   echo "$as_me:16337: \$? = $ac_status" >&5
16338   (exit $ac_status); }; }; then
16339   ac_cv_lib_dmalloc_dmalloc_debug=yes
16340 else
16341   echo "$as_me: failed program was:" >&5
16342 cat conftest.$ac_ext >&5
16343 ac_cv_lib_dmalloc_dmalloc_debug=no
16344 fi
16345 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16346 LIBS=$ac_check_lib_save_LIBS
16347 fi
16348 echo "$as_me:16348: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
16349 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
16350 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
16351   cat >>confdefs.h <<EOF
16352 #define HAVE_LIBDMALLOC 1
16353 EOF
16354
16355   LIBS="-ldmalloc $LIBS"
16356
16357 fi
16358
16359 fi
16360
16361 fi
16362
16363 echo "$as_me:16363: checking if you want to use dbmalloc for testing" >&5
16364 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
16365
16366 # Check whether --with-dbmalloc or --without-dbmalloc was given.
16367 if test "${with_dbmalloc+set}" = set; then
16368   withval="$with_dbmalloc"
16369
16370 cat >>confdefs.h <<EOF
16371 #define USE_DBMALLOC 1
16372 EOF
16373
16374         : ${with_cflags:=-g}
16375         : ${with_no_leaks:=yes}
16376          with_dbmalloc=yes
16377 else
16378   with_dbmalloc=
16379 fi;
16380 echo "$as_me:16380: result: ${with_dbmalloc:-no}" >&5
16381 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
16382
16383 case .$with_cflags in #(vi
16384 .*-g*)
16385         case .$CFLAGS in #(vi
16386         .*-g*) #(vi
16387                 ;;
16388         *)
16389
16390 cf_fix_cppflags=no
16391 cf_new_cflags=
16392 cf_new_cppflags=
16393 cf_new_extra_cppflags=
16394
16395 for cf_add_cflags in -g
16396 do
16397 case $cf_fix_cppflags in
16398 no)
16399         case $cf_add_cflags in #(vi
16400         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
16401                 case $cf_add_cflags in
16402                 -D*)
16403                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16404
16405                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16406                                 && test -z "${cf_tst_cflags}" \
16407                                 && cf_fix_cppflags=yes
16408
16409                         if test $cf_fix_cppflags = yes ; then
16410                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16411                                 continue
16412                         elif test "${cf_tst_cflags}" = "\"'" ; then
16413                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16414                                 continue
16415                         fi
16416                         ;;
16417                 esac
16418                 case "$CPPFLAGS" in
16419                 *$cf_add_cflags) #(vi
16420                         ;;
16421                 *) #(vi
16422                         case $cf_add_cflags in #(vi
16423                         -D*)
16424                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16425
16426 CPPFLAGS=`echo "$CPPFLAGS" | \
16427         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16428                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16429
16430                                 ;;
16431                         esac
16432                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16433                         ;;
16434                 esac
16435                 ;;
16436         *)
16437                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16438                 ;;
16439         esac
16440         ;;
16441 yes)
16442         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16443
16444         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16445
16446         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16447                 && test -z "${cf_tst_cflags}" \
16448                 && cf_fix_cppflags=no
16449         ;;
16450 esac
16451 done
16452
16453 if test -n "$cf_new_cflags" ; then
16454
16455         CFLAGS="$CFLAGS $cf_new_cflags"
16456 fi
16457
16458 if test -n "$cf_new_cppflags" ; then
16459
16460         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16461 fi
16462
16463 if test -n "$cf_new_extra_cppflags" ; then
16464
16465         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16466 fi
16467
16468                 ;;
16469         esac
16470         ;;
16471 esac
16472
16473 if test "$with_dbmalloc" = yes ; then
16474         echo "$as_me:16474: checking for dbmalloc.h" >&5
16475 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
16476 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
16477   echo $ECHO_N "(cached) $ECHO_C" >&6
16478 else
16479   cat >conftest.$ac_ext <<_ACEOF
16480 #line 16480 "configure"
16481 #include "confdefs.h"
16482 #include <dbmalloc.h>
16483 _ACEOF
16484 if { (eval echo "$as_me:16484: \"$ac_cpp conftest.$ac_ext\"") >&5
16485   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16486   ac_status=$?
16487   egrep -v '^ *\+' conftest.er1 >conftest.err
16488   rm -f conftest.er1
16489   cat conftest.err >&5
16490   echo "$as_me:16490: \$? = $ac_status" >&5
16491   (exit $ac_status); } >/dev/null; then
16492   if test -s conftest.err; then
16493     ac_cpp_err=$ac_c_preproc_warn_flag
16494   else
16495     ac_cpp_err=
16496   fi
16497 else
16498   ac_cpp_err=yes
16499 fi
16500 if test -z "$ac_cpp_err"; then
16501   ac_cv_header_dbmalloc_h=yes
16502 else
16503   echo "$as_me: failed program was:" >&5
16504   cat conftest.$ac_ext >&5
16505   ac_cv_header_dbmalloc_h=no
16506 fi
16507 rm -f conftest.err conftest.$ac_ext
16508 fi
16509 echo "$as_me:16509: result: $ac_cv_header_dbmalloc_h" >&5
16510 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
16511 if test $ac_cv_header_dbmalloc_h = yes; then
16512
16513 echo "$as_me:16513: checking for debug_malloc in -ldbmalloc" >&5
16514 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
16515 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
16516   echo $ECHO_N "(cached) $ECHO_C" >&6
16517 else
16518   ac_check_lib_save_LIBS=$LIBS
16519 LIBS="-ldbmalloc  $LIBS"
16520 cat >conftest.$ac_ext <<_ACEOF
16521 #line 16521 "configure"
16522 #include "confdefs.h"
16523
16524 /* Override any gcc2 internal prototype to avoid an error.  */
16525 #ifdef __cplusplus
16526 extern "C"
16527 #endif
16528 /* We use char because int might match the return type of a gcc2
16529    builtin and then its argument prototype would still apply.  */
16530 char debug_malloc ();
16531 int
16532 main ()
16533 {
16534 debug_malloc ();
16535   ;
16536   return 0;
16537 }
16538 _ACEOF
16539 rm -f conftest.$ac_objext conftest$ac_exeext
16540 if { (eval echo "$as_me:16540: \"$ac_link\"") >&5
16541   (eval $ac_link) 2>&5
16542   ac_status=$?
16543   echo "$as_me:16543: \$? = $ac_status" >&5
16544   (exit $ac_status); } &&
16545          { ac_try='test -s conftest$ac_exeext'
16546   { (eval echo "$as_me:16546: \"$ac_try\"") >&5
16547   (eval $ac_try) 2>&5
16548   ac_status=$?
16549   echo "$as_me:16549: \$? = $ac_status" >&5
16550   (exit $ac_status); }; }; then
16551   ac_cv_lib_dbmalloc_debug_malloc=yes
16552 else
16553   echo "$as_me: failed program was:" >&5
16554 cat conftest.$ac_ext >&5
16555 ac_cv_lib_dbmalloc_debug_malloc=no
16556 fi
16557 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16558 LIBS=$ac_check_lib_save_LIBS
16559 fi
16560 echo "$as_me:16560: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
16561 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
16562 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
16563   cat >>confdefs.h <<EOF
16564 #define HAVE_LIBDBMALLOC 1
16565 EOF
16566
16567   LIBS="-ldbmalloc $LIBS"
16568
16569 fi
16570
16571 fi
16572
16573 fi
16574
16575 echo "$as_me:16575: checking if you want to use valgrind for testing" >&5
16576 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
16577
16578 # Check whether --with-valgrind or --without-valgrind was given.
16579 if test "${with_valgrind+set}" = set; then
16580   withval="$with_valgrind"
16581
16582 cat >>confdefs.h <<EOF
16583 #define USE_VALGRIND 1
16584 EOF
16585
16586         : ${with_cflags:=-g}
16587         : ${with_no_leaks:=yes}
16588          with_valgrind=yes
16589 else
16590   with_valgrind=
16591 fi;
16592 echo "$as_me:16592: result: ${with_valgrind:-no}" >&5
16593 echo "${ECHO_T}${with_valgrind:-no}" >&6
16594
16595 case .$with_cflags in #(vi
16596 .*-g*)
16597         case .$CFLAGS in #(vi
16598         .*-g*) #(vi
16599                 ;;
16600         *)
16601
16602 cf_fix_cppflags=no
16603 cf_new_cflags=
16604 cf_new_cppflags=
16605 cf_new_extra_cppflags=
16606
16607 for cf_add_cflags in -g
16608 do
16609 case $cf_fix_cppflags in
16610 no)
16611         case $cf_add_cflags in #(vi
16612         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
16613                 case $cf_add_cflags in
16614                 -D*)
16615                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16616
16617                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16618                                 && test -z "${cf_tst_cflags}" \
16619                                 && cf_fix_cppflags=yes
16620
16621                         if test $cf_fix_cppflags = yes ; then
16622                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16623                                 continue
16624                         elif test "${cf_tst_cflags}" = "\"'" ; then
16625                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16626                                 continue
16627                         fi
16628                         ;;
16629                 esac
16630                 case "$CPPFLAGS" in
16631                 *$cf_add_cflags) #(vi
16632                         ;;
16633                 *) #(vi
16634                         case $cf_add_cflags in #(vi
16635                         -D*)
16636                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16637
16638 CPPFLAGS=`echo "$CPPFLAGS" | \
16639         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16640                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16641
16642                                 ;;
16643                         esac
16644                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16645                         ;;
16646                 esac
16647                 ;;
16648         *)
16649                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16650                 ;;
16651         esac
16652         ;;
16653 yes)
16654         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16655
16656         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16657
16658         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16659                 && test -z "${cf_tst_cflags}" \
16660                 && cf_fix_cppflags=no
16661         ;;
16662 esac
16663 done
16664
16665 if test -n "$cf_new_cflags" ; then
16666
16667         CFLAGS="$CFLAGS $cf_new_cflags"
16668 fi
16669
16670 if test -n "$cf_new_cppflags" ; then
16671
16672         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16673 fi
16674
16675 if test -n "$cf_new_extra_cppflags" ; then
16676
16677         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16678 fi
16679
16680                 ;;
16681         esac
16682         ;;
16683 esac
16684
16685 echo "$as_me:16685: checking if you want to perform memory-leak testing" >&5
16686 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
16687
16688 # Check whether --enable-leaks or --disable-leaks was given.
16689 if test "${enable_leaks+set}" = set; then
16690   enableval="$enable_leaks"
16691   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
16692 else
16693   : ${with_no_leaks:=no}
16694 fi;
16695 echo "$as_me:16695: result: $with_no_leaks" >&5
16696 echo "${ECHO_T}$with_no_leaks" >&6
16697
16698 if test "$with_no_leaks" = yes ; then
16699
16700 cat >>confdefs.h <<\EOF
16701 #define NO_LEAKS 1
16702 EOF
16703
16704 cat >>confdefs.h <<\EOF
16705 #define YY_NO_LEAKS 1
16706 EOF
16707
16708 fi
16709
16710 LD_RPATH_OPT=
16711 echo "$as_me:16711: checking for an rpath option" >&5
16712 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
16713 case $cf_cv_system_name in #(vi
16714 irix*) #(vi
16715         if test "$GCC" = yes; then
16716                 LD_RPATH_OPT="-Wl,-rpath,"
16717         else
16718                 LD_RPATH_OPT="-rpath "
16719         fi
16720         ;;
16721 linux*|gnu*|k*bsd*-gnu) #(vi
16722         LD_RPATH_OPT="-Wl,-rpath,"
16723         ;;
16724 openbsd[2-9].*|mirbsd*) #(vi
16725         LD_RPATH_OPT="-Wl,-rpath,"
16726         ;;
16727 dragonfly*|freebsd*) #(vi
16728         LD_RPATH_OPT="-rpath "
16729         ;;
16730 netbsd*) #(vi
16731         LD_RPATH_OPT="-Wl,-rpath,"
16732         ;;
16733 osf*|mls+*) #(vi
16734         LD_RPATH_OPT="-rpath "
16735         ;;
16736 solaris2*) #(vi
16737         LD_RPATH_OPT="-R"
16738         ;;
16739 *)
16740         ;;
16741 esac
16742 echo "$as_me:16742: result: $LD_RPATH_OPT" >&5
16743 echo "${ECHO_T}$LD_RPATH_OPT" >&6
16744
16745 case "x$LD_RPATH_OPT" in #(vi
16746 x-R*)
16747         echo "$as_me:16747: checking if we need a space after rpath option" >&5
16748 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
16749         cf_save_LIBS="$LIBS"
16750
16751 cf_add_libs="${LD_RPATH_OPT}$libdir"
16752 # Filter out duplicates - this happens with badly-designed ".pc" files...
16753 for cf_add_1lib in $LIBS
16754 do
16755         for cf_add_2lib in $cf_add_libs
16756         do
16757                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16758                 then
16759                         cf_add_1lib=
16760                         break
16761                 fi
16762         done
16763         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16764 done
16765 LIBS="$cf_add_libs"
16766
16767         cat >conftest.$ac_ext <<_ACEOF
16768 #line 16768 "configure"
16769 #include "confdefs.h"
16770
16771 int
16772 main ()
16773 {
16774
16775   ;
16776   return 0;
16777 }
16778 _ACEOF
16779 rm -f conftest.$ac_objext conftest$ac_exeext
16780 if { (eval echo "$as_me:16780: \"$ac_link\"") >&5
16781   (eval $ac_link) 2>&5
16782   ac_status=$?
16783   echo "$as_me:16783: \$? = $ac_status" >&5
16784   (exit $ac_status); } &&
16785          { ac_try='test -s conftest$ac_exeext'
16786   { (eval echo "$as_me:16786: \"$ac_try\"") >&5
16787   (eval $ac_try) 2>&5
16788   ac_status=$?
16789   echo "$as_me:16789: \$? = $ac_status" >&5
16790   (exit $ac_status); }; }; then
16791   cf_rpath_space=no
16792 else
16793   echo "$as_me: failed program was:" >&5
16794 cat conftest.$ac_ext >&5
16795 cf_rpath_space=yes
16796 fi
16797 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16798         LIBS="$cf_save_LIBS"
16799         echo "$as_me:16799: result: $cf_rpath_space" >&5
16800 echo "${ECHO_T}$cf_rpath_space" >&6
16801         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
16802         ;;
16803 esac
16804
16805 echo "$as_me:16805: checking if rpath-hack should be disabled" >&5
16806 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
16807
16808 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
16809 if test "${enable_rpath_hack+set}" = set; then
16810   enableval="$enable_rpath_hack"
16811   test "$enableval" != no && enableval=yes
16812   if test "$enableval" != "yes" ; then
16813     cf_disable_rpath_hack=yes
16814   else
16815     cf_disable_rpath_hack=no
16816   fi
16817 else
16818   enableval=yes
16819   cf_disable_rpath_hack=no
16820
16821 fi;
16822 echo "$as_me:16822: result: $cf_disable_rpath_hack" >&5
16823 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
16824 if test "$cf_disable_rpath_hack" = no ; then
16825
16826 echo "$as_me:16826: checking for updated LDFLAGS" >&5
16827 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
16828 if test -n "$LD_RPATH_OPT" ; then
16829         echo "$as_me:16829: result: maybe" >&5
16830 echo "${ECHO_T}maybe" >&6
16831
16832         for ac_prog in ldd
16833 do
16834   # Extract the first word of "$ac_prog", so it can be a program name with args.
16835 set dummy $ac_prog; ac_word=$2
16836 echo "$as_me:16836: checking for $ac_word" >&5
16837 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16838 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
16839   echo $ECHO_N "(cached) $ECHO_C" >&6
16840 else
16841   if test -n "$cf_ldd_prog"; then
16842   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
16843 else
16844   ac_save_IFS=$IFS; IFS=$ac_path_separator
16845 ac_dummy="$PATH"
16846 for ac_dir in $ac_dummy; do
16847   IFS=$ac_save_IFS
16848   test -z "$ac_dir" && ac_dir=.
16849   $as_executable_p "$ac_dir/$ac_word" || continue
16850 ac_cv_prog_cf_ldd_prog="$ac_prog"
16851 echo "$as_me:16851: found $ac_dir/$ac_word" >&5
16852 break
16853 done
16854
16855 fi
16856 fi
16857 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
16858 if test -n "$cf_ldd_prog"; then
16859   echo "$as_me:16859: result: $cf_ldd_prog" >&5
16860 echo "${ECHO_T}$cf_ldd_prog" >&6
16861 else
16862   echo "$as_me:16862: result: no" >&5
16863 echo "${ECHO_T}no" >&6
16864 fi
16865
16866   test -n "$cf_ldd_prog" && break
16867 done
16868 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
16869
16870         cf_rpath_list="/usr/lib /lib"
16871         if test "$cf_ldd_prog" != no
16872         then
16873                 cf_rpath_oops=
16874
16875 cat >conftest.$ac_ext <<_ACEOF
16876 #line 16876 "configure"
16877 #include "confdefs.h"
16878 #include <stdio.h>
16879 int
16880 main ()
16881 {
16882 printf("Hello");
16883   ;
16884   return 0;
16885 }
16886 _ACEOF
16887 rm -f conftest.$ac_objext conftest$ac_exeext
16888 if { (eval echo "$as_me:16888: \"$ac_link\"") >&5
16889   (eval $ac_link) 2>&5
16890   ac_status=$?
16891   echo "$as_me:16891: \$? = $ac_status" >&5
16892   (exit $ac_status); } &&
16893          { ac_try='test -s conftest$ac_exeext'
16894   { (eval echo "$as_me:16894: \"$ac_try\"") >&5
16895   (eval $ac_try) 2>&5
16896   ac_status=$?
16897   echo "$as_me:16897: \$? = $ac_status" >&5
16898   (exit $ac_status); }; }; then
16899   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
16900                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
16901 else
16902   echo "$as_me: failed program was:" >&5
16903 cat conftest.$ac_ext >&5
16904 fi
16905 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16906
16907                 # If we passed the link-test, but get a "not found" on a given library,
16908                 # this could be due to inept reconfiguration of gcc to make it only
16909                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
16910                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
16911                 # /usr/local libraries.
16912                 if test -n "$cf_rpath_oops"
16913                 then
16914                         for cf_rpath_src in $cf_rpath_oops
16915                         do
16916                                 for cf_rpath_dir in \
16917                                         /usr/local \
16918                                         /usr/pkg \
16919                                         /opt/sfw
16920                                 do
16921                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
16922                                         then
16923                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
16924
16925 echo "${as_me:-configure}:16925: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
16926
16927                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
16928                                                 break
16929                                         fi
16930                                 done
16931                         done
16932                 fi
16933         fi
16934
16935         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16936
16937 echo "${as_me:-configure}:16937: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16938
16939 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
16940
16941 echo "${as_me:-configure}:16941: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
16942
16943 cf_rpath_dst=
16944 for cf_rpath_src in $LDFLAGS
16945 do
16946         case $cf_rpath_src in #(vi
16947         -L*) #(vi
16948
16949                 # check if this refers to a directory which we will ignore
16950                 cf_rpath_skip=no
16951                 if test -n "$cf_rpath_list"
16952                 then
16953                         for cf_rpath_item in $cf_rpath_list
16954                         do
16955                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16956                                 then
16957                                         cf_rpath_skip=yes
16958                                         break
16959                                 fi
16960                         done
16961                 fi
16962
16963                 if test "$cf_rpath_skip" = no
16964                 then
16965                         # transform the option
16966                         if test "$LD_RPATH_OPT" = "-R " ; then
16967                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16968                         else
16969                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16970                         fi
16971
16972                         # if we have not already added this, add it now
16973                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16974                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16975                         then
16976                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16977
16978 echo "${as_me:-configure}:16978: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16979
16980                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16981                         fi
16982                 fi
16983                 ;;
16984         esac
16985         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16986 done
16987 LDFLAGS=$cf_rpath_dst
16988
16989 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
16990
16991 echo "${as_me:-configure}:16991: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
16992
16993 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
16994
16995 echo "${as_me:-configure}:16995: testing ...checking LIBS $LIBS ..." 1>&5
16996
16997 cf_rpath_dst=
16998 for cf_rpath_src in $LIBS
16999 do
17000         case $cf_rpath_src in #(vi
17001         -L*) #(vi
17002
17003                 # check if this refers to a directory which we will ignore
17004                 cf_rpath_skip=no
17005                 if test -n "$cf_rpath_list"
17006                 then
17007                         for cf_rpath_item in $cf_rpath_list
17008                         do
17009                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
17010                                 then
17011                                         cf_rpath_skip=yes
17012                                         break
17013                                 fi
17014                         done
17015                 fi
17016
17017                 if test "$cf_rpath_skip" = no
17018                 then
17019                         # transform the option
17020                         if test "$LD_RPATH_OPT" = "-R " ; then
17021                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
17022                         else
17023                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
17024                         fi
17025
17026                         # if we have not already added this, add it now
17027                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
17028                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
17029                         then
17030                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
17031
17032 echo "${as_me:-configure}:17032: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
17033
17034                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
17035                         fi
17036                 fi
17037                 ;;
17038         esac
17039         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
17040 done
17041 LIBS=$cf_rpath_dst
17042
17043 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
17044
17045 echo "${as_me:-configure}:17045: testing ...checked LIBS $LIBS ..." 1>&5
17046
17047         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
17048
17049 echo "${as_me:-configure}:17049: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
17050
17051 else
17052         echo "$as_me:17052: result: no" >&5
17053 echo "${ECHO_T}no" >&6
17054 fi
17055
17056 fi
17057
17058 TEST_ARGS="$LIBS"
17059 LIBS=
17060
17061 ac_config_files="$ac_config_files Makefile"
17062 ac_config_commands="$ac_config_commands default"
17063 cat >confcache <<\_ACEOF
17064 # This file is a shell script that caches the results of configure
17065 # tests run on this system so they can be shared between configure
17066 # scripts and configure runs, see configure's option --config-cache.
17067 # It is not useful on other systems.  If it contains results you don't
17068 # want to keep, you may remove or edit it.
17069 #
17070 # config.status only pays attention to the cache file if you give it
17071 # the --recheck option to rerun configure.
17072 #
17073 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17074 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17075 # following values.
17076
17077 _ACEOF
17078
17079 # The following way of writing the cache mishandles newlines in values,
17080 # but we know of no workaround that is simple, portable, and efficient.
17081 # So, don't put newlines in cache variables' values.
17082 # Ultrix sh set writes to stderr and can't be redirected directly,
17083 # and sets the high bit in the cache file unless we assign to the vars.
17084 {
17085   (set) 2>&1 |
17086     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17087     *ac_space=\ *)
17088       # `set' does not quote correctly, so add quotes (double-quote
17089       # substitution turns \\\\ into \\, and sed turns \\ into \).
17090       sed -n \
17091         "s/'/'\\\\''/g;
17092           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17093       ;;
17094     *)
17095       # `set' quotes correctly as required by POSIX, so do not add quotes.
17096       sed -n \
17097         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17098       ;;
17099     esac;
17100 } |
17101   sed '
17102      t clear
17103      : clear
17104      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17105      t end
17106      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17107      : end' >>confcache
17108 if cmp -s $cache_file confcache; then :; else
17109   if test -w $cache_file; then
17110     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17111     cat confcache >$cache_file
17112   else
17113     echo "not updating unwritable cache $cache_file"
17114   fi
17115 fi
17116 rm -f confcache
17117
17118 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17119 # Let make expand exec_prefix.
17120 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17121
17122 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17123 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17124 # trailing colons and then remove the whole line if VPATH becomes empty
17125 # (actually we leave an empty line to preserve line numbers).
17126 if test "x$srcdir" = x.; then
17127   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17128 s/:*\$(srcdir):*/:/;
17129 s/:*\${srcdir}:*/:/;
17130 s/:*@srcdir@:*/:/;
17131 s/^\([^=]*=[    ]*\):*/\1/;
17132 s/:*$//;
17133 s/^[^=]*=[      ]*$//;
17134 }'
17135 fi
17136
17137 DEFS=-DHAVE_CONFIG_H
17138
17139 : ${CONFIG_STATUS=./config.status}
17140 ac_clean_files_save=$ac_clean_files
17141 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17142 { echo "$as_me:17142: creating $CONFIG_STATUS" >&5
17143 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17144 cat >$CONFIG_STATUS <<_ACEOF
17145 #! $SHELL
17146 # Generated automatically by configure.
17147 # Run this file to recreate the current configuration.
17148 # Compiler output produced by configure, useful for debugging
17149 # configure, is in config.log if it exists.
17150
17151 debug=false
17152 SHELL=\${CONFIG_SHELL-$SHELL}
17153 ac_cs_invocation="\$0 \$@"
17154
17155 _ACEOF
17156
17157 cat >>$CONFIG_STATUS <<\_ACEOF
17158 # Be Bourne compatible
17159 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17160   emulate sh
17161   NULLCMD=:
17162 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17163   set -o posix
17164 fi
17165
17166 # Name of the executable.
17167 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17168
17169 if expr a : '\(a\)' >/dev/null 2>&1; then
17170   as_expr=expr
17171 else
17172   as_expr=false
17173 fi
17174
17175 rm -f conf$$ conf$$.exe conf$$.file
17176 echo >conf$$.file
17177 if ln -s conf$$.file conf$$ 2>/dev/null; then
17178   # We could just check for DJGPP; but this test a) works b) is more generic
17179   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17180   if test -f conf$$.exe; then
17181     # Don't use ln at all; we don't have any links
17182     as_ln_s='cp -p'
17183   else
17184     as_ln_s='ln -s'
17185   fi
17186 elif ln conf$$.file conf$$ 2>/dev/null; then
17187   as_ln_s=ln
17188 else
17189   as_ln_s='cp -p'
17190 fi
17191 rm -f conf$$ conf$$.exe conf$$.file
17192
17193 as_executable_p="test -f"
17194
17195 # Support unset when possible.
17196 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17197   as_unset=unset
17198 else
17199   as_unset=false
17200 fi
17201
17202 # NLS nuisances.
17203 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17204 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17205 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17206 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17207 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17208 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17209 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17210 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17211
17212 # IFS
17213 # We need space, tab and new line, in precisely that order.
17214 as_nl='
17215 '
17216 IFS="   $as_nl"
17217
17218 # CDPATH.
17219 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17220
17221 exec 6>&1
17222
17223 _ACEOF
17224
17225 # Files that config.status was made for.
17226 if test -n "$ac_config_files"; then
17227   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
17228 fi
17229
17230 if test -n "$ac_config_headers"; then
17231   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
17232 fi
17233
17234 if test -n "$ac_config_links"; then
17235   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
17236 fi
17237
17238 if test -n "$ac_config_commands"; then
17239   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
17240 fi
17241
17242 cat >>$CONFIG_STATUS <<\EOF
17243
17244 ac_cs_usage="\
17245 \`$as_me' instantiates files from templates according to the
17246 current configuration.
17247
17248 Usage: $0 [OPTIONS] [FILE]...
17249
17250   -h, --help       print this help, then exit
17251   -V, --version    print version number, then exit
17252   -d, --debug      don't remove temporary files
17253       --recheck    update $as_me by reconfiguring in the same conditions
17254   --file=FILE[:TEMPLATE]
17255                    instantiate the configuration file FILE
17256   --header=FILE[:TEMPLATE]
17257                    instantiate the configuration header FILE
17258
17259 Configuration files:
17260 $config_files
17261
17262 Configuration headers:
17263 $config_headers
17264
17265 Configuration commands:
17266 $config_commands
17267
17268 Report bugs to <dickey@invisible-island.net>."
17269 EOF
17270
17271 cat >>$CONFIG_STATUS <<EOF
17272 ac_cs_version="\\
17273 config.status
17274 configured by $0, generated by GNU Autoconf 2.52.20121002,
17275   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17276
17277 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17278 Free Software Foundation, Inc.
17279 This config.status script is free software; the Free Software Foundation
17280 gives unlimited permission to copy, distribute and modify it."
17281 srcdir=$srcdir
17282 INSTALL="$INSTALL"
17283 EOF
17284
17285 cat >>$CONFIG_STATUS <<\EOF
17286 # If no file are specified by the user, then we need to provide default
17287 # value.  By we need to know if files were specified by the user.
17288 ac_need_defaults=:
17289 while test $# != 0
17290 do
17291   case $1 in
17292   --*=*)
17293     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17294     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17295     shift
17296     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17297     shift
17298     ;;
17299   -*);;
17300   *) # This is not an option, so the user has probably given explicit
17301      # arguments.
17302      ac_need_defaults=false;;
17303   esac
17304
17305   case $1 in
17306   # Handling of the options.
17307 EOF
17308 cat >>$CONFIG_STATUS <<EOF
17309   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17310     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
17311     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
17312 EOF
17313 cat >>$CONFIG_STATUS <<\EOF
17314   --version | --vers* | -V )
17315     echo "$ac_cs_version"; exit 0 ;;
17316   --he | --h)
17317     # Conflict between --help and --header
17318     { { echo "$as_me:17318: error: ambiguous option: $1
17319 Try \`$0 --help' for more information." >&5
17320 echo "$as_me: error: ambiguous option: $1
17321 Try \`$0 --help' for more information." >&2;}
17322    { (exit 1); exit 1; }; };;
17323   --help | --hel | -h )
17324     echo "$ac_cs_usage"; exit 0 ;;
17325   --debug | --d* | -d )
17326     debug=: ;;
17327   --file | --fil | --fi | --f )
17328     shift
17329     CONFIG_FILES="$CONFIG_FILES $1"
17330     ac_need_defaults=false;;
17331   --header | --heade | --head | --hea )
17332     shift
17333     CONFIG_HEADERS="$CONFIG_HEADERS $1"
17334     ac_need_defaults=false;;
17335
17336   # This is an error.
17337   -*) { { echo "$as_me:17337: error: unrecognized option: $1
17338 Try \`$0 --help' for more information." >&5
17339 echo "$as_me: error: unrecognized option: $1
17340 Try \`$0 --help' for more information." >&2;}
17341    { (exit 1); exit 1; }; } ;;
17342
17343   *) ac_config_targets="$ac_config_targets $1" ;;
17344
17345   esac
17346   shift
17347 done
17348
17349 exec 5>>config.log
17350 cat >&5 << _ACEOF
17351
17352 ## ----------------------- ##
17353 ## Running config.status.  ##
17354 ## ----------------------- ##
17355
17356 This file was extended by $as_me 2.52.20121002, executed with
17357   CONFIG_FILES    = $CONFIG_FILES
17358   CONFIG_HEADERS  = $CONFIG_HEADERS
17359   CONFIG_LINKS    = $CONFIG_LINKS
17360   CONFIG_COMMANDS = $CONFIG_COMMANDS
17361   > $ac_cs_invocation
17362 on `(hostname || uname -n) 2>/dev/null | sed 1q`
17363
17364 _ACEOF
17365 EOF
17366
17367 cat >>$CONFIG_STATUS <<EOF
17368 #
17369 # INIT-COMMANDS section.
17370 #
17371
17372 AWK="$AWK"
17373 ECHO_CC="$ECHO_CC"
17374 ECHO_LD="$ECHO_LD"
17375 SHOW_CC="$SHOW_LD"
17376
17377 EOF
17378
17379 cat >>$CONFIG_STATUS <<\EOF
17380 for ac_config_target in $ac_config_targets
17381 do
17382   case "$ac_config_target" in
17383   # Handling of arguments.
17384   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
17385   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
17386   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
17387   *) { { echo "$as_me:17387: error: invalid argument: $ac_config_target" >&5
17388 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
17389    { (exit 1); exit 1; }; };;
17390   esac
17391 done
17392
17393 # If the user did not use the arguments to specify the items to instantiate,
17394 # then the envvar interface is used.  Set only those that are not.
17395 # We use the long form for the default assignment because of an extremely
17396 # bizarre bug on SunOS 4.1.3.
17397 if $ac_need_defaults; then
17398   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
17399   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
17400   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
17401 fi
17402
17403 # Create a temporary directory, and hook for its removal unless debugging.
17404 $debug ||
17405 {
17406   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
17407   trap '{ (exit 1); exit 1; }' 1 2 13 15
17408 }
17409
17410 # Create a (secure) tmp directory for tmp files.
17411 : ${TMPDIR=/tmp}
17412 {
17413   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
17414   test -n "$tmp" && test -d "$tmp"
17415 }  ||
17416 {
17417   tmp=$TMPDIR/cs$$-$RANDOM
17418   (umask 077 && mkdir $tmp)
17419 } ||
17420 {
17421    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
17422    { (exit 1); exit 1; }
17423 }
17424
17425 EOF
17426
17427 cat >>$CONFIG_STATUS <<EOF
17428
17429 #
17430 # CONFIG_FILES section.
17431 #
17432
17433 # No need to generate the scripts if there are no CONFIG_FILES.
17434 # This happens for instance when ./config.status config.h
17435 if test -n "\$CONFIG_FILES"; then
17436   # Protect against being on the right side of a sed subst in config.status.
17437   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
17438    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
17439 s,@SHELL@,$SHELL,;t t
17440 s,@exec_prefix@,$exec_prefix,;t t
17441 s,@prefix@,$prefix,;t t
17442 s,@program_transform_name@,$program_transform_name,;t t
17443 s,@bindir@,$bindir,;t t
17444 s,@sbindir@,$sbindir,;t t
17445 s,@libexecdir@,$libexecdir,;t t
17446 s,@datarootdir@,$datarootdir,;t t
17447 s,@datadir@,$datadir,;t t
17448 s,@sysconfdir@,$sysconfdir,;t t
17449 s,@sharedstatedir@,$sharedstatedir,;t t
17450 s,@localstatedir@,$localstatedir,;t t
17451 s,@libdir@,$libdir,;t t
17452 s,@includedir@,$includedir,;t t
17453 s,@oldincludedir@,$oldincludedir,;t t
17454 s,@infodir@,$infodir,;t t
17455 s,@mandir@,$mandir,;t t
17456 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
17457 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
17458 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
17459 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
17460 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
17461 s,@build_alias@,$build_alias,;t t
17462 s,@host_alias@,$host_alias,;t t
17463 s,@target_alias@,$target_alias,;t t
17464 s,@ECHO_C@,$ECHO_C,;t t
17465 s,@ECHO_N@,$ECHO_N,;t t
17466 s,@ECHO_T@,$ECHO_T,;t t
17467 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
17468 s,@DEFS@,$DEFS,;t t
17469 s,@LIBS@,$LIBS,;t t
17470 s,@build@,$build,;t t
17471 s,@build_cpu@,$build_cpu,;t t
17472 s,@build_vendor@,$build_vendor,;t t
17473 s,@build_os@,$build_os,;t t
17474 s,@host@,$host,;t t
17475 s,@host_cpu@,$host_cpu,;t t
17476 s,@host_vendor@,$host_vendor,;t t
17477 s,@host_os@,$host_os,;t t
17478 s,@SET_MAKE@,$SET_MAKE,;t t
17479 s,@CC@,$CC,;t t
17480 s,@CFLAGS@,$CFLAGS,;t t
17481 s,@LDFLAGS@,$LDFLAGS,;t t
17482 s,@CPPFLAGS@,$CPPFLAGS,;t t
17483 s,@ac_ct_CC@,$ac_ct_CC,;t t
17484 s,@EXEEXT@,$EXEEXT,;t t
17485 s,@OBJEXT@,$OBJEXT,;t t
17486 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
17487 s,@CPP@,$CPP,;t t
17488 s,@AWK@,$AWK,;t t
17489 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
17490 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
17491 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
17492 s,@LINT@,$LINT,;t t
17493 s,@LINT_OPTS@,$LINT_OPTS,;t t
17494 s,@CTAGS@,$CTAGS,;t t
17495 s,@ETAGS@,$ETAGS,;t t
17496 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
17497 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
17498 s,@MATH_LIB@,$MATH_LIB,;t t
17499 s,@top_builddir@,$top_builddir,;t t
17500 s,@CC_G_OPT@,$CC_G_OPT,;t t
17501 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
17502 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
17503 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
17504 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
17505 s,@LD@,$LD,;t t
17506 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
17507 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
17508 s,@LD_MODEL@,$LD_MODEL,;t t
17509 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
17510 s,@LIBTOOL@,$LIBTOOL,;t t
17511 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
17512 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
17513 s,@LIB_LINK@,$LIB_LINK,;t t
17514 s,@LINK_TESTS@,$LINK_TESTS,;t t
17515 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
17516 s,@PTHREAD@,$PTHREAD,;t t
17517 s,@TEST_ARGS@,$TEST_ARGS,;t t
17518 s,@TEST_DEPS@,$TEST_DEPS,;t t
17519 s,@TEST_LIBS@,$TEST_LIBS,;t t
17520 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
17521 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
17522 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
17523 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
17524 s,@includesubdir@,$includesubdir,;t t
17525 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
17526 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
17527 s,@ECHO_LT@,$ECHO_LT,;t t
17528 s,@ECHO_LD@,$ECHO_LD,;t t
17529 s,@RULE_CC@,$RULE_CC,;t t
17530 s,@SHOW_CC@,$SHOW_CC,;t t
17531 s,@ECHO_CC@,$ECHO_CC,;t t
17532 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
17533 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
17534 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
17535 s,@X_CFLAGS@,$X_CFLAGS,;t t
17536 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
17537 s,@X_LIBS@,$X_LIBS,;t t
17538 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
17539 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
17540 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
17541 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
17542 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
17543 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
17544 CEOF
17545
17546 EOF
17547
17548   cat >>$CONFIG_STATUS <<\EOF
17549   # Split the substitutions into bite-sized pieces for seds with
17550   # small command number limits, like on Digital OSF/1 and HP-UX.
17551   ac_max_sed_lines=48
17552   ac_sed_frag=1 # Number of current file.
17553   ac_beg=1 # First line for current file.
17554   ac_end=$ac_max_sed_lines # Line after last line for current file.
17555   ac_more_lines=:
17556   ac_sed_cmds=
17557   while $ac_more_lines; do
17558     if test $ac_beg -gt 1; then
17559       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17560     else
17561       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17562     fi
17563     if test ! -s $tmp/subs.frag; then
17564       ac_more_lines=false
17565     else
17566       # The purpose of the label and of the branching condition is to
17567       # speed up the sed processing (if there are no `@' at all, there
17568       # is no need to browse any of the substitutions).
17569       # These are the two extra sed commands mentioned above.
17570       (echo ':t
17571   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
17572       if test -z "$ac_sed_cmds"; then
17573         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
17574       else
17575         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
17576       fi
17577       ac_sed_frag=`expr $ac_sed_frag + 1`
17578       ac_beg=$ac_end
17579       ac_end=`expr $ac_end + $ac_max_sed_lines`
17580     fi
17581   done
17582   if test -z "$ac_sed_cmds"; then
17583     ac_sed_cmds=cat
17584   fi
17585 fi # test -n "$CONFIG_FILES"
17586
17587 EOF
17588 cat >>$CONFIG_STATUS <<\EOF
17589 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
17590   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17591   case $ac_file in
17592   - | *:- | *:-:* ) # input from stdin
17593         cat >$tmp/stdin
17594         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17595         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17596   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17597         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17598   * )   ac_file_in=$ac_file.in ;;
17599   esac
17600
17601   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
17602   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17603          X"$ac_file" : 'X\(//\)[^/]' \| \
17604          X"$ac_file" : 'X\(//\)$' \| \
17605          X"$ac_file" : 'X\(/\)' \| \
17606          .     : '\(.\)' 2>/dev/null ||
17607 echo X"$ac_file" |
17608     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17609           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17610           /^X\(\/\/\)$/{ s//\1/; q; }
17611           /^X\(\/\).*/{ s//\1/; q; }
17612           s/.*/./; q'`
17613   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17614     { case "$ac_dir" in
17615   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17616   *)                      as_incr_dir=.;;
17617 esac
17618 as_dummy="$ac_dir"
17619 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17620   case $as_mkdir_dir in
17621     # Skip DOS drivespec
17622     ?:) as_incr_dir=$as_mkdir_dir ;;
17623     *)
17624       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17625       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17626     ;;
17627   esac
17628 done; }
17629
17630     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
17631     # A "../" for each directory in $ac_dir_suffix.
17632     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
17633   else
17634     ac_dir_suffix= ac_dots=
17635   fi
17636
17637   case $srcdir in
17638   .)  ac_srcdir=.
17639       if test -z "$ac_dots"; then
17640          ac_top_srcdir=.
17641       else
17642          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
17643       fi ;;
17644   [\\/]* | ?:[\\/]* )
17645       ac_srcdir=$srcdir$ac_dir_suffix;
17646       ac_top_srcdir=$srcdir ;;
17647   *) # Relative path.
17648     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
17649     ac_top_srcdir=$ac_dots$srcdir ;;
17650   esac
17651
17652   case $INSTALL in
17653   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
17654   *) ac_INSTALL=$ac_dots$INSTALL ;;
17655   esac
17656
17657   if test x"$ac_file" != x-; then
17658     { echo "$as_me:17658: creating $ac_file" >&5
17659 echo "$as_me: creating $ac_file" >&6;}
17660     rm -f "$ac_file"
17661   fi
17662   # Let's still pretend it is `configure' which instantiates (i.e., don't
17663   # use $as_me), people would be surprised to read:
17664   #    /* config.h.  Generated automatically by config.status.  */
17665   configure_input="Generated automatically from `echo $ac_file_in |
17666                                                  sed 's,.*/,,'` by configure."
17667
17668   # First look for the input files in the build tree, otherwise in the
17669   # src tree.
17670   ac_file_inputs=`IFS=:
17671     for f in $ac_file_in; do
17672       case $f in
17673       -) echo $tmp/stdin ;;
17674       [\\/$]*)
17675          # Absolute (can't be DOS-style, as IFS=:)
17676          test -f "$f" || { { echo "$as_me:17676: error: cannot find input file: $f" >&5
17677 echo "$as_me: error: cannot find input file: $f" >&2;}
17678    { (exit 1); exit 1; }; }
17679          echo $f;;
17680       *) # Relative
17681          if test -f "$f"; then
17682            # Build tree
17683            echo $f
17684          elif test -f "$srcdir/$f"; then
17685            # Source tree
17686            echo $srcdir/$f
17687          else
17688            # /dev/null tree
17689            { { echo "$as_me:17689: error: cannot find input file: $f" >&5
17690 echo "$as_me: error: cannot find input file: $f" >&2;}
17691    { (exit 1); exit 1; }; }
17692          fi;;
17693       esac
17694     done` || { (exit 1); exit 1; }
17695 EOF
17696 cat >>$CONFIG_STATUS <<\EOF
17697   ac_warn_datarootdir=no
17698   if test x"$ac_file" != x-; then
17699     for ac_item in $ac_file_inputs
17700     do
17701       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
17702       if test -n "$ac_seen"; then
17703         ac_used=`grep '@datarootdir@' $ac_item`
17704         if test -z "$ac_used"; then
17705           { echo "$as_me:17705: WARNING: datarootdir was used implicitly but not set:
17706 $ac_seen" >&5
17707 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
17708 $ac_seen" >&2;}
17709           ac_warn_datarootdir=yes
17710         fi
17711       fi
17712       ac_seen=`grep '${datarootdir}' $ac_item`
17713       if test -n "$ac_seen"; then
17714         { echo "$as_me:17714: WARNING: datarootdir was used explicitly but not set:
17715 $ac_seen" >&5
17716 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
17717 $ac_seen" >&2;}
17718         ac_warn_datarootdir=yes
17719       fi
17720     done
17721   fi
17722
17723 if test "x$ac_warn_datarootdir" = xyes; then
17724   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
17725 fi
17726
17727 EOF
17728 cat >>$CONFIG_STATUS <<EOF
17729   sed "$ac_vpsub
17730 $extrasub
17731 EOF
17732 cat >>$CONFIG_STATUS <<\EOF
17733 :t
17734 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17735 s,@configure_input@,$configure_input,;t t
17736 s,@srcdir@,$ac_srcdir,;t t
17737 s,@top_srcdir@,$ac_top_srcdir,;t t
17738 s,@INSTALL@,$ac_INSTALL,;t t
17739 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
17740   rm -f $tmp/stdin
17741   if test x"$ac_file" != x-; then
17742     cp $tmp/out $ac_file
17743
17744     for ac_name in prefix exec_prefix datarootdir
17745     do
17746         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
17747         if test -n "$ac_seen"; then
17748             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
17749             if test -z "$ac_init"; then
17750               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
17751               { echo "$as_me:17751: WARNING: Variable $ac_name is used but was not set:
17752 $ac_seen" >&5
17753 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
17754 $ac_seen" >&2;}
17755             fi
17756         fi
17757     done
17758     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
17759     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
17760     if test -s $tmp/out; then
17761       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
17762       { echo "$as_me:17762: WARNING: Some variables may not be substituted:
17763 $ac_seen" >&5
17764 echo "$as_me: WARNING: Some variables may not be substituted:
17765 $ac_seen" >&2;}
17766     fi
17767   else
17768     cat $tmp/out
17769   fi
17770   rm -f $tmp/out
17771
17772 done
17773 EOF
17774 cat >>$CONFIG_STATUS <<\EOF
17775
17776 #
17777 # CONFIG_HEADER section.
17778 #
17779
17780 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17781 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17782 #
17783 # ac_d sets the value in "#define NAME VALUE" lines.
17784 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17785 ac_dB='[        ].*$,\1#\2'
17786 ac_dC=' '
17787 ac_dD=',;t'
17788 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17789 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17790 ac_iB='\([      ]\),\1#\2define\3'
17791 ac_iC=' '
17792 ac_iD='\4,;t'
17793 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17794 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17795 ac_uB='$,\1#\2define\3'
17796 ac_uC=' '
17797 ac_uD=',;t'
17798
17799 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
17800   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17801   case $ac_file in
17802   - | *:- | *:-:* ) # input from stdin
17803         cat >$tmp/stdin
17804         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17805         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17806   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17807         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17808   * )   ac_file_in=$ac_file.in ;;
17809   esac
17810
17811   test x"$ac_file" != x- && { echo "$as_me:17811: creating $ac_file" >&5
17812 echo "$as_me: creating $ac_file" >&6;}
17813
17814   # First look for the input files in the build tree, otherwise in the
17815   # src tree.
17816   ac_file_inputs=`IFS=:
17817     for f in $ac_file_in; do
17818       case $f in
17819       -) echo $tmp/stdin ;;
17820       [\\/$]*)
17821          # Absolute (can't be DOS-style, as IFS=:)
17822          test -f "$f" || { { echo "$as_me:17822: error: cannot find input file: $f" >&5
17823 echo "$as_me: error: cannot find input file: $f" >&2;}
17824    { (exit 1); exit 1; }; }
17825          echo $f;;
17826       *) # Relative
17827          if test -f "$f"; then
17828            # Build tree
17829            echo $f
17830          elif test -f "$srcdir/$f"; then
17831            # Source tree
17832            echo $srcdir/$f
17833          else
17834            # /dev/null tree
17835            { { echo "$as_me:17835: error: cannot find input file: $f" >&5
17836 echo "$as_me: error: cannot find input file: $f" >&2;}
17837    { (exit 1); exit 1; }; }
17838          fi;;
17839       esac
17840     done` || { (exit 1); exit 1; }
17841   # Remove the trailing spaces.
17842   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
17843
17844 EOF
17845
17846 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
17847 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
17848 # be either 'cat' or 'sort'.
17849 cat confdefs.h | uniq >conftest.vals
17850
17851 # Break up conftest.vals because some shells have a limit on
17852 # the size of here documents, and old seds have small limits too.
17853
17854 rm -f conftest.tail
17855 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
17856 while grep . conftest.vals >/dev/null
17857 do
17858   # Write chunks of a limited-size here document to conftest.frag.
17859   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
17860   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
17861   echo 'CEOF' >> $CONFIG_STATUS
17862   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17863   rm -f conftest.vals
17864   mv conftest.tail conftest.vals
17865 done
17866 rm -f conftest.vals
17867
17868 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
17869 # marker @DEFS@.
17870 echo '  cat >> conftest.edit <<CEOF
17871 /@DEFS@/r conftest.frag
17872 /@DEFS@/d
17873 CEOF
17874 sed -f conftest.edit $tmp/in > $tmp/out
17875 rm -f $tmp/in
17876 mv $tmp/out $tmp/in
17877 rm -f conftest.edit conftest.frag
17878 ' >> $CONFIG_STATUS
17879
17880 cat >>$CONFIG_STATUS <<\EOF
17881   # Let's still pretend it is `configure' which instantiates (i.e., don't
17882   # use $as_me), people would be surprised to read:
17883   #    /* config.h.  Generated automatically by config.status.  */
17884   if test x"$ac_file" = x-; then
17885     echo "/* Generated automatically by configure.  */" >$tmp/config.h
17886   else
17887     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
17888   fi
17889   cat $tmp/in >>$tmp/config.h
17890   rm -f $tmp/in
17891   if test x"$ac_file" != x-; then
17892     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
17893       { echo "$as_me:17893: $ac_file is unchanged" >&5
17894 echo "$as_me: $ac_file is unchanged" >&6;}
17895     else
17896       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17897          X"$ac_file" : 'X\(//\)[^/]' \| \
17898          X"$ac_file" : 'X\(//\)$' \| \
17899          X"$ac_file" : 'X\(/\)' \| \
17900          .     : '\(.\)' 2>/dev/null ||
17901 echo X"$ac_file" |
17902     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17903           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17904           /^X\(\/\/\)$/{ s//\1/; q; }
17905           /^X\(\/\).*/{ s//\1/; q; }
17906           s/.*/./; q'`
17907       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17908         { case "$ac_dir" in
17909   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17910   *)                      as_incr_dir=.;;
17911 esac
17912 as_dummy="$ac_dir"
17913 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17914   case $as_mkdir_dir in
17915     # Skip DOS drivespec
17916     ?:) as_incr_dir=$as_mkdir_dir ;;
17917     *)
17918       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17919       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17920     ;;
17921   esac
17922 done; }
17923
17924       fi
17925       rm -f $ac_file
17926       mv $tmp/config.h $ac_file
17927     fi
17928   else
17929     cat $tmp/config.h
17930     rm -f $tmp/config.h
17931   fi
17932 done
17933 EOF
17934 cat >>$CONFIG_STATUS <<\EOF
17935 #
17936 # CONFIG_COMMANDS section.
17937 #
17938 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17939   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17940   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17941
17942   case $ac_dest in
17943     default )
17944
17945 for cf_dir in .
17946 do
17947         if test ! -d $srcdir/$cf_dir; then
17948                 continue
17949         elif test -f $srcdir/$cf_dir/programs; then
17950                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
17951         fi
17952 done
17953
17954         cat >>Makefile <<TEST_EOF
17955
17956 # These rules are generated so we do not rely on suffix rules, which do not
17957 # work consistently for different make-programs (the '\$(MODEL)/' confuses
17958 # some, and the '\$x' confuses others).
17959 TEST_EOF
17960
17961 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
17962 for N in $LIST
17963 do
17964         cat >>Makefile <<TEST_EOF
17965
17966 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
17967         \$(srcdir)/test.priv.h \\
17968         ncurses_cfg.h
17969         $SHOW_CC
17970         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
17971 TEST_EOF
17972 done
17973
17974 if test -f ../config.guess && test -f ../config.sub
17975 then
17976         cat >>Makefile <<TEST_EOF
17977
17978 # if we used CF_INHERIT for getting these files, we can remove them
17979 distclean::
17980         rm -f config.guess config.sub
17981 TEST_EOF
17982 fi
17983  ;;
17984   esac
17985 done
17986 EOF
17987
17988 cat >>$CONFIG_STATUS <<\EOF
17989
17990 { (exit 0); exit 0; }
17991 EOF
17992 chmod +x $CONFIG_STATUS
17993 ac_clean_files=$ac_clean_files_save
17994
17995 # configure is writing to config.log, and then calls config.status.
17996 # config.status does its own redirection, appending to config.log.
17997 # Unfortunately, on DOS this fails, as config.log is still kept open
17998 # by configure, so config.status won't be able to write to it; its
17999 # output is simply discarded.  So we exec the FD to /dev/null,
18000 # effectively closing config.log, so it can be properly (re)opened and
18001 # appended to by config.status.  When coming back to configure, we
18002 # need to make the FD available again.
18003 if test "$no_create" != yes; then
18004   ac_cs_success=:
18005   exec 5>/dev/null
18006   $SHELL $CONFIG_STATUS || ac_cs_success=false
18007   exec 5>>config.log
18008   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18009   # would make configure fail if this is the last instruction.
18010   $ac_cs_success || { (exit 1); exit 1; }
18011 fi
18012