]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.9 - patch 20141115
[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 sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3187         cf_XOPEN_SOURCE=
3188         cf_POSIX_C_SOURCE=
3189         ;;
3190 *)
3191
3192 echo "$as_me:3192: checking if we should define _XOPEN_SOURCE" >&5
3193 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3194 if test "${cf_cv_xopen_source+set}" = set; then
3195   echo $ECHO_N "(cached) $ECHO_C" >&6
3196 else
3197
3198         cat >conftest.$ac_ext <<_ACEOF
3199 #line 3199 "configure"
3200 #include "confdefs.h"
3201
3202 #include <stdlib.h>
3203 #include <string.h>
3204 #include <sys/types.h>
3205
3206 int
3207 main ()
3208 {
3209
3210 #ifndef _XOPEN_SOURCE
3211 make an error
3212 #endif
3213   ;
3214   return 0;
3215 }
3216 _ACEOF
3217 rm -f conftest.$ac_objext
3218 if { (eval echo "$as_me:3218: \"$ac_compile\"") >&5
3219   (eval $ac_compile) 2>&5
3220   ac_status=$?
3221   echo "$as_me:3221: \$? = $ac_status" >&5
3222   (exit $ac_status); } &&
3223          { ac_try='test -s conftest.$ac_objext'
3224   { (eval echo "$as_me:3224: \"$ac_try\"") >&5
3225   (eval $ac_try) 2>&5
3226   ac_status=$?
3227   echo "$as_me:3227: \$? = $ac_status" >&5
3228   (exit $ac_status); }; }; then
3229   cf_cv_xopen_source=no
3230 else
3231   echo "$as_me: failed program was:" >&5
3232 cat conftest.$ac_ext >&5
3233 cf_save="$CPPFLAGS"
3234          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3235          cat >conftest.$ac_ext <<_ACEOF
3236 #line 3236 "configure"
3237 #include "confdefs.h"
3238
3239 #include <stdlib.h>
3240 #include <string.h>
3241 #include <sys/types.h>
3242
3243 int
3244 main ()
3245 {
3246
3247 #ifdef _XOPEN_SOURCE
3248 make an error
3249 #endif
3250   ;
3251   return 0;
3252 }
3253 _ACEOF
3254 rm -f conftest.$ac_objext
3255 if { (eval echo "$as_me:3255: \"$ac_compile\"") >&5
3256   (eval $ac_compile) 2>&5
3257   ac_status=$?
3258   echo "$as_me:3258: \$? = $ac_status" >&5
3259   (exit $ac_status); } &&
3260          { ac_try='test -s conftest.$ac_objext'
3261   { (eval echo "$as_me:3261: \"$ac_try\"") >&5
3262   (eval $ac_try) 2>&5
3263   ac_status=$?
3264   echo "$as_me:3264: \$? = $ac_status" >&5
3265   (exit $ac_status); }; }; then
3266   cf_cv_xopen_source=no
3267 else
3268   echo "$as_me: failed program was:" >&5
3269 cat conftest.$ac_ext >&5
3270 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3271 fi
3272 rm -f conftest.$ac_objext conftest.$ac_ext
3273         CPPFLAGS="$cf_save"
3274
3275 fi
3276 rm -f conftest.$ac_objext conftest.$ac_ext
3277
3278 fi
3279 echo "$as_me:3279: result: $cf_cv_xopen_source" >&5
3280 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3281
3282 if test "$cf_cv_xopen_source" != no ; then
3283
3284 CFLAGS=`echo "$CFLAGS" | \
3285         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3286                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3287
3288 CPPFLAGS=`echo "$CPPFLAGS" | \
3289         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3290                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3291
3292         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3293
3294 cf_fix_cppflags=no
3295 cf_new_cflags=
3296 cf_new_cppflags=
3297 cf_new_extra_cppflags=
3298
3299 for cf_add_cflags in $cf_temp_xopen_source
3300 do
3301 case $cf_fix_cppflags in
3302 no)
3303         case $cf_add_cflags in #(vi
3304         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3305                 case $cf_add_cflags in
3306                 -D*)
3307                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3308
3309                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3310                                 && test -z "${cf_tst_cflags}" \
3311                                 && cf_fix_cppflags=yes
3312
3313                         if test $cf_fix_cppflags = yes ; then
3314                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3315                                 continue
3316                         elif test "${cf_tst_cflags}" = "\"'" ; then
3317                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3318                                 continue
3319                         fi
3320                         ;;
3321                 esac
3322                 case "$CPPFLAGS" in
3323                 *$cf_add_cflags) #(vi
3324                         ;;
3325                 *) #(vi
3326                         case $cf_add_cflags in #(vi
3327                         -D*)
3328                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3329
3330 CPPFLAGS=`echo "$CPPFLAGS" | \
3331         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3332                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3333
3334                                 ;;
3335                         esac
3336                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3337                         ;;
3338                 esac
3339                 ;;
3340         *)
3341                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3342                 ;;
3343         esac
3344         ;;
3345 yes)
3346         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3347
3348         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3349
3350         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3351                 && test -z "${cf_tst_cflags}" \
3352                 && cf_fix_cppflags=no
3353         ;;
3354 esac
3355 done
3356
3357 if test -n "$cf_new_cflags" ; then
3358
3359         CFLAGS="$CFLAGS $cf_new_cflags"
3360 fi
3361
3362 if test -n "$cf_new_cppflags" ; then
3363
3364         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3365 fi
3366
3367 if test -n "$cf_new_extra_cppflags" ; then
3368
3369         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3370 fi
3371
3372 fi
3373
3374 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3375
3376 cf_save_CFLAGS="$CFLAGS"
3377 cf_save_CPPFLAGS="$CPPFLAGS"
3378
3379 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3380         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3381                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3382
3383 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3384         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3385                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3386
3387 echo "$as_me:3387: checking if we should define _POSIX_C_SOURCE" >&5
3388 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3389 if test "${cf_cv_posix_c_source+set}" = set; then
3390   echo $ECHO_N "(cached) $ECHO_C" >&6
3391 else
3392
3393 echo "${as_me:-configure}:3393: testing if the symbol is already defined go no further ..." 1>&5
3394
3395         cat >conftest.$ac_ext <<_ACEOF
3396 #line 3396 "configure"
3397 #include "confdefs.h"
3398 #include <sys/types.h>
3399 int
3400 main ()
3401 {
3402
3403 #ifndef _POSIX_C_SOURCE
3404 make an error
3405 #endif
3406   ;
3407   return 0;
3408 }
3409 _ACEOF
3410 rm -f conftest.$ac_objext
3411 if { (eval echo "$as_me:3411: \"$ac_compile\"") >&5
3412   (eval $ac_compile) 2>&5
3413   ac_status=$?
3414   echo "$as_me:3414: \$? = $ac_status" >&5
3415   (exit $ac_status); } &&
3416          { ac_try='test -s conftest.$ac_objext'
3417   { (eval echo "$as_me:3417: \"$ac_try\"") >&5
3418   (eval $ac_try) 2>&5
3419   ac_status=$?
3420   echo "$as_me:3420: \$? = $ac_status" >&5
3421   (exit $ac_status); }; }; then
3422   cf_cv_posix_c_source=no
3423 else
3424   echo "$as_me: failed program was:" >&5
3425 cat conftest.$ac_ext >&5
3426 cf_want_posix_source=no
3427          case .$cf_POSIX_C_SOURCE in #(vi
3428          .[12]??*) #(vi
3429                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3430                 ;;
3431          .2) #(vi
3432                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3433                 cf_want_posix_source=yes
3434                 ;;
3435          .*)
3436                 cf_want_posix_source=yes
3437                 ;;
3438          esac
3439          if test "$cf_want_posix_source" = yes ; then
3440                 cat >conftest.$ac_ext <<_ACEOF
3441 #line 3441 "configure"
3442 #include "confdefs.h"
3443 #include <sys/types.h>
3444 int
3445 main ()
3446 {
3447
3448 #ifdef _POSIX_SOURCE
3449 make an error
3450 #endif
3451   ;
3452   return 0;
3453 }
3454 _ACEOF
3455 rm -f conftest.$ac_objext
3456 if { (eval echo "$as_me:3456: \"$ac_compile\"") >&5
3457   (eval $ac_compile) 2>&5
3458   ac_status=$?
3459   echo "$as_me:3459: \$? = $ac_status" >&5
3460   (exit $ac_status); } &&
3461          { ac_try='test -s conftest.$ac_objext'
3462   { (eval echo "$as_me:3462: \"$ac_try\"") >&5
3463   (eval $ac_try) 2>&5
3464   ac_status=$?
3465   echo "$as_me:3465: \$? = $ac_status" >&5
3466   (exit $ac_status); }; }; then
3467   :
3468 else
3469   echo "$as_me: failed program was:" >&5
3470 cat conftest.$ac_ext >&5
3471 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3472 fi
3473 rm -f conftest.$ac_objext conftest.$ac_ext
3474          fi
3475
3476 echo "${as_me:-configure}:3476: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3477
3478          CFLAGS="$cf_trim_CFLAGS"
3479          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3480
3481 echo "${as_me:-configure}:3481: testing if the second compile does not leave our definition intact error ..." 1>&5
3482
3483          cat >conftest.$ac_ext <<_ACEOF
3484 #line 3484 "configure"
3485 #include "confdefs.h"
3486 #include <sys/types.h>
3487 int
3488 main ()
3489 {
3490
3491 #ifndef _POSIX_C_SOURCE
3492 make an error
3493 #endif
3494   ;
3495   return 0;
3496 }
3497 _ACEOF
3498 rm -f conftest.$ac_objext
3499 if { (eval echo "$as_me:3499: \"$ac_compile\"") >&5
3500   (eval $ac_compile) 2>&5
3501   ac_status=$?
3502   echo "$as_me:3502: \$? = $ac_status" >&5
3503   (exit $ac_status); } &&
3504          { ac_try='test -s conftest.$ac_objext'
3505   { (eval echo "$as_me:3505: \"$ac_try\"") >&5
3506   (eval $ac_try) 2>&5
3507   ac_status=$?
3508   echo "$as_me:3508: \$? = $ac_status" >&5
3509   (exit $ac_status); }; }; then
3510   :
3511 else
3512   echo "$as_me: failed program was:" >&5
3513 cat conftest.$ac_ext >&5
3514 cf_cv_posix_c_source=no
3515 fi
3516 rm -f conftest.$ac_objext conftest.$ac_ext
3517          CFLAGS="$cf_save_CFLAGS"
3518          CPPFLAGS="$cf_save_CPPFLAGS"
3519
3520 fi
3521 rm -f conftest.$ac_objext conftest.$ac_ext
3522
3523 fi
3524 echo "$as_me:3524: result: $cf_cv_posix_c_source" >&5
3525 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3526
3527 if test "$cf_cv_posix_c_source" != no ; then
3528         CFLAGS="$cf_trim_CFLAGS"
3529         CPPFLAGS="$cf_trim_CPPFLAGS"
3530
3531 cf_fix_cppflags=no
3532 cf_new_cflags=
3533 cf_new_cppflags=
3534 cf_new_extra_cppflags=
3535
3536 for cf_add_cflags in $cf_cv_posix_c_source
3537 do
3538 case $cf_fix_cppflags in
3539 no)
3540         case $cf_add_cflags in #(vi
3541         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3542                 case $cf_add_cflags in
3543                 -D*)
3544                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3545
3546                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3547                                 && test -z "${cf_tst_cflags}" \
3548                                 && cf_fix_cppflags=yes
3549
3550                         if test $cf_fix_cppflags = yes ; then
3551                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3552                                 continue
3553                         elif test "${cf_tst_cflags}" = "\"'" ; then
3554                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3555                                 continue
3556                         fi
3557                         ;;
3558                 esac
3559                 case "$CPPFLAGS" in
3560                 *$cf_add_cflags) #(vi
3561                         ;;
3562                 *) #(vi
3563                         case $cf_add_cflags in #(vi
3564                         -D*)
3565                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3566
3567 CPPFLAGS=`echo "$CPPFLAGS" | \
3568         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3569                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3570
3571                                 ;;
3572                         esac
3573                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3574                         ;;
3575                 esac
3576                 ;;
3577         *)
3578                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3579                 ;;
3580         esac
3581         ;;
3582 yes)
3583         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3584
3585         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3586
3587         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3588                 && test -z "${cf_tst_cflags}" \
3589                 && cf_fix_cppflags=no
3590         ;;
3591 esac
3592 done
3593
3594 if test -n "$cf_new_cflags" ; then
3595
3596         CFLAGS="$CFLAGS $cf_new_cflags"
3597 fi
3598
3599 if test -n "$cf_new_cppflags" ; then
3600
3601         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3602 fi
3603
3604 if test -n "$cf_new_extra_cppflags" ; then
3605
3606         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3607 fi
3608
3609 fi
3610
3611         ;;
3612 esac
3613
3614 if test -n "$cf_xopen_source" ; then
3615
3616 cf_fix_cppflags=no
3617 cf_new_cflags=
3618 cf_new_cppflags=
3619 cf_new_extra_cppflags=
3620
3621 for cf_add_cflags in $cf_xopen_source
3622 do
3623 case $cf_fix_cppflags in
3624 no)
3625         case $cf_add_cflags in #(vi
3626         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3627                 case $cf_add_cflags in
3628                 -D*)
3629                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3630
3631                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3632                                 && test -z "${cf_tst_cflags}" \
3633                                 && cf_fix_cppflags=yes
3634
3635                         if test $cf_fix_cppflags = yes ; then
3636                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3637                                 continue
3638                         elif test "${cf_tst_cflags}" = "\"'" ; then
3639                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3640                                 continue
3641                         fi
3642                         ;;
3643                 esac
3644                 case "$CPPFLAGS" in
3645                 *$cf_add_cflags) #(vi
3646                         ;;
3647                 *) #(vi
3648                         case $cf_add_cflags in #(vi
3649                         -D*)
3650                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3651
3652 CPPFLAGS=`echo "$CPPFLAGS" | \
3653         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3654                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3655
3656                                 ;;
3657                         esac
3658                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3659                         ;;
3660                 esac
3661                 ;;
3662         *)
3663                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3664                 ;;
3665         esac
3666         ;;
3667 yes)
3668         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3669
3670         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3671
3672         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3673                 && test -z "${cf_tst_cflags}" \
3674                 && cf_fix_cppflags=no
3675         ;;
3676 esac
3677 done
3678
3679 if test -n "$cf_new_cflags" ; then
3680         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
3681
3682 echo "${as_me:-configure}:3682: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
3683
3684         CFLAGS="$CFLAGS $cf_new_cflags"
3685 fi
3686
3687 if test -n "$cf_new_cppflags" ; then
3688         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
3689
3690 echo "${as_me:-configure}:3690: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
3691
3692         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3693 fi
3694
3695 if test -n "$cf_new_extra_cppflags" ; then
3696         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
3697
3698 echo "${as_me:-configure}:3698: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
3699
3700         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3701 fi
3702
3703 fi
3704
3705 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3706         echo "$as_me:3706: checking if _XOPEN_SOURCE really is set" >&5
3707 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3708         cat >conftest.$ac_ext <<_ACEOF
3709 #line 3709 "configure"
3710 #include "confdefs.h"
3711 #include <stdlib.h>
3712 int
3713 main ()
3714 {
3715
3716 #ifndef _XOPEN_SOURCE
3717 make an error
3718 #endif
3719   ;
3720   return 0;
3721 }
3722 _ACEOF
3723 rm -f conftest.$ac_objext
3724 if { (eval echo "$as_me:3724: \"$ac_compile\"") >&5
3725   (eval $ac_compile) 2>&5
3726   ac_status=$?
3727   echo "$as_me:3727: \$? = $ac_status" >&5
3728   (exit $ac_status); } &&
3729          { ac_try='test -s conftest.$ac_objext'
3730   { (eval echo "$as_me:3730: \"$ac_try\"") >&5
3731   (eval $ac_try) 2>&5
3732   ac_status=$?
3733   echo "$as_me:3733: \$? = $ac_status" >&5
3734   (exit $ac_status); }; }; then
3735   cf_XOPEN_SOURCE_set=yes
3736 else
3737   echo "$as_me: failed program was:" >&5
3738 cat conftest.$ac_ext >&5
3739 cf_XOPEN_SOURCE_set=no
3740 fi
3741 rm -f conftest.$ac_objext conftest.$ac_ext
3742         echo "$as_me:3742: result: $cf_XOPEN_SOURCE_set" >&5
3743 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3744         if test $cf_XOPEN_SOURCE_set = yes
3745         then
3746                 cat >conftest.$ac_ext <<_ACEOF
3747 #line 3747 "configure"
3748 #include "confdefs.h"
3749 #include <stdlib.h>
3750 int
3751 main ()
3752 {
3753
3754 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3755 make an error
3756 #endif
3757   ;
3758   return 0;
3759 }
3760 _ACEOF
3761 rm -f conftest.$ac_objext
3762 if { (eval echo "$as_me:3762: \"$ac_compile\"") >&5
3763   (eval $ac_compile) 2>&5
3764   ac_status=$?
3765   echo "$as_me:3765: \$? = $ac_status" >&5
3766   (exit $ac_status); } &&
3767          { ac_try='test -s conftest.$ac_objext'
3768   { (eval echo "$as_me:3768: \"$ac_try\"") >&5
3769   (eval $ac_try) 2>&5
3770   ac_status=$?
3771   echo "$as_me:3771: \$? = $ac_status" >&5
3772   (exit $ac_status); }; }; then
3773   cf_XOPEN_SOURCE_set_ok=yes
3774 else
3775   echo "$as_me: failed program was:" >&5
3776 cat conftest.$ac_ext >&5
3777 cf_XOPEN_SOURCE_set_ok=no
3778 fi
3779 rm -f conftest.$ac_objext conftest.$ac_ext
3780                 if test $cf_XOPEN_SOURCE_set_ok = no
3781                 then
3782                         { echo "$as_me:3782: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3783 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3784                 fi
3785         else
3786
3787 echo "$as_me:3787: checking if we should define _XOPEN_SOURCE" >&5
3788 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3789 if test "${cf_cv_xopen_source+set}" = set; then
3790   echo $ECHO_N "(cached) $ECHO_C" >&6
3791 else
3792
3793         cat >conftest.$ac_ext <<_ACEOF
3794 #line 3794 "configure"
3795 #include "confdefs.h"
3796
3797 #include <stdlib.h>
3798 #include <string.h>
3799 #include <sys/types.h>
3800
3801 int
3802 main ()
3803 {
3804
3805 #ifndef _XOPEN_SOURCE
3806 make an error
3807 #endif
3808   ;
3809   return 0;
3810 }
3811 _ACEOF
3812 rm -f conftest.$ac_objext
3813 if { (eval echo "$as_me:3813: \"$ac_compile\"") >&5
3814   (eval $ac_compile) 2>&5
3815   ac_status=$?
3816   echo "$as_me:3816: \$? = $ac_status" >&5
3817   (exit $ac_status); } &&
3818          { ac_try='test -s conftest.$ac_objext'
3819   { (eval echo "$as_me:3819: \"$ac_try\"") >&5
3820   (eval $ac_try) 2>&5
3821   ac_status=$?
3822   echo "$as_me:3822: \$? = $ac_status" >&5
3823   (exit $ac_status); }; }; then
3824   cf_cv_xopen_source=no
3825 else
3826   echo "$as_me: failed program was:" >&5
3827 cat conftest.$ac_ext >&5
3828 cf_save="$CPPFLAGS"
3829          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3830          cat >conftest.$ac_ext <<_ACEOF
3831 #line 3831 "configure"
3832 #include "confdefs.h"
3833
3834 #include <stdlib.h>
3835 #include <string.h>
3836 #include <sys/types.h>
3837
3838 int
3839 main ()
3840 {
3841
3842 #ifdef _XOPEN_SOURCE
3843 make an error
3844 #endif
3845   ;
3846   return 0;
3847 }
3848 _ACEOF
3849 rm -f conftest.$ac_objext
3850 if { (eval echo "$as_me:3850: \"$ac_compile\"") >&5
3851   (eval $ac_compile) 2>&5
3852   ac_status=$?
3853   echo "$as_me:3853: \$? = $ac_status" >&5
3854   (exit $ac_status); } &&
3855          { ac_try='test -s conftest.$ac_objext'
3856   { (eval echo "$as_me:3856: \"$ac_try\"") >&5
3857   (eval $ac_try) 2>&5
3858   ac_status=$?
3859   echo "$as_me:3859: \$? = $ac_status" >&5
3860   (exit $ac_status); }; }; then
3861   cf_cv_xopen_source=no
3862 else
3863   echo "$as_me: failed program was:" >&5
3864 cat conftest.$ac_ext >&5
3865 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3866 fi
3867 rm -f conftest.$ac_objext conftest.$ac_ext
3868         CPPFLAGS="$cf_save"
3869
3870 fi
3871 rm -f conftest.$ac_objext conftest.$ac_ext
3872
3873 fi
3874 echo "$as_me:3874: result: $cf_cv_xopen_source" >&5
3875 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3876
3877 if test "$cf_cv_xopen_source" != no ; then
3878
3879 CFLAGS=`echo "$CFLAGS" | \
3880         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3881                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3882
3883 CPPFLAGS=`echo "$CPPFLAGS" | \
3884         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3885                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3886
3887         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3888
3889 cf_fix_cppflags=no
3890 cf_new_cflags=
3891 cf_new_cppflags=
3892 cf_new_extra_cppflags=
3893
3894 for cf_add_cflags in $cf_temp_xopen_source
3895 do
3896 case $cf_fix_cppflags in
3897 no)
3898         case $cf_add_cflags in #(vi
3899         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3900                 case $cf_add_cflags in
3901                 -D*)
3902                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3903
3904                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3905                                 && test -z "${cf_tst_cflags}" \
3906                                 && cf_fix_cppflags=yes
3907
3908                         if test $cf_fix_cppflags = yes ; then
3909                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3910                                 continue
3911                         elif test "${cf_tst_cflags}" = "\"'" ; then
3912                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3913                                 continue
3914                         fi
3915                         ;;
3916                 esac
3917                 case "$CPPFLAGS" in
3918                 *$cf_add_cflags) #(vi
3919                         ;;
3920                 *) #(vi
3921                         case $cf_add_cflags in #(vi
3922                         -D*)
3923                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3924
3925 CPPFLAGS=`echo "$CPPFLAGS" | \
3926         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3927                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3928
3929                                 ;;
3930                         esac
3931                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3932                         ;;
3933                 esac
3934                 ;;
3935         *)
3936                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3937                 ;;
3938         esac
3939         ;;
3940 yes)
3941         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3942
3943         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3944
3945         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3946                 && test -z "${cf_tst_cflags}" \
3947                 && cf_fix_cppflags=no
3948         ;;
3949 esac
3950 done
3951
3952 if test -n "$cf_new_cflags" ; then
3953
3954         CFLAGS="$CFLAGS $cf_new_cflags"
3955 fi
3956
3957 if test -n "$cf_new_cppflags" ; then
3958
3959         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3960 fi
3961
3962 if test -n "$cf_new_extra_cppflags" ; then
3963
3964         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3965 fi
3966
3967 fi
3968
3969         fi
3970 fi
3971
3972 echo "$as_me:3972: checking for signal global datatype" >&5
3973 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
3974 if test "${cf_cv_sig_atomic_t+set}" = set; then
3975   echo $ECHO_N "(cached) $ECHO_C" >&6
3976 else
3977
3978         for cf_type in \
3979                 "volatile sig_atomic_t" \
3980                 "sig_atomic_t" \
3981                 "int"
3982         do
3983         cat >conftest.$ac_ext <<_ACEOF
3984 #line 3984 "configure"
3985 #include "confdefs.h"
3986
3987 #include <sys/types.h>
3988 #include <signal.h>
3989 #include <stdio.h>
3990
3991 extern $cf_type x;
3992 $cf_type x;
3993 static void handler(int sig)
3994 {
3995         x = 5;
3996 }
3997 int
3998 main ()
3999 {
4000 signal(SIGINT, handler);
4001                  x = 1
4002   ;
4003   return 0;
4004 }
4005 _ACEOF
4006 rm -f conftest.$ac_objext
4007 if { (eval echo "$as_me:4007: \"$ac_compile\"") >&5
4008   (eval $ac_compile) 2>&5
4009   ac_status=$?
4010   echo "$as_me:4010: \$? = $ac_status" >&5
4011   (exit $ac_status); } &&
4012          { ac_try='test -s conftest.$ac_objext'
4013   { (eval echo "$as_me:4013: \"$ac_try\"") >&5
4014   (eval $ac_try) 2>&5
4015   ac_status=$?
4016   echo "$as_me:4016: \$? = $ac_status" >&5
4017   (exit $ac_status); }; }; then
4018   cf_cv_sig_atomic_t=$cf_type
4019 else
4020   echo "$as_me: failed program was:" >&5
4021 cat conftest.$ac_ext >&5
4022 cf_cv_sig_atomic_t=no
4023 fi
4024 rm -f conftest.$ac_objext conftest.$ac_ext
4025                 test "$cf_cv_sig_atomic_t" != no && break
4026         done
4027
4028 fi
4029
4030 echo "$as_me:4030: result: $cf_cv_sig_atomic_t" >&5
4031 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4032 test "$cf_cv_sig_atomic_t" != no &&
4033 cat >>confdefs.h <<EOF
4034 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4035 EOF
4036
4037 echo "$as_me:4037: checking if you want to use pkg-config" >&5
4038 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4039
4040 # Check whether --with-pkg-config or --without-pkg-config was given.
4041 if test "${with_pkg_config+set}" = set; then
4042   withval="$with_pkg_config"
4043   cf_pkg_config=$withval
4044 else
4045   cf_pkg_config=yes
4046 fi;
4047 echo "$as_me:4047: result: $cf_pkg_config" >&5
4048 echo "${ECHO_T}$cf_pkg_config" >&6
4049
4050 case $cf_pkg_config in #(vi
4051 no) #(vi
4052         PKG_CONFIG=none
4053         ;;
4054 yes) #(vi
4055
4056 if test -n "$ac_tool_prefix"; then
4057   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4058 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4059 echo "$as_me:4059: checking for $ac_word" >&5
4060 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4061 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4062   echo $ECHO_N "(cached) $ECHO_C" >&6
4063 else
4064   case $PKG_CONFIG in
4065   [\\/]* | ?:[\\/]*)
4066   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4067   ;;
4068   *)
4069   ac_save_IFS=$IFS; IFS=$ac_path_separator
4070 ac_dummy="$PATH"
4071 for ac_dir in $ac_dummy; do
4072   IFS=$ac_save_IFS
4073   test -z "$ac_dir" && ac_dir=.
4074   if $as_executable_p "$ac_dir/$ac_word"; then
4075    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4076    echo "$as_me:4076: found $ac_dir/$ac_word" >&5
4077    break
4078 fi
4079 done
4080
4081   ;;
4082 esac
4083 fi
4084 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4085
4086 if test -n "$PKG_CONFIG"; then
4087   echo "$as_me:4087: result: $PKG_CONFIG" >&5
4088 echo "${ECHO_T}$PKG_CONFIG" >&6
4089 else
4090   echo "$as_me:4090: result: no" >&5
4091 echo "${ECHO_T}no" >&6
4092 fi
4093
4094 fi
4095 if test -z "$ac_cv_path_PKG_CONFIG"; then
4096   ac_pt_PKG_CONFIG=$PKG_CONFIG
4097   # Extract the first word of "pkg-config", so it can be a program name with args.
4098 set dummy pkg-config; ac_word=$2
4099 echo "$as_me:4099: checking for $ac_word" >&5
4100 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4101 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4102   echo $ECHO_N "(cached) $ECHO_C" >&6
4103 else
4104   case $ac_pt_PKG_CONFIG in
4105   [\\/]* | ?:[\\/]*)
4106   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4107   ;;
4108   *)
4109   ac_save_IFS=$IFS; IFS=$ac_path_separator
4110 ac_dummy="$PATH"
4111 for ac_dir in $ac_dummy; do
4112   IFS=$ac_save_IFS
4113   test -z "$ac_dir" && ac_dir=.
4114   if $as_executable_p "$ac_dir/$ac_word"; then
4115    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4116    echo "$as_me:4116: found $ac_dir/$ac_word" >&5
4117    break
4118 fi
4119 done
4120
4121   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4122   ;;
4123 esac
4124 fi
4125 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4126
4127 if test -n "$ac_pt_PKG_CONFIG"; then
4128   echo "$as_me:4128: result: $ac_pt_PKG_CONFIG" >&5
4129 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4130 else
4131   echo "$as_me:4131: result: no" >&5
4132 echo "${ECHO_T}no" >&6
4133 fi
4134
4135   PKG_CONFIG=$ac_pt_PKG_CONFIG
4136 else
4137   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4138 fi
4139
4140         ;;
4141 *)
4142         PKG_CONFIG=$withval
4143         ;;
4144 esac
4145
4146 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4147 if test "$PKG_CONFIG" != none ; then
4148
4149 if test "x$prefix" != xNONE; then
4150   cf_path_syntax="$prefix"
4151 else
4152   cf_path_syntax="$ac_default_prefix"
4153 fi
4154
4155 case ".$PKG_CONFIG" in #(vi
4156 .\$\(*\)*|.\'*\'*) #(vi
4157   ;;
4158 ..|./*|.\\*) #(vi
4159   ;;
4160 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
4161   ;;
4162 .\${*prefix}*|.\${*dir}*) #(vi
4163   eval PKG_CONFIG="$PKG_CONFIG"
4164   case ".$PKG_CONFIG" in #(vi
4165   .NONE/*)
4166     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4167     ;;
4168   esac
4169   ;; #(vi
4170 .no|.NONE/*)
4171   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4172   ;;
4173 *)
4174   { { echo "$as_me:4174: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4175 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4176    { (exit 1); exit 1; }; }
4177   ;;
4178 esac
4179
4180 fi
4181
4182 echo "$as_me:4182: checking if you want to see long compiling messages" >&5
4183 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4184
4185 # Check whether --enable-echo or --disable-echo was given.
4186 if test "${enable_echo+set}" = set; then
4187   enableval="$enable_echo"
4188   test "$enableval" != no && enableval=yes
4189   if test "$enableval" != "yes" ; then
4190
4191     ECHO_LT='--silent'
4192     ECHO_LD='@echo linking $@;'
4193     RULE_CC='@echo compiling $<'
4194     SHOW_CC='@echo compiling $@'
4195     ECHO_CC='@'
4196
4197   else
4198
4199     ECHO_LT=''
4200     ECHO_LD=''
4201     RULE_CC=''
4202     SHOW_CC=''
4203     ECHO_CC=''
4204
4205   fi
4206 else
4207   enableval=yes
4208
4209     ECHO_LT=''
4210     ECHO_LD=''
4211     RULE_CC=''
4212     SHOW_CC=''
4213     ECHO_CC=''
4214
4215 fi;
4216 echo "$as_me:4216: result: $enableval" >&5
4217 echo "${ECHO_T}$enableval" >&6
4218
4219 echo "$as_me:4219: checking for ncurses wrap-prefix" >&5
4220 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4221
4222 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4223 if test "${with_ncurses_wrap_prefix+set}" = set; then
4224   withval="$with_ncurses_wrap_prefix"
4225   NCURSES_WRAP_PREFIX=$withval
4226 else
4227   NCURSES_WRAP_PREFIX=_nc_
4228 fi;
4229 echo "$as_me:4229: result: $NCURSES_WRAP_PREFIX" >&5
4230 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4231
4232 echo "$as_me:4232: checking if you want to check for wide-character functions" >&5
4233 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4234
4235 # Check whether --enable-widec or --disable-widec was given.
4236 if test "${enable_widec+set}" = set; then
4237   enableval="$enable_widec"
4238   test "$enableval" != no && enableval=yes
4239   if test "$enableval" != "yes" ; then
4240     cf_enable_widec=no
4241   else
4242     cf_enable_widec=yes
4243   fi
4244 else
4245   enableval=yes
4246   cf_enable_widec=yes
4247
4248 fi;
4249 echo "$as_me:4249: result: $cf_enable_widec" >&5
4250 echo "${ECHO_T}$cf_enable_widec" >&6
4251
4252 echo "$as_me:4252: checking for specific curses-directory" >&5
4253 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4254
4255 # Check whether --with-curses-dir or --without-curses-dir was given.
4256 if test "${with_curses_dir+set}" = set; then
4257   withval="$with_curses_dir"
4258   cf_cv_curses_dir=$withval
4259 else
4260   cf_cv_curses_dir=no
4261 fi;
4262 echo "$as_me:4262: result: $cf_cv_curses_dir" >&5
4263 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4264
4265 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4266 then
4267
4268 if test "x$prefix" != xNONE; then
4269   cf_path_syntax="$prefix"
4270 else
4271   cf_path_syntax="$ac_default_prefix"
4272 fi
4273
4274 case ".$withval" in #(vi
4275 .\$\(*\)*|.\'*\'*) #(vi
4276   ;;
4277 ..|./*|.\\*) #(vi
4278   ;;
4279 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
4280   ;;
4281 .\${*prefix}*|.\${*dir}*) #(vi
4282   eval withval="$withval"
4283   case ".$withval" in #(vi
4284   .NONE/*)
4285     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4286     ;;
4287   esac
4288   ;; #(vi
4289 .no|.NONE/*)
4290   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4291   ;;
4292 *)
4293   { { echo "$as_me:4293: error: expected a pathname, not \"$withval\"" >&5
4294 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4295    { (exit 1); exit 1; }; }
4296   ;;
4297 esac
4298
4299         if test -d "$cf_cv_curses_dir"
4300         then
4301
4302 if test -n "$cf_cv_curses_dir/include" ; then
4303   for cf_add_incdir in $cf_cv_curses_dir/include
4304   do
4305         while test $cf_add_incdir != /usr/include
4306         do
4307           if test -d $cf_add_incdir
4308           then
4309                 cf_have_incdir=no
4310                 if test -n "$CFLAGS$CPPFLAGS" ; then
4311                   # a loop is needed to ensure we can add subdirs of existing dirs
4312                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4313                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4314                           cf_have_incdir=yes; break
4315                         fi
4316                   done
4317                 fi
4318
4319                 if test "$cf_have_incdir" = no ; then
4320                   if test "$cf_add_incdir" = /usr/local/include ; then
4321                         if test "$GCC" = yes
4322                         then
4323                           cf_save_CPPFLAGS=$CPPFLAGS
4324                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4325                           cat >conftest.$ac_ext <<_ACEOF
4326 #line 4326 "configure"
4327 #include "confdefs.h"
4328 #include <stdio.h>
4329 int
4330 main ()
4331 {
4332 printf("Hello")
4333   ;
4334   return 0;
4335 }
4336 _ACEOF
4337 rm -f conftest.$ac_objext
4338 if { (eval echo "$as_me:4338: \"$ac_compile\"") >&5
4339   (eval $ac_compile) 2>&5
4340   ac_status=$?
4341   echo "$as_me:4341: \$? = $ac_status" >&5
4342   (exit $ac_status); } &&
4343          { ac_try='test -s conftest.$ac_objext'
4344   { (eval echo "$as_me:4344: \"$ac_try\"") >&5
4345   (eval $ac_try) 2>&5
4346   ac_status=$?
4347   echo "$as_me:4347: \$? = $ac_status" >&5
4348   (exit $ac_status); }; }; then
4349   :
4350 else
4351   echo "$as_me: failed program was:" >&5
4352 cat conftest.$ac_ext >&5
4353 cf_have_incdir=yes
4354 fi
4355 rm -f conftest.$ac_objext conftest.$ac_ext
4356                           CPPFLAGS=$cf_save_CPPFLAGS
4357                         fi
4358                   fi
4359                 fi
4360
4361                 if test "$cf_have_incdir" = no ; then
4362                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4363
4364 echo "${as_me:-configure}:4364: testing adding $cf_add_incdir to include-path ..." 1>&5
4365
4366                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4367
4368                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4369                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4370                   cf_add_incdir="$cf_top_incdir"
4371                 else
4372                   break
4373                 fi
4374           fi
4375         done
4376   done
4377 fi
4378
4379 if test -n "$cf_cv_curses_dir/lib" ; then
4380   for cf_add_libdir in $cf_cv_curses_dir/lib
4381   do
4382     if test $cf_add_libdir = /usr/lib ; then
4383       :
4384     elif test -d $cf_add_libdir
4385     then
4386       cf_have_libdir=no
4387       if test -n "$LDFLAGS$LIBS" ; then
4388         # a loop is needed to ensure we can add subdirs of existing dirs
4389         for cf_test_libdir in $LDFLAGS $LIBS ; do
4390           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4391             cf_have_libdir=yes; break
4392           fi
4393         done
4394       fi
4395       if test "$cf_have_libdir" = no ; then
4396         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4397
4398 echo "${as_me:-configure}:4398: testing adding $cf_add_libdir to library-path ..." 1>&5
4399
4400         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4401       fi
4402     fi
4403   done
4404 fi
4405
4406         fi
4407 fi
4408
4409 cf_cv_screen=curses
4410
4411 echo "$as_me:4411: checking for specified curses library type" >&5
4412 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4413
4414 # Check whether --with-ncursesw or --without-ncursesw was given.
4415 if test "${with_ncursesw+set}" = set; then
4416   withval="$with_ncursesw"
4417   cf_cv_screen=ncursesw
4418 else
4419
4420 # Check whether --with-ncurses or --without-ncurses was given.
4421 if test "${with_ncurses+set}" = set; then
4422   withval="$with_ncurses"
4423   cf_cv_screen=ncurses
4424 else
4425
4426 # Check whether --with-pdcurses or --without-pdcurses was given.
4427 if test "${with_pdcurses+set}" = set; then
4428   withval="$with_pdcurses"
4429   cf_cv_screen=pdcurses
4430 else
4431
4432 # Check whether --with-curses-colr or --without-curses-colr was given.
4433 if test "${with_curses_colr+set}" = set; then
4434   withval="$with_curses_colr"
4435   cf_cv_screen=curses_colr
4436 else
4437
4438 # Check whether --with-curses-5lib or --without-curses-5lib was given.
4439 if test "${with_curses_5lib+set}" = set; then
4440   withval="$with_curses_5lib"
4441   cf_cv_screen=curses_5lib
4442 fi;
4443 fi;
4444 fi;
4445 fi;
4446 fi;
4447
4448 echo "$as_me:4448: result: $cf_cv_screen" >&5
4449 echo "${ECHO_T}$cf_cv_screen" >&6
4450
4451 case $cf_cv_screen in #(vi
4452 curses|curses_*) #(vi
4453
4454 echo "$as_me:4454: checking for extra include directories" >&5
4455 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4456 if test "${cf_cv_curses_incdir+set}" = set; then
4457   echo $ECHO_N "(cached) $ECHO_C" >&6
4458 else
4459
4460 cf_cv_curses_incdir=no
4461 case $host_os in #(vi
4462 hpux10.*) #(vi
4463         if test "x$cf_cv_screen" = "xcurses_colr"
4464         then
4465                 test -d /usr/include/curses_colr && \
4466                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
4467         fi
4468         ;;
4469 sunos3*|sunos4*)
4470         if test "x$cf_cv_screen" = "xcurses_5lib"
4471         then
4472                 test -d /usr/5lib && \
4473                 test -d /usr/5include && \
4474                 cf_cv_curses_incdir="-I/usr/5include"
4475         fi
4476         ;;
4477 esac
4478
4479 fi
4480 echo "$as_me:4480: result: $cf_cv_curses_incdir" >&5
4481 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4482 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4483
4484 echo "$as_me:4484: checking if we have identified curses headers" >&5
4485 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4486 if test "${cf_cv_ncurses_header+set}" = set; then
4487   echo $ECHO_N "(cached) $ECHO_C" >&6
4488 else
4489
4490 cf_cv_ncurses_header=none
4491 for cf_header in  \
4492         ncurses.h \
4493         curses.h ncurses/ncurses.h ncurses/curses.h
4494 do
4495 cat >conftest.$ac_ext <<_ACEOF
4496 #line 4496 "configure"
4497 #include "confdefs.h"
4498 #include <${cf_header}>
4499 int
4500 main ()
4501 {
4502 initscr(); tgoto("?", 0,0)
4503   ;
4504   return 0;
4505 }
4506 _ACEOF
4507 rm -f conftest.$ac_objext
4508 if { (eval echo "$as_me:4508: \"$ac_compile\"") >&5
4509   (eval $ac_compile) 2>&5
4510   ac_status=$?
4511   echo "$as_me:4511: \$? = $ac_status" >&5
4512   (exit $ac_status); } &&
4513          { ac_try='test -s conftest.$ac_objext'
4514   { (eval echo "$as_me:4514: \"$ac_try\"") >&5
4515   (eval $ac_try) 2>&5
4516   ac_status=$?
4517   echo "$as_me:4517: \$? = $ac_status" >&5
4518   (exit $ac_status); }; }; then
4519   cf_cv_ncurses_header=$cf_header; break
4520 else
4521   echo "$as_me: failed program was:" >&5
4522 cat conftest.$ac_ext >&5
4523 fi
4524 rm -f conftest.$ac_objext conftest.$ac_ext
4525 done
4526
4527 fi
4528 echo "$as_me:4528: result: $cf_cv_ncurses_header" >&5
4529 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4530
4531 if test "$cf_cv_ncurses_header" = none ; then
4532         { { echo "$as_me:4532: error: No curses header-files found" >&5
4533 echo "$as_me: error: No curses header-files found" >&2;}
4534    { (exit 1); exit 1; }; }
4535 fi
4536
4537 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4538
4539 for ac_header in $cf_cv_ncurses_header
4540 do
4541 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4542 echo "$as_me:4542: checking for $ac_header" >&5
4543 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4544 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4545   echo $ECHO_N "(cached) $ECHO_C" >&6
4546 else
4547   cat >conftest.$ac_ext <<_ACEOF
4548 #line 4548 "configure"
4549 #include "confdefs.h"
4550 #include <$ac_header>
4551 _ACEOF
4552 if { (eval echo "$as_me:4552: \"$ac_cpp conftest.$ac_ext\"") >&5
4553   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4554   ac_status=$?
4555   egrep -v '^ *\+' conftest.er1 >conftest.err
4556   rm -f conftest.er1
4557   cat conftest.err >&5
4558   echo "$as_me:4558: \$? = $ac_status" >&5
4559   (exit $ac_status); } >/dev/null; then
4560   if test -s conftest.err; then
4561     ac_cpp_err=$ac_c_preproc_warn_flag
4562   else
4563     ac_cpp_err=
4564   fi
4565 else
4566   ac_cpp_err=yes
4567 fi
4568 if test -z "$ac_cpp_err"; then
4569   eval "$as_ac_Header=yes"
4570 else
4571   echo "$as_me: failed program was:" >&5
4572   cat conftest.$ac_ext >&5
4573   eval "$as_ac_Header=no"
4574 fi
4575 rm -f conftest.err conftest.$ac_ext
4576 fi
4577 echo "$as_me:4577: result: `eval echo '${'$as_ac_Header'}'`" >&5
4578 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4579 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4580   cat >>confdefs.h <<EOF
4581 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4582 EOF
4583
4584 fi
4585 done
4586
4587 echo "$as_me:4587: checking for terminfo header" >&5
4588 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4589 if test "${cf_cv_term_header+set}" = set; then
4590   echo $ECHO_N "(cached) $ECHO_C" >&6
4591 else
4592
4593 case ${cf_cv_ncurses_header} in #(vi
4594 */ncurses.h|*/ncursesw.h) #(vi
4595         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4596         ;;
4597 *)
4598         cf_term_header=term.h
4599         ;;
4600 esac
4601
4602 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4603 do
4604 cat >conftest.$ac_ext <<_ACEOF
4605 #line 4605 "configure"
4606 #include "confdefs.h"
4607 #include <stdio.h>
4608 #include <${cf_cv_ncurses_header:-curses.h}>
4609 #include <$cf_test>
4610
4611 int
4612 main ()
4613 {
4614 int x = auto_left_margin
4615   ;
4616   return 0;
4617 }
4618 _ACEOF
4619 rm -f conftest.$ac_objext
4620 if { (eval echo "$as_me:4620: \"$ac_compile\"") >&5
4621   (eval $ac_compile) 2>&5
4622   ac_status=$?
4623   echo "$as_me:4623: \$? = $ac_status" >&5
4624   (exit $ac_status); } &&
4625          { ac_try='test -s conftest.$ac_objext'
4626   { (eval echo "$as_me:4626: \"$ac_try\"") >&5
4627   (eval $ac_try) 2>&5
4628   ac_status=$?
4629   echo "$as_me:4629: \$? = $ac_status" >&5
4630   (exit $ac_status); }; }; then
4631
4632         cf_cv_term_header="$cf_test"
4633 else
4634   echo "$as_me: failed program was:" >&5
4635 cat conftest.$ac_ext >&5
4636
4637         cf_cv_term_header=unknown
4638
4639 fi
4640 rm -f conftest.$ac_objext conftest.$ac_ext
4641         test "$cf_cv_term_header" != unknown && break
4642 done
4643
4644 fi
4645 echo "$as_me:4645: result: $cf_cv_term_header" >&5
4646 echo "${ECHO_T}$cf_cv_term_header" >&6
4647
4648 # Set definitions to allow ifdef'ing to accommodate subdirectories
4649
4650 case $cf_cv_term_header in # (vi
4651 *term.h)
4652
4653 cat >>confdefs.h <<\EOF
4654 #define HAVE_TERM_H 1
4655 EOF
4656
4657         ;;
4658 esac
4659
4660 case $cf_cv_term_header in # (vi
4661 ncurses/term.h) #(vi
4662
4663 cat >>confdefs.h <<\EOF
4664 #define HAVE_NCURSES_TERM_H 1
4665 EOF
4666
4667         ;;
4668 ncursesw/term.h)
4669
4670 cat >>confdefs.h <<\EOF
4671 #define HAVE_NCURSESW_TERM_H 1
4672 EOF
4673
4674         ;;
4675 esac
4676
4677 echo "$as_me:4677: checking for ncurses version" >&5
4678 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4679 if test "${cf_cv_ncurses_version+set}" = set; then
4680   echo $ECHO_N "(cached) $ECHO_C" >&6
4681 else
4682
4683         cf_cv_ncurses_version=no
4684         cf_tempfile=out$$
4685         rm -f $cf_tempfile
4686         if test "$cross_compiling" = yes; then
4687
4688         # This will not work if the preprocessor splits the line after the
4689         # Autoconf token.  The 'unproto' program does that.
4690         cat > conftest.$ac_ext <<EOF
4691 #include <${cf_cv_ncurses_header:-curses.h}>
4692 #undef Autoconf
4693 #ifdef NCURSES_VERSION
4694 Autoconf NCURSES_VERSION
4695 #else
4696 #ifdef __NCURSES_H
4697 Autoconf "old"
4698 #endif
4699 ;
4700 #endif
4701 EOF
4702         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4703         { (eval echo "$as_me:4703: \"$cf_try\"") >&5
4704   (eval $cf_try) 2>&5
4705   ac_status=$?
4706   echo "$as_me:4706: \$? = $ac_status" >&5
4707   (exit $ac_status); }
4708         if test -f conftest.out ; then
4709                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4710                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4711                 rm -f conftest.out
4712         fi
4713
4714 else
4715   cat >conftest.$ac_ext <<_ACEOF
4716 #line 4716 "configure"
4717 #include "confdefs.h"
4718
4719 #include <${cf_cv_ncurses_header:-curses.h}>
4720 #include <stdio.h>
4721 int main()
4722 {
4723         FILE *fp = fopen("$cf_tempfile", "w");
4724 #ifdef NCURSES_VERSION
4725 # ifdef NCURSES_VERSION_PATCH
4726         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4727 # else
4728         fprintf(fp, "%s\n", NCURSES_VERSION);
4729 # endif
4730 #else
4731 # ifdef __NCURSES_H
4732         fprintf(fp, "old\n");
4733 # else
4734         make an error
4735 # endif
4736 #endif
4737         ${cf_cv_main_return:-return}(0);
4738 }
4739 _ACEOF
4740 rm -f conftest$ac_exeext
4741 if { (eval echo "$as_me:4741: \"$ac_link\"") >&5
4742   (eval $ac_link) 2>&5
4743   ac_status=$?
4744   echo "$as_me:4744: \$? = $ac_status" >&5
4745   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4746   { (eval echo "$as_me:4746: \"$ac_try\"") >&5
4747   (eval $ac_try) 2>&5
4748   ac_status=$?
4749   echo "$as_me:4749: \$? = $ac_status" >&5
4750   (exit $ac_status); }; }; then
4751
4752         cf_cv_ncurses_version=`cat $cf_tempfile`
4753 else
4754   echo "$as_me: program exited with status $ac_status" >&5
4755 echo "$as_me: failed program was:" >&5
4756 cat conftest.$ac_ext >&5
4757 fi
4758 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4759 fi
4760         rm -f $cf_tempfile
4761
4762 fi
4763 echo "$as_me:4763: result: $cf_cv_ncurses_version" >&5
4764 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4765 test "$cf_cv_ncurses_version" = no ||
4766 cat >>confdefs.h <<\EOF
4767 #define NCURSES 1
4768 EOF
4769
4770 echo "$as_me:4770: checking if we have identified curses libraries" >&5
4771 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
4772 cat >conftest.$ac_ext <<_ACEOF
4773 #line 4773 "configure"
4774 #include "confdefs.h"
4775 #include <${cf_cv_ncurses_header:-curses.h}>
4776 int
4777 main ()
4778 {
4779 initscr(); tgoto("?", 0,0)
4780   ;
4781   return 0;
4782 }
4783 _ACEOF
4784 rm -f conftest.$ac_objext conftest$ac_exeext
4785 if { (eval echo "$as_me:4785: \"$ac_link\"") >&5
4786   (eval $ac_link) 2>&5
4787   ac_status=$?
4788   echo "$as_me:4788: \$? = $ac_status" >&5
4789   (exit $ac_status); } &&
4790          { ac_try='test -s conftest$ac_exeext'
4791   { (eval echo "$as_me:4791: \"$ac_try\"") >&5
4792   (eval $ac_try) 2>&5
4793   ac_status=$?
4794   echo "$as_me:4794: \$? = $ac_status" >&5
4795   (exit $ac_status); }; }; then
4796   cf_result=yes
4797 else
4798   echo "$as_me: failed program was:" >&5
4799 cat conftest.$ac_ext >&5
4800 cf_result=no
4801 fi
4802 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4803 echo "$as_me:4803: result: $cf_result" >&5
4804 echo "${ECHO_T}$cf_result" >&6
4805
4806 if test "$cf_result" = no ; then
4807 case $host_os in #(vi
4808 freebsd*) #(vi
4809     echo "$as_me:4809: checking for tgoto in -lmytinfo" >&5
4810 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4811 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4812   echo $ECHO_N "(cached) $ECHO_C" >&6
4813 else
4814   ac_check_lib_save_LIBS=$LIBS
4815 LIBS="-lmytinfo  $LIBS"
4816 cat >conftest.$ac_ext <<_ACEOF
4817 #line 4817 "configure"
4818 #include "confdefs.h"
4819
4820 /* Override any gcc2 internal prototype to avoid an error.  */
4821 #ifdef __cplusplus
4822 extern "C"
4823 #endif
4824 /* We use char because int might match the return type of a gcc2
4825    builtin and then its argument prototype would still apply.  */
4826 char tgoto ();
4827 int
4828 main ()
4829 {
4830 tgoto ();
4831   ;
4832   return 0;
4833 }
4834 _ACEOF
4835 rm -f conftest.$ac_objext conftest$ac_exeext
4836 if { (eval echo "$as_me:4836: \"$ac_link\"") >&5
4837   (eval $ac_link) 2>&5
4838   ac_status=$?
4839   echo "$as_me:4839: \$? = $ac_status" >&5
4840   (exit $ac_status); } &&
4841          { ac_try='test -s conftest$ac_exeext'
4842   { (eval echo "$as_me:4842: \"$ac_try\"") >&5
4843   (eval $ac_try) 2>&5
4844   ac_status=$?
4845   echo "$as_me:4845: \$? = $ac_status" >&5
4846   (exit $ac_status); }; }; then
4847   ac_cv_lib_mytinfo_tgoto=yes
4848 else
4849   echo "$as_me: failed program was:" >&5
4850 cat conftest.$ac_ext >&5
4851 ac_cv_lib_mytinfo_tgoto=no
4852 fi
4853 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4854 LIBS=$ac_check_lib_save_LIBS
4855 fi
4856 echo "$as_me:4856: result: $ac_cv_lib_mytinfo_tgoto" >&5
4857 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4858 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4859
4860 cf_add_libs="-lmytinfo"
4861 # Filter out duplicates - this happens with badly-designed ".pc" files...
4862 for cf_add_1lib in $LIBS
4863 do
4864         for cf_add_2lib in $cf_add_libs
4865         do
4866                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4867                 then
4868                         cf_add_1lib=
4869                         break
4870                 fi
4871         done
4872         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4873 done
4874 LIBS="$cf_add_libs"
4875
4876 fi
4877
4878     ;;
4879 hpux10.*) #(vi
4880         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
4881         # next (1998), and xcurses "newer" (2000).  There is no header file for
4882         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
4883         # term.h) for cur_colr
4884         if test "x$cf_cv_screen" = "xcurses_colr"
4885         then
4886                 echo "$as_me:4886: checking for initscr in -lcur_colr" >&5
4887 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
4888 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
4889   echo $ECHO_N "(cached) $ECHO_C" >&6
4890 else
4891   ac_check_lib_save_LIBS=$LIBS
4892 LIBS="-lcur_colr  $LIBS"
4893 cat >conftest.$ac_ext <<_ACEOF
4894 #line 4894 "configure"
4895 #include "confdefs.h"
4896
4897 /* Override any gcc2 internal prototype to avoid an error.  */
4898 #ifdef __cplusplus
4899 extern "C"
4900 #endif
4901 /* We use char because int might match the return type of a gcc2
4902    builtin and then its argument prototype would still apply.  */
4903 char initscr ();
4904 int
4905 main ()
4906 {
4907 initscr ();
4908   ;
4909   return 0;
4910 }
4911 _ACEOF
4912 rm -f conftest.$ac_objext conftest$ac_exeext
4913 if { (eval echo "$as_me:4913: \"$ac_link\"") >&5
4914   (eval $ac_link) 2>&5
4915   ac_status=$?
4916   echo "$as_me:4916: \$? = $ac_status" >&5
4917   (exit $ac_status); } &&
4918          { ac_try='test -s conftest$ac_exeext'
4919   { (eval echo "$as_me:4919: \"$ac_try\"") >&5
4920   (eval $ac_try) 2>&5
4921   ac_status=$?
4922   echo "$as_me:4922: \$? = $ac_status" >&5
4923   (exit $ac_status); }; }; then
4924   ac_cv_lib_cur_colr_initscr=yes
4925 else
4926   echo "$as_me: failed program was:" >&5
4927 cat conftest.$ac_ext >&5
4928 ac_cv_lib_cur_colr_initscr=no
4929 fi
4930 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4931 LIBS=$ac_check_lib_save_LIBS
4932 fi
4933 echo "$as_me:4933: result: $ac_cv_lib_cur_colr_initscr" >&5
4934 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
4935 if test $ac_cv_lib_cur_colr_initscr = yes; then
4936
4937 cf_add_libs="-lcur_colr"
4938 # Filter out duplicates - this happens with badly-designed ".pc" files...
4939 for cf_add_1lib in $LIBS
4940 do
4941         for cf_add_2lib in $cf_add_libs
4942         do
4943                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4944                 then
4945                         cf_add_1lib=
4946                         break
4947                 fi
4948         done
4949         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4950 done
4951 LIBS="$cf_add_libs"
4952
4953                         ac_cv_func_initscr=yes
4954
4955 else
4956
4957                 echo "$as_me:4957: checking for initscr in -lHcurses" >&5
4958 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
4959 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
4960   echo $ECHO_N "(cached) $ECHO_C" >&6
4961 else
4962   ac_check_lib_save_LIBS=$LIBS
4963 LIBS="-lHcurses  $LIBS"
4964 cat >conftest.$ac_ext <<_ACEOF
4965 #line 4965 "configure"
4966 #include "confdefs.h"
4967
4968 /* Override any gcc2 internal prototype to avoid an error.  */
4969 #ifdef __cplusplus
4970 extern "C"
4971 #endif
4972 /* We use char because int might match the return type of a gcc2
4973    builtin and then its argument prototype would still apply.  */
4974 char initscr ();
4975 int
4976 main ()
4977 {
4978 initscr ();
4979   ;
4980   return 0;
4981 }
4982 _ACEOF
4983 rm -f conftest.$ac_objext conftest$ac_exeext
4984 if { (eval echo "$as_me:4984: \"$ac_link\"") >&5
4985   (eval $ac_link) 2>&5
4986   ac_status=$?
4987   echo "$as_me:4987: \$? = $ac_status" >&5
4988   (exit $ac_status); } &&
4989          { ac_try='test -s conftest$ac_exeext'
4990   { (eval echo "$as_me:4990: \"$ac_try\"") >&5
4991   (eval $ac_try) 2>&5
4992   ac_status=$?
4993   echo "$as_me:4993: \$? = $ac_status" >&5
4994   (exit $ac_status); }; }; then
4995   ac_cv_lib_Hcurses_initscr=yes
4996 else
4997   echo "$as_me: failed program was:" >&5
4998 cat conftest.$ac_ext >&5
4999 ac_cv_lib_Hcurses_initscr=no
5000 fi
5001 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5002 LIBS=$ac_check_lib_save_LIBS
5003 fi
5004 echo "$as_me:5004: result: $ac_cv_lib_Hcurses_initscr" >&5
5005 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5006 if test $ac_cv_lib_Hcurses_initscr = yes; then
5007
5008                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5009
5010 cf_add_libs="-lHcurses"
5011 # Filter out duplicates - this happens with badly-designed ".pc" files...
5012 for cf_add_1lib in $LIBS
5013 do
5014         for cf_add_2lib in $cf_add_libs
5015         do
5016                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5017                 then
5018                         cf_add_1lib=
5019                         break
5020                 fi
5021         done
5022         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5023 done
5024 LIBS="$cf_add_libs"
5025
5026                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5027                         ac_cv_func_initscr=yes
5028
5029 fi
5030
5031 fi
5032
5033         fi
5034         ;;
5035 linux*)
5036         case `arch 2>/dev/null` in
5037         x86_64)
5038                 if test -d /lib64
5039                 then
5040
5041 if test -n "/lib64" ; then
5042   for cf_add_libdir in /lib64
5043   do
5044     if test $cf_add_libdir = /usr/lib ; then
5045       :
5046     elif test -d $cf_add_libdir
5047     then
5048       cf_have_libdir=no
5049       if test -n "$LDFLAGS$LIBS" ; then
5050         # a loop is needed to ensure we can add subdirs of existing dirs
5051         for cf_test_libdir in $LDFLAGS $LIBS ; do
5052           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5053             cf_have_libdir=yes; break
5054           fi
5055         done
5056       fi
5057       if test "$cf_have_libdir" = no ; then
5058         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5059
5060 echo "${as_me:-configure}:5060: testing adding $cf_add_libdir to library-path ..." 1>&5
5061
5062         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5063       fi
5064     fi
5065   done
5066 fi
5067
5068                 else
5069
5070 if test -n "/lib" ; then
5071   for cf_add_libdir in /lib
5072   do
5073     if test $cf_add_libdir = /usr/lib ; then
5074       :
5075     elif test -d $cf_add_libdir
5076     then
5077       cf_have_libdir=no
5078       if test -n "$LDFLAGS$LIBS" ; then
5079         # a loop is needed to ensure we can add subdirs of existing dirs
5080         for cf_test_libdir in $LDFLAGS $LIBS ; do
5081           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5082             cf_have_libdir=yes; break
5083           fi
5084         done
5085       fi
5086       if test "$cf_have_libdir" = no ; then
5087         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5088
5089 echo "${as_me:-configure}:5089: testing adding $cf_add_libdir to library-path ..." 1>&5
5090
5091         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5092       fi
5093     fi
5094   done
5095 fi
5096
5097                 fi
5098                 ;;
5099         *)
5100
5101 if test -n "/lib" ; then
5102   for cf_add_libdir in /lib
5103   do
5104     if test $cf_add_libdir = /usr/lib ; then
5105       :
5106     elif test -d $cf_add_libdir
5107     then
5108       cf_have_libdir=no
5109       if test -n "$LDFLAGS$LIBS" ; then
5110         # a loop is needed to ensure we can add subdirs of existing dirs
5111         for cf_test_libdir in $LDFLAGS $LIBS ; do
5112           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5113             cf_have_libdir=yes; break
5114           fi
5115         done
5116       fi
5117       if test "$cf_have_libdir" = no ; then
5118         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5119
5120 echo "${as_me:-configure}:5120: testing adding $cf_add_libdir to library-path ..." 1>&5
5121
5122         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5123       fi
5124     fi
5125   done
5126 fi
5127
5128                 ;;
5129         esac
5130         ;;
5131 sunos3*|sunos4*)
5132         if test "x$cf_cv_screen" = "xcurses_5lib"
5133         then
5134                 if test -d /usr/5lib ; then
5135
5136 if test -n "/usr/5lib" ; then
5137   for cf_add_libdir in /usr/5lib
5138   do
5139     if test $cf_add_libdir = /usr/lib ; then
5140       :
5141     elif test -d $cf_add_libdir
5142     then
5143       cf_have_libdir=no
5144       if test -n "$LDFLAGS$LIBS" ; then
5145         # a loop is needed to ensure we can add subdirs of existing dirs
5146         for cf_test_libdir in $LDFLAGS $LIBS ; do
5147           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5148             cf_have_libdir=yes; break
5149           fi
5150         done
5151       fi
5152       if test "$cf_have_libdir" = no ; then
5153         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5154
5155 echo "${as_me:-configure}:5155: testing adding $cf_add_libdir to library-path ..." 1>&5
5156
5157         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5158       fi
5159     fi
5160   done
5161 fi
5162
5163 cf_add_libs="-lcurses -ltermcap"
5164 # Filter out duplicates - this happens with badly-designed ".pc" files...
5165 for cf_add_1lib in $LIBS
5166 do
5167         for cf_add_2lib in $cf_add_libs
5168         do
5169                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5170                 then
5171                         cf_add_1lib=
5172                         break
5173                 fi
5174         done
5175         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5176 done
5177 LIBS="$cf_add_libs"
5178
5179                 fi
5180     fi
5181     ac_cv_func_initscr=yes
5182     ;;
5183 esac
5184
5185 if test ".$ac_cv_func_initscr" != .yes ; then
5186         cf_save_LIBS="$LIBS"
5187
5188         if test ".${cf_cv_ncurses_version:-no}" != .no
5189         then
5190                 cf_check_list="ncurses curses cursesX"
5191         else
5192                 cf_check_list="cursesX curses ncurses"
5193         fi
5194
5195         # Check for library containing tgoto.  Do this before curses library
5196         # because it may be needed to link the test-case for initscr.
5197         if test "x$cf_term_lib" = x
5198         then
5199                 echo "$as_me:5199: checking for tgoto" >&5
5200 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5201 if test "${ac_cv_func_tgoto+set}" = set; then
5202   echo $ECHO_N "(cached) $ECHO_C" >&6
5203 else
5204   cat >conftest.$ac_ext <<_ACEOF
5205 #line 5205 "configure"
5206 #include "confdefs.h"
5207 /* System header to define __stub macros and hopefully few prototypes,
5208     which can conflict with char tgoto (); below.  */
5209 #include <assert.h>
5210 /* Override any gcc2 internal prototype to avoid an error.  */
5211 #ifdef __cplusplus
5212 extern "C"
5213 #endif
5214 /* We use char because int might match the return type of a gcc2
5215    builtin and then its argument prototype would still apply.  */
5216 char tgoto ();
5217 char (*f) ();
5218
5219 int
5220 main ()
5221 {
5222 /* The GNU C library defines this for functions which it implements
5223     to always fail with ENOSYS.  Some functions are actually named
5224     something starting with __ and the normal name is an alias.  */
5225 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5226 choke me
5227 #else
5228 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5229 #endif
5230
5231   ;
5232   return 0;
5233 }
5234 _ACEOF
5235 rm -f conftest.$ac_objext conftest$ac_exeext
5236 if { (eval echo "$as_me:5236: \"$ac_link\"") >&5
5237   (eval $ac_link) 2>&5
5238   ac_status=$?
5239   echo "$as_me:5239: \$? = $ac_status" >&5
5240   (exit $ac_status); } &&
5241          { ac_try='test -s conftest$ac_exeext'
5242   { (eval echo "$as_me:5242: \"$ac_try\"") >&5
5243   (eval $ac_try) 2>&5
5244   ac_status=$?
5245   echo "$as_me:5245: \$? = $ac_status" >&5
5246   (exit $ac_status); }; }; then
5247   ac_cv_func_tgoto=yes
5248 else
5249   echo "$as_me: failed program was:" >&5
5250 cat conftest.$ac_ext >&5
5251 ac_cv_func_tgoto=no
5252 fi
5253 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5254 fi
5255 echo "$as_me:5255: result: $ac_cv_func_tgoto" >&5
5256 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5257 if test $ac_cv_func_tgoto = yes; then
5258   cf_term_lib=predefined
5259 else
5260
5261                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5262                         do
5263                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5264 echo "$as_me:5264: checking for tgoto in -l$cf_term_lib" >&5
5265 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5266 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5267   echo $ECHO_N "(cached) $ECHO_C" >&6
5268 else
5269   ac_check_lib_save_LIBS=$LIBS
5270 LIBS="-l$cf_term_lib  $LIBS"
5271 cat >conftest.$ac_ext <<_ACEOF
5272 #line 5272 "configure"
5273 #include "confdefs.h"
5274
5275 /* Override any gcc2 internal prototype to avoid an error.  */
5276 #ifdef __cplusplus
5277 extern "C"
5278 #endif
5279 /* We use char because int might match the return type of a gcc2
5280    builtin and then its argument prototype would still apply.  */
5281 char tgoto ();
5282 int
5283 main ()
5284 {
5285 tgoto ();
5286   ;
5287   return 0;
5288 }
5289 _ACEOF
5290 rm -f conftest.$ac_objext conftest$ac_exeext
5291 if { (eval echo "$as_me:5291: \"$ac_link\"") >&5
5292   (eval $ac_link) 2>&5
5293   ac_status=$?
5294   echo "$as_me:5294: \$? = $ac_status" >&5
5295   (exit $ac_status); } &&
5296          { ac_try='test -s conftest$ac_exeext'
5297   { (eval echo "$as_me:5297: \"$ac_try\"") >&5
5298   (eval $ac_try) 2>&5
5299   ac_status=$?
5300   echo "$as_me:5300: \$? = $ac_status" >&5
5301   (exit $ac_status); }; }; then
5302   eval "$as_ac_Lib=yes"
5303 else
5304   echo "$as_me: failed program was:" >&5
5305 cat conftest.$ac_ext >&5
5306 eval "$as_ac_Lib=no"
5307 fi
5308 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5309 LIBS=$ac_check_lib_save_LIBS
5310 fi
5311 echo "$as_me:5311: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5312 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5313 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5314   break
5315 fi
5316
5317                         done
5318
5319 fi
5320
5321         fi
5322
5323         # Check for library containing initscr
5324         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5325         if test "x$cf_curs_lib" = x
5326         then
5327                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5328                 do
5329                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5330 echo "$as_me:5330: checking for initscr in -l$cf_curs_lib" >&5
5331 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5332 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5333   echo $ECHO_N "(cached) $ECHO_C" >&6
5334 else
5335   ac_check_lib_save_LIBS=$LIBS
5336 LIBS="-l$cf_curs_lib  $LIBS"
5337 cat >conftest.$ac_ext <<_ACEOF
5338 #line 5338 "configure"
5339 #include "confdefs.h"
5340
5341 /* Override any gcc2 internal prototype to avoid an error.  */
5342 #ifdef __cplusplus
5343 extern "C"
5344 #endif
5345 /* We use char because int might match the return type of a gcc2
5346    builtin and then its argument prototype would still apply.  */
5347 char initscr ();
5348 int
5349 main ()
5350 {
5351 initscr ();
5352   ;
5353   return 0;
5354 }
5355 _ACEOF
5356 rm -f conftest.$ac_objext conftest$ac_exeext
5357 if { (eval echo "$as_me:5357: \"$ac_link\"") >&5
5358   (eval $ac_link) 2>&5
5359   ac_status=$?
5360   echo "$as_me:5360: \$? = $ac_status" >&5
5361   (exit $ac_status); } &&
5362          { ac_try='test -s conftest$ac_exeext'
5363   { (eval echo "$as_me:5363: \"$ac_try\"") >&5
5364   (eval $ac_try) 2>&5
5365   ac_status=$?
5366   echo "$as_me:5366: \$? = $ac_status" >&5
5367   (exit $ac_status); }; }; then
5368   eval "$as_ac_Lib=yes"
5369 else
5370   echo "$as_me: failed program was:" >&5
5371 cat conftest.$ac_ext >&5
5372 eval "$as_ac_Lib=no"
5373 fi
5374 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5375 LIBS=$ac_check_lib_save_LIBS
5376 fi
5377 echo "$as_me:5377: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5378 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5379 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5380   break
5381 fi
5382
5383                 done
5384         fi
5385         test $cf_curs_lib = unknown && { { echo "$as_me:5385: error: no curses library found" >&5
5386 echo "$as_me: error: no curses library found" >&2;}
5387    { (exit 1); exit 1; }; }
5388
5389         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5390         if test "$cf_term_lib" = unknown ; then
5391                 echo "$as_me:5391: checking if we can link with $cf_curs_lib library" >&5
5392 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5393                 cat >conftest.$ac_ext <<_ACEOF
5394 #line 5394 "configure"
5395 #include "confdefs.h"
5396 #include <${cf_cv_ncurses_header:-curses.h}>
5397 int
5398 main ()
5399 {
5400 initscr()
5401   ;
5402   return 0;
5403 }
5404 _ACEOF
5405 rm -f conftest.$ac_objext conftest$ac_exeext
5406 if { (eval echo "$as_me:5406: \"$ac_link\"") >&5
5407   (eval $ac_link) 2>&5
5408   ac_status=$?
5409   echo "$as_me:5409: \$? = $ac_status" >&5
5410   (exit $ac_status); } &&
5411          { ac_try='test -s conftest$ac_exeext'
5412   { (eval echo "$as_me:5412: \"$ac_try\"") >&5
5413   (eval $ac_try) 2>&5
5414   ac_status=$?
5415   echo "$as_me:5415: \$? = $ac_status" >&5
5416   (exit $ac_status); }; }; then
5417   cf_result=yes
5418 else
5419   echo "$as_me: failed program was:" >&5
5420 cat conftest.$ac_ext >&5
5421 cf_result=no
5422 fi
5423 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5424                 echo "$as_me:5424: result: $cf_result" >&5
5425 echo "${ECHO_T}$cf_result" >&6
5426                 test $cf_result = no && { { echo "$as_me:5426: error: Cannot link curses library" >&5
5427 echo "$as_me: error: Cannot link curses library" >&2;}
5428    { (exit 1); exit 1; }; }
5429         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5430                 :
5431         elif test "$cf_term_lib" != predefined ; then
5432                 echo "$as_me:5432: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5433 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5434                 cat >conftest.$ac_ext <<_ACEOF
5435 #line 5435 "configure"
5436 #include "confdefs.h"
5437 #include <${cf_cv_ncurses_header:-curses.h}>
5438 int
5439 main ()
5440 {
5441 initscr(); tgoto((char *)0, 0, 0);
5442   ;
5443   return 0;
5444 }
5445 _ACEOF
5446 rm -f conftest.$ac_objext conftest$ac_exeext
5447 if { (eval echo "$as_me:5447: \"$ac_link\"") >&5
5448   (eval $ac_link) 2>&5
5449   ac_status=$?
5450   echo "$as_me:5450: \$? = $ac_status" >&5
5451   (exit $ac_status); } &&
5452          { ac_try='test -s conftest$ac_exeext'
5453   { (eval echo "$as_me:5453: \"$ac_try\"") >&5
5454   (eval $ac_try) 2>&5
5455   ac_status=$?
5456   echo "$as_me:5456: \$? = $ac_status" >&5
5457   (exit $ac_status); }; }; then
5458   cf_result=no
5459 else
5460   echo "$as_me: failed program was:" >&5
5461 cat conftest.$ac_ext >&5
5462
5463                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5464                         cat >conftest.$ac_ext <<_ACEOF
5465 #line 5465 "configure"
5466 #include "confdefs.h"
5467 #include <${cf_cv_ncurses_header:-curses.h}>
5468 int
5469 main ()
5470 {
5471 initscr()
5472   ;
5473   return 0;
5474 }
5475 _ACEOF
5476 rm -f conftest.$ac_objext conftest$ac_exeext
5477 if { (eval echo "$as_me:5477: \"$ac_link\"") >&5
5478   (eval $ac_link) 2>&5
5479   ac_status=$?
5480   echo "$as_me:5480: \$? = $ac_status" >&5
5481   (exit $ac_status); } &&
5482          { ac_try='test -s conftest$ac_exeext'
5483   { (eval echo "$as_me:5483: \"$ac_try\"") >&5
5484   (eval $ac_try) 2>&5
5485   ac_status=$?
5486   echo "$as_me:5486: \$? = $ac_status" >&5
5487   (exit $ac_status); }; }; then
5488   cf_result=yes
5489 else
5490   echo "$as_me: failed program was:" >&5
5491 cat conftest.$ac_ext >&5
5492 cf_result=error
5493 fi
5494 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5495
5496 fi
5497 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5498                 echo "$as_me:5498: result: $cf_result" >&5
5499 echo "${ECHO_T}$cf_result" >&6
5500         fi
5501 fi
5502 fi
5503
5504         ;;
5505 ncurses) #(vi
5506
5507 cf_ncuconfig_root=ncurses
5508
5509 echo "Looking for ${cf_ncuconfig_root}-config"
5510
5511 if test -n "$ac_tool_prefix"; then
5512   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5513   do
5514     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5515 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5516 echo "$as_me:5516: checking for $ac_word" >&5
5517 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5518 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5519   echo $ECHO_N "(cached) $ECHO_C" >&6
5520 else
5521   if test -n "$NCURSES_CONFIG"; then
5522   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5523 else
5524   ac_save_IFS=$IFS; IFS=$ac_path_separator
5525 ac_dummy="$PATH"
5526 for ac_dir in $ac_dummy; do
5527   IFS=$ac_save_IFS
5528   test -z "$ac_dir" && ac_dir=.
5529   $as_executable_p "$ac_dir/$ac_word" || continue
5530 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5531 echo "$as_me:5531: found $ac_dir/$ac_word" >&5
5532 break
5533 done
5534
5535 fi
5536 fi
5537 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5538 if test -n "$NCURSES_CONFIG"; then
5539   echo "$as_me:5539: result: $NCURSES_CONFIG" >&5
5540 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5541 else
5542   echo "$as_me:5542: result: no" >&5
5543 echo "${ECHO_T}no" >&6
5544 fi
5545
5546     test -n "$NCURSES_CONFIG" && break
5547   done
5548 fi
5549 if test -z "$NCURSES_CONFIG"; then
5550   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5551   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5552 do
5553   # Extract the first word of "$ac_prog", so it can be a program name with args.
5554 set dummy $ac_prog; ac_word=$2
5555 echo "$as_me:5555: checking for $ac_word" >&5
5556 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5557 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5558   echo $ECHO_N "(cached) $ECHO_C" >&6
5559 else
5560   if test -n "$ac_ct_NCURSES_CONFIG"; then
5561   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5562 else
5563   ac_save_IFS=$IFS; IFS=$ac_path_separator
5564 ac_dummy="$PATH"
5565 for ac_dir in $ac_dummy; do
5566   IFS=$ac_save_IFS
5567   test -z "$ac_dir" && ac_dir=.
5568   $as_executable_p "$ac_dir/$ac_word" || continue
5569 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5570 echo "$as_me:5570: found $ac_dir/$ac_word" >&5
5571 break
5572 done
5573
5574 fi
5575 fi
5576 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5577 if test -n "$ac_ct_NCURSES_CONFIG"; then
5578   echo "$as_me:5578: result: $ac_ct_NCURSES_CONFIG" >&5
5579 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5580 else
5581   echo "$as_me:5581: result: no" >&5
5582 echo "${ECHO_T}no" >&6
5583 fi
5584
5585   test -n "$ac_ct_NCURSES_CONFIG" && break
5586 done
5587 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5588
5589   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5590 fi
5591
5592 if test "$NCURSES_CONFIG" != none ; then
5593
5594 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5595
5596 cf_add_libs="`$NCURSES_CONFIG --libs`"
5597 # Filter out duplicates - this happens with badly-designed ".pc" files...
5598 for cf_add_1lib in $LIBS
5599 do
5600         for cf_add_2lib in $cf_add_libs
5601         do
5602                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5603                 then
5604                         cf_add_1lib=
5605                         break
5606                 fi
5607         done
5608         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5609 done
5610 LIBS="$cf_add_libs"
5611
5612 # even with config script, some packages use no-override for curses.h
5613
5614 echo "$as_me:5614: checking if we have identified curses headers" >&5
5615 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5616 if test "${cf_cv_ncurses_header+set}" = set; then
5617   echo $ECHO_N "(cached) $ECHO_C" >&6
5618 else
5619
5620 cf_cv_ncurses_header=none
5621 for cf_header in  \
5622     ncurses/ncurses.h \
5623         ncurses/curses.h \
5624         ncurses.h \
5625         curses.h
5626 do
5627 cat >conftest.$ac_ext <<_ACEOF
5628 #line 5628 "configure"
5629 #include "confdefs.h"
5630 #include <${cf_header}>
5631 int
5632 main ()
5633 {
5634 initscr(); tgoto("?", 0,0)
5635   ;
5636   return 0;
5637 }
5638 _ACEOF
5639 rm -f conftest.$ac_objext
5640 if { (eval echo "$as_me:5640: \"$ac_compile\"") >&5
5641   (eval $ac_compile) 2>&5
5642   ac_status=$?
5643   echo "$as_me:5643: \$? = $ac_status" >&5
5644   (exit $ac_status); } &&
5645          { ac_try='test -s conftest.$ac_objext'
5646   { (eval echo "$as_me:5646: \"$ac_try\"") >&5
5647   (eval $ac_try) 2>&5
5648   ac_status=$?
5649   echo "$as_me:5649: \$? = $ac_status" >&5
5650   (exit $ac_status); }; }; then
5651   cf_cv_ncurses_header=$cf_header; break
5652 else
5653   echo "$as_me: failed program was:" >&5
5654 cat conftest.$ac_ext >&5
5655 fi
5656 rm -f conftest.$ac_objext conftest.$ac_ext
5657 done
5658
5659 fi
5660 echo "$as_me:5660: result: $cf_cv_ncurses_header" >&5
5661 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5662
5663 if test "$cf_cv_ncurses_header" = none ; then
5664         { { echo "$as_me:5664: error: No curses header-files found" >&5
5665 echo "$as_me: error: No curses header-files found" >&2;}
5666    { (exit 1); exit 1; }; }
5667 fi
5668
5669 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5670
5671 for ac_header in $cf_cv_ncurses_header
5672 do
5673 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5674 echo "$as_me:5674: checking for $ac_header" >&5
5675 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5676 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5677   echo $ECHO_N "(cached) $ECHO_C" >&6
5678 else
5679   cat >conftest.$ac_ext <<_ACEOF
5680 #line 5680 "configure"
5681 #include "confdefs.h"
5682 #include <$ac_header>
5683 _ACEOF
5684 if { (eval echo "$as_me:5684: \"$ac_cpp conftest.$ac_ext\"") >&5
5685   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5686   ac_status=$?
5687   egrep -v '^ *\+' conftest.er1 >conftest.err
5688   rm -f conftest.er1
5689   cat conftest.err >&5
5690   echo "$as_me:5690: \$? = $ac_status" >&5
5691   (exit $ac_status); } >/dev/null; then
5692   if test -s conftest.err; then
5693     ac_cpp_err=$ac_c_preproc_warn_flag
5694   else
5695     ac_cpp_err=
5696   fi
5697 else
5698   ac_cpp_err=yes
5699 fi
5700 if test -z "$ac_cpp_err"; then
5701   eval "$as_ac_Header=yes"
5702 else
5703   echo "$as_me: failed program was:" >&5
5704   cat conftest.$ac_ext >&5
5705   eval "$as_ac_Header=no"
5706 fi
5707 rm -f conftest.err conftest.$ac_ext
5708 fi
5709 echo "$as_me:5709: result: `eval echo '${'$as_ac_Header'}'`" >&5
5710 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5711 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5712   cat >>confdefs.h <<EOF
5713 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5714 EOF
5715
5716 fi
5717 done
5718
5719 cat >>confdefs.h <<\EOF
5720 #define NCURSES 1
5721 EOF
5722
5723 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5724
5725 cat >>confdefs.h <<EOF
5726 #define $cf_nculib_ROOT 1
5727 EOF
5728
5729 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5730
5731 else
5732
5733 cf_ncuhdr_root=ncurses
5734
5735 test -n "$cf_cv_curses_dir" && \
5736 test "$cf_cv_curses_dir" != "no" && { \
5737
5738 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5739   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5740   do
5741         while test $cf_add_incdir != /usr/include
5742         do
5743           if test -d $cf_add_incdir
5744           then
5745                 cf_have_incdir=no
5746                 if test -n "$CFLAGS$CPPFLAGS" ; then
5747                   # a loop is needed to ensure we can add subdirs of existing dirs
5748                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5749                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5750                           cf_have_incdir=yes; break
5751                         fi
5752                   done
5753                 fi
5754
5755                 if test "$cf_have_incdir" = no ; then
5756                   if test "$cf_add_incdir" = /usr/local/include ; then
5757                         if test "$GCC" = yes
5758                         then
5759                           cf_save_CPPFLAGS=$CPPFLAGS
5760                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5761                           cat >conftest.$ac_ext <<_ACEOF
5762 #line 5762 "configure"
5763 #include "confdefs.h"
5764 #include <stdio.h>
5765 int
5766 main ()
5767 {
5768 printf("Hello")
5769   ;
5770   return 0;
5771 }
5772 _ACEOF
5773 rm -f conftest.$ac_objext
5774 if { (eval echo "$as_me:5774: \"$ac_compile\"") >&5
5775   (eval $ac_compile) 2>&5
5776   ac_status=$?
5777   echo "$as_me:5777: \$? = $ac_status" >&5
5778   (exit $ac_status); } &&
5779          { ac_try='test -s conftest.$ac_objext'
5780   { (eval echo "$as_me:5780: \"$ac_try\"") >&5
5781   (eval $ac_try) 2>&5
5782   ac_status=$?
5783   echo "$as_me:5783: \$? = $ac_status" >&5
5784   (exit $ac_status); }; }; then
5785   :
5786 else
5787   echo "$as_me: failed program was:" >&5
5788 cat conftest.$ac_ext >&5
5789 cf_have_incdir=yes
5790 fi
5791 rm -f conftest.$ac_objext conftest.$ac_ext
5792                           CPPFLAGS=$cf_save_CPPFLAGS
5793                         fi
5794                   fi
5795                 fi
5796
5797                 if test "$cf_have_incdir" = no ; then
5798                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5799
5800 echo "${as_me:-configure}:5800: testing adding $cf_add_incdir to include-path ..." 1>&5
5801
5802                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5803
5804                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5805                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5806                   cf_add_incdir="$cf_top_incdir"
5807                 else
5808                   break
5809                 fi
5810           fi
5811         done
5812   done
5813 fi
5814
5815 }
5816
5817 echo "$as_me:5817: checking for $cf_ncuhdr_root header in include-path" >&5
5818 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5819 if test "${cf_cv_ncurses_h+set}" = set; then
5820   echo $ECHO_N "(cached) $ECHO_C" >&6
5821 else
5822
5823         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5824         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5825         for cf_header in $cf_header_list
5826         do
5827
5828         cat >conftest.$ac_ext <<_ACEOF
5829 #line 5829 "configure"
5830 #include "confdefs.h"
5831
5832 #include <$cf_header>
5833 int
5834 main ()
5835 {
5836
5837 #ifdef NCURSES_VERSION
5838
5839 printf("%s\n", NCURSES_VERSION);
5840 #else
5841 #ifdef __NCURSES_H
5842 printf("old\n");
5843 #else
5844         make an error
5845 #endif
5846 #endif
5847
5848   ;
5849   return 0;
5850 }
5851 _ACEOF
5852 rm -f conftest.$ac_objext
5853 if { (eval echo "$as_me:5853: \"$ac_compile\"") >&5
5854   (eval $ac_compile) 2>&5
5855   ac_status=$?
5856   echo "$as_me:5856: \$? = $ac_status" >&5
5857   (exit $ac_status); } &&
5858          { ac_try='test -s conftest.$ac_objext'
5859   { (eval echo "$as_me:5859: \"$ac_try\"") >&5
5860   (eval $ac_try) 2>&5
5861   ac_status=$?
5862   echo "$as_me:5862: \$? = $ac_status" >&5
5863   (exit $ac_status); }; }; then
5864   cf_cv_ncurses_h=$cf_header
5865
5866 else
5867   echo "$as_me: failed program was:" >&5
5868 cat conftest.$ac_ext >&5
5869 cf_cv_ncurses_h=no
5870 fi
5871 rm -f conftest.$ac_objext conftest.$ac_ext
5872
5873                 test "$cf_cv_ncurses_h" != no && break
5874         done
5875
5876 fi
5877 echo "$as_me:5877: result: $cf_cv_ncurses_h" >&5
5878 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5879
5880 if test "$cf_cv_ncurses_h" != no ; then
5881         cf_cv_ncurses_header=$cf_cv_ncurses_h
5882 else
5883
5884 echo "$as_me:5884: checking for $cf_ncuhdr_root include-path" >&5
5885 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5886 if test "${cf_cv_ncurses_h2+set}" = set; then
5887   echo $ECHO_N "(cached) $ECHO_C" >&6
5888 else
5889
5890         test -n "$verbose" && echo
5891
5892 cf_search=
5893
5894 # collect the current set of include-directories from compiler flags
5895 cf_header_path_list=""
5896 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5897         for cf_header_path in $CPPFLAGS $CFLAGS
5898         do
5899                 case $cf_header_path in #(vi
5900                 -I*)
5901                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5902
5903 test "x$cf_header_path" != "xNONE" && \
5904 test -d "$cf_header_path" && \
5905  {
5906         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5907         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5908         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5909         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5910         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5911         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"
5912 }
5913
5914                         cf_header_path_list="$cf_header_path_list $cf_search"
5915                         ;;
5916                 esac
5917         done
5918 fi
5919
5920 # add the variations for the package we are looking for
5921
5922 cf_search=
5923
5924 test "x/usr" != "x$prefix" && \
5925 test -d "/usr" && \
5926 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
5927         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
5928         test -d /usr/include &&          cf_search="$cf_search /usr/include"
5929         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
5930         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
5931         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
5932         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5933 }
5934
5935 test "x$prefix" != "xNONE" && \
5936 test -d "$prefix" && \
5937  {
5938         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5939         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5940         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5941         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5942         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5943         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5944 }
5945
5946 test "x/usr/local" != "x$prefix" && \
5947 test -d "/usr/local" && \
5948 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
5949         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
5950         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
5951         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
5952         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
5953         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
5954         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5955 }
5956
5957 test "x/opt" != "x$prefix" && \
5958 test -d "/opt" && \
5959 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
5960         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
5961         test -d /opt/include &&          cf_search="$cf_search /opt/include"
5962         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
5963         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
5964         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
5965         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5966 }
5967
5968 test "x$HOME" != "x$prefix" && \
5969 test -d "$HOME" && \
5970 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
5971         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
5972         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
5973         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
5974         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
5975         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
5976         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5977 }
5978
5979 test "$includedir" != NONE && \
5980 test "$includedir" != "/usr/include" && \
5981 test -d "$includedir" && {
5982         test -d $includedir &&    cf_search="$cf_search $includedir"
5983         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5984 }
5985
5986 test "$oldincludedir" != NONE && \
5987 test "$oldincludedir" != "/usr/include" && \
5988 test -d "$oldincludedir" && {
5989         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5990         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5991 }
5992
5993 cf_search="$cf_search $cf_header_path_list"
5994
5995         test -n "$verbose" && echo search path $cf_search
5996         cf_save2_CPPFLAGS="$CPPFLAGS"
5997         for cf_incdir in $cf_search
5998         do
5999
6000 if test -n "$cf_incdir" ; then
6001   for cf_add_incdir in $cf_incdir
6002   do
6003         while test $cf_add_incdir != /usr/include
6004         do
6005           if test -d $cf_add_incdir
6006           then
6007                 cf_have_incdir=no
6008                 if test -n "$CFLAGS$CPPFLAGS" ; then
6009                   # a loop is needed to ensure we can add subdirs of existing dirs
6010                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6011                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6012                           cf_have_incdir=yes; break
6013                         fi
6014                   done
6015                 fi
6016
6017                 if test "$cf_have_incdir" = no ; then
6018                   if test "$cf_add_incdir" = /usr/local/include ; then
6019                         if test "$GCC" = yes
6020                         then
6021                           cf_save_CPPFLAGS=$CPPFLAGS
6022                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6023                           cat >conftest.$ac_ext <<_ACEOF
6024 #line 6024 "configure"
6025 #include "confdefs.h"
6026 #include <stdio.h>
6027 int
6028 main ()
6029 {
6030 printf("Hello")
6031   ;
6032   return 0;
6033 }
6034 _ACEOF
6035 rm -f conftest.$ac_objext
6036 if { (eval echo "$as_me:6036: \"$ac_compile\"") >&5
6037   (eval $ac_compile) 2>&5
6038   ac_status=$?
6039   echo "$as_me:6039: \$? = $ac_status" >&5
6040   (exit $ac_status); } &&
6041          { ac_try='test -s conftest.$ac_objext'
6042   { (eval echo "$as_me:6042: \"$ac_try\"") >&5
6043   (eval $ac_try) 2>&5
6044   ac_status=$?
6045   echo "$as_me:6045: \$? = $ac_status" >&5
6046   (exit $ac_status); }; }; then
6047   :
6048 else
6049   echo "$as_me: failed program was:" >&5
6050 cat conftest.$ac_ext >&5
6051 cf_have_incdir=yes
6052 fi
6053 rm -f conftest.$ac_objext conftest.$ac_ext
6054                           CPPFLAGS=$cf_save_CPPFLAGS
6055                         fi
6056                   fi
6057                 fi
6058
6059                 if test "$cf_have_incdir" = no ; then
6060                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6061
6062 echo "${as_me:-configure}:6062: testing adding $cf_add_incdir to include-path ..." 1>&5
6063
6064                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6065
6066                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6067                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6068                   cf_add_incdir="$cf_top_incdir"
6069                 else
6070                   break
6071                 fi
6072           fi
6073         done
6074   done
6075 fi
6076
6077                 for cf_header in \
6078                         ncurses.h \
6079                         curses.h
6080                 do
6081
6082         cat >conftest.$ac_ext <<_ACEOF
6083 #line 6083 "configure"
6084 #include "confdefs.h"
6085
6086 #include <$cf_header>
6087 int
6088 main ()
6089 {
6090
6091 #ifdef NCURSES_VERSION
6092
6093 printf("%s\n", NCURSES_VERSION);
6094 #else
6095 #ifdef __NCURSES_H
6096 printf("old\n");
6097 #else
6098         make an error
6099 #endif
6100 #endif
6101
6102   ;
6103   return 0;
6104 }
6105 _ACEOF
6106 rm -f conftest.$ac_objext
6107 if { (eval echo "$as_me:6107: \"$ac_compile\"") >&5
6108   (eval $ac_compile) 2>&5
6109   ac_status=$?
6110   echo "$as_me:6110: \$? = $ac_status" >&5
6111   (exit $ac_status); } &&
6112          { ac_try='test -s conftest.$ac_objext'
6113   { (eval echo "$as_me:6113: \"$ac_try\"") >&5
6114   (eval $ac_try) 2>&5
6115   ac_status=$?
6116   echo "$as_me:6116: \$? = $ac_status" >&5
6117   (exit $ac_status); }; }; then
6118   cf_cv_ncurses_h2=$cf_header
6119
6120 else
6121   echo "$as_me: failed program was:" >&5
6122 cat conftest.$ac_ext >&5
6123 cf_cv_ncurses_h2=no
6124 fi
6125 rm -f conftest.$ac_objext conftest.$ac_ext
6126
6127                         if test "$cf_cv_ncurses_h2" != no ; then
6128                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6129                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6130                                 break
6131                         fi
6132                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6133                 done
6134                 CPPFLAGS="$cf_save2_CPPFLAGS"
6135                 test "$cf_cv_ncurses_h2" != no && break
6136         done
6137         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6137: error: not found" >&5
6138 echo "$as_me: error: not found" >&2;}
6139    { (exit 1); exit 1; }; }
6140
6141 fi
6142 echo "$as_me:6142: result: $cf_cv_ncurses_h2" >&5
6143 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6144
6145         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6146         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6147         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6148                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6149         fi
6150
6151 if test -n "$cf_1st_incdir" ; then
6152   for cf_add_incdir in $cf_1st_incdir
6153   do
6154         while test $cf_add_incdir != /usr/include
6155         do
6156           if test -d $cf_add_incdir
6157           then
6158                 cf_have_incdir=no
6159                 if test -n "$CFLAGS$CPPFLAGS" ; then
6160                   # a loop is needed to ensure we can add subdirs of existing dirs
6161                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6162                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6163                           cf_have_incdir=yes; break
6164                         fi
6165                   done
6166                 fi
6167
6168                 if test "$cf_have_incdir" = no ; then
6169                   if test "$cf_add_incdir" = /usr/local/include ; then
6170                         if test "$GCC" = yes
6171                         then
6172                           cf_save_CPPFLAGS=$CPPFLAGS
6173                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6174                           cat >conftest.$ac_ext <<_ACEOF
6175 #line 6175 "configure"
6176 #include "confdefs.h"
6177 #include <stdio.h>
6178 int
6179 main ()
6180 {
6181 printf("Hello")
6182   ;
6183   return 0;
6184 }
6185 _ACEOF
6186 rm -f conftest.$ac_objext
6187 if { (eval echo "$as_me:6187: \"$ac_compile\"") >&5
6188   (eval $ac_compile) 2>&5
6189   ac_status=$?
6190   echo "$as_me:6190: \$? = $ac_status" >&5
6191   (exit $ac_status); } &&
6192          { ac_try='test -s conftest.$ac_objext'
6193   { (eval echo "$as_me:6193: \"$ac_try\"") >&5
6194   (eval $ac_try) 2>&5
6195   ac_status=$?
6196   echo "$as_me:6196: \$? = $ac_status" >&5
6197   (exit $ac_status); }; }; then
6198   :
6199 else
6200   echo "$as_me: failed program was:" >&5
6201 cat conftest.$ac_ext >&5
6202 cf_have_incdir=yes
6203 fi
6204 rm -f conftest.$ac_objext conftest.$ac_ext
6205                           CPPFLAGS=$cf_save_CPPFLAGS
6206                         fi
6207                   fi
6208                 fi
6209
6210                 if test "$cf_have_incdir" = no ; then
6211                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6212
6213 echo "${as_me:-configure}:6213: testing adding $cf_add_incdir to include-path ..." 1>&5
6214
6215                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6216
6217                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6218                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6219                   cf_add_incdir="$cf_top_incdir"
6220                 else
6221                   break
6222                 fi
6223           fi
6224         done
6225   done
6226 fi
6227
6228 fi
6229
6230 # Set definitions to allow ifdef'ing for ncurses.h
6231
6232 case $cf_cv_ncurses_header in # (vi
6233 *ncurses.h)
6234
6235 cat >>confdefs.h <<\EOF
6236 #define HAVE_NCURSES_H 1
6237 EOF
6238
6239         ;;
6240 esac
6241
6242 case $cf_cv_ncurses_header in # (vi
6243 ncurses/curses.h|ncurses/ncurses.h)
6244
6245 cat >>confdefs.h <<\EOF
6246 #define HAVE_NCURSES_NCURSES_H 1
6247 EOF
6248
6249         ;;
6250 ncursesw/curses.h|ncursesw/ncurses.h)
6251
6252 cat >>confdefs.h <<\EOF
6253 #define HAVE_NCURSESW_NCURSES_H 1
6254 EOF
6255
6256         ;;
6257 esac
6258
6259 echo "$as_me:6259: checking for terminfo header" >&5
6260 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6261 if test "${cf_cv_term_header+set}" = set; then
6262   echo $ECHO_N "(cached) $ECHO_C" >&6
6263 else
6264
6265 case ${cf_cv_ncurses_header} in #(vi
6266 */ncurses.h|*/ncursesw.h) #(vi
6267         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6268         ;;
6269 *)
6270         cf_term_header=term.h
6271         ;;
6272 esac
6273
6274 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6275 do
6276 cat >conftest.$ac_ext <<_ACEOF
6277 #line 6277 "configure"
6278 #include "confdefs.h"
6279 #include <stdio.h>
6280 #include <${cf_cv_ncurses_header:-curses.h}>
6281 #include <$cf_test>
6282
6283 int
6284 main ()
6285 {
6286 int x = auto_left_margin
6287   ;
6288   return 0;
6289 }
6290 _ACEOF
6291 rm -f conftest.$ac_objext
6292 if { (eval echo "$as_me:6292: \"$ac_compile\"") >&5
6293   (eval $ac_compile) 2>&5
6294   ac_status=$?
6295   echo "$as_me:6295: \$? = $ac_status" >&5
6296   (exit $ac_status); } &&
6297          { ac_try='test -s conftest.$ac_objext'
6298   { (eval echo "$as_me:6298: \"$ac_try\"") >&5
6299   (eval $ac_try) 2>&5
6300   ac_status=$?
6301   echo "$as_me:6301: \$? = $ac_status" >&5
6302   (exit $ac_status); }; }; then
6303
6304         cf_cv_term_header="$cf_test"
6305 else
6306   echo "$as_me: failed program was:" >&5
6307 cat conftest.$ac_ext >&5
6308
6309         cf_cv_term_header=unknown
6310
6311 fi
6312 rm -f conftest.$ac_objext conftest.$ac_ext
6313         test "$cf_cv_term_header" != unknown && break
6314 done
6315
6316 fi
6317 echo "$as_me:6317: result: $cf_cv_term_header" >&5
6318 echo "${ECHO_T}$cf_cv_term_header" >&6
6319
6320 # Set definitions to allow ifdef'ing to accommodate subdirectories
6321
6322 case $cf_cv_term_header in # (vi
6323 *term.h)
6324
6325 cat >>confdefs.h <<\EOF
6326 #define HAVE_TERM_H 1
6327 EOF
6328
6329         ;;
6330 esac
6331
6332 case $cf_cv_term_header in # (vi
6333 ncurses/term.h) #(vi
6334
6335 cat >>confdefs.h <<\EOF
6336 #define HAVE_NCURSES_TERM_H 1
6337 EOF
6338
6339         ;;
6340 ncursesw/term.h)
6341
6342 cat >>confdefs.h <<\EOF
6343 #define HAVE_NCURSESW_TERM_H 1
6344 EOF
6345
6346         ;;
6347 esac
6348
6349 # some applications need this, but should check for NCURSES_VERSION
6350
6351 cat >>confdefs.h <<\EOF
6352 #define NCURSES 1
6353 EOF
6354
6355 echo "$as_me:6355: checking for ncurses version" >&5
6356 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6357 if test "${cf_cv_ncurses_version+set}" = set; then
6358   echo $ECHO_N "(cached) $ECHO_C" >&6
6359 else
6360
6361         cf_cv_ncurses_version=no
6362         cf_tempfile=out$$
6363         rm -f $cf_tempfile
6364         if test "$cross_compiling" = yes; then
6365
6366         # This will not work if the preprocessor splits the line after the
6367         # Autoconf token.  The 'unproto' program does that.
6368         cat > conftest.$ac_ext <<EOF
6369 #include <${cf_cv_ncurses_header:-curses.h}>
6370 #undef Autoconf
6371 #ifdef NCURSES_VERSION
6372 Autoconf NCURSES_VERSION
6373 #else
6374 #ifdef __NCURSES_H
6375 Autoconf "old"
6376 #endif
6377 ;
6378 #endif
6379 EOF
6380         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6381         { (eval echo "$as_me:6381: \"$cf_try\"") >&5
6382   (eval $cf_try) 2>&5
6383   ac_status=$?
6384   echo "$as_me:6384: \$? = $ac_status" >&5
6385   (exit $ac_status); }
6386         if test -f conftest.out ; then
6387                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6388                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6389                 rm -f conftest.out
6390         fi
6391
6392 else
6393   cat >conftest.$ac_ext <<_ACEOF
6394 #line 6394 "configure"
6395 #include "confdefs.h"
6396
6397 #include <${cf_cv_ncurses_header:-curses.h}>
6398 #include <stdio.h>
6399 int main()
6400 {
6401         FILE *fp = fopen("$cf_tempfile", "w");
6402 #ifdef NCURSES_VERSION
6403 # ifdef NCURSES_VERSION_PATCH
6404         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6405 # else
6406         fprintf(fp, "%s\n", NCURSES_VERSION);
6407 # endif
6408 #else
6409 # ifdef __NCURSES_H
6410         fprintf(fp, "old\n");
6411 # else
6412         make an error
6413 # endif
6414 #endif
6415         ${cf_cv_main_return:-return}(0);
6416 }
6417 _ACEOF
6418 rm -f conftest$ac_exeext
6419 if { (eval echo "$as_me:6419: \"$ac_link\"") >&5
6420   (eval $ac_link) 2>&5
6421   ac_status=$?
6422   echo "$as_me:6422: \$? = $ac_status" >&5
6423   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6424   { (eval echo "$as_me:6424: \"$ac_try\"") >&5
6425   (eval $ac_try) 2>&5
6426   ac_status=$?
6427   echo "$as_me:6427: \$? = $ac_status" >&5
6428   (exit $ac_status); }; }; then
6429
6430         cf_cv_ncurses_version=`cat $cf_tempfile`
6431 else
6432   echo "$as_me: program exited with status $ac_status" >&5
6433 echo "$as_me: failed program was:" >&5
6434 cat conftest.$ac_ext >&5
6435 fi
6436 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6437 fi
6438         rm -f $cf_tempfile
6439
6440 fi
6441 echo "$as_me:6441: result: $cf_cv_ncurses_version" >&5
6442 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6443 test "$cf_cv_ncurses_version" = no ||
6444 cat >>confdefs.h <<\EOF
6445 #define NCURSES 1
6446 EOF
6447
6448 cf_nculib_root=ncurses
6449         # This works, except for the special case where we find gpm, but
6450         # ncurses is in a nonstandard location via $LIBS, and we really want
6451         # to link gpm.
6452 cf_ncurses_LIBS=""
6453 cf_ncurses_SAVE="$LIBS"
6454 echo "$as_me:6454: checking for Gpm_Open in -lgpm" >&5
6455 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6456 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6457   echo $ECHO_N "(cached) $ECHO_C" >&6
6458 else
6459   ac_check_lib_save_LIBS=$LIBS
6460 LIBS="-lgpm  $LIBS"
6461 cat >conftest.$ac_ext <<_ACEOF
6462 #line 6462 "configure"
6463 #include "confdefs.h"
6464
6465 /* Override any gcc2 internal prototype to avoid an error.  */
6466 #ifdef __cplusplus
6467 extern "C"
6468 #endif
6469 /* We use char because int might match the return type of a gcc2
6470    builtin and then its argument prototype would still apply.  */
6471 char Gpm_Open ();
6472 int
6473 main ()
6474 {
6475 Gpm_Open ();
6476   ;
6477   return 0;
6478 }
6479 _ACEOF
6480 rm -f conftest.$ac_objext conftest$ac_exeext
6481 if { (eval echo "$as_me:6481: \"$ac_link\"") >&5
6482   (eval $ac_link) 2>&5
6483   ac_status=$?
6484   echo "$as_me:6484: \$? = $ac_status" >&5
6485   (exit $ac_status); } &&
6486          { ac_try='test -s conftest$ac_exeext'
6487   { (eval echo "$as_me:6487: \"$ac_try\"") >&5
6488   (eval $ac_try) 2>&5
6489   ac_status=$?
6490   echo "$as_me:6490: \$? = $ac_status" >&5
6491   (exit $ac_status); }; }; then
6492   ac_cv_lib_gpm_Gpm_Open=yes
6493 else
6494   echo "$as_me: failed program was:" >&5
6495 cat conftest.$ac_ext >&5
6496 ac_cv_lib_gpm_Gpm_Open=no
6497 fi
6498 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6499 LIBS=$ac_check_lib_save_LIBS
6500 fi
6501 echo "$as_me:6501: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6502 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6503 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6504   echo "$as_me:6504: checking for initscr in -lgpm" >&5
6505 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6506 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6507   echo $ECHO_N "(cached) $ECHO_C" >&6
6508 else
6509   ac_check_lib_save_LIBS=$LIBS
6510 LIBS="-lgpm  $LIBS"
6511 cat >conftest.$ac_ext <<_ACEOF
6512 #line 6512 "configure"
6513 #include "confdefs.h"
6514
6515 /* Override any gcc2 internal prototype to avoid an error.  */
6516 #ifdef __cplusplus
6517 extern "C"
6518 #endif
6519 /* We use char because int might match the return type of a gcc2
6520    builtin and then its argument prototype would still apply.  */
6521 char initscr ();
6522 int
6523 main ()
6524 {
6525 initscr ();
6526   ;
6527   return 0;
6528 }
6529 _ACEOF
6530 rm -f conftest.$ac_objext conftest$ac_exeext
6531 if { (eval echo "$as_me:6531: \"$ac_link\"") >&5
6532   (eval $ac_link) 2>&5
6533   ac_status=$?
6534   echo "$as_me:6534: \$? = $ac_status" >&5
6535   (exit $ac_status); } &&
6536          { ac_try='test -s conftest$ac_exeext'
6537   { (eval echo "$as_me:6537: \"$ac_try\"") >&5
6538   (eval $ac_try) 2>&5
6539   ac_status=$?
6540   echo "$as_me:6540: \$? = $ac_status" >&5
6541   (exit $ac_status); }; }; then
6542   ac_cv_lib_gpm_initscr=yes
6543 else
6544   echo "$as_me: failed program was:" >&5
6545 cat conftest.$ac_ext >&5
6546 ac_cv_lib_gpm_initscr=no
6547 fi
6548 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6549 LIBS=$ac_check_lib_save_LIBS
6550 fi
6551 echo "$as_me:6551: result: $ac_cv_lib_gpm_initscr" >&5
6552 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6553 if test $ac_cv_lib_gpm_initscr = yes; then
6554   LIBS="$cf_ncurses_SAVE"
6555 else
6556   cf_ncurses_LIBS="-lgpm"
6557 fi
6558
6559 fi
6560
6561 case $host_os in #(vi
6562 freebsd*)
6563         # This is only necessary if you are linking against an obsolete
6564         # version of ncurses (but it should do no harm, since it's static).
6565         if test "$cf_nculib_root" = ncurses ; then
6566                 echo "$as_me:6566: checking for tgoto in -lmytinfo" >&5
6567 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6568 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6569   echo $ECHO_N "(cached) $ECHO_C" >&6
6570 else
6571   ac_check_lib_save_LIBS=$LIBS
6572 LIBS="-lmytinfo  $LIBS"
6573 cat >conftest.$ac_ext <<_ACEOF
6574 #line 6574 "configure"
6575 #include "confdefs.h"
6576
6577 /* Override any gcc2 internal prototype to avoid an error.  */
6578 #ifdef __cplusplus
6579 extern "C"
6580 #endif
6581 /* We use char because int might match the return type of a gcc2
6582    builtin and then its argument prototype would still apply.  */
6583 char tgoto ();
6584 int
6585 main ()
6586 {
6587 tgoto ();
6588   ;
6589   return 0;
6590 }
6591 _ACEOF
6592 rm -f conftest.$ac_objext conftest$ac_exeext
6593 if { (eval echo "$as_me:6593: \"$ac_link\"") >&5
6594   (eval $ac_link) 2>&5
6595   ac_status=$?
6596   echo "$as_me:6596: \$? = $ac_status" >&5
6597   (exit $ac_status); } &&
6598          { ac_try='test -s conftest$ac_exeext'
6599   { (eval echo "$as_me:6599: \"$ac_try\"") >&5
6600   (eval $ac_try) 2>&5
6601   ac_status=$?
6602   echo "$as_me:6602: \$? = $ac_status" >&5
6603   (exit $ac_status); }; }; then
6604   ac_cv_lib_mytinfo_tgoto=yes
6605 else
6606   echo "$as_me: failed program was:" >&5
6607 cat conftest.$ac_ext >&5
6608 ac_cv_lib_mytinfo_tgoto=no
6609 fi
6610 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6611 LIBS=$ac_check_lib_save_LIBS
6612 fi
6613 echo "$as_me:6613: result: $ac_cv_lib_mytinfo_tgoto" >&5
6614 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6615 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6616   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6617 fi
6618
6619         fi
6620         ;;
6621 esac
6622
6623 cf_add_libs="$cf_ncurses_LIBS"
6624 # Filter out duplicates - this happens with badly-designed ".pc" files...
6625 for cf_add_1lib in $LIBS
6626 do
6627         for cf_add_2lib in $cf_add_libs
6628         do
6629                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6630                 then
6631                         cf_add_1lib=
6632                         break
6633                 fi
6634         done
6635         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6636 done
6637 LIBS="$cf_add_libs"
6638
6639 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6640 then
6641
6642 cf_add_libs="-l$cf_nculib_root"
6643 # Filter out duplicates - this happens with badly-designed ".pc" files...
6644 for cf_add_1lib in $LIBS
6645 do
6646         for cf_add_2lib in $cf_add_libs
6647         do
6648                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6649                 then
6650                         cf_add_1lib=
6651                         break
6652                 fi
6653         done
6654         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6655 done
6656 LIBS="$cf_add_libs"
6657
6658 else
6659
6660         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6661         cf_libdir=""
6662         echo "$as_me:6662: checking for initscr" >&5
6663 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6664 if test "${ac_cv_func_initscr+set}" = set; then
6665   echo $ECHO_N "(cached) $ECHO_C" >&6
6666 else
6667   cat >conftest.$ac_ext <<_ACEOF
6668 #line 6668 "configure"
6669 #include "confdefs.h"
6670 /* System header to define __stub macros and hopefully few prototypes,
6671     which can conflict with char initscr (); below.  */
6672 #include <assert.h>
6673 /* Override any gcc2 internal prototype to avoid an error.  */
6674 #ifdef __cplusplus
6675 extern "C"
6676 #endif
6677 /* We use char because int might match the return type of a gcc2
6678    builtin and then its argument prototype would still apply.  */
6679 char initscr ();
6680 char (*f) ();
6681
6682 int
6683 main ()
6684 {
6685 /* The GNU C library defines this for functions which it implements
6686     to always fail with ENOSYS.  Some functions are actually named
6687     something starting with __ and the normal name is an alias.  */
6688 #if defined (__stub_initscr) || defined (__stub___initscr)
6689 choke me
6690 #else
6691 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6692 #endif
6693
6694   ;
6695   return 0;
6696 }
6697 _ACEOF
6698 rm -f conftest.$ac_objext conftest$ac_exeext
6699 if { (eval echo "$as_me:6699: \"$ac_link\"") >&5
6700   (eval $ac_link) 2>&5
6701   ac_status=$?
6702   echo "$as_me:6702: \$? = $ac_status" >&5
6703   (exit $ac_status); } &&
6704          { ac_try='test -s conftest$ac_exeext'
6705   { (eval echo "$as_me:6705: \"$ac_try\"") >&5
6706   (eval $ac_try) 2>&5
6707   ac_status=$?
6708   echo "$as_me:6708: \$? = $ac_status" >&5
6709   (exit $ac_status); }; }; then
6710   ac_cv_func_initscr=yes
6711 else
6712   echo "$as_me: failed program was:" >&5
6713 cat conftest.$ac_ext >&5
6714 ac_cv_func_initscr=no
6715 fi
6716 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6717 fi
6718 echo "$as_me:6718: result: $ac_cv_func_initscr" >&5
6719 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6720 if test $ac_cv_func_initscr = yes; then
6721   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6722 else
6723
6724                 cf_save_LIBS="$LIBS"
6725                 echo "$as_me:6725: checking for initscr in -l$cf_nculib_root" >&5
6726 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6727                 LIBS="-l$cf_nculib_root $LIBS"
6728                 cat >conftest.$ac_ext <<_ACEOF
6729 #line 6729 "configure"
6730 #include "confdefs.h"
6731 #include <${cf_cv_ncurses_header:-curses.h}>
6732 int
6733 main ()
6734 {
6735 initscr()
6736   ;
6737   return 0;
6738 }
6739 _ACEOF
6740 rm -f conftest.$ac_objext conftest$ac_exeext
6741 if { (eval echo "$as_me:6741: \"$ac_link\"") >&5
6742   (eval $ac_link) 2>&5
6743   ac_status=$?
6744   echo "$as_me:6744: \$? = $ac_status" >&5
6745   (exit $ac_status); } &&
6746          { ac_try='test -s conftest$ac_exeext'
6747   { (eval echo "$as_me:6747: \"$ac_try\"") >&5
6748   (eval $ac_try) 2>&5
6749   ac_status=$?
6750   echo "$as_me:6750: \$? = $ac_status" >&5
6751   (exit $ac_status); }; }; then
6752   echo "$as_me:6752: result: yes" >&5
6753 echo "${ECHO_T}yes" >&6
6754                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6755
6756 else
6757   echo "$as_me: failed program was:" >&5
6758 cat conftest.$ac_ext >&5
6759 echo "$as_me:6759: result: no" >&5
6760 echo "${ECHO_T}no" >&6
6761
6762 cf_search=
6763 cf_library_path_list=""
6764 if test -n "${LDFLAGS}${LIBS}" ; then
6765         for cf_library_path in $LDFLAGS $LIBS
6766         do
6767                 case $cf_library_path in #(vi
6768                 -L*)
6769                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6770
6771 test "x$cf_library_path" != "xNONE" && \
6772 test -d "$cf_library_path" && \
6773  {
6774         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6775         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6776         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6777         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6778         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6779         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"
6780 }
6781
6782                         cf_library_path_list="$cf_library_path_list $cf_search"
6783                         ;;
6784                 esac
6785         done
6786 fi
6787
6788 cf_search=
6789
6790 test "x/usr" != "x$prefix" && \
6791 test -d "/usr" && \
6792 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
6793         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6794         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6795         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
6796         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
6797         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
6798         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
6799 }
6800
6801 test "x$prefix" != "xNONE" && \
6802 test -d "$prefix" && \
6803  {
6804         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6805         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6806         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6807         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6808         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6809         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6810 }
6811
6812 test "x/usr/local" != "x$prefix" && \
6813 test -d "/usr/local" && \
6814 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
6815         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6816         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6817         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
6818         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
6819         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
6820         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
6821 }
6822
6823 test "x/opt" != "x$prefix" && \
6824 test -d "/opt" && \
6825 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
6826         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6827         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6828         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
6829         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
6830         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
6831         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
6832 }
6833
6834 test "x$HOME" != "x$prefix" && \
6835 test -d "$HOME" && \
6836 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
6837         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6838         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6839         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
6840         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
6841         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
6842         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
6843 }
6844
6845 cf_search="$cf_library_path_list $cf_search"
6846
6847                         for cf_libdir in $cf_search
6848                         do
6849                                 echo "$as_me:6849: checking for -l$cf_nculib_root in $cf_libdir" >&5
6850 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6851                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6852                                 cat >conftest.$ac_ext <<_ACEOF
6853 #line 6853 "configure"
6854 #include "confdefs.h"
6855 #include <${cf_cv_ncurses_header:-curses.h}>
6856 int
6857 main ()
6858 {
6859 initscr()
6860   ;
6861   return 0;
6862 }
6863 _ACEOF
6864 rm -f conftest.$ac_objext conftest$ac_exeext
6865 if { (eval echo "$as_me:6865: \"$ac_link\"") >&5
6866   (eval $ac_link) 2>&5
6867   ac_status=$?
6868   echo "$as_me:6868: \$? = $ac_status" >&5
6869   (exit $ac_status); } &&
6870          { ac_try='test -s conftest$ac_exeext'
6871   { (eval echo "$as_me:6871: \"$ac_try\"") >&5
6872   (eval $ac_try) 2>&5
6873   ac_status=$?
6874   echo "$as_me:6874: \$? = $ac_status" >&5
6875   (exit $ac_status); }; }; then
6876   echo "$as_me:6876: result: yes" >&5
6877 echo "${ECHO_T}yes" >&6
6878                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6879                                          break
6880 else
6881   echo "$as_me: failed program was:" >&5
6882 cat conftest.$ac_ext >&5
6883 echo "$as_me:6883: result: no" >&5
6884 echo "${ECHO_T}no" >&6
6885                                          LIBS="$cf_save_LIBS"
6886 fi
6887 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6888                         done
6889
6890 fi
6891 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6892
6893 fi
6894
6895 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6896
6897 if test $cf_found_library = no ; then
6898         { { echo "$as_me:6898: error: Cannot link $cf_nculib_root library" >&5
6899 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6900    { (exit 1); exit 1; }; }
6901 fi
6902
6903 fi
6904
6905 if test -n "$cf_ncurses_LIBS" ; then
6906         echo "$as_me:6906: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6907 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6908         cf_ncurses_SAVE="$LIBS"
6909         for p in $cf_ncurses_LIBS ; do
6910                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6911                 if test "$q" != "$LIBS" ; then
6912                         LIBS="$q"
6913                 fi
6914         done
6915         cat >conftest.$ac_ext <<_ACEOF
6916 #line 6916 "configure"
6917 #include "confdefs.h"
6918 #include <${cf_cv_ncurses_header:-curses.h}>
6919 int
6920 main ()
6921 {
6922 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6923   ;
6924   return 0;
6925 }
6926 _ACEOF
6927 rm -f conftest.$ac_objext conftest$ac_exeext
6928 if { (eval echo "$as_me:6928: \"$ac_link\"") >&5
6929   (eval $ac_link) 2>&5
6930   ac_status=$?
6931   echo "$as_me:6931: \$? = $ac_status" >&5
6932   (exit $ac_status); } &&
6933          { ac_try='test -s conftest$ac_exeext'
6934   { (eval echo "$as_me:6934: \"$ac_try\"") >&5
6935   (eval $ac_try) 2>&5
6936   ac_status=$?
6937   echo "$as_me:6937: \$? = $ac_status" >&5
6938   (exit $ac_status); }; }; then
6939   echo "$as_me:6939: result: yes" >&5
6940 echo "${ECHO_T}yes" >&6
6941 else
6942   echo "$as_me: failed program was:" >&5
6943 cat conftest.$ac_ext >&5
6944 echo "$as_me:6944: result: no" >&5
6945 echo "${ECHO_T}no" >&6
6946                  LIBS="$cf_ncurses_SAVE"
6947 fi
6948 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6949 fi
6950
6951 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6952
6953 cat >>confdefs.h <<EOF
6954 #define $cf_nculib_ROOT 1
6955 EOF
6956
6957 fi
6958
6959         ;;
6960 ncursesw) #(vi
6961
6962 echo "$as_me:6962: checking for multibyte character support" >&5
6963 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6964 if test "${cf_cv_utf8_lib+set}" = set; then
6965   echo $ECHO_N "(cached) $ECHO_C" >&6
6966 else
6967
6968         cf_save_LIBS="$LIBS"
6969         cat >conftest.$ac_ext <<_ACEOF
6970 #line 6970 "configure"
6971 #include "confdefs.h"
6972
6973 #include <stdlib.h>
6974 int
6975 main ()
6976 {
6977 putwc(0,0);
6978   ;
6979   return 0;
6980 }
6981 _ACEOF
6982 rm -f conftest.$ac_objext conftest$ac_exeext
6983 if { (eval echo "$as_me:6983: \"$ac_link\"") >&5
6984   (eval $ac_link) 2>&5
6985   ac_status=$?
6986   echo "$as_me:6986: \$? = $ac_status" >&5
6987   (exit $ac_status); } &&
6988          { ac_try='test -s conftest$ac_exeext'
6989   { (eval echo "$as_me:6989: \"$ac_try\"") >&5
6990   (eval $ac_try) 2>&5
6991   ac_status=$?
6992   echo "$as_me:6992: \$? = $ac_status" >&5
6993   (exit $ac_status); }; }; then
6994   cf_cv_utf8_lib=yes
6995 else
6996   echo "$as_me: failed program was:" >&5
6997 cat conftest.$ac_ext >&5
6998
6999 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7000 # will be set on completion of the AC_TRY_LINK below.
7001 cf_cv_header_path_utf8=
7002 cf_cv_library_path_utf8=
7003
7004 echo "${as_me:-configure}:7004: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7005
7006 cf_save_LIBS="$LIBS"
7007
7008 cat >conftest.$ac_ext <<_ACEOF
7009 #line 7009 "configure"
7010 #include "confdefs.h"
7011
7012 #include <libutf8.h>
7013 int
7014 main ()
7015 {
7016 putwc(0,0);
7017   ;
7018   return 0;
7019 }
7020 _ACEOF
7021 rm -f conftest.$ac_objext conftest$ac_exeext
7022 if { (eval echo "$as_me:7022: \"$ac_link\"") >&5
7023   (eval $ac_link) 2>&5
7024   ac_status=$?
7025   echo "$as_me:7025: \$? = $ac_status" >&5
7026   (exit $ac_status); } &&
7027          { ac_try='test -s conftest$ac_exeext'
7028   { (eval echo "$as_me:7028: \"$ac_try\"") >&5
7029   (eval $ac_try) 2>&5
7030   ac_status=$?
7031   echo "$as_me:7031: \$? = $ac_status" >&5
7032   (exit $ac_status); }; }; then
7033
7034         cf_cv_find_linkage_utf8=yes
7035         cf_cv_header_path_utf8=/usr/include
7036         cf_cv_library_path_utf8=/usr/lib
7037
7038 else
7039   echo "$as_me: failed program was:" >&5
7040 cat conftest.$ac_ext >&5
7041
7042 LIBS="-lutf8  $cf_save_LIBS"
7043
7044 cat >conftest.$ac_ext <<_ACEOF
7045 #line 7045 "configure"
7046 #include "confdefs.h"
7047
7048 #include <libutf8.h>
7049 int
7050 main ()
7051 {
7052 putwc(0,0);
7053   ;
7054   return 0;
7055 }
7056 _ACEOF
7057 rm -f conftest.$ac_objext conftest$ac_exeext
7058 if { (eval echo "$as_me:7058: \"$ac_link\"") >&5
7059   (eval $ac_link) 2>&5
7060   ac_status=$?
7061   echo "$as_me:7061: \$? = $ac_status" >&5
7062   (exit $ac_status); } &&
7063          { ac_try='test -s conftest$ac_exeext'
7064   { (eval echo "$as_me:7064: \"$ac_try\"") >&5
7065   (eval $ac_try) 2>&5
7066   ac_status=$?
7067   echo "$as_me:7067: \$? = $ac_status" >&5
7068   (exit $ac_status); }; }; then
7069
7070         cf_cv_find_linkage_utf8=yes
7071         cf_cv_header_path_utf8=/usr/include
7072         cf_cv_library_path_utf8=/usr/lib
7073         cf_cv_library_file_utf8="-lutf8"
7074
7075 else
7076   echo "$as_me: failed program was:" >&5
7077 cat conftest.$ac_ext >&5
7078
7079         cf_cv_find_linkage_utf8=no
7080         LIBS="$cf_save_LIBS"
7081
7082     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
7083
7084 echo "${as_me:-configure}:7084: testing find linkage for utf8 library ..." 1>&5
7085
7086 echo "${as_me:-configure}:7086: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7087
7088     cf_save_CPPFLAGS="$CPPFLAGS"
7089     cf_test_CPPFLAGS="$CPPFLAGS"
7090
7091 cf_search=
7092
7093 # collect the current set of include-directories from compiler flags
7094 cf_header_path_list=""
7095 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7096         for cf_header_path in $CPPFLAGS $CFLAGS
7097         do
7098                 case $cf_header_path in #(vi
7099                 -I*)
7100                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7101
7102 test "x$cf_header_path" != "xNONE" && \
7103 test -d "$cf_header_path" && \
7104  {
7105         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7106         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7107         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7108         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7109         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7110         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7111 }
7112
7113                         cf_header_path_list="$cf_header_path_list $cf_search"
7114                         ;;
7115                 esac
7116         done
7117 fi
7118
7119 # add the variations for the package we are looking for
7120
7121 cf_search=
7122
7123 test "x/usr" != "x$prefix" && \
7124 test -d "/usr" && \
7125 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
7126         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7127         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7128         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
7129         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
7130         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
7131         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
7132 }
7133
7134 test "x$prefix" != "xNONE" && \
7135 test -d "$prefix" && \
7136  {
7137         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7138         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7139         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7140         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7141         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7142         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7143 }
7144
7145 test "x/usr/local" != "x$prefix" && \
7146 test -d "/usr/local" && \
7147 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
7148         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
7149         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
7150         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
7151         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
7152         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
7153         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
7154 }
7155
7156 test "x/opt" != "x$prefix" && \
7157 test -d "/opt" && \
7158 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
7159         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
7160         test -d /opt/include &&          cf_search="$cf_search /opt/include"
7161         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
7162         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
7163         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
7164         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
7165 }
7166
7167 test "x$HOME" != "x$prefix" && \
7168 test -d "$HOME" && \
7169 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
7170         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
7171         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
7172         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
7173         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
7174         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
7175         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
7176 }
7177
7178 test "$includedir" != NONE && \
7179 test "$includedir" != "/usr/include" && \
7180 test -d "$includedir" && {
7181         test -d $includedir &&    cf_search="$cf_search $includedir"
7182         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7183 }
7184
7185 test "$oldincludedir" != NONE && \
7186 test "$oldincludedir" != "/usr/include" && \
7187 test -d "$oldincludedir" && {
7188         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7189         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7190 }
7191
7192 cf_search="$cf_search $cf_header_path_list"
7193
7194     for cf_cv_header_path_utf8 in $cf_search
7195     do
7196       if test -d $cf_cv_header_path_utf8 ; then
7197         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7198
7199 echo "${as_me:-configure}:7199: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7200
7201         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
7202         cat >conftest.$ac_ext <<_ACEOF
7203 #line 7203 "configure"
7204 #include "confdefs.h"
7205
7206 #include <libutf8.h>
7207 int
7208 main ()
7209 {
7210 putwc(0,0);
7211   ;
7212   return 0;
7213 }
7214 _ACEOF
7215 rm -f conftest.$ac_objext
7216 if { (eval echo "$as_me:7216: \"$ac_compile\"") >&5
7217   (eval $ac_compile) 2>&5
7218   ac_status=$?
7219   echo "$as_me:7219: \$? = $ac_status" >&5
7220   (exit $ac_status); } &&
7221          { ac_try='test -s conftest.$ac_objext'
7222   { (eval echo "$as_me:7222: \"$ac_try\"") >&5
7223   (eval $ac_try) 2>&5
7224   ac_status=$?
7225   echo "$as_me:7225: \$? = $ac_status" >&5
7226   (exit $ac_status); }; }; then
7227
7228             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7229
7230 echo "${as_me:-configure}:7230: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7231
7232             cf_cv_find_linkage_utf8=maybe
7233             cf_test_CPPFLAGS="$CPPFLAGS"
7234             break
7235 else
7236   echo "$as_me: failed program was:" >&5
7237 cat conftest.$ac_ext >&5
7238
7239             CPPFLAGS="$cf_save_CPPFLAGS"
7240
7241 fi
7242 rm -f conftest.$ac_objext conftest.$ac_ext
7243       fi
7244     done
7245
7246     if test "$cf_cv_find_linkage_utf8" = maybe ; then
7247
7248 echo "${as_me:-configure}:7248: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7249
7250       cf_save_LIBS="$LIBS"
7251       cf_save_LDFLAGS="$LDFLAGS"
7252
7253       if test "$cf_cv_find_linkage_utf8" != yes ; then
7254
7255 cf_search=
7256 cf_library_path_list=""
7257 if test -n "${LDFLAGS}${LIBS}" ; then
7258         for cf_library_path in $LDFLAGS $LIBS
7259         do
7260                 case $cf_library_path in #(vi
7261                 -L*)
7262                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7263
7264 test "x$cf_library_path" != "xNONE" && \
7265 test -d "$cf_library_path" && \
7266  {
7267         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7268         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7269         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7270         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7271         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7272         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7273 }
7274
7275                         cf_library_path_list="$cf_library_path_list $cf_search"
7276                         ;;
7277                 esac
7278         done
7279 fi
7280
7281 cf_search=
7282
7283 test "x/usr" != "x$prefix" && \
7284 test -d "/usr" && \
7285 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
7286         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7287         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7288         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
7289         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
7290         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
7291         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
7292 }
7293
7294 test "x$prefix" != "xNONE" && \
7295 test -d "$prefix" && \
7296  {
7297         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7298         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7299         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7300         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7301         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7302         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7303 }
7304
7305 test "x/usr/local" != "x$prefix" && \
7306 test -d "/usr/local" && \
7307 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
7308         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7309         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7310         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
7311         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
7312         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
7313         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
7314 }
7315
7316 test "x/opt" != "x$prefix" && \
7317 test -d "/opt" && \
7318 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
7319         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7320         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7321         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
7322         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
7323         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
7324         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
7325 }
7326
7327 test "x$HOME" != "x$prefix" && \
7328 test -d "$HOME" && \
7329 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
7330         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7331         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7332         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
7333         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
7334         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
7335         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
7336 }
7337
7338 cf_search="$cf_library_path_list $cf_search"
7339
7340         for cf_cv_library_path_utf8 in $cf_search
7341         do
7342           if test -d $cf_cv_library_path_utf8 ; then
7343             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
7344
7345 echo "${as_me:-configure}:7345: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7346
7347             CPPFLAGS="$cf_test_CPPFLAGS"
7348             LIBS="-lutf8  $cf_save_LIBS"
7349             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7350             cat >conftest.$ac_ext <<_ACEOF
7351 #line 7351 "configure"
7352 #include "confdefs.h"
7353
7354 #include <libutf8.h>
7355 int
7356 main ()
7357 {
7358 putwc(0,0);
7359   ;
7360   return 0;
7361 }
7362 _ACEOF
7363 rm -f conftest.$ac_objext conftest$ac_exeext
7364 if { (eval echo "$as_me:7364: \"$ac_link\"") >&5
7365   (eval $ac_link) 2>&5
7366   ac_status=$?
7367   echo "$as_me:7367: \$? = $ac_status" >&5
7368   (exit $ac_status); } &&
7369          { ac_try='test -s conftest$ac_exeext'
7370   { (eval echo "$as_me:7370: \"$ac_try\"") >&5
7371   (eval $ac_try) 2>&5
7372   ac_status=$?
7373   echo "$as_me:7373: \$? = $ac_status" >&5
7374   (exit $ac_status); }; }; then
7375
7376                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7377
7378 echo "${as_me:-configure}:7378: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7379
7380                 cf_cv_find_linkage_utf8=yes
7381                 cf_cv_library_file_utf8="-lutf8"
7382                 break
7383 else
7384   echo "$as_me: failed program was:" >&5
7385 cat conftest.$ac_ext >&5
7386
7387                 CPPFLAGS="$cf_save_CPPFLAGS"
7388                 LIBS="$cf_save_LIBS"
7389                 LDFLAGS="$cf_save_LDFLAGS"
7390
7391 fi
7392 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7393           fi
7394         done
7395         CPPFLAGS="$cf_save_CPPFLAGS"
7396         LDFLAGS="$cf_save_LDFLAGS"
7397       fi
7398
7399     else
7400       cf_cv_find_linkage_utf8=no
7401     fi
7402
7403 fi
7404 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7405
7406 fi
7407 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7408
7409 LIBS="$cf_save_LIBS"
7410
7411 if test "$cf_cv_find_linkage_utf8" = yes ; then
7412 cf_cv_utf8_lib=add-on
7413 else
7414 cf_cv_utf8_lib=no
7415 fi
7416
7417 fi
7418 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7419 fi
7420 echo "$as_me:7420: result: $cf_cv_utf8_lib" >&5
7421 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7422
7423 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7424 # ncurses/ncursesw:
7425 if test "$cf_cv_utf8_lib" = "add-on" ; then
7426
7427 cat >>confdefs.h <<\EOF
7428 #define HAVE_LIBUTF8_H 1
7429 EOF
7430
7431 if test -n "$cf_cv_header_path_utf8" ; then
7432   for cf_add_incdir in $cf_cv_header_path_utf8
7433   do
7434         while test $cf_add_incdir != /usr/include
7435         do
7436           if test -d $cf_add_incdir
7437           then
7438                 cf_have_incdir=no
7439                 if test -n "$CFLAGS$CPPFLAGS" ; then
7440                   # a loop is needed to ensure we can add subdirs of existing dirs
7441                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7442                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7443                           cf_have_incdir=yes; break
7444                         fi
7445                   done
7446                 fi
7447
7448                 if test "$cf_have_incdir" = no ; then
7449                   if test "$cf_add_incdir" = /usr/local/include ; then
7450                         if test "$GCC" = yes
7451                         then
7452                           cf_save_CPPFLAGS=$CPPFLAGS
7453                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7454                           cat >conftest.$ac_ext <<_ACEOF
7455 #line 7455 "configure"
7456 #include "confdefs.h"
7457 #include <stdio.h>
7458 int
7459 main ()
7460 {
7461 printf("Hello")
7462   ;
7463   return 0;
7464 }
7465 _ACEOF
7466 rm -f conftest.$ac_objext
7467 if { (eval echo "$as_me:7467: \"$ac_compile\"") >&5
7468   (eval $ac_compile) 2>&5
7469   ac_status=$?
7470   echo "$as_me:7470: \$? = $ac_status" >&5
7471   (exit $ac_status); } &&
7472          { ac_try='test -s conftest.$ac_objext'
7473   { (eval echo "$as_me:7473: \"$ac_try\"") >&5
7474   (eval $ac_try) 2>&5
7475   ac_status=$?
7476   echo "$as_me:7476: \$? = $ac_status" >&5
7477   (exit $ac_status); }; }; then
7478   :
7479 else
7480   echo "$as_me: failed program was:" >&5
7481 cat conftest.$ac_ext >&5
7482 cf_have_incdir=yes
7483 fi
7484 rm -f conftest.$ac_objext conftest.$ac_ext
7485                           CPPFLAGS=$cf_save_CPPFLAGS
7486                         fi
7487                   fi
7488                 fi
7489
7490                 if test "$cf_have_incdir" = no ; then
7491                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7492
7493 echo "${as_me:-configure}:7493: testing adding $cf_add_incdir to include-path ..." 1>&5
7494
7495                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7496
7497                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7498                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7499                   cf_add_incdir="$cf_top_incdir"
7500                 else
7501                   break
7502                 fi
7503           fi
7504         done
7505   done
7506 fi
7507
7508 if test -n "$cf_cv_library_path_utf8" ; then
7509   for cf_add_libdir in $cf_cv_library_path_utf8
7510   do
7511     if test $cf_add_libdir = /usr/lib ; then
7512       :
7513     elif test -d $cf_add_libdir
7514     then
7515       cf_have_libdir=no
7516       if test -n "$LDFLAGS$LIBS" ; then
7517         # a loop is needed to ensure we can add subdirs of existing dirs
7518         for cf_test_libdir in $LDFLAGS $LIBS ; do
7519           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7520             cf_have_libdir=yes; break
7521           fi
7522         done
7523       fi
7524       if test "$cf_have_libdir" = no ; then
7525         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7526
7527 echo "${as_me:-configure}:7527: testing adding $cf_add_libdir to library-path ..." 1>&5
7528
7529         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7530       fi
7531     fi
7532   done
7533 fi
7534
7535 cf_add_libs="$cf_cv_library_file_utf8"
7536 # Filter out duplicates - this happens with badly-designed ".pc" files...
7537 for cf_add_1lib in $LIBS
7538 do
7539         for cf_add_2lib in $cf_add_libs
7540         do
7541                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7542                 then
7543                         cf_add_1lib=
7544                         break
7545                 fi
7546         done
7547         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7548 done
7549 LIBS="$cf_add_libs"
7550
7551 fi
7552
7553 cf_ncuconfig_root=ncursesw
7554
7555 echo "Looking for ${cf_ncuconfig_root}-config"
7556
7557 if test -n "$ac_tool_prefix"; then
7558   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7559   do
7560     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7561 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7562 echo "$as_me:7562: checking for $ac_word" >&5
7563 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7564 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7565   echo $ECHO_N "(cached) $ECHO_C" >&6
7566 else
7567   if test -n "$NCURSES_CONFIG"; then
7568   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7569 else
7570   ac_save_IFS=$IFS; IFS=$ac_path_separator
7571 ac_dummy="$PATH"
7572 for ac_dir in $ac_dummy; do
7573   IFS=$ac_save_IFS
7574   test -z "$ac_dir" && ac_dir=.
7575   $as_executable_p "$ac_dir/$ac_word" || continue
7576 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7577 echo "$as_me:7577: found $ac_dir/$ac_word" >&5
7578 break
7579 done
7580
7581 fi
7582 fi
7583 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7584 if test -n "$NCURSES_CONFIG"; then
7585   echo "$as_me:7585: result: $NCURSES_CONFIG" >&5
7586 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7587 else
7588   echo "$as_me:7588: result: no" >&5
7589 echo "${ECHO_T}no" >&6
7590 fi
7591
7592     test -n "$NCURSES_CONFIG" && break
7593   done
7594 fi
7595 if test -z "$NCURSES_CONFIG"; then
7596   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7597   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7598 do
7599   # Extract the first word of "$ac_prog", so it can be a program name with args.
7600 set dummy $ac_prog; ac_word=$2
7601 echo "$as_me:7601: checking for $ac_word" >&5
7602 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7603 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7604   echo $ECHO_N "(cached) $ECHO_C" >&6
7605 else
7606   if test -n "$ac_ct_NCURSES_CONFIG"; then
7607   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7608 else
7609   ac_save_IFS=$IFS; IFS=$ac_path_separator
7610 ac_dummy="$PATH"
7611 for ac_dir in $ac_dummy; do
7612   IFS=$ac_save_IFS
7613   test -z "$ac_dir" && ac_dir=.
7614   $as_executable_p "$ac_dir/$ac_word" || continue
7615 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7616 echo "$as_me:7616: found $ac_dir/$ac_word" >&5
7617 break
7618 done
7619
7620 fi
7621 fi
7622 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7623 if test -n "$ac_ct_NCURSES_CONFIG"; then
7624   echo "$as_me:7624: result: $ac_ct_NCURSES_CONFIG" >&5
7625 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7626 else
7627   echo "$as_me:7627: result: no" >&5
7628 echo "${ECHO_T}no" >&6
7629 fi
7630
7631   test -n "$ac_ct_NCURSES_CONFIG" && break
7632 done
7633 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7634
7635   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7636 fi
7637
7638 if test "$NCURSES_CONFIG" != none ; then
7639
7640 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7641
7642 cf_add_libs="`$NCURSES_CONFIG --libs`"
7643 # Filter out duplicates - this happens with badly-designed ".pc" files...
7644 for cf_add_1lib in $LIBS
7645 do
7646         for cf_add_2lib in $cf_add_libs
7647         do
7648                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7649                 then
7650                         cf_add_1lib=
7651                         break
7652                 fi
7653         done
7654         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7655 done
7656 LIBS="$cf_add_libs"
7657
7658 # even with config script, some packages use no-override for curses.h
7659
7660 echo "$as_me:7660: checking if we have identified curses headers" >&5
7661 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7662 if test "${cf_cv_ncurses_header+set}" = set; then
7663   echo $ECHO_N "(cached) $ECHO_C" >&6
7664 else
7665
7666 cf_cv_ncurses_header=none
7667 for cf_header in  \
7668     ncursesw/ncurses.h \
7669         ncursesw/curses.h \
7670         ncurses.h \
7671         curses.h
7672 do
7673 cat >conftest.$ac_ext <<_ACEOF
7674 #line 7674 "configure"
7675 #include "confdefs.h"
7676 #include <${cf_header}>
7677 int
7678 main ()
7679 {
7680 initscr(); tgoto("?", 0,0)
7681   ;
7682   return 0;
7683 }
7684 _ACEOF
7685 rm -f conftest.$ac_objext
7686 if { (eval echo "$as_me:7686: \"$ac_compile\"") >&5
7687   (eval $ac_compile) 2>&5
7688   ac_status=$?
7689   echo "$as_me:7689: \$? = $ac_status" >&5
7690   (exit $ac_status); } &&
7691          { ac_try='test -s conftest.$ac_objext'
7692   { (eval echo "$as_me:7692: \"$ac_try\"") >&5
7693   (eval $ac_try) 2>&5
7694   ac_status=$?
7695   echo "$as_me:7695: \$? = $ac_status" >&5
7696   (exit $ac_status); }; }; then
7697   cf_cv_ncurses_header=$cf_header; break
7698 else
7699   echo "$as_me: failed program was:" >&5
7700 cat conftest.$ac_ext >&5
7701 fi
7702 rm -f conftest.$ac_objext conftest.$ac_ext
7703 done
7704
7705 fi
7706 echo "$as_me:7706: result: $cf_cv_ncurses_header" >&5
7707 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7708
7709 if test "$cf_cv_ncurses_header" = none ; then
7710         { { echo "$as_me:7710: error: No curses header-files found" >&5
7711 echo "$as_me: error: No curses header-files found" >&2;}
7712    { (exit 1); exit 1; }; }
7713 fi
7714
7715 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7716
7717 for ac_header in $cf_cv_ncurses_header
7718 do
7719 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7720 echo "$as_me:7720: checking for $ac_header" >&5
7721 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7722 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7723   echo $ECHO_N "(cached) $ECHO_C" >&6
7724 else
7725   cat >conftest.$ac_ext <<_ACEOF
7726 #line 7726 "configure"
7727 #include "confdefs.h"
7728 #include <$ac_header>
7729 _ACEOF
7730 if { (eval echo "$as_me:7730: \"$ac_cpp conftest.$ac_ext\"") >&5
7731   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7732   ac_status=$?
7733   egrep -v '^ *\+' conftest.er1 >conftest.err
7734   rm -f conftest.er1
7735   cat conftest.err >&5
7736   echo "$as_me:7736: \$? = $ac_status" >&5
7737   (exit $ac_status); } >/dev/null; then
7738   if test -s conftest.err; then
7739     ac_cpp_err=$ac_c_preproc_warn_flag
7740   else
7741     ac_cpp_err=
7742   fi
7743 else
7744   ac_cpp_err=yes
7745 fi
7746 if test -z "$ac_cpp_err"; then
7747   eval "$as_ac_Header=yes"
7748 else
7749   echo "$as_me: failed program was:" >&5
7750   cat conftest.$ac_ext >&5
7751   eval "$as_ac_Header=no"
7752 fi
7753 rm -f conftest.err conftest.$ac_ext
7754 fi
7755 echo "$as_me:7755: result: `eval echo '${'$as_ac_Header'}'`" >&5
7756 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7757 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7758   cat >>confdefs.h <<EOF
7759 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7760 EOF
7761
7762 fi
7763 done
7764
7765 cat >>confdefs.h <<\EOF
7766 #define NCURSES 1
7767 EOF
7768
7769 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7770
7771 cat >>confdefs.h <<EOF
7772 #define $cf_nculib_ROOT 1
7773 EOF
7774
7775 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7776
7777 else
7778
7779 cf_ncuhdr_root=ncursesw
7780
7781 test -n "$cf_cv_curses_dir" && \
7782 test "$cf_cv_curses_dir" != "no" && { \
7783
7784 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7785   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7786   do
7787         while test $cf_add_incdir != /usr/include
7788         do
7789           if test -d $cf_add_incdir
7790           then
7791                 cf_have_incdir=no
7792                 if test -n "$CFLAGS$CPPFLAGS" ; then
7793                   # a loop is needed to ensure we can add subdirs of existing dirs
7794                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7795                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7796                           cf_have_incdir=yes; break
7797                         fi
7798                   done
7799                 fi
7800
7801                 if test "$cf_have_incdir" = no ; then
7802                   if test "$cf_add_incdir" = /usr/local/include ; then
7803                         if test "$GCC" = yes
7804                         then
7805                           cf_save_CPPFLAGS=$CPPFLAGS
7806                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7807                           cat >conftest.$ac_ext <<_ACEOF
7808 #line 7808 "configure"
7809 #include "confdefs.h"
7810 #include <stdio.h>
7811 int
7812 main ()
7813 {
7814 printf("Hello")
7815   ;
7816   return 0;
7817 }
7818 _ACEOF
7819 rm -f conftest.$ac_objext
7820 if { (eval echo "$as_me:7820: \"$ac_compile\"") >&5
7821   (eval $ac_compile) 2>&5
7822   ac_status=$?
7823   echo "$as_me:7823: \$? = $ac_status" >&5
7824   (exit $ac_status); } &&
7825          { ac_try='test -s conftest.$ac_objext'
7826   { (eval echo "$as_me:7826: \"$ac_try\"") >&5
7827   (eval $ac_try) 2>&5
7828   ac_status=$?
7829   echo "$as_me:7829: \$? = $ac_status" >&5
7830   (exit $ac_status); }; }; then
7831   :
7832 else
7833   echo "$as_me: failed program was:" >&5
7834 cat conftest.$ac_ext >&5
7835 cf_have_incdir=yes
7836 fi
7837 rm -f conftest.$ac_objext conftest.$ac_ext
7838                           CPPFLAGS=$cf_save_CPPFLAGS
7839                         fi
7840                   fi
7841                 fi
7842
7843                 if test "$cf_have_incdir" = no ; then
7844                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7845
7846 echo "${as_me:-configure}:7846: testing adding $cf_add_incdir to include-path ..." 1>&5
7847
7848                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7849
7850                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7851                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7852                   cf_add_incdir="$cf_top_incdir"
7853                 else
7854                   break
7855                 fi
7856           fi
7857         done
7858   done
7859 fi
7860
7861 }
7862
7863 echo "$as_me:7863: checking for $cf_ncuhdr_root header in include-path" >&5
7864 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7865 if test "${cf_cv_ncurses_h+set}" = set; then
7866   echo $ECHO_N "(cached) $ECHO_C" >&6
7867 else
7868
7869         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7870         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7871         for cf_header in $cf_header_list
7872         do
7873
7874         cat >conftest.$ac_ext <<_ACEOF
7875 #line 7875 "configure"
7876 #include "confdefs.h"
7877
7878 #define _XOPEN_SOURCE_EXTENDED
7879 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7880 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7881
7882 #include <$cf_header>
7883 int
7884 main ()
7885 {
7886
7887 #ifdef NCURSES_VERSION
7888
7889 #ifndef WACS_BSSB
7890         make an error
7891 #endif
7892
7893 printf("%s\n", NCURSES_VERSION);
7894 #else
7895 #ifdef __NCURSES_H
7896 printf("old\n");
7897 #else
7898         make an error
7899 #endif
7900 #endif
7901
7902   ;
7903   return 0;
7904 }
7905 _ACEOF
7906 rm -f conftest.$ac_objext
7907 if { (eval echo "$as_me:7907: \"$ac_compile\"") >&5
7908   (eval $ac_compile) 2>&5
7909   ac_status=$?
7910   echo "$as_me:7910: \$? = $ac_status" >&5
7911   (exit $ac_status); } &&
7912          { ac_try='test -s conftest.$ac_objext'
7913   { (eval echo "$as_me:7913: \"$ac_try\"") >&5
7914   (eval $ac_try) 2>&5
7915   ac_status=$?
7916   echo "$as_me:7916: \$? = $ac_status" >&5
7917   (exit $ac_status); }; }; then
7918   cf_cv_ncurses_h=$cf_header
7919
7920 else
7921   echo "$as_me: failed program was:" >&5
7922 cat conftest.$ac_ext >&5
7923 cf_cv_ncurses_h=no
7924 fi
7925 rm -f conftest.$ac_objext conftest.$ac_ext
7926
7927                 test "$cf_cv_ncurses_h" != no && break
7928         done
7929
7930 fi
7931 echo "$as_me:7931: result: $cf_cv_ncurses_h" >&5
7932 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7933
7934 if test "$cf_cv_ncurses_h" != no ; then
7935         cf_cv_ncurses_header=$cf_cv_ncurses_h
7936 else
7937
7938 echo "$as_me:7938: checking for $cf_ncuhdr_root include-path" >&5
7939 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7940 if test "${cf_cv_ncurses_h2+set}" = set; then
7941   echo $ECHO_N "(cached) $ECHO_C" >&6
7942 else
7943
7944         test -n "$verbose" && echo
7945
7946 cf_search=
7947
7948 # collect the current set of include-directories from compiler flags
7949 cf_header_path_list=""
7950 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7951         for cf_header_path in $CPPFLAGS $CFLAGS
7952         do
7953                 case $cf_header_path in #(vi
7954                 -I*)
7955                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7956
7957 test "x$cf_header_path" != "xNONE" && \
7958 test -d "$cf_header_path" && \
7959  {
7960         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7961         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7962         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7963         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7964         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7965         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"
7966 }
7967
7968                         cf_header_path_list="$cf_header_path_list $cf_search"
7969                         ;;
7970                 esac
7971         done
7972 fi
7973
7974 # add the variations for the package we are looking for
7975
7976 cf_search=
7977
7978 test "x/usr" != "x$prefix" && \
7979 test -d "/usr" && \
7980 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
7981         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7982         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7983         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
7984         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
7985         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
7986         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7987 }
7988
7989 test "x$prefix" != "xNONE" && \
7990 test -d "$prefix" && \
7991  {
7992         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7993         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7994         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7995         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7996         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7997         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7998 }
7999
8000 test "x/usr/local" != "x$prefix" && \
8001 test -d "/usr/local" && \
8002 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
8003         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
8004         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
8005         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
8006         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
8007         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
8008         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8009 }
8010
8011 test "x/opt" != "x$prefix" && \
8012 test -d "/opt" && \
8013 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
8014         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
8015         test -d /opt/include &&          cf_search="$cf_search /opt/include"
8016         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
8017         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
8018         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
8019         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8020 }
8021
8022 test "x$HOME" != "x$prefix" && \
8023 test -d "$HOME" && \
8024 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
8025         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
8026         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
8027         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
8028         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
8029         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
8030         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8031 }
8032
8033 test "$includedir" != NONE && \
8034 test "$includedir" != "/usr/include" && \
8035 test -d "$includedir" && {
8036         test -d $includedir &&    cf_search="$cf_search $includedir"
8037         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8038 }
8039
8040 test "$oldincludedir" != NONE && \
8041 test "$oldincludedir" != "/usr/include" && \
8042 test -d "$oldincludedir" && {
8043         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8044         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8045 }
8046
8047 cf_search="$cf_search $cf_header_path_list"
8048
8049         test -n "$verbose" && echo search path $cf_search
8050         cf_save2_CPPFLAGS="$CPPFLAGS"
8051         for cf_incdir in $cf_search
8052         do
8053
8054 if test -n "$cf_incdir" ; then
8055   for cf_add_incdir in $cf_incdir
8056   do
8057         while test $cf_add_incdir != /usr/include
8058         do
8059           if test -d $cf_add_incdir
8060           then
8061                 cf_have_incdir=no
8062                 if test -n "$CFLAGS$CPPFLAGS" ; then
8063                   # a loop is needed to ensure we can add subdirs of existing dirs
8064                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8065                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8066                           cf_have_incdir=yes; break
8067                         fi
8068                   done
8069                 fi
8070
8071                 if test "$cf_have_incdir" = no ; then
8072                   if test "$cf_add_incdir" = /usr/local/include ; then
8073                         if test "$GCC" = yes
8074                         then
8075                           cf_save_CPPFLAGS=$CPPFLAGS
8076                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8077                           cat >conftest.$ac_ext <<_ACEOF
8078 #line 8078 "configure"
8079 #include "confdefs.h"
8080 #include <stdio.h>
8081 int
8082 main ()
8083 {
8084 printf("Hello")
8085   ;
8086   return 0;
8087 }
8088 _ACEOF
8089 rm -f conftest.$ac_objext
8090 if { (eval echo "$as_me:8090: \"$ac_compile\"") >&5
8091   (eval $ac_compile) 2>&5
8092   ac_status=$?
8093   echo "$as_me:8093: \$? = $ac_status" >&5
8094   (exit $ac_status); } &&
8095          { ac_try='test -s conftest.$ac_objext'
8096   { (eval echo "$as_me:8096: \"$ac_try\"") >&5
8097   (eval $ac_try) 2>&5
8098   ac_status=$?
8099   echo "$as_me:8099: \$? = $ac_status" >&5
8100   (exit $ac_status); }; }; then
8101   :
8102 else
8103   echo "$as_me: failed program was:" >&5
8104 cat conftest.$ac_ext >&5
8105 cf_have_incdir=yes
8106 fi
8107 rm -f conftest.$ac_objext conftest.$ac_ext
8108                           CPPFLAGS=$cf_save_CPPFLAGS
8109                         fi
8110                   fi
8111                 fi
8112
8113                 if test "$cf_have_incdir" = no ; then
8114                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8115
8116 echo "${as_me:-configure}:8116: testing adding $cf_add_incdir to include-path ..." 1>&5
8117
8118                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8119
8120                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8121                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8122                   cf_add_incdir="$cf_top_incdir"
8123                 else
8124                   break
8125                 fi
8126           fi
8127         done
8128   done
8129 fi
8130
8131                 for cf_header in \
8132                         ncurses.h \
8133                         curses.h
8134                 do
8135
8136         cat >conftest.$ac_ext <<_ACEOF
8137 #line 8137 "configure"
8138 #include "confdefs.h"
8139
8140 #include <$cf_header>
8141 int
8142 main ()
8143 {
8144
8145 #ifdef NCURSES_VERSION
8146
8147 printf("%s\n", NCURSES_VERSION);
8148 #else
8149 #ifdef __NCURSES_H
8150 printf("old\n");
8151 #else
8152         make an error
8153 #endif
8154 #endif
8155
8156   ;
8157   return 0;
8158 }
8159 _ACEOF
8160 rm -f conftest.$ac_objext
8161 if { (eval echo "$as_me:8161: \"$ac_compile\"") >&5
8162   (eval $ac_compile) 2>&5
8163   ac_status=$?
8164   echo "$as_me:8164: \$? = $ac_status" >&5
8165   (exit $ac_status); } &&
8166          { ac_try='test -s conftest.$ac_objext'
8167   { (eval echo "$as_me:8167: \"$ac_try\"") >&5
8168   (eval $ac_try) 2>&5
8169   ac_status=$?
8170   echo "$as_me:8170: \$? = $ac_status" >&5
8171   (exit $ac_status); }; }; then
8172   cf_cv_ncurses_h2=$cf_header
8173
8174 else
8175   echo "$as_me: failed program was:" >&5
8176 cat conftest.$ac_ext >&5
8177 cf_cv_ncurses_h2=no
8178 fi
8179 rm -f conftest.$ac_objext conftest.$ac_ext
8180
8181                         if test "$cf_cv_ncurses_h2" != no ; then
8182                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8183                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8184                                 break
8185                         fi
8186                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8187                 done
8188                 CPPFLAGS="$cf_save2_CPPFLAGS"
8189                 test "$cf_cv_ncurses_h2" != no && break
8190         done
8191         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8191: error: not found" >&5
8192 echo "$as_me: error: not found" >&2;}
8193    { (exit 1); exit 1; }; }
8194
8195 fi
8196 echo "$as_me:8196: result: $cf_cv_ncurses_h2" >&5
8197 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8198
8199         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8200         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8201         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8202                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8203         fi
8204
8205 if test -n "$cf_1st_incdir" ; then
8206   for cf_add_incdir in $cf_1st_incdir
8207   do
8208         while test $cf_add_incdir != /usr/include
8209         do
8210           if test -d $cf_add_incdir
8211           then
8212                 cf_have_incdir=no
8213                 if test -n "$CFLAGS$CPPFLAGS" ; then
8214                   # a loop is needed to ensure we can add subdirs of existing dirs
8215                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8216                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8217                           cf_have_incdir=yes; break
8218                         fi
8219                   done
8220                 fi
8221
8222                 if test "$cf_have_incdir" = no ; then
8223                   if test "$cf_add_incdir" = /usr/local/include ; then
8224                         if test "$GCC" = yes
8225                         then
8226                           cf_save_CPPFLAGS=$CPPFLAGS
8227                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8228                           cat >conftest.$ac_ext <<_ACEOF
8229 #line 8229 "configure"
8230 #include "confdefs.h"
8231 #include <stdio.h>
8232 int
8233 main ()
8234 {
8235 printf("Hello")
8236   ;
8237   return 0;
8238 }
8239 _ACEOF
8240 rm -f conftest.$ac_objext
8241 if { (eval echo "$as_me:8241: \"$ac_compile\"") >&5
8242   (eval $ac_compile) 2>&5
8243   ac_status=$?
8244   echo "$as_me:8244: \$? = $ac_status" >&5
8245   (exit $ac_status); } &&
8246          { ac_try='test -s conftest.$ac_objext'
8247   { (eval echo "$as_me:8247: \"$ac_try\"") >&5
8248   (eval $ac_try) 2>&5
8249   ac_status=$?
8250   echo "$as_me:8250: \$? = $ac_status" >&5
8251   (exit $ac_status); }; }; then
8252   :
8253 else
8254   echo "$as_me: failed program was:" >&5
8255 cat conftest.$ac_ext >&5
8256 cf_have_incdir=yes
8257 fi
8258 rm -f conftest.$ac_objext conftest.$ac_ext
8259                           CPPFLAGS=$cf_save_CPPFLAGS
8260                         fi
8261                   fi
8262                 fi
8263
8264                 if test "$cf_have_incdir" = no ; then
8265                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8266
8267 echo "${as_me:-configure}:8267: testing adding $cf_add_incdir to include-path ..." 1>&5
8268
8269                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8270
8271                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8272                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8273                   cf_add_incdir="$cf_top_incdir"
8274                 else
8275                   break
8276                 fi
8277           fi
8278         done
8279   done
8280 fi
8281
8282 fi
8283
8284 # Set definitions to allow ifdef'ing for ncurses.h
8285
8286 case $cf_cv_ncurses_header in # (vi
8287 *ncurses.h)
8288
8289 cat >>confdefs.h <<\EOF
8290 #define HAVE_NCURSES_H 1
8291 EOF
8292
8293         ;;
8294 esac
8295
8296 case $cf_cv_ncurses_header in # (vi
8297 ncurses/curses.h|ncurses/ncurses.h)
8298
8299 cat >>confdefs.h <<\EOF
8300 #define HAVE_NCURSES_NCURSES_H 1
8301 EOF
8302
8303         ;;
8304 ncursesw/curses.h|ncursesw/ncurses.h)
8305
8306 cat >>confdefs.h <<\EOF
8307 #define HAVE_NCURSESW_NCURSES_H 1
8308 EOF
8309
8310         ;;
8311 esac
8312
8313 echo "$as_me:8313: checking for terminfo header" >&5
8314 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8315 if test "${cf_cv_term_header+set}" = set; then
8316   echo $ECHO_N "(cached) $ECHO_C" >&6
8317 else
8318
8319 case ${cf_cv_ncurses_header} in #(vi
8320 */ncurses.h|*/ncursesw.h) #(vi
8321         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8322         ;;
8323 *)
8324         cf_term_header=term.h
8325         ;;
8326 esac
8327
8328 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8329 do
8330 cat >conftest.$ac_ext <<_ACEOF
8331 #line 8331 "configure"
8332 #include "confdefs.h"
8333 #include <stdio.h>
8334 #include <${cf_cv_ncurses_header:-curses.h}>
8335 #include <$cf_test>
8336
8337 int
8338 main ()
8339 {
8340 int x = auto_left_margin
8341   ;
8342   return 0;
8343 }
8344 _ACEOF
8345 rm -f conftest.$ac_objext
8346 if { (eval echo "$as_me:8346: \"$ac_compile\"") >&5
8347   (eval $ac_compile) 2>&5
8348   ac_status=$?
8349   echo "$as_me:8349: \$? = $ac_status" >&5
8350   (exit $ac_status); } &&
8351          { ac_try='test -s conftest.$ac_objext'
8352   { (eval echo "$as_me:8352: \"$ac_try\"") >&5
8353   (eval $ac_try) 2>&5
8354   ac_status=$?
8355   echo "$as_me:8355: \$? = $ac_status" >&5
8356   (exit $ac_status); }; }; then
8357
8358         cf_cv_term_header="$cf_test"
8359 else
8360   echo "$as_me: failed program was:" >&5
8361 cat conftest.$ac_ext >&5
8362
8363         cf_cv_term_header=unknown
8364
8365 fi
8366 rm -f conftest.$ac_objext conftest.$ac_ext
8367         test "$cf_cv_term_header" != unknown && break
8368 done
8369
8370 fi
8371 echo "$as_me:8371: result: $cf_cv_term_header" >&5
8372 echo "${ECHO_T}$cf_cv_term_header" >&6
8373
8374 # Set definitions to allow ifdef'ing to accommodate subdirectories
8375
8376 case $cf_cv_term_header in # (vi
8377 *term.h)
8378
8379 cat >>confdefs.h <<\EOF
8380 #define HAVE_TERM_H 1
8381 EOF
8382
8383         ;;
8384 esac
8385
8386 case $cf_cv_term_header in # (vi
8387 ncurses/term.h) #(vi
8388
8389 cat >>confdefs.h <<\EOF
8390 #define HAVE_NCURSES_TERM_H 1
8391 EOF
8392
8393         ;;
8394 ncursesw/term.h)
8395
8396 cat >>confdefs.h <<\EOF
8397 #define HAVE_NCURSESW_TERM_H 1
8398 EOF
8399
8400         ;;
8401 esac
8402
8403 # some applications need this, but should check for NCURSES_VERSION
8404
8405 cat >>confdefs.h <<\EOF
8406 #define NCURSES 1
8407 EOF
8408
8409 echo "$as_me:8409: checking for ncurses version" >&5
8410 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8411 if test "${cf_cv_ncurses_version+set}" = set; then
8412   echo $ECHO_N "(cached) $ECHO_C" >&6
8413 else
8414
8415         cf_cv_ncurses_version=no
8416         cf_tempfile=out$$
8417         rm -f $cf_tempfile
8418         if test "$cross_compiling" = yes; then
8419
8420         # This will not work if the preprocessor splits the line after the
8421         # Autoconf token.  The 'unproto' program does that.
8422         cat > conftest.$ac_ext <<EOF
8423 #include <${cf_cv_ncurses_header:-curses.h}>
8424 #undef Autoconf
8425 #ifdef NCURSES_VERSION
8426 Autoconf NCURSES_VERSION
8427 #else
8428 #ifdef __NCURSES_H
8429 Autoconf "old"
8430 #endif
8431 ;
8432 #endif
8433 EOF
8434         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8435         { (eval echo "$as_me:8435: \"$cf_try\"") >&5
8436   (eval $cf_try) 2>&5
8437   ac_status=$?
8438   echo "$as_me:8438: \$? = $ac_status" >&5
8439   (exit $ac_status); }
8440         if test -f conftest.out ; then
8441                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8442                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8443                 rm -f conftest.out
8444         fi
8445
8446 else
8447   cat >conftest.$ac_ext <<_ACEOF
8448 #line 8448 "configure"
8449 #include "confdefs.h"
8450
8451 #include <${cf_cv_ncurses_header:-curses.h}>
8452 #include <stdio.h>
8453 int main()
8454 {
8455         FILE *fp = fopen("$cf_tempfile", "w");
8456 #ifdef NCURSES_VERSION
8457 # ifdef NCURSES_VERSION_PATCH
8458         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8459 # else
8460         fprintf(fp, "%s\n", NCURSES_VERSION);
8461 # endif
8462 #else
8463 # ifdef __NCURSES_H
8464         fprintf(fp, "old\n");
8465 # else
8466         make an error
8467 # endif
8468 #endif
8469         ${cf_cv_main_return:-return}(0);
8470 }
8471 _ACEOF
8472 rm -f conftest$ac_exeext
8473 if { (eval echo "$as_me:8473: \"$ac_link\"") >&5
8474   (eval $ac_link) 2>&5
8475   ac_status=$?
8476   echo "$as_me:8476: \$? = $ac_status" >&5
8477   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8478   { (eval echo "$as_me:8478: \"$ac_try\"") >&5
8479   (eval $ac_try) 2>&5
8480   ac_status=$?
8481   echo "$as_me:8481: \$? = $ac_status" >&5
8482   (exit $ac_status); }; }; then
8483
8484         cf_cv_ncurses_version=`cat $cf_tempfile`
8485 else
8486   echo "$as_me: program exited with status $ac_status" >&5
8487 echo "$as_me: failed program was:" >&5
8488 cat conftest.$ac_ext >&5
8489 fi
8490 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8491 fi
8492         rm -f $cf_tempfile
8493
8494 fi
8495 echo "$as_me:8495: result: $cf_cv_ncurses_version" >&5
8496 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8497 test "$cf_cv_ncurses_version" = no ||
8498 cat >>confdefs.h <<\EOF
8499 #define NCURSES 1
8500 EOF
8501
8502 cf_nculib_root=ncursesw
8503         # This works, except for the special case where we find gpm, but
8504         # ncurses is in a nonstandard location via $LIBS, and we really want
8505         # to link gpm.
8506 cf_ncurses_LIBS=""
8507 cf_ncurses_SAVE="$LIBS"
8508 echo "$as_me:8508: checking for Gpm_Open in -lgpm" >&5
8509 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8510 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8511   echo $ECHO_N "(cached) $ECHO_C" >&6
8512 else
8513   ac_check_lib_save_LIBS=$LIBS
8514 LIBS="-lgpm  $LIBS"
8515 cat >conftest.$ac_ext <<_ACEOF
8516 #line 8516 "configure"
8517 #include "confdefs.h"
8518
8519 /* Override any gcc2 internal prototype to avoid an error.  */
8520 #ifdef __cplusplus
8521 extern "C"
8522 #endif
8523 /* We use char because int might match the return type of a gcc2
8524    builtin and then its argument prototype would still apply.  */
8525 char Gpm_Open ();
8526 int
8527 main ()
8528 {
8529 Gpm_Open ();
8530   ;
8531   return 0;
8532 }
8533 _ACEOF
8534 rm -f conftest.$ac_objext conftest$ac_exeext
8535 if { (eval echo "$as_me:8535: \"$ac_link\"") >&5
8536   (eval $ac_link) 2>&5
8537   ac_status=$?
8538   echo "$as_me:8538: \$? = $ac_status" >&5
8539   (exit $ac_status); } &&
8540          { ac_try='test -s conftest$ac_exeext'
8541   { (eval echo "$as_me:8541: \"$ac_try\"") >&5
8542   (eval $ac_try) 2>&5
8543   ac_status=$?
8544   echo "$as_me:8544: \$? = $ac_status" >&5
8545   (exit $ac_status); }; }; then
8546   ac_cv_lib_gpm_Gpm_Open=yes
8547 else
8548   echo "$as_me: failed program was:" >&5
8549 cat conftest.$ac_ext >&5
8550 ac_cv_lib_gpm_Gpm_Open=no
8551 fi
8552 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8553 LIBS=$ac_check_lib_save_LIBS
8554 fi
8555 echo "$as_me:8555: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8556 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8557 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8558   echo "$as_me:8558: checking for initscr in -lgpm" >&5
8559 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8560 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8561   echo $ECHO_N "(cached) $ECHO_C" >&6
8562 else
8563   ac_check_lib_save_LIBS=$LIBS
8564 LIBS="-lgpm  $LIBS"
8565 cat >conftest.$ac_ext <<_ACEOF
8566 #line 8566 "configure"
8567 #include "confdefs.h"
8568
8569 /* Override any gcc2 internal prototype to avoid an error.  */
8570 #ifdef __cplusplus
8571 extern "C"
8572 #endif
8573 /* We use char because int might match the return type of a gcc2
8574    builtin and then its argument prototype would still apply.  */
8575 char initscr ();
8576 int
8577 main ()
8578 {
8579 initscr ();
8580   ;
8581   return 0;
8582 }
8583 _ACEOF
8584 rm -f conftest.$ac_objext conftest$ac_exeext
8585 if { (eval echo "$as_me:8585: \"$ac_link\"") >&5
8586   (eval $ac_link) 2>&5
8587   ac_status=$?
8588   echo "$as_me:8588: \$? = $ac_status" >&5
8589   (exit $ac_status); } &&
8590          { ac_try='test -s conftest$ac_exeext'
8591   { (eval echo "$as_me:8591: \"$ac_try\"") >&5
8592   (eval $ac_try) 2>&5
8593   ac_status=$?
8594   echo "$as_me:8594: \$? = $ac_status" >&5
8595   (exit $ac_status); }; }; then
8596   ac_cv_lib_gpm_initscr=yes
8597 else
8598   echo "$as_me: failed program was:" >&5
8599 cat conftest.$ac_ext >&5
8600 ac_cv_lib_gpm_initscr=no
8601 fi
8602 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8603 LIBS=$ac_check_lib_save_LIBS
8604 fi
8605 echo "$as_me:8605: result: $ac_cv_lib_gpm_initscr" >&5
8606 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8607 if test $ac_cv_lib_gpm_initscr = yes; then
8608   LIBS="$cf_ncurses_SAVE"
8609 else
8610   cf_ncurses_LIBS="-lgpm"
8611 fi
8612
8613 fi
8614
8615 case $host_os in #(vi
8616 freebsd*)
8617         # This is only necessary if you are linking against an obsolete
8618         # version of ncurses (but it should do no harm, since it's static).
8619         if test "$cf_nculib_root" = ncurses ; then
8620                 echo "$as_me:8620: checking for tgoto in -lmytinfo" >&5
8621 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8622 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8623   echo $ECHO_N "(cached) $ECHO_C" >&6
8624 else
8625   ac_check_lib_save_LIBS=$LIBS
8626 LIBS="-lmytinfo  $LIBS"
8627 cat >conftest.$ac_ext <<_ACEOF
8628 #line 8628 "configure"
8629 #include "confdefs.h"
8630
8631 /* Override any gcc2 internal prototype to avoid an error.  */
8632 #ifdef __cplusplus
8633 extern "C"
8634 #endif
8635 /* We use char because int might match the return type of a gcc2
8636    builtin and then its argument prototype would still apply.  */
8637 char tgoto ();
8638 int
8639 main ()
8640 {
8641 tgoto ();
8642   ;
8643   return 0;
8644 }
8645 _ACEOF
8646 rm -f conftest.$ac_objext conftest$ac_exeext
8647 if { (eval echo "$as_me:8647: \"$ac_link\"") >&5
8648   (eval $ac_link) 2>&5
8649   ac_status=$?
8650   echo "$as_me:8650: \$? = $ac_status" >&5
8651   (exit $ac_status); } &&
8652          { ac_try='test -s conftest$ac_exeext'
8653   { (eval echo "$as_me:8653: \"$ac_try\"") >&5
8654   (eval $ac_try) 2>&5
8655   ac_status=$?
8656   echo "$as_me:8656: \$? = $ac_status" >&5
8657   (exit $ac_status); }; }; then
8658   ac_cv_lib_mytinfo_tgoto=yes
8659 else
8660   echo "$as_me: failed program was:" >&5
8661 cat conftest.$ac_ext >&5
8662 ac_cv_lib_mytinfo_tgoto=no
8663 fi
8664 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8665 LIBS=$ac_check_lib_save_LIBS
8666 fi
8667 echo "$as_me:8667: result: $ac_cv_lib_mytinfo_tgoto" >&5
8668 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8669 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8670   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8671 fi
8672
8673         fi
8674         ;;
8675 esac
8676
8677 cf_add_libs="$cf_ncurses_LIBS"
8678 # Filter out duplicates - this happens with badly-designed ".pc" files...
8679 for cf_add_1lib in $LIBS
8680 do
8681         for cf_add_2lib in $cf_add_libs
8682         do
8683                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8684                 then
8685                         cf_add_1lib=
8686                         break
8687                 fi
8688         done
8689         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8690 done
8691 LIBS="$cf_add_libs"
8692
8693 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8694 then
8695
8696 cf_add_libs="-l$cf_nculib_root"
8697 # Filter out duplicates - this happens with badly-designed ".pc" files...
8698 for cf_add_1lib in $LIBS
8699 do
8700         for cf_add_2lib in $cf_add_libs
8701         do
8702                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8703                 then
8704                         cf_add_1lib=
8705                         break
8706                 fi
8707         done
8708         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8709 done
8710 LIBS="$cf_add_libs"
8711
8712 else
8713
8714         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8715         cf_libdir=""
8716         echo "$as_me:8716: checking for initscr" >&5
8717 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8718 if test "${ac_cv_func_initscr+set}" = set; then
8719   echo $ECHO_N "(cached) $ECHO_C" >&6
8720 else
8721   cat >conftest.$ac_ext <<_ACEOF
8722 #line 8722 "configure"
8723 #include "confdefs.h"
8724 /* System header to define __stub macros and hopefully few prototypes,
8725     which can conflict with char initscr (); below.  */
8726 #include <assert.h>
8727 /* Override any gcc2 internal prototype to avoid an error.  */
8728 #ifdef __cplusplus
8729 extern "C"
8730 #endif
8731 /* We use char because int might match the return type of a gcc2
8732    builtin and then its argument prototype would still apply.  */
8733 char initscr ();
8734 char (*f) ();
8735
8736 int
8737 main ()
8738 {
8739 /* The GNU C library defines this for functions which it implements
8740     to always fail with ENOSYS.  Some functions are actually named
8741     something starting with __ and the normal name is an alias.  */
8742 #if defined (__stub_initscr) || defined (__stub___initscr)
8743 choke me
8744 #else
8745 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8746 #endif
8747
8748   ;
8749   return 0;
8750 }
8751 _ACEOF
8752 rm -f conftest.$ac_objext conftest$ac_exeext
8753 if { (eval echo "$as_me:8753: \"$ac_link\"") >&5
8754   (eval $ac_link) 2>&5
8755   ac_status=$?
8756   echo "$as_me:8756: \$? = $ac_status" >&5
8757   (exit $ac_status); } &&
8758          { ac_try='test -s conftest$ac_exeext'
8759   { (eval echo "$as_me:8759: \"$ac_try\"") >&5
8760   (eval $ac_try) 2>&5
8761   ac_status=$?
8762   echo "$as_me:8762: \$? = $ac_status" >&5
8763   (exit $ac_status); }; }; then
8764   ac_cv_func_initscr=yes
8765 else
8766   echo "$as_me: failed program was:" >&5
8767 cat conftest.$ac_ext >&5
8768 ac_cv_func_initscr=no
8769 fi
8770 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8771 fi
8772 echo "$as_me:8772: result: $ac_cv_func_initscr" >&5
8773 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8774 if test $ac_cv_func_initscr = yes; then
8775   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8776 else
8777
8778                 cf_save_LIBS="$LIBS"
8779                 echo "$as_me:8779: checking for initscr in -l$cf_nculib_root" >&5
8780 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8781                 LIBS="-l$cf_nculib_root $LIBS"
8782                 cat >conftest.$ac_ext <<_ACEOF
8783 #line 8783 "configure"
8784 #include "confdefs.h"
8785 #include <${cf_cv_ncurses_header:-curses.h}>
8786 int
8787 main ()
8788 {
8789 initscr()
8790   ;
8791   return 0;
8792 }
8793 _ACEOF
8794 rm -f conftest.$ac_objext conftest$ac_exeext
8795 if { (eval echo "$as_me:8795: \"$ac_link\"") >&5
8796   (eval $ac_link) 2>&5
8797   ac_status=$?
8798   echo "$as_me:8798: \$? = $ac_status" >&5
8799   (exit $ac_status); } &&
8800          { ac_try='test -s conftest$ac_exeext'
8801   { (eval echo "$as_me:8801: \"$ac_try\"") >&5
8802   (eval $ac_try) 2>&5
8803   ac_status=$?
8804   echo "$as_me:8804: \$? = $ac_status" >&5
8805   (exit $ac_status); }; }; then
8806   echo "$as_me:8806: result: yes" >&5
8807 echo "${ECHO_T}yes" >&6
8808                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8809
8810 else
8811   echo "$as_me: failed program was:" >&5
8812 cat conftest.$ac_ext >&5
8813 echo "$as_me:8813: result: no" >&5
8814 echo "${ECHO_T}no" >&6
8815
8816 cf_search=
8817 cf_library_path_list=""
8818 if test -n "${LDFLAGS}${LIBS}" ; then
8819         for cf_library_path in $LDFLAGS $LIBS
8820         do
8821                 case $cf_library_path in #(vi
8822                 -L*)
8823                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8824
8825 test "x$cf_library_path" != "xNONE" && \
8826 test -d "$cf_library_path" && \
8827  {
8828         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8829         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8830         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8831         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8832         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8833         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"
8834 }
8835
8836                         cf_library_path_list="$cf_library_path_list $cf_search"
8837                         ;;
8838                 esac
8839         done
8840 fi
8841
8842 cf_search=
8843
8844 test "x/usr" != "x$prefix" && \
8845 test -d "/usr" && \
8846 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
8847         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
8848         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
8849         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
8850         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
8851         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
8852         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
8853 }
8854
8855 test "x$prefix" != "xNONE" && \
8856 test -d "$prefix" && \
8857  {
8858         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8859         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8860         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8861         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8862         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8863         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8864 }
8865
8866 test "x/usr/local" != "x$prefix" && \
8867 test -d "/usr/local" && \
8868 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
8869         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
8870         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
8871         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
8872         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
8873         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
8874         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
8875 }
8876
8877 test "x/opt" != "x$prefix" && \
8878 test -d "/opt" && \
8879 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
8880         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
8881         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
8882         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
8883         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
8884         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
8885         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
8886 }
8887
8888 test "x$HOME" != "x$prefix" && \
8889 test -d "$HOME" && \
8890 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
8891         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
8892         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
8893         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
8894         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
8895         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
8896         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
8897 }
8898
8899 cf_search="$cf_library_path_list $cf_search"
8900
8901                         for cf_libdir in $cf_search
8902                         do
8903                                 echo "$as_me:8903: checking for -l$cf_nculib_root in $cf_libdir" >&5
8904 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8905                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8906                                 cat >conftest.$ac_ext <<_ACEOF
8907 #line 8907 "configure"
8908 #include "confdefs.h"
8909 #include <${cf_cv_ncurses_header:-curses.h}>
8910 int
8911 main ()
8912 {
8913 initscr()
8914   ;
8915   return 0;
8916 }
8917 _ACEOF
8918 rm -f conftest.$ac_objext conftest$ac_exeext
8919 if { (eval echo "$as_me:8919: \"$ac_link\"") >&5
8920   (eval $ac_link) 2>&5
8921   ac_status=$?
8922   echo "$as_me:8922: \$? = $ac_status" >&5
8923   (exit $ac_status); } &&
8924          { ac_try='test -s conftest$ac_exeext'
8925   { (eval echo "$as_me:8925: \"$ac_try\"") >&5
8926   (eval $ac_try) 2>&5
8927   ac_status=$?
8928   echo "$as_me:8928: \$? = $ac_status" >&5
8929   (exit $ac_status); }; }; then
8930   echo "$as_me:8930: result: yes" >&5
8931 echo "${ECHO_T}yes" >&6
8932                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8933                                          break
8934 else
8935   echo "$as_me: failed program was:" >&5
8936 cat conftest.$ac_ext >&5
8937 echo "$as_me:8937: result: no" >&5
8938 echo "${ECHO_T}no" >&6
8939                                          LIBS="$cf_save_LIBS"
8940 fi
8941 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8942                         done
8943
8944 fi
8945 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8946
8947 fi
8948
8949 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8950
8951 if test $cf_found_library = no ; then
8952         { { echo "$as_me:8952: error: Cannot link $cf_nculib_root library" >&5
8953 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8954    { (exit 1); exit 1; }; }
8955 fi
8956
8957 fi
8958
8959 if test -n "$cf_ncurses_LIBS" ; then
8960         echo "$as_me:8960: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8961 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8962         cf_ncurses_SAVE="$LIBS"
8963         for p in $cf_ncurses_LIBS ; do
8964                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8965                 if test "$q" != "$LIBS" ; then
8966                         LIBS="$q"
8967                 fi
8968         done
8969         cat >conftest.$ac_ext <<_ACEOF
8970 #line 8970 "configure"
8971 #include "confdefs.h"
8972 #include <${cf_cv_ncurses_header:-curses.h}>
8973 int
8974 main ()
8975 {
8976 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8977   ;
8978   return 0;
8979 }
8980 _ACEOF
8981 rm -f conftest.$ac_objext conftest$ac_exeext
8982 if { (eval echo "$as_me:8982: \"$ac_link\"") >&5
8983   (eval $ac_link) 2>&5
8984   ac_status=$?
8985   echo "$as_me:8985: \$? = $ac_status" >&5
8986   (exit $ac_status); } &&
8987          { ac_try='test -s conftest$ac_exeext'
8988   { (eval echo "$as_me:8988: \"$ac_try\"") >&5
8989   (eval $ac_try) 2>&5
8990   ac_status=$?
8991   echo "$as_me:8991: \$? = $ac_status" >&5
8992   (exit $ac_status); }; }; then
8993   echo "$as_me:8993: result: yes" >&5
8994 echo "${ECHO_T}yes" >&6
8995 else
8996   echo "$as_me: failed program was:" >&5
8997 cat conftest.$ac_ext >&5
8998 echo "$as_me:8998: result: no" >&5
8999 echo "${ECHO_T}no" >&6
9000                  LIBS="$cf_ncurses_SAVE"
9001 fi
9002 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9003 fi
9004
9005 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9006
9007 cat >>confdefs.h <<EOF
9008 #define $cf_nculib_ROOT 1
9009 EOF
9010
9011 fi
9012
9013         ;;
9014 pdcurses)
9015         echo "$as_me:9015: checking for X" >&5
9016 echo $ECHO_N "checking for X... $ECHO_C" >&6
9017
9018 # Check whether --with-x or --without-x was given.
9019 if test "${with_x+set}" = set; then
9020   withval="$with_x"
9021
9022 fi;
9023 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9024 if test "x$with_x" = xno; then
9025   # The user explicitly disabled X.
9026   have_x=disabled
9027 else
9028   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9029     # Both variables are already set.
9030     have_x=yes
9031   else
9032     if test "${ac_cv_have_x+set}" = set; then
9033   echo $ECHO_N "(cached) $ECHO_C" >&6
9034 else
9035   # One or both of the vars are not set, and there is no cached value.
9036 ac_x_includes=no ac_x_libraries=no
9037 rm -fr conftest.dir
9038 if mkdir conftest.dir; then
9039   cd conftest.dir
9040   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9041   cat >Imakefile <<'EOF'
9042 acfindx:
9043         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9044 EOF
9045   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9046     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9047     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9048     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9049     for ac_extension in a so sl dylib dll; do
9050       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9051          test -f $ac_im_libdir/libX11.$ac_extension; then
9052         ac_im_usrlibdir=$ac_im_libdir; break
9053       fi
9054     done
9055     # Screen out bogus values from the imake configuration.  They are
9056     # bogus both because they are the default anyway, and because
9057     # using them would break gcc on systems where it needs fixed includes.
9058     case $ac_im_incroot in
9059         /usr/include) ;;
9060         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9061     esac
9062     case $ac_im_usrlibdir in
9063         /usr/lib | /lib) ;;
9064         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9065     esac
9066   fi
9067   cd ..
9068   rm -fr conftest.dir
9069 fi
9070
9071 # Standard set of common directories for X headers.
9072 # Check X11 before X11Rn because it is often a symlink to the current release.
9073 ac_x_header_dirs='
9074 /usr/X11/include
9075 /usr/X11R6/include
9076 /usr/X11R5/include
9077 /usr/X11R4/include
9078
9079 /usr/include/X11
9080 /usr/include/X11R6
9081 /usr/include/X11R5
9082 /usr/include/X11R4
9083
9084 /usr/local/X11/include
9085 /usr/local/X11R6/include
9086 /usr/local/X11R5/include
9087 /usr/local/X11R4/include
9088
9089 /usr/local/include/X11
9090 /usr/local/include/X11R6
9091 /usr/local/include/X11R5
9092 /usr/local/include/X11R4
9093
9094 /usr/X386/include
9095 /usr/x386/include
9096 /usr/XFree86/include/X11
9097
9098 /usr/include
9099 /usr/local/include
9100 /usr/unsupported/include
9101 /usr/athena/include
9102 /usr/local/x11r5/include
9103 /usr/lpp/Xamples/include
9104
9105 /usr/openwin/include
9106 /usr/openwin/share/include'
9107
9108 if test "$ac_x_includes" = no; then
9109   # Guess where to find include files, by looking for Intrinsic.h.
9110   # First, try using that file with no special directory specified.
9111   cat >conftest.$ac_ext <<_ACEOF
9112 #line 9112 "configure"
9113 #include "confdefs.h"
9114 #include <X11/Intrinsic.h>
9115 _ACEOF
9116 if { (eval echo "$as_me:9116: \"$ac_cpp conftest.$ac_ext\"") >&5
9117   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9118   ac_status=$?
9119   egrep -v '^ *\+' conftest.er1 >conftest.err
9120   rm -f conftest.er1
9121   cat conftest.err >&5
9122   echo "$as_me:9122: \$? = $ac_status" >&5
9123   (exit $ac_status); } >/dev/null; then
9124   if test -s conftest.err; then
9125     ac_cpp_err=$ac_c_preproc_warn_flag
9126   else
9127     ac_cpp_err=
9128   fi
9129 else
9130   ac_cpp_err=yes
9131 fi
9132 if test -z "$ac_cpp_err"; then
9133   # We can compile using X headers with no special include directory.
9134 ac_x_includes=
9135 else
9136   echo "$as_me: failed program was:" >&5
9137   cat conftest.$ac_ext >&5
9138   for ac_dir in $ac_x_header_dirs; do
9139   if test -r "$ac_dir/X11/Intrinsic.h"; then
9140     ac_x_includes=$ac_dir
9141     break
9142   fi
9143 done
9144 fi
9145 rm -f conftest.err conftest.$ac_ext
9146 fi # $ac_x_includes = no
9147
9148 if test "$ac_x_libraries" = no; then
9149   # Check for the libraries.
9150   # See if we find them without any special options.
9151   # Don't add to $LIBS permanently.
9152   ac_save_LIBS=$LIBS
9153   LIBS="-lXt $LIBS"
9154   cat >conftest.$ac_ext <<_ACEOF
9155 #line 9155 "configure"
9156 #include "confdefs.h"
9157 #include <X11/Intrinsic.h>
9158 int
9159 main ()
9160 {
9161 XtMalloc (0)
9162   ;
9163   return 0;
9164 }
9165 _ACEOF
9166 rm -f conftest.$ac_objext conftest$ac_exeext
9167 if { (eval echo "$as_me:9167: \"$ac_link\"") >&5
9168   (eval $ac_link) 2>&5
9169   ac_status=$?
9170   echo "$as_me:9170: \$? = $ac_status" >&5
9171   (exit $ac_status); } &&
9172          { ac_try='test -s conftest$ac_exeext'
9173   { (eval echo "$as_me:9173: \"$ac_try\"") >&5
9174   (eval $ac_try) 2>&5
9175   ac_status=$?
9176   echo "$as_me:9176: \$? = $ac_status" >&5
9177   (exit $ac_status); }; }; then
9178   LIBS=$ac_save_LIBS
9179 # We can link X programs with no special library path.
9180 ac_x_libraries=
9181 else
9182   echo "$as_me: failed program was:" >&5
9183 cat conftest.$ac_ext >&5
9184 LIBS=$ac_save_LIBS
9185 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9186 do
9187   # Don't even attempt the hair of trying to link an X program!
9188   for ac_extension in a so sl dylib dll; do
9189     if test -r $ac_dir/libXt.$ac_extension; then
9190       ac_x_libraries=$ac_dir
9191       break 2
9192     fi
9193   done
9194 done
9195 fi
9196 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9197 fi # $ac_x_libraries = no
9198
9199 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9200   # Didn't find X anywhere.  Cache the known absence of X.
9201   ac_cv_have_x="have_x=no"
9202 else
9203   # Record where we found X for the cache.
9204   ac_cv_have_x="have_x=yes \
9205                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9206 fi
9207 fi
9208
9209   fi
9210   eval "$ac_cv_have_x"
9211 fi # $with_x != no
9212
9213 if test "$have_x" != yes; then
9214   echo "$as_me:9214: result: $have_x" >&5
9215 echo "${ECHO_T}$have_x" >&6
9216   no_x=yes
9217 else
9218   # If each of the values was on the command line, it overrides each guess.
9219   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9220   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9221   # Update the cache value to reflect the command line values.
9222   ac_cv_have_x="have_x=yes \
9223                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9224   echo "$as_me:9224: result: libraries $x_libraries, headers $x_includes" >&5
9225 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9226 fi
9227
9228 if test "$no_x" = yes; then
9229   # Not all programs may use this symbol, but it does not hurt to define it.
9230
9231 cat >>confdefs.h <<\EOF
9232 #define X_DISPLAY_MISSING 1
9233 EOF
9234
9235   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9236 else
9237   if test -n "$x_includes"; then
9238     X_CFLAGS="$X_CFLAGS -I$x_includes"
9239   fi
9240
9241   # It would also be nice to do this for all -L options, not just this one.
9242   if test -n "$x_libraries"; then
9243     X_LIBS="$X_LIBS -L$x_libraries"
9244     # For Solaris; some versions of Sun CC require a space after -R and
9245     # others require no space.  Words are not sufficient . . . .
9246     case `(uname -sr) 2>/dev/null` in
9247     "SunOS 5"*)
9248       echo "$as_me:9248: checking whether -R must be followed by a space" >&5
9249 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9250       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9251       cat >conftest.$ac_ext <<_ACEOF
9252 #line 9252 "configure"
9253 #include "confdefs.h"
9254
9255 int
9256 main ()
9257 {
9258
9259   ;
9260   return 0;
9261 }
9262 _ACEOF
9263 rm -f conftest.$ac_objext conftest$ac_exeext
9264 if { (eval echo "$as_me:9264: \"$ac_link\"") >&5
9265   (eval $ac_link) 2>&5
9266   ac_status=$?
9267   echo "$as_me:9267: \$? = $ac_status" >&5
9268   (exit $ac_status); } &&
9269          { ac_try='test -s conftest$ac_exeext'
9270   { (eval echo "$as_me:9270: \"$ac_try\"") >&5
9271   (eval $ac_try) 2>&5
9272   ac_status=$?
9273   echo "$as_me:9273: \$? = $ac_status" >&5
9274   (exit $ac_status); }; }; then
9275   ac_R_nospace=yes
9276 else
9277   echo "$as_me: failed program was:" >&5
9278 cat conftest.$ac_ext >&5
9279 ac_R_nospace=no
9280 fi
9281 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9282       if test $ac_R_nospace = yes; then
9283         echo "$as_me:9283: result: no" >&5
9284 echo "${ECHO_T}no" >&6
9285         X_LIBS="$X_LIBS -R$x_libraries"
9286       else
9287         LIBS="$ac_xsave_LIBS -R $x_libraries"
9288         cat >conftest.$ac_ext <<_ACEOF
9289 #line 9289 "configure"
9290 #include "confdefs.h"
9291
9292 int
9293 main ()
9294 {
9295
9296   ;
9297   return 0;
9298 }
9299 _ACEOF
9300 rm -f conftest.$ac_objext conftest$ac_exeext
9301 if { (eval echo "$as_me:9301: \"$ac_link\"") >&5
9302   (eval $ac_link) 2>&5
9303   ac_status=$?
9304   echo "$as_me:9304: \$? = $ac_status" >&5
9305   (exit $ac_status); } &&
9306          { ac_try='test -s conftest$ac_exeext'
9307   { (eval echo "$as_me:9307: \"$ac_try\"") >&5
9308   (eval $ac_try) 2>&5
9309   ac_status=$?
9310   echo "$as_me:9310: \$? = $ac_status" >&5
9311   (exit $ac_status); }; }; then
9312   ac_R_space=yes
9313 else
9314   echo "$as_me: failed program was:" >&5
9315 cat conftest.$ac_ext >&5
9316 ac_R_space=no
9317 fi
9318 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9319         if test $ac_R_space = yes; then
9320           echo "$as_me:9320: result: yes" >&5
9321 echo "${ECHO_T}yes" >&6
9322           X_LIBS="$X_LIBS -R $x_libraries"
9323         else
9324           echo "$as_me:9324: result: neither works" >&5
9325 echo "${ECHO_T}neither works" >&6
9326         fi
9327       fi
9328       LIBS=$ac_xsave_LIBS
9329     esac
9330   fi
9331
9332   # Check for system-dependent libraries X programs must link with.
9333   # Do this before checking for the system-independent R6 libraries
9334   # (-lICE), since we may need -lsocket or whatever for X linking.
9335
9336   if test "$ISC" = yes; then
9337     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9338   else
9339     # Martyn Johnson says this is needed for Ultrix, if the X
9340     # libraries were built with DECnet support.  And Karl Berry says
9341     # the Alpha needs dnet_stub (dnet does not exist).
9342     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9343     cat >conftest.$ac_ext <<_ACEOF
9344 #line 9344 "configure"
9345 #include "confdefs.h"
9346
9347 /* Override any gcc2 internal prototype to avoid an error.  */
9348 #ifdef __cplusplus
9349 extern "C"
9350 #endif
9351 /* We use char because int might match the return type of a gcc2
9352    builtin and then its argument prototype would still apply.  */
9353 char XOpenDisplay ();
9354 int
9355 main ()
9356 {
9357 XOpenDisplay ();
9358   ;
9359   return 0;
9360 }
9361 _ACEOF
9362 rm -f conftest.$ac_objext conftest$ac_exeext
9363 if { (eval echo "$as_me:9363: \"$ac_link\"") >&5
9364   (eval $ac_link) 2>&5
9365   ac_status=$?
9366   echo "$as_me:9366: \$? = $ac_status" >&5
9367   (exit $ac_status); } &&
9368          { ac_try='test -s conftest$ac_exeext'
9369   { (eval echo "$as_me:9369: \"$ac_try\"") >&5
9370   (eval $ac_try) 2>&5
9371   ac_status=$?
9372   echo "$as_me:9372: \$? = $ac_status" >&5
9373   (exit $ac_status); }; }; then
9374   :
9375 else
9376   echo "$as_me: failed program was:" >&5
9377 cat conftest.$ac_ext >&5
9378 echo "$as_me:9378: checking for dnet_ntoa in -ldnet" >&5
9379 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9380 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9381   echo $ECHO_N "(cached) $ECHO_C" >&6
9382 else
9383   ac_check_lib_save_LIBS=$LIBS
9384 LIBS="-ldnet  $LIBS"
9385 cat >conftest.$ac_ext <<_ACEOF
9386 #line 9386 "configure"
9387 #include "confdefs.h"
9388
9389 /* Override any gcc2 internal prototype to avoid an error.  */
9390 #ifdef __cplusplus
9391 extern "C"
9392 #endif
9393 /* We use char because int might match the return type of a gcc2
9394    builtin and then its argument prototype would still apply.  */
9395 char dnet_ntoa ();
9396 int
9397 main ()
9398 {
9399 dnet_ntoa ();
9400   ;
9401   return 0;
9402 }
9403 _ACEOF
9404 rm -f conftest.$ac_objext conftest$ac_exeext
9405 if { (eval echo "$as_me:9405: \"$ac_link\"") >&5
9406   (eval $ac_link) 2>&5
9407   ac_status=$?
9408   echo "$as_me:9408: \$? = $ac_status" >&5
9409   (exit $ac_status); } &&
9410          { ac_try='test -s conftest$ac_exeext'
9411   { (eval echo "$as_me:9411: \"$ac_try\"") >&5
9412   (eval $ac_try) 2>&5
9413   ac_status=$?
9414   echo "$as_me:9414: \$? = $ac_status" >&5
9415   (exit $ac_status); }; }; then
9416   ac_cv_lib_dnet_dnet_ntoa=yes
9417 else
9418   echo "$as_me: failed program was:" >&5
9419 cat conftest.$ac_ext >&5
9420 ac_cv_lib_dnet_dnet_ntoa=no
9421 fi
9422 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9423 LIBS=$ac_check_lib_save_LIBS
9424 fi
9425 echo "$as_me:9425: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9426 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9427 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9428   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9429 fi
9430
9431     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9432       echo "$as_me:9432: checking for dnet_ntoa in -ldnet_stub" >&5
9433 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9434 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9435   echo $ECHO_N "(cached) $ECHO_C" >&6
9436 else
9437   ac_check_lib_save_LIBS=$LIBS
9438 LIBS="-ldnet_stub  $LIBS"
9439 cat >conftest.$ac_ext <<_ACEOF
9440 #line 9440 "configure"
9441 #include "confdefs.h"
9442
9443 /* Override any gcc2 internal prototype to avoid an error.  */
9444 #ifdef __cplusplus
9445 extern "C"
9446 #endif
9447 /* We use char because int might match the return type of a gcc2
9448    builtin and then its argument prototype would still apply.  */
9449 char dnet_ntoa ();
9450 int
9451 main ()
9452 {
9453 dnet_ntoa ();
9454   ;
9455   return 0;
9456 }
9457 _ACEOF
9458 rm -f conftest.$ac_objext conftest$ac_exeext
9459 if { (eval echo "$as_me:9459: \"$ac_link\"") >&5
9460   (eval $ac_link) 2>&5
9461   ac_status=$?
9462   echo "$as_me:9462: \$? = $ac_status" >&5
9463   (exit $ac_status); } &&
9464          { ac_try='test -s conftest$ac_exeext'
9465   { (eval echo "$as_me:9465: \"$ac_try\"") >&5
9466   (eval $ac_try) 2>&5
9467   ac_status=$?
9468   echo "$as_me:9468: \$? = $ac_status" >&5
9469   (exit $ac_status); }; }; then
9470   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9471 else
9472   echo "$as_me: failed program was:" >&5
9473 cat conftest.$ac_ext >&5
9474 ac_cv_lib_dnet_stub_dnet_ntoa=no
9475 fi
9476 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9477 LIBS=$ac_check_lib_save_LIBS
9478 fi
9479 echo "$as_me:9479: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9480 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9481 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9482   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9483 fi
9484
9485     fi
9486 fi
9487 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9488     LIBS="$ac_xsave_LIBS"
9489
9490     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9491     # to get the SysV transport functions.
9492     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9493     # needs -lnsl.
9494     # The nsl library prevents programs from opening the X display
9495     # on Irix 5.2, according to T.E. Dickey.
9496     # The functions gethostbyname, getservbyname, and inet_addr are
9497     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9498     echo "$as_me:9498: checking for gethostbyname" >&5
9499 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9500 if test "${ac_cv_func_gethostbyname+set}" = set; then
9501   echo $ECHO_N "(cached) $ECHO_C" >&6
9502 else
9503   cat >conftest.$ac_ext <<_ACEOF
9504 #line 9504 "configure"
9505 #include "confdefs.h"
9506 /* System header to define __stub macros and hopefully few prototypes,
9507     which can conflict with char gethostbyname (); below.  */
9508 #include <assert.h>
9509 /* Override any gcc2 internal prototype to avoid an error.  */
9510 #ifdef __cplusplus
9511 extern "C"
9512 #endif
9513 /* We use char because int might match the return type of a gcc2
9514    builtin and then its argument prototype would still apply.  */
9515 char gethostbyname ();
9516 char (*f) ();
9517
9518 int
9519 main ()
9520 {
9521 /* The GNU C library defines this for functions which it implements
9522     to always fail with ENOSYS.  Some functions are actually named
9523     something starting with __ and the normal name is an alias.  */
9524 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9525 choke me
9526 #else
9527 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9528 #endif
9529
9530   ;
9531   return 0;
9532 }
9533 _ACEOF
9534 rm -f conftest.$ac_objext conftest$ac_exeext
9535 if { (eval echo "$as_me:9535: \"$ac_link\"") >&5
9536   (eval $ac_link) 2>&5
9537   ac_status=$?
9538   echo "$as_me:9538: \$? = $ac_status" >&5
9539   (exit $ac_status); } &&
9540          { ac_try='test -s conftest$ac_exeext'
9541   { (eval echo "$as_me:9541: \"$ac_try\"") >&5
9542   (eval $ac_try) 2>&5
9543   ac_status=$?
9544   echo "$as_me:9544: \$? = $ac_status" >&5
9545   (exit $ac_status); }; }; then
9546   ac_cv_func_gethostbyname=yes
9547 else
9548   echo "$as_me: failed program was:" >&5
9549 cat conftest.$ac_ext >&5
9550 ac_cv_func_gethostbyname=no
9551 fi
9552 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9553 fi
9554 echo "$as_me:9554: result: $ac_cv_func_gethostbyname" >&5
9555 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9556
9557     if test $ac_cv_func_gethostbyname = no; then
9558       echo "$as_me:9558: checking for gethostbyname in -lnsl" >&5
9559 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9560 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9561   echo $ECHO_N "(cached) $ECHO_C" >&6
9562 else
9563   ac_check_lib_save_LIBS=$LIBS
9564 LIBS="-lnsl  $LIBS"
9565 cat >conftest.$ac_ext <<_ACEOF
9566 #line 9566 "configure"
9567 #include "confdefs.h"
9568
9569 /* Override any gcc2 internal prototype to avoid an error.  */
9570 #ifdef __cplusplus
9571 extern "C"
9572 #endif
9573 /* We use char because int might match the return type of a gcc2
9574    builtin and then its argument prototype would still apply.  */
9575 char gethostbyname ();
9576 int
9577 main ()
9578 {
9579 gethostbyname ();
9580   ;
9581   return 0;
9582 }
9583 _ACEOF
9584 rm -f conftest.$ac_objext conftest$ac_exeext
9585 if { (eval echo "$as_me:9585: \"$ac_link\"") >&5
9586   (eval $ac_link) 2>&5
9587   ac_status=$?
9588   echo "$as_me:9588: \$? = $ac_status" >&5
9589   (exit $ac_status); } &&
9590          { ac_try='test -s conftest$ac_exeext'
9591   { (eval echo "$as_me:9591: \"$ac_try\"") >&5
9592   (eval $ac_try) 2>&5
9593   ac_status=$?
9594   echo "$as_me:9594: \$? = $ac_status" >&5
9595   (exit $ac_status); }; }; then
9596   ac_cv_lib_nsl_gethostbyname=yes
9597 else
9598   echo "$as_me: failed program was:" >&5
9599 cat conftest.$ac_ext >&5
9600 ac_cv_lib_nsl_gethostbyname=no
9601 fi
9602 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9603 LIBS=$ac_check_lib_save_LIBS
9604 fi
9605 echo "$as_me:9605: result: $ac_cv_lib_nsl_gethostbyname" >&5
9606 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9607 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9608   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9609 fi
9610
9611       if test $ac_cv_lib_nsl_gethostbyname = no; then
9612         echo "$as_me:9612: checking for gethostbyname in -lbsd" >&5
9613 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9614 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9615   echo $ECHO_N "(cached) $ECHO_C" >&6
9616 else
9617   ac_check_lib_save_LIBS=$LIBS
9618 LIBS="-lbsd  $LIBS"
9619 cat >conftest.$ac_ext <<_ACEOF
9620 #line 9620 "configure"
9621 #include "confdefs.h"
9622
9623 /* Override any gcc2 internal prototype to avoid an error.  */
9624 #ifdef __cplusplus
9625 extern "C"
9626 #endif
9627 /* We use char because int might match the return type of a gcc2
9628    builtin and then its argument prototype would still apply.  */
9629 char gethostbyname ();
9630 int
9631 main ()
9632 {
9633 gethostbyname ();
9634   ;
9635   return 0;
9636 }
9637 _ACEOF
9638 rm -f conftest.$ac_objext conftest$ac_exeext
9639 if { (eval echo "$as_me:9639: \"$ac_link\"") >&5
9640   (eval $ac_link) 2>&5
9641   ac_status=$?
9642   echo "$as_me:9642: \$? = $ac_status" >&5
9643   (exit $ac_status); } &&
9644          { ac_try='test -s conftest$ac_exeext'
9645   { (eval echo "$as_me:9645: \"$ac_try\"") >&5
9646   (eval $ac_try) 2>&5
9647   ac_status=$?
9648   echo "$as_me:9648: \$? = $ac_status" >&5
9649   (exit $ac_status); }; }; then
9650   ac_cv_lib_bsd_gethostbyname=yes
9651 else
9652   echo "$as_me: failed program was:" >&5
9653 cat conftest.$ac_ext >&5
9654 ac_cv_lib_bsd_gethostbyname=no
9655 fi
9656 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9657 LIBS=$ac_check_lib_save_LIBS
9658 fi
9659 echo "$as_me:9659: result: $ac_cv_lib_bsd_gethostbyname" >&5
9660 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
9661 if test $ac_cv_lib_bsd_gethostbyname = yes; then
9662   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
9663 fi
9664
9665       fi
9666     fi
9667
9668     # lieder@skyler.mavd.honeywell.com says without -lsocket,
9669     # socket/setsockopt and other routines are undefined under SCO ODT
9670     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
9671     # on later versions), says Simon Leinen: it contains gethostby*
9672     # variants that don't use the nameserver (or something).  -lsocket
9673     # must be given before -lnsl if both are needed.  We assume that
9674     # if connect needs -lnsl, so does gethostbyname.
9675     echo "$as_me:9675: checking for connect" >&5
9676 echo $ECHO_N "checking for connect... $ECHO_C" >&6
9677 if test "${ac_cv_func_connect+set}" = set; then
9678   echo $ECHO_N "(cached) $ECHO_C" >&6
9679 else
9680   cat >conftest.$ac_ext <<_ACEOF
9681 #line 9681 "configure"
9682 #include "confdefs.h"
9683 /* System header to define __stub macros and hopefully few prototypes,
9684     which can conflict with char connect (); below.  */
9685 #include <assert.h>
9686 /* Override any gcc2 internal prototype to avoid an error.  */
9687 #ifdef __cplusplus
9688 extern "C"
9689 #endif
9690 /* We use char because int might match the return type of a gcc2
9691    builtin and then its argument prototype would still apply.  */
9692 char connect ();
9693 char (*f) ();
9694
9695 int
9696 main ()
9697 {
9698 /* The GNU C library defines this for functions which it implements
9699     to always fail with ENOSYS.  Some functions are actually named
9700     something starting with __ and the normal name is an alias.  */
9701 #if defined (__stub_connect) || defined (__stub___connect)
9702 choke me
9703 #else
9704 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9705 #endif
9706
9707   ;
9708   return 0;
9709 }
9710 _ACEOF
9711 rm -f conftest.$ac_objext conftest$ac_exeext
9712 if { (eval echo "$as_me:9712: \"$ac_link\"") >&5
9713   (eval $ac_link) 2>&5
9714   ac_status=$?
9715   echo "$as_me:9715: \$? = $ac_status" >&5
9716   (exit $ac_status); } &&
9717          { ac_try='test -s conftest$ac_exeext'
9718   { (eval echo "$as_me:9718: \"$ac_try\"") >&5
9719   (eval $ac_try) 2>&5
9720   ac_status=$?
9721   echo "$as_me:9721: \$? = $ac_status" >&5
9722   (exit $ac_status); }; }; then
9723   ac_cv_func_connect=yes
9724 else
9725   echo "$as_me: failed program was:" >&5
9726 cat conftest.$ac_ext >&5
9727 ac_cv_func_connect=no
9728 fi
9729 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9730 fi
9731 echo "$as_me:9731: result: $ac_cv_func_connect" >&5
9732 echo "${ECHO_T}$ac_cv_func_connect" >&6
9733
9734     if test $ac_cv_func_connect = no; then
9735       echo "$as_me:9735: checking for connect in -lsocket" >&5
9736 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
9737 if test "${ac_cv_lib_socket_connect+set}" = set; then
9738   echo $ECHO_N "(cached) $ECHO_C" >&6
9739 else
9740   ac_check_lib_save_LIBS=$LIBS
9741 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
9742 cat >conftest.$ac_ext <<_ACEOF
9743 #line 9743 "configure"
9744 #include "confdefs.h"
9745
9746 /* Override any gcc2 internal prototype to avoid an error.  */
9747 #ifdef __cplusplus
9748 extern "C"
9749 #endif
9750 /* We use char because int might match the return type of a gcc2
9751    builtin and then its argument prototype would still apply.  */
9752 char connect ();
9753 int
9754 main ()
9755 {
9756 connect ();
9757   ;
9758   return 0;
9759 }
9760 _ACEOF
9761 rm -f conftest.$ac_objext conftest$ac_exeext
9762 if { (eval echo "$as_me:9762: \"$ac_link\"") >&5
9763   (eval $ac_link) 2>&5
9764   ac_status=$?
9765   echo "$as_me:9765: \$? = $ac_status" >&5
9766   (exit $ac_status); } &&
9767          { ac_try='test -s conftest$ac_exeext'
9768   { (eval echo "$as_me:9768: \"$ac_try\"") >&5
9769   (eval $ac_try) 2>&5
9770   ac_status=$?
9771   echo "$as_me:9771: \$? = $ac_status" >&5
9772   (exit $ac_status); }; }; then
9773   ac_cv_lib_socket_connect=yes
9774 else
9775   echo "$as_me: failed program was:" >&5
9776 cat conftest.$ac_ext >&5
9777 ac_cv_lib_socket_connect=no
9778 fi
9779 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9780 LIBS=$ac_check_lib_save_LIBS
9781 fi
9782 echo "$as_me:9782: result: $ac_cv_lib_socket_connect" >&5
9783 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
9784 if test $ac_cv_lib_socket_connect = yes; then
9785   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
9786 fi
9787
9788     fi
9789
9790     # Guillermo Gomez says -lposix is necessary on A/UX.
9791     echo "$as_me:9791: checking for remove" >&5
9792 echo $ECHO_N "checking for remove... $ECHO_C" >&6
9793 if test "${ac_cv_func_remove+set}" = set; then
9794   echo $ECHO_N "(cached) $ECHO_C" >&6
9795 else
9796   cat >conftest.$ac_ext <<_ACEOF
9797 #line 9797 "configure"
9798 #include "confdefs.h"
9799 /* System header to define __stub macros and hopefully few prototypes,
9800     which can conflict with char remove (); below.  */
9801 #include <assert.h>
9802 /* Override any gcc2 internal prototype to avoid an error.  */
9803 #ifdef __cplusplus
9804 extern "C"
9805 #endif
9806 /* We use char because int might match the return type of a gcc2
9807    builtin and then its argument prototype would still apply.  */
9808 char remove ();
9809 char (*f) ();
9810
9811 int
9812 main ()
9813 {
9814 /* The GNU C library defines this for functions which it implements
9815     to always fail with ENOSYS.  Some functions are actually named
9816     something starting with __ and the normal name is an alias.  */
9817 #if defined (__stub_remove) || defined (__stub___remove)
9818 choke me
9819 #else
9820 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9821 #endif
9822
9823   ;
9824   return 0;
9825 }
9826 _ACEOF
9827 rm -f conftest.$ac_objext conftest$ac_exeext
9828 if { (eval echo "$as_me:9828: \"$ac_link\"") >&5
9829   (eval $ac_link) 2>&5
9830   ac_status=$?
9831   echo "$as_me:9831: \$? = $ac_status" >&5
9832   (exit $ac_status); } &&
9833          { ac_try='test -s conftest$ac_exeext'
9834   { (eval echo "$as_me:9834: \"$ac_try\"") >&5
9835   (eval $ac_try) 2>&5
9836   ac_status=$?
9837   echo "$as_me:9837: \$? = $ac_status" >&5
9838   (exit $ac_status); }; }; then
9839   ac_cv_func_remove=yes
9840 else
9841   echo "$as_me: failed program was:" >&5
9842 cat conftest.$ac_ext >&5
9843 ac_cv_func_remove=no
9844 fi
9845 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9846 fi
9847 echo "$as_me:9847: result: $ac_cv_func_remove" >&5
9848 echo "${ECHO_T}$ac_cv_func_remove" >&6
9849
9850     if test $ac_cv_func_remove = no; then
9851       echo "$as_me:9851: checking for remove in -lposix" >&5
9852 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
9853 if test "${ac_cv_lib_posix_remove+set}" = set; then
9854   echo $ECHO_N "(cached) $ECHO_C" >&6
9855 else
9856   ac_check_lib_save_LIBS=$LIBS
9857 LIBS="-lposix  $LIBS"
9858 cat >conftest.$ac_ext <<_ACEOF
9859 #line 9859 "configure"
9860 #include "confdefs.h"
9861
9862 /* Override any gcc2 internal prototype to avoid an error.  */
9863 #ifdef __cplusplus
9864 extern "C"
9865 #endif
9866 /* We use char because int might match the return type of a gcc2
9867    builtin and then its argument prototype would still apply.  */
9868 char remove ();
9869 int
9870 main ()
9871 {
9872 remove ();
9873   ;
9874   return 0;
9875 }
9876 _ACEOF
9877 rm -f conftest.$ac_objext conftest$ac_exeext
9878 if { (eval echo "$as_me:9878: \"$ac_link\"") >&5
9879   (eval $ac_link) 2>&5
9880   ac_status=$?
9881   echo "$as_me:9881: \$? = $ac_status" >&5
9882   (exit $ac_status); } &&
9883          { ac_try='test -s conftest$ac_exeext'
9884   { (eval echo "$as_me:9884: \"$ac_try\"") >&5
9885   (eval $ac_try) 2>&5
9886   ac_status=$?
9887   echo "$as_me:9887: \$? = $ac_status" >&5
9888   (exit $ac_status); }; }; then
9889   ac_cv_lib_posix_remove=yes
9890 else
9891   echo "$as_me: failed program was:" >&5
9892 cat conftest.$ac_ext >&5
9893 ac_cv_lib_posix_remove=no
9894 fi
9895 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9896 LIBS=$ac_check_lib_save_LIBS
9897 fi
9898 echo "$as_me:9898: result: $ac_cv_lib_posix_remove" >&5
9899 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
9900 if test $ac_cv_lib_posix_remove = yes; then
9901   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
9902 fi
9903
9904     fi
9905
9906     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
9907     echo "$as_me:9907: checking for shmat" >&5
9908 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
9909 if test "${ac_cv_func_shmat+set}" = set; then
9910   echo $ECHO_N "(cached) $ECHO_C" >&6
9911 else
9912   cat >conftest.$ac_ext <<_ACEOF
9913 #line 9913 "configure"
9914 #include "confdefs.h"
9915 /* System header to define __stub macros and hopefully few prototypes,
9916     which can conflict with char shmat (); below.  */
9917 #include <assert.h>
9918 /* Override any gcc2 internal prototype to avoid an error.  */
9919 #ifdef __cplusplus
9920 extern "C"
9921 #endif
9922 /* We use char because int might match the return type of a gcc2
9923    builtin and then its argument prototype would still apply.  */
9924 char shmat ();
9925 char (*f) ();
9926
9927 int
9928 main ()
9929 {
9930 /* The GNU C library defines this for functions which it implements
9931     to always fail with ENOSYS.  Some functions are actually named
9932     something starting with __ and the normal name is an alias.  */
9933 #if defined (__stub_shmat) || defined (__stub___shmat)
9934 choke me
9935 #else
9936 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9937 #endif
9938
9939   ;
9940   return 0;
9941 }
9942 _ACEOF
9943 rm -f conftest.$ac_objext conftest$ac_exeext
9944 if { (eval echo "$as_me:9944: \"$ac_link\"") >&5
9945   (eval $ac_link) 2>&5
9946   ac_status=$?
9947   echo "$as_me:9947: \$? = $ac_status" >&5
9948   (exit $ac_status); } &&
9949          { ac_try='test -s conftest$ac_exeext'
9950   { (eval echo "$as_me:9950: \"$ac_try\"") >&5
9951   (eval $ac_try) 2>&5
9952   ac_status=$?
9953   echo "$as_me:9953: \$? = $ac_status" >&5
9954   (exit $ac_status); }; }; then
9955   ac_cv_func_shmat=yes
9956 else
9957   echo "$as_me: failed program was:" >&5
9958 cat conftest.$ac_ext >&5
9959 ac_cv_func_shmat=no
9960 fi
9961 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9962 fi
9963 echo "$as_me:9963: result: $ac_cv_func_shmat" >&5
9964 echo "${ECHO_T}$ac_cv_func_shmat" >&6
9965
9966     if test $ac_cv_func_shmat = no; then
9967       echo "$as_me:9967: checking for shmat in -lipc" >&5
9968 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
9969 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
9970   echo $ECHO_N "(cached) $ECHO_C" >&6
9971 else
9972   ac_check_lib_save_LIBS=$LIBS
9973 LIBS="-lipc  $LIBS"
9974 cat >conftest.$ac_ext <<_ACEOF
9975 #line 9975 "configure"
9976 #include "confdefs.h"
9977
9978 /* Override any gcc2 internal prototype to avoid an error.  */
9979 #ifdef __cplusplus
9980 extern "C"
9981 #endif
9982 /* We use char because int might match the return type of a gcc2
9983    builtin and then its argument prototype would still apply.  */
9984 char shmat ();
9985 int
9986 main ()
9987 {
9988 shmat ();
9989   ;
9990   return 0;
9991 }
9992 _ACEOF
9993 rm -f conftest.$ac_objext conftest$ac_exeext
9994 if { (eval echo "$as_me:9994: \"$ac_link\"") >&5
9995   (eval $ac_link) 2>&5
9996   ac_status=$?
9997   echo "$as_me:9997: \$? = $ac_status" >&5
9998   (exit $ac_status); } &&
9999          { ac_try='test -s conftest$ac_exeext'
10000   { (eval echo "$as_me:10000: \"$ac_try\"") >&5
10001   (eval $ac_try) 2>&5
10002   ac_status=$?
10003   echo "$as_me:10003: \$? = $ac_status" >&5
10004   (exit $ac_status); }; }; then
10005   ac_cv_lib_ipc_shmat=yes
10006 else
10007   echo "$as_me: failed program was:" >&5
10008 cat conftest.$ac_ext >&5
10009 ac_cv_lib_ipc_shmat=no
10010 fi
10011 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10012 LIBS=$ac_check_lib_save_LIBS
10013 fi
10014 echo "$as_me:10014: result: $ac_cv_lib_ipc_shmat" >&5
10015 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10016 if test $ac_cv_lib_ipc_shmat = yes; then
10017   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10018 fi
10019
10020     fi
10021   fi
10022
10023   # Check for libraries that X11R6 Xt/Xaw programs need.
10024   ac_save_LDFLAGS=$LDFLAGS
10025   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10026   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10027   # check for ICE first), but we must link in the order -lSM -lICE or
10028   # we get undefined symbols.  So assume we have SM if we have ICE.
10029   # These have to be linked with before -lX11, unlike the other
10030   # libraries we check for below, so use a different variable.
10031   # John Interrante, Karl Berry
10032   echo "$as_me:10032: checking for IceConnectionNumber in -lICE" >&5
10033 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10034 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10035   echo $ECHO_N "(cached) $ECHO_C" >&6
10036 else
10037   ac_check_lib_save_LIBS=$LIBS
10038 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10039 cat >conftest.$ac_ext <<_ACEOF
10040 #line 10040 "configure"
10041 #include "confdefs.h"
10042
10043 /* Override any gcc2 internal prototype to avoid an error.  */
10044 #ifdef __cplusplus
10045 extern "C"
10046 #endif
10047 /* We use char because int might match the return type of a gcc2
10048    builtin and then its argument prototype would still apply.  */
10049 char IceConnectionNumber ();
10050 int
10051 main ()
10052 {
10053 IceConnectionNumber ();
10054   ;
10055   return 0;
10056 }
10057 _ACEOF
10058 rm -f conftest.$ac_objext conftest$ac_exeext
10059 if { (eval echo "$as_me:10059: \"$ac_link\"") >&5
10060   (eval $ac_link) 2>&5
10061   ac_status=$?
10062   echo "$as_me:10062: \$? = $ac_status" >&5
10063   (exit $ac_status); } &&
10064          { ac_try='test -s conftest$ac_exeext'
10065   { (eval echo "$as_me:10065: \"$ac_try\"") >&5
10066   (eval $ac_try) 2>&5
10067   ac_status=$?
10068   echo "$as_me:10068: \$? = $ac_status" >&5
10069   (exit $ac_status); }; }; then
10070   ac_cv_lib_ICE_IceConnectionNumber=yes
10071 else
10072   echo "$as_me: failed program was:" >&5
10073 cat conftest.$ac_ext >&5
10074 ac_cv_lib_ICE_IceConnectionNumber=no
10075 fi
10076 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10077 LIBS=$ac_check_lib_save_LIBS
10078 fi
10079 echo "$as_me:10079: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10080 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10081 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10082   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10083 fi
10084
10085   LDFLAGS=$ac_save_LDFLAGS
10086
10087 fi
10088
10089 cf_x_athena=${cf_x_athena:-Xaw}
10090
10091 echo "$as_me:10091: checking if you want to link with Xaw 3d library" >&5
10092 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10093 withval=
10094
10095 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10096 if test "${with_Xaw3d+set}" = set; then
10097   withval="$with_Xaw3d"
10098
10099 fi;
10100 if test "$withval" = yes ; then
10101         cf_x_athena=Xaw3d
10102         echo "$as_me:10102: result: yes" >&5
10103 echo "${ECHO_T}yes" >&6
10104 else
10105         echo "$as_me:10105: result: no" >&5
10106 echo "${ECHO_T}no" >&6
10107 fi
10108
10109 echo "$as_me:10109: checking if you want to link with Xaw 3d xft library" >&5
10110 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
10111 withval=
10112
10113 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
10114 if test "${with_Xaw3dxft+set}" = set; then
10115   withval="$with_Xaw3dxft"
10116
10117 fi;
10118 if test "$withval" = yes ; then
10119         cf_x_athena=Xaw3dxft
10120         echo "$as_me:10120: result: yes" >&5
10121 echo "${ECHO_T}yes" >&6
10122 else
10123         echo "$as_me:10123: result: no" >&5
10124 echo "${ECHO_T}no" >&6
10125 fi
10126
10127 echo "$as_me:10127: checking if you want to link with neXT Athena library" >&5
10128 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10129 withval=
10130
10131 # Check whether --with-neXtaw or --without-neXtaw was given.
10132 if test "${with_neXtaw+set}" = set; then
10133   withval="$with_neXtaw"
10134
10135 fi;
10136 if test "$withval" = yes ; then
10137         cf_x_athena=neXtaw
10138         echo "$as_me:10138: result: yes" >&5
10139 echo "${ECHO_T}yes" >&6
10140 else
10141         echo "$as_me:10141: result: no" >&5
10142 echo "${ECHO_T}no" >&6
10143 fi
10144
10145 echo "$as_me:10145: checking if you want to link with Athena-Plus library" >&5
10146 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10147 withval=
10148
10149 # Check whether --with-XawPlus or --without-XawPlus was given.
10150 if test "${with_XawPlus+set}" = set; then
10151   withval="$with_XawPlus"
10152
10153 fi;
10154 if test "$withval" = yes ; then
10155         cf_x_athena=XawPlus
10156         echo "$as_me:10156: result: yes" >&5
10157 echo "${ECHO_T}yes" >&6
10158 else
10159         echo "$as_me:10159: result: no" >&5
10160 echo "${ECHO_T}no" >&6
10161 fi
10162
10163 cf_x_athena_lib=""
10164
10165 if test "$PKG_CONFIG" != none ; then
10166         cf_athena_list=
10167         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10168         for cf_athena_pkg in \
10169                 $cf_athena_list \
10170                 ${cf_x_athena} \
10171                 ${cf_x_athena}-devel \
10172                 lib${cf_x_athena} \
10173                 lib${cf_x_athena}-devel
10174         do
10175
10176 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10177         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10178
10179 echo "${as_me:-configure}:10179: testing found package $cf_athena_pkg ..." 1>&5
10180
10181         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10182         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10183         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10184
10185 echo "${as_me:-configure}:10185: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10186
10187         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10188
10189 echo "${as_me:-configure}:10189: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10190
10191 cf_fix_cppflags=no
10192 cf_new_cflags=
10193 cf_new_cppflags=
10194 cf_new_extra_cppflags=
10195
10196 for cf_add_cflags in $cf_pkgconfig_incs
10197 do
10198 case $cf_fix_cppflags in
10199 no)
10200         case $cf_add_cflags in #(vi
10201         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10202                 case $cf_add_cflags in
10203                 -D*)
10204                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10205
10206                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10207                                 && test -z "${cf_tst_cflags}" \
10208                                 && cf_fix_cppflags=yes
10209
10210                         if test $cf_fix_cppflags = yes ; then
10211                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10212                                 continue
10213                         elif test "${cf_tst_cflags}" = "\"'" ; then
10214                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10215                                 continue
10216                         fi
10217                         ;;
10218                 esac
10219                 case "$CPPFLAGS" in
10220                 *$cf_add_cflags) #(vi
10221                         ;;
10222                 *) #(vi
10223                         case $cf_add_cflags in #(vi
10224                         -D*)
10225                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10226
10227 CPPFLAGS=`echo "$CPPFLAGS" | \
10228         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10229                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10230
10231                                 ;;
10232                         esac
10233                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10234                         ;;
10235                 esac
10236                 ;;
10237         *)
10238                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10239                 ;;
10240         esac
10241         ;;
10242 yes)
10243         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10244
10245         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10246
10247         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10248                 && test -z "${cf_tst_cflags}" \
10249                 && cf_fix_cppflags=no
10250         ;;
10251 esac
10252 done
10253
10254 if test -n "$cf_new_cflags" ; then
10255
10256         CFLAGS="$CFLAGS $cf_new_cflags"
10257 fi
10258
10259 if test -n "$cf_new_cppflags" ; then
10260
10261         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10262 fi
10263
10264 if test -n "$cf_new_extra_cppflags" ; then
10265
10266         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10267 fi
10268
10269 cf_add_libs="$cf_pkgconfig_libs"
10270 # Filter out duplicates - this happens with badly-designed ".pc" files...
10271 for cf_add_1lib in $LIBS
10272 do
10273         for cf_add_2lib in $cf_add_libs
10274         do
10275                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10276                 then
10277                         cf_add_1lib=
10278                         break
10279                 fi
10280         done
10281         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10282 done
10283 LIBS="$cf_add_libs"
10284
10285                         cf_x_athena_lib="$cf_pkgconfig_libs"
10286
10287 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10288
10289                         cat >>confdefs.h <<EOF
10290 #define $cf_x_athena_LIBS 1
10291 EOF
10292
10293         for cf_trim_lib in Xmu Xt X11
10294         do
10295                 case "$LIBS" in
10296                 *-l$cf_trim_lib\ *-l$cf_trim_lib*)
10297                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10298                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10299
10300 echo "${as_me:-configure}:10300: testing ..trimmed $LIBS ..." 1>&5
10301
10302                         ;;
10303                 esac
10304         done
10305
10306 echo "$as_me:10306: checking for usable $cf_x_athena/Xmu package" >&5
10307 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10308 if test "${cf_cv_xaw_compat+set}" = set; then
10309   echo $ECHO_N "(cached) $ECHO_C" >&6
10310 else
10311
10312 cat >conftest.$ac_ext <<_ACEOF
10313 #line 10313 "configure"
10314 #include "confdefs.h"
10315
10316 #include <X11/Xmu/CharSet.h>
10317
10318 int
10319 main ()
10320 {
10321
10322 int check = XmuCompareISOLatin1("big", "small")
10323
10324   ;
10325   return 0;
10326 }
10327 _ACEOF
10328 rm -f conftest.$ac_objext conftest$ac_exeext
10329 if { (eval echo "$as_me:10329: \"$ac_link\"") >&5
10330   (eval $ac_link) 2>&5
10331   ac_status=$?
10332   echo "$as_me:10332: \$? = $ac_status" >&5
10333   (exit $ac_status); } &&
10334          { ac_try='test -s conftest$ac_exeext'
10335   { (eval echo "$as_me:10335: \"$ac_try\"") >&5
10336   (eval $ac_try) 2>&5
10337   ac_status=$?
10338   echo "$as_me:10338: \$? = $ac_status" >&5
10339   (exit $ac_status); }; }; then
10340   cf_cv_xaw_compat=yes
10341 else
10342   echo "$as_me: failed program was:" >&5
10343 cat conftest.$ac_ext >&5
10344 cf_cv_xaw_compat=no
10345 fi
10346 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10347 fi
10348 echo "$as_me:10348: result: $cf_cv_xaw_compat" >&5
10349 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10350
10351                         if test "$cf_cv_xaw_compat" = no
10352                         then
10353                                 # workaround for broken ".pc" files...
10354                                 case "$cf_x_athena_lib" in #(vi
10355                                 *-lXmu*) #(vi
10356                                         ;;
10357                                 *)
10358                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10359
10360 echo "${as_me:-configure}:10360: testing work around broken package ..." 1>&5
10361
10362                                         cf_save_xmu="$LIBS"
10363                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
10364
10365 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10366         test -n "$verbose" && echo "    found package xmu" 1>&6
10367
10368 echo "${as_me:-configure}:10368: testing found package xmu ..." 1>&5
10369
10370         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10371         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10372         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10373
10374 echo "${as_me:-configure}:10374: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10375
10376         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10377
10378 echo "${as_me:-configure}:10378: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10379
10380 cf_fix_cppflags=no
10381 cf_new_cflags=
10382 cf_new_cppflags=
10383 cf_new_extra_cppflags=
10384
10385 for cf_add_cflags in $cf_pkgconfig_incs
10386 do
10387 case $cf_fix_cppflags in
10388 no)
10389         case $cf_add_cflags in #(vi
10390         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10391                 case $cf_add_cflags in
10392                 -D*)
10393                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10394
10395                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10396                                 && test -z "${cf_tst_cflags}" \
10397                                 && cf_fix_cppflags=yes
10398
10399                         if test $cf_fix_cppflags = yes ; then
10400                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10401                                 continue
10402                         elif test "${cf_tst_cflags}" = "\"'" ; then
10403                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10404                                 continue
10405                         fi
10406                         ;;
10407                 esac
10408                 case "$CPPFLAGS" in
10409                 *$cf_add_cflags) #(vi
10410                         ;;
10411                 *) #(vi
10412                         case $cf_add_cflags in #(vi
10413                         -D*)
10414                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10415
10416 CPPFLAGS=`echo "$CPPFLAGS" | \
10417         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10418                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10419
10420                                 ;;
10421                         esac
10422                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10423                         ;;
10424                 esac
10425                 ;;
10426         *)
10427                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10428                 ;;
10429         esac
10430         ;;
10431 yes)
10432         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10433
10434         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10435
10436         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10437                 && test -z "${cf_tst_cflags}" \
10438                 && cf_fix_cppflags=no
10439         ;;
10440 esac
10441 done
10442
10443 if test -n "$cf_new_cflags" ; then
10444
10445         CFLAGS="$CFLAGS $cf_new_cflags"
10446 fi
10447
10448 if test -n "$cf_new_cppflags" ; then
10449
10450         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10451 fi
10452
10453 if test -n "$cf_new_extra_cppflags" ; then
10454
10455         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10456 fi
10457
10458 cf_add_libs="$cf_pkgconfig_libs"
10459 # Filter out duplicates - this happens with badly-designed ".pc" files...
10460 for cf_add_1lib in $LIBS
10461 do
10462         for cf_add_2lib in $cf_add_libs
10463         do
10464                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10465                 then
10466                         cf_add_1lib=
10467                         break
10468                 fi
10469         done
10470         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10471 done
10472 LIBS="$cf_add_libs"
10473
10474                                                         LIBS="$cf_save_xmu"
10475
10476 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10477
10478 echo "${as_me:-configure}:10478: testing ...before $LIBS ..." 1>&5
10479
10480 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
10481 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10482
10483 echo "${as_me:-configure}:10483: testing ...after  $LIBS ..." 1>&5
10484
10485 else
10486         cf_pkgconfig_incs=
10487         cf_pkgconfig_libs=
10488
10489 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10490
10491 echo "${as_me:-configure}:10491: testing ...before $LIBS ..." 1>&5
10492
10493 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
10494 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10495
10496 echo "${as_me:-configure}:10496: testing ...after  $LIBS ..." 1>&5
10497
10498 fi
10499
10500         for cf_trim_lib in Xmu Xt X11
10501         do
10502                 case "$LIBS" in
10503                 *-l$cf_trim_lib\ *-l$cf_trim_lib*)
10504                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10505                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10506
10507 echo "${as_me:-configure}:10507: testing ..trimmed $LIBS ..." 1>&5
10508
10509                         ;;
10510                 esac
10511         done
10512
10513                                         ;;
10514                                 esac
10515                         fi
10516
10517                         break
10518 else
10519         cf_pkgconfig_incs=
10520         cf_pkgconfig_libs=
10521         :
10522 fi
10523
10524         done
10525 fi
10526
10527 if test -z "$cf_x_athena_lib" ; then
10528
10529 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10530         test -n "$verbose" && echo "    found package Xext" 1>&6
10531
10532 echo "${as_me:-configure}:10532: testing found package Xext ..." 1>&5
10533
10534         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10535         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10536         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10537
10538 echo "${as_me:-configure}:10538: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10539
10540         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10541
10542 echo "${as_me:-configure}:10542: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10543
10544 cf_fix_cppflags=no
10545 cf_new_cflags=
10546 cf_new_cppflags=
10547 cf_new_extra_cppflags=
10548
10549 for cf_add_cflags in $cf_pkgconfig_incs
10550 do
10551 case $cf_fix_cppflags in
10552 no)
10553         case $cf_add_cflags in #(vi
10554         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10555                 case $cf_add_cflags in
10556                 -D*)
10557                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10558
10559                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10560                                 && test -z "${cf_tst_cflags}" \
10561                                 && cf_fix_cppflags=yes
10562
10563                         if test $cf_fix_cppflags = yes ; then
10564                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10565                                 continue
10566                         elif test "${cf_tst_cflags}" = "\"'" ; then
10567                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10568                                 continue
10569                         fi
10570                         ;;
10571                 esac
10572                 case "$CPPFLAGS" in
10573                 *$cf_add_cflags) #(vi
10574                         ;;
10575                 *) #(vi
10576                         case $cf_add_cflags in #(vi
10577                         -D*)
10578                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10579
10580 CPPFLAGS=`echo "$CPPFLAGS" | \
10581         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10582                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10583
10584                                 ;;
10585                         esac
10586                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10587                         ;;
10588                 esac
10589                 ;;
10590         *)
10591                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10592                 ;;
10593         esac
10594         ;;
10595 yes)
10596         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10597
10598         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10599
10600         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10601                 && test -z "${cf_tst_cflags}" \
10602                 && cf_fix_cppflags=no
10603         ;;
10604 esac
10605 done
10606
10607 if test -n "$cf_new_cflags" ; then
10608
10609         CFLAGS="$CFLAGS $cf_new_cflags"
10610 fi
10611
10612 if test -n "$cf_new_cppflags" ; then
10613
10614         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10615 fi
10616
10617 if test -n "$cf_new_extra_cppflags" ; then
10618
10619         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10620 fi
10621
10622 cf_add_libs="$cf_pkgconfig_libs"
10623 # Filter out duplicates - this happens with badly-designed ".pc" files...
10624 for cf_add_1lib in $LIBS
10625 do
10626         for cf_add_2lib in $cf_add_libs
10627         do
10628                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10629                 then
10630                         cf_add_1lib=
10631                         break
10632                 fi
10633         done
10634         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10635 done
10636 LIBS="$cf_add_libs"
10637
10638         :
10639 else
10640         cf_pkgconfig_incs=
10641         cf_pkgconfig_libs=
10642
10643         echo "$as_me:10643: checking for XextCreateExtension in -lXext" >&5
10644 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10645 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10646   echo $ECHO_N "(cached) $ECHO_C" >&6
10647 else
10648   ac_check_lib_save_LIBS=$LIBS
10649 LIBS="-lXext  $LIBS"
10650 cat >conftest.$ac_ext <<_ACEOF
10651 #line 10651 "configure"
10652 #include "confdefs.h"
10653
10654 /* Override any gcc2 internal prototype to avoid an error.  */
10655 #ifdef __cplusplus
10656 extern "C"
10657 #endif
10658 /* We use char because int might match the return type of a gcc2
10659    builtin and then its argument prototype would still apply.  */
10660 char XextCreateExtension ();
10661 int
10662 main ()
10663 {
10664 XextCreateExtension ();
10665   ;
10666   return 0;
10667 }
10668 _ACEOF
10669 rm -f conftest.$ac_objext conftest$ac_exeext
10670 if { (eval echo "$as_me:10670: \"$ac_link\"") >&5
10671   (eval $ac_link) 2>&5
10672   ac_status=$?
10673   echo "$as_me:10673: \$? = $ac_status" >&5
10674   (exit $ac_status); } &&
10675          { ac_try='test -s conftest$ac_exeext'
10676   { (eval echo "$as_me:10676: \"$ac_try\"") >&5
10677   (eval $ac_try) 2>&5
10678   ac_status=$?
10679   echo "$as_me:10679: \$? = $ac_status" >&5
10680   (exit $ac_status); }; }; then
10681   ac_cv_lib_Xext_XextCreateExtension=yes
10682 else
10683   echo "$as_me: failed program was:" >&5
10684 cat conftest.$ac_ext >&5
10685 ac_cv_lib_Xext_XextCreateExtension=no
10686 fi
10687 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10688 LIBS=$ac_check_lib_save_LIBS
10689 fi
10690 echo "$as_me:10690: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
10691 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
10692 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
10693
10694 cf_add_libs="-lXext"
10695 # Filter out duplicates - this happens with badly-designed ".pc" files...
10696 for cf_add_1lib in $LIBS
10697 do
10698         for cf_add_2lib in $cf_add_libs
10699         do
10700                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10701                 then
10702                         cf_add_1lib=
10703                         break
10704                 fi
10705         done
10706         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10707 done
10708 LIBS="$cf_add_libs"
10709
10710 fi
10711
10712 fi
10713
10714 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
10715 # in some cases has installed dummy files in the former, other cases replaced
10716 # it with a link to the new location).  This complicates the configure script.
10717 # Check for that pitfall, and recover using pkg-config
10718 #
10719 # If none of these are set, the configuration is almost certainly broken.
10720 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
10721 then
10722
10723 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
10724         test -n "$verbose" && echo "    found package x11" 1>&6
10725
10726 echo "${as_me:-configure}:10726: testing found package x11 ..." 1>&5
10727
10728         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
10729         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
10730         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
10731
10732 echo "${as_me:-configure}:10732: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10733
10734         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
10735
10736 echo "${as_me:-configure}:10736: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
10737
10738 cf_fix_cppflags=no
10739 cf_new_cflags=
10740 cf_new_cppflags=
10741 cf_new_extra_cppflags=
10742
10743 for cf_add_cflags in $cf_pkgconfig_incs
10744 do
10745 case $cf_fix_cppflags in
10746 no)
10747         case $cf_add_cflags in #(vi
10748         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10749                 case $cf_add_cflags in
10750                 -D*)
10751                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10752
10753                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10754                                 && test -z "${cf_tst_cflags}" \
10755                                 && cf_fix_cppflags=yes
10756
10757                         if test $cf_fix_cppflags = yes ; then
10758                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10759                                 continue
10760                         elif test "${cf_tst_cflags}" = "\"'" ; then
10761                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10762                                 continue
10763                         fi
10764                         ;;
10765                 esac
10766                 case "$CPPFLAGS" in
10767                 *$cf_add_cflags) #(vi
10768                         ;;
10769                 *) #(vi
10770                         case $cf_add_cflags in #(vi
10771                         -D*)
10772                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10773
10774 CPPFLAGS=`echo "$CPPFLAGS" | \
10775         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10776                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10777
10778                                 ;;
10779                         esac
10780                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10781                         ;;
10782                 esac
10783                 ;;
10784         *)
10785                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10786                 ;;
10787         esac
10788         ;;
10789 yes)
10790         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10791
10792         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10793
10794         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10795                 && test -z "${cf_tst_cflags}" \
10796                 && cf_fix_cppflags=no
10797         ;;
10798 esac
10799 done
10800
10801 if test -n "$cf_new_cflags" ; then
10802
10803         CFLAGS="$CFLAGS $cf_new_cflags"
10804 fi
10805
10806 if test -n "$cf_new_cppflags" ; then
10807
10808         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10809 fi
10810
10811 if test -n "$cf_new_extra_cppflags" ; then
10812
10813         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10814 fi
10815
10816 cf_add_libs="$cf_pkgconfig_libs"
10817 # Filter out duplicates - this happens with badly-designed ".pc" files...
10818 for cf_add_1lib in $LIBS
10819 do
10820         for cf_add_2lib in $cf_add_libs
10821         do
10822                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10823                 then
10824                         cf_add_1lib=
10825                         break
10826                 fi
10827         done
10828         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10829 done
10830 LIBS="$cf_add_libs"
10831
10832         :
10833 else
10834         cf_pkgconfig_incs=
10835         cf_pkgconfig_libs=
10836         { echo "$as_me:10836: WARNING: unable to find X11 library" >&5
10837 echo "$as_me: WARNING: unable to find X11 library" >&2;}
10838 fi
10839
10840 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
10841         test -n "$verbose" && echo "    found package ice" 1>&6
10842
10843 echo "${as_me:-configure}:10843: testing found package ice ..." 1>&5
10844
10845         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
10846         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
10847         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
10848
10849 echo "${as_me:-configure}:10849: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10850
10851         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
10852
10853 echo "${as_me:-configure}:10853: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
10854
10855 cf_fix_cppflags=no
10856 cf_new_cflags=
10857 cf_new_cppflags=
10858 cf_new_extra_cppflags=
10859
10860 for cf_add_cflags in $cf_pkgconfig_incs
10861 do
10862 case $cf_fix_cppflags in
10863 no)
10864         case $cf_add_cflags in #(vi
10865         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10866                 case $cf_add_cflags in
10867                 -D*)
10868                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10869
10870                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10871                                 && test -z "${cf_tst_cflags}" \
10872                                 && cf_fix_cppflags=yes
10873
10874                         if test $cf_fix_cppflags = yes ; then
10875                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10876                                 continue
10877                         elif test "${cf_tst_cflags}" = "\"'" ; then
10878                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10879                                 continue
10880                         fi
10881                         ;;
10882                 esac
10883                 case "$CPPFLAGS" in
10884                 *$cf_add_cflags) #(vi
10885                         ;;
10886                 *) #(vi
10887                         case $cf_add_cflags in #(vi
10888                         -D*)
10889                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10890
10891 CPPFLAGS=`echo "$CPPFLAGS" | \
10892         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10893                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10894
10895                                 ;;
10896                         esac
10897                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10898                         ;;
10899                 esac
10900                 ;;
10901         *)
10902                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10903                 ;;
10904         esac
10905         ;;
10906 yes)
10907         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10908
10909         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10910
10911         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10912                 && test -z "${cf_tst_cflags}" \
10913                 && cf_fix_cppflags=no
10914         ;;
10915 esac
10916 done
10917
10918 if test -n "$cf_new_cflags" ; then
10919
10920         CFLAGS="$CFLAGS $cf_new_cflags"
10921 fi
10922
10923 if test -n "$cf_new_cppflags" ; then
10924
10925         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10926 fi
10927
10928 if test -n "$cf_new_extra_cppflags" ; then
10929
10930         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10931 fi
10932
10933 cf_add_libs="$cf_pkgconfig_libs"
10934 # Filter out duplicates - this happens with badly-designed ".pc" files...
10935 for cf_add_1lib in $LIBS
10936 do
10937         for cf_add_2lib in $cf_add_libs
10938         do
10939                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10940                 then
10941                         cf_add_1lib=
10942                         break
10943                 fi
10944         done
10945         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10946 done
10947 LIBS="$cf_add_libs"
10948
10949         :
10950 else
10951         cf_pkgconfig_incs=
10952         cf_pkgconfig_libs=
10953         { echo "$as_me:10953: WARNING: unable to find ICE library" >&5
10954 echo "$as_me: WARNING: unable to find ICE library" >&2;}
10955 fi
10956
10957 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
10958         test -n "$verbose" && echo "    found package sm" 1>&6
10959
10960 echo "${as_me:-configure}:10960: testing found package sm ..." 1>&5
10961
10962         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
10963         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
10964         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
10965
10966 echo "${as_me:-configure}:10966: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10967
10968         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
10969
10970 echo "${as_me:-configure}:10970: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
10971
10972 cf_fix_cppflags=no
10973 cf_new_cflags=
10974 cf_new_cppflags=
10975 cf_new_extra_cppflags=
10976
10977 for cf_add_cflags in $cf_pkgconfig_incs
10978 do
10979 case $cf_fix_cppflags in
10980 no)
10981         case $cf_add_cflags in #(vi
10982         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10983                 case $cf_add_cflags in
10984                 -D*)
10985                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10986
10987                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10988                                 && test -z "${cf_tst_cflags}" \
10989                                 && cf_fix_cppflags=yes
10990
10991                         if test $cf_fix_cppflags = yes ; then
10992                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10993                                 continue
10994                         elif test "${cf_tst_cflags}" = "\"'" ; then
10995                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10996                                 continue
10997                         fi
10998                         ;;
10999                 esac
11000                 case "$CPPFLAGS" in
11001                 *$cf_add_cflags) #(vi
11002                         ;;
11003                 *) #(vi
11004                         case $cf_add_cflags in #(vi
11005                         -D*)
11006                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11007
11008 CPPFLAGS=`echo "$CPPFLAGS" | \
11009         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11010                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11011
11012                                 ;;
11013                         esac
11014                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11015                         ;;
11016                 esac
11017                 ;;
11018         *)
11019                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11020                 ;;
11021         esac
11022         ;;
11023 yes)
11024         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11025
11026         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11027
11028         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11029                 && test -z "${cf_tst_cflags}" \
11030                 && cf_fix_cppflags=no
11031         ;;
11032 esac
11033 done
11034
11035 if test -n "$cf_new_cflags" ; then
11036
11037         CFLAGS="$CFLAGS $cf_new_cflags"
11038 fi
11039
11040 if test -n "$cf_new_cppflags" ; then
11041
11042         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11043 fi
11044
11045 if test -n "$cf_new_extra_cppflags" ; then
11046
11047         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11048 fi
11049
11050 cf_add_libs="$cf_pkgconfig_libs"
11051 # Filter out duplicates - this happens with badly-designed ".pc" files...
11052 for cf_add_1lib in $LIBS
11053 do
11054         for cf_add_2lib in $cf_add_libs
11055         do
11056                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11057                 then
11058                         cf_add_1lib=
11059                         break
11060                 fi
11061         done
11062         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11063 done
11064 LIBS="$cf_add_libs"
11065
11066         :
11067 else
11068         cf_pkgconfig_incs=
11069         cf_pkgconfig_libs=
11070         { echo "$as_me:11070: WARNING: unable to find SM library" >&5
11071 echo "$as_me: WARNING: unable to find SM library" >&2;}
11072 fi
11073
11074 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11075         test -n "$verbose" && echo "    found package xt" 1>&6
11076
11077 echo "${as_me:-configure}:11077: testing found package xt ..." 1>&5
11078
11079         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11080         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11081         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11082
11083 echo "${as_me:-configure}:11083: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11084
11085         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11086
11087 echo "${as_me:-configure}:11087: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11088
11089 cf_fix_cppflags=no
11090 cf_new_cflags=
11091 cf_new_cppflags=
11092 cf_new_extra_cppflags=
11093
11094 for cf_add_cflags in $cf_pkgconfig_incs
11095 do
11096 case $cf_fix_cppflags in
11097 no)
11098         case $cf_add_cflags in #(vi
11099         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11100                 case $cf_add_cflags in
11101                 -D*)
11102                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11103
11104                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11105                                 && test -z "${cf_tst_cflags}" \
11106                                 && cf_fix_cppflags=yes
11107
11108                         if test $cf_fix_cppflags = yes ; then
11109                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11110                                 continue
11111                         elif test "${cf_tst_cflags}" = "\"'" ; then
11112                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11113                                 continue
11114                         fi
11115                         ;;
11116                 esac
11117                 case "$CPPFLAGS" in
11118                 *$cf_add_cflags) #(vi
11119                         ;;
11120                 *) #(vi
11121                         case $cf_add_cflags in #(vi
11122                         -D*)
11123                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11124
11125 CPPFLAGS=`echo "$CPPFLAGS" | \
11126         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11127                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11128
11129                                 ;;
11130                         esac
11131                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11132                         ;;
11133                 esac
11134                 ;;
11135         *)
11136                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11137                 ;;
11138         esac
11139         ;;
11140 yes)
11141         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11142
11143         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11144
11145         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11146                 && test -z "${cf_tst_cflags}" \
11147                 && cf_fix_cppflags=no
11148         ;;
11149 esac
11150 done
11151
11152 if test -n "$cf_new_cflags" ; then
11153
11154         CFLAGS="$CFLAGS $cf_new_cflags"
11155 fi
11156
11157 if test -n "$cf_new_cppflags" ; then
11158
11159         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11160 fi
11161
11162 if test -n "$cf_new_extra_cppflags" ; then
11163
11164         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11165 fi
11166
11167 cf_add_libs="$cf_pkgconfig_libs"
11168 # Filter out duplicates - this happens with badly-designed ".pc" files...
11169 for cf_add_1lib in $LIBS
11170 do
11171         for cf_add_2lib in $cf_add_libs
11172         do
11173                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11174                 then
11175                         cf_add_1lib=
11176                         break
11177                 fi
11178         done
11179         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11180 done
11181 LIBS="$cf_add_libs"
11182
11183         :
11184 else
11185         cf_pkgconfig_incs=
11186         cf_pkgconfig_libs=
11187         { echo "$as_me:11187: WARNING: unable to find Xt library" >&5
11188 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11189 fi
11190
11191 fi
11192
11193 cf_have_X_LIBS=no
11194
11195 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11196         test -n "$verbose" && echo "    found package xt" 1>&6
11197
11198 echo "${as_me:-configure}:11198: testing found package xt ..." 1>&5
11199
11200         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11201         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11202         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11203
11204 echo "${as_me:-configure}:11204: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11205
11206         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11207
11208 echo "${as_me:-configure}:11208: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11209
11210 cf_fix_cppflags=no
11211 cf_new_cflags=
11212 cf_new_cppflags=
11213 cf_new_extra_cppflags=
11214
11215 for cf_add_cflags in $cf_pkgconfig_incs
11216 do
11217 case $cf_fix_cppflags in
11218 no)
11219         case $cf_add_cflags in #(vi
11220         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11221                 case $cf_add_cflags in
11222                 -D*)
11223                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11224
11225                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11226                                 && test -z "${cf_tst_cflags}" \
11227                                 && cf_fix_cppflags=yes
11228
11229                         if test $cf_fix_cppflags = yes ; then
11230                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11231                                 continue
11232                         elif test "${cf_tst_cflags}" = "\"'" ; then
11233                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11234                                 continue
11235                         fi
11236                         ;;
11237                 esac
11238                 case "$CPPFLAGS" in
11239                 *$cf_add_cflags) #(vi
11240                         ;;
11241                 *) #(vi
11242                         case $cf_add_cflags in #(vi
11243                         -D*)
11244                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11245
11246 CPPFLAGS=`echo "$CPPFLAGS" | \
11247         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11248                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11249
11250                                 ;;
11251                         esac
11252                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11253                         ;;
11254                 esac
11255                 ;;
11256         *)
11257                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11258                 ;;
11259         esac
11260         ;;
11261 yes)
11262         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11263
11264         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11265
11266         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11267                 && test -z "${cf_tst_cflags}" \
11268                 && cf_fix_cppflags=no
11269         ;;
11270 esac
11271 done
11272
11273 if test -n "$cf_new_cflags" ; then
11274
11275         CFLAGS="$CFLAGS $cf_new_cflags"
11276 fi
11277
11278 if test -n "$cf_new_cppflags" ; then
11279
11280         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11281 fi
11282
11283 if test -n "$cf_new_extra_cppflags" ; then
11284
11285         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11286 fi
11287
11288 cf_add_libs="$cf_pkgconfig_libs"
11289 # Filter out duplicates - this happens with badly-designed ".pc" files...
11290 for cf_add_1lib in $LIBS
11291 do
11292         for cf_add_2lib in $cf_add_libs
11293         do
11294                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11295                 then
11296                         cf_add_1lib=
11297                         break
11298                 fi
11299         done
11300         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11301 done
11302 LIBS="$cf_add_libs"
11303
11304         case "x$LIBS" in #(vi
11305         *-lX11*) #(vi
11306                 ;;
11307         *)
11308 # we have an "xt" package, but it may omit Xt's dependency on X11
11309 echo "$as_me:11309: checking for usable X dependency" >&5
11310 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11311 if test "${cf_cv_xt_x11_compat+set}" = set; then
11312   echo $ECHO_N "(cached) $ECHO_C" >&6
11313 else
11314
11315 cat >conftest.$ac_ext <<_ACEOF
11316 #line 11316 "configure"
11317 #include "confdefs.h"
11318
11319 #include <X11/Xlib.h>
11320
11321 int
11322 main ()
11323 {
11324
11325         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11326         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11327         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11328         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11329
11330   ;
11331   return 0;
11332 }
11333 _ACEOF
11334 rm -f conftest.$ac_objext conftest$ac_exeext
11335 if { (eval echo "$as_me:11335: \"$ac_link\"") >&5
11336   (eval $ac_link) 2>&5
11337   ac_status=$?
11338   echo "$as_me:11338: \$? = $ac_status" >&5
11339   (exit $ac_status); } &&
11340          { ac_try='test -s conftest$ac_exeext'
11341   { (eval echo "$as_me:11341: \"$ac_try\"") >&5
11342   (eval $ac_try) 2>&5
11343   ac_status=$?
11344   echo "$as_me:11344: \$? = $ac_status" >&5
11345   (exit $ac_status); }; }; then
11346   cf_cv_xt_x11_compat=yes
11347 else
11348   echo "$as_me: failed program was:" >&5
11349 cat conftest.$ac_ext >&5
11350 cf_cv_xt_x11_compat=no
11351 fi
11352 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11353 fi
11354 echo "$as_me:11354: result: $cf_cv_xt_x11_compat" >&5
11355 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11356                 if test "$cf_cv_xt_x11_compat" = no
11357                 then
11358                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11359
11360 echo "${as_me:-configure}:11360: testing work around broken X11 dependency ..." 1>&5
11361
11362                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11363
11364 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11365         test -n "$verbose" && echo "    found package x11" 1>&6
11366
11367 echo "${as_me:-configure}:11367: testing found package x11 ..." 1>&5
11368
11369         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11370         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11371         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11372
11373 echo "${as_me:-configure}:11373: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11374
11375         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11376
11377 echo "${as_me:-configure}:11377: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11378
11379 cf_fix_cppflags=no
11380 cf_new_cflags=
11381 cf_new_cppflags=
11382 cf_new_extra_cppflags=
11383
11384 for cf_add_cflags in $cf_pkgconfig_incs
11385 do
11386 case $cf_fix_cppflags in
11387 no)
11388         case $cf_add_cflags in #(vi
11389         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11390                 case $cf_add_cflags in
11391                 -D*)
11392                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11393
11394                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11395                                 && test -z "${cf_tst_cflags}" \
11396                                 && cf_fix_cppflags=yes
11397
11398                         if test $cf_fix_cppflags = yes ; then
11399                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11400                                 continue
11401                         elif test "${cf_tst_cflags}" = "\"'" ; then
11402                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11403                                 continue
11404                         fi
11405                         ;;
11406                 esac
11407                 case "$CPPFLAGS" in
11408                 *$cf_add_cflags) #(vi
11409                         ;;
11410                 *) #(vi
11411                         case $cf_add_cflags in #(vi
11412                         -D*)
11413                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11414
11415 CPPFLAGS=`echo "$CPPFLAGS" | \
11416         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11417                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11418
11419                                 ;;
11420                         esac
11421                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11422                         ;;
11423                 esac
11424                 ;;
11425         *)
11426                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11427                 ;;
11428         esac
11429         ;;
11430 yes)
11431         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11432
11433         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11434
11435         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11436                 && test -z "${cf_tst_cflags}" \
11437                 && cf_fix_cppflags=no
11438         ;;
11439 esac
11440 done
11441
11442 if test -n "$cf_new_cflags" ; then
11443
11444         CFLAGS="$CFLAGS $cf_new_cflags"
11445 fi
11446
11447 if test -n "$cf_new_cppflags" ; then
11448
11449         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11450 fi
11451
11452 if test -n "$cf_new_extra_cppflags" ; then
11453
11454         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11455 fi
11456
11457 cf_add_libs="$cf_pkgconfig_libs"
11458 # Filter out duplicates - this happens with badly-designed ".pc" files...
11459 for cf_add_1lib in $LIBS
11460 do
11461         for cf_add_2lib in $cf_add_libs
11462         do
11463                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11464                 then
11465                         cf_add_1lib=
11466                         break
11467                 fi
11468         done
11469         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11470 done
11471 LIBS="$cf_add_libs"
11472
11473         :
11474 else
11475         cf_pkgconfig_incs=
11476         cf_pkgconfig_libs=
11477
11478 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11479
11480 echo "${as_me:-configure}:11480: testing ...before $LIBS ..." 1>&5
11481
11482 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
11483 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11484
11485 echo "${as_me:-configure}:11485: testing ...after  $LIBS ..." 1>&5
11486
11487 fi
11488
11489                 fi
11490                 ;;
11491         esac
11492
11493 echo "$as_me:11493: checking for usable X Toolkit package" >&5
11494 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11495 if test "${cf_cv_xt_ice_compat+set}" = set; then
11496   echo $ECHO_N "(cached) $ECHO_C" >&6
11497 else
11498
11499 cat >conftest.$ac_ext <<_ACEOF
11500 #line 11500 "configure"
11501 #include "confdefs.h"
11502
11503 #include <X11/Shell.h>
11504
11505 int
11506 main ()
11507 {
11508 int num = IceConnectionNumber(0)
11509
11510   ;
11511   return 0;
11512 }
11513 _ACEOF
11514 rm -f conftest.$ac_objext conftest$ac_exeext
11515 if { (eval echo "$as_me:11515: \"$ac_link\"") >&5
11516   (eval $ac_link) 2>&5
11517   ac_status=$?
11518   echo "$as_me:11518: \$? = $ac_status" >&5
11519   (exit $ac_status); } &&
11520          { ac_try='test -s conftest$ac_exeext'
11521   { (eval echo "$as_me:11521: \"$ac_try\"") >&5
11522   (eval $ac_try) 2>&5
11523   ac_status=$?
11524   echo "$as_me:11524: \$? = $ac_status" >&5
11525   (exit $ac_status); }; }; then
11526   cf_cv_xt_ice_compat=yes
11527 else
11528   echo "$as_me: failed program was:" >&5
11529 cat conftest.$ac_ext >&5
11530 cf_cv_xt_ice_compat=no
11531 fi
11532 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11533 fi
11534 echo "$as_me:11534: result: $cf_cv_xt_ice_compat" >&5
11535 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11536
11537         if test "$cf_cv_xt_ice_compat" = no
11538         then
11539                 # workaround for broken ".pc" files used for X Toolkit.
11540                 case "x$X_PRE_LIBS" in #(vi
11541                 *-lICE*)
11542                         case "x$LIBS" in #(vi
11543                         *-lICE*) #(vi
11544                                 ;;
11545                         *)
11546                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11547
11548 echo "${as_me:-configure}:11548: testing work around broken ICE dependency ..." 1>&5
11549
11550 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11551         test -n "$verbose" && echo "    found package ice" 1>&6
11552
11553 echo "${as_me:-configure}:11553: testing found package ice ..." 1>&5
11554
11555         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11556         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11557         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11558
11559 echo "${as_me:-configure}:11559: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11560
11561         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11562
11563 echo "${as_me:-configure}:11563: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11564
11565 cf_fix_cppflags=no
11566 cf_new_cflags=
11567 cf_new_cppflags=
11568 cf_new_extra_cppflags=
11569
11570 for cf_add_cflags in $cf_pkgconfig_incs
11571 do
11572 case $cf_fix_cppflags in
11573 no)
11574         case $cf_add_cflags in #(vi
11575         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11576                 case $cf_add_cflags in
11577                 -D*)
11578                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11579
11580                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11581                                 && test -z "${cf_tst_cflags}" \
11582                                 && cf_fix_cppflags=yes
11583
11584                         if test $cf_fix_cppflags = yes ; then
11585                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11586                                 continue
11587                         elif test "${cf_tst_cflags}" = "\"'" ; then
11588                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11589                                 continue
11590                         fi
11591                         ;;
11592                 esac
11593                 case "$CPPFLAGS" in
11594                 *$cf_add_cflags) #(vi
11595                         ;;
11596                 *) #(vi
11597                         case $cf_add_cflags in #(vi
11598                         -D*)
11599                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11600
11601 CPPFLAGS=`echo "$CPPFLAGS" | \
11602         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11603                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11604
11605                                 ;;
11606                         esac
11607                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11608                         ;;
11609                 esac
11610                 ;;
11611         *)
11612                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11613                 ;;
11614         esac
11615         ;;
11616 yes)
11617         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11618
11619         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11620
11621         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11622                 && test -z "${cf_tst_cflags}" \
11623                 && cf_fix_cppflags=no
11624         ;;
11625 esac
11626 done
11627
11628 if test -n "$cf_new_cflags" ; then
11629
11630         CFLAGS="$CFLAGS $cf_new_cflags"
11631 fi
11632
11633 if test -n "$cf_new_cppflags" ; then
11634
11635         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11636 fi
11637
11638 if test -n "$cf_new_extra_cppflags" ; then
11639
11640         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11641 fi
11642
11643 cf_add_libs="$cf_pkgconfig_libs"
11644 # Filter out duplicates - this happens with badly-designed ".pc" files...
11645 for cf_add_1lib in $LIBS
11646 do
11647         for cf_add_2lib in $cf_add_libs
11648         do
11649                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11650                 then
11651                         cf_add_1lib=
11652                         break
11653                 fi
11654         done
11655         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11656 done
11657 LIBS="$cf_add_libs"
11658
11659 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11660         test -n "$verbose" && echo "    found package sm" 1>&6
11661
11662 echo "${as_me:-configure}:11662: testing found package sm ..." 1>&5
11663
11664         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11665         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11666         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11667
11668 echo "${as_me:-configure}:11668: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11669
11670         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11671
11672 echo "${as_me:-configure}:11672: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11673
11674 cf_fix_cppflags=no
11675 cf_new_cflags=
11676 cf_new_cppflags=
11677 cf_new_extra_cppflags=
11678
11679 for cf_add_cflags in $cf_pkgconfig_incs
11680 do
11681 case $cf_fix_cppflags in
11682 no)
11683         case $cf_add_cflags in #(vi
11684         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11685                 case $cf_add_cflags in
11686                 -D*)
11687                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11688
11689                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11690                                 && test -z "${cf_tst_cflags}" \
11691                                 && cf_fix_cppflags=yes
11692
11693                         if test $cf_fix_cppflags = yes ; then
11694                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11695                                 continue
11696                         elif test "${cf_tst_cflags}" = "\"'" ; then
11697                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11698                                 continue
11699                         fi
11700                         ;;
11701                 esac
11702                 case "$CPPFLAGS" in
11703                 *$cf_add_cflags) #(vi
11704                         ;;
11705                 *) #(vi
11706                         case $cf_add_cflags in #(vi
11707                         -D*)
11708                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11709
11710 CPPFLAGS=`echo "$CPPFLAGS" | \
11711         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11712                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11713
11714                                 ;;
11715                         esac
11716                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11717                         ;;
11718                 esac
11719                 ;;
11720         *)
11721                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11722                 ;;
11723         esac
11724         ;;
11725 yes)
11726         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11727
11728         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11729
11730         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11731                 && test -z "${cf_tst_cflags}" \
11732                 && cf_fix_cppflags=no
11733         ;;
11734 esac
11735 done
11736
11737 if test -n "$cf_new_cflags" ; then
11738
11739         CFLAGS="$CFLAGS $cf_new_cflags"
11740 fi
11741
11742 if test -n "$cf_new_cppflags" ; then
11743
11744         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11745 fi
11746
11747 if test -n "$cf_new_extra_cppflags" ; then
11748
11749         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11750 fi
11751
11752 cf_add_libs="$cf_pkgconfig_libs"
11753 # Filter out duplicates - this happens with badly-designed ".pc" files...
11754 for cf_add_1lib in $LIBS
11755 do
11756         for cf_add_2lib in $cf_add_libs
11757         do
11758                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11759                 then
11760                         cf_add_1lib=
11761                         break
11762                 fi
11763         done
11764         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11765 done
11766 LIBS="$cf_add_libs"
11767
11768         :
11769 else
11770         cf_pkgconfig_incs=
11771         cf_pkgconfig_libs=
11772         :
11773 fi
11774
11775 else
11776         cf_pkgconfig_incs=
11777         cf_pkgconfig_libs=
11778
11779 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11780
11781 echo "${as_me:-configure}:11781: testing ...before $LIBS ..." 1>&5
11782
11783 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
11784 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11785
11786 echo "${as_me:-configure}:11786: testing ...after  $LIBS ..." 1>&5
11787
11788 fi
11789
11790                                 ;;
11791                         esac
11792                         ;;
11793                 esac
11794         fi
11795
11796         cf_have_X_LIBS=yes
11797
11798 else
11799         cf_pkgconfig_incs=
11800         cf_pkgconfig_libs=
11801
11802         LDFLAGS="$X_LIBS $LDFLAGS"
11803
11804 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11805
11806 echo "${as_me:-configure}:11806: testing checking additions to CFLAGS ..." 1>&5
11807
11808 cf_check_cflags="$CFLAGS"
11809 cf_check_cppflags="$CPPFLAGS"
11810
11811 cf_fix_cppflags=no
11812 cf_new_cflags=
11813 cf_new_cppflags=
11814 cf_new_extra_cppflags=
11815
11816 for cf_add_cflags in $X_CFLAGS
11817 do
11818 case $cf_fix_cppflags in
11819 no)
11820         case $cf_add_cflags in #(vi
11821         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11822                 case $cf_add_cflags in
11823                 -D*)
11824                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11825
11826                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11827                                 && test -z "${cf_tst_cflags}" \
11828                                 && cf_fix_cppflags=yes
11829
11830                         if test $cf_fix_cppflags = yes ; then
11831                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11832                                 continue
11833                         elif test "${cf_tst_cflags}" = "\"'" ; then
11834                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11835                                 continue
11836                         fi
11837                         ;;
11838                 esac
11839                 case "$CPPFLAGS" in
11840                 *$cf_add_cflags) #(vi
11841                         ;;
11842                 *) #(vi
11843                         case $cf_add_cflags in #(vi
11844                         -D*)
11845                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11846
11847 CPPFLAGS=`echo "$CPPFLAGS" | \
11848         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11849                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11850
11851                                 ;;
11852                         esac
11853                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11854                         ;;
11855                 esac
11856                 ;;
11857         *)
11858                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11859                 ;;
11860         esac
11861         ;;
11862 yes)
11863         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11864
11865         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11866
11867         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11868                 && test -z "${cf_tst_cflags}" \
11869                 && cf_fix_cppflags=no
11870         ;;
11871 esac
11872 done
11873
11874 if test -n "$cf_new_cflags" ; then
11875         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11876
11877 echo "${as_me:-configure}:11877: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11878
11879         CFLAGS="$CFLAGS $cf_new_cflags"
11880 fi
11881
11882 if test -n "$cf_new_cppflags" ; then
11883         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11884
11885 echo "${as_me:-configure}:11885: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11886
11887         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11888 fi
11889
11890 if test -n "$cf_new_extra_cppflags" ; then
11891         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11892
11893 echo "${as_me:-configure}:11893: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11894
11895         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11896 fi
11897
11898 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
11899 cat >conftest.$ac_ext <<_ACEOF
11900 #line 11900 "configure"
11901 #include "confdefs.h"
11902 #include <stdio.h>
11903 int
11904 main ()
11905 {
11906 printf("Hello world");
11907   ;
11908   return 0;
11909 }
11910 _ACEOF
11911 rm -f conftest.$ac_objext conftest$ac_exeext
11912 if { (eval echo "$as_me:11912: \"$ac_link\"") >&5
11913   (eval $ac_link) 2>&5
11914   ac_status=$?
11915   echo "$as_me:11915: \$? = $ac_status" >&5
11916   (exit $ac_status); } &&
11917          { ac_try='test -s conftest$ac_exeext'
11918   { (eval echo "$as_me:11918: \"$ac_try\"") >&5
11919   (eval $ac_try) 2>&5
11920   ac_status=$?
11921   echo "$as_me:11921: \$? = $ac_status" >&5
11922   (exit $ac_status); }; }; then
11923   :
11924 else
11925   echo "$as_me: failed program was:" >&5
11926 cat conftest.$ac_ext >&5
11927 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
11928
11929 echo "${as_me:-configure}:11929: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
11930
11931          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
11932                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
11933
11934 echo "${as_me:-configure}:11934: testing but keeping change to \$CPPFLAGS ..." 1>&5
11935
11936          fi
11937          CFLAGS="$cf_check_flags"
11938 fi
11939 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11940 fi
11941
11942         echo "$as_me:11942: checking for XOpenDisplay" >&5
11943 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
11944 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
11945   echo $ECHO_N "(cached) $ECHO_C" >&6
11946 else
11947   cat >conftest.$ac_ext <<_ACEOF
11948 #line 11948 "configure"
11949 #include "confdefs.h"
11950 /* System header to define __stub macros and hopefully few prototypes,
11951     which can conflict with char XOpenDisplay (); below.  */
11952 #include <assert.h>
11953 /* Override any gcc2 internal prototype to avoid an error.  */
11954 #ifdef __cplusplus
11955 extern "C"
11956 #endif
11957 /* We use char because int might match the return type of a gcc2
11958    builtin and then its argument prototype would still apply.  */
11959 char XOpenDisplay ();
11960 char (*f) ();
11961
11962 int
11963 main ()
11964 {
11965 /* The GNU C library defines this for functions which it implements
11966     to always fail with ENOSYS.  Some functions are actually named
11967     something starting with __ and the normal name is an alias.  */
11968 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
11969 choke me
11970 #else
11971 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11972 #endif
11973
11974   ;
11975   return 0;
11976 }
11977 _ACEOF
11978 rm -f conftest.$ac_objext conftest$ac_exeext
11979 if { (eval echo "$as_me:11979: \"$ac_link\"") >&5
11980   (eval $ac_link) 2>&5
11981   ac_status=$?
11982   echo "$as_me:11982: \$? = $ac_status" >&5
11983   (exit $ac_status); } &&
11984          { ac_try='test -s conftest$ac_exeext'
11985   { (eval echo "$as_me:11985: \"$ac_try\"") >&5
11986   (eval $ac_try) 2>&5
11987   ac_status=$?
11988   echo "$as_me:11988: \$? = $ac_status" >&5
11989   (exit $ac_status); }; }; then
11990   ac_cv_func_XOpenDisplay=yes
11991 else
11992   echo "$as_me: failed program was:" >&5
11993 cat conftest.$ac_ext >&5
11994 ac_cv_func_XOpenDisplay=no
11995 fi
11996 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11997 fi
11998 echo "$as_me:11998: result: $ac_cv_func_XOpenDisplay" >&5
11999 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12000 if test $ac_cv_func_XOpenDisplay = yes; then
12001   :
12002 else
12003
12004         echo "$as_me:12004: checking for XOpenDisplay in -lX11" >&5
12005 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12006 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12007   echo $ECHO_N "(cached) $ECHO_C" >&6
12008 else
12009   ac_check_lib_save_LIBS=$LIBS
12010 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12011 cat >conftest.$ac_ext <<_ACEOF
12012 #line 12012 "configure"
12013 #include "confdefs.h"
12014
12015 /* Override any gcc2 internal prototype to avoid an error.  */
12016 #ifdef __cplusplus
12017 extern "C"
12018 #endif
12019 /* We use char because int might match the return type of a gcc2
12020    builtin and then its argument prototype would still apply.  */
12021 char XOpenDisplay ();
12022 int
12023 main ()
12024 {
12025 XOpenDisplay ();
12026   ;
12027   return 0;
12028 }
12029 _ACEOF
12030 rm -f conftest.$ac_objext conftest$ac_exeext
12031 if { (eval echo "$as_me:12031: \"$ac_link\"") >&5
12032   (eval $ac_link) 2>&5
12033   ac_status=$?
12034   echo "$as_me:12034: \$? = $ac_status" >&5
12035   (exit $ac_status); } &&
12036          { ac_try='test -s conftest$ac_exeext'
12037   { (eval echo "$as_me:12037: \"$ac_try\"") >&5
12038   (eval $ac_try) 2>&5
12039   ac_status=$?
12040   echo "$as_me:12040: \$? = $ac_status" >&5
12041   (exit $ac_status); }; }; then
12042   ac_cv_lib_X11_XOpenDisplay=yes
12043 else
12044   echo "$as_me: failed program was:" >&5
12045 cat conftest.$ac_ext >&5
12046 ac_cv_lib_X11_XOpenDisplay=no
12047 fi
12048 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12049 LIBS=$ac_check_lib_save_LIBS
12050 fi
12051 echo "$as_me:12051: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12052 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12053 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12054
12055 cf_add_libs="-lX11"
12056 # Filter out duplicates - this happens with badly-designed ".pc" files...
12057 for cf_add_1lib in $LIBS
12058 do
12059         for cf_add_2lib in $cf_add_libs
12060         do
12061                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12062                 then
12063                         cf_add_1lib=
12064                         break
12065                 fi
12066         done
12067         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12068 done
12069 LIBS="$cf_add_libs"
12070
12071 fi
12072
12073 fi
12074
12075         echo "$as_me:12075: checking for XtAppInitialize" >&5
12076 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12077 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12078   echo $ECHO_N "(cached) $ECHO_C" >&6
12079 else
12080   cat >conftest.$ac_ext <<_ACEOF
12081 #line 12081 "configure"
12082 #include "confdefs.h"
12083 /* System header to define __stub macros and hopefully few prototypes,
12084     which can conflict with char XtAppInitialize (); below.  */
12085 #include <assert.h>
12086 /* Override any gcc2 internal prototype to avoid an error.  */
12087 #ifdef __cplusplus
12088 extern "C"
12089 #endif
12090 /* We use char because int might match the return type of a gcc2
12091    builtin and then its argument prototype would still apply.  */
12092 char XtAppInitialize ();
12093 char (*f) ();
12094
12095 int
12096 main ()
12097 {
12098 /* The GNU C library defines this for functions which it implements
12099     to always fail with ENOSYS.  Some functions are actually named
12100     something starting with __ and the normal name is an alias.  */
12101 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12102 choke me
12103 #else
12104 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12105 #endif
12106
12107   ;
12108   return 0;
12109 }
12110 _ACEOF
12111 rm -f conftest.$ac_objext conftest$ac_exeext
12112 if { (eval echo "$as_me:12112: \"$ac_link\"") >&5
12113   (eval $ac_link) 2>&5
12114   ac_status=$?
12115   echo "$as_me:12115: \$? = $ac_status" >&5
12116   (exit $ac_status); } &&
12117          { ac_try='test -s conftest$ac_exeext'
12118   { (eval echo "$as_me:12118: \"$ac_try\"") >&5
12119   (eval $ac_try) 2>&5
12120   ac_status=$?
12121   echo "$as_me:12121: \$? = $ac_status" >&5
12122   (exit $ac_status); }; }; then
12123   ac_cv_func_XtAppInitialize=yes
12124 else
12125   echo "$as_me: failed program was:" >&5
12126 cat conftest.$ac_ext >&5
12127 ac_cv_func_XtAppInitialize=no
12128 fi
12129 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12130 fi
12131 echo "$as_me:12131: result: $ac_cv_func_XtAppInitialize" >&5
12132 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12133 if test $ac_cv_func_XtAppInitialize = yes; then
12134   :
12135 else
12136
12137         echo "$as_me:12137: checking for XtAppInitialize in -lXt" >&5
12138 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12139 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12140   echo $ECHO_N "(cached) $ECHO_C" >&6
12141 else
12142   ac_check_lib_save_LIBS=$LIBS
12143 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12144 cat >conftest.$ac_ext <<_ACEOF
12145 #line 12145 "configure"
12146 #include "confdefs.h"
12147
12148 /* Override any gcc2 internal prototype to avoid an error.  */
12149 #ifdef __cplusplus
12150 extern "C"
12151 #endif
12152 /* We use char because int might match the return type of a gcc2
12153    builtin and then its argument prototype would still apply.  */
12154 char XtAppInitialize ();
12155 int
12156 main ()
12157 {
12158 XtAppInitialize ();
12159   ;
12160   return 0;
12161 }
12162 _ACEOF
12163 rm -f conftest.$ac_objext conftest$ac_exeext
12164 if { (eval echo "$as_me:12164: \"$ac_link\"") >&5
12165   (eval $ac_link) 2>&5
12166   ac_status=$?
12167   echo "$as_me:12167: \$? = $ac_status" >&5
12168   (exit $ac_status); } &&
12169          { ac_try='test -s conftest$ac_exeext'
12170   { (eval echo "$as_me:12170: \"$ac_try\"") >&5
12171   (eval $ac_try) 2>&5
12172   ac_status=$?
12173   echo "$as_me:12173: \$? = $ac_status" >&5
12174   (exit $ac_status); }; }; then
12175   ac_cv_lib_Xt_XtAppInitialize=yes
12176 else
12177   echo "$as_me: failed program was:" >&5
12178 cat conftest.$ac_ext >&5
12179 ac_cv_lib_Xt_XtAppInitialize=no
12180 fi
12181 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12182 LIBS=$ac_check_lib_save_LIBS
12183 fi
12184 echo "$as_me:12184: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12185 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12186 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12187
12188 cat >>confdefs.h <<\EOF
12189 #define HAVE_LIBXT 1
12190 EOF
12191
12192                  cf_have_X_LIBS=Xt
12193                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12194 fi
12195
12196 fi
12197
12198 fi
12199
12200 if test $cf_have_X_LIBS = no ; then
12201         { echo "$as_me:12201: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12202 test program.  You will have to check and add the proper libraries by hand
12203 to makefile." >&5
12204 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12205 test program.  You will have to check and add the proper libraries by hand
12206 to makefile." >&2;}
12207 fi
12208
12209 cf_x_athena_root=$cf_x_athena
12210 cf_x_athena_inc=""
12211
12212 for cf_path in default \
12213         /usr/contrib/X11R6 \
12214         /usr/contrib/X11R5 \
12215         /usr/lib/X11R5 \
12216         /usr/local
12217 do
12218         if test -z "$cf_x_athena_inc" ; then
12219                 cf_save="$CPPFLAGS"
12220                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12221                 if test $cf_path != default ; then
12222                         CPPFLAGS="$cf_save -I$cf_path/include"
12223                         echo "$as_me:12223: checking for $cf_test in $cf_path" >&5
12224 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12225                 else
12226                         echo "$as_me:12226: checking for $cf_test" >&5
12227 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12228                 fi
12229                 cat >conftest.$ac_ext <<_ACEOF
12230 #line 12230 "configure"
12231 #include "confdefs.h"
12232
12233 #include <X11/Intrinsic.h>
12234 #include <$cf_test>
12235 int
12236 main ()
12237 {
12238
12239   ;
12240   return 0;
12241 }
12242 _ACEOF
12243 rm -f conftest.$ac_objext
12244 if { (eval echo "$as_me:12244: \"$ac_compile\"") >&5
12245   (eval $ac_compile) 2>&5
12246   ac_status=$?
12247   echo "$as_me:12247: \$? = $ac_status" >&5
12248   (exit $ac_status); } &&
12249          { ac_try='test -s conftest.$ac_objext'
12250   { (eval echo "$as_me:12250: \"$ac_try\"") >&5
12251   (eval $ac_try) 2>&5
12252   ac_status=$?
12253   echo "$as_me:12253: \$? = $ac_status" >&5
12254   (exit $ac_status); }; }; then
12255   cf_result=yes
12256 else
12257   echo "$as_me: failed program was:" >&5
12258 cat conftest.$ac_ext >&5
12259 cf_result=no
12260 fi
12261 rm -f conftest.$ac_objext conftest.$ac_ext
12262                 echo "$as_me:12262: result: $cf_result" >&5
12263 echo "${ECHO_T}$cf_result" >&6
12264                 if test "$cf_result" = yes ; then
12265                         cf_x_athena_inc=$cf_path
12266                         break
12267                 else
12268                         CPPFLAGS="$cf_save"
12269                 fi
12270         fi
12271 done
12272
12273 if test -z "$cf_x_athena_inc" ; then
12274         { echo "$as_me:12274: WARNING: Unable to successfully find Athena header files with test program" >&5
12275 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12276 elif test "$cf_x_athena_inc" != default ; then
12277         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12278 fi
12279
12280 cf_x_athena_root=$cf_x_athena
12281 cf_x_athena_lib=""
12282
12283 for cf_path in default \
12284         /usr/contrib/X11R6 \
12285         /usr/contrib/X11R5 \
12286         /usr/lib/X11R5 \
12287         /usr/local
12288 do
12289         for cf_lib in \
12290                 ${cf_x_athena_root} \
12291                 ${cf_x_athena_root}7 \
12292                 ${cf_x_athena_root}6
12293         do
12294         for cf_libs in \
12295                 "-l$cf_lib -lXmu" \
12296                 "-l$cf_lib -lXpm -lXmu" \
12297                 "-l${cf_lib}_s -lXmu_s"
12298         do
12299                 if test -z "$cf_x_athena_lib" ; then
12300                         cf_save="$LIBS"
12301                         cf_test=XawSimpleMenuAddGlobalActions
12302                         if test $cf_path != default ; then
12303
12304 cf_add_libs="-L$cf_path/lib $cf_libs"
12305 # Filter out duplicates - this happens with badly-designed ".pc" files...
12306 for cf_add_1lib in $LIBS
12307 do
12308         for cf_add_2lib in $cf_add_libs
12309         do
12310                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12311                 then
12312                         cf_add_1lib=
12313                         break
12314                 fi
12315         done
12316         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12317 done
12318 LIBS="$cf_add_libs"
12319
12320                                 echo "$as_me:12320: checking for $cf_libs in $cf_path" >&5
12321 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12322                         else
12323
12324 cf_add_libs="$cf_libs"
12325 # Filter out duplicates - this happens with badly-designed ".pc" files...
12326 for cf_add_1lib in $LIBS
12327 do
12328         for cf_add_2lib in $cf_add_libs
12329         do
12330                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12331                 then
12332                         cf_add_1lib=
12333                         break
12334                 fi
12335         done
12336         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12337 done
12338 LIBS="$cf_add_libs"
12339
12340                                 echo "$as_me:12340: checking for $cf_test in $cf_libs" >&5
12341 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12342                         fi
12343                         cat >conftest.$ac_ext <<_ACEOF
12344 #line 12344 "configure"
12345 #include "confdefs.h"
12346
12347 #include <X11/Intrinsic.h>
12348 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12349
12350 int
12351 main ()
12352 {
12353
12354 $cf_test((XtAppContext) 0)
12355   ;
12356   return 0;
12357 }
12358 _ACEOF
12359 rm -f conftest.$ac_objext conftest$ac_exeext
12360 if { (eval echo "$as_me:12360: \"$ac_link\"") >&5
12361   (eval $ac_link) 2>&5
12362   ac_status=$?
12363   echo "$as_me:12363: \$? = $ac_status" >&5
12364   (exit $ac_status); } &&
12365          { ac_try='test -s conftest$ac_exeext'
12366   { (eval echo "$as_me:12366: \"$ac_try\"") >&5
12367   (eval $ac_try) 2>&5
12368   ac_status=$?
12369   echo "$as_me:12369: \$? = $ac_status" >&5
12370   (exit $ac_status); }; }; then
12371   cf_result=yes
12372 else
12373   echo "$as_me: failed program was:" >&5
12374 cat conftest.$ac_ext >&5
12375 cf_result=no
12376 fi
12377 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12378                         echo "$as_me:12378: result: $cf_result" >&5
12379 echo "${ECHO_T}$cf_result" >&6
12380                         if test "$cf_result" = yes ; then
12381                                 cf_x_athena_lib="$cf_libs"
12382                                 break
12383                         fi
12384                         LIBS="$cf_save"
12385                 fi
12386         done # cf_libs
12387                 test -n "$cf_x_athena_lib" && break
12388         done # cf_lib
12389 done
12390
12391 if test -z "$cf_x_athena_lib" ; then
12392         { { echo "$as_me:12392: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12393 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12394    { (exit 1); exit 1; }; }
12395 fi
12396
12397 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12398
12399 cat >>confdefs.h <<EOF
12400 #define $cf_x_athena_LIBS 1
12401 EOF
12402
12403 fi
12404
12405 if test -n "$ac_tool_prefix"; then
12406   for ac_prog in xcurses-config
12407   do
12408     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12409 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12410 echo "$as_me:12410: checking for $ac_word" >&5
12411 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12412 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12413   echo $ECHO_N "(cached) $ECHO_C" >&6
12414 else
12415   if test -n "$XCURSES_CONFIG"; then
12416   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12417 else
12418   ac_save_IFS=$IFS; IFS=$ac_path_separator
12419 ac_dummy="$PATH"
12420 for ac_dir in $ac_dummy; do
12421   IFS=$ac_save_IFS
12422   test -z "$ac_dir" && ac_dir=.
12423   $as_executable_p "$ac_dir/$ac_word" || continue
12424 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12425 echo "$as_me:12425: found $ac_dir/$ac_word" >&5
12426 break
12427 done
12428
12429 fi
12430 fi
12431 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12432 if test -n "$XCURSES_CONFIG"; then
12433   echo "$as_me:12433: result: $XCURSES_CONFIG" >&5
12434 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12435 else
12436   echo "$as_me:12436: result: no" >&5
12437 echo "${ECHO_T}no" >&6
12438 fi
12439
12440     test -n "$XCURSES_CONFIG" && break
12441   done
12442 fi
12443 if test -z "$XCURSES_CONFIG"; then
12444   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12445   for ac_prog in xcurses-config
12446 do
12447   # Extract the first word of "$ac_prog", so it can be a program name with args.
12448 set dummy $ac_prog; ac_word=$2
12449 echo "$as_me:12449: checking for $ac_word" >&5
12450 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12451 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12452   echo $ECHO_N "(cached) $ECHO_C" >&6
12453 else
12454   if test -n "$ac_ct_XCURSES_CONFIG"; then
12455   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12456 else
12457   ac_save_IFS=$IFS; IFS=$ac_path_separator
12458 ac_dummy="$PATH"
12459 for ac_dir in $ac_dummy; do
12460   IFS=$ac_save_IFS
12461   test -z "$ac_dir" && ac_dir=.
12462   $as_executable_p "$ac_dir/$ac_word" || continue
12463 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12464 echo "$as_me:12464: found $ac_dir/$ac_word" >&5
12465 break
12466 done
12467
12468 fi
12469 fi
12470 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12471 if test -n "$ac_ct_XCURSES_CONFIG"; then
12472   echo "$as_me:12472: result: $ac_ct_XCURSES_CONFIG" >&5
12473 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12474 else
12475   echo "$as_me:12475: result: no" >&5
12476 echo "${ECHO_T}no" >&6
12477 fi
12478
12479   test -n "$ac_ct_XCURSES_CONFIG" && break
12480 done
12481 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12482
12483   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12484 fi
12485
12486 if test "$XCURSES_CONFIG" != none ; then
12487
12488 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12489
12490 cf_add_libs="`$XCURSES_CONFIG --libs`"
12491 # Filter out duplicates - this happens with badly-designed ".pc" files...
12492 for cf_add_1lib in $LIBS
12493 do
12494         for cf_add_2lib in $cf_add_libs
12495         do
12496                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12497                 then
12498                         cf_add_1lib=
12499                         break
12500                 fi
12501         done
12502         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12503 done
12504 LIBS="$cf_add_libs"
12505
12506 cf_cv_lib_XCurses=yes
12507
12508 else
12509
12510 LDFLAGS="$LDFLAGS $X_LIBS"
12511
12512 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12513
12514 echo "${as_me:-configure}:12514: testing checking additions to CFLAGS ..." 1>&5
12515
12516 cf_check_cflags="$CFLAGS"
12517 cf_check_cppflags="$CPPFLAGS"
12518
12519 cf_fix_cppflags=no
12520 cf_new_cflags=
12521 cf_new_cppflags=
12522 cf_new_extra_cppflags=
12523
12524 for cf_add_cflags in $X_CFLAGS
12525 do
12526 case $cf_fix_cppflags in
12527 no)
12528         case $cf_add_cflags in #(vi
12529         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12530                 case $cf_add_cflags in
12531                 -D*)
12532                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12533
12534                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12535                                 && test -z "${cf_tst_cflags}" \
12536                                 && cf_fix_cppflags=yes
12537
12538                         if test $cf_fix_cppflags = yes ; then
12539                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12540                                 continue
12541                         elif test "${cf_tst_cflags}" = "\"'" ; then
12542                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12543                                 continue
12544                         fi
12545                         ;;
12546                 esac
12547                 case "$CPPFLAGS" in
12548                 *$cf_add_cflags) #(vi
12549                         ;;
12550                 *) #(vi
12551                         case $cf_add_cflags in #(vi
12552                         -D*)
12553                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12554
12555 CPPFLAGS=`echo "$CPPFLAGS" | \
12556         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12557                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12558
12559                                 ;;
12560                         esac
12561                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12562                         ;;
12563                 esac
12564                 ;;
12565         *)
12566                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12567                 ;;
12568         esac
12569         ;;
12570 yes)
12571         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12572
12573         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12574
12575         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12576                 && test -z "${cf_tst_cflags}" \
12577                 && cf_fix_cppflags=no
12578         ;;
12579 esac
12580 done
12581
12582 if test -n "$cf_new_cflags" ; then
12583         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12584
12585 echo "${as_me:-configure}:12585: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12586
12587         CFLAGS="$CFLAGS $cf_new_cflags"
12588 fi
12589
12590 if test -n "$cf_new_cppflags" ; then
12591         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12592
12593 echo "${as_me:-configure}:12593: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12594
12595         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12596 fi
12597
12598 if test -n "$cf_new_extra_cppflags" ; then
12599         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12600
12601 echo "${as_me:-configure}:12601: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12602
12603         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12604 fi
12605
12606 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12607 cat >conftest.$ac_ext <<_ACEOF
12608 #line 12608 "configure"
12609 #include "confdefs.h"
12610 #include <stdio.h>
12611 int
12612 main ()
12613 {
12614 printf("Hello world");
12615   ;
12616   return 0;
12617 }
12618 _ACEOF
12619 rm -f conftest.$ac_objext conftest$ac_exeext
12620 if { (eval echo "$as_me:12620: \"$ac_link\"") >&5
12621   (eval $ac_link) 2>&5
12622   ac_status=$?
12623   echo "$as_me:12623: \$? = $ac_status" >&5
12624   (exit $ac_status); } &&
12625          { ac_try='test -s conftest$ac_exeext'
12626   { (eval echo "$as_me:12626: \"$ac_try\"") >&5
12627   (eval $ac_try) 2>&5
12628   ac_status=$?
12629   echo "$as_me:12629: \$? = $ac_status" >&5
12630   (exit $ac_status); }; }; then
12631   :
12632 else
12633   echo "$as_me: failed program was:" >&5
12634 cat conftest.$ac_ext >&5
12635 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12636
12637 echo "${as_me:-configure}:12637: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12638
12639          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12640                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12641
12642 echo "${as_me:-configure}:12642: testing but keeping change to \$CPPFLAGS ..." 1>&5
12643
12644          fi
12645          CFLAGS="$cf_check_flags"
12646 fi
12647 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12648 fi
12649
12650 echo "$as_me:12650: checking for XOpenDisplay in -lX11" >&5
12651 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12652 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12653   echo $ECHO_N "(cached) $ECHO_C" >&6
12654 else
12655   ac_check_lib_save_LIBS=$LIBS
12656 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12657 cat >conftest.$ac_ext <<_ACEOF
12658 #line 12658 "configure"
12659 #include "confdefs.h"
12660
12661 /* Override any gcc2 internal prototype to avoid an error.  */
12662 #ifdef __cplusplus
12663 extern "C"
12664 #endif
12665 /* We use char because int might match the return type of a gcc2
12666    builtin and then its argument prototype would still apply.  */
12667 char XOpenDisplay ();
12668 int
12669 main ()
12670 {
12671 XOpenDisplay ();
12672   ;
12673   return 0;
12674 }
12675 _ACEOF
12676 rm -f conftest.$ac_objext conftest$ac_exeext
12677 if { (eval echo "$as_me:12677: \"$ac_link\"") >&5
12678   (eval $ac_link) 2>&5
12679   ac_status=$?
12680   echo "$as_me:12680: \$? = $ac_status" >&5
12681   (exit $ac_status); } &&
12682          { ac_try='test -s conftest$ac_exeext'
12683   { (eval echo "$as_me:12683: \"$ac_try\"") >&5
12684   (eval $ac_try) 2>&5
12685   ac_status=$?
12686   echo "$as_me:12686: \$? = $ac_status" >&5
12687   (exit $ac_status); }; }; then
12688   ac_cv_lib_X11_XOpenDisplay=yes
12689 else
12690   echo "$as_me: failed program was:" >&5
12691 cat conftest.$ac_ext >&5
12692 ac_cv_lib_X11_XOpenDisplay=no
12693 fi
12694 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12695 LIBS=$ac_check_lib_save_LIBS
12696 fi
12697 echo "$as_me:12697: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12698 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12699 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12700
12701 cf_add_libs="-lX11"
12702 # Filter out duplicates - this happens with badly-designed ".pc" files...
12703 for cf_add_1lib in $LIBS
12704 do
12705         for cf_add_2lib in $cf_add_libs
12706         do
12707                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12708                 then
12709                         cf_add_1lib=
12710                         break
12711                 fi
12712         done
12713         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12714 done
12715 LIBS="$cf_add_libs"
12716
12717 fi
12718
12719 echo "$as_me:12719: checking for XCurses library" >&5
12720 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
12721 if test "${cf_cv_lib_XCurses+set}" = set; then
12722   echo $ECHO_N "(cached) $ECHO_C" >&6
12723 else
12724
12725 cf_add_libs="-lXCurses"
12726 # Filter out duplicates - this happens with badly-designed ".pc" files...
12727 for cf_add_1lib in $LIBS
12728 do
12729         for cf_add_2lib in $cf_add_libs
12730         do
12731                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12732                 then
12733                         cf_add_1lib=
12734                         break
12735                 fi
12736         done
12737         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12738 done
12739 LIBS="$cf_add_libs"
12740
12741 cat >conftest.$ac_ext <<_ACEOF
12742 #line 12742 "configure"
12743 #include "confdefs.h"
12744
12745 #include <xcurses.h>
12746 char *XCursesProgramName = "test";
12747
12748 int
12749 main ()
12750 {
12751 XCursesExit();
12752   ;
12753   return 0;
12754 }
12755 _ACEOF
12756 rm -f conftest.$ac_objext conftest$ac_exeext
12757 if { (eval echo "$as_me:12757: \"$ac_link\"") >&5
12758   (eval $ac_link) 2>&5
12759   ac_status=$?
12760   echo "$as_me:12760: \$? = $ac_status" >&5
12761   (exit $ac_status); } &&
12762          { ac_try='test -s conftest$ac_exeext'
12763   { (eval echo "$as_me:12763: \"$ac_try\"") >&5
12764   (eval $ac_try) 2>&5
12765   ac_status=$?
12766   echo "$as_me:12766: \$? = $ac_status" >&5
12767   (exit $ac_status); }; }; then
12768   cf_cv_lib_XCurses=yes
12769 else
12770   echo "$as_me: failed program was:" >&5
12771 cat conftest.$ac_ext >&5
12772 cf_cv_lib_XCurses=no
12773 fi
12774 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12775
12776 fi
12777 echo "$as_me:12777: result: $cf_cv_lib_XCurses" >&5
12778 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
12779
12780 fi
12781
12782 if test $cf_cv_lib_XCurses = yes ; then
12783
12784 cat >>confdefs.h <<\EOF
12785 #define UNIX 1
12786 EOF
12787
12788 cat >>confdefs.h <<\EOF
12789 #define XCURSES 1
12790 EOF
12791
12792         echo "$as_me:12792: checking for xcurses.h" >&5
12793 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
12794 if test "${ac_cv_header_xcurses_h+set}" = set; then
12795   echo $ECHO_N "(cached) $ECHO_C" >&6
12796 else
12797   cat >conftest.$ac_ext <<_ACEOF
12798 #line 12798 "configure"
12799 #include "confdefs.h"
12800 #include <xcurses.h>
12801 _ACEOF
12802 if { (eval echo "$as_me:12802: \"$ac_cpp conftest.$ac_ext\"") >&5
12803   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12804   ac_status=$?
12805   egrep -v '^ *\+' conftest.er1 >conftest.err
12806   rm -f conftest.er1
12807   cat conftest.err >&5
12808   echo "$as_me:12808: \$? = $ac_status" >&5
12809   (exit $ac_status); } >/dev/null; then
12810   if test -s conftest.err; then
12811     ac_cpp_err=$ac_c_preproc_warn_flag
12812   else
12813     ac_cpp_err=
12814   fi
12815 else
12816   ac_cpp_err=yes
12817 fi
12818 if test -z "$ac_cpp_err"; then
12819   ac_cv_header_xcurses_h=yes
12820 else
12821   echo "$as_me: failed program was:" >&5
12822   cat conftest.$ac_ext >&5
12823   ac_cv_header_xcurses_h=no
12824 fi
12825 rm -f conftest.err conftest.$ac_ext
12826 fi
12827 echo "$as_me:12827: result: $ac_cv_header_xcurses_h" >&5
12828 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
12829 if test $ac_cv_header_xcurses_h = yes; then
12830
12831 cat >>confdefs.h <<\EOF
12832 #define HAVE_XCURSES 1
12833 EOF
12834
12835 fi
12836
12837 else
12838         { { echo "$as_me:12838: error: Cannot link with XCurses" >&5
12839 echo "$as_me: error: Cannot link with XCurses" >&2;}
12840    { (exit 1); exit 1; }; }
12841 fi
12842
12843         ;;
12844 esac
12845
12846 case $cf_cv_screen in
12847 curses|curses_*)
12848
12849 echo "$as_me:12849: checking for NetBSD form.h" >&5
12850 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
12851 if test "${cf_cv_netbsd_form_h+set}" = set; then
12852   echo $ECHO_N "(cached) $ECHO_C" >&6
12853 else
12854
12855 cat >conftest.$ac_ext <<_ACEOF
12856 #line 12856 "configure"
12857 #include "confdefs.h"
12858
12859 #include <${cf_cv_ncurses_header:-curses.h}>
12860 #include <form.h>
12861
12862 int
12863 main ()
12864 {
12865
12866         FORM *form;
12867         int y = current_field(form)->cursor_ypos;
12868         int x = current_field(form)->cursor_xpos;
12869
12870   ;
12871   return 0;
12872 }
12873 _ACEOF
12874 rm -f conftest.$ac_objext
12875 if { (eval echo "$as_me:12875: \"$ac_compile\"") >&5
12876   (eval $ac_compile) 2>&5
12877   ac_status=$?
12878   echo "$as_me:12878: \$? = $ac_status" >&5
12879   (exit $ac_status); } &&
12880          { ac_try='test -s conftest.$ac_objext'
12881   { (eval echo "$as_me:12881: \"$ac_try\"") >&5
12882   (eval $ac_try) 2>&5
12883   ac_status=$?
12884   echo "$as_me:12884: \$? = $ac_status" >&5
12885   (exit $ac_status); }; }; then
12886   cf_cv_netbsd_form_h=yes
12887
12888 else
12889   echo "$as_me: failed program was:" >&5
12890 cat conftest.$ac_ext >&5
12891 cf_cv_netbsd_form_h=no
12892 fi
12893 rm -f conftest.$ac_objext conftest.$ac_ext
12894
12895 fi
12896 echo "$as_me:12896: result: $cf_cv_netbsd_form_h" >&5
12897 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
12898
12899 test "$cf_cv_netbsd_form_h" = yes &&
12900 cat >>confdefs.h <<\EOF
12901 #define HAVE_NETBSD_FORM_H 1
12902 EOF
12903
12904 echo "$as_me:12904: checking for NetBSD menu.h" >&5
12905 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
12906 if test "${cf_cv_netbsd_menu_h+set}" = set; then
12907   echo $ECHO_N "(cached) $ECHO_C" >&6
12908 else
12909
12910 cat >conftest.$ac_ext <<_ACEOF
12911 #line 12911 "configure"
12912 #include "confdefs.h"
12913
12914 #include <${cf_cv_ncurses_header:-curses.h}>
12915 #include <menu.h>
12916
12917 int
12918 main ()
12919 {
12920
12921         MENU *menu;
12922         int y = menu->max_item_width;
12923
12924   ;
12925   return 0;
12926 }
12927 _ACEOF
12928 rm -f conftest.$ac_objext
12929 if { (eval echo "$as_me:12929: \"$ac_compile\"") >&5
12930   (eval $ac_compile) 2>&5
12931   ac_status=$?
12932   echo "$as_me:12932: \$? = $ac_status" >&5
12933   (exit $ac_status); } &&
12934          { ac_try='test -s conftest.$ac_objext'
12935   { (eval echo "$as_me:12935: \"$ac_try\"") >&5
12936   (eval $ac_try) 2>&5
12937   ac_status=$?
12938   echo "$as_me:12938: \$? = $ac_status" >&5
12939   (exit $ac_status); }; }; then
12940   cf_cv_netbsd_menu_h=yes
12941
12942 else
12943   echo "$as_me: failed program was:" >&5
12944 cat conftest.$ac_ext >&5
12945 cf_cv_netbsd_menu_h=no
12946 fi
12947 rm -f conftest.$ac_objext conftest.$ac_ext
12948
12949 fi
12950 echo "$as_me:12950: result: $cf_cv_netbsd_menu_h" >&5
12951 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
12952
12953 test "$cf_cv_netbsd_menu_h" = yes &&
12954 cat >>confdefs.h <<\EOF
12955 #define HAVE_NETBSD_MENU_H 1
12956 EOF
12957
12958         ;;
12959 ncursesw)
12960         cf_cv_libtype=w
12961         ;;
12962 esac
12963
12964 case $cf_cv_screen in #(vi
12965 pdcurses) #(vi
12966         ;;
12967 *)
12968         # look for curses-related libraries
12969         : ${cf_panel_lib:=panel}
12970         : ${cf_menu_lib:=menu}
12971         : ${cf_form_lib:=form}
12972
12973 as_ac_Lib=`echo "ac_cv_lib_$cf_panel_lib$cf_cv_libtype''_new_panel" | $as_tr_sh`
12974 echo "$as_me:12974: checking for new_panel in -l$cf_panel_lib$cf_cv_libtype" >&5
12975 echo $ECHO_N "checking for new_panel in -l$cf_panel_lib$cf_cv_libtype... $ECHO_C" >&6
12976 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12977   echo $ECHO_N "(cached) $ECHO_C" >&6
12978 else
12979   ac_check_lib_save_LIBS=$LIBS
12980 LIBS="-l$cf_panel_lib$cf_cv_libtype  $LIBS"
12981 cat >conftest.$ac_ext <<_ACEOF
12982 #line 12982 "configure"
12983 #include "confdefs.h"
12984
12985 /* Override any gcc2 internal prototype to avoid an error.  */
12986 #ifdef __cplusplus
12987 extern "C"
12988 #endif
12989 /* We use char because int might match the return type of a gcc2
12990    builtin and then its argument prototype would still apply.  */
12991 char new_panel ();
12992 int
12993 main ()
12994 {
12995 new_panel ();
12996   ;
12997   return 0;
12998 }
12999 _ACEOF
13000 rm -f conftest.$ac_objext conftest$ac_exeext
13001 if { (eval echo "$as_me:13001: \"$ac_link\"") >&5
13002   (eval $ac_link) 2>&5
13003   ac_status=$?
13004   echo "$as_me:13004: \$? = $ac_status" >&5
13005   (exit $ac_status); } &&
13006          { ac_try='test -s conftest$ac_exeext'
13007   { (eval echo "$as_me:13007: \"$ac_try\"") >&5
13008   (eval $ac_try) 2>&5
13009   ac_status=$?
13010   echo "$as_me:13010: \$? = $ac_status" >&5
13011   (exit $ac_status); }; }; then
13012   eval "$as_ac_Lib=yes"
13013 else
13014   echo "$as_me: failed program was:" >&5
13015 cat conftest.$ac_ext >&5
13016 eval "$as_ac_Lib=no"
13017 fi
13018 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13019 LIBS=$ac_check_lib_save_LIBS
13020 fi
13021 echo "$as_me:13021: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13022 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13023 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13024   cat >>confdefs.h <<EOF
13025 #define `echo "HAVE_LIB$cf_panel_lib$cf_cv_libtype" | $as_tr_cpp` 1
13026 EOF
13027
13028   LIBS="-l$cf_panel_lib$cf_cv_libtype $LIBS"
13029
13030 fi
13031
13032 as_ac_Lib=`echo "ac_cv_lib_$cf_menu_lib$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13033 echo "$as_me:13033: checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype" >&5
13034 echo $ECHO_N "checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype... $ECHO_C" >&6
13035 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13036   echo $ECHO_N "(cached) $ECHO_C" >&6
13037 else
13038   ac_check_lib_save_LIBS=$LIBS
13039 LIBS="-l$cf_menu_lib$cf_cv_libtype  $LIBS"
13040 cat >conftest.$ac_ext <<_ACEOF
13041 #line 13041 "configure"
13042 #include "confdefs.h"
13043
13044 /* Override any gcc2 internal prototype to avoid an error.  */
13045 #ifdef __cplusplus
13046 extern "C"
13047 #endif
13048 /* We use char because int might match the return type of a gcc2
13049    builtin and then its argument prototype would still apply.  */
13050 char menu_driver ();
13051 int
13052 main ()
13053 {
13054 menu_driver ();
13055   ;
13056   return 0;
13057 }
13058 _ACEOF
13059 rm -f conftest.$ac_objext conftest$ac_exeext
13060 if { (eval echo "$as_me:13060: \"$ac_link\"") >&5
13061   (eval $ac_link) 2>&5
13062   ac_status=$?
13063   echo "$as_me:13063: \$? = $ac_status" >&5
13064   (exit $ac_status); } &&
13065          { ac_try='test -s conftest$ac_exeext'
13066   { (eval echo "$as_me:13066: \"$ac_try\"") >&5
13067   (eval $ac_try) 2>&5
13068   ac_status=$?
13069   echo "$as_me:13069: \$? = $ac_status" >&5
13070   (exit $ac_status); }; }; then
13071   eval "$as_ac_Lib=yes"
13072 else
13073   echo "$as_me: failed program was:" >&5
13074 cat conftest.$ac_ext >&5
13075 eval "$as_ac_Lib=no"
13076 fi
13077 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13078 LIBS=$ac_check_lib_save_LIBS
13079 fi
13080 echo "$as_me:13080: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13081 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13082 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13083   cat >>confdefs.h <<EOF
13084 #define `echo "HAVE_LIB$cf_menu_lib$cf_cv_libtype" | $as_tr_cpp` 1
13085 EOF
13086
13087   LIBS="-l$cf_menu_lib$cf_cv_libtype $LIBS"
13088
13089 fi
13090
13091 as_ac_Lib=`echo "ac_cv_lib_$cf_form_lib$cf_cv_libtype''_form_driver" | $as_tr_sh`
13092 echo "$as_me:13092: checking for form_driver in -l$cf_form_lib$cf_cv_libtype" >&5
13093 echo $ECHO_N "checking for form_driver in -l$cf_form_lib$cf_cv_libtype... $ECHO_C" >&6
13094 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13095   echo $ECHO_N "(cached) $ECHO_C" >&6
13096 else
13097   ac_check_lib_save_LIBS=$LIBS
13098 LIBS="-l$cf_form_lib$cf_cv_libtype  $LIBS"
13099 cat >conftest.$ac_ext <<_ACEOF
13100 #line 13100 "configure"
13101 #include "confdefs.h"
13102
13103 /* Override any gcc2 internal prototype to avoid an error.  */
13104 #ifdef __cplusplus
13105 extern "C"
13106 #endif
13107 /* We use char because int might match the return type of a gcc2
13108    builtin and then its argument prototype would still apply.  */
13109 char form_driver ();
13110 int
13111 main ()
13112 {
13113 form_driver ();
13114   ;
13115   return 0;
13116 }
13117 _ACEOF
13118 rm -f conftest.$ac_objext conftest$ac_exeext
13119 if { (eval echo "$as_me:13119: \"$ac_link\"") >&5
13120   (eval $ac_link) 2>&5
13121   ac_status=$?
13122   echo "$as_me:13122: \$? = $ac_status" >&5
13123   (exit $ac_status); } &&
13124          { ac_try='test -s conftest$ac_exeext'
13125   { (eval echo "$as_me:13125: \"$ac_try\"") >&5
13126   (eval $ac_try) 2>&5
13127   ac_status=$?
13128   echo "$as_me:13128: \$? = $ac_status" >&5
13129   (exit $ac_status); }; }; then
13130   eval "$as_ac_Lib=yes"
13131 else
13132   echo "$as_me: failed program was:" >&5
13133 cat conftest.$ac_ext >&5
13134 eval "$as_ac_Lib=no"
13135 fi
13136 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13137 LIBS=$ac_check_lib_save_LIBS
13138 fi
13139 echo "$as_me:13139: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13140 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13141 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13142   cat >>confdefs.h <<EOF
13143 #define `echo "HAVE_LIB$cf_form_lib$cf_cv_libtype" | $as_tr_cpp` 1
13144 EOF
13145
13146   LIBS="-l$cf_form_lib$cf_cv_libtype $LIBS"
13147
13148 fi
13149
13150         # look for curses-related headers
13151
13152 for ac_header in \
13153                 nc_alloc.h \
13154                 nomacros.h \
13155                 form.h \
13156                 menu.h \
13157                 panel.h \
13158                 term_entry.h \
13159
13160 do
13161 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13162 echo "$as_me:13162: checking for $ac_header" >&5
13163 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13164 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13165   echo $ECHO_N "(cached) $ECHO_C" >&6
13166 else
13167   cat >conftest.$ac_ext <<_ACEOF
13168 #line 13168 "configure"
13169 #include "confdefs.h"
13170 #include <$ac_header>
13171 _ACEOF
13172 if { (eval echo "$as_me:13172: \"$ac_cpp conftest.$ac_ext\"") >&5
13173   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13174   ac_status=$?
13175   egrep -v '^ *\+' conftest.er1 >conftest.err
13176   rm -f conftest.er1
13177   cat conftest.err >&5
13178   echo "$as_me:13178: \$? = $ac_status" >&5
13179   (exit $ac_status); } >/dev/null; then
13180   if test -s conftest.err; then
13181     ac_cpp_err=$ac_c_preproc_warn_flag
13182   else
13183     ac_cpp_err=
13184   fi
13185 else
13186   ac_cpp_err=yes
13187 fi
13188 if test -z "$ac_cpp_err"; then
13189   eval "$as_ac_Header=yes"
13190 else
13191   echo "$as_me: failed program was:" >&5
13192   cat conftest.$ac_ext >&5
13193   eval "$as_ac_Header=no"
13194 fi
13195 rm -f conftest.err conftest.$ac_ext
13196 fi
13197 echo "$as_me:13197: result: `eval echo '${'$as_ac_Header'}'`" >&5
13198 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13199 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13200   cat >>confdefs.h <<EOF
13201 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13202 EOF
13203
13204 fi
13205 done
13206
13207         ;;
13208 esac
13209
13210 echo "$as_me:13210: checking for ANSI C header files" >&5
13211 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13212 if test "${ac_cv_header_stdc+set}" = set; then
13213   echo $ECHO_N "(cached) $ECHO_C" >&6
13214 else
13215   cat >conftest.$ac_ext <<_ACEOF
13216 #line 13216 "configure"
13217 #include "confdefs.h"
13218 #include <stdlib.h>
13219 #include <stdarg.h>
13220 #include <string.h>
13221 #include <float.h>
13222
13223 _ACEOF
13224 if { (eval echo "$as_me:13224: \"$ac_cpp conftest.$ac_ext\"") >&5
13225   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13226   ac_status=$?
13227   egrep -v '^ *\+' conftest.er1 >conftest.err
13228   rm -f conftest.er1
13229   cat conftest.err >&5
13230   echo "$as_me:13230: \$? = $ac_status" >&5
13231   (exit $ac_status); } >/dev/null; then
13232   if test -s conftest.err; then
13233     ac_cpp_err=$ac_c_preproc_warn_flag
13234   else
13235     ac_cpp_err=
13236   fi
13237 else
13238   ac_cpp_err=yes
13239 fi
13240 if test -z "$ac_cpp_err"; then
13241   ac_cv_header_stdc=yes
13242 else
13243   echo "$as_me: failed program was:" >&5
13244   cat conftest.$ac_ext >&5
13245   ac_cv_header_stdc=no
13246 fi
13247 rm -f conftest.err conftest.$ac_ext
13248
13249 if test $ac_cv_header_stdc = yes; then
13250   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13251   cat >conftest.$ac_ext <<_ACEOF
13252 #line 13252 "configure"
13253 #include "confdefs.h"
13254 #include <string.h>
13255
13256 _ACEOF
13257 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13258   egrep "memchr" >/dev/null 2>&1; then
13259   :
13260 else
13261   ac_cv_header_stdc=no
13262 fi
13263 rm -rf conftest*
13264
13265 fi
13266
13267 if test $ac_cv_header_stdc = yes; then
13268   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13269   cat >conftest.$ac_ext <<_ACEOF
13270 #line 13270 "configure"
13271 #include "confdefs.h"
13272 #include <stdlib.h>
13273
13274 _ACEOF
13275 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13276   egrep "free" >/dev/null 2>&1; then
13277   :
13278 else
13279   ac_cv_header_stdc=no
13280 fi
13281 rm -rf conftest*
13282
13283 fi
13284
13285 if test $ac_cv_header_stdc = yes; then
13286   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13287   if test "$cross_compiling" = yes; then
13288   :
13289 else
13290   cat >conftest.$ac_ext <<_ACEOF
13291 #line 13291 "configure"
13292 #include "confdefs.h"
13293 #include <ctype.h>
13294 #if ((' ' & 0x0FF) == 0x020)
13295 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13296 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13297 #else
13298 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13299                      || ('j' <= (c) && (c) <= 'r') \
13300                      || ('s' <= (c) && (c) <= 'z'))
13301 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13302 #endif
13303
13304 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13305 int
13306 main ()
13307 {
13308   int i;
13309   for (i = 0; i < 256; i++)
13310     if (XOR (islower (i), ISLOWER (i))
13311         || toupper (i) != TOUPPER (i))
13312       $ac_main_return(2);
13313   $ac_main_return (0);
13314 }
13315 _ACEOF
13316 rm -f conftest$ac_exeext
13317 if { (eval echo "$as_me:13317: \"$ac_link\"") >&5
13318   (eval $ac_link) 2>&5
13319   ac_status=$?
13320   echo "$as_me:13320: \$? = $ac_status" >&5
13321   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13322   { (eval echo "$as_me:13322: \"$ac_try\"") >&5
13323   (eval $ac_try) 2>&5
13324   ac_status=$?
13325   echo "$as_me:13325: \$? = $ac_status" >&5
13326   (exit $ac_status); }; }; then
13327   :
13328 else
13329   echo "$as_me: program exited with status $ac_status" >&5
13330 echo "$as_me: failed program was:" >&5
13331 cat conftest.$ac_ext >&5
13332 ac_cv_header_stdc=no
13333 fi
13334 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13335 fi
13336 fi
13337 fi
13338 echo "$as_me:13338: result: $ac_cv_header_stdc" >&5
13339 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13340 if test $ac_cv_header_stdc = yes; then
13341
13342 cat >>confdefs.h <<\EOF
13343 #define STDC_HEADERS 1
13344 EOF
13345
13346 fi
13347
13348 echo "$as_me:13348: checking whether time.h and sys/time.h may both be included" >&5
13349 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13350 if test "${ac_cv_header_time+set}" = set; then
13351   echo $ECHO_N "(cached) $ECHO_C" >&6
13352 else
13353   cat >conftest.$ac_ext <<_ACEOF
13354 #line 13354 "configure"
13355 #include "confdefs.h"
13356 #include <sys/types.h>
13357 #include <sys/time.h>
13358 #include <time.h>
13359
13360 int
13361 main ()
13362 {
13363 if ((struct tm *) 0)
13364 return 0;
13365   ;
13366   return 0;
13367 }
13368 _ACEOF
13369 rm -f conftest.$ac_objext
13370 if { (eval echo "$as_me:13370: \"$ac_compile\"") >&5
13371   (eval $ac_compile) 2>&5
13372   ac_status=$?
13373   echo "$as_me:13373: \$? = $ac_status" >&5
13374   (exit $ac_status); } &&
13375          { ac_try='test -s conftest.$ac_objext'
13376   { (eval echo "$as_me:13376: \"$ac_try\"") >&5
13377   (eval $ac_try) 2>&5
13378   ac_status=$?
13379   echo "$as_me:13379: \$? = $ac_status" >&5
13380   (exit $ac_status); }; }; then
13381   ac_cv_header_time=yes
13382 else
13383   echo "$as_me: failed program was:" >&5
13384 cat conftest.$ac_ext >&5
13385 ac_cv_header_time=no
13386 fi
13387 rm -f conftest.$ac_objext conftest.$ac_ext
13388 fi
13389 echo "$as_me:13389: result: $ac_cv_header_time" >&5
13390 echo "${ECHO_T}$ac_cv_header_time" >&6
13391 if test $ac_cv_header_time = yes; then
13392
13393 cat >>confdefs.h <<\EOF
13394 #define TIME_WITH_SYS_TIME 1
13395 EOF
13396
13397 fi
13398
13399 for ac_header in \
13400 getopt.h \
13401 locale.h \
13402 math.h \
13403 stdarg.h \
13404 sys/ioctl.h \
13405 sys/select.h \
13406 sys/time.h \
13407 termios.h \
13408 unistd.h \
13409
13410 do
13411 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13412 echo "$as_me:13412: checking for $ac_header" >&5
13413 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13414 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13415   echo $ECHO_N "(cached) $ECHO_C" >&6
13416 else
13417   cat >conftest.$ac_ext <<_ACEOF
13418 #line 13418 "configure"
13419 #include "confdefs.h"
13420 #include <$ac_header>
13421 _ACEOF
13422 if { (eval echo "$as_me:13422: \"$ac_cpp conftest.$ac_ext\"") >&5
13423   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13424   ac_status=$?
13425   egrep -v '^ *\+' conftest.er1 >conftest.err
13426   rm -f conftest.er1
13427   cat conftest.err >&5
13428   echo "$as_me:13428: \$? = $ac_status" >&5
13429   (exit $ac_status); } >/dev/null; then
13430   if test -s conftest.err; then
13431     ac_cpp_err=$ac_c_preproc_warn_flag
13432   else
13433     ac_cpp_err=
13434   fi
13435 else
13436   ac_cpp_err=yes
13437 fi
13438 if test -z "$ac_cpp_err"; then
13439   eval "$as_ac_Header=yes"
13440 else
13441   echo "$as_me: failed program was:" >&5
13442   cat conftest.$ac_ext >&5
13443   eval "$as_ac_Header=no"
13444 fi
13445 rm -f conftest.err conftest.$ac_ext
13446 fi
13447 echo "$as_me:13447: result: `eval echo '${'$as_ac_Header'}'`" >&5
13448 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13449 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13450   cat >>confdefs.h <<EOF
13451 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13452 EOF
13453
13454 fi
13455 done
13456
13457 for ac_header in unistd.h getopt.h
13458 do
13459 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13460 echo "$as_me:13460: checking for $ac_header" >&5
13461 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13462 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13463   echo $ECHO_N "(cached) $ECHO_C" >&6
13464 else
13465   cat >conftest.$ac_ext <<_ACEOF
13466 #line 13466 "configure"
13467 #include "confdefs.h"
13468 #include <$ac_header>
13469 _ACEOF
13470 if { (eval echo "$as_me:13470: \"$ac_cpp conftest.$ac_ext\"") >&5
13471   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13472   ac_status=$?
13473   egrep -v '^ *\+' conftest.er1 >conftest.err
13474   rm -f conftest.er1
13475   cat conftest.err >&5
13476   echo "$as_me:13476: \$? = $ac_status" >&5
13477   (exit $ac_status); } >/dev/null; then
13478   if test -s conftest.err; then
13479     ac_cpp_err=$ac_c_preproc_warn_flag
13480   else
13481     ac_cpp_err=
13482   fi
13483 else
13484   ac_cpp_err=yes
13485 fi
13486 if test -z "$ac_cpp_err"; then
13487   eval "$as_ac_Header=yes"
13488 else
13489   echo "$as_me: failed program was:" >&5
13490   cat conftest.$ac_ext >&5
13491   eval "$as_ac_Header=no"
13492 fi
13493 rm -f conftest.err conftest.$ac_ext
13494 fi
13495 echo "$as_me:13495: result: `eval echo '${'$as_ac_Header'}'`" >&5
13496 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13497 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13498   cat >>confdefs.h <<EOF
13499 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13500 EOF
13501
13502 fi
13503 done
13504
13505 echo "$as_me:13505: checking for header declaring getopt variables" >&5
13506 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13507 if test "${cf_cv_getopt_header+set}" = set; then
13508   echo $ECHO_N "(cached) $ECHO_C" >&6
13509 else
13510
13511 cf_cv_getopt_header=none
13512 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13513 do
13514 cat >conftest.$ac_ext <<_ACEOF
13515 #line 13515 "configure"
13516 #include "confdefs.h"
13517
13518 #include <$cf_header>
13519 int
13520 main ()
13521 {
13522 int x = optind; char *y = optarg
13523   ;
13524   return 0;
13525 }
13526 _ACEOF
13527 rm -f conftest.$ac_objext
13528 if { (eval echo "$as_me:13528: \"$ac_compile\"") >&5
13529   (eval $ac_compile) 2>&5
13530   ac_status=$?
13531   echo "$as_me:13531: \$? = $ac_status" >&5
13532   (exit $ac_status); } &&
13533          { ac_try='test -s conftest.$ac_objext'
13534   { (eval echo "$as_me:13534: \"$ac_try\"") >&5
13535   (eval $ac_try) 2>&5
13536   ac_status=$?
13537   echo "$as_me:13537: \$? = $ac_status" >&5
13538   (exit $ac_status); }; }; then
13539   cf_cv_getopt_header=$cf_header
13540  break
13541 else
13542   echo "$as_me: failed program was:" >&5
13543 cat conftest.$ac_ext >&5
13544 fi
13545 rm -f conftest.$ac_objext conftest.$ac_ext
13546 done
13547
13548 fi
13549 echo "$as_me:13549: result: $cf_cv_getopt_header" >&5
13550 echo "${ECHO_T}$cf_cv_getopt_header" >&6
13551 if test $cf_cv_getopt_header != none ; then
13552
13553 cat >>confdefs.h <<\EOF
13554 #define HAVE_GETOPT_HEADER 1
13555 EOF
13556
13557 fi
13558 if test $cf_cv_getopt_header = getopt.h ; then
13559
13560 cat >>confdefs.h <<\EOF
13561 #define NEED_GETOPT_H 1
13562 EOF
13563
13564 fi
13565
13566 for ac_func in \
13567 getopt \
13568 gettimeofday \
13569
13570 do
13571 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13572 echo "$as_me:13572: checking for $ac_func" >&5
13573 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13574 if eval "test \"\${$as_ac_var+set}\" = set"; then
13575   echo $ECHO_N "(cached) $ECHO_C" >&6
13576 else
13577   cat >conftest.$ac_ext <<_ACEOF
13578 #line 13578 "configure"
13579 #include "confdefs.h"
13580 /* System header to define __stub macros and hopefully few prototypes,
13581     which can conflict with char $ac_func (); below.  */
13582 #include <assert.h>
13583 /* Override any gcc2 internal prototype to avoid an error.  */
13584 #ifdef __cplusplus
13585 extern "C"
13586 #endif
13587 /* We use char because int might match the return type of a gcc2
13588    builtin and then its argument prototype would still apply.  */
13589 char $ac_func ();
13590 char (*f) ();
13591
13592 int
13593 main ()
13594 {
13595 /* The GNU C library defines this for functions which it implements
13596     to always fail with ENOSYS.  Some functions are actually named
13597     something starting with __ and the normal name is an alias.  */
13598 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13599 choke me
13600 #else
13601 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13602 #endif
13603
13604   ;
13605   return 0;
13606 }
13607 _ACEOF
13608 rm -f conftest.$ac_objext conftest$ac_exeext
13609 if { (eval echo "$as_me:13609: \"$ac_link\"") >&5
13610   (eval $ac_link) 2>&5
13611   ac_status=$?
13612   echo "$as_me:13612: \$? = $ac_status" >&5
13613   (exit $ac_status); } &&
13614          { ac_try='test -s conftest$ac_exeext'
13615   { (eval echo "$as_me:13615: \"$ac_try\"") >&5
13616   (eval $ac_try) 2>&5
13617   ac_status=$?
13618   echo "$as_me:13618: \$? = $ac_status" >&5
13619   (exit $ac_status); }; }; then
13620   eval "$as_ac_var=yes"
13621 else
13622   echo "$as_me: failed program was:" >&5
13623 cat conftest.$ac_ext >&5
13624 eval "$as_ac_var=no"
13625 fi
13626 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13627 fi
13628 echo "$as_me:13628: result: `eval echo '${'$as_ac_var'}'`" >&5
13629 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13630 if test `eval echo '${'$as_ac_var'}'` = yes; then
13631   cat >>confdefs.h <<EOF
13632 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13633 EOF
13634
13635 fi
13636 done
13637
13638 if test "x$ac_cv_func_getopt" = xno; then
13639         { { echo "$as_me:13639: error: getopt is required for building programs" >&5
13640 echo "$as_me: error: getopt is required for building programs" >&2;}
13641    { (exit 1); exit 1; }; }
13642 fi
13643
13644 if test "$cf_enable_widec" = yes; then
13645
13646 for ac_func in \
13647 mblen \
13648 mbrlen \
13649 mbrtowc \
13650 mbsrtowcs \
13651 mbstowcs \
13652 mbtowc \
13653 wcsrtombs \
13654 wcstombs \
13655
13656 do
13657 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13658 echo "$as_me:13658: checking for $ac_func" >&5
13659 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13660 if eval "test \"\${$as_ac_var+set}\" = set"; then
13661   echo $ECHO_N "(cached) $ECHO_C" >&6
13662 else
13663   cat >conftest.$ac_ext <<_ACEOF
13664 #line 13664 "configure"
13665 #include "confdefs.h"
13666 /* System header to define __stub macros and hopefully few prototypes,
13667     which can conflict with char $ac_func (); below.  */
13668 #include <assert.h>
13669 /* Override any gcc2 internal prototype to avoid an error.  */
13670 #ifdef __cplusplus
13671 extern "C"
13672 #endif
13673 /* We use char because int might match the return type of a gcc2
13674    builtin and then its argument prototype would still apply.  */
13675 char $ac_func ();
13676 char (*f) ();
13677
13678 int
13679 main ()
13680 {
13681 /* The GNU C library defines this for functions which it implements
13682     to always fail with ENOSYS.  Some functions are actually named
13683     something starting with __ and the normal name is an alias.  */
13684 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13685 choke me
13686 #else
13687 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13688 #endif
13689
13690   ;
13691   return 0;
13692 }
13693 _ACEOF
13694 rm -f conftest.$ac_objext conftest$ac_exeext
13695 if { (eval echo "$as_me:13695: \"$ac_link\"") >&5
13696   (eval $ac_link) 2>&5
13697   ac_status=$?
13698   echo "$as_me:13698: \$? = $ac_status" >&5
13699   (exit $ac_status); } &&
13700          { ac_try='test -s conftest$ac_exeext'
13701   { (eval echo "$as_me:13701: \"$ac_try\"") >&5
13702   (eval $ac_try) 2>&5
13703   ac_status=$?
13704   echo "$as_me:13704: \$? = $ac_status" >&5
13705   (exit $ac_status); }; }; then
13706   eval "$as_ac_var=yes"
13707 else
13708   echo "$as_me: failed program was:" >&5
13709 cat conftest.$ac_ext >&5
13710 eval "$as_ac_var=no"
13711 fi
13712 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13713 fi
13714 echo "$as_me:13714: result: `eval echo '${'$as_ac_var'}'`" >&5
13715 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13716 if test `eval echo '${'$as_ac_var'}'` = yes; then
13717   cat >>confdefs.h <<EOF
13718 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13719 EOF
13720
13721 fi
13722 done
13723
13724 fi
13725
13726 echo "$as_me:13726: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
13727 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
13728 if test "${cf_cv_need_xopen_extension+set}" = set; then
13729   echo $ECHO_N "(cached) $ECHO_C" >&6
13730 else
13731
13732 cat >conftest.$ac_ext <<_ACEOF
13733 #line 13733 "configure"
13734 #include "confdefs.h"
13735
13736 #include <stdlib.h>
13737 #include <${cf_cv_ncurses_header:-curses.h}>
13738 int
13739 main ()
13740 {
13741
13742 #if defined(NCURSES_VERSION_PATCH)
13743 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
13744         make an error
13745 #endif
13746 #endif
13747         long x = winnstr(stdscr, "", 0);
13748         int x1, y1;
13749         getbegyx(stdscr, y1, x1)
13750   ;
13751   return 0;
13752 }
13753 _ACEOF
13754 rm -f conftest.$ac_objext conftest$ac_exeext
13755 if { (eval echo "$as_me:13755: \"$ac_link\"") >&5
13756   (eval $ac_link) 2>&5
13757   ac_status=$?
13758   echo "$as_me:13758: \$? = $ac_status" >&5
13759   (exit $ac_status); } &&
13760          { ac_try='test -s conftest$ac_exeext'
13761   { (eval echo "$as_me:13761: \"$ac_try\"") >&5
13762   (eval $ac_try) 2>&5
13763   ac_status=$?
13764   echo "$as_me:13764: \$? = $ac_status" >&5
13765   (exit $ac_status); }; }; then
13766   cf_cv_need_xopen_extension=no
13767 else
13768   echo "$as_me: failed program was:" >&5
13769 cat conftest.$ac_ext >&5
13770 cat >conftest.$ac_ext <<_ACEOF
13771 #line 13771 "configure"
13772 #include "confdefs.h"
13773
13774 #define _XOPEN_SOURCE_EXTENDED
13775 #include <stdlib.h>
13776 #include <${cf_cv_ncurses_header:-curses.h}>
13777 int
13778 main ()
13779 {
13780
13781 #ifdef NCURSES_VERSION
13782         cchar_t check;
13783         int check2 = curs_set((int)sizeof(check));
13784 #endif
13785         long x = winnstr(stdscr, "", 0);
13786         int x1, y1;
13787         getbegyx(stdscr, y1, x1)
13788   ;
13789   return 0;
13790 }
13791 _ACEOF
13792 rm -f conftest.$ac_objext conftest$ac_exeext
13793 if { (eval echo "$as_me:13793: \"$ac_link\"") >&5
13794   (eval $ac_link) 2>&5
13795   ac_status=$?
13796   echo "$as_me:13796: \$? = $ac_status" >&5
13797   (exit $ac_status); } &&
13798          { ac_try='test -s conftest$ac_exeext'
13799   { (eval echo "$as_me:13799: \"$ac_try\"") >&5
13800   (eval $ac_try) 2>&5
13801   ac_status=$?
13802   echo "$as_me:13802: \$? = $ac_status" >&5
13803   (exit $ac_status); }; }; then
13804   cf_cv_need_xopen_extension=yes
13805 else
13806   echo "$as_me: failed program was:" >&5
13807 cat conftest.$ac_ext >&5
13808 cf_cv_need_xopen_extension=unknown
13809 fi
13810 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13811 fi
13812 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13813 fi
13814 echo "$as_me:13814: result: $cf_cv_need_xopen_extension" >&5
13815 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
13816 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
13817
13818 echo "$as_me:13818: checking for term.h" >&5
13819 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
13820 if test "${cf_cv_term_header+set}" = set; then
13821   echo $ECHO_N "(cached) $ECHO_C" >&6
13822 else
13823
13824 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
13825 # for <term.h> if we do not find the variant.
13826
13827 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
13828
13829 case ${cf_cv_ncurses_header:-curses.h} in #(vi
13830 */*)
13831         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
13832         cf_header_list="$cf_header_item $cf_header_list"
13833         ;;
13834 esac
13835
13836 for cf_header in $cf_header_list
13837 do
13838         cat >conftest.$ac_ext <<_ACEOF
13839 #line 13839 "configure"
13840 #include "confdefs.h"
13841
13842 #include <${cf_cv_ncurses_header:-curses.h}>
13843 #include <${cf_header}>
13844 int
13845 main ()
13846 {
13847 WINDOW *x
13848   ;
13849   return 0;
13850 }
13851 _ACEOF
13852 rm -f conftest.$ac_objext
13853 if { (eval echo "$as_me:13853: \"$ac_compile\"") >&5
13854   (eval $ac_compile) 2>&5
13855   ac_status=$?
13856   echo "$as_me:13856: \$? = $ac_status" >&5
13857   (exit $ac_status); } &&
13858          { ac_try='test -s conftest.$ac_objext'
13859   { (eval echo "$as_me:13859: \"$ac_try\"") >&5
13860   (eval $ac_try) 2>&5
13861   ac_status=$?
13862   echo "$as_me:13862: \$? = $ac_status" >&5
13863   (exit $ac_status); }; }; then
13864   cf_cv_term_header=$cf_header
13865          break
13866 else
13867   echo "$as_me: failed program was:" >&5
13868 cat conftest.$ac_ext >&5
13869 cf_cv_term_header=no
13870 fi
13871 rm -f conftest.$ac_objext conftest.$ac_ext
13872 done
13873
13874 case $cf_cv_term_header in #(vi
13875 no)
13876         # If curses is ncurses, some packagers still mess it up by trying to make
13877         # us use GNU termcap.  This handles the most common case.
13878         for cf_header in ncurses/term.h ncursesw/term.h
13879         do
13880                 cat >conftest.$ac_ext <<_ACEOF
13881 #line 13881 "configure"
13882 #include "confdefs.h"
13883
13884 #include <${cf_cv_ncurses_header:-curses.h}>
13885 #ifdef NCURSES_VERSION
13886 #include <${cf_header}>
13887 #else
13888 make an error
13889 #endif
13890 int
13891 main ()
13892 {
13893 WINDOW *x
13894   ;
13895   return 0;
13896 }
13897 _ACEOF
13898 rm -f conftest.$ac_objext
13899 if { (eval echo "$as_me:13899: \"$ac_compile\"") >&5
13900   (eval $ac_compile) 2>&5
13901   ac_status=$?
13902   echo "$as_me:13902: \$? = $ac_status" >&5
13903   (exit $ac_status); } &&
13904          { ac_try='test -s conftest.$ac_objext'
13905   { (eval echo "$as_me:13905: \"$ac_try\"") >&5
13906   (eval $ac_try) 2>&5
13907   ac_status=$?
13908   echo "$as_me:13908: \$? = $ac_status" >&5
13909   (exit $ac_status); }; }; then
13910   cf_cv_term_header=$cf_header
13911                          break
13912 else
13913   echo "$as_me: failed program was:" >&5
13914 cat conftest.$ac_ext >&5
13915 cf_cv_term_header=no
13916 fi
13917 rm -f conftest.$ac_objext conftest.$ac_ext
13918         done
13919         ;;
13920 esac
13921
13922 fi
13923 echo "$as_me:13923: result: $cf_cv_term_header" >&5
13924 echo "${ECHO_T}$cf_cv_term_header" >&6
13925
13926 case $cf_cv_term_header in #(vi
13927 term.h) #(vi
13928
13929 cat >>confdefs.h <<\EOF
13930 #define HAVE_TERM_H 1
13931 EOF
13932
13933         ;;
13934 ncurses/term.h) #(vi
13935
13936 cat >>confdefs.h <<\EOF
13937 #define HAVE_NCURSES_TERM_H 1
13938 EOF
13939
13940         ;;
13941 ncursesw/term.h)
13942
13943 cat >>confdefs.h <<\EOF
13944 #define HAVE_NCURSESW_TERM_H 1
13945 EOF
13946
13947         ;;
13948 esac
13949
13950 echo "$as_me:13950: checking for unctrl.h" >&5
13951 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
13952 if test "${cf_cv_unctrl_header+set}" = set; then
13953   echo $ECHO_N "(cached) $ECHO_C" >&6
13954 else
13955
13956 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
13957 # for <unctrl.h> if we do not find the variant.
13958
13959 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
13960
13961 case ${cf_cv_ncurses_header:-curses.h} in #(vi
13962 */*)
13963         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
13964         cf_header_list="$cf_header_item $cf_header_list"
13965         ;;
13966 esac
13967
13968 for cf_header in $cf_header_list
13969 do
13970         cat >conftest.$ac_ext <<_ACEOF
13971 #line 13971 "configure"
13972 #include "confdefs.h"
13973
13974 #include <${cf_cv_ncurses_header:-curses.h}>
13975 #include <${cf_header}>
13976 int
13977 main ()
13978 {
13979 WINDOW *x
13980   ;
13981   return 0;
13982 }
13983 _ACEOF
13984 rm -f conftest.$ac_objext
13985 if { (eval echo "$as_me:13985: \"$ac_compile\"") >&5
13986   (eval $ac_compile) 2>&5
13987   ac_status=$?
13988   echo "$as_me:13988: \$? = $ac_status" >&5
13989   (exit $ac_status); } &&
13990          { ac_try='test -s conftest.$ac_objext'
13991   { (eval echo "$as_me:13991: \"$ac_try\"") >&5
13992   (eval $ac_try) 2>&5
13993   ac_status=$?
13994   echo "$as_me:13994: \$? = $ac_status" >&5
13995   (exit $ac_status); }; }; then
13996   cf_cv_unctrl_header=$cf_header
13997          break
13998 else
13999   echo "$as_me: failed program was:" >&5
14000 cat conftest.$ac_ext >&5
14001 cf_cv_unctrl_header=no
14002 fi
14003 rm -f conftest.$ac_objext conftest.$ac_ext
14004 done
14005
14006 fi
14007 echo "$as_me:14007: result: $cf_cv_unctrl_header" >&5
14008 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14009
14010 case $cf_cv_unctrl_header in #(vi
14011 no)
14012         { echo "$as_me:14012: WARNING: unctrl.h header not found" >&5
14013 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14014         ;;
14015 esac
14016
14017 case $cf_cv_unctrl_header in #(vi
14018 unctrl.h) #(vi
14019
14020 cat >>confdefs.h <<\EOF
14021 #define HAVE_UNCTRL_H 1
14022 EOF
14023
14024         ;;
14025 ncurses/unctrl.h) #(vi
14026
14027 cat >>confdefs.h <<\EOF
14028 #define HAVE_NCURSES_UNCTRL_H 1
14029 EOF
14030
14031         ;;
14032 ncursesw/unctrl.h)
14033
14034 cat >>confdefs.h <<\EOF
14035 #define HAVE_NCURSESW_UNCTRL_H 1
14036 EOF
14037
14038         ;;
14039 esac
14040
14041 for cf_func in \
14042 assume_default_colors \
14043 chgat \
14044 color_set \
14045 filter \
14046 getbegx \
14047 getcurx \
14048 getmaxx \
14049 getnstr \
14050 getparx \
14051 getwin \
14052 mvvline \
14053 mvwvline \
14054 napms \
14055 putwin \
14056 resize_term \
14057 resizeterm \
14058 ripoffline \
14059 scr_dump \
14060 setupterm \
14061 slk_color \
14062 slk_init \
14063 termattrs \
14064 tgetent \
14065 tigetnum \
14066 tigetstr \
14067 typeahead \
14068 use_default_colors \
14069 use_env \
14070 use_extended_names \
14071 use_screen \
14072 use_window \
14073 vid_puts \
14074 vidputs \
14075 vsscanf \
14076 vw_printw \
14077 wchgat \
14078 winsstr \
14079 wresize \
14080 wsyncdown \
14081
14082 do
14083
14084 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14085
14086         echo "$as_me:14086: checking for ${cf_func}" >&5
14087 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14088
14089 echo "${as_me:-configure}:14089: testing ${cf_func} ..." 1>&5
14090
14091         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14092   echo $ECHO_N "(cached) $ECHO_C" >&6
14093 else
14094
14095                 eval cf_result='$ac_cv_func_'$cf_func
14096                 if test ".$cf_result" != ".no"; then
14097                         cat >conftest.$ac_ext <<_ACEOF
14098 #line 14098 "configure"
14099 #include "confdefs.h"
14100
14101 #ifdef HAVE_XCURSES
14102 #include <xcurses.h>
14103 char * XCursesProgramName = "test";
14104 #else
14105 #include <${cf_cv_ncurses_header:-curses.h}>
14106 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14107 #include <ncursesw/term.h>
14108 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14109 #include <ncurses/term.h>
14110 #elif defined(HAVE_TERM_H)
14111 #include <term.h>
14112 #endif
14113 #endif
14114
14115 int
14116 main ()
14117 {
14118
14119 #ifndef ${cf_func}
14120 long foo = (long)(&${cf_func});
14121 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14122 if (foo + 1234 > 5678)
14123         ${cf_cv_main_return:-return}(foo);
14124 #endif
14125
14126   ;
14127   return 0;
14128 }
14129 _ACEOF
14130 rm -f conftest.$ac_objext conftest$ac_exeext
14131 if { (eval echo "$as_me:14131: \"$ac_link\"") >&5
14132   (eval $ac_link) 2>&5
14133   ac_status=$?
14134   echo "$as_me:14134: \$? = $ac_status" >&5
14135   (exit $ac_status); } &&
14136          { ac_try='test -s conftest$ac_exeext'
14137   { (eval echo "$as_me:14137: \"$ac_try\"") >&5
14138   (eval $ac_try) 2>&5
14139   ac_status=$?
14140   echo "$as_me:14140: \$? = $ac_status" >&5
14141   (exit $ac_status); }; }; then
14142   cf_result=yes
14143 else
14144   echo "$as_me: failed program was:" >&5
14145 cat conftest.$ac_ext >&5
14146 cf_result=no
14147 fi
14148 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14149                 fi
14150                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14151
14152 fi
14153
14154         # use the computed/retrieved cache-value:
14155         eval 'cf_result=$cf_cv_func_'$cf_func
14156         echo "$as_me:14156: result: $cf_result" >&5
14157 echo "${ECHO_T}$cf_result" >&6
14158         if test $cf_result != no; then
14159                 cat >>confdefs.h <<EOF
14160 #define HAVE_${cf_tr_func} 1
14161 EOF
14162
14163         fi
14164 done
14165
14166 for cf_func in tputs
14167 do
14168
14169 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14170
14171         echo "$as_me:14171: checking for ${cf_func}" >&5
14172 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14173
14174 echo "${as_me:-configure}:14174: testing ${cf_func} ..." 1>&5
14175
14176         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14177   echo $ECHO_N "(cached) $ECHO_C" >&6
14178 else
14179
14180                 eval cf_result='$ac_cv_func_'$cf_func
14181                 if test ".$cf_result" != ".no"; then
14182                         cat >conftest.$ac_ext <<_ACEOF
14183 #line 14183 "configure"
14184 #include "confdefs.h"
14185
14186 #ifdef HAVE_XCURSES
14187 #include <xcurses.h>
14188 char * XCursesProgramName = "test";
14189 #else
14190 #include <${cf_cv_ncurses_header:-curses.h}>
14191 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14192 #include <ncursesw/term.h>
14193 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14194 #include <ncurses/term.h>
14195 #elif defined(HAVE_TERM_H)
14196 #include <term.h>
14197 #endif
14198 #endif
14199
14200 int
14201 main ()
14202 {
14203
14204 #ifndef ${cf_func}
14205 long foo = (long)(&${cf_func});
14206 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14207 if (foo + 1234 > 5678)
14208         ${cf_cv_main_return:-return}(foo);
14209 #endif
14210
14211   ;
14212   return 0;
14213 }
14214 _ACEOF
14215 rm -f conftest.$ac_objext conftest$ac_exeext
14216 if { (eval echo "$as_me:14216: \"$ac_link\"") >&5
14217   (eval $ac_link) 2>&5
14218   ac_status=$?
14219   echo "$as_me:14219: \$? = $ac_status" >&5
14220   (exit $ac_status); } &&
14221          { ac_try='test -s conftest$ac_exeext'
14222   { (eval echo "$as_me:14222: \"$ac_try\"") >&5
14223   (eval $ac_try) 2>&5
14224   ac_status=$?
14225   echo "$as_me:14225: \$? = $ac_status" >&5
14226   (exit $ac_status); }; }; then
14227   cf_result=yes
14228 else
14229   echo "$as_me: failed program was:" >&5
14230 cat conftest.$ac_ext >&5
14231 cf_result=no
14232 fi
14233 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14234                 fi
14235                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14236
14237 fi
14238
14239         # use the computed/retrieved cache-value:
14240         eval 'cf_result=$cf_cv_func_'$cf_func
14241         echo "$as_me:14241: result: $cf_result" >&5
14242 echo "${ECHO_T}$cf_result" >&6
14243         if test $cf_result != no; then
14244                 cat >>confdefs.h <<EOF
14245 #define HAVE_${cf_tr_func} 1
14246 EOF
14247
14248         fi
14249 done
14250
14251 if test x$cf_cv_func_tputs = xyes
14252 then
14253         cf_done=no
14254         for cf_arg in int char
14255         do
14256                 for cf_ret in int void
14257                 do
14258                         if test $cf_ret = void
14259                         then
14260                                 cf_return="/* nothing */"
14261                         else
14262                                 cf_return="return value"
14263                         fi
14264                         cat >conftest.$ac_ext <<_ACEOF
14265 #line 14265 "configure"
14266 #include "confdefs.h"
14267
14268 #include <${cf_cv_ncurses_header:-curses.h}>
14269 #include <$cf_cv_term_header>
14270
14271 static $cf_ret outc($cf_arg value) { $cf_return; }
14272
14273 int
14274 main ()
14275 {
14276
14277         tputs("hello", 0, outc);
14278         ${cf_cv_main_return:-return}(0);
14279
14280   ;
14281   return 0;
14282 }
14283 _ACEOF
14284 rm -f conftest.$ac_objext
14285 if { (eval echo "$as_me:14285: \"$ac_compile\"") >&5
14286   (eval $ac_compile) 2>&5
14287   ac_status=$?
14288   echo "$as_me:14288: \$? = $ac_status" >&5
14289   (exit $ac_status); } &&
14290          { ac_try='test -s conftest.$ac_objext'
14291   { (eval echo "$as_me:14291: \"$ac_try\"") >&5
14292   (eval $ac_try) 2>&5
14293   ac_status=$?
14294   echo "$as_me:14294: \$? = $ac_status" >&5
14295   (exit $ac_status); }; }; then
14296
14297                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14298
14299 echo "${as_me:-configure}:14299: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14300
14301                 cat >>confdefs.h <<EOF
14302 #define TPUTS_ARG               $cf_arg
14303 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14304 #define TPUTS_RETURN(value)     $cf_return
14305 EOF
14306                 cf_done=yes
14307                 break
14308
14309 else
14310   echo "$as_me: failed program was:" >&5
14311 cat conftest.$ac_ext >&5
14312 fi
14313 rm -f conftest.$ac_objext conftest.$ac_ext
14314                 done
14315                 test $cf_done = yes && break
14316         done
14317 fi
14318
14319 echo "$as_me:14319: checking for ncurses extended functions" >&5
14320 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14321 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14322   echo $ECHO_N "(cached) $ECHO_C" >&6
14323 else
14324
14325 cat >conftest.$ac_ext <<_ACEOF
14326 #line 14326 "configure"
14327 #include "confdefs.h"
14328
14329 #include <${cf_cv_ncurses_header:-curses.h}>
14330 int
14331 main ()
14332 {
14333
14334 int x = NCURSES_EXT_FUNCS
14335
14336   ;
14337   return 0;
14338 }
14339 _ACEOF
14340 rm -f conftest.$ac_objext
14341 if { (eval echo "$as_me:14341: \"$ac_compile\"") >&5
14342   (eval $ac_compile) 2>&5
14343   ac_status=$?
14344   echo "$as_me:14344: \$? = $ac_status" >&5
14345   (exit $ac_status); } &&
14346          { ac_try='test -s conftest.$ac_objext'
14347   { (eval echo "$as_me:14347: \"$ac_try\"") >&5
14348   (eval $ac_try) 2>&5
14349   ac_status=$?
14350   echo "$as_me:14350: \$? = $ac_status" >&5
14351   (exit $ac_status); }; }; then
14352   cf_cv_ncurses_ext_funcs=defined
14353 else
14354   echo "$as_me: failed program was:" >&5
14355 cat conftest.$ac_ext >&5
14356
14357 cat >conftest.$ac_ext <<_ACEOF
14358 #line 14358 "configure"
14359 #include "confdefs.h"
14360
14361 #include <${cf_cv_ncurses_header:-curses.h}>
14362 int
14363 main ()
14364 {
14365
14366         (void) assume_default_colors (0, 0);
14367         (void) curses_version ();
14368         (void) define_key (0, 0);
14369         (void) is_term_resized (0, 0);
14370         (void) key_defined (0);
14371         (void) keybound (0, 0);
14372         (void) keyok (0, 0);
14373         (void) resize_term (0, 0);
14374         (void) resizeterm (0, 0);
14375         (void) use_default_colors ();
14376         (void) use_extended_names (0);
14377         (void) wresize (0, 0, 0);
14378   ;
14379   return 0;
14380 }
14381 _ACEOF
14382 rm -f conftest.$ac_objext conftest$ac_exeext
14383 if { (eval echo "$as_me:14383: \"$ac_link\"") >&5
14384   (eval $ac_link) 2>&5
14385   ac_status=$?
14386   echo "$as_me:14386: \$? = $ac_status" >&5
14387   (exit $ac_status); } &&
14388          { ac_try='test -s conftest$ac_exeext'
14389   { (eval echo "$as_me:14389: \"$ac_try\"") >&5
14390   (eval $ac_try) 2>&5
14391   ac_status=$?
14392   echo "$as_me:14392: \$? = $ac_status" >&5
14393   (exit $ac_status); }; }; then
14394   cf_cv_ncurses_ext_funcs=yes
14395 else
14396   echo "$as_me: failed program was:" >&5
14397 cat conftest.$ac_ext >&5
14398 cf_cv_ncurses_ext_funcs=no
14399 fi
14400 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14401
14402 fi
14403 rm -f conftest.$ac_objext conftest.$ac_ext
14404
14405 fi
14406 echo "$as_me:14406: result: $cf_cv_ncurses_ext_funcs" >&5
14407 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14408 test "$cf_cv_ncurses_ext_funcs" = yes &&
14409 cat >>confdefs.h <<\EOF
14410 #define NCURSES_EXT_FUNCS 1
14411 EOF
14412
14413 if test "$cf_enable_widec" = yes
14414 then
14415         # workaround for systems with ncurses before 20111029, due to change of
14416         # feature test macro from _XPG5 to _XOPEN_SOURCE
14417         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14418         then
14419                 cf_define_xpg5=no
14420                 echo "$as_me:14420: checking if _XPG5 should be defined to enable wide-characters" >&5
14421 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14422
14423                 cat >conftest.$ac_ext <<_ACEOF
14424 #line 14424 "configure"
14425 #include "confdefs.h"
14426
14427 #include <${cf_cv_ncurses_header:-curses.h}>
14428 int
14429 main ()
14430 {
14431 int x = _XPG5
14432   ;
14433   return 0;
14434 }
14435 _ACEOF
14436 rm -f conftest.$ac_objext
14437 if { (eval echo "$as_me:14437: \"$ac_compile\"") >&5
14438   (eval $ac_compile) 2>&5
14439   ac_status=$?
14440   echo "$as_me:14440: \$? = $ac_status" >&5
14441   (exit $ac_status); } &&
14442          { ac_try='test -s conftest.$ac_objext'
14443   { (eval echo "$as_me:14443: \"$ac_try\"") >&5
14444   (eval $ac_try) 2>&5
14445   ac_status=$?
14446   echo "$as_me:14446: \$? = $ac_status" >&5
14447   (exit $ac_status); }; }; then
14448   :
14449 else
14450   echo "$as_me: failed program was:" >&5
14451 cat conftest.$ac_ext >&5
14452 cf_save_cppflags="$CPPFLAGS"
14453                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14454                          cat >conftest.$ac_ext <<_ACEOF
14455 #line 14455 "configure"
14456 #include "confdefs.h"
14457
14458 #include <${cf_cv_ncurses_header:-curses.h}>
14459 int
14460 main ()
14461 {
14462 int x = _XPG5
14463   ;
14464   return 0;
14465 }
14466 _ACEOF
14467 rm -f conftest.$ac_objext
14468 if { (eval echo "$as_me:14468: \"$ac_compile\"") >&5
14469   (eval $ac_compile) 2>&5
14470   ac_status=$?
14471   echo "$as_me:14471: \$? = $ac_status" >&5
14472   (exit $ac_status); } &&
14473          { ac_try='test -s conftest.$ac_objext'
14474   { (eval echo "$as_me:14474: \"$ac_try\"") >&5
14475   (eval $ac_try) 2>&5
14476   ac_status=$?
14477   echo "$as_me:14477: \$? = $ac_status" >&5
14478   (exit $ac_status); }; }; then
14479   cf_define_xpg5=yes
14480 else
14481   echo "$as_me: failed program was:" >&5
14482 cat conftest.$ac_ext >&5
14483 fi
14484 rm -f conftest.$ac_objext conftest.$ac_ext
14485                          CPPFLAGS="$cf_save_cppflags"
14486 fi
14487 rm -f conftest.$ac_objext conftest.$ac_ext
14488                 echo "$as_me:14488: result: $cf_define_xpg5" >&5
14489 echo "${ECHO_T}$cf_define_xpg5" >&6
14490
14491                 if test "$cf_define_xpg5" = yes
14492                 then
14493                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14494                 fi
14495         fi
14496
14497         echo "$as_me:14497: checking for wide-character functions" >&5
14498 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14499 if test "${cf_cv_widechar_funcs+set}" = set; then
14500   echo $ECHO_N "(cached) $ECHO_C" >&6
14501 else
14502
14503         cat >conftest.$ac_ext <<_ACEOF
14504 #line 14504 "configure"
14505 #include "confdefs.h"
14506
14507 #include <${cf_cv_ncurses_header:-curses.h}>
14508 int
14509 main ()
14510 {
14511
14512                 static wchar_t src_wchar[2];
14513                 static cchar_t dst_cchar;
14514                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
14515
14516   ;
14517   return 0;
14518 }
14519 _ACEOF
14520 rm -f conftest.$ac_objext conftest$ac_exeext
14521 if { (eval echo "$as_me:14521: \"$ac_link\"") >&5
14522   (eval $ac_link) 2>&5
14523   ac_status=$?
14524   echo "$as_me:14524: \$? = $ac_status" >&5
14525   (exit $ac_status); } &&
14526          { ac_try='test -s conftest$ac_exeext'
14527   { (eval echo "$as_me:14527: \"$ac_try\"") >&5
14528   (eval $ac_try) 2>&5
14529   ac_status=$?
14530   echo "$as_me:14530: \$? = $ac_status" >&5
14531   (exit $ac_status); }; }; then
14532   cf_cv_widechar_funcs=yes
14533 else
14534   echo "$as_me: failed program was:" >&5
14535 cat conftest.$ac_ext >&5
14536 cf_cv_widechar_funcs=no
14537 fi
14538 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14539
14540 fi
14541 echo "$as_me:14541: result: $cf_cv_widechar_funcs" >&5
14542 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
14543         if test "$cf_cv_widechar_funcs" != no ; then
14544
14545 cat >>confdefs.h <<\EOF
14546 #define USE_WIDEC_SUPPORT 1
14547 EOF
14548
14549         else
14550                 cat >>confdefs.h <<\EOF
14551 #define USE_WIDEC_SUPPORT 0
14552 EOF
14553
14554         fi
14555 else
14556         cat >>confdefs.h <<\EOF
14557 #define USE_WIDEC_SUPPORT 0
14558 EOF
14559
14560 fi
14561
14562 echo "$as_me:14562: checking if sys/time.h works with sys/select.h" >&5
14563 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
14564 if test "${cf_cv_sys_time_select+set}" = set; then
14565   echo $ECHO_N "(cached) $ECHO_C" >&6
14566 else
14567
14568 cat >conftest.$ac_ext <<_ACEOF
14569 #line 14569 "configure"
14570 #include "confdefs.h"
14571
14572 #include <sys/types.h>
14573 #ifdef HAVE_SYS_TIME_H
14574 #include <sys/time.h>
14575 #endif
14576 #ifdef HAVE_SYS_SELECT_H
14577 #include <sys/select.h>
14578 #endif
14579
14580 int
14581 main ()
14582 {
14583
14584   ;
14585   return 0;
14586 }
14587 _ACEOF
14588 rm -f conftest.$ac_objext
14589 if { (eval echo "$as_me:14589: \"$ac_compile\"") >&5
14590   (eval $ac_compile) 2>&5
14591   ac_status=$?
14592   echo "$as_me:14592: \$? = $ac_status" >&5
14593   (exit $ac_status); } &&
14594          { ac_try='test -s conftest.$ac_objext'
14595   { (eval echo "$as_me:14595: \"$ac_try\"") >&5
14596   (eval $ac_try) 2>&5
14597   ac_status=$?
14598   echo "$as_me:14598: \$? = $ac_status" >&5
14599   (exit $ac_status); }; }; then
14600   cf_cv_sys_time_select=yes
14601 else
14602   echo "$as_me: failed program was:" >&5
14603 cat conftest.$ac_ext >&5
14604 cf_cv_sys_time_select=no
14605 fi
14606 rm -f conftest.$ac_objext conftest.$ac_ext
14607
14608 fi
14609
14610 echo "$as_me:14610: result: $cf_cv_sys_time_select" >&5
14611 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
14612 test "$cf_cv_sys_time_select" = yes &&
14613 cat >>confdefs.h <<\EOF
14614 #define HAVE_SYS_TIME_SELECT 1
14615 EOF
14616
14617 echo "$as_me:14617: checking for function curses_version" >&5
14618 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
14619 if test "${cf_cv_func_curses_version+set}" = set; then
14620   echo $ECHO_N "(cached) $ECHO_C" >&6
14621 else
14622
14623 if test "$cross_compiling" = yes; then
14624   cf_cv_func_curses_version=unknown
14625 else
14626   cat >conftest.$ac_ext <<_ACEOF
14627 #line 14627 "configure"
14628 #include "confdefs.h"
14629
14630 #include <${cf_cv_ncurses_header:-curses.h}>
14631 int main()
14632 {
14633         char temp[1024];
14634         sprintf(temp, "%s\n", curses_version());
14635         ${cf_cv_main_return:-return}(0);
14636 }
14637
14638 _ACEOF
14639 rm -f conftest$ac_exeext
14640 if { (eval echo "$as_me:14640: \"$ac_link\"") >&5
14641   (eval $ac_link) 2>&5
14642   ac_status=$?
14643   echo "$as_me:14643: \$? = $ac_status" >&5
14644   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14645   { (eval echo "$as_me:14645: \"$ac_try\"") >&5
14646   (eval $ac_try) 2>&5
14647   ac_status=$?
14648   echo "$as_me:14648: \$? = $ac_status" >&5
14649   (exit $ac_status); }; }; then
14650   cf_cv_func_curses_version=yes
14651
14652 else
14653   echo "$as_me: program exited with status $ac_status" >&5
14654 echo "$as_me: failed program was:" >&5
14655 cat conftest.$ac_ext >&5
14656 cf_cv_func_curses_version=no
14657
14658 fi
14659 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14660 fi
14661 rm -f core
14662 fi
14663 echo "$as_me:14663: result: $cf_cv_func_curses_version" >&5
14664 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
14665 test "$cf_cv_func_curses_version" = yes &&
14666 cat >>confdefs.h <<\EOF
14667 #define HAVE_CURSES_VERSION 1
14668 EOF
14669
14670 echo "$as_me:14670: checking for alternate character set array" >&5
14671 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
14672 if test "${cf_cv_curses_acs_map+set}" = set; then
14673   echo $ECHO_N "(cached) $ECHO_C" >&6
14674 else
14675
14676 cf_cv_curses_acs_map=unknown
14677 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
14678 do
14679 cat >conftest.$ac_ext <<_ACEOF
14680 #line 14680 "configure"
14681 #include "confdefs.h"
14682
14683 #include <${cf_cv_ncurses_header:-curses.h}>
14684
14685 int
14686 main ()
14687 {
14688
14689 $name['k'] = ACS_PLUS
14690
14691   ;
14692   return 0;
14693 }
14694 _ACEOF
14695 rm -f conftest.$ac_objext conftest$ac_exeext
14696 if { (eval echo "$as_me:14696: \"$ac_link\"") >&5
14697   (eval $ac_link) 2>&5
14698   ac_status=$?
14699   echo "$as_me:14699: \$? = $ac_status" >&5
14700   (exit $ac_status); } &&
14701          { ac_try='test -s conftest$ac_exeext'
14702   { (eval echo "$as_me:14702: \"$ac_try\"") >&5
14703   (eval $ac_try) 2>&5
14704   ac_status=$?
14705   echo "$as_me:14705: \$? = $ac_status" >&5
14706   (exit $ac_status); }; }; then
14707   cf_cv_curses_acs_map=$name; break
14708 else
14709   echo "$as_me: failed program was:" >&5
14710 cat conftest.$ac_ext >&5
14711 fi
14712 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14713 done
14714
14715 fi
14716 echo "$as_me:14716: result: $cf_cv_curses_acs_map" >&5
14717 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
14718
14719 test "$cf_cv_curses_acs_map" != unknown &&
14720 cat >>confdefs.h <<EOF
14721 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
14722 EOF
14723
14724 if test "$cf_enable_widec" = yes; then
14725
14726 echo "$as_me:14726: checking for wide alternate character set array" >&5
14727 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
14728 if test "${cf_cv_curses_wacs_map+set}" = set; then
14729   echo $ECHO_N "(cached) $ECHO_C" >&6
14730 else
14731
14732         cf_cv_curses_wacs_map=unknown
14733         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
14734         do
14735         cat >conftest.$ac_ext <<_ACEOF
14736 #line 14736 "configure"
14737 #include "confdefs.h"
14738
14739 #ifndef _XOPEN_SOURCE_EXTENDED
14740 #define _XOPEN_SOURCE_EXTENDED
14741 #endif
14742 #include <${cf_cv_ncurses_header:-curses.h}>
14743 int
14744 main ()
14745 {
14746 void *foo = &($name['k'])
14747   ;
14748   return 0;
14749 }
14750 _ACEOF
14751 rm -f conftest.$ac_objext conftest$ac_exeext
14752 if { (eval echo "$as_me:14752: \"$ac_link\"") >&5
14753   (eval $ac_link) 2>&5
14754   ac_status=$?
14755   echo "$as_me:14755: \$? = $ac_status" >&5
14756   (exit $ac_status); } &&
14757          { ac_try='test -s conftest$ac_exeext'
14758   { (eval echo "$as_me:14758: \"$ac_try\"") >&5
14759   (eval $ac_try) 2>&5
14760   ac_status=$?
14761   echo "$as_me:14761: \$? = $ac_status" >&5
14762   (exit $ac_status); }; }; then
14763   cf_cv_curses_wacs_map=$name
14764          break
14765 else
14766   echo "$as_me: failed program was:" >&5
14767 cat conftest.$ac_ext >&5
14768 fi
14769 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14770         done
14771 fi
14772 echo "$as_me:14772: result: $cf_cv_curses_wacs_map" >&5
14773 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
14774
14775 test "$cf_cv_curses_wacs_map" != unknown &&
14776 cat >>confdefs.h <<EOF
14777 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
14778 EOF
14779
14780 echo "$as_me:14780: checking for wide alternate character constants" >&5
14781 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
14782 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
14783   echo $ECHO_N "(cached) $ECHO_C" >&6
14784 else
14785
14786 cf_cv_curses_wacs_symbols=no
14787 if test "$cf_cv_curses_wacs_map" != unknown
14788 then
14789         cat >conftest.$ac_ext <<_ACEOF
14790 #line 14790 "configure"
14791 #include "confdefs.h"
14792
14793 #ifndef _XOPEN_SOURCE_EXTENDED
14794 #define _XOPEN_SOURCE_EXTENDED
14795 #endif
14796 #include <${cf_cv_ncurses_header:-curses.h}>
14797 int
14798 main ()
14799 {
14800 cchar_t *foo = WACS_PLUS;
14801          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
14802   ;
14803   return 0;
14804 }
14805 _ACEOF
14806 rm -f conftest.$ac_objext conftest$ac_exeext
14807 if { (eval echo "$as_me:14807: \"$ac_link\"") >&5
14808   (eval $ac_link) 2>&5
14809   ac_status=$?
14810   echo "$as_me:14810: \$? = $ac_status" >&5
14811   (exit $ac_status); } &&
14812          { ac_try='test -s conftest$ac_exeext'
14813   { (eval echo "$as_me:14813: \"$ac_try\"") >&5
14814   (eval $ac_try) 2>&5
14815   ac_status=$?
14816   echo "$as_me:14816: \$? = $ac_status" >&5
14817   (exit $ac_status); }; }; then
14818   cf_cv_curses_wacs_symbols=yes
14819 else
14820   echo "$as_me: failed program was:" >&5
14821 cat conftest.$ac_ext >&5
14822 fi
14823 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14824 else
14825         cat >conftest.$ac_ext <<_ACEOF
14826 #line 14826 "configure"
14827 #include "confdefs.h"
14828
14829 #ifndef _XOPEN_SOURCE_EXTENDED
14830 #define _XOPEN_SOURCE_EXTENDED
14831 #endif
14832 #include <${cf_cv_ncurses_header:-curses.h}>
14833 int
14834 main ()
14835 {
14836 cchar_t *foo = WACS_PLUS
14837   ;
14838   return 0;
14839 }
14840 _ACEOF
14841 rm -f conftest.$ac_objext conftest$ac_exeext
14842 if { (eval echo "$as_me:14842: \"$ac_link\"") >&5
14843   (eval $ac_link) 2>&5
14844   ac_status=$?
14845   echo "$as_me:14845: \$? = $ac_status" >&5
14846   (exit $ac_status); } &&
14847          { ac_try='test -s conftest$ac_exeext'
14848   { (eval echo "$as_me:14848: \"$ac_try\"") >&5
14849   (eval $ac_try) 2>&5
14850   ac_status=$?
14851   echo "$as_me:14851: \$? = $ac_status" >&5
14852   (exit $ac_status); }; }; then
14853   cf_cv_curses_wacs_symbols=yes
14854 else
14855   echo "$as_me: failed program was:" >&5
14856 cat conftest.$ac_ext >&5
14857 fi
14858 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14859 fi
14860
14861 fi
14862 echo "$as_me:14862: result: $cf_cv_curses_wacs_symbols" >&5
14863 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
14864
14865 test "$cf_cv_curses_wacs_symbols" != no &&
14866 cat >>confdefs.h <<\EOF
14867 #define CURSES_WACS_SYMBOLS 1
14868 EOF
14869
14870 fi
14871
14872 echo "$as_me:14872: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14873 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14874 cat >conftest.$ac_ext <<_ACEOF
14875 #line 14875 "configure"
14876 #include "confdefs.h"
14877
14878 #ifndef _XOPEN_SOURCE_EXTENDED
14879 #define _XOPEN_SOURCE_EXTENDED
14880 #endif
14881 #include <${cf_cv_ncurses_header:-curses.h}>
14882 int
14883 main ()
14884 {
14885
14886 attr_t foo
14887
14888   ;
14889   return 0;
14890 }
14891 _ACEOF
14892 rm -f conftest.$ac_objext
14893 if { (eval echo "$as_me:14893: \"$ac_compile\"") >&5
14894   (eval $ac_compile) 2>&5
14895   ac_status=$?
14896   echo "$as_me:14896: \$? = $ac_status" >&5
14897   (exit $ac_status); } &&
14898          { ac_try='test -s conftest.$ac_objext'
14899   { (eval echo "$as_me:14899: \"$ac_try\"") >&5
14900   (eval $ac_try) 2>&5
14901   ac_status=$?
14902   echo "$as_me:14902: \$? = $ac_status" >&5
14903   (exit $ac_status); }; }; then
14904   cf_result=yes
14905 else
14906   echo "$as_me: failed program was:" >&5
14907 cat conftest.$ac_ext >&5
14908 cf_result=no
14909 fi
14910 rm -f conftest.$ac_objext conftest.$ac_ext
14911 echo "$as_me:14911: result: $cf_result" >&5
14912 echo "${ECHO_T}$cf_result" >&6
14913 if test $cf_result = yes ; then
14914
14915 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14916
14917 cat >>confdefs.h <<EOF
14918 #define $cf_result 1
14919 EOF
14920
14921 else
14922
14923 cat >>confdefs.h <<EOF
14924 #define attr_t long
14925 EOF
14926
14927 fi
14928
14929 if test "$cf_enable_widec" = yes; then
14930
14931 # This is needed on Tru64 5.0 to declare mbstate_t
14932 echo "$as_me:14932: checking if we must include wchar.h to declare mbstate_t" >&5
14933 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
14934 if test "${cf_cv_mbstate_t+set}" = set; then
14935   echo $ECHO_N "(cached) $ECHO_C" >&6
14936 else
14937
14938 cat >conftest.$ac_ext <<_ACEOF
14939 #line 14939 "configure"
14940 #include "confdefs.h"
14941
14942 #include <stdlib.h>
14943 #include <stdarg.h>
14944 #include <stdio.h>
14945 #ifdef HAVE_LIBUTF8_H
14946 #include <libutf8.h>
14947 #endif
14948 int
14949 main ()
14950 {
14951 mbstate_t state
14952   ;
14953   return 0;
14954 }
14955 _ACEOF
14956 rm -f conftest.$ac_objext
14957 if { (eval echo "$as_me:14957: \"$ac_compile\"") >&5
14958   (eval $ac_compile) 2>&5
14959   ac_status=$?
14960   echo "$as_me:14960: \$? = $ac_status" >&5
14961   (exit $ac_status); } &&
14962          { ac_try='test -s conftest.$ac_objext'
14963   { (eval echo "$as_me:14963: \"$ac_try\"") >&5
14964   (eval $ac_try) 2>&5
14965   ac_status=$?
14966   echo "$as_me:14966: \$? = $ac_status" >&5
14967   (exit $ac_status); }; }; then
14968   cf_cv_mbstate_t=no
14969 else
14970   echo "$as_me: failed program was:" >&5
14971 cat conftest.$ac_ext >&5
14972 cat >conftest.$ac_ext <<_ACEOF
14973 #line 14973 "configure"
14974 #include "confdefs.h"
14975
14976 #include <stdlib.h>
14977 #include <stdarg.h>
14978 #include <stdio.h>
14979 #include <wchar.h>
14980 #ifdef HAVE_LIBUTF8_H
14981 #include <libutf8.h>
14982 #endif
14983 int
14984 main ()
14985 {
14986 mbstate_t value
14987   ;
14988   return 0;
14989 }
14990 _ACEOF
14991 rm -f conftest.$ac_objext
14992 if { (eval echo "$as_me:14992: \"$ac_compile\"") >&5
14993   (eval $ac_compile) 2>&5
14994   ac_status=$?
14995   echo "$as_me:14995: \$? = $ac_status" >&5
14996   (exit $ac_status); } &&
14997          { ac_try='test -s conftest.$ac_objext'
14998   { (eval echo "$as_me:14998: \"$ac_try\"") >&5
14999   (eval $ac_try) 2>&5
15000   ac_status=$?
15001   echo "$as_me:15001: \$? = $ac_status" >&5
15002   (exit $ac_status); }; }; then
15003   cf_cv_mbstate_t=yes
15004 else
15005   echo "$as_me: failed program was:" >&5
15006 cat conftest.$ac_ext >&5
15007 cf_cv_mbstate_t=unknown
15008 fi
15009 rm -f conftest.$ac_objext conftest.$ac_ext
15010 fi
15011 rm -f conftest.$ac_objext conftest.$ac_ext
15012 fi
15013 echo "$as_me:15013: result: $cf_cv_mbstate_t" >&5
15014 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15015
15016 if test "$cf_cv_mbstate_t" = yes ; then
15017
15018 cat >>confdefs.h <<\EOF
15019 #define NEED_WCHAR_H 1
15020 EOF
15021
15022         NEED_WCHAR_H=1
15023 fi
15024
15025 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15026 if test "$cf_cv_mbstate_t" = unknown ; then
15027         NCURSES_MBSTATE_T=1
15028 fi
15029
15030 # if we find mbstate_t in either place, use substitution to provide a fallback.
15031 if test "$cf_cv_mbstate_t" != unknown ; then
15032         NCURSES_OK_MBSTATE_T=1
15033 fi
15034
15035 # This is needed on Tru64 5.0 to declare wchar_t
15036 echo "$as_me:15036: checking if we must include wchar.h to declare wchar_t" >&5
15037 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15038 if test "${cf_cv_wchar_t+set}" = set; then
15039   echo $ECHO_N "(cached) $ECHO_C" >&6
15040 else
15041
15042 cat >conftest.$ac_ext <<_ACEOF
15043 #line 15043 "configure"
15044 #include "confdefs.h"
15045
15046 #include <stdlib.h>
15047 #include <stdarg.h>
15048 #include <stdio.h>
15049 #ifdef HAVE_LIBUTF8_H
15050 #include <libutf8.h>
15051 #endif
15052 int
15053 main ()
15054 {
15055 wchar_t state
15056   ;
15057   return 0;
15058 }
15059 _ACEOF
15060 rm -f conftest.$ac_objext
15061 if { (eval echo "$as_me:15061: \"$ac_compile\"") >&5
15062   (eval $ac_compile) 2>&5
15063   ac_status=$?
15064   echo "$as_me:15064: \$? = $ac_status" >&5
15065   (exit $ac_status); } &&
15066          { ac_try='test -s conftest.$ac_objext'
15067   { (eval echo "$as_me:15067: \"$ac_try\"") >&5
15068   (eval $ac_try) 2>&5
15069   ac_status=$?
15070   echo "$as_me:15070: \$? = $ac_status" >&5
15071   (exit $ac_status); }; }; then
15072   cf_cv_wchar_t=no
15073 else
15074   echo "$as_me: failed program was:" >&5
15075 cat conftest.$ac_ext >&5
15076 cat >conftest.$ac_ext <<_ACEOF
15077 #line 15077 "configure"
15078 #include "confdefs.h"
15079
15080 #include <stdlib.h>
15081 #include <stdarg.h>
15082 #include <stdio.h>
15083 #include <wchar.h>
15084 #ifdef HAVE_LIBUTF8_H
15085 #include <libutf8.h>
15086 #endif
15087 int
15088 main ()
15089 {
15090 wchar_t value
15091   ;
15092   return 0;
15093 }
15094 _ACEOF
15095 rm -f conftest.$ac_objext
15096 if { (eval echo "$as_me:15096: \"$ac_compile\"") >&5
15097   (eval $ac_compile) 2>&5
15098   ac_status=$?
15099   echo "$as_me:15099: \$? = $ac_status" >&5
15100   (exit $ac_status); } &&
15101          { ac_try='test -s conftest.$ac_objext'
15102   { (eval echo "$as_me:15102: \"$ac_try\"") >&5
15103   (eval $ac_try) 2>&5
15104   ac_status=$?
15105   echo "$as_me:15105: \$? = $ac_status" >&5
15106   (exit $ac_status); }; }; then
15107   cf_cv_wchar_t=yes
15108 else
15109   echo "$as_me: failed program was:" >&5
15110 cat conftest.$ac_ext >&5
15111 cf_cv_wchar_t=unknown
15112 fi
15113 rm -f conftest.$ac_objext conftest.$ac_ext
15114 fi
15115 rm -f conftest.$ac_objext conftest.$ac_ext
15116 fi
15117 echo "$as_me:15117: result: $cf_cv_wchar_t" >&5
15118 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15119
15120 if test "$cf_cv_wchar_t" = yes ; then
15121
15122 cat >>confdefs.h <<\EOF
15123 #define NEED_WCHAR_H 1
15124 EOF
15125
15126         NEED_WCHAR_H=1
15127 fi
15128
15129 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15130 if test "$cf_cv_wchar_t" = unknown ; then
15131         NCURSES_WCHAR_T=1
15132 fi
15133
15134 # if we find wchar_t in either place, use substitution to provide a fallback.
15135 if test "$cf_cv_wchar_t" != unknown ; then
15136         NCURSES_OK_WCHAR_T=1
15137 fi
15138
15139 # This is needed on Tru64 5.0 to declare wint_t
15140 echo "$as_me:15140: checking if we must include wchar.h to declare wint_t" >&5
15141 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15142 if test "${cf_cv_wint_t+set}" = set; then
15143   echo $ECHO_N "(cached) $ECHO_C" >&6
15144 else
15145
15146 cat >conftest.$ac_ext <<_ACEOF
15147 #line 15147 "configure"
15148 #include "confdefs.h"
15149
15150 #include <stdlib.h>
15151 #include <stdarg.h>
15152 #include <stdio.h>
15153 #ifdef HAVE_LIBUTF8_H
15154 #include <libutf8.h>
15155 #endif
15156 int
15157 main ()
15158 {
15159 wint_t state
15160   ;
15161   return 0;
15162 }
15163 _ACEOF
15164 rm -f conftest.$ac_objext
15165 if { (eval echo "$as_me:15165: \"$ac_compile\"") >&5
15166   (eval $ac_compile) 2>&5
15167   ac_status=$?
15168   echo "$as_me:15168: \$? = $ac_status" >&5
15169   (exit $ac_status); } &&
15170          { ac_try='test -s conftest.$ac_objext'
15171   { (eval echo "$as_me:15171: \"$ac_try\"") >&5
15172   (eval $ac_try) 2>&5
15173   ac_status=$?
15174   echo "$as_me:15174: \$? = $ac_status" >&5
15175   (exit $ac_status); }; }; then
15176   cf_cv_wint_t=no
15177 else
15178   echo "$as_me: failed program was:" >&5
15179 cat conftest.$ac_ext >&5
15180 cat >conftest.$ac_ext <<_ACEOF
15181 #line 15181 "configure"
15182 #include "confdefs.h"
15183
15184 #include <stdlib.h>
15185 #include <stdarg.h>
15186 #include <stdio.h>
15187 #include <wchar.h>
15188 #ifdef HAVE_LIBUTF8_H
15189 #include <libutf8.h>
15190 #endif
15191 int
15192 main ()
15193 {
15194 wint_t value
15195   ;
15196   return 0;
15197 }
15198 _ACEOF
15199 rm -f conftest.$ac_objext
15200 if { (eval echo "$as_me:15200: \"$ac_compile\"") >&5
15201   (eval $ac_compile) 2>&5
15202   ac_status=$?
15203   echo "$as_me:15203: \$? = $ac_status" >&5
15204   (exit $ac_status); } &&
15205          { ac_try='test -s conftest.$ac_objext'
15206   { (eval echo "$as_me:15206: \"$ac_try\"") >&5
15207   (eval $ac_try) 2>&5
15208   ac_status=$?
15209   echo "$as_me:15209: \$? = $ac_status" >&5
15210   (exit $ac_status); }; }; then
15211   cf_cv_wint_t=yes
15212 else
15213   echo "$as_me: failed program was:" >&5
15214 cat conftest.$ac_ext >&5
15215 cf_cv_wint_t=unknown
15216 fi
15217 rm -f conftest.$ac_objext conftest.$ac_ext
15218 fi
15219 rm -f conftest.$ac_objext conftest.$ac_ext
15220 fi
15221 echo "$as_me:15221: result: $cf_cv_wint_t" >&5
15222 echo "${ECHO_T}$cf_cv_wint_t" >&6
15223
15224 if test "$cf_cv_wint_t" = yes ; then
15225
15226 cat >>confdefs.h <<\EOF
15227 #define NEED_WCHAR_H 1
15228 EOF
15229
15230         NEED_WCHAR_H=1
15231 fi
15232
15233 # if we do not find wint_t in either place, use substitution to provide a fallback.
15234 if test "$cf_cv_wint_t" = unknown ; then
15235         NCURSES_WINT_T=1
15236 fi
15237
15238 # if we find wint_t in either place, use substitution to provide a fallback.
15239 if test "$cf_cv_wint_t" != unknown ; then
15240         NCURSES_OK_WINT_T=1
15241 fi
15242
15243         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15244
15245 echo "$as_me:15245: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15246 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15247 cat >conftest.$ac_ext <<_ACEOF
15248 #line 15248 "configure"
15249 #include "confdefs.h"
15250
15251 #ifndef _XOPEN_SOURCE_EXTENDED
15252 #define _XOPEN_SOURCE_EXTENDED
15253 #endif
15254 #include <${cf_cv_ncurses_header:-curses.h}>
15255 int
15256 main ()
15257 {
15258
15259 mbstate_t foo
15260
15261   ;
15262   return 0;
15263 }
15264 _ACEOF
15265 rm -f conftest.$ac_objext
15266 if { (eval echo "$as_me:15266: \"$ac_compile\"") >&5
15267   (eval $ac_compile) 2>&5
15268   ac_status=$?
15269   echo "$as_me:15269: \$? = $ac_status" >&5
15270   (exit $ac_status); } &&
15271          { ac_try='test -s conftest.$ac_objext'
15272   { (eval echo "$as_me:15272: \"$ac_try\"") >&5
15273   (eval $ac_try) 2>&5
15274   ac_status=$?
15275   echo "$as_me:15275: \$? = $ac_status" >&5
15276   (exit $ac_status); }; }; then
15277   cf_result=yes
15278 else
15279   echo "$as_me: failed program was:" >&5
15280 cat conftest.$ac_ext >&5
15281 cf_result=no
15282 fi
15283 rm -f conftest.$ac_objext conftest.$ac_ext
15284 echo "$as_me:15284: result: $cf_result" >&5
15285 echo "${ECHO_T}$cf_result" >&6
15286 if test $cf_result = yes ; then
15287
15288 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15289
15290 cat >>confdefs.h <<EOF
15291 #define $cf_result 1
15292 EOF
15293
15294 else
15295
15296 cat >>confdefs.h <<EOF
15297 #define mbstate_t long
15298 EOF
15299
15300 fi
15301
15302         fi
15303
15304         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
15305
15306 echo "$as_me:15306: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15307 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15308 cat >conftest.$ac_ext <<_ACEOF
15309 #line 15309 "configure"
15310 #include "confdefs.h"
15311
15312 #ifndef _XOPEN_SOURCE_EXTENDED
15313 #define _XOPEN_SOURCE_EXTENDED
15314 #endif
15315 #include <${cf_cv_ncurses_header:-curses.h}>
15316 int
15317 main ()
15318 {
15319
15320 wchar_t foo
15321
15322   ;
15323   return 0;
15324 }
15325 _ACEOF
15326 rm -f conftest.$ac_objext
15327 if { (eval echo "$as_me:15327: \"$ac_compile\"") >&5
15328   (eval $ac_compile) 2>&5
15329   ac_status=$?
15330   echo "$as_me:15330: \$? = $ac_status" >&5
15331   (exit $ac_status); } &&
15332          { ac_try='test -s conftest.$ac_objext'
15333   { (eval echo "$as_me:15333: \"$ac_try\"") >&5
15334   (eval $ac_try) 2>&5
15335   ac_status=$?
15336   echo "$as_me:15336: \$? = $ac_status" >&5
15337   (exit $ac_status); }; }; then
15338   cf_result=yes
15339 else
15340   echo "$as_me: failed program was:" >&5
15341 cat conftest.$ac_ext >&5
15342 cf_result=no
15343 fi
15344 rm -f conftest.$ac_objext conftest.$ac_ext
15345 echo "$as_me:15345: result: $cf_result" >&5
15346 echo "${ECHO_T}$cf_result" >&6
15347 if test $cf_result = yes ; then
15348
15349 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15350
15351 cat >>confdefs.h <<EOF
15352 #define $cf_result 1
15353 EOF
15354
15355 else
15356
15357 cat >>confdefs.h <<EOF
15358 #define wchar_t long
15359 EOF
15360
15361 fi
15362
15363         fi
15364
15365         if test "$NCURSES_OK_WINT_T" = 0 ; then
15366
15367 echo "$as_me:15367: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15368 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15369 cat >conftest.$ac_ext <<_ACEOF
15370 #line 15370 "configure"
15371 #include "confdefs.h"
15372
15373 #ifndef _XOPEN_SOURCE_EXTENDED
15374 #define _XOPEN_SOURCE_EXTENDED
15375 #endif
15376 #include <${cf_cv_ncurses_header:-curses.h}>
15377 int
15378 main ()
15379 {
15380
15381 wint_t foo
15382
15383   ;
15384   return 0;
15385 }
15386 _ACEOF
15387 rm -f conftest.$ac_objext
15388 if { (eval echo "$as_me:15388: \"$ac_compile\"") >&5
15389   (eval $ac_compile) 2>&5
15390   ac_status=$?
15391   echo "$as_me:15391: \$? = $ac_status" >&5
15392   (exit $ac_status); } &&
15393          { ac_try='test -s conftest.$ac_objext'
15394   { (eval echo "$as_me:15394: \"$ac_try\"") >&5
15395   (eval $ac_try) 2>&5
15396   ac_status=$?
15397   echo "$as_me:15397: \$? = $ac_status" >&5
15398   (exit $ac_status); }; }; then
15399   cf_result=yes
15400 else
15401   echo "$as_me: failed program was:" >&5
15402 cat conftest.$ac_ext >&5
15403 cf_result=no
15404 fi
15405 rm -f conftest.$ac_objext conftest.$ac_ext
15406 echo "$as_me:15406: result: $cf_result" >&5
15407 echo "${ECHO_T}$cf_result" >&6
15408 if test $cf_result = yes ; then
15409
15410 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15411
15412 cat >>confdefs.h <<EOF
15413 #define $cf_result 1
15414 EOF
15415
15416 else
15417
15418 cat >>confdefs.h <<EOF
15419 #define wint_t long
15420 EOF
15421
15422 fi
15423
15424         fi
15425 fi
15426
15427 echo "$as_me:15427: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15428 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15429
15430 cat >conftest.$ac_ext <<_ACEOF
15431 #line 15431 "configure"
15432 #include "confdefs.h"
15433
15434 #ifdef HAVE_XCURSES
15435 #include <xcurses.h>
15436 char * XCursesProgramName = "test";
15437 #else
15438 #include <${cf_cv_ncurses_header:-curses.h}>
15439 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15440 #include <ncursesw/term.h>
15441 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15442 #include <ncurses/term.h>
15443 #elif defined(HAVE_TERM_H)
15444 #include <term.h>
15445 #endif
15446 #endif
15447
15448 int
15449 main ()
15450 {
15451
15452 void *foo = &(boolnames)
15453
15454   ;
15455   return 0;
15456 }
15457 _ACEOF
15458 rm -f conftest.$ac_objext
15459 if { (eval echo "$as_me:15459: \"$ac_compile\"") >&5
15460   (eval $ac_compile) 2>&5
15461   ac_status=$?
15462   echo "$as_me:15462: \$? = $ac_status" >&5
15463   (exit $ac_status); } &&
15464          { ac_try='test -s conftest.$ac_objext'
15465   { (eval echo "$as_me:15465: \"$ac_try\"") >&5
15466   (eval $ac_try) 2>&5
15467   ac_status=$?
15468   echo "$as_me:15468: \$? = $ac_status" >&5
15469   (exit $ac_status); }; }; then
15470   cf_result=yes
15471 else
15472   echo "$as_me: failed program was:" >&5
15473 cat conftest.$ac_ext >&5
15474 cf_result=no
15475 fi
15476 rm -f conftest.$ac_objext conftest.$ac_ext
15477 echo "$as_me:15477: result: $cf_result" >&5
15478 echo "${ECHO_T}$cf_result" >&6
15479
15480 if test $cf_result = yes ; then
15481
15482 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15483
15484         cat >>confdefs.h <<EOF
15485 #define $cf_result 1
15486 EOF
15487
15488 else
15489         echo "$as_me:15489: checking for data boolnames in library" >&5
15490 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
15491         # BSD linkers insist on making weak linkage, but resolve at runtime.
15492         if test "$cross_compiling" = yes; then
15493
15494         # cross-compiling
15495         cat >conftest.$ac_ext <<_ACEOF
15496 #line 15496 "configure"
15497 #include "confdefs.h"
15498
15499 #ifdef HAVE_XCURSES
15500 #include <xcurses.h>
15501 char * XCursesProgramName = "test";
15502 #else
15503 #include <${cf_cv_ncurses_header:-curses.h}>
15504 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15505 #include <ncursesw/term.h>
15506 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15507 #include <ncurses/term.h>
15508 #elif defined(HAVE_TERM_H)
15509 #include <term.h>
15510 #endif
15511 #endif
15512
15513 extern char boolnames;
15514 int
15515 main ()
15516 {
15517
15518         do {
15519                 void *foo = &(boolnames);
15520                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
15521                 ${cf_cv_main_return:-return}(foo == 0);
15522         } while (0)
15523
15524   ;
15525   return 0;
15526 }
15527 _ACEOF
15528 rm -f conftest.$ac_objext conftest$ac_exeext
15529 if { (eval echo "$as_me:15529: \"$ac_link\"") >&5
15530   (eval $ac_link) 2>&5
15531   ac_status=$?
15532   echo "$as_me:15532: \$? = $ac_status" >&5
15533   (exit $ac_status); } &&
15534          { ac_try='test -s conftest$ac_exeext'
15535   { (eval echo "$as_me:15535: \"$ac_try\"") >&5
15536   (eval $ac_try) 2>&5
15537   ac_status=$?
15538   echo "$as_me:15538: \$? = $ac_status" >&5
15539   (exit $ac_status); }; }; then
15540   cf_result=yes
15541 else
15542   echo "$as_me: failed program was:" >&5
15543 cat conftest.$ac_ext >&5
15544 cf_result=no
15545 fi
15546 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15547
15548 else
15549   cat >conftest.$ac_ext <<_ACEOF
15550 #line 15550 "configure"
15551 #include "confdefs.h"
15552
15553 #ifdef HAVE_XCURSES
15554 #include <xcurses.h>
15555 char * XCursesProgramName = "test";
15556 #else
15557 #include <${cf_cv_ncurses_header:-curses.h}>
15558 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15559 #include <ncursesw/term.h>
15560 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15561 #include <ncurses/term.h>
15562 #elif defined(HAVE_TERM_H)
15563 #include <term.h>
15564 #endif
15565 #endif
15566
15567 extern char boolnames;
15568 int main(void)
15569 {
15570         void *foo = &(boolnames);
15571         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
15572         ${cf_cv_main_return:-return}(foo == 0);
15573 }
15574 _ACEOF
15575 rm -f conftest$ac_exeext
15576 if { (eval echo "$as_me:15576: \"$ac_link\"") >&5
15577   (eval $ac_link) 2>&5
15578   ac_status=$?
15579   echo "$as_me:15579: \$? = $ac_status" >&5
15580   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15581   { (eval echo "$as_me:15581: \"$ac_try\"") >&5
15582   (eval $ac_try) 2>&5
15583   ac_status=$?
15584   echo "$as_me:15584: \$? = $ac_status" >&5
15585   (exit $ac_status); }; }; then
15586   cf_result=yes
15587 else
15588   echo "$as_me: program exited with status $ac_status" >&5
15589 echo "$as_me: failed program was:" >&5
15590 cat conftest.$ac_ext >&5
15591 cf_result=no
15592 fi
15593 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15594 fi
15595         echo "$as_me:15595: result: $cf_result" >&5
15596 echo "${ECHO_T}$cf_result" >&6
15597         if test $cf_result = yes ; then
15598
15599 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15600
15601                 cat >>confdefs.h <<EOF
15602 #define $cf_result 1
15603 EOF
15604
15605         fi
15606 fi
15607
15608 echo "$as_me:15608: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15609 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15610
15611 cat >conftest.$ac_ext <<_ACEOF
15612 #line 15612 "configure"
15613 #include "confdefs.h"
15614
15615 #ifdef HAVE_XCURSES
15616 #include <xcurses.h>
15617 char * XCursesProgramName = "test";
15618 #else
15619 #include <${cf_cv_ncurses_header:-curses.h}>
15620 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15621 #include <ncursesw/term.h>
15622 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15623 #include <ncurses/term.h>
15624 #elif defined(HAVE_TERM_H)
15625 #include <term.h>
15626 #endif
15627 #endif
15628
15629 int
15630 main ()
15631 {
15632
15633 void *foo = &(boolfnames)
15634
15635   ;
15636   return 0;
15637 }
15638 _ACEOF
15639 rm -f conftest.$ac_objext
15640 if { (eval echo "$as_me:15640: \"$ac_compile\"") >&5
15641   (eval $ac_compile) 2>&5
15642   ac_status=$?
15643   echo "$as_me:15643: \$? = $ac_status" >&5
15644   (exit $ac_status); } &&
15645          { ac_try='test -s conftest.$ac_objext'
15646   { (eval echo "$as_me:15646: \"$ac_try\"") >&5
15647   (eval $ac_try) 2>&5
15648   ac_status=$?
15649   echo "$as_me:15649: \$? = $ac_status" >&5
15650   (exit $ac_status); }; }; then
15651   cf_result=yes
15652 else
15653   echo "$as_me: failed program was:" >&5
15654 cat conftest.$ac_ext >&5
15655 cf_result=no
15656 fi
15657 rm -f conftest.$ac_objext conftest.$ac_ext
15658 echo "$as_me:15658: result: $cf_result" >&5
15659 echo "${ECHO_T}$cf_result" >&6
15660
15661 if test $cf_result = yes ; then
15662
15663 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15664
15665         cat >>confdefs.h <<EOF
15666 #define $cf_result 1
15667 EOF
15668
15669 else
15670         echo "$as_me:15670: checking for data boolfnames in library" >&5
15671 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
15672         # BSD linkers insist on making weak linkage, but resolve at runtime.
15673         if test "$cross_compiling" = yes; then
15674
15675         # cross-compiling
15676         cat >conftest.$ac_ext <<_ACEOF
15677 #line 15677 "configure"
15678 #include "confdefs.h"
15679
15680 #ifdef HAVE_XCURSES
15681 #include <xcurses.h>
15682 char * XCursesProgramName = "test";
15683 #else
15684 #include <${cf_cv_ncurses_header:-curses.h}>
15685 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15686 #include <ncursesw/term.h>
15687 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15688 #include <ncurses/term.h>
15689 #elif defined(HAVE_TERM_H)
15690 #include <term.h>
15691 #endif
15692 #endif
15693
15694 extern char boolfnames;
15695 int
15696 main ()
15697 {
15698
15699         do {
15700                 void *foo = &(boolfnames);
15701                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
15702                 ${cf_cv_main_return:-return}(foo == 0);
15703         } while (0)
15704
15705   ;
15706   return 0;
15707 }
15708 _ACEOF
15709 rm -f conftest.$ac_objext conftest$ac_exeext
15710 if { (eval echo "$as_me:15710: \"$ac_link\"") >&5
15711   (eval $ac_link) 2>&5
15712   ac_status=$?
15713   echo "$as_me:15713: \$? = $ac_status" >&5
15714   (exit $ac_status); } &&
15715          { ac_try='test -s conftest$ac_exeext'
15716   { (eval echo "$as_me:15716: \"$ac_try\"") >&5
15717   (eval $ac_try) 2>&5
15718   ac_status=$?
15719   echo "$as_me:15719: \$? = $ac_status" >&5
15720   (exit $ac_status); }; }; then
15721   cf_result=yes
15722 else
15723   echo "$as_me: failed program was:" >&5
15724 cat conftest.$ac_ext >&5
15725 cf_result=no
15726 fi
15727 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15728
15729 else
15730   cat >conftest.$ac_ext <<_ACEOF
15731 #line 15731 "configure"
15732 #include "confdefs.h"
15733
15734 #ifdef HAVE_XCURSES
15735 #include <xcurses.h>
15736 char * XCursesProgramName = "test";
15737 #else
15738 #include <${cf_cv_ncurses_header:-curses.h}>
15739 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15740 #include <ncursesw/term.h>
15741 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15742 #include <ncurses/term.h>
15743 #elif defined(HAVE_TERM_H)
15744 #include <term.h>
15745 #endif
15746 #endif
15747
15748 extern char boolfnames;
15749 int main(void)
15750 {
15751         void *foo = &(boolfnames);
15752         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
15753         ${cf_cv_main_return:-return}(foo == 0);
15754 }
15755 _ACEOF
15756 rm -f conftest$ac_exeext
15757 if { (eval echo "$as_me:15757: \"$ac_link\"") >&5
15758   (eval $ac_link) 2>&5
15759   ac_status=$?
15760   echo "$as_me:15760: \$? = $ac_status" >&5
15761   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15762   { (eval echo "$as_me:15762: \"$ac_try\"") >&5
15763   (eval $ac_try) 2>&5
15764   ac_status=$?
15765   echo "$as_me:15765: \$? = $ac_status" >&5
15766   (exit $ac_status); }; }; then
15767   cf_result=yes
15768 else
15769   echo "$as_me: program exited with status $ac_status" >&5
15770 echo "$as_me: failed program was:" >&5
15771 cat conftest.$ac_ext >&5
15772 cf_result=no
15773 fi
15774 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15775 fi
15776         echo "$as_me:15776: result: $cf_result" >&5
15777 echo "${ECHO_T}$cf_result" >&6
15778         if test $cf_result = yes ; then
15779
15780 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15781
15782                 cat >>confdefs.h <<EOF
15783 #define $cf_result 1
15784 EOF
15785
15786         fi
15787 fi
15788
15789 if ( test "$GCC" = yes || test "$GXX" = yes )
15790 then
15791 echo "$as_me:15791: checking if you want to turn on gcc warnings" >&5
15792 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15793
15794 # Check whether --enable-warnings or --disable-warnings was given.
15795 if test "${enable_warnings+set}" = set; then
15796   enableval="$enable_warnings"
15797   test "$enableval" != yes && enableval=no
15798   if test "$enableval" != "no" ; then
15799     with_warnings=yes
15800   else
15801     with_warnings=no
15802   fi
15803 else
15804   enableval=no
15805   with_warnings=no
15806
15807 fi;
15808 echo "$as_me:15808: result: $with_warnings" >&5
15809 echo "${ECHO_T}$with_warnings" >&6
15810 if test "$with_warnings" = "yes"
15811 then
15812
15813 if test "$GCC" = yes
15814 then
15815 cat > conftest.i <<EOF
15816 #ifndef GCC_PRINTF
15817 #define GCC_PRINTF 0
15818 #endif
15819 #ifndef GCC_SCANF
15820 #define GCC_SCANF 0
15821 #endif
15822 #ifndef GCC_NORETURN
15823 #define GCC_NORETURN /* nothing */
15824 #endif
15825 #ifndef GCC_UNUSED
15826 #define GCC_UNUSED /* nothing */
15827 #endif
15828 EOF
15829 if test "$GCC" = yes
15830 then
15831         { echo "$as_me:15831: checking for $CC __attribute__ directives..." >&5
15832 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15833 cat > conftest.$ac_ext <<EOF
15834 #line 15834 "${as_me:-configure}"
15835 #include "confdefs.h"
15836 #include "conftest.h"
15837 #include "conftest.i"
15838 #if     GCC_PRINTF
15839 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15840 #else
15841 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15842 #endif
15843 #if     GCC_SCANF
15844 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15845 #else
15846 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15847 #endif
15848 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15849 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
15850 extern void foo(void) GCC_NORETURN;
15851 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
15852 EOF
15853         cf_printf_attribute=no
15854         cf_scanf_attribute=no
15855         for cf_attribute in scanf printf unused noreturn
15856         do
15857
15858 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15859
15860                 cf_directive="__attribute__(($cf_attribute))"
15861                 echo "checking for $CC $cf_directive" 1>&5
15862
15863                 case $cf_attribute in #(vi
15864                 printf) #(vi
15865                         cf_printf_attribute=yes
15866                         cat >conftest.h <<EOF
15867 #define GCC_$cf_ATTRIBUTE 1
15868 EOF
15869                         ;;
15870                 scanf) #(vi
15871                         cf_scanf_attribute=yes
15872                         cat >conftest.h <<EOF
15873 #define GCC_$cf_ATTRIBUTE 1
15874 EOF
15875                         ;;
15876                 *) #(vi
15877                         cat >conftest.h <<EOF
15878 #define GCC_$cf_ATTRIBUTE $cf_directive
15879 EOF
15880                         ;;
15881                 esac
15882
15883                 if { (eval echo "$as_me:15883: \"$ac_compile\"") >&5
15884   (eval $ac_compile) 2>&5
15885   ac_status=$?
15886   echo "$as_me:15886: \$? = $ac_status" >&5
15887   (exit $ac_status); }; then
15888                         test -n "$verbose" && echo "$as_me:15888: result: ... $cf_attribute" >&5
15889 echo "${ECHO_T}... $cf_attribute" >&6
15890                         cat conftest.h >>confdefs.h
15891                         case $cf_attribute in #(vi
15892                         noreturn) #(vi
15893
15894 cat >>confdefs.h <<EOF
15895 #define GCC_NORETURN $cf_directive
15896 EOF
15897
15898                                 ;;
15899                         printf) #(vi
15900                                 cf_value='/* nothing */'
15901                                 if test "$cf_printf_attribute" != no ; then
15902                                         cf_value='__attribute__((format(printf,fmt,var)))'
15903
15904 cat >>confdefs.h <<\EOF
15905 #define GCC_PRINTF 1
15906 EOF
15907
15908                                 fi
15909
15910 cat >>confdefs.h <<EOF
15911 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15912 EOF
15913
15914                                 ;;
15915                         scanf) #(vi
15916                                 cf_value='/* nothing */'
15917                                 if test "$cf_scanf_attribute" != no ; then
15918                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15919
15920 cat >>confdefs.h <<\EOF
15921 #define GCC_SCANF 1
15922 EOF
15923
15924                                 fi
15925
15926 cat >>confdefs.h <<EOF
15927 #define GCC_SCANFLIKE(fmt,var) $cf_value
15928 EOF
15929
15930                                 ;;
15931                         unused) #(vi
15932
15933 cat >>confdefs.h <<EOF
15934 #define GCC_UNUSED $cf_directive
15935 EOF
15936
15937                                 ;;
15938                         esac
15939                 fi
15940         done
15941 else
15942         fgrep define conftest.i >>confdefs.h
15943 fi
15944 rm -rf conftest*
15945 fi
15946
15947 INTEL_COMPILER=no
15948
15949 if test "$GCC" = yes ; then
15950         case $host_os in
15951         linux*|gnu*)
15952                 echo "$as_me:15952: checking if this is really Intel C compiler" >&5
15953 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
15954                 cf_save_CFLAGS="$CFLAGS"
15955                 CFLAGS="$CFLAGS -no-gcc"
15956                 cat >conftest.$ac_ext <<_ACEOF
15957 #line 15957 "configure"
15958 #include "confdefs.h"
15959
15960 int
15961 main ()
15962 {
15963
15964 #ifdef __INTEL_COMPILER
15965 #else
15966 make an error
15967 #endif
15968
15969   ;
15970   return 0;
15971 }
15972 _ACEOF
15973 rm -f conftest.$ac_objext
15974 if { (eval echo "$as_me:15974: \"$ac_compile\"") >&5
15975   (eval $ac_compile) 2>&5
15976   ac_status=$?
15977   echo "$as_me:15977: \$? = $ac_status" >&5
15978   (exit $ac_status); } &&
15979          { ac_try='test -s conftest.$ac_objext'
15980   { (eval echo "$as_me:15980: \"$ac_try\"") >&5
15981   (eval $ac_try) 2>&5
15982   ac_status=$?
15983   echo "$as_me:15983: \$? = $ac_status" >&5
15984   (exit $ac_status); }; }; then
15985   INTEL_COMPILER=yes
15986 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
15987
15988 else
15989   echo "$as_me: failed program was:" >&5
15990 cat conftest.$ac_ext >&5
15991 fi
15992 rm -f conftest.$ac_objext conftest.$ac_ext
15993                 CFLAGS="$cf_save_CFLAGS"
15994                 echo "$as_me:15994: result: $INTEL_COMPILER" >&5
15995 echo "${ECHO_T}$INTEL_COMPILER" >&6
15996                 ;;
15997         esac
15998 fi
15999
16000 CLANG_COMPILER=no
16001
16002 if test "$GCC" = yes ; then
16003         echo "$as_me:16003: checking if this is really Clang C compiler" >&5
16004 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
16005         cf_save_CFLAGS="$CFLAGS"
16006         CFLAGS="$CFLAGS -Qunused-arguments"
16007         cat >conftest.$ac_ext <<_ACEOF
16008 #line 16008 "configure"
16009 #include "confdefs.h"
16010
16011 int
16012 main ()
16013 {
16014
16015 #ifdef __clang__
16016 #else
16017 make an error
16018 #endif
16019
16020   ;
16021   return 0;
16022 }
16023 _ACEOF
16024 rm -f conftest.$ac_objext
16025 if { (eval echo "$as_me:16025: \"$ac_compile\"") >&5
16026   (eval $ac_compile) 2>&5
16027   ac_status=$?
16028   echo "$as_me:16028: \$? = $ac_status" >&5
16029   (exit $ac_status); } &&
16030          { ac_try='test -s conftest.$ac_objext'
16031   { (eval echo "$as_me:16031: \"$ac_try\"") >&5
16032   (eval $ac_try) 2>&5
16033   ac_status=$?
16034   echo "$as_me:16034: \$? = $ac_status" >&5
16035   (exit $ac_status); }; }; then
16036   CLANG_COMPILER=yes
16037 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
16038
16039 else
16040   echo "$as_me: failed program was:" >&5
16041 cat conftest.$ac_ext >&5
16042 fi
16043 rm -f conftest.$ac_objext conftest.$ac_ext
16044         CFLAGS="$cf_save_CFLAGS"
16045         echo "$as_me:16045: result: $CLANG_COMPILER" >&5
16046 echo "${ECHO_T}$CLANG_COMPILER" >&6
16047 fi
16048
16049 cat > conftest.$ac_ext <<EOF
16050 #line 16050 "${as_me:-configure}"
16051 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
16052 EOF
16053
16054 if test "$INTEL_COMPILER" = yes
16055 then
16056 # The "-wdXXX" options suppress warnings:
16057 # remark #1419: external declaration in primary source file
16058 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
16059 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
16060 # remark #193: zero used for undefined preprocessing identifier
16061 # remark #593: variable "curs_sb_left_arrow" was set but never used
16062 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
16063 # remark #869: parameter "tw" was never referenced
16064 # remark #981: operands are evaluated in unspecified order
16065 # warning #279: controlling expression is constant
16066
16067         { echo "$as_me:16067: checking for $CC warning options..." >&5
16068 echo "$as_me: checking for $CC warning options..." >&6;}
16069         cf_save_CFLAGS="$CFLAGS"
16070         EXTRA_CFLAGS="-Wall"
16071         for cf_opt in \
16072                 wd1419 \
16073                 wd1683 \
16074                 wd1684 \
16075                 wd193 \
16076                 wd593 \
16077                 wd279 \
16078                 wd810 \
16079                 wd869 \
16080                 wd981
16081         do
16082                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16083                 if { (eval echo "$as_me:16083: \"$ac_compile\"") >&5
16084   (eval $ac_compile) 2>&5
16085   ac_status=$?
16086   echo "$as_me:16086: \$? = $ac_status" >&5
16087   (exit $ac_status); }; then
16088                         test -n "$verbose" && echo "$as_me:16088: result: ... -$cf_opt" >&5
16089 echo "${ECHO_T}... -$cf_opt" >&6
16090                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16091                 fi
16092         done
16093         CFLAGS="$cf_save_CFLAGS"
16094
16095 elif test "$GCC" = yes
16096 then
16097         { echo "$as_me:16097: checking for $CC warning options..." >&5
16098 echo "$as_me: checking for $CC warning options..." >&6;}
16099         cf_save_CFLAGS="$CFLAGS"
16100         EXTRA_CFLAGS=
16101         cf_warn_CONST=""
16102         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
16103         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
16104         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
16105         for cf_opt in W Wall \
16106                 Wbad-function-cast \
16107                 Wcast-align \
16108                 Wcast-qual \
16109                 Wdeclaration-after-statement \
16110                 Wextra \
16111                 Winline \
16112                 Wmissing-declarations \
16113                 Wmissing-prototypes \
16114                 Wnested-externs \
16115                 Wpointer-arith \
16116                 Wshadow \
16117                 Wstrict-prototypes \
16118                 Wundef $cf_gcc_warnings $cf_warn_CONST
16119         do
16120                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16121                 if { (eval echo "$as_me:16121: \"$ac_compile\"") >&5
16122   (eval $ac_compile) 2>&5
16123   ac_status=$?
16124   echo "$as_me:16124: \$? = $ac_status" >&5
16125   (exit $ac_status); }; then
16126                         test -n "$verbose" && echo "$as_me:16126: result: ... -$cf_opt" >&5
16127 echo "${ECHO_T}... -$cf_opt" >&6
16128                         case $cf_opt in #(vi
16129                         Wcast-qual) #(vi
16130                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
16131                                 ;;
16132                         Winline) #(vi
16133                                 case $GCC_VERSION in
16134                                 [34].*)
16135                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16136
16137 echo "${as_me:-configure}:16137: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16138
16139                                         continue;;
16140                                 esac
16141                                 ;;
16142                         Wpointer-arith) #(vi
16143                                 case $GCC_VERSION in
16144                                 [12].*)
16145                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16146
16147 echo "${as_me:-configure}:16147: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16148
16149                                         continue;;
16150                                 esac
16151                                 ;;
16152                         esac
16153                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16154                 fi
16155         done
16156         CFLAGS="$cf_save_CFLAGS"
16157 fi
16158 rm -rf conftest*
16159
16160 fi
16161 fi
16162
16163 echo "$as_me:16163: checking if you want to use dmalloc for testing" >&5
16164 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
16165
16166 # Check whether --with-dmalloc or --without-dmalloc was given.
16167 if test "${with_dmalloc+set}" = set; then
16168   withval="$with_dmalloc"
16169
16170 cat >>confdefs.h <<EOF
16171 #define USE_DMALLOC 1
16172 EOF
16173
16174         : ${with_cflags:=-g}
16175         : ${with_no_leaks:=yes}
16176          with_dmalloc=yes
16177 else
16178   with_dmalloc=
16179 fi;
16180 echo "$as_me:16180: result: ${with_dmalloc:-no}" >&5
16181 echo "${ECHO_T}${with_dmalloc:-no}" >&6
16182
16183 case .$with_cflags in #(vi
16184 .*-g*)
16185         case .$CFLAGS in #(vi
16186         .*-g*) #(vi
16187                 ;;
16188         *)
16189
16190 cf_fix_cppflags=no
16191 cf_new_cflags=
16192 cf_new_cppflags=
16193 cf_new_extra_cppflags=
16194
16195 for cf_add_cflags in -g
16196 do
16197 case $cf_fix_cppflags in
16198 no)
16199         case $cf_add_cflags in #(vi
16200         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
16201                 case $cf_add_cflags in
16202                 -D*)
16203                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16204
16205                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16206                                 && test -z "${cf_tst_cflags}" \
16207                                 && cf_fix_cppflags=yes
16208
16209                         if test $cf_fix_cppflags = yes ; then
16210                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16211                                 continue
16212                         elif test "${cf_tst_cflags}" = "\"'" ; then
16213                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16214                                 continue
16215                         fi
16216                         ;;
16217                 esac
16218                 case "$CPPFLAGS" in
16219                 *$cf_add_cflags) #(vi
16220                         ;;
16221                 *) #(vi
16222                         case $cf_add_cflags in #(vi
16223                         -D*)
16224                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16225
16226 CPPFLAGS=`echo "$CPPFLAGS" | \
16227         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16228                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16229
16230                                 ;;
16231                         esac
16232                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16233                         ;;
16234                 esac
16235                 ;;
16236         *)
16237                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16238                 ;;
16239         esac
16240         ;;
16241 yes)
16242         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16243
16244         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16245
16246         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16247                 && test -z "${cf_tst_cflags}" \
16248                 && cf_fix_cppflags=no
16249         ;;
16250 esac
16251 done
16252
16253 if test -n "$cf_new_cflags" ; then
16254
16255         CFLAGS="$CFLAGS $cf_new_cflags"
16256 fi
16257
16258 if test -n "$cf_new_cppflags" ; then
16259
16260         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16261 fi
16262
16263 if test -n "$cf_new_extra_cppflags" ; then
16264
16265         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16266 fi
16267
16268                 ;;
16269         esac
16270         ;;
16271 esac
16272
16273 if test "$with_dmalloc" = yes ; then
16274         echo "$as_me:16274: checking for dmalloc.h" >&5
16275 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
16276 if test "${ac_cv_header_dmalloc_h+set}" = set; then
16277   echo $ECHO_N "(cached) $ECHO_C" >&6
16278 else
16279   cat >conftest.$ac_ext <<_ACEOF
16280 #line 16280 "configure"
16281 #include "confdefs.h"
16282 #include <dmalloc.h>
16283 _ACEOF
16284 if { (eval echo "$as_me:16284: \"$ac_cpp conftest.$ac_ext\"") >&5
16285   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16286   ac_status=$?
16287   egrep -v '^ *\+' conftest.er1 >conftest.err
16288   rm -f conftest.er1
16289   cat conftest.err >&5
16290   echo "$as_me:16290: \$? = $ac_status" >&5
16291   (exit $ac_status); } >/dev/null; then
16292   if test -s conftest.err; then
16293     ac_cpp_err=$ac_c_preproc_warn_flag
16294   else
16295     ac_cpp_err=
16296   fi
16297 else
16298   ac_cpp_err=yes
16299 fi
16300 if test -z "$ac_cpp_err"; then
16301   ac_cv_header_dmalloc_h=yes
16302 else
16303   echo "$as_me: failed program was:" >&5
16304   cat conftest.$ac_ext >&5
16305   ac_cv_header_dmalloc_h=no
16306 fi
16307 rm -f conftest.err conftest.$ac_ext
16308 fi
16309 echo "$as_me:16309: result: $ac_cv_header_dmalloc_h" >&5
16310 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
16311 if test $ac_cv_header_dmalloc_h = yes; then
16312
16313 echo "$as_me:16313: checking for dmalloc_debug in -ldmalloc" >&5
16314 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
16315 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
16316   echo $ECHO_N "(cached) $ECHO_C" >&6
16317 else
16318   ac_check_lib_save_LIBS=$LIBS
16319 LIBS="-ldmalloc  $LIBS"
16320 cat >conftest.$ac_ext <<_ACEOF
16321 #line 16321 "configure"
16322 #include "confdefs.h"
16323
16324 /* Override any gcc2 internal prototype to avoid an error.  */
16325 #ifdef __cplusplus
16326 extern "C"
16327 #endif
16328 /* We use char because int might match the return type of a gcc2
16329    builtin and then its argument prototype would still apply.  */
16330 char dmalloc_debug ();
16331 int
16332 main ()
16333 {
16334 dmalloc_debug ();
16335   ;
16336   return 0;
16337 }
16338 _ACEOF
16339 rm -f conftest.$ac_objext conftest$ac_exeext
16340 if { (eval echo "$as_me:16340: \"$ac_link\"") >&5
16341   (eval $ac_link) 2>&5
16342   ac_status=$?
16343   echo "$as_me:16343: \$? = $ac_status" >&5
16344   (exit $ac_status); } &&
16345          { ac_try='test -s conftest$ac_exeext'
16346   { (eval echo "$as_me:16346: \"$ac_try\"") >&5
16347   (eval $ac_try) 2>&5
16348   ac_status=$?
16349   echo "$as_me:16349: \$? = $ac_status" >&5
16350   (exit $ac_status); }; }; then
16351   ac_cv_lib_dmalloc_dmalloc_debug=yes
16352 else
16353   echo "$as_me: failed program was:" >&5
16354 cat conftest.$ac_ext >&5
16355 ac_cv_lib_dmalloc_dmalloc_debug=no
16356 fi
16357 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16358 LIBS=$ac_check_lib_save_LIBS
16359 fi
16360 echo "$as_me:16360: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
16361 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
16362 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
16363   cat >>confdefs.h <<EOF
16364 #define HAVE_LIBDMALLOC 1
16365 EOF
16366
16367   LIBS="-ldmalloc $LIBS"
16368
16369 fi
16370
16371 fi
16372
16373 fi
16374
16375 echo "$as_me:16375: checking if you want to use dbmalloc for testing" >&5
16376 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
16377
16378 # Check whether --with-dbmalloc or --without-dbmalloc was given.
16379 if test "${with_dbmalloc+set}" = set; then
16380   withval="$with_dbmalloc"
16381
16382 cat >>confdefs.h <<EOF
16383 #define USE_DBMALLOC 1
16384 EOF
16385
16386         : ${with_cflags:=-g}
16387         : ${with_no_leaks:=yes}
16388          with_dbmalloc=yes
16389 else
16390   with_dbmalloc=
16391 fi;
16392 echo "$as_me:16392: result: ${with_dbmalloc:-no}" >&5
16393 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
16394
16395 case .$with_cflags in #(vi
16396 .*-g*)
16397         case .$CFLAGS in #(vi
16398         .*-g*) #(vi
16399                 ;;
16400         *)
16401
16402 cf_fix_cppflags=no
16403 cf_new_cflags=
16404 cf_new_cppflags=
16405 cf_new_extra_cppflags=
16406
16407 for cf_add_cflags in -g
16408 do
16409 case $cf_fix_cppflags in
16410 no)
16411         case $cf_add_cflags in #(vi
16412         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
16413                 case $cf_add_cflags in
16414                 -D*)
16415                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16416
16417                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16418                                 && test -z "${cf_tst_cflags}" \
16419                                 && cf_fix_cppflags=yes
16420
16421                         if test $cf_fix_cppflags = yes ; then
16422                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16423                                 continue
16424                         elif test "${cf_tst_cflags}" = "\"'" ; then
16425                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16426                                 continue
16427                         fi
16428                         ;;
16429                 esac
16430                 case "$CPPFLAGS" in
16431                 *$cf_add_cflags) #(vi
16432                         ;;
16433                 *) #(vi
16434                         case $cf_add_cflags in #(vi
16435                         -D*)
16436                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16437
16438 CPPFLAGS=`echo "$CPPFLAGS" | \
16439         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16440                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16441
16442                                 ;;
16443                         esac
16444                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16445                         ;;
16446                 esac
16447                 ;;
16448         *)
16449                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16450                 ;;
16451         esac
16452         ;;
16453 yes)
16454         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16455
16456         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16457
16458         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16459                 && test -z "${cf_tst_cflags}" \
16460                 && cf_fix_cppflags=no
16461         ;;
16462 esac
16463 done
16464
16465 if test -n "$cf_new_cflags" ; then
16466
16467         CFLAGS="$CFLAGS $cf_new_cflags"
16468 fi
16469
16470 if test -n "$cf_new_cppflags" ; then
16471
16472         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16473 fi
16474
16475 if test -n "$cf_new_extra_cppflags" ; then
16476
16477         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16478 fi
16479
16480                 ;;
16481         esac
16482         ;;
16483 esac
16484
16485 if test "$with_dbmalloc" = yes ; then
16486         echo "$as_me:16486: checking for dbmalloc.h" >&5
16487 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
16488 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
16489   echo $ECHO_N "(cached) $ECHO_C" >&6
16490 else
16491   cat >conftest.$ac_ext <<_ACEOF
16492 #line 16492 "configure"
16493 #include "confdefs.h"
16494 #include <dbmalloc.h>
16495 _ACEOF
16496 if { (eval echo "$as_me:16496: \"$ac_cpp conftest.$ac_ext\"") >&5
16497   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16498   ac_status=$?
16499   egrep -v '^ *\+' conftest.er1 >conftest.err
16500   rm -f conftest.er1
16501   cat conftest.err >&5
16502   echo "$as_me:16502: \$? = $ac_status" >&5
16503   (exit $ac_status); } >/dev/null; then
16504   if test -s conftest.err; then
16505     ac_cpp_err=$ac_c_preproc_warn_flag
16506   else
16507     ac_cpp_err=
16508   fi
16509 else
16510   ac_cpp_err=yes
16511 fi
16512 if test -z "$ac_cpp_err"; then
16513   ac_cv_header_dbmalloc_h=yes
16514 else
16515   echo "$as_me: failed program was:" >&5
16516   cat conftest.$ac_ext >&5
16517   ac_cv_header_dbmalloc_h=no
16518 fi
16519 rm -f conftest.err conftest.$ac_ext
16520 fi
16521 echo "$as_me:16521: result: $ac_cv_header_dbmalloc_h" >&5
16522 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
16523 if test $ac_cv_header_dbmalloc_h = yes; then
16524
16525 echo "$as_me:16525: checking for debug_malloc in -ldbmalloc" >&5
16526 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
16527 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
16528   echo $ECHO_N "(cached) $ECHO_C" >&6
16529 else
16530   ac_check_lib_save_LIBS=$LIBS
16531 LIBS="-ldbmalloc  $LIBS"
16532 cat >conftest.$ac_ext <<_ACEOF
16533 #line 16533 "configure"
16534 #include "confdefs.h"
16535
16536 /* Override any gcc2 internal prototype to avoid an error.  */
16537 #ifdef __cplusplus
16538 extern "C"
16539 #endif
16540 /* We use char because int might match the return type of a gcc2
16541    builtin and then its argument prototype would still apply.  */
16542 char debug_malloc ();
16543 int
16544 main ()
16545 {
16546 debug_malloc ();
16547   ;
16548   return 0;
16549 }
16550 _ACEOF
16551 rm -f conftest.$ac_objext conftest$ac_exeext
16552 if { (eval echo "$as_me:16552: \"$ac_link\"") >&5
16553   (eval $ac_link) 2>&5
16554   ac_status=$?
16555   echo "$as_me:16555: \$? = $ac_status" >&5
16556   (exit $ac_status); } &&
16557          { ac_try='test -s conftest$ac_exeext'
16558   { (eval echo "$as_me:16558: \"$ac_try\"") >&5
16559   (eval $ac_try) 2>&5
16560   ac_status=$?
16561   echo "$as_me:16561: \$? = $ac_status" >&5
16562   (exit $ac_status); }; }; then
16563   ac_cv_lib_dbmalloc_debug_malloc=yes
16564 else
16565   echo "$as_me: failed program was:" >&5
16566 cat conftest.$ac_ext >&5
16567 ac_cv_lib_dbmalloc_debug_malloc=no
16568 fi
16569 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16570 LIBS=$ac_check_lib_save_LIBS
16571 fi
16572 echo "$as_me:16572: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
16573 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
16574 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
16575   cat >>confdefs.h <<EOF
16576 #define HAVE_LIBDBMALLOC 1
16577 EOF
16578
16579   LIBS="-ldbmalloc $LIBS"
16580
16581 fi
16582
16583 fi
16584
16585 fi
16586
16587 echo "$as_me:16587: checking if you want to use valgrind for testing" >&5
16588 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
16589
16590 # Check whether --with-valgrind or --without-valgrind was given.
16591 if test "${with_valgrind+set}" = set; then
16592   withval="$with_valgrind"
16593
16594 cat >>confdefs.h <<EOF
16595 #define USE_VALGRIND 1
16596 EOF
16597
16598         : ${with_cflags:=-g}
16599         : ${with_no_leaks:=yes}
16600          with_valgrind=yes
16601 else
16602   with_valgrind=
16603 fi;
16604 echo "$as_me:16604: result: ${with_valgrind:-no}" >&5
16605 echo "${ECHO_T}${with_valgrind:-no}" >&6
16606
16607 case .$with_cflags in #(vi
16608 .*-g*)
16609         case .$CFLAGS in #(vi
16610         .*-g*) #(vi
16611                 ;;
16612         *)
16613
16614 cf_fix_cppflags=no
16615 cf_new_cflags=
16616 cf_new_cppflags=
16617 cf_new_extra_cppflags=
16618
16619 for cf_add_cflags in -g
16620 do
16621 case $cf_fix_cppflags in
16622 no)
16623         case $cf_add_cflags in #(vi
16624         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
16625                 case $cf_add_cflags in
16626                 -D*)
16627                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16628
16629                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16630                                 && test -z "${cf_tst_cflags}" \
16631                                 && cf_fix_cppflags=yes
16632
16633                         if test $cf_fix_cppflags = yes ; then
16634                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16635                                 continue
16636                         elif test "${cf_tst_cflags}" = "\"'" ; then
16637                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16638                                 continue
16639                         fi
16640                         ;;
16641                 esac
16642                 case "$CPPFLAGS" in
16643                 *$cf_add_cflags) #(vi
16644                         ;;
16645                 *) #(vi
16646                         case $cf_add_cflags in #(vi
16647                         -D*)
16648                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16649
16650 CPPFLAGS=`echo "$CPPFLAGS" | \
16651         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16652                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16653
16654                                 ;;
16655                         esac
16656                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16657                         ;;
16658                 esac
16659                 ;;
16660         *)
16661                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16662                 ;;
16663         esac
16664         ;;
16665 yes)
16666         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16667
16668         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16669
16670         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16671                 && test -z "${cf_tst_cflags}" \
16672                 && cf_fix_cppflags=no
16673         ;;
16674 esac
16675 done
16676
16677 if test -n "$cf_new_cflags" ; then
16678
16679         CFLAGS="$CFLAGS $cf_new_cflags"
16680 fi
16681
16682 if test -n "$cf_new_cppflags" ; then
16683
16684         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16685 fi
16686
16687 if test -n "$cf_new_extra_cppflags" ; then
16688
16689         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16690 fi
16691
16692                 ;;
16693         esac
16694         ;;
16695 esac
16696
16697 echo "$as_me:16697: checking if you want to perform memory-leak testing" >&5
16698 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
16699
16700 # Check whether --enable-leaks or --disable-leaks was given.
16701 if test "${enable_leaks+set}" = set; then
16702   enableval="$enable_leaks"
16703   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
16704 else
16705   : ${with_no_leaks:=no}
16706 fi;
16707 echo "$as_me:16707: result: $with_no_leaks" >&5
16708 echo "${ECHO_T}$with_no_leaks" >&6
16709
16710 if test "$with_no_leaks" = yes ; then
16711
16712 cat >>confdefs.h <<\EOF
16713 #define NO_LEAKS 1
16714 EOF
16715
16716 cat >>confdefs.h <<\EOF
16717 #define YY_NO_LEAKS 1
16718 EOF
16719
16720 fi
16721
16722 LD_RPATH_OPT=
16723 echo "$as_me:16723: checking for an rpath option" >&5
16724 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
16725 case $cf_cv_system_name in #(vi
16726 irix*) #(vi
16727         if test "$GCC" = yes; then
16728                 LD_RPATH_OPT="-Wl,-rpath,"
16729         else
16730                 LD_RPATH_OPT="-rpath "
16731         fi
16732         ;;
16733 linux*|gnu*|k*bsd*-gnu) #(vi
16734         LD_RPATH_OPT="-Wl,-rpath,"
16735         ;;
16736 openbsd[2-9].*|mirbsd*) #(vi
16737         LD_RPATH_OPT="-Wl,-rpath,"
16738         ;;
16739 dragonfly*|freebsd*) #(vi
16740         LD_RPATH_OPT="-rpath "
16741         ;;
16742 netbsd*) #(vi
16743         LD_RPATH_OPT="-Wl,-rpath,"
16744         ;;
16745 osf*|mls+*) #(vi
16746         LD_RPATH_OPT="-rpath "
16747         ;;
16748 solaris2*) #(vi
16749         LD_RPATH_OPT="-R"
16750         ;;
16751 *)
16752         ;;
16753 esac
16754 echo "$as_me:16754: result: $LD_RPATH_OPT" >&5
16755 echo "${ECHO_T}$LD_RPATH_OPT" >&6
16756
16757 case "x$LD_RPATH_OPT" in #(vi
16758 x-R*)
16759         echo "$as_me:16759: checking if we need a space after rpath option" >&5
16760 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
16761         cf_save_LIBS="$LIBS"
16762
16763 cf_add_libs="${LD_RPATH_OPT}$libdir"
16764 # Filter out duplicates - this happens with badly-designed ".pc" files...
16765 for cf_add_1lib in $LIBS
16766 do
16767         for cf_add_2lib in $cf_add_libs
16768         do
16769                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16770                 then
16771                         cf_add_1lib=
16772                         break
16773                 fi
16774         done
16775         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16776 done
16777 LIBS="$cf_add_libs"
16778
16779         cat >conftest.$ac_ext <<_ACEOF
16780 #line 16780 "configure"
16781 #include "confdefs.h"
16782
16783 int
16784 main ()
16785 {
16786
16787   ;
16788   return 0;
16789 }
16790 _ACEOF
16791 rm -f conftest.$ac_objext conftest$ac_exeext
16792 if { (eval echo "$as_me:16792: \"$ac_link\"") >&5
16793   (eval $ac_link) 2>&5
16794   ac_status=$?
16795   echo "$as_me:16795: \$? = $ac_status" >&5
16796   (exit $ac_status); } &&
16797          { ac_try='test -s conftest$ac_exeext'
16798   { (eval echo "$as_me:16798: \"$ac_try\"") >&5
16799   (eval $ac_try) 2>&5
16800   ac_status=$?
16801   echo "$as_me:16801: \$? = $ac_status" >&5
16802   (exit $ac_status); }; }; then
16803   cf_rpath_space=no
16804 else
16805   echo "$as_me: failed program was:" >&5
16806 cat conftest.$ac_ext >&5
16807 cf_rpath_space=yes
16808 fi
16809 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16810         LIBS="$cf_save_LIBS"
16811         echo "$as_me:16811: result: $cf_rpath_space" >&5
16812 echo "${ECHO_T}$cf_rpath_space" >&6
16813         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
16814         ;;
16815 esac
16816
16817 echo "$as_me:16817: checking if rpath-hack should be disabled" >&5
16818 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
16819
16820 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
16821 if test "${enable_rpath_hack+set}" = set; then
16822   enableval="$enable_rpath_hack"
16823   test "$enableval" != no && enableval=yes
16824   if test "$enableval" != "yes" ; then
16825     cf_disable_rpath_hack=yes
16826   else
16827     cf_disable_rpath_hack=no
16828   fi
16829 else
16830   enableval=yes
16831   cf_disable_rpath_hack=no
16832
16833 fi;
16834 echo "$as_me:16834: result: $cf_disable_rpath_hack" >&5
16835 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
16836 if test "$cf_disable_rpath_hack" = no ; then
16837
16838 echo "$as_me:16838: checking for updated LDFLAGS" >&5
16839 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
16840 if test -n "$LD_RPATH_OPT" ; then
16841         echo "$as_me:16841: result: maybe" >&5
16842 echo "${ECHO_T}maybe" >&6
16843
16844         for ac_prog in ldd
16845 do
16846   # Extract the first word of "$ac_prog", so it can be a program name with args.
16847 set dummy $ac_prog; ac_word=$2
16848 echo "$as_me:16848: checking for $ac_word" >&5
16849 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16850 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
16851   echo $ECHO_N "(cached) $ECHO_C" >&6
16852 else
16853   if test -n "$cf_ldd_prog"; then
16854   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
16855 else
16856   ac_save_IFS=$IFS; IFS=$ac_path_separator
16857 ac_dummy="$PATH"
16858 for ac_dir in $ac_dummy; do
16859   IFS=$ac_save_IFS
16860   test -z "$ac_dir" && ac_dir=.
16861   $as_executable_p "$ac_dir/$ac_word" || continue
16862 ac_cv_prog_cf_ldd_prog="$ac_prog"
16863 echo "$as_me:16863: found $ac_dir/$ac_word" >&5
16864 break
16865 done
16866
16867 fi
16868 fi
16869 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
16870 if test -n "$cf_ldd_prog"; then
16871   echo "$as_me:16871: result: $cf_ldd_prog" >&5
16872 echo "${ECHO_T}$cf_ldd_prog" >&6
16873 else
16874   echo "$as_me:16874: result: no" >&5
16875 echo "${ECHO_T}no" >&6
16876 fi
16877
16878   test -n "$cf_ldd_prog" && break
16879 done
16880 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
16881
16882         cf_rpath_list="/usr/lib /lib"
16883         if test "$cf_ldd_prog" != no
16884         then
16885                 cf_rpath_oops=
16886
16887 cat >conftest.$ac_ext <<_ACEOF
16888 #line 16888 "configure"
16889 #include "confdefs.h"
16890 #include <stdio.h>
16891 int
16892 main ()
16893 {
16894 printf("Hello");
16895   ;
16896   return 0;
16897 }
16898 _ACEOF
16899 rm -f conftest.$ac_objext conftest$ac_exeext
16900 if { (eval echo "$as_me:16900: \"$ac_link\"") >&5
16901   (eval $ac_link) 2>&5
16902   ac_status=$?
16903   echo "$as_me:16903: \$? = $ac_status" >&5
16904   (exit $ac_status); } &&
16905          { ac_try='test -s conftest$ac_exeext'
16906   { (eval echo "$as_me:16906: \"$ac_try\"") >&5
16907   (eval $ac_try) 2>&5
16908   ac_status=$?
16909   echo "$as_me:16909: \$? = $ac_status" >&5
16910   (exit $ac_status); }; }; then
16911   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
16912                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
16913 else
16914   echo "$as_me: failed program was:" >&5
16915 cat conftest.$ac_ext >&5
16916 fi
16917 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16918
16919                 # If we passed the link-test, but get a "not found" on a given library,
16920                 # this could be due to inept reconfiguration of gcc to make it only
16921                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
16922                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
16923                 # /usr/local libraries.
16924                 if test -n "$cf_rpath_oops"
16925                 then
16926                         for cf_rpath_src in $cf_rpath_oops
16927                         do
16928                                 for cf_rpath_dir in \
16929                                         /usr/local \
16930                                         /usr/pkg \
16931                                         /opt/sfw
16932                                 do
16933                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
16934                                         then
16935                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
16936
16937 echo "${as_me:-configure}:16937: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
16938
16939                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
16940                                                 break
16941                                         fi
16942                                 done
16943                         done
16944                 fi
16945         fi
16946
16947         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16948
16949 echo "${as_me:-configure}:16949: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16950
16951 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
16952
16953 echo "${as_me:-configure}:16953: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
16954
16955 cf_rpath_dst=
16956 for cf_rpath_src in $LDFLAGS
16957 do
16958         case $cf_rpath_src in #(vi
16959         -L*) #(vi
16960
16961                 # check if this refers to a directory which we will ignore
16962                 cf_rpath_skip=no
16963                 if test -n "$cf_rpath_list"
16964                 then
16965                         for cf_rpath_item in $cf_rpath_list
16966                         do
16967                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16968                                 then
16969                                         cf_rpath_skip=yes
16970                                         break
16971                                 fi
16972                         done
16973                 fi
16974
16975                 if test "$cf_rpath_skip" = no
16976                 then
16977                         # transform the option
16978                         if test "$LD_RPATH_OPT" = "-R " ; then
16979                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16980                         else
16981                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16982                         fi
16983
16984                         # if we have not already added this, add it now
16985                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16986                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16987                         then
16988                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16989
16990 echo "${as_me:-configure}:16990: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16991
16992                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16993                         fi
16994                 fi
16995                 ;;
16996         esac
16997         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16998 done
16999 LDFLAGS=$cf_rpath_dst
17000
17001 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
17002
17003 echo "${as_me:-configure}:17003: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
17004
17005 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
17006
17007 echo "${as_me:-configure}:17007: testing ...checking LIBS $LIBS ..." 1>&5
17008
17009 cf_rpath_dst=
17010 for cf_rpath_src in $LIBS
17011 do
17012         case $cf_rpath_src in #(vi
17013         -L*) #(vi
17014
17015                 # check if this refers to a directory which we will ignore
17016                 cf_rpath_skip=no
17017                 if test -n "$cf_rpath_list"
17018                 then
17019                         for cf_rpath_item in $cf_rpath_list
17020                         do
17021                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
17022                                 then
17023                                         cf_rpath_skip=yes
17024                                         break
17025                                 fi
17026                         done
17027                 fi
17028
17029                 if test "$cf_rpath_skip" = no
17030                 then
17031                         # transform the option
17032                         if test "$LD_RPATH_OPT" = "-R " ; then
17033                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
17034                         else
17035                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
17036                         fi
17037
17038                         # if we have not already added this, add it now
17039                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
17040                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
17041                         then
17042                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
17043
17044 echo "${as_me:-configure}:17044: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
17045
17046                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
17047                         fi
17048                 fi
17049                 ;;
17050         esac
17051         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
17052 done
17053 LIBS=$cf_rpath_dst
17054
17055 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
17056
17057 echo "${as_me:-configure}:17057: testing ...checked LIBS $LIBS ..." 1>&5
17058
17059         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
17060
17061 echo "${as_me:-configure}:17061: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
17062
17063 else
17064         echo "$as_me:17064: result: no" >&5
17065 echo "${ECHO_T}no" >&6
17066 fi
17067
17068 fi
17069
17070 TEST_ARGS="$LIBS"
17071 LIBS=
17072
17073 ac_config_files="$ac_config_files Makefile"
17074 ac_config_commands="$ac_config_commands default"
17075 cat >confcache <<\_ACEOF
17076 # This file is a shell script that caches the results of configure
17077 # tests run on this system so they can be shared between configure
17078 # scripts and configure runs, see configure's option --config-cache.
17079 # It is not useful on other systems.  If it contains results you don't
17080 # want to keep, you may remove or edit it.
17081 #
17082 # config.status only pays attention to the cache file if you give it
17083 # the --recheck option to rerun configure.
17084 #
17085 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17086 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17087 # following values.
17088
17089 _ACEOF
17090
17091 # The following way of writing the cache mishandles newlines in values,
17092 # but we know of no workaround that is simple, portable, and efficient.
17093 # So, don't put newlines in cache variables' values.
17094 # Ultrix sh set writes to stderr and can't be redirected directly,
17095 # and sets the high bit in the cache file unless we assign to the vars.
17096 {
17097   (set) 2>&1 |
17098     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17099     *ac_space=\ *)
17100       # `set' does not quote correctly, so add quotes (double-quote
17101       # substitution turns \\\\ into \\, and sed turns \\ into \).
17102       sed -n \
17103         "s/'/'\\\\''/g;
17104           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17105       ;;
17106     *)
17107       # `set' quotes correctly as required by POSIX, so do not add quotes.
17108       sed -n \
17109         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17110       ;;
17111     esac;
17112 } |
17113   sed '
17114      t clear
17115      : clear
17116      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17117      t end
17118      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17119      : end' >>confcache
17120 if cmp -s $cache_file confcache; then :; else
17121   if test -w $cache_file; then
17122     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17123     cat confcache >$cache_file
17124   else
17125     echo "not updating unwritable cache $cache_file"
17126   fi
17127 fi
17128 rm -f confcache
17129
17130 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17131 # Let make expand exec_prefix.
17132 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17133
17134 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17135 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17136 # trailing colons and then remove the whole line if VPATH becomes empty
17137 # (actually we leave an empty line to preserve line numbers).
17138 if test "x$srcdir" = x.; then
17139   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17140 s/:*\$(srcdir):*/:/;
17141 s/:*\${srcdir}:*/:/;
17142 s/:*@srcdir@:*/:/;
17143 s/^\([^=]*=[    ]*\):*/\1/;
17144 s/:*$//;
17145 s/^[^=]*=[      ]*$//;
17146 }'
17147 fi
17148
17149 DEFS=-DHAVE_CONFIG_H
17150
17151 : ${CONFIG_STATUS=./config.status}
17152 ac_clean_files_save=$ac_clean_files
17153 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17154 { echo "$as_me:17154: creating $CONFIG_STATUS" >&5
17155 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17156 cat >$CONFIG_STATUS <<_ACEOF
17157 #! $SHELL
17158 # Generated automatically by configure.
17159 # Run this file to recreate the current configuration.
17160 # Compiler output produced by configure, useful for debugging
17161 # configure, is in config.log if it exists.
17162
17163 debug=false
17164 SHELL=\${CONFIG_SHELL-$SHELL}
17165 ac_cs_invocation="\$0 \$@"
17166
17167 _ACEOF
17168
17169 cat >>$CONFIG_STATUS <<\_ACEOF
17170 # Be Bourne compatible
17171 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17172   emulate sh
17173   NULLCMD=:
17174 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17175   set -o posix
17176 fi
17177
17178 # Name of the executable.
17179 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17180
17181 if expr a : '\(a\)' >/dev/null 2>&1; then
17182   as_expr=expr
17183 else
17184   as_expr=false
17185 fi
17186
17187 rm -f conf$$ conf$$.exe conf$$.file
17188 echo >conf$$.file
17189 if ln -s conf$$.file conf$$ 2>/dev/null; then
17190   # We could just check for DJGPP; but this test a) works b) is more generic
17191   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17192   if test -f conf$$.exe; then
17193     # Don't use ln at all; we don't have any links
17194     as_ln_s='cp -p'
17195   else
17196     as_ln_s='ln -s'
17197   fi
17198 elif ln conf$$.file conf$$ 2>/dev/null; then
17199   as_ln_s=ln
17200 else
17201   as_ln_s='cp -p'
17202 fi
17203 rm -f conf$$ conf$$.exe conf$$.file
17204
17205 as_executable_p="test -f"
17206
17207 # Support unset when possible.
17208 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17209   as_unset=unset
17210 else
17211   as_unset=false
17212 fi
17213
17214 # NLS nuisances.
17215 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17216 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17217 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17218 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17219 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17220 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17221 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17222 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17223
17224 # IFS
17225 # We need space, tab and new line, in precisely that order.
17226 as_nl='
17227 '
17228 IFS="   $as_nl"
17229
17230 # CDPATH.
17231 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17232
17233 exec 6>&1
17234
17235 _ACEOF
17236
17237 # Files that config.status was made for.
17238 if test -n "$ac_config_files"; then
17239   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
17240 fi
17241
17242 if test -n "$ac_config_headers"; then
17243   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
17244 fi
17245
17246 if test -n "$ac_config_links"; then
17247   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
17248 fi
17249
17250 if test -n "$ac_config_commands"; then
17251   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
17252 fi
17253
17254 cat >>$CONFIG_STATUS <<\EOF
17255
17256 ac_cs_usage="\
17257 \`$as_me' instantiates files from templates according to the
17258 current configuration.
17259
17260 Usage: $0 [OPTIONS] [FILE]...
17261
17262   -h, --help       print this help, then exit
17263   -V, --version    print version number, then exit
17264   -d, --debug      don't remove temporary files
17265       --recheck    update $as_me by reconfiguring in the same conditions
17266   --file=FILE[:TEMPLATE]
17267                    instantiate the configuration file FILE
17268   --header=FILE[:TEMPLATE]
17269                    instantiate the configuration header FILE
17270
17271 Configuration files:
17272 $config_files
17273
17274 Configuration headers:
17275 $config_headers
17276
17277 Configuration commands:
17278 $config_commands
17279
17280 Report bugs to <dickey@invisible-island.net>."
17281 EOF
17282
17283 cat >>$CONFIG_STATUS <<EOF
17284 ac_cs_version="\\
17285 config.status
17286 configured by $0, generated by GNU Autoconf 2.52.20121002,
17287   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17288
17289 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17290 Free Software Foundation, Inc.
17291 This config.status script is free software; the Free Software Foundation
17292 gives unlimited permission to copy, distribute and modify it."
17293 srcdir=$srcdir
17294 INSTALL="$INSTALL"
17295 EOF
17296
17297 cat >>$CONFIG_STATUS <<\EOF
17298 # If no file are specified by the user, then we need to provide default
17299 # value.  By we need to know if files were specified by the user.
17300 ac_need_defaults=:
17301 while test $# != 0
17302 do
17303   case $1 in
17304   --*=*)
17305     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17306     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17307     shift
17308     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17309     shift
17310     ;;
17311   -*);;
17312   *) # This is not an option, so the user has probably given explicit
17313      # arguments.
17314      ac_need_defaults=false;;
17315   esac
17316
17317   case $1 in
17318   # Handling of the options.
17319 EOF
17320 cat >>$CONFIG_STATUS <<EOF
17321   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17322     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
17323     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
17324 EOF
17325 cat >>$CONFIG_STATUS <<\EOF
17326   --version | --vers* | -V )
17327     echo "$ac_cs_version"; exit 0 ;;
17328   --he | --h)
17329     # Conflict between --help and --header
17330     { { echo "$as_me:17330: error: ambiguous option: $1
17331 Try \`$0 --help' for more information." >&5
17332 echo "$as_me: error: ambiguous option: $1
17333 Try \`$0 --help' for more information." >&2;}
17334    { (exit 1); exit 1; }; };;
17335   --help | --hel | -h )
17336     echo "$ac_cs_usage"; exit 0 ;;
17337   --debug | --d* | -d )
17338     debug=: ;;
17339   --file | --fil | --fi | --f )
17340     shift
17341     CONFIG_FILES="$CONFIG_FILES $1"
17342     ac_need_defaults=false;;
17343   --header | --heade | --head | --hea )
17344     shift
17345     CONFIG_HEADERS="$CONFIG_HEADERS $1"
17346     ac_need_defaults=false;;
17347
17348   # This is an error.
17349   -*) { { echo "$as_me:17349: error: unrecognized option: $1
17350 Try \`$0 --help' for more information." >&5
17351 echo "$as_me: error: unrecognized option: $1
17352 Try \`$0 --help' for more information." >&2;}
17353    { (exit 1); exit 1; }; } ;;
17354
17355   *) ac_config_targets="$ac_config_targets $1" ;;
17356
17357   esac
17358   shift
17359 done
17360
17361 exec 5>>config.log
17362 cat >&5 << _ACEOF
17363
17364 ## ----------------------- ##
17365 ## Running config.status.  ##
17366 ## ----------------------- ##
17367
17368 This file was extended by $as_me 2.52.20121002, executed with
17369   CONFIG_FILES    = $CONFIG_FILES
17370   CONFIG_HEADERS  = $CONFIG_HEADERS
17371   CONFIG_LINKS    = $CONFIG_LINKS
17372   CONFIG_COMMANDS = $CONFIG_COMMANDS
17373   > $ac_cs_invocation
17374 on `(hostname || uname -n) 2>/dev/null | sed 1q`
17375
17376 _ACEOF
17377 EOF
17378
17379 cat >>$CONFIG_STATUS <<EOF
17380 #
17381 # INIT-COMMANDS section.
17382 #
17383
17384 AWK="$AWK"
17385 ECHO_CC="$ECHO_CC"
17386 ECHO_LD="$ECHO_LD"
17387 SHOW_CC="$SHOW_LD"
17388
17389 EOF
17390
17391 cat >>$CONFIG_STATUS <<\EOF
17392 for ac_config_target in $ac_config_targets
17393 do
17394   case "$ac_config_target" in
17395   # Handling of arguments.
17396   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
17397   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
17398   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
17399   *) { { echo "$as_me:17399: error: invalid argument: $ac_config_target" >&5
17400 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
17401    { (exit 1); exit 1; }; };;
17402   esac
17403 done
17404
17405 # If the user did not use the arguments to specify the items to instantiate,
17406 # then the envvar interface is used.  Set only those that are not.
17407 # We use the long form for the default assignment because of an extremely
17408 # bizarre bug on SunOS 4.1.3.
17409 if $ac_need_defaults; then
17410   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
17411   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
17412   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
17413 fi
17414
17415 # Create a temporary directory, and hook for its removal unless debugging.
17416 $debug ||
17417 {
17418   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
17419   trap '{ (exit 1); exit 1; }' 1 2 13 15
17420 }
17421
17422 # Create a (secure) tmp directory for tmp files.
17423 : ${TMPDIR=/tmp}
17424 {
17425   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
17426   test -n "$tmp" && test -d "$tmp"
17427 }  ||
17428 {
17429   tmp=$TMPDIR/cs$$-$RANDOM
17430   (umask 077 && mkdir $tmp)
17431 } ||
17432 {
17433    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
17434    { (exit 1); exit 1; }
17435 }
17436
17437 EOF
17438
17439 cat >>$CONFIG_STATUS <<EOF
17440
17441 #
17442 # CONFIG_FILES section.
17443 #
17444
17445 # No need to generate the scripts if there are no CONFIG_FILES.
17446 # This happens for instance when ./config.status config.h
17447 if test -n "\$CONFIG_FILES"; then
17448   # Protect against being on the right side of a sed subst in config.status.
17449   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
17450    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
17451 s,@SHELL@,$SHELL,;t t
17452 s,@exec_prefix@,$exec_prefix,;t t
17453 s,@prefix@,$prefix,;t t
17454 s,@program_transform_name@,$program_transform_name,;t t
17455 s,@bindir@,$bindir,;t t
17456 s,@sbindir@,$sbindir,;t t
17457 s,@libexecdir@,$libexecdir,;t t
17458 s,@datarootdir@,$datarootdir,;t t
17459 s,@datadir@,$datadir,;t t
17460 s,@sysconfdir@,$sysconfdir,;t t
17461 s,@sharedstatedir@,$sharedstatedir,;t t
17462 s,@localstatedir@,$localstatedir,;t t
17463 s,@libdir@,$libdir,;t t
17464 s,@includedir@,$includedir,;t t
17465 s,@oldincludedir@,$oldincludedir,;t t
17466 s,@infodir@,$infodir,;t t
17467 s,@mandir@,$mandir,;t t
17468 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
17469 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
17470 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
17471 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
17472 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
17473 s,@build_alias@,$build_alias,;t t
17474 s,@host_alias@,$host_alias,;t t
17475 s,@target_alias@,$target_alias,;t t
17476 s,@ECHO_C@,$ECHO_C,;t t
17477 s,@ECHO_N@,$ECHO_N,;t t
17478 s,@ECHO_T@,$ECHO_T,;t t
17479 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
17480 s,@DEFS@,$DEFS,;t t
17481 s,@LIBS@,$LIBS,;t t
17482 s,@build@,$build,;t t
17483 s,@build_cpu@,$build_cpu,;t t
17484 s,@build_vendor@,$build_vendor,;t t
17485 s,@build_os@,$build_os,;t t
17486 s,@host@,$host,;t t
17487 s,@host_cpu@,$host_cpu,;t t
17488 s,@host_vendor@,$host_vendor,;t t
17489 s,@host_os@,$host_os,;t t
17490 s,@SET_MAKE@,$SET_MAKE,;t t
17491 s,@CC@,$CC,;t t
17492 s,@CFLAGS@,$CFLAGS,;t t
17493 s,@LDFLAGS@,$LDFLAGS,;t t
17494 s,@CPPFLAGS@,$CPPFLAGS,;t t
17495 s,@ac_ct_CC@,$ac_ct_CC,;t t
17496 s,@EXEEXT@,$EXEEXT,;t t
17497 s,@OBJEXT@,$OBJEXT,;t t
17498 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
17499 s,@CPP@,$CPP,;t t
17500 s,@AWK@,$AWK,;t t
17501 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
17502 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
17503 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
17504 s,@LINT@,$LINT,;t t
17505 s,@LINT_OPTS@,$LINT_OPTS,;t t
17506 s,@CTAGS@,$CTAGS,;t t
17507 s,@ETAGS@,$ETAGS,;t t
17508 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
17509 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
17510 s,@MATH_LIB@,$MATH_LIB,;t t
17511 s,@top_builddir@,$top_builddir,;t t
17512 s,@CC_G_OPT@,$CC_G_OPT,;t t
17513 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
17514 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
17515 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
17516 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
17517 s,@LD@,$LD,;t t
17518 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
17519 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
17520 s,@LD_MODEL@,$LD_MODEL,;t t
17521 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
17522 s,@LIBTOOL@,$LIBTOOL,;t t
17523 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
17524 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
17525 s,@LIB_LINK@,$LIB_LINK,;t t
17526 s,@LINK_TESTS@,$LINK_TESTS,;t t
17527 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
17528 s,@PTHREAD@,$PTHREAD,;t t
17529 s,@TEST_ARGS@,$TEST_ARGS,;t t
17530 s,@TEST_DEPS@,$TEST_DEPS,;t t
17531 s,@TEST_LIBS@,$TEST_LIBS,;t t
17532 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
17533 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
17534 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
17535 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
17536 s,@includesubdir@,$includesubdir,;t t
17537 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
17538 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
17539 s,@ECHO_LT@,$ECHO_LT,;t t
17540 s,@ECHO_LD@,$ECHO_LD,;t t
17541 s,@RULE_CC@,$RULE_CC,;t t
17542 s,@SHOW_CC@,$SHOW_CC,;t t
17543 s,@ECHO_CC@,$ECHO_CC,;t t
17544 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
17545 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
17546 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
17547 s,@X_CFLAGS@,$X_CFLAGS,;t t
17548 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
17549 s,@X_LIBS@,$X_LIBS,;t t
17550 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
17551 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
17552 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
17553 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
17554 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
17555 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
17556 CEOF
17557
17558 EOF
17559
17560   cat >>$CONFIG_STATUS <<\EOF
17561   # Split the substitutions into bite-sized pieces for seds with
17562   # small command number limits, like on Digital OSF/1 and HP-UX.
17563   ac_max_sed_lines=48
17564   ac_sed_frag=1 # Number of current file.
17565   ac_beg=1 # First line for current file.
17566   ac_end=$ac_max_sed_lines # Line after last line for current file.
17567   ac_more_lines=:
17568   ac_sed_cmds=
17569   while $ac_more_lines; do
17570     if test $ac_beg -gt 1; then
17571       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17572     else
17573       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17574     fi
17575     if test ! -s $tmp/subs.frag; then
17576       ac_more_lines=false
17577     else
17578       # The purpose of the label and of the branching condition is to
17579       # speed up the sed processing (if there are no `@' at all, there
17580       # is no need to browse any of the substitutions).
17581       # These are the two extra sed commands mentioned above.
17582       (echo ':t
17583   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
17584       if test -z "$ac_sed_cmds"; then
17585         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
17586       else
17587         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
17588       fi
17589       ac_sed_frag=`expr $ac_sed_frag + 1`
17590       ac_beg=$ac_end
17591       ac_end=`expr $ac_end + $ac_max_sed_lines`
17592     fi
17593   done
17594   if test -z "$ac_sed_cmds"; then
17595     ac_sed_cmds=cat
17596   fi
17597 fi # test -n "$CONFIG_FILES"
17598
17599 EOF
17600 cat >>$CONFIG_STATUS <<\EOF
17601 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
17602   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17603   case $ac_file in
17604   - | *:- | *:-:* ) # input from stdin
17605         cat >$tmp/stdin
17606         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17607         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17608   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17609         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17610   * )   ac_file_in=$ac_file.in ;;
17611   esac
17612
17613   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
17614   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17615          X"$ac_file" : 'X\(//\)[^/]' \| \
17616          X"$ac_file" : 'X\(//\)$' \| \
17617          X"$ac_file" : 'X\(/\)' \| \
17618          .     : '\(.\)' 2>/dev/null ||
17619 echo X"$ac_file" |
17620     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17621           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17622           /^X\(\/\/\)$/{ s//\1/; q; }
17623           /^X\(\/\).*/{ s//\1/; q; }
17624           s/.*/./; q'`
17625   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17626     { case "$ac_dir" in
17627   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17628   *)                      as_incr_dir=.;;
17629 esac
17630 as_dummy="$ac_dir"
17631 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17632   case $as_mkdir_dir in
17633     # Skip DOS drivespec
17634     ?:) as_incr_dir=$as_mkdir_dir ;;
17635     *)
17636       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17637       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17638     ;;
17639   esac
17640 done; }
17641
17642     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
17643     # A "../" for each directory in $ac_dir_suffix.
17644     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
17645   else
17646     ac_dir_suffix= ac_dots=
17647   fi
17648
17649   case $srcdir in
17650   .)  ac_srcdir=.
17651       if test -z "$ac_dots"; then
17652          ac_top_srcdir=.
17653       else
17654          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
17655       fi ;;
17656   [\\/]* | ?:[\\/]* )
17657       ac_srcdir=$srcdir$ac_dir_suffix;
17658       ac_top_srcdir=$srcdir ;;
17659   *) # Relative path.
17660     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
17661     ac_top_srcdir=$ac_dots$srcdir ;;
17662   esac
17663
17664   case $INSTALL in
17665   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
17666   *) ac_INSTALL=$ac_dots$INSTALL ;;
17667   esac
17668
17669   if test x"$ac_file" != x-; then
17670     { echo "$as_me:17670: creating $ac_file" >&5
17671 echo "$as_me: creating $ac_file" >&6;}
17672     rm -f "$ac_file"
17673   fi
17674   # Let's still pretend it is `configure' which instantiates (i.e., don't
17675   # use $as_me), people would be surprised to read:
17676   #    /* config.h.  Generated automatically by config.status.  */
17677   configure_input="Generated automatically from `echo $ac_file_in |
17678                                                  sed 's,.*/,,'` by configure."
17679
17680   # First look for the input files in the build tree, otherwise in the
17681   # src tree.
17682   ac_file_inputs=`IFS=:
17683     for f in $ac_file_in; do
17684       case $f in
17685       -) echo $tmp/stdin ;;
17686       [\\/$]*)
17687          # Absolute (can't be DOS-style, as IFS=:)
17688          test -f "$f" || { { echo "$as_me:17688: error: cannot find input file: $f" >&5
17689 echo "$as_me: error: cannot find input file: $f" >&2;}
17690    { (exit 1); exit 1; }; }
17691          echo $f;;
17692       *) # Relative
17693          if test -f "$f"; then
17694            # Build tree
17695            echo $f
17696          elif test -f "$srcdir/$f"; then
17697            # Source tree
17698            echo $srcdir/$f
17699          else
17700            # /dev/null tree
17701            { { echo "$as_me:17701: error: cannot find input file: $f" >&5
17702 echo "$as_me: error: cannot find input file: $f" >&2;}
17703    { (exit 1); exit 1; }; }
17704          fi;;
17705       esac
17706     done` || { (exit 1); exit 1; }
17707 EOF
17708 cat >>$CONFIG_STATUS <<\EOF
17709   ac_warn_datarootdir=no
17710   if test x"$ac_file" != x-; then
17711     for ac_item in $ac_file_inputs
17712     do
17713       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
17714       if test -n "$ac_seen"; then
17715         ac_used=`grep '@datarootdir@' $ac_item`
17716         if test -z "$ac_used"; then
17717           { echo "$as_me:17717: WARNING: datarootdir was used implicitly but not set:
17718 $ac_seen" >&5
17719 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
17720 $ac_seen" >&2;}
17721           ac_warn_datarootdir=yes
17722         fi
17723       fi
17724       ac_seen=`grep '${datarootdir}' $ac_item`
17725       if test -n "$ac_seen"; then
17726         { echo "$as_me:17726: WARNING: datarootdir was used explicitly but not set:
17727 $ac_seen" >&5
17728 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
17729 $ac_seen" >&2;}
17730         ac_warn_datarootdir=yes
17731       fi
17732     done
17733   fi
17734
17735 if test "x$ac_warn_datarootdir" = xyes; then
17736   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
17737 fi
17738
17739 EOF
17740 cat >>$CONFIG_STATUS <<EOF
17741   sed "$ac_vpsub
17742 $extrasub
17743 EOF
17744 cat >>$CONFIG_STATUS <<\EOF
17745 :t
17746 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17747 s,@configure_input@,$configure_input,;t t
17748 s,@srcdir@,$ac_srcdir,;t t
17749 s,@top_srcdir@,$ac_top_srcdir,;t t
17750 s,@INSTALL@,$ac_INSTALL,;t t
17751 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
17752   rm -f $tmp/stdin
17753   if test x"$ac_file" != x-; then
17754     cp $tmp/out $ac_file
17755
17756     for ac_name in prefix exec_prefix datarootdir
17757     do
17758         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
17759         if test -n "$ac_seen"; then
17760             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
17761             if test -z "$ac_init"; then
17762               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
17763               { echo "$as_me:17763: WARNING: Variable $ac_name is used but was not set:
17764 $ac_seen" >&5
17765 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
17766 $ac_seen" >&2;}
17767             fi
17768         fi
17769     done
17770     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
17771     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
17772     if test -s $tmp/out; then
17773       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
17774       { echo "$as_me:17774: WARNING: Some variables may not be substituted:
17775 $ac_seen" >&5
17776 echo "$as_me: WARNING: Some variables may not be substituted:
17777 $ac_seen" >&2;}
17778     fi
17779   else
17780     cat $tmp/out
17781   fi
17782   rm -f $tmp/out
17783
17784 done
17785 EOF
17786 cat >>$CONFIG_STATUS <<\EOF
17787
17788 #
17789 # CONFIG_HEADER section.
17790 #
17791
17792 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17793 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17794 #
17795 # ac_d sets the value in "#define NAME VALUE" lines.
17796 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17797 ac_dB='[        ].*$,\1#\2'
17798 ac_dC=' '
17799 ac_dD=',;t'
17800 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17801 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17802 ac_iB='\([      ]\),\1#\2define\3'
17803 ac_iC=' '
17804 ac_iD='\4,;t'
17805 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17806 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17807 ac_uB='$,\1#\2define\3'
17808 ac_uC=' '
17809 ac_uD=',;t'
17810
17811 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
17812   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17813   case $ac_file in
17814   - | *:- | *:-:* ) # input from stdin
17815         cat >$tmp/stdin
17816         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17817         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17818   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17819         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17820   * )   ac_file_in=$ac_file.in ;;
17821   esac
17822
17823   test x"$ac_file" != x- && { echo "$as_me:17823: creating $ac_file" >&5
17824 echo "$as_me: creating $ac_file" >&6;}
17825
17826   # First look for the input files in the build tree, otherwise in the
17827   # src tree.
17828   ac_file_inputs=`IFS=:
17829     for f in $ac_file_in; do
17830       case $f in
17831       -) echo $tmp/stdin ;;
17832       [\\/$]*)
17833          # Absolute (can't be DOS-style, as IFS=:)
17834          test -f "$f" || { { echo "$as_me:17834: error: cannot find input file: $f" >&5
17835 echo "$as_me: error: cannot find input file: $f" >&2;}
17836    { (exit 1); exit 1; }; }
17837          echo $f;;
17838       *) # Relative
17839          if test -f "$f"; then
17840            # Build tree
17841            echo $f
17842          elif test -f "$srcdir/$f"; then
17843            # Source tree
17844            echo $srcdir/$f
17845          else
17846            # /dev/null tree
17847            { { echo "$as_me:17847: error: cannot find input file: $f" >&5
17848 echo "$as_me: error: cannot find input file: $f" >&2;}
17849    { (exit 1); exit 1; }; }
17850          fi;;
17851       esac
17852     done` || { (exit 1); exit 1; }
17853   # Remove the trailing spaces.
17854   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
17855
17856 EOF
17857
17858 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
17859 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
17860 # be either 'cat' or 'sort'.
17861 cat confdefs.h | uniq >conftest.vals
17862
17863 # Break up conftest.vals because some shells have a limit on
17864 # the size of here documents, and old seds have small limits too.
17865
17866 rm -f conftest.tail
17867 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
17868 while grep . conftest.vals >/dev/null
17869 do
17870   # Write chunks of a limited-size here document to conftest.frag.
17871   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
17872   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
17873   echo 'CEOF' >> $CONFIG_STATUS
17874   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17875   rm -f conftest.vals
17876   mv conftest.tail conftest.vals
17877 done
17878 rm -f conftest.vals
17879
17880 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
17881 # marker @DEFS@.
17882 echo '  cat >> conftest.edit <<CEOF
17883 /@DEFS@/r conftest.frag
17884 /@DEFS@/d
17885 CEOF
17886 sed -f conftest.edit $tmp/in > $tmp/out
17887 rm -f $tmp/in
17888 mv $tmp/out $tmp/in
17889 rm -f conftest.edit conftest.frag
17890 ' >> $CONFIG_STATUS
17891
17892 cat >>$CONFIG_STATUS <<\EOF
17893   # Let's still pretend it is `configure' which instantiates (i.e., don't
17894   # use $as_me), people would be surprised to read:
17895   #    /* config.h.  Generated automatically by config.status.  */
17896   if test x"$ac_file" = x-; then
17897     echo "/* Generated automatically by configure.  */" >$tmp/config.h
17898   else
17899     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
17900   fi
17901   cat $tmp/in >>$tmp/config.h
17902   rm -f $tmp/in
17903   if test x"$ac_file" != x-; then
17904     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
17905       { echo "$as_me:17905: $ac_file is unchanged" >&5
17906 echo "$as_me: $ac_file is unchanged" >&6;}
17907     else
17908       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17909          X"$ac_file" : 'X\(//\)[^/]' \| \
17910          X"$ac_file" : 'X\(//\)$' \| \
17911          X"$ac_file" : 'X\(/\)' \| \
17912          .     : '\(.\)' 2>/dev/null ||
17913 echo X"$ac_file" |
17914     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17915           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17916           /^X\(\/\/\)$/{ s//\1/; q; }
17917           /^X\(\/\).*/{ s//\1/; q; }
17918           s/.*/./; q'`
17919       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17920         { case "$ac_dir" in
17921   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17922   *)                      as_incr_dir=.;;
17923 esac
17924 as_dummy="$ac_dir"
17925 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17926   case $as_mkdir_dir in
17927     # Skip DOS drivespec
17928     ?:) as_incr_dir=$as_mkdir_dir ;;
17929     *)
17930       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17931       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17932     ;;
17933   esac
17934 done; }
17935
17936       fi
17937       rm -f $ac_file
17938       mv $tmp/config.h $ac_file
17939     fi
17940   else
17941     cat $tmp/config.h
17942     rm -f $tmp/config.h
17943   fi
17944 done
17945 EOF
17946 cat >>$CONFIG_STATUS <<\EOF
17947 #
17948 # CONFIG_COMMANDS section.
17949 #
17950 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17951   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17952   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17953
17954   case $ac_dest in
17955     default )
17956
17957 for cf_dir in .
17958 do
17959         if test ! -d $srcdir/$cf_dir; then
17960                 continue
17961         elif test -f $srcdir/$cf_dir/programs; then
17962                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
17963         fi
17964 done
17965
17966         cat >>Makefile <<TEST_EOF
17967
17968 # These rules are generated so we do not rely on suffix rules, which do not
17969 # work consistently for different make-programs (the '\$(MODEL)/' confuses
17970 # some, and the '\$x' confuses others).
17971 TEST_EOF
17972
17973 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
17974 for N in $LIST
17975 do
17976         cat >>Makefile <<TEST_EOF
17977
17978 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
17979         \$(srcdir)/test.priv.h \\
17980         ncurses_cfg.h
17981         $SHOW_CC
17982         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
17983 TEST_EOF
17984 done
17985
17986 if test -f ../config.guess && test -f ../config.sub
17987 then
17988         cat >>Makefile <<TEST_EOF
17989
17990 # if we used CF_INHERIT for getting these files, we can remove them
17991 distclean::
17992         rm -f config.guess config.sub
17993 TEST_EOF
17994 fi
17995  ;;
17996   esac
17997 done
17998 EOF
17999
18000 cat >>$CONFIG_STATUS <<\EOF
18001
18002 { (exit 0); exit 0; }
18003 EOF
18004 chmod +x $CONFIG_STATUS
18005 ac_clean_files=$ac_clean_files_save
18006
18007 # configure is writing to config.log, and then calls config.status.
18008 # config.status does its own redirection, appending to config.log.
18009 # Unfortunately, on DOS this fails, as config.log is still kept open
18010 # by configure, so config.status won't be able to write to it; its
18011 # output is simply discarded.  So we exec the FD to /dev/null,
18012 # effectively closing config.log, so it can be properly (re)opened and
18013 # appended to by config.status.  When coming back to configure, we
18014 # need to make the FD available again.
18015 if test "$no_create" != yes; then
18016   ac_cs_success=:
18017   exec 5>/dev/null
18018   $SHELL $CONFIG_STATUS || ac_cs_success=false
18019   exec 5>>config.log
18020   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18021   # would make configure fail if this is the last instruction.
18022   $ac_cs_success || { (exit 1); exit 1; }
18023 fi
18024