]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.0 - patch 20160903
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20150926.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${datarootdir}/info'
146 mandir='${datarootdir}/man'
147
148 # Identity of this package.
149 PACKAGE_NAME=
150 PACKAGE_TARNAME=
151 PACKAGE_VERSION=
152 PACKAGE_STRING=
153 PACKAGE_BUGREPORT=
154
155 ac_prev=
156 for ac_option
157 do
158   # If the previous option needs an argument, assign it.
159   if test -n "$ac_prev"; then
160     eval "$ac_prev=\$ac_option"
161     ac_prev=
162     continue
163   fi
164
165   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
166
167   # Accept the important Cygnus configure options, so we can diagnose typos.
168
169   case $ac_option in
170
171   -bindir | --bindir | --bindi | --bind | --bin | --bi)
172     ac_prev=bindir ;;
173   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
174     bindir=$ac_optarg ;;
175
176   -build | --build | --buil | --bui | --bu)
177     ac_prev=build_alias ;;
178   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
179     build_alias=$ac_optarg ;;
180
181   -cache-file | --cache-file | --cache-fil | --cache-fi \
182   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
183     ac_prev=cache_file ;;
184   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
185   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
186     cache_file=$ac_optarg ;;
187
188   --config-cache | -C)
189     cache_file=config.cache ;;
190
191   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
192     ac_prev=datadir ;;
193   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
194   | --da=*)
195     datadir=$ac_optarg ;;
196
197   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
198   | --dataroo | --dataro | --datar)
199     ac_prev=datarootdir ;;
200   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
201   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
202     datarootdir=$ac_optarg ;;
203
204   -disable-* | --disable-*)
205     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
206     # Reject names that are not valid shell variable names.
207     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
208       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
209    { (exit 1); exit 1; }; }
210     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
211     eval "enable_$ac_feature=no" ;;
212
213   -enable-* | --enable-*)
214     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
215     # Reject names that are not valid shell variable names.
216     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
217       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
218    { (exit 1); exit 1; }; }
219     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
220     case $ac_option in
221       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
222       *) ac_optarg=yes ;;
223     esac
224     eval "enable_$ac_feature='$ac_optarg'" ;;
225
226   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
227   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
228   | --exec | --exe | --ex)
229     ac_prev=exec_prefix ;;
230   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
231   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
232   | --exec=* | --exe=* | --ex=*)
233     exec_prefix=$ac_optarg ;;
234
235   -gas | --gas | --ga | --g)
236     # Obsolete; use --with-gas.
237     with_gas=yes ;;
238
239   -help | --help | --hel | --he | -h)
240     ac_init_help=long ;;
241   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
242     ac_init_help=recursive ;;
243   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
244     ac_init_help=short ;;
245
246   -host | --host | --hos | --ho)
247     ac_prev=host_alias ;;
248   -host=* | --host=* | --hos=* | --ho=*)
249     host_alias=$ac_optarg ;;
250
251   -includedir | --includedir | --includedi | --included | --include \
252   | --includ | --inclu | --incl | --inc)
253     ac_prev=includedir ;;
254   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
255   | --includ=* | --inclu=* | --incl=* | --inc=*)
256     includedir=$ac_optarg ;;
257
258   -infodir | --infodir | --infodi | --infod | --info | --inf)
259     ac_prev=infodir ;;
260   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
261     infodir=$ac_optarg ;;
262
263   -libdir | --libdir | --libdi | --libd)
264     ac_prev=libdir ;;
265   -libdir=* | --libdir=* | --libdi=* | --libd=*)
266     libdir=$ac_optarg ;;
267
268   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
269   | --libexe | --libex | --libe)
270     ac_prev=libexecdir ;;
271   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
272   | --libexe=* | --libex=* | --libe=*)
273     libexecdir=$ac_optarg ;;
274
275   -localstatedir | --localstatedir | --localstatedi | --localstated \
276   | --localstate | --localstat | --localsta | --localst \
277   | --locals | --local | --loca | --loc | --lo)
278     ac_prev=localstatedir ;;
279   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
280   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
281   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
282     localstatedir=$ac_optarg ;;
283
284   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
285     ac_prev=mandir ;;
286   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
287     mandir=$ac_optarg ;;
288
289   -nfp | --nfp | --nf)
290     # Obsolete; use --without-fp.
291     with_fp=no ;;
292
293   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
294   | --no-cr | --no-c)
295     no_create=yes ;;
296
297   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
298   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
299     no_recursion=yes ;;
300
301   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
302   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
303   | --oldin | --oldi | --old | --ol | --o)
304     ac_prev=oldincludedir ;;
305   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
306   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
307   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
308     oldincludedir=$ac_optarg ;;
309
310   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
311     ac_prev=prefix ;;
312   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
313     prefix=$ac_optarg ;;
314
315   -program-prefix | --program-prefix | --program-prefi | --program-pref \
316   | --program-pre | --program-pr | --program-p)
317     ac_prev=program_prefix ;;
318   -program-prefix=* | --program-prefix=* | --program-prefi=* \
319   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
320     program_prefix=$ac_optarg ;;
321
322   -program-suffix | --program-suffix | --program-suffi | --program-suff \
323   | --program-suf | --program-su | --program-s)
324     ac_prev=program_suffix ;;
325   -program-suffix=* | --program-suffix=* | --program-suffi=* \
326   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
327     program_suffix=$ac_optarg ;;
328
329   -program-transform-name | --program-transform-name \
330   | --program-transform-nam | --program-transform-na \
331   | --program-transform-n | --program-transform- \
332   | --program-transform | --program-transfor \
333   | --program-transfo | --program-transf \
334   | --program-trans | --program-tran \
335   | --progr-tra | --program-tr | --program-t)
336     ac_prev=program_transform_name ;;
337   -program-transform-name=* | --program-transform-name=* \
338   | --program-transform-nam=* | --program-transform-na=* \
339   | --program-transform-n=* | --program-transform-=* \
340   | --program-transform=* | --program-transfor=* \
341   | --program-transfo=* | --program-transf=* \
342   | --program-trans=* | --program-tran=* \
343   | --progr-tra=* | --program-tr=* | --program-t=*)
344     program_transform_name=$ac_optarg ;;
345
346   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
347   | -silent | --silent | --silen | --sile | --sil)
348     silent=yes ;;
349
350   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
351     ac_prev=sbindir ;;
352   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
353   | --sbi=* | --sb=*)
354     sbindir=$ac_optarg ;;
355
356   -sharedstatedir | --sharedstatedir | --sharedstatedi \
357   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
358   | --sharedst | --shareds | --shared | --share | --shar \
359   | --sha | --sh)
360     ac_prev=sharedstatedir ;;
361   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
362   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
363   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
364   | --sha=* | --sh=*)
365     sharedstatedir=$ac_optarg ;;
366
367   -site | --site | --sit)
368     ac_prev=site ;;
369   -site=* | --site=* | --sit=*)
370     site=$ac_optarg ;;
371
372   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
373     ac_prev=srcdir ;;
374   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
375     srcdir=$ac_optarg ;;
376
377   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
378   | --syscon | --sysco | --sysc | --sys | --sy)
379     ac_prev=sysconfdir ;;
380   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
381   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
382     sysconfdir=$ac_optarg ;;
383
384   -target | --target | --targe | --targ | --tar | --ta | --t)
385     ac_prev=target_alias ;;
386   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
387     target_alias=$ac_optarg ;;
388
389   -v | -verbose | --verbose | --verbos | --verbo | --verb)
390     verbose=yes ;;
391
392   -version | --version | --versio | --versi | --vers | -V)
393     ac_init_version=: ;;
394
395   -with-* | --with-*)
396     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
397     # Reject names that are not valid shell variable names.
398     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
399       { echo "$as_me: error: invalid package name: $ac_package" >&2
400    { (exit 1); exit 1; }; }
401     ac_package=`echo $ac_package| sed 's/-/_/g'`
402     case $ac_option in
403       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
404       *) ac_optarg=yes ;;
405     esac
406     eval "with_$ac_package='$ac_optarg'" ;;
407
408   -without-* | --without-*)
409     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
410     # Reject names that are not valid shell variable names.
411     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
412       { echo "$as_me: error: invalid package name: $ac_package" >&2
413    { (exit 1); exit 1; }; }
414     ac_package=`echo $ac_package | sed 's/-/_/g'`
415     eval "with_$ac_package=no" ;;
416
417   --x)
418     # Obsolete; use --with-x.
419     with_x=yes ;;
420
421   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
422   | --x-incl | --x-inc | --x-in | --x-i)
423     ac_prev=x_includes ;;
424   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
425   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
426     x_includes=$ac_optarg ;;
427
428   -x-libraries | --x-libraries | --x-librarie | --x-librari \
429   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
430     ac_prev=x_libraries ;;
431   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
432   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
433     x_libraries=$ac_optarg ;;
434
435   -*) { echo "$as_me: error: unrecognized option: $ac_option
436 Try \`$0 --help' for more information." >&2
437    { (exit 1); exit 1; }; }
438     ;;
439
440   *=*)
441     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
442     # Reject names that are not valid shell variable names.
443     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
444       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
445    { (exit 1); exit 1; }; }
446     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
447     eval "$ac_envvar='$ac_optarg'"
448     export $ac_envvar ;;
449
450   *)
451     # FIXME: should be removed in autoconf 3.0.
452     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
453     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
454       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
455     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
456     ;;
457
458   esac
459 done
460
461 if test -n "$ac_prev"; then
462   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
463   { echo "$as_me: error: missing argument to $ac_option" >&2
464    { (exit 1); exit 1; }; }
465 fi
466
467 # Be sure to have absolute paths.
468 for ac_var in exec_prefix prefix
469 do
470   eval ac_val=$`echo $ac_var`
471   case $ac_val in
472     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
473     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
474    { (exit 1); exit 1; }; };;
475   esac
476 done
477
478 # Be sure to have absolute paths.
479 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
480               localstatedir libdir includedir oldincludedir infodir mandir
481 do
482   eval ac_val=$`echo $ac_var`
483   case $ac_val in
484     [\\/$]* | ?:[\\/]* ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # There might be people who depend on the old broken behavior: `$host'
491 # used to hold the argument of --host etc.
492 build=$build_alias
493 host=$host_alias
494 target=$target_alias
495
496 # FIXME: should be removed in autoconf 3.0.
497 if test "x$host_alias" != x; then
498   if test "x$build_alias" = x; then
499     cross_compiling=maybe
500     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
501     If a cross compiler is detected then cross compile mode will be used." >&2
502   elif test "x$build_alias" != "x$host_alias"; then
503     cross_compiling=yes
504   fi
505 fi
506
507 ac_tool_prefix=
508 test -n "$host_alias" && ac_tool_prefix=$host_alias-
509
510 test "$silent" = yes && exec 6>/dev/null
511
512 # Find the source files, if location was not specified.
513 if test -z "$srcdir"; then
514   ac_srcdir_defaulted=yes
515   # Try the directory containing this script, then its parent.
516   ac_prog=$0
517   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
518   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
519   srcdir=$ac_confdir
520   if test ! -r $srcdir/$ac_unique_file; then
521     srcdir=..
522   fi
523 else
524   ac_srcdir_defaulted=no
525 fi
526 if test ! -r $srcdir/$ac_unique_file; then
527   if test "$ac_srcdir_defaulted" = yes; then
528     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
529    { (exit 1); exit 1; }; }
530   else
531     { echo "$as_me: error: cannot find sources in $srcdir" >&2
532    { (exit 1); exit 1; }; }
533   fi
534 fi
535 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
536 ac_env_build_alias_set=${build_alias+set}
537 ac_env_build_alias_value=$build_alias
538 ac_cv_env_build_alias_set=${build_alias+set}
539 ac_cv_env_build_alias_value=$build_alias
540 ac_env_host_alias_set=${host_alias+set}
541 ac_env_host_alias_value=$host_alias
542 ac_cv_env_host_alias_set=${host_alias+set}
543 ac_cv_env_host_alias_value=$host_alias
544 ac_env_target_alias_set=${target_alias+set}
545 ac_env_target_alias_value=$target_alias
546 ac_cv_env_target_alias_set=${target_alias+set}
547 ac_cv_env_target_alias_value=$target_alias
548 ac_env_CC_set=${CC+set}
549 ac_env_CC_value=$CC
550 ac_cv_env_CC_set=${CC+set}
551 ac_cv_env_CC_value=$CC
552 ac_env_CFLAGS_set=${CFLAGS+set}
553 ac_env_CFLAGS_value=$CFLAGS
554 ac_cv_env_CFLAGS_set=${CFLAGS+set}
555 ac_cv_env_CFLAGS_value=$CFLAGS
556 ac_env_LDFLAGS_set=${LDFLAGS+set}
557 ac_env_LDFLAGS_value=$LDFLAGS
558 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
559 ac_cv_env_LDFLAGS_value=$LDFLAGS
560 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
561 ac_env_CPPFLAGS_value=$CPPFLAGS
562 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
563 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
564 ac_env_CPP_set=${CPP+set}
565 ac_env_CPP_value=$CPP
566 ac_cv_env_CPP_set=${CPP+set}
567 ac_cv_env_CPP_value=$CPP
568
569 #
570 # Report the --help message.
571 #
572 if test "$ac_init_help" = "long"; then
573   # Omit some internal or obsolete options to make the list less imposing.
574   # This message is too long to be a string in the A/UX 3.1 sh.
575   cat <<EOF
576 \`configure' configures this package to adapt to many kinds of systems.
577
578 Usage: $0 [OPTION]... [VAR=VALUE]...
579
580 To assign environment variables (e.g., CC, CFLAGS...), specify them as
581 VAR=VALUE.  See below for descriptions of some of the useful variables.
582
583 Defaults for the options are specified in brackets.
584
585 Configuration:
586   -h, --help              display this help and exit
587       --help=short        display options specific to this package
588       --help=recursive    display the short help of all the included packages
589   -V, --version           display version information and exit
590   -q, --quiet, --silent   do not print \`checking...' messages
591       --cache-file=FILE   cache test results in FILE [disabled]
592   -C, --config-cache      alias for \`--cache-file=config.cache'
593   -n, --no-create         do not create output files
594       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
595
596 EOF
597
598   cat <<EOF
599 Installation directories:
600   --prefix=PREFIX         install architecture-independent files in PREFIX
601                           [$ac_default_prefix]
602   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
603                           [PREFIX]
604
605 By default, \`make install' will install all the files in
606 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
607 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
608 for instance \`--prefix=\$HOME'.
609
610 For better control, use the options below.
611
612 Fine tuning of the installation directories:
613   --bindir=DIR            user executables [EPREFIX/bin]
614   --sbindir=DIR           system admin executables [EPREFIX/sbin]
615   --libexecdir=DIR        program executables [EPREFIX/libexec]
616   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
617   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
618   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
619   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
620   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
621   --libdir=DIR            object code libraries [EPREFIX/lib]
622   --includedir=DIR        C header files [PREFIX/include]
623   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
624   --infodir=DIR           info documentation [DATAROOTDIR/info]
625   --mandir=DIR            man documentation [DATAROOTDIR/man]
626 EOF
627
628   cat <<\EOF
629
630 Program names:
631   --program-prefix=PREFIX            prepend PREFIX to installed program names
632   --program-suffix=SUFFIX            append SUFFIX to installed program names
633   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
634
635 X features:
636   --x-includes=DIR    X include files are in DIR
637   --x-libraries=DIR   X library files are in DIR
638
639 System types:
640   --build=BUILD           configure for building on BUILD [guessed]
641   --host=HOST       build programs to run on HOST [BUILD]
642 EOF
643 fi
644
645 if test -n "$ac_init_help"; then
646
647   cat <<\EOF
648
649 Optional 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-screen=XXX       use specified curses-libraries
665   --with-ncursesw         use wide ncurses-libraries
666   --with-ncurses          use ncurses-libraries
667   --with-pdcurses         compile/link with pdcurses X11 library
668   --with-curses-colr      compile/link with HPUX 10.x color-curses
669   --with-curses-5lib      compile/link with SunOS 5lib curses
670   --with-Xaw3d            link with Xaw 3d library
671   --with-Xaw3dxft         link with Xaw 3d xft library
672   --with-neXtaw           link with neXT Athena library
673   --with-XawPlus          link with Athena-Plus library
674   --with-x                use the X Window System
675 Testing/development Options:
676   --enable-warnings       test: turn on gcc compiler warnings
677   --with-dmalloc          test: use Gray Watson's dmalloc library
678   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
679   --with-valgrind         test: use valgrind
680   --disable-leaks         test: free permanent memory, analyze leaks
681   --disable-rpath-hack    don't add rpath options for additional libraries
682
683 Some influential environment variables:
684   CC          C compiler command
685   CFLAGS      C compiler flags
686   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
687               nonstandard directory <lib dir>
688   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
689               headers in a nonstandard directory <include dir>
690   CPP         C preprocessor
691
692 Use these variables to override the choices made by `configure' or to help
693 it to find libraries and programs with nonstandard names/locations.
694
695 EOF
696 fi
697
698 if test "$ac_init_help" = "recursive"; then
699   # If there are subdirs, report their specific --help.
700   ac_popdir=`pwd`
701   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
702     cd $ac_subdir
703     # A "../" for each directory in /$ac_subdir.
704     ac_dots=`echo $ac_subdir |
705              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
706
707     case $srcdir in
708     .) # No --srcdir option.  We are building in place.
709       ac_sub_srcdir=$srcdir ;;
710     [\\/]* | ?:[\\/]* ) # Absolute path.
711       ac_sub_srcdir=$srcdir/$ac_subdir ;;
712     *) # Relative path.
713       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
714     esac
715
716     # Check for guested configure; otherwise get Cygnus style configure.
717     if test -f $ac_sub_srcdir/configure.gnu; then
718       echo
719       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
720     elif test -f $ac_sub_srcdir/configure; then
721       echo
722       $SHELL $ac_sub_srcdir/configure  --help=recursive
723     elif test -f $ac_sub_srcdir/configure.ac ||
724            test -f $ac_sub_srcdir/configure.in; then
725       echo
726       $ac_configure --help
727     else
728       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
729     fi
730     cd $ac_popdir
731   done
732 fi
733
734 test -n "$ac_init_help" && exit 0
735 if $ac_init_version; then
736   cat <<\EOF
737
738 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
739 Free Software Foundation, Inc.
740 This configure script is free software; the Free Software Foundation
741 gives unlimited permission to copy, distribute and modify it.
742 EOF
743   exit 0
744 fi
745 exec 5>config.log
746 cat >&5 <<EOF
747 This file contains any messages produced by compilers while
748 running configure, to aid debugging if configure makes a mistake.
749
750 It was created by $as_me, which was
751 generated by GNU Autoconf 2.52.20150926.  Invocation command line was
752
753   $ $0 $@
754
755 EOF
756 {
757 cat <<_ASUNAME
758 ## ---------- ##
759 ## Platform.  ##
760 ## ---------- ##
761
762 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
763 uname -m = `(uname -m) 2>/dev/null || echo unknown`
764 uname -r = `(uname -r) 2>/dev/null || echo unknown`
765 uname -s = `(uname -s) 2>/dev/null || echo unknown`
766 uname -v = `(uname -v) 2>/dev/null || echo unknown`
767
768 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
769 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
770
771 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
772 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
773 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
774 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
775 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
776 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
777 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
778
779 PATH = $PATH
780
781 _ASUNAME
782 } >&5
783
784 cat >&5 <<EOF
785 ## ------------ ##
786 ## Core tests.  ##
787 ## ------------ ##
788
789 EOF
790
791 # Keep a trace of the command line.
792 # Strip out --no-create and --no-recursion so they do not pile up.
793 # Also quote any args containing shell meta-characters.
794 ac_configure_args=
795 ac_sep=
796 for ac_arg
797 do
798   case $ac_arg in
799   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
800   | --no-cr | --no-c) ;;
801   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
802   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
803   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
804     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
805     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
806     ac_sep=" " ;;
807   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
808      ac_sep=" " ;;
809   esac
810   # Get rid of the leading space.
811 done
812
813 # When interrupted or exit'd, cleanup temporary files, and complete
814 # config.log.  We remove comments because anyway the quotes in there
815 # would cause problems or look ugly.
816 trap 'exit_status=$?
817   # Save into config.log some information that might help in debugging.
818   echo >&5
819   echo "## ----------------- ##" >&5
820   echo "## Cache variables.  ##" >&5
821   echo "## ----------------- ##" >&5
822   echo >&5
823   # The following way of writing the cache mishandles newlines in values,
824 {
825   (set) 2>&1 |
826     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
827     *ac_space=\ *)
828       sed -n \
829         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
830           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
831       ;;
832     *)
833       sed -n \
834         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
835       ;;
836     esac;
837 } >&5
838   sed "/^$/d" confdefs.h >conftest.log
839   if test -s conftest.log; then
840     echo >&5
841     echo "## ------------ ##" >&5
842     echo "## confdefs.h.  ##" >&5
843     echo "## ------------ ##" >&5
844     echo >&5
845     cat conftest.log >&5
846   fi
847   (echo; echo) >&5
848   test "$ac_signal" != 0 &&
849     echo "$as_me: caught signal $ac_signal" >&5
850   echo "$as_me: exit $exit_status" >&5
851   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
852     exit $exit_status
853      ' 0
854 for ac_signal in 1 2 13 15; do
855   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
856 done
857 ac_signal=0
858
859 # confdefs.h avoids OS command line length limits that DEFS can exceed.
860 rm -rf conftest* confdefs.h
861 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
862 echo >confdefs.h
863
864 # Let the site file select an alternate cache file if it wants to.
865 # Prefer explicitly selected file to automatically selected ones.
866 if test -z "$CONFIG_SITE"; then
867   if test "x$prefix" != xNONE; then
868     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
869   else
870     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
871   fi
872 fi
873 for ac_site_file in $CONFIG_SITE; do
874   if test -r "$ac_site_file"; then
875     { echo "$as_me:875: loading site script $ac_site_file" >&5
876 echo "$as_me: loading site script $ac_site_file" >&6;}
877     cat "$ac_site_file" >&5
878     . "$ac_site_file"
879   fi
880 done
881
882 if test -r "$cache_file"; then
883   # Some versions of bash will fail to source /dev/null (special
884   # files actually), so we avoid doing that.
885   if test -f "$cache_file"; then
886     { echo "$as_me:886: loading cache $cache_file" >&5
887 echo "$as_me: loading cache $cache_file" >&6;}
888     case $cache_file in
889       [\\/]* | ?:[\\/]* ) . $cache_file;;
890       *)                      . ./$cache_file;;
891     esac
892   fi
893 else
894   { echo "$as_me:894: creating cache $cache_file" >&5
895 echo "$as_me: creating cache $cache_file" >&6;}
896   >$cache_file
897 fi
898
899 # Check that the precious variables saved in the cache have kept the same
900 # value.
901 ac_cache_corrupted=false
902 for ac_var in `(set) 2>&1 |
903                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
904   eval ac_old_set=\$ac_cv_env_${ac_var}_set
905   eval ac_new_set=\$ac_env_${ac_var}_set
906   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
907   eval ac_new_val="\$ac_env_${ac_var}_value"
908   case $ac_old_set,$ac_new_set in
909     set,)
910       { echo "$as_me:910: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
911 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
912       ac_cache_corrupted=: ;;
913     ,set)
914       { echo "$as_me:914: error: \`$ac_var' was not set in the previous run" >&5
915 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
916       ac_cache_corrupted=: ;;
917     ,);;
918     *)
919       if test "x$ac_old_val" != "x$ac_new_val"; then
920         { echo "$as_me:920: error: \`$ac_var' has changed since the previous run:" >&5
921 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
922         { echo "$as_me:922:   former value:  $ac_old_val" >&5
923 echo "$as_me:   former value:  $ac_old_val" >&2;}
924         { echo "$as_me:924:   current value: $ac_new_val" >&5
925 echo "$as_me:   current value: $ac_new_val" >&2;}
926         ac_cache_corrupted=:
927       fi;;
928   esac
929   # Pass precious variables to config.status.  It doesn't matter if
930   # we pass some twice (in addition to the command line arguments).
931   if test "$ac_new_set" = set; then
932     case $ac_new_val in
933     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
934       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
935       ac_configure_args="$ac_configure_args '$ac_arg'"
936       ;;
937     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
938        ;;
939     esac
940   fi
941 done
942 if $ac_cache_corrupted; then
943   { echo "$as_me:943: error: changes in the environment can compromise the build" >&5
944 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
945   { { echo "$as_me:945: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
946 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
947    { (exit 1); exit 1; }; }
948 fi
949
950 ac_ext=c
951 ac_cpp='$CPP $CPPFLAGS'
952 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
953 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
954 ac_compiler_gnu=$ac_cv_c_compiler_gnu
955 ac_main_return=return
956
957 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
958   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
959                    ECHO_T='     ' ;;
960   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
961   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
962 esac
963 echo "#! $SHELL" >conftest.sh
964 echo  "exit 0"   >>conftest.sh
965 chmod +x conftest.sh
966 if { (echo "$as_me:966: PATH=\".;.\"; conftest.sh") >&5
967   (PATH=".;."; conftest.sh) 2>&5
968   ac_status=$?
969   echo "$as_me:969: \$? = $ac_status" >&5
970   (exit $ac_status); }; then
971   ac_path_separator=';'
972 else
973   ac_path_separator=:
974 fi
975 PATH_SEPARATOR="$ac_path_separator"
976 rm -f conftest.sh
977
978 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
979
980 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
981
982 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
983
984 ac_aux_dir=
985 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
986   if test -f $ac_dir/install-sh; then
987     ac_aux_dir=$ac_dir
988     ac_install_sh="$ac_aux_dir/install-sh -c"
989     break
990   elif test -f $ac_dir/install.sh; then
991     ac_aux_dir=$ac_dir
992     ac_install_sh="$ac_aux_dir/install.sh -c"
993     break
994   elif test -f $ac_dir/shtool; then
995     ac_aux_dir=$ac_dir
996     ac_install_sh="$ac_aux_dir/shtool install -c"
997     break
998   fi
999 done
1000 if test -z "$ac_aux_dir"; then
1001   { { echo "$as_me:1001: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1002 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1003    { (exit 1); exit 1; }; }
1004 fi
1005 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1006 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1007 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1008
1009 # Make sure we can run config.sub.
1010 $ac_config_sub sun4 >/dev/null 2>&1 ||
1011   { { echo "$as_me:1011: error: cannot run $ac_config_sub" >&5
1012 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1013    { (exit 1); exit 1; }; }
1014
1015 echo "$as_me:1015: checking build system type" >&5
1016 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1017 if test "${ac_cv_build+set}" = set; then
1018   echo $ECHO_N "(cached) $ECHO_C" >&6
1019 else
1020   ac_cv_build_alias=$build_alias
1021 test -z "$ac_cv_build_alias" &&
1022   ac_cv_build_alias=`$ac_config_guess`
1023 test -z "$ac_cv_build_alias" &&
1024   { { echo "$as_me:1024: error: cannot guess build type; you must specify one" >&5
1025 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1026    { (exit 1); exit 1; }; }
1027 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1028   { { echo "$as_me:1028: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1029 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1030    { (exit 1); exit 1; }; }
1031
1032 fi
1033 echo "$as_me:1033: result: $ac_cv_build" >&5
1034 echo "${ECHO_T}$ac_cv_build" >&6
1035 build=$ac_cv_build
1036 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1037 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1038 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1039
1040 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1041         echo "$as_me:1041: checking host system type" >&5
1042 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1043 if test "${ac_cv_host+set}" = set; then
1044   echo $ECHO_N "(cached) $ECHO_C" >&6
1045 else
1046   ac_cv_host_alias=$host_alias
1047 test -z "$ac_cv_host_alias" &&
1048   ac_cv_host_alias=$ac_cv_build_alias
1049 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1050   { { echo "$as_me:1050: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1051 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1052    { (exit 1); exit 1; }; }
1053
1054 fi
1055 echo "$as_me:1055: result: $ac_cv_host" >&5
1056 echo "${ECHO_T}$ac_cv_host" >&6
1057 host=$ac_cv_host
1058 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1059 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1060 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1061
1062         system_name="$host_os"
1063 else
1064         system_name="`(uname -s -r) 2>/dev/null`"
1065         if test -z "$system_name" ; then
1066                 system_name="`(hostname) 2>/dev/null`"
1067         fi
1068 fi
1069 test -n "$system_name" &&
1070 cat >>confdefs.h <<EOF
1071 #define SYSTEM_NAME "$system_name"
1072 EOF
1073
1074 if test "${cf_cv_system_name+set}" = set; then
1075   echo $ECHO_N "(cached) $ECHO_C" >&6
1076 else
1077   cf_cv_system_name="$system_name"
1078 fi
1079
1080 test -z "$system_name" && system_name="$cf_cv_system_name"
1081 test -n "$cf_cv_system_name" && echo "$as_me:1081: result: Configuring for $cf_cv_system_name" >&5
1082 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1083
1084 if test ".$system_name" != ".$cf_cv_system_name" ; then
1085         echo "$as_me:1085: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1086 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1087         { { echo "$as_me:1087: error: \"Please remove config.cache and try again.\"" >&5
1088 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1089    { (exit 1); exit 1; }; }
1090 fi
1091
1092 test "$program_prefix" != NONE &&
1093   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1094 # Use a double $ so make ignores it.
1095 test "$program_suffix" != NONE &&
1096   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1097 # Double any \ or $.  echo might interpret backslashes.
1098 # By default was `s,x,x', remove it if useless.
1099 cat <<\_ACEOF >conftest.sed
1100 s/[\\$]/&&/g;s/;s,x,x,$//
1101 _ACEOF
1102 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1103 rm conftest.sed
1104
1105 echo "$as_me:1105: checking whether ${MAKE-make} sets \${MAKE}" >&5
1106 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1107 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1108 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1109   echo $ECHO_N "(cached) $ECHO_C" >&6
1110 else
1111   cat >conftest.make <<\EOF
1112 all:
1113         @echo 'ac_maketemp="${MAKE}"'
1114 EOF
1115 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1116 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1117 if test -n "$ac_maketemp"; then
1118   eval ac_cv_prog_make_${ac_make}_set=yes
1119 else
1120   eval ac_cv_prog_make_${ac_make}_set=no
1121 fi
1122 rm -f conftest.make
1123 fi
1124 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1125   echo "$as_me:1125: result: yes" >&5
1126 echo "${ECHO_T}yes" >&6
1127   SET_MAKE=
1128 else
1129   echo "$as_me:1129: result: no" >&5
1130 echo "${ECHO_T}no" >&6
1131   SET_MAKE="MAKE=${MAKE-make}"
1132 fi
1133
1134 ac_ext=c
1135 ac_cpp='$CPP $CPPFLAGS'
1136 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1137 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1138 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1139 ac_main_return=return
1140 if test -n "$ac_tool_prefix"; then
1141   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1142 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1143 echo "$as_me:1143: checking for $ac_word" >&5
1144 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1145 if test "${ac_cv_prog_CC+set}" = set; then
1146   echo $ECHO_N "(cached) $ECHO_C" >&6
1147 else
1148   if test -n "$CC"; then
1149   ac_cv_prog_CC="$CC" # Let the user override the test.
1150 else
1151   ac_save_IFS=$IFS; IFS=$ac_path_separator
1152 ac_dummy="$PATH"
1153 for ac_dir in $ac_dummy; do
1154   IFS=$ac_save_IFS
1155   test -z "$ac_dir" && ac_dir=.
1156   $as_executable_p "$ac_dir/$ac_word" || continue
1157 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1158 echo "$as_me:1158: found $ac_dir/$ac_word" >&5
1159 break
1160 done
1161
1162 fi
1163 fi
1164 CC=$ac_cv_prog_CC
1165 if test -n "$CC"; then
1166   echo "$as_me:1166: result: $CC" >&5
1167 echo "${ECHO_T}$CC" >&6
1168 else
1169   echo "$as_me:1169: result: no" >&5
1170 echo "${ECHO_T}no" >&6
1171 fi
1172
1173 fi
1174 if test -z "$ac_cv_prog_CC"; then
1175   ac_ct_CC=$CC
1176   # Extract the first word of "gcc", so it can be a program name with args.
1177 set dummy gcc; ac_word=$2
1178 echo "$as_me:1178: checking for $ac_word" >&5
1179 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1180 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1181   echo $ECHO_N "(cached) $ECHO_C" >&6
1182 else
1183   if test -n "$ac_ct_CC"; then
1184   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1185 else
1186   ac_save_IFS=$IFS; IFS=$ac_path_separator
1187 ac_dummy="$PATH"
1188 for ac_dir in $ac_dummy; do
1189   IFS=$ac_save_IFS
1190   test -z "$ac_dir" && ac_dir=.
1191   $as_executable_p "$ac_dir/$ac_word" || continue
1192 ac_cv_prog_ac_ct_CC="gcc"
1193 echo "$as_me:1193: found $ac_dir/$ac_word" >&5
1194 break
1195 done
1196
1197 fi
1198 fi
1199 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1200 if test -n "$ac_ct_CC"; then
1201   echo "$as_me:1201: result: $ac_ct_CC" >&5
1202 echo "${ECHO_T}$ac_ct_CC" >&6
1203 else
1204   echo "$as_me:1204: result: no" >&5
1205 echo "${ECHO_T}no" >&6
1206 fi
1207
1208   CC=$ac_ct_CC
1209 else
1210   CC="$ac_cv_prog_CC"
1211 fi
1212
1213 if test -z "$CC"; then
1214   if test -n "$ac_tool_prefix"; then
1215   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1216 set dummy ${ac_tool_prefix}cc; ac_word=$2
1217 echo "$as_me:1217: checking for $ac_word" >&5
1218 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1219 if test "${ac_cv_prog_CC+set}" = set; then
1220   echo $ECHO_N "(cached) $ECHO_C" >&6
1221 else
1222   if test -n "$CC"; then
1223   ac_cv_prog_CC="$CC" # Let the user override the test.
1224 else
1225   ac_save_IFS=$IFS; IFS=$ac_path_separator
1226 ac_dummy="$PATH"
1227 for ac_dir in $ac_dummy; do
1228   IFS=$ac_save_IFS
1229   test -z "$ac_dir" && ac_dir=.
1230   $as_executable_p "$ac_dir/$ac_word" || continue
1231 ac_cv_prog_CC="${ac_tool_prefix}cc"
1232 echo "$as_me:1232: found $ac_dir/$ac_word" >&5
1233 break
1234 done
1235
1236 fi
1237 fi
1238 CC=$ac_cv_prog_CC
1239 if test -n "$CC"; then
1240   echo "$as_me:1240: result: $CC" >&5
1241 echo "${ECHO_T}$CC" >&6
1242 else
1243   echo "$as_me:1243: result: no" >&5
1244 echo "${ECHO_T}no" >&6
1245 fi
1246
1247 fi
1248 if test -z "$ac_cv_prog_CC"; then
1249   ac_ct_CC=$CC
1250   # Extract the first word of "cc", so it can be a program name with args.
1251 set dummy cc; ac_word=$2
1252 echo "$as_me:1252: checking for $ac_word" >&5
1253 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1254 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1255   echo $ECHO_N "(cached) $ECHO_C" >&6
1256 else
1257   if test -n "$ac_ct_CC"; then
1258   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1259 else
1260   ac_save_IFS=$IFS; IFS=$ac_path_separator
1261 ac_dummy="$PATH"
1262 for ac_dir in $ac_dummy; do
1263   IFS=$ac_save_IFS
1264   test -z "$ac_dir" && ac_dir=.
1265   $as_executable_p "$ac_dir/$ac_word" || continue
1266 ac_cv_prog_ac_ct_CC="cc"
1267 echo "$as_me:1267: found $ac_dir/$ac_word" >&5
1268 break
1269 done
1270
1271 fi
1272 fi
1273 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1274 if test -n "$ac_ct_CC"; then
1275   echo "$as_me:1275: result: $ac_ct_CC" >&5
1276 echo "${ECHO_T}$ac_ct_CC" >&6
1277 else
1278   echo "$as_me:1278: result: no" >&5
1279 echo "${ECHO_T}no" >&6
1280 fi
1281
1282   CC=$ac_ct_CC
1283 else
1284   CC="$ac_cv_prog_CC"
1285 fi
1286
1287 fi
1288 if test -z "$CC"; then
1289   # Extract the first word of "cc", so it can be a program name with args.
1290 set dummy cc; ac_word=$2
1291 echo "$as_me:1291: checking for $ac_word" >&5
1292 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1293 if test "${ac_cv_prog_CC+set}" = set; then
1294   echo $ECHO_N "(cached) $ECHO_C" >&6
1295 else
1296   if test -n "$CC"; then
1297   ac_cv_prog_CC="$CC" # Let the user override the test.
1298 else
1299   ac_prog_rejected=no
1300   ac_save_IFS=$IFS; IFS=$ac_path_separator
1301 ac_dummy="$PATH"
1302 for ac_dir in $ac_dummy; do
1303   IFS=$ac_save_IFS
1304   test -z "$ac_dir" && ac_dir=.
1305   $as_executable_p "$ac_dir/$ac_word" || continue
1306 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1307   ac_prog_rejected=yes
1308   continue
1309 fi
1310 ac_cv_prog_CC="cc"
1311 echo "$as_me:1311: found $ac_dir/$ac_word" >&5
1312 break
1313 done
1314
1315 if test $ac_prog_rejected = yes; then
1316   # We found a bogon in the path, so make sure we never use it.
1317   set dummy $ac_cv_prog_CC
1318   shift
1319   if test $# != 0; then
1320     # We chose a different compiler from the bogus one.
1321     # However, it has the same basename, so the bogon will be chosen
1322     # first if we set CC to just the basename; use the full file name.
1323     shift
1324     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1325     shift
1326     ac_cv_prog_CC="$@"
1327   fi
1328 fi
1329 fi
1330 fi
1331 CC=$ac_cv_prog_CC
1332 if test -n "$CC"; then
1333   echo "$as_me:1333: result: $CC" >&5
1334 echo "${ECHO_T}$CC" >&6
1335 else
1336   echo "$as_me:1336: result: no" >&5
1337 echo "${ECHO_T}no" >&6
1338 fi
1339
1340 fi
1341 if test -z "$CC"; then
1342   if test -n "$ac_tool_prefix"; then
1343   for ac_prog in cl
1344   do
1345     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1346 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1347 echo "$as_me:1347: checking for $ac_word" >&5
1348 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1349 if test "${ac_cv_prog_CC+set}" = set; then
1350   echo $ECHO_N "(cached) $ECHO_C" >&6
1351 else
1352   if test -n "$CC"; then
1353   ac_cv_prog_CC="$CC" # Let the user override the test.
1354 else
1355   ac_save_IFS=$IFS; IFS=$ac_path_separator
1356 ac_dummy="$PATH"
1357 for ac_dir in $ac_dummy; do
1358   IFS=$ac_save_IFS
1359   test -z "$ac_dir" && ac_dir=.
1360   $as_executable_p "$ac_dir/$ac_word" || continue
1361 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1362 echo "$as_me:1362: found $ac_dir/$ac_word" >&5
1363 break
1364 done
1365
1366 fi
1367 fi
1368 CC=$ac_cv_prog_CC
1369 if test -n "$CC"; then
1370   echo "$as_me:1370: result: $CC" >&5
1371 echo "${ECHO_T}$CC" >&6
1372 else
1373   echo "$as_me:1373: result: no" >&5
1374 echo "${ECHO_T}no" >&6
1375 fi
1376
1377     test -n "$CC" && break
1378   done
1379 fi
1380 if test -z "$CC"; then
1381   ac_ct_CC=$CC
1382   for ac_prog in cl
1383 do
1384   # Extract the first word of "$ac_prog", so it can be a program name with args.
1385 set dummy $ac_prog; ac_word=$2
1386 echo "$as_me:1386: checking for $ac_word" >&5
1387 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1388 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1389   echo $ECHO_N "(cached) $ECHO_C" >&6
1390 else
1391   if test -n "$ac_ct_CC"; then
1392   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1393 else
1394   ac_save_IFS=$IFS; IFS=$ac_path_separator
1395 ac_dummy="$PATH"
1396 for ac_dir in $ac_dummy; do
1397   IFS=$ac_save_IFS
1398   test -z "$ac_dir" && ac_dir=.
1399   $as_executable_p "$ac_dir/$ac_word" || continue
1400 ac_cv_prog_ac_ct_CC="$ac_prog"
1401 echo "$as_me:1401: found $ac_dir/$ac_word" >&5
1402 break
1403 done
1404
1405 fi
1406 fi
1407 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1408 if test -n "$ac_ct_CC"; then
1409   echo "$as_me:1409: result: $ac_ct_CC" >&5
1410 echo "${ECHO_T}$ac_ct_CC" >&6
1411 else
1412   echo "$as_me:1412: result: no" >&5
1413 echo "${ECHO_T}no" >&6
1414 fi
1415
1416   test -n "$ac_ct_CC" && break
1417 done
1418
1419   CC=$ac_ct_CC
1420 fi
1421
1422 fi
1423
1424 test -z "$CC" && { { echo "$as_me:1424: error: no acceptable cc found in \$PATH" >&5
1425 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1426    { (exit 1); exit 1; }; }
1427
1428 # Provide some information about the compiler.
1429 echo "$as_me:1429:" \
1430      "checking for C compiler version" >&5
1431 ac_compiler=`set X $ac_compile; echo $2`
1432 { (eval echo "$as_me:1432: \"$ac_compiler --version </dev/null >&5\"") >&5
1433   (eval $ac_compiler --version </dev/null >&5) 2>&5
1434   ac_status=$?
1435   echo "$as_me:1435: \$? = $ac_status" >&5
1436   (exit $ac_status); }
1437 { (eval echo "$as_me:1437: \"$ac_compiler -v </dev/null >&5\"") >&5
1438   (eval $ac_compiler -v </dev/null >&5) 2>&5
1439   ac_status=$?
1440   echo "$as_me:1440: \$? = $ac_status" >&5
1441   (exit $ac_status); }
1442 { (eval echo "$as_me:1442: \"$ac_compiler -V </dev/null >&5\"") >&5
1443   (eval $ac_compiler -V </dev/null >&5) 2>&5
1444   ac_status=$?
1445   echo "$as_me:1445: \$? = $ac_status" >&5
1446   (exit $ac_status); }
1447
1448 cat >conftest.$ac_ext <<_ACEOF
1449 #line 1449 "configure"
1450 #include "confdefs.h"
1451
1452 int
1453 main ()
1454 {
1455
1456   ;
1457   return 0;
1458 }
1459 _ACEOF
1460 ac_clean_files_save=$ac_clean_files
1461 ac_clean_files="$ac_clean_files a.out a.exe"
1462 # Try to create an executable without -o first, disregard a.out.
1463 # It will help us diagnose broken compilers, and finding out an intuition
1464 # of exeext.
1465 echo "$as_me:1465: checking for C compiler default output" >&5
1466 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1467 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1468 if { (eval echo "$as_me:1468: \"$ac_link_default\"") >&5
1469   (eval $ac_link_default) 2>&5
1470   ac_status=$?
1471   echo "$as_me:1471: \$? = $ac_status" >&5
1472   (exit $ac_status); }; then
1473   # Find the output, starting from the most likely.  This scheme is
1474 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1475 # resort.
1476 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1477                 ls a.out conftest 2>/dev/null;
1478                 ls a.* conftest.* 2>/dev/null`; do
1479   case $ac_file in
1480     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1481     a.out ) # We found the default executable, but exeext='' is most
1482             # certainly right.
1483             break;;
1484     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1485           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1486           export ac_cv_exeext
1487           break;;
1488     * ) break;;
1489   esac
1490 done
1491 else
1492   echo "$as_me: failed program was:" >&5
1493 cat conftest.$ac_ext >&5
1494 { { echo "$as_me:1494: error: C compiler cannot create executables" >&5
1495 echo "$as_me: error: C compiler cannot create executables" >&2;}
1496    { (exit 77); exit 77; }; }
1497 fi
1498
1499 ac_exeext=$ac_cv_exeext
1500 echo "$as_me:1500: result: $ac_file" >&5
1501 echo "${ECHO_T}$ac_file" >&6
1502
1503 # Check the compiler produces executables we can run.  If not, either
1504 # the compiler is broken, or we cross compile.
1505 echo "$as_me:1505: checking whether the C compiler works" >&5
1506 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1507 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1508 # If not cross compiling, check that we can run a simple program.
1509 if test "$cross_compiling" != yes; then
1510   if { ac_try='./$ac_file'
1511   { (eval echo "$as_me:1511: \"$ac_try\"") >&5
1512   (eval $ac_try) 2>&5
1513   ac_status=$?
1514   echo "$as_me:1514: \$? = $ac_status" >&5
1515   (exit $ac_status); }; }; then
1516     cross_compiling=no
1517   else
1518     if test "$cross_compiling" = maybe; then
1519         cross_compiling=yes
1520     else
1521         { { echo "$as_me:1521: error: cannot run C compiled programs.
1522 If you meant to cross compile, use \`--host'." >&5
1523 echo "$as_me: error: cannot run C compiled programs.
1524 If you meant to cross compile, use \`--host'." >&2;}
1525    { (exit 1); exit 1; }; }
1526     fi
1527   fi
1528 fi
1529 echo "$as_me:1529: result: yes" >&5
1530 echo "${ECHO_T}yes" >&6
1531
1532 rm -f a.out a.exe conftest$ac_cv_exeext
1533 ac_clean_files=$ac_clean_files_save
1534 # Check the compiler produces executables we can run.  If not, either
1535 # the compiler is broken, or we cross compile.
1536 echo "$as_me:1536: checking whether we are cross compiling" >&5
1537 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1538 echo "$as_me:1538: result: $cross_compiling" >&5
1539 echo "${ECHO_T}$cross_compiling" >&6
1540
1541 echo "$as_me:1541: checking for executable suffix" >&5
1542 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1543 if { (eval echo "$as_me:1543: \"$ac_link\"") >&5
1544   (eval $ac_link) 2>&5
1545   ac_status=$?
1546   echo "$as_me:1546: \$? = $ac_status" >&5
1547   (exit $ac_status); }; then
1548   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1549 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1550 # work properly (i.e., refer to `conftest.exe'), while it won't with
1551 # `rm'.
1552 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1553   case $ac_file in
1554     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1555     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1556           export ac_cv_exeext
1557           break;;
1558     * ) break;;
1559   esac
1560 done
1561 else
1562   { { echo "$as_me:1562: error: cannot compute EXEEXT: cannot compile and link" >&5
1563 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1564    { (exit 1); exit 1; }; }
1565 fi
1566
1567 rm -f conftest$ac_cv_exeext
1568 echo "$as_me:1568: result: $ac_cv_exeext" >&5
1569 echo "${ECHO_T}$ac_cv_exeext" >&6
1570
1571 rm -f conftest.$ac_ext
1572 EXEEXT=$ac_cv_exeext
1573 ac_exeext=$EXEEXT
1574 echo "$as_me:1574: checking for object suffix" >&5
1575 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1576 if test "${ac_cv_objext+set}" = set; then
1577   echo $ECHO_N "(cached) $ECHO_C" >&6
1578 else
1579   cat >conftest.$ac_ext <<_ACEOF
1580 #line 1580 "configure"
1581 #include "confdefs.h"
1582
1583 int
1584 main ()
1585 {
1586
1587   ;
1588   return 0;
1589 }
1590 _ACEOF
1591 rm -f conftest.o conftest.obj
1592 if { (eval echo "$as_me:1592: \"$ac_compile\"") >&5
1593   (eval $ac_compile) 2>&5
1594   ac_status=$?
1595   echo "$as_me:1595: \$? = $ac_status" >&5
1596   (exit $ac_status); }; then
1597   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1598   case $ac_file in
1599     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1600     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1601        break;;
1602   esac
1603 done
1604 else
1605   echo "$as_me: failed program was:" >&5
1606 cat conftest.$ac_ext >&5
1607 { { echo "$as_me:1607: error: cannot compute OBJEXT: cannot compile" >&5
1608 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1609    { (exit 1); exit 1; }; }
1610 fi
1611
1612 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1613 fi
1614 echo "$as_me:1614: result: $ac_cv_objext" >&5
1615 echo "${ECHO_T}$ac_cv_objext" >&6
1616 OBJEXT=$ac_cv_objext
1617 ac_objext=$OBJEXT
1618 echo "$as_me:1618: checking whether we are using the GNU C compiler" >&5
1619 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1620 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1621   echo $ECHO_N "(cached) $ECHO_C" >&6
1622 else
1623   cat >conftest.$ac_ext <<_ACEOF
1624 #line 1624 "configure"
1625 #include "confdefs.h"
1626
1627 int
1628 main ()
1629 {
1630 #ifndef __GNUC__
1631        choke me
1632 #endif
1633
1634   ;
1635   return 0;
1636 }
1637 _ACEOF
1638 rm -f conftest.$ac_objext
1639 if { (eval echo "$as_me:1639: \"$ac_compile\"") >&5
1640   (eval $ac_compile) 2>&5
1641   ac_status=$?
1642   echo "$as_me:1642: \$? = $ac_status" >&5
1643   (exit $ac_status); } &&
1644          { ac_try='test -s conftest.$ac_objext'
1645   { (eval echo "$as_me:1645: \"$ac_try\"") >&5
1646   (eval $ac_try) 2>&5
1647   ac_status=$?
1648   echo "$as_me:1648: \$? = $ac_status" >&5
1649   (exit $ac_status); }; }; then
1650   ac_compiler_gnu=yes
1651 else
1652   echo "$as_me: failed program was:" >&5
1653 cat conftest.$ac_ext >&5
1654 ac_compiler_gnu=no
1655 fi
1656 rm -f conftest.$ac_objext conftest.$ac_ext
1657 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1658
1659 fi
1660 echo "$as_me:1660: result: $ac_cv_c_compiler_gnu" >&5
1661 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1662 GCC=`test $ac_compiler_gnu = yes && echo yes`
1663 ac_test_CFLAGS=${CFLAGS+set}
1664 ac_save_CFLAGS=$CFLAGS
1665 CFLAGS="-g"
1666 echo "$as_me:1666: checking whether $CC accepts -g" >&5
1667 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1668 if test "${ac_cv_prog_cc_g+set}" = set; then
1669   echo $ECHO_N "(cached) $ECHO_C" >&6
1670 else
1671   cat >conftest.$ac_ext <<_ACEOF
1672 #line 1672 "configure"
1673 #include "confdefs.h"
1674
1675 int
1676 main ()
1677 {
1678
1679   ;
1680   return 0;
1681 }
1682 _ACEOF
1683 rm -f conftest.$ac_objext
1684 if { (eval echo "$as_me:1684: \"$ac_compile\"") >&5
1685   (eval $ac_compile) 2>&5
1686   ac_status=$?
1687   echo "$as_me:1687: \$? = $ac_status" >&5
1688   (exit $ac_status); } &&
1689          { ac_try='test -s conftest.$ac_objext'
1690   { (eval echo "$as_me:1690: \"$ac_try\"") >&5
1691   (eval $ac_try) 2>&5
1692   ac_status=$?
1693   echo "$as_me:1693: \$? = $ac_status" >&5
1694   (exit $ac_status); }; }; then
1695   ac_cv_prog_cc_g=yes
1696 else
1697   echo "$as_me: failed program was:" >&5
1698 cat conftest.$ac_ext >&5
1699 ac_cv_prog_cc_g=no
1700 fi
1701 rm -f conftest.$ac_objext conftest.$ac_ext
1702 fi
1703 echo "$as_me:1703: result: $ac_cv_prog_cc_g" >&5
1704 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1705 if test "$ac_test_CFLAGS" = set; then
1706   CFLAGS=$ac_save_CFLAGS
1707 elif test $ac_cv_prog_cc_g = yes; then
1708   if test "$GCC" = yes; then
1709     CFLAGS="-g -O2"
1710   else
1711     CFLAGS="-g"
1712   fi
1713 else
1714   if test "$GCC" = yes; then
1715     CFLAGS="-O2"
1716   else
1717     CFLAGS=
1718   fi
1719 fi
1720 # Some people use a C++ compiler to compile C.  Since we use `exit',
1721 # in C++ we need to declare it.  In case someone uses the same compiler
1722 # for both compiling C and C++ we need to have the C++ compiler decide
1723 # the declaration of exit, since it's the most demanding environment.
1724 cat >conftest.$ac_ext <<_ACEOF
1725 #ifndef __cplusplus
1726   choke me
1727 #endif
1728 _ACEOF
1729 rm -f conftest.$ac_objext
1730 if { (eval echo "$as_me:1730: \"$ac_compile\"") >&5
1731   (eval $ac_compile) 2>&5
1732   ac_status=$?
1733   echo "$as_me:1733: \$? = $ac_status" >&5
1734   (exit $ac_status); } &&
1735          { ac_try='test -s conftest.$ac_objext'
1736   { (eval echo "$as_me:1736: \"$ac_try\"") >&5
1737   (eval $ac_try) 2>&5
1738   ac_status=$?
1739   echo "$as_me:1739: \$? = $ac_status" >&5
1740   (exit $ac_status); }; }; then
1741   for ac_declaration in \
1742    ''\
1743    '#include <stdlib.h>' \
1744    'extern "C" void std::exit (int) throw (); using std::exit;' \
1745    'extern "C" void std::exit (int); using std::exit;' \
1746    'extern "C" void exit (int) throw ();' \
1747    'extern "C" void exit (int);' \
1748    'void exit (int);'
1749 do
1750   cat >conftest.$ac_ext <<_ACEOF
1751 #line 1751 "configure"
1752 #include "confdefs.h"
1753 #include <stdlib.h>
1754 $ac_declaration
1755 int
1756 main ()
1757 {
1758 exit (42);
1759   ;
1760   return 0;
1761 }
1762 _ACEOF
1763 rm -f conftest.$ac_objext
1764 if { (eval echo "$as_me:1764: \"$ac_compile\"") >&5
1765   (eval $ac_compile) 2>&5
1766   ac_status=$?
1767   echo "$as_me:1767: \$? = $ac_status" >&5
1768   (exit $ac_status); } &&
1769          { ac_try='test -s conftest.$ac_objext'
1770   { (eval echo "$as_me:1770: \"$ac_try\"") >&5
1771   (eval $ac_try) 2>&5
1772   ac_status=$?
1773   echo "$as_me:1773: \$? = $ac_status" >&5
1774   (exit $ac_status); }; }; then
1775   :
1776 else
1777   echo "$as_me: failed program was:" >&5
1778 cat conftest.$ac_ext >&5
1779 continue
1780 fi
1781 rm -f conftest.$ac_objext conftest.$ac_ext
1782   cat >conftest.$ac_ext <<_ACEOF
1783 #line 1783 "configure"
1784 #include "confdefs.h"
1785 $ac_declaration
1786 int
1787 main ()
1788 {
1789 exit (42);
1790   ;
1791   return 0;
1792 }
1793 _ACEOF
1794 rm -f conftest.$ac_objext
1795 if { (eval echo "$as_me:1795: \"$ac_compile\"") >&5
1796   (eval $ac_compile) 2>&5
1797   ac_status=$?
1798   echo "$as_me:1798: \$? = $ac_status" >&5
1799   (exit $ac_status); } &&
1800          { ac_try='test -s conftest.$ac_objext'
1801   { (eval echo "$as_me:1801: \"$ac_try\"") >&5
1802   (eval $ac_try) 2>&5
1803   ac_status=$?
1804   echo "$as_me:1804: \$? = $ac_status" >&5
1805   (exit $ac_status); }; }; then
1806   break
1807 else
1808   echo "$as_me: failed program was:" >&5
1809 cat conftest.$ac_ext >&5
1810 fi
1811 rm -f conftest.$ac_objext conftest.$ac_ext
1812 done
1813 rm -rf conftest*
1814 if test -n "$ac_declaration"; then
1815   echo '#ifdef __cplusplus' >>confdefs.h
1816   echo $ac_declaration      >>confdefs.h
1817   echo '#endif'             >>confdefs.h
1818 fi
1819
1820 else
1821   echo "$as_me: failed program was:" >&5
1822 cat conftest.$ac_ext >&5
1823 fi
1824 rm -f conftest.$ac_objext conftest.$ac_ext
1825 ac_ext=c
1826 ac_cpp='$CPP $CPPFLAGS'
1827 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1828 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1829 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1830 ac_main_return=return
1831
1832 GCC_VERSION=none
1833 if test "$GCC" = yes ; then
1834         echo "$as_me:1834: checking version of $CC" >&5
1835 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1836         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.].*//'`"
1837         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1838         echo "$as_me:1838: result: $GCC_VERSION" >&5
1839 echo "${ECHO_T}$GCC_VERSION" >&6
1840 fi
1841
1842 echo "$as_me:1842: checking for $CC option to accept ANSI C" >&5
1843 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1844 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1845   echo $ECHO_N "(cached) $ECHO_C" >&6
1846 else
1847   ac_cv_prog_cc_stdc=no
1848 ac_save_CC=$CC
1849 cat >conftest.$ac_ext <<_ACEOF
1850 #line 1850 "configure"
1851 #include "confdefs.h"
1852 #include <stdarg.h>
1853 #include <stdio.h>
1854 #include <sys/types.h>
1855 #include <sys/stat.h>
1856 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1857 struct buf { int x; };
1858 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1859 static char *e (p, i)
1860      char **p;
1861      int i;
1862 {
1863   return p[i];
1864 }
1865 static char *f (char * (*g) (char **, int), char **p, ...)
1866 {
1867   char *s;
1868   va_list v;
1869   va_start (v,p);
1870   s = g (p, va_arg (v,int));
1871   va_end (v);
1872   return s;
1873 }
1874 int test (int i, double x);
1875 struct s1 {int (*f) (int a);};
1876 struct s2 {int (*f) (double a);};
1877 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1878 int argc;
1879 char **argv;
1880 int
1881 main ()
1882 {
1883 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1884   ;
1885   return 0;
1886 }
1887 _ACEOF
1888 # Don't try gcc -ansi; that turns off useful extensions and
1889 # breaks some systems' header files.
1890 # AIX                   -qlanglvl=ansi
1891 # Ultrix and OSF/1      -std1
1892 # HP-UX 10.20 and later -Ae
1893 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1894 # SVR4                  -Xc -D__EXTENSIONS__
1895 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1896 do
1897   CC="$ac_save_CC $ac_arg"
1898   rm -f conftest.$ac_objext
1899 if { (eval echo "$as_me:1899: \"$ac_compile\"") >&5
1900   (eval $ac_compile) 2>&5
1901   ac_status=$?
1902   echo "$as_me:1902: \$? = $ac_status" >&5
1903   (exit $ac_status); } &&
1904          { ac_try='test -s conftest.$ac_objext'
1905   { (eval echo "$as_me:1905: \"$ac_try\"") >&5
1906   (eval $ac_try) 2>&5
1907   ac_status=$?
1908   echo "$as_me:1908: \$? = $ac_status" >&5
1909   (exit $ac_status); }; }; then
1910   ac_cv_prog_cc_stdc=$ac_arg
1911 break
1912 else
1913   echo "$as_me: failed program was:" >&5
1914 cat conftest.$ac_ext >&5
1915 fi
1916 rm -f conftest.$ac_objext
1917 done
1918 rm -f conftest.$ac_ext conftest.$ac_objext
1919 CC=$ac_save_CC
1920
1921 fi
1922
1923 case "x$ac_cv_prog_cc_stdc" in
1924   x|xno)
1925     echo "$as_me:1925: result: none needed" >&5
1926 echo "${ECHO_T}none needed" >&6 ;;
1927   *)
1928     echo "$as_me:1928: result: $ac_cv_prog_cc_stdc" >&5
1929 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1930     CC="$CC $ac_cv_prog_cc_stdc" ;;
1931 esac
1932
1933 # This should have been defined by AC_PROG_CC
1934 : ${CC:=cc}
1935
1936 echo "$as_me:1936: checking \$CC variable" >&5
1937 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1938 case "$CC" in
1939 (*[\ \  ]-*)
1940         echo "$as_me:1940: result: broken" >&5
1941 echo "${ECHO_T}broken" >&6
1942         { echo "$as_me:1942: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1943 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1944         # humor him...
1945         cf_flags=`echo "$CC" | sed -e 's/^.*[   ]\(-[^  ]\)/\1/'`
1946         CC=`echo "$CC " | sed -e 's/[   ]-[^    ].*$//' -e 's/[         ]*$//'`
1947         for cf_arg in $cf_flags
1948         do
1949                 case "x$cf_arg" in
1950                 (x-[IUDfgOW]*)
1951
1952 cf_fix_cppflags=no
1953 cf_new_cflags=
1954 cf_new_cppflags=
1955 cf_new_extra_cppflags=
1956
1957 for cf_add_cflags in $cf_flags
1958 do
1959 case $cf_fix_cppflags in
1960 (no)
1961         case $cf_add_cflags in
1962         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1963                 case $cf_add_cflags in
1964                 (-D*)
1965                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1966
1967                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1968                                 && test -z "${cf_tst_cflags}" \
1969                                 && cf_fix_cppflags=yes
1970
1971                         if test $cf_fix_cppflags = yes ; then
1972                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1973                                 continue
1974                         elif test "${cf_tst_cflags}" = "\"'" ; then
1975                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1976                                 continue
1977                         fi
1978                         ;;
1979                 esac
1980                 case "$CPPFLAGS" in
1981                 (*$cf_add_cflags)
1982                         ;;
1983                 (*)
1984                         case $cf_add_cflags in
1985                         (-D*)
1986                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1987
1988 CPPFLAGS=`echo "$CPPFLAGS" | \
1989         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1990                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1991
1992                                 ;;
1993                         esac
1994                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1995                         ;;
1996                 esac
1997                 ;;
1998         (*)
1999                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2000                 ;;
2001         esac
2002         ;;
2003 (yes)
2004         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2005
2006         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2007
2008         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2009                 && test -z "${cf_tst_cflags}" \
2010                 && cf_fix_cppflags=no
2011         ;;
2012 esac
2013 done
2014
2015 if test -n "$cf_new_cflags" ; then
2016
2017         CFLAGS="$CFLAGS $cf_new_cflags"
2018 fi
2019
2020 if test -n "$cf_new_cppflags" ; then
2021
2022         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2023 fi
2024
2025 if test -n "$cf_new_extra_cppflags" ; then
2026
2027         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2028 fi
2029
2030                         ;;
2031                 (*)
2032                         CC="$CC $cf_arg"
2033                         ;;
2034                 esac
2035         done
2036         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2037
2038 echo "${as_me:-configure}:2038: testing resulting CC: '$CC' ..." 1>&5
2039
2040         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2041
2042 echo "${as_me:-configure}:2042: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2043
2044         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2045
2046 echo "${as_me:-configure}:2046: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2047
2048         ;;
2049 (*)
2050         echo "$as_me:2050: result: ok" >&5
2051 echo "${ECHO_T}ok" >&6
2052         ;;
2053 esac
2054
2055 ac_ext=c
2056 ac_cpp='$CPP $CPPFLAGS'
2057 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2058 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2059 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2060 ac_main_return=return
2061 echo "$as_me:2061: checking how to run the C preprocessor" >&5
2062 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2063 # On Suns, sometimes $CPP names a directory.
2064 if test -n "$CPP" && test -d "$CPP"; then
2065   CPP=
2066 fi
2067 if test -z "$CPP"; then
2068   if test "${ac_cv_prog_CPP+set}" = set; then
2069   echo $ECHO_N "(cached) $ECHO_C" >&6
2070 else
2071       # Double quotes because CPP needs to be expanded
2072     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2073     do
2074       ac_preproc_ok=false
2075 for ac_c_preproc_warn_flag in '' yes
2076 do
2077   # Use a header file that comes with gcc, so configuring glibc
2078   # with a fresh cross-compiler works.
2079   # On the NeXT, cc -E runs the code through the compiler's parser,
2080   # not just through cpp. "Syntax error" is here to catch this case.
2081   cat >conftest.$ac_ext <<_ACEOF
2082 #line 2082 "configure"
2083 #include "confdefs.h"
2084 #include <assert.h>
2085                      Syntax error
2086 _ACEOF
2087 if { (eval echo "$as_me:2087: \"$ac_cpp conftest.$ac_ext\"") >&5
2088   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2089   ac_status=$?
2090   egrep -v '^ *\+' conftest.er1 >conftest.err
2091   rm -f conftest.er1
2092   cat conftest.err >&5
2093   echo "$as_me:2093: \$? = $ac_status" >&5
2094   (exit $ac_status); } >/dev/null; then
2095   if test -s conftest.err; then
2096     ac_cpp_err=$ac_c_preproc_warn_flag
2097   else
2098     ac_cpp_err=
2099   fi
2100 else
2101   ac_cpp_err=yes
2102 fi
2103 if test -z "$ac_cpp_err"; then
2104   :
2105 else
2106   echo "$as_me: failed program was:" >&5
2107   cat conftest.$ac_ext >&5
2108   # Broken: fails on valid input.
2109 continue
2110 fi
2111 rm -f conftest.err conftest.$ac_ext
2112
2113   # OK, works on sane cases.  Now check whether non-existent headers
2114   # can be detected and how.
2115   cat >conftest.$ac_ext <<_ACEOF
2116 #line 2116 "configure"
2117 #include "confdefs.h"
2118 #include <ac_nonexistent.h>
2119 _ACEOF
2120 if { (eval echo "$as_me:2120: \"$ac_cpp conftest.$ac_ext\"") >&5
2121   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2122   ac_status=$?
2123   egrep -v '^ *\+' conftest.er1 >conftest.err
2124   rm -f conftest.er1
2125   cat conftest.err >&5
2126   echo "$as_me:2126: \$? = $ac_status" >&5
2127   (exit $ac_status); } >/dev/null; then
2128   if test -s conftest.err; then
2129     ac_cpp_err=$ac_c_preproc_warn_flag
2130   else
2131     ac_cpp_err=
2132   fi
2133 else
2134   ac_cpp_err=yes
2135 fi
2136 if test -z "$ac_cpp_err"; then
2137   # Broken: success on invalid input.
2138 continue
2139 else
2140   echo "$as_me: failed program was:" >&5
2141   cat conftest.$ac_ext >&5
2142   # Passes both tests.
2143 ac_preproc_ok=:
2144 break
2145 fi
2146 rm -f conftest.err conftest.$ac_ext
2147
2148 done
2149 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2150 rm -f conftest.err conftest.$ac_ext
2151 if $ac_preproc_ok; then
2152   break
2153 fi
2154
2155     done
2156     ac_cv_prog_CPP=$CPP
2157
2158 fi
2159   CPP=$ac_cv_prog_CPP
2160 else
2161   ac_cv_prog_CPP=$CPP
2162 fi
2163 echo "$as_me:2163: result: $CPP" >&5
2164 echo "${ECHO_T}$CPP" >&6
2165 ac_preproc_ok=false
2166 for ac_c_preproc_warn_flag in '' yes
2167 do
2168   # Use a header file that comes with gcc, so configuring glibc
2169   # with a fresh cross-compiler works.
2170   # On the NeXT, cc -E runs the code through the compiler's parser,
2171   # not just through cpp. "Syntax error" is here to catch this case.
2172   cat >conftest.$ac_ext <<_ACEOF
2173 #line 2173 "configure"
2174 #include "confdefs.h"
2175 #include <assert.h>
2176                      Syntax error
2177 _ACEOF
2178 if { (eval echo "$as_me:2178: \"$ac_cpp conftest.$ac_ext\"") >&5
2179   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2180   ac_status=$?
2181   egrep -v '^ *\+' conftest.er1 >conftest.err
2182   rm -f conftest.er1
2183   cat conftest.err >&5
2184   echo "$as_me:2184: \$? = $ac_status" >&5
2185   (exit $ac_status); } >/dev/null; then
2186   if test -s conftest.err; then
2187     ac_cpp_err=$ac_c_preproc_warn_flag
2188   else
2189     ac_cpp_err=
2190   fi
2191 else
2192   ac_cpp_err=yes
2193 fi
2194 if test -z "$ac_cpp_err"; then
2195   :
2196 else
2197   echo "$as_me: failed program was:" >&5
2198   cat conftest.$ac_ext >&5
2199   # Broken: fails on valid input.
2200 continue
2201 fi
2202 rm -f conftest.err conftest.$ac_ext
2203
2204   # OK, works on sane cases.  Now check whether non-existent headers
2205   # can be detected and how.
2206   cat >conftest.$ac_ext <<_ACEOF
2207 #line 2207 "configure"
2208 #include "confdefs.h"
2209 #include <ac_nonexistent.h>
2210 _ACEOF
2211 if { (eval echo "$as_me:2211: \"$ac_cpp conftest.$ac_ext\"") >&5
2212   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2213   ac_status=$?
2214   egrep -v '^ *\+' conftest.er1 >conftest.err
2215   rm -f conftest.er1
2216   cat conftest.err >&5
2217   echo "$as_me:2217: \$? = $ac_status" >&5
2218   (exit $ac_status); } >/dev/null; then
2219   if test -s conftest.err; then
2220     ac_cpp_err=$ac_c_preproc_warn_flag
2221   else
2222     ac_cpp_err=
2223   fi
2224 else
2225   ac_cpp_err=yes
2226 fi
2227 if test -z "$ac_cpp_err"; then
2228   # Broken: success on invalid input.
2229 continue
2230 else
2231   echo "$as_me: failed program was:" >&5
2232   cat conftest.$ac_ext >&5
2233   # Passes both tests.
2234 ac_preproc_ok=:
2235 break
2236 fi
2237 rm -f conftest.err conftest.$ac_ext
2238
2239 done
2240 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2241 rm -f conftest.err conftest.$ac_ext
2242 if $ac_preproc_ok; then
2243   :
2244 else
2245   { { echo "$as_me:2245: error: C preprocessor \"$CPP\" fails sanity check" >&5
2246 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2247    { (exit 1); exit 1; }; }
2248 fi
2249
2250 ac_ext=c
2251 ac_cpp='$CPP $CPPFLAGS'
2252 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2253 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2254 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2255 ac_main_return=return
2256
2257 for ac_prog in mawk gawk nawk awk
2258 do
2259   # Extract the first word of "$ac_prog", so it can be a program name with args.
2260 set dummy $ac_prog; ac_word=$2
2261 echo "$as_me:2261: checking for $ac_word" >&5
2262 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2263 if test "${ac_cv_prog_AWK+set}" = set; then
2264   echo $ECHO_N "(cached) $ECHO_C" >&6
2265 else
2266   if test -n "$AWK"; then
2267   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2268 else
2269   ac_save_IFS=$IFS; IFS=$ac_path_separator
2270 ac_dummy="$PATH"
2271 for ac_dir in $ac_dummy; do
2272   IFS=$ac_save_IFS
2273   test -z "$ac_dir" && ac_dir=.
2274   $as_executable_p "$ac_dir/$ac_word" || continue
2275 ac_cv_prog_AWK="$ac_prog"
2276 echo "$as_me:2276: found $ac_dir/$ac_word" >&5
2277 break
2278 done
2279
2280 fi
2281 fi
2282 AWK=$ac_cv_prog_AWK
2283 if test -n "$AWK"; then
2284   echo "$as_me:2284: result: $AWK" >&5
2285 echo "${ECHO_T}$AWK" >&6
2286 else
2287   echo "$as_me:2287: result: no" >&5
2288 echo "${ECHO_T}no" >&6
2289 fi
2290
2291   test -n "$AWK" && break
2292 done
2293
2294 # Find a good install program.  We prefer a C program (faster),
2295 # so one script is as good as another.  But avoid the broken or
2296 # incompatible versions:
2297 # SysV /etc/install, /usr/sbin/install
2298 # SunOS /usr/etc/install
2299 # IRIX /sbin/install
2300 # AIX /bin/install
2301 # AmigaOS /C/install, which installs bootblocks on floppy discs
2302 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2303 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2304 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2305 # ./install, which can be erroneously created by make from ./install.sh.
2306 echo "$as_me:2306: checking for a BSD compatible install" >&5
2307 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2308 if test -z "$INSTALL"; then
2309 if test "${ac_cv_path_install+set}" = set; then
2310   echo $ECHO_N "(cached) $ECHO_C" >&6
2311 else
2312     ac_save_IFS=$IFS; IFS=$ac_path_separator
2313   for ac_dir in $PATH; do
2314     IFS=$ac_save_IFS
2315     # Account for people who put trailing slashes in PATH elements.
2316     case $ac_dir/ in
2317     / | ./ | .// | /cC/* \
2318     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2319     | /usr/ucb/* ) ;;
2320     *)
2321       # OSF1 and SCO ODT 3.0 have their own names for install.
2322       # Don't use installbsd from OSF since it installs stuff as root
2323       # by default.
2324       for ac_prog in ginstall scoinst install; do
2325         if $as_executable_p "$ac_dir/$ac_prog"; then
2326           if test $ac_prog = install &&
2327             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2328             # AIX install.  It has an incompatible calling convention.
2329             :
2330           elif test $ac_prog = install &&
2331             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2332             # program-specific install script used by HP pwplus--don't use.
2333             :
2334           else
2335             ac_cv_path_install="$ac_dir/$ac_prog -c"
2336             break 2
2337           fi
2338         fi
2339       done
2340       ;;
2341     esac
2342   done
2343
2344 fi
2345   if test "${ac_cv_path_install+set}" = set; then
2346     INSTALL=$ac_cv_path_install
2347   else
2348     # As a last resort, use the slow shell script.  We don't cache a
2349     # path for INSTALL within a source directory, because that will
2350     # break other packages using the cache if that directory is
2351     # removed, or if the path is relative.
2352     INSTALL=$ac_install_sh
2353   fi
2354 fi
2355 echo "$as_me:2355: result: $INSTALL" >&5
2356 echo "${ECHO_T}$INSTALL" >&6
2357
2358 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2359 # It thinks the first close brace ends the variable substitution.
2360 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2361
2362 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2363
2364 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2365
2366 case $INSTALL in
2367 (/*)
2368         ;;
2369 (*)
2370         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2371         test -z "$cf_dir" && cf_dir=.
2372         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2373         ;;
2374 esac
2375
2376 for ac_prog in lint cppcheck splint
2377 do
2378   # Extract the first word of "$ac_prog", so it can be a program name with args.
2379 set dummy $ac_prog; ac_word=$2
2380 echo "$as_me:2380: checking for $ac_word" >&5
2381 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2382 if test "${ac_cv_prog_LINT+set}" = set; then
2383   echo $ECHO_N "(cached) $ECHO_C" >&6
2384 else
2385   if test -n "$LINT"; then
2386   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2387 else
2388   ac_save_IFS=$IFS; IFS=$ac_path_separator
2389 ac_dummy="$PATH"
2390 for ac_dir in $ac_dummy; do
2391   IFS=$ac_save_IFS
2392   test -z "$ac_dir" && ac_dir=.
2393   $as_executable_p "$ac_dir/$ac_word" || continue
2394 ac_cv_prog_LINT="$ac_prog"
2395 echo "$as_me:2395: found $ac_dir/$ac_word" >&5
2396 break
2397 done
2398
2399 fi
2400 fi
2401 LINT=$ac_cv_prog_LINT
2402 if test -n "$LINT"; then
2403   echo "$as_me:2403: result: $LINT" >&5
2404 echo "${ECHO_T}$LINT" >&6
2405 else
2406   echo "$as_me:2406: result: no" >&5
2407 echo "${ECHO_T}no" >&6
2408 fi
2409
2410   test -n "$LINT" && break
2411 done
2412
2413 echo "$as_me:2413: checking if filesystem supports mixed-case filenames" >&5
2414 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2415 if test "${cf_cv_mixedcase+set}" = set; then
2416   echo $ECHO_N "(cached) $ECHO_C" >&6
2417 else
2418
2419 if test "$cross_compiling" = yes ; then
2420         case $target_alias in
2421         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2422                 cf_cv_mixedcase=no
2423                 ;;
2424         (*)
2425                 cf_cv_mixedcase=yes
2426                 ;;
2427         esac
2428 else
2429         rm -f conftest CONFTEST
2430         echo test >conftest
2431         if test -f CONFTEST ; then
2432                 cf_cv_mixedcase=no
2433         else
2434                 cf_cv_mixedcase=yes
2435         fi
2436         rm -f conftest CONFTEST
2437 fi
2438
2439 fi
2440 echo "$as_me:2440: result: $cf_cv_mixedcase" >&5
2441 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2442 test "$cf_cv_mixedcase" = yes &&
2443 cat >>confdefs.h <<\EOF
2444 #define MIXEDCASE_FILENAMES 1
2445 EOF
2446
2447 for ac_prog in exctags ctags
2448 do
2449   # Extract the first word of "$ac_prog", so it can be a program name with args.
2450 set dummy $ac_prog; ac_word=$2
2451 echo "$as_me:2451: checking for $ac_word" >&5
2452 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2453 if test "${ac_cv_prog_CTAGS+set}" = set; then
2454   echo $ECHO_N "(cached) $ECHO_C" >&6
2455 else
2456   if test -n "$CTAGS"; then
2457   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2458 else
2459   ac_save_IFS=$IFS; IFS=$ac_path_separator
2460 ac_dummy="$PATH"
2461 for ac_dir in $ac_dummy; do
2462   IFS=$ac_save_IFS
2463   test -z "$ac_dir" && ac_dir=.
2464   $as_executable_p "$ac_dir/$ac_word" || continue
2465 ac_cv_prog_CTAGS="$ac_prog"
2466 echo "$as_me:2466: found $ac_dir/$ac_word" >&5
2467 break
2468 done
2469
2470 fi
2471 fi
2472 CTAGS=$ac_cv_prog_CTAGS
2473 if test -n "$CTAGS"; then
2474   echo "$as_me:2474: result: $CTAGS" >&5
2475 echo "${ECHO_T}$CTAGS" >&6
2476 else
2477   echo "$as_me:2477: result: no" >&5
2478 echo "${ECHO_T}no" >&6
2479 fi
2480
2481   test -n "$CTAGS" && break
2482 done
2483
2484 for ac_prog in exetags etags
2485 do
2486   # Extract the first word of "$ac_prog", so it can be a program name with args.
2487 set dummy $ac_prog; ac_word=$2
2488 echo "$as_me:2488: checking for $ac_word" >&5
2489 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2490 if test "${ac_cv_prog_ETAGS+set}" = set; then
2491   echo $ECHO_N "(cached) $ECHO_C" >&6
2492 else
2493   if test -n "$ETAGS"; then
2494   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2495 else
2496   ac_save_IFS=$IFS; IFS=$ac_path_separator
2497 ac_dummy="$PATH"
2498 for ac_dir in $ac_dummy; do
2499   IFS=$ac_save_IFS
2500   test -z "$ac_dir" && ac_dir=.
2501   $as_executable_p "$ac_dir/$ac_word" || continue
2502 ac_cv_prog_ETAGS="$ac_prog"
2503 echo "$as_me:2503: found $ac_dir/$ac_word" >&5
2504 break
2505 done
2506
2507 fi
2508 fi
2509 ETAGS=$ac_cv_prog_ETAGS
2510 if test -n "$ETAGS"; then
2511   echo "$as_me:2511: result: $ETAGS" >&5
2512 echo "${ECHO_T}$ETAGS" >&6
2513 else
2514   echo "$as_me:2514: result: no" >&5
2515 echo "${ECHO_T}no" >&6
2516 fi
2517
2518   test -n "$ETAGS" && break
2519 done
2520
2521 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2522 set dummy ${CTAGS:-ctags}; ac_word=$2
2523 echo "$as_me:2523: checking for $ac_word" >&5
2524 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2525 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2526   echo $ECHO_N "(cached) $ECHO_C" >&6
2527 else
2528   if test -n "$MAKE_LOWER_TAGS"; then
2529   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2530 else
2531   ac_save_IFS=$IFS; IFS=$ac_path_separator
2532 ac_dummy="$PATH"
2533 for ac_dir in $ac_dummy; do
2534   IFS=$ac_save_IFS
2535   test -z "$ac_dir" && ac_dir=.
2536   $as_executable_p "$ac_dir/$ac_word" || continue
2537 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2538 echo "$as_me:2538: found $ac_dir/$ac_word" >&5
2539 break
2540 done
2541
2542   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2543 fi
2544 fi
2545 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2546 if test -n "$MAKE_LOWER_TAGS"; then
2547   echo "$as_me:2547: result: $MAKE_LOWER_TAGS" >&5
2548 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2549 else
2550   echo "$as_me:2550: result: no" >&5
2551 echo "${ECHO_T}no" >&6
2552 fi
2553
2554 if test "$cf_cv_mixedcase" = yes ; then
2555         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2556 set dummy ${ETAGS:-etags}; ac_word=$2
2557 echo "$as_me:2557: checking for $ac_word" >&5
2558 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2559 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2560   echo $ECHO_N "(cached) $ECHO_C" >&6
2561 else
2562   if test -n "$MAKE_UPPER_TAGS"; then
2563   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2564 else
2565   ac_save_IFS=$IFS; IFS=$ac_path_separator
2566 ac_dummy="$PATH"
2567 for ac_dir in $ac_dummy; do
2568   IFS=$ac_save_IFS
2569   test -z "$ac_dir" && ac_dir=.
2570   $as_executable_p "$ac_dir/$ac_word" || continue
2571 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2572 echo "$as_me:2572: found $ac_dir/$ac_word" >&5
2573 break
2574 done
2575
2576   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2577 fi
2578 fi
2579 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2580 if test -n "$MAKE_UPPER_TAGS"; then
2581   echo "$as_me:2581: result: $MAKE_UPPER_TAGS" >&5
2582 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2583 else
2584   echo "$as_me:2584: result: no" >&5
2585 echo "${ECHO_T}no" >&6
2586 fi
2587
2588 else
2589         MAKE_UPPER_TAGS=no
2590 fi
2591
2592 if test "$MAKE_UPPER_TAGS" = yes ; then
2593         MAKE_UPPER_TAGS=
2594 else
2595         MAKE_UPPER_TAGS="#"
2596 fi
2597
2598 if test "$MAKE_LOWER_TAGS" = yes ; then
2599         MAKE_LOWER_TAGS=
2600 else
2601         MAKE_LOWER_TAGS="#"
2602 fi
2603
2604 echo "$as_me:2604: checking if -lm needed for math functions" >&5
2605 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2606 if test "${cf_cv_need_libm+set}" = set; then
2607   echo $ECHO_N "(cached) $ECHO_C" >&6
2608 else
2609
2610         cat >conftest.$ac_ext <<_ACEOF
2611 #line 2611 "configure"
2612 #include "confdefs.h"
2613
2614         #include <stdio.h>
2615         #include <math.h>
2616
2617 int
2618 main ()
2619 {
2620 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2621   ;
2622   return 0;
2623 }
2624 _ACEOF
2625 rm -f conftest.$ac_objext conftest$ac_exeext
2626 if { (eval echo "$as_me:2626: \"$ac_link\"") >&5
2627   (eval $ac_link) 2>&5
2628   ac_status=$?
2629   echo "$as_me:2629: \$? = $ac_status" >&5
2630   (exit $ac_status); } &&
2631          { ac_try='test -s conftest$ac_exeext'
2632   { (eval echo "$as_me:2632: \"$ac_try\"") >&5
2633   (eval $ac_try) 2>&5
2634   ac_status=$?
2635   echo "$as_me:2635: \$? = $ac_status" >&5
2636   (exit $ac_status); }; }; then
2637   cf_cv_need_libm=no
2638 else
2639   echo "$as_me: failed program was:" >&5
2640 cat conftest.$ac_ext >&5
2641 cf_cv_need_libm=yes
2642 fi
2643 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2644 fi
2645 echo "$as_me:2645: result: $cf_cv_need_libm" >&5
2646 echo "${ECHO_T}$cf_cv_need_libm" >&6
2647 if test "$cf_cv_need_libm" = yes
2648 then
2649 MATH_LIB=-lm
2650 fi
2651
2652 top_builddir=`pwd`
2653
2654 CC_G_OPT="-g"
2655 CC_SHARED_OPTS=unknown
2656 CPPFLAGS="$CPPFLAGS"
2657 DFT_DEP_SUFFIX=""
2658 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2659 DFT_UPR_MODEL="NORMAL"
2660 LD="ld"
2661 LDFLAGS_SHARED=""
2662 LDFLAGS_STATIC=""
2663 LD_MODEL=""
2664 LD_SHARED_OPTS=""
2665 LIBTOOL=""
2666 LIBTOOL_OPTS=""
2667 LIB_CLEAN=""
2668 LIB_COMPILE=""
2669 LIB_LINK='${CC}'
2670 LINK_TESTS=""
2671 LOCAL_LDFLAGS=""
2672 PACKAGE="ncurses-examples"
2673 PTHREAD="-lm"
2674 TEST_ARGS=""
2675 TEST_DEPS=""
2676 TEST_LIBS=""
2677 TINFO_LDFLAGS=''
2678 TINFO_LIBS='$(LIBS_CURSES)'
2679 cf_cv_abi_version=""
2680 cf_cv_rel_version=""
2681 includesubdir=""
2682
2683 cf_cv_screen=curses
2684 cf_cv_libtype=
2685
2686 if test "$GCC" = yes
2687 then
2688 cat > conftest.i <<EOF
2689 #ifndef GCC_PRINTF
2690 #define GCC_PRINTF 0
2691 #endif
2692 #ifndef GCC_SCANF
2693 #define GCC_SCANF 0
2694 #endif
2695 #ifndef GCC_NORETURN
2696 #define GCC_NORETURN /* nothing */
2697 #endif
2698 #ifndef GCC_UNUSED
2699 #define GCC_UNUSED /* nothing */
2700 #endif
2701 EOF
2702 if test "$GCC" = yes
2703 then
2704         { echo "$as_me:2704: checking for $CC __attribute__ directives..." >&5
2705 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2706 cat > conftest.$ac_ext <<EOF
2707 #line 2707 "${as_me:-configure}"
2708 #include "confdefs.h"
2709 #include "conftest.h"
2710 #include "conftest.i"
2711 #if     GCC_PRINTF
2712 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2713 #else
2714 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2715 #endif
2716 #if     GCC_SCANF
2717 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2718 #else
2719 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2720 #endif
2721 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2722 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2723 extern void foo(void) GCC_NORETURN;
2724 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2725 EOF
2726         cf_printf_attribute=no
2727         cf_scanf_attribute=no
2728         for cf_attribute in scanf printf unused noreturn
2729         do
2730
2731 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2732
2733                 cf_directive="__attribute__(($cf_attribute))"
2734                 echo "checking for $CC $cf_directive" 1>&5
2735
2736                 case $cf_attribute in
2737                 (printf)
2738                         cf_printf_attribute=yes
2739                         cat >conftest.h <<EOF
2740 #define GCC_$cf_ATTRIBUTE 1
2741 EOF
2742                         ;;
2743                 (scanf)
2744                         cf_scanf_attribute=yes
2745                         cat >conftest.h <<EOF
2746 #define GCC_$cf_ATTRIBUTE 1
2747 EOF
2748                         ;;
2749                 (*)
2750                         cat >conftest.h <<EOF
2751 #define GCC_$cf_ATTRIBUTE $cf_directive
2752 EOF
2753                         ;;
2754                 esac
2755
2756                 if { (eval echo "$as_me:2756: \"$ac_compile\"") >&5
2757   (eval $ac_compile) 2>&5
2758   ac_status=$?
2759   echo "$as_me:2759: \$? = $ac_status" >&5
2760   (exit $ac_status); }; then
2761                         test -n "$verbose" && echo "$as_me:2761: result: ... $cf_attribute" >&5
2762 echo "${ECHO_T}... $cf_attribute" >&6
2763                         cat conftest.h >>confdefs.h
2764                         case $cf_attribute in
2765                         (noreturn)
2766
2767 cat >>confdefs.h <<EOF
2768 #define GCC_NORETURN $cf_directive
2769 EOF
2770
2771                                 ;;
2772                         (printf)
2773                                 cf_value='/* nothing */'
2774                                 if test "$cf_printf_attribute" != no ; then
2775                                         cf_value='__attribute__((format(printf,fmt,var)))'
2776
2777 cat >>confdefs.h <<\EOF
2778 #define GCC_PRINTF 1
2779 EOF
2780
2781                                 fi
2782
2783 cat >>confdefs.h <<EOF
2784 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2785 EOF
2786
2787                                 ;;
2788                         (scanf)
2789                                 cf_value='/* nothing */'
2790                                 if test "$cf_scanf_attribute" != no ; then
2791                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2792
2793 cat >>confdefs.h <<\EOF
2794 #define GCC_SCANF 1
2795 EOF
2796
2797                                 fi
2798
2799 cat >>confdefs.h <<EOF
2800 #define GCC_SCANFLIKE(fmt,var) $cf_value
2801 EOF
2802
2803                                 ;;
2804                         (unused)
2805
2806 cat >>confdefs.h <<EOF
2807 #define GCC_UNUSED $cf_directive
2808 EOF
2809
2810                                 ;;
2811                         esac
2812                 fi
2813         done
2814 else
2815         fgrep define conftest.i >>confdefs.h
2816 fi
2817 rm -rf conftest*
2818 fi
2819
2820 cf_XOPEN_SOURCE=500
2821 cf_POSIX_C_SOURCE=199506L
2822 cf_xopen_source=
2823
2824 case $host_os in
2825 (aix[4-7]*)
2826         cf_xopen_source="-D_ALL_SOURCE"
2827         ;;
2828 (msys)
2829         cf_XOPEN_SOURCE=600
2830         ;;
2831 (darwin[0-8].*)
2832         cf_xopen_source="-D_APPLE_C_SOURCE"
2833         ;;
2834 (darwin*)
2835         cf_xopen_source="-D_DARWIN_C_SOURCE"
2836         cf_XOPEN_SOURCE=
2837         ;;
2838 (freebsd*|dragonfly*)
2839         # 5.x headers associate
2840         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2841         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2842         cf_POSIX_C_SOURCE=200112L
2843         cf_XOPEN_SOURCE=600
2844         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2845         ;;
2846 (hpux11*)
2847         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2848         ;;
2849 (hpux*)
2850         cf_xopen_source="-D_HPUX_SOURCE"
2851         ;;
2852 (irix[56].*)
2853         cf_xopen_source="-D_SGI_SOURCE"
2854         cf_XOPEN_SOURCE=
2855         ;;
2856 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
2857
2858 echo "$as_me:2858: checking if we must define _GNU_SOURCE" >&5
2859 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2860 if test "${cf_cv_gnu_source+set}" = set; then
2861   echo $ECHO_N "(cached) $ECHO_C" >&6
2862 else
2863
2864 cat >conftest.$ac_ext <<_ACEOF
2865 #line 2865 "configure"
2866 #include "confdefs.h"
2867 #include <sys/types.h>
2868 int
2869 main ()
2870 {
2871
2872 #ifndef _XOPEN_SOURCE
2873 make an error
2874 #endif
2875   ;
2876   return 0;
2877 }
2878 _ACEOF
2879 rm -f conftest.$ac_objext
2880 if { (eval echo "$as_me:2880: \"$ac_compile\"") >&5
2881   (eval $ac_compile) 2>&5
2882   ac_status=$?
2883   echo "$as_me:2883: \$? = $ac_status" >&5
2884   (exit $ac_status); } &&
2885          { ac_try='test -s conftest.$ac_objext'
2886   { (eval echo "$as_me:2886: \"$ac_try\"") >&5
2887   (eval $ac_try) 2>&5
2888   ac_status=$?
2889   echo "$as_me:2889: \$? = $ac_status" >&5
2890   (exit $ac_status); }; }; then
2891   cf_cv_gnu_source=no
2892 else
2893   echo "$as_me: failed program was:" >&5
2894 cat conftest.$ac_ext >&5
2895 cf_save="$CPPFLAGS"
2896          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2897          cat >conftest.$ac_ext <<_ACEOF
2898 #line 2898 "configure"
2899 #include "confdefs.h"
2900 #include <sys/types.h>
2901 int
2902 main ()
2903 {
2904
2905 #ifdef _XOPEN_SOURCE
2906 make an error
2907 #endif
2908   ;
2909   return 0;
2910 }
2911 _ACEOF
2912 rm -f conftest.$ac_objext
2913 if { (eval echo "$as_me:2913: \"$ac_compile\"") >&5
2914   (eval $ac_compile) 2>&5
2915   ac_status=$?
2916   echo "$as_me:2916: \$? = $ac_status" >&5
2917   (exit $ac_status); } &&
2918          { ac_try='test -s conftest.$ac_objext'
2919   { (eval echo "$as_me:2919: \"$ac_try\"") >&5
2920   (eval $ac_try) 2>&5
2921   ac_status=$?
2922   echo "$as_me:2922: \$? = $ac_status" >&5
2923   (exit $ac_status); }; }; then
2924   cf_cv_gnu_source=no
2925 else
2926   echo "$as_me: failed program was:" >&5
2927 cat conftest.$ac_ext >&5
2928 cf_cv_gnu_source=yes
2929 fi
2930 rm -f conftest.$ac_objext conftest.$ac_ext
2931         CPPFLAGS="$cf_save"
2932
2933 fi
2934 rm -f conftest.$ac_objext conftest.$ac_ext
2935
2936 fi
2937 echo "$as_me:2937: result: $cf_cv_gnu_source" >&5
2938 echo "${ECHO_T}$cf_cv_gnu_source" >&6
2939
2940 if test "$cf_cv_gnu_source" = yes
2941 then
2942 echo "$as_me:2942: checking if we should also define _DEFAULT_SOURCE" >&5
2943 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
2944 if test "${cf_cv_default_source+set}" = set; then
2945   echo $ECHO_N "(cached) $ECHO_C" >&6
2946 else
2947
2948 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2949         cat >conftest.$ac_ext <<_ACEOF
2950 #line 2950 "configure"
2951 #include "confdefs.h"
2952 #include <sys/types.h>
2953 int
2954 main ()
2955 {
2956
2957 #ifdef _DEFAULT_SOURCE
2958 make an error
2959 #endif
2960   ;
2961   return 0;
2962 }
2963 _ACEOF
2964 rm -f conftest.$ac_objext
2965 if { (eval echo "$as_me:2965: \"$ac_compile\"") >&5
2966   (eval $ac_compile) 2>&5
2967   ac_status=$?
2968   echo "$as_me:2968: \$? = $ac_status" >&5
2969   (exit $ac_status); } &&
2970          { ac_try='test -s conftest.$ac_objext'
2971   { (eval echo "$as_me:2971: \"$ac_try\"") >&5
2972   (eval $ac_try) 2>&5
2973   ac_status=$?
2974   echo "$as_me:2974: \$? = $ac_status" >&5
2975   (exit $ac_status); }; }; then
2976   cf_cv_default_source=no
2977 else
2978   echo "$as_me: failed program was:" >&5
2979 cat conftest.$ac_ext >&5
2980 cf_cv_default_source=yes
2981 fi
2982 rm -f conftest.$ac_objext conftest.$ac_ext
2983
2984 fi
2985 echo "$as_me:2985: result: $cf_cv_default_source" >&5
2986 echo "${ECHO_T}$cf_cv_default_source" >&6
2987 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
2988 fi
2989
2990         ;;
2991 (minix*)
2992         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
2993         ;;
2994 (mirbsd*)
2995         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
2996         cf_XOPEN_SOURCE=
2997
2998 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2999
3000 cf_save_CFLAGS="$CFLAGS"
3001 cf_save_CPPFLAGS="$CPPFLAGS"
3002
3003 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3004         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3005                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3006
3007 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3008         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3009                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3010
3011 echo "$as_me:3011: checking if we should define _POSIX_C_SOURCE" >&5
3012 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3013 if test "${cf_cv_posix_c_source+set}" = set; then
3014   echo $ECHO_N "(cached) $ECHO_C" >&6
3015 else
3016
3017 echo "${as_me:-configure}:3017: testing if the symbol is already defined go no further ..." 1>&5
3018
3019         cat >conftest.$ac_ext <<_ACEOF
3020 #line 3020 "configure"
3021 #include "confdefs.h"
3022 #include <sys/types.h>
3023 int
3024 main ()
3025 {
3026
3027 #ifndef _POSIX_C_SOURCE
3028 make an error
3029 #endif
3030   ;
3031   return 0;
3032 }
3033 _ACEOF
3034 rm -f conftest.$ac_objext
3035 if { (eval echo "$as_me:3035: \"$ac_compile\"") >&5
3036   (eval $ac_compile) 2>&5
3037   ac_status=$?
3038   echo "$as_me:3038: \$? = $ac_status" >&5
3039   (exit $ac_status); } &&
3040          { ac_try='test -s conftest.$ac_objext'
3041   { (eval echo "$as_me:3041: \"$ac_try\"") >&5
3042   (eval $ac_try) 2>&5
3043   ac_status=$?
3044   echo "$as_me:3044: \$? = $ac_status" >&5
3045   (exit $ac_status); }; }; then
3046   cf_cv_posix_c_source=no
3047 else
3048   echo "$as_me: failed program was:" >&5
3049 cat conftest.$ac_ext >&5
3050 cf_want_posix_source=no
3051          case .$cf_POSIX_C_SOURCE in
3052          (.[12]??*)
3053                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3054                 ;;
3055          (.2)
3056                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3057                 cf_want_posix_source=yes
3058                 ;;
3059          (.*)
3060                 cf_want_posix_source=yes
3061                 ;;
3062          esac
3063          if test "$cf_want_posix_source" = yes ; then
3064                 cat >conftest.$ac_ext <<_ACEOF
3065 #line 3065 "configure"
3066 #include "confdefs.h"
3067 #include <sys/types.h>
3068 int
3069 main ()
3070 {
3071
3072 #ifdef _POSIX_SOURCE
3073 make an error
3074 #endif
3075   ;
3076   return 0;
3077 }
3078 _ACEOF
3079 rm -f conftest.$ac_objext
3080 if { (eval echo "$as_me:3080: \"$ac_compile\"") >&5
3081   (eval $ac_compile) 2>&5
3082   ac_status=$?
3083   echo "$as_me:3083: \$? = $ac_status" >&5
3084   (exit $ac_status); } &&
3085          { ac_try='test -s conftest.$ac_objext'
3086   { (eval echo "$as_me:3086: \"$ac_try\"") >&5
3087   (eval $ac_try) 2>&5
3088   ac_status=$?
3089   echo "$as_me:3089: \$? = $ac_status" >&5
3090   (exit $ac_status); }; }; then
3091   :
3092 else
3093   echo "$as_me: failed program was:" >&5
3094 cat conftest.$ac_ext >&5
3095 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3096 fi
3097 rm -f conftest.$ac_objext conftest.$ac_ext
3098          fi
3099
3100 echo "${as_me:-configure}:3100: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3101
3102          CFLAGS="$cf_trim_CFLAGS"
3103          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3104
3105 echo "${as_me:-configure}:3105: testing if the second compile does not leave our definition intact error ..." 1>&5
3106
3107          cat >conftest.$ac_ext <<_ACEOF
3108 #line 3108 "configure"
3109 #include "confdefs.h"
3110 #include <sys/types.h>
3111 int
3112 main ()
3113 {
3114
3115 #ifndef _POSIX_C_SOURCE
3116 make an error
3117 #endif
3118   ;
3119   return 0;
3120 }
3121 _ACEOF
3122 rm -f conftest.$ac_objext
3123 if { (eval echo "$as_me:3123: \"$ac_compile\"") >&5
3124   (eval $ac_compile) 2>&5
3125   ac_status=$?
3126   echo "$as_me:3126: \$? = $ac_status" >&5
3127   (exit $ac_status); } &&
3128          { ac_try='test -s conftest.$ac_objext'
3129   { (eval echo "$as_me:3129: \"$ac_try\"") >&5
3130   (eval $ac_try) 2>&5
3131   ac_status=$?
3132   echo "$as_me:3132: \$? = $ac_status" >&5
3133   (exit $ac_status); }; }; then
3134   :
3135 else
3136   echo "$as_me: failed program was:" >&5
3137 cat conftest.$ac_ext >&5
3138 cf_cv_posix_c_source=no
3139 fi
3140 rm -f conftest.$ac_objext conftest.$ac_ext
3141          CFLAGS="$cf_save_CFLAGS"
3142          CPPFLAGS="$cf_save_CPPFLAGS"
3143
3144 fi
3145 rm -f conftest.$ac_objext conftest.$ac_ext
3146
3147 fi
3148 echo "$as_me:3148: result: $cf_cv_posix_c_source" >&5
3149 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3150
3151 if test "$cf_cv_posix_c_source" != no ; then
3152         CFLAGS="$cf_trim_CFLAGS"
3153         CPPFLAGS="$cf_trim_CPPFLAGS"
3154
3155 cf_fix_cppflags=no
3156 cf_new_cflags=
3157 cf_new_cppflags=
3158 cf_new_extra_cppflags=
3159
3160 for cf_add_cflags in $cf_cv_posix_c_source
3161 do
3162 case $cf_fix_cppflags in
3163 (no)
3164         case $cf_add_cflags in
3165         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3166                 case $cf_add_cflags in
3167                 (-D*)
3168                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3169
3170                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3171                                 && test -z "${cf_tst_cflags}" \
3172                                 && cf_fix_cppflags=yes
3173
3174                         if test $cf_fix_cppflags = yes ; then
3175                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3176                                 continue
3177                         elif test "${cf_tst_cflags}" = "\"'" ; then
3178                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3179                                 continue
3180                         fi
3181                         ;;
3182                 esac
3183                 case "$CPPFLAGS" in
3184                 (*$cf_add_cflags)
3185                         ;;
3186                 (*)
3187                         case $cf_add_cflags in
3188                         (-D*)
3189                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3190
3191 CPPFLAGS=`echo "$CPPFLAGS" | \
3192         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3193                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3194
3195                                 ;;
3196                         esac
3197                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3198                         ;;
3199                 esac
3200                 ;;
3201         (*)
3202                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3203                 ;;
3204         esac
3205         ;;
3206 (yes)
3207         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3208
3209         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3210
3211         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3212                 && test -z "${cf_tst_cflags}" \
3213                 && cf_fix_cppflags=no
3214         ;;
3215 esac
3216 done
3217
3218 if test -n "$cf_new_cflags" ; then
3219
3220         CFLAGS="$CFLAGS $cf_new_cflags"
3221 fi
3222
3223 if test -n "$cf_new_cppflags" ; then
3224
3225         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3226 fi
3227
3228 if test -n "$cf_new_extra_cppflags" ; then
3229
3230         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3231 fi
3232
3233 fi
3234
3235         ;;
3236 (netbsd*)
3237         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3238         ;;
3239 (openbsd[4-9]*)
3240         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3241         cf_xopen_source="-D_BSD_SOURCE"
3242         cf_XOPEN_SOURCE=600
3243         ;;
3244 (openbsd*)
3245         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3246         ;;
3247 (osf[45]*)
3248         cf_xopen_source="-D_OSF_SOURCE"
3249         ;;
3250 (nto-qnx*)
3251         cf_xopen_source="-D_QNX_SOURCE"
3252         ;;
3253 (sco*)
3254         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3255         ;;
3256 (solaris2.*)
3257         cf_xopen_source="-D__EXTENSIONS__"
3258         cf_cv_xopen_source=broken
3259         ;;
3260 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3261         cf_XOPEN_SOURCE=
3262         cf_POSIX_C_SOURCE=
3263         ;;
3264 (*)
3265
3266 echo "$as_me:3266: checking if we should define _XOPEN_SOURCE" >&5
3267 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3268 if test "${cf_cv_xopen_source+set}" = set; then
3269   echo $ECHO_N "(cached) $ECHO_C" >&6
3270 else
3271
3272         cat >conftest.$ac_ext <<_ACEOF
3273 #line 3273 "configure"
3274 #include "confdefs.h"
3275
3276 #include <stdlib.h>
3277 #include <string.h>
3278 #include <sys/types.h>
3279
3280 int
3281 main ()
3282 {
3283
3284 #ifndef _XOPEN_SOURCE
3285 make an error
3286 #endif
3287   ;
3288   return 0;
3289 }
3290 _ACEOF
3291 rm -f conftest.$ac_objext
3292 if { (eval echo "$as_me:3292: \"$ac_compile\"") >&5
3293   (eval $ac_compile) 2>&5
3294   ac_status=$?
3295   echo "$as_me:3295: \$? = $ac_status" >&5
3296   (exit $ac_status); } &&
3297          { ac_try='test -s conftest.$ac_objext'
3298   { (eval echo "$as_me:3298: \"$ac_try\"") >&5
3299   (eval $ac_try) 2>&5
3300   ac_status=$?
3301   echo "$as_me:3301: \$? = $ac_status" >&5
3302   (exit $ac_status); }; }; then
3303   cf_cv_xopen_source=no
3304 else
3305   echo "$as_me: failed program was:" >&5
3306 cat conftest.$ac_ext >&5
3307 cf_save="$CPPFLAGS"
3308          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3309          cat >conftest.$ac_ext <<_ACEOF
3310 #line 3310 "configure"
3311 #include "confdefs.h"
3312
3313 #include <stdlib.h>
3314 #include <string.h>
3315 #include <sys/types.h>
3316
3317 int
3318 main ()
3319 {
3320
3321 #ifdef _XOPEN_SOURCE
3322 make an error
3323 #endif
3324   ;
3325   return 0;
3326 }
3327 _ACEOF
3328 rm -f conftest.$ac_objext
3329 if { (eval echo "$as_me:3329: \"$ac_compile\"") >&5
3330   (eval $ac_compile) 2>&5
3331   ac_status=$?
3332   echo "$as_me:3332: \$? = $ac_status" >&5
3333   (exit $ac_status); } &&
3334          { ac_try='test -s conftest.$ac_objext'
3335   { (eval echo "$as_me:3335: \"$ac_try\"") >&5
3336   (eval $ac_try) 2>&5
3337   ac_status=$?
3338   echo "$as_me:3338: \$? = $ac_status" >&5
3339   (exit $ac_status); }; }; then
3340   cf_cv_xopen_source=no
3341 else
3342   echo "$as_me: failed program was:" >&5
3343 cat conftest.$ac_ext >&5
3344 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3345 fi
3346 rm -f conftest.$ac_objext conftest.$ac_ext
3347         CPPFLAGS="$cf_save"
3348
3349 fi
3350 rm -f conftest.$ac_objext conftest.$ac_ext
3351
3352 fi
3353 echo "$as_me:3353: result: $cf_cv_xopen_source" >&5
3354 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3355
3356 if test "$cf_cv_xopen_source" != no ; then
3357
3358 CFLAGS=`echo "$CFLAGS" | \
3359         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3360                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3361
3362 CPPFLAGS=`echo "$CPPFLAGS" | \
3363         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3364                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3365
3366         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3367
3368 cf_fix_cppflags=no
3369 cf_new_cflags=
3370 cf_new_cppflags=
3371 cf_new_extra_cppflags=
3372
3373 for cf_add_cflags in $cf_temp_xopen_source
3374 do
3375 case $cf_fix_cppflags in
3376 (no)
3377         case $cf_add_cflags in
3378         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3379                 case $cf_add_cflags in
3380                 (-D*)
3381                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3382
3383                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3384                                 && test -z "${cf_tst_cflags}" \
3385                                 && cf_fix_cppflags=yes
3386
3387                         if test $cf_fix_cppflags = yes ; then
3388                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3389                                 continue
3390                         elif test "${cf_tst_cflags}" = "\"'" ; then
3391                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3392                                 continue
3393                         fi
3394                         ;;
3395                 esac
3396                 case "$CPPFLAGS" in
3397                 (*$cf_add_cflags)
3398                         ;;
3399                 (*)
3400                         case $cf_add_cflags in
3401                         (-D*)
3402                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3403
3404 CPPFLAGS=`echo "$CPPFLAGS" | \
3405         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3406                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3407
3408                                 ;;
3409                         esac
3410                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3411                         ;;
3412                 esac
3413                 ;;
3414         (*)
3415                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3416                 ;;
3417         esac
3418         ;;
3419 (yes)
3420         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3421
3422         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3423
3424         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3425                 && test -z "${cf_tst_cflags}" \
3426                 && cf_fix_cppflags=no
3427         ;;
3428 esac
3429 done
3430
3431 if test -n "$cf_new_cflags" ; then
3432
3433         CFLAGS="$CFLAGS $cf_new_cflags"
3434 fi
3435
3436 if test -n "$cf_new_cppflags" ; then
3437
3438         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3439 fi
3440
3441 if test -n "$cf_new_extra_cppflags" ; then
3442
3443         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3444 fi
3445
3446 fi
3447
3448 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3449
3450 cf_save_CFLAGS="$CFLAGS"
3451 cf_save_CPPFLAGS="$CPPFLAGS"
3452
3453 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3454         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3455                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3456
3457 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3458         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3459                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3460
3461 echo "$as_me:3461: checking if we should define _POSIX_C_SOURCE" >&5
3462 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3463 if test "${cf_cv_posix_c_source+set}" = set; then
3464   echo $ECHO_N "(cached) $ECHO_C" >&6
3465 else
3466
3467 echo "${as_me:-configure}:3467: testing if the symbol is already defined go no further ..." 1>&5
3468
3469         cat >conftest.$ac_ext <<_ACEOF
3470 #line 3470 "configure"
3471 #include "confdefs.h"
3472 #include <sys/types.h>
3473 int
3474 main ()
3475 {
3476
3477 #ifndef _POSIX_C_SOURCE
3478 make an error
3479 #endif
3480   ;
3481   return 0;
3482 }
3483 _ACEOF
3484 rm -f conftest.$ac_objext
3485 if { (eval echo "$as_me:3485: \"$ac_compile\"") >&5
3486   (eval $ac_compile) 2>&5
3487   ac_status=$?
3488   echo "$as_me:3488: \$? = $ac_status" >&5
3489   (exit $ac_status); } &&
3490          { ac_try='test -s conftest.$ac_objext'
3491   { (eval echo "$as_me:3491: \"$ac_try\"") >&5
3492   (eval $ac_try) 2>&5
3493   ac_status=$?
3494   echo "$as_me:3494: \$? = $ac_status" >&5
3495   (exit $ac_status); }; }; then
3496   cf_cv_posix_c_source=no
3497 else
3498   echo "$as_me: failed program was:" >&5
3499 cat conftest.$ac_ext >&5
3500 cf_want_posix_source=no
3501          case .$cf_POSIX_C_SOURCE in
3502          (.[12]??*)
3503                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3504                 ;;
3505          (.2)
3506                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3507                 cf_want_posix_source=yes
3508                 ;;
3509          (.*)
3510                 cf_want_posix_source=yes
3511                 ;;
3512          esac
3513          if test "$cf_want_posix_source" = yes ; then
3514                 cat >conftest.$ac_ext <<_ACEOF
3515 #line 3515 "configure"
3516 #include "confdefs.h"
3517 #include <sys/types.h>
3518 int
3519 main ()
3520 {
3521
3522 #ifdef _POSIX_SOURCE
3523 make an error
3524 #endif
3525   ;
3526   return 0;
3527 }
3528 _ACEOF
3529 rm -f conftest.$ac_objext
3530 if { (eval echo "$as_me:3530: \"$ac_compile\"") >&5
3531   (eval $ac_compile) 2>&5
3532   ac_status=$?
3533   echo "$as_me:3533: \$? = $ac_status" >&5
3534   (exit $ac_status); } &&
3535          { ac_try='test -s conftest.$ac_objext'
3536   { (eval echo "$as_me:3536: \"$ac_try\"") >&5
3537   (eval $ac_try) 2>&5
3538   ac_status=$?
3539   echo "$as_me:3539: \$? = $ac_status" >&5
3540   (exit $ac_status); }; }; then
3541   :
3542 else
3543   echo "$as_me: failed program was:" >&5
3544 cat conftest.$ac_ext >&5
3545 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3546 fi
3547 rm -f conftest.$ac_objext conftest.$ac_ext
3548          fi
3549
3550 echo "${as_me:-configure}:3550: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3551
3552          CFLAGS="$cf_trim_CFLAGS"
3553          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3554
3555 echo "${as_me:-configure}:3555: testing if the second compile does not leave our definition intact error ..." 1>&5
3556
3557          cat >conftest.$ac_ext <<_ACEOF
3558 #line 3558 "configure"
3559 #include "confdefs.h"
3560 #include <sys/types.h>
3561 int
3562 main ()
3563 {
3564
3565 #ifndef _POSIX_C_SOURCE
3566 make an error
3567 #endif
3568   ;
3569   return 0;
3570 }
3571 _ACEOF
3572 rm -f conftest.$ac_objext
3573 if { (eval echo "$as_me:3573: \"$ac_compile\"") >&5
3574   (eval $ac_compile) 2>&5
3575   ac_status=$?
3576   echo "$as_me:3576: \$? = $ac_status" >&5
3577   (exit $ac_status); } &&
3578          { ac_try='test -s conftest.$ac_objext'
3579   { (eval echo "$as_me:3579: \"$ac_try\"") >&5
3580   (eval $ac_try) 2>&5
3581   ac_status=$?
3582   echo "$as_me:3582: \$? = $ac_status" >&5
3583   (exit $ac_status); }; }; then
3584   :
3585 else
3586   echo "$as_me: failed program was:" >&5
3587 cat conftest.$ac_ext >&5
3588 cf_cv_posix_c_source=no
3589 fi
3590 rm -f conftest.$ac_objext conftest.$ac_ext
3591          CFLAGS="$cf_save_CFLAGS"
3592          CPPFLAGS="$cf_save_CPPFLAGS"
3593
3594 fi
3595 rm -f conftest.$ac_objext conftest.$ac_ext
3596
3597 fi
3598 echo "$as_me:3598: result: $cf_cv_posix_c_source" >&5
3599 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3600
3601 if test "$cf_cv_posix_c_source" != no ; then
3602         CFLAGS="$cf_trim_CFLAGS"
3603         CPPFLAGS="$cf_trim_CPPFLAGS"
3604
3605 cf_fix_cppflags=no
3606 cf_new_cflags=
3607 cf_new_cppflags=
3608 cf_new_extra_cppflags=
3609
3610 for cf_add_cflags in $cf_cv_posix_c_source
3611 do
3612 case $cf_fix_cppflags in
3613 (no)
3614         case $cf_add_cflags in
3615         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3616                 case $cf_add_cflags in
3617                 (-D*)
3618                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3619
3620                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3621                                 && test -z "${cf_tst_cflags}" \
3622                                 && cf_fix_cppflags=yes
3623
3624                         if test $cf_fix_cppflags = yes ; then
3625                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3626                                 continue
3627                         elif test "${cf_tst_cflags}" = "\"'" ; then
3628                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3629                                 continue
3630                         fi
3631                         ;;
3632                 esac
3633                 case "$CPPFLAGS" in
3634                 (*$cf_add_cflags)
3635                         ;;
3636                 (*)
3637                         case $cf_add_cflags in
3638                         (-D*)
3639                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3640
3641 CPPFLAGS=`echo "$CPPFLAGS" | \
3642         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3643                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3644
3645                                 ;;
3646                         esac
3647                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3648                         ;;
3649                 esac
3650                 ;;
3651         (*)
3652                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3653                 ;;
3654         esac
3655         ;;
3656 (yes)
3657         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3658
3659         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3660
3661         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3662                 && test -z "${cf_tst_cflags}" \
3663                 && cf_fix_cppflags=no
3664         ;;
3665 esac
3666 done
3667
3668 if test -n "$cf_new_cflags" ; then
3669
3670         CFLAGS="$CFLAGS $cf_new_cflags"
3671 fi
3672
3673 if test -n "$cf_new_cppflags" ; then
3674
3675         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3676 fi
3677
3678 if test -n "$cf_new_extra_cppflags" ; then
3679
3680         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3681 fi
3682
3683 fi
3684
3685         ;;
3686 esac
3687
3688 if test -n "$cf_xopen_source" ; then
3689
3690 cf_fix_cppflags=no
3691 cf_new_cflags=
3692 cf_new_cppflags=
3693 cf_new_extra_cppflags=
3694
3695 for cf_add_cflags in $cf_xopen_source
3696 do
3697 case $cf_fix_cppflags in
3698 (no)
3699         case $cf_add_cflags in
3700         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3701                 case $cf_add_cflags in
3702                 (-D*)
3703                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3704
3705                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3706                                 && test -z "${cf_tst_cflags}" \
3707                                 && cf_fix_cppflags=yes
3708
3709                         if test $cf_fix_cppflags = yes ; then
3710                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3711                                 continue
3712                         elif test "${cf_tst_cflags}" = "\"'" ; then
3713                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3714                                 continue
3715                         fi
3716                         ;;
3717                 esac
3718                 case "$CPPFLAGS" in
3719                 (*$cf_add_cflags)
3720                         ;;
3721                 (*)
3722                         case $cf_add_cflags in
3723                         (-D*)
3724                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3725
3726 CPPFLAGS=`echo "$CPPFLAGS" | \
3727         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3728                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3729
3730                                 ;;
3731                         esac
3732                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3733                         ;;
3734                 esac
3735                 ;;
3736         (*)
3737                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3738                 ;;
3739         esac
3740         ;;
3741 (yes)
3742         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3743
3744         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3745
3746         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3747                 && test -z "${cf_tst_cflags}" \
3748                 && cf_fix_cppflags=no
3749         ;;
3750 esac
3751 done
3752
3753 if test -n "$cf_new_cflags" ; then
3754         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
3755
3756 echo "${as_me:-configure}:3756: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
3757
3758         CFLAGS="$CFLAGS $cf_new_cflags"
3759 fi
3760
3761 if test -n "$cf_new_cppflags" ; then
3762         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
3763
3764 echo "${as_me:-configure}:3764: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
3765
3766         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3767 fi
3768
3769 if test -n "$cf_new_extra_cppflags" ; then
3770         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
3771
3772 echo "${as_me:-configure}:3772: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
3773
3774         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3775 fi
3776
3777 fi
3778
3779 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3780         echo "$as_me:3780: checking if _XOPEN_SOURCE really is set" >&5
3781 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3782         cat >conftest.$ac_ext <<_ACEOF
3783 #line 3783 "configure"
3784 #include "confdefs.h"
3785 #include <stdlib.h>
3786 int
3787 main ()
3788 {
3789
3790 #ifndef _XOPEN_SOURCE
3791 make an error
3792 #endif
3793   ;
3794   return 0;
3795 }
3796 _ACEOF
3797 rm -f conftest.$ac_objext
3798 if { (eval echo "$as_me:3798: \"$ac_compile\"") >&5
3799   (eval $ac_compile) 2>&5
3800   ac_status=$?
3801   echo "$as_me:3801: \$? = $ac_status" >&5
3802   (exit $ac_status); } &&
3803          { ac_try='test -s conftest.$ac_objext'
3804   { (eval echo "$as_me:3804: \"$ac_try\"") >&5
3805   (eval $ac_try) 2>&5
3806   ac_status=$?
3807   echo "$as_me:3807: \$? = $ac_status" >&5
3808   (exit $ac_status); }; }; then
3809   cf_XOPEN_SOURCE_set=yes
3810 else
3811   echo "$as_me: failed program was:" >&5
3812 cat conftest.$ac_ext >&5
3813 cf_XOPEN_SOURCE_set=no
3814 fi
3815 rm -f conftest.$ac_objext conftest.$ac_ext
3816         echo "$as_me:3816: result: $cf_XOPEN_SOURCE_set" >&5
3817 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3818         if test $cf_XOPEN_SOURCE_set = yes
3819         then
3820                 cat >conftest.$ac_ext <<_ACEOF
3821 #line 3821 "configure"
3822 #include "confdefs.h"
3823 #include <stdlib.h>
3824 int
3825 main ()
3826 {
3827
3828 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3829 make an error
3830 #endif
3831   ;
3832   return 0;
3833 }
3834 _ACEOF
3835 rm -f conftest.$ac_objext
3836 if { (eval echo "$as_me:3836: \"$ac_compile\"") >&5
3837   (eval $ac_compile) 2>&5
3838   ac_status=$?
3839   echo "$as_me:3839: \$? = $ac_status" >&5
3840   (exit $ac_status); } &&
3841          { ac_try='test -s conftest.$ac_objext'
3842   { (eval echo "$as_me:3842: \"$ac_try\"") >&5
3843   (eval $ac_try) 2>&5
3844   ac_status=$?
3845   echo "$as_me:3845: \$? = $ac_status" >&5
3846   (exit $ac_status); }; }; then
3847   cf_XOPEN_SOURCE_set_ok=yes
3848 else
3849   echo "$as_me: failed program was:" >&5
3850 cat conftest.$ac_ext >&5
3851 cf_XOPEN_SOURCE_set_ok=no
3852 fi
3853 rm -f conftest.$ac_objext conftest.$ac_ext
3854                 if test $cf_XOPEN_SOURCE_set_ok = no
3855                 then
3856                         { echo "$as_me:3856: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3857 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3858                 fi
3859         else
3860
3861 echo "$as_me:3861: checking if we should define _XOPEN_SOURCE" >&5
3862 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3863 if test "${cf_cv_xopen_source+set}" = set; then
3864   echo $ECHO_N "(cached) $ECHO_C" >&6
3865 else
3866
3867         cat >conftest.$ac_ext <<_ACEOF
3868 #line 3868 "configure"
3869 #include "confdefs.h"
3870
3871 #include <stdlib.h>
3872 #include <string.h>
3873 #include <sys/types.h>
3874
3875 int
3876 main ()
3877 {
3878
3879 #ifndef _XOPEN_SOURCE
3880 make an error
3881 #endif
3882   ;
3883   return 0;
3884 }
3885 _ACEOF
3886 rm -f conftest.$ac_objext
3887 if { (eval echo "$as_me:3887: \"$ac_compile\"") >&5
3888   (eval $ac_compile) 2>&5
3889   ac_status=$?
3890   echo "$as_me:3890: \$? = $ac_status" >&5
3891   (exit $ac_status); } &&
3892          { ac_try='test -s conftest.$ac_objext'
3893   { (eval echo "$as_me:3893: \"$ac_try\"") >&5
3894   (eval $ac_try) 2>&5
3895   ac_status=$?
3896   echo "$as_me:3896: \$? = $ac_status" >&5
3897   (exit $ac_status); }; }; then
3898   cf_cv_xopen_source=no
3899 else
3900   echo "$as_me: failed program was:" >&5
3901 cat conftest.$ac_ext >&5
3902 cf_save="$CPPFLAGS"
3903          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3904          cat >conftest.$ac_ext <<_ACEOF
3905 #line 3905 "configure"
3906 #include "confdefs.h"
3907
3908 #include <stdlib.h>
3909 #include <string.h>
3910 #include <sys/types.h>
3911
3912 int
3913 main ()
3914 {
3915
3916 #ifdef _XOPEN_SOURCE
3917 make an error
3918 #endif
3919   ;
3920   return 0;
3921 }
3922 _ACEOF
3923 rm -f conftest.$ac_objext
3924 if { (eval echo "$as_me:3924: \"$ac_compile\"") >&5
3925   (eval $ac_compile) 2>&5
3926   ac_status=$?
3927   echo "$as_me:3927: \$? = $ac_status" >&5
3928   (exit $ac_status); } &&
3929          { ac_try='test -s conftest.$ac_objext'
3930   { (eval echo "$as_me:3930: \"$ac_try\"") >&5
3931   (eval $ac_try) 2>&5
3932   ac_status=$?
3933   echo "$as_me:3933: \$? = $ac_status" >&5
3934   (exit $ac_status); }; }; then
3935   cf_cv_xopen_source=no
3936 else
3937   echo "$as_me: failed program was:" >&5
3938 cat conftest.$ac_ext >&5
3939 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3940 fi
3941 rm -f conftest.$ac_objext conftest.$ac_ext
3942         CPPFLAGS="$cf_save"
3943
3944 fi
3945 rm -f conftest.$ac_objext conftest.$ac_ext
3946
3947 fi
3948 echo "$as_me:3948: result: $cf_cv_xopen_source" >&5
3949 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3950
3951 if test "$cf_cv_xopen_source" != no ; then
3952
3953 CFLAGS=`echo "$CFLAGS" | \
3954         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3955                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3956
3957 CPPFLAGS=`echo "$CPPFLAGS" | \
3958         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3959                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3960
3961         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3962
3963 cf_fix_cppflags=no
3964 cf_new_cflags=
3965 cf_new_cppflags=
3966 cf_new_extra_cppflags=
3967
3968 for cf_add_cflags in $cf_temp_xopen_source
3969 do
3970 case $cf_fix_cppflags in
3971 (no)
3972         case $cf_add_cflags in
3973         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3974                 case $cf_add_cflags in
3975                 (-D*)
3976                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3977
3978                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3979                                 && test -z "${cf_tst_cflags}" \
3980                                 && cf_fix_cppflags=yes
3981
3982                         if test $cf_fix_cppflags = yes ; then
3983                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3984                                 continue
3985                         elif test "${cf_tst_cflags}" = "\"'" ; then
3986                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3987                                 continue
3988                         fi
3989                         ;;
3990                 esac
3991                 case "$CPPFLAGS" in
3992                 (*$cf_add_cflags)
3993                         ;;
3994                 (*)
3995                         case $cf_add_cflags in
3996                         (-D*)
3997                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3998
3999 CPPFLAGS=`echo "$CPPFLAGS" | \
4000         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4001                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4002
4003                                 ;;
4004                         esac
4005                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4006                         ;;
4007                 esac
4008                 ;;
4009         (*)
4010                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4011                 ;;
4012         esac
4013         ;;
4014 (yes)
4015         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4016
4017         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4018
4019         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4020                 && test -z "${cf_tst_cflags}" \
4021                 && cf_fix_cppflags=no
4022         ;;
4023 esac
4024 done
4025
4026 if test -n "$cf_new_cflags" ; then
4027
4028         CFLAGS="$CFLAGS $cf_new_cflags"
4029 fi
4030
4031 if test -n "$cf_new_cppflags" ; then
4032
4033         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4034 fi
4035
4036 if test -n "$cf_new_extra_cppflags" ; then
4037
4038         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4039 fi
4040
4041 fi
4042
4043         fi
4044 fi
4045
4046 echo "$as_me:4046: checking for signal global datatype" >&5
4047 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4048 if test "${cf_cv_sig_atomic_t+set}" = set; then
4049   echo $ECHO_N "(cached) $ECHO_C" >&6
4050 else
4051
4052         for cf_type in \
4053                 "volatile sig_atomic_t" \
4054                 "sig_atomic_t" \
4055                 "int"
4056         do
4057         cat >conftest.$ac_ext <<_ACEOF
4058 #line 4058 "configure"
4059 #include "confdefs.h"
4060
4061 #include <sys/types.h>
4062 #include <signal.h>
4063 #include <stdio.h>
4064
4065 extern $cf_type x;
4066 $cf_type x;
4067 static void handler(int sig)
4068 {
4069         x = 5;
4070 }
4071 int
4072 main ()
4073 {
4074 signal(SIGINT, handler);
4075                  x = 1
4076   ;
4077   return 0;
4078 }
4079 _ACEOF
4080 rm -f conftest.$ac_objext
4081 if { (eval echo "$as_me:4081: \"$ac_compile\"") >&5
4082   (eval $ac_compile) 2>&5
4083   ac_status=$?
4084   echo "$as_me:4084: \$? = $ac_status" >&5
4085   (exit $ac_status); } &&
4086          { ac_try='test -s conftest.$ac_objext'
4087   { (eval echo "$as_me:4087: \"$ac_try\"") >&5
4088   (eval $ac_try) 2>&5
4089   ac_status=$?
4090   echo "$as_me:4090: \$? = $ac_status" >&5
4091   (exit $ac_status); }; }; then
4092   cf_cv_sig_atomic_t=$cf_type
4093 else
4094   echo "$as_me: failed program was:" >&5
4095 cat conftest.$ac_ext >&5
4096 cf_cv_sig_atomic_t=no
4097 fi
4098 rm -f conftest.$ac_objext conftest.$ac_ext
4099                 test "$cf_cv_sig_atomic_t" != no && break
4100         done
4101
4102 fi
4103
4104 echo "$as_me:4104: result: $cf_cv_sig_atomic_t" >&5
4105 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4106 test "$cf_cv_sig_atomic_t" != no &&
4107 cat >>confdefs.h <<EOF
4108 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4109 EOF
4110
4111 # Work around breakage on OS X
4112
4113 echo "$as_me:4113: checking if SIGWINCH is defined" >&5
4114 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
4115 if test "${cf_cv_define_sigwinch+set}" = set; then
4116   echo $ECHO_N "(cached) $ECHO_C" >&6
4117 else
4118
4119         cat >conftest.$ac_ext <<_ACEOF
4120 #line 4120 "configure"
4121 #include "confdefs.h"
4122
4123 #include <sys/types.h>
4124 #include <sys/signal.h>
4125
4126 int
4127 main ()
4128 {
4129 int x = SIGWINCH
4130   ;
4131   return 0;
4132 }
4133 _ACEOF
4134 rm -f conftest.$ac_objext
4135 if { (eval echo "$as_me:4135: \"$ac_compile\"") >&5
4136   (eval $ac_compile) 2>&5
4137   ac_status=$?
4138   echo "$as_me:4138: \$? = $ac_status" >&5
4139   (exit $ac_status); } &&
4140          { ac_try='test -s conftest.$ac_objext'
4141   { (eval echo "$as_me:4141: \"$ac_try\"") >&5
4142   (eval $ac_try) 2>&5
4143   ac_status=$?
4144   echo "$as_me:4144: \$? = $ac_status" >&5
4145   (exit $ac_status); }; }; then
4146   cf_cv_define_sigwinch=yes
4147 else
4148   echo "$as_me: failed program was:" >&5
4149 cat conftest.$ac_ext >&5
4150 cat >conftest.$ac_ext <<_ACEOF
4151 #line 4151 "configure"
4152 #include "confdefs.h"
4153
4154 #undef _XOPEN_SOURCE
4155 #undef _POSIX_SOURCE
4156 #undef _POSIX_C_SOURCE
4157 #include <sys/types.h>
4158 #include <sys/signal.h>
4159
4160 int
4161 main ()
4162 {
4163 int x = SIGWINCH
4164   ;
4165   return 0;
4166 }
4167 _ACEOF
4168 rm -f conftest.$ac_objext
4169 if { (eval echo "$as_me:4169: \"$ac_compile\"") >&5
4170   (eval $ac_compile) 2>&5
4171   ac_status=$?
4172   echo "$as_me:4172: \$? = $ac_status" >&5
4173   (exit $ac_status); } &&
4174          { ac_try='test -s conftest.$ac_objext'
4175   { (eval echo "$as_me:4175: \"$ac_try\"") >&5
4176   (eval $ac_try) 2>&5
4177   ac_status=$?
4178   echo "$as_me:4178: \$? = $ac_status" >&5
4179   (exit $ac_status); }; }; then
4180   cf_cv_define_sigwinch=maybe
4181 else
4182   echo "$as_me: failed program was:" >&5
4183 cat conftest.$ac_ext >&5
4184 cf_cv_define_sigwinch=no
4185 fi
4186 rm -f conftest.$ac_objext conftest.$ac_ext
4187
4188 fi
4189 rm -f conftest.$ac_objext conftest.$ac_ext
4190
4191 fi
4192 echo "$as_me:4192: result: $cf_cv_define_sigwinch" >&5
4193 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
4194
4195 if test "$cf_cv_define_sigwinch" = maybe ; then
4196 echo "$as_me:4196: checking for actual SIGWINCH definition" >&5
4197 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
4198 if test "${cf_cv_fixup_sigwinch+set}" = set; then
4199   echo $ECHO_N "(cached) $ECHO_C" >&6
4200 else
4201
4202 cf_cv_fixup_sigwinch=unknown
4203 cf_sigwinch=32
4204 while test $cf_sigwinch != 1
4205 do
4206         cat >conftest.$ac_ext <<_ACEOF
4207 #line 4207 "configure"
4208 #include "confdefs.h"
4209
4210 #undef _XOPEN_SOURCE
4211 #undef _POSIX_SOURCE
4212 #undef _POSIX_C_SOURCE
4213 #include <sys/types.h>
4214 #include <sys/signal.h>
4215
4216 int
4217 main ()
4218 {
4219
4220 #if SIGWINCH != $cf_sigwinch
4221 make an error
4222 #endif
4223 int x = SIGWINCH
4224   ;
4225   return 0;
4226 }
4227 _ACEOF
4228 rm -f conftest.$ac_objext
4229 if { (eval echo "$as_me:4229: \"$ac_compile\"") >&5
4230   (eval $ac_compile) 2>&5
4231   ac_status=$?
4232   echo "$as_me:4232: \$? = $ac_status" >&5
4233   (exit $ac_status); } &&
4234          { ac_try='test -s conftest.$ac_objext'
4235   { (eval echo "$as_me:4235: \"$ac_try\"") >&5
4236   (eval $ac_try) 2>&5
4237   ac_status=$?
4238   echo "$as_me:4238: \$? = $ac_status" >&5
4239   (exit $ac_status); }; }; then
4240   cf_cv_fixup_sigwinch=$cf_sigwinch
4241          break
4242 else
4243   echo "$as_me: failed program was:" >&5
4244 cat conftest.$ac_ext >&5
4245 fi
4246 rm -f conftest.$ac_objext conftest.$ac_ext
4247
4248 cf_sigwinch=`expr $cf_sigwinch - 1`
4249 done
4250
4251 fi
4252 echo "$as_me:4252: result: $cf_cv_fixup_sigwinch" >&5
4253 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
4254
4255         if test "$cf_cv_fixup_sigwinch" != unknown ; then
4256                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
4257         fi
4258 fi
4259
4260 # Checks for CODESET support.
4261
4262 echo "$as_me:4262: checking for nl_langinfo and CODESET" >&5
4263 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
4264 if test "${am_cv_langinfo_codeset+set}" = set; then
4265   echo $ECHO_N "(cached) $ECHO_C" >&6
4266 else
4267   cat >conftest.$ac_ext <<_ACEOF
4268 #line 4268 "configure"
4269 #include "confdefs.h"
4270 #include <langinfo.h>
4271 int
4272 main ()
4273 {
4274 char* cs = nl_langinfo(CODESET);
4275   ;
4276   return 0;
4277 }
4278 _ACEOF
4279 rm -f conftest.$ac_objext conftest$ac_exeext
4280 if { (eval echo "$as_me:4280: \"$ac_link\"") >&5
4281   (eval $ac_link) 2>&5
4282   ac_status=$?
4283   echo "$as_me:4283: \$? = $ac_status" >&5
4284   (exit $ac_status); } &&
4285          { ac_try='test -s conftest$ac_exeext'
4286   { (eval echo "$as_me:4286: \"$ac_try\"") >&5
4287   (eval $ac_try) 2>&5
4288   ac_status=$?
4289   echo "$as_me:4289: \$? = $ac_status" >&5
4290   (exit $ac_status); }; }; then
4291   am_cv_langinfo_codeset=yes
4292 else
4293   echo "$as_me: failed program was:" >&5
4294 cat conftest.$ac_ext >&5
4295 am_cv_langinfo_codeset=no
4296 fi
4297 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4298
4299 fi
4300 echo "$as_me:4300: result: $am_cv_langinfo_codeset" >&5
4301 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
4302         if test $am_cv_langinfo_codeset = yes; then
4303
4304 cat >>confdefs.h <<\EOF
4305 #define HAVE_LANGINFO_CODESET 1
4306 EOF
4307
4308         fi
4309
4310 echo "$as_me:4310: checking if you want to use pkg-config" >&5
4311 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4312
4313 # Check whether --with-pkg-config or --without-pkg-config was given.
4314 if test "${with_pkg_config+set}" = set; then
4315   withval="$with_pkg_config"
4316   cf_pkg_config=$withval
4317 else
4318   cf_pkg_config=yes
4319 fi;
4320 echo "$as_me:4320: result: $cf_pkg_config" >&5
4321 echo "${ECHO_T}$cf_pkg_config" >&6
4322
4323 case $cf_pkg_config in
4324 (no)
4325         PKG_CONFIG=none
4326         ;;
4327 (yes)
4328
4329 if test -n "$ac_tool_prefix"; then
4330   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4331 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4332 echo "$as_me:4332: checking for $ac_word" >&5
4333 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4334 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4335   echo $ECHO_N "(cached) $ECHO_C" >&6
4336 else
4337   case $PKG_CONFIG in
4338   [\\/]* | ?:[\\/]*)
4339   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4340   ;;
4341   *)
4342   ac_save_IFS=$IFS; IFS=$ac_path_separator
4343 ac_dummy="$PATH"
4344 for ac_dir in $ac_dummy; do
4345   IFS=$ac_save_IFS
4346   test -z "$ac_dir" && ac_dir=.
4347   if $as_executable_p "$ac_dir/$ac_word"; then
4348    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4349    echo "$as_me:4349: found $ac_dir/$ac_word" >&5
4350    break
4351 fi
4352 done
4353
4354   ;;
4355 esac
4356 fi
4357 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4358
4359 if test -n "$PKG_CONFIG"; then
4360   echo "$as_me:4360: result: $PKG_CONFIG" >&5
4361 echo "${ECHO_T}$PKG_CONFIG" >&6
4362 else
4363   echo "$as_me:4363: result: no" >&5
4364 echo "${ECHO_T}no" >&6
4365 fi
4366
4367 fi
4368 if test -z "$ac_cv_path_PKG_CONFIG"; then
4369   ac_pt_PKG_CONFIG=$PKG_CONFIG
4370   # Extract the first word of "pkg-config", so it can be a program name with args.
4371 set dummy pkg-config; ac_word=$2
4372 echo "$as_me:4372: checking for $ac_word" >&5
4373 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4374 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4375   echo $ECHO_N "(cached) $ECHO_C" >&6
4376 else
4377   case $ac_pt_PKG_CONFIG in
4378   [\\/]* | ?:[\\/]*)
4379   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4380   ;;
4381   *)
4382   ac_save_IFS=$IFS; IFS=$ac_path_separator
4383 ac_dummy="$PATH"
4384 for ac_dir in $ac_dummy; do
4385   IFS=$ac_save_IFS
4386   test -z "$ac_dir" && ac_dir=.
4387   if $as_executable_p "$ac_dir/$ac_word"; then
4388    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4389    echo "$as_me:4389: found $ac_dir/$ac_word" >&5
4390    break
4391 fi
4392 done
4393
4394   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4395   ;;
4396 esac
4397 fi
4398 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4399
4400 if test -n "$ac_pt_PKG_CONFIG"; then
4401   echo "$as_me:4401: result: $ac_pt_PKG_CONFIG" >&5
4402 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4403 else
4404   echo "$as_me:4404: result: no" >&5
4405 echo "${ECHO_T}no" >&6
4406 fi
4407
4408   PKG_CONFIG=$ac_pt_PKG_CONFIG
4409 else
4410   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4411 fi
4412
4413         ;;
4414 (*)
4415         PKG_CONFIG=$withval
4416         ;;
4417 esac
4418
4419 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4420 if test "$PKG_CONFIG" != none ; then
4421
4422 if test "x$prefix" != xNONE; then
4423         cf_path_syntax="$prefix"
4424 else
4425         cf_path_syntax="$ac_default_prefix"
4426 fi
4427
4428 case ".$PKG_CONFIG" in
4429 (.\$\(*\)*|.\'*\'*)
4430         ;;
4431 (..|./*|.\\*)
4432         ;;
4433 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4434         ;;
4435 (.\${*prefix}*|.\${*dir}*)
4436         eval PKG_CONFIG="$PKG_CONFIG"
4437         case ".$PKG_CONFIG" in
4438         (.NONE/*)
4439                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4440                 ;;
4441         esac
4442         ;;
4443 (.no|.NONE/*)
4444         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4445         ;;
4446 (*)
4447         { { echo "$as_me:4447: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4448 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4449    { (exit 1); exit 1; }; }
4450         ;;
4451 esac
4452
4453 elif test "x$cf_pkg_config" != xno ; then
4454         { echo "$as_me:4454: WARNING: pkg-config is not installed" >&5
4455 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4456 fi
4457
4458 echo "$as_me:4458: checking if you want to see long compiling messages" >&5
4459 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4460
4461 # Check whether --enable-echo or --disable-echo was given.
4462 if test "${enable_echo+set}" = set; then
4463   enableval="$enable_echo"
4464   test "$enableval" != no && enableval=yes
4465         if test "$enableval" != "yes" ; then
4466
4467         ECHO_LT='--silent'
4468         ECHO_LD='@echo linking $@;'
4469         RULE_CC='@echo compiling $<'
4470         SHOW_CC='@echo compiling $@'
4471         ECHO_CC='@'
4472
4473         else
4474
4475         ECHO_LT=''
4476         ECHO_LD=''
4477         RULE_CC=''
4478         SHOW_CC=''
4479         ECHO_CC=''
4480
4481         fi
4482 else
4483   enableval=yes
4484
4485         ECHO_LT=''
4486         ECHO_LD=''
4487         RULE_CC=''
4488         SHOW_CC=''
4489         ECHO_CC=''
4490
4491 fi;
4492 echo "$as_me:4492: result: $enableval" >&5
4493 echo "${ECHO_T}$enableval" >&6
4494
4495 echo "$as_me:4495: checking for ncurses wrap-prefix" >&5
4496 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4497
4498 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4499 if test "${with_ncurses_wrap_prefix+set}" = set; then
4500   withval="$with_ncurses_wrap_prefix"
4501   NCURSES_WRAP_PREFIX=$withval
4502 else
4503   NCURSES_WRAP_PREFIX=_nc_
4504 fi;
4505 echo "$as_me:4505: result: $NCURSES_WRAP_PREFIX" >&5
4506 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4507
4508 echo "$as_me:4508: checking if you want to check for wide-character functions" >&5
4509 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4510
4511 # Check whether --enable-widec or --disable-widec was given.
4512 if test "${enable_widec+set}" = set; then
4513   enableval="$enable_widec"
4514   test "$enableval" != no && enableval=yes
4515         if test "$enableval" != "yes" ; then
4516     cf_enable_widec=no
4517         else
4518                 cf_enable_widec=yes
4519         fi
4520 else
4521   enableval=yes
4522         cf_enable_widec=yes
4523
4524 fi;
4525 echo "$as_me:4525: result: $cf_enable_widec" >&5
4526 echo "${ECHO_T}$cf_enable_widec" >&6
4527
4528 echo "$as_me:4528: checking for specific curses-directory" >&5
4529 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4530
4531 # Check whether --with-curses-dir or --without-curses-dir was given.
4532 if test "${with_curses_dir+set}" = set; then
4533   withval="$with_curses_dir"
4534   cf_cv_curses_dir=$withval
4535 else
4536   cf_cv_curses_dir=no
4537 fi;
4538 echo "$as_me:4538: result: $cf_cv_curses_dir" >&5
4539 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4540
4541 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4542 then
4543
4544 if test "x$prefix" != xNONE; then
4545         cf_path_syntax="$prefix"
4546 else
4547         cf_path_syntax="$ac_default_prefix"
4548 fi
4549
4550 case ".$withval" in
4551 (.\$\(*\)*|.\'*\'*)
4552         ;;
4553 (..|./*|.\\*)
4554         ;;
4555 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4556         ;;
4557 (.\${*prefix}*|.\${*dir}*)
4558         eval withval="$withval"
4559         case ".$withval" in
4560         (.NONE/*)
4561                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4562                 ;;
4563         esac
4564         ;;
4565 (.no|.NONE/*)
4566         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4567         ;;
4568 (*)
4569         { { echo "$as_me:4569: error: expected a pathname, not \"$withval\"" >&5
4570 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4571    { (exit 1); exit 1; }; }
4572         ;;
4573 esac
4574
4575         if test -d "$cf_cv_curses_dir"
4576         then
4577
4578 if test -n "$cf_cv_curses_dir/include" ; then
4579   for cf_add_incdir in $cf_cv_curses_dir/include
4580   do
4581         while test $cf_add_incdir != /usr/include
4582         do
4583           if test -d $cf_add_incdir
4584           then
4585                 cf_have_incdir=no
4586                 if test -n "$CFLAGS$CPPFLAGS" ; then
4587                   # a loop is needed to ensure we can add subdirs of existing dirs
4588                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4589                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4590                           cf_have_incdir=yes; break
4591                         fi
4592                   done
4593                 fi
4594
4595                 if test "$cf_have_incdir" = no ; then
4596                   if test "$cf_add_incdir" = /usr/local/include ; then
4597                         if test "$GCC" = yes
4598                         then
4599                           cf_save_CPPFLAGS=$CPPFLAGS
4600                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4601                           cat >conftest.$ac_ext <<_ACEOF
4602 #line 4602 "configure"
4603 #include "confdefs.h"
4604 #include <stdio.h>
4605 int
4606 main ()
4607 {
4608 printf("Hello")
4609   ;
4610   return 0;
4611 }
4612 _ACEOF
4613 rm -f conftest.$ac_objext
4614 if { (eval echo "$as_me:4614: \"$ac_compile\"") >&5
4615   (eval $ac_compile) 2>&5
4616   ac_status=$?
4617   echo "$as_me:4617: \$? = $ac_status" >&5
4618   (exit $ac_status); } &&
4619          { ac_try='test -s conftest.$ac_objext'
4620   { (eval echo "$as_me:4620: \"$ac_try\"") >&5
4621   (eval $ac_try) 2>&5
4622   ac_status=$?
4623   echo "$as_me:4623: \$? = $ac_status" >&5
4624   (exit $ac_status); }; }; then
4625   :
4626 else
4627   echo "$as_me: failed program was:" >&5
4628 cat conftest.$ac_ext >&5
4629 cf_have_incdir=yes
4630 fi
4631 rm -f conftest.$ac_objext conftest.$ac_ext
4632                           CPPFLAGS=$cf_save_CPPFLAGS
4633                         fi
4634                   fi
4635                 fi
4636
4637                 if test "$cf_have_incdir" = no ; then
4638                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4639
4640 echo "${as_me:-configure}:4640: testing adding $cf_add_incdir to include-path ..." 1>&5
4641
4642                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4643
4644                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4645                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4646                   cf_add_incdir="$cf_top_incdir"
4647                 else
4648                   break
4649                 fi
4650           else
4651                 break
4652           fi
4653         done
4654   done
4655 fi
4656
4657 if test -n "$cf_cv_curses_dir/lib" ; then
4658         for cf_add_libdir in $cf_cv_curses_dir/lib
4659         do
4660                 if test $cf_add_libdir = /usr/lib ; then
4661                         :
4662                 elif test -d $cf_add_libdir
4663                 then
4664                         cf_have_libdir=no
4665                         if test -n "$LDFLAGS$LIBS" ; then
4666                                 # a loop is needed to ensure we can add subdirs of existing dirs
4667                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4668                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4669                                                 cf_have_libdir=yes; break
4670                                         fi
4671                                 done
4672                         fi
4673                         if test "$cf_have_libdir" = no ; then
4674                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4675
4676 echo "${as_me:-configure}:4676: testing adding $cf_add_libdir to library-path ..." 1>&5
4677
4678                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4679                         fi
4680                 fi
4681         done
4682 fi
4683
4684         fi
4685 fi
4686
4687 cf_cv_screen=curses
4688
4689 echo "$as_me:4689: checking for specified curses library type" >&5
4690 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4691
4692 # Check whether --with-screen or --without-screen was given.
4693 if test "${with_screen+set}" = set; then
4694   withval="$with_screen"
4695   cf_cv_screen=$withval
4696 else
4697
4698 # Check whether --with-ncursesw or --without-ncursesw was given.
4699 if test "${with_ncursesw+set}" = set; then
4700   withval="$with_ncursesw"
4701   cf_cv_screen=ncursesw
4702 else
4703
4704 # Check whether --with-ncurses or --without-ncurses was given.
4705 if test "${with_ncurses+set}" = set; then
4706   withval="$with_ncurses"
4707   cf_cv_screen=ncurses
4708 else
4709
4710 # Check whether --with-pdcurses or --without-pdcurses was given.
4711 if test "${with_pdcurses+set}" = set; then
4712   withval="$with_pdcurses"
4713   cf_cv_screen=pdcurses
4714 else
4715
4716 # Check whether --with-curses-colr or --without-curses-colr was given.
4717 if test "${with_curses_colr+set}" = set; then
4718   withval="$with_curses_colr"
4719   cf_cv_screen=curses_colr
4720 else
4721
4722 # Check whether --with-curses-5lib or --without-curses-5lib was given.
4723 if test "${with_curses_5lib+set}" = set; then
4724   withval="$with_curses_5lib"
4725   cf_cv_screen=curses_5lib
4726 fi;
4727 fi;
4728 fi;
4729 fi;
4730 fi;
4731 fi;
4732
4733 echo "$as_me:4733: result: $cf_cv_screen" >&5
4734 echo "${ECHO_T}$cf_cv_screen" >&6
4735
4736 case $cf_cv_screen in
4737 (curses|curses_*)
4738
4739 echo "$as_me:4739: checking for extra include directories" >&5
4740 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4741 if test "${cf_cv_curses_incdir+set}" = set; then
4742   echo $ECHO_N "(cached) $ECHO_C" >&6
4743 else
4744
4745 cf_cv_curses_incdir=no
4746 case $host_os in
4747 (hpux10.*)
4748         if test "x$cf_cv_screen" = "xcurses_colr"
4749         then
4750                 test -d /usr/include/curses_colr && \
4751                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
4752         fi
4753         ;;
4754 (sunos3*|sunos4*)
4755         if test "x$cf_cv_screen" = "xcurses_5lib"
4756         then
4757                 test -d /usr/5lib && \
4758                 test -d /usr/5include && \
4759                 cf_cv_curses_incdir="-I/usr/5include"
4760         fi
4761         ;;
4762 esac
4763
4764 fi
4765 echo "$as_me:4765: result: $cf_cv_curses_incdir" >&5
4766 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4767 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4768
4769 echo "$as_me:4769: checking if we have identified curses headers" >&5
4770 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4771 if test "${cf_cv_ncurses_header+set}" = set; then
4772   echo $ECHO_N "(cached) $ECHO_C" >&6
4773 else
4774
4775 cf_cv_ncurses_header=none
4776 for cf_header in \
4777         ncurses.h  \
4778         curses.h  ncurses/ncurses.h ncurses/curses.h
4779 do
4780 cat >conftest.$ac_ext <<_ACEOF
4781 #line 4781 "configure"
4782 #include "confdefs.h"
4783 #include <${cf_header}>
4784 int
4785 main ()
4786 {
4787 initscr(); tgoto("?", 0,0)
4788   ;
4789   return 0;
4790 }
4791 _ACEOF
4792 rm -f conftest.$ac_objext
4793 if { (eval echo "$as_me:4793: \"$ac_compile\"") >&5
4794   (eval $ac_compile) 2>&5
4795   ac_status=$?
4796   echo "$as_me:4796: \$? = $ac_status" >&5
4797   (exit $ac_status); } &&
4798          { ac_try='test -s conftest.$ac_objext'
4799   { (eval echo "$as_me:4799: \"$ac_try\"") >&5
4800   (eval $ac_try) 2>&5
4801   ac_status=$?
4802   echo "$as_me:4802: \$? = $ac_status" >&5
4803   (exit $ac_status); }; }; then
4804   cf_cv_ncurses_header=$cf_header; break
4805 else
4806   echo "$as_me: failed program was:" >&5
4807 cat conftest.$ac_ext >&5
4808 fi
4809 rm -f conftest.$ac_objext conftest.$ac_ext
4810 done
4811
4812 fi
4813 echo "$as_me:4813: result: $cf_cv_ncurses_header" >&5
4814 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4815
4816 if test "$cf_cv_ncurses_header" = none ; then
4817         { { echo "$as_me:4817: error: No curses header-files found" >&5
4818 echo "$as_me: error: No curses header-files found" >&2;}
4819    { (exit 1); exit 1; }; }
4820 fi
4821
4822 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4823
4824 for ac_header in $cf_cv_ncurses_header
4825 do
4826 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4827 echo "$as_me:4827: checking for $ac_header" >&5
4828 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4829 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4830   echo $ECHO_N "(cached) $ECHO_C" >&6
4831 else
4832   cat >conftest.$ac_ext <<_ACEOF
4833 #line 4833 "configure"
4834 #include "confdefs.h"
4835 #include <$ac_header>
4836 _ACEOF
4837 if { (eval echo "$as_me:4837: \"$ac_cpp conftest.$ac_ext\"") >&5
4838   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4839   ac_status=$?
4840   egrep -v '^ *\+' conftest.er1 >conftest.err
4841   rm -f conftest.er1
4842   cat conftest.err >&5
4843   echo "$as_me:4843: \$? = $ac_status" >&5
4844   (exit $ac_status); } >/dev/null; then
4845   if test -s conftest.err; then
4846     ac_cpp_err=$ac_c_preproc_warn_flag
4847   else
4848     ac_cpp_err=
4849   fi
4850 else
4851   ac_cpp_err=yes
4852 fi
4853 if test -z "$ac_cpp_err"; then
4854   eval "$as_ac_Header=yes"
4855 else
4856   echo "$as_me: failed program was:" >&5
4857   cat conftest.$ac_ext >&5
4858   eval "$as_ac_Header=no"
4859 fi
4860 rm -f conftest.err conftest.$ac_ext
4861 fi
4862 echo "$as_me:4862: result: `eval echo '${'$as_ac_Header'}'`" >&5
4863 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4864 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4865   cat >>confdefs.h <<EOF
4866 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4867 EOF
4868
4869 fi
4870 done
4871
4872 echo "$as_me:4872: checking for terminfo header" >&5
4873 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4874 if test "${cf_cv_term_header+set}" = set; then
4875   echo $ECHO_N "(cached) $ECHO_C" >&6
4876 else
4877
4878 case ${cf_cv_ncurses_header} in
4879 (*/ncurses.h|*/ncursesw.h)
4880         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4881         ;;
4882 (*)
4883         cf_term_header=term.h
4884         ;;
4885 esac
4886
4887 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4888 do
4889 cat >conftest.$ac_ext <<_ACEOF
4890 #line 4890 "configure"
4891 #include "confdefs.h"
4892 #include <stdio.h>
4893 #include <${cf_cv_ncurses_header:-curses.h}>
4894 #include <$cf_test>
4895
4896 int
4897 main ()
4898 {
4899 int x = auto_left_margin
4900   ;
4901   return 0;
4902 }
4903 _ACEOF
4904 rm -f conftest.$ac_objext
4905 if { (eval echo "$as_me:4905: \"$ac_compile\"") >&5
4906   (eval $ac_compile) 2>&5
4907   ac_status=$?
4908   echo "$as_me:4908: \$? = $ac_status" >&5
4909   (exit $ac_status); } &&
4910          { ac_try='test -s conftest.$ac_objext'
4911   { (eval echo "$as_me:4911: \"$ac_try\"") >&5
4912   (eval $ac_try) 2>&5
4913   ac_status=$?
4914   echo "$as_me:4914: \$? = $ac_status" >&5
4915   (exit $ac_status); }; }; then
4916
4917         cf_cv_term_header="$cf_test"
4918 else
4919   echo "$as_me: failed program was:" >&5
4920 cat conftest.$ac_ext >&5
4921
4922         cf_cv_term_header=unknown
4923
4924 fi
4925 rm -f conftest.$ac_objext conftest.$ac_ext
4926         test "$cf_cv_term_header" != unknown && break
4927 done
4928
4929 fi
4930 echo "$as_me:4930: result: $cf_cv_term_header" >&5
4931 echo "${ECHO_T}$cf_cv_term_header" >&6
4932
4933 # Set definitions to allow ifdef'ing to accommodate subdirectories
4934
4935 case $cf_cv_term_header in
4936 (*term.h)
4937
4938 cat >>confdefs.h <<\EOF
4939 #define HAVE_TERM_H 1
4940 EOF
4941
4942         ;;
4943 esac
4944
4945 case $cf_cv_term_header in
4946 (ncurses/term.h)
4947
4948 cat >>confdefs.h <<\EOF
4949 #define HAVE_NCURSES_TERM_H 1
4950 EOF
4951
4952         ;;
4953 (ncursesw/term.h)
4954
4955 cat >>confdefs.h <<\EOF
4956 #define HAVE_NCURSESW_TERM_H 1
4957 EOF
4958
4959         ;;
4960 esac
4961
4962 echo "$as_me:4962: checking for ncurses version" >&5
4963 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4964 if test "${cf_cv_ncurses_version+set}" = set; then
4965   echo $ECHO_N "(cached) $ECHO_C" >&6
4966 else
4967
4968         cf_cv_ncurses_version=no
4969         cf_tempfile=out$$
4970         rm -f $cf_tempfile
4971         if test "$cross_compiling" = yes; then
4972
4973         # This will not work if the preprocessor splits the line after the
4974         # Autoconf token.  The 'unproto' program does that.
4975         cat > conftest.$ac_ext <<EOF
4976 #include <${cf_cv_ncurses_header:-curses.h}>
4977 #undef Autoconf
4978 #ifdef NCURSES_VERSION
4979 Autoconf NCURSES_VERSION
4980 #else
4981 #ifdef __NCURSES_H
4982 Autoconf "old"
4983 #endif
4984 ;
4985 #endif
4986 EOF
4987         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4988         { (eval echo "$as_me:4988: \"$cf_try\"") >&5
4989   (eval $cf_try) 2>&5
4990   ac_status=$?
4991   echo "$as_me:4991: \$? = $ac_status" >&5
4992   (exit $ac_status); }
4993         if test -f conftest.out ; then
4994                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4995                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4996                 rm -f conftest.out
4997         fi
4998
4999 else
5000   cat >conftest.$ac_ext <<_ACEOF
5001 #line 5001 "configure"
5002 #include "confdefs.h"
5003
5004 #include <${cf_cv_ncurses_header:-curses.h}>
5005 #include <stdio.h>
5006 int main()
5007 {
5008         FILE *fp = fopen("$cf_tempfile", "w");
5009 #ifdef NCURSES_VERSION
5010 # ifdef NCURSES_VERSION_PATCH
5011         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5012 # else
5013         fprintf(fp, "%s\n", NCURSES_VERSION);
5014 # endif
5015 #else
5016 # ifdef __NCURSES_H
5017         fprintf(fp, "old\n");
5018 # else
5019         make an error
5020 # endif
5021 #endif
5022         ${cf_cv_main_return:-return}(0);
5023 }
5024 _ACEOF
5025 rm -f conftest$ac_exeext
5026 if { (eval echo "$as_me:5026: \"$ac_link\"") >&5
5027   (eval $ac_link) 2>&5
5028   ac_status=$?
5029   echo "$as_me:5029: \$? = $ac_status" >&5
5030   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5031   { (eval echo "$as_me:5031: \"$ac_try\"") >&5
5032   (eval $ac_try) 2>&5
5033   ac_status=$?
5034   echo "$as_me:5034: \$? = $ac_status" >&5
5035   (exit $ac_status); }; }; then
5036
5037         cf_cv_ncurses_version=`cat $cf_tempfile`
5038 else
5039   echo "$as_me: program exited with status $ac_status" >&5
5040 echo "$as_me: failed program was:" >&5
5041 cat conftest.$ac_ext >&5
5042 fi
5043 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5044 fi
5045         rm -f $cf_tempfile
5046
5047 fi
5048 echo "$as_me:5048: result: $cf_cv_ncurses_version" >&5
5049 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5050 test "$cf_cv_ncurses_version" = no ||
5051 cat >>confdefs.h <<\EOF
5052 #define NCURSES 1
5053 EOF
5054
5055 echo "$as_me:5055: checking if we have identified curses libraries" >&5
5056 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5057 cat >conftest.$ac_ext <<_ACEOF
5058 #line 5058 "configure"
5059 #include "confdefs.h"
5060 #include <${cf_cv_ncurses_header:-curses.h}>
5061 int
5062 main ()
5063 {
5064 initscr(); tgoto("?", 0,0)
5065   ;
5066   return 0;
5067 }
5068 _ACEOF
5069 rm -f conftest.$ac_objext conftest$ac_exeext
5070 if { (eval echo "$as_me:5070: \"$ac_link\"") >&5
5071   (eval $ac_link) 2>&5
5072   ac_status=$?
5073   echo "$as_me:5073: \$? = $ac_status" >&5
5074   (exit $ac_status); } &&
5075          { ac_try='test -s conftest$ac_exeext'
5076   { (eval echo "$as_me:5076: \"$ac_try\"") >&5
5077   (eval $ac_try) 2>&5
5078   ac_status=$?
5079   echo "$as_me:5079: \$? = $ac_status" >&5
5080   (exit $ac_status); }; }; then
5081   cf_result=yes
5082 else
5083   echo "$as_me: failed program was:" >&5
5084 cat conftest.$ac_ext >&5
5085 cf_result=no
5086 fi
5087 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5088 echo "$as_me:5088: result: $cf_result" >&5
5089 echo "${ECHO_T}$cf_result" >&6
5090
5091 if test "$cf_result" = no ; then
5092 case $host_os in
5093 (freebsd*)
5094         echo "$as_me:5094: checking for tgoto in -lmytinfo" >&5
5095 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5096 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5097   echo $ECHO_N "(cached) $ECHO_C" >&6
5098 else
5099   ac_check_lib_save_LIBS=$LIBS
5100 LIBS="-lmytinfo  $LIBS"
5101 cat >conftest.$ac_ext <<_ACEOF
5102 #line 5102 "configure"
5103 #include "confdefs.h"
5104
5105 /* Override any gcc2 internal prototype to avoid an error.  */
5106 #ifdef __cplusplus
5107 extern "C"
5108 #endif
5109 /* We use char because int might match the return type of a gcc2
5110    builtin and then its argument prototype would still apply.  */
5111 char tgoto ();
5112 int
5113 main ()
5114 {
5115 tgoto ();
5116   ;
5117   return 0;
5118 }
5119 _ACEOF
5120 rm -f conftest.$ac_objext conftest$ac_exeext
5121 if { (eval echo "$as_me:5121: \"$ac_link\"") >&5
5122   (eval $ac_link) 2>&5
5123   ac_status=$?
5124   echo "$as_me:5124: \$? = $ac_status" >&5
5125   (exit $ac_status); } &&
5126          { ac_try='test -s conftest$ac_exeext'
5127   { (eval echo "$as_me:5127: \"$ac_try\"") >&5
5128   (eval $ac_try) 2>&5
5129   ac_status=$?
5130   echo "$as_me:5130: \$? = $ac_status" >&5
5131   (exit $ac_status); }; }; then
5132   ac_cv_lib_mytinfo_tgoto=yes
5133 else
5134   echo "$as_me: failed program was:" >&5
5135 cat conftest.$ac_ext >&5
5136 ac_cv_lib_mytinfo_tgoto=no
5137 fi
5138 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5139 LIBS=$ac_check_lib_save_LIBS
5140 fi
5141 echo "$as_me:5141: result: $ac_cv_lib_mytinfo_tgoto" >&5
5142 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5143 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5144
5145 cf_add_libs="-lmytinfo"
5146 # Filter out duplicates - this happens with badly-designed ".pc" files...
5147 for cf_add_1lib in $LIBS
5148 do
5149         for cf_add_2lib in $cf_add_libs
5150         do
5151                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5152                 then
5153                         cf_add_1lib=
5154                         break
5155                 fi
5156         done
5157         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5158 done
5159 LIBS="$cf_add_libs"
5160
5161 fi
5162
5163         ;;
5164 (hpux10.*)
5165         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5166         # next (1998), and xcurses "newer" (2000).  There is no header file for
5167         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5168         # term.h) for cur_colr
5169         if test "x$cf_cv_screen" = "xcurses_colr"
5170         then
5171                 echo "$as_me:5171: checking for initscr in -lcur_colr" >&5
5172 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5173 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5174   echo $ECHO_N "(cached) $ECHO_C" >&6
5175 else
5176   ac_check_lib_save_LIBS=$LIBS
5177 LIBS="-lcur_colr  $LIBS"
5178 cat >conftest.$ac_ext <<_ACEOF
5179 #line 5179 "configure"
5180 #include "confdefs.h"
5181
5182 /* Override any gcc2 internal prototype to avoid an error.  */
5183 #ifdef __cplusplus
5184 extern "C"
5185 #endif
5186 /* We use char because int might match the return type of a gcc2
5187    builtin and then its argument prototype would still apply.  */
5188 char initscr ();
5189 int
5190 main ()
5191 {
5192 initscr ();
5193   ;
5194   return 0;
5195 }
5196 _ACEOF
5197 rm -f conftest.$ac_objext conftest$ac_exeext
5198 if { (eval echo "$as_me:5198: \"$ac_link\"") >&5
5199   (eval $ac_link) 2>&5
5200   ac_status=$?
5201   echo "$as_me:5201: \$? = $ac_status" >&5
5202   (exit $ac_status); } &&
5203          { ac_try='test -s conftest$ac_exeext'
5204   { (eval echo "$as_me:5204: \"$ac_try\"") >&5
5205   (eval $ac_try) 2>&5
5206   ac_status=$?
5207   echo "$as_me:5207: \$? = $ac_status" >&5
5208   (exit $ac_status); }; }; then
5209   ac_cv_lib_cur_colr_initscr=yes
5210 else
5211   echo "$as_me: failed program was:" >&5
5212 cat conftest.$ac_ext >&5
5213 ac_cv_lib_cur_colr_initscr=no
5214 fi
5215 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5216 LIBS=$ac_check_lib_save_LIBS
5217 fi
5218 echo "$as_me:5218: result: $ac_cv_lib_cur_colr_initscr" >&5
5219 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5220 if test $ac_cv_lib_cur_colr_initscr = yes; then
5221
5222 cf_add_libs="-lcur_colr"
5223 # Filter out duplicates - this happens with badly-designed ".pc" files...
5224 for cf_add_1lib in $LIBS
5225 do
5226         for cf_add_2lib in $cf_add_libs
5227         do
5228                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5229                 then
5230                         cf_add_1lib=
5231                         break
5232                 fi
5233         done
5234         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5235 done
5236 LIBS="$cf_add_libs"
5237
5238                         ac_cv_func_initscr=yes
5239
5240 else
5241
5242                 echo "$as_me:5242: checking for initscr in -lHcurses" >&5
5243 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5244 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5245   echo $ECHO_N "(cached) $ECHO_C" >&6
5246 else
5247   ac_check_lib_save_LIBS=$LIBS
5248 LIBS="-lHcurses  $LIBS"
5249 cat >conftest.$ac_ext <<_ACEOF
5250 #line 5250 "configure"
5251 #include "confdefs.h"
5252
5253 /* Override any gcc2 internal prototype to avoid an error.  */
5254 #ifdef __cplusplus
5255 extern "C"
5256 #endif
5257 /* We use char because int might match the return type of a gcc2
5258    builtin and then its argument prototype would still apply.  */
5259 char initscr ();
5260 int
5261 main ()
5262 {
5263 initscr ();
5264   ;
5265   return 0;
5266 }
5267 _ACEOF
5268 rm -f conftest.$ac_objext conftest$ac_exeext
5269 if { (eval echo "$as_me:5269: \"$ac_link\"") >&5
5270   (eval $ac_link) 2>&5
5271   ac_status=$?
5272   echo "$as_me:5272: \$? = $ac_status" >&5
5273   (exit $ac_status); } &&
5274          { ac_try='test -s conftest$ac_exeext'
5275   { (eval echo "$as_me:5275: \"$ac_try\"") >&5
5276   (eval $ac_try) 2>&5
5277   ac_status=$?
5278   echo "$as_me:5278: \$? = $ac_status" >&5
5279   (exit $ac_status); }; }; then
5280   ac_cv_lib_Hcurses_initscr=yes
5281 else
5282   echo "$as_me: failed program was:" >&5
5283 cat conftest.$ac_ext >&5
5284 ac_cv_lib_Hcurses_initscr=no
5285 fi
5286 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5287 LIBS=$ac_check_lib_save_LIBS
5288 fi
5289 echo "$as_me:5289: result: $ac_cv_lib_Hcurses_initscr" >&5
5290 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5291 if test $ac_cv_lib_Hcurses_initscr = yes; then
5292
5293                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5294
5295 cf_add_libs="-lHcurses"
5296 # Filter out duplicates - this happens with badly-designed ".pc" files...
5297 for cf_add_1lib in $LIBS
5298 do
5299         for cf_add_2lib in $cf_add_libs
5300         do
5301                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5302                 then
5303                         cf_add_1lib=
5304                         break
5305                 fi
5306         done
5307         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5308 done
5309 LIBS="$cf_add_libs"
5310
5311                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5312                         ac_cv_func_initscr=yes
5313
5314 fi
5315
5316 fi
5317
5318         fi
5319         ;;
5320 (linux*)
5321         case `arch 2>/dev/null` in
5322         (x86_64)
5323                 if test -d /lib64
5324                 then
5325
5326 if test -n "/lib64" ; then
5327         for cf_add_libdir in /lib64
5328         do
5329                 if test $cf_add_libdir = /usr/lib ; then
5330                         :
5331                 elif test -d $cf_add_libdir
5332                 then
5333                         cf_have_libdir=no
5334                         if test -n "$LDFLAGS$LIBS" ; then
5335                                 # a loop is needed to ensure we can add subdirs of existing dirs
5336                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5337                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5338                                                 cf_have_libdir=yes; break
5339                                         fi
5340                                 done
5341                         fi
5342                         if test "$cf_have_libdir" = no ; then
5343                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5344
5345 echo "${as_me:-configure}:5345: testing adding $cf_add_libdir to library-path ..." 1>&5
5346
5347                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5348                         fi
5349                 fi
5350         done
5351 fi
5352
5353                 else
5354
5355 if test -n "/lib" ; then
5356         for cf_add_libdir in /lib
5357         do
5358                 if test $cf_add_libdir = /usr/lib ; then
5359                         :
5360                 elif test -d $cf_add_libdir
5361                 then
5362                         cf_have_libdir=no
5363                         if test -n "$LDFLAGS$LIBS" ; then
5364                                 # a loop is needed to ensure we can add subdirs of existing dirs
5365                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5366                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5367                                                 cf_have_libdir=yes; break
5368                                         fi
5369                                 done
5370                         fi
5371                         if test "$cf_have_libdir" = no ; then
5372                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5373
5374 echo "${as_me:-configure}:5374: testing adding $cf_add_libdir to library-path ..." 1>&5
5375
5376                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5377                         fi
5378                 fi
5379         done
5380 fi
5381
5382                 fi
5383                 ;;
5384         (*)
5385
5386 if test -n "/lib" ; then
5387         for cf_add_libdir in /lib
5388         do
5389                 if test $cf_add_libdir = /usr/lib ; then
5390                         :
5391                 elif test -d $cf_add_libdir
5392                 then
5393                         cf_have_libdir=no
5394                         if test -n "$LDFLAGS$LIBS" ; then
5395                                 # a loop is needed to ensure we can add subdirs of existing dirs
5396                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5397                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5398                                                 cf_have_libdir=yes; break
5399                                         fi
5400                                 done
5401                         fi
5402                         if test "$cf_have_libdir" = no ; then
5403                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5404
5405 echo "${as_me:-configure}:5405: testing adding $cf_add_libdir to library-path ..." 1>&5
5406
5407                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5408                         fi
5409                 fi
5410         done
5411 fi
5412
5413                 ;;
5414         esac
5415         ;;
5416 (sunos3*|sunos4*)
5417         if test "x$cf_cv_screen" = "xcurses_5lib"
5418         then
5419                 if test -d /usr/5lib ; then
5420
5421 if test -n "/usr/5lib" ; then
5422         for cf_add_libdir in /usr/5lib
5423         do
5424                 if test $cf_add_libdir = /usr/lib ; then
5425                         :
5426                 elif test -d $cf_add_libdir
5427                 then
5428                         cf_have_libdir=no
5429                         if test -n "$LDFLAGS$LIBS" ; then
5430                                 # a loop is needed to ensure we can add subdirs of existing dirs
5431                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5432                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5433                                                 cf_have_libdir=yes; break
5434                                         fi
5435                                 done
5436                         fi
5437                         if test "$cf_have_libdir" = no ; then
5438                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5439
5440 echo "${as_me:-configure}:5440: testing adding $cf_add_libdir to library-path ..." 1>&5
5441
5442                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5443                         fi
5444                 fi
5445         done
5446 fi
5447
5448 cf_add_libs="-lcurses -ltermcap"
5449 # Filter out duplicates - this happens with badly-designed ".pc" files...
5450 for cf_add_1lib in $LIBS
5451 do
5452         for cf_add_2lib in $cf_add_libs
5453         do
5454                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5455                 then
5456                         cf_add_1lib=
5457                         break
5458                 fi
5459         done
5460         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5461 done
5462 LIBS="$cf_add_libs"
5463
5464                 fi
5465         fi
5466         ac_cv_func_initscr=yes
5467         ;;
5468 esac
5469
5470 if test ".$ac_cv_func_initscr" != .yes ; then
5471         cf_save_LIBS="$LIBS"
5472
5473         if test ".${cf_cv_ncurses_version:-no}" != .no
5474         then
5475                 cf_check_list="ncurses curses cursesX"
5476         else
5477                 cf_check_list="cursesX curses ncurses"
5478         fi
5479
5480         # Check for library containing tgoto.  Do this before curses library
5481         # because it may be needed to link the test-case for initscr.
5482         if test "x$cf_term_lib" = x
5483         then
5484                 echo "$as_me:5484: checking for tgoto" >&5
5485 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5486 if test "${ac_cv_func_tgoto+set}" = set; then
5487   echo $ECHO_N "(cached) $ECHO_C" >&6
5488 else
5489   cat >conftest.$ac_ext <<_ACEOF
5490 #line 5490 "configure"
5491 #include "confdefs.h"
5492 /* System header to define __stub macros and hopefully few prototypes,
5493     which can conflict with char tgoto (); below.  */
5494 #include <assert.h>
5495 /* Override any gcc2 internal prototype to avoid an error.  */
5496 #ifdef __cplusplus
5497 extern "C"
5498 #endif
5499 /* We use char because int might match the return type of a gcc2
5500    builtin and then its argument prototype would still apply.  */
5501 char tgoto ();
5502 char (*f) ();
5503
5504 int
5505 main ()
5506 {
5507 /* The GNU C library defines this for functions which it implements
5508     to always fail with ENOSYS.  Some functions are actually named
5509     something starting with __ and the normal name is an alias.  */
5510 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5511 choke me
5512 #else
5513 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5514 #endif
5515
5516   ;
5517   return 0;
5518 }
5519 _ACEOF
5520 rm -f conftest.$ac_objext conftest$ac_exeext
5521 if { (eval echo "$as_me:5521: \"$ac_link\"") >&5
5522   (eval $ac_link) 2>&5
5523   ac_status=$?
5524   echo "$as_me:5524: \$? = $ac_status" >&5
5525   (exit $ac_status); } &&
5526          { ac_try='test -s conftest$ac_exeext'
5527   { (eval echo "$as_me:5527: \"$ac_try\"") >&5
5528   (eval $ac_try) 2>&5
5529   ac_status=$?
5530   echo "$as_me:5530: \$? = $ac_status" >&5
5531   (exit $ac_status); }; }; then
5532   ac_cv_func_tgoto=yes
5533 else
5534   echo "$as_me: failed program was:" >&5
5535 cat conftest.$ac_ext >&5
5536 ac_cv_func_tgoto=no
5537 fi
5538 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5539 fi
5540 echo "$as_me:5540: result: $ac_cv_func_tgoto" >&5
5541 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5542 if test $ac_cv_func_tgoto = yes; then
5543   cf_term_lib=predefined
5544 else
5545
5546                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5547                         do
5548                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5549 echo "$as_me:5549: checking for tgoto in -l$cf_term_lib" >&5
5550 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5551 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5552   echo $ECHO_N "(cached) $ECHO_C" >&6
5553 else
5554   ac_check_lib_save_LIBS=$LIBS
5555 LIBS="-l$cf_term_lib  $LIBS"
5556 cat >conftest.$ac_ext <<_ACEOF
5557 #line 5557 "configure"
5558 #include "confdefs.h"
5559
5560 /* Override any gcc2 internal prototype to avoid an error.  */
5561 #ifdef __cplusplus
5562 extern "C"
5563 #endif
5564 /* We use char because int might match the return type of a gcc2
5565    builtin and then its argument prototype would still apply.  */
5566 char tgoto ();
5567 int
5568 main ()
5569 {
5570 tgoto ();
5571   ;
5572   return 0;
5573 }
5574 _ACEOF
5575 rm -f conftest.$ac_objext conftest$ac_exeext
5576 if { (eval echo "$as_me:5576: \"$ac_link\"") >&5
5577   (eval $ac_link) 2>&5
5578   ac_status=$?
5579   echo "$as_me:5579: \$? = $ac_status" >&5
5580   (exit $ac_status); } &&
5581          { ac_try='test -s conftest$ac_exeext'
5582   { (eval echo "$as_me:5582: \"$ac_try\"") >&5
5583   (eval $ac_try) 2>&5
5584   ac_status=$?
5585   echo "$as_me:5585: \$? = $ac_status" >&5
5586   (exit $ac_status); }; }; then
5587   eval "$as_ac_Lib=yes"
5588 else
5589   echo "$as_me: failed program was:" >&5
5590 cat conftest.$ac_ext >&5
5591 eval "$as_ac_Lib=no"
5592 fi
5593 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5594 LIBS=$ac_check_lib_save_LIBS
5595 fi
5596 echo "$as_me:5596: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5597 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5598 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5599   break
5600 fi
5601
5602                         done
5603
5604 fi
5605
5606         fi
5607
5608         # Check for library containing initscr
5609         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5610         if test "x$cf_curs_lib" = x
5611         then
5612                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5613                 do
5614                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5615 echo "$as_me:5615: checking for initscr in -l$cf_curs_lib" >&5
5616 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5617 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5618   echo $ECHO_N "(cached) $ECHO_C" >&6
5619 else
5620   ac_check_lib_save_LIBS=$LIBS
5621 LIBS="-l$cf_curs_lib  $LIBS"
5622 cat >conftest.$ac_ext <<_ACEOF
5623 #line 5623 "configure"
5624 #include "confdefs.h"
5625
5626 /* Override any gcc2 internal prototype to avoid an error.  */
5627 #ifdef __cplusplus
5628 extern "C"
5629 #endif
5630 /* We use char because int might match the return type of a gcc2
5631    builtin and then its argument prototype would still apply.  */
5632 char initscr ();
5633 int
5634 main ()
5635 {
5636 initscr ();
5637   ;
5638   return 0;
5639 }
5640 _ACEOF
5641 rm -f conftest.$ac_objext conftest$ac_exeext
5642 if { (eval echo "$as_me:5642: \"$ac_link\"") >&5
5643   (eval $ac_link) 2>&5
5644   ac_status=$?
5645   echo "$as_me:5645: \$? = $ac_status" >&5
5646   (exit $ac_status); } &&
5647          { ac_try='test -s conftest$ac_exeext'
5648   { (eval echo "$as_me:5648: \"$ac_try\"") >&5
5649   (eval $ac_try) 2>&5
5650   ac_status=$?
5651   echo "$as_me:5651: \$? = $ac_status" >&5
5652   (exit $ac_status); }; }; then
5653   eval "$as_ac_Lib=yes"
5654 else
5655   echo "$as_me: failed program was:" >&5
5656 cat conftest.$ac_ext >&5
5657 eval "$as_ac_Lib=no"
5658 fi
5659 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5660 LIBS=$ac_check_lib_save_LIBS
5661 fi
5662 echo "$as_me:5662: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5663 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5664 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5665   break
5666 fi
5667
5668                 done
5669         fi
5670         test $cf_curs_lib = unknown && { { echo "$as_me:5670: error: no curses library found" >&5
5671 echo "$as_me: error: no curses library found" >&2;}
5672    { (exit 1); exit 1; }; }
5673
5674         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5675         if test "$cf_term_lib" = unknown ; then
5676                 echo "$as_me:5676: checking if we can link with $cf_curs_lib library" >&5
5677 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5678                 cat >conftest.$ac_ext <<_ACEOF
5679 #line 5679 "configure"
5680 #include "confdefs.h"
5681 #include <${cf_cv_ncurses_header:-curses.h}>
5682 int
5683 main ()
5684 {
5685 initscr()
5686   ;
5687   return 0;
5688 }
5689 _ACEOF
5690 rm -f conftest.$ac_objext conftest$ac_exeext
5691 if { (eval echo "$as_me:5691: \"$ac_link\"") >&5
5692   (eval $ac_link) 2>&5
5693   ac_status=$?
5694   echo "$as_me:5694: \$? = $ac_status" >&5
5695   (exit $ac_status); } &&
5696          { ac_try='test -s conftest$ac_exeext'
5697   { (eval echo "$as_me:5697: \"$ac_try\"") >&5
5698   (eval $ac_try) 2>&5
5699   ac_status=$?
5700   echo "$as_me:5700: \$? = $ac_status" >&5
5701   (exit $ac_status); }; }; then
5702   cf_result=yes
5703 else
5704   echo "$as_me: failed program was:" >&5
5705 cat conftest.$ac_ext >&5
5706 cf_result=no
5707 fi
5708 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5709                 echo "$as_me:5709: result: $cf_result" >&5
5710 echo "${ECHO_T}$cf_result" >&6
5711                 test $cf_result = no && { { echo "$as_me:5711: error: Cannot link curses library" >&5
5712 echo "$as_me: error: Cannot link curses library" >&2;}
5713    { (exit 1); exit 1; }; }
5714         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5715                 :
5716         elif test "$cf_term_lib" != predefined ; then
5717                 echo "$as_me:5717: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5718 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5719                 cat >conftest.$ac_ext <<_ACEOF
5720 #line 5720 "configure"
5721 #include "confdefs.h"
5722 #include <${cf_cv_ncurses_header:-curses.h}>
5723 int
5724 main ()
5725 {
5726 initscr(); tgoto((char *)0, 0, 0);
5727   ;
5728   return 0;
5729 }
5730 _ACEOF
5731 rm -f conftest.$ac_objext conftest$ac_exeext
5732 if { (eval echo "$as_me:5732: \"$ac_link\"") >&5
5733   (eval $ac_link) 2>&5
5734   ac_status=$?
5735   echo "$as_me:5735: \$? = $ac_status" >&5
5736   (exit $ac_status); } &&
5737          { ac_try='test -s conftest$ac_exeext'
5738   { (eval echo "$as_me:5738: \"$ac_try\"") >&5
5739   (eval $ac_try) 2>&5
5740   ac_status=$?
5741   echo "$as_me:5741: \$? = $ac_status" >&5
5742   (exit $ac_status); }; }; then
5743   cf_result=no
5744 else
5745   echo "$as_me: failed program was:" >&5
5746 cat conftest.$ac_ext >&5
5747
5748                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5749                         cat >conftest.$ac_ext <<_ACEOF
5750 #line 5750 "configure"
5751 #include "confdefs.h"
5752 #include <${cf_cv_ncurses_header:-curses.h}>
5753 int
5754 main ()
5755 {
5756 initscr()
5757   ;
5758   return 0;
5759 }
5760 _ACEOF
5761 rm -f conftest.$ac_objext conftest$ac_exeext
5762 if { (eval echo "$as_me:5762: \"$ac_link\"") >&5
5763   (eval $ac_link) 2>&5
5764   ac_status=$?
5765   echo "$as_me:5765: \$? = $ac_status" >&5
5766   (exit $ac_status); } &&
5767          { ac_try='test -s conftest$ac_exeext'
5768   { (eval echo "$as_me:5768: \"$ac_try\"") >&5
5769   (eval $ac_try) 2>&5
5770   ac_status=$?
5771   echo "$as_me:5771: \$? = $ac_status" >&5
5772   (exit $ac_status); }; }; then
5773   cf_result=yes
5774 else
5775   echo "$as_me: failed program was:" >&5
5776 cat conftest.$ac_ext >&5
5777 cf_result=error
5778 fi
5779 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5780
5781 fi
5782 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5783                 echo "$as_me:5783: result: $cf_result" >&5
5784 echo "${ECHO_T}$cf_result" >&6
5785         fi
5786 fi
5787 fi
5788
5789         ;;
5790 (ncursesw*)
5791
5792 echo "$as_me:5792: checking for multibyte character support" >&5
5793 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5794 if test "${cf_cv_utf8_lib+set}" = set; then
5795   echo $ECHO_N "(cached) $ECHO_C" >&6
5796 else
5797
5798         cf_save_LIBS="$LIBS"
5799         cat >conftest.$ac_ext <<_ACEOF
5800 #line 5800 "configure"
5801 #include "confdefs.h"
5802
5803 #include <stdlib.h>
5804 int
5805 main ()
5806 {
5807 putwc(0,0);
5808   ;
5809   return 0;
5810 }
5811 _ACEOF
5812 rm -f conftest.$ac_objext conftest$ac_exeext
5813 if { (eval echo "$as_me:5813: \"$ac_link\"") >&5
5814   (eval $ac_link) 2>&5
5815   ac_status=$?
5816   echo "$as_me:5816: \$? = $ac_status" >&5
5817   (exit $ac_status); } &&
5818          { ac_try='test -s conftest$ac_exeext'
5819   { (eval echo "$as_me:5819: \"$ac_try\"") >&5
5820   (eval $ac_try) 2>&5
5821   ac_status=$?
5822   echo "$as_me:5822: \$? = $ac_status" >&5
5823   (exit $ac_status); }; }; then
5824   cf_cv_utf8_lib=yes
5825 else
5826   echo "$as_me: failed program was:" >&5
5827 cat conftest.$ac_ext >&5
5828
5829 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5830 # will be set on completion of the AC_TRY_LINK below.
5831 cf_cv_header_path_utf8=
5832 cf_cv_library_path_utf8=
5833
5834 echo "${as_me:-configure}:5834: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5835
5836 cf_save_LIBS="$LIBS"
5837
5838 cat >conftest.$ac_ext <<_ACEOF
5839 #line 5839 "configure"
5840 #include "confdefs.h"
5841
5842 #include <libutf8.h>
5843 int
5844 main ()
5845 {
5846 putwc(0,0);
5847   ;
5848   return 0;
5849 }
5850 _ACEOF
5851 rm -f conftest.$ac_objext conftest$ac_exeext
5852 if { (eval echo "$as_me:5852: \"$ac_link\"") >&5
5853   (eval $ac_link) 2>&5
5854   ac_status=$?
5855   echo "$as_me:5855: \$? = $ac_status" >&5
5856   (exit $ac_status); } &&
5857          { ac_try='test -s conftest$ac_exeext'
5858   { (eval echo "$as_me:5858: \"$ac_try\"") >&5
5859   (eval $ac_try) 2>&5
5860   ac_status=$?
5861   echo "$as_me:5861: \$? = $ac_status" >&5
5862   (exit $ac_status); }; }; then
5863
5864         cf_cv_find_linkage_utf8=yes
5865         cf_cv_header_path_utf8=/usr/include
5866         cf_cv_library_path_utf8=/usr/lib
5867
5868 else
5869   echo "$as_me: failed program was:" >&5
5870 cat conftest.$ac_ext >&5
5871
5872 LIBS="-lutf8  $cf_save_LIBS"
5873
5874 cat >conftest.$ac_ext <<_ACEOF
5875 #line 5875 "configure"
5876 #include "confdefs.h"
5877
5878 #include <libutf8.h>
5879 int
5880 main ()
5881 {
5882 putwc(0,0);
5883   ;
5884   return 0;
5885 }
5886 _ACEOF
5887 rm -f conftest.$ac_objext conftest$ac_exeext
5888 if { (eval echo "$as_me:5888: \"$ac_link\"") >&5
5889   (eval $ac_link) 2>&5
5890   ac_status=$?
5891   echo "$as_me:5891: \$? = $ac_status" >&5
5892   (exit $ac_status); } &&
5893          { ac_try='test -s conftest$ac_exeext'
5894   { (eval echo "$as_me:5894: \"$ac_try\"") >&5
5895   (eval $ac_try) 2>&5
5896   ac_status=$?
5897   echo "$as_me:5897: \$? = $ac_status" >&5
5898   (exit $ac_status); }; }; then
5899
5900         cf_cv_find_linkage_utf8=yes
5901         cf_cv_header_path_utf8=/usr/include
5902         cf_cv_library_path_utf8=/usr/lib
5903         cf_cv_library_file_utf8="-lutf8"
5904
5905 else
5906   echo "$as_me: failed program was:" >&5
5907 cat conftest.$ac_ext >&5
5908
5909         cf_cv_find_linkage_utf8=no
5910         LIBS="$cf_save_LIBS"
5911
5912         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5913
5914 echo "${as_me:-configure}:5914: testing find linkage for utf8 library ..." 1>&5
5915
5916 echo "${as_me:-configure}:5916: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5917
5918         cf_save_CPPFLAGS="$CPPFLAGS"
5919         cf_test_CPPFLAGS="$CPPFLAGS"
5920
5921 cf_search=
5922
5923 # collect the current set of include-directories from compiler flags
5924 cf_header_path_list=""
5925 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5926         for cf_header_path in $CPPFLAGS $CFLAGS
5927         do
5928                 case $cf_header_path in
5929                 (-I*)
5930                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5931
5932 test "x$cf_header_path" != "xNONE" && \
5933 test -d "$cf_header_path" && \
5934  {
5935         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5936         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5937         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5938         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5939         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5940         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5941 }
5942
5943                         cf_header_path_list="$cf_header_path_list $cf_search"
5944                         ;;
5945                 esac
5946         done
5947 fi
5948
5949 # add the variations for the package we are looking for
5950
5951 cf_search=
5952
5953 test "x$prefix" != "xNONE" && \
5954 test -d "$prefix" && \
5955  {
5956         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5957         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5958         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5959         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5960         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5961         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5962 }
5963
5964 for cf_subdir_prefix in \
5965         /usr \
5966         /usr/local \
5967         /usr/pkg \
5968         /opt \
5969         /opt/local \
5970         $HOME
5971 do
5972
5973 test "x$cf_subdir_prefix" != "x$prefix" && \
5974 test -d "$cf_subdir_prefix" && \
5975 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5976         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5977         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5978         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5979         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5980         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5981         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5982 }
5983
5984 done
5985
5986 test "$includedir" != NONE && \
5987 test "$includedir" != "/usr/include" && \
5988 test -d "$includedir" && {
5989         test -d $includedir &&    cf_search="$cf_search $includedir"
5990         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5991 }
5992
5993 test "$oldincludedir" != NONE && \
5994 test "$oldincludedir" != "/usr/include" && \
5995 test -d "$oldincludedir" && {
5996         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5997         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5998 }
5999
6000 cf_search="$cf_search $cf_header_path_list"
6001
6002         for cf_cv_header_path_utf8 in $cf_search
6003         do
6004                 if test -d $cf_cv_header_path_utf8 ; then
6005                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6006
6007 echo "${as_me:-configure}:6007: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6008
6009                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
6010                         cat >conftest.$ac_ext <<_ACEOF
6011 #line 6011 "configure"
6012 #include "confdefs.h"
6013
6014 #include <libutf8.h>
6015 int
6016 main ()
6017 {
6018 putwc(0,0);
6019   ;
6020   return 0;
6021 }
6022 _ACEOF
6023 rm -f conftest.$ac_objext
6024 if { (eval echo "$as_me:6024: \"$ac_compile\"") >&5
6025   (eval $ac_compile) 2>&5
6026   ac_status=$?
6027   echo "$as_me:6027: \$? = $ac_status" >&5
6028   (exit $ac_status); } &&
6029          { ac_try='test -s conftest.$ac_objext'
6030   { (eval echo "$as_me:6030: \"$ac_try\"") >&5
6031   (eval $ac_try) 2>&5
6032   ac_status=$?
6033   echo "$as_me:6033: \$? = $ac_status" >&5
6034   (exit $ac_status); }; }; then
6035
6036                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6037
6038 echo "${as_me:-configure}:6038: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6039
6040                                 cf_cv_find_linkage_utf8=maybe
6041                                 cf_test_CPPFLAGS="$CPPFLAGS"
6042                                 break
6043 else
6044   echo "$as_me: failed program was:" >&5
6045 cat conftest.$ac_ext >&5
6046
6047                                 CPPFLAGS="$cf_save_CPPFLAGS"
6048
6049 fi
6050 rm -f conftest.$ac_objext conftest.$ac_ext
6051                 fi
6052         done
6053
6054         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6055
6056 echo "${as_me:-configure}:6056: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6057
6058                 cf_save_LIBS="$LIBS"
6059                 cf_save_LDFLAGS="$LDFLAGS"
6060
6061                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6062
6063 cf_search=
6064 cf_library_path_list=""
6065 if test -n "${LDFLAGS}${LIBS}" ; then
6066         for cf_library_path in $LDFLAGS $LIBS
6067         do
6068                 case $cf_library_path in
6069                 (-L*)
6070                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6071
6072 test "x$cf_library_path" != "xNONE" && \
6073 test -d "$cf_library_path" && \
6074  {
6075         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6076         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6077         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6078         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6079         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6080         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6081 }
6082
6083                         cf_library_path_list="$cf_library_path_list $cf_search"
6084                         ;;
6085                 esac
6086         done
6087 fi
6088
6089 cf_search=
6090
6091 test "x$prefix" != "xNONE" && \
6092 test -d "$prefix" && \
6093  {
6094         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6095         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6096         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6097         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6098         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6099         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6100 }
6101
6102 for cf_subdir_prefix in \
6103         /usr \
6104         /usr/local \
6105         /usr/pkg \
6106         /opt \
6107         /opt/local \
6108         $HOME
6109 do
6110
6111 test "x$cf_subdir_prefix" != "x$prefix" && \
6112 test -d "$cf_subdir_prefix" && \
6113 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6114         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6115         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6116         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6117         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6118         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6119         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6120 }
6121
6122 done
6123
6124 cf_search="$cf_library_path_list $cf_search"
6125
6126                         for cf_cv_library_path_utf8 in $cf_search
6127                         do
6128                                 if test -d $cf_cv_library_path_utf8 ; then
6129                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6130
6131 echo "${as_me:-configure}:6131: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6132
6133                                         CPPFLAGS="$cf_test_CPPFLAGS"
6134                                         LIBS="-lutf8  $cf_save_LIBS"
6135                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6136                                         cat >conftest.$ac_ext <<_ACEOF
6137 #line 6137 "configure"
6138 #include "confdefs.h"
6139
6140 #include <libutf8.h>
6141 int
6142 main ()
6143 {
6144 putwc(0,0);
6145   ;
6146   return 0;
6147 }
6148 _ACEOF
6149 rm -f conftest.$ac_objext conftest$ac_exeext
6150 if { (eval echo "$as_me:6150: \"$ac_link\"") >&5
6151   (eval $ac_link) 2>&5
6152   ac_status=$?
6153   echo "$as_me:6153: \$? = $ac_status" >&5
6154   (exit $ac_status); } &&
6155          { ac_try='test -s conftest$ac_exeext'
6156   { (eval echo "$as_me:6156: \"$ac_try\"") >&5
6157   (eval $ac_try) 2>&5
6158   ac_status=$?
6159   echo "$as_me:6159: \$? = $ac_status" >&5
6160   (exit $ac_status); }; }; then
6161
6162                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6163
6164 echo "${as_me:-configure}:6164: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6165
6166                                         cf_cv_find_linkage_utf8=yes
6167                                         cf_cv_library_file_utf8="-lutf8"
6168                                         break
6169 else
6170   echo "$as_me: failed program was:" >&5
6171 cat conftest.$ac_ext >&5
6172
6173                                         CPPFLAGS="$cf_save_CPPFLAGS"
6174                                         LIBS="$cf_save_LIBS"
6175                                         LDFLAGS="$cf_save_LDFLAGS"
6176
6177 fi
6178 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6179                                 fi
6180                         done
6181                         CPPFLAGS="$cf_save_CPPFLAGS"
6182                         LDFLAGS="$cf_save_LDFLAGS"
6183                 fi
6184
6185         else
6186                 cf_cv_find_linkage_utf8=no
6187         fi
6188
6189 fi
6190 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6191
6192 fi
6193 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6194
6195 LIBS="$cf_save_LIBS"
6196
6197 if test "$cf_cv_find_linkage_utf8" = yes ; then
6198 cf_cv_utf8_lib=add-on
6199 else
6200 cf_cv_utf8_lib=no
6201 fi
6202
6203 fi
6204 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6205 fi
6206 echo "$as_me:6206: result: $cf_cv_utf8_lib" >&5
6207 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6208
6209 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6210 # ncurses/ncursesw:
6211 if test "$cf_cv_utf8_lib" = "add-on" ; then
6212
6213 cat >>confdefs.h <<\EOF
6214 #define HAVE_LIBUTF8_H 1
6215 EOF
6216
6217 if test -n "$cf_cv_header_path_utf8" ; then
6218   for cf_add_incdir in $cf_cv_header_path_utf8
6219   do
6220         while test $cf_add_incdir != /usr/include
6221         do
6222           if test -d $cf_add_incdir
6223           then
6224                 cf_have_incdir=no
6225                 if test -n "$CFLAGS$CPPFLAGS" ; then
6226                   # a loop is needed to ensure we can add subdirs of existing dirs
6227                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6228                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6229                           cf_have_incdir=yes; break
6230                         fi
6231                   done
6232                 fi
6233
6234                 if test "$cf_have_incdir" = no ; then
6235                   if test "$cf_add_incdir" = /usr/local/include ; then
6236                         if test "$GCC" = yes
6237                         then
6238                           cf_save_CPPFLAGS=$CPPFLAGS
6239                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6240                           cat >conftest.$ac_ext <<_ACEOF
6241 #line 6241 "configure"
6242 #include "confdefs.h"
6243 #include <stdio.h>
6244 int
6245 main ()
6246 {
6247 printf("Hello")
6248   ;
6249   return 0;
6250 }
6251 _ACEOF
6252 rm -f conftest.$ac_objext
6253 if { (eval echo "$as_me:6253: \"$ac_compile\"") >&5
6254   (eval $ac_compile) 2>&5
6255   ac_status=$?
6256   echo "$as_me:6256: \$? = $ac_status" >&5
6257   (exit $ac_status); } &&
6258          { ac_try='test -s conftest.$ac_objext'
6259   { (eval echo "$as_me:6259: \"$ac_try\"") >&5
6260   (eval $ac_try) 2>&5
6261   ac_status=$?
6262   echo "$as_me:6262: \$? = $ac_status" >&5
6263   (exit $ac_status); }; }; then
6264   :
6265 else
6266   echo "$as_me: failed program was:" >&5
6267 cat conftest.$ac_ext >&5
6268 cf_have_incdir=yes
6269 fi
6270 rm -f conftest.$ac_objext conftest.$ac_ext
6271                           CPPFLAGS=$cf_save_CPPFLAGS
6272                         fi
6273                   fi
6274                 fi
6275
6276                 if test "$cf_have_incdir" = no ; then
6277                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6278
6279 echo "${as_me:-configure}:6279: testing adding $cf_add_incdir to include-path ..." 1>&5
6280
6281                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6282
6283                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6284                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6285                   cf_add_incdir="$cf_top_incdir"
6286                 else
6287                   break
6288                 fi
6289           else
6290                 break
6291           fi
6292         done
6293   done
6294 fi
6295
6296 if test -n "$cf_cv_library_path_utf8" ; then
6297         for cf_add_libdir in $cf_cv_library_path_utf8
6298         do
6299                 if test $cf_add_libdir = /usr/lib ; then
6300                         :
6301                 elif test -d $cf_add_libdir
6302                 then
6303                         cf_have_libdir=no
6304                         if test -n "$LDFLAGS$LIBS" ; then
6305                                 # a loop is needed to ensure we can add subdirs of existing dirs
6306                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6307                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6308                                                 cf_have_libdir=yes; break
6309                                         fi
6310                                 done
6311                         fi
6312                         if test "$cf_have_libdir" = no ; then
6313                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6314
6315 echo "${as_me:-configure}:6315: testing adding $cf_add_libdir to library-path ..." 1>&5
6316
6317                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6318                         fi
6319                 fi
6320         done
6321 fi
6322
6323 cf_add_libs="$cf_cv_library_file_utf8"
6324 # Filter out duplicates - this happens with badly-designed ".pc" files...
6325 for cf_add_1lib in $LIBS
6326 do
6327         for cf_add_2lib in $cf_add_libs
6328         do
6329                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6330                 then
6331                         cf_add_1lib=
6332                         break
6333                 fi
6334         done
6335         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6336 done
6337 LIBS="$cf_add_libs"
6338
6339 fi
6340
6341 cf_ncuconfig_root=$cf_cv_screen
6342 cf_have_ncuconfig=no
6343
6344 if test "x${PKG_CONFIG:=none}" != xnone; then
6345         echo "$as_me:6345: checking pkg-config for $cf_ncuconfig_root" >&5
6346 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6347         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6348                 echo "$as_me:6348: result: yes" >&5
6349 echo "${ECHO_T}yes" >&6
6350
6351                 echo "$as_me:6351: checking if the $cf_ncuconfig_root package files work" >&5
6352 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6353                 cf_have_ncuconfig=unknown
6354
6355                 cf_save_CPPFLAGS="$CPPFLAGS"
6356                 cf_save_LIBS="$LIBS"
6357
6358                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6359
6360 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6361 # Filter out duplicates - this happens with badly-designed ".pc" files...
6362 for cf_add_1lib in $LIBS
6363 do
6364         for cf_add_2lib in $cf_add_libs
6365         do
6366                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6367                 then
6368                         cf_add_1lib=
6369                         break
6370                 fi
6371         done
6372         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6373 done
6374 LIBS="$cf_add_libs"
6375
6376                 cat >conftest.$ac_ext <<_ACEOF
6377 #line 6377 "configure"
6378 #include "confdefs.h"
6379 #include <${cf_cv_ncurses_header:-curses.h}>
6380 int
6381 main ()
6382 {
6383 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6384   ;
6385   return 0;
6386 }
6387 _ACEOF
6388 rm -f conftest.$ac_objext conftest$ac_exeext
6389 if { (eval echo "$as_me:6389: \"$ac_link\"") >&5
6390   (eval $ac_link) 2>&5
6391   ac_status=$?
6392   echo "$as_me:6392: \$? = $ac_status" >&5
6393   (exit $ac_status); } &&
6394          { ac_try='test -s conftest$ac_exeext'
6395   { (eval echo "$as_me:6395: \"$ac_try\"") >&5
6396   (eval $ac_try) 2>&5
6397   ac_status=$?
6398   echo "$as_me:6398: \$? = $ac_status" >&5
6399   (exit $ac_status); }; }; then
6400   if test "$cross_compiling" = yes; then
6401   cf_have_ncuconfig=maybe
6402 else
6403   cat >conftest.$ac_ext <<_ACEOF
6404 #line 6404 "configure"
6405 #include "confdefs.h"
6406 #include <${cf_cv_ncurses_header:-curses.h}>
6407                                 int main(void)
6408                                 { char *xx = curses_version(); return (xx == 0); }
6409 _ACEOF
6410 rm -f conftest$ac_exeext
6411 if { (eval echo "$as_me:6411: \"$ac_link\"") >&5
6412   (eval $ac_link) 2>&5
6413   ac_status=$?
6414   echo "$as_me:6414: \$? = $ac_status" >&5
6415   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6416   { (eval echo "$as_me:6416: \"$ac_try\"") >&5
6417   (eval $ac_try) 2>&5
6418   ac_status=$?
6419   echo "$as_me:6419: \$? = $ac_status" >&5
6420   (exit $ac_status); }; }; then
6421   cf_have_ncuconfig=yes
6422 else
6423   echo "$as_me: program exited with status $ac_status" >&5
6424 echo "$as_me: failed program was:" >&5
6425 cat conftest.$ac_ext >&5
6426 cf_have_ncuconfig=no
6427 fi
6428 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6429 fi
6430 else
6431   echo "$as_me: failed program was:" >&5
6432 cat conftest.$ac_ext >&5
6433 cf_have_ncuconfig=no
6434 fi
6435 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6436                 echo "$as_me:6436: result: $cf_have_ncuconfig" >&5
6437 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6438                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6439                 if test "$cf_have_ncuconfig" != "yes"
6440                 then
6441                         CPPFLAGS="$cf_save_CPPFLAGS"
6442                         LIBS="$cf_save_LIBS"
6443                         NCURSES_CONFIG_PKG=none
6444                 else
6445
6446 cat >>confdefs.h <<\EOF
6447 #define NCURSES 1
6448 EOF
6449
6450                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6451                 fi
6452
6453         else
6454                 echo "$as_me:6454: result: no" >&5
6455 echo "${ECHO_T}no" >&6
6456                 NCURSES_CONFIG_PKG=none
6457         fi
6458 else
6459         NCURSES_CONFIG_PKG=none
6460 fi
6461
6462 if test "x$cf_have_ncuconfig" = "xno"; then
6463         echo "Looking for ${cf_ncuconfig_root}-config"
6464
6465 if test -n "$ac_tool_prefix"; then
6466   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6467   do
6468     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6469 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6470 echo "$as_me:6470: checking for $ac_word" >&5
6471 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6472 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6473   echo $ECHO_N "(cached) $ECHO_C" >&6
6474 else
6475   if test -n "$NCURSES_CONFIG"; then
6476   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6477 else
6478   ac_save_IFS=$IFS; IFS=$ac_path_separator
6479 ac_dummy="$PATH"
6480 for ac_dir in $ac_dummy; do
6481   IFS=$ac_save_IFS
6482   test -z "$ac_dir" && ac_dir=.
6483   $as_executable_p "$ac_dir/$ac_word" || continue
6484 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6485 echo "$as_me:6485: found $ac_dir/$ac_word" >&5
6486 break
6487 done
6488
6489 fi
6490 fi
6491 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6492 if test -n "$NCURSES_CONFIG"; then
6493   echo "$as_me:6493: result: $NCURSES_CONFIG" >&5
6494 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6495 else
6496   echo "$as_me:6496: result: no" >&5
6497 echo "${ECHO_T}no" >&6
6498 fi
6499
6500     test -n "$NCURSES_CONFIG" && break
6501   done
6502 fi
6503 if test -z "$NCURSES_CONFIG"; then
6504   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6505   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6506 do
6507   # Extract the first word of "$ac_prog", so it can be a program name with args.
6508 set dummy $ac_prog; ac_word=$2
6509 echo "$as_me:6509: checking for $ac_word" >&5
6510 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6511 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6512   echo $ECHO_N "(cached) $ECHO_C" >&6
6513 else
6514   if test -n "$ac_ct_NCURSES_CONFIG"; then
6515   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6516 else
6517   ac_save_IFS=$IFS; IFS=$ac_path_separator
6518 ac_dummy="$PATH"
6519 for ac_dir in $ac_dummy; do
6520   IFS=$ac_save_IFS
6521   test -z "$ac_dir" && ac_dir=.
6522   $as_executable_p "$ac_dir/$ac_word" || continue
6523 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6524 echo "$as_me:6524: found $ac_dir/$ac_word" >&5
6525 break
6526 done
6527
6528 fi
6529 fi
6530 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6531 if test -n "$ac_ct_NCURSES_CONFIG"; then
6532   echo "$as_me:6532: result: $ac_ct_NCURSES_CONFIG" >&5
6533 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6534 else
6535   echo "$as_me:6535: result: no" >&5
6536 echo "${ECHO_T}no" >&6
6537 fi
6538
6539   test -n "$ac_ct_NCURSES_CONFIG" && break
6540 done
6541 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6542
6543   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6544 fi
6545
6546         if test "$NCURSES_CONFIG" != none ; then
6547
6548                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6549
6550 cf_add_libs="`$NCURSES_CONFIG --libs`"
6551 # Filter out duplicates - this happens with badly-designed ".pc" files...
6552 for cf_add_1lib in $LIBS
6553 do
6554         for cf_add_2lib in $cf_add_libs
6555         do
6556                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6557                 then
6558                         cf_add_1lib=
6559                         break
6560                 fi
6561         done
6562         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6563 done
6564 LIBS="$cf_add_libs"
6565
6566                 # even with config script, some packages use no-override for curses.h
6567
6568 echo "$as_me:6568: checking if we have identified curses headers" >&5
6569 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6570 if test "${cf_cv_ncurses_header+set}" = set; then
6571   echo $ECHO_N "(cached) $ECHO_C" >&6
6572 else
6573
6574 cf_cv_ncurses_header=none
6575 for cf_header in \
6576         ncurses.h $cf_cv_screen/ncurses.h \
6577         curses.h $cf_cv_screen/curses.h
6578 do
6579 cat >conftest.$ac_ext <<_ACEOF
6580 #line 6580 "configure"
6581 #include "confdefs.h"
6582 #include <${cf_header}>
6583 int
6584 main ()
6585 {
6586 initscr(); tgoto("?", 0,0)
6587   ;
6588   return 0;
6589 }
6590 _ACEOF
6591 rm -f conftest.$ac_objext
6592 if { (eval echo "$as_me:6592: \"$ac_compile\"") >&5
6593   (eval $ac_compile) 2>&5
6594   ac_status=$?
6595   echo "$as_me:6595: \$? = $ac_status" >&5
6596   (exit $ac_status); } &&
6597          { ac_try='test -s conftest.$ac_objext'
6598   { (eval echo "$as_me:6598: \"$ac_try\"") >&5
6599   (eval $ac_try) 2>&5
6600   ac_status=$?
6601   echo "$as_me:6601: \$? = $ac_status" >&5
6602   (exit $ac_status); }; }; then
6603   cf_cv_ncurses_header=$cf_header; break
6604 else
6605   echo "$as_me: failed program was:" >&5
6606 cat conftest.$ac_ext >&5
6607 fi
6608 rm -f conftest.$ac_objext conftest.$ac_ext
6609 done
6610
6611 fi
6612 echo "$as_me:6612: result: $cf_cv_ncurses_header" >&5
6613 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6614
6615 if test "$cf_cv_ncurses_header" = none ; then
6616         { { echo "$as_me:6616: error: No curses header-files found" >&5
6617 echo "$as_me: error: No curses header-files found" >&2;}
6618    { (exit 1); exit 1; }; }
6619 fi
6620
6621 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6622
6623 for ac_header in $cf_cv_ncurses_header
6624 do
6625 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6626 echo "$as_me:6626: checking for $ac_header" >&5
6627 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6628 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6629   echo $ECHO_N "(cached) $ECHO_C" >&6
6630 else
6631   cat >conftest.$ac_ext <<_ACEOF
6632 #line 6632 "configure"
6633 #include "confdefs.h"
6634 #include <$ac_header>
6635 _ACEOF
6636 if { (eval echo "$as_me:6636: \"$ac_cpp conftest.$ac_ext\"") >&5
6637   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6638   ac_status=$?
6639   egrep -v '^ *\+' conftest.er1 >conftest.err
6640   rm -f conftest.er1
6641   cat conftest.err >&5
6642   echo "$as_me:6642: \$? = $ac_status" >&5
6643   (exit $ac_status); } >/dev/null; then
6644   if test -s conftest.err; then
6645     ac_cpp_err=$ac_c_preproc_warn_flag
6646   else
6647     ac_cpp_err=
6648   fi
6649 else
6650   ac_cpp_err=yes
6651 fi
6652 if test -z "$ac_cpp_err"; then
6653   eval "$as_ac_Header=yes"
6654 else
6655   echo "$as_me: failed program was:" >&5
6656   cat conftest.$ac_ext >&5
6657   eval "$as_ac_Header=no"
6658 fi
6659 rm -f conftest.err conftest.$ac_ext
6660 fi
6661 echo "$as_me:6661: result: `eval echo '${'$as_ac_Header'}'`" >&5
6662 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6663 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6664   cat >>confdefs.h <<EOF
6665 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6666 EOF
6667
6668 fi
6669 done
6670
6671 cat >>confdefs.h <<\EOF
6672 #define NCURSES 1
6673 EOF
6674
6675 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6676
6677                 cat >>confdefs.h <<EOF
6678 #define $cf_nculib_ROOT 1
6679 EOF
6680
6681                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6682
6683         else
6684
6685 cf_ncuhdr_root=$cf_cv_screen
6686
6687 test -n "$cf_cv_curses_dir" && \
6688 test "$cf_cv_curses_dir" != "no" && { \
6689
6690 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6691   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6692   do
6693         while test $cf_add_incdir != /usr/include
6694         do
6695           if test -d $cf_add_incdir
6696           then
6697                 cf_have_incdir=no
6698                 if test -n "$CFLAGS$CPPFLAGS" ; then
6699                   # a loop is needed to ensure we can add subdirs of existing dirs
6700                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6701                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6702                           cf_have_incdir=yes; break
6703                         fi
6704                   done
6705                 fi
6706
6707                 if test "$cf_have_incdir" = no ; then
6708                   if test "$cf_add_incdir" = /usr/local/include ; then
6709                         if test "$GCC" = yes
6710                         then
6711                           cf_save_CPPFLAGS=$CPPFLAGS
6712                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6713                           cat >conftest.$ac_ext <<_ACEOF
6714 #line 6714 "configure"
6715 #include "confdefs.h"
6716 #include <stdio.h>
6717 int
6718 main ()
6719 {
6720 printf("Hello")
6721   ;
6722   return 0;
6723 }
6724 _ACEOF
6725 rm -f conftest.$ac_objext
6726 if { (eval echo "$as_me:6726: \"$ac_compile\"") >&5
6727   (eval $ac_compile) 2>&5
6728   ac_status=$?
6729   echo "$as_me:6729: \$? = $ac_status" >&5
6730   (exit $ac_status); } &&
6731          { ac_try='test -s conftest.$ac_objext'
6732   { (eval echo "$as_me:6732: \"$ac_try\"") >&5
6733   (eval $ac_try) 2>&5
6734   ac_status=$?
6735   echo "$as_me:6735: \$? = $ac_status" >&5
6736   (exit $ac_status); }; }; then
6737   :
6738 else
6739   echo "$as_me: failed program was:" >&5
6740 cat conftest.$ac_ext >&5
6741 cf_have_incdir=yes
6742 fi
6743 rm -f conftest.$ac_objext conftest.$ac_ext
6744                           CPPFLAGS=$cf_save_CPPFLAGS
6745                         fi
6746                   fi
6747                 fi
6748
6749                 if test "$cf_have_incdir" = no ; then
6750                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6751
6752 echo "${as_me:-configure}:6752: testing adding $cf_add_incdir to include-path ..." 1>&5
6753
6754                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6755
6756                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6757                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6758                   cf_add_incdir="$cf_top_incdir"
6759                 else
6760                   break
6761                 fi
6762           else
6763                 break
6764           fi
6765         done
6766   done
6767 fi
6768
6769 }
6770
6771 echo "$as_me:6771: checking for $cf_ncuhdr_root header in include-path" >&5
6772 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6773 if test "${cf_cv_ncurses_h+set}" = set; then
6774   echo $ECHO_N "(cached) $ECHO_C" >&6
6775 else
6776
6777         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6778         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6779         for cf_header in $cf_header_list
6780         do
6781
6782         cat >conftest.$ac_ext <<_ACEOF
6783 #line 6783 "configure"
6784 #include "confdefs.h"
6785
6786 #include <$cf_header>
6787 int
6788 main ()
6789 {
6790
6791 #ifdef NCURSES_VERSION
6792
6793 printf("%s\n", NCURSES_VERSION);
6794 #else
6795 #ifdef __NCURSES_H
6796 printf("old\n");
6797 #else
6798         make an error
6799 #endif
6800 #endif
6801
6802   ;
6803   return 0;
6804 }
6805 _ACEOF
6806 rm -f conftest.$ac_objext
6807 if { (eval echo "$as_me:6807: \"$ac_compile\"") >&5
6808   (eval $ac_compile) 2>&5
6809   ac_status=$?
6810   echo "$as_me:6810: \$? = $ac_status" >&5
6811   (exit $ac_status); } &&
6812          { ac_try='test -s conftest.$ac_objext'
6813   { (eval echo "$as_me:6813: \"$ac_try\"") >&5
6814   (eval $ac_try) 2>&5
6815   ac_status=$?
6816   echo "$as_me:6816: \$? = $ac_status" >&5
6817   (exit $ac_status); }; }; then
6818   cf_cv_ncurses_h=$cf_header
6819
6820 else
6821   echo "$as_me: failed program was:" >&5
6822 cat conftest.$ac_ext >&5
6823 cf_cv_ncurses_h=no
6824 fi
6825 rm -f conftest.$ac_objext conftest.$ac_ext
6826
6827                 test "$cf_cv_ncurses_h" != no && break
6828         done
6829
6830 fi
6831 echo "$as_me:6831: result: $cf_cv_ncurses_h" >&5
6832 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6833
6834 if test "$cf_cv_ncurses_h" != no ; then
6835         cf_cv_ncurses_header=$cf_cv_ncurses_h
6836 else
6837
6838 echo "$as_me:6838: checking for $cf_ncuhdr_root include-path" >&5
6839 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6840 if test "${cf_cv_ncurses_h2+set}" = set; then
6841   echo $ECHO_N "(cached) $ECHO_C" >&6
6842 else
6843
6844         test -n "$verbose" && echo
6845
6846 cf_search=
6847
6848 # collect the current set of include-directories from compiler flags
6849 cf_header_path_list=""
6850 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6851         for cf_header_path in $CPPFLAGS $CFLAGS
6852         do
6853                 case $cf_header_path in
6854                 (-I*)
6855                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6856
6857 test "x$cf_header_path" != "xNONE" && \
6858 test -d "$cf_header_path" && \
6859  {
6860         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6861         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6862         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6863         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6864         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6865         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"
6866 }
6867
6868                         cf_header_path_list="$cf_header_path_list $cf_search"
6869                         ;;
6870                 esac
6871         done
6872 fi
6873
6874 # add the variations for the package we are looking for
6875
6876 cf_search=
6877
6878 test "x$prefix" != "xNONE" && \
6879 test -d "$prefix" && \
6880  {
6881         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6882         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6883         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6884         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6885         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6886         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6887 }
6888
6889 for cf_subdir_prefix in \
6890         /usr \
6891         /usr/local \
6892         /usr/pkg \
6893         /opt \
6894         /opt/local \
6895         $HOME
6896 do
6897
6898 test "x$cf_subdir_prefix" != "x$prefix" && \
6899 test -d "$cf_subdir_prefix" && \
6900 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6901         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6902         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6903         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6904         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6905         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6906         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6907 }
6908
6909 done
6910
6911 test "$includedir" != NONE && \
6912 test "$includedir" != "/usr/include" && \
6913 test -d "$includedir" && {
6914         test -d $includedir &&    cf_search="$cf_search $includedir"
6915         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6916 }
6917
6918 test "$oldincludedir" != NONE && \
6919 test "$oldincludedir" != "/usr/include" && \
6920 test -d "$oldincludedir" && {
6921         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6922         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6923 }
6924
6925 cf_search="$cf_search $cf_header_path_list"
6926
6927         test -n "$verbose" && echo search path $cf_search
6928         cf_save2_CPPFLAGS="$CPPFLAGS"
6929         for cf_incdir in $cf_search
6930         do
6931
6932 if test -n "$cf_incdir" ; then
6933   for cf_add_incdir in $cf_incdir
6934   do
6935         while test $cf_add_incdir != /usr/include
6936         do
6937           if test -d $cf_add_incdir
6938           then
6939                 cf_have_incdir=no
6940                 if test -n "$CFLAGS$CPPFLAGS" ; then
6941                   # a loop is needed to ensure we can add subdirs of existing dirs
6942                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6943                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6944                           cf_have_incdir=yes; break
6945                         fi
6946                   done
6947                 fi
6948
6949                 if test "$cf_have_incdir" = no ; then
6950                   if test "$cf_add_incdir" = /usr/local/include ; then
6951                         if test "$GCC" = yes
6952                         then
6953                           cf_save_CPPFLAGS=$CPPFLAGS
6954                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6955                           cat >conftest.$ac_ext <<_ACEOF
6956 #line 6956 "configure"
6957 #include "confdefs.h"
6958 #include <stdio.h>
6959 int
6960 main ()
6961 {
6962 printf("Hello")
6963   ;
6964   return 0;
6965 }
6966 _ACEOF
6967 rm -f conftest.$ac_objext
6968 if { (eval echo "$as_me:6968: \"$ac_compile\"") >&5
6969   (eval $ac_compile) 2>&5
6970   ac_status=$?
6971   echo "$as_me:6971: \$? = $ac_status" >&5
6972   (exit $ac_status); } &&
6973          { ac_try='test -s conftest.$ac_objext'
6974   { (eval echo "$as_me:6974: \"$ac_try\"") >&5
6975   (eval $ac_try) 2>&5
6976   ac_status=$?
6977   echo "$as_me:6977: \$? = $ac_status" >&5
6978   (exit $ac_status); }; }; then
6979   :
6980 else
6981   echo "$as_me: failed program was:" >&5
6982 cat conftest.$ac_ext >&5
6983 cf_have_incdir=yes
6984 fi
6985 rm -f conftest.$ac_objext conftest.$ac_ext
6986                           CPPFLAGS=$cf_save_CPPFLAGS
6987                         fi
6988                   fi
6989                 fi
6990
6991                 if test "$cf_have_incdir" = no ; then
6992                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6993
6994 echo "${as_me:-configure}:6994: testing adding $cf_add_incdir to include-path ..." 1>&5
6995
6996                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6997
6998                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6999                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7000                   cf_add_incdir="$cf_top_incdir"
7001                 else
7002                   break
7003                 fi
7004           else
7005                 break
7006           fi
7007         done
7008   done
7009 fi
7010
7011                 for cf_header in \
7012                         ncurses.h \
7013                         curses.h
7014                 do
7015
7016         cat >conftest.$ac_ext <<_ACEOF
7017 #line 7017 "configure"
7018 #include "confdefs.h"
7019
7020 #include <$cf_header>
7021 int
7022 main ()
7023 {
7024
7025 #ifdef NCURSES_VERSION
7026
7027 printf("%s\n", NCURSES_VERSION);
7028 #else
7029 #ifdef __NCURSES_H
7030 printf("old\n");
7031 #else
7032         make an error
7033 #endif
7034 #endif
7035
7036   ;
7037   return 0;
7038 }
7039 _ACEOF
7040 rm -f conftest.$ac_objext
7041 if { (eval echo "$as_me:7041: \"$ac_compile\"") >&5
7042   (eval $ac_compile) 2>&5
7043   ac_status=$?
7044   echo "$as_me:7044: \$? = $ac_status" >&5
7045   (exit $ac_status); } &&
7046          { ac_try='test -s conftest.$ac_objext'
7047   { (eval echo "$as_me:7047: \"$ac_try\"") >&5
7048   (eval $ac_try) 2>&5
7049   ac_status=$?
7050   echo "$as_me:7050: \$? = $ac_status" >&5
7051   (exit $ac_status); }; }; then
7052   cf_cv_ncurses_h2=$cf_header
7053
7054 else
7055   echo "$as_me: failed program was:" >&5
7056 cat conftest.$ac_ext >&5
7057 cf_cv_ncurses_h2=no
7058 fi
7059 rm -f conftest.$ac_objext conftest.$ac_ext
7060
7061                         if test "$cf_cv_ncurses_h2" != no ; then
7062                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7063                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7064                                 break
7065                         fi
7066                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7067                 done
7068                 CPPFLAGS="$cf_save2_CPPFLAGS"
7069                 test "$cf_cv_ncurses_h2" != no && break
7070         done
7071         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7071: error: not found" >&5
7072 echo "$as_me: error: not found" >&2;}
7073    { (exit 1); exit 1; }; }
7074
7075 fi
7076 echo "$as_me:7076: result: $cf_cv_ncurses_h2" >&5
7077 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7078
7079         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7080         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7081         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7082                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7083         fi
7084
7085 if test -n "$cf_1st_incdir" ; then
7086   for cf_add_incdir in $cf_1st_incdir
7087   do
7088         while test $cf_add_incdir != /usr/include
7089         do
7090           if test -d $cf_add_incdir
7091           then
7092                 cf_have_incdir=no
7093                 if test -n "$CFLAGS$CPPFLAGS" ; then
7094                   # a loop is needed to ensure we can add subdirs of existing dirs
7095                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7096                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7097                           cf_have_incdir=yes; break
7098                         fi
7099                   done
7100                 fi
7101
7102                 if test "$cf_have_incdir" = no ; then
7103                   if test "$cf_add_incdir" = /usr/local/include ; then
7104                         if test "$GCC" = yes
7105                         then
7106                           cf_save_CPPFLAGS=$CPPFLAGS
7107                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7108                           cat >conftest.$ac_ext <<_ACEOF
7109 #line 7109 "configure"
7110 #include "confdefs.h"
7111 #include <stdio.h>
7112 int
7113 main ()
7114 {
7115 printf("Hello")
7116   ;
7117   return 0;
7118 }
7119 _ACEOF
7120 rm -f conftest.$ac_objext
7121 if { (eval echo "$as_me:7121: \"$ac_compile\"") >&5
7122   (eval $ac_compile) 2>&5
7123   ac_status=$?
7124   echo "$as_me:7124: \$? = $ac_status" >&5
7125   (exit $ac_status); } &&
7126          { ac_try='test -s conftest.$ac_objext'
7127   { (eval echo "$as_me:7127: \"$ac_try\"") >&5
7128   (eval $ac_try) 2>&5
7129   ac_status=$?
7130   echo "$as_me:7130: \$? = $ac_status" >&5
7131   (exit $ac_status); }; }; then
7132   :
7133 else
7134   echo "$as_me: failed program was:" >&5
7135 cat conftest.$ac_ext >&5
7136 cf_have_incdir=yes
7137 fi
7138 rm -f conftest.$ac_objext conftest.$ac_ext
7139                           CPPFLAGS=$cf_save_CPPFLAGS
7140                         fi
7141                   fi
7142                 fi
7143
7144                 if test "$cf_have_incdir" = no ; then
7145                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7146
7147 echo "${as_me:-configure}:7147: testing adding $cf_add_incdir to include-path ..." 1>&5
7148
7149                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7150
7151                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7152                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7153                   cf_add_incdir="$cf_top_incdir"
7154                 else
7155                   break
7156                 fi
7157           else
7158                 break
7159           fi
7160         done
7161   done
7162 fi
7163
7164 fi
7165
7166 # Set definitions to allow ifdef'ing for ncurses.h
7167
7168 case $cf_cv_ncurses_header in
7169 (*ncurses.h)
7170
7171 cat >>confdefs.h <<\EOF
7172 #define HAVE_NCURSES_H 1
7173 EOF
7174
7175         ;;
7176 esac
7177
7178 case $cf_cv_ncurses_header in
7179 (ncurses/curses.h|ncurses/ncurses.h)
7180
7181 cat >>confdefs.h <<\EOF
7182 #define HAVE_NCURSES_NCURSES_H 1
7183 EOF
7184
7185         ;;
7186 (ncursesw/curses.h|ncursesw/ncurses.h)
7187
7188 cat >>confdefs.h <<\EOF
7189 #define HAVE_NCURSESW_NCURSES_H 1
7190 EOF
7191
7192         ;;
7193 esac
7194
7195 echo "$as_me:7195: checking for terminfo header" >&5
7196 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7197 if test "${cf_cv_term_header+set}" = set; then
7198   echo $ECHO_N "(cached) $ECHO_C" >&6
7199 else
7200
7201 case ${cf_cv_ncurses_header} in
7202 (*/ncurses.h|*/ncursesw.h)
7203         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7204         ;;
7205 (*)
7206         cf_term_header=term.h
7207         ;;
7208 esac
7209
7210 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7211 do
7212 cat >conftest.$ac_ext <<_ACEOF
7213 #line 7213 "configure"
7214 #include "confdefs.h"
7215 #include <stdio.h>
7216 #include <${cf_cv_ncurses_header:-curses.h}>
7217 #include <$cf_test>
7218
7219 int
7220 main ()
7221 {
7222 int x = auto_left_margin
7223   ;
7224   return 0;
7225 }
7226 _ACEOF
7227 rm -f conftest.$ac_objext
7228 if { (eval echo "$as_me:7228: \"$ac_compile\"") >&5
7229   (eval $ac_compile) 2>&5
7230   ac_status=$?
7231   echo "$as_me:7231: \$? = $ac_status" >&5
7232   (exit $ac_status); } &&
7233          { ac_try='test -s conftest.$ac_objext'
7234   { (eval echo "$as_me:7234: \"$ac_try\"") >&5
7235   (eval $ac_try) 2>&5
7236   ac_status=$?
7237   echo "$as_me:7237: \$? = $ac_status" >&5
7238   (exit $ac_status); }; }; then
7239
7240         cf_cv_term_header="$cf_test"
7241 else
7242   echo "$as_me: failed program was:" >&5
7243 cat conftest.$ac_ext >&5
7244
7245         cf_cv_term_header=unknown
7246
7247 fi
7248 rm -f conftest.$ac_objext conftest.$ac_ext
7249         test "$cf_cv_term_header" != unknown && break
7250 done
7251
7252 fi
7253 echo "$as_me:7253: result: $cf_cv_term_header" >&5
7254 echo "${ECHO_T}$cf_cv_term_header" >&6
7255
7256 # Set definitions to allow ifdef'ing to accommodate subdirectories
7257
7258 case $cf_cv_term_header in
7259 (*term.h)
7260
7261 cat >>confdefs.h <<\EOF
7262 #define HAVE_TERM_H 1
7263 EOF
7264
7265         ;;
7266 esac
7267
7268 case $cf_cv_term_header in
7269 (ncurses/term.h)
7270
7271 cat >>confdefs.h <<\EOF
7272 #define HAVE_NCURSES_TERM_H 1
7273 EOF
7274
7275         ;;
7276 (ncursesw/term.h)
7277
7278 cat >>confdefs.h <<\EOF
7279 #define HAVE_NCURSESW_TERM_H 1
7280 EOF
7281
7282         ;;
7283 esac
7284
7285 # some applications need this, but should check for NCURSES_VERSION
7286
7287 cat >>confdefs.h <<\EOF
7288 #define NCURSES 1
7289 EOF
7290
7291 echo "$as_me:7291: checking for ncurses version" >&5
7292 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7293 if test "${cf_cv_ncurses_version+set}" = set; then
7294   echo $ECHO_N "(cached) $ECHO_C" >&6
7295 else
7296
7297         cf_cv_ncurses_version=no
7298         cf_tempfile=out$$
7299         rm -f $cf_tempfile
7300         if test "$cross_compiling" = yes; then
7301
7302         # This will not work if the preprocessor splits the line after the
7303         # Autoconf token.  The 'unproto' program does that.
7304         cat > conftest.$ac_ext <<EOF
7305 #include <${cf_cv_ncurses_header:-curses.h}>
7306 #undef Autoconf
7307 #ifdef NCURSES_VERSION
7308 Autoconf NCURSES_VERSION
7309 #else
7310 #ifdef __NCURSES_H
7311 Autoconf "old"
7312 #endif
7313 ;
7314 #endif
7315 EOF
7316         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7317         { (eval echo "$as_me:7317: \"$cf_try\"") >&5
7318   (eval $cf_try) 2>&5
7319   ac_status=$?
7320   echo "$as_me:7320: \$? = $ac_status" >&5
7321   (exit $ac_status); }
7322         if test -f conftest.out ; then
7323                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7324                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7325                 rm -f conftest.out
7326         fi
7327
7328 else
7329   cat >conftest.$ac_ext <<_ACEOF
7330 #line 7330 "configure"
7331 #include "confdefs.h"
7332
7333 #include <${cf_cv_ncurses_header:-curses.h}>
7334 #include <stdio.h>
7335 int main()
7336 {
7337         FILE *fp = fopen("$cf_tempfile", "w");
7338 #ifdef NCURSES_VERSION
7339 # ifdef NCURSES_VERSION_PATCH
7340         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7341 # else
7342         fprintf(fp, "%s\n", NCURSES_VERSION);
7343 # endif
7344 #else
7345 # ifdef __NCURSES_H
7346         fprintf(fp, "old\n");
7347 # else
7348         make an error
7349 # endif
7350 #endif
7351         ${cf_cv_main_return:-return}(0);
7352 }
7353 _ACEOF
7354 rm -f conftest$ac_exeext
7355 if { (eval echo "$as_me:7355: \"$ac_link\"") >&5
7356   (eval $ac_link) 2>&5
7357   ac_status=$?
7358   echo "$as_me:7358: \$? = $ac_status" >&5
7359   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7360   { (eval echo "$as_me:7360: \"$ac_try\"") >&5
7361   (eval $ac_try) 2>&5
7362   ac_status=$?
7363   echo "$as_me:7363: \$? = $ac_status" >&5
7364   (exit $ac_status); }; }; then
7365
7366         cf_cv_ncurses_version=`cat $cf_tempfile`
7367 else
7368   echo "$as_me: program exited with status $ac_status" >&5
7369 echo "$as_me: failed program was:" >&5
7370 cat conftest.$ac_ext >&5
7371 fi
7372 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7373 fi
7374         rm -f $cf_tempfile
7375
7376 fi
7377 echo "$as_me:7377: result: $cf_cv_ncurses_version" >&5
7378 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7379 test "$cf_cv_ncurses_version" = no ||
7380 cat >>confdefs.h <<\EOF
7381 #define NCURSES 1
7382 EOF
7383
7384 cf_nculib_root=$cf_cv_screen
7385         # This works, except for the special case where we find gpm, but
7386         # ncurses is in a nonstandard location via $LIBS, and we really want
7387         # to link gpm.
7388 cf_ncurses_LIBS=""
7389 cf_ncurses_SAVE="$LIBS"
7390 echo "$as_me:7390: checking for Gpm_Open in -lgpm" >&5
7391 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7392 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7393   echo $ECHO_N "(cached) $ECHO_C" >&6
7394 else
7395   ac_check_lib_save_LIBS=$LIBS
7396 LIBS="-lgpm  $LIBS"
7397 cat >conftest.$ac_ext <<_ACEOF
7398 #line 7398 "configure"
7399 #include "confdefs.h"
7400
7401 /* Override any gcc2 internal prototype to avoid an error.  */
7402 #ifdef __cplusplus
7403 extern "C"
7404 #endif
7405 /* We use char because int might match the return type of a gcc2
7406    builtin and then its argument prototype would still apply.  */
7407 char Gpm_Open ();
7408 int
7409 main ()
7410 {
7411 Gpm_Open ();
7412   ;
7413   return 0;
7414 }
7415 _ACEOF
7416 rm -f conftest.$ac_objext conftest$ac_exeext
7417 if { (eval echo "$as_me:7417: \"$ac_link\"") >&5
7418   (eval $ac_link) 2>&5
7419   ac_status=$?
7420   echo "$as_me:7420: \$? = $ac_status" >&5
7421   (exit $ac_status); } &&
7422          { ac_try='test -s conftest$ac_exeext'
7423   { (eval echo "$as_me:7423: \"$ac_try\"") >&5
7424   (eval $ac_try) 2>&5
7425   ac_status=$?
7426   echo "$as_me:7426: \$? = $ac_status" >&5
7427   (exit $ac_status); }; }; then
7428   ac_cv_lib_gpm_Gpm_Open=yes
7429 else
7430   echo "$as_me: failed program was:" >&5
7431 cat conftest.$ac_ext >&5
7432 ac_cv_lib_gpm_Gpm_Open=no
7433 fi
7434 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7435 LIBS=$ac_check_lib_save_LIBS
7436 fi
7437 echo "$as_me:7437: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7438 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7439 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7440   echo "$as_me:7440: checking for initscr in -lgpm" >&5
7441 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7442 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7443   echo $ECHO_N "(cached) $ECHO_C" >&6
7444 else
7445   ac_check_lib_save_LIBS=$LIBS
7446 LIBS="-lgpm  $LIBS"
7447 cat >conftest.$ac_ext <<_ACEOF
7448 #line 7448 "configure"
7449 #include "confdefs.h"
7450
7451 /* Override any gcc2 internal prototype to avoid an error.  */
7452 #ifdef __cplusplus
7453 extern "C"
7454 #endif
7455 /* We use char because int might match the return type of a gcc2
7456    builtin and then its argument prototype would still apply.  */
7457 char initscr ();
7458 int
7459 main ()
7460 {
7461 initscr ();
7462   ;
7463   return 0;
7464 }
7465 _ACEOF
7466 rm -f conftest.$ac_objext conftest$ac_exeext
7467 if { (eval echo "$as_me:7467: \"$ac_link\"") >&5
7468   (eval $ac_link) 2>&5
7469   ac_status=$?
7470   echo "$as_me:7470: \$? = $ac_status" >&5
7471   (exit $ac_status); } &&
7472          { ac_try='test -s conftest$ac_exeext'
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   ac_cv_lib_gpm_initscr=yes
7479 else
7480   echo "$as_me: failed program was:" >&5
7481 cat conftest.$ac_ext >&5
7482 ac_cv_lib_gpm_initscr=no
7483 fi
7484 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7485 LIBS=$ac_check_lib_save_LIBS
7486 fi
7487 echo "$as_me:7487: result: $ac_cv_lib_gpm_initscr" >&5
7488 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7489 if test $ac_cv_lib_gpm_initscr = yes; then
7490   LIBS="$cf_ncurses_SAVE"
7491 else
7492   cf_ncurses_LIBS="-lgpm"
7493 fi
7494
7495 fi
7496
7497 case $host_os in
7498 (freebsd*)
7499         # This is only necessary if you are linking against an obsolete
7500         # version of ncurses (but it should do no harm, since it's static).
7501         if test "$cf_nculib_root" = ncurses ; then
7502                 echo "$as_me:7502: checking for tgoto in -lmytinfo" >&5
7503 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7504 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7505   echo $ECHO_N "(cached) $ECHO_C" >&6
7506 else
7507   ac_check_lib_save_LIBS=$LIBS
7508 LIBS="-lmytinfo  $LIBS"
7509 cat >conftest.$ac_ext <<_ACEOF
7510 #line 7510 "configure"
7511 #include "confdefs.h"
7512
7513 /* Override any gcc2 internal prototype to avoid an error.  */
7514 #ifdef __cplusplus
7515 extern "C"
7516 #endif
7517 /* We use char because int might match the return type of a gcc2
7518    builtin and then its argument prototype would still apply.  */
7519 char tgoto ();
7520 int
7521 main ()
7522 {
7523 tgoto ();
7524   ;
7525   return 0;
7526 }
7527 _ACEOF
7528 rm -f conftest.$ac_objext conftest$ac_exeext
7529 if { (eval echo "$as_me:7529: \"$ac_link\"") >&5
7530   (eval $ac_link) 2>&5
7531   ac_status=$?
7532   echo "$as_me:7532: \$? = $ac_status" >&5
7533   (exit $ac_status); } &&
7534          { ac_try='test -s conftest$ac_exeext'
7535   { (eval echo "$as_me:7535: \"$ac_try\"") >&5
7536   (eval $ac_try) 2>&5
7537   ac_status=$?
7538   echo "$as_me:7538: \$? = $ac_status" >&5
7539   (exit $ac_status); }; }; then
7540   ac_cv_lib_mytinfo_tgoto=yes
7541 else
7542   echo "$as_me: failed program was:" >&5
7543 cat conftest.$ac_ext >&5
7544 ac_cv_lib_mytinfo_tgoto=no
7545 fi
7546 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7547 LIBS=$ac_check_lib_save_LIBS
7548 fi
7549 echo "$as_me:7549: result: $ac_cv_lib_mytinfo_tgoto" >&5
7550 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7551 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7552   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7553 fi
7554
7555         fi
7556         ;;
7557 esac
7558
7559 cf_add_libs="$cf_ncurses_LIBS"
7560 # Filter out duplicates - this happens with badly-designed ".pc" files...
7561 for cf_add_1lib in $LIBS
7562 do
7563         for cf_add_2lib in $cf_add_libs
7564         do
7565                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7566                 then
7567                         cf_add_1lib=
7568                         break
7569                 fi
7570         done
7571         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7572 done
7573 LIBS="$cf_add_libs"
7574
7575 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7576 then
7577
7578 cf_add_libs="-l$cf_nculib_root"
7579 # Filter out duplicates - this happens with badly-designed ".pc" files...
7580 for cf_add_1lib in $LIBS
7581 do
7582         for cf_add_2lib in $cf_add_libs
7583         do
7584                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7585                 then
7586                         cf_add_1lib=
7587                         break
7588                 fi
7589         done
7590         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7591 done
7592 LIBS="$cf_add_libs"
7593
7594 else
7595
7596         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7597         cf_libdir=""
7598         echo "$as_me:7598: checking for initscr" >&5
7599 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7600 if test "${ac_cv_func_initscr+set}" = set; then
7601   echo $ECHO_N "(cached) $ECHO_C" >&6
7602 else
7603   cat >conftest.$ac_ext <<_ACEOF
7604 #line 7604 "configure"
7605 #include "confdefs.h"
7606 /* System header to define __stub macros and hopefully few prototypes,
7607     which can conflict with char initscr (); below.  */
7608 #include <assert.h>
7609 /* Override any gcc2 internal prototype to avoid an error.  */
7610 #ifdef __cplusplus
7611 extern "C"
7612 #endif
7613 /* We use char because int might match the return type of a gcc2
7614    builtin and then its argument prototype would still apply.  */
7615 char initscr ();
7616 char (*f) ();
7617
7618 int
7619 main ()
7620 {
7621 /* The GNU C library defines this for functions which it implements
7622     to always fail with ENOSYS.  Some functions are actually named
7623     something starting with __ and the normal name is an alias.  */
7624 #if defined (__stub_initscr) || defined (__stub___initscr)
7625 choke me
7626 #else
7627 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7628 #endif
7629
7630   ;
7631   return 0;
7632 }
7633 _ACEOF
7634 rm -f conftest.$ac_objext conftest$ac_exeext
7635 if { (eval echo "$as_me:7635: \"$ac_link\"") >&5
7636   (eval $ac_link) 2>&5
7637   ac_status=$?
7638   echo "$as_me:7638: \$? = $ac_status" >&5
7639   (exit $ac_status); } &&
7640          { ac_try='test -s conftest$ac_exeext'
7641   { (eval echo "$as_me:7641: \"$ac_try\"") >&5
7642   (eval $ac_try) 2>&5
7643   ac_status=$?
7644   echo "$as_me:7644: \$? = $ac_status" >&5
7645   (exit $ac_status); }; }; then
7646   ac_cv_func_initscr=yes
7647 else
7648   echo "$as_me: failed program was:" >&5
7649 cat conftest.$ac_ext >&5
7650 ac_cv_func_initscr=no
7651 fi
7652 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7653 fi
7654 echo "$as_me:7654: result: $ac_cv_func_initscr" >&5
7655 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7656 if test $ac_cv_func_initscr = yes; then
7657   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7658 else
7659
7660                 cf_save_LIBS="$LIBS"
7661                 echo "$as_me:7661: checking for initscr in -l$cf_nculib_root" >&5
7662 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7663                 LIBS="-l$cf_nculib_root $LIBS"
7664                 cat >conftest.$ac_ext <<_ACEOF
7665 #line 7665 "configure"
7666 #include "confdefs.h"
7667 #include <${cf_cv_ncurses_header:-curses.h}>
7668 int
7669 main ()
7670 {
7671 initscr()
7672   ;
7673   return 0;
7674 }
7675 _ACEOF
7676 rm -f conftest.$ac_objext conftest$ac_exeext
7677 if { (eval echo "$as_me:7677: \"$ac_link\"") >&5
7678   (eval $ac_link) 2>&5
7679   ac_status=$?
7680   echo "$as_me:7680: \$? = $ac_status" >&5
7681   (exit $ac_status); } &&
7682          { ac_try='test -s conftest$ac_exeext'
7683   { (eval echo "$as_me:7683: \"$ac_try\"") >&5
7684   (eval $ac_try) 2>&5
7685   ac_status=$?
7686   echo "$as_me:7686: \$? = $ac_status" >&5
7687   (exit $ac_status); }; }; then
7688   echo "$as_me:7688: result: yes" >&5
7689 echo "${ECHO_T}yes" >&6
7690                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7691
7692 else
7693   echo "$as_me: failed program was:" >&5
7694 cat conftest.$ac_ext >&5
7695 echo "$as_me:7695: result: no" >&5
7696 echo "${ECHO_T}no" >&6
7697
7698 cf_search=
7699 cf_library_path_list=""
7700 if test -n "${LDFLAGS}${LIBS}" ; then
7701         for cf_library_path in $LDFLAGS $LIBS
7702         do
7703                 case $cf_library_path in
7704                 (-L*)
7705                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7706
7707 test "x$cf_library_path" != "xNONE" && \
7708 test -d "$cf_library_path" && \
7709  {
7710         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7711         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7712         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7713         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7714         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7715         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"
7716 }
7717
7718                         cf_library_path_list="$cf_library_path_list $cf_search"
7719                         ;;
7720                 esac
7721         done
7722 fi
7723
7724 cf_search=
7725
7726 test "x$prefix" != "xNONE" && \
7727 test -d "$prefix" && \
7728  {
7729         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7730         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7731         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7732         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7733         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7734         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7735 }
7736
7737 for cf_subdir_prefix in \
7738         /usr \
7739         /usr/local \
7740         /usr/pkg \
7741         /opt \
7742         /opt/local \
7743         $HOME
7744 do
7745
7746 test "x$cf_subdir_prefix" != "x$prefix" && \
7747 test -d "$cf_subdir_prefix" && \
7748 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7749         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7750         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7751         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7752         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7753         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7754         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
7755 }
7756
7757 done
7758
7759 cf_search="$cf_library_path_list $cf_search"
7760
7761                         for cf_libdir in $cf_search
7762                         do
7763                                 echo "$as_me:7763: checking for -l$cf_nculib_root in $cf_libdir" >&5
7764 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7765                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7766                                 cat >conftest.$ac_ext <<_ACEOF
7767 #line 7767 "configure"
7768 #include "confdefs.h"
7769 #include <${cf_cv_ncurses_header:-curses.h}>
7770 int
7771 main ()
7772 {
7773 initscr()
7774   ;
7775   return 0;
7776 }
7777 _ACEOF
7778 rm -f conftest.$ac_objext conftest$ac_exeext
7779 if { (eval echo "$as_me:7779: \"$ac_link\"") >&5
7780   (eval $ac_link) 2>&5
7781   ac_status=$?
7782   echo "$as_me:7782: \$? = $ac_status" >&5
7783   (exit $ac_status); } &&
7784          { ac_try='test -s conftest$ac_exeext'
7785   { (eval echo "$as_me:7785: \"$ac_try\"") >&5
7786   (eval $ac_try) 2>&5
7787   ac_status=$?
7788   echo "$as_me:7788: \$? = $ac_status" >&5
7789   (exit $ac_status); }; }; then
7790   echo "$as_me:7790: result: yes" >&5
7791 echo "${ECHO_T}yes" >&6
7792                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7793                                          break
7794 else
7795   echo "$as_me: failed program was:" >&5
7796 cat conftest.$ac_ext >&5
7797 echo "$as_me:7797: result: no" >&5
7798 echo "${ECHO_T}no" >&6
7799                                          LIBS="$cf_save_LIBS"
7800 fi
7801 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7802                         done
7803
7804 fi
7805 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7806
7807 fi
7808
7809 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7810
7811 if test $cf_found_library = no ; then
7812         { { echo "$as_me:7812: error: Cannot link $cf_nculib_root library" >&5
7813 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7814    { (exit 1); exit 1; }; }
7815 fi
7816
7817 fi
7818
7819 if test -n "$cf_ncurses_LIBS" ; then
7820         echo "$as_me:7820: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7821 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7822         cf_ncurses_SAVE="$LIBS"
7823         for p in $cf_ncurses_LIBS ; do
7824                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7825                 if test "$q" != "$LIBS" ; then
7826                         LIBS="$q"
7827                 fi
7828         done
7829         cat >conftest.$ac_ext <<_ACEOF
7830 #line 7830 "configure"
7831 #include "confdefs.h"
7832 #include <${cf_cv_ncurses_header:-curses.h}>
7833 int
7834 main ()
7835 {
7836 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7837   ;
7838   return 0;
7839 }
7840 _ACEOF
7841 rm -f conftest.$ac_objext conftest$ac_exeext
7842 if { (eval echo "$as_me:7842: \"$ac_link\"") >&5
7843   (eval $ac_link) 2>&5
7844   ac_status=$?
7845   echo "$as_me:7845: \$? = $ac_status" >&5
7846   (exit $ac_status); } &&
7847          { ac_try='test -s conftest$ac_exeext'
7848   { (eval echo "$as_me:7848: \"$ac_try\"") >&5
7849   (eval $ac_try) 2>&5
7850   ac_status=$?
7851   echo "$as_me:7851: \$? = $ac_status" >&5
7852   (exit $ac_status); }; }; then
7853   echo "$as_me:7853: result: yes" >&5
7854 echo "${ECHO_T}yes" >&6
7855 else
7856   echo "$as_me: failed program was:" >&5
7857 cat conftest.$ac_ext >&5
7858 echo "$as_me:7858: result: no" >&5
7859 echo "${ECHO_T}no" >&6
7860                  LIBS="$cf_ncurses_SAVE"
7861 fi
7862 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7863 fi
7864
7865 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7866
7867 cat >>confdefs.h <<EOF
7868 #define $cf_nculib_ROOT 1
7869 EOF
7870
7871         fi
7872 else
7873         NCURSES_CONFIG=none
7874 fi
7875
7876         ;;
7877 (ncurses*)
7878
7879 cf_ncuconfig_root=$cf_cv_screen
7880 cf_have_ncuconfig=no
7881
7882 if test "x${PKG_CONFIG:=none}" != xnone; then
7883         echo "$as_me:7883: checking pkg-config for $cf_ncuconfig_root" >&5
7884 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7885         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7886                 echo "$as_me:7886: result: yes" >&5
7887 echo "${ECHO_T}yes" >&6
7888
7889                 echo "$as_me:7889: checking if the $cf_ncuconfig_root package files work" >&5
7890 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7891                 cf_have_ncuconfig=unknown
7892
7893                 cf_save_CPPFLAGS="$CPPFLAGS"
7894                 cf_save_LIBS="$LIBS"
7895
7896                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7897
7898 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7899 # Filter out duplicates - this happens with badly-designed ".pc" files...
7900 for cf_add_1lib in $LIBS
7901 do
7902         for cf_add_2lib in $cf_add_libs
7903         do
7904                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7905                 then
7906                         cf_add_1lib=
7907                         break
7908                 fi
7909         done
7910         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7911 done
7912 LIBS="$cf_add_libs"
7913
7914                 cat >conftest.$ac_ext <<_ACEOF
7915 #line 7915 "configure"
7916 #include "confdefs.h"
7917 #include <${cf_cv_ncurses_header:-curses.h}>
7918 int
7919 main ()
7920 {
7921 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7922   ;
7923   return 0;
7924 }
7925 _ACEOF
7926 rm -f conftest.$ac_objext conftest$ac_exeext
7927 if { (eval echo "$as_me:7927: \"$ac_link\"") >&5
7928   (eval $ac_link) 2>&5
7929   ac_status=$?
7930   echo "$as_me:7930: \$? = $ac_status" >&5
7931   (exit $ac_status); } &&
7932          { ac_try='test -s conftest$ac_exeext'
7933   { (eval echo "$as_me:7933: \"$ac_try\"") >&5
7934   (eval $ac_try) 2>&5
7935   ac_status=$?
7936   echo "$as_me:7936: \$? = $ac_status" >&5
7937   (exit $ac_status); }; }; then
7938   if test "$cross_compiling" = yes; then
7939   cf_have_ncuconfig=maybe
7940 else
7941   cat >conftest.$ac_ext <<_ACEOF
7942 #line 7942 "configure"
7943 #include "confdefs.h"
7944 #include <${cf_cv_ncurses_header:-curses.h}>
7945                                 int main(void)
7946                                 { char *xx = curses_version(); return (xx == 0); }
7947 _ACEOF
7948 rm -f conftest$ac_exeext
7949 if { (eval echo "$as_me:7949: \"$ac_link\"") >&5
7950   (eval $ac_link) 2>&5
7951   ac_status=$?
7952   echo "$as_me:7952: \$? = $ac_status" >&5
7953   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7954   { (eval echo "$as_me:7954: \"$ac_try\"") >&5
7955   (eval $ac_try) 2>&5
7956   ac_status=$?
7957   echo "$as_me:7957: \$? = $ac_status" >&5
7958   (exit $ac_status); }; }; then
7959   cf_have_ncuconfig=yes
7960 else
7961   echo "$as_me: program exited with status $ac_status" >&5
7962 echo "$as_me: failed program was:" >&5
7963 cat conftest.$ac_ext >&5
7964 cf_have_ncuconfig=no
7965 fi
7966 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7967 fi
7968 else
7969   echo "$as_me: failed program was:" >&5
7970 cat conftest.$ac_ext >&5
7971 cf_have_ncuconfig=no
7972 fi
7973 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7974                 echo "$as_me:7974: result: $cf_have_ncuconfig" >&5
7975 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7976                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7977                 if test "$cf_have_ncuconfig" != "yes"
7978                 then
7979                         CPPFLAGS="$cf_save_CPPFLAGS"
7980                         LIBS="$cf_save_LIBS"
7981                         NCURSES_CONFIG_PKG=none
7982                 else
7983
7984 cat >>confdefs.h <<\EOF
7985 #define NCURSES 1
7986 EOF
7987
7988                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7989                 fi
7990
7991         else
7992                 echo "$as_me:7992: result: no" >&5
7993 echo "${ECHO_T}no" >&6
7994                 NCURSES_CONFIG_PKG=none
7995         fi
7996 else
7997         NCURSES_CONFIG_PKG=none
7998 fi
7999
8000 if test "x$cf_have_ncuconfig" = "xno"; then
8001         echo "Looking for ${cf_ncuconfig_root}-config"
8002
8003 if test -n "$ac_tool_prefix"; then
8004   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8005   do
8006     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8007 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8008 echo "$as_me:8008: checking for $ac_word" >&5
8009 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8010 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8011   echo $ECHO_N "(cached) $ECHO_C" >&6
8012 else
8013   if test -n "$NCURSES_CONFIG"; then
8014   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8015 else
8016   ac_save_IFS=$IFS; IFS=$ac_path_separator
8017 ac_dummy="$PATH"
8018 for ac_dir in $ac_dummy; do
8019   IFS=$ac_save_IFS
8020   test -z "$ac_dir" && ac_dir=.
8021   $as_executable_p "$ac_dir/$ac_word" || continue
8022 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8023 echo "$as_me:8023: found $ac_dir/$ac_word" >&5
8024 break
8025 done
8026
8027 fi
8028 fi
8029 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8030 if test -n "$NCURSES_CONFIG"; then
8031   echo "$as_me:8031: result: $NCURSES_CONFIG" >&5
8032 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8033 else
8034   echo "$as_me:8034: result: no" >&5
8035 echo "${ECHO_T}no" >&6
8036 fi
8037
8038     test -n "$NCURSES_CONFIG" && break
8039   done
8040 fi
8041 if test -z "$NCURSES_CONFIG"; then
8042   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8043   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8044 do
8045   # Extract the first word of "$ac_prog", so it can be a program name with args.
8046 set dummy $ac_prog; ac_word=$2
8047 echo "$as_me:8047: checking for $ac_word" >&5
8048 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8049 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8050   echo $ECHO_N "(cached) $ECHO_C" >&6
8051 else
8052   if test -n "$ac_ct_NCURSES_CONFIG"; then
8053   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8054 else
8055   ac_save_IFS=$IFS; IFS=$ac_path_separator
8056 ac_dummy="$PATH"
8057 for ac_dir in $ac_dummy; do
8058   IFS=$ac_save_IFS
8059   test -z "$ac_dir" && ac_dir=.
8060   $as_executable_p "$ac_dir/$ac_word" || continue
8061 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8062 echo "$as_me:8062: found $ac_dir/$ac_word" >&5
8063 break
8064 done
8065
8066 fi
8067 fi
8068 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8069 if test -n "$ac_ct_NCURSES_CONFIG"; then
8070   echo "$as_me:8070: result: $ac_ct_NCURSES_CONFIG" >&5
8071 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8072 else
8073   echo "$as_me:8073: result: no" >&5
8074 echo "${ECHO_T}no" >&6
8075 fi
8076
8077   test -n "$ac_ct_NCURSES_CONFIG" && break
8078 done
8079 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8080
8081   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8082 fi
8083
8084         if test "$NCURSES_CONFIG" != none ; then
8085
8086                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8087
8088 cf_add_libs="`$NCURSES_CONFIG --libs`"
8089 # Filter out duplicates - this happens with badly-designed ".pc" files...
8090 for cf_add_1lib in $LIBS
8091 do
8092         for cf_add_2lib in $cf_add_libs
8093         do
8094                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8095                 then
8096                         cf_add_1lib=
8097                         break
8098                 fi
8099         done
8100         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8101 done
8102 LIBS="$cf_add_libs"
8103
8104                 # even with config script, some packages use no-override for curses.h
8105
8106 echo "$as_me:8106: checking if we have identified curses headers" >&5
8107 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8108 if test "${cf_cv_ncurses_header+set}" = set; then
8109   echo $ECHO_N "(cached) $ECHO_C" >&6
8110 else
8111
8112 cf_cv_ncurses_header=none
8113 for cf_header in \
8114         ncurses.h $cf_cv_screen/ncurses.h \
8115         curses.h $cf_cv_screen/curses.h
8116 do
8117 cat >conftest.$ac_ext <<_ACEOF
8118 #line 8118 "configure"
8119 #include "confdefs.h"
8120 #include <${cf_header}>
8121 int
8122 main ()
8123 {
8124 initscr(); tgoto("?", 0,0)
8125   ;
8126   return 0;
8127 }
8128 _ACEOF
8129 rm -f conftest.$ac_objext
8130 if { (eval echo "$as_me:8130: \"$ac_compile\"") >&5
8131   (eval $ac_compile) 2>&5
8132   ac_status=$?
8133   echo "$as_me:8133: \$? = $ac_status" >&5
8134   (exit $ac_status); } &&
8135          { ac_try='test -s conftest.$ac_objext'
8136   { (eval echo "$as_me:8136: \"$ac_try\"") >&5
8137   (eval $ac_try) 2>&5
8138   ac_status=$?
8139   echo "$as_me:8139: \$? = $ac_status" >&5
8140   (exit $ac_status); }; }; then
8141   cf_cv_ncurses_header=$cf_header; break
8142 else
8143   echo "$as_me: failed program was:" >&5
8144 cat conftest.$ac_ext >&5
8145 fi
8146 rm -f conftest.$ac_objext conftest.$ac_ext
8147 done
8148
8149 fi
8150 echo "$as_me:8150: result: $cf_cv_ncurses_header" >&5
8151 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8152
8153 if test "$cf_cv_ncurses_header" = none ; then
8154         { { echo "$as_me:8154: error: No curses header-files found" >&5
8155 echo "$as_me: error: No curses header-files found" >&2;}
8156    { (exit 1); exit 1; }; }
8157 fi
8158
8159 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8160
8161 for ac_header in $cf_cv_ncurses_header
8162 do
8163 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8164 echo "$as_me:8164: checking for $ac_header" >&5
8165 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8166 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8167   echo $ECHO_N "(cached) $ECHO_C" >&6
8168 else
8169   cat >conftest.$ac_ext <<_ACEOF
8170 #line 8170 "configure"
8171 #include "confdefs.h"
8172 #include <$ac_header>
8173 _ACEOF
8174 if { (eval echo "$as_me:8174: \"$ac_cpp conftest.$ac_ext\"") >&5
8175   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8176   ac_status=$?
8177   egrep -v '^ *\+' conftest.er1 >conftest.err
8178   rm -f conftest.er1
8179   cat conftest.err >&5
8180   echo "$as_me:8180: \$? = $ac_status" >&5
8181   (exit $ac_status); } >/dev/null; then
8182   if test -s conftest.err; then
8183     ac_cpp_err=$ac_c_preproc_warn_flag
8184   else
8185     ac_cpp_err=
8186   fi
8187 else
8188   ac_cpp_err=yes
8189 fi
8190 if test -z "$ac_cpp_err"; then
8191   eval "$as_ac_Header=yes"
8192 else
8193   echo "$as_me: failed program was:" >&5
8194   cat conftest.$ac_ext >&5
8195   eval "$as_ac_Header=no"
8196 fi
8197 rm -f conftest.err conftest.$ac_ext
8198 fi
8199 echo "$as_me:8199: result: `eval echo '${'$as_ac_Header'}'`" >&5
8200 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8201 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8202   cat >>confdefs.h <<EOF
8203 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8204 EOF
8205
8206 fi
8207 done
8208
8209 cat >>confdefs.h <<\EOF
8210 #define NCURSES 1
8211 EOF
8212
8213 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8214
8215                 cat >>confdefs.h <<EOF
8216 #define $cf_nculib_ROOT 1
8217 EOF
8218
8219                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8220
8221         else
8222
8223 cf_ncuhdr_root=$cf_cv_screen
8224
8225 test -n "$cf_cv_curses_dir" && \
8226 test "$cf_cv_curses_dir" != "no" && { \
8227
8228 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8229   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8230   do
8231         while test $cf_add_incdir != /usr/include
8232         do
8233           if test -d $cf_add_incdir
8234           then
8235                 cf_have_incdir=no
8236                 if test -n "$CFLAGS$CPPFLAGS" ; then
8237                   # a loop is needed to ensure we can add subdirs of existing dirs
8238                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8239                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8240                           cf_have_incdir=yes; break
8241                         fi
8242                   done
8243                 fi
8244
8245                 if test "$cf_have_incdir" = no ; then
8246                   if test "$cf_add_incdir" = /usr/local/include ; then
8247                         if test "$GCC" = yes
8248                         then
8249                           cf_save_CPPFLAGS=$CPPFLAGS
8250                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8251                           cat >conftest.$ac_ext <<_ACEOF
8252 #line 8252 "configure"
8253 #include "confdefs.h"
8254 #include <stdio.h>
8255 int
8256 main ()
8257 {
8258 printf("Hello")
8259   ;
8260   return 0;
8261 }
8262 _ACEOF
8263 rm -f conftest.$ac_objext
8264 if { (eval echo "$as_me:8264: \"$ac_compile\"") >&5
8265   (eval $ac_compile) 2>&5
8266   ac_status=$?
8267   echo "$as_me:8267: \$? = $ac_status" >&5
8268   (exit $ac_status); } &&
8269          { ac_try='test -s conftest.$ac_objext'
8270   { (eval echo "$as_me:8270: \"$ac_try\"") >&5
8271   (eval $ac_try) 2>&5
8272   ac_status=$?
8273   echo "$as_me:8273: \$? = $ac_status" >&5
8274   (exit $ac_status); }; }; then
8275   :
8276 else
8277   echo "$as_me: failed program was:" >&5
8278 cat conftest.$ac_ext >&5
8279 cf_have_incdir=yes
8280 fi
8281 rm -f conftest.$ac_objext conftest.$ac_ext
8282                           CPPFLAGS=$cf_save_CPPFLAGS
8283                         fi
8284                   fi
8285                 fi
8286
8287                 if test "$cf_have_incdir" = no ; then
8288                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8289
8290 echo "${as_me:-configure}:8290: testing adding $cf_add_incdir to include-path ..." 1>&5
8291
8292                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8293
8294                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8295                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8296                   cf_add_incdir="$cf_top_incdir"
8297                 else
8298                   break
8299                 fi
8300           else
8301                 break
8302           fi
8303         done
8304   done
8305 fi
8306
8307 }
8308
8309 echo "$as_me:8309: checking for $cf_ncuhdr_root header in include-path" >&5
8310 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8311 if test "${cf_cv_ncurses_h+set}" = set; then
8312   echo $ECHO_N "(cached) $ECHO_C" >&6
8313 else
8314
8315         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8316         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8317         for cf_header in $cf_header_list
8318         do
8319
8320         cat >conftest.$ac_ext <<_ACEOF
8321 #line 8321 "configure"
8322 #include "confdefs.h"
8323
8324 #include <$cf_header>
8325 int
8326 main ()
8327 {
8328
8329 #ifdef NCURSES_VERSION
8330
8331 printf("%s\n", NCURSES_VERSION);
8332 #else
8333 #ifdef __NCURSES_H
8334 printf("old\n");
8335 #else
8336         make an error
8337 #endif
8338 #endif
8339
8340   ;
8341   return 0;
8342 }
8343 _ACEOF
8344 rm -f conftest.$ac_objext
8345 if { (eval echo "$as_me:8345: \"$ac_compile\"") >&5
8346   (eval $ac_compile) 2>&5
8347   ac_status=$?
8348   echo "$as_me:8348: \$? = $ac_status" >&5
8349   (exit $ac_status); } &&
8350          { ac_try='test -s conftest.$ac_objext'
8351   { (eval echo "$as_me:8351: \"$ac_try\"") >&5
8352   (eval $ac_try) 2>&5
8353   ac_status=$?
8354   echo "$as_me:8354: \$? = $ac_status" >&5
8355   (exit $ac_status); }; }; then
8356   cf_cv_ncurses_h=$cf_header
8357
8358 else
8359   echo "$as_me: failed program was:" >&5
8360 cat conftest.$ac_ext >&5
8361 cf_cv_ncurses_h=no
8362 fi
8363 rm -f conftest.$ac_objext conftest.$ac_ext
8364
8365                 test "$cf_cv_ncurses_h" != no && break
8366         done
8367
8368 fi
8369 echo "$as_me:8369: result: $cf_cv_ncurses_h" >&5
8370 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8371
8372 if test "$cf_cv_ncurses_h" != no ; then
8373         cf_cv_ncurses_header=$cf_cv_ncurses_h
8374 else
8375
8376 echo "$as_me:8376: checking for $cf_ncuhdr_root include-path" >&5
8377 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8378 if test "${cf_cv_ncurses_h2+set}" = set; then
8379   echo $ECHO_N "(cached) $ECHO_C" >&6
8380 else
8381
8382         test -n "$verbose" && echo
8383
8384 cf_search=
8385
8386 # collect the current set of include-directories from compiler flags
8387 cf_header_path_list=""
8388 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8389         for cf_header_path in $CPPFLAGS $CFLAGS
8390         do
8391                 case $cf_header_path in
8392                 (-I*)
8393                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8394
8395 test "x$cf_header_path" != "xNONE" && \
8396 test -d "$cf_header_path" && \
8397  {
8398         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8399         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8400         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8401         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8402         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8403         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"
8404 }
8405
8406                         cf_header_path_list="$cf_header_path_list $cf_search"
8407                         ;;
8408                 esac
8409         done
8410 fi
8411
8412 # add the variations for the package we are looking for
8413
8414 cf_search=
8415
8416 test "x$prefix" != "xNONE" && \
8417 test -d "$prefix" && \
8418  {
8419         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8420         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8421         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8422         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8423         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8424         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8425 }
8426
8427 for cf_subdir_prefix in \
8428         /usr \
8429         /usr/local \
8430         /usr/pkg \
8431         /opt \
8432         /opt/local \
8433         $HOME
8434 do
8435
8436 test "x$cf_subdir_prefix" != "x$prefix" && \
8437 test -d "$cf_subdir_prefix" && \
8438 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8439         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8440         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8441         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8442         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8443         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8444         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8445 }
8446
8447 done
8448
8449 test "$includedir" != NONE && \
8450 test "$includedir" != "/usr/include" && \
8451 test -d "$includedir" && {
8452         test -d $includedir &&    cf_search="$cf_search $includedir"
8453         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8454 }
8455
8456 test "$oldincludedir" != NONE && \
8457 test "$oldincludedir" != "/usr/include" && \
8458 test -d "$oldincludedir" && {
8459         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8460         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8461 }
8462
8463 cf_search="$cf_search $cf_header_path_list"
8464
8465         test -n "$verbose" && echo search path $cf_search
8466         cf_save2_CPPFLAGS="$CPPFLAGS"
8467         for cf_incdir in $cf_search
8468         do
8469
8470 if test -n "$cf_incdir" ; then
8471   for cf_add_incdir in $cf_incdir
8472   do
8473         while test $cf_add_incdir != /usr/include
8474         do
8475           if test -d $cf_add_incdir
8476           then
8477                 cf_have_incdir=no
8478                 if test -n "$CFLAGS$CPPFLAGS" ; then
8479                   # a loop is needed to ensure we can add subdirs of existing dirs
8480                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8481                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8482                           cf_have_incdir=yes; break
8483                         fi
8484                   done
8485                 fi
8486
8487                 if test "$cf_have_incdir" = no ; then
8488                   if test "$cf_add_incdir" = /usr/local/include ; then
8489                         if test "$GCC" = yes
8490                         then
8491                           cf_save_CPPFLAGS=$CPPFLAGS
8492                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8493                           cat >conftest.$ac_ext <<_ACEOF
8494 #line 8494 "configure"
8495 #include "confdefs.h"
8496 #include <stdio.h>
8497 int
8498 main ()
8499 {
8500 printf("Hello")
8501   ;
8502   return 0;
8503 }
8504 _ACEOF
8505 rm -f conftest.$ac_objext
8506 if { (eval echo "$as_me:8506: \"$ac_compile\"") >&5
8507   (eval $ac_compile) 2>&5
8508   ac_status=$?
8509   echo "$as_me:8509: \$? = $ac_status" >&5
8510   (exit $ac_status); } &&
8511          { ac_try='test -s conftest.$ac_objext'
8512   { (eval echo "$as_me:8512: \"$ac_try\"") >&5
8513   (eval $ac_try) 2>&5
8514   ac_status=$?
8515   echo "$as_me:8515: \$? = $ac_status" >&5
8516   (exit $ac_status); }; }; then
8517   :
8518 else
8519   echo "$as_me: failed program was:" >&5
8520 cat conftest.$ac_ext >&5
8521 cf_have_incdir=yes
8522 fi
8523 rm -f conftest.$ac_objext conftest.$ac_ext
8524                           CPPFLAGS=$cf_save_CPPFLAGS
8525                         fi
8526                   fi
8527                 fi
8528
8529                 if test "$cf_have_incdir" = no ; then
8530                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8531
8532 echo "${as_me:-configure}:8532: testing adding $cf_add_incdir to include-path ..." 1>&5
8533
8534                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8535
8536                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8537                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8538                   cf_add_incdir="$cf_top_incdir"
8539                 else
8540                   break
8541                 fi
8542           else
8543                 break
8544           fi
8545         done
8546   done
8547 fi
8548
8549                 for cf_header in \
8550                         ncurses.h \
8551                         curses.h
8552                 do
8553
8554         cat >conftest.$ac_ext <<_ACEOF
8555 #line 8555 "configure"
8556 #include "confdefs.h"
8557
8558 #include <$cf_header>
8559 int
8560 main ()
8561 {
8562
8563 #ifdef NCURSES_VERSION
8564
8565 printf("%s\n", NCURSES_VERSION);
8566 #else
8567 #ifdef __NCURSES_H
8568 printf("old\n");
8569 #else
8570         make an error
8571 #endif
8572 #endif
8573
8574   ;
8575   return 0;
8576 }
8577 _ACEOF
8578 rm -f conftest.$ac_objext
8579 if { (eval echo "$as_me:8579: \"$ac_compile\"") >&5
8580   (eval $ac_compile) 2>&5
8581   ac_status=$?
8582   echo "$as_me:8582: \$? = $ac_status" >&5
8583   (exit $ac_status); } &&
8584          { ac_try='test -s conftest.$ac_objext'
8585   { (eval echo "$as_me:8585: \"$ac_try\"") >&5
8586   (eval $ac_try) 2>&5
8587   ac_status=$?
8588   echo "$as_me:8588: \$? = $ac_status" >&5
8589   (exit $ac_status); }; }; then
8590   cf_cv_ncurses_h2=$cf_header
8591
8592 else
8593   echo "$as_me: failed program was:" >&5
8594 cat conftest.$ac_ext >&5
8595 cf_cv_ncurses_h2=no
8596 fi
8597 rm -f conftest.$ac_objext conftest.$ac_ext
8598
8599                         if test "$cf_cv_ncurses_h2" != no ; then
8600                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8601                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8602                                 break
8603                         fi
8604                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8605                 done
8606                 CPPFLAGS="$cf_save2_CPPFLAGS"
8607                 test "$cf_cv_ncurses_h2" != no && break
8608         done
8609         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8609: error: not found" >&5
8610 echo "$as_me: error: not found" >&2;}
8611    { (exit 1); exit 1; }; }
8612
8613 fi
8614 echo "$as_me:8614: result: $cf_cv_ncurses_h2" >&5
8615 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8616
8617         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8618         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8619         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8620                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8621         fi
8622
8623 if test -n "$cf_1st_incdir" ; then
8624   for cf_add_incdir in $cf_1st_incdir
8625   do
8626         while test $cf_add_incdir != /usr/include
8627         do
8628           if test -d $cf_add_incdir
8629           then
8630                 cf_have_incdir=no
8631                 if test -n "$CFLAGS$CPPFLAGS" ; then
8632                   # a loop is needed to ensure we can add subdirs of existing dirs
8633                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8634                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8635                           cf_have_incdir=yes; break
8636                         fi
8637                   done
8638                 fi
8639
8640                 if test "$cf_have_incdir" = no ; then
8641                   if test "$cf_add_incdir" = /usr/local/include ; then
8642                         if test "$GCC" = yes
8643                         then
8644                           cf_save_CPPFLAGS=$CPPFLAGS
8645                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8646                           cat >conftest.$ac_ext <<_ACEOF
8647 #line 8647 "configure"
8648 #include "confdefs.h"
8649 #include <stdio.h>
8650 int
8651 main ()
8652 {
8653 printf("Hello")
8654   ;
8655   return 0;
8656 }
8657 _ACEOF
8658 rm -f conftest.$ac_objext
8659 if { (eval echo "$as_me:8659: \"$ac_compile\"") >&5
8660   (eval $ac_compile) 2>&5
8661   ac_status=$?
8662   echo "$as_me:8662: \$? = $ac_status" >&5
8663   (exit $ac_status); } &&
8664          { ac_try='test -s conftest.$ac_objext'
8665   { (eval echo "$as_me:8665: \"$ac_try\"") >&5
8666   (eval $ac_try) 2>&5
8667   ac_status=$?
8668   echo "$as_me:8668: \$? = $ac_status" >&5
8669   (exit $ac_status); }; }; then
8670   :
8671 else
8672   echo "$as_me: failed program was:" >&5
8673 cat conftest.$ac_ext >&5
8674 cf_have_incdir=yes
8675 fi
8676 rm -f conftest.$ac_objext conftest.$ac_ext
8677                           CPPFLAGS=$cf_save_CPPFLAGS
8678                         fi
8679                   fi
8680                 fi
8681
8682                 if test "$cf_have_incdir" = no ; then
8683                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8684
8685 echo "${as_me:-configure}:8685: testing adding $cf_add_incdir to include-path ..." 1>&5
8686
8687                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8688
8689                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8690                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8691                   cf_add_incdir="$cf_top_incdir"
8692                 else
8693                   break
8694                 fi
8695           else
8696                 break
8697           fi
8698         done
8699   done
8700 fi
8701
8702 fi
8703
8704 # Set definitions to allow ifdef'ing for ncurses.h
8705
8706 case $cf_cv_ncurses_header in
8707 (*ncurses.h)
8708
8709 cat >>confdefs.h <<\EOF
8710 #define HAVE_NCURSES_H 1
8711 EOF
8712
8713         ;;
8714 esac
8715
8716 case $cf_cv_ncurses_header in
8717 (ncurses/curses.h|ncurses/ncurses.h)
8718
8719 cat >>confdefs.h <<\EOF
8720 #define HAVE_NCURSES_NCURSES_H 1
8721 EOF
8722
8723         ;;
8724 (ncursesw/curses.h|ncursesw/ncurses.h)
8725
8726 cat >>confdefs.h <<\EOF
8727 #define HAVE_NCURSESW_NCURSES_H 1
8728 EOF
8729
8730         ;;
8731 esac
8732
8733 echo "$as_me:8733: checking for terminfo header" >&5
8734 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8735 if test "${cf_cv_term_header+set}" = set; then
8736   echo $ECHO_N "(cached) $ECHO_C" >&6
8737 else
8738
8739 case ${cf_cv_ncurses_header} in
8740 (*/ncurses.h|*/ncursesw.h)
8741         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8742         ;;
8743 (*)
8744         cf_term_header=term.h
8745         ;;
8746 esac
8747
8748 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8749 do
8750 cat >conftest.$ac_ext <<_ACEOF
8751 #line 8751 "configure"
8752 #include "confdefs.h"
8753 #include <stdio.h>
8754 #include <${cf_cv_ncurses_header:-curses.h}>
8755 #include <$cf_test>
8756
8757 int
8758 main ()
8759 {
8760 int x = auto_left_margin
8761   ;
8762   return 0;
8763 }
8764 _ACEOF
8765 rm -f conftest.$ac_objext
8766 if { (eval echo "$as_me:8766: \"$ac_compile\"") >&5
8767   (eval $ac_compile) 2>&5
8768   ac_status=$?
8769   echo "$as_me:8769: \$? = $ac_status" >&5
8770   (exit $ac_status); } &&
8771          { ac_try='test -s conftest.$ac_objext'
8772   { (eval echo "$as_me:8772: \"$ac_try\"") >&5
8773   (eval $ac_try) 2>&5
8774   ac_status=$?
8775   echo "$as_me:8775: \$? = $ac_status" >&5
8776   (exit $ac_status); }; }; then
8777
8778         cf_cv_term_header="$cf_test"
8779 else
8780   echo "$as_me: failed program was:" >&5
8781 cat conftest.$ac_ext >&5
8782
8783         cf_cv_term_header=unknown
8784
8785 fi
8786 rm -f conftest.$ac_objext conftest.$ac_ext
8787         test "$cf_cv_term_header" != unknown && break
8788 done
8789
8790 fi
8791 echo "$as_me:8791: result: $cf_cv_term_header" >&5
8792 echo "${ECHO_T}$cf_cv_term_header" >&6
8793
8794 # Set definitions to allow ifdef'ing to accommodate subdirectories
8795
8796 case $cf_cv_term_header in
8797 (*term.h)
8798
8799 cat >>confdefs.h <<\EOF
8800 #define HAVE_TERM_H 1
8801 EOF
8802
8803         ;;
8804 esac
8805
8806 case $cf_cv_term_header in
8807 (ncurses/term.h)
8808
8809 cat >>confdefs.h <<\EOF
8810 #define HAVE_NCURSES_TERM_H 1
8811 EOF
8812
8813         ;;
8814 (ncursesw/term.h)
8815
8816 cat >>confdefs.h <<\EOF
8817 #define HAVE_NCURSESW_TERM_H 1
8818 EOF
8819
8820         ;;
8821 esac
8822
8823 # some applications need this, but should check for NCURSES_VERSION
8824
8825 cat >>confdefs.h <<\EOF
8826 #define NCURSES 1
8827 EOF
8828
8829 echo "$as_me:8829: checking for ncurses version" >&5
8830 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8831 if test "${cf_cv_ncurses_version+set}" = set; then
8832   echo $ECHO_N "(cached) $ECHO_C" >&6
8833 else
8834
8835         cf_cv_ncurses_version=no
8836         cf_tempfile=out$$
8837         rm -f $cf_tempfile
8838         if test "$cross_compiling" = yes; then
8839
8840         # This will not work if the preprocessor splits the line after the
8841         # Autoconf token.  The 'unproto' program does that.
8842         cat > conftest.$ac_ext <<EOF
8843 #include <${cf_cv_ncurses_header:-curses.h}>
8844 #undef Autoconf
8845 #ifdef NCURSES_VERSION
8846 Autoconf NCURSES_VERSION
8847 #else
8848 #ifdef __NCURSES_H
8849 Autoconf "old"
8850 #endif
8851 ;
8852 #endif
8853 EOF
8854         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8855         { (eval echo "$as_me:8855: \"$cf_try\"") >&5
8856   (eval $cf_try) 2>&5
8857   ac_status=$?
8858   echo "$as_me:8858: \$? = $ac_status" >&5
8859   (exit $ac_status); }
8860         if test -f conftest.out ; then
8861                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8862                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8863                 rm -f conftest.out
8864         fi
8865
8866 else
8867   cat >conftest.$ac_ext <<_ACEOF
8868 #line 8868 "configure"
8869 #include "confdefs.h"
8870
8871 #include <${cf_cv_ncurses_header:-curses.h}>
8872 #include <stdio.h>
8873 int main()
8874 {
8875         FILE *fp = fopen("$cf_tempfile", "w");
8876 #ifdef NCURSES_VERSION
8877 # ifdef NCURSES_VERSION_PATCH
8878         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8879 # else
8880         fprintf(fp, "%s\n", NCURSES_VERSION);
8881 # endif
8882 #else
8883 # ifdef __NCURSES_H
8884         fprintf(fp, "old\n");
8885 # else
8886         make an error
8887 # endif
8888 #endif
8889         ${cf_cv_main_return:-return}(0);
8890 }
8891 _ACEOF
8892 rm -f conftest$ac_exeext
8893 if { (eval echo "$as_me:8893: \"$ac_link\"") >&5
8894   (eval $ac_link) 2>&5
8895   ac_status=$?
8896   echo "$as_me:8896: \$? = $ac_status" >&5
8897   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8898   { (eval echo "$as_me:8898: \"$ac_try\"") >&5
8899   (eval $ac_try) 2>&5
8900   ac_status=$?
8901   echo "$as_me:8901: \$? = $ac_status" >&5
8902   (exit $ac_status); }; }; then
8903
8904         cf_cv_ncurses_version=`cat $cf_tempfile`
8905 else
8906   echo "$as_me: program exited with status $ac_status" >&5
8907 echo "$as_me: failed program was:" >&5
8908 cat conftest.$ac_ext >&5
8909 fi
8910 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8911 fi
8912         rm -f $cf_tempfile
8913
8914 fi
8915 echo "$as_me:8915: result: $cf_cv_ncurses_version" >&5
8916 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8917 test "$cf_cv_ncurses_version" = no ||
8918 cat >>confdefs.h <<\EOF
8919 #define NCURSES 1
8920 EOF
8921
8922 cf_nculib_root=$cf_cv_screen
8923         # This works, except for the special case where we find gpm, but
8924         # ncurses is in a nonstandard location via $LIBS, and we really want
8925         # to link gpm.
8926 cf_ncurses_LIBS=""
8927 cf_ncurses_SAVE="$LIBS"
8928 echo "$as_me:8928: checking for Gpm_Open in -lgpm" >&5
8929 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8930 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8931   echo $ECHO_N "(cached) $ECHO_C" >&6
8932 else
8933   ac_check_lib_save_LIBS=$LIBS
8934 LIBS="-lgpm  $LIBS"
8935 cat >conftest.$ac_ext <<_ACEOF
8936 #line 8936 "configure"
8937 #include "confdefs.h"
8938
8939 /* Override any gcc2 internal prototype to avoid an error.  */
8940 #ifdef __cplusplus
8941 extern "C"
8942 #endif
8943 /* We use char because int might match the return type of a gcc2
8944    builtin and then its argument prototype would still apply.  */
8945 char Gpm_Open ();
8946 int
8947 main ()
8948 {
8949 Gpm_Open ();
8950   ;
8951   return 0;
8952 }
8953 _ACEOF
8954 rm -f conftest.$ac_objext conftest$ac_exeext
8955 if { (eval echo "$as_me:8955: \"$ac_link\"") >&5
8956   (eval $ac_link) 2>&5
8957   ac_status=$?
8958   echo "$as_me:8958: \$? = $ac_status" >&5
8959   (exit $ac_status); } &&
8960          { ac_try='test -s conftest$ac_exeext'
8961   { (eval echo "$as_me:8961: \"$ac_try\"") >&5
8962   (eval $ac_try) 2>&5
8963   ac_status=$?
8964   echo "$as_me:8964: \$? = $ac_status" >&5
8965   (exit $ac_status); }; }; then
8966   ac_cv_lib_gpm_Gpm_Open=yes
8967 else
8968   echo "$as_me: failed program was:" >&5
8969 cat conftest.$ac_ext >&5
8970 ac_cv_lib_gpm_Gpm_Open=no
8971 fi
8972 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8973 LIBS=$ac_check_lib_save_LIBS
8974 fi
8975 echo "$as_me:8975: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8976 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8977 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8978   echo "$as_me:8978: checking for initscr in -lgpm" >&5
8979 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8980 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8981   echo $ECHO_N "(cached) $ECHO_C" >&6
8982 else
8983   ac_check_lib_save_LIBS=$LIBS
8984 LIBS="-lgpm  $LIBS"
8985 cat >conftest.$ac_ext <<_ACEOF
8986 #line 8986 "configure"
8987 #include "confdefs.h"
8988
8989 /* Override any gcc2 internal prototype to avoid an error.  */
8990 #ifdef __cplusplus
8991 extern "C"
8992 #endif
8993 /* We use char because int might match the return type of a gcc2
8994    builtin and then its argument prototype would still apply.  */
8995 char initscr ();
8996 int
8997 main ()
8998 {
8999 initscr ();
9000   ;
9001   return 0;
9002 }
9003 _ACEOF
9004 rm -f conftest.$ac_objext conftest$ac_exeext
9005 if { (eval echo "$as_me:9005: \"$ac_link\"") >&5
9006   (eval $ac_link) 2>&5
9007   ac_status=$?
9008   echo "$as_me:9008: \$? = $ac_status" >&5
9009   (exit $ac_status); } &&
9010          { ac_try='test -s conftest$ac_exeext'
9011   { (eval echo "$as_me:9011: \"$ac_try\"") >&5
9012   (eval $ac_try) 2>&5
9013   ac_status=$?
9014   echo "$as_me:9014: \$? = $ac_status" >&5
9015   (exit $ac_status); }; }; then
9016   ac_cv_lib_gpm_initscr=yes
9017 else
9018   echo "$as_me: failed program was:" >&5
9019 cat conftest.$ac_ext >&5
9020 ac_cv_lib_gpm_initscr=no
9021 fi
9022 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9023 LIBS=$ac_check_lib_save_LIBS
9024 fi
9025 echo "$as_me:9025: result: $ac_cv_lib_gpm_initscr" >&5
9026 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9027 if test $ac_cv_lib_gpm_initscr = yes; then
9028   LIBS="$cf_ncurses_SAVE"
9029 else
9030   cf_ncurses_LIBS="-lgpm"
9031 fi
9032
9033 fi
9034
9035 case $host_os in
9036 (freebsd*)
9037         # This is only necessary if you are linking against an obsolete
9038         # version of ncurses (but it should do no harm, since it's static).
9039         if test "$cf_nculib_root" = ncurses ; then
9040                 echo "$as_me:9040: checking for tgoto in -lmytinfo" >&5
9041 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9042 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9043   echo $ECHO_N "(cached) $ECHO_C" >&6
9044 else
9045   ac_check_lib_save_LIBS=$LIBS
9046 LIBS="-lmytinfo  $LIBS"
9047 cat >conftest.$ac_ext <<_ACEOF
9048 #line 9048 "configure"
9049 #include "confdefs.h"
9050
9051 /* Override any gcc2 internal prototype to avoid an error.  */
9052 #ifdef __cplusplus
9053 extern "C"
9054 #endif
9055 /* We use char because int might match the return type of a gcc2
9056    builtin and then its argument prototype would still apply.  */
9057 char tgoto ();
9058 int
9059 main ()
9060 {
9061 tgoto ();
9062   ;
9063   return 0;
9064 }
9065 _ACEOF
9066 rm -f conftest.$ac_objext conftest$ac_exeext
9067 if { (eval echo "$as_me:9067: \"$ac_link\"") >&5
9068   (eval $ac_link) 2>&5
9069   ac_status=$?
9070   echo "$as_me:9070: \$? = $ac_status" >&5
9071   (exit $ac_status); } &&
9072          { ac_try='test -s conftest$ac_exeext'
9073   { (eval echo "$as_me:9073: \"$ac_try\"") >&5
9074   (eval $ac_try) 2>&5
9075   ac_status=$?
9076   echo "$as_me:9076: \$? = $ac_status" >&5
9077   (exit $ac_status); }; }; then
9078   ac_cv_lib_mytinfo_tgoto=yes
9079 else
9080   echo "$as_me: failed program was:" >&5
9081 cat conftest.$ac_ext >&5
9082 ac_cv_lib_mytinfo_tgoto=no
9083 fi
9084 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9085 LIBS=$ac_check_lib_save_LIBS
9086 fi
9087 echo "$as_me:9087: result: $ac_cv_lib_mytinfo_tgoto" >&5
9088 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9089 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9090   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9091 fi
9092
9093         fi
9094         ;;
9095 esac
9096
9097 cf_add_libs="$cf_ncurses_LIBS"
9098 # Filter out duplicates - this happens with badly-designed ".pc" files...
9099 for cf_add_1lib in $LIBS
9100 do
9101         for cf_add_2lib in $cf_add_libs
9102         do
9103                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9104                 then
9105                         cf_add_1lib=
9106                         break
9107                 fi
9108         done
9109         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9110 done
9111 LIBS="$cf_add_libs"
9112
9113 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9114 then
9115
9116 cf_add_libs="-l$cf_nculib_root"
9117 # Filter out duplicates - this happens with badly-designed ".pc" files...
9118 for cf_add_1lib in $LIBS
9119 do
9120         for cf_add_2lib in $cf_add_libs
9121         do
9122                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9123                 then
9124                         cf_add_1lib=
9125                         break
9126                 fi
9127         done
9128         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9129 done
9130 LIBS="$cf_add_libs"
9131
9132 else
9133
9134         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9135         cf_libdir=""
9136         echo "$as_me:9136: checking for initscr" >&5
9137 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9138 if test "${ac_cv_func_initscr+set}" = set; then
9139   echo $ECHO_N "(cached) $ECHO_C" >&6
9140 else
9141   cat >conftest.$ac_ext <<_ACEOF
9142 #line 9142 "configure"
9143 #include "confdefs.h"
9144 /* System header to define __stub macros and hopefully few prototypes,
9145     which can conflict with char initscr (); below.  */
9146 #include <assert.h>
9147 /* Override any gcc2 internal prototype to avoid an error.  */
9148 #ifdef __cplusplus
9149 extern "C"
9150 #endif
9151 /* We use char because int might match the return type of a gcc2
9152    builtin and then its argument prototype would still apply.  */
9153 char initscr ();
9154 char (*f) ();
9155
9156 int
9157 main ()
9158 {
9159 /* The GNU C library defines this for functions which it implements
9160     to always fail with ENOSYS.  Some functions are actually named
9161     something starting with __ and the normal name is an alias.  */
9162 #if defined (__stub_initscr) || defined (__stub___initscr)
9163 choke me
9164 #else
9165 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9166 #endif
9167
9168   ;
9169   return 0;
9170 }
9171 _ACEOF
9172 rm -f conftest.$ac_objext conftest$ac_exeext
9173 if { (eval echo "$as_me:9173: \"$ac_link\"") >&5
9174   (eval $ac_link) 2>&5
9175   ac_status=$?
9176   echo "$as_me:9176: \$? = $ac_status" >&5
9177   (exit $ac_status); } &&
9178          { ac_try='test -s conftest$ac_exeext'
9179   { (eval echo "$as_me:9179: \"$ac_try\"") >&5
9180   (eval $ac_try) 2>&5
9181   ac_status=$?
9182   echo "$as_me:9182: \$? = $ac_status" >&5
9183   (exit $ac_status); }; }; then
9184   ac_cv_func_initscr=yes
9185 else
9186   echo "$as_me: failed program was:" >&5
9187 cat conftest.$ac_ext >&5
9188 ac_cv_func_initscr=no
9189 fi
9190 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9191 fi
9192 echo "$as_me:9192: result: $ac_cv_func_initscr" >&5
9193 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9194 if test $ac_cv_func_initscr = yes; then
9195   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9196 else
9197
9198                 cf_save_LIBS="$LIBS"
9199                 echo "$as_me:9199: checking for initscr in -l$cf_nculib_root" >&5
9200 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9201                 LIBS="-l$cf_nculib_root $LIBS"
9202                 cat >conftest.$ac_ext <<_ACEOF
9203 #line 9203 "configure"
9204 #include "confdefs.h"
9205 #include <${cf_cv_ncurses_header:-curses.h}>
9206 int
9207 main ()
9208 {
9209 initscr()
9210   ;
9211   return 0;
9212 }
9213 _ACEOF
9214 rm -f conftest.$ac_objext conftest$ac_exeext
9215 if { (eval echo "$as_me:9215: \"$ac_link\"") >&5
9216   (eval $ac_link) 2>&5
9217   ac_status=$?
9218   echo "$as_me:9218: \$? = $ac_status" >&5
9219   (exit $ac_status); } &&
9220          { ac_try='test -s conftest$ac_exeext'
9221   { (eval echo "$as_me:9221: \"$ac_try\"") >&5
9222   (eval $ac_try) 2>&5
9223   ac_status=$?
9224   echo "$as_me:9224: \$? = $ac_status" >&5
9225   (exit $ac_status); }; }; then
9226   echo "$as_me:9226: result: yes" >&5
9227 echo "${ECHO_T}yes" >&6
9228                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9229
9230 else
9231   echo "$as_me: failed program was:" >&5
9232 cat conftest.$ac_ext >&5
9233 echo "$as_me:9233: result: no" >&5
9234 echo "${ECHO_T}no" >&6
9235
9236 cf_search=
9237 cf_library_path_list=""
9238 if test -n "${LDFLAGS}${LIBS}" ; then
9239         for cf_library_path in $LDFLAGS $LIBS
9240         do
9241                 case $cf_library_path in
9242                 (-L*)
9243                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9244
9245 test "x$cf_library_path" != "xNONE" && \
9246 test -d "$cf_library_path" && \
9247  {
9248         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9249         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9250         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9251         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9252         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9253         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"
9254 }
9255
9256                         cf_library_path_list="$cf_library_path_list $cf_search"
9257                         ;;
9258                 esac
9259         done
9260 fi
9261
9262 cf_search=
9263
9264 test "x$prefix" != "xNONE" && \
9265 test -d "$prefix" && \
9266  {
9267         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9268         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9269         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9270         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9271         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9272         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9273 }
9274
9275 for cf_subdir_prefix in \
9276         /usr \
9277         /usr/local \
9278         /usr/pkg \
9279         /opt \
9280         /opt/local \
9281         $HOME
9282 do
9283
9284 test "x$cf_subdir_prefix" != "x$prefix" && \
9285 test -d "$cf_subdir_prefix" && \
9286 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9287         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9288         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9289         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9290         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9291         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9292         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
9293 }
9294
9295 done
9296
9297 cf_search="$cf_library_path_list $cf_search"
9298
9299                         for cf_libdir in $cf_search
9300                         do
9301                                 echo "$as_me:9301: checking for -l$cf_nculib_root in $cf_libdir" >&5
9302 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9303                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9304                                 cat >conftest.$ac_ext <<_ACEOF
9305 #line 9305 "configure"
9306 #include "confdefs.h"
9307 #include <${cf_cv_ncurses_header:-curses.h}>
9308 int
9309 main ()
9310 {
9311 initscr()
9312   ;
9313   return 0;
9314 }
9315 _ACEOF
9316 rm -f conftest.$ac_objext conftest$ac_exeext
9317 if { (eval echo "$as_me:9317: \"$ac_link\"") >&5
9318   (eval $ac_link) 2>&5
9319   ac_status=$?
9320   echo "$as_me:9320: \$? = $ac_status" >&5
9321   (exit $ac_status); } &&
9322          { ac_try='test -s conftest$ac_exeext'
9323   { (eval echo "$as_me:9323: \"$ac_try\"") >&5
9324   (eval $ac_try) 2>&5
9325   ac_status=$?
9326   echo "$as_me:9326: \$? = $ac_status" >&5
9327   (exit $ac_status); }; }; then
9328   echo "$as_me:9328: result: yes" >&5
9329 echo "${ECHO_T}yes" >&6
9330                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9331                                          break
9332 else
9333   echo "$as_me: failed program was:" >&5
9334 cat conftest.$ac_ext >&5
9335 echo "$as_me:9335: result: no" >&5
9336 echo "${ECHO_T}no" >&6
9337                                          LIBS="$cf_save_LIBS"
9338 fi
9339 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9340                         done
9341
9342 fi
9343 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9344
9345 fi
9346
9347 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9348
9349 if test $cf_found_library = no ; then
9350         { { echo "$as_me:9350: error: Cannot link $cf_nculib_root library" >&5
9351 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9352    { (exit 1); exit 1; }; }
9353 fi
9354
9355 fi
9356
9357 if test -n "$cf_ncurses_LIBS" ; then
9358         echo "$as_me:9358: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9359 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9360         cf_ncurses_SAVE="$LIBS"
9361         for p in $cf_ncurses_LIBS ; do
9362                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9363                 if test "$q" != "$LIBS" ; then
9364                         LIBS="$q"
9365                 fi
9366         done
9367         cat >conftest.$ac_ext <<_ACEOF
9368 #line 9368 "configure"
9369 #include "confdefs.h"
9370 #include <${cf_cv_ncurses_header:-curses.h}>
9371 int
9372 main ()
9373 {
9374 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9375   ;
9376   return 0;
9377 }
9378 _ACEOF
9379 rm -f conftest.$ac_objext conftest$ac_exeext
9380 if { (eval echo "$as_me:9380: \"$ac_link\"") >&5
9381   (eval $ac_link) 2>&5
9382   ac_status=$?
9383   echo "$as_me:9383: \$? = $ac_status" >&5
9384   (exit $ac_status); } &&
9385          { ac_try='test -s conftest$ac_exeext'
9386   { (eval echo "$as_me:9386: \"$ac_try\"") >&5
9387   (eval $ac_try) 2>&5
9388   ac_status=$?
9389   echo "$as_me:9389: \$? = $ac_status" >&5
9390   (exit $ac_status); }; }; then
9391   echo "$as_me:9391: result: yes" >&5
9392 echo "${ECHO_T}yes" >&6
9393 else
9394   echo "$as_me: failed program was:" >&5
9395 cat conftest.$ac_ext >&5
9396 echo "$as_me:9396: result: no" >&5
9397 echo "${ECHO_T}no" >&6
9398                  LIBS="$cf_ncurses_SAVE"
9399 fi
9400 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9401 fi
9402
9403 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9404
9405 cat >>confdefs.h <<EOF
9406 #define $cf_nculib_ROOT 1
9407 EOF
9408
9409         fi
9410 else
9411         NCURSES_CONFIG=none
9412 fi
9413
9414         ;;
9415 (pdcurses)
9416         echo "$as_me:9416: checking for X" >&5
9417 echo $ECHO_N "checking for X... $ECHO_C" >&6
9418
9419 # Check whether --with-x or --without-x was given.
9420 if test "${with_x+set}" = set; then
9421   withval="$with_x"
9422
9423 fi;
9424 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9425 if test "x$with_x" = xno; then
9426   # The user explicitly disabled X.
9427   have_x=disabled
9428 else
9429   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9430     # Both variables are already set.
9431     have_x=yes
9432   else
9433     if test "${ac_cv_have_x+set}" = set; then
9434   echo $ECHO_N "(cached) $ECHO_C" >&6
9435 else
9436   # One or both of the vars are not set, and there is no cached value.
9437 ac_x_includes=no ac_x_libraries=no
9438 rm -fr conftest.dir
9439 if mkdir conftest.dir; then
9440   cd conftest.dir
9441   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9442   cat >Imakefile <<'EOF'
9443 acfindx:
9444         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9445 EOF
9446   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9447     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9448     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9449     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9450     for ac_extension in a so sl dylib dll; do
9451       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9452          test -f $ac_im_libdir/libX11.$ac_extension; then
9453         ac_im_usrlibdir=$ac_im_libdir; break
9454       fi
9455     done
9456     # Screen out bogus values from the imake configuration.  They are
9457     # bogus both because they are the default anyway, and because
9458     # using them would break gcc on systems where it needs fixed includes.
9459     case $ac_im_incroot in
9460         /usr/include) ;;
9461         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9462     esac
9463     case $ac_im_usrlibdir in
9464         /usr/lib | /lib) ;;
9465         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9466     esac
9467   fi
9468   cd ..
9469   rm -fr conftest.dir
9470 fi
9471
9472 # Standard set of common directories for X headers.
9473 # Check X11 before X11Rn because it is often a symlink to the current release.
9474 ac_x_header_dirs='
9475 /usr/X11/include
9476 /usr/X11R6/include
9477 /usr/X11R5/include
9478 /usr/X11R4/include
9479
9480 /usr/include/X11
9481 /usr/include/X11R6
9482 /usr/include/X11R5
9483 /usr/include/X11R4
9484
9485 /usr/local/X11/include
9486 /usr/local/X11R6/include
9487 /usr/local/X11R5/include
9488 /usr/local/X11R4/include
9489
9490 /usr/local/include/X11
9491 /usr/local/include/X11R6
9492 /usr/local/include/X11R5
9493 /usr/local/include/X11R4
9494
9495 /usr/X386/include
9496 /usr/x386/include
9497 /usr/XFree86/include/X11
9498
9499 /usr/include
9500 /usr/local/include
9501 /usr/unsupported/include
9502 /usr/athena/include
9503 /usr/local/x11r5/include
9504 /usr/lpp/Xamples/include
9505
9506 /usr/openwin/include
9507 /usr/openwin/share/include'
9508
9509 if test "$ac_x_includes" = no; then
9510   # Guess where to find include files, by looking for Intrinsic.h.
9511   # First, try using that file with no special directory specified.
9512   cat >conftest.$ac_ext <<_ACEOF
9513 #line 9513 "configure"
9514 #include "confdefs.h"
9515 #include <X11/Intrinsic.h>
9516 _ACEOF
9517 if { (eval echo "$as_me:9517: \"$ac_cpp conftest.$ac_ext\"") >&5
9518   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9519   ac_status=$?
9520   egrep -v '^ *\+' conftest.er1 >conftest.err
9521   rm -f conftest.er1
9522   cat conftest.err >&5
9523   echo "$as_me:9523: \$? = $ac_status" >&5
9524   (exit $ac_status); } >/dev/null; then
9525   if test -s conftest.err; then
9526     ac_cpp_err=$ac_c_preproc_warn_flag
9527   else
9528     ac_cpp_err=
9529   fi
9530 else
9531   ac_cpp_err=yes
9532 fi
9533 if test -z "$ac_cpp_err"; then
9534   # We can compile using X headers with no special include directory.
9535 ac_x_includes=
9536 else
9537   echo "$as_me: failed program was:" >&5
9538   cat conftest.$ac_ext >&5
9539   for ac_dir in $ac_x_header_dirs; do
9540   if test -r "$ac_dir/X11/Intrinsic.h"; then
9541     ac_x_includes=$ac_dir
9542     break
9543   fi
9544 done
9545 fi
9546 rm -f conftest.err conftest.$ac_ext
9547 fi # $ac_x_includes = no
9548
9549 if test "$ac_x_libraries" = no; then
9550   # Check for the libraries.
9551   # See if we find them without any special options.
9552   # Don't add to $LIBS permanently.
9553   ac_save_LIBS=$LIBS
9554   LIBS="-lXt $LIBS"
9555   cat >conftest.$ac_ext <<_ACEOF
9556 #line 9556 "configure"
9557 #include "confdefs.h"
9558 #include <X11/Intrinsic.h>
9559 int
9560 main ()
9561 {
9562 XtMalloc (0)
9563   ;
9564   return 0;
9565 }
9566 _ACEOF
9567 rm -f conftest.$ac_objext conftest$ac_exeext
9568 if { (eval echo "$as_me:9568: \"$ac_link\"") >&5
9569   (eval $ac_link) 2>&5
9570   ac_status=$?
9571   echo "$as_me:9571: \$? = $ac_status" >&5
9572   (exit $ac_status); } &&
9573          { ac_try='test -s conftest$ac_exeext'
9574   { (eval echo "$as_me:9574: \"$ac_try\"") >&5
9575   (eval $ac_try) 2>&5
9576   ac_status=$?
9577   echo "$as_me:9577: \$? = $ac_status" >&5
9578   (exit $ac_status); }; }; then
9579   LIBS=$ac_save_LIBS
9580 # We can link X programs with no special library path.
9581 ac_x_libraries=
9582 else
9583   echo "$as_me: failed program was:" >&5
9584 cat conftest.$ac_ext >&5
9585 LIBS=$ac_save_LIBS
9586 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9587 do
9588   # Don't even attempt the hair of trying to link an X program!
9589   for ac_extension in a so sl dylib dll; do
9590     if test -r $ac_dir/libXt.$ac_extension; then
9591       ac_x_libraries=$ac_dir
9592       break 2
9593     fi
9594   done
9595 done
9596 fi
9597 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9598 fi # $ac_x_libraries = no
9599
9600 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9601   # Didn't find X anywhere.  Cache the known absence of X.
9602   ac_cv_have_x="have_x=no"
9603 else
9604   # Record where we found X for the cache.
9605   ac_cv_have_x="have_x=yes \
9606                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9607 fi
9608 fi
9609
9610   fi
9611   eval "$ac_cv_have_x"
9612 fi # $with_x != no
9613
9614 if test "$have_x" != yes; then
9615   echo "$as_me:9615: result: $have_x" >&5
9616 echo "${ECHO_T}$have_x" >&6
9617   no_x=yes
9618 else
9619   # If each of the values was on the command line, it overrides each guess.
9620   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9621   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9622   # Update the cache value to reflect the command line values.
9623   ac_cv_have_x="have_x=yes \
9624                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9625   echo "$as_me:9625: result: libraries $x_libraries, headers $x_includes" >&5
9626 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9627 fi
9628
9629 if test "$no_x" = yes; then
9630   # Not all programs may use this symbol, but it does not hurt to define it.
9631
9632 cat >>confdefs.h <<\EOF
9633 #define X_DISPLAY_MISSING 1
9634 EOF
9635
9636   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9637 else
9638   if test -n "$x_includes"; then
9639     X_CFLAGS="$X_CFLAGS -I$x_includes"
9640   fi
9641
9642   # It would also be nice to do this for all -L options, not just this one.
9643   if test -n "$x_libraries"; then
9644     X_LIBS="$X_LIBS -L$x_libraries"
9645     # For Solaris; some versions of Sun CC require a space after -R and
9646     # others require no space.  Words are not sufficient . . . .
9647     case `(uname -sr) 2>/dev/null` in
9648     "SunOS 5"*)
9649       echo "$as_me:9649: checking whether -R must be followed by a space" >&5
9650 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9651       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9652       cat >conftest.$ac_ext <<_ACEOF
9653 #line 9653 "configure"
9654 #include "confdefs.h"
9655
9656 int
9657 main ()
9658 {
9659
9660   ;
9661   return 0;
9662 }
9663 _ACEOF
9664 rm -f conftest.$ac_objext conftest$ac_exeext
9665 if { (eval echo "$as_me:9665: \"$ac_link\"") >&5
9666   (eval $ac_link) 2>&5
9667   ac_status=$?
9668   echo "$as_me:9668: \$? = $ac_status" >&5
9669   (exit $ac_status); } &&
9670          { ac_try='test -s conftest$ac_exeext'
9671   { (eval echo "$as_me:9671: \"$ac_try\"") >&5
9672   (eval $ac_try) 2>&5
9673   ac_status=$?
9674   echo "$as_me:9674: \$? = $ac_status" >&5
9675   (exit $ac_status); }; }; then
9676   ac_R_nospace=yes
9677 else
9678   echo "$as_me: failed program was:" >&5
9679 cat conftest.$ac_ext >&5
9680 ac_R_nospace=no
9681 fi
9682 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9683       if test $ac_R_nospace = yes; then
9684         echo "$as_me:9684: result: no" >&5
9685 echo "${ECHO_T}no" >&6
9686         X_LIBS="$X_LIBS -R$x_libraries"
9687       else
9688         LIBS="$ac_xsave_LIBS -R $x_libraries"
9689         cat >conftest.$ac_ext <<_ACEOF
9690 #line 9690 "configure"
9691 #include "confdefs.h"
9692
9693 int
9694 main ()
9695 {
9696
9697   ;
9698   return 0;
9699 }
9700 _ACEOF
9701 rm -f conftest.$ac_objext conftest$ac_exeext
9702 if { (eval echo "$as_me:9702: \"$ac_link\"") >&5
9703   (eval $ac_link) 2>&5
9704   ac_status=$?
9705   echo "$as_me:9705: \$? = $ac_status" >&5
9706   (exit $ac_status); } &&
9707          { ac_try='test -s conftest$ac_exeext'
9708   { (eval echo "$as_me:9708: \"$ac_try\"") >&5
9709   (eval $ac_try) 2>&5
9710   ac_status=$?
9711   echo "$as_me:9711: \$? = $ac_status" >&5
9712   (exit $ac_status); }; }; then
9713   ac_R_space=yes
9714 else
9715   echo "$as_me: failed program was:" >&5
9716 cat conftest.$ac_ext >&5
9717 ac_R_space=no
9718 fi
9719 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9720         if test $ac_R_space = yes; then
9721           echo "$as_me:9721: result: yes" >&5
9722 echo "${ECHO_T}yes" >&6
9723           X_LIBS="$X_LIBS -R $x_libraries"
9724         else
9725           echo "$as_me:9725: result: neither works" >&5
9726 echo "${ECHO_T}neither works" >&6
9727         fi
9728       fi
9729       LIBS=$ac_xsave_LIBS
9730     esac
9731   fi
9732
9733   # Check for system-dependent libraries X programs must link with.
9734   # Do this before checking for the system-independent R6 libraries
9735   # (-lICE), since we may need -lsocket or whatever for X linking.
9736
9737   if test "$ISC" = yes; then
9738     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9739   else
9740     # Martyn Johnson says this is needed for Ultrix, if the X
9741     # libraries were built with DECnet support.  And Karl Berry says
9742     # the Alpha needs dnet_stub (dnet does not exist).
9743     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9744     cat >conftest.$ac_ext <<_ACEOF
9745 #line 9745 "configure"
9746 #include "confdefs.h"
9747
9748 /* Override any gcc2 internal prototype to avoid an error.  */
9749 #ifdef __cplusplus
9750 extern "C"
9751 #endif
9752 /* We use char because int might match the return type of a gcc2
9753    builtin and then its argument prototype would still apply.  */
9754 char XOpenDisplay ();
9755 int
9756 main ()
9757 {
9758 XOpenDisplay ();
9759   ;
9760   return 0;
9761 }
9762 _ACEOF
9763 rm -f conftest.$ac_objext conftest$ac_exeext
9764 if { (eval echo "$as_me:9764: \"$ac_link\"") >&5
9765   (eval $ac_link) 2>&5
9766   ac_status=$?
9767   echo "$as_me:9767: \$? = $ac_status" >&5
9768   (exit $ac_status); } &&
9769          { ac_try='test -s conftest$ac_exeext'
9770   { (eval echo "$as_me:9770: \"$ac_try\"") >&5
9771   (eval $ac_try) 2>&5
9772   ac_status=$?
9773   echo "$as_me:9773: \$? = $ac_status" >&5
9774   (exit $ac_status); }; }; then
9775   :
9776 else
9777   echo "$as_me: failed program was:" >&5
9778 cat conftest.$ac_ext >&5
9779 echo "$as_me:9779: checking for dnet_ntoa in -ldnet" >&5
9780 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9781 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9782   echo $ECHO_N "(cached) $ECHO_C" >&6
9783 else
9784   ac_check_lib_save_LIBS=$LIBS
9785 LIBS="-ldnet  $LIBS"
9786 cat >conftest.$ac_ext <<_ACEOF
9787 #line 9787 "configure"
9788 #include "confdefs.h"
9789
9790 /* Override any gcc2 internal prototype to avoid an error.  */
9791 #ifdef __cplusplus
9792 extern "C"
9793 #endif
9794 /* We use char because int might match the return type of a gcc2
9795    builtin and then its argument prototype would still apply.  */
9796 char dnet_ntoa ();
9797 int
9798 main ()
9799 {
9800 dnet_ntoa ();
9801   ;
9802   return 0;
9803 }
9804 _ACEOF
9805 rm -f conftest.$ac_objext conftest$ac_exeext
9806 if { (eval echo "$as_me:9806: \"$ac_link\"") >&5
9807   (eval $ac_link) 2>&5
9808   ac_status=$?
9809   echo "$as_me:9809: \$? = $ac_status" >&5
9810   (exit $ac_status); } &&
9811          { ac_try='test -s conftest$ac_exeext'
9812   { (eval echo "$as_me:9812: \"$ac_try\"") >&5
9813   (eval $ac_try) 2>&5
9814   ac_status=$?
9815   echo "$as_me:9815: \$? = $ac_status" >&5
9816   (exit $ac_status); }; }; then
9817   ac_cv_lib_dnet_dnet_ntoa=yes
9818 else
9819   echo "$as_me: failed program was:" >&5
9820 cat conftest.$ac_ext >&5
9821 ac_cv_lib_dnet_dnet_ntoa=no
9822 fi
9823 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9824 LIBS=$ac_check_lib_save_LIBS
9825 fi
9826 echo "$as_me:9826: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9827 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9828 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9829   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9830 fi
9831
9832     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9833       echo "$as_me:9833: checking for dnet_ntoa in -ldnet_stub" >&5
9834 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9835 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9836   echo $ECHO_N "(cached) $ECHO_C" >&6
9837 else
9838   ac_check_lib_save_LIBS=$LIBS
9839 LIBS="-ldnet_stub  $LIBS"
9840 cat >conftest.$ac_ext <<_ACEOF
9841 #line 9841 "configure"
9842 #include "confdefs.h"
9843
9844 /* Override any gcc2 internal prototype to avoid an error.  */
9845 #ifdef __cplusplus
9846 extern "C"
9847 #endif
9848 /* We use char because int might match the return type of a gcc2
9849    builtin and then its argument prototype would still apply.  */
9850 char dnet_ntoa ();
9851 int
9852 main ()
9853 {
9854 dnet_ntoa ();
9855   ;
9856   return 0;
9857 }
9858 _ACEOF
9859 rm -f conftest.$ac_objext conftest$ac_exeext
9860 if { (eval echo "$as_me:9860: \"$ac_link\"") >&5
9861   (eval $ac_link) 2>&5
9862   ac_status=$?
9863   echo "$as_me:9863: \$? = $ac_status" >&5
9864   (exit $ac_status); } &&
9865          { ac_try='test -s conftest$ac_exeext'
9866   { (eval echo "$as_me:9866: \"$ac_try\"") >&5
9867   (eval $ac_try) 2>&5
9868   ac_status=$?
9869   echo "$as_me:9869: \$? = $ac_status" >&5
9870   (exit $ac_status); }; }; then
9871   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9872 else
9873   echo "$as_me: failed program was:" >&5
9874 cat conftest.$ac_ext >&5
9875 ac_cv_lib_dnet_stub_dnet_ntoa=no
9876 fi
9877 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9878 LIBS=$ac_check_lib_save_LIBS
9879 fi
9880 echo "$as_me:9880: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9881 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9882 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9883   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9884 fi
9885
9886     fi
9887 fi
9888 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9889     LIBS="$ac_xsave_LIBS"
9890
9891     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9892     # to get the SysV transport functions.
9893     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9894     # needs -lnsl.
9895     # The nsl library prevents programs from opening the X display
9896     # on Irix 5.2, according to T.E. Dickey.
9897     # The functions gethostbyname, getservbyname, and inet_addr are
9898     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9899     echo "$as_me:9899: checking for gethostbyname" >&5
9900 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9901 if test "${ac_cv_func_gethostbyname+set}" = set; then
9902   echo $ECHO_N "(cached) $ECHO_C" >&6
9903 else
9904   cat >conftest.$ac_ext <<_ACEOF
9905 #line 9905 "configure"
9906 #include "confdefs.h"
9907 /* System header to define __stub macros and hopefully few prototypes,
9908     which can conflict with char gethostbyname (); below.  */
9909 #include <assert.h>
9910 /* Override any gcc2 internal prototype to avoid an error.  */
9911 #ifdef __cplusplus
9912 extern "C"
9913 #endif
9914 /* We use char because int might match the return type of a gcc2
9915    builtin and then its argument prototype would still apply.  */
9916 char gethostbyname ();
9917 char (*f) ();
9918
9919 int
9920 main ()
9921 {
9922 /* The GNU C library defines this for functions which it implements
9923     to always fail with ENOSYS.  Some functions are actually named
9924     something starting with __ and the normal name is an alias.  */
9925 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9926 choke me
9927 #else
9928 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9929 #endif
9930
9931   ;
9932   return 0;
9933 }
9934 _ACEOF
9935 rm -f conftest.$ac_objext conftest$ac_exeext
9936 if { (eval echo "$as_me:9936: \"$ac_link\"") >&5
9937   (eval $ac_link) 2>&5
9938   ac_status=$?
9939   echo "$as_me:9939: \$? = $ac_status" >&5
9940   (exit $ac_status); } &&
9941          { ac_try='test -s conftest$ac_exeext'
9942   { (eval echo "$as_me:9942: \"$ac_try\"") >&5
9943   (eval $ac_try) 2>&5
9944   ac_status=$?
9945   echo "$as_me:9945: \$? = $ac_status" >&5
9946   (exit $ac_status); }; }; then
9947   ac_cv_func_gethostbyname=yes
9948 else
9949   echo "$as_me: failed program was:" >&5
9950 cat conftest.$ac_ext >&5
9951 ac_cv_func_gethostbyname=no
9952 fi
9953 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9954 fi
9955 echo "$as_me:9955: result: $ac_cv_func_gethostbyname" >&5
9956 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9957
9958     if test $ac_cv_func_gethostbyname = no; then
9959       echo "$as_me:9959: checking for gethostbyname in -lnsl" >&5
9960 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9961 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9962   echo $ECHO_N "(cached) $ECHO_C" >&6
9963 else
9964   ac_check_lib_save_LIBS=$LIBS
9965 LIBS="-lnsl  $LIBS"
9966 cat >conftest.$ac_ext <<_ACEOF
9967 #line 9967 "configure"
9968 #include "confdefs.h"
9969
9970 /* Override any gcc2 internal prototype to avoid an error.  */
9971 #ifdef __cplusplus
9972 extern "C"
9973 #endif
9974 /* We use char because int might match the return type of a gcc2
9975    builtin and then its argument prototype would still apply.  */
9976 char gethostbyname ();
9977 int
9978 main ()
9979 {
9980 gethostbyname ();
9981   ;
9982   return 0;
9983 }
9984 _ACEOF
9985 rm -f conftest.$ac_objext conftest$ac_exeext
9986 if { (eval echo "$as_me:9986: \"$ac_link\"") >&5
9987   (eval $ac_link) 2>&5
9988   ac_status=$?
9989   echo "$as_me:9989: \$? = $ac_status" >&5
9990   (exit $ac_status); } &&
9991          { ac_try='test -s conftest$ac_exeext'
9992   { (eval echo "$as_me:9992: \"$ac_try\"") >&5
9993   (eval $ac_try) 2>&5
9994   ac_status=$?
9995   echo "$as_me:9995: \$? = $ac_status" >&5
9996   (exit $ac_status); }; }; then
9997   ac_cv_lib_nsl_gethostbyname=yes
9998 else
9999   echo "$as_me: failed program was:" >&5
10000 cat conftest.$ac_ext >&5
10001 ac_cv_lib_nsl_gethostbyname=no
10002 fi
10003 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10004 LIBS=$ac_check_lib_save_LIBS
10005 fi
10006 echo "$as_me:10006: result: $ac_cv_lib_nsl_gethostbyname" >&5
10007 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10008 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10009   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10010 fi
10011
10012       if test $ac_cv_lib_nsl_gethostbyname = no; then
10013         echo "$as_me:10013: checking for gethostbyname in -lbsd" >&5
10014 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10015 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10016   echo $ECHO_N "(cached) $ECHO_C" >&6
10017 else
10018   ac_check_lib_save_LIBS=$LIBS
10019 LIBS="-lbsd  $LIBS"
10020 cat >conftest.$ac_ext <<_ACEOF
10021 #line 10021 "configure"
10022 #include "confdefs.h"
10023
10024 /* Override any gcc2 internal prototype to avoid an error.  */
10025 #ifdef __cplusplus
10026 extern "C"
10027 #endif
10028 /* We use char because int might match the return type of a gcc2
10029    builtin and then its argument prototype would still apply.  */
10030 char gethostbyname ();
10031 int
10032 main ()
10033 {
10034 gethostbyname ();
10035   ;
10036   return 0;
10037 }
10038 _ACEOF
10039 rm -f conftest.$ac_objext conftest$ac_exeext
10040 if { (eval echo "$as_me:10040: \"$ac_link\"") >&5
10041   (eval $ac_link) 2>&5
10042   ac_status=$?
10043   echo "$as_me:10043: \$? = $ac_status" >&5
10044   (exit $ac_status); } &&
10045          { ac_try='test -s conftest$ac_exeext'
10046   { (eval echo "$as_me:10046: \"$ac_try\"") >&5
10047   (eval $ac_try) 2>&5
10048   ac_status=$?
10049   echo "$as_me:10049: \$? = $ac_status" >&5
10050   (exit $ac_status); }; }; then
10051   ac_cv_lib_bsd_gethostbyname=yes
10052 else
10053   echo "$as_me: failed program was:" >&5
10054 cat conftest.$ac_ext >&5
10055 ac_cv_lib_bsd_gethostbyname=no
10056 fi
10057 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10058 LIBS=$ac_check_lib_save_LIBS
10059 fi
10060 echo "$as_me:10060: result: $ac_cv_lib_bsd_gethostbyname" >&5
10061 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10062 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10063   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10064 fi
10065
10066       fi
10067     fi
10068
10069     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10070     # socket/setsockopt and other routines are undefined under SCO ODT
10071     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10072     # on later versions), says Simon Leinen: it contains gethostby*
10073     # variants that don't use the nameserver (or something).  -lsocket
10074     # must be given before -lnsl if both are needed.  We assume that
10075     # if connect needs -lnsl, so does gethostbyname.
10076     echo "$as_me:10076: checking for connect" >&5
10077 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10078 if test "${ac_cv_func_connect+set}" = set; then
10079   echo $ECHO_N "(cached) $ECHO_C" >&6
10080 else
10081   cat >conftest.$ac_ext <<_ACEOF
10082 #line 10082 "configure"
10083 #include "confdefs.h"
10084 /* System header to define __stub macros and hopefully few prototypes,
10085     which can conflict with char connect (); below.  */
10086 #include <assert.h>
10087 /* Override any gcc2 internal prototype to avoid an error.  */
10088 #ifdef __cplusplus
10089 extern "C"
10090 #endif
10091 /* We use char because int might match the return type of a gcc2
10092    builtin and then its argument prototype would still apply.  */
10093 char connect ();
10094 char (*f) ();
10095
10096 int
10097 main ()
10098 {
10099 /* The GNU C library defines this for functions which it implements
10100     to always fail with ENOSYS.  Some functions are actually named
10101     something starting with __ and the normal name is an alias.  */
10102 #if defined (__stub_connect) || defined (__stub___connect)
10103 choke me
10104 #else
10105 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10106 #endif
10107
10108   ;
10109   return 0;
10110 }
10111 _ACEOF
10112 rm -f conftest.$ac_objext conftest$ac_exeext
10113 if { (eval echo "$as_me:10113: \"$ac_link\"") >&5
10114   (eval $ac_link) 2>&5
10115   ac_status=$?
10116   echo "$as_me:10116: \$? = $ac_status" >&5
10117   (exit $ac_status); } &&
10118          { ac_try='test -s conftest$ac_exeext'
10119   { (eval echo "$as_me:10119: \"$ac_try\"") >&5
10120   (eval $ac_try) 2>&5
10121   ac_status=$?
10122   echo "$as_me:10122: \$? = $ac_status" >&5
10123   (exit $ac_status); }; }; then
10124   ac_cv_func_connect=yes
10125 else
10126   echo "$as_me: failed program was:" >&5
10127 cat conftest.$ac_ext >&5
10128 ac_cv_func_connect=no
10129 fi
10130 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10131 fi
10132 echo "$as_me:10132: result: $ac_cv_func_connect" >&5
10133 echo "${ECHO_T}$ac_cv_func_connect" >&6
10134
10135     if test $ac_cv_func_connect = no; then
10136       echo "$as_me:10136: checking for connect in -lsocket" >&5
10137 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10138 if test "${ac_cv_lib_socket_connect+set}" = set; then
10139   echo $ECHO_N "(cached) $ECHO_C" >&6
10140 else
10141   ac_check_lib_save_LIBS=$LIBS
10142 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10143 cat >conftest.$ac_ext <<_ACEOF
10144 #line 10144 "configure"
10145 #include "confdefs.h"
10146
10147 /* Override any gcc2 internal prototype to avoid an error.  */
10148 #ifdef __cplusplus
10149 extern "C"
10150 #endif
10151 /* We use char because int might match the return type of a gcc2
10152    builtin and then its argument prototype would still apply.  */
10153 char connect ();
10154 int
10155 main ()
10156 {
10157 connect ();
10158   ;
10159   return 0;
10160 }
10161 _ACEOF
10162 rm -f conftest.$ac_objext conftest$ac_exeext
10163 if { (eval echo "$as_me:10163: \"$ac_link\"") >&5
10164   (eval $ac_link) 2>&5
10165   ac_status=$?
10166   echo "$as_me:10166: \$? = $ac_status" >&5
10167   (exit $ac_status); } &&
10168          { ac_try='test -s conftest$ac_exeext'
10169   { (eval echo "$as_me:10169: \"$ac_try\"") >&5
10170   (eval $ac_try) 2>&5
10171   ac_status=$?
10172   echo "$as_me:10172: \$? = $ac_status" >&5
10173   (exit $ac_status); }; }; then
10174   ac_cv_lib_socket_connect=yes
10175 else
10176   echo "$as_me: failed program was:" >&5
10177 cat conftest.$ac_ext >&5
10178 ac_cv_lib_socket_connect=no
10179 fi
10180 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10181 LIBS=$ac_check_lib_save_LIBS
10182 fi
10183 echo "$as_me:10183: result: $ac_cv_lib_socket_connect" >&5
10184 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10185 if test $ac_cv_lib_socket_connect = yes; then
10186   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10187 fi
10188
10189     fi
10190
10191     # Guillermo Gomez says -lposix is necessary on A/UX.
10192     echo "$as_me:10192: checking for remove" >&5
10193 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10194 if test "${ac_cv_func_remove+set}" = set; then
10195   echo $ECHO_N "(cached) $ECHO_C" >&6
10196 else
10197   cat >conftest.$ac_ext <<_ACEOF
10198 #line 10198 "configure"
10199 #include "confdefs.h"
10200 /* System header to define __stub macros and hopefully few prototypes,
10201     which can conflict with char remove (); below.  */
10202 #include <assert.h>
10203 /* Override any gcc2 internal prototype to avoid an error.  */
10204 #ifdef __cplusplus
10205 extern "C"
10206 #endif
10207 /* We use char because int might match the return type of a gcc2
10208    builtin and then its argument prototype would still apply.  */
10209 char remove ();
10210 char (*f) ();
10211
10212 int
10213 main ()
10214 {
10215 /* The GNU C library defines this for functions which it implements
10216     to always fail with ENOSYS.  Some functions are actually named
10217     something starting with __ and the normal name is an alias.  */
10218 #if defined (__stub_remove) || defined (__stub___remove)
10219 choke me
10220 #else
10221 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10222 #endif
10223
10224   ;
10225   return 0;
10226 }
10227 _ACEOF
10228 rm -f conftest.$ac_objext conftest$ac_exeext
10229 if { (eval echo "$as_me:10229: \"$ac_link\"") >&5
10230   (eval $ac_link) 2>&5
10231   ac_status=$?
10232   echo "$as_me:10232: \$? = $ac_status" >&5
10233   (exit $ac_status); } &&
10234          { ac_try='test -s conftest$ac_exeext'
10235   { (eval echo "$as_me:10235: \"$ac_try\"") >&5
10236   (eval $ac_try) 2>&5
10237   ac_status=$?
10238   echo "$as_me:10238: \$? = $ac_status" >&5
10239   (exit $ac_status); }; }; then
10240   ac_cv_func_remove=yes
10241 else
10242   echo "$as_me: failed program was:" >&5
10243 cat conftest.$ac_ext >&5
10244 ac_cv_func_remove=no
10245 fi
10246 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10247 fi
10248 echo "$as_me:10248: result: $ac_cv_func_remove" >&5
10249 echo "${ECHO_T}$ac_cv_func_remove" >&6
10250
10251     if test $ac_cv_func_remove = no; then
10252       echo "$as_me:10252: checking for remove in -lposix" >&5
10253 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10254 if test "${ac_cv_lib_posix_remove+set}" = set; then
10255   echo $ECHO_N "(cached) $ECHO_C" >&6
10256 else
10257   ac_check_lib_save_LIBS=$LIBS
10258 LIBS="-lposix  $LIBS"
10259 cat >conftest.$ac_ext <<_ACEOF
10260 #line 10260 "configure"
10261 #include "confdefs.h"
10262
10263 /* Override any gcc2 internal prototype to avoid an error.  */
10264 #ifdef __cplusplus
10265 extern "C"
10266 #endif
10267 /* We use char because int might match the return type of a gcc2
10268    builtin and then its argument prototype would still apply.  */
10269 char remove ();
10270 int
10271 main ()
10272 {
10273 remove ();
10274   ;
10275   return 0;
10276 }
10277 _ACEOF
10278 rm -f conftest.$ac_objext conftest$ac_exeext
10279 if { (eval echo "$as_me:10279: \"$ac_link\"") >&5
10280   (eval $ac_link) 2>&5
10281   ac_status=$?
10282   echo "$as_me:10282: \$? = $ac_status" >&5
10283   (exit $ac_status); } &&
10284          { ac_try='test -s conftest$ac_exeext'
10285   { (eval echo "$as_me:10285: \"$ac_try\"") >&5
10286   (eval $ac_try) 2>&5
10287   ac_status=$?
10288   echo "$as_me:10288: \$? = $ac_status" >&5
10289   (exit $ac_status); }; }; then
10290   ac_cv_lib_posix_remove=yes
10291 else
10292   echo "$as_me: failed program was:" >&5
10293 cat conftest.$ac_ext >&5
10294 ac_cv_lib_posix_remove=no
10295 fi
10296 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10297 LIBS=$ac_check_lib_save_LIBS
10298 fi
10299 echo "$as_me:10299: result: $ac_cv_lib_posix_remove" >&5
10300 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10301 if test $ac_cv_lib_posix_remove = yes; then
10302   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10303 fi
10304
10305     fi
10306
10307     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10308     echo "$as_me:10308: checking for shmat" >&5
10309 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10310 if test "${ac_cv_func_shmat+set}" = set; then
10311   echo $ECHO_N "(cached) $ECHO_C" >&6
10312 else
10313   cat >conftest.$ac_ext <<_ACEOF
10314 #line 10314 "configure"
10315 #include "confdefs.h"
10316 /* System header to define __stub macros and hopefully few prototypes,
10317     which can conflict with char shmat (); below.  */
10318 #include <assert.h>
10319 /* Override any gcc2 internal prototype to avoid an error.  */
10320 #ifdef __cplusplus
10321 extern "C"
10322 #endif
10323 /* We use char because int might match the return type of a gcc2
10324    builtin and then its argument prototype would still apply.  */
10325 char shmat ();
10326 char (*f) ();
10327
10328 int
10329 main ()
10330 {
10331 /* The GNU C library defines this for functions which it implements
10332     to always fail with ENOSYS.  Some functions are actually named
10333     something starting with __ and the normal name is an alias.  */
10334 #if defined (__stub_shmat) || defined (__stub___shmat)
10335 choke me
10336 #else
10337 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10338 #endif
10339
10340   ;
10341   return 0;
10342 }
10343 _ACEOF
10344 rm -f conftest.$ac_objext conftest$ac_exeext
10345 if { (eval echo "$as_me:10345: \"$ac_link\"") >&5
10346   (eval $ac_link) 2>&5
10347   ac_status=$?
10348   echo "$as_me:10348: \$? = $ac_status" >&5
10349   (exit $ac_status); } &&
10350          { ac_try='test -s conftest$ac_exeext'
10351   { (eval echo "$as_me:10351: \"$ac_try\"") >&5
10352   (eval $ac_try) 2>&5
10353   ac_status=$?
10354   echo "$as_me:10354: \$? = $ac_status" >&5
10355   (exit $ac_status); }; }; then
10356   ac_cv_func_shmat=yes
10357 else
10358   echo "$as_me: failed program was:" >&5
10359 cat conftest.$ac_ext >&5
10360 ac_cv_func_shmat=no
10361 fi
10362 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10363 fi
10364 echo "$as_me:10364: result: $ac_cv_func_shmat" >&5
10365 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10366
10367     if test $ac_cv_func_shmat = no; then
10368       echo "$as_me:10368: checking for shmat in -lipc" >&5
10369 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10370 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10371   echo $ECHO_N "(cached) $ECHO_C" >&6
10372 else
10373   ac_check_lib_save_LIBS=$LIBS
10374 LIBS="-lipc  $LIBS"
10375 cat >conftest.$ac_ext <<_ACEOF
10376 #line 10376 "configure"
10377 #include "confdefs.h"
10378
10379 /* Override any gcc2 internal prototype to avoid an error.  */
10380 #ifdef __cplusplus
10381 extern "C"
10382 #endif
10383 /* We use char because int might match the return type of a gcc2
10384    builtin and then its argument prototype would still apply.  */
10385 char shmat ();
10386 int
10387 main ()
10388 {
10389 shmat ();
10390   ;
10391   return 0;
10392 }
10393 _ACEOF
10394 rm -f conftest.$ac_objext conftest$ac_exeext
10395 if { (eval echo "$as_me:10395: \"$ac_link\"") >&5
10396   (eval $ac_link) 2>&5
10397   ac_status=$?
10398   echo "$as_me:10398: \$? = $ac_status" >&5
10399   (exit $ac_status); } &&
10400          { ac_try='test -s conftest$ac_exeext'
10401   { (eval echo "$as_me:10401: \"$ac_try\"") >&5
10402   (eval $ac_try) 2>&5
10403   ac_status=$?
10404   echo "$as_me:10404: \$? = $ac_status" >&5
10405   (exit $ac_status); }; }; then
10406   ac_cv_lib_ipc_shmat=yes
10407 else
10408   echo "$as_me: failed program was:" >&5
10409 cat conftest.$ac_ext >&5
10410 ac_cv_lib_ipc_shmat=no
10411 fi
10412 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10413 LIBS=$ac_check_lib_save_LIBS
10414 fi
10415 echo "$as_me:10415: result: $ac_cv_lib_ipc_shmat" >&5
10416 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10417 if test $ac_cv_lib_ipc_shmat = yes; then
10418   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10419 fi
10420
10421     fi
10422   fi
10423
10424   # Check for libraries that X11R6 Xt/Xaw programs need.
10425   ac_save_LDFLAGS=$LDFLAGS
10426   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10427   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10428   # check for ICE first), but we must link in the order -lSM -lICE or
10429   # we get undefined symbols.  So assume we have SM if we have ICE.
10430   # These have to be linked with before -lX11, unlike the other
10431   # libraries we check for below, so use a different variable.
10432   # John Interrante, Karl Berry
10433   echo "$as_me:10433: checking for IceConnectionNumber in -lICE" >&5
10434 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10435 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10436   echo $ECHO_N "(cached) $ECHO_C" >&6
10437 else
10438   ac_check_lib_save_LIBS=$LIBS
10439 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10440 cat >conftest.$ac_ext <<_ACEOF
10441 #line 10441 "configure"
10442 #include "confdefs.h"
10443
10444 /* Override any gcc2 internal prototype to avoid an error.  */
10445 #ifdef __cplusplus
10446 extern "C"
10447 #endif
10448 /* We use char because int might match the return type of a gcc2
10449    builtin and then its argument prototype would still apply.  */
10450 char IceConnectionNumber ();
10451 int
10452 main ()
10453 {
10454 IceConnectionNumber ();
10455   ;
10456   return 0;
10457 }
10458 _ACEOF
10459 rm -f conftest.$ac_objext conftest$ac_exeext
10460 if { (eval echo "$as_me:10460: \"$ac_link\"") >&5
10461   (eval $ac_link) 2>&5
10462   ac_status=$?
10463   echo "$as_me:10463: \$? = $ac_status" >&5
10464   (exit $ac_status); } &&
10465          { ac_try='test -s conftest$ac_exeext'
10466   { (eval echo "$as_me:10466: \"$ac_try\"") >&5
10467   (eval $ac_try) 2>&5
10468   ac_status=$?
10469   echo "$as_me:10469: \$? = $ac_status" >&5
10470   (exit $ac_status); }; }; then
10471   ac_cv_lib_ICE_IceConnectionNumber=yes
10472 else
10473   echo "$as_me: failed program was:" >&5
10474 cat conftest.$ac_ext >&5
10475 ac_cv_lib_ICE_IceConnectionNumber=no
10476 fi
10477 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10478 LIBS=$ac_check_lib_save_LIBS
10479 fi
10480 echo "$as_me:10480: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10481 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10482 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10483   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10484 fi
10485
10486   LDFLAGS=$ac_save_LDFLAGS
10487
10488 fi
10489
10490 cf_x_athena=${cf_x_athena:-Xaw}
10491
10492 echo "$as_me:10492: checking if you want to link with Xaw 3d library" >&5
10493 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10494 withval=
10495
10496 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10497 if test "${with_Xaw3d+set}" = set; then
10498   withval="$with_Xaw3d"
10499
10500 fi;
10501 if test "$withval" = yes ; then
10502         cf_x_athena=Xaw3d
10503         echo "$as_me:10503: result: yes" >&5
10504 echo "${ECHO_T}yes" >&6
10505 else
10506         echo "$as_me:10506: result: no" >&5
10507 echo "${ECHO_T}no" >&6
10508 fi
10509
10510 echo "$as_me:10510: checking if you want to link with Xaw 3d xft library" >&5
10511 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
10512 withval=
10513
10514 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
10515 if test "${with_Xaw3dxft+set}" = set; then
10516   withval="$with_Xaw3dxft"
10517
10518 fi;
10519 if test "$withval" = yes ; then
10520         cf_x_athena=Xaw3dxft
10521         echo "$as_me:10521: result: yes" >&5
10522 echo "${ECHO_T}yes" >&6
10523 else
10524         echo "$as_me:10524: result: no" >&5
10525 echo "${ECHO_T}no" >&6
10526 fi
10527
10528 echo "$as_me:10528: checking if you want to link with neXT Athena library" >&5
10529 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10530 withval=
10531
10532 # Check whether --with-neXtaw or --without-neXtaw was given.
10533 if test "${with_neXtaw+set}" = set; then
10534   withval="$with_neXtaw"
10535
10536 fi;
10537 if test "$withval" = yes ; then
10538         cf_x_athena=neXtaw
10539         echo "$as_me:10539: result: yes" >&5
10540 echo "${ECHO_T}yes" >&6
10541 else
10542         echo "$as_me:10542: result: no" >&5
10543 echo "${ECHO_T}no" >&6
10544 fi
10545
10546 echo "$as_me:10546: checking if you want to link with Athena-Plus library" >&5
10547 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10548 withval=
10549
10550 # Check whether --with-XawPlus or --without-XawPlus was given.
10551 if test "${with_XawPlus+set}" = set; then
10552   withval="$with_XawPlus"
10553
10554 fi;
10555 if test "$withval" = yes ; then
10556         cf_x_athena=XawPlus
10557         echo "$as_me:10557: result: yes" >&5
10558 echo "${ECHO_T}yes" >&6
10559 else
10560         echo "$as_me:10560: result: no" >&5
10561 echo "${ECHO_T}no" >&6
10562 fi
10563
10564 cf_x_athena_lib=""
10565
10566 if test "$PKG_CONFIG" != none ; then
10567         cf_athena_list=
10568         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10569         for cf_athena_pkg in \
10570                 $cf_athena_list \
10571                 ${cf_x_athena} \
10572                 ${cf_x_athena}-devel \
10573                 lib${cf_x_athena} \
10574                 lib${cf_x_athena}-devel
10575         do
10576
10577 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10578         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10579
10580 echo "${as_me:-configure}:10580: testing found package $cf_athena_pkg ..." 1>&5
10581
10582         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10583         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10584         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10585
10586 echo "${as_me:-configure}:10586: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10587
10588         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10589
10590 echo "${as_me:-configure}:10590: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10591
10592 cf_fix_cppflags=no
10593 cf_new_cflags=
10594 cf_new_cppflags=
10595 cf_new_extra_cppflags=
10596
10597 for cf_add_cflags in $cf_pkgconfig_incs
10598 do
10599 case $cf_fix_cppflags in
10600 (no)
10601         case $cf_add_cflags in
10602         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10603                 case $cf_add_cflags in
10604                 (-D*)
10605                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10606
10607                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10608                                 && test -z "${cf_tst_cflags}" \
10609                                 && cf_fix_cppflags=yes
10610
10611                         if test $cf_fix_cppflags = yes ; then
10612                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10613                                 continue
10614                         elif test "${cf_tst_cflags}" = "\"'" ; then
10615                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10616                                 continue
10617                         fi
10618                         ;;
10619                 esac
10620                 case "$CPPFLAGS" in
10621                 (*$cf_add_cflags)
10622                         ;;
10623                 (*)
10624                         case $cf_add_cflags in
10625                         (-D*)
10626                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10627
10628 CPPFLAGS=`echo "$CPPFLAGS" | \
10629         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10630                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10631
10632                                 ;;
10633                         esac
10634                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10635                         ;;
10636                 esac
10637                 ;;
10638         (*)
10639                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10640                 ;;
10641         esac
10642         ;;
10643 (yes)
10644         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10645
10646         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10647
10648         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10649                 && test -z "${cf_tst_cflags}" \
10650                 && cf_fix_cppflags=no
10651         ;;
10652 esac
10653 done
10654
10655 if test -n "$cf_new_cflags" ; then
10656
10657         CFLAGS="$CFLAGS $cf_new_cflags"
10658 fi
10659
10660 if test -n "$cf_new_cppflags" ; then
10661
10662         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10663 fi
10664
10665 if test -n "$cf_new_extra_cppflags" ; then
10666
10667         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10668 fi
10669
10670 cf_add_libs="$cf_pkgconfig_libs"
10671 # Filter out duplicates - this happens with badly-designed ".pc" files...
10672 for cf_add_1lib in $LIBS
10673 do
10674         for cf_add_2lib in $cf_add_libs
10675         do
10676                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10677                 then
10678                         cf_add_1lib=
10679                         break
10680                 fi
10681         done
10682         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10683 done
10684 LIBS="$cf_add_libs"
10685
10686                         cf_x_athena_lib="$cf_pkgconfig_libs"
10687
10688 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10689
10690                         cat >>confdefs.h <<EOF
10691 #define $cf_x_athena_LIBS 1
10692 EOF
10693
10694         for cf_trim_lib in Xmu Xt X11
10695         do
10696                 case "$LIBS" in
10697                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10698                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10699                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10700
10701 echo "${as_me:-configure}:10701: testing ..trimmed $LIBS ..." 1>&5
10702
10703                         ;;
10704                 esac
10705         done
10706
10707 echo "$as_me:10707: checking for usable $cf_x_athena/Xmu package" >&5
10708 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10709 if test "${cf_cv_xaw_compat+set}" = set; then
10710   echo $ECHO_N "(cached) $ECHO_C" >&6
10711 else
10712
10713 cat >conftest.$ac_ext <<_ACEOF
10714 #line 10714 "configure"
10715 #include "confdefs.h"
10716
10717 #include <X11/Xmu/CharSet.h>
10718
10719 int
10720 main ()
10721 {
10722
10723 int check = XmuCompareISOLatin1("big", "small")
10724
10725   ;
10726   return 0;
10727 }
10728 _ACEOF
10729 rm -f conftest.$ac_objext conftest$ac_exeext
10730 if { (eval echo "$as_me:10730: \"$ac_link\"") >&5
10731   (eval $ac_link) 2>&5
10732   ac_status=$?
10733   echo "$as_me:10733: \$? = $ac_status" >&5
10734   (exit $ac_status); } &&
10735          { ac_try='test -s conftest$ac_exeext'
10736   { (eval echo "$as_me:10736: \"$ac_try\"") >&5
10737   (eval $ac_try) 2>&5
10738   ac_status=$?
10739   echo "$as_me:10739: \$? = $ac_status" >&5
10740   (exit $ac_status); }; }; then
10741   cf_cv_xaw_compat=yes
10742 else
10743   echo "$as_me: failed program was:" >&5
10744 cat conftest.$ac_ext >&5
10745 cf_cv_xaw_compat=no
10746 fi
10747 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10748 fi
10749 echo "$as_me:10749: result: $cf_cv_xaw_compat" >&5
10750 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10751
10752                         if test "$cf_cv_xaw_compat" = no
10753                         then
10754                                 # workaround for broken ".pc" files...
10755                                 case "$cf_x_athena_lib" in
10756                                 (*-lXmu*)
10757                                         ;;
10758                                 (*)
10759                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10760
10761 echo "${as_me:-configure}:10761: testing work around broken package ..." 1>&5
10762
10763                                         cf_save_xmu="$LIBS"
10764                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
10765
10766 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10767         test -n "$verbose" && echo "    found package xmu" 1>&6
10768
10769 echo "${as_me:-configure}:10769: testing found package xmu ..." 1>&5
10770
10771         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10772         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10773         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10774
10775 echo "${as_me:-configure}:10775: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10776
10777         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10778
10779 echo "${as_me:-configure}:10779: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10780
10781 cf_fix_cppflags=no
10782 cf_new_cflags=
10783 cf_new_cppflags=
10784 cf_new_extra_cppflags=
10785
10786 for cf_add_cflags in $cf_pkgconfig_incs
10787 do
10788 case $cf_fix_cppflags in
10789 (no)
10790         case $cf_add_cflags in
10791         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10792                 case $cf_add_cflags in
10793                 (-D*)
10794                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10795
10796                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10797                                 && test -z "${cf_tst_cflags}" \
10798                                 && cf_fix_cppflags=yes
10799
10800                         if test $cf_fix_cppflags = yes ; then
10801                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10802                                 continue
10803                         elif test "${cf_tst_cflags}" = "\"'" ; then
10804                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10805                                 continue
10806                         fi
10807                         ;;
10808                 esac
10809                 case "$CPPFLAGS" in
10810                 (*$cf_add_cflags)
10811                         ;;
10812                 (*)
10813                         case $cf_add_cflags in
10814                         (-D*)
10815                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10816
10817 CPPFLAGS=`echo "$CPPFLAGS" | \
10818         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10819                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10820
10821                                 ;;
10822                         esac
10823                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10824                         ;;
10825                 esac
10826                 ;;
10827         (*)
10828                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10829                 ;;
10830         esac
10831         ;;
10832 (yes)
10833         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10834
10835         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10836
10837         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10838                 && test -z "${cf_tst_cflags}" \
10839                 && cf_fix_cppflags=no
10840         ;;
10841 esac
10842 done
10843
10844 if test -n "$cf_new_cflags" ; then
10845
10846         CFLAGS="$CFLAGS $cf_new_cflags"
10847 fi
10848
10849 if test -n "$cf_new_cppflags" ; then
10850
10851         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10852 fi
10853
10854 if test -n "$cf_new_extra_cppflags" ; then
10855
10856         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10857 fi
10858
10859 cf_add_libs="$cf_pkgconfig_libs"
10860 # Filter out duplicates - this happens with badly-designed ".pc" files...
10861 for cf_add_1lib in $LIBS
10862 do
10863         for cf_add_2lib in $cf_add_libs
10864         do
10865                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10866                 then
10867                         cf_add_1lib=
10868                         break
10869                 fi
10870         done
10871         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10872 done
10873 LIBS="$cf_add_libs"
10874
10875                                                         LIBS="$cf_save_xmu"
10876
10877 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10878
10879 echo "${as_me:-configure}:10879: testing ...before $LIBS ..." 1>&5
10880
10881 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
10882 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10883
10884 echo "${as_me:-configure}:10884: testing ...after  $LIBS ..." 1>&5
10885
10886 else
10887         cf_pkgconfig_incs=
10888         cf_pkgconfig_libs=
10889
10890 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10891
10892 echo "${as_me:-configure}:10892: testing ...before $LIBS ..." 1>&5
10893
10894 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
10895 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10896
10897 echo "${as_me:-configure}:10897: testing ...after  $LIBS ..." 1>&5
10898
10899 fi
10900
10901         for cf_trim_lib in Xmu Xt X11
10902         do
10903                 case "$LIBS" in
10904                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10905                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10906                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10907
10908 echo "${as_me:-configure}:10908: testing ..trimmed $LIBS ..." 1>&5
10909
10910                         ;;
10911                 esac
10912         done
10913
10914                                         ;;
10915                                 esac
10916                         fi
10917
10918                         break
10919 else
10920         cf_pkgconfig_incs=
10921         cf_pkgconfig_libs=
10922         :
10923 fi
10924
10925         done
10926 fi
10927
10928 if test -z "$cf_x_athena_lib" ; then
10929
10930 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10931         test -n "$verbose" && echo "    found package Xext" 1>&6
10932
10933 echo "${as_me:-configure}:10933: testing found package Xext ..." 1>&5
10934
10935         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10936         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10937         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10938
10939 echo "${as_me:-configure}:10939: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10940
10941         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10942
10943 echo "${as_me:-configure}:10943: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10944
10945 cf_fix_cppflags=no
10946 cf_new_cflags=
10947 cf_new_cppflags=
10948 cf_new_extra_cppflags=
10949
10950 for cf_add_cflags in $cf_pkgconfig_incs
10951 do
10952 case $cf_fix_cppflags in
10953 (no)
10954         case $cf_add_cflags in
10955         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10956                 case $cf_add_cflags in
10957                 (-D*)
10958                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10959
10960                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10961                                 && test -z "${cf_tst_cflags}" \
10962                                 && cf_fix_cppflags=yes
10963
10964                         if test $cf_fix_cppflags = yes ; then
10965                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10966                                 continue
10967                         elif test "${cf_tst_cflags}" = "\"'" ; then
10968                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10969                                 continue
10970                         fi
10971                         ;;
10972                 esac
10973                 case "$CPPFLAGS" in
10974                 (*$cf_add_cflags)
10975                         ;;
10976                 (*)
10977                         case $cf_add_cflags in
10978                         (-D*)
10979                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10980
10981 CPPFLAGS=`echo "$CPPFLAGS" | \
10982         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10983                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10984
10985                                 ;;
10986                         esac
10987                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10988                         ;;
10989                 esac
10990                 ;;
10991         (*)
10992                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10993                 ;;
10994         esac
10995         ;;
10996 (yes)
10997         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10998
10999         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11000
11001         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11002                 && test -z "${cf_tst_cflags}" \
11003                 && cf_fix_cppflags=no
11004         ;;
11005 esac
11006 done
11007
11008 if test -n "$cf_new_cflags" ; then
11009
11010         CFLAGS="$CFLAGS $cf_new_cflags"
11011 fi
11012
11013 if test -n "$cf_new_cppflags" ; then
11014
11015         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11016 fi
11017
11018 if test -n "$cf_new_extra_cppflags" ; then
11019
11020         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11021 fi
11022
11023 cf_add_libs="$cf_pkgconfig_libs"
11024 # Filter out duplicates - this happens with badly-designed ".pc" files...
11025 for cf_add_1lib in $LIBS
11026 do
11027         for cf_add_2lib in $cf_add_libs
11028         do
11029                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11030                 then
11031                         cf_add_1lib=
11032                         break
11033                 fi
11034         done
11035         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11036 done
11037 LIBS="$cf_add_libs"
11038
11039         :
11040 else
11041         cf_pkgconfig_incs=
11042         cf_pkgconfig_libs=
11043
11044         echo "$as_me:11044: checking for XextCreateExtension in -lXext" >&5
11045 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11046 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11047   echo $ECHO_N "(cached) $ECHO_C" >&6
11048 else
11049   ac_check_lib_save_LIBS=$LIBS
11050 LIBS="-lXext  $LIBS"
11051 cat >conftest.$ac_ext <<_ACEOF
11052 #line 11052 "configure"
11053 #include "confdefs.h"
11054
11055 /* Override any gcc2 internal prototype to avoid an error.  */
11056 #ifdef __cplusplus
11057 extern "C"
11058 #endif
11059 /* We use char because int might match the return type of a gcc2
11060    builtin and then its argument prototype would still apply.  */
11061 char XextCreateExtension ();
11062 int
11063 main ()
11064 {
11065 XextCreateExtension ();
11066   ;
11067   return 0;
11068 }
11069 _ACEOF
11070 rm -f conftest.$ac_objext conftest$ac_exeext
11071 if { (eval echo "$as_me:11071: \"$ac_link\"") >&5
11072   (eval $ac_link) 2>&5
11073   ac_status=$?
11074   echo "$as_me:11074: \$? = $ac_status" >&5
11075   (exit $ac_status); } &&
11076          { ac_try='test -s conftest$ac_exeext'
11077   { (eval echo "$as_me:11077: \"$ac_try\"") >&5
11078   (eval $ac_try) 2>&5
11079   ac_status=$?
11080   echo "$as_me:11080: \$? = $ac_status" >&5
11081   (exit $ac_status); }; }; then
11082   ac_cv_lib_Xext_XextCreateExtension=yes
11083 else
11084   echo "$as_me: failed program was:" >&5
11085 cat conftest.$ac_ext >&5
11086 ac_cv_lib_Xext_XextCreateExtension=no
11087 fi
11088 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11089 LIBS=$ac_check_lib_save_LIBS
11090 fi
11091 echo "$as_me:11091: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11092 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11093 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11094
11095 cf_add_libs="-lXext"
11096 # Filter out duplicates - this happens with badly-designed ".pc" files...
11097 for cf_add_1lib in $LIBS
11098 do
11099         for cf_add_2lib in $cf_add_libs
11100         do
11101                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11102                 then
11103                         cf_add_1lib=
11104                         break
11105                 fi
11106         done
11107         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11108 done
11109 LIBS="$cf_add_libs"
11110
11111 fi
11112
11113 fi
11114
11115 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11116 # in some cases has installed dummy files in the former, other cases replaced
11117 # it with a link to the new location).  This complicates the configure script.
11118 # Check for that pitfall, and recover using pkg-config
11119 #
11120 # If none of these are set, the configuration is almost certainly broken.
11121 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11122 then
11123
11124 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11125         test -n "$verbose" && echo "    found package x11" 1>&6
11126
11127 echo "${as_me:-configure}:11127: testing found package x11 ..." 1>&5
11128
11129         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11130         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11131         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11132
11133 echo "${as_me:-configure}:11133: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11134
11135         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11136
11137 echo "${as_me:-configure}:11137: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11138
11139 cf_fix_cppflags=no
11140 cf_new_cflags=
11141 cf_new_cppflags=
11142 cf_new_extra_cppflags=
11143
11144 for cf_add_cflags in $cf_pkgconfig_incs
11145 do
11146 case $cf_fix_cppflags in
11147 (no)
11148         case $cf_add_cflags in
11149         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11150                 case $cf_add_cflags in
11151                 (-D*)
11152                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11153
11154                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11155                                 && test -z "${cf_tst_cflags}" \
11156                                 && cf_fix_cppflags=yes
11157
11158                         if test $cf_fix_cppflags = yes ; then
11159                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11160                                 continue
11161                         elif test "${cf_tst_cflags}" = "\"'" ; then
11162                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11163                                 continue
11164                         fi
11165                         ;;
11166                 esac
11167                 case "$CPPFLAGS" in
11168                 (*$cf_add_cflags)
11169                         ;;
11170                 (*)
11171                         case $cf_add_cflags in
11172                         (-D*)
11173                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11174
11175 CPPFLAGS=`echo "$CPPFLAGS" | \
11176         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11177                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11178
11179                                 ;;
11180                         esac
11181                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11182                         ;;
11183                 esac
11184                 ;;
11185         (*)
11186                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11187                 ;;
11188         esac
11189         ;;
11190 (yes)
11191         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11192
11193         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11194
11195         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11196                 && test -z "${cf_tst_cflags}" \
11197                 && cf_fix_cppflags=no
11198         ;;
11199 esac
11200 done
11201
11202 if test -n "$cf_new_cflags" ; then
11203
11204         CFLAGS="$CFLAGS $cf_new_cflags"
11205 fi
11206
11207 if test -n "$cf_new_cppflags" ; then
11208
11209         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11210 fi
11211
11212 if test -n "$cf_new_extra_cppflags" ; then
11213
11214         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11215 fi
11216
11217 cf_add_libs="$cf_pkgconfig_libs"
11218 # Filter out duplicates - this happens with badly-designed ".pc" files...
11219 for cf_add_1lib in $LIBS
11220 do
11221         for cf_add_2lib in $cf_add_libs
11222         do
11223                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11224                 then
11225                         cf_add_1lib=
11226                         break
11227                 fi
11228         done
11229         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11230 done
11231 LIBS="$cf_add_libs"
11232
11233         :
11234 else
11235         cf_pkgconfig_incs=
11236         cf_pkgconfig_libs=
11237         { echo "$as_me:11237: WARNING: unable to find X11 library" >&5
11238 echo "$as_me: WARNING: unable to find X11 library" >&2;}
11239 fi
11240
11241 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11242         test -n "$verbose" && echo "    found package ice" 1>&6
11243
11244 echo "${as_me:-configure}:11244: testing found package ice ..." 1>&5
11245
11246         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11247         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11248         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11249
11250 echo "${as_me:-configure}:11250: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11251
11252         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11253
11254 echo "${as_me:-configure}:11254: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11255
11256 cf_fix_cppflags=no
11257 cf_new_cflags=
11258 cf_new_cppflags=
11259 cf_new_extra_cppflags=
11260
11261 for cf_add_cflags in $cf_pkgconfig_incs
11262 do
11263 case $cf_fix_cppflags in
11264 (no)
11265         case $cf_add_cflags in
11266         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11267                 case $cf_add_cflags in
11268                 (-D*)
11269                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11270
11271                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11272                                 && test -z "${cf_tst_cflags}" \
11273                                 && cf_fix_cppflags=yes
11274
11275                         if test $cf_fix_cppflags = yes ; then
11276                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11277                                 continue
11278                         elif test "${cf_tst_cflags}" = "\"'" ; then
11279                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11280                                 continue
11281                         fi
11282                         ;;
11283                 esac
11284                 case "$CPPFLAGS" in
11285                 (*$cf_add_cflags)
11286                         ;;
11287                 (*)
11288                         case $cf_add_cflags in
11289                         (-D*)
11290                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11291
11292 CPPFLAGS=`echo "$CPPFLAGS" | \
11293         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11294                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11295
11296                                 ;;
11297                         esac
11298                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11299                         ;;
11300                 esac
11301                 ;;
11302         (*)
11303                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11304                 ;;
11305         esac
11306         ;;
11307 (yes)
11308         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11309
11310         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11311
11312         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11313                 && test -z "${cf_tst_cflags}" \
11314                 && cf_fix_cppflags=no
11315         ;;
11316 esac
11317 done
11318
11319 if test -n "$cf_new_cflags" ; then
11320
11321         CFLAGS="$CFLAGS $cf_new_cflags"
11322 fi
11323
11324 if test -n "$cf_new_cppflags" ; then
11325
11326         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11327 fi
11328
11329 if test -n "$cf_new_extra_cppflags" ; then
11330
11331         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11332 fi
11333
11334 cf_add_libs="$cf_pkgconfig_libs"
11335 # Filter out duplicates - this happens with badly-designed ".pc" files...
11336 for cf_add_1lib in $LIBS
11337 do
11338         for cf_add_2lib in $cf_add_libs
11339         do
11340                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11341                 then
11342                         cf_add_1lib=
11343                         break
11344                 fi
11345         done
11346         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11347 done
11348 LIBS="$cf_add_libs"
11349
11350         :
11351 else
11352         cf_pkgconfig_incs=
11353         cf_pkgconfig_libs=
11354         { echo "$as_me:11354: WARNING: unable to find ICE library" >&5
11355 echo "$as_me: WARNING: unable to find ICE library" >&2;}
11356 fi
11357
11358 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11359         test -n "$verbose" && echo "    found package sm" 1>&6
11360
11361 echo "${as_me:-configure}:11361: testing found package sm ..." 1>&5
11362
11363         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11364         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11365         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11366
11367 echo "${as_me:-configure}:11367: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11368
11369         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11370
11371 echo "${as_me:-configure}:11371: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11372
11373 cf_fix_cppflags=no
11374 cf_new_cflags=
11375 cf_new_cppflags=
11376 cf_new_extra_cppflags=
11377
11378 for cf_add_cflags in $cf_pkgconfig_incs
11379 do
11380 case $cf_fix_cppflags in
11381 (no)
11382         case $cf_add_cflags in
11383         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11384                 case $cf_add_cflags in
11385                 (-D*)
11386                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11387
11388                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11389                                 && test -z "${cf_tst_cflags}" \
11390                                 && cf_fix_cppflags=yes
11391
11392                         if test $cf_fix_cppflags = yes ; then
11393                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11394                                 continue
11395                         elif test "${cf_tst_cflags}" = "\"'" ; then
11396                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11397                                 continue
11398                         fi
11399                         ;;
11400                 esac
11401                 case "$CPPFLAGS" in
11402                 (*$cf_add_cflags)
11403                         ;;
11404                 (*)
11405                         case $cf_add_cflags in
11406                         (-D*)
11407                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11408
11409 CPPFLAGS=`echo "$CPPFLAGS" | \
11410         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11411                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11412
11413                                 ;;
11414                         esac
11415                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11416                         ;;
11417                 esac
11418                 ;;
11419         (*)
11420                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11421                 ;;
11422         esac
11423         ;;
11424 (yes)
11425         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11426
11427         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11428
11429         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11430                 && test -z "${cf_tst_cflags}" \
11431                 && cf_fix_cppflags=no
11432         ;;
11433 esac
11434 done
11435
11436 if test -n "$cf_new_cflags" ; then
11437
11438         CFLAGS="$CFLAGS $cf_new_cflags"
11439 fi
11440
11441 if test -n "$cf_new_cppflags" ; then
11442
11443         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11444 fi
11445
11446 if test -n "$cf_new_extra_cppflags" ; then
11447
11448         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11449 fi
11450
11451 cf_add_libs="$cf_pkgconfig_libs"
11452 # Filter out duplicates - this happens with badly-designed ".pc" files...
11453 for cf_add_1lib in $LIBS
11454 do
11455         for cf_add_2lib in $cf_add_libs
11456         do
11457                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11458                 then
11459                         cf_add_1lib=
11460                         break
11461                 fi
11462         done
11463         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11464 done
11465 LIBS="$cf_add_libs"
11466
11467         :
11468 else
11469         cf_pkgconfig_incs=
11470         cf_pkgconfig_libs=
11471         { echo "$as_me:11471: WARNING: unable to find SM library" >&5
11472 echo "$as_me: WARNING: unable to find SM library" >&2;}
11473 fi
11474
11475 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11476         test -n "$verbose" && echo "    found package xt" 1>&6
11477
11478 echo "${as_me:-configure}:11478: testing found package xt ..." 1>&5
11479
11480         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11481         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11482         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11483
11484 echo "${as_me:-configure}:11484: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11485
11486         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11487
11488 echo "${as_me:-configure}:11488: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11489
11490 cf_fix_cppflags=no
11491 cf_new_cflags=
11492 cf_new_cppflags=
11493 cf_new_extra_cppflags=
11494
11495 for cf_add_cflags in $cf_pkgconfig_incs
11496 do
11497 case $cf_fix_cppflags in
11498 (no)
11499         case $cf_add_cflags in
11500         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11501                 case $cf_add_cflags in
11502                 (-D*)
11503                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11504
11505                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11506                                 && test -z "${cf_tst_cflags}" \
11507                                 && cf_fix_cppflags=yes
11508
11509                         if test $cf_fix_cppflags = yes ; then
11510                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11511                                 continue
11512                         elif test "${cf_tst_cflags}" = "\"'" ; then
11513                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11514                                 continue
11515                         fi
11516                         ;;
11517                 esac
11518                 case "$CPPFLAGS" in
11519                 (*$cf_add_cflags)
11520                         ;;
11521                 (*)
11522                         case $cf_add_cflags in
11523                         (-D*)
11524                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11525
11526 CPPFLAGS=`echo "$CPPFLAGS" | \
11527         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11528                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11529
11530                                 ;;
11531                         esac
11532                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11533                         ;;
11534                 esac
11535                 ;;
11536         (*)
11537                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11538                 ;;
11539         esac
11540         ;;
11541 (yes)
11542         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11543
11544         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11545
11546         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11547                 && test -z "${cf_tst_cflags}" \
11548                 && cf_fix_cppflags=no
11549         ;;
11550 esac
11551 done
11552
11553 if test -n "$cf_new_cflags" ; then
11554
11555         CFLAGS="$CFLAGS $cf_new_cflags"
11556 fi
11557
11558 if test -n "$cf_new_cppflags" ; then
11559
11560         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11561 fi
11562
11563 if test -n "$cf_new_extra_cppflags" ; then
11564
11565         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11566 fi
11567
11568 cf_add_libs="$cf_pkgconfig_libs"
11569 # Filter out duplicates - this happens with badly-designed ".pc" files...
11570 for cf_add_1lib in $LIBS
11571 do
11572         for cf_add_2lib in $cf_add_libs
11573         do
11574                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11575                 then
11576                         cf_add_1lib=
11577                         break
11578                 fi
11579         done
11580         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11581 done
11582 LIBS="$cf_add_libs"
11583
11584         :
11585 else
11586         cf_pkgconfig_incs=
11587         cf_pkgconfig_libs=
11588         { echo "$as_me:11588: WARNING: unable to find Xt library" >&5
11589 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11590 fi
11591
11592 fi
11593
11594 cf_have_X_LIBS=no
11595
11596 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11597         test -n "$verbose" && echo "    found package xt" 1>&6
11598
11599 echo "${as_me:-configure}:11599: testing found package xt ..." 1>&5
11600
11601         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11602         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11603         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11604
11605 echo "${as_me:-configure}:11605: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11606
11607         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11608
11609 echo "${as_me:-configure}:11609: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11610
11611 cf_fix_cppflags=no
11612 cf_new_cflags=
11613 cf_new_cppflags=
11614 cf_new_extra_cppflags=
11615
11616 for cf_add_cflags in $cf_pkgconfig_incs
11617 do
11618 case $cf_fix_cppflags in
11619 (no)
11620         case $cf_add_cflags in
11621         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11622                 case $cf_add_cflags in
11623                 (-D*)
11624                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11625
11626                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11627                                 && test -z "${cf_tst_cflags}" \
11628                                 && cf_fix_cppflags=yes
11629
11630                         if test $cf_fix_cppflags = yes ; then
11631                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11632                                 continue
11633                         elif test "${cf_tst_cflags}" = "\"'" ; then
11634                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11635                                 continue
11636                         fi
11637                         ;;
11638                 esac
11639                 case "$CPPFLAGS" in
11640                 (*$cf_add_cflags)
11641                         ;;
11642                 (*)
11643                         case $cf_add_cflags in
11644                         (-D*)
11645                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11646
11647 CPPFLAGS=`echo "$CPPFLAGS" | \
11648         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11649                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11650
11651                                 ;;
11652                         esac
11653                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11654                         ;;
11655                 esac
11656                 ;;
11657         (*)
11658                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11659                 ;;
11660         esac
11661         ;;
11662 (yes)
11663         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11664
11665         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11666
11667         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11668                 && test -z "${cf_tst_cflags}" \
11669                 && cf_fix_cppflags=no
11670         ;;
11671 esac
11672 done
11673
11674 if test -n "$cf_new_cflags" ; then
11675
11676         CFLAGS="$CFLAGS $cf_new_cflags"
11677 fi
11678
11679 if test -n "$cf_new_cppflags" ; then
11680
11681         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11682 fi
11683
11684 if test -n "$cf_new_extra_cppflags" ; then
11685
11686         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11687 fi
11688
11689 cf_add_libs="$cf_pkgconfig_libs"
11690 # Filter out duplicates - this happens with badly-designed ".pc" files...
11691 for cf_add_1lib in $LIBS
11692 do
11693         for cf_add_2lib in $cf_add_libs
11694         do
11695                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11696                 then
11697                         cf_add_1lib=
11698                         break
11699                 fi
11700         done
11701         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11702 done
11703 LIBS="$cf_add_libs"
11704
11705         case "x$LIBS" in
11706         (*-lX11*)
11707                 ;;
11708         (*)
11709 # we have an "xt" package, but it may omit Xt's dependency on X11
11710 echo "$as_me:11710: checking for usable X dependency" >&5
11711 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11712 if test "${cf_cv_xt_x11_compat+set}" = set; then
11713   echo $ECHO_N "(cached) $ECHO_C" >&6
11714 else
11715
11716 cat >conftest.$ac_ext <<_ACEOF
11717 #line 11717 "configure"
11718 #include "confdefs.h"
11719
11720 #include <X11/Xlib.h>
11721
11722 int
11723 main ()
11724 {
11725
11726         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11727         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11728         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11729         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11730
11731   ;
11732   return 0;
11733 }
11734 _ACEOF
11735 rm -f conftest.$ac_objext conftest$ac_exeext
11736 if { (eval echo "$as_me:11736: \"$ac_link\"") >&5
11737   (eval $ac_link) 2>&5
11738   ac_status=$?
11739   echo "$as_me:11739: \$? = $ac_status" >&5
11740   (exit $ac_status); } &&
11741          { ac_try='test -s conftest$ac_exeext'
11742   { (eval echo "$as_me:11742: \"$ac_try\"") >&5
11743   (eval $ac_try) 2>&5
11744   ac_status=$?
11745   echo "$as_me:11745: \$? = $ac_status" >&5
11746   (exit $ac_status); }; }; then
11747   cf_cv_xt_x11_compat=yes
11748 else
11749   echo "$as_me: failed program was:" >&5
11750 cat conftest.$ac_ext >&5
11751 cf_cv_xt_x11_compat=no
11752 fi
11753 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11754 fi
11755 echo "$as_me:11755: result: $cf_cv_xt_x11_compat" >&5
11756 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11757                 if test "$cf_cv_xt_x11_compat" = no
11758                 then
11759                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11760
11761 echo "${as_me:-configure}:11761: testing work around broken X11 dependency ..." 1>&5
11762
11763                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11764
11765 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11766         test -n "$verbose" && echo "    found package x11" 1>&6
11767
11768 echo "${as_me:-configure}:11768: testing found package x11 ..." 1>&5
11769
11770         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11771         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11772         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11773
11774 echo "${as_me:-configure}:11774: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11775
11776         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11777
11778 echo "${as_me:-configure}:11778: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11779
11780 cf_fix_cppflags=no
11781 cf_new_cflags=
11782 cf_new_cppflags=
11783 cf_new_extra_cppflags=
11784
11785 for cf_add_cflags in $cf_pkgconfig_incs
11786 do
11787 case $cf_fix_cppflags in
11788 (no)
11789         case $cf_add_cflags in
11790         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11791                 case $cf_add_cflags in
11792                 (-D*)
11793                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11794
11795                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11796                                 && test -z "${cf_tst_cflags}" \
11797                                 && cf_fix_cppflags=yes
11798
11799                         if test $cf_fix_cppflags = yes ; then
11800                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11801                                 continue
11802                         elif test "${cf_tst_cflags}" = "\"'" ; then
11803                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11804                                 continue
11805                         fi
11806                         ;;
11807                 esac
11808                 case "$CPPFLAGS" in
11809                 (*$cf_add_cflags)
11810                         ;;
11811                 (*)
11812                         case $cf_add_cflags in
11813                         (-D*)
11814                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11815
11816 CPPFLAGS=`echo "$CPPFLAGS" | \
11817         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11818                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11819
11820                                 ;;
11821                         esac
11822                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11823                         ;;
11824                 esac
11825                 ;;
11826         (*)
11827                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11828                 ;;
11829         esac
11830         ;;
11831 (yes)
11832         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11833
11834         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11835
11836         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11837                 && test -z "${cf_tst_cflags}" \
11838                 && cf_fix_cppflags=no
11839         ;;
11840 esac
11841 done
11842
11843 if test -n "$cf_new_cflags" ; then
11844
11845         CFLAGS="$CFLAGS $cf_new_cflags"
11846 fi
11847
11848 if test -n "$cf_new_cppflags" ; then
11849
11850         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11851 fi
11852
11853 if test -n "$cf_new_extra_cppflags" ; then
11854
11855         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11856 fi
11857
11858 cf_add_libs="$cf_pkgconfig_libs"
11859 # Filter out duplicates - this happens with badly-designed ".pc" files...
11860 for cf_add_1lib in $LIBS
11861 do
11862         for cf_add_2lib in $cf_add_libs
11863         do
11864                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11865                 then
11866                         cf_add_1lib=
11867                         break
11868                 fi
11869         done
11870         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11871 done
11872 LIBS="$cf_add_libs"
11873
11874         :
11875 else
11876         cf_pkgconfig_incs=
11877         cf_pkgconfig_libs=
11878
11879 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11880
11881 echo "${as_me:-configure}:11881: testing ...before $LIBS ..." 1>&5
11882
11883 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
11884 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11885
11886 echo "${as_me:-configure}:11886: testing ...after  $LIBS ..." 1>&5
11887
11888 fi
11889
11890                 fi
11891                 ;;
11892         esac
11893
11894 echo "$as_me:11894: checking for usable X Toolkit package" >&5
11895 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11896 if test "${cf_cv_xt_ice_compat+set}" = set; then
11897   echo $ECHO_N "(cached) $ECHO_C" >&6
11898 else
11899
11900 cat >conftest.$ac_ext <<_ACEOF
11901 #line 11901 "configure"
11902 #include "confdefs.h"
11903
11904 #include <X11/Shell.h>
11905
11906 int
11907 main ()
11908 {
11909 int num = IceConnectionNumber(0)
11910
11911   ;
11912   return 0;
11913 }
11914 _ACEOF
11915 rm -f conftest.$ac_objext conftest$ac_exeext
11916 if { (eval echo "$as_me:11916: \"$ac_link\"") >&5
11917   (eval $ac_link) 2>&5
11918   ac_status=$?
11919   echo "$as_me:11919: \$? = $ac_status" >&5
11920   (exit $ac_status); } &&
11921          { ac_try='test -s conftest$ac_exeext'
11922   { (eval echo "$as_me:11922: \"$ac_try\"") >&5
11923   (eval $ac_try) 2>&5
11924   ac_status=$?
11925   echo "$as_me:11925: \$? = $ac_status" >&5
11926   (exit $ac_status); }; }; then
11927   cf_cv_xt_ice_compat=yes
11928 else
11929   echo "$as_me: failed program was:" >&5
11930 cat conftest.$ac_ext >&5
11931 cf_cv_xt_ice_compat=no
11932 fi
11933 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11934 fi
11935 echo "$as_me:11935: result: $cf_cv_xt_ice_compat" >&5
11936 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11937
11938         if test "$cf_cv_xt_ice_compat" = no
11939         then
11940                 # workaround for broken ".pc" files used for X Toolkit.
11941                 case "x$X_PRE_LIBS" in
11942                 (*-lICE*)
11943                         case "x$LIBS" in
11944                         (*-lICE*)
11945                                 ;;
11946                         (*)
11947                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11948
11949 echo "${as_me:-configure}:11949: testing work around broken ICE dependency ..." 1>&5
11950
11951 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11952         test -n "$verbose" && echo "    found package ice" 1>&6
11953
11954 echo "${as_me:-configure}:11954: testing found package ice ..." 1>&5
11955
11956         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11957         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11958         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11959
11960 echo "${as_me:-configure}:11960: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11961
11962         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11963
11964 echo "${as_me:-configure}:11964: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11965
11966 cf_fix_cppflags=no
11967 cf_new_cflags=
11968 cf_new_cppflags=
11969 cf_new_extra_cppflags=
11970
11971 for cf_add_cflags in $cf_pkgconfig_incs
11972 do
11973 case $cf_fix_cppflags in
11974 (no)
11975         case $cf_add_cflags in
11976         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11977                 case $cf_add_cflags in
11978                 (-D*)
11979                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11980
11981                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11982                                 && test -z "${cf_tst_cflags}" \
11983                                 && cf_fix_cppflags=yes
11984
11985                         if test $cf_fix_cppflags = yes ; then
11986                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11987                                 continue
11988                         elif test "${cf_tst_cflags}" = "\"'" ; then
11989                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11990                                 continue
11991                         fi
11992                         ;;
11993                 esac
11994                 case "$CPPFLAGS" in
11995                 (*$cf_add_cflags)
11996                         ;;
11997                 (*)
11998                         case $cf_add_cflags in
11999                         (-D*)
12000                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12001
12002 CPPFLAGS=`echo "$CPPFLAGS" | \
12003         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12004                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12005
12006                                 ;;
12007                         esac
12008                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12009                         ;;
12010                 esac
12011                 ;;
12012         (*)
12013                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12014                 ;;
12015         esac
12016         ;;
12017 (yes)
12018         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12019
12020         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12021
12022         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12023                 && test -z "${cf_tst_cflags}" \
12024                 && cf_fix_cppflags=no
12025         ;;
12026 esac
12027 done
12028
12029 if test -n "$cf_new_cflags" ; then
12030
12031         CFLAGS="$CFLAGS $cf_new_cflags"
12032 fi
12033
12034 if test -n "$cf_new_cppflags" ; then
12035
12036         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12037 fi
12038
12039 if test -n "$cf_new_extra_cppflags" ; then
12040
12041         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12042 fi
12043
12044 cf_add_libs="$cf_pkgconfig_libs"
12045 # Filter out duplicates - this happens with badly-designed ".pc" files...
12046 for cf_add_1lib in $LIBS
12047 do
12048         for cf_add_2lib in $cf_add_libs
12049         do
12050                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12051                 then
12052                         cf_add_1lib=
12053                         break
12054                 fi
12055         done
12056         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12057 done
12058 LIBS="$cf_add_libs"
12059
12060 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12061         test -n "$verbose" && echo "    found package sm" 1>&6
12062
12063 echo "${as_me:-configure}:12063: testing found package sm ..." 1>&5
12064
12065         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12066         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12067         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12068
12069 echo "${as_me:-configure}:12069: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12070
12071         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12072
12073 echo "${as_me:-configure}:12073: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12074
12075 cf_fix_cppflags=no
12076 cf_new_cflags=
12077 cf_new_cppflags=
12078 cf_new_extra_cppflags=
12079
12080 for cf_add_cflags in $cf_pkgconfig_incs
12081 do
12082 case $cf_fix_cppflags in
12083 (no)
12084         case $cf_add_cflags in
12085         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12086                 case $cf_add_cflags in
12087                 (-D*)
12088                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12089
12090                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12091                                 && test -z "${cf_tst_cflags}" \
12092                                 && cf_fix_cppflags=yes
12093
12094                         if test $cf_fix_cppflags = yes ; then
12095                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12096                                 continue
12097                         elif test "${cf_tst_cflags}" = "\"'" ; then
12098                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12099                                 continue
12100                         fi
12101                         ;;
12102                 esac
12103                 case "$CPPFLAGS" in
12104                 (*$cf_add_cflags)
12105                         ;;
12106                 (*)
12107                         case $cf_add_cflags in
12108                         (-D*)
12109                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12110
12111 CPPFLAGS=`echo "$CPPFLAGS" | \
12112         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12113                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12114
12115                                 ;;
12116                         esac
12117                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12118                         ;;
12119                 esac
12120                 ;;
12121         (*)
12122                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12123                 ;;
12124         esac
12125         ;;
12126 (yes)
12127         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12128
12129         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12130
12131         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12132                 && test -z "${cf_tst_cflags}" \
12133                 && cf_fix_cppflags=no
12134         ;;
12135 esac
12136 done
12137
12138 if test -n "$cf_new_cflags" ; then
12139
12140         CFLAGS="$CFLAGS $cf_new_cflags"
12141 fi
12142
12143 if test -n "$cf_new_cppflags" ; then
12144
12145         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12146 fi
12147
12148 if test -n "$cf_new_extra_cppflags" ; then
12149
12150         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12151 fi
12152
12153 cf_add_libs="$cf_pkgconfig_libs"
12154 # Filter out duplicates - this happens with badly-designed ".pc" files...
12155 for cf_add_1lib in $LIBS
12156 do
12157         for cf_add_2lib in $cf_add_libs
12158         do
12159                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12160                 then
12161                         cf_add_1lib=
12162                         break
12163                 fi
12164         done
12165         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12166 done
12167 LIBS="$cf_add_libs"
12168
12169         :
12170 else
12171         cf_pkgconfig_incs=
12172         cf_pkgconfig_libs=
12173         :
12174 fi
12175
12176 else
12177         cf_pkgconfig_incs=
12178         cf_pkgconfig_libs=
12179
12180 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12181
12182 echo "${as_me:-configure}:12182: testing ...before $LIBS ..." 1>&5
12183
12184 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
12185 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12186
12187 echo "${as_me:-configure}:12187: testing ...after  $LIBS ..." 1>&5
12188
12189 fi
12190
12191                                 ;;
12192                         esac
12193                         ;;
12194                 esac
12195         fi
12196
12197         cf_have_X_LIBS=yes
12198
12199 else
12200         cf_pkgconfig_incs=
12201         cf_pkgconfig_libs=
12202
12203         LDFLAGS="$X_LIBS $LDFLAGS"
12204
12205 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12206
12207 echo "${as_me:-configure}:12207: testing checking additions to CFLAGS ..." 1>&5
12208
12209 cf_check_cflags="$CFLAGS"
12210 cf_check_cppflags="$CPPFLAGS"
12211
12212 cf_fix_cppflags=no
12213 cf_new_cflags=
12214 cf_new_cppflags=
12215 cf_new_extra_cppflags=
12216
12217 for cf_add_cflags in $X_CFLAGS
12218 do
12219 case $cf_fix_cppflags in
12220 (no)
12221         case $cf_add_cflags in
12222         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12223                 case $cf_add_cflags in
12224                 (-D*)
12225                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12226
12227                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12228                                 && test -z "${cf_tst_cflags}" \
12229                                 && cf_fix_cppflags=yes
12230
12231                         if test $cf_fix_cppflags = yes ; then
12232                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12233                                 continue
12234                         elif test "${cf_tst_cflags}" = "\"'" ; then
12235                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12236                                 continue
12237                         fi
12238                         ;;
12239                 esac
12240                 case "$CPPFLAGS" in
12241                 (*$cf_add_cflags)
12242                         ;;
12243                 (*)
12244                         case $cf_add_cflags in
12245                         (-D*)
12246                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12247
12248 CPPFLAGS=`echo "$CPPFLAGS" | \
12249         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12250                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12251
12252                                 ;;
12253                         esac
12254                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12255                         ;;
12256                 esac
12257                 ;;
12258         (*)
12259                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12260                 ;;
12261         esac
12262         ;;
12263 (yes)
12264         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12265
12266         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12267
12268         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12269                 && test -z "${cf_tst_cflags}" \
12270                 && cf_fix_cppflags=no
12271         ;;
12272 esac
12273 done
12274
12275 if test -n "$cf_new_cflags" ; then
12276         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12277
12278 echo "${as_me:-configure}:12278: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12279
12280         CFLAGS="$CFLAGS $cf_new_cflags"
12281 fi
12282
12283 if test -n "$cf_new_cppflags" ; then
12284         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12285
12286 echo "${as_me:-configure}:12286: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12287
12288         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12289 fi
12290
12291 if test -n "$cf_new_extra_cppflags" ; then
12292         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12293
12294 echo "${as_me:-configure}:12294: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12295
12296         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12297 fi
12298
12299 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12300 cat >conftest.$ac_ext <<_ACEOF
12301 #line 12301 "configure"
12302 #include "confdefs.h"
12303 #include <stdio.h>
12304 int
12305 main ()
12306 {
12307 printf("Hello world");
12308   ;
12309   return 0;
12310 }
12311 _ACEOF
12312 rm -f conftest.$ac_objext conftest$ac_exeext
12313 if { (eval echo "$as_me:12313: \"$ac_link\"") >&5
12314   (eval $ac_link) 2>&5
12315   ac_status=$?
12316   echo "$as_me:12316: \$? = $ac_status" >&5
12317   (exit $ac_status); } &&
12318          { ac_try='test -s conftest$ac_exeext'
12319   { (eval echo "$as_me:12319: \"$ac_try\"") >&5
12320   (eval $ac_try) 2>&5
12321   ac_status=$?
12322   echo "$as_me:12322: \$? = $ac_status" >&5
12323   (exit $ac_status); }; }; then
12324   :
12325 else
12326   echo "$as_me: failed program was:" >&5
12327 cat conftest.$ac_ext >&5
12328 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12329
12330 echo "${as_me:-configure}:12330: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12331
12332          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12333                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12334
12335 echo "${as_me:-configure}:12335: testing but keeping change to \$CPPFLAGS ..." 1>&5
12336
12337          fi
12338          CFLAGS="$cf_check_flags"
12339 fi
12340 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12341 fi
12342
12343         echo "$as_me:12343: checking for XOpenDisplay" >&5
12344 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12345 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12346   echo $ECHO_N "(cached) $ECHO_C" >&6
12347 else
12348   cat >conftest.$ac_ext <<_ACEOF
12349 #line 12349 "configure"
12350 #include "confdefs.h"
12351 /* System header to define __stub macros and hopefully few prototypes,
12352     which can conflict with char XOpenDisplay (); below.  */
12353 #include <assert.h>
12354 /* Override any gcc2 internal prototype to avoid an error.  */
12355 #ifdef __cplusplus
12356 extern "C"
12357 #endif
12358 /* We use char because int might match the return type of a gcc2
12359    builtin and then its argument prototype would still apply.  */
12360 char XOpenDisplay ();
12361 char (*f) ();
12362
12363 int
12364 main ()
12365 {
12366 /* The GNU C library defines this for functions which it implements
12367     to always fail with ENOSYS.  Some functions are actually named
12368     something starting with __ and the normal name is an alias.  */
12369 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12370 choke me
12371 #else
12372 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12373 #endif
12374
12375   ;
12376   return 0;
12377 }
12378 _ACEOF
12379 rm -f conftest.$ac_objext conftest$ac_exeext
12380 if { (eval echo "$as_me:12380: \"$ac_link\"") >&5
12381   (eval $ac_link) 2>&5
12382   ac_status=$?
12383   echo "$as_me:12383: \$? = $ac_status" >&5
12384   (exit $ac_status); } &&
12385          { ac_try='test -s conftest$ac_exeext'
12386   { (eval echo "$as_me:12386: \"$ac_try\"") >&5
12387   (eval $ac_try) 2>&5
12388   ac_status=$?
12389   echo "$as_me:12389: \$? = $ac_status" >&5
12390   (exit $ac_status); }; }; then
12391   ac_cv_func_XOpenDisplay=yes
12392 else
12393   echo "$as_me: failed program was:" >&5
12394 cat conftest.$ac_ext >&5
12395 ac_cv_func_XOpenDisplay=no
12396 fi
12397 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12398 fi
12399 echo "$as_me:12399: result: $ac_cv_func_XOpenDisplay" >&5
12400 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12401 if test $ac_cv_func_XOpenDisplay = yes; then
12402   :
12403 else
12404
12405         echo "$as_me:12405: checking for XOpenDisplay in -lX11" >&5
12406 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12407 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12408   echo $ECHO_N "(cached) $ECHO_C" >&6
12409 else
12410   ac_check_lib_save_LIBS=$LIBS
12411 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12412 cat >conftest.$ac_ext <<_ACEOF
12413 #line 12413 "configure"
12414 #include "confdefs.h"
12415
12416 /* Override any gcc2 internal prototype to avoid an error.  */
12417 #ifdef __cplusplus
12418 extern "C"
12419 #endif
12420 /* We use char because int might match the return type of a gcc2
12421    builtin and then its argument prototype would still apply.  */
12422 char XOpenDisplay ();
12423 int
12424 main ()
12425 {
12426 XOpenDisplay ();
12427   ;
12428   return 0;
12429 }
12430 _ACEOF
12431 rm -f conftest.$ac_objext conftest$ac_exeext
12432 if { (eval echo "$as_me:12432: \"$ac_link\"") >&5
12433   (eval $ac_link) 2>&5
12434   ac_status=$?
12435   echo "$as_me:12435: \$? = $ac_status" >&5
12436   (exit $ac_status); } &&
12437          { ac_try='test -s conftest$ac_exeext'
12438   { (eval echo "$as_me:12438: \"$ac_try\"") >&5
12439   (eval $ac_try) 2>&5
12440   ac_status=$?
12441   echo "$as_me:12441: \$? = $ac_status" >&5
12442   (exit $ac_status); }; }; then
12443   ac_cv_lib_X11_XOpenDisplay=yes
12444 else
12445   echo "$as_me: failed program was:" >&5
12446 cat conftest.$ac_ext >&5
12447 ac_cv_lib_X11_XOpenDisplay=no
12448 fi
12449 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12450 LIBS=$ac_check_lib_save_LIBS
12451 fi
12452 echo "$as_me:12452: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12453 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12454 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12455
12456 cf_add_libs="-lX11"
12457 # Filter out duplicates - this happens with badly-designed ".pc" files...
12458 for cf_add_1lib in $LIBS
12459 do
12460         for cf_add_2lib in $cf_add_libs
12461         do
12462                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12463                 then
12464                         cf_add_1lib=
12465                         break
12466                 fi
12467         done
12468         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12469 done
12470 LIBS="$cf_add_libs"
12471
12472 fi
12473
12474 fi
12475
12476         echo "$as_me:12476: checking for XtAppInitialize" >&5
12477 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12478 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12479   echo $ECHO_N "(cached) $ECHO_C" >&6
12480 else
12481   cat >conftest.$ac_ext <<_ACEOF
12482 #line 12482 "configure"
12483 #include "confdefs.h"
12484 /* System header to define __stub macros and hopefully few prototypes,
12485     which can conflict with char XtAppInitialize (); below.  */
12486 #include <assert.h>
12487 /* Override any gcc2 internal prototype to avoid an error.  */
12488 #ifdef __cplusplus
12489 extern "C"
12490 #endif
12491 /* We use char because int might match the return type of a gcc2
12492    builtin and then its argument prototype would still apply.  */
12493 char XtAppInitialize ();
12494 char (*f) ();
12495
12496 int
12497 main ()
12498 {
12499 /* The GNU C library defines this for functions which it implements
12500     to always fail with ENOSYS.  Some functions are actually named
12501     something starting with __ and the normal name is an alias.  */
12502 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12503 choke me
12504 #else
12505 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12506 #endif
12507
12508   ;
12509   return 0;
12510 }
12511 _ACEOF
12512 rm -f conftest.$ac_objext conftest$ac_exeext
12513 if { (eval echo "$as_me:12513: \"$ac_link\"") >&5
12514   (eval $ac_link) 2>&5
12515   ac_status=$?
12516   echo "$as_me:12516: \$? = $ac_status" >&5
12517   (exit $ac_status); } &&
12518          { ac_try='test -s conftest$ac_exeext'
12519   { (eval echo "$as_me:12519: \"$ac_try\"") >&5
12520   (eval $ac_try) 2>&5
12521   ac_status=$?
12522   echo "$as_me:12522: \$? = $ac_status" >&5
12523   (exit $ac_status); }; }; then
12524   ac_cv_func_XtAppInitialize=yes
12525 else
12526   echo "$as_me: failed program was:" >&5
12527 cat conftest.$ac_ext >&5
12528 ac_cv_func_XtAppInitialize=no
12529 fi
12530 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12531 fi
12532 echo "$as_me:12532: result: $ac_cv_func_XtAppInitialize" >&5
12533 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12534 if test $ac_cv_func_XtAppInitialize = yes; then
12535   :
12536 else
12537
12538         echo "$as_me:12538: checking for XtAppInitialize in -lXt" >&5
12539 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12540 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12541   echo $ECHO_N "(cached) $ECHO_C" >&6
12542 else
12543   ac_check_lib_save_LIBS=$LIBS
12544 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12545 cat >conftest.$ac_ext <<_ACEOF
12546 #line 12546 "configure"
12547 #include "confdefs.h"
12548
12549 /* Override any gcc2 internal prototype to avoid an error.  */
12550 #ifdef __cplusplus
12551 extern "C"
12552 #endif
12553 /* We use char because int might match the return type of a gcc2
12554    builtin and then its argument prototype would still apply.  */
12555 char XtAppInitialize ();
12556 int
12557 main ()
12558 {
12559 XtAppInitialize ();
12560   ;
12561   return 0;
12562 }
12563 _ACEOF
12564 rm -f conftest.$ac_objext conftest$ac_exeext
12565 if { (eval echo "$as_me:12565: \"$ac_link\"") >&5
12566   (eval $ac_link) 2>&5
12567   ac_status=$?
12568   echo "$as_me:12568: \$? = $ac_status" >&5
12569   (exit $ac_status); } &&
12570          { ac_try='test -s conftest$ac_exeext'
12571   { (eval echo "$as_me:12571: \"$ac_try\"") >&5
12572   (eval $ac_try) 2>&5
12573   ac_status=$?
12574   echo "$as_me:12574: \$? = $ac_status" >&5
12575   (exit $ac_status); }; }; then
12576   ac_cv_lib_Xt_XtAppInitialize=yes
12577 else
12578   echo "$as_me: failed program was:" >&5
12579 cat conftest.$ac_ext >&5
12580 ac_cv_lib_Xt_XtAppInitialize=no
12581 fi
12582 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12583 LIBS=$ac_check_lib_save_LIBS
12584 fi
12585 echo "$as_me:12585: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12586 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12587 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12588
12589 cat >>confdefs.h <<\EOF
12590 #define HAVE_LIBXT 1
12591 EOF
12592
12593                  cf_have_X_LIBS=Xt
12594                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12595 fi
12596
12597 fi
12598
12599 fi
12600
12601 if test $cf_have_X_LIBS = no ; then
12602         { echo "$as_me:12602: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12603 test program.  You will have to check and add the proper libraries by hand
12604 to makefile." >&5
12605 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12606 test program.  You will have to check and add the proper libraries by hand
12607 to makefile." >&2;}
12608 fi
12609
12610 cf_x_athena_root=$cf_x_athena
12611 cf_x_athena_inc=""
12612
12613 for cf_path in default \
12614         /usr/contrib/X11R6 \
12615         /usr/contrib/X11R5 \
12616         /usr/lib/X11R5 \
12617         /usr/local
12618 do
12619         if test -z "$cf_x_athena_inc" ; then
12620                 cf_save="$CPPFLAGS"
12621                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12622                 if test $cf_path != default ; then
12623                         CPPFLAGS="$cf_save -I$cf_path/include"
12624                         echo "$as_me:12624: checking for $cf_test in $cf_path" >&5
12625 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12626                 else
12627                         echo "$as_me:12627: checking for $cf_test" >&5
12628 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12629                 fi
12630                 cat >conftest.$ac_ext <<_ACEOF
12631 #line 12631 "configure"
12632 #include "confdefs.h"
12633
12634 #include <X11/Intrinsic.h>
12635 #include <$cf_test>
12636 int
12637 main ()
12638 {
12639
12640   ;
12641   return 0;
12642 }
12643 _ACEOF
12644 rm -f conftest.$ac_objext
12645 if { (eval echo "$as_me:12645: \"$ac_compile\"") >&5
12646   (eval $ac_compile) 2>&5
12647   ac_status=$?
12648   echo "$as_me:12648: \$? = $ac_status" >&5
12649   (exit $ac_status); } &&
12650          { ac_try='test -s conftest.$ac_objext'
12651   { (eval echo "$as_me:12651: \"$ac_try\"") >&5
12652   (eval $ac_try) 2>&5
12653   ac_status=$?
12654   echo "$as_me:12654: \$? = $ac_status" >&5
12655   (exit $ac_status); }; }; then
12656   cf_result=yes
12657 else
12658   echo "$as_me: failed program was:" >&5
12659 cat conftest.$ac_ext >&5
12660 cf_result=no
12661 fi
12662 rm -f conftest.$ac_objext conftest.$ac_ext
12663                 echo "$as_me:12663: result: $cf_result" >&5
12664 echo "${ECHO_T}$cf_result" >&6
12665                 if test "$cf_result" = yes ; then
12666                         cf_x_athena_inc=$cf_path
12667                         break
12668                 else
12669                         CPPFLAGS="$cf_save"
12670                 fi
12671         fi
12672 done
12673
12674 if test -z "$cf_x_athena_inc" ; then
12675         { echo "$as_me:12675: WARNING: Unable to successfully find Athena header files with test program" >&5
12676 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12677 elif test "$cf_x_athena_inc" != default ; then
12678         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12679 fi
12680
12681 cf_x_athena_root=$cf_x_athena
12682 cf_x_athena_lib=""
12683
12684 for cf_path in default \
12685         /usr/contrib/X11R6 \
12686         /usr/contrib/X11R5 \
12687         /usr/lib/X11R5 \
12688         /usr/local
12689 do
12690         for cf_lib in \
12691                 ${cf_x_athena_root} \
12692                 ${cf_x_athena_root}7 \
12693                 ${cf_x_athena_root}6
12694         do
12695         for cf_libs in \
12696                 "-l$cf_lib -lXmu" \
12697                 "-l$cf_lib -lXpm -lXmu" \
12698                 "-l${cf_lib}_s -lXmu_s"
12699         do
12700                 if test -z "$cf_x_athena_lib" ; then
12701                         cf_save="$LIBS"
12702                         cf_test=XawSimpleMenuAddGlobalActions
12703                         if test $cf_path != default ; then
12704
12705 cf_add_libs="-L$cf_path/lib $cf_libs"
12706 # Filter out duplicates - this happens with badly-designed ".pc" files...
12707 for cf_add_1lib in $LIBS
12708 do
12709         for cf_add_2lib in $cf_add_libs
12710         do
12711                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12712                 then
12713                         cf_add_1lib=
12714                         break
12715                 fi
12716         done
12717         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12718 done
12719 LIBS="$cf_add_libs"
12720
12721                                 echo "$as_me:12721: checking for $cf_libs in $cf_path" >&5
12722 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12723                         else
12724
12725 cf_add_libs="$cf_libs"
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                                 echo "$as_me:12741: checking for $cf_test in $cf_libs" >&5
12742 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12743                         fi
12744                         cat >conftest.$ac_ext <<_ACEOF
12745 #line 12745 "configure"
12746 #include "confdefs.h"
12747
12748 #include <X11/Intrinsic.h>
12749 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12750
12751 int
12752 main ()
12753 {
12754
12755 $cf_test((XtAppContext) 0)
12756   ;
12757   return 0;
12758 }
12759 _ACEOF
12760 rm -f conftest.$ac_objext conftest$ac_exeext
12761 if { (eval echo "$as_me:12761: \"$ac_link\"") >&5
12762   (eval $ac_link) 2>&5
12763   ac_status=$?
12764   echo "$as_me:12764: \$? = $ac_status" >&5
12765   (exit $ac_status); } &&
12766          { ac_try='test -s conftest$ac_exeext'
12767   { (eval echo "$as_me:12767: \"$ac_try\"") >&5
12768   (eval $ac_try) 2>&5
12769   ac_status=$?
12770   echo "$as_me:12770: \$? = $ac_status" >&5
12771   (exit $ac_status); }; }; then
12772   cf_result=yes
12773 else
12774   echo "$as_me: failed program was:" >&5
12775 cat conftest.$ac_ext >&5
12776 cf_result=no
12777 fi
12778 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12779                         echo "$as_me:12779: result: $cf_result" >&5
12780 echo "${ECHO_T}$cf_result" >&6
12781                         if test "$cf_result" = yes ; then
12782                                 cf_x_athena_lib="$cf_libs"
12783                                 break
12784                         fi
12785                         LIBS="$cf_save"
12786                 fi
12787         done # cf_libs
12788                 test -n "$cf_x_athena_lib" && break
12789         done # cf_lib
12790 done
12791
12792 if test -z "$cf_x_athena_lib" ; then
12793         { { echo "$as_me:12793: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12794 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12795    { (exit 1); exit 1; }; }
12796 fi
12797
12798 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12799
12800 cat >>confdefs.h <<EOF
12801 #define $cf_x_athena_LIBS 1
12802 EOF
12803
12804 fi
12805
12806 if test -n "$ac_tool_prefix"; then
12807   for ac_prog in xcurses-config
12808   do
12809     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12810 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12811 echo "$as_me:12811: checking for $ac_word" >&5
12812 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12813 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12814   echo $ECHO_N "(cached) $ECHO_C" >&6
12815 else
12816   if test -n "$XCURSES_CONFIG"; then
12817   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12818 else
12819   ac_save_IFS=$IFS; IFS=$ac_path_separator
12820 ac_dummy="$PATH"
12821 for ac_dir in $ac_dummy; do
12822   IFS=$ac_save_IFS
12823   test -z "$ac_dir" && ac_dir=.
12824   $as_executable_p "$ac_dir/$ac_word" || continue
12825 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12826 echo "$as_me:12826: found $ac_dir/$ac_word" >&5
12827 break
12828 done
12829
12830 fi
12831 fi
12832 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12833 if test -n "$XCURSES_CONFIG"; then
12834   echo "$as_me:12834: result: $XCURSES_CONFIG" >&5
12835 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12836 else
12837   echo "$as_me:12837: result: no" >&5
12838 echo "${ECHO_T}no" >&6
12839 fi
12840
12841     test -n "$XCURSES_CONFIG" && break
12842   done
12843 fi
12844 if test -z "$XCURSES_CONFIG"; then
12845   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12846   for ac_prog in xcurses-config
12847 do
12848   # Extract the first word of "$ac_prog", so it can be a program name with args.
12849 set dummy $ac_prog; ac_word=$2
12850 echo "$as_me:12850: checking for $ac_word" >&5
12851 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12852 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12853   echo $ECHO_N "(cached) $ECHO_C" >&6
12854 else
12855   if test -n "$ac_ct_XCURSES_CONFIG"; then
12856   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12857 else
12858   ac_save_IFS=$IFS; IFS=$ac_path_separator
12859 ac_dummy="$PATH"
12860 for ac_dir in $ac_dummy; do
12861   IFS=$ac_save_IFS
12862   test -z "$ac_dir" && ac_dir=.
12863   $as_executable_p "$ac_dir/$ac_word" || continue
12864 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12865 echo "$as_me:12865: found $ac_dir/$ac_word" >&5
12866 break
12867 done
12868
12869 fi
12870 fi
12871 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12872 if test -n "$ac_ct_XCURSES_CONFIG"; then
12873   echo "$as_me:12873: result: $ac_ct_XCURSES_CONFIG" >&5
12874 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12875 else
12876   echo "$as_me:12876: result: no" >&5
12877 echo "${ECHO_T}no" >&6
12878 fi
12879
12880   test -n "$ac_ct_XCURSES_CONFIG" && break
12881 done
12882 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12883
12884   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12885 fi
12886
12887 if test "$XCURSES_CONFIG" != none ; then
12888
12889 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12890
12891 cf_add_libs="`$XCURSES_CONFIG --libs`"
12892 # Filter out duplicates - this happens with badly-designed ".pc" files...
12893 for cf_add_1lib in $LIBS
12894 do
12895         for cf_add_2lib in $cf_add_libs
12896         do
12897                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12898                 then
12899                         cf_add_1lib=
12900                         break
12901                 fi
12902         done
12903         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12904 done
12905 LIBS="$cf_add_libs"
12906
12907 cf_cv_lib_XCurses=yes
12908
12909 else
12910
12911 LDFLAGS="$LDFLAGS $X_LIBS"
12912
12913 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12914
12915 echo "${as_me:-configure}:12915: testing checking additions to CFLAGS ..." 1>&5
12916
12917 cf_check_cflags="$CFLAGS"
12918 cf_check_cppflags="$CPPFLAGS"
12919
12920 cf_fix_cppflags=no
12921 cf_new_cflags=
12922 cf_new_cppflags=
12923 cf_new_extra_cppflags=
12924
12925 for cf_add_cflags in $X_CFLAGS
12926 do
12927 case $cf_fix_cppflags in
12928 (no)
12929         case $cf_add_cflags in
12930         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12931                 case $cf_add_cflags in
12932                 (-D*)
12933                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12934
12935                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12936                                 && test -z "${cf_tst_cflags}" \
12937                                 && cf_fix_cppflags=yes
12938
12939                         if test $cf_fix_cppflags = yes ; then
12940                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12941                                 continue
12942                         elif test "${cf_tst_cflags}" = "\"'" ; then
12943                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12944                                 continue
12945                         fi
12946                         ;;
12947                 esac
12948                 case "$CPPFLAGS" in
12949                 (*$cf_add_cflags)
12950                         ;;
12951                 (*)
12952                         case $cf_add_cflags in
12953                         (-D*)
12954                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12955
12956 CPPFLAGS=`echo "$CPPFLAGS" | \
12957         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12958                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12959
12960                                 ;;
12961                         esac
12962                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12963                         ;;
12964                 esac
12965                 ;;
12966         (*)
12967                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12968                 ;;
12969         esac
12970         ;;
12971 (yes)
12972         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12973
12974         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12975
12976         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12977                 && test -z "${cf_tst_cflags}" \
12978                 && cf_fix_cppflags=no
12979         ;;
12980 esac
12981 done
12982
12983 if test -n "$cf_new_cflags" ; then
12984         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12985
12986 echo "${as_me:-configure}:12986: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12987
12988         CFLAGS="$CFLAGS $cf_new_cflags"
12989 fi
12990
12991 if test -n "$cf_new_cppflags" ; then
12992         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12993
12994 echo "${as_me:-configure}:12994: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12995
12996         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12997 fi
12998
12999 if test -n "$cf_new_extra_cppflags" ; then
13000         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13001
13002 echo "${as_me:-configure}:13002: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13003
13004         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
13005 fi
13006
13007 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13008 cat >conftest.$ac_ext <<_ACEOF
13009 #line 13009 "configure"
13010 #include "confdefs.h"
13011 #include <stdio.h>
13012 int
13013 main ()
13014 {
13015 printf("Hello world");
13016   ;
13017   return 0;
13018 }
13019 _ACEOF
13020 rm -f conftest.$ac_objext conftest$ac_exeext
13021 if { (eval echo "$as_me:13021: \"$ac_link\"") >&5
13022   (eval $ac_link) 2>&5
13023   ac_status=$?
13024   echo "$as_me:13024: \$? = $ac_status" >&5
13025   (exit $ac_status); } &&
13026          { ac_try='test -s conftest$ac_exeext'
13027   { (eval echo "$as_me:13027: \"$ac_try\"") >&5
13028   (eval $ac_try) 2>&5
13029   ac_status=$?
13030   echo "$as_me:13030: \$? = $ac_status" >&5
13031   (exit $ac_status); }; }; then
13032   :
13033 else
13034   echo "$as_me: failed program was:" >&5
13035 cat conftest.$ac_ext >&5
13036 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13037
13038 echo "${as_me:-configure}:13038: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13039
13040          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13041                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13042
13043 echo "${as_me:-configure}:13043: testing but keeping change to \$CPPFLAGS ..." 1>&5
13044
13045          fi
13046          CFLAGS="$cf_check_flags"
13047 fi
13048 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13049 fi
13050
13051 echo "$as_me:13051: checking for XOpenDisplay in -lX11" >&5
13052 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13053 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13054   echo $ECHO_N "(cached) $ECHO_C" >&6
13055 else
13056   ac_check_lib_save_LIBS=$LIBS
13057 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13058 cat >conftest.$ac_ext <<_ACEOF
13059 #line 13059 "configure"
13060 #include "confdefs.h"
13061
13062 /* Override any gcc2 internal prototype to avoid an error.  */
13063 #ifdef __cplusplus
13064 extern "C"
13065 #endif
13066 /* We use char because int might match the return type of a gcc2
13067    builtin and then its argument prototype would still apply.  */
13068 char XOpenDisplay ();
13069 int
13070 main ()
13071 {
13072 XOpenDisplay ();
13073   ;
13074   return 0;
13075 }
13076 _ACEOF
13077 rm -f conftest.$ac_objext conftest$ac_exeext
13078 if { (eval echo "$as_me:13078: \"$ac_link\"") >&5
13079   (eval $ac_link) 2>&5
13080   ac_status=$?
13081   echo "$as_me:13081: \$? = $ac_status" >&5
13082   (exit $ac_status); } &&
13083          { ac_try='test -s conftest$ac_exeext'
13084   { (eval echo "$as_me:13084: \"$ac_try\"") >&5
13085   (eval $ac_try) 2>&5
13086   ac_status=$?
13087   echo "$as_me:13087: \$? = $ac_status" >&5
13088   (exit $ac_status); }; }; then
13089   ac_cv_lib_X11_XOpenDisplay=yes
13090 else
13091   echo "$as_me: failed program was:" >&5
13092 cat conftest.$ac_ext >&5
13093 ac_cv_lib_X11_XOpenDisplay=no
13094 fi
13095 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13096 LIBS=$ac_check_lib_save_LIBS
13097 fi
13098 echo "$as_me:13098: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13099 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13100 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13101
13102 cf_add_libs="-lX11"
13103 # Filter out duplicates - this happens with badly-designed ".pc" files...
13104 for cf_add_1lib in $LIBS
13105 do
13106         for cf_add_2lib in $cf_add_libs
13107         do
13108                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13109                 then
13110                         cf_add_1lib=
13111                         break
13112                 fi
13113         done
13114         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13115 done
13116 LIBS="$cf_add_libs"
13117
13118 fi
13119
13120 echo "$as_me:13120: checking for XCurses library" >&5
13121 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13122 if test "${cf_cv_lib_XCurses+set}" = set; then
13123   echo $ECHO_N "(cached) $ECHO_C" >&6
13124 else
13125
13126 cf_add_libs="-lXCurses"
13127 # Filter out duplicates - this happens with badly-designed ".pc" files...
13128 for cf_add_1lib in $LIBS
13129 do
13130         for cf_add_2lib in $cf_add_libs
13131         do
13132                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13133                 then
13134                         cf_add_1lib=
13135                         break
13136                 fi
13137         done
13138         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13139 done
13140 LIBS="$cf_add_libs"
13141
13142 cat >conftest.$ac_ext <<_ACEOF
13143 #line 13143 "configure"
13144 #include "confdefs.h"
13145
13146 #include <xcurses.h>
13147 char *XCursesProgramName = "test";
13148
13149 int
13150 main ()
13151 {
13152 XCursesExit();
13153   ;
13154   return 0;
13155 }
13156 _ACEOF
13157 rm -f conftest.$ac_objext conftest$ac_exeext
13158 if { (eval echo "$as_me:13158: \"$ac_link\"") >&5
13159   (eval $ac_link) 2>&5
13160   ac_status=$?
13161   echo "$as_me:13161: \$? = $ac_status" >&5
13162   (exit $ac_status); } &&
13163          { ac_try='test -s conftest$ac_exeext'
13164   { (eval echo "$as_me:13164: \"$ac_try\"") >&5
13165   (eval $ac_try) 2>&5
13166   ac_status=$?
13167   echo "$as_me:13167: \$? = $ac_status" >&5
13168   (exit $ac_status); }; }; then
13169   cf_cv_lib_XCurses=yes
13170 else
13171   echo "$as_me: failed program was:" >&5
13172 cat conftest.$ac_ext >&5
13173 cf_cv_lib_XCurses=no
13174 fi
13175 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13176
13177 fi
13178 echo "$as_me:13178: result: $cf_cv_lib_XCurses" >&5
13179 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
13180
13181 fi
13182
13183 if test $cf_cv_lib_XCurses = yes ; then
13184
13185 cat >>confdefs.h <<\EOF
13186 #define UNIX 1
13187 EOF
13188
13189 cat >>confdefs.h <<\EOF
13190 #define XCURSES 1
13191 EOF
13192
13193         echo "$as_me:13193: checking for xcurses.h" >&5
13194 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
13195 if test "${ac_cv_header_xcurses_h+set}" = set; then
13196   echo $ECHO_N "(cached) $ECHO_C" >&6
13197 else
13198   cat >conftest.$ac_ext <<_ACEOF
13199 #line 13199 "configure"
13200 #include "confdefs.h"
13201 #include <xcurses.h>
13202 _ACEOF
13203 if { (eval echo "$as_me:13203: \"$ac_cpp conftest.$ac_ext\"") >&5
13204   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13205   ac_status=$?
13206   egrep -v '^ *\+' conftest.er1 >conftest.err
13207   rm -f conftest.er1
13208   cat conftest.err >&5
13209   echo "$as_me:13209: \$? = $ac_status" >&5
13210   (exit $ac_status); } >/dev/null; then
13211   if test -s conftest.err; then
13212     ac_cpp_err=$ac_c_preproc_warn_flag
13213   else
13214     ac_cpp_err=
13215   fi
13216 else
13217   ac_cpp_err=yes
13218 fi
13219 if test -z "$ac_cpp_err"; then
13220   ac_cv_header_xcurses_h=yes
13221 else
13222   echo "$as_me: failed program was:" >&5
13223   cat conftest.$ac_ext >&5
13224   ac_cv_header_xcurses_h=no
13225 fi
13226 rm -f conftest.err conftest.$ac_ext
13227 fi
13228 echo "$as_me:13228: result: $ac_cv_header_xcurses_h" >&5
13229 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
13230 if test $ac_cv_header_xcurses_h = yes; then
13231
13232 cat >>confdefs.h <<\EOF
13233 #define HAVE_XCURSES 1
13234 EOF
13235
13236 fi
13237
13238 else
13239         { { echo "$as_me:13239: error: Cannot link with XCurses" >&5
13240 echo "$as_me: error: Cannot link with XCurses" >&2;}
13241    { (exit 1); exit 1; }; }
13242 fi
13243
13244         ;;
13245 (*)
13246         { { echo "$as_me:13246: error: unexpected screen-value: $cf_cv_screen" >&5
13247 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
13248    { (exit 1); exit 1; }; }
13249         ;;
13250 esac
13251
13252 : ${cf_nculib_root:=$cf_cv_screen}
13253 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
13254 echo "$as_me:13254: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
13255 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
13256 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13257   echo $ECHO_N "(cached) $ECHO_C" >&6
13258 else
13259   ac_check_lib_save_LIBS=$LIBS
13260 LIBS="-l$cf_nculib_root  $LIBS"
13261 cat >conftest.$ac_ext <<_ACEOF
13262 #line 13262 "configure"
13263 #include "confdefs.h"
13264
13265 /* Override any gcc2 internal prototype to avoid an error.  */
13266 #ifdef __cplusplus
13267 extern "C"
13268 #endif
13269 /* We use char because int might match the return type of a gcc2
13270    builtin and then its argument prototype would still apply.  */
13271 char _nc_init_pthreads ();
13272 int
13273 main ()
13274 {
13275 _nc_init_pthreads ();
13276   ;
13277   return 0;
13278 }
13279 _ACEOF
13280 rm -f conftest.$ac_objext conftest$ac_exeext
13281 if { (eval echo "$as_me:13281: \"$ac_link\"") >&5
13282   (eval $ac_link) 2>&5
13283   ac_status=$?
13284   echo "$as_me:13284: \$? = $ac_status" >&5
13285   (exit $ac_status); } &&
13286          { ac_try='test -s conftest$ac_exeext'
13287   { (eval echo "$as_me:13287: \"$ac_try\"") >&5
13288   (eval $ac_try) 2>&5
13289   ac_status=$?
13290   echo "$as_me:13290: \$? = $ac_status" >&5
13291   (exit $ac_status); }; }; then
13292   eval "$as_ac_Lib=yes"
13293 else
13294   echo "$as_me: failed program was:" >&5
13295 cat conftest.$ac_ext >&5
13296 eval "$as_ac_Lib=no"
13297 fi
13298 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13299 LIBS=$ac_check_lib_save_LIBS
13300 fi
13301 echo "$as_me:13301: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13302 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13303 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13304   cf_cv_ncurses_pthreads=yes
13305 else
13306   cf_cv_ncurses_pthreads=no
13307 fi
13308
13309 if test "$cf_cv_ncurses_pthreads" = yes
13310 then
13311
13312 cf_add_libs="-lpthread"
13313 # Filter out duplicates - this happens with badly-designed ".pc" files...
13314 for cf_add_1lib in $LIBS
13315 do
13316         for cf_add_2lib in $cf_add_libs
13317         do
13318                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13319                 then
13320                         cf_add_1lib=
13321                         break
13322                 fi
13323         done
13324         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13325 done
13326 LIBS="$cf_add_libs"
13327
13328 fi
13329
13330 case $cf_cv_screen in
13331 (ncurses*)
13332         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
13333         ;;
13334 (curses|curses_*)
13335
13336 echo "$as_me:13336: checking for NetBSD form.h" >&5
13337 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
13338 if test "${cf_cv_netbsd_form_h+set}" = set; then
13339   echo $ECHO_N "(cached) $ECHO_C" >&6
13340 else
13341
13342 cat >conftest.$ac_ext <<_ACEOF
13343 #line 13343 "configure"
13344 #include "confdefs.h"
13345
13346 #include <${cf_cv_ncurses_header:-curses.h}>
13347 #include <form.h>
13348
13349 int
13350 main ()
13351 {
13352
13353         FORM *form;
13354         int y = current_field(form)->cursor_ypos;
13355         int x = current_field(form)->cursor_xpos;
13356
13357   ;
13358   return 0;
13359 }
13360 _ACEOF
13361 rm -f conftest.$ac_objext
13362 if { (eval echo "$as_me:13362: \"$ac_compile\"") >&5
13363   (eval $ac_compile) 2>&5
13364   ac_status=$?
13365   echo "$as_me:13365: \$? = $ac_status" >&5
13366   (exit $ac_status); } &&
13367          { ac_try='test -s conftest.$ac_objext'
13368   { (eval echo "$as_me:13368: \"$ac_try\"") >&5
13369   (eval $ac_try) 2>&5
13370   ac_status=$?
13371   echo "$as_me:13371: \$? = $ac_status" >&5
13372   (exit $ac_status); }; }; then
13373   cf_cv_netbsd_form_h=yes
13374
13375 else
13376   echo "$as_me: failed program was:" >&5
13377 cat conftest.$ac_ext >&5
13378 cf_cv_netbsd_form_h=no
13379 fi
13380 rm -f conftest.$ac_objext conftest.$ac_ext
13381
13382 fi
13383 echo "$as_me:13383: result: $cf_cv_netbsd_form_h" >&5
13384 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13385
13386 test "$cf_cv_netbsd_form_h" = yes &&
13387 cat >>confdefs.h <<\EOF
13388 #define HAVE_NETBSD_FORM_H 1
13389 EOF
13390
13391 echo "$as_me:13391: checking for NetBSD menu.h" >&5
13392 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13393 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13394   echo $ECHO_N "(cached) $ECHO_C" >&6
13395 else
13396
13397 cat >conftest.$ac_ext <<_ACEOF
13398 #line 13398 "configure"
13399 #include "confdefs.h"
13400
13401 #include <${cf_cv_ncurses_header:-curses.h}>
13402 #include <menu.h>
13403
13404 int
13405 main ()
13406 {
13407
13408         MENU *menu;
13409         int y = menu->max_item_width;
13410
13411   ;
13412   return 0;
13413 }
13414 _ACEOF
13415 rm -f conftest.$ac_objext
13416 if { (eval echo "$as_me:13416: \"$ac_compile\"") >&5
13417   (eval $ac_compile) 2>&5
13418   ac_status=$?
13419   echo "$as_me:13419: \$? = $ac_status" >&5
13420   (exit $ac_status); } &&
13421          { ac_try='test -s conftest.$ac_objext'
13422   { (eval echo "$as_me:13422: \"$ac_try\"") >&5
13423   (eval $ac_try) 2>&5
13424   ac_status=$?
13425   echo "$as_me:13425: \$? = $ac_status" >&5
13426   (exit $ac_status); }; }; then
13427   cf_cv_netbsd_menu_h=yes
13428
13429 else
13430   echo "$as_me: failed program was:" >&5
13431 cat conftest.$ac_ext >&5
13432 cf_cv_netbsd_menu_h=no
13433 fi
13434 rm -f conftest.$ac_objext conftest.$ac_ext
13435
13436 fi
13437 echo "$as_me:13437: result: $cf_cv_netbsd_menu_h" >&5
13438 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13439
13440 test "$cf_cv_netbsd_menu_h" = yes &&
13441 cat >>confdefs.h <<\EOF
13442 #define HAVE_NETBSD_MENU_H 1
13443 EOF
13444
13445         ;;
13446 esac
13447
13448 case $cf_cv_screen in
13449 (pdcurses)
13450         ;;
13451 (*)
13452         # look for curses-related libraries
13453
13454 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13455 echo "$as_me:13455: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13456 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13457 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13458   echo $ECHO_N "(cached) $ECHO_C" >&6
13459 else
13460   ac_check_lib_save_LIBS=$LIBS
13461 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13462 cat >conftest.$ac_ext <<_ACEOF
13463 #line 13463 "configure"
13464 #include "confdefs.h"
13465
13466 /* Override any gcc2 internal prototype to avoid an error.  */
13467 #ifdef __cplusplus
13468 extern "C"
13469 #endif
13470 /* We use char because int might match the return type of a gcc2
13471    builtin and then its argument prototype would still apply.  */
13472 char new_panel ();
13473 int
13474 main ()
13475 {
13476 new_panel ();
13477   ;
13478   return 0;
13479 }
13480 _ACEOF
13481 rm -f conftest.$ac_objext conftest$ac_exeext
13482 if { (eval echo "$as_me:13482: \"$ac_link\"") >&5
13483   (eval $ac_link) 2>&5
13484   ac_status=$?
13485   echo "$as_me:13485: \$? = $ac_status" >&5
13486   (exit $ac_status); } &&
13487          { ac_try='test -s conftest$ac_exeext'
13488   { (eval echo "$as_me:13488: \"$ac_try\"") >&5
13489   (eval $ac_try) 2>&5
13490   ac_status=$?
13491   echo "$as_me:13491: \$? = $ac_status" >&5
13492   (exit $ac_status); }; }; then
13493   eval "$as_ac_Lib=yes"
13494 else
13495   echo "$as_me: failed program was:" >&5
13496 cat conftest.$ac_ext >&5
13497 eval "$as_ac_Lib=no"
13498 fi
13499 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13500 LIBS=$ac_check_lib_save_LIBS
13501 fi
13502 echo "$as_me:13502: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13503 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13504 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13505
13506 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13507
13508 cf_add_libs="-lpanel$cf_cv_libtype"
13509 # Filter out duplicates - this happens with badly-designed ".pc" files...
13510 for cf_add_1lib in $LIBS
13511 do
13512         for cf_add_2lib in $cf_add_libs
13513         do
13514                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13515                 then
13516                         cf_add_1lib=
13517                         break
13518                 fi
13519         done
13520         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13521 done
13522 LIBS="$cf_add_libs"
13523
13524 cat >>confdefs.h <<EOF
13525 #define $cf_upper 1
13526 EOF
13527
13528 fi
13529
13530 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13531 echo "$as_me:13531: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13532 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13533 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13534   echo $ECHO_N "(cached) $ECHO_C" >&6
13535 else
13536   ac_check_lib_save_LIBS=$LIBS
13537 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13538 cat >conftest.$ac_ext <<_ACEOF
13539 #line 13539 "configure"
13540 #include "confdefs.h"
13541
13542 /* Override any gcc2 internal prototype to avoid an error.  */
13543 #ifdef __cplusplus
13544 extern "C"
13545 #endif
13546 /* We use char because int might match the return type of a gcc2
13547    builtin and then its argument prototype would still apply.  */
13548 char menu_driver ();
13549 int
13550 main ()
13551 {
13552 menu_driver ();
13553   ;
13554   return 0;
13555 }
13556 _ACEOF
13557 rm -f conftest.$ac_objext conftest$ac_exeext
13558 if { (eval echo "$as_me:13558: \"$ac_link\"") >&5
13559   (eval $ac_link) 2>&5
13560   ac_status=$?
13561   echo "$as_me:13561: \$? = $ac_status" >&5
13562   (exit $ac_status); } &&
13563          { ac_try='test -s conftest$ac_exeext'
13564   { (eval echo "$as_me:13564: \"$ac_try\"") >&5
13565   (eval $ac_try) 2>&5
13566   ac_status=$?
13567   echo "$as_me:13567: \$? = $ac_status" >&5
13568   (exit $ac_status); }; }; then
13569   eval "$as_ac_Lib=yes"
13570 else
13571   echo "$as_me: failed program was:" >&5
13572 cat conftest.$ac_ext >&5
13573 eval "$as_ac_Lib=no"
13574 fi
13575 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13576 LIBS=$ac_check_lib_save_LIBS
13577 fi
13578 echo "$as_me:13578: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13579 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13580 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13581
13582 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13583
13584 cf_add_libs="-lmenu$cf_cv_libtype"
13585 # Filter out duplicates - this happens with badly-designed ".pc" files...
13586 for cf_add_1lib in $LIBS
13587 do
13588         for cf_add_2lib in $cf_add_libs
13589         do
13590                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13591                 then
13592                         cf_add_1lib=
13593                         break
13594                 fi
13595         done
13596         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13597 done
13598 LIBS="$cf_add_libs"
13599
13600 cat >>confdefs.h <<EOF
13601 #define $cf_upper 1
13602 EOF
13603
13604 fi
13605
13606 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13607 echo "$as_me:13607: checking for form_driver in -lform$cf_cv_libtype" >&5
13608 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13609 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13610   echo $ECHO_N "(cached) $ECHO_C" >&6
13611 else
13612   ac_check_lib_save_LIBS=$LIBS
13613 LIBS="-lform$cf_cv_libtype  $LIBS"
13614 cat >conftest.$ac_ext <<_ACEOF
13615 #line 13615 "configure"
13616 #include "confdefs.h"
13617
13618 /* Override any gcc2 internal prototype to avoid an error.  */
13619 #ifdef __cplusplus
13620 extern "C"
13621 #endif
13622 /* We use char because int might match the return type of a gcc2
13623    builtin and then its argument prototype would still apply.  */
13624 char form_driver ();
13625 int
13626 main ()
13627 {
13628 form_driver ();
13629   ;
13630   return 0;
13631 }
13632 _ACEOF
13633 rm -f conftest.$ac_objext conftest$ac_exeext
13634 if { (eval echo "$as_me:13634: \"$ac_link\"") >&5
13635   (eval $ac_link) 2>&5
13636   ac_status=$?
13637   echo "$as_me:13637: \$? = $ac_status" >&5
13638   (exit $ac_status); } &&
13639          { ac_try='test -s conftest$ac_exeext'
13640   { (eval echo "$as_me:13640: \"$ac_try\"") >&5
13641   (eval $ac_try) 2>&5
13642   ac_status=$?
13643   echo "$as_me:13643: \$? = $ac_status" >&5
13644   (exit $ac_status); }; }; then
13645   eval "$as_ac_Lib=yes"
13646 else
13647   echo "$as_me: failed program was:" >&5
13648 cat conftest.$ac_ext >&5
13649 eval "$as_ac_Lib=no"
13650 fi
13651 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13652 LIBS=$ac_check_lib_save_LIBS
13653 fi
13654 echo "$as_me:13654: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13655 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13656 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13657
13658 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13659
13660 cf_add_libs="-lform$cf_cv_libtype"
13661 # Filter out duplicates - this happens with badly-designed ".pc" files...
13662 for cf_add_1lib in $LIBS
13663 do
13664         for cf_add_2lib in $cf_add_libs
13665         do
13666                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13667                 then
13668                         cf_add_1lib=
13669                         break
13670                 fi
13671         done
13672         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13673 done
13674 LIBS="$cf_add_libs"
13675
13676 cat >>confdefs.h <<EOF
13677 #define $cf_upper 1
13678 EOF
13679
13680 fi
13681
13682         # look for curses-related headers
13683
13684 for ac_header in \
13685                 nc_alloc.h \
13686                 nomacros.h \
13687                 form.h \
13688                 menu.h \
13689                 panel.h \
13690                 term_entry.h \
13691
13692 do
13693 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13694 echo "$as_me:13694: checking for $ac_header" >&5
13695 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13696 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13697   echo $ECHO_N "(cached) $ECHO_C" >&6
13698 else
13699   cat >conftest.$ac_ext <<_ACEOF
13700 #line 13700 "configure"
13701 #include "confdefs.h"
13702 #include <$ac_header>
13703 _ACEOF
13704 if { (eval echo "$as_me:13704: \"$ac_cpp conftest.$ac_ext\"") >&5
13705   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13706   ac_status=$?
13707   egrep -v '^ *\+' conftest.er1 >conftest.err
13708   rm -f conftest.er1
13709   cat conftest.err >&5
13710   echo "$as_me:13710: \$? = $ac_status" >&5
13711   (exit $ac_status); } >/dev/null; then
13712   if test -s conftest.err; then
13713     ac_cpp_err=$ac_c_preproc_warn_flag
13714   else
13715     ac_cpp_err=
13716   fi
13717 else
13718   ac_cpp_err=yes
13719 fi
13720 if test -z "$ac_cpp_err"; then
13721   eval "$as_ac_Header=yes"
13722 else
13723   echo "$as_me: failed program was:" >&5
13724   cat conftest.$ac_ext >&5
13725   eval "$as_ac_Header=no"
13726 fi
13727 rm -f conftest.err conftest.$ac_ext
13728 fi
13729 echo "$as_me:13729: result: `eval echo '${'$as_ac_Header'}'`" >&5
13730 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13731 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13732   cat >>confdefs.h <<EOF
13733 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13734 EOF
13735
13736 fi
13737 done
13738
13739         ;;
13740 esac
13741
13742 echo "$as_me:13742: checking for ANSI C header files" >&5
13743 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13744 if test "${ac_cv_header_stdc+set}" = set; then
13745   echo $ECHO_N "(cached) $ECHO_C" >&6
13746 else
13747   cat >conftest.$ac_ext <<_ACEOF
13748 #line 13748 "configure"
13749 #include "confdefs.h"
13750 #include <stdlib.h>
13751 #include <stdarg.h>
13752 #include <string.h>
13753 #include <float.h>
13754
13755 _ACEOF
13756 if { (eval echo "$as_me:13756: \"$ac_cpp conftest.$ac_ext\"") >&5
13757   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13758   ac_status=$?
13759   egrep -v '^ *\+' conftest.er1 >conftest.err
13760   rm -f conftest.er1
13761   cat conftest.err >&5
13762   echo "$as_me:13762: \$? = $ac_status" >&5
13763   (exit $ac_status); } >/dev/null; then
13764   if test -s conftest.err; then
13765     ac_cpp_err=$ac_c_preproc_warn_flag
13766   else
13767     ac_cpp_err=
13768   fi
13769 else
13770   ac_cpp_err=yes
13771 fi
13772 if test -z "$ac_cpp_err"; then
13773   ac_cv_header_stdc=yes
13774 else
13775   echo "$as_me: failed program was:" >&5
13776   cat conftest.$ac_ext >&5
13777   ac_cv_header_stdc=no
13778 fi
13779 rm -f conftest.err conftest.$ac_ext
13780
13781 if test $ac_cv_header_stdc = yes; then
13782   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13783   cat >conftest.$ac_ext <<_ACEOF
13784 #line 13784 "configure"
13785 #include "confdefs.h"
13786 #include <string.h>
13787
13788 _ACEOF
13789 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13790   egrep "memchr" >/dev/null 2>&1; then
13791   :
13792 else
13793   ac_cv_header_stdc=no
13794 fi
13795 rm -rf conftest*
13796
13797 fi
13798
13799 if test $ac_cv_header_stdc = yes; then
13800   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13801   cat >conftest.$ac_ext <<_ACEOF
13802 #line 13802 "configure"
13803 #include "confdefs.h"
13804 #include <stdlib.h>
13805
13806 _ACEOF
13807 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13808   egrep "free" >/dev/null 2>&1; then
13809   :
13810 else
13811   ac_cv_header_stdc=no
13812 fi
13813 rm -rf conftest*
13814
13815 fi
13816
13817 if test $ac_cv_header_stdc = yes; then
13818   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13819   if test "$cross_compiling" = yes; then
13820   :
13821 else
13822   cat >conftest.$ac_ext <<_ACEOF
13823 #line 13823 "configure"
13824 #include "confdefs.h"
13825 #include <ctype.h>
13826 #if ((' ' & 0x0FF) == 0x020)
13827 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13828 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13829 #else
13830 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13831                      || ('j' <= (c) && (c) <= 'r') \
13832                      || ('s' <= (c) && (c) <= 'z'))
13833 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13834 #endif
13835
13836 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13837 int
13838 main ()
13839 {
13840   int i;
13841   for (i = 0; i < 256; i++)
13842     if (XOR (islower (i), ISLOWER (i))
13843         || toupper (i) != TOUPPER (i))
13844       $ac_main_return(2);
13845   $ac_main_return (0);
13846 }
13847 _ACEOF
13848 rm -f conftest$ac_exeext
13849 if { (eval echo "$as_me:13849: \"$ac_link\"") >&5
13850   (eval $ac_link) 2>&5
13851   ac_status=$?
13852   echo "$as_me:13852: \$? = $ac_status" >&5
13853   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13854   { (eval echo "$as_me:13854: \"$ac_try\"") >&5
13855   (eval $ac_try) 2>&5
13856   ac_status=$?
13857   echo "$as_me:13857: \$? = $ac_status" >&5
13858   (exit $ac_status); }; }; then
13859   :
13860 else
13861   echo "$as_me: program exited with status $ac_status" >&5
13862 echo "$as_me: failed program was:" >&5
13863 cat conftest.$ac_ext >&5
13864 ac_cv_header_stdc=no
13865 fi
13866 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13867 fi
13868 fi
13869 fi
13870 echo "$as_me:13870: result: $ac_cv_header_stdc" >&5
13871 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13872 if test $ac_cv_header_stdc = yes; then
13873
13874 cat >>confdefs.h <<\EOF
13875 #define STDC_HEADERS 1
13876 EOF
13877
13878 fi
13879
13880 echo "$as_me:13880: checking whether time.h and sys/time.h may both be included" >&5
13881 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13882 if test "${ac_cv_header_time+set}" = set; then
13883   echo $ECHO_N "(cached) $ECHO_C" >&6
13884 else
13885   cat >conftest.$ac_ext <<_ACEOF
13886 #line 13886 "configure"
13887 #include "confdefs.h"
13888 #include <sys/types.h>
13889 #include <sys/time.h>
13890 #include <time.h>
13891
13892 int
13893 main ()
13894 {
13895 if ((struct tm *) 0)
13896 return 0;
13897   ;
13898   return 0;
13899 }
13900 _ACEOF
13901 rm -f conftest.$ac_objext
13902 if { (eval echo "$as_me:13902: \"$ac_compile\"") >&5
13903   (eval $ac_compile) 2>&5
13904   ac_status=$?
13905   echo "$as_me:13905: \$? = $ac_status" >&5
13906   (exit $ac_status); } &&
13907          { ac_try='test -s conftest.$ac_objext'
13908   { (eval echo "$as_me:13908: \"$ac_try\"") >&5
13909   (eval $ac_try) 2>&5
13910   ac_status=$?
13911   echo "$as_me:13911: \$? = $ac_status" >&5
13912   (exit $ac_status); }; }; then
13913   ac_cv_header_time=yes
13914 else
13915   echo "$as_me: failed program was:" >&5
13916 cat conftest.$ac_ext >&5
13917 ac_cv_header_time=no
13918 fi
13919 rm -f conftest.$ac_objext conftest.$ac_ext
13920 fi
13921 echo "$as_me:13921: result: $ac_cv_header_time" >&5
13922 echo "${ECHO_T}$ac_cv_header_time" >&6
13923 if test $ac_cv_header_time = yes; then
13924
13925 cat >>confdefs.h <<\EOF
13926 #define TIME_WITH_SYS_TIME 1
13927 EOF
13928
13929 fi
13930
13931 for ac_header in \
13932 getopt.h \
13933 locale.h \
13934 math.h \
13935 stdarg.h \
13936 sys/ioctl.h \
13937 sys/select.h \
13938 sys/time.h \
13939 termios.h \
13940 unistd.h \
13941
13942 do
13943 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13944 echo "$as_me:13944: checking for $ac_header" >&5
13945 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13946 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13947   echo $ECHO_N "(cached) $ECHO_C" >&6
13948 else
13949   cat >conftest.$ac_ext <<_ACEOF
13950 #line 13950 "configure"
13951 #include "confdefs.h"
13952 #include <$ac_header>
13953 _ACEOF
13954 if { (eval echo "$as_me:13954: \"$ac_cpp conftest.$ac_ext\"") >&5
13955   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13956   ac_status=$?
13957   egrep -v '^ *\+' conftest.er1 >conftest.err
13958   rm -f conftest.er1
13959   cat conftest.err >&5
13960   echo "$as_me:13960: \$? = $ac_status" >&5
13961   (exit $ac_status); } >/dev/null; then
13962   if test -s conftest.err; then
13963     ac_cpp_err=$ac_c_preproc_warn_flag
13964   else
13965     ac_cpp_err=
13966   fi
13967 else
13968   ac_cpp_err=yes
13969 fi
13970 if test -z "$ac_cpp_err"; then
13971   eval "$as_ac_Header=yes"
13972 else
13973   echo "$as_me: failed program was:" >&5
13974   cat conftest.$ac_ext >&5
13975   eval "$as_ac_Header=no"
13976 fi
13977 rm -f conftest.err conftest.$ac_ext
13978 fi
13979 echo "$as_me:13979: result: `eval echo '${'$as_ac_Header'}'`" >&5
13980 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13981 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13982   cat >>confdefs.h <<EOF
13983 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13984 EOF
13985
13986 fi
13987 done
13988
13989 for ac_header in unistd.h getopt.h
13990 do
13991 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13992 echo "$as_me:13992: checking for $ac_header" >&5
13993 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13994 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13995   echo $ECHO_N "(cached) $ECHO_C" >&6
13996 else
13997   cat >conftest.$ac_ext <<_ACEOF
13998 #line 13998 "configure"
13999 #include "confdefs.h"
14000 #include <$ac_header>
14001 _ACEOF
14002 if { (eval echo "$as_me:14002: \"$ac_cpp conftest.$ac_ext\"") >&5
14003   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14004   ac_status=$?
14005   egrep -v '^ *\+' conftest.er1 >conftest.err
14006   rm -f conftest.er1
14007   cat conftest.err >&5
14008   echo "$as_me:14008: \$? = $ac_status" >&5
14009   (exit $ac_status); } >/dev/null; then
14010   if test -s conftest.err; then
14011     ac_cpp_err=$ac_c_preproc_warn_flag
14012   else
14013     ac_cpp_err=
14014   fi
14015 else
14016   ac_cpp_err=yes
14017 fi
14018 if test -z "$ac_cpp_err"; then
14019   eval "$as_ac_Header=yes"
14020 else
14021   echo "$as_me: failed program was:" >&5
14022   cat conftest.$ac_ext >&5
14023   eval "$as_ac_Header=no"
14024 fi
14025 rm -f conftest.err conftest.$ac_ext
14026 fi
14027 echo "$as_me:14027: result: `eval echo '${'$as_ac_Header'}'`" >&5
14028 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14029 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14030   cat >>confdefs.h <<EOF
14031 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14032 EOF
14033
14034 fi
14035 done
14036
14037 echo "$as_me:14037: checking for header declaring getopt variables" >&5
14038 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
14039 if test "${cf_cv_getopt_header+set}" = set; then
14040   echo $ECHO_N "(cached) $ECHO_C" >&6
14041 else
14042
14043 cf_cv_getopt_header=none
14044 for cf_header in stdio.h stdlib.h unistd.h getopt.h
14045 do
14046 cat >conftest.$ac_ext <<_ACEOF
14047 #line 14047 "configure"
14048 #include "confdefs.h"
14049
14050 #include <$cf_header>
14051 int
14052 main ()
14053 {
14054 int x = optind; char *y = optarg
14055   ;
14056   return 0;
14057 }
14058 _ACEOF
14059 rm -f conftest.$ac_objext
14060 if { (eval echo "$as_me:14060: \"$ac_compile\"") >&5
14061   (eval $ac_compile) 2>&5
14062   ac_status=$?
14063   echo "$as_me:14063: \$? = $ac_status" >&5
14064   (exit $ac_status); } &&
14065          { ac_try='test -s conftest.$ac_objext'
14066   { (eval echo "$as_me:14066: \"$ac_try\"") >&5
14067   (eval $ac_try) 2>&5
14068   ac_status=$?
14069   echo "$as_me:14069: \$? = $ac_status" >&5
14070   (exit $ac_status); }; }; then
14071   cf_cv_getopt_header=$cf_header
14072  break
14073 else
14074   echo "$as_me: failed program was:" >&5
14075 cat conftest.$ac_ext >&5
14076 fi
14077 rm -f conftest.$ac_objext conftest.$ac_ext
14078 done
14079
14080 fi
14081 echo "$as_me:14081: result: $cf_cv_getopt_header" >&5
14082 echo "${ECHO_T}$cf_cv_getopt_header" >&6
14083 if test $cf_cv_getopt_header != none ; then
14084
14085 cat >>confdefs.h <<\EOF
14086 #define HAVE_GETOPT_HEADER 1
14087 EOF
14088
14089 fi
14090 if test $cf_cv_getopt_header = getopt.h ; then
14091
14092 cat >>confdefs.h <<\EOF
14093 #define NEED_GETOPT_H 1
14094 EOF
14095
14096 fi
14097
14098 for ac_func in \
14099 getopt \
14100 gettimeofday \
14101
14102 do
14103 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14104 echo "$as_me:14104: checking for $ac_func" >&5
14105 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14106 if eval "test \"\${$as_ac_var+set}\" = set"; then
14107   echo $ECHO_N "(cached) $ECHO_C" >&6
14108 else
14109   cat >conftest.$ac_ext <<_ACEOF
14110 #line 14110 "configure"
14111 #include "confdefs.h"
14112 /* System header to define __stub macros and hopefully few prototypes,
14113     which can conflict with char $ac_func (); below.  */
14114 #include <assert.h>
14115 /* Override any gcc2 internal prototype to avoid an error.  */
14116 #ifdef __cplusplus
14117 extern "C"
14118 #endif
14119 /* We use char because int might match the return type of a gcc2
14120    builtin and then its argument prototype would still apply.  */
14121 char $ac_func ();
14122 char (*f) ();
14123
14124 int
14125 main ()
14126 {
14127 /* The GNU C library defines this for functions which it implements
14128     to always fail with ENOSYS.  Some functions are actually named
14129     something starting with __ and the normal name is an alias.  */
14130 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14131 choke me
14132 #else
14133 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14134 #endif
14135
14136   ;
14137   return 0;
14138 }
14139 _ACEOF
14140 rm -f conftest.$ac_objext conftest$ac_exeext
14141 if { (eval echo "$as_me:14141: \"$ac_link\"") >&5
14142   (eval $ac_link) 2>&5
14143   ac_status=$?
14144   echo "$as_me:14144: \$? = $ac_status" >&5
14145   (exit $ac_status); } &&
14146          { ac_try='test -s conftest$ac_exeext'
14147   { (eval echo "$as_me:14147: \"$ac_try\"") >&5
14148   (eval $ac_try) 2>&5
14149   ac_status=$?
14150   echo "$as_me:14150: \$? = $ac_status" >&5
14151   (exit $ac_status); }; }; then
14152   eval "$as_ac_var=yes"
14153 else
14154   echo "$as_me: failed program was:" >&5
14155 cat conftest.$ac_ext >&5
14156 eval "$as_ac_var=no"
14157 fi
14158 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14159 fi
14160 echo "$as_me:14160: result: `eval echo '${'$as_ac_var'}'`" >&5
14161 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14162 if test `eval echo '${'$as_ac_var'}'` = yes; then
14163   cat >>confdefs.h <<EOF
14164 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14165 EOF
14166
14167 fi
14168 done
14169
14170 if test "x$ac_cv_func_getopt" = xno; then
14171         { { echo "$as_me:14171: error: getopt is required for building programs" >&5
14172 echo "$as_me: error: getopt is required for building programs" >&2;}
14173    { (exit 1); exit 1; }; }
14174 fi
14175
14176 if test "$cf_enable_widec" = yes; then
14177
14178 for ac_func in \
14179 mblen \
14180 mbrlen \
14181 mbrtowc \
14182 mbsrtowcs \
14183 mbstowcs \
14184 mbtowc \
14185 wcsrtombs \
14186 wcstombs \
14187
14188 do
14189 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14190 echo "$as_me:14190: checking for $ac_func" >&5
14191 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14192 if eval "test \"\${$as_ac_var+set}\" = set"; then
14193   echo $ECHO_N "(cached) $ECHO_C" >&6
14194 else
14195   cat >conftest.$ac_ext <<_ACEOF
14196 #line 14196 "configure"
14197 #include "confdefs.h"
14198 /* System header to define __stub macros and hopefully few prototypes,
14199     which can conflict with char $ac_func (); below.  */
14200 #include <assert.h>
14201 /* Override any gcc2 internal prototype to avoid an error.  */
14202 #ifdef __cplusplus
14203 extern "C"
14204 #endif
14205 /* We use char because int might match the return type of a gcc2
14206    builtin and then its argument prototype would still apply.  */
14207 char $ac_func ();
14208 char (*f) ();
14209
14210 int
14211 main ()
14212 {
14213 /* The GNU C library defines this for functions which it implements
14214     to always fail with ENOSYS.  Some functions are actually named
14215     something starting with __ and the normal name is an alias.  */
14216 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14217 choke me
14218 #else
14219 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14220 #endif
14221
14222   ;
14223   return 0;
14224 }
14225 _ACEOF
14226 rm -f conftest.$ac_objext conftest$ac_exeext
14227 if { (eval echo "$as_me:14227: \"$ac_link\"") >&5
14228   (eval $ac_link) 2>&5
14229   ac_status=$?
14230   echo "$as_me:14230: \$? = $ac_status" >&5
14231   (exit $ac_status); } &&
14232          { ac_try='test -s conftest$ac_exeext'
14233   { (eval echo "$as_me:14233: \"$ac_try\"") >&5
14234   (eval $ac_try) 2>&5
14235   ac_status=$?
14236   echo "$as_me:14236: \$? = $ac_status" >&5
14237   (exit $ac_status); }; }; then
14238   eval "$as_ac_var=yes"
14239 else
14240   echo "$as_me: failed program was:" >&5
14241 cat conftest.$ac_ext >&5
14242 eval "$as_ac_var=no"
14243 fi
14244 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14245 fi
14246 echo "$as_me:14246: result: `eval echo '${'$as_ac_var'}'`" >&5
14247 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14248 if test `eval echo '${'$as_ac_var'}'` = yes; then
14249   cat >>confdefs.h <<EOF
14250 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14251 EOF
14252
14253 fi
14254 done
14255
14256 fi
14257
14258 echo "$as_me:14258: checking definition to turn on extended curses functions" >&5
14259 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
14260 if test "${cf_cv_need_xopen_extension+set}" = set; then
14261   echo $ECHO_N "(cached) $ECHO_C" >&6
14262 else
14263
14264 cf_cv_need_xopen_extension=unknown
14265 cat >conftest.$ac_ext <<_ACEOF
14266 #line 14266 "configure"
14267 #include "confdefs.h"
14268
14269 #include <stdlib.h>
14270 #include <${cf_cv_ncurses_header:-curses.h}>
14271 int
14272 main ()
14273 {
14274
14275 #if defined(NCURSES_VERSION_PATCH)
14276 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
14277         make an error
14278 #endif
14279 #endif
14280 #ifdef NCURSES_VERSION
14281         cchar_t check;
14282         int check2 = curs_set((int)sizeof(check));
14283 #endif
14284         long x = winnstr(stdscr, "", 0);
14285         int x1, y1;
14286         getbegyx(stdscr, y1, x1)
14287   ;
14288   return 0;
14289 }
14290 _ACEOF
14291 rm -f conftest.$ac_objext conftest$ac_exeext
14292 if { (eval echo "$as_me:14292: \"$ac_link\"") >&5
14293   (eval $ac_link) 2>&5
14294   ac_status=$?
14295   echo "$as_me:14295: \$? = $ac_status" >&5
14296   (exit $ac_status); } &&
14297          { ac_try='test -s conftest$ac_exeext'
14298   { (eval echo "$as_me:14298: \"$ac_try\"") >&5
14299   (eval $ac_try) 2>&5
14300   ac_status=$?
14301   echo "$as_me:14301: \$? = $ac_status" >&5
14302   (exit $ac_status); }; }; then
14303   cf_cv_need_xopen_extension=none
14304 else
14305   echo "$as_me: failed program was:" >&5
14306 cat conftest.$ac_ext >&5
14307
14308         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
14309         do
14310                 cat >conftest.$ac_ext <<_ACEOF
14311 #line 14311 "configure"
14312 #include "confdefs.h"
14313
14314 #define $cf_try_xopen_extension 1
14315 #include <stdlib.h>
14316 #include <${cf_cv_ncurses_header:-curses.h}>
14317 int
14318 main ()
14319 {
14320
14321 #ifdef NCURSES_VERSION
14322                 cchar_t check;
14323                 int check2 = curs_set((int)sizeof(check));
14324 #endif
14325                 long x = winnstr(stdscr, "", 0);
14326                 int x1, y1;
14327                 getbegyx(stdscr, y1, x1)
14328   ;
14329   return 0;
14330 }
14331 _ACEOF
14332 rm -f conftest.$ac_objext conftest$ac_exeext
14333 if { (eval echo "$as_me:14333: \"$ac_link\"") >&5
14334   (eval $ac_link) 2>&5
14335   ac_status=$?
14336   echo "$as_me:14336: \$? = $ac_status" >&5
14337   (exit $ac_status); } &&
14338          { ac_try='test -s conftest$ac_exeext'
14339   { (eval echo "$as_me:14339: \"$ac_try\"") >&5
14340   (eval $ac_try) 2>&5
14341   ac_status=$?
14342   echo "$as_me:14342: \$? = $ac_status" >&5
14343   (exit $ac_status); }; }; then
14344   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
14345 else
14346   echo "$as_me: failed program was:" >&5
14347 cat conftest.$ac_ext >&5
14348 fi
14349 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14350         done
14351
14352 fi
14353 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14354
14355 fi
14356 echo "$as_me:14356: result: $cf_cv_need_xopen_extension" >&5
14357 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14358
14359 case $cf_cv_need_xopen_extension in
14360 (*_*)
14361         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
14362         ;;
14363 esac
14364
14365 echo "$as_me:14365: checking for term.h" >&5
14366 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14367 if test "${cf_cv_term_header+set}" = set; then
14368   echo $ECHO_N "(cached) $ECHO_C" >&6
14369 else
14370
14371 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14372 # for <term.h> if we do not find the variant.
14373
14374 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14375
14376 case ${cf_cv_ncurses_header:-curses.h} in
14377 (*/*)
14378         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14379         cf_header_list="$cf_header_item $cf_header_list"
14380         ;;
14381 esac
14382
14383 for cf_header in $cf_header_list
14384 do
14385         cat >conftest.$ac_ext <<_ACEOF
14386 #line 14386 "configure"
14387 #include "confdefs.h"
14388
14389 #include <${cf_cv_ncurses_header:-curses.h}>
14390 #include <${cf_header}>
14391 int
14392 main ()
14393 {
14394 WINDOW *x
14395   ;
14396   return 0;
14397 }
14398 _ACEOF
14399 rm -f conftest.$ac_objext
14400 if { (eval echo "$as_me:14400: \"$ac_compile\"") >&5
14401   (eval $ac_compile) 2>&5
14402   ac_status=$?
14403   echo "$as_me:14403: \$? = $ac_status" >&5
14404   (exit $ac_status); } &&
14405          { ac_try='test -s conftest.$ac_objext'
14406   { (eval echo "$as_me:14406: \"$ac_try\"") >&5
14407   (eval $ac_try) 2>&5
14408   ac_status=$?
14409   echo "$as_me:14409: \$? = $ac_status" >&5
14410   (exit $ac_status); }; }; then
14411   cf_cv_term_header=$cf_header
14412          break
14413 else
14414   echo "$as_me: failed program was:" >&5
14415 cat conftest.$ac_ext >&5
14416 cf_cv_term_header=no
14417 fi
14418 rm -f conftest.$ac_objext conftest.$ac_ext
14419 done
14420
14421 case $cf_cv_term_header in
14422 (no)
14423         # If curses is ncurses, some packagers still mess it up by trying to make
14424         # us use GNU termcap.  This handles the most common case.
14425         for cf_header in ncurses/term.h ncursesw/term.h
14426         do
14427                 cat >conftest.$ac_ext <<_ACEOF
14428 #line 14428 "configure"
14429 #include "confdefs.h"
14430
14431 #include <${cf_cv_ncurses_header:-curses.h}>
14432 #ifdef NCURSES_VERSION
14433 #include <${cf_header}>
14434 #else
14435 make an error
14436 #endif
14437 int
14438 main ()
14439 {
14440 WINDOW *x
14441   ;
14442   return 0;
14443 }
14444 _ACEOF
14445 rm -f conftest.$ac_objext
14446 if { (eval echo "$as_me:14446: \"$ac_compile\"") >&5
14447   (eval $ac_compile) 2>&5
14448   ac_status=$?
14449   echo "$as_me:14449: \$? = $ac_status" >&5
14450   (exit $ac_status); } &&
14451          { ac_try='test -s conftest.$ac_objext'
14452   { (eval echo "$as_me:14452: \"$ac_try\"") >&5
14453   (eval $ac_try) 2>&5
14454   ac_status=$?
14455   echo "$as_me:14455: \$? = $ac_status" >&5
14456   (exit $ac_status); }; }; then
14457   cf_cv_term_header=$cf_header
14458                          break
14459 else
14460   echo "$as_me: failed program was:" >&5
14461 cat conftest.$ac_ext >&5
14462 cf_cv_term_header=no
14463 fi
14464 rm -f conftest.$ac_objext conftest.$ac_ext
14465         done
14466         ;;
14467 esac
14468
14469 fi
14470 echo "$as_me:14470: result: $cf_cv_term_header" >&5
14471 echo "${ECHO_T}$cf_cv_term_header" >&6
14472
14473 case $cf_cv_term_header in
14474 (term.h)
14475
14476 cat >>confdefs.h <<\EOF
14477 #define HAVE_TERM_H 1
14478 EOF
14479
14480         ;;
14481 (ncurses/term.h)
14482
14483 cat >>confdefs.h <<\EOF
14484 #define HAVE_NCURSES_TERM_H 1
14485 EOF
14486
14487         ;;
14488 (ncursesw/term.h)
14489
14490 cat >>confdefs.h <<\EOF
14491 #define HAVE_NCURSESW_TERM_H 1
14492 EOF
14493
14494         ;;
14495 esac
14496
14497 echo "$as_me:14497: checking for unctrl.h" >&5
14498 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14499 if test "${cf_cv_unctrl_header+set}" = set; then
14500   echo $ECHO_N "(cached) $ECHO_C" >&6
14501 else
14502
14503 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14504 # for <unctrl.h> if we do not find the variant.
14505
14506 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14507
14508 case ${cf_cv_ncurses_header:-curses.h} in
14509 (*/*)
14510         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14511         cf_header_list="$cf_header_item $cf_header_list"
14512         ;;
14513 esac
14514
14515 for cf_header in $cf_header_list
14516 do
14517         cat >conftest.$ac_ext <<_ACEOF
14518 #line 14518 "configure"
14519 #include "confdefs.h"
14520
14521 #include <${cf_cv_ncurses_header:-curses.h}>
14522 #include <${cf_header}>
14523 int
14524 main ()
14525 {
14526 WINDOW *x
14527   ;
14528   return 0;
14529 }
14530 _ACEOF
14531 rm -f conftest.$ac_objext
14532 if { (eval echo "$as_me:14532: \"$ac_compile\"") >&5
14533   (eval $ac_compile) 2>&5
14534   ac_status=$?
14535   echo "$as_me:14535: \$? = $ac_status" >&5
14536   (exit $ac_status); } &&
14537          { ac_try='test -s conftest.$ac_objext'
14538   { (eval echo "$as_me:14538: \"$ac_try\"") >&5
14539   (eval $ac_try) 2>&5
14540   ac_status=$?
14541   echo "$as_me:14541: \$? = $ac_status" >&5
14542   (exit $ac_status); }; }; then
14543   cf_cv_unctrl_header=$cf_header
14544          break
14545 else
14546   echo "$as_me: failed program was:" >&5
14547 cat conftest.$ac_ext >&5
14548 cf_cv_unctrl_header=no
14549 fi
14550 rm -f conftest.$ac_objext conftest.$ac_ext
14551 done
14552
14553 fi
14554 echo "$as_me:14554: result: $cf_cv_unctrl_header" >&5
14555 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14556
14557 case $cf_cv_unctrl_header in
14558 (no)
14559         { echo "$as_me:14559: WARNING: unctrl.h header not found" >&5
14560 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14561         ;;
14562 esac
14563
14564 case $cf_cv_unctrl_header in
14565 (unctrl.h)
14566
14567 cat >>confdefs.h <<\EOF
14568 #define HAVE_UNCTRL_H 1
14569 EOF
14570
14571         ;;
14572 (ncurses/unctrl.h)
14573
14574 cat >>confdefs.h <<\EOF
14575 #define HAVE_NCURSES_UNCTRL_H 1
14576 EOF
14577
14578         ;;
14579 (ncursesw/unctrl.h)
14580
14581 cat >>confdefs.h <<\EOF
14582 #define HAVE_NCURSESW_UNCTRL_H 1
14583 EOF
14584
14585         ;;
14586 esac
14587
14588 for cf_func in \
14589 assume_default_colors \
14590 chgat \
14591 color_set \
14592 filter \
14593 getbegx \
14594 getcurx \
14595 getmaxx \
14596 getnstr \
14597 getparx \
14598 getwin \
14599 mvvline \
14600 mvwvline \
14601 napms \
14602 putwin \
14603 resize_term \
14604 resizeterm \
14605 restartterm \
14606 ripoffline \
14607 scr_dump \
14608 setupterm \
14609 slk_color \
14610 slk_init \
14611 termattrs \
14612 tgetent \
14613 tigetnum \
14614 tigetstr \
14615 typeahead \
14616 use_default_colors \
14617 use_env \
14618 use_extended_names \
14619 use_screen \
14620 use_window \
14621 vid_puts \
14622 vidputs \
14623 vsscanf \
14624 vw_printw \
14625 wchgat \
14626 winsstr \
14627 wresize \
14628 wsyncdown \
14629
14630 do
14631
14632 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14633
14634         echo "$as_me:14634: checking for ${cf_func}" >&5
14635 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14636
14637 echo "${as_me:-configure}:14637: testing ${cf_func} ..." 1>&5
14638
14639         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14640   echo $ECHO_N "(cached) $ECHO_C" >&6
14641 else
14642
14643                 eval cf_result='$ac_cv_func_'$cf_func
14644                 if test ".$cf_result" != ".no"; then
14645                         cat >conftest.$ac_ext <<_ACEOF
14646 #line 14646 "configure"
14647 #include "confdefs.h"
14648
14649 #ifdef HAVE_XCURSES
14650 #include <xcurses.h>
14651 char * XCursesProgramName = "test";
14652 #else
14653 #include <${cf_cv_ncurses_header:-curses.h}>
14654 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14655 #include <ncursesw/term.h>
14656 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14657 #include <ncurses/term.h>
14658 #elif defined(HAVE_TERM_H)
14659 #include <term.h>
14660 #endif
14661 #endif
14662
14663 int
14664 main ()
14665 {
14666
14667 #ifndef ${cf_func}
14668 long foo = (long)(&${cf_func});
14669 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14670 if (foo + 1234 > 5678)
14671         ${cf_cv_main_return:-return}(foo);
14672 #endif
14673
14674   ;
14675   return 0;
14676 }
14677 _ACEOF
14678 rm -f conftest.$ac_objext conftest$ac_exeext
14679 if { (eval echo "$as_me:14679: \"$ac_link\"") >&5
14680   (eval $ac_link) 2>&5
14681   ac_status=$?
14682   echo "$as_me:14682: \$? = $ac_status" >&5
14683   (exit $ac_status); } &&
14684          { ac_try='test -s conftest$ac_exeext'
14685   { (eval echo "$as_me:14685: \"$ac_try\"") >&5
14686   (eval $ac_try) 2>&5
14687   ac_status=$?
14688   echo "$as_me:14688: \$? = $ac_status" >&5
14689   (exit $ac_status); }; }; then
14690   cf_result=yes
14691 else
14692   echo "$as_me: failed program was:" >&5
14693 cat conftest.$ac_ext >&5
14694 cf_result=no
14695 fi
14696 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14697                 fi
14698                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14699
14700 fi
14701
14702         # use the computed/retrieved cache-value:
14703         eval 'cf_result=$cf_cv_func_'$cf_func
14704         echo "$as_me:14704: result: $cf_result" >&5
14705 echo "${ECHO_T}$cf_result" >&6
14706         if test $cf_result != no; then
14707                 cat >>confdefs.h <<EOF
14708 #define HAVE_${cf_tr_func} 1
14709 EOF
14710
14711         fi
14712 done
14713
14714 for cf_func in tputs
14715 do
14716
14717 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14718
14719         echo "$as_me:14719: checking for ${cf_func}" >&5
14720 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14721
14722 echo "${as_me:-configure}:14722: testing ${cf_func} ..." 1>&5
14723
14724         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14725   echo $ECHO_N "(cached) $ECHO_C" >&6
14726 else
14727
14728                 eval cf_result='$ac_cv_func_'$cf_func
14729                 if test ".$cf_result" != ".no"; then
14730                         cat >conftest.$ac_ext <<_ACEOF
14731 #line 14731 "configure"
14732 #include "confdefs.h"
14733
14734 #ifdef HAVE_XCURSES
14735 #include <xcurses.h>
14736 char * XCursesProgramName = "test";
14737 #else
14738 #include <${cf_cv_ncurses_header:-curses.h}>
14739 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14740 #include <ncursesw/term.h>
14741 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14742 #include <ncurses/term.h>
14743 #elif defined(HAVE_TERM_H)
14744 #include <term.h>
14745 #endif
14746 #endif
14747
14748 int
14749 main ()
14750 {
14751
14752 #ifndef ${cf_func}
14753 long foo = (long)(&${cf_func});
14754 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14755 if (foo + 1234 > 5678)
14756         ${cf_cv_main_return:-return}(foo);
14757 #endif
14758
14759   ;
14760   return 0;
14761 }
14762 _ACEOF
14763 rm -f conftest.$ac_objext conftest$ac_exeext
14764 if { (eval echo "$as_me:14764: \"$ac_link\"") >&5
14765   (eval $ac_link) 2>&5
14766   ac_status=$?
14767   echo "$as_me:14767: \$? = $ac_status" >&5
14768   (exit $ac_status); } &&
14769          { ac_try='test -s conftest$ac_exeext'
14770   { (eval echo "$as_me:14770: \"$ac_try\"") >&5
14771   (eval $ac_try) 2>&5
14772   ac_status=$?
14773   echo "$as_me:14773: \$? = $ac_status" >&5
14774   (exit $ac_status); }; }; then
14775   cf_result=yes
14776 else
14777   echo "$as_me: failed program was:" >&5
14778 cat conftest.$ac_ext >&5
14779 cf_result=no
14780 fi
14781 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14782                 fi
14783                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14784
14785 fi
14786
14787         # use the computed/retrieved cache-value:
14788         eval 'cf_result=$cf_cv_func_'$cf_func
14789         echo "$as_me:14789: result: $cf_result" >&5
14790 echo "${ECHO_T}$cf_result" >&6
14791         if test $cf_result != no; then
14792                 cat >>confdefs.h <<EOF
14793 #define HAVE_${cf_tr_func} 1
14794 EOF
14795
14796         fi
14797 done
14798
14799 if test x$cf_cv_func_tputs = xyes
14800 then
14801         cf_done=no
14802         for cf_arg in int char
14803         do
14804                 for cf_ret in int void
14805                 do
14806                         if test $cf_ret = void
14807                         then
14808                                 cf_return="/* nothing */"
14809                         else
14810                                 cf_return="return value"
14811                         fi
14812                         cat >conftest.$ac_ext <<_ACEOF
14813 #line 14813 "configure"
14814 #include "confdefs.h"
14815
14816 #include <${cf_cv_ncurses_header:-curses.h}>
14817 #include <$cf_cv_term_header>
14818
14819 static $cf_ret outc($cf_arg value) { $cf_return; }
14820
14821 int
14822 main ()
14823 {
14824
14825         tputs("hello", 0, outc);
14826         ${cf_cv_main_return:-return}(0);
14827
14828   ;
14829   return 0;
14830 }
14831 _ACEOF
14832 rm -f conftest.$ac_objext
14833 if { (eval echo "$as_me:14833: \"$ac_compile\"") >&5
14834   (eval $ac_compile) 2>&5
14835   ac_status=$?
14836   echo "$as_me:14836: \$? = $ac_status" >&5
14837   (exit $ac_status); } &&
14838          { ac_try='test -s conftest.$ac_objext'
14839   { (eval echo "$as_me:14839: \"$ac_try\"") >&5
14840   (eval $ac_try) 2>&5
14841   ac_status=$?
14842   echo "$as_me:14842: \$? = $ac_status" >&5
14843   (exit $ac_status); }; }; then
14844
14845                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14846
14847 echo "${as_me:-configure}:14847: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14848
14849                 cat >>confdefs.h <<EOF
14850 #define TPUTS_ARG               $cf_arg
14851 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14852 #define TPUTS_RETURN(value)     $cf_return
14853 EOF
14854                 cf_done=yes
14855                 break
14856
14857 else
14858   echo "$as_me: failed program was:" >&5
14859 cat conftest.$ac_ext >&5
14860 fi
14861 rm -f conftest.$ac_objext conftest.$ac_ext
14862                 done
14863                 test $cf_done = yes && break
14864         done
14865 fi
14866
14867 echo "$as_me:14867: checking for ncurses extended functions" >&5
14868 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14869 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14870   echo $ECHO_N "(cached) $ECHO_C" >&6
14871 else
14872
14873 cat >conftest.$ac_ext <<_ACEOF
14874 #line 14874 "configure"
14875 #include "confdefs.h"
14876
14877 #include <${cf_cv_ncurses_header:-curses.h}>
14878 int
14879 main ()
14880 {
14881
14882 int x = NCURSES_EXT_FUNCS
14883
14884   ;
14885   return 0;
14886 }
14887 _ACEOF
14888 rm -f conftest.$ac_objext
14889 if { (eval echo "$as_me:14889: \"$ac_compile\"") >&5
14890   (eval $ac_compile) 2>&5
14891   ac_status=$?
14892   echo "$as_me:14892: \$? = $ac_status" >&5
14893   (exit $ac_status); } &&
14894          { ac_try='test -s conftest.$ac_objext'
14895   { (eval echo "$as_me:14895: \"$ac_try\"") >&5
14896   (eval $ac_try) 2>&5
14897   ac_status=$?
14898   echo "$as_me:14898: \$? = $ac_status" >&5
14899   (exit $ac_status); }; }; then
14900   cf_cv_ncurses_ext_funcs=defined
14901 else
14902   echo "$as_me: failed program was:" >&5
14903 cat conftest.$ac_ext >&5
14904
14905 cat >conftest.$ac_ext <<_ACEOF
14906 #line 14906 "configure"
14907 #include "confdefs.h"
14908
14909 #include <${cf_cv_ncurses_header:-curses.h}>
14910 int
14911 main ()
14912 {
14913
14914         (void) assume_default_colors (0, 0);
14915         (void) curses_version ();
14916         (void) define_key (0, 0);
14917         (void) is_term_resized (0, 0);
14918         (void) key_defined (0);
14919         (void) keybound (0, 0);
14920         (void) keyok (0, 0);
14921         (void) resize_term (0, 0);
14922         (void) resizeterm (0, 0);
14923         (void) use_default_colors ();
14924         (void) use_extended_names (0);
14925         (void) wresize (0, 0, 0);
14926   ;
14927   return 0;
14928 }
14929 _ACEOF
14930 rm -f conftest.$ac_objext conftest$ac_exeext
14931 if { (eval echo "$as_me:14931: \"$ac_link\"") >&5
14932   (eval $ac_link) 2>&5
14933   ac_status=$?
14934   echo "$as_me:14934: \$? = $ac_status" >&5
14935   (exit $ac_status); } &&
14936          { ac_try='test -s conftest$ac_exeext'
14937   { (eval echo "$as_me:14937: \"$ac_try\"") >&5
14938   (eval $ac_try) 2>&5
14939   ac_status=$?
14940   echo "$as_me:14940: \$? = $ac_status" >&5
14941   (exit $ac_status); }; }; then
14942   cf_cv_ncurses_ext_funcs=yes
14943 else
14944   echo "$as_me: failed program was:" >&5
14945 cat conftest.$ac_ext >&5
14946 cf_cv_ncurses_ext_funcs=no
14947 fi
14948 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14949
14950 fi
14951 rm -f conftest.$ac_objext conftest.$ac_ext
14952
14953 fi
14954 echo "$as_me:14954: result: $cf_cv_ncurses_ext_funcs" >&5
14955 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14956 test "$cf_cv_ncurses_ext_funcs" = yes &&
14957 cat >>confdefs.h <<\EOF
14958 #define NCURSES_EXT_FUNCS 1
14959 EOF
14960
14961 if test "$cf_enable_widec" = yes
14962 then
14963         # workaround for systems with ncurses before 20111029, due to change of
14964         # feature test macro from _XPG5 to _XOPEN_SOURCE
14965         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14966         then
14967                 cf_define_xpg5=no
14968                 echo "$as_me:14968: checking if _XPG5 should be defined to enable wide-characters" >&5
14969 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14970
14971                 cat >conftest.$ac_ext <<_ACEOF
14972 #line 14972 "configure"
14973 #include "confdefs.h"
14974
14975 #include <${cf_cv_ncurses_header:-curses.h}>
14976 int
14977 main ()
14978 {
14979 int x = _XPG5
14980   ;
14981   return 0;
14982 }
14983 _ACEOF
14984 rm -f conftest.$ac_objext
14985 if { (eval echo "$as_me:14985: \"$ac_compile\"") >&5
14986   (eval $ac_compile) 2>&5
14987   ac_status=$?
14988   echo "$as_me:14988: \$? = $ac_status" >&5
14989   (exit $ac_status); } &&
14990          { ac_try='test -s conftest.$ac_objext'
14991   { (eval echo "$as_me:14991: \"$ac_try\"") >&5
14992   (eval $ac_try) 2>&5
14993   ac_status=$?
14994   echo "$as_me:14994: \$? = $ac_status" >&5
14995   (exit $ac_status); }; }; then
14996   :
14997 else
14998   echo "$as_me: failed program was:" >&5
14999 cat conftest.$ac_ext >&5
15000 cf_save_cppflags="$CPPFLAGS"
15001                          CPPFLAGS="$CPPFLAGS -D_XPG5"
15002                          cat >conftest.$ac_ext <<_ACEOF
15003 #line 15003 "configure"
15004 #include "confdefs.h"
15005
15006 #include <${cf_cv_ncurses_header:-curses.h}>
15007 int
15008 main ()
15009 {
15010 int x = _XPG5
15011   ;
15012   return 0;
15013 }
15014 _ACEOF
15015 rm -f conftest.$ac_objext
15016 if { (eval echo "$as_me:15016: \"$ac_compile\"") >&5
15017   (eval $ac_compile) 2>&5
15018   ac_status=$?
15019   echo "$as_me:15019: \$? = $ac_status" >&5
15020   (exit $ac_status); } &&
15021          { ac_try='test -s conftest.$ac_objext'
15022   { (eval echo "$as_me:15022: \"$ac_try\"") >&5
15023   (eval $ac_try) 2>&5
15024   ac_status=$?
15025   echo "$as_me:15025: \$? = $ac_status" >&5
15026   (exit $ac_status); }; }; then
15027   cf_define_xpg5=yes
15028 else
15029   echo "$as_me: failed program was:" >&5
15030 cat conftest.$ac_ext >&5
15031 fi
15032 rm -f conftest.$ac_objext conftest.$ac_ext
15033                          CPPFLAGS="$cf_save_cppflags"
15034 fi
15035 rm -f conftest.$ac_objext conftest.$ac_ext
15036                 echo "$as_me:15036: result: $cf_define_xpg5" >&5
15037 echo "${ECHO_T}$cf_define_xpg5" >&6
15038
15039                 if test "$cf_define_xpg5" = yes
15040                 then
15041                         CPPFLAGS="$CPPFLAGS -D_XPG5"
15042                 fi
15043         fi
15044
15045         echo "$as_me:15045: checking for wide-character functions" >&5
15046 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
15047 if test "${cf_cv_widechar_funcs+set}" = set; then
15048   echo $ECHO_N "(cached) $ECHO_C" >&6
15049 else
15050
15051         cat >conftest.$ac_ext <<_ACEOF
15052 #line 15052 "configure"
15053 #include "confdefs.h"
15054
15055 #include <${cf_cv_ncurses_header:-curses.h}>
15056 int
15057 main ()
15058 {
15059
15060                 static wchar_t src_wchar[2];
15061                 static cchar_t dst_cchar;
15062                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
15063
15064   ;
15065   return 0;
15066 }
15067 _ACEOF
15068 rm -f conftest.$ac_objext conftest$ac_exeext
15069 if { (eval echo "$as_me:15069: \"$ac_link\"") >&5
15070   (eval $ac_link) 2>&5
15071   ac_status=$?
15072   echo "$as_me:15072: \$? = $ac_status" >&5
15073   (exit $ac_status); } &&
15074          { ac_try='test -s conftest$ac_exeext'
15075   { (eval echo "$as_me:15075: \"$ac_try\"") >&5
15076   (eval $ac_try) 2>&5
15077   ac_status=$?
15078   echo "$as_me:15078: \$? = $ac_status" >&5
15079   (exit $ac_status); }; }; then
15080   cf_cv_widechar_funcs=yes
15081 else
15082   echo "$as_me: failed program was:" >&5
15083 cat conftest.$ac_ext >&5
15084 cf_cv_widechar_funcs=no
15085 fi
15086 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15087
15088 fi
15089 echo "$as_me:15089: result: $cf_cv_widechar_funcs" >&5
15090 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
15091         if test "$cf_cv_widechar_funcs" != no ; then
15092
15093 cat >>confdefs.h <<\EOF
15094 #define USE_WIDEC_SUPPORT 1
15095 EOF
15096
15097         else
15098                 cat >>confdefs.h <<\EOF
15099 #define USE_WIDEC_SUPPORT 0
15100 EOF
15101
15102         fi
15103 else
15104         cat >>confdefs.h <<\EOF
15105 #define USE_WIDEC_SUPPORT 0
15106 EOF
15107
15108 fi
15109
15110 echo "$as_me:15110: checking if $cf_cv_screen library uses pthreads" >&5
15111 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
15112 if test "${cf_cv_use_pthreads+set}" = set; then
15113   echo $ECHO_N "(cached) $ECHO_C" >&6
15114 else
15115
15116 cat >conftest.$ac_ext <<_ACEOF
15117 #line 15117 "configure"
15118 #include "confdefs.h"
15119
15120 #include <${cf_cv_ncurses_header:-curses.h}>
15121 extern void _nc_init_pthreads(void);
15122
15123 int
15124 main ()
15125 {
15126
15127         initscr();
15128         _nc_init_pthreads();
15129
15130   ;
15131   return 0;
15132 }
15133 _ACEOF
15134 rm -f conftest.$ac_objext conftest$ac_exeext
15135 if { (eval echo "$as_me:15135: \"$ac_link\"") >&5
15136   (eval $ac_link) 2>&5
15137   ac_status=$?
15138   echo "$as_me:15138: \$? = $ac_status" >&5
15139   (exit $ac_status); } &&
15140          { ac_try='test -s conftest$ac_exeext'
15141   { (eval echo "$as_me:15141: \"$ac_try\"") >&5
15142   (eval $ac_try) 2>&5
15143   ac_status=$?
15144   echo "$as_me:15144: \$? = $ac_status" >&5
15145   (exit $ac_status); }; }; then
15146   cf_cv_use_pthreads=yes
15147 else
15148   echo "$as_me: failed program was:" >&5
15149 cat conftest.$ac_ext >&5
15150 cf_cv_use_pthreads=no
15151 fi
15152 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15153
15154 fi
15155 echo "$as_me:15155: result: $cf_cv_use_pthreads" >&5
15156 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
15157 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
15158 #define USE_PTHREADS 1
15159 EOF
15160
15161 echo "$as_me:15161: checking if sys/time.h works with sys/select.h" >&5
15162 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
15163 if test "${cf_cv_sys_time_select+set}" = set; then
15164   echo $ECHO_N "(cached) $ECHO_C" >&6
15165 else
15166
15167 cat >conftest.$ac_ext <<_ACEOF
15168 #line 15168 "configure"
15169 #include "confdefs.h"
15170
15171 #include <sys/types.h>
15172 #ifdef HAVE_SYS_TIME_H
15173 #include <sys/time.h>
15174 #endif
15175 #ifdef HAVE_SYS_SELECT_H
15176 #include <sys/select.h>
15177 #endif
15178
15179 int
15180 main ()
15181 {
15182
15183   ;
15184   return 0;
15185 }
15186 _ACEOF
15187 rm -f conftest.$ac_objext
15188 if { (eval echo "$as_me:15188: \"$ac_compile\"") >&5
15189   (eval $ac_compile) 2>&5
15190   ac_status=$?
15191   echo "$as_me:15191: \$? = $ac_status" >&5
15192   (exit $ac_status); } &&
15193          { ac_try='test -s conftest.$ac_objext'
15194   { (eval echo "$as_me:15194: \"$ac_try\"") >&5
15195   (eval $ac_try) 2>&5
15196   ac_status=$?
15197   echo "$as_me:15197: \$? = $ac_status" >&5
15198   (exit $ac_status); }; }; then
15199   cf_cv_sys_time_select=yes
15200 else
15201   echo "$as_me: failed program was:" >&5
15202 cat conftest.$ac_ext >&5
15203 cf_cv_sys_time_select=no
15204 fi
15205 rm -f conftest.$ac_objext conftest.$ac_ext
15206
15207 fi
15208
15209 echo "$as_me:15209: result: $cf_cv_sys_time_select" >&5
15210 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
15211 test "$cf_cv_sys_time_select" = yes &&
15212 cat >>confdefs.h <<\EOF
15213 #define HAVE_SYS_TIME_SELECT 1
15214 EOF
15215
15216 # special check for test/ditto.c
15217
15218 echo "$as_me:15218: checking for openpty in -lutil" >&5
15219 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
15220 if test "${ac_cv_lib_util_openpty+set}" = set; then
15221   echo $ECHO_N "(cached) $ECHO_C" >&6
15222 else
15223   ac_check_lib_save_LIBS=$LIBS
15224 LIBS="-lutil  $LIBS"
15225 cat >conftest.$ac_ext <<_ACEOF
15226 #line 15226 "configure"
15227 #include "confdefs.h"
15228
15229 /* Override any gcc2 internal prototype to avoid an error.  */
15230 #ifdef __cplusplus
15231 extern "C"
15232 #endif
15233 /* We use char because int might match the return type of a gcc2
15234    builtin and then its argument prototype would still apply.  */
15235 char openpty ();
15236 int
15237 main ()
15238 {
15239 openpty ();
15240   ;
15241   return 0;
15242 }
15243 _ACEOF
15244 rm -f conftest.$ac_objext conftest$ac_exeext
15245 if { (eval echo "$as_me:15245: \"$ac_link\"") >&5
15246   (eval $ac_link) 2>&5
15247   ac_status=$?
15248   echo "$as_me:15248: \$? = $ac_status" >&5
15249   (exit $ac_status); } &&
15250          { ac_try='test -s conftest$ac_exeext'
15251   { (eval echo "$as_me:15251: \"$ac_try\"") >&5
15252   (eval $ac_try) 2>&5
15253   ac_status=$?
15254   echo "$as_me:15254: \$? = $ac_status" >&5
15255   (exit $ac_status); }; }; then
15256   ac_cv_lib_util_openpty=yes
15257 else
15258   echo "$as_me: failed program was:" >&5
15259 cat conftest.$ac_ext >&5
15260 ac_cv_lib_util_openpty=no
15261 fi
15262 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15263 LIBS=$ac_check_lib_save_LIBS
15264 fi
15265 echo "$as_me:15265: result: $ac_cv_lib_util_openpty" >&5
15266 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
15267 if test $ac_cv_lib_util_openpty = yes; then
15268   cf_cv_lib_util=yes
15269 else
15270   cf_cv_lib_util=no
15271 fi
15272
15273 echo "$as_me:15273: checking for openpty header" >&5
15274 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
15275 if test "${cf_cv_func_openpty+set}" = set; then
15276   echo $ECHO_N "(cached) $ECHO_C" >&6
15277 else
15278
15279         cf_save_LIBS="$LIBS"
15280         test $cf_cv_lib_util = yes && {
15281 cf_add_libs="-lutil"
15282 # Filter out duplicates - this happens with badly-designed ".pc" files...
15283 for cf_add_1lib in $LIBS
15284 do
15285         for cf_add_2lib in $cf_add_libs
15286         do
15287                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15288                 then
15289                         cf_add_1lib=
15290                         break
15291                 fi
15292         done
15293         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15294 done
15295 LIBS="$cf_add_libs"
15296  }
15297         for cf_header in pty.h libutil.h util.h
15298         do
15299         cat >conftest.$ac_ext <<_ACEOF
15300 #line 15300 "configure"
15301 #include "confdefs.h"
15302
15303 #include <$cf_header>
15304
15305 int
15306 main ()
15307 {
15308
15309         int x = openpty((int *)0, (int *)0, (char *)0,
15310                                    (struct termios *)0, (struct winsize *)0);
15311
15312   ;
15313   return 0;
15314 }
15315 _ACEOF
15316 rm -f conftest.$ac_objext conftest$ac_exeext
15317 if { (eval echo "$as_me:15317: \"$ac_link\"") >&5
15318   (eval $ac_link) 2>&5
15319   ac_status=$?
15320   echo "$as_me:15320: \$? = $ac_status" >&5
15321   (exit $ac_status); } &&
15322          { ac_try='test -s conftest$ac_exeext'
15323   { (eval echo "$as_me:15323: \"$ac_try\"") >&5
15324   (eval $ac_try) 2>&5
15325   ac_status=$?
15326   echo "$as_me:15326: \$? = $ac_status" >&5
15327   (exit $ac_status); }; }; then
15328
15329                 cf_cv_func_openpty=$cf_header
15330                 break
15331
15332 else
15333   echo "$as_me: failed program was:" >&5
15334 cat conftest.$ac_ext >&5
15335
15336                 cf_cv_func_openpty=no
15337
15338 fi
15339 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15340         done
15341         LIBS="$cf_save_LIBS"
15342
15343 fi
15344 echo "$as_me:15344: result: $cf_cv_func_openpty" >&5
15345 echo "${ECHO_T}$cf_cv_func_openpty" >&6
15346
15347 if test "$cf_cv_func_openpty" != no ; then
15348
15349 cat >>confdefs.h <<EOF
15350 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
15351 EOF
15352
15353 cat >>confdefs.h <<\EOF
15354 #define USE_XTERM_PTY 1
15355 EOF
15356
15357         if test "x$cf_cv_lib_util" = xyes ; then
15358
15359 cf_add_libs="-lutil"
15360 # Filter out duplicates - this happens with badly-designed ".pc" files...
15361 for cf_add_1lib in $TEST_LIBS
15362 do
15363         for cf_add_2lib in $cf_add_libs
15364         do
15365                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15366                 then
15367                         cf_add_1lib=
15368                         break
15369                 fi
15370         done
15371         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15372 done
15373 TEST_LIBS="$cf_add_libs"
15374
15375         fi
15376 fi
15377
15378 echo "$as_me:15378: checking for function curses_version" >&5
15379 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
15380 if test "${cf_cv_func_curses_version+set}" = set; then
15381   echo $ECHO_N "(cached) $ECHO_C" >&6
15382 else
15383
15384 if test "$cross_compiling" = yes; then
15385   cf_cv_func_curses_version=unknown
15386 else
15387   cat >conftest.$ac_ext <<_ACEOF
15388 #line 15388 "configure"
15389 #include "confdefs.h"
15390
15391 #include <${cf_cv_ncurses_header:-curses.h}>
15392 int main()
15393 {
15394         char temp[1024];
15395         sprintf(temp, "%s\n", curses_version());
15396         ${cf_cv_main_return:-return}(0);
15397 }
15398
15399 _ACEOF
15400 rm -f conftest$ac_exeext
15401 if { (eval echo "$as_me:15401: \"$ac_link\"") >&5
15402   (eval $ac_link) 2>&5
15403   ac_status=$?
15404   echo "$as_me:15404: \$? = $ac_status" >&5
15405   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15406   { (eval echo "$as_me:15406: \"$ac_try\"") >&5
15407   (eval $ac_try) 2>&5
15408   ac_status=$?
15409   echo "$as_me:15409: \$? = $ac_status" >&5
15410   (exit $ac_status); }; }; then
15411   cf_cv_func_curses_version=yes
15412
15413 else
15414   echo "$as_me: program exited with status $ac_status" >&5
15415 echo "$as_me: failed program was:" >&5
15416 cat conftest.$ac_ext >&5
15417 cf_cv_func_curses_version=no
15418
15419 fi
15420 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15421 fi
15422 rm -f core
15423 fi
15424 echo "$as_me:15424: result: $cf_cv_func_curses_version" >&5
15425 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
15426 test "$cf_cv_func_curses_version" = yes &&
15427 cat >>confdefs.h <<\EOF
15428 #define HAVE_CURSES_VERSION 1
15429 EOF
15430
15431 echo "$as_me:15431: checking for alternate character set array" >&5
15432 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
15433 if test "${cf_cv_curses_acs_map+set}" = set; then
15434   echo $ECHO_N "(cached) $ECHO_C" >&6
15435 else
15436
15437 cf_cv_curses_acs_map=unknown
15438 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
15439 do
15440 cat >conftest.$ac_ext <<_ACEOF
15441 #line 15441 "configure"
15442 #include "confdefs.h"
15443
15444 #include <${cf_cv_ncurses_header:-curses.h}>
15445
15446 int
15447 main ()
15448 {
15449
15450 $name['k'] = ACS_PLUS
15451
15452   ;
15453   return 0;
15454 }
15455 _ACEOF
15456 rm -f conftest.$ac_objext conftest$ac_exeext
15457 if { (eval echo "$as_me:15457: \"$ac_link\"") >&5
15458   (eval $ac_link) 2>&5
15459   ac_status=$?
15460   echo "$as_me:15460: \$? = $ac_status" >&5
15461   (exit $ac_status); } &&
15462          { ac_try='test -s conftest$ac_exeext'
15463   { (eval echo "$as_me:15463: \"$ac_try\"") >&5
15464   (eval $ac_try) 2>&5
15465   ac_status=$?
15466   echo "$as_me:15466: \$? = $ac_status" >&5
15467   (exit $ac_status); }; }; then
15468   cf_cv_curses_acs_map=$name; break
15469 else
15470   echo "$as_me: failed program was:" >&5
15471 cat conftest.$ac_ext >&5
15472 fi
15473 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15474 done
15475
15476 fi
15477 echo "$as_me:15477: result: $cf_cv_curses_acs_map" >&5
15478 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
15479
15480 test "$cf_cv_curses_acs_map" != unknown &&
15481 cat >>confdefs.h <<EOF
15482 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
15483 EOF
15484
15485 if test "$cf_enable_widec" = yes; then
15486
15487 echo "$as_me:15487: checking for wide alternate character set array" >&5
15488 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
15489 if test "${cf_cv_curses_wacs_map+set}" = set; then
15490   echo $ECHO_N "(cached) $ECHO_C" >&6
15491 else
15492
15493         cf_cv_curses_wacs_map=unknown
15494         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
15495         do
15496         cat >conftest.$ac_ext <<_ACEOF
15497 #line 15497 "configure"
15498 #include "confdefs.h"
15499
15500 #ifndef _XOPEN_SOURCE_EXTENDED
15501 #define _XOPEN_SOURCE_EXTENDED
15502 #endif
15503 #include <${cf_cv_ncurses_header:-curses.h}>
15504 int
15505 main ()
15506 {
15507 void *foo = &($name['k'])
15508   ;
15509   return 0;
15510 }
15511 _ACEOF
15512 rm -f conftest.$ac_objext conftest$ac_exeext
15513 if { (eval echo "$as_me:15513: \"$ac_link\"") >&5
15514   (eval $ac_link) 2>&5
15515   ac_status=$?
15516   echo "$as_me:15516: \$? = $ac_status" >&5
15517   (exit $ac_status); } &&
15518          { ac_try='test -s conftest$ac_exeext'
15519   { (eval echo "$as_me:15519: \"$ac_try\"") >&5
15520   (eval $ac_try) 2>&5
15521   ac_status=$?
15522   echo "$as_me:15522: \$? = $ac_status" >&5
15523   (exit $ac_status); }; }; then
15524   cf_cv_curses_wacs_map=$name
15525          break
15526 else
15527   echo "$as_me: failed program was:" >&5
15528 cat conftest.$ac_ext >&5
15529 fi
15530 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15531         done
15532 fi
15533 echo "$as_me:15533: result: $cf_cv_curses_wacs_map" >&5
15534 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
15535
15536 test "$cf_cv_curses_wacs_map" != unknown &&
15537 cat >>confdefs.h <<EOF
15538 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
15539 EOF
15540
15541 echo "$as_me:15541: checking for wide alternate character constants" >&5
15542 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
15543 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
15544   echo $ECHO_N "(cached) $ECHO_C" >&6
15545 else
15546
15547 cf_cv_curses_wacs_symbols=no
15548 if test "$cf_cv_curses_wacs_map" != unknown
15549 then
15550         cat >conftest.$ac_ext <<_ACEOF
15551 #line 15551 "configure"
15552 #include "confdefs.h"
15553
15554 #ifndef _XOPEN_SOURCE_EXTENDED
15555 #define _XOPEN_SOURCE_EXTENDED
15556 #endif
15557 #include <${cf_cv_ncurses_header:-curses.h}>
15558 int
15559 main ()
15560 {
15561 cchar_t *foo = WACS_PLUS;
15562          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
15563   ;
15564   return 0;
15565 }
15566 _ACEOF
15567 rm -f conftest.$ac_objext conftest$ac_exeext
15568 if { (eval echo "$as_me:15568: \"$ac_link\"") >&5
15569   (eval $ac_link) 2>&5
15570   ac_status=$?
15571   echo "$as_me:15571: \$? = $ac_status" >&5
15572   (exit $ac_status); } &&
15573          { ac_try='test -s conftest$ac_exeext'
15574   { (eval echo "$as_me:15574: \"$ac_try\"") >&5
15575   (eval $ac_try) 2>&5
15576   ac_status=$?
15577   echo "$as_me:15577: \$? = $ac_status" >&5
15578   (exit $ac_status); }; }; then
15579   cf_cv_curses_wacs_symbols=yes
15580 else
15581   echo "$as_me: failed program was:" >&5
15582 cat conftest.$ac_ext >&5
15583 fi
15584 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15585 else
15586         cat >conftest.$ac_ext <<_ACEOF
15587 #line 15587 "configure"
15588 #include "confdefs.h"
15589
15590 #ifndef _XOPEN_SOURCE_EXTENDED
15591 #define _XOPEN_SOURCE_EXTENDED
15592 #endif
15593 #include <${cf_cv_ncurses_header:-curses.h}>
15594 int
15595 main ()
15596 {
15597 cchar_t *foo = WACS_PLUS
15598   ;
15599   return 0;
15600 }
15601 _ACEOF
15602 rm -f conftest.$ac_objext conftest$ac_exeext
15603 if { (eval echo "$as_me:15603: \"$ac_link\"") >&5
15604   (eval $ac_link) 2>&5
15605   ac_status=$?
15606   echo "$as_me:15606: \$? = $ac_status" >&5
15607   (exit $ac_status); } &&
15608          { ac_try='test -s conftest$ac_exeext'
15609   { (eval echo "$as_me:15609: \"$ac_try\"") >&5
15610   (eval $ac_try) 2>&5
15611   ac_status=$?
15612   echo "$as_me:15612: \$? = $ac_status" >&5
15613   (exit $ac_status); }; }; then
15614   cf_cv_curses_wacs_symbols=yes
15615 else
15616   echo "$as_me: failed program was:" >&5
15617 cat conftest.$ac_ext >&5
15618 fi
15619 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15620 fi
15621
15622 fi
15623 echo "$as_me:15623: result: $cf_cv_curses_wacs_symbols" >&5
15624 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15625
15626 test "$cf_cv_curses_wacs_symbols" != no &&
15627 cat >>confdefs.h <<\EOF
15628 #define CURSES_WACS_SYMBOLS 1
15629 EOF
15630
15631 fi
15632
15633 echo "$as_me:15633: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15634 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15635 cat >conftest.$ac_ext <<_ACEOF
15636 #line 15636 "configure"
15637 #include "confdefs.h"
15638
15639 #ifndef _XOPEN_SOURCE_EXTENDED
15640 #define _XOPEN_SOURCE_EXTENDED
15641 #endif
15642 #include <${cf_cv_ncurses_header:-curses.h}>
15643 int
15644 main ()
15645 {
15646
15647 attr_t foo
15648
15649   ;
15650   return 0;
15651 }
15652 _ACEOF
15653 rm -f conftest.$ac_objext
15654 if { (eval echo "$as_me:15654: \"$ac_compile\"") >&5
15655   (eval $ac_compile) 2>&5
15656   ac_status=$?
15657   echo "$as_me:15657: \$? = $ac_status" >&5
15658   (exit $ac_status); } &&
15659          { ac_try='test -s conftest.$ac_objext'
15660   { (eval echo "$as_me:15660: \"$ac_try\"") >&5
15661   (eval $ac_try) 2>&5
15662   ac_status=$?
15663   echo "$as_me:15663: \$? = $ac_status" >&5
15664   (exit $ac_status); }; }; then
15665   cf_result=yes
15666 else
15667   echo "$as_me: failed program was:" >&5
15668 cat conftest.$ac_ext >&5
15669 cf_result=no
15670 fi
15671 rm -f conftest.$ac_objext conftest.$ac_ext
15672 echo "$as_me:15672: result: $cf_result" >&5
15673 echo "${ECHO_T}$cf_result" >&6
15674 if test $cf_result = yes ; then
15675
15676 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15677
15678 cat >>confdefs.h <<EOF
15679 #define $cf_result 1
15680 EOF
15681
15682 else
15683
15684 cat >>confdefs.h <<EOF
15685 #define attr_t long
15686 EOF
15687
15688 fi
15689
15690 if test "$cf_enable_widec" = yes; then
15691
15692 # This is needed on Tru64 5.0 to declare mbstate_t
15693 echo "$as_me:15693: checking if we must include wchar.h to declare mbstate_t" >&5
15694 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15695 if test "${cf_cv_mbstate_t+set}" = set; then
15696   echo $ECHO_N "(cached) $ECHO_C" >&6
15697 else
15698
15699 cat >conftest.$ac_ext <<_ACEOF
15700 #line 15700 "configure"
15701 #include "confdefs.h"
15702
15703 #include <stdlib.h>
15704 #include <stdarg.h>
15705 #include <stdio.h>
15706 #ifdef HAVE_LIBUTF8_H
15707 #include <libutf8.h>
15708 #endif
15709 int
15710 main ()
15711 {
15712 mbstate_t state
15713   ;
15714   return 0;
15715 }
15716 _ACEOF
15717 rm -f conftest.$ac_objext
15718 if { (eval echo "$as_me:15718: \"$ac_compile\"") >&5
15719   (eval $ac_compile) 2>&5
15720   ac_status=$?
15721   echo "$as_me:15721: \$? = $ac_status" >&5
15722   (exit $ac_status); } &&
15723          { ac_try='test -s conftest.$ac_objext'
15724   { (eval echo "$as_me:15724: \"$ac_try\"") >&5
15725   (eval $ac_try) 2>&5
15726   ac_status=$?
15727   echo "$as_me:15727: \$? = $ac_status" >&5
15728   (exit $ac_status); }; }; then
15729   cf_cv_mbstate_t=no
15730 else
15731   echo "$as_me: failed program was:" >&5
15732 cat conftest.$ac_ext >&5
15733 cat >conftest.$ac_ext <<_ACEOF
15734 #line 15734 "configure"
15735 #include "confdefs.h"
15736
15737 #include <stdlib.h>
15738 #include <stdarg.h>
15739 #include <stdio.h>
15740 #include <wchar.h>
15741 #ifdef HAVE_LIBUTF8_H
15742 #include <libutf8.h>
15743 #endif
15744 int
15745 main ()
15746 {
15747 mbstate_t value
15748   ;
15749   return 0;
15750 }
15751 _ACEOF
15752 rm -f conftest.$ac_objext
15753 if { (eval echo "$as_me:15753: \"$ac_compile\"") >&5
15754   (eval $ac_compile) 2>&5
15755   ac_status=$?
15756   echo "$as_me:15756: \$? = $ac_status" >&5
15757   (exit $ac_status); } &&
15758          { ac_try='test -s conftest.$ac_objext'
15759   { (eval echo "$as_me:15759: \"$ac_try\"") >&5
15760   (eval $ac_try) 2>&5
15761   ac_status=$?
15762   echo "$as_me:15762: \$? = $ac_status" >&5
15763   (exit $ac_status); }; }; then
15764   cf_cv_mbstate_t=yes
15765 else
15766   echo "$as_me: failed program was:" >&5
15767 cat conftest.$ac_ext >&5
15768 cf_cv_mbstate_t=unknown
15769 fi
15770 rm -f conftest.$ac_objext conftest.$ac_ext
15771 fi
15772 rm -f conftest.$ac_objext conftest.$ac_ext
15773 fi
15774 echo "$as_me:15774: result: $cf_cv_mbstate_t" >&5
15775 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15776
15777 if test "$cf_cv_mbstate_t" = yes ; then
15778
15779 cat >>confdefs.h <<\EOF
15780 #define NEED_WCHAR_H 1
15781 EOF
15782
15783         NEED_WCHAR_H=1
15784 fi
15785
15786 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15787 if test "$cf_cv_mbstate_t" = unknown ; then
15788         NCURSES_MBSTATE_T=1
15789 fi
15790
15791 # if we find mbstate_t in either place, use substitution to provide a fallback.
15792 if test "$cf_cv_mbstate_t" != unknown ; then
15793         NCURSES_OK_MBSTATE_T=1
15794 fi
15795
15796 # This is needed on Tru64 5.0 to declare wchar_t
15797 echo "$as_me:15797: checking if we must include wchar.h to declare wchar_t" >&5
15798 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15799 if test "${cf_cv_wchar_t+set}" = set; then
15800   echo $ECHO_N "(cached) $ECHO_C" >&6
15801 else
15802
15803 cat >conftest.$ac_ext <<_ACEOF
15804 #line 15804 "configure"
15805 #include "confdefs.h"
15806
15807 #include <stdlib.h>
15808 #include <stdarg.h>
15809 #include <stdio.h>
15810 #ifdef HAVE_LIBUTF8_H
15811 #include <libutf8.h>
15812 #endif
15813 int
15814 main ()
15815 {
15816 wchar_t state
15817   ;
15818   return 0;
15819 }
15820 _ACEOF
15821 rm -f conftest.$ac_objext
15822 if { (eval echo "$as_me:15822: \"$ac_compile\"") >&5
15823   (eval $ac_compile) 2>&5
15824   ac_status=$?
15825   echo "$as_me:15825: \$? = $ac_status" >&5
15826   (exit $ac_status); } &&
15827          { ac_try='test -s conftest.$ac_objext'
15828   { (eval echo "$as_me:15828: \"$ac_try\"") >&5
15829   (eval $ac_try) 2>&5
15830   ac_status=$?
15831   echo "$as_me:15831: \$? = $ac_status" >&5
15832   (exit $ac_status); }; }; then
15833   cf_cv_wchar_t=no
15834 else
15835   echo "$as_me: failed program was:" >&5
15836 cat conftest.$ac_ext >&5
15837 cat >conftest.$ac_ext <<_ACEOF
15838 #line 15838 "configure"
15839 #include "confdefs.h"
15840
15841 #include <stdlib.h>
15842 #include <stdarg.h>
15843 #include <stdio.h>
15844 #include <wchar.h>
15845 #ifdef HAVE_LIBUTF8_H
15846 #include <libutf8.h>
15847 #endif
15848 int
15849 main ()
15850 {
15851 wchar_t value
15852   ;
15853   return 0;
15854 }
15855 _ACEOF
15856 rm -f conftest.$ac_objext
15857 if { (eval echo "$as_me:15857: \"$ac_compile\"") >&5
15858   (eval $ac_compile) 2>&5
15859   ac_status=$?
15860   echo "$as_me:15860: \$? = $ac_status" >&5
15861   (exit $ac_status); } &&
15862          { ac_try='test -s conftest.$ac_objext'
15863   { (eval echo "$as_me:15863: \"$ac_try\"") >&5
15864   (eval $ac_try) 2>&5
15865   ac_status=$?
15866   echo "$as_me:15866: \$? = $ac_status" >&5
15867   (exit $ac_status); }; }; then
15868   cf_cv_wchar_t=yes
15869 else
15870   echo "$as_me: failed program was:" >&5
15871 cat conftest.$ac_ext >&5
15872 cf_cv_wchar_t=unknown
15873 fi
15874 rm -f conftest.$ac_objext conftest.$ac_ext
15875 fi
15876 rm -f conftest.$ac_objext conftest.$ac_ext
15877 fi
15878 echo "$as_me:15878: result: $cf_cv_wchar_t" >&5
15879 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15880
15881 if test "$cf_cv_wchar_t" = yes ; then
15882
15883 cat >>confdefs.h <<\EOF
15884 #define NEED_WCHAR_H 1
15885 EOF
15886
15887         NEED_WCHAR_H=1
15888 fi
15889
15890 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15891 if test "$cf_cv_wchar_t" = unknown ; then
15892         NCURSES_WCHAR_T=1
15893 fi
15894
15895 # if we find wchar_t in either place, use substitution to provide a fallback.
15896 if test "$cf_cv_wchar_t" != unknown ; then
15897         NCURSES_OK_WCHAR_T=1
15898 fi
15899
15900 # This is needed on Tru64 5.0 to declare wint_t
15901 echo "$as_me:15901: checking if we must include wchar.h to declare wint_t" >&5
15902 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15903 if test "${cf_cv_wint_t+set}" = set; then
15904   echo $ECHO_N "(cached) $ECHO_C" >&6
15905 else
15906
15907 cat >conftest.$ac_ext <<_ACEOF
15908 #line 15908 "configure"
15909 #include "confdefs.h"
15910
15911 #include <stdlib.h>
15912 #include <stdarg.h>
15913 #include <stdio.h>
15914 #ifdef HAVE_LIBUTF8_H
15915 #include <libutf8.h>
15916 #endif
15917 int
15918 main ()
15919 {
15920 wint_t state
15921   ;
15922   return 0;
15923 }
15924 _ACEOF
15925 rm -f conftest.$ac_objext
15926 if { (eval echo "$as_me:15926: \"$ac_compile\"") >&5
15927   (eval $ac_compile) 2>&5
15928   ac_status=$?
15929   echo "$as_me:15929: \$? = $ac_status" >&5
15930   (exit $ac_status); } &&
15931          { ac_try='test -s conftest.$ac_objext'
15932   { (eval echo "$as_me:15932: \"$ac_try\"") >&5
15933   (eval $ac_try) 2>&5
15934   ac_status=$?
15935   echo "$as_me:15935: \$? = $ac_status" >&5
15936   (exit $ac_status); }; }; then
15937   cf_cv_wint_t=no
15938 else
15939   echo "$as_me: failed program was:" >&5
15940 cat conftest.$ac_ext >&5
15941 cat >conftest.$ac_ext <<_ACEOF
15942 #line 15942 "configure"
15943 #include "confdefs.h"
15944
15945 #include <stdlib.h>
15946 #include <stdarg.h>
15947 #include <stdio.h>
15948 #include <wchar.h>
15949 #ifdef HAVE_LIBUTF8_H
15950 #include <libutf8.h>
15951 #endif
15952 int
15953 main ()
15954 {
15955 wint_t value
15956   ;
15957   return 0;
15958 }
15959 _ACEOF
15960 rm -f conftest.$ac_objext
15961 if { (eval echo "$as_me:15961: \"$ac_compile\"") >&5
15962   (eval $ac_compile) 2>&5
15963   ac_status=$?
15964   echo "$as_me:15964: \$? = $ac_status" >&5
15965   (exit $ac_status); } &&
15966          { ac_try='test -s conftest.$ac_objext'
15967   { (eval echo "$as_me:15967: \"$ac_try\"") >&5
15968   (eval $ac_try) 2>&5
15969   ac_status=$?
15970   echo "$as_me:15970: \$? = $ac_status" >&5
15971   (exit $ac_status); }; }; then
15972   cf_cv_wint_t=yes
15973 else
15974   echo "$as_me: failed program was:" >&5
15975 cat conftest.$ac_ext >&5
15976 cf_cv_wint_t=unknown
15977 fi
15978 rm -f conftest.$ac_objext conftest.$ac_ext
15979 fi
15980 rm -f conftest.$ac_objext conftest.$ac_ext
15981 fi
15982 echo "$as_me:15982: result: $cf_cv_wint_t" >&5
15983 echo "${ECHO_T}$cf_cv_wint_t" >&6
15984
15985 if test "$cf_cv_wint_t" = yes ; then
15986
15987 cat >>confdefs.h <<\EOF
15988 #define NEED_WCHAR_H 1
15989 EOF
15990
15991         NEED_WCHAR_H=1
15992 fi
15993
15994 # if we do not find wint_t in either place, use substitution to provide a fallback.
15995 if test "$cf_cv_wint_t" = unknown ; then
15996         NCURSES_WINT_T=1
15997 fi
15998
15999 # if we find wint_t in either place, use substitution to provide a fallback.
16000 if test "$cf_cv_wint_t" != unknown ; then
16001         NCURSES_OK_WINT_T=1
16002 fi
16003
16004         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
16005
16006 echo "$as_me:16006: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16007 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16008 cat >conftest.$ac_ext <<_ACEOF
16009 #line 16009 "configure"
16010 #include "confdefs.h"
16011
16012 #ifndef _XOPEN_SOURCE_EXTENDED
16013 #define _XOPEN_SOURCE_EXTENDED
16014 #endif
16015 #include <${cf_cv_ncurses_header:-curses.h}>
16016 int
16017 main ()
16018 {
16019
16020 mbstate_t foo
16021
16022   ;
16023   return 0;
16024 }
16025 _ACEOF
16026 rm -f conftest.$ac_objext
16027 if { (eval echo "$as_me:16027: \"$ac_compile\"") >&5
16028   (eval $ac_compile) 2>&5
16029   ac_status=$?
16030   echo "$as_me:16030: \$? = $ac_status" >&5
16031   (exit $ac_status); } &&
16032          { ac_try='test -s conftest.$ac_objext'
16033   { (eval echo "$as_me:16033: \"$ac_try\"") >&5
16034   (eval $ac_try) 2>&5
16035   ac_status=$?
16036   echo "$as_me:16036: \$? = $ac_status" >&5
16037   (exit $ac_status); }; }; then
16038   cf_result=yes
16039 else
16040   echo "$as_me: failed program was:" >&5
16041 cat conftest.$ac_ext >&5
16042 cf_result=no
16043 fi
16044 rm -f conftest.$ac_objext conftest.$ac_ext
16045 echo "$as_me:16045: result: $cf_result" >&5
16046 echo "${ECHO_T}$cf_result" >&6
16047 if test $cf_result = yes ; then
16048
16049 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16050
16051 cat >>confdefs.h <<EOF
16052 #define $cf_result 1
16053 EOF
16054
16055 else
16056
16057 cat >>confdefs.h <<EOF
16058 #define mbstate_t long
16059 EOF
16060
16061 fi
16062
16063         fi
16064
16065         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
16066
16067 echo "$as_me:16067: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16068 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16069 cat >conftest.$ac_ext <<_ACEOF
16070 #line 16070 "configure"
16071 #include "confdefs.h"
16072
16073 #ifndef _XOPEN_SOURCE_EXTENDED
16074 #define _XOPEN_SOURCE_EXTENDED
16075 #endif
16076 #include <${cf_cv_ncurses_header:-curses.h}>
16077 int
16078 main ()
16079 {
16080
16081 wchar_t foo
16082
16083   ;
16084   return 0;
16085 }
16086 _ACEOF
16087 rm -f conftest.$ac_objext
16088 if { (eval echo "$as_me:16088: \"$ac_compile\"") >&5
16089   (eval $ac_compile) 2>&5
16090   ac_status=$?
16091   echo "$as_me:16091: \$? = $ac_status" >&5
16092   (exit $ac_status); } &&
16093          { ac_try='test -s conftest.$ac_objext'
16094   { (eval echo "$as_me:16094: \"$ac_try\"") >&5
16095   (eval $ac_try) 2>&5
16096   ac_status=$?
16097   echo "$as_me:16097: \$? = $ac_status" >&5
16098   (exit $ac_status); }; }; then
16099   cf_result=yes
16100 else
16101   echo "$as_me: failed program was:" >&5
16102 cat conftest.$ac_ext >&5
16103 cf_result=no
16104 fi
16105 rm -f conftest.$ac_objext conftest.$ac_ext
16106 echo "$as_me:16106: result: $cf_result" >&5
16107 echo "${ECHO_T}$cf_result" >&6
16108 if test $cf_result = yes ; then
16109
16110 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16111
16112 cat >>confdefs.h <<EOF
16113 #define $cf_result 1
16114 EOF
16115
16116 else
16117
16118 cat >>confdefs.h <<EOF
16119 #define wchar_t long
16120 EOF
16121
16122 fi
16123
16124         fi
16125
16126         if test "$NCURSES_OK_WINT_T" = 0 ; then
16127
16128 echo "$as_me:16128: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16129 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16130 cat >conftest.$ac_ext <<_ACEOF
16131 #line 16131 "configure"
16132 #include "confdefs.h"
16133
16134 #ifndef _XOPEN_SOURCE_EXTENDED
16135 #define _XOPEN_SOURCE_EXTENDED
16136 #endif
16137 #include <${cf_cv_ncurses_header:-curses.h}>
16138 int
16139 main ()
16140 {
16141
16142 wint_t foo
16143
16144   ;
16145   return 0;
16146 }
16147 _ACEOF
16148 rm -f conftest.$ac_objext
16149 if { (eval echo "$as_me:16149: \"$ac_compile\"") >&5
16150   (eval $ac_compile) 2>&5
16151   ac_status=$?
16152   echo "$as_me:16152: \$? = $ac_status" >&5
16153   (exit $ac_status); } &&
16154          { ac_try='test -s conftest.$ac_objext'
16155   { (eval echo "$as_me:16155: \"$ac_try\"") >&5
16156   (eval $ac_try) 2>&5
16157   ac_status=$?
16158   echo "$as_me:16158: \$? = $ac_status" >&5
16159   (exit $ac_status); }; }; then
16160   cf_result=yes
16161 else
16162   echo "$as_me: failed program was:" >&5
16163 cat conftest.$ac_ext >&5
16164 cf_result=no
16165 fi
16166 rm -f conftest.$ac_objext conftest.$ac_ext
16167 echo "$as_me:16167: result: $cf_result" >&5
16168 echo "${ECHO_T}$cf_result" >&6
16169 if test $cf_result = yes ; then
16170
16171 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16172
16173 cat >>confdefs.h <<EOF
16174 #define $cf_result 1
16175 EOF
16176
16177 else
16178
16179 cat >>confdefs.h <<EOF
16180 #define wint_t long
16181 EOF
16182
16183 fi
16184
16185         fi
16186 fi
16187
16188 echo "$as_me:16188: checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16189 echo $ECHO_N "checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16190
16191 cat >conftest.$ac_ext <<_ACEOF
16192 #line 16192 "configure"
16193 #include "confdefs.h"
16194
16195 #ifdef HAVE_XCURSES
16196 #include <xcurses.h>
16197 char * XCursesProgramName = "test";
16198 #else
16199 #include <${cf_cv_ncurses_header:-curses.h}>
16200 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16201 #include <ncursesw/term.h>
16202 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16203 #include <ncurses/term.h>
16204 #elif defined(HAVE_TERM_H)
16205 #include <term.h>
16206 #endif
16207 #endif
16208
16209 int
16210 main ()
16211 {
16212
16213 void *foo = &(ospeed)
16214
16215   ;
16216   return 0;
16217 }
16218 _ACEOF
16219 rm -f conftest.$ac_objext
16220 if { (eval echo "$as_me:16220: \"$ac_compile\"") >&5
16221   (eval $ac_compile) 2>&5
16222   ac_status=$?
16223   echo "$as_me:16223: \$? = $ac_status" >&5
16224   (exit $ac_status); } &&
16225          { ac_try='test -s conftest.$ac_objext'
16226   { (eval echo "$as_me:16226: \"$ac_try\"") >&5
16227   (eval $ac_try) 2>&5
16228   ac_status=$?
16229   echo "$as_me:16229: \$? = $ac_status" >&5
16230   (exit $ac_status); }; }; then
16231   cf_result=yes
16232 else
16233   echo "$as_me: failed program was:" >&5
16234 cat conftest.$ac_ext >&5
16235 cf_result=no
16236 fi
16237 rm -f conftest.$ac_objext conftest.$ac_ext
16238 echo "$as_me:16238: result: $cf_result" >&5
16239 echo "${ECHO_T}$cf_result" >&6
16240
16241 if test $cf_result = yes ; then
16242
16243 cf_result=`echo "have_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16244
16245         cat >>confdefs.h <<EOF
16246 #define $cf_result 1
16247 EOF
16248
16249 else
16250         echo "$as_me:16250: checking for data ospeed in library" >&5
16251 echo $ECHO_N "checking for data ospeed in library... $ECHO_C" >&6
16252         # BSD linkers insist on making weak linkage, but resolve at runtime.
16253         if test "$cross_compiling" = yes; then
16254
16255         # cross-compiling
16256         cat >conftest.$ac_ext <<_ACEOF
16257 #line 16257 "configure"
16258 #include "confdefs.h"
16259
16260 #ifdef HAVE_XCURSES
16261 #include <xcurses.h>
16262 char * XCursesProgramName = "test";
16263 #else
16264 #include <${cf_cv_ncurses_header:-curses.h}>
16265 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16266 #include <ncursesw/term.h>
16267 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16268 #include <ncurses/term.h>
16269 #elif defined(HAVE_TERM_H)
16270 #include <term.h>
16271 #endif
16272 #endif
16273
16274 extern char ospeed;
16275 int
16276 main ()
16277 {
16278
16279         do {
16280                 void *foo = &(ospeed);
16281                 fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16282                 ${cf_cv_main_return:-return}(foo == 0);
16283         } while (0)
16284
16285   ;
16286   return 0;
16287 }
16288 _ACEOF
16289 rm -f conftest.$ac_objext conftest$ac_exeext
16290 if { (eval echo "$as_me:16290: \"$ac_link\"") >&5
16291   (eval $ac_link) 2>&5
16292   ac_status=$?
16293   echo "$as_me:16293: \$? = $ac_status" >&5
16294   (exit $ac_status); } &&
16295          { ac_try='test -s conftest$ac_exeext'
16296   { (eval echo "$as_me:16296: \"$ac_try\"") >&5
16297   (eval $ac_try) 2>&5
16298   ac_status=$?
16299   echo "$as_me:16299: \$? = $ac_status" >&5
16300   (exit $ac_status); }; }; then
16301   cf_result=yes
16302 else
16303   echo "$as_me: failed program was:" >&5
16304 cat conftest.$ac_ext >&5
16305 cf_result=no
16306 fi
16307 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16308
16309 else
16310   cat >conftest.$ac_ext <<_ACEOF
16311 #line 16311 "configure"
16312 #include "confdefs.h"
16313
16314 #ifdef HAVE_XCURSES
16315 #include <xcurses.h>
16316 char * XCursesProgramName = "test";
16317 #else
16318 #include <${cf_cv_ncurses_header:-curses.h}>
16319 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16320 #include <ncursesw/term.h>
16321 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16322 #include <ncurses/term.h>
16323 #elif defined(HAVE_TERM_H)
16324 #include <term.h>
16325 #endif
16326 #endif
16327
16328 extern char ospeed;
16329 int main(void)
16330 {
16331         void *foo = &(ospeed);
16332         fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16333         ${cf_cv_main_return:-return}(foo == 0);
16334 }
16335 _ACEOF
16336 rm -f conftest$ac_exeext
16337 if { (eval echo "$as_me:16337: \"$ac_link\"") >&5
16338   (eval $ac_link) 2>&5
16339   ac_status=$?
16340   echo "$as_me:16340: \$? = $ac_status" >&5
16341   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16342   { (eval echo "$as_me:16342: \"$ac_try\"") >&5
16343   (eval $ac_try) 2>&5
16344   ac_status=$?
16345   echo "$as_me:16345: \$? = $ac_status" >&5
16346   (exit $ac_status); }; }; then
16347   cf_result=yes
16348 else
16349   echo "$as_me: program exited with status $ac_status" >&5
16350 echo "$as_me: failed program was:" >&5
16351 cat conftest.$ac_ext >&5
16352 cf_result=no
16353 fi
16354 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16355 fi
16356         echo "$as_me:16356: result: $cf_result" >&5
16357 echo "${ECHO_T}$cf_result" >&6
16358         if test $cf_result = yes ; then
16359
16360 cf_result=`echo "decl_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16361
16362                 cat >>confdefs.h <<EOF
16363 #define $cf_result 1
16364 EOF
16365
16366         fi
16367 fi
16368
16369 echo "$as_me:16369: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16370 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16371
16372 cat >conftest.$ac_ext <<_ACEOF
16373 #line 16373 "configure"
16374 #include "confdefs.h"
16375
16376 #ifdef HAVE_XCURSES
16377 #include <xcurses.h>
16378 char * XCursesProgramName = "test";
16379 #else
16380 #include <${cf_cv_ncurses_header:-curses.h}>
16381 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16382 #include <ncursesw/term.h>
16383 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16384 #include <ncurses/term.h>
16385 #elif defined(HAVE_TERM_H)
16386 #include <term.h>
16387 #endif
16388 #endif
16389
16390 int
16391 main ()
16392 {
16393
16394 void *foo = &(boolnames)
16395
16396   ;
16397   return 0;
16398 }
16399 _ACEOF
16400 rm -f conftest.$ac_objext
16401 if { (eval echo "$as_me:16401: \"$ac_compile\"") >&5
16402   (eval $ac_compile) 2>&5
16403   ac_status=$?
16404   echo "$as_me:16404: \$? = $ac_status" >&5
16405   (exit $ac_status); } &&
16406          { ac_try='test -s conftest.$ac_objext'
16407   { (eval echo "$as_me:16407: \"$ac_try\"") >&5
16408   (eval $ac_try) 2>&5
16409   ac_status=$?
16410   echo "$as_me:16410: \$? = $ac_status" >&5
16411   (exit $ac_status); }; }; then
16412   cf_result=yes
16413 else
16414   echo "$as_me: failed program was:" >&5
16415 cat conftest.$ac_ext >&5
16416 cf_result=no
16417 fi
16418 rm -f conftest.$ac_objext conftest.$ac_ext
16419 echo "$as_me:16419: result: $cf_result" >&5
16420 echo "${ECHO_T}$cf_result" >&6
16421
16422 if test $cf_result = yes ; then
16423
16424 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16425
16426         cat >>confdefs.h <<EOF
16427 #define $cf_result 1
16428 EOF
16429
16430 else
16431         echo "$as_me:16431: checking for data boolnames in library" >&5
16432 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
16433         # BSD linkers insist on making weak linkage, but resolve at runtime.
16434         if test "$cross_compiling" = yes; then
16435
16436         # cross-compiling
16437         cat >conftest.$ac_ext <<_ACEOF
16438 #line 16438 "configure"
16439 #include "confdefs.h"
16440
16441 #ifdef HAVE_XCURSES
16442 #include <xcurses.h>
16443 char * XCursesProgramName = "test";
16444 #else
16445 #include <${cf_cv_ncurses_header:-curses.h}>
16446 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16447 #include <ncursesw/term.h>
16448 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16449 #include <ncurses/term.h>
16450 #elif defined(HAVE_TERM_H)
16451 #include <term.h>
16452 #endif
16453 #endif
16454
16455 extern char boolnames;
16456 int
16457 main ()
16458 {
16459
16460         do {
16461                 void *foo = &(boolnames);
16462                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16463                 ${cf_cv_main_return:-return}(foo == 0);
16464         } while (0)
16465
16466   ;
16467   return 0;
16468 }
16469 _ACEOF
16470 rm -f conftest.$ac_objext conftest$ac_exeext
16471 if { (eval echo "$as_me:16471: \"$ac_link\"") >&5
16472   (eval $ac_link) 2>&5
16473   ac_status=$?
16474   echo "$as_me:16474: \$? = $ac_status" >&5
16475   (exit $ac_status); } &&
16476          { ac_try='test -s conftest$ac_exeext'
16477   { (eval echo "$as_me:16477: \"$ac_try\"") >&5
16478   (eval $ac_try) 2>&5
16479   ac_status=$?
16480   echo "$as_me:16480: \$? = $ac_status" >&5
16481   (exit $ac_status); }; }; then
16482   cf_result=yes
16483 else
16484   echo "$as_me: failed program was:" >&5
16485 cat conftest.$ac_ext >&5
16486 cf_result=no
16487 fi
16488 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16489
16490 else
16491   cat >conftest.$ac_ext <<_ACEOF
16492 #line 16492 "configure"
16493 #include "confdefs.h"
16494
16495 #ifdef HAVE_XCURSES
16496 #include <xcurses.h>
16497 char * XCursesProgramName = "test";
16498 #else
16499 #include <${cf_cv_ncurses_header:-curses.h}>
16500 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16501 #include <ncursesw/term.h>
16502 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16503 #include <ncurses/term.h>
16504 #elif defined(HAVE_TERM_H)
16505 #include <term.h>
16506 #endif
16507 #endif
16508
16509 extern char boolnames;
16510 int main(void)
16511 {
16512         void *foo = &(boolnames);
16513         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16514         ${cf_cv_main_return:-return}(foo == 0);
16515 }
16516 _ACEOF
16517 rm -f conftest$ac_exeext
16518 if { (eval echo "$as_me:16518: \"$ac_link\"") >&5
16519   (eval $ac_link) 2>&5
16520   ac_status=$?
16521   echo "$as_me:16521: \$? = $ac_status" >&5
16522   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16523   { (eval echo "$as_me:16523: \"$ac_try\"") >&5
16524   (eval $ac_try) 2>&5
16525   ac_status=$?
16526   echo "$as_me:16526: \$? = $ac_status" >&5
16527   (exit $ac_status); }; }; then
16528   cf_result=yes
16529 else
16530   echo "$as_me: program exited with status $ac_status" >&5
16531 echo "$as_me: failed program was:" >&5
16532 cat conftest.$ac_ext >&5
16533 cf_result=no
16534 fi
16535 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16536 fi
16537         echo "$as_me:16537: result: $cf_result" >&5
16538 echo "${ECHO_T}$cf_result" >&6
16539         if test $cf_result = yes ; then
16540
16541 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16542
16543                 cat >>confdefs.h <<EOF
16544 #define $cf_result 1
16545 EOF
16546
16547         fi
16548 fi
16549
16550 echo "$as_me:16550: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16551 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16552
16553 cat >conftest.$ac_ext <<_ACEOF
16554 #line 16554 "configure"
16555 #include "confdefs.h"
16556
16557 #ifdef HAVE_XCURSES
16558 #include <xcurses.h>
16559 char * XCursesProgramName = "test";
16560 #else
16561 #include <${cf_cv_ncurses_header:-curses.h}>
16562 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16563 #include <ncursesw/term.h>
16564 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16565 #include <ncurses/term.h>
16566 #elif defined(HAVE_TERM_H)
16567 #include <term.h>
16568 #endif
16569 #endif
16570
16571 int
16572 main ()
16573 {
16574
16575 void *foo = &(boolfnames)
16576
16577   ;
16578   return 0;
16579 }
16580 _ACEOF
16581 rm -f conftest.$ac_objext
16582 if { (eval echo "$as_me:16582: \"$ac_compile\"") >&5
16583   (eval $ac_compile) 2>&5
16584   ac_status=$?
16585   echo "$as_me:16585: \$? = $ac_status" >&5
16586   (exit $ac_status); } &&
16587          { ac_try='test -s conftest.$ac_objext'
16588   { (eval echo "$as_me:16588: \"$ac_try\"") >&5
16589   (eval $ac_try) 2>&5
16590   ac_status=$?
16591   echo "$as_me:16591: \$? = $ac_status" >&5
16592   (exit $ac_status); }; }; then
16593   cf_result=yes
16594 else
16595   echo "$as_me: failed program was:" >&5
16596 cat conftest.$ac_ext >&5
16597 cf_result=no
16598 fi
16599 rm -f conftest.$ac_objext conftest.$ac_ext
16600 echo "$as_me:16600: result: $cf_result" >&5
16601 echo "${ECHO_T}$cf_result" >&6
16602
16603 if test $cf_result = yes ; then
16604
16605 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16606
16607         cat >>confdefs.h <<EOF
16608 #define $cf_result 1
16609 EOF
16610
16611 else
16612         echo "$as_me:16612: checking for data boolfnames in library" >&5
16613 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
16614         # BSD linkers insist on making weak linkage, but resolve at runtime.
16615         if test "$cross_compiling" = yes; then
16616
16617         # cross-compiling
16618         cat >conftest.$ac_ext <<_ACEOF
16619 #line 16619 "configure"
16620 #include "confdefs.h"
16621
16622 #ifdef HAVE_XCURSES
16623 #include <xcurses.h>
16624 char * XCursesProgramName = "test";
16625 #else
16626 #include <${cf_cv_ncurses_header:-curses.h}>
16627 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16628 #include <ncursesw/term.h>
16629 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16630 #include <ncurses/term.h>
16631 #elif defined(HAVE_TERM_H)
16632 #include <term.h>
16633 #endif
16634 #endif
16635
16636 extern char boolfnames;
16637 int
16638 main ()
16639 {
16640
16641         do {
16642                 void *foo = &(boolfnames);
16643                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16644                 ${cf_cv_main_return:-return}(foo == 0);
16645         } while (0)
16646
16647   ;
16648   return 0;
16649 }
16650 _ACEOF
16651 rm -f conftest.$ac_objext conftest$ac_exeext
16652 if { (eval echo "$as_me:16652: \"$ac_link\"") >&5
16653   (eval $ac_link) 2>&5
16654   ac_status=$?
16655   echo "$as_me:16655: \$? = $ac_status" >&5
16656   (exit $ac_status); } &&
16657          { ac_try='test -s conftest$ac_exeext'
16658   { (eval echo "$as_me:16658: \"$ac_try\"") >&5
16659   (eval $ac_try) 2>&5
16660   ac_status=$?
16661   echo "$as_me:16661: \$? = $ac_status" >&5
16662   (exit $ac_status); }; }; then
16663   cf_result=yes
16664 else
16665   echo "$as_me: failed program was:" >&5
16666 cat conftest.$ac_ext >&5
16667 cf_result=no
16668 fi
16669 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16670
16671 else
16672   cat >conftest.$ac_ext <<_ACEOF
16673 #line 16673 "configure"
16674 #include "confdefs.h"
16675
16676 #ifdef HAVE_XCURSES
16677 #include <xcurses.h>
16678 char * XCursesProgramName = "test";
16679 #else
16680 #include <${cf_cv_ncurses_header:-curses.h}>
16681 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16682 #include <ncursesw/term.h>
16683 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16684 #include <ncurses/term.h>
16685 #elif defined(HAVE_TERM_H)
16686 #include <term.h>
16687 #endif
16688 #endif
16689
16690 extern char boolfnames;
16691 int main(void)
16692 {
16693         void *foo = &(boolfnames);
16694         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16695         ${cf_cv_main_return:-return}(foo == 0);
16696 }
16697 _ACEOF
16698 rm -f conftest$ac_exeext
16699 if { (eval echo "$as_me:16699: \"$ac_link\"") >&5
16700   (eval $ac_link) 2>&5
16701   ac_status=$?
16702   echo "$as_me:16702: \$? = $ac_status" >&5
16703   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16704   { (eval echo "$as_me:16704: \"$ac_try\"") >&5
16705   (eval $ac_try) 2>&5
16706   ac_status=$?
16707   echo "$as_me:16707: \$? = $ac_status" >&5
16708   (exit $ac_status); }; }; then
16709   cf_result=yes
16710 else
16711   echo "$as_me: program exited with status $ac_status" >&5
16712 echo "$as_me: failed program was:" >&5
16713 cat conftest.$ac_ext >&5
16714 cf_result=no
16715 fi
16716 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16717 fi
16718         echo "$as_me:16718: result: $cf_result" >&5
16719 echo "${ECHO_T}$cf_result" >&6
16720         if test $cf_result = yes ; then
16721
16722 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16723
16724                 cat >>confdefs.h <<EOF
16725 #define $cf_result 1
16726 EOF
16727
16728         fi
16729 fi
16730
16731 echo "$as_me:16731: checking for data ttytype declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16732 echo $ECHO_N "checking for data ttytype declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16733
16734 cat >conftest.$ac_ext <<_ACEOF
16735 #line 16735 "configure"
16736 #include "confdefs.h"
16737
16738 #ifdef HAVE_XCURSES
16739 #include <xcurses.h>
16740 char * XCursesProgramName = "test";
16741 #else
16742 #include <${cf_cv_ncurses_header:-curses.h}>
16743 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16744 #include <ncursesw/term.h>
16745 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16746 #include <ncurses/term.h>
16747 #elif defined(HAVE_TERM_H)
16748 #include <term.h>
16749 #endif
16750 #endif
16751
16752 int
16753 main ()
16754 {
16755
16756 void *foo = &(ttytype)
16757
16758   ;
16759   return 0;
16760 }
16761 _ACEOF
16762 rm -f conftest.$ac_objext
16763 if { (eval echo "$as_me:16763: \"$ac_compile\"") >&5
16764   (eval $ac_compile) 2>&5
16765   ac_status=$?
16766   echo "$as_me:16766: \$? = $ac_status" >&5
16767   (exit $ac_status); } &&
16768          { ac_try='test -s conftest.$ac_objext'
16769   { (eval echo "$as_me:16769: \"$ac_try\"") >&5
16770   (eval $ac_try) 2>&5
16771   ac_status=$?
16772   echo "$as_me:16772: \$? = $ac_status" >&5
16773   (exit $ac_status); }; }; then
16774   cf_result=yes
16775 else
16776   echo "$as_me: failed program was:" >&5
16777 cat conftest.$ac_ext >&5
16778 cf_result=no
16779 fi
16780 rm -f conftest.$ac_objext conftest.$ac_ext
16781 echo "$as_me:16781: result: $cf_result" >&5
16782 echo "${ECHO_T}$cf_result" >&6
16783
16784 if test $cf_result = yes ; then
16785
16786 cf_result=`echo "have_curses_data_ttytype" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16787
16788         cat >>confdefs.h <<EOF
16789 #define $cf_result 1
16790 EOF
16791
16792 else
16793         echo "$as_me:16793: checking for data ttytype in library" >&5
16794 echo $ECHO_N "checking for data ttytype in library... $ECHO_C" >&6
16795         # BSD linkers insist on making weak linkage, but resolve at runtime.
16796         if test "$cross_compiling" = yes; then
16797
16798         # cross-compiling
16799         cat >conftest.$ac_ext <<_ACEOF
16800 #line 16800 "configure"
16801 #include "confdefs.h"
16802
16803 #ifdef HAVE_XCURSES
16804 #include <xcurses.h>
16805 char * XCursesProgramName = "test";
16806 #else
16807 #include <${cf_cv_ncurses_header:-curses.h}>
16808 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16809 #include <ncursesw/term.h>
16810 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16811 #include <ncurses/term.h>
16812 #elif defined(HAVE_TERM_H)
16813 #include <term.h>
16814 #endif
16815 #endif
16816
16817 extern char ttytype;
16818 int
16819 main ()
16820 {
16821
16822         do {
16823                 void *foo = &(ttytype);
16824                 fprintf(stderr, "testing linkage of ttytype:%p\n", foo);
16825                 ${cf_cv_main_return:-return}(foo == 0);
16826         } while (0)
16827
16828   ;
16829   return 0;
16830 }
16831 _ACEOF
16832 rm -f conftest.$ac_objext conftest$ac_exeext
16833 if { (eval echo "$as_me:16833: \"$ac_link\"") >&5
16834   (eval $ac_link) 2>&5
16835   ac_status=$?
16836   echo "$as_me:16836: \$? = $ac_status" >&5
16837   (exit $ac_status); } &&
16838          { ac_try='test -s conftest$ac_exeext'
16839   { (eval echo "$as_me:16839: \"$ac_try\"") >&5
16840   (eval $ac_try) 2>&5
16841   ac_status=$?
16842   echo "$as_me:16842: \$? = $ac_status" >&5
16843   (exit $ac_status); }; }; then
16844   cf_result=yes
16845 else
16846   echo "$as_me: failed program was:" >&5
16847 cat conftest.$ac_ext >&5
16848 cf_result=no
16849 fi
16850 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16851
16852 else
16853   cat >conftest.$ac_ext <<_ACEOF
16854 #line 16854 "configure"
16855 #include "confdefs.h"
16856
16857 #ifdef HAVE_XCURSES
16858 #include <xcurses.h>
16859 char * XCursesProgramName = "test";
16860 #else
16861 #include <${cf_cv_ncurses_header:-curses.h}>
16862 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16863 #include <ncursesw/term.h>
16864 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16865 #include <ncurses/term.h>
16866 #elif defined(HAVE_TERM_H)
16867 #include <term.h>
16868 #endif
16869 #endif
16870
16871 extern char ttytype;
16872 int main(void)
16873 {
16874         void *foo = &(ttytype);
16875         fprintf(stderr, "testing linkage of ttytype:%p\n", foo);
16876         ${cf_cv_main_return:-return}(foo == 0);
16877 }
16878 _ACEOF
16879 rm -f conftest$ac_exeext
16880 if { (eval echo "$as_me:16880: \"$ac_link\"") >&5
16881   (eval $ac_link) 2>&5
16882   ac_status=$?
16883   echo "$as_me:16883: \$? = $ac_status" >&5
16884   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16885   { (eval echo "$as_me:16885: \"$ac_try\"") >&5
16886   (eval $ac_try) 2>&5
16887   ac_status=$?
16888   echo "$as_me:16888: \$? = $ac_status" >&5
16889   (exit $ac_status); }; }; then
16890   cf_result=yes
16891 else
16892   echo "$as_me: program exited with status $ac_status" >&5
16893 echo "$as_me: failed program was:" >&5
16894 cat conftest.$ac_ext >&5
16895 cf_result=no
16896 fi
16897 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16898 fi
16899         echo "$as_me:16899: result: $cf_result" >&5
16900 echo "${ECHO_T}$cf_result" >&6
16901         if test $cf_result = yes ; then
16902
16903 cf_result=`echo "decl_curses_data_ttytype" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16904
16905                 cat >>confdefs.h <<EOF
16906 #define $cf_result 1
16907 EOF
16908
16909         fi
16910 fi
16911
16912 if ( test "$GCC" = yes || test "$GXX" = yes )
16913 then
16914 echo "$as_me:16914: checking if you want to turn on gcc warnings" >&5
16915 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
16916
16917 # Check whether --enable-warnings or --disable-warnings was given.
16918 if test "${enable_warnings+set}" = set; then
16919   enableval="$enable_warnings"
16920   test "$enableval" != yes && enableval=no
16921         if test "$enableval" != "no" ; then
16922     with_warnings=yes
16923         else
16924                 with_warnings=no
16925         fi
16926 else
16927   enableval=no
16928         with_warnings=no
16929
16930 fi;
16931 echo "$as_me:16931: result: $with_warnings" >&5
16932 echo "${ECHO_T}$with_warnings" >&6
16933 if test "$with_warnings" = "yes"
16934 then
16935
16936 if test "$GCC" = yes
16937 then
16938 cat > conftest.i <<EOF
16939 #ifndef GCC_PRINTF
16940 #define GCC_PRINTF 0
16941 #endif
16942 #ifndef GCC_SCANF
16943 #define GCC_SCANF 0
16944 #endif
16945 #ifndef GCC_NORETURN
16946 #define GCC_NORETURN /* nothing */
16947 #endif
16948 #ifndef GCC_UNUSED
16949 #define GCC_UNUSED /* nothing */
16950 #endif
16951 EOF
16952 if test "$GCC" = yes
16953 then
16954         { echo "$as_me:16954: checking for $CC __attribute__ directives..." >&5
16955 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
16956 cat > conftest.$ac_ext <<EOF
16957 #line 16957 "${as_me:-configure}"
16958 #include "confdefs.h"
16959 #include "conftest.h"
16960 #include "conftest.i"
16961 #if     GCC_PRINTF
16962 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
16963 #else
16964 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
16965 #endif
16966 #if     GCC_SCANF
16967 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
16968 #else
16969 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
16970 #endif
16971 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
16972 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
16973 extern void foo(void) GCC_NORETURN;
16974 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
16975 EOF
16976         cf_printf_attribute=no
16977         cf_scanf_attribute=no
16978         for cf_attribute in scanf printf unused noreturn
16979         do
16980
16981 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16982
16983                 cf_directive="__attribute__(($cf_attribute))"
16984                 echo "checking for $CC $cf_directive" 1>&5
16985
16986                 case $cf_attribute in
16987                 (printf)
16988                         cf_printf_attribute=yes
16989                         cat >conftest.h <<EOF
16990 #define GCC_$cf_ATTRIBUTE 1
16991 EOF
16992                         ;;
16993                 (scanf)
16994                         cf_scanf_attribute=yes
16995                         cat >conftest.h <<EOF
16996 #define GCC_$cf_ATTRIBUTE 1
16997 EOF
16998                         ;;
16999                 (*)
17000                         cat >conftest.h <<EOF
17001 #define GCC_$cf_ATTRIBUTE $cf_directive
17002 EOF
17003                         ;;
17004                 esac
17005
17006                 if { (eval echo "$as_me:17006: \"$ac_compile\"") >&5
17007   (eval $ac_compile) 2>&5
17008   ac_status=$?
17009   echo "$as_me:17009: \$? = $ac_status" >&5
17010   (exit $ac_status); }; then
17011                         test -n "$verbose" && echo "$as_me:17011: result: ... $cf_attribute" >&5
17012 echo "${ECHO_T}... $cf_attribute" >&6
17013                         cat conftest.h >>confdefs.h
17014                         case $cf_attribute in
17015                         (noreturn)
17016
17017 cat >>confdefs.h <<EOF
17018 #define GCC_NORETURN $cf_directive
17019 EOF
17020
17021                                 ;;
17022                         (printf)
17023                                 cf_value='/* nothing */'
17024                                 if test "$cf_printf_attribute" != no ; then
17025                                         cf_value='__attribute__((format(printf,fmt,var)))'
17026
17027 cat >>confdefs.h <<\EOF
17028 #define GCC_PRINTF 1
17029 EOF
17030
17031                                 fi
17032
17033 cat >>confdefs.h <<EOF
17034 #define GCC_PRINTFLIKE(fmt,var) $cf_value
17035 EOF
17036
17037                                 ;;
17038                         (scanf)
17039                                 cf_value='/* nothing */'
17040                                 if test "$cf_scanf_attribute" != no ; then
17041                                         cf_value='__attribute__((format(scanf,fmt,var)))'
17042
17043 cat >>confdefs.h <<\EOF
17044 #define GCC_SCANF 1
17045 EOF
17046
17047                                 fi
17048
17049 cat >>confdefs.h <<EOF
17050 #define GCC_SCANFLIKE(fmt,var) $cf_value
17051 EOF
17052
17053                                 ;;
17054                         (unused)
17055
17056 cat >>confdefs.h <<EOF
17057 #define GCC_UNUSED $cf_directive
17058 EOF
17059
17060                                 ;;
17061                         esac
17062                 fi
17063         done
17064 else
17065         fgrep define conftest.i >>confdefs.h
17066 fi
17067 rm -rf conftest*
17068 fi
17069
17070 INTEL_COMPILER=no
17071
17072 if test "$GCC" = yes ; then
17073         case $host_os in
17074         (linux*|gnu*)
17075                 echo "$as_me:17075: checking if this is really Intel C compiler" >&5
17076 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
17077                 cf_save_CFLAGS="$CFLAGS"
17078                 CFLAGS="$CFLAGS -no-gcc"
17079                 cat >conftest.$ac_ext <<_ACEOF
17080 #line 17080 "configure"
17081 #include "confdefs.h"
17082
17083 int
17084 main ()
17085 {
17086
17087 #ifdef __INTEL_COMPILER
17088 #else
17089 make an error
17090 #endif
17091
17092   ;
17093   return 0;
17094 }
17095 _ACEOF
17096 rm -f conftest.$ac_objext
17097 if { (eval echo "$as_me:17097: \"$ac_compile\"") >&5
17098   (eval $ac_compile) 2>&5
17099   ac_status=$?
17100   echo "$as_me:17100: \$? = $ac_status" >&5
17101   (exit $ac_status); } &&
17102          { ac_try='test -s conftest.$ac_objext'
17103   { (eval echo "$as_me:17103: \"$ac_try\"") >&5
17104   (eval $ac_try) 2>&5
17105   ac_status=$?
17106   echo "$as_me:17106: \$? = $ac_status" >&5
17107   (exit $ac_status); }; }; then
17108   INTEL_COMPILER=yes
17109 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
17110
17111 else
17112   echo "$as_me: failed program was:" >&5
17113 cat conftest.$ac_ext >&5
17114 fi
17115 rm -f conftest.$ac_objext conftest.$ac_ext
17116                 CFLAGS="$cf_save_CFLAGS"
17117                 echo "$as_me:17117: result: $INTEL_COMPILER" >&5
17118 echo "${ECHO_T}$INTEL_COMPILER" >&6
17119                 ;;
17120         esac
17121 fi
17122
17123 CLANG_COMPILER=no
17124
17125 if test "$GCC" = yes ; then
17126         echo "$as_me:17126: checking if this is really Clang C compiler" >&5
17127 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
17128         cf_save_CFLAGS="$CFLAGS"
17129         CFLAGS="$CFLAGS -Qunused-arguments"
17130         cat >conftest.$ac_ext <<_ACEOF
17131 #line 17131 "configure"
17132 #include "confdefs.h"
17133
17134 int
17135 main ()
17136 {
17137
17138 #ifdef __clang__
17139 #else
17140 make an error
17141 #endif
17142
17143   ;
17144   return 0;
17145 }
17146 _ACEOF
17147 rm -f conftest.$ac_objext
17148 if { (eval echo "$as_me:17148: \"$ac_compile\"") >&5
17149   (eval $ac_compile) 2>&5
17150   ac_status=$?
17151   echo "$as_me:17151: \$? = $ac_status" >&5
17152   (exit $ac_status); } &&
17153          { ac_try='test -s conftest.$ac_objext'
17154   { (eval echo "$as_me:17154: \"$ac_try\"") >&5
17155   (eval $ac_try) 2>&5
17156   ac_status=$?
17157   echo "$as_me:17157: \$? = $ac_status" >&5
17158   (exit $ac_status); }; }; then
17159   CLANG_COMPILER=yes
17160 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
17161
17162 else
17163   echo "$as_me: failed program was:" >&5
17164 cat conftest.$ac_ext >&5
17165 fi
17166 rm -f conftest.$ac_objext conftest.$ac_ext
17167         CFLAGS="$cf_save_CFLAGS"
17168         echo "$as_me:17168: result: $CLANG_COMPILER" >&5
17169 echo "${ECHO_T}$CLANG_COMPILER" >&6
17170 fi
17171
17172 cat > conftest.$ac_ext <<EOF
17173 #line 17173 "${as_me:-configure}"
17174 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
17175 EOF
17176
17177 if test "$INTEL_COMPILER" = yes
17178 then
17179 # The "-wdXXX" options suppress warnings:
17180 # remark #1419: external declaration in primary source file
17181 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
17182 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
17183 # remark #193: zero used for undefined preprocessing identifier
17184 # remark #593: variable "curs_sb_left_arrow" was set but never used
17185 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
17186 # remark #869: parameter "tw" was never referenced
17187 # remark #981: operands are evaluated in unspecified order
17188 # warning #279: controlling expression is constant
17189
17190         { echo "$as_me:17190: checking for $CC warning options..." >&5
17191 echo "$as_me: checking for $CC warning options..." >&6;}
17192         cf_save_CFLAGS="$CFLAGS"
17193         EXTRA_CFLAGS="-Wall"
17194         for cf_opt in \
17195                 wd1419 \
17196                 wd1683 \
17197                 wd1684 \
17198                 wd193 \
17199                 wd593 \
17200                 wd279 \
17201                 wd810 \
17202                 wd869 \
17203                 wd981
17204         do
17205                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17206                 if { (eval echo "$as_me:17206: \"$ac_compile\"") >&5
17207   (eval $ac_compile) 2>&5
17208   ac_status=$?
17209   echo "$as_me:17209: \$? = $ac_status" >&5
17210   (exit $ac_status); }; then
17211                         test -n "$verbose" && echo "$as_me:17211: result: ... -$cf_opt" >&5
17212 echo "${ECHO_T}... -$cf_opt" >&6
17213                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17214                 fi
17215         done
17216         CFLAGS="$cf_save_CFLAGS"
17217
17218 elif test "$GCC" = yes
17219 then
17220         { echo "$as_me:17220: checking for $CC warning options..." >&5
17221 echo "$as_me: checking for $CC warning options..." >&6;}
17222         cf_save_CFLAGS="$CFLAGS"
17223         EXTRA_CFLAGS=
17224         cf_warn_CONST=""
17225         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
17226         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
17227         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
17228         for cf_opt in W Wall \
17229                 Wbad-function-cast \
17230                 Wcast-align \
17231                 Wcast-qual \
17232                 Wdeclaration-after-statement \
17233                 Wextra \
17234                 Winline \
17235                 Wmissing-declarations \
17236                 Wmissing-prototypes \
17237                 Wnested-externs \
17238                 Wpointer-arith \
17239                 Wshadow \
17240                 Wstrict-prototypes \
17241                 Wundef $cf_gcc_warnings $cf_warn_CONST
17242         do
17243                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17244                 if { (eval echo "$as_me:17244: \"$ac_compile\"") >&5
17245   (eval $ac_compile) 2>&5
17246   ac_status=$?
17247   echo "$as_me:17247: \$? = $ac_status" >&5
17248   (exit $ac_status); }; then
17249                         test -n "$verbose" && echo "$as_me:17249: result: ... -$cf_opt" >&5
17250 echo "${ECHO_T}... -$cf_opt" >&6
17251                         case $cf_opt in
17252                         (Wcast-qual)
17253                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
17254                                 ;;
17255                         (Winline)
17256                                 case $GCC_VERSION in
17257                                 ([34].*)
17258                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17259
17260 echo "${as_me:-configure}:17260: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17261
17262                                         continue;;
17263                                 esac
17264                                 ;;
17265                         (Wpointer-arith)
17266                                 case $GCC_VERSION in
17267                                 ([12].*)
17268                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17269
17270 echo "${as_me:-configure}:17270: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17271
17272                                         continue;;
17273                                 esac
17274                                 ;;
17275                         esac
17276                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17277                 fi
17278         done
17279         CFLAGS="$cf_save_CFLAGS"
17280 fi
17281 rm -rf conftest*
17282
17283 fi
17284 fi
17285
17286 echo "$as_me:17286: checking if you want to use dmalloc for testing" >&5
17287 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
17288
17289 # Check whether --with-dmalloc or --without-dmalloc was given.
17290 if test "${with_dmalloc+set}" = set; then
17291   withval="$with_dmalloc"
17292
17293 cat >>confdefs.h <<EOF
17294 #define USE_DMALLOC 1
17295 EOF
17296
17297         : ${with_cflags:=-g}
17298         : ${with_no_leaks:=yes}
17299          with_dmalloc=yes
17300 else
17301   with_dmalloc=
17302 fi;
17303 echo "$as_me:17303: result: ${with_dmalloc:-no}" >&5
17304 echo "${ECHO_T}${with_dmalloc:-no}" >&6
17305
17306 case .$with_cflags in
17307 (.*-g*)
17308         case .$CFLAGS in
17309         (.*-g*)
17310                 ;;
17311         (*)
17312
17313 cf_fix_cppflags=no
17314 cf_new_cflags=
17315 cf_new_cppflags=
17316 cf_new_extra_cppflags=
17317
17318 for cf_add_cflags in -g
17319 do
17320 case $cf_fix_cppflags in
17321 (no)
17322         case $cf_add_cflags in
17323         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17324                 case $cf_add_cflags in
17325                 (-D*)
17326                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17327
17328                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17329                                 && test -z "${cf_tst_cflags}" \
17330                                 && cf_fix_cppflags=yes
17331
17332                         if test $cf_fix_cppflags = yes ; then
17333                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17334                                 continue
17335                         elif test "${cf_tst_cflags}" = "\"'" ; then
17336                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17337                                 continue
17338                         fi
17339                         ;;
17340                 esac
17341                 case "$CPPFLAGS" in
17342                 (*$cf_add_cflags)
17343                         ;;
17344                 (*)
17345                         case $cf_add_cflags in
17346                         (-D*)
17347                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17348
17349 CPPFLAGS=`echo "$CPPFLAGS" | \
17350         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17351                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17352
17353                                 ;;
17354                         esac
17355                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17356                         ;;
17357                 esac
17358                 ;;
17359         (*)
17360                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17361                 ;;
17362         esac
17363         ;;
17364 (yes)
17365         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17366
17367         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17368
17369         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17370                 && test -z "${cf_tst_cflags}" \
17371                 && cf_fix_cppflags=no
17372         ;;
17373 esac
17374 done
17375
17376 if test -n "$cf_new_cflags" ; then
17377
17378         CFLAGS="$CFLAGS $cf_new_cflags"
17379 fi
17380
17381 if test -n "$cf_new_cppflags" ; then
17382
17383         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17384 fi
17385
17386 if test -n "$cf_new_extra_cppflags" ; then
17387
17388         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17389 fi
17390
17391                 ;;
17392         esac
17393         ;;
17394 esac
17395
17396 if test "$with_dmalloc" = yes ; then
17397         echo "$as_me:17397: checking for dmalloc.h" >&5
17398 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
17399 if test "${ac_cv_header_dmalloc_h+set}" = set; then
17400   echo $ECHO_N "(cached) $ECHO_C" >&6
17401 else
17402   cat >conftest.$ac_ext <<_ACEOF
17403 #line 17403 "configure"
17404 #include "confdefs.h"
17405 #include <dmalloc.h>
17406 _ACEOF
17407 if { (eval echo "$as_me:17407: \"$ac_cpp conftest.$ac_ext\"") >&5
17408   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17409   ac_status=$?
17410   egrep -v '^ *\+' conftest.er1 >conftest.err
17411   rm -f conftest.er1
17412   cat conftest.err >&5
17413   echo "$as_me:17413: \$? = $ac_status" >&5
17414   (exit $ac_status); } >/dev/null; then
17415   if test -s conftest.err; then
17416     ac_cpp_err=$ac_c_preproc_warn_flag
17417   else
17418     ac_cpp_err=
17419   fi
17420 else
17421   ac_cpp_err=yes
17422 fi
17423 if test -z "$ac_cpp_err"; then
17424   ac_cv_header_dmalloc_h=yes
17425 else
17426   echo "$as_me: failed program was:" >&5
17427   cat conftest.$ac_ext >&5
17428   ac_cv_header_dmalloc_h=no
17429 fi
17430 rm -f conftest.err conftest.$ac_ext
17431 fi
17432 echo "$as_me:17432: result: $ac_cv_header_dmalloc_h" >&5
17433 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
17434 if test $ac_cv_header_dmalloc_h = yes; then
17435
17436 echo "$as_me:17436: checking for dmalloc_debug in -ldmalloc" >&5
17437 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
17438 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
17439   echo $ECHO_N "(cached) $ECHO_C" >&6
17440 else
17441   ac_check_lib_save_LIBS=$LIBS
17442 LIBS="-ldmalloc  $LIBS"
17443 cat >conftest.$ac_ext <<_ACEOF
17444 #line 17444 "configure"
17445 #include "confdefs.h"
17446
17447 /* Override any gcc2 internal prototype to avoid an error.  */
17448 #ifdef __cplusplus
17449 extern "C"
17450 #endif
17451 /* We use char because int might match the return type of a gcc2
17452    builtin and then its argument prototype would still apply.  */
17453 char dmalloc_debug ();
17454 int
17455 main ()
17456 {
17457 dmalloc_debug ();
17458   ;
17459   return 0;
17460 }
17461 _ACEOF
17462 rm -f conftest.$ac_objext conftest$ac_exeext
17463 if { (eval echo "$as_me:17463: \"$ac_link\"") >&5
17464   (eval $ac_link) 2>&5
17465   ac_status=$?
17466   echo "$as_me:17466: \$? = $ac_status" >&5
17467   (exit $ac_status); } &&
17468          { ac_try='test -s conftest$ac_exeext'
17469   { (eval echo "$as_me:17469: \"$ac_try\"") >&5
17470   (eval $ac_try) 2>&5
17471   ac_status=$?
17472   echo "$as_me:17472: \$? = $ac_status" >&5
17473   (exit $ac_status); }; }; then
17474   ac_cv_lib_dmalloc_dmalloc_debug=yes
17475 else
17476   echo "$as_me: failed program was:" >&5
17477 cat conftest.$ac_ext >&5
17478 ac_cv_lib_dmalloc_dmalloc_debug=no
17479 fi
17480 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17481 LIBS=$ac_check_lib_save_LIBS
17482 fi
17483 echo "$as_me:17483: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
17484 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
17485 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
17486   cat >>confdefs.h <<EOF
17487 #define HAVE_LIBDMALLOC 1
17488 EOF
17489
17490   LIBS="-ldmalloc $LIBS"
17491
17492 fi
17493
17494 fi
17495
17496 fi
17497
17498 echo "$as_me:17498: checking if you want to use dbmalloc for testing" >&5
17499 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
17500
17501 # Check whether --with-dbmalloc or --without-dbmalloc was given.
17502 if test "${with_dbmalloc+set}" = set; then
17503   withval="$with_dbmalloc"
17504
17505 cat >>confdefs.h <<EOF
17506 #define USE_DBMALLOC 1
17507 EOF
17508
17509         : ${with_cflags:=-g}
17510         : ${with_no_leaks:=yes}
17511          with_dbmalloc=yes
17512 else
17513   with_dbmalloc=
17514 fi;
17515 echo "$as_me:17515: result: ${with_dbmalloc:-no}" >&5
17516 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
17517
17518 case .$with_cflags in
17519 (.*-g*)
17520         case .$CFLAGS in
17521         (.*-g*)
17522                 ;;
17523         (*)
17524
17525 cf_fix_cppflags=no
17526 cf_new_cflags=
17527 cf_new_cppflags=
17528 cf_new_extra_cppflags=
17529
17530 for cf_add_cflags in -g
17531 do
17532 case $cf_fix_cppflags in
17533 (no)
17534         case $cf_add_cflags in
17535         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17536                 case $cf_add_cflags in
17537                 (-D*)
17538                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17539
17540                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17541                                 && test -z "${cf_tst_cflags}" \
17542                                 && cf_fix_cppflags=yes
17543
17544                         if test $cf_fix_cppflags = yes ; then
17545                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17546                                 continue
17547                         elif test "${cf_tst_cflags}" = "\"'" ; then
17548                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17549                                 continue
17550                         fi
17551                         ;;
17552                 esac
17553                 case "$CPPFLAGS" in
17554                 (*$cf_add_cflags)
17555                         ;;
17556                 (*)
17557                         case $cf_add_cflags in
17558                         (-D*)
17559                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17560
17561 CPPFLAGS=`echo "$CPPFLAGS" | \
17562         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17563                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17564
17565                                 ;;
17566                         esac
17567                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17568                         ;;
17569                 esac
17570                 ;;
17571         (*)
17572                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17573                 ;;
17574         esac
17575         ;;
17576 (yes)
17577         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17578
17579         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17580
17581         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17582                 && test -z "${cf_tst_cflags}" \
17583                 && cf_fix_cppflags=no
17584         ;;
17585 esac
17586 done
17587
17588 if test -n "$cf_new_cflags" ; then
17589
17590         CFLAGS="$CFLAGS $cf_new_cflags"
17591 fi
17592
17593 if test -n "$cf_new_cppflags" ; then
17594
17595         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17596 fi
17597
17598 if test -n "$cf_new_extra_cppflags" ; then
17599
17600         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17601 fi
17602
17603                 ;;
17604         esac
17605         ;;
17606 esac
17607
17608 if test "$with_dbmalloc" = yes ; then
17609         echo "$as_me:17609: checking for dbmalloc.h" >&5
17610 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
17611 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
17612   echo $ECHO_N "(cached) $ECHO_C" >&6
17613 else
17614   cat >conftest.$ac_ext <<_ACEOF
17615 #line 17615 "configure"
17616 #include "confdefs.h"
17617 #include <dbmalloc.h>
17618 _ACEOF
17619 if { (eval echo "$as_me:17619: \"$ac_cpp conftest.$ac_ext\"") >&5
17620   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17621   ac_status=$?
17622   egrep -v '^ *\+' conftest.er1 >conftest.err
17623   rm -f conftest.er1
17624   cat conftest.err >&5
17625   echo "$as_me:17625: \$? = $ac_status" >&5
17626   (exit $ac_status); } >/dev/null; then
17627   if test -s conftest.err; then
17628     ac_cpp_err=$ac_c_preproc_warn_flag
17629   else
17630     ac_cpp_err=
17631   fi
17632 else
17633   ac_cpp_err=yes
17634 fi
17635 if test -z "$ac_cpp_err"; then
17636   ac_cv_header_dbmalloc_h=yes
17637 else
17638   echo "$as_me: failed program was:" >&5
17639   cat conftest.$ac_ext >&5
17640   ac_cv_header_dbmalloc_h=no
17641 fi
17642 rm -f conftest.err conftest.$ac_ext
17643 fi
17644 echo "$as_me:17644: result: $ac_cv_header_dbmalloc_h" >&5
17645 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
17646 if test $ac_cv_header_dbmalloc_h = yes; then
17647
17648 echo "$as_me:17648: checking for debug_malloc in -ldbmalloc" >&5
17649 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
17650 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
17651   echo $ECHO_N "(cached) $ECHO_C" >&6
17652 else
17653   ac_check_lib_save_LIBS=$LIBS
17654 LIBS="-ldbmalloc  $LIBS"
17655 cat >conftest.$ac_ext <<_ACEOF
17656 #line 17656 "configure"
17657 #include "confdefs.h"
17658
17659 /* Override any gcc2 internal prototype to avoid an error.  */
17660 #ifdef __cplusplus
17661 extern "C"
17662 #endif
17663 /* We use char because int might match the return type of a gcc2
17664    builtin and then its argument prototype would still apply.  */
17665 char debug_malloc ();
17666 int
17667 main ()
17668 {
17669 debug_malloc ();
17670   ;
17671   return 0;
17672 }
17673 _ACEOF
17674 rm -f conftest.$ac_objext conftest$ac_exeext
17675 if { (eval echo "$as_me:17675: \"$ac_link\"") >&5
17676   (eval $ac_link) 2>&5
17677   ac_status=$?
17678   echo "$as_me:17678: \$? = $ac_status" >&5
17679   (exit $ac_status); } &&
17680          { ac_try='test -s conftest$ac_exeext'
17681   { (eval echo "$as_me:17681: \"$ac_try\"") >&5
17682   (eval $ac_try) 2>&5
17683   ac_status=$?
17684   echo "$as_me:17684: \$? = $ac_status" >&5
17685   (exit $ac_status); }; }; then
17686   ac_cv_lib_dbmalloc_debug_malloc=yes
17687 else
17688   echo "$as_me: failed program was:" >&5
17689 cat conftest.$ac_ext >&5
17690 ac_cv_lib_dbmalloc_debug_malloc=no
17691 fi
17692 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17693 LIBS=$ac_check_lib_save_LIBS
17694 fi
17695 echo "$as_me:17695: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
17696 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
17697 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
17698   cat >>confdefs.h <<EOF
17699 #define HAVE_LIBDBMALLOC 1
17700 EOF
17701
17702   LIBS="-ldbmalloc $LIBS"
17703
17704 fi
17705
17706 fi
17707
17708 fi
17709
17710 echo "$as_me:17710: checking if you want to use valgrind for testing" >&5
17711 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
17712
17713 # Check whether --with-valgrind or --without-valgrind was given.
17714 if test "${with_valgrind+set}" = set; then
17715   withval="$with_valgrind"
17716
17717 cat >>confdefs.h <<EOF
17718 #define USE_VALGRIND 1
17719 EOF
17720
17721         : ${with_cflags:=-g}
17722         : ${with_no_leaks:=yes}
17723          with_valgrind=yes
17724 else
17725   with_valgrind=
17726 fi;
17727 echo "$as_me:17727: result: ${with_valgrind:-no}" >&5
17728 echo "${ECHO_T}${with_valgrind:-no}" >&6
17729
17730 case .$with_cflags in
17731 (.*-g*)
17732         case .$CFLAGS in
17733         (.*-g*)
17734                 ;;
17735         (*)
17736
17737 cf_fix_cppflags=no
17738 cf_new_cflags=
17739 cf_new_cppflags=
17740 cf_new_extra_cppflags=
17741
17742 for cf_add_cflags in -g
17743 do
17744 case $cf_fix_cppflags in
17745 (no)
17746         case $cf_add_cflags in
17747         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17748                 case $cf_add_cflags in
17749                 (-D*)
17750                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17751
17752                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17753                                 && test -z "${cf_tst_cflags}" \
17754                                 && cf_fix_cppflags=yes
17755
17756                         if test $cf_fix_cppflags = yes ; then
17757                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17758                                 continue
17759                         elif test "${cf_tst_cflags}" = "\"'" ; then
17760                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17761                                 continue
17762                         fi
17763                         ;;
17764                 esac
17765                 case "$CPPFLAGS" in
17766                 (*$cf_add_cflags)
17767                         ;;
17768                 (*)
17769                         case $cf_add_cflags in
17770                         (-D*)
17771                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17772
17773 CPPFLAGS=`echo "$CPPFLAGS" | \
17774         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17775                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17776
17777                                 ;;
17778                         esac
17779                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17780                         ;;
17781                 esac
17782                 ;;
17783         (*)
17784                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17785                 ;;
17786         esac
17787         ;;
17788 (yes)
17789         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17790
17791         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17792
17793         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17794                 && test -z "${cf_tst_cflags}" \
17795                 && cf_fix_cppflags=no
17796         ;;
17797 esac
17798 done
17799
17800 if test -n "$cf_new_cflags" ; then
17801
17802         CFLAGS="$CFLAGS $cf_new_cflags"
17803 fi
17804
17805 if test -n "$cf_new_cppflags" ; then
17806
17807         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17808 fi
17809
17810 if test -n "$cf_new_extra_cppflags" ; then
17811
17812         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17813 fi
17814
17815                 ;;
17816         esac
17817         ;;
17818 esac
17819
17820 echo "$as_me:17820: checking if you want to perform memory-leak testing" >&5
17821 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
17822
17823 # Check whether --enable-leaks or --disable-leaks was given.
17824 if test "${enable_leaks+set}" = set; then
17825   enableval="$enable_leaks"
17826   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
17827 else
17828   : ${with_no_leaks:=no}
17829 fi;
17830 echo "$as_me:17830: result: $with_no_leaks" >&5
17831 echo "${ECHO_T}$with_no_leaks" >&6
17832
17833 if test "$with_no_leaks" = yes ; then
17834
17835 cat >>confdefs.h <<\EOF
17836 #define NO_LEAKS 1
17837 EOF
17838
17839 cat >>confdefs.h <<\EOF
17840 #define YY_NO_LEAKS 1
17841 EOF
17842
17843 fi
17844
17845 LD_RPATH_OPT=
17846 echo "$as_me:17846: checking for an rpath option" >&5
17847 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
17848 case $cf_cv_system_name in
17849 (irix*)
17850         if test "$GCC" = yes; then
17851                 LD_RPATH_OPT="-Wl,-rpath,"
17852         else
17853                 LD_RPATH_OPT="-rpath "
17854         fi
17855         ;;
17856 (linux*|gnu*|k*bsd*-gnu|freebsd*)
17857         LD_RPATH_OPT="-Wl,-rpath,"
17858         ;;
17859 (openbsd[2-9].*|mirbsd*)
17860         LD_RPATH_OPT="-Wl,-rpath,"
17861         ;;
17862 (dragonfly*)
17863         LD_RPATH_OPT="-rpath "
17864         ;;
17865 (netbsd*)
17866         LD_RPATH_OPT="-Wl,-rpath,"
17867         ;;
17868 (osf*|mls+*)
17869         LD_RPATH_OPT="-rpath "
17870         ;;
17871 (solaris2*)
17872         LD_RPATH_OPT="-R"
17873         ;;
17874 (*)
17875         ;;
17876 esac
17877 echo "$as_me:17877: result: $LD_RPATH_OPT" >&5
17878 echo "${ECHO_T}$LD_RPATH_OPT" >&6
17879
17880 case "x$LD_RPATH_OPT" in
17881 (x-R*)
17882         echo "$as_me:17882: checking if we need a space after rpath option" >&5
17883 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
17884         cf_save_LIBS="$LIBS"
17885
17886 cf_add_libs="${LD_RPATH_OPT}$libdir"
17887 # Filter out duplicates - this happens with badly-designed ".pc" files...
17888 for cf_add_1lib in $LIBS
17889 do
17890         for cf_add_2lib in $cf_add_libs
17891         do
17892                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
17893                 then
17894                         cf_add_1lib=
17895                         break
17896                 fi
17897         done
17898         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
17899 done
17900 LIBS="$cf_add_libs"
17901
17902         cat >conftest.$ac_ext <<_ACEOF
17903 #line 17903 "configure"
17904 #include "confdefs.h"
17905
17906 int
17907 main ()
17908 {
17909
17910   ;
17911   return 0;
17912 }
17913 _ACEOF
17914 rm -f conftest.$ac_objext conftest$ac_exeext
17915 if { (eval echo "$as_me:17915: \"$ac_link\"") >&5
17916   (eval $ac_link) 2>&5
17917   ac_status=$?
17918   echo "$as_me:17918: \$? = $ac_status" >&5
17919   (exit $ac_status); } &&
17920          { ac_try='test -s conftest$ac_exeext'
17921   { (eval echo "$as_me:17921: \"$ac_try\"") >&5
17922   (eval $ac_try) 2>&5
17923   ac_status=$?
17924   echo "$as_me:17924: \$? = $ac_status" >&5
17925   (exit $ac_status); }; }; then
17926   cf_rpath_space=no
17927 else
17928   echo "$as_me: failed program was:" >&5
17929 cat conftest.$ac_ext >&5
17930 cf_rpath_space=yes
17931 fi
17932 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17933         LIBS="$cf_save_LIBS"
17934         echo "$as_me:17934: result: $cf_rpath_space" >&5
17935 echo "${ECHO_T}$cf_rpath_space" >&6
17936         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
17937         ;;
17938 esac
17939
17940 echo "$as_me:17940: checking if rpath-hack should be disabled" >&5
17941 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
17942
17943 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
17944 if test "${enable_rpath_hack+set}" = set; then
17945   enableval="$enable_rpath_hack"
17946   test "$enableval" != no && enableval=yes
17947         if test "$enableval" != "yes" ; then
17948     cf_disable_rpath_hack=yes
17949         else
17950                 cf_disable_rpath_hack=no
17951         fi
17952 else
17953   enableval=yes
17954         cf_disable_rpath_hack=no
17955
17956 fi;
17957 echo "$as_me:17957: result: $cf_disable_rpath_hack" >&5
17958 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
17959 if test "$cf_disable_rpath_hack" = no ; then
17960
17961 echo "$as_me:17961: checking for updated LDFLAGS" >&5
17962 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
17963 if test -n "$LD_RPATH_OPT" ; then
17964         echo "$as_me:17964: result: maybe" >&5
17965 echo "${ECHO_T}maybe" >&6
17966
17967         for ac_prog in ldd
17968 do
17969   # Extract the first word of "$ac_prog", so it can be a program name with args.
17970 set dummy $ac_prog; ac_word=$2
17971 echo "$as_me:17971: checking for $ac_word" >&5
17972 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17973 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
17974   echo $ECHO_N "(cached) $ECHO_C" >&6
17975 else
17976   if test -n "$cf_ldd_prog"; then
17977   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
17978 else
17979   ac_save_IFS=$IFS; IFS=$ac_path_separator
17980 ac_dummy="$PATH"
17981 for ac_dir in $ac_dummy; do
17982   IFS=$ac_save_IFS
17983   test -z "$ac_dir" && ac_dir=.
17984   $as_executable_p "$ac_dir/$ac_word" || continue
17985 ac_cv_prog_cf_ldd_prog="$ac_prog"
17986 echo "$as_me:17986: found $ac_dir/$ac_word" >&5
17987 break
17988 done
17989
17990 fi
17991 fi
17992 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
17993 if test -n "$cf_ldd_prog"; then
17994   echo "$as_me:17994: result: $cf_ldd_prog" >&5
17995 echo "${ECHO_T}$cf_ldd_prog" >&6
17996 else
17997   echo "$as_me:17997: result: no" >&5
17998 echo "${ECHO_T}no" >&6
17999 fi
18000
18001   test -n "$cf_ldd_prog" && break
18002 done
18003 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
18004
18005         cf_rpath_list="/usr/lib /lib"
18006         if test "$cf_ldd_prog" != no
18007         then
18008                 cf_rpath_oops=
18009
18010 cat >conftest.$ac_ext <<_ACEOF
18011 #line 18011 "configure"
18012 #include "confdefs.h"
18013 #include <stdio.h>
18014 int
18015 main ()
18016 {
18017 printf("Hello");
18018   ;
18019   return 0;
18020 }
18021 _ACEOF
18022 rm -f conftest.$ac_objext conftest$ac_exeext
18023 if { (eval echo "$as_me:18023: \"$ac_link\"") >&5
18024   (eval $ac_link) 2>&5
18025   ac_status=$?
18026   echo "$as_me:18026: \$? = $ac_status" >&5
18027   (exit $ac_status); } &&
18028          { ac_try='test -s conftest$ac_exeext'
18029   { (eval echo "$as_me:18029: \"$ac_try\"") >&5
18030   (eval $ac_try) 2>&5
18031   ac_status=$?
18032   echo "$as_me:18032: \$? = $ac_status" >&5
18033   (exit $ac_status); }; }; then
18034   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
18035                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
18036 else
18037   echo "$as_me: failed program was:" >&5
18038 cat conftest.$ac_ext >&5
18039 fi
18040 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18041
18042                 # If we passed the link-test, but get a "not found" on a given library,
18043                 # this could be due to inept reconfiguration of gcc to make it only
18044                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
18045                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
18046                 # /usr/local libraries.
18047                 if test -n "$cf_rpath_oops"
18048                 then
18049                         for cf_rpath_src in $cf_rpath_oops
18050                         do
18051                                 for cf_rpath_dir in \
18052                                         /usr/local \
18053                                         /usr/pkg \
18054                                         /opt/sfw
18055                                 do
18056                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
18057                                         then
18058                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
18059
18060 echo "${as_me:-configure}:18060: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
18061
18062                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
18063                                                 break
18064                                         fi
18065                                 done
18066                         done
18067                 fi
18068         fi
18069
18070         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18071
18072 echo "${as_me:-configure}:18072: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18073
18074 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
18075
18076 echo "${as_me:-configure}:18076: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
18077
18078 cf_rpath_dst=
18079 for cf_rpath_src in $LDFLAGS
18080 do
18081         case $cf_rpath_src in
18082         (-L*)
18083
18084                 # check if this refers to a directory which we will ignore
18085                 cf_rpath_skip=no
18086                 if test -n "$cf_rpath_list"
18087                 then
18088                         for cf_rpath_item in $cf_rpath_list
18089                         do
18090                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18091                                 then
18092                                         cf_rpath_skip=yes
18093                                         break
18094                                 fi
18095                         done
18096                 fi
18097
18098                 if test "$cf_rpath_skip" = no
18099                 then
18100                         # transform the option
18101                         if test "$LD_RPATH_OPT" = "-R " ; then
18102                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18103                         else
18104                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18105                         fi
18106
18107                         # if we have not already added this, add it now
18108                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18109                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18110                         then
18111                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18112
18113 echo "${as_me:-configure}:18113: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18114
18115                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18116                         fi
18117                 fi
18118                 ;;
18119         esac
18120         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18121 done
18122 LDFLAGS=$cf_rpath_dst
18123
18124 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
18125
18126 echo "${as_me:-configure}:18126: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
18127
18128 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
18129
18130 echo "${as_me:-configure}:18130: testing ...checking LIBS $LIBS ..." 1>&5
18131
18132 cf_rpath_dst=
18133 for cf_rpath_src in $LIBS
18134 do
18135         case $cf_rpath_src in
18136         (-L*)
18137
18138                 # check if this refers to a directory which we will ignore
18139                 cf_rpath_skip=no
18140                 if test -n "$cf_rpath_list"
18141                 then
18142                         for cf_rpath_item in $cf_rpath_list
18143                         do
18144                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18145                                 then
18146                                         cf_rpath_skip=yes
18147                                         break
18148                                 fi
18149                         done
18150                 fi
18151
18152                 if test "$cf_rpath_skip" = no
18153                 then
18154                         # transform the option
18155                         if test "$LD_RPATH_OPT" = "-R " ; then
18156                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18157                         else
18158                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18159                         fi
18160
18161                         # if we have not already added this, add it now
18162                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18163                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18164                         then
18165                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18166
18167 echo "${as_me:-configure}:18167: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18168
18169                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18170                         fi
18171                 fi
18172                 ;;
18173         esac
18174         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18175 done
18176 LIBS=$cf_rpath_dst
18177
18178 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
18179
18180 echo "${as_me:-configure}:18180: testing ...checked LIBS $LIBS ..." 1>&5
18181
18182         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18183
18184 echo "${as_me:-configure}:18184: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18185
18186 else
18187         echo "$as_me:18187: result: no" >&5
18188 echo "${ECHO_T}no" >&6
18189 fi
18190
18191 fi
18192
18193 TEST_ARGS="$LIBS"
18194 LIBS=
18195
18196 ac_config_files="$ac_config_files Makefile"
18197 ac_config_commands="$ac_config_commands default"
18198 cat >confcache <<\_ACEOF
18199 # This file is a shell script that caches the results of configure
18200 # tests run on this system so they can be shared between configure
18201 # scripts and configure runs, see configure's option --config-cache.
18202 # It is not useful on other systems.  If it contains results you don't
18203 # want to keep, you may remove or edit it.
18204 #
18205 # config.status only pays attention to the cache file if you give it
18206 # the --recheck option to rerun configure.
18207 #
18208 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18209 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18210 # following values.
18211
18212 _ACEOF
18213
18214 # The following way of writing the cache mishandles newlines in values,
18215 # but we know of no workaround that is simple, portable, and efficient.
18216 # So, don't put newlines in cache variables' values.
18217 # Ultrix sh set writes to stderr and can't be redirected directly,
18218 # and sets the high bit in the cache file unless we assign to the vars.
18219 {
18220   (set) 2>&1 |
18221     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18222     *ac_space=\ *)
18223       # `set' does not quote correctly, so add quotes (double-quote
18224       # substitution turns \\\\ into \\, and sed turns \\ into \).
18225       sed -n \
18226         "s/'/'\\\\''/g;
18227           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18228       ;;
18229     *)
18230       # `set' quotes correctly as required by POSIX, so do not add quotes.
18231       sed -n \
18232         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18233       ;;
18234     esac;
18235 } |
18236   sed '
18237      t clear
18238      : clear
18239      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18240      t end
18241      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18242      : end' >>confcache
18243 if cmp -s $cache_file confcache; then :; else
18244   if test -w $cache_file; then
18245     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18246     cat confcache >$cache_file
18247   else
18248     echo "not updating unwritable cache $cache_file"
18249   fi
18250 fi
18251 rm -f confcache
18252
18253 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18254 # Let make expand exec_prefix.
18255 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18256
18257 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18258 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18259 # trailing colons and then remove the whole line if VPATH becomes empty
18260 # (actually we leave an empty line to preserve line numbers).
18261 if test "x$srcdir" = x.; then
18262   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18263 s/:*\$(srcdir):*/:/;
18264 s/:*\${srcdir}:*/:/;
18265 s/:*@srcdir@:*/:/;
18266 s/^\([^=]*=[    ]*\):*/\1/;
18267 s/:*$//;
18268 s/^[^=]*=[      ]*$//;
18269 }'
18270 fi
18271
18272 DEFS=-DHAVE_CONFIG_H
18273
18274 : ${CONFIG_STATUS=./config.status}
18275 ac_clean_files_save=$ac_clean_files
18276 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18277 { echo "$as_me:18277: creating $CONFIG_STATUS" >&5
18278 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18279 cat >$CONFIG_STATUS <<_ACEOF
18280 #! $SHELL
18281 # Generated automatically by configure.
18282 # Run this file to recreate the current configuration.
18283 # Compiler output produced by configure, useful for debugging
18284 # configure, is in config.log if it exists.
18285
18286 debug=false
18287 SHELL=\${CONFIG_SHELL-$SHELL}
18288 ac_cs_invocation="\$0 \$@"
18289
18290 _ACEOF
18291
18292 cat >>$CONFIG_STATUS <<\_ACEOF
18293 # Be Bourne compatible
18294 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18295   emulate sh
18296   NULLCMD=:
18297 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18298   set -o posix
18299 fi
18300
18301 # Name of the executable.
18302 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18303
18304 if expr a : '\(a\)' >/dev/null 2>&1; then
18305   as_expr=expr
18306 else
18307   as_expr=false
18308 fi
18309
18310 rm -f conf$$ conf$$.exe conf$$.file
18311 echo >conf$$.file
18312 if ln -s conf$$.file conf$$ 2>/dev/null; then
18313   # We could just check for DJGPP; but this test a) works b) is more generic
18314   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18315   if test -f conf$$.exe; then
18316     # Don't use ln at all; we don't have any links
18317     as_ln_s='cp -p'
18318   else
18319     as_ln_s='ln -s'
18320   fi
18321 elif ln conf$$.file conf$$ 2>/dev/null; then
18322   as_ln_s=ln
18323 else
18324   as_ln_s='cp -p'
18325 fi
18326 rm -f conf$$ conf$$.exe conf$$.file
18327
18328 as_executable_p="test -f"
18329
18330 # Support unset when possible.
18331 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18332   as_unset=unset
18333 else
18334   as_unset=false
18335 fi
18336
18337 # NLS nuisances.
18338 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18339 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18340 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18341 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18342 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18343 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18344 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18345 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18346
18347 # IFS
18348 # We need space, tab and new line, in precisely that order.
18349 as_nl='
18350 '
18351 IFS="   $as_nl"
18352
18353 # CDPATH.
18354 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18355
18356 exec 6>&1
18357
18358 _ACEOF
18359
18360 # Files that config.status was made for.
18361 if test -n "$ac_config_files"; then
18362   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
18363 fi
18364
18365 if test -n "$ac_config_headers"; then
18366   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
18367 fi
18368
18369 if test -n "$ac_config_links"; then
18370   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
18371 fi
18372
18373 if test -n "$ac_config_commands"; then
18374   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
18375 fi
18376
18377 cat >>$CONFIG_STATUS <<\EOF
18378
18379 ac_cs_usage="\
18380 \`$as_me' instantiates files from templates according to the
18381 current configuration.
18382
18383 Usage: $0 [OPTIONS] [FILE]...
18384
18385   -h, --help       print this help, then exit
18386   -V, --version    print version number, then exit
18387   -d, --debug      don't remove temporary files
18388       --recheck    update $as_me by reconfiguring in the same conditions
18389   --file=FILE[:TEMPLATE]
18390                    instantiate the configuration file FILE
18391   --header=FILE[:TEMPLATE]
18392                    instantiate the configuration header FILE
18393
18394 Configuration files:
18395 $config_files
18396
18397 Configuration headers:
18398 $config_headers
18399
18400 Configuration commands:
18401 $config_commands
18402
18403 Report bugs to <dickey@invisible-island.net>."
18404 EOF
18405
18406 cat >>$CONFIG_STATUS <<EOF
18407 ac_cs_version="\\
18408 config.status
18409 configured by $0, generated by GNU Autoconf 2.52.20150926,
18410   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18411
18412 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18413 Free Software Foundation, Inc.
18414 This config.status script is free software; the Free Software Foundation
18415 gives unlimited permission to copy, distribute and modify it."
18416 srcdir=$srcdir
18417 INSTALL="$INSTALL"
18418 EOF
18419
18420 cat >>$CONFIG_STATUS <<\EOF
18421 # If no file are specified by the user, then we need to provide default
18422 # value.  By we need to know if files were specified by the user.
18423 ac_need_defaults=:
18424 while test $# != 0
18425 do
18426   case $1 in
18427   --*=*)
18428     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18429     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18430     shift
18431     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18432     shift
18433     ;;
18434   -*);;
18435   *) # This is not an option, so the user has probably given explicit
18436      # arguments.
18437      ac_need_defaults=false;;
18438   esac
18439
18440   case $1 in
18441   # Handling of the options.
18442 EOF
18443 cat >>$CONFIG_STATUS <<EOF
18444   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18445     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18446     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18447 EOF
18448 cat >>$CONFIG_STATUS <<\EOF
18449   --version | --vers* | -V )
18450     echo "$ac_cs_version"; exit 0 ;;
18451   --he | --h)
18452     # Conflict between --help and --header
18453     { { echo "$as_me:18453: error: ambiguous option: $1
18454 Try \`$0 --help' for more information." >&5
18455 echo "$as_me: error: ambiguous option: $1
18456 Try \`$0 --help' for more information." >&2;}
18457    { (exit 1); exit 1; }; };;
18458   --help | --hel | -h )
18459     echo "$ac_cs_usage"; exit 0 ;;
18460   --debug | --d* | -d )
18461     debug=: ;;
18462   --file | --fil | --fi | --f )
18463     shift
18464     CONFIG_FILES="$CONFIG_FILES $1"
18465     ac_need_defaults=false;;
18466   --header | --heade | --head | --hea )
18467     shift
18468     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18469     ac_need_defaults=false;;
18470
18471   # This is an error.
18472   -*) { { echo "$as_me:18472: error: unrecognized option: $1
18473 Try \`$0 --help' for more information." >&5
18474 echo "$as_me: error: unrecognized option: $1
18475 Try \`$0 --help' for more information." >&2;}
18476    { (exit 1); exit 1; }; } ;;
18477
18478   *) ac_config_targets="$ac_config_targets $1" ;;
18479
18480   esac
18481   shift
18482 done
18483
18484 exec 5>>config.log
18485 cat >&5 << _ACEOF
18486
18487 ## ----------------------- ##
18488 ## Running config.status.  ##
18489 ## ----------------------- ##
18490
18491 This file was extended by $as_me 2.52.20150926, executed with
18492   CONFIG_FILES    = $CONFIG_FILES
18493   CONFIG_HEADERS  = $CONFIG_HEADERS
18494   CONFIG_LINKS    = $CONFIG_LINKS
18495   CONFIG_COMMANDS = $CONFIG_COMMANDS
18496   > $ac_cs_invocation
18497 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18498
18499 _ACEOF
18500 EOF
18501
18502 cat >>$CONFIG_STATUS <<EOF
18503 #
18504 # INIT-COMMANDS section.
18505 #
18506
18507 AWK="$AWK"
18508 ECHO_CC="$ECHO_CC"
18509 ECHO_LD="$ECHO_LD"
18510 SHOW_CC="$SHOW_LD"
18511
18512 EOF
18513
18514 cat >>$CONFIG_STATUS <<\EOF
18515 for ac_config_target in $ac_config_targets
18516 do
18517   case "$ac_config_target" in
18518   # Handling of arguments.
18519   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18520   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18521   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
18522   *) { { echo "$as_me:18522: error: invalid argument: $ac_config_target" >&5
18523 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18524    { (exit 1); exit 1; }; };;
18525   esac
18526 done
18527
18528 # If the user did not use the arguments to specify the items to instantiate,
18529 # then the envvar interface is used.  Set only those that are not.
18530 # We use the long form for the default assignment because of an extremely
18531 # bizarre bug on SunOS 4.1.3.
18532 if $ac_need_defaults; then
18533   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18534   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18535   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18536 fi
18537
18538 # Create a temporary directory, and hook for its removal unless debugging.
18539 $debug ||
18540 {
18541   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18542   trap '{ (exit 1); exit 1; }' 1 2 13 15
18543 }
18544
18545 # Create a (secure) tmp directory for tmp files.
18546 : ${TMPDIR=/tmp}
18547 {
18548   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18549   test -n "$tmp" && test -d "$tmp"
18550 }  ||
18551 {
18552   tmp=$TMPDIR/cs$$-$RANDOM
18553   (umask 077 && mkdir $tmp)
18554 } ||
18555 {
18556    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18557    { (exit 1); exit 1; }
18558 }
18559
18560 EOF
18561
18562 cat >>$CONFIG_STATUS <<EOF
18563
18564 #
18565 # CONFIG_FILES section.
18566 #
18567
18568 # No need to generate the scripts if there are no CONFIG_FILES.
18569 # This happens for instance when ./config.status config.h
18570 if test -n "\$CONFIG_FILES"; then
18571   # Protect against being on the right side of a sed subst in config.status.
18572   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18573    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18574 s,@SHELL@,$SHELL,;t t
18575 s,@exec_prefix@,$exec_prefix,;t t
18576 s,@prefix@,$prefix,;t t
18577 s,@program_transform_name@,$program_transform_name,;t t
18578 s,@bindir@,$bindir,;t t
18579 s,@sbindir@,$sbindir,;t t
18580 s,@libexecdir@,$libexecdir,;t t
18581 s,@datarootdir@,$datarootdir,;t t
18582 s,@datadir@,$datadir,;t t
18583 s,@sysconfdir@,$sysconfdir,;t t
18584 s,@sharedstatedir@,$sharedstatedir,;t t
18585 s,@localstatedir@,$localstatedir,;t t
18586 s,@libdir@,$libdir,;t t
18587 s,@includedir@,$includedir,;t t
18588 s,@oldincludedir@,$oldincludedir,;t t
18589 s,@infodir@,$infodir,;t t
18590 s,@mandir@,$mandir,;t t
18591 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18592 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18593 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18594 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18595 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18596 s,@build_alias@,$build_alias,;t t
18597 s,@host_alias@,$host_alias,;t t
18598 s,@target_alias@,$target_alias,;t t
18599 s,@ECHO_C@,$ECHO_C,;t t
18600 s,@ECHO_N@,$ECHO_N,;t t
18601 s,@ECHO_T@,$ECHO_T,;t t
18602 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18603 s,@DEFS@,$DEFS,;t t
18604 s,@LIBS@,$LIBS,;t t
18605 s,@build@,$build,;t t
18606 s,@build_cpu@,$build_cpu,;t t
18607 s,@build_vendor@,$build_vendor,;t t
18608 s,@build_os@,$build_os,;t t
18609 s,@host@,$host,;t t
18610 s,@host_cpu@,$host_cpu,;t t
18611 s,@host_vendor@,$host_vendor,;t t
18612 s,@host_os@,$host_os,;t t
18613 s,@SET_MAKE@,$SET_MAKE,;t t
18614 s,@CC@,$CC,;t t
18615 s,@CFLAGS@,$CFLAGS,;t t
18616 s,@LDFLAGS@,$LDFLAGS,;t t
18617 s,@CPPFLAGS@,$CPPFLAGS,;t t
18618 s,@ac_ct_CC@,$ac_ct_CC,;t t
18619 s,@EXEEXT@,$EXEEXT,;t t
18620 s,@OBJEXT@,$OBJEXT,;t t
18621 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18622 s,@CPP@,$CPP,;t t
18623 s,@AWK@,$AWK,;t t
18624 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18625 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18626 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18627 s,@LINT@,$LINT,;t t
18628 s,@LINT_OPTS@,$LINT_OPTS,;t t
18629 s,@CTAGS@,$CTAGS,;t t
18630 s,@ETAGS@,$ETAGS,;t t
18631 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18632 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18633 s,@MATH_LIB@,$MATH_LIB,;t t
18634 s,@top_builddir@,$top_builddir,;t t
18635 s,@CC_G_OPT@,$CC_G_OPT,;t t
18636 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18637 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18638 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18639 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18640 s,@LD@,$LD,;t t
18641 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
18642 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
18643 s,@LD_MODEL@,$LD_MODEL,;t t
18644 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18645 s,@LIBTOOL@,$LIBTOOL,;t t
18646 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
18647 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
18648 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
18649 s,@LIB_LINK@,$LIB_LINK,;t t
18650 s,@LINK_TESTS@,$LINK_TESTS,;t t
18651 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18652 s,@PACKAGE@,$PACKAGE,;t t
18653 s,@PTHREAD@,$PTHREAD,;t t
18654 s,@TEST_ARGS@,$TEST_ARGS,;t t
18655 s,@TEST_DEPS@,$TEST_DEPS,;t t
18656 s,@TEST_LIBS@,$TEST_LIBS,;t t
18657 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
18658 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18659 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18660 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18661 s,@includesubdir@,$includesubdir,;t t
18662 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18663 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18664 s,@ECHO_LT@,$ECHO_LT,;t t
18665 s,@ECHO_LD@,$ECHO_LD,;t t
18666 s,@RULE_CC@,$RULE_CC,;t t
18667 s,@SHOW_CC@,$SHOW_CC,;t t
18668 s,@ECHO_CC@,$ECHO_CC,;t t
18669 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18670 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18671 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18672 s,@X_CFLAGS@,$X_CFLAGS,;t t
18673 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
18674 s,@X_LIBS@,$X_LIBS,;t t
18675 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
18676 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
18677 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
18678 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18679 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
18680 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18681 CEOF
18682
18683 EOF
18684
18685   cat >>$CONFIG_STATUS <<\EOF
18686   # Split the substitutions into bite-sized pieces for seds with
18687   # small command number limits, like on Digital OSF/1 and HP-UX.
18688   ac_max_sed_lines=48
18689   ac_sed_frag=1 # Number of current file.
18690   ac_beg=1 # First line for current file.
18691   ac_end=$ac_max_sed_lines # Line after last line for current file.
18692   ac_more_lines=:
18693   ac_sed_cmds=
18694   while $ac_more_lines; do
18695     if test $ac_beg -gt 1; then
18696       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18697     else
18698       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18699     fi
18700     if test ! -s $tmp/subs.frag; then
18701       ac_more_lines=false
18702     else
18703       # The purpose of the label and of the branching condition is to
18704       # speed up the sed processing (if there are no `@' at all, there
18705       # is no need to browse any of the substitutions).
18706       # These are the two extra sed commands mentioned above.
18707       (echo ':t
18708   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18709       # It is possible to make a multiline substitution using escaped newlines.
18710       # Ensure that we do not split the substitution between script fragments.
18711       ac_BEG=$ac_end
18712       ac_END=`expr $ac_end + $ac_max_sed_lines`
18713       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18714       if test -s $tmp/subs.next; then
18715         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18716         if test ! -s $tmp/subs.edit; then
18717           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18718           if test ! -s $tmp/subs.edit; then
18719             if test $ac_beg -gt 1; then
18720               ac_end=`expr $ac_end - 1`
18721               continue
18722             fi
18723           fi
18724         fi
18725       fi
18726
18727       if test -z "$ac_sed_cmds"; then
18728         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18729       else
18730         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18731       fi
18732       ac_sed_frag=`expr $ac_sed_frag + 1`
18733       ac_beg=$ac_end
18734       ac_end=`expr $ac_end + $ac_max_sed_lines`
18735     fi
18736   done
18737   if test -z "$ac_sed_cmds"; then
18738     ac_sed_cmds=cat
18739   fi
18740 fi # test -n "$CONFIG_FILES"
18741
18742 EOF
18743 cat >>$CONFIG_STATUS <<\EOF
18744 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18745   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18746   case $ac_file in
18747   - | *:- | *:-:* ) # input from stdin
18748         cat >$tmp/stdin
18749         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18750         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18751   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18752         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18753   * )   ac_file_in=$ac_file.in ;;
18754   esac
18755
18756   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18757   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18758          X"$ac_file" : 'X\(//\)[^/]' \| \
18759          X"$ac_file" : 'X\(//\)$' \| \
18760          X"$ac_file" : 'X\(/\)' \| \
18761          .     : '\(.\)' 2>/dev/null ||
18762 echo X"$ac_file" |
18763     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18764           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18765           /^X\(\/\/\)$/{ s//\1/; q; }
18766           /^X\(\/\).*/{ s//\1/; q; }
18767           s/.*/./; q'`
18768   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18769     { case "$ac_dir" in
18770   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18771   *)                      as_incr_dir=.;;
18772 esac
18773 as_dummy="$ac_dir"
18774 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18775   case $as_mkdir_dir in
18776     # Skip DOS drivespec
18777     ?:) as_incr_dir=$as_mkdir_dir ;;
18778     *)
18779       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18780       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18781     ;;
18782   esac
18783 done; }
18784
18785     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18786     # A "../" for each directory in $ac_dir_suffix.
18787     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18788   else
18789     ac_dir_suffix= ac_dots=
18790   fi
18791
18792   case $srcdir in
18793   .)  ac_srcdir=.
18794       if test -z "$ac_dots"; then
18795          ac_top_srcdir=.
18796       else
18797          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
18798       fi ;;
18799   [\\/]* | ?:[\\/]* )
18800       ac_srcdir=$srcdir$ac_dir_suffix;
18801       ac_top_srcdir=$srcdir ;;
18802   *) # Relative path.
18803     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
18804     ac_top_srcdir=$ac_dots$srcdir ;;
18805   esac
18806
18807   case $INSTALL in
18808   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18809   *) ac_INSTALL=$ac_dots$INSTALL ;;
18810   esac
18811
18812   if test x"$ac_file" != x-; then
18813     { echo "$as_me:18813: creating $ac_file" >&5
18814 echo "$as_me: creating $ac_file" >&6;}
18815     rm -f "$ac_file"
18816   fi
18817   # Let's still pretend it is `configure' which instantiates (i.e., don't
18818   # use $as_me), people would be surprised to read:
18819   #    /* config.h.  Generated automatically by config.status.  */
18820   configure_input="Generated automatically from `echo $ac_file_in |
18821                                                  sed 's,.*/,,'` by configure."
18822
18823   # First look for the input files in the build tree, otherwise in the
18824   # src tree.
18825   ac_file_inputs=`IFS=:
18826     for f in $ac_file_in; do
18827       case $f in
18828       -) echo $tmp/stdin ;;
18829       [\\/$]*)
18830          # Absolute (can't be DOS-style, as IFS=:)
18831          test -f "$f" || { { echo "$as_me:18831: error: cannot find input file: $f" >&5
18832 echo "$as_me: error: cannot find input file: $f" >&2;}
18833    { (exit 1); exit 1; }; }
18834          echo $f;;
18835       *) # Relative
18836          if test -f "$f"; then
18837            # Build tree
18838            echo $f
18839          elif test -f "$srcdir/$f"; then
18840            # Source tree
18841            echo $srcdir/$f
18842          else
18843            # /dev/null tree
18844            { { echo "$as_me:18844: error: cannot find input file: $f" >&5
18845 echo "$as_me: error: cannot find input file: $f" >&2;}
18846    { (exit 1); exit 1; }; }
18847          fi;;
18848       esac
18849     done` || { (exit 1); exit 1; }
18850 EOF
18851 cat >>$CONFIG_STATUS <<\EOF
18852   ac_warn_datarootdir=no
18853   if test x"$ac_file" != x-; then
18854     for ac_item in $ac_file_inputs
18855     do
18856       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
18857       if test -n "$ac_seen"; then
18858         ac_used=`grep '@datarootdir@' $ac_item`
18859         if test -z "$ac_used"; then
18860           { echo "$as_me:18860: WARNING: datarootdir was used implicitly but not set:
18861 $ac_seen" >&5
18862 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18863 $ac_seen" >&2;}
18864           ac_warn_datarootdir=yes
18865         fi
18866       fi
18867       ac_seen=`grep '${datarootdir}' $ac_item`
18868       if test -n "$ac_seen"; then
18869         { echo "$as_me:18869: WARNING: datarootdir was used explicitly but not set:
18870 $ac_seen" >&5
18871 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18872 $ac_seen" >&2;}
18873         ac_warn_datarootdir=yes
18874       fi
18875     done
18876   fi
18877
18878 if test "x$ac_warn_datarootdir" = xyes; then
18879   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18880 fi
18881
18882 EOF
18883 cat >>$CONFIG_STATUS <<EOF
18884   sed "$ac_vpsub
18885 $extrasub
18886 EOF
18887 cat >>$CONFIG_STATUS <<\EOF
18888 :t
18889 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18890 s,@configure_input@,$configure_input,;t t
18891 s,@srcdir@,$ac_srcdir,;t t
18892 s,@top_srcdir@,$ac_top_srcdir,;t t
18893 s,@INSTALL@,$ac_INSTALL,;t t
18894 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18895   rm -f $tmp/stdin
18896   if test x"$ac_file" != x-; then
18897     cp $tmp/out $ac_file
18898
18899     for ac_name in prefix exec_prefix datarootdir
18900     do
18901         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
18902         if test -n "$ac_seen"; then
18903             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
18904             if test -z "$ac_init"; then
18905               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18906               { echo "$as_me:18906: WARNING: Variable $ac_name is used but was not set:
18907 $ac_seen" >&5
18908 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18909 $ac_seen" >&2;}
18910             fi
18911         fi
18912     done
18913     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
18914     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
18915     if test -s $tmp/out; then
18916       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18917       { echo "$as_me:18917: WARNING: Some variables may not be substituted:
18918 $ac_seen" >&5
18919 echo "$as_me: WARNING: Some variables may not be substituted:
18920 $ac_seen" >&2;}
18921     fi
18922   else
18923     cat $tmp/out
18924   fi
18925   rm -f $tmp/out
18926
18927 done
18928 EOF
18929 cat >>$CONFIG_STATUS <<\EOF
18930
18931 #
18932 # CONFIG_HEADER section.
18933 #
18934
18935 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18936 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18937 #
18938 # ac_d sets the value in "#define NAME VALUE" lines.
18939 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18940 ac_dB='[        ].*$,\1#\2'
18941 ac_dC=' '
18942 ac_dD=',;t'
18943 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18944 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18945 ac_iB='\([      ]\),\1#\2define\3'
18946 ac_iC=' '
18947 ac_iD='\4,;t'
18948 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18949 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18950 ac_uB='$,\1#\2define\3'
18951 ac_uC=' '
18952 ac_uD=',;t'
18953
18954 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18955   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18956   case $ac_file in
18957   - | *:- | *:-:* ) # input from stdin
18958         cat >$tmp/stdin
18959         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18960         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18961   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18962         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18963   * )   ac_file_in=$ac_file.in ;;
18964   esac
18965
18966   test x"$ac_file" != x- && { echo "$as_me:18966: creating $ac_file" >&5
18967 echo "$as_me: creating $ac_file" >&6;}
18968
18969   # First look for the input files in the build tree, otherwise in the
18970   # src tree.
18971   ac_file_inputs=`IFS=:
18972     for f in $ac_file_in; do
18973       case $f in
18974       -) echo $tmp/stdin ;;
18975       [\\/$]*)
18976          # Absolute (can't be DOS-style, as IFS=:)
18977          test -f "$f" || { { echo "$as_me:18977: error: cannot find input file: $f" >&5
18978 echo "$as_me: error: cannot find input file: $f" >&2;}
18979    { (exit 1); exit 1; }; }
18980          echo $f;;
18981       *) # Relative
18982          if test -f "$f"; then
18983            # Build tree
18984            echo $f
18985          elif test -f "$srcdir/$f"; then
18986            # Source tree
18987            echo $srcdir/$f
18988          else
18989            # /dev/null tree
18990            { { echo "$as_me:18990: error: cannot find input file: $f" >&5
18991 echo "$as_me: error: cannot find input file: $f" >&2;}
18992    { (exit 1); exit 1; }; }
18993          fi;;
18994       esac
18995     done` || { (exit 1); exit 1; }
18996   # Remove the trailing spaces.
18997   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18998
18999 EOF
19000
19001 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19002 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19003 # be either 'cat' or 'sort'.
19004 cat confdefs.h | uniq >conftest.vals
19005
19006 # Break up conftest.vals because some shells have a limit on
19007 # the size of here documents, and old seds have small limits too.
19008
19009 rm -f conftest.tail
19010 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
19011 while grep . conftest.vals >/dev/null
19012 do
19013   # Write chunks of a limited-size here document to conftest.frag.
19014   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
19015   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
19016   echo 'CEOF' >> $CONFIG_STATUS
19017   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
19018   rm -f conftest.vals
19019   mv conftest.tail conftest.vals
19020 done
19021 rm -f conftest.vals
19022
19023 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19024 # marker @DEFS@.
19025 echo '  cat >> conftest.edit <<CEOF
19026 /@DEFS@/r conftest.frag
19027 /@DEFS@/d
19028 CEOF
19029 sed -f conftest.edit $tmp/in > $tmp/out
19030 rm -f $tmp/in
19031 mv $tmp/out $tmp/in
19032 rm -f conftest.edit conftest.frag
19033 ' >> $CONFIG_STATUS
19034
19035 cat >>$CONFIG_STATUS <<\EOF
19036   # Let's still pretend it is `configure' which instantiates (i.e., don't
19037   # use $as_me), people would be surprised to read:
19038   #    /* config.h.  Generated automatically by config.status.  */
19039   if test x"$ac_file" = x-; then
19040     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19041   else
19042     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19043   fi
19044   cat $tmp/in >>$tmp/config.h
19045   rm -f $tmp/in
19046   if test x"$ac_file" != x-; then
19047     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
19048       { echo "$as_me:19048: $ac_file is unchanged" >&5
19049 echo "$as_me: $ac_file is unchanged" >&6;}
19050     else
19051       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19052          X"$ac_file" : 'X\(//\)[^/]' \| \
19053          X"$ac_file" : 'X\(//\)$' \| \
19054          X"$ac_file" : 'X\(/\)' \| \
19055          .     : '\(.\)' 2>/dev/null ||
19056 echo X"$ac_file" |
19057     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19058           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19059           /^X\(\/\/\)$/{ s//\1/; q; }
19060           /^X\(\/\).*/{ s//\1/; q; }
19061           s/.*/./; q'`
19062       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19063         { case "$ac_dir" in
19064   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19065   *)                      as_incr_dir=.;;
19066 esac
19067 as_dummy="$ac_dir"
19068 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19069   case $as_mkdir_dir in
19070     # Skip DOS drivespec
19071     ?:) as_incr_dir=$as_mkdir_dir ;;
19072     *)
19073       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19074       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19075     ;;
19076   esac
19077 done; }
19078
19079       fi
19080       rm -f $ac_file
19081       mv $tmp/config.h $ac_file
19082     fi
19083   else
19084     cat $tmp/config.h
19085     rm -f $tmp/config.h
19086   fi
19087 done
19088 EOF
19089 cat >>$CONFIG_STATUS <<\EOF
19090 #
19091 # CONFIG_COMMANDS section.
19092 #
19093 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19094   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19095   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19096
19097   case $ac_dest in
19098     default )
19099
19100 for cf_dir in .
19101 do
19102         if test ! -d $srcdir/$cf_dir; then
19103                 continue
19104         elif test -f $srcdir/$cf_dir/programs; then
19105                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
19106         fi
19107 done
19108
19109         cat >>Makefile <<TEST_EOF
19110
19111 # These rules are generated so we do not rely on suffix rules, which do not
19112 # work consistently for different make-programs (the '\$(MODEL)/' confuses
19113 # some, and the '\$x' confuses others).
19114 TEST_EOF
19115
19116 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
19117 for N in $LIST
19118 do
19119         cat >>Makefile <<TEST_EOF
19120
19121 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
19122         \$(srcdir)/test.priv.h \\
19123         ncurses_cfg.h
19124         $SHOW_CC
19125         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
19126 TEST_EOF
19127 done
19128
19129 if test -f ../config.guess && test -f ../config.sub
19130 then
19131         cat >>Makefile <<TEST_EOF
19132
19133 # if we used CF_INHERIT for getting these files, we can remove them
19134 distclean::
19135         rm -f config.guess config.sub
19136 TEST_EOF
19137 fi
19138  ;;
19139   esac
19140 done
19141 EOF
19142
19143 cat >>$CONFIG_STATUS <<\EOF
19144
19145 { (exit 0); exit 0; }
19146 EOF
19147 chmod +x $CONFIG_STATUS
19148 ac_clean_files=$ac_clean_files_save
19149
19150 # configure is writing to config.log, and then calls config.status.
19151 # config.status does its own redirection, appending to config.log.
19152 # Unfortunately, on DOS this fails, as config.log is still kept open
19153 # by configure, so config.status won't be able to write to it; its
19154 # output is simply discarded.  So we exec the FD to /dev/null,
19155 # effectively closing config.log, so it can be properly (re)opened and
19156 # appended to by config.status.  When coming back to configure, we
19157 # need to make the FD available again.
19158 if test "$no_create" != yes; then
19159   ac_cs_success=:
19160   exec 5>/dev/null
19161   $SHELL $CONFIG_STATUS || ac_cs_success=false
19162   exec 5>>config.log
19163   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19164   # would make configure fail if this is the last instruction.
19165   $ac_cs_success || { (exit 1); exit 1; }
19166 fi
19167