]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.9 - patch 20141206
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20141204.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${datarootdir}/info'
146 mandir='${datarootdir}/man'
147
148 # Identity of this package.
149 PACKAGE_NAME=
150 PACKAGE_TARNAME=
151 PACKAGE_VERSION=
152 PACKAGE_STRING=
153 PACKAGE_BUGREPORT=
154
155 ac_prev=
156 for ac_option
157 do
158   # If the previous option needs an argument, assign it.
159   if test -n "$ac_prev"; then
160     eval "$ac_prev=\$ac_option"
161     ac_prev=
162     continue
163   fi
164
165   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
166
167   # Accept the important Cygnus configure options, so we can diagnose typos.
168
169   case $ac_option in
170
171   -bindir | --bindir | --bindi | --bind | --bin | --bi)
172     ac_prev=bindir ;;
173   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
174     bindir=$ac_optarg ;;
175
176   -build | --build | --buil | --bui | --bu)
177     ac_prev=build_alias ;;
178   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
179     build_alias=$ac_optarg ;;
180
181   -cache-file | --cache-file | --cache-fil | --cache-fi \
182   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
183     ac_prev=cache_file ;;
184   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
185   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
186     cache_file=$ac_optarg ;;
187
188   --config-cache | -C)
189     cache_file=config.cache ;;
190
191   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
192     ac_prev=datadir ;;
193   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
194   | --da=*)
195     datadir=$ac_optarg ;;
196
197   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
198   | --dataroo | --dataro | --datar)
199     ac_prev=datarootdir ;;
200   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
201   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
202     datarootdir=$ac_optarg ;;
203
204   -disable-* | --disable-*)
205     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
206     # Reject names that are not valid shell variable names.
207     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
208       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
209    { (exit 1); exit 1; }; }
210     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
211     eval "enable_$ac_feature=no" ;;
212
213   -enable-* | --enable-*)
214     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
215     # Reject names that are not valid shell variable names.
216     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
217       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
218    { (exit 1); exit 1; }; }
219     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
220     case $ac_option in
221       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
222       *) ac_optarg=yes ;;
223     esac
224     eval "enable_$ac_feature='$ac_optarg'" ;;
225
226   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
227   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
228   | --exec | --exe | --ex)
229     ac_prev=exec_prefix ;;
230   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
231   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
232   | --exec=* | --exe=* | --ex=*)
233     exec_prefix=$ac_optarg ;;
234
235   -gas | --gas | --ga | --g)
236     # Obsolete; use --with-gas.
237     with_gas=yes ;;
238
239   -help | --help | --hel | --he | -h)
240     ac_init_help=long ;;
241   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
242     ac_init_help=recursive ;;
243   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
244     ac_init_help=short ;;
245
246   -host | --host | --hos | --ho)
247     ac_prev=host_alias ;;
248   -host=* | --host=* | --hos=* | --ho=*)
249     host_alias=$ac_optarg ;;
250
251   -includedir | --includedir | --includedi | --included | --include \
252   | --includ | --inclu | --incl | --inc)
253     ac_prev=includedir ;;
254   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
255   | --includ=* | --inclu=* | --incl=* | --inc=*)
256     includedir=$ac_optarg ;;
257
258   -infodir | --infodir | --infodi | --infod | --info | --inf)
259     ac_prev=infodir ;;
260   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
261     infodir=$ac_optarg ;;
262
263   -libdir | --libdir | --libdi | --libd)
264     ac_prev=libdir ;;
265   -libdir=* | --libdir=* | --libdi=* | --libd=*)
266     libdir=$ac_optarg ;;
267
268   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
269   | --libexe | --libex | --libe)
270     ac_prev=libexecdir ;;
271   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
272   | --libexe=* | --libex=* | --libe=*)
273     libexecdir=$ac_optarg ;;
274
275   -localstatedir | --localstatedir | --localstatedi | --localstated \
276   | --localstate | --localstat | --localsta | --localst \
277   | --locals | --local | --loca | --loc | --lo)
278     ac_prev=localstatedir ;;
279   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
280   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
281   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
282     localstatedir=$ac_optarg ;;
283
284   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
285     ac_prev=mandir ;;
286   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
287     mandir=$ac_optarg ;;
288
289   -nfp | --nfp | --nf)
290     # Obsolete; use --without-fp.
291     with_fp=no ;;
292
293   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
294   | --no-cr | --no-c)
295     no_create=yes ;;
296
297   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
298   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
299     no_recursion=yes ;;
300
301   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
302   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
303   | --oldin | --oldi | --old | --ol | --o)
304     ac_prev=oldincludedir ;;
305   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
306   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
307   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
308     oldincludedir=$ac_optarg ;;
309
310   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
311     ac_prev=prefix ;;
312   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
313     prefix=$ac_optarg ;;
314
315   -program-prefix | --program-prefix | --program-prefi | --program-pref \
316   | --program-pre | --program-pr | --program-p)
317     ac_prev=program_prefix ;;
318   -program-prefix=* | --program-prefix=* | --program-prefi=* \
319   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
320     program_prefix=$ac_optarg ;;
321
322   -program-suffix | --program-suffix | --program-suffi | --program-suff \
323   | --program-suf | --program-su | --program-s)
324     ac_prev=program_suffix ;;
325   -program-suffix=* | --program-suffix=* | --program-suffi=* \
326   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
327     program_suffix=$ac_optarg ;;
328
329   -program-transform-name | --program-transform-name \
330   | --program-transform-nam | --program-transform-na \
331   | --program-transform-n | --program-transform- \
332   | --program-transform | --program-transfor \
333   | --program-transfo | --program-transf \
334   | --program-trans | --program-tran \
335   | --progr-tra | --program-tr | --program-t)
336     ac_prev=program_transform_name ;;
337   -program-transform-name=* | --program-transform-name=* \
338   | --program-transform-nam=* | --program-transform-na=* \
339   | --program-transform-n=* | --program-transform-=* \
340   | --program-transform=* | --program-transfor=* \
341   | --program-transfo=* | --program-transf=* \
342   | --program-trans=* | --program-tran=* \
343   | --progr-tra=* | --program-tr=* | --program-t=*)
344     program_transform_name=$ac_optarg ;;
345
346   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
347   | -silent | --silent | --silen | --sile | --sil)
348     silent=yes ;;
349
350   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
351     ac_prev=sbindir ;;
352   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
353   | --sbi=* | --sb=*)
354     sbindir=$ac_optarg ;;
355
356   -sharedstatedir | --sharedstatedir | --sharedstatedi \
357   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
358   | --sharedst | --shareds | --shared | --share | --shar \
359   | --sha | --sh)
360     ac_prev=sharedstatedir ;;
361   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
362   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
363   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
364   | --sha=* | --sh=*)
365     sharedstatedir=$ac_optarg ;;
366
367   -site | --site | --sit)
368     ac_prev=site ;;
369   -site=* | --site=* | --sit=*)
370     site=$ac_optarg ;;
371
372   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
373     ac_prev=srcdir ;;
374   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
375     srcdir=$ac_optarg ;;
376
377   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
378   | --syscon | --sysco | --sysc | --sys | --sy)
379     ac_prev=sysconfdir ;;
380   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
381   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
382     sysconfdir=$ac_optarg ;;
383
384   -target | --target | --targe | --targ | --tar | --ta | --t)
385     ac_prev=target_alias ;;
386   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
387     target_alias=$ac_optarg ;;
388
389   -v | -verbose | --verbose | --verbos | --verbo | --verb)
390     verbose=yes ;;
391
392   -version | --version | --versio | --versi | --vers | -V)
393     ac_init_version=: ;;
394
395   -with-* | --with-*)
396     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
397     # Reject names that are not valid shell variable names.
398     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
399       { echo "$as_me: error: invalid package name: $ac_package" >&2
400    { (exit 1); exit 1; }; }
401     ac_package=`echo $ac_package| sed 's/-/_/g'`
402     case $ac_option in
403       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
404       *) ac_optarg=yes ;;
405     esac
406     eval "with_$ac_package='$ac_optarg'" ;;
407
408   -without-* | --without-*)
409     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
410     # Reject names that are not valid shell variable names.
411     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
412       { echo "$as_me: error: invalid package name: $ac_package" >&2
413    { (exit 1); exit 1; }; }
414     ac_package=`echo $ac_package | sed 's/-/_/g'`
415     eval "with_$ac_package=no" ;;
416
417   --x)
418     # Obsolete; use --with-x.
419     with_x=yes ;;
420
421   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
422   | --x-incl | --x-inc | --x-in | --x-i)
423     ac_prev=x_includes ;;
424   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
425   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
426     x_includes=$ac_optarg ;;
427
428   -x-libraries | --x-libraries | --x-librarie | --x-librari \
429   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
430     ac_prev=x_libraries ;;
431   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
432   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
433     x_libraries=$ac_optarg ;;
434
435   -*) { echo "$as_me: error: unrecognized option: $ac_option
436 Try \`$0 --help' for more information." >&2
437    { (exit 1); exit 1; }; }
438     ;;
439
440   *=*)
441     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
442     # Reject names that are not valid shell variable names.
443     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
444       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
445    { (exit 1); exit 1; }; }
446     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
447     eval "$ac_envvar='$ac_optarg'"
448     export $ac_envvar ;;
449
450   *)
451     # FIXME: should be removed in autoconf 3.0.
452     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
453     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
454       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
455     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
456     ;;
457
458   esac
459 done
460
461 if test -n "$ac_prev"; then
462   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
463   { echo "$as_me: error: missing argument to $ac_option" >&2
464    { (exit 1); exit 1; }; }
465 fi
466
467 # Be sure to have absolute paths.
468 for ac_var in exec_prefix prefix
469 do
470   eval ac_val=$`echo $ac_var`
471   case $ac_val in
472     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
473     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
474    { (exit 1); exit 1; }; };;
475   esac
476 done
477
478 # Be sure to have absolute paths.
479 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
480               localstatedir libdir includedir oldincludedir infodir mandir
481 do
482   eval ac_val=$`echo $ac_var`
483   case $ac_val in
484     [\\/$]* | ?:[\\/]* ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # There might be people who depend on the old broken behavior: `$host'
491 # used to hold the argument of --host etc.
492 build=$build_alias
493 host=$host_alias
494 target=$target_alias
495
496 # FIXME: should be removed in autoconf 3.0.
497 if test "x$host_alias" != x; then
498   if test "x$build_alias" = x; then
499     cross_compiling=maybe
500     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
501     If a cross compiler is detected then cross compile mode will be used." >&2
502   elif test "x$build_alias" != "x$host_alias"; then
503     cross_compiling=yes
504   fi
505 fi
506
507 ac_tool_prefix=
508 test -n "$host_alias" && ac_tool_prefix=$host_alias-
509
510 test "$silent" = yes && exec 6>/dev/null
511
512 # Find the source files, if location was not specified.
513 if test -z "$srcdir"; then
514   ac_srcdir_defaulted=yes
515   # Try the directory containing this script, then its parent.
516   ac_prog=$0
517   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
518   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
519   srcdir=$ac_confdir
520   if test ! -r $srcdir/$ac_unique_file; then
521     srcdir=..
522   fi
523 else
524   ac_srcdir_defaulted=no
525 fi
526 if test ! -r $srcdir/$ac_unique_file; then
527   if test "$ac_srcdir_defaulted" = yes; then
528     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
529    { (exit 1); exit 1; }; }
530   else
531     { echo "$as_me: error: cannot find sources in $srcdir" >&2
532    { (exit 1); exit 1; }; }
533   fi
534 fi
535 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
536 ac_env_build_alias_set=${build_alias+set}
537 ac_env_build_alias_value=$build_alias
538 ac_cv_env_build_alias_set=${build_alias+set}
539 ac_cv_env_build_alias_value=$build_alias
540 ac_env_host_alias_set=${host_alias+set}
541 ac_env_host_alias_value=$host_alias
542 ac_cv_env_host_alias_set=${host_alias+set}
543 ac_cv_env_host_alias_value=$host_alias
544 ac_env_target_alias_set=${target_alias+set}
545 ac_env_target_alias_value=$target_alias
546 ac_cv_env_target_alias_set=${target_alias+set}
547 ac_cv_env_target_alias_value=$target_alias
548 ac_env_CC_set=${CC+set}
549 ac_env_CC_value=$CC
550 ac_cv_env_CC_set=${CC+set}
551 ac_cv_env_CC_value=$CC
552 ac_env_CFLAGS_set=${CFLAGS+set}
553 ac_env_CFLAGS_value=$CFLAGS
554 ac_cv_env_CFLAGS_set=${CFLAGS+set}
555 ac_cv_env_CFLAGS_value=$CFLAGS
556 ac_env_LDFLAGS_set=${LDFLAGS+set}
557 ac_env_LDFLAGS_value=$LDFLAGS
558 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
559 ac_cv_env_LDFLAGS_value=$LDFLAGS
560 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
561 ac_env_CPPFLAGS_value=$CPPFLAGS
562 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
563 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
564 ac_env_CPP_set=${CPP+set}
565 ac_env_CPP_value=$CPP
566 ac_cv_env_CPP_set=${CPP+set}
567 ac_cv_env_CPP_value=$CPP
568
569 #
570 # Report the --help message.
571 #
572 if test "$ac_init_help" = "long"; then
573   # Omit some internal or obsolete options to make the list less imposing.
574   # This message is too long to be a string in the A/UX 3.1 sh.
575   cat <<EOF
576 \`configure' configures this package to adapt to many kinds of systems.
577
578 Usage: $0 [OPTION]... [VAR=VALUE]...
579
580 To assign environment variables (e.g., CC, CFLAGS...), specify them as
581 VAR=VALUE.  See below for descriptions of some of the useful variables.
582
583 Defaults for the options are specified in brackets.
584
585 Configuration:
586   -h, --help              display this help and exit
587       --help=short        display options specific to this package
588       --help=recursive    display the short help of all the included packages
589   -V, --version           display version information and exit
590   -q, --quiet, --silent   do not print \`checking...' messages
591       --cache-file=FILE   cache test results in FILE [disabled]
592   -C, --config-cache      alias for \`--cache-file=config.cache'
593   -n, --no-create         do not create output files
594       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
595
596 EOF
597
598   cat <<EOF
599 Installation directories:
600   --prefix=PREFIX         install architecture-independent files in PREFIX
601                           [$ac_default_prefix]
602   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
603                           [PREFIX]
604
605 By default, \`make install' will install all the files in
606 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
607 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
608 for instance \`--prefix=\$HOME'.
609
610 For better control, use the options below.
611
612 Fine tuning of the installation directories:
613   --bindir=DIR            user executables [EPREFIX/bin]
614   --sbindir=DIR           system admin executables [EPREFIX/sbin]
615   --libexecdir=DIR        program executables [EPREFIX/libexec]
616   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
617   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
618   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
619   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
620   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
621   --libdir=DIR            object code libraries [EPREFIX/lib]
622   --includedir=DIR        C header files [PREFIX/include]
623   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
624   --infodir=DIR           info documentation [DATAROOTDIR/info]
625   --mandir=DIR            man documentation [DATAROOTDIR/man]
626 EOF
627
628   cat <<\EOF
629
630 Program names:
631   --program-prefix=PREFIX            prepend PREFIX to installed program names
632   --program-suffix=SUFFIX            append SUFFIX to installed program names
633   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
634
635 X features:
636   --x-includes=DIR    X include files are in DIR
637   --x-libraries=DIR   X library files are in DIR
638
639 System types:
640   --build=BUILD           configure for building on BUILD [guessed]
641   --host=HOST       build programs to run on HOST [BUILD]
642 EOF
643 fi
644
645 if test -n "$ac_init_help"; then
646
647   cat <<\EOF
648
649 Optional Packages:
650   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
651   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
652
653 Optional Features:
654   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
655   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
656
657 General Options:
658   --with-pkg-config{=path} enable/disable use of pkg-config
659   --disable-echo          do not display "compiling" commands
660 Curses Version-dependent Options:
661   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
662   --disable-widec         disable checks for wide-character functions
663   --with-curses-dir=DIR   directory in which (n)curses is installed
664   --with-ncursesw         use wide ncurses-libraries
665   --with-ncurses          use ncurses-libraries
666   --with-pdcurses         compile/link with pdcurses X11 library
667   --with-curses-colr      compile/link with HPUX 10.x color-curses
668   --with-curses-5lib      compile/link with SunOS 5lib curses
669   --with-Xaw3d            link with Xaw 3d library
670   --with-Xaw3dxft         link with Xaw 3d xft library
671   --with-neXtaw           link with neXT Athena library
672   --with-XawPlus          link with Athena-Plus library
673   --with-x                use the X Window System
674 Testing/development Options:
675   --enable-warnings       test: turn on gcc compiler warnings
676   --with-dmalloc          test: use Gray Watson's dmalloc library
677   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
678   --with-valgrind         test: use valgrind
679   --disable-leaks         test: free permanent memory, analyze leaks
680   --disable-rpath-hack    don't add rpath options for additional libraries
681
682 Some influential environment variables:
683   CC          C compiler command
684   CFLAGS      C compiler flags
685   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
686               nonstandard directory <lib dir>
687   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
688               headers in a nonstandard directory <include dir>
689   CPP         C preprocessor
690
691 Use these variables to override the choices made by `configure' or to help
692 it to find libraries and programs with nonstandard names/locations.
693
694 EOF
695 fi
696
697 if test "$ac_init_help" = "recursive"; then
698   # If there are subdirs, report their specific --help.
699   ac_popdir=`pwd`
700   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
701     cd $ac_subdir
702     # A "../" for each directory in /$ac_subdir.
703     ac_dots=`echo $ac_subdir |
704              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
705
706     case $srcdir in
707     .) # No --srcdir option.  We are building in place.
708       ac_sub_srcdir=$srcdir ;;
709     [\\/]* | ?:[\\/]* ) # Absolute path.
710       ac_sub_srcdir=$srcdir/$ac_subdir ;;
711     *) # Relative path.
712       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
713     esac
714
715     # Check for guested configure; otherwise get Cygnus style configure.
716     if test -f $ac_sub_srcdir/configure.gnu; then
717       echo
718       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
719     elif test -f $ac_sub_srcdir/configure; then
720       echo
721       $SHELL $ac_sub_srcdir/configure  --help=recursive
722     elif test -f $ac_sub_srcdir/configure.ac ||
723            test -f $ac_sub_srcdir/configure.in; then
724       echo
725       $ac_configure --help
726     else
727       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
728     fi
729     cd $ac_popdir
730   done
731 fi
732
733 test -n "$ac_init_help" && exit 0
734 if $ac_init_version; then
735   cat <<\EOF
736
737 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
738 Free Software Foundation, Inc.
739 This configure script is free software; the Free Software Foundation
740 gives unlimited permission to copy, distribute and modify it.
741 EOF
742   exit 0
743 fi
744 exec 5>config.log
745 cat >&5 <<EOF
746 This file contains any messages produced by compilers while
747 running configure, to aid debugging if configure makes a mistake.
748
749 It was created by $as_me, which was
750 generated by GNU Autoconf 2.52.20141204.  Invocation command line was
751
752   $ $0 $@
753
754 EOF
755 {
756 cat <<_ASUNAME
757 ## ---------- ##
758 ## Platform.  ##
759 ## ---------- ##
760
761 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
762 uname -m = `(uname -m) 2>/dev/null || echo unknown`
763 uname -r = `(uname -r) 2>/dev/null || echo unknown`
764 uname -s = `(uname -s) 2>/dev/null || echo unknown`
765 uname -v = `(uname -v) 2>/dev/null || echo unknown`
766
767 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
768 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
769
770 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
771 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
772 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
773 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
774 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
775 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
776 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
777
778 PATH = $PATH
779
780 _ASUNAME
781 } >&5
782
783 cat >&5 <<EOF
784 ## ------------ ##
785 ## Core tests.  ##
786 ## ------------ ##
787
788 EOF
789
790 # Keep a trace of the command line.
791 # Strip out --no-create and --no-recursion so they do not pile up.
792 # Also quote any args containing shell meta-characters.
793 ac_configure_args=
794 ac_sep=
795 for ac_arg
796 do
797   case $ac_arg in
798   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
799   | --no-cr | --no-c) ;;
800   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
801   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
802   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
803     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
804     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
805     ac_sep=" " ;;
806   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
807      ac_sep=" " ;;
808   esac
809   # Get rid of the leading space.
810 done
811
812 # When interrupted or exit'd, cleanup temporary files, and complete
813 # config.log.  We remove comments because anyway the quotes in there
814 # would cause problems or look ugly.
815 trap 'exit_status=$?
816   # Save into config.log some information that might help in debugging.
817   echo >&5
818   echo "## ----------------- ##" >&5
819   echo "## Cache variables.  ##" >&5
820   echo "## ----------------- ##" >&5
821   echo >&5
822   # The following way of writing the cache mishandles newlines in values,
823 {
824   (set) 2>&1 |
825     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
826     *ac_space=\ *)
827       sed -n \
828         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
829           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
830       ;;
831     *)
832       sed -n \
833         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
834       ;;
835     esac;
836 } >&5
837   sed "/^$/d" confdefs.h >conftest.log
838   if test -s conftest.log; then
839     echo >&5
840     echo "## ------------ ##" >&5
841     echo "## confdefs.h.  ##" >&5
842     echo "## ------------ ##" >&5
843     echo >&5
844     cat conftest.log >&5
845   fi
846   (echo; echo) >&5
847   test "$ac_signal" != 0 &&
848     echo "$as_me: caught signal $ac_signal" >&5
849   echo "$as_me: exit $exit_status" >&5
850   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
851     exit $exit_status
852      ' 0
853 for ac_signal in 1 2 13 15; do
854   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
855 done
856 ac_signal=0
857
858 # confdefs.h avoids OS command line length limits that DEFS can exceed.
859 rm -rf conftest* confdefs.h
860 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
861 echo >confdefs.h
862
863 # Let the site file select an alternate cache file if it wants to.
864 # Prefer explicitly selected file to automatically selected ones.
865 if test -z "$CONFIG_SITE"; then
866   if test "x$prefix" != xNONE; then
867     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
868   else
869     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
870   fi
871 fi
872 for ac_site_file in $CONFIG_SITE; do
873   if test -r "$ac_site_file"; then
874     { echo "$as_me:874: loading site script $ac_site_file" >&5
875 echo "$as_me: loading site script $ac_site_file" >&6;}
876     cat "$ac_site_file" >&5
877     . "$ac_site_file"
878   fi
879 done
880
881 if test -r "$cache_file"; then
882   # Some versions of bash will fail to source /dev/null (special
883   # files actually), so we avoid doing that.
884   if test -f "$cache_file"; then
885     { echo "$as_me:885: loading cache $cache_file" >&5
886 echo "$as_me: loading cache $cache_file" >&6;}
887     case $cache_file in
888       [\\/]* | ?:[\\/]* ) . $cache_file;;
889       *)                      . ./$cache_file;;
890     esac
891   fi
892 else
893   { echo "$as_me:893: creating cache $cache_file" >&5
894 echo "$as_me: creating cache $cache_file" >&6;}
895   >$cache_file
896 fi
897
898 # Check that the precious variables saved in the cache have kept the same
899 # value.
900 ac_cache_corrupted=false
901 for ac_var in `(set) 2>&1 |
902                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
903   eval ac_old_set=\$ac_cv_env_${ac_var}_set
904   eval ac_new_set=\$ac_env_${ac_var}_set
905   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
906   eval ac_new_val="\$ac_env_${ac_var}_value"
907   case $ac_old_set,$ac_new_set in
908     set,)
909       { echo "$as_me:909: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
910 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
911       ac_cache_corrupted=: ;;
912     ,set)
913       { echo "$as_me:913: error: \`$ac_var' was not set in the previous run" >&5
914 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
915       ac_cache_corrupted=: ;;
916     ,);;
917     *)
918       if test "x$ac_old_val" != "x$ac_new_val"; then
919         { echo "$as_me:919: error: \`$ac_var' has changed since the previous run:" >&5
920 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
921         { echo "$as_me:921:   former value:  $ac_old_val" >&5
922 echo "$as_me:   former value:  $ac_old_val" >&2;}
923         { echo "$as_me:923:   current value: $ac_new_val" >&5
924 echo "$as_me:   current value: $ac_new_val" >&2;}
925         ac_cache_corrupted=:
926       fi;;
927   esac
928   # Pass precious variables to config.status.  It doesn't matter if
929   # we pass some twice (in addition to the command line arguments).
930   if test "$ac_new_set" = set; then
931     case $ac_new_val in
932     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
933       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
934       ac_configure_args="$ac_configure_args '$ac_arg'"
935       ;;
936     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
937        ;;
938     esac
939   fi
940 done
941 if $ac_cache_corrupted; then
942   { echo "$as_me:942: error: changes in the environment can compromise the build" >&5
943 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
944   { { echo "$as_me:944: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
945 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
946    { (exit 1); exit 1; }; }
947 fi
948
949 ac_ext=c
950 ac_cpp='$CPP $CPPFLAGS'
951 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
952 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
953 ac_compiler_gnu=$ac_cv_c_compiler_gnu
954 ac_main_return=return
955
956 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
957   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
958                    ECHO_T='     ' ;;
959   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
960   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
961 esac
962 echo "#! $SHELL" >conftest.sh
963 echo  "exit 0"   >>conftest.sh
964 chmod +x conftest.sh
965 if { (echo "$as_me:965: PATH=\".;.\"; conftest.sh") >&5
966   (PATH=".;."; conftest.sh) 2>&5
967   ac_status=$?
968   echo "$as_me:968: \$? = $ac_status" >&5
969   (exit $ac_status); }; then
970   ac_path_separator=';'
971 else
972   ac_path_separator=:
973 fi
974 PATH_SEPARATOR="$ac_path_separator"
975 rm -f conftest.sh
976
977 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
978
979 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
980
981 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
982
983 ac_aux_dir=
984 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
985   if test -f $ac_dir/install-sh; then
986     ac_aux_dir=$ac_dir
987     ac_install_sh="$ac_aux_dir/install-sh -c"
988     break
989   elif test -f $ac_dir/install.sh; then
990     ac_aux_dir=$ac_dir
991     ac_install_sh="$ac_aux_dir/install.sh -c"
992     break
993   elif test -f $ac_dir/shtool; then
994     ac_aux_dir=$ac_dir
995     ac_install_sh="$ac_aux_dir/shtool install -c"
996     break
997   fi
998 done
999 if test -z "$ac_aux_dir"; then
1000   { { echo "$as_me:1000: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1001 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1002    { (exit 1); exit 1; }; }
1003 fi
1004 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1005 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1006 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1007
1008 # Make sure we can run config.sub.
1009 $ac_config_sub sun4 >/dev/null 2>&1 ||
1010   { { echo "$as_me:1010: error: cannot run $ac_config_sub" >&5
1011 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1012    { (exit 1); exit 1; }; }
1013
1014 echo "$as_me:1014: checking build system type" >&5
1015 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1016 if test "${ac_cv_build+set}" = set; then
1017   echo $ECHO_N "(cached) $ECHO_C" >&6
1018 else
1019   ac_cv_build_alias=$build_alias
1020 test -z "$ac_cv_build_alias" &&
1021   ac_cv_build_alias=`$ac_config_guess`
1022 test -z "$ac_cv_build_alias" &&
1023   { { echo "$as_me:1023: error: cannot guess build type; you must specify one" >&5
1024 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1025    { (exit 1); exit 1; }; }
1026 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1027   { { echo "$as_me:1027: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1028 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1029    { (exit 1); exit 1; }; }
1030
1031 fi
1032 echo "$as_me:1032: result: $ac_cv_build" >&5
1033 echo "${ECHO_T}$ac_cv_build" >&6
1034 build=$ac_cv_build
1035 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1036 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1037 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1038
1039 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1040         echo "$as_me:1040: checking host system type" >&5
1041 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1042 if test "${ac_cv_host+set}" = set; then
1043   echo $ECHO_N "(cached) $ECHO_C" >&6
1044 else
1045   ac_cv_host_alias=$host_alias
1046 test -z "$ac_cv_host_alias" &&
1047   ac_cv_host_alias=$ac_cv_build_alias
1048 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1049   { { echo "$as_me:1049: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1050 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1051    { (exit 1); exit 1; }; }
1052
1053 fi
1054 echo "$as_me:1054: result: $ac_cv_host" >&5
1055 echo "${ECHO_T}$ac_cv_host" >&6
1056 host=$ac_cv_host
1057 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1058 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1059 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1060
1061         system_name="$host_os"
1062 else
1063         system_name="`(uname -s -r) 2>/dev/null`"
1064         if test -z "$system_name" ; then
1065                 system_name="`(hostname) 2>/dev/null`"
1066         fi
1067 fi
1068 test -n "$system_name" &&
1069 cat >>confdefs.h <<EOF
1070 #define SYSTEM_NAME "$system_name"
1071 EOF
1072
1073 if test "${cf_cv_system_name+set}" = set; then
1074   echo $ECHO_N "(cached) $ECHO_C" >&6
1075 else
1076   cf_cv_system_name="$system_name"
1077 fi
1078
1079 test -z "$system_name" && system_name="$cf_cv_system_name"
1080 test -n "$cf_cv_system_name" && echo "$as_me:1080: result: Configuring for $cf_cv_system_name" >&5
1081 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1082
1083 if test ".$system_name" != ".$cf_cv_system_name" ; then
1084         echo "$as_me:1084: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1085 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1086         { { echo "$as_me:1086: error: \"Please remove config.cache and try again.\"" >&5
1087 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1088    { (exit 1); exit 1; }; }
1089 fi
1090
1091 test "$program_prefix" != NONE &&
1092   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1093 # Use a double $ so make ignores it.
1094 test "$program_suffix" != NONE &&
1095   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1096 # Double any \ or $.  echo might interpret backslashes.
1097 # By default was `s,x,x', remove it if useless.
1098 cat <<\_ACEOF >conftest.sed
1099 s/[\\$]/&&/g;s/;s,x,x,$//
1100 _ACEOF
1101 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1102 rm conftest.sed
1103
1104 echo "$as_me:1104: checking whether ${MAKE-make} sets \${MAKE}" >&5
1105 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1106 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1107 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1108   echo $ECHO_N "(cached) $ECHO_C" >&6
1109 else
1110   cat >conftest.make <<\EOF
1111 all:
1112         @echo 'ac_maketemp="${MAKE}"'
1113 EOF
1114 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1115 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1116 if test -n "$ac_maketemp"; then
1117   eval ac_cv_prog_make_${ac_make}_set=yes
1118 else
1119   eval ac_cv_prog_make_${ac_make}_set=no
1120 fi
1121 rm -f conftest.make
1122 fi
1123 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1124   echo "$as_me:1124: result: yes" >&5
1125 echo "${ECHO_T}yes" >&6
1126   SET_MAKE=
1127 else
1128   echo "$as_me:1128: result: no" >&5
1129 echo "${ECHO_T}no" >&6
1130   SET_MAKE="MAKE=${MAKE-make}"
1131 fi
1132
1133 ac_ext=c
1134 ac_cpp='$CPP $CPPFLAGS'
1135 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1136 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1137 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1138 ac_main_return=return
1139 if test -n "$ac_tool_prefix"; then
1140   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1141 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1142 echo "$as_me:1142: checking for $ac_word" >&5
1143 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1144 if test "${ac_cv_prog_CC+set}" = set; then
1145   echo $ECHO_N "(cached) $ECHO_C" >&6
1146 else
1147   if test -n "$CC"; then
1148   ac_cv_prog_CC="$CC" # Let the user override the test.
1149 else
1150   ac_save_IFS=$IFS; IFS=$ac_path_separator
1151 ac_dummy="$PATH"
1152 for ac_dir in $ac_dummy; do
1153   IFS=$ac_save_IFS
1154   test -z "$ac_dir" && ac_dir=.
1155   $as_executable_p "$ac_dir/$ac_word" || continue
1156 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1157 echo "$as_me:1157: found $ac_dir/$ac_word" >&5
1158 break
1159 done
1160
1161 fi
1162 fi
1163 CC=$ac_cv_prog_CC
1164 if test -n "$CC"; then
1165   echo "$as_me:1165: result: $CC" >&5
1166 echo "${ECHO_T}$CC" >&6
1167 else
1168   echo "$as_me:1168: result: no" >&5
1169 echo "${ECHO_T}no" >&6
1170 fi
1171
1172 fi
1173 if test -z "$ac_cv_prog_CC"; then
1174   ac_ct_CC=$CC
1175   # Extract the first word of "gcc", so it can be a program name with args.
1176 set dummy gcc; ac_word=$2
1177 echo "$as_me:1177: checking for $ac_word" >&5
1178 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1179 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1180   echo $ECHO_N "(cached) $ECHO_C" >&6
1181 else
1182   if test -n "$ac_ct_CC"; then
1183   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1184 else
1185   ac_save_IFS=$IFS; IFS=$ac_path_separator
1186 ac_dummy="$PATH"
1187 for ac_dir in $ac_dummy; do
1188   IFS=$ac_save_IFS
1189   test -z "$ac_dir" && ac_dir=.
1190   $as_executable_p "$ac_dir/$ac_word" || continue
1191 ac_cv_prog_ac_ct_CC="gcc"
1192 echo "$as_me:1192: found $ac_dir/$ac_word" >&5
1193 break
1194 done
1195
1196 fi
1197 fi
1198 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1199 if test -n "$ac_ct_CC"; then
1200   echo "$as_me:1200: result: $ac_ct_CC" >&5
1201 echo "${ECHO_T}$ac_ct_CC" >&6
1202 else
1203   echo "$as_me:1203: result: no" >&5
1204 echo "${ECHO_T}no" >&6
1205 fi
1206
1207   CC=$ac_ct_CC
1208 else
1209   CC="$ac_cv_prog_CC"
1210 fi
1211
1212 if test -z "$CC"; then
1213   if test -n "$ac_tool_prefix"; then
1214   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1215 set dummy ${ac_tool_prefix}cc; ac_word=$2
1216 echo "$as_me:1216: checking for $ac_word" >&5
1217 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1218 if test "${ac_cv_prog_CC+set}" = set; then
1219   echo $ECHO_N "(cached) $ECHO_C" >&6
1220 else
1221   if test -n "$CC"; then
1222   ac_cv_prog_CC="$CC" # Let the user override the test.
1223 else
1224   ac_save_IFS=$IFS; IFS=$ac_path_separator
1225 ac_dummy="$PATH"
1226 for ac_dir in $ac_dummy; do
1227   IFS=$ac_save_IFS
1228   test -z "$ac_dir" && ac_dir=.
1229   $as_executable_p "$ac_dir/$ac_word" || continue
1230 ac_cv_prog_CC="${ac_tool_prefix}cc"
1231 echo "$as_me:1231: found $ac_dir/$ac_word" >&5
1232 break
1233 done
1234
1235 fi
1236 fi
1237 CC=$ac_cv_prog_CC
1238 if test -n "$CC"; then
1239   echo "$as_me:1239: result: $CC" >&5
1240 echo "${ECHO_T}$CC" >&6
1241 else
1242   echo "$as_me:1242: result: no" >&5
1243 echo "${ECHO_T}no" >&6
1244 fi
1245
1246 fi
1247 if test -z "$ac_cv_prog_CC"; then
1248   ac_ct_CC=$CC
1249   # Extract the first word of "cc", so it can be a program name with args.
1250 set dummy cc; ac_word=$2
1251 echo "$as_me:1251: checking for $ac_word" >&5
1252 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1253 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1254   echo $ECHO_N "(cached) $ECHO_C" >&6
1255 else
1256   if test -n "$ac_ct_CC"; then
1257   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1258 else
1259   ac_save_IFS=$IFS; IFS=$ac_path_separator
1260 ac_dummy="$PATH"
1261 for ac_dir in $ac_dummy; do
1262   IFS=$ac_save_IFS
1263   test -z "$ac_dir" && ac_dir=.
1264   $as_executable_p "$ac_dir/$ac_word" || continue
1265 ac_cv_prog_ac_ct_CC="cc"
1266 echo "$as_me:1266: found $ac_dir/$ac_word" >&5
1267 break
1268 done
1269
1270 fi
1271 fi
1272 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1273 if test -n "$ac_ct_CC"; then
1274   echo "$as_me:1274: result: $ac_ct_CC" >&5
1275 echo "${ECHO_T}$ac_ct_CC" >&6
1276 else
1277   echo "$as_me:1277: result: no" >&5
1278 echo "${ECHO_T}no" >&6
1279 fi
1280
1281   CC=$ac_ct_CC
1282 else
1283   CC="$ac_cv_prog_CC"
1284 fi
1285
1286 fi
1287 if test -z "$CC"; then
1288   # Extract the first word of "cc", so it can be a program name with args.
1289 set dummy cc; ac_word=$2
1290 echo "$as_me:1290: checking for $ac_word" >&5
1291 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1292 if test "${ac_cv_prog_CC+set}" = set; then
1293   echo $ECHO_N "(cached) $ECHO_C" >&6
1294 else
1295   if test -n "$CC"; then
1296   ac_cv_prog_CC="$CC" # Let the user override the test.
1297 else
1298   ac_prog_rejected=no
1299   ac_save_IFS=$IFS; IFS=$ac_path_separator
1300 ac_dummy="$PATH"
1301 for ac_dir in $ac_dummy; do
1302   IFS=$ac_save_IFS
1303   test -z "$ac_dir" && ac_dir=.
1304   $as_executable_p "$ac_dir/$ac_word" || continue
1305 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1306   ac_prog_rejected=yes
1307   continue
1308 fi
1309 ac_cv_prog_CC="cc"
1310 echo "$as_me:1310: found $ac_dir/$ac_word" >&5
1311 break
1312 done
1313
1314 if test $ac_prog_rejected = yes; then
1315   # We found a bogon in the path, so make sure we never use it.
1316   set dummy $ac_cv_prog_CC
1317   shift
1318   if test $# != 0; then
1319     # We chose a different compiler from the bogus one.
1320     # However, it has the same basename, so the bogon will be chosen
1321     # first if we set CC to just the basename; use the full file name.
1322     shift
1323     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1324     shift
1325     ac_cv_prog_CC="$@"
1326   fi
1327 fi
1328 fi
1329 fi
1330 CC=$ac_cv_prog_CC
1331 if test -n "$CC"; then
1332   echo "$as_me:1332: result: $CC" >&5
1333 echo "${ECHO_T}$CC" >&6
1334 else
1335   echo "$as_me:1335: result: no" >&5
1336 echo "${ECHO_T}no" >&6
1337 fi
1338
1339 fi
1340 if test -z "$CC"; then
1341   if test -n "$ac_tool_prefix"; then
1342   for ac_prog in cl
1343   do
1344     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1345 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1346 echo "$as_me:1346: checking for $ac_word" >&5
1347 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1348 if test "${ac_cv_prog_CC+set}" = set; then
1349   echo $ECHO_N "(cached) $ECHO_C" >&6
1350 else
1351   if test -n "$CC"; then
1352   ac_cv_prog_CC="$CC" # Let the user override the test.
1353 else
1354   ac_save_IFS=$IFS; IFS=$ac_path_separator
1355 ac_dummy="$PATH"
1356 for ac_dir in $ac_dummy; do
1357   IFS=$ac_save_IFS
1358   test -z "$ac_dir" && ac_dir=.
1359   $as_executable_p "$ac_dir/$ac_word" || continue
1360 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1361 echo "$as_me:1361: found $ac_dir/$ac_word" >&5
1362 break
1363 done
1364
1365 fi
1366 fi
1367 CC=$ac_cv_prog_CC
1368 if test -n "$CC"; then
1369   echo "$as_me:1369: result: $CC" >&5
1370 echo "${ECHO_T}$CC" >&6
1371 else
1372   echo "$as_me:1372: result: no" >&5
1373 echo "${ECHO_T}no" >&6
1374 fi
1375
1376     test -n "$CC" && break
1377   done
1378 fi
1379 if test -z "$CC"; then
1380   ac_ct_CC=$CC
1381   for ac_prog in cl
1382 do
1383   # Extract the first word of "$ac_prog", so it can be a program name with args.
1384 set dummy $ac_prog; ac_word=$2
1385 echo "$as_me:1385: checking for $ac_word" >&5
1386 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1387 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1388   echo $ECHO_N "(cached) $ECHO_C" >&6
1389 else
1390   if test -n "$ac_ct_CC"; then
1391   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1392 else
1393   ac_save_IFS=$IFS; IFS=$ac_path_separator
1394 ac_dummy="$PATH"
1395 for ac_dir in $ac_dummy; do
1396   IFS=$ac_save_IFS
1397   test -z "$ac_dir" && ac_dir=.
1398   $as_executable_p "$ac_dir/$ac_word" || continue
1399 ac_cv_prog_ac_ct_CC="$ac_prog"
1400 echo "$as_me:1400: found $ac_dir/$ac_word" >&5
1401 break
1402 done
1403
1404 fi
1405 fi
1406 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1407 if test -n "$ac_ct_CC"; then
1408   echo "$as_me:1408: result: $ac_ct_CC" >&5
1409 echo "${ECHO_T}$ac_ct_CC" >&6
1410 else
1411   echo "$as_me:1411: result: no" >&5
1412 echo "${ECHO_T}no" >&6
1413 fi
1414
1415   test -n "$ac_ct_CC" && break
1416 done
1417
1418   CC=$ac_ct_CC
1419 fi
1420
1421 fi
1422
1423 test -z "$CC" && { { echo "$as_me:1423: error: no acceptable cc found in \$PATH" >&5
1424 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1425    { (exit 1); exit 1; }; }
1426
1427 # Provide some information about the compiler.
1428 echo "$as_me:1428:" \
1429      "checking for C compiler version" >&5
1430 ac_compiler=`set X $ac_compile; echo $2`
1431 { (eval echo "$as_me:1431: \"$ac_compiler --version </dev/null >&5\"") >&5
1432   (eval $ac_compiler --version </dev/null >&5) 2>&5
1433   ac_status=$?
1434   echo "$as_me:1434: \$? = $ac_status" >&5
1435   (exit $ac_status); }
1436 { (eval echo "$as_me:1436: \"$ac_compiler -v </dev/null >&5\"") >&5
1437   (eval $ac_compiler -v </dev/null >&5) 2>&5
1438   ac_status=$?
1439   echo "$as_me:1439: \$? = $ac_status" >&5
1440   (exit $ac_status); }
1441 { (eval echo "$as_me:1441: \"$ac_compiler -V </dev/null >&5\"") >&5
1442   (eval $ac_compiler -V </dev/null >&5) 2>&5
1443   ac_status=$?
1444   echo "$as_me:1444: \$? = $ac_status" >&5
1445   (exit $ac_status); }
1446
1447 cat >conftest.$ac_ext <<_ACEOF
1448 #line 1448 "configure"
1449 #include "confdefs.h"
1450
1451 int
1452 main ()
1453 {
1454
1455   ;
1456   return 0;
1457 }
1458 _ACEOF
1459 ac_clean_files_save=$ac_clean_files
1460 ac_clean_files="$ac_clean_files a.out a.exe"
1461 # Try to create an executable without -o first, disregard a.out.
1462 # It will help us diagnose broken compilers, and finding out an intuition
1463 # of exeext.
1464 echo "$as_me:1464: checking for C compiler default output" >&5
1465 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1466 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1467 if { (eval echo "$as_me:1467: \"$ac_link_default\"") >&5
1468   (eval $ac_link_default) 2>&5
1469   ac_status=$?
1470   echo "$as_me:1470: \$? = $ac_status" >&5
1471   (exit $ac_status); }; then
1472   # Find the output, starting from the most likely.  This scheme is
1473 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1474 # resort.
1475 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1476                 ls a.out conftest 2>/dev/null;
1477                 ls a.* conftest.* 2>/dev/null`; do
1478   case $ac_file in
1479     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1480     a.out ) # We found the default executable, but exeext='' is most
1481             # certainly right.
1482             break;;
1483     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1484           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1485           export ac_cv_exeext
1486           break;;
1487     * ) break;;
1488   esac
1489 done
1490 else
1491   echo "$as_me: failed program was:" >&5
1492 cat conftest.$ac_ext >&5
1493 { { echo "$as_me:1493: error: C compiler cannot create executables" >&5
1494 echo "$as_me: error: C compiler cannot create executables" >&2;}
1495    { (exit 77); exit 77; }; }
1496 fi
1497
1498 ac_exeext=$ac_cv_exeext
1499 echo "$as_me:1499: result: $ac_file" >&5
1500 echo "${ECHO_T}$ac_file" >&6
1501
1502 # Check the compiler produces executables we can run.  If not, either
1503 # the compiler is broken, or we cross compile.
1504 echo "$as_me:1504: checking whether the C compiler works" >&5
1505 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1506 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1507 # If not cross compiling, check that we can run a simple program.
1508 if test "$cross_compiling" != yes; then
1509   if { ac_try='./$ac_file'
1510   { (eval echo "$as_me:1510: \"$ac_try\"") >&5
1511   (eval $ac_try) 2>&5
1512   ac_status=$?
1513   echo "$as_me:1513: \$? = $ac_status" >&5
1514   (exit $ac_status); }; }; then
1515     cross_compiling=no
1516   else
1517     if test "$cross_compiling" = maybe; then
1518         cross_compiling=yes
1519     else
1520         { { echo "$as_me:1520: error: cannot run C compiled programs.
1521 If you meant to cross compile, use \`--host'." >&5
1522 echo "$as_me: error: cannot run C compiled programs.
1523 If you meant to cross compile, use \`--host'." >&2;}
1524    { (exit 1); exit 1; }; }
1525     fi
1526   fi
1527 fi
1528 echo "$as_me:1528: result: yes" >&5
1529 echo "${ECHO_T}yes" >&6
1530
1531 rm -f a.out a.exe conftest$ac_cv_exeext
1532 ac_clean_files=$ac_clean_files_save
1533 # Check the compiler produces executables we can run.  If not, either
1534 # the compiler is broken, or we cross compile.
1535 echo "$as_me:1535: checking whether we are cross compiling" >&5
1536 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1537 echo "$as_me:1537: result: $cross_compiling" >&5
1538 echo "${ECHO_T}$cross_compiling" >&6
1539
1540 echo "$as_me:1540: checking for executable suffix" >&5
1541 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1542 if { (eval echo "$as_me:1542: \"$ac_link\"") >&5
1543   (eval $ac_link) 2>&5
1544   ac_status=$?
1545   echo "$as_me:1545: \$? = $ac_status" >&5
1546   (exit $ac_status); }; then
1547   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1548 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1549 # work properly (i.e., refer to `conftest.exe'), while it won't with
1550 # `rm'.
1551 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1552   case $ac_file in
1553     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1554     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1555           export ac_cv_exeext
1556           break;;
1557     * ) break;;
1558   esac
1559 done
1560 else
1561   { { echo "$as_me:1561: error: cannot compute EXEEXT: cannot compile and link" >&5
1562 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1563    { (exit 1); exit 1; }; }
1564 fi
1565
1566 rm -f conftest$ac_cv_exeext
1567 echo "$as_me:1567: result: $ac_cv_exeext" >&5
1568 echo "${ECHO_T}$ac_cv_exeext" >&6
1569
1570 rm -f conftest.$ac_ext
1571 EXEEXT=$ac_cv_exeext
1572 ac_exeext=$EXEEXT
1573 echo "$as_me:1573: checking for object suffix" >&5
1574 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1575 if test "${ac_cv_objext+set}" = set; then
1576   echo $ECHO_N "(cached) $ECHO_C" >&6
1577 else
1578   cat >conftest.$ac_ext <<_ACEOF
1579 #line 1579 "configure"
1580 #include "confdefs.h"
1581
1582 int
1583 main ()
1584 {
1585
1586   ;
1587   return 0;
1588 }
1589 _ACEOF
1590 rm -f conftest.o conftest.obj
1591 if { (eval echo "$as_me:1591: \"$ac_compile\"") >&5
1592   (eval $ac_compile) 2>&5
1593   ac_status=$?
1594   echo "$as_me:1594: \$? = $ac_status" >&5
1595   (exit $ac_status); }; then
1596   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1597   case $ac_file in
1598     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1599     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1600        break;;
1601   esac
1602 done
1603 else
1604   echo "$as_me: failed program was:" >&5
1605 cat conftest.$ac_ext >&5
1606 { { echo "$as_me:1606: error: cannot compute OBJEXT: cannot compile" >&5
1607 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1608    { (exit 1); exit 1; }; }
1609 fi
1610
1611 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1612 fi
1613 echo "$as_me:1613: result: $ac_cv_objext" >&5
1614 echo "${ECHO_T}$ac_cv_objext" >&6
1615 OBJEXT=$ac_cv_objext
1616 ac_objext=$OBJEXT
1617 echo "$as_me:1617: checking whether we are using the GNU C compiler" >&5
1618 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1619 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1620   echo $ECHO_N "(cached) $ECHO_C" >&6
1621 else
1622   cat >conftest.$ac_ext <<_ACEOF
1623 #line 1623 "configure"
1624 #include "confdefs.h"
1625
1626 int
1627 main ()
1628 {
1629 #ifndef __GNUC__
1630        choke me
1631 #endif
1632
1633   ;
1634   return 0;
1635 }
1636 _ACEOF
1637 rm -f conftest.$ac_objext
1638 if { (eval echo "$as_me:1638: \"$ac_compile\"") >&5
1639   (eval $ac_compile) 2>&5
1640   ac_status=$?
1641   echo "$as_me:1641: \$? = $ac_status" >&5
1642   (exit $ac_status); } &&
1643          { ac_try='test -s conftest.$ac_objext'
1644   { (eval echo "$as_me:1644: \"$ac_try\"") >&5
1645   (eval $ac_try) 2>&5
1646   ac_status=$?
1647   echo "$as_me:1647: \$? = $ac_status" >&5
1648   (exit $ac_status); }; }; then
1649   ac_compiler_gnu=yes
1650 else
1651   echo "$as_me: failed program was:" >&5
1652 cat conftest.$ac_ext >&5
1653 ac_compiler_gnu=no
1654 fi
1655 rm -f conftest.$ac_objext conftest.$ac_ext
1656 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1657
1658 fi
1659 echo "$as_me:1659: result: $ac_cv_c_compiler_gnu" >&5
1660 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1661 GCC=`test $ac_compiler_gnu = yes && echo yes`
1662 ac_test_CFLAGS=${CFLAGS+set}
1663 ac_save_CFLAGS=$CFLAGS
1664 CFLAGS="-g"
1665 echo "$as_me:1665: checking whether $CC accepts -g" >&5
1666 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1667 if test "${ac_cv_prog_cc_g+set}" = set; then
1668   echo $ECHO_N "(cached) $ECHO_C" >&6
1669 else
1670   cat >conftest.$ac_ext <<_ACEOF
1671 #line 1671 "configure"
1672 #include "confdefs.h"
1673
1674 int
1675 main ()
1676 {
1677
1678   ;
1679   return 0;
1680 }
1681 _ACEOF
1682 rm -f conftest.$ac_objext
1683 if { (eval echo "$as_me:1683: \"$ac_compile\"") >&5
1684   (eval $ac_compile) 2>&5
1685   ac_status=$?
1686   echo "$as_me:1686: \$? = $ac_status" >&5
1687   (exit $ac_status); } &&
1688          { ac_try='test -s conftest.$ac_objext'
1689   { (eval echo "$as_me:1689: \"$ac_try\"") >&5
1690   (eval $ac_try) 2>&5
1691   ac_status=$?
1692   echo "$as_me:1692: \$? = $ac_status" >&5
1693   (exit $ac_status); }; }; then
1694   ac_cv_prog_cc_g=yes
1695 else
1696   echo "$as_me: failed program was:" >&5
1697 cat conftest.$ac_ext >&5
1698 ac_cv_prog_cc_g=no
1699 fi
1700 rm -f conftest.$ac_objext conftest.$ac_ext
1701 fi
1702 echo "$as_me:1702: result: $ac_cv_prog_cc_g" >&5
1703 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1704 if test "$ac_test_CFLAGS" = set; then
1705   CFLAGS=$ac_save_CFLAGS
1706 elif test $ac_cv_prog_cc_g = yes; then
1707   if test "$GCC" = yes; then
1708     CFLAGS="-g -O2"
1709   else
1710     CFLAGS="-g"
1711   fi
1712 else
1713   if test "$GCC" = yes; then
1714     CFLAGS="-O2"
1715   else
1716     CFLAGS=
1717   fi
1718 fi
1719 # Some people use a C++ compiler to compile C.  Since we use `exit',
1720 # in C++ we need to declare it.  In case someone uses the same compiler
1721 # for both compiling C and C++ we need to have the C++ compiler decide
1722 # the declaration of exit, since it's the most demanding environment.
1723 cat >conftest.$ac_ext <<_ACEOF
1724 #ifndef __cplusplus
1725   choke me
1726 #endif
1727 _ACEOF
1728 rm -f conftest.$ac_objext
1729 if { (eval echo "$as_me:1729: \"$ac_compile\"") >&5
1730   (eval $ac_compile) 2>&5
1731   ac_status=$?
1732   echo "$as_me:1732: \$? = $ac_status" >&5
1733   (exit $ac_status); } &&
1734          { ac_try='test -s conftest.$ac_objext'
1735   { (eval echo "$as_me:1735: \"$ac_try\"") >&5
1736   (eval $ac_try) 2>&5
1737   ac_status=$?
1738   echo "$as_me:1738: \$? = $ac_status" >&5
1739   (exit $ac_status); }; }; then
1740   for ac_declaration in \
1741    ''\
1742    '#include <stdlib.h>' \
1743    'extern "C" void std::exit (int) throw (); using std::exit;' \
1744    'extern "C" void std::exit (int); using std::exit;' \
1745    'extern "C" void exit (int) throw ();' \
1746    'extern "C" void exit (int);' \
1747    'void exit (int);'
1748 do
1749   cat >conftest.$ac_ext <<_ACEOF
1750 #line 1750 "configure"
1751 #include "confdefs.h"
1752 #include <stdlib.h>
1753 $ac_declaration
1754 int
1755 main ()
1756 {
1757 exit (42);
1758   ;
1759   return 0;
1760 }
1761 _ACEOF
1762 rm -f conftest.$ac_objext
1763 if { (eval echo "$as_me:1763: \"$ac_compile\"") >&5
1764   (eval $ac_compile) 2>&5
1765   ac_status=$?
1766   echo "$as_me:1766: \$? = $ac_status" >&5
1767   (exit $ac_status); } &&
1768          { ac_try='test -s conftest.$ac_objext'
1769   { (eval echo "$as_me:1769: \"$ac_try\"") >&5
1770   (eval $ac_try) 2>&5
1771   ac_status=$?
1772   echo "$as_me:1772: \$? = $ac_status" >&5
1773   (exit $ac_status); }; }; then
1774   :
1775 else
1776   echo "$as_me: failed program was:" >&5
1777 cat conftest.$ac_ext >&5
1778 continue
1779 fi
1780 rm -f conftest.$ac_objext conftest.$ac_ext
1781   cat >conftest.$ac_ext <<_ACEOF
1782 #line 1782 "configure"
1783 #include "confdefs.h"
1784 $ac_declaration
1785 int
1786 main ()
1787 {
1788 exit (42);
1789   ;
1790   return 0;
1791 }
1792 _ACEOF
1793 rm -f conftest.$ac_objext
1794 if { (eval echo "$as_me:1794: \"$ac_compile\"") >&5
1795   (eval $ac_compile) 2>&5
1796   ac_status=$?
1797   echo "$as_me:1797: \$? = $ac_status" >&5
1798   (exit $ac_status); } &&
1799          { ac_try='test -s conftest.$ac_objext'
1800   { (eval echo "$as_me:1800: \"$ac_try\"") >&5
1801   (eval $ac_try) 2>&5
1802   ac_status=$?
1803   echo "$as_me:1803: \$? = $ac_status" >&5
1804   (exit $ac_status); }; }; then
1805   break
1806 else
1807   echo "$as_me: failed program was:" >&5
1808 cat conftest.$ac_ext >&5
1809 fi
1810 rm -f conftest.$ac_objext conftest.$ac_ext
1811 done
1812 rm -rf conftest*
1813 if test -n "$ac_declaration"; then
1814   echo '#ifdef __cplusplus' >>confdefs.h
1815   echo $ac_declaration      >>confdefs.h
1816   echo '#endif'             >>confdefs.h
1817 fi
1818
1819 else
1820   echo "$as_me: failed program was:" >&5
1821 cat conftest.$ac_ext >&5
1822 fi
1823 rm -f conftest.$ac_objext conftest.$ac_ext
1824 ac_ext=c
1825 ac_cpp='$CPP $CPPFLAGS'
1826 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1827 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1828 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1829 ac_main_return=return
1830
1831 GCC_VERSION=none
1832 if test "$GCC" = yes ; then
1833         echo "$as_me:1833: checking version of $CC" >&5
1834 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1835         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1836         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1837         echo "$as_me:1837: result: $GCC_VERSION" >&5
1838 echo "${ECHO_T}$GCC_VERSION" >&6
1839 fi
1840
1841 echo "$as_me:1841: checking for $CC option to accept ANSI C" >&5
1842 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1843 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1844   echo $ECHO_N "(cached) $ECHO_C" >&6
1845 else
1846   ac_cv_prog_cc_stdc=no
1847 ac_save_CC=$CC
1848 cat >conftest.$ac_ext <<_ACEOF
1849 #line 1849 "configure"
1850 #include "confdefs.h"
1851 #include <stdarg.h>
1852 #include <stdio.h>
1853 #include <sys/types.h>
1854 #include <sys/stat.h>
1855 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1856 struct buf { int x; };
1857 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1858 static char *e (p, i)
1859      char **p;
1860      int i;
1861 {
1862   return p[i];
1863 }
1864 static char *f (char * (*g) (char **, int), char **p, ...)
1865 {
1866   char *s;
1867   va_list v;
1868   va_start (v,p);
1869   s = g (p, va_arg (v,int));
1870   va_end (v);
1871   return s;
1872 }
1873 int test (int i, double x);
1874 struct s1 {int (*f) (int a);};
1875 struct s2 {int (*f) (double a);};
1876 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1877 int argc;
1878 char **argv;
1879 int
1880 main ()
1881 {
1882 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1883   ;
1884   return 0;
1885 }
1886 _ACEOF
1887 # Don't try gcc -ansi; that turns off useful extensions and
1888 # breaks some systems' header files.
1889 # AIX                   -qlanglvl=ansi
1890 # Ultrix and OSF/1      -std1
1891 # HP-UX 10.20 and later -Ae
1892 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1893 # SVR4                  -Xc -D__EXTENSIONS__
1894 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1895 do
1896   CC="$ac_save_CC $ac_arg"
1897   rm -f conftest.$ac_objext
1898 if { (eval echo "$as_me:1898: \"$ac_compile\"") >&5
1899   (eval $ac_compile) 2>&5
1900   ac_status=$?
1901   echo "$as_me:1901: \$? = $ac_status" >&5
1902   (exit $ac_status); } &&
1903          { ac_try='test -s conftest.$ac_objext'
1904   { (eval echo "$as_me:1904: \"$ac_try\"") >&5
1905   (eval $ac_try) 2>&5
1906   ac_status=$?
1907   echo "$as_me:1907: \$? = $ac_status" >&5
1908   (exit $ac_status); }; }; then
1909   ac_cv_prog_cc_stdc=$ac_arg
1910 break
1911 else
1912   echo "$as_me: failed program was:" >&5
1913 cat conftest.$ac_ext >&5
1914 fi
1915 rm -f conftest.$ac_objext
1916 done
1917 rm -f conftest.$ac_ext conftest.$ac_objext
1918 CC=$ac_save_CC
1919
1920 fi
1921
1922 case "x$ac_cv_prog_cc_stdc" in
1923   x|xno)
1924     echo "$as_me:1924: result: none needed" >&5
1925 echo "${ECHO_T}none needed" >&6 ;;
1926   *)
1927     echo "$as_me:1927: result: $ac_cv_prog_cc_stdc" >&5
1928 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1929     CC="$CC $ac_cv_prog_cc_stdc" ;;
1930 esac
1931
1932 # This should have been defined by AC_PROG_CC
1933 : ${CC:=cc}
1934
1935 echo "$as_me:1935: checking \$CC variable" >&5
1936 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1937 case "$CC" in #(vi
1938 *[\ \   ]-[IUD]*)
1939         echo "$as_me:1939: result: broken" >&5
1940 echo "${ECHO_T}broken" >&6
1941         { echo "$as_me:1941: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1942 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1943         # humor him...
1944         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
1945         CC=`echo "$CC" | sed -e 's/[    ].*//'`
1946
1947 cf_fix_cppflags=no
1948 cf_new_cflags=
1949 cf_new_cppflags=
1950 cf_new_extra_cppflags=
1951
1952 for cf_add_cflags in $cf_flags
1953 do
1954 case $cf_fix_cppflags in
1955 no)
1956         case $cf_add_cflags in #(vi
1957         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1958                 case $cf_add_cflags in
1959                 -D*)
1960                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1961
1962                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1963                                 && test -z "${cf_tst_cflags}" \
1964                                 && cf_fix_cppflags=yes
1965
1966                         if test $cf_fix_cppflags = yes ; then
1967                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1968                                 continue
1969                         elif test "${cf_tst_cflags}" = "\"'" ; then
1970                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1971                                 continue
1972                         fi
1973                         ;;
1974                 esac
1975                 case "$CPPFLAGS" in
1976                 *$cf_add_cflags) #(vi
1977                         ;;
1978                 *) #(vi
1979                         case $cf_add_cflags in #(vi
1980                         -D*)
1981                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1982
1983 CPPFLAGS=`echo "$CPPFLAGS" | \
1984         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1985                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1986
1987                                 ;;
1988                         esac
1989                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1990                         ;;
1991                 esac
1992                 ;;
1993         *)
1994                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1995                 ;;
1996         esac
1997         ;;
1998 yes)
1999         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2000
2001         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2002
2003         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2004                 && test -z "${cf_tst_cflags}" \
2005                 && cf_fix_cppflags=no
2006         ;;
2007 esac
2008 done
2009
2010 if test -n "$cf_new_cflags" ; then
2011
2012         CFLAGS="$CFLAGS $cf_new_cflags"
2013 fi
2014
2015 if test -n "$cf_new_cppflags" ; then
2016
2017         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2018 fi
2019
2020 if test -n "$cf_new_extra_cppflags" ; then
2021
2022         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2023 fi
2024
2025         ;;
2026 *)
2027         echo "$as_me:2027: result: ok" >&5
2028 echo "${ECHO_T}ok" >&6
2029         ;;
2030 esac
2031
2032 ac_ext=c
2033 ac_cpp='$CPP $CPPFLAGS'
2034 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2035 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2036 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2037 ac_main_return=return
2038 echo "$as_me:2038: checking how to run the C preprocessor" >&5
2039 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2040 # On Suns, sometimes $CPP names a directory.
2041 if test -n "$CPP" && test -d "$CPP"; then
2042   CPP=
2043 fi
2044 if test -z "$CPP"; then
2045   if test "${ac_cv_prog_CPP+set}" = set; then
2046   echo $ECHO_N "(cached) $ECHO_C" >&6
2047 else
2048       # Double quotes because CPP needs to be expanded
2049     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2050     do
2051       ac_preproc_ok=false
2052 for ac_c_preproc_warn_flag in '' yes
2053 do
2054   # Use a header file that comes with gcc, so configuring glibc
2055   # with a fresh cross-compiler works.
2056   # On the NeXT, cc -E runs the code through the compiler's parser,
2057   # not just through cpp. "Syntax error" is here to catch this case.
2058   cat >conftest.$ac_ext <<_ACEOF
2059 #line 2059 "configure"
2060 #include "confdefs.h"
2061 #include <assert.h>
2062                      Syntax error
2063 _ACEOF
2064 if { (eval echo "$as_me:2064: \"$ac_cpp conftest.$ac_ext\"") >&5
2065   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2066   ac_status=$?
2067   egrep -v '^ *\+' conftest.er1 >conftest.err
2068   rm -f conftest.er1
2069   cat conftest.err >&5
2070   echo "$as_me:2070: \$? = $ac_status" >&5
2071   (exit $ac_status); } >/dev/null; then
2072   if test -s conftest.err; then
2073     ac_cpp_err=$ac_c_preproc_warn_flag
2074   else
2075     ac_cpp_err=
2076   fi
2077 else
2078   ac_cpp_err=yes
2079 fi
2080 if test -z "$ac_cpp_err"; then
2081   :
2082 else
2083   echo "$as_me: failed program was:" >&5
2084   cat conftest.$ac_ext >&5
2085   # Broken: fails on valid input.
2086 continue
2087 fi
2088 rm -f conftest.err conftest.$ac_ext
2089
2090   # OK, works on sane cases.  Now check whether non-existent headers
2091   # can be detected and how.
2092   cat >conftest.$ac_ext <<_ACEOF
2093 #line 2093 "configure"
2094 #include "confdefs.h"
2095 #include <ac_nonexistent.h>
2096 _ACEOF
2097 if { (eval echo "$as_me:2097: \"$ac_cpp conftest.$ac_ext\"") >&5
2098   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2099   ac_status=$?
2100   egrep -v '^ *\+' conftest.er1 >conftest.err
2101   rm -f conftest.er1
2102   cat conftest.err >&5
2103   echo "$as_me:2103: \$? = $ac_status" >&5
2104   (exit $ac_status); } >/dev/null; then
2105   if test -s conftest.err; then
2106     ac_cpp_err=$ac_c_preproc_warn_flag
2107   else
2108     ac_cpp_err=
2109   fi
2110 else
2111   ac_cpp_err=yes
2112 fi
2113 if test -z "$ac_cpp_err"; then
2114   # Broken: success on invalid input.
2115 continue
2116 else
2117   echo "$as_me: failed program was:" >&5
2118   cat conftest.$ac_ext >&5
2119   # Passes both tests.
2120 ac_preproc_ok=:
2121 break
2122 fi
2123 rm -f conftest.err conftest.$ac_ext
2124
2125 done
2126 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2127 rm -f conftest.err conftest.$ac_ext
2128 if $ac_preproc_ok; then
2129   break
2130 fi
2131
2132     done
2133     ac_cv_prog_CPP=$CPP
2134
2135 fi
2136   CPP=$ac_cv_prog_CPP
2137 else
2138   ac_cv_prog_CPP=$CPP
2139 fi
2140 echo "$as_me:2140: result: $CPP" >&5
2141 echo "${ECHO_T}$CPP" >&6
2142 ac_preproc_ok=false
2143 for ac_c_preproc_warn_flag in '' yes
2144 do
2145   # Use a header file that comes with gcc, so configuring glibc
2146   # with a fresh cross-compiler works.
2147   # On the NeXT, cc -E runs the code through the compiler's parser,
2148   # not just through cpp. "Syntax error" is here to catch this case.
2149   cat >conftest.$ac_ext <<_ACEOF
2150 #line 2150 "configure"
2151 #include "confdefs.h"
2152 #include <assert.h>
2153                      Syntax error
2154 _ACEOF
2155 if { (eval echo "$as_me:2155: \"$ac_cpp conftest.$ac_ext\"") >&5
2156   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2157   ac_status=$?
2158   egrep -v '^ *\+' conftest.er1 >conftest.err
2159   rm -f conftest.er1
2160   cat conftest.err >&5
2161   echo "$as_me:2161: \$? = $ac_status" >&5
2162   (exit $ac_status); } >/dev/null; then
2163   if test -s conftest.err; then
2164     ac_cpp_err=$ac_c_preproc_warn_flag
2165   else
2166     ac_cpp_err=
2167   fi
2168 else
2169   ac_cpp_err=yes
2170 fi
2171 if test -z "$ac_cpp_err"; then
2172   :
2173 else
2174   echo "$as_me: failed program was:" >&5
2175   cat conftest.$ac_ext >&5
2176   # Broken: fails on valid input.
2177 continue
2178 fi
2179 rm -f conftest.err conftest.$ac_ext
2180
2181   # OK, works on sane cases.  Now check whether non-existent headers
2182   # can be detected and how.
2183   cat >conftest.$ac_ext <<_ACEOF
2184 #line 2184 "configure"
2185 #include "confdefs.h"
2186 #include <ac_nonexistent.h>
2187 _ACEOF
2188 if { (eval echo "$as_me:2188: \"$ac_cpp conftest.$ac_ext\"") >&5
2189   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2190   ac_status=$?
2191   egrep -v '^ *\+' conftest.er1 >conftest.err
2192   rm -f conftest.er1
2193   cat conftest.err >&5
2194   echo "$as_me:2194: \$? = $ac_status" >&5
2195   (exit $ac_status); } >/dev/null; then
2196   if test -s conftest.err; then
2197     ac_cpp_err=$ac_c_preproc_warn_flag
2198   else
2199     ac_cpp_err=
2200   fi
2201 else
2202   ac_cpp_err=yes
2203 fi
2204 if test -z "$ac_cpp_err"; then
2205   # Broken: success on invalid input.
2206 continue
2207 else
2208   echo "$as_me: failed program was:" >&5
2209   cat conftest.$ac_ext >&5
2210   # Passes both tests.
2211 ac_preproc_ok=:
2212 break
2213 fi
2214 rm -f conftest.err conftest.$ac_ext
2215
2216 done
2217 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2218 rm -f conftest.err conftest.$ac_ext
2219 if $ac_preproc_ok; then
2220   :
2221 else
2222   { { echo "$as_me:2222: error: C preprocessor \"$CPP\" fails sanity check" >&5
2223 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2224    { (exit 1); exit 1; }; }
2225 fi
2226
2227 ac_ext=c
2228 ac_cpp='$CPP $CPPFLAGS'
2229 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2230 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2231 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2232 ac_main_return=return
2233
2234 for ac_prog in mawk gawk nawk awk
2235 do
2236   # Extract the first word of "$ac_prog", so it can be a program name with args.
2237 set dummy $ac_prog; ac_word=$2
2238 echo "$as_me:2238: checking for $ac_word" >&5
2239 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2240 if test "${ac_cv_prog_AWK+set}" = set; then
2241   echo $ECHO_N "(cached) $ECHO_C" >&6
2242 else
2243   if test -n "$AWK"; then
2244   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2245 else
2246   ac_save_IFS=$IFS; IFS=$ac_path_separator
2247 ac_dummy="$PATH"
2248 for ac_dir in $ac_dummy; do
2249   IFS=$ac_save_IFS
2250   test -z "$ac_dir" && ac_dir=.
2251   $as_executable_p "$ac_dir/$ac_word" || continue
2252 ac_cv_prog_AWK="$ac_prog"
2253 echo "$as_me:2253: found $ac_dir/$ac_word" >&5
2254 break
2255 done
2256
2257 fi
2258 fi
2259 AWK=$ac_cv_prog_AWK
2260 if test -n "$AWK"; then
2261   echo "$as_me:2261: result: $AWK" >&5
2262 echo "${ECHO_T}$AWK" >&6
2263 else
2264   echo "$as_me:2264: result: no" >&5
2265 echo "${ECHO_T}no" >&6
2266 fi
2267
2268   test -n "$AWK" && break
2269 done
2270
2271 # Find a good install program.  We prefer a C program (faster),
2272 # so one script is as good as another.  But avoid the broken or
2273 # incompatible versions:
2274 # SysV /etc/install, /usr/sbin/install
2275 # SunOS /usr/etc/install
2276 # IRIX /sbin/install
2277 # AIX /bin/install
2278 # AmigaOS /C/install, which installs bootblocks on floppy discs
2279 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2280 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2281 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2282 # ./install, which can be erroneously created by make from ./install.sh.
2283 echo "$as_me:2283: checking for a BSD compatible install" >&5
2284 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2285 if test -z "$INSTALL"; then
2286 if test "${ac_cv_path_install+set}" = set; then
2287   echo $ECHO_N "(cached) $ECHO_C" >&6
2288 else
2289     ac_save_IFS=$IFS; IFS=$ac_path_separator
2290   for ac_dir in $PATH; do
2291     IFS=$ac_save_IFS
2292     # Account for people who put trailing slashes in PATH elements.
2293     case $ac_dir/ in
2294     / | ./ | .// | /cC/* \
2295     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2296     | /usr/ucb/* ) ;;
2297     *)
2298       # OSF1 and SCO ODT 3.0 have their own names for install.
2299       # Don't use installbsd from OSF since it installs stuff as root
2300       # by default.
2301       for ac_prog in ginstall scoinst install; do
2302         if $as_executable_p "$ac_dir/$ac_prog"; then
2303           if test $ac_prog = install &&
2304             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2305             # AIX install.  It has an incompatible calling convention.
2306             :
2307           elif test $ac_prog = install &&
2308             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2309             # program-specific install script used by HP pwplus--don't use.
2310             :
2311           else
2312             ac_cv_path_install="$ac_dir/$ac_prog -c"
2313             break 2
2314           fi
2315         fi
2316       done
2317       ;;
2318     esac
2319   done
2320
2321 fi
2322   if test "${ac_cv_path_install+set}" = set; then
2323     INSTALL=$ac_cv_path_install
2324   else
2325     # As a last resort, use the slow shell script.  We don't cache a
2326     # path for INSTALL within a source directory, because that will
2327     # break other packages using the cache if that directory is
2328     # removed, or if the path is relative.
2329     INSTALL=$ac_install_sh
2330   fi
2331 fi
2332 echo "$as_me:2332: result: $INSTALL" >&5
2333 echo "${ECHO_T}$INSTALL" >&6
2334
2335 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2336 # It thinks the first close brace ends the variable substitution.
2337 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2338
2339 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2340
2341 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2342
2343 case $INSTALL in
2344 /*)
2345   ;;
2346 *)
2347   cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2348   test -z "$cf_dir" && cf_dir=.
2349   INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2350   ;;
2351 esac
2352
2353 for ac_prog in tdlint lint alint splint lclint
2354 do
2355   # Extract the first word of "$ac_prog", so it can be a program name with args.
2356 set dummy $ac_prog; ac_word=$2
2357 echo "$as_me:2357: checking for $ac_word" >&5
2358 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2359 if test "${ac_cv_prog_LINT+set}" = set; then
2360   echo $ECHO_N "(cached) $ECHO_C" >&6
2361 else
2362   if test -n "$LINT"; then
2363   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2364 else
2365   ac_save_IFS=$IFS; IFS=$ac_path_separator
2366 ac_dummy="$PATH"
2367 for ac_dir in $ac_dummy; do
2368   IFS=$ac_save_IFS
2369   test -z "$ac_dir" && ac_dir=.
2370   $as_executable_p "$ac_dir/$ac_word" || continue
2371 ac_cv_prog_LINT="$ac_prog"
2372 echo "$as_me:2372: found $ac_dir/$ac_word" >&5
2373 break
2374 done
2375
2376 fi
2377 fi
2378 LINT=$ac_cv_prog_LINT
2379 if test -n "$LINT"; then
2380   echo "$as_me:2380: result: $LINT" >&5
2381 echo "${ECHO_T}$LINT" >&6
2382 else
2383   echo "$as_me:2383: result: no" >&5
2384 echo "${ECHO_T}no" >&6
2385 fi
2386
2387   test -n "$LINT" && break
2388 done
2389
2390 echo "$as_me:2390: checking if filesystem supports mixed-case filenames" >&5
2391 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2392 if test "${cf_cv_mixedcase+set}" = set; then
2393   echo $ECHO_N "(cached) $ECHO_C" >&6
2394 else
2395
2396 if test "$cross_compiling" = yes ; then
2397         case $target_alias in #(vi
2398         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) #(vi
2399                 cf_cv_mixedcase=no
2400                 ;;
2401         *)
2402                 cf_cv_mixedcase=yes
2403                 ;;
2404         esac
2405 else
2406         rm -f conftest CONFTEST
2407         echo test >conftest
2408         if test -f CONFTEST ; then
2409                 cf_cv_mixedcase=no
2410         else
2411                 cf_cv_mixedcase=yes
2412         fi
2413         rm -f conftest CONFTEST
2414 fi
2415
2416 fi
2417 echo "$as_me:2417: result: $cf_cv_mixedcase" >&5
2418 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2419 test "$cf_cv_mixedcase" = yes &&
2420 cat >>confdefs.h <<\EOF
2421 #define MIXEDCASE_FILENAMES 1
2422 EOF
2423
2424 for ac_prog in exctags ctags
2425 do
2426   # Extract the first word of "$ac_prog", so it can be a program name with args.
2427 set dummy $ac_prog; ac_word=$2
2428 echo "$as_me:2428: checking for $ac_word" >&5
2429 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2430 if test "${ac_cv_prog_CTAGS+set}" = set; then
2431   echo $ECHO_N "(cached) $ECHO_C" >&6
2432 else
2433   if test -n "$CTAGS"; then
2434   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2435 else
2436   ac_save_IFS=$IFS; IFS=$ac_path_separator
2437 ac_dummy="$PATH"
2438 for ac_dir in $ac_dummy; do
2439   IFS=$ac_save_IFS
2440   test -z "$ac_dir" && ac_dir=.
2441   $as_executable_p "$ac_dir/$ac_word" || continue
2442 ac_cv_prog_CTAGS="$ac_prog"
2443 echo "$as_me:2443: found $ac_dir/$ac_word" >&5
2444 break
2445 done
2446
2447 fi
2448 fi
2449 CTAGS=$ac_cv_prog_CTAGS
2450 if test -n "$CTAGS"; then
2451   echo "$as_me:2451: result: $CTAGS" >&5
2452 echo "${ECHO_T}$CTAGS" >&6
2453 else
2454   echo "$as_me:2454: result: no" >&5
2455 echo "${ECHO_T}no" >&6
2456 fi
2457
2458   test -n "$CTAGS" && break
2459 done
2460
2461 for ac_prog in exetags etags
2462 do
2463   # Extract the first word of "$ac_prog", so it can be a program name with args.
2464 set dummy $ac_prog; ac_word=$2
2465 echo "$as_me:2465: checking for $ac_word" >&5
2466 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2467 if test "${ac_cv_prog_ETAGS+set}" = set; then
2468   echo $ECHO_N "(cached) $ECHO_C" >&6
2469 else
2470   if test -n "$ETAGS"; then
2471   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2472 else
2473   ac_save_IFS=$IFS; IFS=$ac_path_separator
2474 ac_dummy="$PATH"
2475 for ac_dir in $ac_dummy; do
2476   IFS=$ac_save_IFS
2477   test -z "$ac_dir" && ac_dir=.
2478   $as_executable_p "$ac_dir/$ac_word" || continue
2479 ac_cv_prog_ETAGS="$ac_prog"
2480 echo "$as_me:2480: found $ac_dir/$ac_word" >&5
2481 break
2482 done
2483
2484 fi
2485 fi
2486 ETAGS=$ac_cv_prog_ETAGS
2487 if test -n "$ETAGS"; then
2488   echo "$as_me:2488: result: $ETAGS" >&5
2489 echo "${ECHO_T}$ETAGS" >&6
2490 else
2491   echo "$as_me:2491: result: no" >&5
2492 echo "${ECHO_T}no" >&6
2493 fi
2494
2495   test -n "$ETAGS" && break
2496 done
2497
2498 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2499 set dummy ${CTAGS:-ctags}; ac_word=$2
2500 echo "$as_me:2500: checking for $ac_word" >&5
2501 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2502 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2503   echo $ECHO_N "(cached) $ECHO_C" >&6
2504 else
2505   if test -n "$MAKE_LOWER_TAGS"; then
2506   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2507 else
2508   ac_save_IFS=$IFS; IFS=$ac_path_separator
2509 ac_dummy="$PATH"
2510 for ac_dir in $ac_dummy; do
2511   IFS=$ac_save_IFS
2512   test -z "$ac_dir" && ac_dir=.
2513   $as_executable_p "$ac_dir/$ac_word" || continue
2514 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2515 echo "$as_me:2515: found $ac_dir/$ac_word" >&5
2516 break
2517 done
2518
2519   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2520 fi
2521 fi
2522 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2523 if test -n "$MAKE_LOWER_TAGS"; then
2524   echo "$as_me:2524: result: $MAKE_LOWER_TAGS" >&5
2525 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2526 else
2527   echo "$as_me:2527: result: no" >&5
2528 echo "${ECHO_T}no" >&6
2529 fi
2530
2531 if test "$cf_cv_mixedcase" = yes ; then
2532         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2533 set dummy ${ETAGS:-etags}; ac_word=$2
2534 echo "$as_me:2534: checking for $ac_word" >&5
2535 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2536 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2537   echo $ECHO_N "(cached) $ECHO_C" >&6
2538 else
2539   if test -n "$MAKE_UPPER_TAGS"; then
2540   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2541 else
2542   ac_save_IFS=$IFS; IFS=$ac_path_separator
2543 ac_dummy="$PATH"
2544 for ac_dir in $ac_dummy; do
2545   IFS=$ac_save_IFS
2546   test -z "$ac_dir" && ac_dir=.
2547   $as_executable_p "$ac_dir/$ac_word" || continue
2548 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2549 echo "$as_me:2549: found $ac_dir/$ac_word" >&5
2550 break
2551 done
2552
2553   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2554 fi
2555 fi
2556 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2557 if test -n "$MAKE_UPPER_TAGS"; then
2558   echo "$as_me:2558: result: $MAKE_UPPER_TAGS" >&5
2559 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2560 else
2561   echo "$as_me:2561: result: no" >&5
2562 echo "${ECHO_T}no" >&6
2563 fi
2564
2565 else
2566         MAKE_UPPER_TAGS=no
2567 fi
2568
2569 if test "$MAKE_UPPER_TAGS" = yes ; then
2570         MAKE_UPPER_TAGS=
2571 else
2572         MAKE_UPPER_TAGS="#"
2573 fi
2574
2575 if test "$MAKE_LOWER_TAGS" = yes ; then
2576         MAKE_LOWER_TAGS=
2577 else
2578         MAKE_LOWER_TAGS="#"
2579 fi
2580
2581 echo "$as_me:2581: checking if -lm needed for math functions" >&5
2582 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2583 if test "${cf_cv_need_libm+set}" = set; then
2584   echo $ECHO_N "(cached) $ECHO_C" >&6
2585 else
2586
2587         cat >conftest.$ac_ext <<_ACEOF
2588 #line 2588 "configure"
2589 #include "confdefs.h"
2590
2591         #include <stdio.h>
2592         #include <math.h>
2593
2594 int
2595 main ()
2596 {
2597 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2598   ;
2599   return 0;
2600 }
2601 _ACEOF
2602 rm -f conftest.$ac_objext conftest$ac_exeext
2603 if { (eval echo "$as_me:2603: \"$ac_link\"") >&5
2604   (eval $ac_link) 2>&5
2605   ac_status=$?
2606   echo "$as_me:2606: \$? = $ac_status" >&5
2607   (exit $ac_status); } &&
2608          { ac_try='test -s conftest$ac_exeext'
2609   { (eval echo "$as_me:2609: \"$ac_try\"") >&5
2610   (eval $ac_try) 2>&5
2611   ac_status=$?
2612   echo "$as_me:2612: \$? = $ac_status" >&5
2613   (exit $ac_status); }; }; then
2614   cf_cv_need_libm=no
2615 else
2616   echo "$as_me: failed program was:" >&5
2617 cat conftest.$ac_ext >&5
2618 cf_cv_need_libm=yes
2619 fi
2620 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2621 fi
2622 echo "$as_me:2622: result: $cf_cv_need_libm" >&5
2623 echo "${ECHO_T}$cf_cv_need_libm" >&6
2624 if test "$cf_cv_need_libm" = yes
2625 then
2626 MATH_LIB=-lm
2627 fi
2628
2629 top_builddir=`pwd`
2630
2631 CC_G_OPT="-g"
2632 CC_SHARED_OPTS=unknown
2633 CPPFLAGS="$CPPFLAGS"
2634 DFT_DEP_SUFFIX=""
2635 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2636 DFT_UPR_MODEL="NORMAL"
2637 LD="ld"
2638 LDFLAGS_SHARED=""
2639 LDFLAGS_STATIC=""
2640 LD_MODEL=""
2641 LD_SHARED_OPTS=""
2642 LIBTOOL=""
2643 LIB_CLEAN=""
2644 LIB_COMPILE=""
2645 LIB_LINK='${CC}'
2646 LINK_TESTS=""
2647 LOCAL_LDFLAGS=""
2648 PTHREAD="-lm"
2649 TEST_ARGS=""
2650 TEST_DEPS=""
2651 TEST_LIBS=""
2652 TINFO_LDFLAGS=''
2653 TINFO_LIBS='$(LIBS_CURSES)'
2654 cf_cv_abi_version=""
2655 cf_cv_rel_version=""
2656 includesubdir=""
2657
2658 cf_cv_screen=curses
2659 cf_cv_libtype=
2660
2661 if test "$GCC" = yes
2662 then
2663 cat > conftest.i <<EOF
2664 #ifndef GCC_PRINTF
2665 #define GCC_PRINTF 0
2666 #endif
2667 #ifndef GCC_SCANF
2668 #define GCC_SCANF 0
2669 #endif
2670 #ifndef GCC_NORETURN
2671 #define GCC_NORETURN /* nothing */
2672 #endif
2673 #ifndef GCC_UNUSED
2674 #define GCC_UNUSED /* nothing */
2675 #endif
2676 EOF
2677 if test "$GCC" = yes
2678 then
2679         { echo "$as_me:2679: checking for $CC __attribute__ directives..." >&5
2680 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2681 cat > conftest.$ac_ext <<EOF
2682 #line 2682 "${as_me:-configure}"
2683 #include "confdefs.h"
2684 #include "conftest.h"
2685 #include "conftest.i"
2686 #if     GCC_PRINTF
2687 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2688 #else
2689 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2690 #endif
2691 #if     GCC_SCANF
2692 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2693 #else
2694 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2695 #endif
2696 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2697 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2698 extern void foo(void) GCC_NORETURN;
2699 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2700 EOF
2701         cf_printf_attribute=no
2702         cf_scanf_attribute=no
2703         for cf_attribute in scanf printf unused noreturn
2704         do
2705
2706 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2707
2708                 cf_directive="__attribute__(($cf_attribute))"
2709                 echo "checking for $CC $cf_directive" 1>&5
2710
2711                 case $cf_attribute in #(vi
2712                 printf) #(vi
2713                         cf_printf_attribute=yes
2714                         cat >conftest.h <<EOF
2715 #define GCC_$cf_ATTRIBUTE 1
2716 EOF
2717                         ;;
2718                 scanf) #(vi
2719                         cf_scanf_attribute=yes
2720                         cat >conftest.h <<EOF
2721 #define GCC_$cf_ATTRIBUTE 1
2722 EOF
2723                         ;;
2724                 *) #(vi
2725                         cat >conftest.h <<EOF
2726 #define GCC_$cf_ATTRIBUTE $cf_directive
2727 EOF
2728                         ;;
2729                 esac
2730
2731                 if { (eval echo "$as_me:2731: \"$ac_compile\"") >&5
2732   (eval $ac_compile) 2>&5
2733   ac_status=$?
2734   echo "$as_me:2734: \$? = $ac_status" >&5
2735   (exit $ac_status); }; then
2736                         test -n "$verbose" && echo "$as_me:2736: result: ... $cf_attribute" >&5
2737 echo "${ECHO_T}... $cf_attribute" >&6
2738                         cat conftest.h >>confdefs.h
2739                         case $cf_attribute in #(vi
2740                         noreturn) #(vi
2741
2742 cat >>confdefs.h <<EOF
2743 #define GCC_NORETURN $cf_directive
2744 EOF
2745
2746                                 ;;
2747                         printf) #(vi
2748                                 cf_value='/* nothing */'
2749                                 if test "$cf_printf_attribute" != no ; then
2750                                         cf_value='__attribute__((format(printf,fmt,var)))'
2751
2752 cat >>confdefs.h <<\EOF
2753 #define GCC_PRINTF 1
2754 EOF
2755
2756                                 fi
2757
2758 cat >>confdefs.h <<EOF
2759 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2760 EOF
2761
2762                                 ;;
2763                         scanf) #(vi
2764                                 cf_value='/* nothing */'
2765                                 if test "$cf_scanf_attribute" != no ; then
2766                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2767
2768 cat >>confdefs.h <<\EOF
2769 #define GCC_SCANF 1
2770 EOF
2771
2772                                 fi
2773
2774 cat >>confdefs.h <<EOF
2775 #define GCC_SCANFLIKE(fmt,var) $cf_value
2776 EOF
2777
2778                                 ;;
2779                         unused) #(vi
2780
2781 cat >>confdefs.h <<EOF
2782 #define GCC_UNUSED $cf_directive
2783 EOF
2784
2785                                 ;;
2786                         esac
2787                 fi
2788         done
2789 else
2790         fgrep define conftest.i >>confdefs.h
2791 fi
2792 rm -rf conftest*
2793 fi
2794
2795 cf_XOPEN_SOURCE=500
2796 cf_POSIX_C_SOURCE=199506L
2797 cf_xopen_source=
2798
2799 case $host_os in #(vi
2800 aix[4-7]*) #(vi
2801         cf_xopen_source="-D_ALL_SOURCE"
2802         ;;
2803 cygwin|msys) #(vi
2804         cf_XOPEN_SOURCE=600
2805         ;;
2806 darwin[0-8].*) #(vi
2807         cf_xopen_source="-D_APPLE_C_SOURCE"
2808         ;;
2809 darwin*) #(vi
2810         cf_xopen_source="-D_DARWIN_C_SOURCE"
2811         cf_XOPEN_SOURCE=
2812         ;;
2813 freebsd*|dragonfly*) #(vi
2814         # 5.x headers associate
2815         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2816         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2817         cf_POSIX_C_SOURCE=200112L
2818         cf_XOPEN_SOURCE=600
2819         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2820         ;;
2821 hpux11*) #(vi
2822         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2823         ;;
2824 hpux*) #(vi
2825         cf_xopen_source="-D_HPUX_SOURCE"
2826         ;;
2827 irix[56].*) #(vi
2828         cf_xopen_source="-D_SGI_SOURCE"
2829         cf_XOPEN_SOURCE=
2830         ;;
2831 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
2832
2833 echo "$as_me:2833: checking if we must define _GNU_SOURCE" >&5
2834 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2835 if test "${cf_cv_gnu_source+set}" = set; then
2836   echo $ECHO_N "(cached) $ECHO_C" >&6
2837 else
2838
2839 cat >conftest.$ac_ext <<_ACEOF
2840 #line 2840 "configure"
2841 #include "confdefs.h"
2842 #include <sys/types.h>
2843 int
2844 main ()
2845 {
2846
2847 #ifndef _XOPEN_SOURCE
2848 make an error
2849 #endif
2850   ;
2851   return 0;
2852 }
2853 _ACEOF
2854 rm -f conftest.$ac_objext
2855 if { (eval echo "$as_me:2855: \"$ac_compile\"") >&5
2856   (eval $ac_compile) 2>&5
2857   ac_status=$?
2858   echo "$as_me:2858: \$? = $ac_status" >&5
2859   (exit $ac_status); } &&
2860          { ac_try='test -s conftest.$ac_objext'
2861   { (eval echo "$as_me:2861: \"$ac_try\"") >&5
2862   (eval $ac_try) 2>&5
2863   ac_status=$?
2864   echo "$as_me:2864: \$? = $ac_status" >&5
2865   (exit $ac_status); }; }; then
2866   cf_cv_gnu_source=no
2867 else
2868   echo "$as_me: failed program was:" >&5
2869 cat conftest.$ac_ext >&5
2870 cf_save="$CPPFLAGS"
2871          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2872          cat >conftest.$ac_ext <<_ACEOF
2873 #line 2873 "configure"
2874 #include "confdefs.h"
2875 #include <sys/types.h>
2876 int
2877 main ()
2878 {
2879
2880 #ifdef _XOPEN_SOURCE
2881 make an error
2882 #endif
2883   ;
2884   return 0;
2885 }
2886 _ACEOF
2887 rm -f conftest.$ac_objext
2888 if { (eval echo "$as_me:2888: \"$ac_compile\"") >&5
2889   (eval $ac_compile) 2>&5
2890   ac_status=$?
2891   echo "$as_me:2891: \$? = $ac_status" >&5
2892   (exit $ac_status); } &&
2893          { ac_try='test -s conftest.$ac_objext'
2894   { (eval echo "$as_me:2894: \"$ac_try\"") >&5
2895   (eval $ac_try) 2>&5
2896   ac_status=$?
2897   echo "$as_me:2897: \$? = $ac_status" >&5
2898   (exit $ac_status); }; }; then
2899   cf_cv_gnu_source=no
2900 else
2901   echo "$as_me: failed program was:" >&5
2902 cat conftest.$ac_ext >&5
2903 cf_cv_gnu_source=yes
2904 fi
2905 rm -f conftest.$ac_objext conftest.$ac_ext
2906         CPPFLAGS="$cf_save"
2907
2908 fi
2909 rm -f conftest.$ac_objext conftest.$ac_ext
2910
2911 fi
2912 echo "$as_me:2912: result: $cf_cv_gnu_source" >&5
2913 echo "${ECHO_T}$cf_cv_gnu_source" >&6
2914 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2915
2916         ;;
2917 minix*) #(vi
2918         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
2919         ;;
2920 mirbsd*) #(vi
2921         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
2922         cf_XOPEN_SOURCE=
2923
2924 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2925
2926 cf_save_CFLAGS="$CFLAGS"
2927 cf_save_CPPFLAGS="$CPPFLAGS"
2928
2929 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2930         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2931                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2932
2933 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2934         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2935                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2936
2937 echo "$as_me:2937: checking if we should define _POSIX_C_SOURCE" >&5
2938 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
2939 if test "${cf_cv_posix_c_source+set}" = set; then
2940   echo $ECHO_N "(cached) $ECHO_C" >&6
2941 else
2942
2943 echo "${as_me:-configure}:2943: testing if the symbol is already defined go no further ..." 1>&5
2944
2945         cat >conftest.$ac_ext <<_ACEOF
2946 #line 2946 "configure"
2947 #include "confdefs.h"
2948 #include <sys/types.h>
2949 int
2950 main ()
2951 {
2952
2953 #ifndef _POSIX_C_SOURCE
2954 make an error
2955 #endif
2956   ;
2957   return 0;
2958 }
2959 _ACEOF
2960 rm -f conftest.$ac_objext
2961 if { (eval echo "$as_me:2961: \"$ac_compile\"") >&5
2962   (eval $ac_compile) 2>&5
2963   ac_status=$?
2964   echo "$as_me:2964: \$? = $ac_status" >&5
2965   (exit $ac_status); } &&
2966          { ac_try='test -s conftest.$ac_objext'
2967   { (eval echo "$as_me:2967: \"$ac_try\"") >&5
2968   (eval $ac_try) 2>&5
2969   ac_status=$?
2970   echo "$as_me:2970: \$? = $ac_status" >&5
2971   (exit $ac_status); }; }; then
2972   cf_cv_posix_c_source=no
2973 else
2974   echo "$as_me: failed program was:" >&5
2975 cat conftest.$ac_ext >&5
2976 cf_want_posix_source=no
2977          case .$cf_POSIX_C_SOURCE in #(vi
2978          .[12]??*) #(vi
2979                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2980                 ;;
2981          .2) #(vi
2982                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2983                 cf_want_posix_source=yes
2984                 ;;
2985          .*)
2986                 cf_want_posix_source=yes
2987                 ;;
2988          esac
2989          if test "$cf_want_posix_source" = yes ; then
2990                 cat >conftest.$ac_ext <<_ACEOF
2991 #line 2991 "configure"
2992 #include "confdefs.h"
2993 #include <sys/types.h>
2994 int
2995 main ()
2996 {
2997
2998 #ifdef _POSIX_SOURCE
2999 make an error
3000 #endif
3001   ;
3002   return 0;
3003 }
3004 _ACEOF
3005 rm -f conftest.$ac_objext
3006 if { (eval echo "$as_me:3006: \"$ac_compile\"") >&5
3007   (eval $ac_compile) 2>&5
3008   ac_status=$?
3009   echo "$as_me:3009: \$? = $ac_status" >&5
3010   (exit $ac_status); } &&
3011          { ac_try='test -s conftest.$ac_objext'
3012   { (eval echo "$as_me:3012: \"$ac_try\"") >&5
3013   (eval $ac_try) 2>&5
3014   ac_status=$?
3015   echo "$as_me:3015: \$? = $ac_status" >&5
3016   (exit $ac_status); }; }; then
3017   :
3018 else
3019   echo "$as_me: failed program was:" >&5
3020 cat conftest.$ac_ext >&5
3021 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3022 fi
3023 rm -f conftest.$ac_objext conftest.$ac_ext
3024          fi
3025
3026 echo "${as_me:-configure}:3026: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3027
3028          CFLAGS="$cf_trim_CFLAGS"
3029          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3030
3031 echo "${as_me:-configure}:3031: testing if the second compile does not leave our definition intact error ..." 1>&5
3032
3033          cat >conftest.$ac_ext <<_ACEOF
3034 #line 3034 "configure"
3035 #include "confdefs.h"
3036 #include <sys/types.h>
3037 int
3038 main ()
3039 {
3040
3041 #ifndef _POSIX_C_SOURCE
3042 make an error
3043 #endif
3044   ;
3045   return 0;
3046 }
3047 _ACEOF
3048 rm -f conftest.$ac_objext
3049 if { (eval echo "$as_me:3049: \"$ac_compile\"") >&5
3050   (eval $ac_compile) 2>&5
3051   ac_status=$?
3052   echo "$as_me:3052: \$? = $ac_status" >&5
3053   (exit $ac_status); } &&
3054          { ac_try='test -s conftest.$ac_objext'
3055   { (eval echo "$as_me:3055: \"$ac_try\"") >&5
3056   (eval $ac_try) 2>&5
3057   ac_status=$?
3058   echo "$as_me:3058: \$? = $ac_status" >&5
3059   (exit $ac_status); }; }; then
3060   :
3061 else
3062   echo "$as_me: failed program was:" >&5
3063 cat conftest.$ac_ext >&5
3064 cf_cv_posix_c_source=no
3065 fi
3066 rm -f conftest.$ac_objext conftest.$ac_ext
3067          CFLAGS="$cf_save_CFLAGS"
3068          CPPFLAGS="$cf_save_CPPFLAGS"
3069
3070 fi
3071 rm -f conftest.$ac_objext conftest.$ac_ext
3072
3073 fi
3074 echo "$as_me:3074: result: $cf_cv_posix_c_source" >&5
3075 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3076
3077 if test "$cf_cv_posix_c_source" != no ; then
3078         CFLAGS="$cf_trim_CFLAGS"
3079         CPPFLAGS="$cf_trim_CPPFLAGS"
3080
3081 cf_fix_cppflags=no
3082 cf_new_cflags=
3083 cf_new_cppflags=
3084 cf_new_extra_cppflags=
3085
3086 for cf_add_cflags in $cf_cv_posix_c_source
3087 do
3088 case $cf_fix_cppflags in
3089 no)
3090         case $cf_add_cflags in #(vi
3091         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3092                 case $cf_add_cflags in
3093                 -D*)
3094                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3095
3096                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3097                                 && test -z "${cf_tst_cflags}" \
3098                                 && cf_fix_cppflags=yes
3099
3100                         if test $cf_fix_cppflags = yes ; then
3101                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3102                                 continue
3103                         elif test "${cf_tst_cflags}" = "\"'" ; then
3104                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3105                                 continue
3106                         fi
3107                         ;;
3108                 esac
3109                 case "$CPPFLAGS" in
3110                 *$cf_add_cflags) #(vi
3111                         ;;
3112                 *) #(vi
3113                         case $cf_add_cflags in #(vi
3114                         -D*)
3115                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3116
3117 CPPFLAGS=`echo "$CPPFLAGS" | \
3118         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3119                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3120
3121                                 ;;
3122                         esac
3123                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3124                         ;;
3125                 esac
3126                 ;;
3127         *)
3128                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3129                 ;;
3130         esac
3131         ;;
3132 yes)
3133         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3134
3135         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3136
3137         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3138                 && test -z "${cf_tst_cflags}" \
3139                 && cf_fix_cppflags=no
3140         ;;
3141 esac
3142 done
3143
3144 if test -n "$cf_new_cflags" ; then
3145
3146         CFLAGS="$CFLAGS $cf_new_cflags"
3147 fi
3148
3149 if test -n "$cf_new_cppflags" ; then
3150
3151         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3152 fi
3153
3154 if test -n "$cf_new_extra_cppflags" ; then
3155
3156         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3157 fi
3158
3159 fi
3160
3161         ;;
3162 netbsd*) #(vi
3163         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3164         ;;
3165 openbsd[4-9]*) #(vi
3166         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3167         cf_xopen_source="-D_BSD_SOURCE"
3168         cf_XOPEN_SOURCE=600
3169         ;;
3170 openbsd*) #(vi
3171         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3172         ;;
3173 osf[45]*) #(vi
3174         cf_xopen_source="-D_OSF_SOURCE"
3175         ;;
3176 nto-qnx*) #(vi
3177         cf_xopen_source="-D_QNX_SOURCE"
3178         ;;
3179 sco*) #(vi
3180         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3181         ;;
3182 solaris2.*) #(vi
3183         cf_xopen_source="-D__EXTENSIONS__"
3184         cf_cv_xopen_source=broken
3185         ;;
3186 sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3187         cf_XOPEN_SOURCE=
3188         cf_POSIX_C_SOURCE=
3189         ;;
3190 *)
3191
3192 echo "$as_me:3192: checking if we should define _XOPEN_SOURCE" >&5
3193 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3194 if test "${cf_cv_xopen_source+set}" = set; then
3195   echo $ECHO_N "(cached) $ECHO_C" >&6
3196 else
3197
3198         cat >conftest.$ac_ext <<_ACEOF
3199 #line 3199 "configure"
3200 #include "confdefs.h"
3201
3202 #include <stdlib.h>
3203 #include <string.h>
3204 #include <sys/types.h>
3205
3206 int
3207 main ()
3208 {
3209
3210 #ifndef _XOPEN_SOURCE
3211 make an error
3212 #endif
3213   ;
3214   return 0;
3215 }
3216 _ACEOF
3217 rm -f conftest.$ac_objext
3218 if { (eval echo "$as_me:3218: \"$ac_compile\"") >&5
3219   (eval $ac_compile) 2>&5
3220   ac_status=$?
3221   echo "$as_me:3221: \$? = $ac_status" >&5
3222   (exit $ac_status); } &&
3223          { ac_try='test -s conftest.$ac_objext'
3224   { (eval echo "$as_me:3224: \"$ac_try\"") >&5
3225   (eval $ac_try) 2>&5
3226   ac_status=$?
3227   echo "$as_me:3227: \$? = $ac_status" >&5
3228   (exit $ac_status); }; }; then
3229   cf_cv_xopen_source=no
3230 else
3231   echo "$as_me: failed program was:" >&5
3232 cat conftest.$ac_ext >&5
3233 cf_save="$CPPFLAGS"
3234          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3235          cat >conftest.$ac_ext <<_ACEOF
3236 #line 3236 "configure"
3237 #include "confdefs.h"
3238
3239 #include <stdlib.h>
3240 #include <string.h>
3241 #include <sys/types.h>
3242
3243 int
3244 main ()
3245 {
3246
3247 #ifdef _XOPEN_SOURCE
3248 make an error
3249 #endif
3250   ;
3251   return 0;
3252 }
3253 _ACEOF
3254 rm -f conftest.$ac_objext
3255 if { (eval echo "$as_me:3255: \"$ac_compile\"") >&5
3256   (eval $ac_compile) 2>&5
3257   ac_status=$?
3258   echo "$as_me:3258: \$? = $ac_status" >&5
3259   (exit $ac_status); } &&
3260          { ac_try='test -s conftest.$ac_objext'
3261   { (eval echo "$as_me:3261: \"$ac_try\"") >&5
3262   (eval $ac_try) 2>&5
3263   ac_status=$?
3264   echo "$as_me:3264: \$? = $ac_status" >&5
3265   (exit $ac_status); }; }; then
3266   cf_cv_xopen_source=no
3267 else
3268   echo "$as_me: failed program was:" >&5
3269 cat conftest.$ac_ext >&5
3270 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3271 fi
3272 rm -f conftest.$ac_objext conftest.$ac_ext
3273         CPPFLAGS="$cf_save"
3274
3275 fi
3276 rm -f conftest.$ac_objext conftest.$ac_ext
3277
3278 fi
3279 echo "$as_me:3279: result: $cf_cv_xopen_source" >&5
3280 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3281
3282 if test "$cf_cv_xopen_source" != no ; then
3283
3284 CFLAGS=`echo "$CFLAGS" | \
3285         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3286                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3287
3288 CPPFLAGS=`echo "$CPPFLAGS" | \
3289         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3290                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3291
3292         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3293
3294 cf_fix_cppflags=no
3295 cf_new_cflags=
3296 cf_new_cppflags=
3297 cf_new_extra_cppflags=
3298
3299 for cf_add_cflags in $cf_temp_xopen_source
3300 do
3301 case $cf_fix_cppflags in
3302 no)
3303         case $cf_add_cflags in #(vi
3304         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3305                 case $cf_add_cflags in
3306                 -D*)
3307                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3308
3309                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3310                                 && test -z "${cf_tst_cflags}" \
3311                                 && cf_fix_cppflags=yes
3312
3313                         if test $cf_fix_cppflags = yes ; then
3314                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3315                                 continue
3316                         elif test "${cf_tst_cflags}" = "\"'" ; then
3317                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3318                                 continue
3319                         fi
3320                         ;;
3321                 esac
3322                 case "$CPPFLAGS" in
3323                 *$cf_add_cflags) #(vi
3324                         ;;
3325                 *) #(vi
3326                         case $cf_add_cflags in #(vi
3327                         -D*)
3328                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3329
3330 CPPFLAGS=`echo "$CPPFLAGS" | \
3331         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3332                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3333
3334                                 ;;
3335                         esac
3336                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3337                         ;;
3338                 esac
3339                 ;;
3340         *)
3341                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3342                 ;;
3343         esac
3344         ;;
3345 yes)
3346         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3347
3348         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3349
3350         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3351                 && test -z "${cf_tst_cflags}" \
3352                 && cf_fix_cppflags=no
3353         ;;
3354 esac
3355 done
3356
3357 if test -n "$cf_new_cflags" ; then
3358
3359         CFLAGS="$CFLAGS $cf_new_cflags"
3360 fi
3361
3362 if test -n "$cf_new_cppflags" ; then
3363
3364         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3365 fi
3366
3367 if test -n "$cf_new_extra_cppflags" ; then
3368
3369         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3370 fi
3371
3372 fi
3373
3374 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3375
3376 cf_save_CFLAGS="$CFLAGS"
3377 cf_save_CPPFLAGS="$CPPFLAGS"
3378
3379 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3380         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3381                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3382
3383 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3384         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3385                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3386
3387 echo "$as_me:3387: checking if we should define _POSIX_C_SOURCE" >&5
3388 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3389 if test "${cf_cv_posix_c_source+set}" = set; then
3390   echo $ECHO_N "(cached) $ECHO_C" >&6
3391 else
3392
3393 echo "${as_me:-configure}:3393: testing if the symbol is already defined go no further ..." 1>&5
3394
3395         cat >conftest.$ac_ext <<_ACEOF
3396 #line 3396 "configure"
3397 #include "confdefs.h"
3398 #include <sys/types.h>
3399 int
3400 main ()
3401 {
3402
3403 #ifndef _POSIX_C_SOURCE
3404 make an error
3405 #endif
3406   ;
3407   return 0;
3408 }
3409 _ACEOF
3410 rm -f conftest.$ac_objext
3411 if { (eval echo "$as_me:3411: \"$ac_compile\"") >&5
3412   (eval $ac_compile) 2>&5
3413   ac_status=$?
3414   echo "$as_me:3414: \$? = $ac_status" >&5
3415   (exit $ac_status); } &&
3416          { ac_try='test -s conftest.$ac_objext'
3417   { (eval echo "$as_me:3417: \"$ac_try\"") >&5
3418   (eval $ac_try) 2>&5
3419   ac_status=$?
3420   echo "$as_me:3420: \$? = $ac_status" >&5
3421   (exit $ac_status); }; }; then
3422   cf_cv_posix_c_source=no
3423 else
3424   echo "$as_me: failed program was:" >&5
3425 cat conftest.$ac_ext >&5
3426 cf_want_posix_source=no
3427          case .$cf_POSIX_C_SOURCE in #(vi
3428          .[12]??*) #(vi
3429                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3430                 ;;
3431          .2) #(vi
3432                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3433                 cf_want_posix_source=yes
3434                 ;;
3435          .*)
3436                 cf_want_posix_source=yes
3437                 ;;
3438          esac
3439          if test "$cf_want_posix_source" = yes ; then
3440                 cat >conftest.$ac_ext <<_ACEOF
3441 #line 3441 "configure"
3442 #include "confdefs.h"
3443 #include <sys/types.h>
3444 int
3445 main ()
3446 {
3447
3448 #ifdef _POSIX_SOURCE
3449 make an error
3450 #endif
3451   ;
3452   return 0;
3453 }
3454 _ACEOF
3455 rm -f conftest.$ac_objext
3456 if { (eval echo "$as_me:3456: \"$ac_compile\"") >&5
3457   (eval $ac_compile) 2>&5
3458   ac_status=$?
3459   echo "$as_me:3459: \$? = $ac_status" >&5
3460   (exit $ac_status); } &&
3461          { ac_try='test -s conftest.$ac_objext'
3462   { (eval echo "$as_me:3462: \"$ac_try\"") >&5
3463   (eval $ac_try) 2>&5
3464   ac_status=$?
3465   echo "$as_me:3465: \$? = $ac_status" >&5
3466   (exit $ac_status); }; }; then
3467   :
3468 else
3469   echo "$as_me: failed program was:" >&5
3470 cat conftest.$ac_ext >&5
3471 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3472 fi
3473 rm -f conftest.$ac_objext conftest.$ac_ext
3474          fi
3475
3476 echo "${as_me:-configure}:3476: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3477
3478          CFLAGS="$cf_trim_CFLAGS"
3479          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3480
3481 echo "${as_me:-configure}:3481: testing if the second compile does not leave our definition intact error ..." 1>&5
3482
3483          cat >conftest.$ac_ext <<_ACEOF
3484 #line 3484 "configure"
3485 #include "confdefs.h"
3486 #include <sys/types.h>
3487 int
3488 main ()
3489 {
3490
3491 #ifndef _POSIX_C_SOURCE
3492 make an error
3493 #endif
3494   ;
3495   return 0;
3496 }
3497 _ACEOF
3498 rm -f conftest.$ac_objext
3499 if { (eval echo "$as_me:3499: \"$ac_compile\"") >&5
3500   (eval $ac_compile) 2>&5
3501   ac_status=$?
3502   echo "$as_me:3502: \$? = $ac_status" >&5
3503   (exit $ac_status); } &&
3504          { ac_try='test -s conftest.$ac_objext'
3505   { (eval echo "$as_me:3505: \"$ac_try\"") >&5
3506   (eval $ac_try) 2>&5
3507   ac_status=$?
3508   echo "$as_me:3508: \$? = $ac_status" >&5
3509   (exit $ac_status); }; }; then
3510   :
3511 else
3512   echo "$as_me: failed program was:" >&5
3513 cat conftest.$ac_ext >&5
3514 cf_cv_posix_c_source=no
3515 fi
3516 rm -f conftest.$ac_objext conftest.$ac_ext
3517          CFLAGS="$cf_save_CFLAGS"
3518          CPPFLAGS="$cf_save_CPPFLAGS"
3519
3520 fi
3521 rm -f conftest.$ac_objext conftest.$ac_ext
3522
3523 fi
3524 echo "$as_me:3524: result: $cf_cv_posix_c_source" >&5
3525 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3526
3527 if test "$cf_cv_posix_c_source" != no ; then
3528         CFLAGS="$cf_trim_CFLAGS"
3529         CPPFLAGS="$cf_trim_CPPFLAGS"
3530
3531 cf_fix_cppflags=no
3532 cf_new_cflags=
3533 cf_new_cppflags=
3534 cf_new_extra_cppflags=
3535
3536 for cf_add_cflags in $cf_cv_posix_c_source
3537 do
3538 case $cf_fix_cppflags in
3539 no)
3540         case $cf_add_cflags in #(vi
3541         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3542                 case $cf_add_cflags in
3543                 -D*)
3544                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3545
3546                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3547                                 && test -z "${cf_tst_cflags}" \
3548                                 && cf_fix_cppflags=yes
3549
3550                         if test $cf_fix_cppflags = yes ; then
3551                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3552                                 continue
3553                         elif test "${cf_tst_cflags}" = "\"'" ; then
3554                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3555                                 continue
3556                         fi
3557                         ;;
3558                 esac
3559                 case "$CPPFLAGS" in
3560                 *$cf_add_cflags) #(vi
3561                         ;;
3562                 *) #(vi
3563                         case $cf_add_cflags in #(vi
3564                         -D*)
3565                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3566
3567 CPPFLAGS=`echo "$CPPFLAGS" | \
3568         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3569                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3570
3571                                 ;;
3572                         esac
3573                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3574                         ;;
3575                 esac
3576                 ;;
3577         *)
3578                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3579                 ;;
3580         esac
3581         ;;
3582 yes)
3583         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3584
3585         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3586
3587         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3588                 && test -z "${cf_tst_cflags}" \
3589                 && cf_fix_cppflags=no
3590         ;;
3591 esac
3592 done
3593
3594 if test -n "$cf_new_cflags" ; then
3595
3596         CFLAGS="$CFLAGS $cf_new_cflags"
3597 fi
3598
3599 if test -n "$cf_new_cppflags" ; then
3600
3601         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3602 fi
3603
3604 if test -n "$cf_new_extra_cppflags" ; then
3605
3606         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3607 fi
3608
3609 fi
3610
3611         ;;
3612 esac
3613
3614 if test -n "$cf_xopen_source" ; then
3615
3616 cf_fix_cppflags=no
3617 cf_new_cflags=
3618 cf_new_cppflags=
3619 cf_new_extra_cppflags=
3620
3621 for cf_add_cflags in $cf_xopen_source
3622 do
3623 case $cf_fix_cppflags in
3624 no)
3625         case $cf_add_cflags in #(vi
3626         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3627                 case $cf_add_cflags in
3628                 -D*)
3629                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3630
3631                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3632                                 && test -z "${cf_tst_cflags}" \
3633                                 && cf_fix_cppflags=yes
3634
3635                         if test $cf_fix_cppflags = yes ; then
3636                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3637                                 continue
3638                         elif test "${cf_tst_cflags}" = "\"'" ; then
3639                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3640                                 continue
3641                         fi
3642                         ;;
3643                 esac
3644                 case "$CPPFLAGS" in
3645                 *$cf_add_cflags) #(vi
3646                         ;;
3647                 *) #(vi
3648                         case $cf_add_cflags in #(vi
3649                         -D*)
3650                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3651
3652 CPPFLAGS=`echo "$CPPFLAGS" | \
3653         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3654                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3655
3656                                 ;;
3657                         esac
3658                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3659                         ;;
3660                 esac
3661                 ;;
3662         *)
3663                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3664                 ;;
3665         esac
3666         ;;
3667 yes)
3668         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3669
3670         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3671
3672         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3673                 && test -z "${cf_tst_cflags}" \
3674                 && cf_fix_cppflags=no
3675         ;;
3676 esac
3677 done
3678
3679 if test -n "$cf_new_cflags" ; then
3680         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
3681
3682 echo "${as_me:-configure}:3682: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
3683
3684         CFLAGS="$CFLAGS $cf_new_cflags"
3685 fi
3686
3687 if test -n "$cf_new_cppflags" ; then
3688         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
3689
3690 echo "${as_me:-configure}:3690: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
3691
3692         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3693 fi
3694
3695 if test -n "$cf_new_extra_cppflags" ; then
3696         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
3697
3698 echo "${as_me:-configure}:3698: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
3699
3700         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3701 fi
3702
3703 fi
3704
3705 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3706         echo "$as_me:3706: checking if _XOPEN_SOURCE really is set" >&5
3707 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3708         cat >conftest.$ac_ext <<_ACEOF
3709 #line 3709 "configure"
3710 #include "confdefs.h"
3711 #include <stdlib.h>
3712 int
3713 main ()
3714 {
3715
3716 #ifndef _XOPEN_SOURCE
3717 make an error
3718 #endif
3719   ;
3720   return 0;
3721 }
3722 _ACEOF
3723 rm -f conftest.$ac_objext
3724 if { (eval echo "$as_me:3724: \"$ac_compile\"") >&5
3725   (eval $ac_compile) 2>&5
3726   ac_status=$?
3727   echo "$as_me:3727: \$? = $ac_status" >&5
3728   (exit $ac_status); } &&
3729          { ac_try='test -s conftest.$ac_objext'
3730   { (eval echo "$as_me:3730: \"$ac_try\"") >&5
3731   (eval $ac_try) 2>&5
3732   ac_status=$?
3733   echo "$as_me:3733: \$? = $ac_status" >&5
3734   (exit $ac_status); }; }; then
3735   cf_XOPEN_SOURCE_set=yes
3736 else
3737   echo "$as_me: failed program was:" >&5
3738 cat conftest.$ac_ext >&5
3739 cf_XOPEN_SOURCE_set=no
3740 fi
3741 rm -f conftest.$ac_objext conftest.$ac_ext
3742         echo "$as_me:3742: result: $cf_XOPEN_SOURCE_set" >&5
3743 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3744         if test $cf_XOPEN_SOURCE_set = yes
3745         then
3746                 cat >conftest.$ac_ext <<_ACEOF
3747 #line 3747 "configure"
3748 #include "confdefs.h"
3749 #include <stdlib.h>
3750 int
3751 main ()
3752 {
3753
3754 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3755 make an error
3756 #endif
3757   ;
3758   return 0;
3759 }
3760 _ACEOF
3761 rm -f conftest.$ac_objext
3762 if { (eval echo "$as_me:3762: \"$ac_compile\"") >&5
3763   (eval $ac_compile) 2>&5
3764   ac_status=$?
3765   echo "$as_me:3765: \$? = $ac_status" >&5
3766   (exit $ac_status); } &&
3767          { ac_try='test -s conftest.$ac_objext'
3768   { (eval echo "$as_me:3768: \"$ac_try\"") >&5
3769   (eval $ac_try) 2>&5
3770   ac_status=$?
3771   echo "$as_me:3771: \$? = $ac_status" >&5
3772   (exit $ac_status); }; }; then
3773   cf_XOPEN_SOURCE_set_ok=yes
3774 else
3775   echo "$as_me: failed program was:" >&5
3776 cat conftest.$ac_ext >&5
3777 cf_XOPEN_SOURCE_set_ok=no
3778 fi
3779 rm -f conftest.$ac_objext conftest.$ac_ext
3780                 if test $cf_XOPEN_SOURCE_set_ok = no
3781                 then
3782                         { echo "$as_me:3782: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3783 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3784                 fi
3785         else
3786
3787 echo "$as_me:3787: checking if we should define _XOPEN_SOURCE" >&5
3788 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3789 if test "${cf_cv_xopen_source+set}" = set; then
3790   echo $ECHO_N "(cached) $ECHO_C" >&6
3791 else
3792
3793         cat >conftest.$ac_ext <<_ACEOF
3794 #line 3794 "configure"
3795 #include "confdefs.h"
3796
3797 #include <stdlib.h>
3798 #include <string.h>
3799 #include <sys/types.h>
3800
3801 int
3802 main ()
3803 {
3804
3805 #ifndef _XOPEN_SOURCE
3806 make an error
3807 #endif
3808   ;
3809   return 0;
3810 }
3811 _ACEOF
3812 rm -f conftest.$ac_objext
3813 if { (eval echo "$as_me:3813: \"$ac_compile\"") >&5
3814   (eval $ac_compile) 2>&5
3815   ac_status=$?
3816   echo "$as_me:3816: \$? = $ac_status" >&5
3817   (exit $ac_status); } &&
3818          { ac_try='test -s conftest.$ac_objext'
3819   { (eval echo "$as_me:3819: \"$ac_try\"") >&5
3820   (eval $ac_try) 2>&5
3821   ac_status=$?
3822   echo "$as_me:3822: \$? = $ac_status" >&5
3823   (exit $ac_status); }; }; then
3824   cf_cv_xopen_source=no
3825 else
3826   echo "$as_me: failed program was:" >&5
3827 cat conftest.$ac_ext >&5
3828 cf_save="$CPPFLAGS"
3829          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3830          cat >conftest.$ac_ext <<_ACEOF
3831 #line 3831 "configure"
3832 #include "confdefs.h"
3833
3834 #include <stdlib.h>
3835 #include <string.h>
3836 #include <sys/types.h>
3837
3838 int
3839 main ()
3840 {
3841
3842 #ifdef _XOPEN_SOURCE
3843 make an error
3844 #endif
3845   ;
3846   return 0;
3847 }
3848 _ACEOF
3849 rm -f conftest.$ac_objext
3850 if { (eval echo "$as_me:3850: \"$ac_compile\"") >&5
3851   (eval $ac_compile) 2>&5
3852   ac_status=$?
3853   echo "$as_me:3853: \$? = $ac_status" >&5
3854   (exit $ac_status); } &&
3855          { ac_try='test -s conftest.$ac_objext'
3856   { (eval echo "$as_me:3856: \"$ac_try\"") >&5
3857   (eval $ac_try) 2>&5
3858   ac_status=$?
3859   echo "$as_me:3859: \$? = $ac_status" >&5
3860   (exit $ac_status); }; }; then
3861   cf_cv_xopen_source=no
3862 else
3863   echo "$as_me: failed program was:" >&5
3864 cat conftest.$ac_ext >&5
3865 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3866 fi
3867 rm -f conftest.$ac_objext conftest.$ac_ext
3868         CPPFLAGS="$cf_save"
3869
3870 fi
3871 rm -f conftest.$ac_objext conftest.$ac_ext
3872
3873 fi
3874 echo "$as_me:3874: result: $cf_cv_xopen_source" >&5
3875 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3876
3877 if test "$cf_cv_xopen_source" != no ; then
3878
3879 CFLAGS=`echo "$CFLAGS" | \
3880         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3881                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3882
3883 CPPFLAGS=`echo "$CPPFLAGS" | \
3884         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3885                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3886
3887         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3888
3889 cf_fix_cppflags=no
3890 cf_new_cflags=
3891 cf_new_cppflags=
3892 cf_new_extra_cppflags=
3893
3894 for cf_add_cflags in $cf_temp_xopen_source
3895 do
3896 case $cf_fix_cppflags in
3897 no)
3898         case $cf_add_cflags in #(vi
3899         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3900                 case $cf_add_cflags in
3901                 -D*)
3902                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3903
3904                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3905                                 && test -z "${cf_tst_cflags}" \
3906                                 && cf_fix_cppflags=yes
3907
3908                         if test $cf_fix_cppflags = yes ; then
3909                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3910                                 continue
3911                         elif test "${cf_tst_cflags}" = "\"'" ; then
3912                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3913                                 continue
3914                         fi
3915                         ;;
3916                 esac
3917                 case "$CPPFLAGS" in
3918                 *$cf_add_cflags) #(vi
3919                         ;;
3920                 *) #(vi
3921                         case $cf_add_cflags in #(vi
3922                         -D*)
3923                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3924
3925 CPPFLAGS=`echo "$CPPFLAGS" | \
3926         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3927                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3928
3929                                 ;;
3930                         esac
3931                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3932                         ;;
3933                 esac
3934                 ;;
3935         *)
3936                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3937                 ;;
3938         esac
3939         ;;
3940 yes)
3941         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3942
3943         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3944
3945         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3946                 && test -z "${cf_tst_cflags}" \
3947                 && cf_fix_cppflags=no
3948         ;;
3949 esac
3950 done
3951
3952 if test -n "$cf_new_cflags" ; then
3953
3954         CFLAGS="$CFLAGS $cf_new_cflags"
3955 fi
3956
3957 if test -n "$cf_new_cppflags" ; then
3958
3959         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3960 fi
3961
3962 if test -n "$cf_new_extra_cppflags" ; then
3963
3964         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3965 fi
3966
3967 fi
3968
3969         fi
3970 fi
3971
3972 echo "$as_me:3972: checking for signal global datatype" >&5
3973 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
3974 if test "${cf_cv_sig_atomic_t+set}" = set; then
3975   echo $ECHO_N "(cached) $ECHO_C" >&6
3976 else
3977
3978         for cf_type in \
3979                 "volatile sig_atomic_t" \
3980                 "sig_atomic_t" \
3981                 "int"
3982         do
3983         cat >conftest.$ac_ext <<_ACEOF
3984 #line 3984 "configure"
3985 #include "confdefs.h"
3986
3987 #include <sys/types.h>
3988 #include <signal.h>
3989 #include <stdio.h>
3990
3991 extern $cf_type x;
3992 $cf_type x;
3993 static void handler(int sig)
3994 {
3995         x = 5;
3996 }
3997 int
3998 main ()
3999 {
4000 signal(SIGINT, handler);
4001                  x = 1
4002   ;
4003   return 0;
4004 }
4005 _ACEOF
4006 rm -f conftest.$ac_objext
4007 if { (eval echo "$as_me:4007: \"$ac_compile\"") >&5
4008   (eval $ac_compile) 2>&5
4009   ac_status=$?
4010   echo "$as_me:4010: \$? = $ac_status" >&5
4011   (exit $ac_status); } &&
4012          { ac_try='test -s conftest.$ac_objext'
4013   { (eval echo "$as_me:4013: \"$ac_try\"") >&5
4014   (eval $ac_try) 2>&5
4015   ac_status=$?
4016   echo "$as_me:4016: \$? = $ac_status" >&5
4017   (exit $ac_status); }; }; then
4018   cf_cv_sig_atomic_t=$cf_type
4019 else
4020   echo "$as_me: failed program was:" >&5
4021 cat conftest.$ac_ext >&5
4022 cf_cv_sig_atomic_t=no
4023 fi
4024 rm -f conftest.$ac_objext conftest.$ac_ext
4025                 test "$cf_cv_sig_atomic_t" != no && break
4026         done
4027
4028 fi
4029
4030 echo "$as_me:4030: result: $cf_cv_sig_atomic_t" >&5
4031 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4032 test "$cf_cv_sig_atomic_t" != no &&
4033 cat >>confdefs.h <<EOF
4034 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4035 EOF
4036
4037 echo "$as_me:4037: checking if you want to use pkg-config" >&5
4038 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4039
4040 # Check whether --with-pkg-config or --without-pkg-config was given.
4041 if test "${with_pkg_config+set}" = set; then
4042   withval="$with_pkg_config"
4043   cf_pkg_config=$withval
4044 else
4045   cf_pkg_config=yes
4046 fi;
4047 echo "$as_me:4047: result: $cf_pkg_config" >&5
4048 echo "${ECHO_T}$cf_pkg_config" >&6
4049
4050 case $cf_pkg_config in #(vi
4051 no) #(vi
4052         PKG_CONFIG=none
4053         ;;
4054 yes) #(vi
4055
4056 if test -n "$ac_tool_prefix"; then
4057   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4058 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4059 echo "$as_me:4059: checking for $ac_word" >&5
4060 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4061 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4062   echo $ECHO_N "(cached) $ECHO_C" >&6
4063 else
4064   case $PKG_CONFIG in
4065   [\\/]* | ?:[\\/]*)
4066   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4067   ;;
4068   *)
4069   ac_save_IFS=$IFS; IFS=$ac_path_separator
4070 ac_dummy="$PATH"
4071 for ac_dir in $ac_dummy; do
4072   IFS=$ac_save_IFS
4073   test -z "$ac_dir" && ac_dir=.
4074   if $as_executable_p "$ac_dir/$ac_word"; then
4075    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4076    echo "$as_me:4076: found $ac_dir/$ac_word" >&5
4077    break
4078 fi
4079 done
4080
4081   ;;
4082 esac
4083 fi
4084 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4085
4086 if test -n "$PKG_CONFIG"; then
4087   echo "$as_me:4087: result: $PKG_CONFIG" >&5
4088 echo "${ECHO_T}$PKG_CONFIG" >&6
4089 else
4090   echo "$as_me:4090: result: no" >&5
4091 echo "${ECHO_T}no" >&6
4092 fi
4093
4094 fi
4095 if test -z "$ac_cv_path_PKG_CONFIG"; then
4096   ac_pt_PKG_CONFIG=$PKG_CONFIG
4097   # Extract the first word of "pkg-config", so it can be a program name with args.
4098 set dummy pkg-config; ac_word=$2
4099 echo "$as_me:4099: checking for $ac_word" >&5
4100 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4101 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4102   echo $ECHO_N "(cached) $ECHO_C" >&6
4103 else
4104   case $ac_pt_PKG_CONFIG in
4105   [\\/]* | ?:[\\/]*)
4106   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4107   ;;
4108   *)
4109   ac_save_IFS=$IFS; IFS=$ac_path_separator
4110 ac_dummy="$PATH"
4111 for ac_dir in $ac_dummy; do
4112   IFS=$ac_save_IFS
4113   test -z "$ac_dir" && ac_dir=.
4114   if $as_executable_p "$ac_dir/$ac_word"; then
4115    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4116    echo "$as_me:4116: found $ac_dir/$ac_word" >&5
4117    break
4118 fi
4119 done
4120
4121   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4122   ;;
4123 esac
4124 fi
4125 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4126
4127 if test -n "$ac_pt_PKG_CONFIG"; then
4128   echo "$as_me:4128: result: $ac_pt_PKG_CONFIG" >&5
4129 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4130 else
4131   echo "$as_me:4131: result: no" >&5
4132 echo "${ECHO_T}no" >&6
4133 fi
4134
4135   PKG_CONFIG=$ac_pt_PKG_CONFIG
4136 else
4137   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4138 fi
4139
4140         ;;
4141 *)
4142         PKG_CONFIG=$withval
4143         ;;
4144 esac
4145
4146 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4147 if test "$PKG_CONFIG" != none ; then
4148
4149 if test "x$prefix" != xNONE; then
4150   cf_path_syntax="$prefix"
4151 else
4152   cf_path_syntax="$ac_default_prefix"
4153 fi
4154
4155 case ".$PKG_CONFIG" in #(vi
4156 .\$\(*\)*|.\'*\'*) #(vi
4157   ;;
4158 ..|./*|.\\*) #(vi
4159   ;;
4160 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
4161   ;;
4162 .\${*prefix}*|.\${*dir}*) #(vi
4163   eval PKG_CONFIG="$PKG_CONFIG"
4164   case ".$PKG_CONFIG" in #(vi
4165   .NONE/*)
4166     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4167     ;;
4168   esac
4169   ;; #(vi
4170 .no|.NONE/*)
4171   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4172   ;;
4173 *)
4174   { { echo "$as_me:4174: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4175 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4176    { (exit 1); exit 1; }; }
4177   ;;
4178 esac
4179
4180 fi
4181
4182 echo "$as_me:4182: checking if you want to see long compiling messages" >&5
4183 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4184
4185 # Check whether --enable-echo or --disable-echo was given.
4186 if test "${enable_echo+set}" = set; then
4187   enableval="$enable_echo"
4188   test "$enableval" != no && enableval=yes
4189   if test "$enableval" != "yes" ; then
4190
4191     ECHO_LT='--silent'
4192     ECHO_LD='@echo linking $@;'
4193     RULE_CC='@echo compiling $<'
4194     SHOW_CC='@echo compiling $@'
4195     ECHO_CC='@'
4196
4197   else
4198
4199     ECHO_LT=''
4200     ECHO_LD=''
4201     RULE_CC=''
4202     SHOW_CC=''
4203     ECHO_CC=''
4204
4205   fi
4206 else
4207   enableval=yes
4208
4209     ECHO_LT=''
4210     ECHO_LD=''
4211     RULE_CC=''
4212     SHOW_CC=''
4213     ECHO_CC=''
4214
4215 fi;
4216 echo "$as_me:4216: result: $enableval" >&5
4217 echo "${ECHO_T}$enableval" >&6
4218
4219 echo "$as_me:4219: checking for ncurses wrap-prefix" >&5
4220 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4221
4222 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4223 if test "${with_ncurses_wrap_prefix+set}" = set; then
4224   withval="$with_ncurses_wrap_prefix"
4225   NCURSES_WRAP_PREFIX=$withval
4226 else
4227   NCURSES_WRAP_PREFIX=_nc_
4228 fi;
4229 echo "$as_me:4229: result: $NCURSES_WRAP_PREFIX" >&5
4230 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4231
4232 echo "$as_me:4232: checking if you want to check for wide-character functions" >&5
4233 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4234
4235 # Check whether --enable-widec or --disable-widec was given.
4236 if test "${enable_widec+set}" = set; then
4237   enableval="$enable_widec"
4238   test "$enableval" != no && enableval=yes
4239   if test "$enableval" != "yes" ; then
4240     cf_enable_widec=no
4241   else
4242     cf_enable_widec=yes
4243   fi
4244 else
4245   enableval=yes
4246   cf_enable_widec=yes
4247
4248 fi;
4249 echo "$as_me:4249: result: $cf_enable_widec" >&5
4250 echo "${ECHO_T}$cf_enable_widec" >&6
4251
4252 echo "$as_me:4252: checking for specific curses-directory" >&5
4253 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4254
4255 # Check whether --with-curses-dir or --without-curses-dir was given.
4256 if test "${with_curses_dir+set}" = set; then
4257   withval="$with_curses_dir"
4258   cf_cv_curses_dir=$withval
4259 else
4260   cf_cv_curses_dir=no
4261 fi;
4262 echo "$as_me:4262: result: $cf_cv_curses_dir" >&5
4263 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4264
4265 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4266 then
4267
4268 if test "x$prefix" != xNONE; then
4269   cf_path_syntax="$prefix"
4270 else
4271   cf_path_syntax="$ac_default_prefix"
4272 fi
4273
4274 case ".$withval" in #(vi
4275 .\$\(*\)*|.\'*\'*) #(vi
4276   ;;
4277 ..|./*|.\\*) #(vi
4278   ;;
4279 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
4280   ;;
4281 .\${*prefix}*|.\${*dir}*) #(vi
4282   eval withval="$withval"
4283   case ".$withval" in #(vi
4284   .NONE/*)
4285     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4286     ;;
4287   esac
4288   ;; #(vi
4289 .no|.NONE/*)
4290   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4291   ;;
4292 *)
4293   { { echo "$as_me:4293: error: expected a pathname, not \"$withval\"" >&5
4294 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4295    { (exit 1); exit 1; }; }
4296   ;;
4297 esac
4298
4299         if test -d "$cf_cv_curses_dir"
4300         then
4301
4302 if test -n "$cf_cv_curses_dir/include" ; then
4303   for cf_add_incdir in $cf_cv_curses_dir/include
4304   do
4305         while test $cf_add_incdir != /usr/include
4306         do
4307           if test -d $cf_add_incdir
4308           then
4309                 cf_have_incdir=no
4310                 if test -n "$CFLAGS$CPPFLAGS" ; then
4311                   # a loop is needed to ensure we can add subdirs of existing dirs
4312                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4313                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4314                           cf_have_incdir=yes; break
4315                         fi
4316                   done
4317                 fi
4318
4319                 if test "$cf_have_incdir" = no ; then
4320                   if test "$cf_add_incdir" = /usr/local/include ; then
4321                         if test "$GCC" = yes
4322                         then
4323                           cf_save_CPPFLAGS=$CPPFLAGS
4324                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4325                           cat >conftest.$ac_ext <<_ACEOF
4326 #line 4326 "configure"
4327 #include "confdefs.h"
4328 #include <stdio.h>
4329 int
4330 main ()
4331 {
4332 printf("Hello")
4333   ;
4334   return 0;
4335 }
4336 _ACEOF
4337 rm -f conftest.$ac_objext
4338 if { (eval echo "$as_me:4338: \"$ac_compile\"") >&5
4339   (eval $ac_compile) 2>&5
4340   ac_status=$?
4341   echo "$as_me:4341: \$? = $ac_status" >&5
4342   (exit $ac_status); } &&
4343          { ac_try='test -s conftest.$ac_objext'
4344   { (eval echo "$as_me:4344: \"$ac_try\"") >&5
4345   (eval $ac_try) 2>&5
4346   ac_status=$?
4347   echo "$as_me:4347: \$? = $ac_status" >&5
4348   (exit $ac_status); }; }; then
4349   :
4350 else
4351   echo "$as_me: failed program was:" >&5
4352 cat conftest.$ac_ext >&5
4353 cf_have_incdir=yes
4354 fi
4355 rm -f conftest.$ac_objext conftest.$ac_ext
4356                           CPPFLAGS=$cf_save_CPPFLAGS
4357                         fi
4358                   fi
4359                 fi
4360
4361                 if test "$cf_have_incdir" = no ; then
4362                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4363
4364 echo "${as_me:-configure}:4364: testing adding $cf_add_incdir to include-path ..." 1>&5
4365
4366                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4367
4368                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4369                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4370                   cf_add_incdir="$cf_top_incdir"
4371                 else
4372                   break
4373                 fi
4374           fi
4375         done
4376   done
4377 fi
4378
4379 if test -n "$cf_cv_curses_dir/lib" ; then
4380   for cf_add_libdir in $cf_cv_curses_dir/lib
4381   do
4382     if test $cf_add_libdir = /usr/lib ; then
4383       :
4384     elif test -d $cf_add_libdir
4385     then
4386       cf_have_libdir=no
4387       if test -n "$LDFLAGS$LIBS" ; then
4388         # a loop is needed to ensure we can add subdirs of existing dirs
4389         for cf_test_libdir in $LDFLAGS $LIBS ; do
4390           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4391             cf_have_libdir=yes; break
4392           fi
4393         done
4394       fi
4395       if test "$cf_have_libdir" = no ; then
4396         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4397
4398 echo "${as_me:-configure}:4398: testing adding $cf_add_libdir to library-path ..." 1>&5
4399
4400         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4401       fi
4402     fi
4403   done
4404 fi
4405
4406         fi
4407 fi
4408
4409 cf_cv_screen=curses
4410
4411 echo "$as_me:4411: checking for specified curses library type" >&5
4412 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4413
4414 # Check whether --with-ncursesw or --without-ncursesw was given.
4415 if test "${with_ncursesw+set}" = set; then
4416   withval="$with_ncursesw"
4417   cf_cv_screen=ncursesw
4418 else
4419
4420 # Check whether --with-ncurses or --without-ncurses was given.
4421 if test "${with_ncurses+set}" = set; then
4422   withval="$with_ncurses"
4423   cf_cv_screen=ncurses
4424 else
4425
4426 # Check whether --with-pdcurses or --without-pdcurses was given.
4427 if test "${with_pdcurses+set}" = set; then
4428   withval="$with_pdcurses"
4429   cf_cv_screen=pdcurses
4430 else
4431
4432 # Check whether --with-curses-colr or --without-curses-colr was given.
4433 if test "${with_curses_colr+set}" = set; then
4434   withval="$with_curses_colr"
4435   cf_cv_screen=curses_colr
4436 else
4437
4438 # Check whether --with-curses-5lib or --without-curses-5lib was given.
4439 if test "${with_curses_5lib+set}" = set; then
4440   withval="$with_curses_5lib"
4441   cf_cv_screen=curses_5lib
4442 fi;
4443 fi;
4444 fi;
4445 fi;
4446 fi;
4447
4448 echo "$as_me:4448: result: $cf_cv_screen" >&5
4449 echo "${ECHO_T}$cf_cv_screen" >&6
4450
4451 case $cf_cv_screen in #(vi
4452 curses|curses_*) #(vi
4453
4454 echo "$as_me:4454: checking for extra include directories" >&5
4455 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4456 if test "${cf_cv_curses_incdir+set}" = set; then
4457   echo $ECHO_N "(cached) $ECHO_C" >&6
4458 else
4459
4460 cf_cv_curses_incdir=no
4461 case $host_os in #(vi
4462 hpux10.*) #(vi
4463         if test "x$cf_cv_screen" = "xcurses_colr"
4464         then
4465                 test -d /usr/include/curses_colr && \
4466                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
4467         fi
4468         ;;
4469 sunos3*|sunos4*)
4470         if test "x$cf_cv_screen" = "xcurses_5lib"
4471         then
4472                 test -d /usr/5lib && \
4473                 test -d /usr/5include && \
4474                 cf_cv_curses_incdir="-I/usr/5include"
4475         fi
4476         ;;
4477 esac
4478
4479 fi
4480 echo "$as_me:4480: result: $cf_cv_curses_incdir" >&5
4481 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4482 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4483
4484 echo "$as_me:4484: checking if we have identified curses headers" >&5
4485 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4486 if test "${cf_cv_ncurses_header+set}" = set; then
4487   echo $ECHO_N "(cached) $ECHO_C" >&6
4488 else
4489
4490 cf_cv_ncurses_header=none
4491 for cf_header in  \
4492         ncurses.h \
4493         curses.h ncurses/ncurses.h ncurses/curses.h
4494 do
4495 cat >conftest.$ac_ext <<_ACEOF
4496 #line 4496 "configure"
4497 #include "confdefs.h"
4498 #include <${cf_header}>
4499 int
4500 main ()
4501 {
4502 initscr(); tgoto("?", 0,0)
4503   ;
4504   return 0;
4505 }
4506 _ACEOF
4507 rm -f conftest.$ac_objext
4508 if { (eval echo "$as_me:4508: \"$ac_compile\"") >&5
4509   (eval $ac_compile) 2>&5
4510   ac_status=$?
4511   echo "$as_me:4511: \$? = $ac_status" >&5
4512   (exit $ac_status); } &&
4513          { ac_try='test -s conftest.$ac_objext'
4514   { (eval echo "$as_me:4514: \"$ac_try\"") >&5
4515   (eval $ac_try) 2>&5
4516   ac_status=$?
4517   echo "$as_me:4517: \$? = $ac_status" >&5
4518   (exit $ac_status); }; }; then
4519   cf_cv_ncurses_header=$cf_header; break
4520 else
4521   echo "$as_me: failed program was:" >&5
4522 cat conftest.$ac_ext >&5
4523 fi
4524 rm -f conftest.$ac_objext conftest.$ac_ext
4525 done
4526
4527 fi
4528 echo "$as_me:4528: result: $cf_cv_ncurses_header" >&5
4529 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4530
4531 if test "$cf_cv_ncurses_header" = none ; then
4532         { { echo "$as_me:4532: error: No curses header-files found" >&5
4533 echo "$as_me: error: No curses header-files found" >&2;}
4534    { (exit 1); exit 1; }; }
4535 fi
4536
4537 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4538
4539 for ac_header in $cf_cv_ncurses_header
4540 do
4541 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4542 echo "$as_me:4542: checking for $ac_header" >&5
4543 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4544 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4545   echo $ECHO_N "(cached) $ECHO_C" >&6
4546 else
4547   cat >conftest.$ac_ext <<_ACEOF
4548 #line 4548 "configure"
4549 #include "confdefs.h"
4550 #include <$ac_header>
4551 _ACEOF
4552 if { (eval echo "$as_me:4552: \"$ac_cpp conftest.$ac_ext\"") >&5
4553   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4554   ac_status=$?
4555   egrep -v '^ *\+' conftest.er1 >conftest.err
4556   rm -f conftest.er1
4557   cat conftest.err >&5
4558   echo "$as_me:4558: \$? = $ac_status" >&5
4559   (exit $ac_status); } >/dev/null; then
4560   if test -s conftest.err; then
4561     ac_cpp_err=$ac_c_preproc_warn_flag
4562   else
4563     ac_cpp_err=
4564   fi
4565 else
4566   ac_cpp_err=yes
4567 fi
4568 if test -z "$ac_cpp_err"; then
4569   eval "$as_ac_Header=yes"
4570 else
4571   echo "$as_me: failed program was:" >&5
4572   cat conftest.$ac_ext >&5
4573   eval "$as_ac_Header=no"
4574 fi
4575 rm -f conftest.err conftest.$ac_ext
4576 fi
4577 echo "$as_me:4577: result: `eval echo '${'$as_ac_Header'}'`" >&5
4578 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4579 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4580   cat >>confdefs.h <<EOF
4581 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4582 EOF
4583
4584 fi
4585 done
4586
4587 echo "$as_me:4587: checking for terminfo header" >&5
4588 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4589 if test "${cf_cv_term_header+set}" = set; then
4590   echo $ECHO_N "(cached) $ECHO_C" >&6
4591 else
4592
4593 case ${cf_cv_ncurses_header} in #(vi
4594 */ncurses.h|*/ncursesw.h) #(vi
4595         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4596         ;;
4597 *)
4598         cf_term_header=term.h
4599         ;;
4600 esac
4601
4602 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4603 do
4604 cat >conftest.$ac_ext <<_ACEOF
4605 #line 4605 "configure"
4606 #include "confdefs.h"
4607 #include <stdio.h>
4608 #include <${cf_cv_ncurses_header:-curses.h}>
4609 #include <$cf_test>
4610
4611 int
4612 main ()
4613 {
4614 int x = auto_left_margin
4615   ;
4616   return 0;
4617 }
4618 _ACEOF
4619 rm -f conftest.$ac_objext
4620 if { (eval echo "$as_me:4620: \"$ac_compile\"") >&5
4621   (eval $ac_compile) 2>&5
4622   ac_status=$?
4623   echo "$as_me:4623: \$? = $ac_status" >&5
4624   (exit $ac_status); } &&
4625          { ac_try='test -s conftest.$ac_objext'
4626   { (eval echo "$as_me:4626: \"$ac_try\"") >&5
4627   (eval $ac_try) 2>&5
4628   ac_status=$?
4629   echo "$as_me:4629: \$? = $ac_status" >&5
4630   (exit $ac_status); }; }; then
4631
4632         cf_cv_term_header="$cf_test"
4633 else
4634   echo "$as_me: failed program was:" >&5
4635 cat conftest.$ac_ext >&5
4636
4637         cf_cv_term_header=unknown
4638
4639 fi
4640 rm -f conftest.$ac_objext conftest.$ac_ext
4641         test "$cf_cv_term_header" != unknown && break
4642 done
4643
4644 fi
4645 echo "$as_me:4645: result: $cf_cv_term_header" >&5
4646 echo "${ECHO_T}$cf_cv_term_header" >&6
4647
4648 # Set definitions to allow ifdef'ing to accommodate subdirectories
4649
4650 case $cf_cv_term_header in # (vi
4651 *term.h)
4652
4653 cat >>confdefs.h <<\EOF
4654 #define HAVE_TERM_H 1
4655 EOF
4656
4657         ;;
4658 esac
4659
4660 case $cf_cv_term_header in # (vi
4661 ncurses/term.h) #(vi
4662
4663 cat >>confdefs.h <<\EOF
4664 #define HAVE_NCURSES_TERM_H 1
4665 EOF
4666
4667         ;;
4668 ncursesw/term.h)
4669
4670 cat >>confdefs.h <<\EOF
4671 #define HAVE_NCURSESW_TERM_H 1
4672 EOF
4673
4674         ;;
4675 esac
4676
4677 echo "$as_me:4677: checking for ncurses version" >&5
4678 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4679 if test "${cf_cv_ncurses_version+set}" = set; then
4680   echo $ECHO_N "(cached) $ECHO_C" >&6
4681 else
4682
4683         cf_cv_ncurses_version=no
4684         cf_tempfile=out$$
4685         rm -f $cf_tempfile
4686         if test "$cross_compiling" = yes; then
4687
4688         # This will not work if the preprocessor splits the line after the
4689         # Autoconf token.  The 'unproto' program does that.
4690         cat > conftest.$ac_ext <<EOF
4691 #include <${cf_cv_ncurses_header:-curses.h}>
4692 #undef Autoconf
4693 #ifdef NCURSES_VERSION
4694 Autoconf NCURSES_VERSION
4695 #else
4696 #ifdef __NCURSES_H
4697 Autoconf "old"
4698 #endif
4699 ;
4700 #endif
4701 EOF
4702         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4703         { (eval echo "$as_me:4703: \"$cf_try\"") >&5
4704   (eval $cf_try) 2>&5
4705   ac_status=$?
4706   echo "$as_me:4706: \$? = $ac_status" >&5
4707   (exit $ac_status); }
4708         if test -f conftest.out ; then
4709                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4710                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4711                 rm -f conftest.out
4712         fi
4713
4714 else
4715   cat >conftest.$ac_ext <<_ACEOF
4716 #line 4716 "configure"
4717 #include "confdefs.h"
4718
4719 #include <${cf_cv_ncurses_header:-curses.h}>
4720 #include <stdio.h>
4721 int main()
4722 {
4723         FILE *fp = fopen("$cf_tempfile", "w");
4724 #ifdef NCURSES_VERSION
4725 # ifdef NCURSES_VERSION_PATCH
4726         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4727 # else
4728         fprintf(fp, "%s\n", NCURSES_VERSION);
4729 # endif
4730 #else
4731 # ifdef __NCURSES_H
4732         fprintf(fp, "old\n");
4733 # else
4734         make an error
4735 # endif
4736 #endif
4737         ${cf_cv_main_return:-return}(0);
4738 }
4739 _ACEOF
4740 rm -f conftest$ac_exeext
4741 if { (eval echo "$as_me:4741: \"$ac_link\"") >&5
4742   (eval $ac_link) 2>&5
4743   ac_status=$?
4744   echo "$as_me:4744: \$? = $ac_status" >&5
4745   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4746   { (eval echo "$as_me:4746: \"$ac_try\"") >&5
4747   (eval $ac_try) 2>&5
4748   ac_status=$?
4749   echo "$as_me:4749: \$? = $ac_status" >&5
4750   (exit $ac_status); }; }; then
4751
4752         cf_cv_ncurses_version=`cat $cf_tempfile`
4753 else
4754   echo "$as_me: program exited with status $ac_status" >&5
4755 echo "$as_me: failed program was:" >&5
4756 cat conftest.$ac_ext >&5
4757 fi
4758 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4759 fi
4760         rm -f $cf_tempfile
4761
4762 fi
4763 echo "$as_me:4763: result: $cf_cv_ncurses_version" >&5
4764 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4765 test "$cf_cv_ncurses_version" = no ||
4766 cat >>confdefs.h <<\EOF
4767 #define NCURSES 1
4768 EOF
4769
4770 echo "$as_me:4770: checking if we have identified curses libraries" >&5
4771 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
4772 cat >conftest.$ac_ext <<_ACEOF
4773 #line 4773 "configure"
4774 #include "confdefs.h"
4775 #include <${cf_cv_ncurses_header:-curses.h}>
4776 int
4777 main ()
4778 {
4779 initscr(); tgoto("?", 0,0)
4780   ;
4781   return 0;
4782 }
4783 _ACEOF
4784 rm -f conftest.$ac_objext conftest$ac_exeext
4785 if { (eval echo "$as_me:4785: \"$ac_link\"") >&5
4786   (eval $ac_link) 2>&5
4787   ac_status=$?
4788   echo "$as_me:4788: \$? = $ac_status" >&5
4789   (exit $ac_status); } &&
4790          { ac_try='test -s conftest$ac_exeext'
4791   { (eval echo "$as_me:4791: \"$ac_try\"") >&5
4792   (eval $ac_try) 2>&5
4793   ac_status=$?
4794   echo "$as_me:4794: \$? = $ac_status" >&5
4795   (exit $ac_status); }; }; then
4796   cf_result=yes
4797 else
4798   echo "$as_me: failed program was:" >&5
4799 cat conftest.$ac_ext >&5
4800 cf_result=no
4801 fi
4802 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4803 echo "$as_me:4803: result: $cf_result" >&5
4804 echo "${ECHO_T}$cf_result" >&6
4805
4806 if test "$cf_result" = no ; then
4807 case $host_os in #(vi
4808 freebsd*) #(vi
4809     echo "$as_me:4809: checking for tgoto in -lmytinfo" >&5
4810 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4811 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4812   echo $ECHO_N "(cached) $ECHO_C" >&6
4813 else
4814   ac_check_lib_save_LIBS=$LIBS
4815 LIBS="-lmytinfo  $LIBS"
4816 cat >conftest.$ac_ext <<_ACEOF
4817 #line 4817 "configure"
4818 #include "confdefs.h"
4819
4820 /* Override any gcc2 internal prototype to avoid an error.  */
4821 #ifdef __cplusplus
4822 extern "C"
4823 #endif
4824 /* We use char because int might match the return type of a gcc2
4825    builtin and then its argument prototype would still apply.  */
4826 char tgoto ();
4827 int
4828 main ()
4829 {
4830 tgoto ();
4831   ;
4832   return 0;
4833 }
4834 _ACEOF
4835 rm -f conftest.$ac_objext conftest$ac_exeext
4836 if { (eval echo "$as_me:4836: \"$ac_link\"") >&5
4837   (eval $ac_link) 2>&5
4838   ac_status=$?
4839   echo "$as_me:4839: \$? = $ac_status" >&5
4840   (exit $ac_status); } &&
4841          { ac_try='test -s conftest$ac_exeext'
4842   { (eval echo "$as_me:4842: \"$ac_try\"") >&5
4843   (eval $ac_try) 2>&5
4844   ac_status=$?
4845   echo "$as_me:4845: \$? = $ac_status" >&5
4846   (exit $ac_status); }; }; then
4847   ac_cv_lib_mytinfo_tgoto=yes
4848 else
4849   echo "$as_me: failed program was:" >&5
4850 cat conftest.$ac_ext >&5
4851 ac_cv_lib_mytinfo_tgoto=no
4852 fi
4853 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4854 LIBS=$ac_check_lib_save_LIBS
4855 fi
4856 echo "$as_me:4856: result: $ac_cv_lib_mytinfo_tgoto" >&5
4857 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4858 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4859
4860 cf_add_libs="-lmytinfo"
4861 # Filter out duplicates - this happens with badly-designed ".pc" files...
4862 for cf_add_1lib in $LIBS
4863 do
4864         for cf_add_2lib in $cf_add_libs
4865         do
4866                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4867                 then
4868                         cf_add_1lib=
4869                         break
4870                 fi
4871         done
4872         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4873 done
4874 LIBS="$cf_add_libs"
4875
4876 fi
4877
4878     ;;
4879 hpux10.*) #(vi
4880         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
4881         # next (1998), and xcurses "newer" (2000).  There is no header file for
4882         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
4883         # term.h) for cur_colr
4884         if test "x$cf_cv_screen" = "xcurses_colr"
4885         then
4886                 echo "$as_me:4886: checking for initscr in -lcur_colr" >&5
4887 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
4888 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
4889   echo $ECHO_N "(cached) $ECHO_C" >&6
4890 else
4891   ac_check_lib_save_LIBS=$LIBS
4892 LIBS="-lcur_colr  $LIBS"
4893 cat >conftest.$ac_ext <<_ACEOF
4894 #line 4894 "configure"
4895 #include "confdefs.h"
4896
4897 /* Override any gcc2 internal prototype to avoid an error.  */
4898 #ifdef __cplusplus
4899 extern "C"
4900 #endif
4901 /* We use char because int might match the return type of a gcc2
4902    builtin and then its argument prototype would still apply.  */
4903 char initscr ();
4904 int
4905 main ()
4906 {
4907 initscr ();
4908   ;
4909   return 0;
4910 }
4911 _ACEOF
4912 rm -f conftest.$ac_objext conftest$ac_exeext
4913 if { (eval echo "$as_me:4913: \"$ac_link\"") >&5
4914   (eval $ac_link) 2>&5
4915   ac_status=$?
4916   echo "$as_me:4916: \$? = $ac_status" >&5
4917   (exit $ac_status); } &&
4918          { ac_try='test -s conftest$ac_exeext'
4919   { (eval echo "$as_me:4919: \"$ac_try\"") >&5
4920   (eval $ac_try) 2>&5
4921   ac_status=$?
4922   echo "$as_me:4922: \$? = $ac_status" >&5
4923   (exit $ac_status); }; }; then
4924   ac_cv_lib_cur_colr_initscr=yes
4925 else
4926   echo "$as_me: failed program was:" >&5
4927 cat conftest.$ac_ext >&5
4928 ac_cv_lib_cur_colr_initscr=no
4929 fi
4930 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4931 LIBS=$ac_check_lib_save_LIBS
4932 fi
4933 echo "$as_me:4933: result: $ac_cv_lib_cur_colr_initscr" >&5
4934 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
4935 if test $ac_cv_lib_cur_colr_initscr = yes; then
4936
4937 cf_add_libs="-lcur_colr"
4938 # Filter out duplicates - this happens with badly-designed ".pc" files...
4939 for cf_add_1lib in $LIBS
4940 do
4941         for cf_add_2lib in $cf_add_libs
4942         do
4943                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4944                 then
4945                         cf_add_1lib=
4946                         break
4947                 fi
4948         done
4949         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4950 done
4951 LIBS="$cf_add_libs"
4952
4953                         ac_cv_func_initscr=yes
4954
4955 else
4956
4957                 echo "$as_me:4957: checking for initscr in -lHcurses" >&5
4958 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
4959 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
4960   echo $ECHO_N "(cached) $ECHO_C" >&6
4961 else
4962   ac_check_lib_save_LIBS=$LIBS
4963 LIBS="-lHcurses  $LIBS"
4964 cat >conftest.$ac_ext <<_ACEOF
4965 #line 4965 "configure"
4966 #include "confdefs.h"
4967
4968 /* Override any gcc2 internal prototype to avoid an error.  */
4969 #ifdef __cplusplus
4970 extern "C"
4971 #endif
4972 /* We use char because int might match the return type of a gcc2
4973    builtin and then its argument prototype would still apply.  */
4974 char initscr ();
4975 int
4976 main ()
4977 {
4978 initscr ();
4979   ;
4980   return 0;
4981 }
4982 _ACEOF
4983 rm -f conftest.$ac_objext conftest$ac_exeext
4984 if { (eval echo "$as_me:4984: \"$ac_link\"") >&5
4985   (eval $ac_link) 2>&5
4986   ac_status=$?
4987   echo "$as_me:4987: \$? = $ac_status" >&5
4988   (exit $ac_status); } &&
4989          { ac_try='test -s conftest$ac_exeext'
4990   { (eval echo "$as_me:4990: \"$ac_try\"") >&5
4991   (eval $ac_try) 2>&5
4992   ac_status=$?
4993   echo "$as_me:4993: \$? = $ac_status" >&5
4994   (exit $ac_status); }; }; then
4995   ac_cv_lib_Hcurses_initscr=yes
4996 else
4997   echo "$as_me: failed program was:" >&5
4998 cat conftest.$ac_ext >&5
4999 ac_cv_lib_Hcurses_initscr=no
5000 fi
5001 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5002 LIBS=$ac_check_lib_save_LIBS
5003 fi
5004 echo "$as_me:5004: result: $ac_cv_lib_Hcurses_initscr" >&5
5005 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5006 if test $ac_cv_lib_Hcurses_initscr = yes; then
5007
5008                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5009
5010 cf_add_libs="-lHcurses"
5011 # Filter out duplicates - this happens with badly-designed ".pc" files...
5012 for cf_add_1lib in $LIBS
5013 do
5014         for cf_add_2lib in $cf_add_libs
5015         do
5016                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5017                 then
5018                         cf_add_1lib=
5019                         break
5020                 fi
5021         done
5022         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5023 done
5024 LIBS="$cf_add_libs"
5025
5026                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5027                         ac_cv_func_initscr=yes
5028
5029 fi
5030
5031 fi
5032
5033         fi
5034         ;;
5035 linux*)
5036         case `arch 2>/dev/null` in
5037         x86_64)
5038                 if test -d /lib64
5039                 then
5040
5041 if test -n "/lib64" ; then
5042   for cf_add_libdir in /lib64
5043   do
5044     if test $cf_add_libdir = /usr/lib ; then
5045       :
5046     elif test -d $cf_add_libdir
5047     then
5048       cf_have_libdir=no
5049       if test -n "$LDFLAGS$LIBS" ; then
5050         # a loop is needed to ensure we can add subdirs of existing dirs
5051         for cf_test_libdir in $LDFLAGS $LIBS ; do
5052           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5053             cf_have_libdir=yes; break
5054           fi
5055         done
5056       fi
5057       if test "$cf_have_libdir" = no ; then
5058         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5059
5060 echo "${as_me:-configure}:5060: testing adding $cf_add_libdir to library-path ..." 1>&5
5061
5062         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5063       fi
5064     fi
5065   done
5066 fi
5067
5068                 else
5069
5070 if test -n "/lib" ; then
5071   for cf_add_libdir in /lib
5072   do
5073     if test $cf_add_libdir = /usr/lib ; then
5074       :
5075     elif test -d $cf_add_libdir
5076     then
5077       cf_have_libdir=no
5078       if test -n "$LDFLAGS$LIBS" ; then
5079         # a loop is needed to ensure we can add subdirs of existing dirs
5080         for cf_test_libdir in $LDFLAGS $LIBS ; do
5081           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5082             cf_have_libdir=yes; break
5083           fi
5084         done
5085       fi
5086       if test "$cf_have_libdir" = no ; then
5087         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5088
5089 echo "${as_me:-configure}:5089: testing adding $cf_add_libdir to library-path ..." 1>&5
5090
5091         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5092       fi
5093     fi
5094   done
5095 fi
5096
5097                 fi
5098                 ;;
5099         *)
5100
5101 if test -n "/lib" ; then
5102   for cf_add_libdir in /lib
5103   do
5104     if test $cf_add_libdir = /usr/lib ; then
5105       :
5106     elif test -d $cf_add_libdir
5107     then
5108       cf_have_libdir=no
5109       if test -n "$LDFLAGS$LIBS" ; then
5110         # a loop is needed to ensure we can add subdirs of existing dirs
5111         for cf_test_libdir in $LDFLAGS $LIBS ; do
5112           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5113             cf_have_libdir=yes; break
5114           fi
5115         done
5116       fi
5117       if test "$cf_have_libdir" = no ; then
5118         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5119
5120 echo "${as_me:-configure}:5120: testing adding $cf_add_libdir to library-path ..." 1>&5
5121
5122         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5123       fi
5124     fi
5125   done
5126 fi
5127
5128                 ;;
5129         esac
5130         ;;
5131 sunos3*|sunos4*)
5132         if test "x$cf_cv_screen" = "xcurses_5lib"
5133         then
5134                 if test -d /usr/5lib ; then
5135
5136 if test -n "/usr/5lib" ; then
5137   for cf_add_libdir in /usr/5lib
5138   do
5139     if test $cf_add_libdir = /usr/lib ; then
5140       :
5141     elif test -d $cf_add_libdir
5142     then
5143       cf_have_libdir=no
5144       if test -n "$LDFLAGS$LIBS" ; then
5145         # a loop is needed to ensure we can add subdirs of existing dirs
5146         for cf_test_libdir in $LDFLAGS $LIBS ; do
5147           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5148             cf_have_libdir=yes; break
5149           fi
5150         done
5151       fi
5152       if test "$cf_have_libdir" = no ; then
5153         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5154
5155 echo "${as_me:-configure}:5155: testing adding $cf_add_libdir to library-path ..." 1>&5
5156
5157         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5158       fi
5159     fi
5160   done
5161 fi
5162
5163 cf_add_libs="-lcurses -ltermcap"
5164 # Filter out duplicates - this happens with badly-designed ".pc" files...
5165 for cf_add_1lib in $LIBS
5166 do
5167         for cf_add_2lib in $cf_add_libs
5168         do
5169                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5170                 then
5171                         cf_add_1lib=
5172                         break
5173                 fi
5174         done
5175         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5176 done
5177 LIBS="$cf_add_libs"
5178
5179                 fi
5180     fi
5181     ac_cv_func_initscr=yes
5182     ;;
5183 esac
5184
5185 if test ".$ac_cv_func_initscr" != .yes ; then
5186         cf_save_LIBS="$LIBS"
5187
5188         if test ".${cf_cv_ncurses_version:-no}" != .no
5189         then
5190                 cf_check_list="ncurses curses cursesX"
5191         else
5192                 cf_check_list="cursesX curses ncurses"
5193         fi
5194
5195         # Check for library containing tgoto.  Do this before curses library
5196         # because it may be needed to link the test-case for initscr.
5197         if test "x$cf_term_lib" = x
5198         then
5199                 echo "$as_me:5199: checking for tgoto" >&5
5200 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5201 if test "${ac_cv_func_tgoto+set}" = set; then
5202   echo $ECHO_N "(cached) $ECHO_C" >&6
5203 else
5204   cat >conftest.$ac_ext <<_ACEOF
5205 #line 5205 "configure"
5206 #include "confdefs.h"
5207 /* System header to define __stub macros and hopefully few prototypes,
5208     which can conflict with char tgoto (); below.  */
5209 #include <assert.h>
5210 /* Override any gcc2 internal prototype to avoid an error.  */
5211 #ifdef __cplusplus
5212 extern "C"
5213 #endif
5214 /* We use char because int might match the return type of a gcc2
5215    builtin and then its argument prototype would still apply.  */
5216 char tgoto ();
5217 char (*f) ();
5218
5219 int
5220 main ()
5221 {
5222 /* The GNU C library defines this for functions which it implements
5223     to always fail with ENOSYS.  Some functions are actually named
5224     something starting with __ and the normal name is an alias.  */
5225 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5226 choke me
5227 #else
5228 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5229 #endif
5230
5231   ;
5232   return 0;
5233 }
5234 _ACEOF
5235 rm -f conftest.$ac_objext conftest$ac_exeext
5236 if { (eval echo "$as_me:5236: \"$ac_link\"") >&5
5237   (eval $ac_link) 2>&5
5238   ac_status=$?
5239   echo "$as_me:5239: \$? = $ac_status" >&5
5240   (exit $ac_status); } &&
5241          { ac_try='test -s conftest$ac_exeext'
5242   { (eval echo "$as_me:5242: \"$ac_try\"") >&5
5243   (eval $ac_try) 2>&5
5244   ac_status=$?
5245   echo "$as_me:5245: \$? = $ac_status" >&5
5246   (exit $ac_status); }; }; then
5247   ac_cv_func_tgoto=yes
5248 else
5249   echo "$as_me: failed program was:" >&5
5250 cat conftest.$ac_ext >&5
5251 ac_cv_func_tgoto=no
5252 fi
5253 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5254 fi
5255 echo "$as_me:5255: result: $ac_cv_func_tgoto" >&5
5256 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5257 if test $ac_cv_func_tgoto = yes; then
5258   cf_term_lib=predefined
5259 else
5260
5261                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5262                         do
5263                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5264 echo "$as_me:5264: checking for tgoto in -l$cf_term_lib" >&5
5265 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5266 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5267   echo $ECHO_N "(cached) $ECHO_C" >&6
5268 else
5269   ac_check_lib_save_LIBS=$LIBS
5270 LIBS="-l$cf_term_lib  $LIBS"
5271 cat >conftest.$ac_ext <<_ACEOF
5272 #line 5272 "configure"
5273 #include "confdefs.h"
5274
5275 /* Override any gcc2 internal prototype to avoid an error.  */
5276 #ifdef __cplusplus
5277 extern "C"
5278 #endif
5279 /* We use char because int might match the return type of a gcc2
5280    builtin and then its argument prototype would still apply.  */
5281 char tgoto ();
5282 int
5283 main ()
5284 {
5285 tgoto ();
5286   ;
5287   return 0;
5288 }
5289 _ACEOF
5290 rm -f conftest.$ac_objext conftest$ac_exeext
5291 if { (eval echo "$as_me:5291: \"$ac_link\"") >&5
5292   (eval $ac_link) 2>&5
5293   ac_status=$?
5294   echo "$as_me:5294: \$? = $ac_status" >&5
5295   (exit $ac_status); } &&
5296          { ac_try='test -s conftest$ac_exeext'
5297   { (eval echo "$as_me:5297: \"$ac_try\"") >&5
5298   (eval $ac_try) 2>&5
5299   ac_status=$?
5300   echo "$as_me:5300: \$? = $ac_status" >&5
5301   (exit $ac_status); }; }; then
5302   eval "$as_ac_Lib=yes"
5303 else
5304   echo "$as_me: failed program was:" >&5
5305 cat conftest.$ac_ext >&5
5306 eval "$as_ac_Lib=no"
5307 fi
5308 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5309 LIBS=$ac_check_lib_save_LIBS
5310 fi
5311 echo "$as_me:5311: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5312 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5313 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5314   break
5315 fi
5316
5317                         done
5318
5319 fi
5320
5321         fi
5322
5323         # Check for library containing initscr
5324         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5325         if test "x$cf_curs_lib" = x
5326         then
5327                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5328                 do
5329                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5330 echo "$as_me:5330: checking for initscr in -l$cf_curs_lib" >&5
5331 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5332 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5333   echo $ECHO_N "(cached) $ECHO_C" >&6
5334 else
5335   ac_check_lib_save_LIBS=$LIBS
5336 LIBS="-l$cf_curs_lib  $LIBS"
5337 cat >conftest.$ac_ext <<_ACEOF
5338 #line 5338 "configure"
5339 #include "confdefs.h"
5340
5341 /* Override any gcc2 internal prototype to avoid an error.  */
5342 #ifdef __cplusplus
5343 extern "C"
5344 #endif
5345 /* We use char because int might match the return type of a gcc2
5346    builtin and then its argument prototype would still apply.  */
5347 char initscr ();
5348 int
5349 main ()
5350 {
5351 initscr ();
5352   ;
5353   return 0;
5354 }
5355 _ACEOF
5356 rm -f conftest.$ac_objext conftest$ac_exeext
5357 if { (eval echo "$as_me:5357: \"$ac_link\"") >&5
5358   (eval $ac_link) 2>&5
5359   ac_status=$?
5360   echo "$as_me:5360: \$? = $ac_status" >&5
5361   (exit $ac_status); } &&
5362          { ac_try='test -s conftest$ac_exeext'
5363   { (eval echo "$as_me:5363: \"$ac_try\"") >&5
5364   (eval $ac_try) 2>&5
5365   ac_status=$?
5366   echo "$as_me:5366: \$? = $ac_status" >&5
5367   (exit $ac_status); }; }; then
5368   eval "$as_ac_Lib=yes"
5369 else
5370   echo "$as_me: failed program was:" >&5
5371 cat conftest.$ac_ext >&5
5372 eval "$as_ac_Lib=no"
5373 fi
5374 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5375 LIBS=$ac_check_lib_save_LIBS
5376 fi
5377 echo "$as_me:5377: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5378 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5379 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5380   break
5381 fi
5382
5383                 done
5384         fi
5385         test $cf_curs_lib = unknown && { { echo "$as_me:5385: error: no curses library found" >&5
5386 echo "$as_me: error: no curses library found" >&2;}
5387    { (exit 1); exit 1; }; }
5388
5389         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5390         if test "$cf_term_lib" = unknown ; then
5391                 echo "$as_me:5391: checking if we can link with $cf_curs_lib library" >&5
5392 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5393                 cat >conftest.$ac_ext <<_ACEOF
5394 #line 5394 "configure"
5395 #include "confdefs.h"
5396 #include <${cf_cv_ncurses_header:-curses.h}>
5397 int
5398 main ()
5399 {
5400 initscr()
5401   ;
5402   return 0;
5403 }
5404 _ACEOF
5405 rm -f conftest.$ac_objext conftest$ac_exeext
5406 if { (eval echo "$as_me:5406: \"$ac_link\"") >&5
5407   (eval $ac_link) 2>&5
5408   ac_status=$?
5409   echo "$as_me:5409: \$? = $ac_status" >&5
5410   (exit $ac_status); } &&
5411          { ac_try='test -s conftest$ac_exeext'
5412   { (eval echo "$as_me:5412: \"$ac_try\"") >&5
5413   (eval $ac_try) 2>&5
5414   ac_status=$?
5415   echo "$as_me:5415: \$? = $ac_status" >&5
5416   (exit $ac_status); }; }; then
5417   cf_result=yes
5418 else
5419   echo "$as_me: failed program was:" >&5
5420 cat conftest.$ac_ext >&5
5421 cf_result=no
5422 fi
5423 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5424                 echo "$as_me:5424: result: $cf_result" >&5
5425 echo "${ECHO_T}$cf_result" >&6
5426                 test $cf_result = no && { { echo "$as_me:5426: error: Cannot link curses library" >&5
5427 echo "$as_me: error: Cannot link curses library" >&2;}
5428    { (exit 1); exit 1; }; }
5429         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5430                 :
5431         elif test "$cf_term_lib" != predefined ; then
5432                 echo "$as_me:5432: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5433 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5434                 cat >conftest.$ac_ext <<_ACEOF
5435 #line 5435 "configure"
5436 #include "confdefs.h"
5437 #include <${cf_cv_ncurses_header:-curses.h}>
5438 int
5439 main ()
5440 {
5441 initscr(); tgoto((char *)0, 0, 0);
5442   ;
5443   return 0;
5444 }
5445 _ACEOF
5446 rm -f conftest.$ac_objext conftest$ac_exeext
5447 if { (eval echo "$as_me:5447: \"$ac_link\"") >&5
5448   (eval $ac_link) 2>&5
5449   ac_status=$?
5450   echo "$as_me:5450: \$? = $ac_status" >&5
5451   (exit $ac_status); } &&
5452          { ac_try='test -s conftest$ac_exeext'
5453   { (eval echo "$as_me:5453: \"$ac_try\"") >&5
5454   (eval $ac_try) 2>&5
5455   ac_status=$?
5456   echo "$as_me:5456: \$? = $ac_status" >&5
5457   (exit $ac_status); }; }; then
5458   cf_result=no
5459 else
5460   echo "$as_me: failed program was:" >&5
5461 cat conftest.$ac_ext >&5
5462
5463                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5464                         cat >conftest.$ac_ext <<_ACEOF
5465 #line 5465 "configure"
5466 #include "confdefs.h"
5467 #include <${cf_cv_ncurses_header:-curses.h}>
5468 int
5469 main ()
5470 {
5471 initscr()
5472   ;
5473   return 0;
5474 }
5475 _ACEOF
5476 rm -f conftest.$ac_objext conftest$ac_exeext
5477 if { (eval echo "$as_me:5477: \"$ac_link\"") >&5
5478   (eval $ac_link) 2>&5
5479   ac_status=$?
5480   echo "$as_me:5480: \$? = $ac_status" >&5
5481   (exit $ac_status); } &&
5482          { ac_try='test -s conftest$ac_exeext'
5483   { (eval echo "$as_me:5483: \"$ac_try\"") >&5
5484   (eval $ac_try) 2>&5
5485   ac_status=$?
5486   echo "$as_me:5486: \$? = $ac_status" >&5
5487   (exit $ac_status); }; }; then
5488   cf_result=yes
5489 else
5490   echo "$as_me: failed program was:" >&5
5491 cat conftest.$ac_ext >&5
5492 cf_result=error
5493 fi
5494 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5495
5496 fi
5497 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5498                 echo "$as_me:5498: result: $cf_result" >&5
5499 echo "${ECHO_T}$cf_result" >&6
5500         fi
5501 fi
5502 fi
5503
5504         ;;
5505 ncurses) #(vi
5506
5507 cf_ncuconfig_root=ncurses
5508
5509 echo "Looking for ${cf_ncuconfig_root}-config"
5510
5511 if test -n "$ac_tool_prefix"; then
5512   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5513   do
5514     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5515 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5516 echo "$as_me:5516: checking for $ac_word" >&5
5517 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5518 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5519   echo $ECHO_N "(cached) $ECHO_C" >&6
5520 else
5521   if test -n "$NCURSES_CONFIG"; then
5522   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5523 else
5524   ac_save_IFS=$IFS; IFS=$ac_path_separator
5525 ac_dummy="$PATH"
5526 for ac_dir in $ac_dummy; do
5527   IFS=$ac_save_IFS
5528   test -z "$ac_dir" && ac_dir=.
5529   $as_executable_p "$ac_dir/$ac_word" || continue
5530 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5531 echo "$as_me:5531: found $ac_dir/$ac_word" >&5
5532 break
5533 done
5534
5535 fi
5536 fi
5537 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5538 if test -n "$NCURSES_CONFIG"; then
5539   echo "$as_me:5539: result: $NCURSES_CONFIG" >&5
5540 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5541 else
5542   echo "$as_me:5542: result: no" >&5
5543 echo "${ECHO_T}no" >&6
5544 fi
5545
5546     test -n "$NCURSES_CONFIG" && break
5547   done
5548 fi
5549 if test -z "$NCURSES_CONFIG"; then
5550   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5551   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5552 do
5553   # Extract the first word of "$ac_prog", so it can be a program name with args.
5554 set dummy $ac_prog; ac_word=$2
5555 echo "$as_me:5555: checking for $ac_word" >&5
5556 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5557 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5558   echo $ECHO_N "(cached) $ECHO_C" >&6
5559 else
5560   if test -n "$ac_ct_NCURSES_CONFIG"; then
5561   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5562 else
5563   ac_save_IFS=$IFS; IFS=$ac_path_separator
5564 ac_dummy="$PATH"
5565 for ac_dir in $ac_dummy; do
5566   IFS=$ac_save_IFS
5567   test -z "$ac_dir" && ac_dir=.
5568   $as_executable_p "$ac_dir/$ac_word" || continue
5569 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5570 echo "$as_me:5570: found $ac_dir/$ac_word" >&5
5571 break
5572 done
5573
5574 fi
5575 fi
5576 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5577 if test -n "$ac_ct_NCURSES_CONFIG"; then
5578   echo "$as_me:5578: result: $ac_ct_NCURSES_CONFIG" >&5
5579 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5580 else
5581   echo "$as_me:5581: result: no" >&5
5582 echo "${ECHO_T}no" >&6
5583 fi
5584
5585   test -n "$ac_ct_NCURSES_CONFIG" && break
5586 done
5587 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5588
5589   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5590 fi
5591
5592 if test "$NCURSES_CONFIG" != none ; then
5593
5594 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5595
5596 cf_add_libs="`$NCURSES_CONFIG --libs`"
5597 # Filter out duplicates - this happens with badly-designed ".pc" files...
5598 for cf_add_1lib in $LIBS
5599 do
5600         for cf_add_2lib in $cf_add_libs
5601         do
5602                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5603                 then
5604                         cf_add_1lib=
5605                         break
5606                 fi
5607         done
5608         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5609 done
5610 LIBS="$cf_add_libs"
5611
5612 # even with config script, some packages use no-override for curses.h
5613
5614 echo "$as_me:5614: checking if we have identified curses headers" >&5
5615 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5616 if test "${cf_cv_ncurses_header+set}" = set; then
5617   echo $ECHO_N "(cached) $ECHO_C" >&6
5618 else
5619
5620 cf_cv_ncurses_header=none
5621 for cf_header in  \
5622     ncurses/ncurses.h \
5623         ncurses/curses.h \
5624         ncurses.h \
5625         curses.h
5626 do
5627 cat >conftest.$ac_ext <<_ACEOF
5628 #line 5628 "configure"
5629 #include "confdefs.h"
5630 #include <${cf_header}>
5631 int
5632 main ()
5633 {
5634 initscr(); tgoto("?", 0,0)
5635   ;
5636   return 0;
5637 }
5638 _ACEOF
5639 rm -f conftest.$ac_objext
5640 if { (eval echo "$as_me:5640: \"$ac_compile\"") >&5
5641   (eval $ac_compile) 2>&5
5642   ac_status=$?
5643   echo "$as_me:5643: \$? = $ac_status" >&5
5644   (exit $ac_status); } &&
5645          { ac_try='test -s conftest.$ac_objext'
5646   { (eval echo "$as_me:5646: \"$ac_try\"") >&5
5647   (eval $ac_try) 2>&5
5648   ac_status=$?
5649   echo "$as_me:5649: \$? = $ac_status" >&5
5650   (exit $ac_status); }; }; then
5651   cf_cv_ncurses_header=$cf_header; break
5652 else
5653   echo "$as_me: failed program was:" >&5
5654 cat conftest.$ac_ext >&5
5655 fi
5656 rm -f conftest.$ac_objext conftest.$ac_ext
5657 done
5658
5659 fi
5660 echo "$as_me:5660: result: $cf_cv_ncurses_header" >&5
5661 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5662
5663 if test "$cf_cv_ncurses_header" = none ; then
5664         { { echo "$as_me:5664: error: No curses header-files found" >&5
5665 echo "$as_me: error: No curses header-files found" >&2;}
5666    { (exit 1); exit 1; }; }
5667 fi
5668
5669 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5670
5671 for ac_header in $cf_cv_ncurses_header
5672 do
5673 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5674 echo "$as_me:5674: checking for $ac_header" >&5
5675 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5676 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5677   echo $ECHO_N "(cached) $ECHO_C" >&6
5678 else
5679   cat >conftest.$ac_ext <<_ACEOF
5680 #line 5680 "configure"
5681 #include "confdefs.h"
5682 #include <$ac_header>
5683 _ACEOF
5684 if { (eval echo "$as_me:5684: \"$ac_cpp conftest.$ac_ext\"") >&5
5685   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5686   ac_status=$?
5687   egrep -v '^ *\+' conftest.er1 >conftest.err
5688   rm -f conftest.er1
5689   cat conftest.err >&5
5690   echo "$as_me:5690: \$? = $ac_status" >&5
5691   (exit $ac_status); } >/dev/null; then
5692   if test -s conftest.err; then
5693     ac_cpp_err=$ac_c_preproc_warn_flag
5694   else
5695     ac_cpp_err=
5696   fi
5697 else
5698   ac_cpp_err=yes
5699 fi
5700 if test -z "$ac_cpp_err"; then
5701   eval "$as_ac_Header=yes"
5702 else
5703   echo "$as_me: failed program was:" >&5
5704   cat conftest.$ac_ext >&5
5705   eval "$as_ac_Header=no"
5706 fi
5707 rm -f conftest.err conftest.$ac_ext
5708 fi
5709 echo "$as_me:5709: result: `eval echo '${'$as_ac_Header'}'`" >&5
5710 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5711 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5712   cat >>confdefs.h <<EOF
5713 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5714 EOF
5715
5716 fi
5717 done
5718
5719 cat >>confdefs.h <<\EOF
5720 #define NCURSES 1
5721 EOF
5722
5723 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5724
5725 cat >>confdefs.h <<EOF
5726 #define $cf_nculib_ROOT 1
5727 EOF
5728
5729 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5730
5731 else
5732
5733 cf_ncuhdr_root=ncurses
5734
5735 test -n "$cf_cv_curses_dir" && \
5736 test "$cf_cv_curses_dir" != "no" && { \
5737
5738 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5739   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5740   do
5741         while test $cf_add_incdir != /usr/include
5742         do
5743           if test -d $cf_add_incdir
5744           then
5745                 cf_have_incdir=no
5746                 if test -n "$CFLAGS$CPPFLAGS" ; then
5747                   # a loop is needed to ensure we can add subdirs of existing dirs
5748                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5749                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5750                           cf_have_incdir=yes; break
5751                         fi
5752                   done
5753                 fi
5754
5755                 if test "$cf_have_incdir" = no ; then
5756                   if test "$cf_add_incdir" = /usr/local/include ; then
5757                         if test "$GCC" = yes
5758                         then
5759                           cf_save_CPPFLAGS=$CPPFLAGS
5760                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5761                           cat >conftest.$ac_ext <<_ACEOF
5762 #line 5762 "configure"
5763 #include "confdefs.h"
5764 #include <stdio.h>
5765 int
5766 main ()
5767 {
5768 printf("Hello")
5769   ;
5770   return 0;
5771 }
5772 _ACEOF
5773 rm -f conftest.$ac_objext
5774 if { (eval echo "$as_me:5774: \"$ac_compile\"") >&5
5775   (eval $ac_compile) 2>&5
5776   ac_status=$?
5777   echo "$as_me:5777: \$? = $ac_status" >&5
5778   (exit $ac_status); } &&
5779          { ac_try='test -s conftest.$ac_objext'
5780   { (eval echo "$as_me:5780: \"$ac_try\"") >&5
5781   (eval $ac_try) 2>&5
5782   ac_status=$?
5783   echo "$as_me:5783: \$? = $ac_status" >&5
5784   (exit $ac_status); }; }; then
5785   :
5786 else
5787   echo "$as_me: failed program was:" >&5
5788 cat conftest.$ac_ext >&5
5789 cf_have_incdir=yes
5790 fi
5791 rm -f conftest.$ac_objext conftest.$ac_ext
5792                           CPPFLAGS=$cf_save_CPPFLAGS
5793                         fi
5794                   fi
5795                 fi
5796
5797                 if test "$cf_have_incdir" = no ; then
5798                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5799
5800 echo "${as_me:-configure}:5800: testing adding $cf_add_incdir to include-path ..." 1>&5
5801
5802                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5803
5804                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5805                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5806                   cf_add_incdir="$cf_top_incdir"
5807                 else
5808                   break
5809                 fi
5810           fi
5811         done
5812   done
5813 fi
5814
5815 }
5816
5817 echo "$as_me:5817: checking for $cf_ncuhdr_root header in include-path" >&5
5818 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5819 if test "${cf_cv_ncurses_h+set}" = set; then
5820   echo $ECHO_N "(cached) $ECHO_C" >&6
5821 else
5822
5823         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5824         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5825         for cf_header in $cf_header_list
5826         do
5827
5828         cat >conftest.$ac_ext <<_ACEOF
5829 #line 5829 "configure"
5830 #include "confdefs.h"
5831
5832 #include <$cf_header>
5833 int
5834 main ()
5835 {
5836
5837 #ifdef NCURSES_VERSION
5838
5839 printf("%s\n", NCURSES_VERSION);
5840 #else
5841 #ifdef __NCURSES_H
5842 printf("old\n");
5843 #else
5844         make an error
5845 #endif
5846 #endif
5847
5848   ;
5849   return 0;
5850 }
5851 _ACEOF
5852 rm -f conftest.$ac_objext
5853 if { (eval echo "$as_me:5853: \"$ac_compile\"") >&5
5854   (eval $ac_compile) 2>&5
5855   ac_status=$?
5856   echo "$as_me:5856: \$? = $ac_status" >&5
5857   (exit $ac_status); } &&
5858          { ac_try='test -s conftest.$ac_objext'
5859   { (eval echo "$as_me:5859: \"$ac_try\"") >&5
5860   (eval $ac_try) 2>&5
5861   ac_status=$?
5862   echo "$as_me:5862: \$? = $ac_status" >&5
5863   (exit $ac_status); }; }; then
5864   cf_cv_ncurses_h=$cf_header
5865
5866 else
5867   echo "$as_me: failed program was:" >&5
5868 cat conftest.$ac_ext >&5
5869 cf_cv_ncurses_h=no
5870 fi
5871 rm -f conftest.$ac_objext conftest.$ac_ext
5872
5873                 test "$cf_cv_ncurses_h" != no && break
5874         done
5875
5876 fi
5877 echo "$as_me:5877: result: $cf_cv_ncurses_h" >&5
5878 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5879
5880 if test "$cf_cv_ncurses_h" != no ; then
5881         cf_cv_ncurses_header=$cf_cv_ncurses_h
5882 else
5883
5884 echo "$as_me:5884: checking for $cf_ncuhdr_root include-path" >&5
5885 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5886 if test "${cf_cv_ncurses_h2+set}" = set; then
5887   echo $ECHO_N "(cached) $ECHO_C" >&6
5888 else
5889
5890         test -n "$verbose" && echo
5891
5892 cf_search=
5893
5894 # collect the current set of include-directories from compiler flags
5895 cf_header_path_list=""
5896 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5897         for cf_header_path in $CPPFLAGS $CFLAGS
5898         do
5899                 case $cf_header_path in #(vi
5900                 -I*)
5901                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5902
5903 test "x$cf_header_path" != "xNONE" && \
5904 test -d "$cf_header_path" && \
5905  {
5906         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5907         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5908         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5909         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5910         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5911         test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5912 }
5913
5914                         cf_header_path_list="$cf_header_path_list $cf_search"
5915                         ;;
5916                 esac
5917         done
5918 fi
5919
5920 # add the variations for the package we are looking for
5921
5922 cf_search=
5923
5924 test "x$prefix" != "xNONE" && \
5925 test -d "$prefix" && \
5926  {
5927         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5928         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5929         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5930         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5931         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5932         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5933 }
5934
5935 for cf_subdir_prefix in \
5936         /usr \
5937         /usr/local \
5938         /usr/pkg \
5939         /opt \
5940         /opt/local \
5941         $HOME
5942 do
5943
5944 test "x$cf_subdir_prefix" != "x$prefix" && \
5945 test -d "$cf_subdir_prefix" && \
5946 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5947         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5948         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5949         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5950         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5951         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5952         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"
5953 }
5954
5955 done
5956
5957 test "$includedir" != NONE && \
5958 test "$includedir" != "/usr/include" && \
5959 test -d "$includedir" && {
5960         test -d $includedir &&    cf_search="$cf_search $includedir"
5961         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5962 }
5963
5964 test "$oldincludedir" != NONE && \
5965 test "$oldincludedir" != "/usr/include" && \
5966 test -d "$oldincludedir" && {
5967         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5968         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5969 }
5970
5971 cf_search="$cf_search $cf_header_path_list"
5972
5973         test -n "$verbose" && echo search path $cf_search
5974         cf_save2_CPPFLAGS="$CPPFLAGS"
5975         for cf_incdir in $cf_search
5976         do
5977
5978 if test -n "$cf_incdir" ; then
5979   for cf_add_incdir in $cf_incdir
5980   do
5981         while test $cf_add_incdir != /usr/include
5982         do
5983           if test -d $cf_add_incdir
5984           then
5985                 cf_have_incdir=no
5986                 if test -n "$CFLAGS$CPPFLAGS" ; then
5987                   # a loop is needed to ensure we can add subdirs of existing dirs
5988                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5989                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5990                           cf_have_incdir=yes; break
5991                         fi
5992                   done
5993                 fi
5994
5995                 if test "$cf_have_incdir" = no ; then
5996                   if test "$cf_add_incdir" = /usr/local/include ; then
5997                         if test "$GCC" = yes
5998                         then
5999                           cf_save_CPPFLAGS=$CPPFLAGS
6000                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6001                           cat >conftest.$ac_ext <<_ACEOF
6002 #line 6002 "configure"
6003 #include "confdefs.h"
6004 #include <stdio.h>
6005 int
6006 main ()
6007 {
6008 printf("Hello")
6009   ;
6010   return 0;
6011 }
6012 _ACEOF
6013 rm -f conftest.$ac_objext
6014 if { (eval echo "$as_me:6014: \"$ac_compile\"") >&5
6015   (eval $ac_compile) 2>&5
6016   ac_status=$?
6017   echo "$as_me:6017: \$? = $ac_status" >&5
6018   (exit $ac_status); } &&
6019          { ac_try='test -s conftest.$ac_objext'
6020   { (eval echo "$as_me:6020: \"$ac_try\"") >&5
6021   (eval $ac_try) 2>&5
6022   ac_status=$?
6023   echo "$as_me:6023: \$? = $ac_status" >&5
6024   (exit $ac_status); }; }; then
6025   :
6026 else
6027   echo "$as_me: failed program was:" >&5
6028 cat conftest.$ac_ext >&5
6029 cf_have_incdir=yes
6030 fi
6031 rm -f conftest.$ac_objext conftest.$ac_ext
6032                           CPPFLAGS=$cf_save_CPPFLAGS
6033                         fi
6034                   fi
6035                 fi
6036
6037                 if test "$cf_have_incdir" = no ; then
6038                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6039
6040 echo "${as_me:-configure}:6040: testing adding $cf_add_incdir to include-path ..." 1>&5
6041
6042                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6043
6044                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6045                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6046                   cf_add_incdir="$cf_top_incdir"
6047                 else
6048                   break
6049                 fi
6050           fi
6051         done
6052   done
6053 fi
6054
6055                 for cf_header in \
6056                         ncurses.h \
6057                         curses.h
6058                 do
6059
6060         cat >conftest.$ac_ext <<_ACEOF
6061 #line 6061 "configure"
6062 #include "confdefs.h"
6063
6064 #include <$cf_header>
6065 int
6066 main ()
6067 {
6068
6069 #ifdef NCURSES_VERSION
6070
6071 printf("%s\n", NCURSES_VERSION);
6072 #else
6073 #ifdef __NCURSES_H
6074 printf("old\n");
6075 #else
6076         make an error
6077 #endif
6078 #endif
6079
6080   ;
6081   return 0;
6082 }
6083 _ACEOF
6084 rm -f conftest.$ac_objext
6085 if { (eval echo "$as_me:6085: \"$ac_compile\"") >&5
6086   (eval $ac_compile) 2>&5
6087   ac_status=$?
6088   echo "$as_me:6088: \$? = $ac_status" >&5
6089   (exit $ac_status); } &&
6090          { ac_try='test -s conftest.$ac_objext'
6091   { (eval echo "$as_me:6091: \"$ac_try\"") >&5
6092   (eval $ac_try) 2>&5
6093   ac_status=$?
6094   echo "$as_me:6094: \$? = $ac_status" >&5
6095   (exit $ac_status); }; }; then
6096   cf_cv_ncurses_h2=$cf_header
6097
6098 else
6099   echo "$as_me: failed program was:" >&5
6100 cat conftest.$ac_ext >&5
6101 cf_cv_ncurses_h2=no
6102 fi
6103 rm -f conftest.$ac_objext conftest.$ac_ext
6104
6105                         if test "$cf_cv_ncurses_h2" != no ; then
6106                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6107                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6108                                 break
6109                         fi
6110                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6111                 done
6112                 CPPFLAGS="$cf_save2_CPPFLAGS"
6113                 test "$cf_cv_ncurses_h2" != no && break
6114         done
6115         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6115: error: not found" >&5
6116 echo "$as_me: error: not found" >&2;}
6117    { (exit 1); exit 1; }; }
6118
6119 fi
6120 echo "$as_me:6120: result: $cf_cv_ncurses_h2" >&5
6121 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6122
6123         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6124         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6125         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6126                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6127         fi
6128
6129 if test -n "$cf_1st_incdir" ; then
6130   for cf_add_incdir in $cf_1st_incdir
6131   do
6132         while test $cf_add_incdir != /usr/include
6133         do
6134           if test -d $cf_add_incdir
6135           then
6136                 cf_have_incdir=no
6137                 if test -n "$CFLAGS$CPPFLAGS" ; then
6138                   # a loop is needed to ensure we can add subdirs of existing dirs
6139                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6140                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6141                           cf_have_incdir=yes; break
6142                         fi
6143                   done
6144                 fi
6145
6146                 if test "$cf_have_incdir" = no ; then
6147                   if test "$cf_add_incdir" = /usr/local/include ; then
6148                         if test "$GCC" = yes
6149                         then
6150                           cf_save_CPPFLAGS=$CPPFLAGS
6151                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6152                           cat >conftest.$ac_ext <<_ACEOF
6153 #line 6153 "configure"
6154 #include "confdefs.h"
6155 #include <stdio.h>
6156 int
6157 main ()
6158 {
6159 printf("Hello")
6160   ;
6161   return 0;
6162 }
6163 _ACEOF
6164 rm -f conftest.$ac_objext
6165 if { (eval echo "$as_me:6165: \"$ac_compile\"") >&5
6166   (eval $ac_compile) 2>&5
6167   ac_status=$?
6168   echo "$as_me:6168: \$? = $ac_status" >&5
6169   (exit $ac_status); } &&
6170          { ac_try='test -s conftest.$ac_objext'
6171   { (eval echo "$as_me:6171: \"$ac_try\"") >&5
6172   (eval $ac_try) 2>&5
6173   ac_status=$?
6174   echo "$as_me:6174: \$? = $ac_status" >&5
6175   (exit $ac_status); }; }; then
6176   :
6177 else
6178   echo "$as_me: failed program was:" >&5
6179 cat conftest.$ac_ext >&5
6180 cf_have_incdir=yes
6181 fi
6182 rm -f conftest.$ac_objext conftest.$ac_ext
6183                           CPPFLAGS=$cf_save_CPPFLAGS
6184                         fi
6185                   fi
6186                 fi
6187
6188                 if test "$cf_have_incdir" = no ; then
6189                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6190
6191 echo "${as_me:-configure}:6191: testing adding $cf_add_incdir to include-path ..." 1>&5
6192
6193                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6194
6195                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6196                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6197                   cf_add_incdir="$cf_top_incdir"
6198                 else
6199                   break
6200                 fi
6201           fi
6202         done
6203   done
6204 fi
6205
6206 fi
6207
6208 # Set definitions to allow ifdef'ing for ncurses.h
6209
6210 case $cf_cv_ncurses_header in # (vi
6211 *ncurses.h)
6212
6213 cat >>confdefs.h <<\EOF
6214 #define HAVE_NCURSES_H 1
6215 EOF
6216
6217         ;;
6218 esac
6219
6220 case $cf_cv_ncurses_header in # (vi
6221 ncurses/curses.h|ncurses/ncurses.h)
6222
6223 cat >>confdefs.h <<\EOF
6224 #define HAVE_NCURSES_NCURSES_H 1
6225 EOF
6226
6227         ;;
6228 ncursesw/curses.h|ncursesw/ncurses.h)
6229
6230 cat >>confdefs.h <<\EOF
6231 #define HAVE_NCURSESW_NCURSES_H 1
6232 EOF
6233
6234         ;;
6235 esac
6236
6237 echo "$as_me:6237: checking for terminfo header" >&5
6238 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6239 if test "${cf_cv_term_header+set}" = set; then
6240   echo $ECHO_N "(cached) $ECHO_C" >&6
6241 else
6242
6243 case ${cf_cv_ncurses_header} in #(vi
6244 */ncurses.h|*/ncursesw.h) #(vi
6245         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6246         ;;
6247 *)
6248         cf_term_header=term.h
6249         ;;
6250 esac
6251
6252 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6253 do
6254 cat >conftest.$ac_ext <<_ACEOF
6255 #line 6255 "configure"
6256 #include "confdefs.h"
6257 #include <stdio.h>
6258 #include <${cf_cv_ncurses_header:-curses.h}>
6259 #include <$cf_test>
6260
6261 int
6262 main ()
6263 {
6264 int x = auto_left_margin
6265   ;
6266   return 0;
6267 }
6268 _ACEOF
6269 rm -f conftest.$ac_objext
6270 if { (eval echo "$as_me:6270: \"$ac_compile\"") >&5
6271   (eval $ac_compile) 2>&5
6272   ac_status=$?
6273   echo "$as_me:6273: \$? = $ac_status" >&5
6274   (exit $ac_status); } &&
6275          { ac_try='test -s conftest.$ac_objext'
6276   { (eval echo "$as_me:6276: \"$ac_try\"") >&5
6277   (eval $ac_try) 2>&5
6278   ac_status=$?
6279   echo "$as_me:6279: \$? = $ac_status" >&5
6280   (exit $ac_status); }; }; then
6281
6282         cf_cv_term_header="$cf_test"
6283 else
6284   echo "$as_me: failed program was:" >&5
6285 cat conftest.$ac_ext >&5
6286
6287         cf_cv_term_header=unknown
6288
6289 fi
6290 rm -f conftest.$ac_objext conftest.$ac_ext
6291         test "$cf_cv_term_header" != unknown && break
6292 done
6293
6294 fi
6295 echo "$as_me:6295: result: $cf_cv_term_header" >&5
6296 echo "${ECHO_T}$cf_cv_term_header" >&6
6297
6298 # Set definitions to allow ifdef'ing to accommodate subdirectories
6299
6300 case $cf_cv_term_header in # (vi
6301 *term.h)
6302
6303 cat >>confdefs.h <<\EOF
6304 #define HAVE_TERM_H 1
6305 EOF
6306
6307         ;;
6308 esac
6309
6310 case $cf_cv_term_header in # (vi
6311 ncurses/term.h) #(vi
6312
6313 cat >>confdefs.h <<\EOF
6314 #define HAVE_NCURSES_TERM_H 1
6315 EOF
6316
6317         ;;
6318 ncursesw/term.h)
6319
6320 cat >>confdefs.h <<\EOF
6321 #define HAVE_NCURSESW_TERM_H 1
6322 EOF
6323
6324         ;;
6325 esac
6326
6327 # some applications need this, but should check for NCURSES_VERSION
6328
6329 cat >>confdefs.h <<\EOF
6330 #define NCURSES 1
6331 EOF
6332
6333 echo "$as_me:6333: checking for ncurses version" >&5
6334 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6335 if test "${cf_cv_ncurses_version+set}" = set; then
6336   echo $ECHO_N "(cached) $ECHO_C" >&6
6337 else
6338
6339         cf_cv_ncurses_version=no
6340         cf_tempfile=out$$
6341         rm -f $cf_tempfile
6342         if test "$cross_compiling" = yes; then
6343
6344         # This will not work if the preprocessor splits the line after the
6345         # Autoconf token.  The 'unproto' program does that.
6346         cat > conftest.$ac_ext <<EOF
6347 #include <${cf_cv_ncurses_header:-curses.h}>
6348 #undef Autoconf
6349 #ifdef NCURSES_VERSION
6350 Autoconf NCURSES_VERSION
6351 #else
6352 #ifdef __NCURSES_H
6353 Autoconf "old"
6354 #endif
6355 ;
6356 #endif
6357 EOF
6358         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6359         { (eval echo "$as_me:6359: \"$cf_try\"") >&5
6360   (eval $cf_try) 2>&5
6361   ac_status=$?
6362   echo "$as_me:6362: \$? = $ac_status" >&5
6363   (exit $ac_status); }
6364         if test -f conftest.out ; then
6365                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6366                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6367                 rm -f conftest.out
6368         fi
6369
6370 else
6371   cat >conftest.$ac_ext <<_ACEOF
6372 #line 6372 "configure"
6373 #include "confdefs.h"
6374
6375 #include <${cf_cv_ncurses_header:-curses.h}>
6376 #include <stdio.h>
6377 int main()
6378 {
6379         FILE *fp = fopen("$cf_tempfile", "w");
6380 #ifdef NCURSES_VERSION
6381 # ifdef NCURSES_VERSION_PATCH
6382         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6383 # else
6384         fprintf(fp, "%s\n", NCURSES_VERSION);
6385 # endif
6386 #else
6387 # ifdef __NCURSES_H
6388         fprintf(fp, "old\n");
6389 # else
6390         make an error
6391 # endif
6392 #endif
6393         ${cf_cv_main_return:-return}(0);
6394 }
6395 _ACEOF
6396 rm -f conftest$ac_exeext
6397 if { (eval echo "$as_me:6397: \"$ac_link\"") >&5
6398   (eval $ac_link) 2>&5
6399   ac_status=$?
6400   echo "$as_me:6400: \$? = $ac_status" >&5
6401   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6402   { (eval echo "$as_me:6402: \"$ac_try\"") >&5
6403   (eval $ac_try) 2>&5
6404   ac_status=$?
6405   echo "$as_me:6405: \$? = $ac_status" >&5
6406   (exit $ac_status); }; }; then
6407
6408         cf_cv_ncurses_version=`cat $cf_tempfile`
6409 else
6410   echo "$as_me: program exited with status $ac_status" >&5
6411 echo "$as_me: failed program was:" >&5
6412 cat conftest.$ac_ext >&5
6413 fi
6414 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6415 fi
6416         rm -f $cf_tempfile
6417
6418 fi
6419 echo "$as_me:6419: result: $cf_cv_ncurses_version" >&5
6420 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6421 test "$cf_cv_ncurses_version" = no ||
6422 cat >>confdefs.h <<\EOF
6423 #define NCURSES 1
6424 EOF
6425
6426 cf_nculib_root=ncurses
6427         # This works, except for the special case where we find gpm, but
6428         # ncurses is in a nonstandard location via $LIBS, and we really want
6429         # to link gpm.
6430 cf_ncurses_LIBS=""
6431 cf_ncurses_SAVE="$LIBS"
6432 echo "$as_me:6432: checking for Gpm_Open in -lgpm" >&5
6433 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6434 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6435   echo $ECHO_N "(cached) $ECHO_C" >&6
6436 else
6437   ac_check_lib_save_LIBS=$LIBS
6438 LIBS="-lgpm  $LIBS"
6439 cat >conftest.$ac_ext <<_ACEOF
6440 #line 6440 "configure"
6441 #include "confdefs.h"
6442
6443 /* Override any gcc2 internal prototype to avoid an error.  */
6444 #ifdef __cplusplus
6445 extern "C"
6446 #endif
6447 /* We use char because int might match the return type of a gcc2
6448    builtin and then its argument prototype would still apply.  */
6449 char Gpm_Open ();
6450 int
6451 main ()
6452 {
6453 Gpm_Open ();
6454   ;
6455   return 0;
6456 }
6457 _ACEOF
6458 rm -f conftest.$ac_objext conftest$ac_exeext
6459 if { (eval echo "$as_me:6459: \"$ac_link\"") >&5
6460   (eval $ac_link) 2>&5
6461   ac_status=$?
6462   echo "$as_me:6462: \$? = $ac_status" >&5
6463   (exit $ac_status); } &&
6464          { ac_try='test -s conftest$ac_exeext'
6465   { (eval echo "$as_me:6465: \"$ac_try\"") >&5
6466   (eval $ac_try) 2>&5
6467   ac_status=$?
6468   echo "$as_me:6468: \$? = $ac_status" >&5
6469   (exit $ac_status); }; }; then
6470   ac_cv_lib_gpm_Gpm_Open=yes
6471 else
6472   echo "$as_me: failed program was:" >&5
6473 cat conftest.$ac_ext >&5
6474 ac_cv_lib_gpm_Gpm_Open=no
6475 fi
6476 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6477 LIBS=$ac_check_lib_save_LIBS
6478 fi
6479 echo "$as_me:6479: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6480 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6481 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6482   echo "$as_me:6482: checking for initscr in -lgpm" >&5
6483 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6484 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6485   echo $ECHO_N "(cached) $ECHO_C" >&6
6486 else
6487   ac_check_lib_save_LIBS=$LIBS
6488 LIBS="-lgpm  $LIBS"
6489 cat >conftest.$ac_ext <<_ACEOF
6490 #line 6490 "configure"
6491 #include "confdefs.h"
6492
6493 /* Override any gcc2 internal prototype to avoid an error.  */
6494 #ifdef __cplusplus
6495 extern "C"
6496 #endif
6497 /* We use char because int might match the return type of a gcc2
6498    builtin and then its argument prototype would still apply.  */
6499 char initscr ();
6500 int
6501 main ()
6502 {
6503 initscr ();
6504   ;
6505   return 0;
6506 }
6507 _ACEOF
6508 rm -f conftest.$ac_objext conftest$ac_exeext
6509 if { (eval echo "$as_me:6509: \"$ac_link\"") >&5
6510   (eval $ac_link) 2>&5
6511   ac_status=$?
6512   echo "$as_me:6512: \$? = $ac_status" >&5
6513   (exit $ac_status); } &&
6514          { ac_try='test -s conftest$ac_exeext'
6515   { (eval echo "$as_me:6515: \"$ac_try\"") >&5
6516   (eval $ac_try) 2>&5
6517   ac_status=$?
6518   echo "$as_me:6518: \$? = $ac_status" >&5
6519   (exit $ac_status); }; }; then
6520   ac_cv_lib_gpm_initscr=yes
6521 else
6522   echo "$as_me: failed program was:" >&5
6523 cat conftest.$ac_ext >&5
6524 ac_cv_lib_gpm_initscr=no
6525 fi
6526 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6527 LIBS=$ac_check_lib_save_LIBS
6528 fi
6529 echo "$as_me:6529: result: $ac_cv_lib_gpm_initscr" >&5
6530 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6531 if test $ac_cv_lib_gpm_initscr = yes; then
6532   LIBS="$cf_ncurses_SAVE"
6533 else
6534   cf_ncurses_LIBS="-lgpm"
6535 fi
6536
6537 fi
6538
6539 case $host_os in #(vi
6540 freebsd*)
6541         # This is only necessary if you are linking against an obsolete
6542         # version of ncurses (but it should do no harm, since it's static).
6543         if test "$cf_nculib_root" = ncurses ; then
6544                 echo "$as_me:6544: checking for tgoto in -lmytinfo" >&5
6545 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6546 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6547   echo $ECHO_N "(cached) $ECHO_C" >&6
6548 else
6549   ac_check_lib_save_LIBS=$LIBS
6550 LIBS="-lmytinfo  $LIBS"
6551 cat >conftest.$ac_ext <<_ACEOF
6552 #line 6552 "configure"
6553 #include "confdefs.h"
6554
6555 /* Override any gcc2 internal prototype to avoid an error.  */
6556 #ifdef __cplusplus
6557 extern "C"
6558 #endif
6559 /* We use char because int might match the return type of a gcc2
6560    builtin and then its argument prototype would still apply.  */
6561 char tgoto ();
6562 int
6563 main ()
6564 {
6565 tgoto ();
6566   ;
6567   return 0;
6568 }
6569 _ACEOF
6570 rm -f conftest.$ac_objext conftest$ac_exeext
6571 if { (eval echo "$as_me:6571: \"$ac_link\"") >&5
6572   (eval $ac_link) 2>&5
6573   ac_status=$?
6574   echo "$as_me:6574: \$? = $ac_status" >&5
6575   (exit $ac_status); } &&
6576          { ac_try='test -s conftest$ac_exeext'
6577   { (eval echo "$as_me:6577: \"$ac_try\"") >&5
6578   (eval $ac_try) 2>&5
6579   ac_status=$?
6580   echo "$as_me:6580: \$? = $ac_status" >&5
6581   (exit $ac_status); }; }; then
6582   ac_cv_lib_mytinfo_tgoto=yes
6583 else
6584   echo "$as_me: failed program was:" >&5
6585 cat conftest.$ac_ext >&5
6586 ac_cv_lib_mytinfo_tgoto=no
6587 fi
6588 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6589 LIBS=$ac_check_lib_save_LIBS
6590 fi
6591 echo "$as_me:6591: result: $ac_cv_lib_mytinfo_tgoto" >&5
6592 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6593 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6594   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6595 fi
6596
6597         fi
6598         ;;
6599 esac
6600
6601 cf_add_libs="$cf_ncurses_LIBS"
6602 # Filter out duplicates - this happens with badly-designed ".pc" files...
6603 for cf_add_1lib in $LIBS
6604 do
6605         for cf_add_2lib in $cf_add_libs
6606         do
6607                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6608                 then
6609                         cf_add_1lib=
6610                         break
6611                 fi
6612         done
6613         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6614 done
6615 LIBS="$cf_add_libs"
6616
6617 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6618 then
6619
6620 cf_add_libs="-l$cf_nculib_root"
6621 # Filter out duplicates - this happens with badly-designed ".pc" files...
6622 for cf_add_1lib in $LIBS
6623 do
6624         for cf_add_2lib in $cf_add_libs
6625         do
6626                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6627                 then
6628                         cf_add_1lib=
6629                         break
6630                 fi
6631         done
6632         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6633 done
6634 LIBS="$cf_add_libs"
6635
6636 else
6637
6638         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6639         cf_libdir=""
6640         echo "$as_me:6640: checking for initscr" >&5
6641 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6642 if test "${ac_cv_func_initscr+set}" = set; then
6643   echo $ECHO_N "(cached) $ECHO_C" >&6
6644 else
6645   cat >conftest.$ac_ext <<_ACEOF
6646 #line 6646 "configure"
6647 #include "confdefs.h"
6648 /* System header to define __stub macros and hopefully few prototypes,
6649     which can conflict with char initscr (); below.  */
6650 #include <assert.h>
6651 /* Override any gcc2 internal prototype to avoid an error.  */
6652 #ifdef __cplusplus
6653 extern "C"
6654 #endif
6655 /* We use char because int might match the return type of a gcc2
6656    builtin and then its argument prototype would still apply.  */
6657 char initscr ();
6658 char (*f) ();
6659
6660 int
6661 main ()
6662 {
6663 /* The GNU C library defines this for functions which it implements
6664     to always fail with ENOSYS.  Some functions are actually named
6665     something starting with __ and the normal name is an alias.  */
6666 #if defined (__stub_initscr) || defined (__stub___initscr)
6667 choke me
6668 #else
6669 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6670 #endif
6671
6672   ;
6673   return 0;
6674 }
6675 _ACEOF
6676 rm -f conftest.$ac_objext conftest$ac_exeext
6677 if { (eval echo "$as_me:6677: \"$ac_link\"") >&5
6678   (eval $ac_link) 2>&5
6679   ac_status=$?
6680   echo "$as_me:6680: \$? = $ac_status" >&5
6681   (exit $ac_status); } &&
6682          { ac_try='test -s conftest$ac_exeext'
6683   { (eval echo "$as_me:6683: \"$ac_try\"") >&5
6684   (eval $ac_try) 2>&5
6685   ac_status=$?
6686   echo "$as_me:6686: \$? = $ac_status" >&5
6687   (exit $ac_status); }; }; then
6688   ac_cv_func_initscr=yes
6689 else
6690   echo "$as_me: failed program was:" >&5
6691 cat conftest.$ac_ext >&5
6692 ac_cv_func_initscr=no
6693 fi
6694 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6695 fi
6696 echo "$as_me:6696: result: $ac_cv_func_initscr" >&5
6697 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6698 if test $ac_cv_func_initscr = yes; then
6699   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6700 else
6701
6702                 cf_save_LIBS="$LIBS"
6703                 echo "$as_me:6703: checking for initscr in -l$cf_nculib_root" >&5
6704 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6705                 LIBS="-l$cf_nculib_root $LIBS"
6706                 cat >conftest.$ac_ext <<_ACEOF
6707 #line 6707 "configure"
6708 #include "confdefs.h"
6709 #include <${cf_cv_ncurses_header:-curses.h}>
6710 int
6711 main ()
6712 {
6713 initscr()
6714   ;
6715   return 0;
6716 }
6717 _ACEOF
6718 rm -f conftest.$ac_objext conftest$ac_exeext
6719 if { (eval echo "$as_me:6719: \"$ac_link\"") >&5
6720   (eval $ac_link) 2>&5
6721   ac_status=$?
6722   echo "$as_me:6722: \$? = $ac_status" >&5
6723   (exit $ac_status); } &&
6724          { ac_try='test -s conftest$ac_exeext'
6725   { (eval echo "$as_me:6725: \"$ac_try\"") >&5
6726   (eval $ac_try) 2>&5
6727   ac_status=$?
6728   echo "$as_me:6728: \$? = $ac_status" >&5
6729   (exit $ac_status); }; }; then
6730   echo "$as_me:6730: result: yes" >&5
6731 echo "${ECHO_T}yes" >&6
6732                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6733
6734 else
6735   echo "$as_me: failed program was:" >&5
6736 cat conftest.$ac_ext >&5
6737 echo "$as_me:6737: result: no" >&5
6738 echo "${ECHO_T}no" >&6
6739
6740 cf_search=
6741 cf_library_path_list=""
6742 if test -n "${LDFLAGS}${LIBS}" ; then
6743         for cf_library_path in $LDFLAGS $LIBS
6744         do
6745                 case $cf_library_path in #(vi
6746                 -L*)
6747                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6748
6749 test "x$cf_library_path" != "xNONE" && \
6750 test -d "$cf_library_path" && \
6751  {
6752         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6753         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6754         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6755         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6756         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6757         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"
6758 }
6759
6760                         cf_library_path_list="$cf_library_path_list $cf_search"
6761                         ;;
6762                 esac
6763         done
6764 fi
6765
6766 cf_search=
6767
6768 test "x$prefix" != "xNONE" && \
6769 test -d "$prefix" && \
6770  {
6771         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6772         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6773         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6774         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6775         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6776         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6777 }
6778
6779 for cf_subdir_prefix in \
6780         /usr \
6781         /usr/local \
6782         /usr/pkg \
6783         /opt \
6784         /opt/local \
6785         $HOME
6786 do
6787
6788 test "x$cf_subdir_prefix" != "x$prefix" && \
6789 test -d "$cf_subdir_prefix" && \
6790 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6791         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6792         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6793         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6794         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6795         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6796         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"
6797 }
6798
6799 done
6800
6801 cf_search="$cf_library_path_list $cf_search"
6802
6803                         for cf_libdir in $cf_search
6804                         do
6805                                 echo "$as_me:6805: checking for -l$cf_nculib_root in $cf_libdir" >&5
6806 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6807                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6808                                 cat >conftest.$ac_ext <<_ACEOF
6809 #line 6809 "configure"
6810 #include "confdefs.h"
6811 #include <${cf_cv_ncurses_header:-curses.h}>
6812 int
6813 main ()
6814 {
6815 initscr()
6816   ;
6817   return 0;
6818 }
6819 _ACEOF
6820 rm -f conftest.$ac_objext conftest$ac_exeext
6821 if { (eval echo "$as_me:6821: \"$ac_link\"") >&5
6822   (eval $ac_link) 2>&5
6823   ac_status=$?
6824   echo "$as_me:6824: \$? = $ac_status" >&5
6825   (exit $ac_status); } &&
6826          { ac_try='test -s conftest$ac_exeext'
6827   { (eval echo "$as_me:6827: \"$ac_try\"") >&5
6828   (eval $ac_try) 2>&5
6829   ac_status=$?
6830   echo "$as_me:6830: \$? = $ac_status" >&5
6831   (exit $ac_status); }; }; then
6832   echo "$as_me:6832: result: yes" >&5
6833 echo "${ECHO_T}yes" >&6
6834                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6835                                          break
6836 else
6837   echo "$as_me: failed program was:" >&5
6838 cat conftest.$ac_ext >&5
6839 echo "$as_me:6839: result: no" >&5
6840 echo "${ECHO_T}no" >&6
6841                                          LIBS="$cf_save_LIBS"
6842 fi
6843 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6844                         done
6845
6846 fi
6847 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6848
6849 fi
6850
6851 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6852
6853 if test $cf_found_library = no ; then
6854         { { echo "$as_me:6854: error: Cannot link $cf_nculib_root library" >&5
6855 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6856    { (exit 1); exit 1; }; }
6857 fi
6858
6859 fi
6860
6861 if test -n "$cf_ncurses_LIBS" ; then
6862         echo "$as_me:6862: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6863 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6864         cf_ncurses_SAVE="$LIBS"
6865         for p in $cf_ncurses_LIBS ; do
6866                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6867                 if test "$q" != "$LIBS" ; then
6868                         LIBS="$q"
6869                 fi
6870         done
6871         cat >conftest.$ac_ext <<_ACEOF
6872 #line 6872 "configure"
6873 #include "confdefs.h"
6874 #include <${cf_cv_ncurses_header:-curses.h}>
6875 int
6876 main ()
6877 {
6878 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6879   ;
6880   return 0;
6881 }
6882 _ACEOF
6883 rm -f conftest.$ac_objext conftest$ac_exeext
6884 if { (eval echo "$as_me:6884: \"$ac_link\"") >&5
6885   (eval $ac_link) 2>&5
6886   ac_status=$?
6887   echo "$as_me:6887: \$? = $ac_status" >&5
6888   (exit $ac_status); } &&
6889          { ac_try='test -s conftest$ac_exeext'
6890   { (eval echo "$as_me:6890: \"$ac_try\"") >&5
6891   (eval $ac_try) 2>&5
6892   ac_status=$?
6893   echo "$as_me:6893: \$? = $ac_status" >&5
6894   (exit $ac_status); }; }; then
6895   echo "$as_me:6895: result: yes" >&5
6896 echo "${ECHO_T}yes" >&6
6897 else
6898   echo "$as_me: failed program was:" >&5
6899 cat conftest.$ac_ext >&5
6900 echo "$as_me:6900: result: no" >&5
6901 echo "${ECHO_T}no" >&6
6902                  LIBS="$cf_ncurses_SAVE"
6903 fi
6904 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6905 fi
6906
6907 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6908
6909 cat >>confdefs.h <<EOF
6910 #define $cf_nculib_ROOT 1
6911 EOF
6912
6913 fi
6914
6915         ;;
6916 ncursesw) #(vi
6917
6918 echo "$as_me:6918: checking for multibyte character support" >&5
6919 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6920 if test "${cf_cv_utf8_lib+set}" = set; then
6921   echo $ECHO_N "(cached) $ECHO_C" >&6
6922 else
6923
6924         cf_save_LIBS="$LIBS"
6925         cat >conftest.$ac_ext <<_ACEOF
6926 #line 6926 "configure"
6927 #include "confdefs.h"
6928
6929 #include <stdlib.h>
6930 int
6931 main ()
6932 {
6933 putwc(0,0);
6934   ;
6935   return 0;
6936 }
6937 _ACEOF
6938 rm -f conftest.$ac_objext conftest$ac_exeext
6939 if { (eval echo "$as_me:6939: \"$ac_link\"") >&5
6940   (eval $ac_link) 2>&5
6941   ac_status=$?
6942   echo "$as_me:6942: \$? = $ac_status" >&5
6943   (exit $ac_status); } &&
6944          { ac_try='test -s conftest$ac_exeext'
6945   { (eval echo "$as_me:6945: \"$ac_try\"") >&5
6946   (eval $ac_try) 2>&5
6947   ac_status=$?
6948   echo "$as_me:6948: \$? = $ac_status" >&5
6949   (exit $ac_status); }; }; then
6950   cf_cv_utf8_lib=yes
6951 else
6952   echo "$as_me: failed program was:" >&5
6953 cat conftest.$ac_ext >&5
6954
6955 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6956 # will be set on completion of the AC_TRY_LINK below.
6957 cf_cv_header_path_utf8=
6958 cf_cv_library_path_utf8=
6959
6960 echo "${as_me:-configure}:6960: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6961
6962 cf_save_LIBS="$LIBS"
6963
6964 cat >conftest.$ac_ext <<_ACEOF
6965 #line 6965 "configure"
6966 #include "confdefs.h"
6967
6968 #include <libutf8.h>
6969 int
6970 main ()
6971 {
6972 putwc(0,0);
6973   ;
6974   return 0;
6975 }
6976 _ACEOF
6977 rm -f conftest.$ac_objext conftest$ac_exeext
6978 if { (eval echo "$as_me:6978: \"$ac_link\"") >&5
6979   (eval $ac_link) 2>&5
6980   ac_status=$?
6981   echo "$as_me:6981: \$? = $ac_status" >&5
6982   (exit $ac_status); } &&
6983          { ac_try='test -s conftest$ac_exeext'
6984   { (eval echo "$as_me:6984: \"$ac_try\"") >&5
6985   (eval $ac_try) 2>&5
6986   ac_status=$?
6987   echo "$as_me:6987: \$? = $ac_status" >&5
6988   (exit $ac_status); }; }; then
6989
6990         cf_cv_find_linkage_utf8=yes
6991         cf_cv_header_path_utf8=/usr/include
6992         cf_cv_library_path_utf8=/usr/lib
6993
6994 else
6995   echo "$as_me: failed program was:" >&5
6996 cat conftest.$ac_ext >&5
6997
6998 LIBS="-lutf8  $cf_save_LIBS"
6999
7000 cat >conftest.$ac_ext <<_ACEOF
7001 #line 7001 "configure"
7002 #include "confdefs.h"
7003
7004 #include <libutf8.h>
7005 int
7006 main ()
7007 {
7008 putwc(0,0);
7009   ;
7010   return 0;
7011 }
7012 _ACEOF
7013 rm -f conftest.$ac_objext conftest$ac_exeext
7014 if { (eval echo "$as_me:7014: \"$ac_link\"") >&5
7015   (eval $ac_link) 2>&5
7016   ac_status=$?
7017   echo "$as_me:7017: \$? = $ac_status" >&5
7018   (exit $ac_status); } &&
7019          { ac_try='test -s conftest$ac_exeext'
7020   { (eval echo "$as_me:7020: \"$ac_try\"") >&5
7021   (eval $ac_try) 2>&5
7022   ac_status=$?
7023   echo "$as_me:7023: \$? = $ac_status" >&5
7024   (exit $ac_status); }; }; then
7025
7026         cf_cv_find_linkage_utf8=yes
7027         cf_cv_header_path_utf8=/usr/include
7028         cf_cv_library_path_utf8=/usr/lib
7029         cf_cv_library_file_utf8="-lutf8"
7030
7031 else
7032   echo "$as_me: failed program was:" >&5
7033 cat conftest.$ac_ext >&5
7034
7035         cf_cv_find_linkage_utf8=no
7036         LIBS="$cf_save_LIBS"
7037
7038     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
7039
7040 echo "${as_me:-configure}:7040: testing find linkage for utf8 library ..." 1>&5
7041
7042 echo "${as_me:-configure}:7042: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7043
7044     cf_save_CPPFLAGS="$CPPFLAGS"
7045     cf_test_CPPFLAGS="$CPPFLAGS"
7046
7047 cf_search=
7048
7049 # collect the current set of include-directories from compiler flags
7050 cf_header_path_list=""
7051 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7052         for cf_header_path in $CPPFLAGS $CFLAGS
7053         do
7054                 case $cf_header_path in #(vi
7055                 -I*)
7056                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7057
7058 test "x$cf_header_path" != "xNONE" && \
7059 test -d "$cf_header_path" && \
7060  {
7061         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7062         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7063         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7064         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7065         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7066         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7067 }
7068
7069                         cf_header_path_list="$cf_header_path_list $cf_search"
7070                         ;;
7071                 esac
7072         done
7073 fi
7074
7075 # add the variations for the package we are looking for
7076
7077 cf_search=
7078
7079 test "x$prefix" != "xNONE" && \
7080 test -d "$prefix" && \
7081  {
7082         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7083         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7084         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7085         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7086         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7087         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7088 }
7089
7090 for cf_subdir_prefix in \
7091         /usr \
7092         /usr/local \
7093         /usr/pkg \
7094         /opt \
7095         /opt/local \
7096         $HOME
7097 do
7098
7099 test "x$cf_subdir_prefix" != "x$prefix" && \
7100 test -d "$cf_subdir_prefix" && \
7101 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7102         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7103         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7104         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7105         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7106         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7107         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7108 }
7109
7110 done
7111
7112 test "$includedir" != NONE && \
7113 test "$includedir" != "/usr/include" && \
7114 test -d "$includedir" && {
7115         test -d $includedir &&    cf_search="$cf_search $includedir"
7116         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7117 }
7118
7119 test "$oldincludedir" != NONE && \
7120 test "$oldincludedir" != "/usr/include" && \
7121 test -d "$oldincludedir" && {
7122         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7123         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7124 }
7125
7126 cf_search="$cf_search $cf_header_path_list"
7127
7128     for cf_cv_header_path_utf8 in $cf_search
7129     do
7130       if test -d $cf_cv_header_path_utf8 ; then
7131         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7132
7133 echo "${as_me:-configure}:7133: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7134
7135         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
7136         cat >conftest.$ac_ext <<_ACEOF
7137 #line 7137 "configure"
7138 #include "confdefs.h"
7139
7140 #include <libutf8.h>
7141 int
7142 main ()
7143 {
7144 putwc(0,0);
7145   ;
7146   return 0;
7147 }
7148 _ACEOF
7149 rm -f conftest.$ac_objext
7150 if { (eval echo "$as_me:7150: \"$ac_compile\"") >&5
7151   (eval $ac_compile) 2>&5
7152   ac_status=$?
7153   echo "$as_me:7153: \$? = $ac_status" >&5
7154   (exit $ac_status); } &&
7155          { ac_try='test -s conftest.$ac_objext'
7156   { (eval echo "$as_me:7156: \"$ac_try\"") >&5
7157   (eval $ac_try) 2>&5
7158   ac_status=$?
7159   echo "$as_me:7159: \$? = $ac_status" >&5
7160   (exit $ac_status); }; }; then
7161
7162             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7163
7164 echo "${as_me:-configure}:7164: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7165
7166             cf_cv_find_linkage_utf8=maybe
7167             cf_test_CPPFLAGS="$CPPFLAGS"
7168             break
7169 else
7170   echo "$as_me: failed program was:" >&5
7171 cat conftest.$ac_ext >&5
7172
7173             CPPFLAGS="$cf_save_CPPFLAGS"
7174
7175 fi
7176 rm -f conftest.$ac_objext conftest.$ac_ext
7177       fi
7178     done
7179
7180     if test "$cf_cv_find_linkage_utf8" = maybe ; then
7181
7182 echo "${as_me:-configure}:7182: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7183
7184       cf_save_LIBS="$LIBS"
7185       cf_save_LDFLAGS="$LDFLAGS"
7186
7187       if test "$cf_cv_find_linkage_utf8" != yes ; then
7188
7189 cf_search=
7190 cf_library_path_list=""
7191 if test -n "${LDFLAGS}${LIBS}" ; then
7192         for cf_library_path in $LDFLAGS $LIBS
7193         do
7194                 case $cf_library_path in #(vi
7195                 -L*)
7196                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7197
7198 test "x$cf_library_path" != "xNONE" && \
7199 test -d "$cf_library_path" && \
7200  {
7201         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7202         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7203         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7204         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7205         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7206         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7207 }
7208
7209                         cf_library_path_list="$cf_library_path_list $cf_search"
7210                         ;;
7211                 esac
7212         done
7213 fi
7214
7215 cf_search=
7216
7217 test "x$prefix" != "xNONE" && \
7218 test -d "$prefix" && \
7219  {
7220         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7221         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7222         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7223         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7224         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7225         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7226 }
7227
7228 for cf_subdir_prefix in \
7229         /usr \
7230         /usr/local \
7231         /usr/pkg \
7232         /opt \
7233         /opt/local \
7234         $HOME
7235 do
7236
7237 test "x$cf_subdir_prefix" != "x$prefix" && \
7238 test -d "$cf_subdir_prefix" && \
7239 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7240         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7241         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7242         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7243         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7244         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7245         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7246 }
7247
7248 done
7249
7250 cf_search="$cf_library_path_list $cf_search"
7251
7252         for cf_cv_library_path_utf8 in $cf_search
7253         do
7254           if test -d $cf_cv_library_path_utf8 ; then
7255             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
7256
7257 echo "${as_me:-configure}:7257: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7258
7259             CPPFLAGS="$cf_test_CPPFLAGS"
7260             LIBS="-lutf8  $cf_save_LIBS"
7261             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7262             cat >conftest.$ac_ext <<_ACEOF
7263 #line 7263 "configure"
7264 #include "confdefs.h"
7265
7266 #include <libutf8.h>
7267 int
7268 main ()
7269 {
7270 putwc(0,0);
7271   ;
7272   return 0;
7273 }
7274 _ACEOF
7275 rm -f conftest.$ac_objext conftest$ac_exeext
7276 if { (eval echo "$as_me:7276: \"$ac_link\"") >&5
7277   (eval $ac_link) 2>&5
7278   ac_status=$?
7279   echo "$as_me:7279: \$? = $ac_status" >&5
7280   (exit $ac_status); } &&
7281          { ac_try='test -s conftest$ac_exeext'
7282   { (eval echo "$as_me:7282: \"$ac_try\"") >&5
7283   (eval $ac_try) 2>&5
7284   ac_status=$?
7285   echo "$as_me:7285: \$? = $ac_status" >&5
7286   (exit $ac_status); }; }; then
7287
7288                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7289
7290 echo "${as_me:-configure}:7290: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7291
7292                 cf_cv_find_linkage_utf8=yes
7293                 cf_cv_library_file_utf8="-lutf8"
7294                 break
7295 else
7296   echo "$as_me: failed program was:" >&5
7297 cat conftest.$ac_ext >&5
7298
7299                 CPPFLAGS="$cf_save_CPPFLAGS"
7300                 LIBS="$cf_save_LIBS"
7301                 LDFLAGS="$cf_save_LDFLAGS"
7302
7303 fi
7304 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7305           fi
7306         done
7307         CPPFLAGS="$cf_save_CPPFLAGS"
7308         LDFLAGS="$cf_save_LDFLAGS"
7309       fi
7310
7311     else
7312       cf_cv_find_linkage_utf8=no
7313     fi
7314
7315 fi
7316 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7317
7318 fi
7319 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7320
7321 LIBS="$cf_save_LIBS"
7322
7323 if test "$cf_cv_find_linkage_utf8" = yes ; then
7324 cf_cv_utf8_lib=add-on
7325 else
7326 cf_cv_utf8_lib=no
7327 fi
7328
7329 fi
7330 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7331 fi
7332 echo "$as_me:7332: result: $cf_cv_utf8_lib" >&5
7333 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7334
7335 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7336 # ncurses/ncursesw:
7337 if test "$cf_cv_utf8_lib" = "add-on" ; then
7338
7339 cat >>confdefs.h <<\EOF
7340 #define HAVE_LIBUTF8_H 1
7341 EOF
7342
7343 if test -n "$cf_cv_header_path_utf8" ; then
7344   for cf_add_incdir in $cf_cv_header_path_utf8
7345   do
7346         while test $cf_add_incdir != /usr/include
7347         do
7348           if test -d $cf_add_incdir
7349           then
7350                 cf_have_incdir=no
7351                 if test -n "$CFLAGS$CPPFLAGS" ; then
7352                   # a loop is needed to ensure we can add subdirs of existing dirs
7353                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7354                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7355                           cf_have_incdir=yes; break
7356                         fi
7357                   done
7358                 fi
7359
7360                 if test "$cf_have_incdir" = no ; then
7361                   if test "$cf_add_incdir" = /usr/local/include ; then
7362                         if test "$GCC" = yes
7363                         then
7364                           cf_save_CPPFLAGS=$CPPFLAGS
7365                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7366                           cat >conftest.$ac_ext <<_ACEOF
7367 #line 7367 "configure"
7368 #include "confdefs.h"
7369 #include <stdio.h>
7370 int
7371 main ()
7372 {
7373 printf("Hello")
7374   ;
7375   return 0;
7376 }
7377 _ACEOF
7378 rm -f conftest.$ac_objext
7379 if { (eval echo "$as_me:7379: \"$ac_compile\"") >&5
7380   (eval $ac_compile) 2>&5
7381   ac_status=$?
7382   echo "$as_me:7382: \$? = $ac_status" >&5
7383   (exit $ac_status); } &&
7384          { ac_try='test -s conftest.$ac_objext'
7385   { (eval echo "$as_me:7385: \"$ac_try\"") >&5
7386   (eval $ac_try) 2>&5
7387   ac_status=$?
7388   echo "$as_me:7388: \$? = $ac_status" >&5
7389   (exit $ac_status); }; }; then
7390   :
7391 else
7392   echo "$as_me: failed program was:" >&5
7393 cat conftest.$ac_ext >&5
7394 cf_have_incdir=yes
7395 fi
7396 rm -f conftest.$ac_objext conftest.$ac_ext
7397                           CPPFLAGS=$cf_save_CPPFLAGS
7398                         fi
7399                   fi
7400                 fi
7401
7402                 if test "$cf_have_incdir" = no ; then
7403                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7404
7405 echo "${as_me:-configure}:7405: testing adding $cf_add_incdir to include-path ..." 1>&5
7406
7407                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7408
7409                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7410                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7411                   cf_add_incdir="$cf_top_incdir"
7412                 else
7413                   break
7414                 fi
7415           fi
7416         done
7417   done
7418 fi
7419
7420 if test -n "$cf_cv_library_path_utf8" ; then
7421   for cf_add_libdir in $cf_cv_library_path_utf8
7422   do
7423     if test $cf_add_libdir = /usr/lib ; then
7424       :
7425     elif test -d $cf_add_libdir
7426     then
7427       cf_have_libdir=no
7428       if test -n "$LDFLAGS$LIBS" ; then
7429         # a loop is needed to ensure we can add subdirs of existing dirs
7430         for cf_test_libdir in $LDFLAGS $LIBS ; do
7431           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7432             cf_have_libdir=yes; break
7433           fi
7434         done
7435       fi
7436       if test "$cf_have_libdir" = no ; then
7437         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7438
7439 echo "${as_me:-configure}:7439: testing adding $cf_add_libdir to library-path ..." 1>&5
7440
7441         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7442       fi
7443     fi
7444   done
7445 fi
7446
7447 cf_add_libs="$cf_cv_library_file_utf8"
7448 # Filter out duplicates - this happens with badly-designed ".pc" files...
7449 for cf_add_1lib in $LIBS
7450 do
7451         for cf_add_2lib in $cf_add_libs
7452         do
7453                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7454                 then
7455                         cf_add_1lib=
7456                         break
7457                 fi
7458         done
7459         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7460 done
7461 LIBS="$cf_add_libs"
7462
7463 fi
7464
7465 cf_ncuconfig_root=ncursesw
7466
7467 echo "Looking for ${cf_ncuconfig_root}-config"
7468
7469 if test -n "$ac_tool_prefix"; then
7470   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7471   do
7472     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7473 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7474 echo "$as_me:7474: checking for $ac_word" >&5
7475 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7476 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7477   echo $ECHO_N "(cached) $ECHO_C" >&6
7478 else
7479   if test -n "$NCURSES_CONFIG"; then
7480   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7481 else
7482   ac_save_IFS=$IFS; IFS=$ac_path_separator
7483 ac_dummy="$PATH"
7484 for ac_dir in $ac_dummy; do
7485   IFS=$ac_save_IFS
7486   test -z "$ac_dir" && ac_dir=.
7487   $as_executable_p "$ac_dir/$ac_word" || continue
7488 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7489 echo "$as_me:7489: found $ac_dir/$ac_word" >&5
7490 break
7491 done
7492
7493 fi
7494 fi
7495 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7496 if test -n "$NCURSES_CONFIG"; then
7497   echo "$as_me:7497: result: $NCURSES_CONFIG" >&5
7498 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7499 else
7500   echo "$as_me:7500: result: no" >&5
7501 echo "${ECHO_T}no" >&6
7502 fi
7503
7504     test -n "$NCURSES_CONFIG" && break
7505   done
7506 fi
7507 if test -z "$NCURSES_CONFIG"; then
7508   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7509   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7510 do
7511   # Extract the first word of "$ac_prog", so it can be a program name with args.
7512 set dummy $ac_prog; ac_word=$2
7513 echo "$as_me:7513: checking for $ac_word" >&5
7514 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7515 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7516   echo $ECHO_N "(cached) $ECHO_C" >&6
7517 else
7518   if test -n "$ac_ct_NCURSES_CONFIG"; then
7519   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7520 else
7521   ac_save_IFS=$IFS; IFS=$ac_path_separator
7522 ac_dummy="$PATH"
7523 for ac_dir in $ac_dummy; do
7524   IFS=$ac_save_IFS
7525   test -z "$ac_dir" && ac_dir=.
7526   $as_executable_p "$ac_dir/$ac_word" || continue
7527 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7528 echo "$as_me:7528: found $ac_dir/$ac_word" >&5
7529 break
7530 done
7531
7532 fi
7533 fi
7534 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7535 if test -n "$ac_ct_NCURSES_CONFIG"; then
7536   echo "$as_me:7536: result: $ac_ct_NCURSES_CONFIG" >&5
7537 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7538 else
7539   echo "$as_me:7539: result: no" >&5
7540 echo "${ECHO_T}no" >&6
7541 fi
7542
7543   test -n "$ac_ct_NCURSES_CONFIG" && break
7544 done
7545 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7546
7547   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7548 fi
7549
7550 if test "$NCURSES_CONFIG" != none ; then
7551
7552 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7553
7554 cf_add_libs="`$NCURSES_CONFIG --libs`"
7555 # Filter out duplicates - this happens with badly-designed ".pc" files...
7556 for cf_add_1lib in $LIBS
7557 do
7558         for cf_add_2lib in $cf_add_libs
7559         do
7560                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7561                 then
7562                         cf_add_1lib=
7563                         break
7564                 fi
7565         done
7566         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7567 done
7568 LIBS="$cf_add_libs"
7569
7570 # even with config script, some packages use no-override for curses.h
7571
7572 echo "$as_me:7572: checking if we have identified curses headers" >&5
7573 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7574 if test "${cf_cv_ncurses_header+set}" = set; then
7575   echo $ECHO_N "(cached) $ECHO_C" >&6
7576 else
7577
7578 cf_cv_ncurses_header=none
7579 for cf_header in  \
7580     ncursesw/ncurses.h \
7581         ncursesw/curses.h \
7582         ncurses.h \
7583         curses.h
7584 do
7585 cat >conftest.$ac_ext <<_ACEOF
7586 #line 7586 "configure"
7587 #include "confdefs.h"
7588 #include <${cf_header}>
7589 int
7590 main ()
7591 {
7592 initscr(); tgoto("?", 0,0)
7593   ;
7594   return 0;
7595 }
7596 _ACEOF
7597 rm -f conftest.$ac_objext
7598 if { (eval echo "$as_me:7598: \"$ac_compile\"") >&5
7599   (eval $ac_compile) 2>&5
7600   ac_status=$?
7601   echo "$as_me:7601: \$? = $ac_status" >&5
7602   (exit $ac_status); } &&
7603          { ac_try='test -s conftest.$ac_objext'
7604   { (eval echo "$as_me:7604: \"$ac_try\"") >&5
7605   (eval $ac_try) 2>&5
7606   ac_status=$?
7607   echo "$as_me:7607: \$? = $ac_status" >&5
7608   (exit $ac_status); }; }; then
7609   cf_cv_ncurses_header=$cf_header; break
7610 else
7611   echo "$as_me: failed program was:" >&5
7612 cat conftest.$ac_ext >&5
7613 fi
7614 rm -f conftest.$ac_objext conftest.$ac_ext
7615 done
7616
7617 fi
7618 echo "$as_me:7618: result: $cf_cv_ncurses_header" >&5
7619 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7620
7621 if test "$cf_cv_ncurses_header" = none ; then
7622         { { echo "$as_me:7622: error: No curses header-files found" >&5
7623 echo "$as_me: error: No curses header-files found" >&2;}
7624    { (exit 1); exit 1; }; }
7625 fi
7626
7627 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7628
7629 for ac_header in $cf_cv_ncurses_header
7630 do
7631 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7632 echo "$as_me:7632: checking for $ac_header" >&5
7633 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7634 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7635   echo $ECHO_N "(cached) $ECHO_C" >&6
7636 else
7637   cat >conftest.$ac_ext <<_ACEOF
7638 #line 7638 "configure"
7639 #include "confdefs.h"
7640 #include <$ac_header>
7641 _ACEOF
7642 if { (eval echo "$as_me:7642: \"$ac_cpp conftest.$ac_ext\"") >&5
7643   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7644   ac_status=$?
7645   egrep -v '^ *\+' conftest.er1 >conftest.err
7646   rm -f conftest.er1
7647   cat conftest.err >&5
7648   echo "$as_me:7648: \$? = $ac_status" >&5
7649   (exit $ac_status); } >/dev/null; then
7650   if test -s conftest.err; then
7651     ac_cpp_err=$ac_c_preproc_warn_flag
7652   else
7653     ac_cpp_err=
7654   fi
7655 else
7656   ac_cpp_err=yes
7657 fi
7658 if test -z "$ac_cpp_err"; then
7659   eval "$as_ac_Header=yes"
7660 else
7661   echo "$as_me: failed program was:" >&5
7662   cat conftest.$ac_ext >&5
7663   eval "$as_ac_Header=no"
7664 fi
7665 rm -f conftest.err conftest.$ac_ext
7666 fi
7667 echo "$as_me:7667: result: `eval echo '${'$as_ac_Header'}'`" >&5
7668 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7669 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7670   cat >>confdefs.h <<EOF
7671 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7672 EOF
7673
7674 fi
7675 done
7676
7677 cat >>confdefs.h <<\EOF
7678 #define NCURSES 1
7679 EOF
7680
7681 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7682
7683 cat >>confdefs.h <<EOF
7684 #define $cf_nculib_ROOT 1
7685 EOF
7686
7687 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7688
7689 else
7690
7691 cf_ncuhdr_root=ncursesw
7692
7693 test -n "$cf_cv_curses_dir" && \
7694 test "$cf_cv_curses_dir" != "no" && { \
7695
7696 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7697   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7698   do
7699         while test $cf_add_incdir != /usr/include
7700         do
7701           if test -d $cf_add_incdir
7702           then
7703                 cf_have_incdir=no
7704                 if test -n "$CFLAGS$CPPFLAGS" ; then
7705                   # a loop is needed to ensure we can add subdirs of existing dirs
7706                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7707                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7708                           cf_have_incdir=yes; break
7709                         fi
7710                   done
7711                 fi
7712
7713                 if test "$cf_have_incdir" = no ; then
7714                   if test "$cf_add_incdir" = /usr/local/include ; then
7715                         if test "$GCC" = yes
7716                         then
7717                           cf_save_CPPFLAGS=$CPPFLAGS
7718                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7719                           cat >conftest.$ac_ext <<_ACEOF
7720 #line 7720 "configure"
7721 #include "confdefs.h"
7722 #include <stdio.h>
7723 int
7724 main ()
7725 {
7726 printf("Hello")
7727   ;
7728   return 0;
7729 }
7730 _ACEOF
7731 rm -f conftest.$ac_objext
7732 if { (eval echo "$as_me:7732: \"$ac_compile\"") >&5
7733   (eval $ac_compile) 2>&5
7734   ac_status=$?
7735   echo "$as_me:7735: \$? = $ac_status" >&5
7736   (exit $ac_status); } &&
7737          { ac_try='test -s conftest.$ac_objext'
7738   { (eval echo "$as_me:7738: \"$ac_try\"") >&5
7739   (eval $ac_try) 2>&5
7740   ac_status=$?
7741   echo "$as_me:7741: \$? = $ac_status" >&5
7742   (exit $ac_status); }; }; then
7743   :
7744 else
7745   echo "$as_me: failed program was:" >&5
7746 cat conftest.$ac_ext >&5
7747 cf_have_incdir=yes
7748 fi
7749 rm -f conftest.$ac_objext conftest.$ac_ext
7750                           CPPFLAGS=$cf_save_CPPFLAGS
7751                         fi
7752                   fi
7753                 fi
7754
7755                 if test "$cf_have_incdir" = no ; then
7756                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7757
7758 echo "${as_me:-configure}:7758: testing adding $cf_add_incdir to include-path ..." 1>&5
7759
7760                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7761
7762                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7763                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7764                   cf_add_incdir="$cf_top_incdir"
7765                 else
7766                   break
7767                 fi
7768           fi
7769         done
7770   done
7771 fi
7772
7773 }
7774
7775 echo "$as_me:7775: checking for $cf_ncuhdr_root header in include-path" >&5
7776 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7777 if test "${cf_cv_ncurses_h+set}" = set; then
7778   echo $ECHO_N "(cached) $ECHO_C" >&6
7779 else
7780
7781         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7782         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7783         for cf_header in $cf_header_list
7784         do
7785
7786         cat >conftest.$ac_ext <<_ACEOF
7787 #line 7787 "configure"
7788 #include "confdefs.h"
7789
7790 #define _XOPEN_SOURCE_EXTENDED
7791 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7792 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7793
7794 #include <$cf_header>
7795 int
7796 main ()
7797 {
7798
7799 #ifdef NCURSES_VERSION
7800
7801 #ifndef WACS_BSSB
7802         make an error
7803 #endif
7804
7805 printf("%s\n", NCURSES_VERSION);
7806 #else
7807 #ifdef __NCURSES_H
7808 printf("old\n");
7809 #else
7810         make an error
7811 #endif
7812 #endif
7813
7814   ;
7815   return 0;
7816 }
7817 _ACEOF
7818 rm -f conftest.$ac_objext
7819 if { (eval echo "$as_me:7819: \"$ac_compile\"") >&5
7820   (eval $ac_compile) 2>&5
7821   ac_status=$?
7822   echo "$as_me:7822: \$? = $ac_status" >&5
7823   (exit $ac_status); } &&
7824          { ac_try='test -s conftest.$ac_objext'
7825   { (eval echo "$as_me:7825: \"$ac_try\"") >&5
7826   (eval $ac_try) 2>&5
7827   ac_status=$?
7828   echo "$as_me:7828: \$? = $ac_status" >&5
7829   (exit $ac_status); }; }; then
7830   cf_cv_ncurses_h=$cf_header
7831
7832 else
7833   echo "$as_me: failed program was:" >&5
7834 cat conftest.$ac_ext >&5
7835 cf_cv_ncurses_h=no
7836 fi
7837 rm -f conftest.$ac_objext conftest.$ac_ext
7838
7839                 test "$cf_cv_ncurses_h" != no && break
7840         done
7841
7842 fi
7843 echo "$as_me:7843: result: $cf_cv_ncurses_h" >&5
7844 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7845
7846 if test "$cf_cv_ncurses_h" != no ; then
7847         cf_cv_ncurses_header=$cf_cv_ncurses_h
7848 else
7849
7850 echo "$as_me:7850: checking for $cf_ncuhdr_root include-path" >&5
7851 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7852 if test "${cf_cv_ncurses_h2+set}" = set; then
7853   echo $ECHO_N "(cached) $ECHO_C" >&6
7854 else
7855
7856         test -n "$verbose" && echo
7857
7858 cf_search=
7859
7860 # collect the current set of include-directories from compiler flags
7861 cf_header_path_list=""
7862 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7863         for cf_header_path in $CPPFLAGS $CFLAGS
7864         do
7865                 case $cf_header_path in #(vi
7866                 -I*)
7867                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7868
7869 test "x$cf_header_path" != "xNONE" && \
7870 test -d "$cf_header_path" && \
7871  {
7872         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7873         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7874         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7875         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7876         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7877         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"
7878 }
7879
7880                         cf_header_path_list="$cf_header_path_list $cf_search"
7881                         ;;
7882                 esac
7883         done
7884 fi
7885
7886 # add the variations for the package we are looking for
7887
7888 cf_search=
7889
7890 test "x$prefix" != "xNONE" && \
7891 test -d "$prefix" && \
7892  {
7893         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7894         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7895         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7896         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7897         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7898         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7899 }
7900
7901 for cf_subdir_prefix in \
7902         /usr \
7903         /usr/local \
7904         /usr/pkg \
7905         /opt \
7906         /opt/local \
7907         $HOME
7908 do
7909
7910 test "x$cf_subdir_prefix" != "x$prefix" && \
7911 test -d "$cf_subdir_prefix" && \
7912 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7913         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7914         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7915         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7916         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7917         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7918         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"
7919 }
7920
7921 done
7922
7923 test "$includedir" != NONE && \
7924 test "$includedir" != "/usr/include" && \
7925 test -d "$includedir" && {
7926         test -d $includedir &&    cf_search="$cf_search $includedir"
7927         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7928 }
7929
7930 test "$oldincludedir" != NONE && \
7931 test "$oldincludedir" != "/usr/include" && \
7932 test -d "$oldincludedir" && {
7933         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7934         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7935 }
7936
7937 cf_search="$cf_search $cf_header_path_list"
7938
7939         test -n "$verbose" && echo search path $cf_search
7940         cf_save2_CPPFLAGS="$CPPFLAGS"
7941         for cf_incdir in $cf_search
7942         do
7943
7944 if test -n "$cf_incdir" ; then
7945   for cf_add_incdir in $cf_incdir
7946   do
7947         while test $cf_add_incdir != /usr/include
7948         do
7949           if test -d $cf_add_incdir
7950           then
7951                 cf_have_incdir=no
7952                 if test -n "$CFLAGS$CPPFLAGS" ; then
7953                   # a loop is needed to ensure we can add subdirs of existing dirs
7954                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7955                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7956                           cf_have_incdir=yes; break
7957                         fi
7958                   done
7959                 fi
7960
7961                 if test "$cf_have_incdir" = no ; then
7962                   if test "$cf_add_incdir" = /usr/local/include ; then
7963                         if test "$GCC" = yes
7964                         then
7965                           cf_save_CPPFLAGS=$CPPFLAGS
7966                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7967                           cat >conftest.$ac_ext <<_ACEOF
7968 #line 7968 "configure"
7969 #include "confdefs.h"
7970 #include <stdio.h>
7971 int
7972 main ()
7973 {
7974 printf("Hello")
7975   ;
7976   return 0;
7977 }
7978 _ACEOF
7979 rm -f conftest.$ac_objext
7980 if { (eval echo "$as_me:7980: \"$ac_compile\"") >&5
7981   (eval $ac_compile) 2>&5
7982   ac_status=$?
7983   echo "$as_me:7983: \$? = $ac_status" >&5
7984   (exit $ac_status); } &&
7985          { ac_try='test -s conftest.$ac_objext'
7986   { (eval echo "$as_me:7986: \"$ac_try\"") >&5
7987   (eval $ac_try) 2>&5
7988   ac_status=$?
7989   echo "$as_me:7989: \$? = $ac_status" >&5
7990   (exit $ac_status); }; }; then
7991   :
7992 else
7993   echo "$as_me: failed program was:" >&5
7994 cat conftest.$ac_ext >&5
7995 cf_have_incdir=yes
7996 fi
7997 rm -f conftest.$ac_objext conftest.$ac_ext
7998                           CPPFLAGS=$cf_save_CPPFLAGS
7999                         fi
8000                   fi
8001                 fi
8002
8003                 if test "$cf_have_incdir" = no ; then
8004                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8005
8006 echo "${as_me:-configure}:8006: testing adding $cf_add_incdir to include-path ..." 1>&5
8007
8008                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8009
8010                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8011                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8012                   cf_add_incdir="$cf_top_incdir"
8013                 else
8014                   break
8015                 fi
8016           fi
8017         done
8018   done
8019 fi
8020
8021                 for cf_header in \
8022                         ncurses.h \
8023                         curses.h
8024                 do
8025
8026         cat >conftest.$ac_ext <<_ACEOF
8027 #line 8027 "configure"
8028 #include "confdefs.h"
8029
8030 #include <$cf_header>
8031 int
8032 main ()
8033 {
8034
8035 #ifdef NCURSES_VERSION
8036
8037 printf("%s\n", NCURSES_VERSION);
8038 #else
8039 #ifdef __NCURSES_H
8040 printf("old\n");
8041 #else
8042         make an error
8043 #endif
8044 #endif
8045
8046   ;
8047   return 0;
8048 }
8049 _ACEOF
8050 rm -f conftest.$ac_objext
8051 if { (eval echo "$as_me:8051: \"$ac_compile\"") >&5
8052   (eval $ac_compile) 2>&5
8053   ac_status=$?
8054   echo "$as_me:8054: \$? = $ac_status" >&5
8055   (exit $ac_status); } &&
8056          { ac_try='test -s conftest.$ac_objext'
8057   { (eval echo "$as_me:8057: \"$ac_try\"") >&5
8058   (eval $ac_try) 2>&5
8059   ac_status=$?
8060   echo "$as_me:8060: \$? = $ac_status" >&5
8061   (exit $ac_status); }; }; then
8062   cf_cv_ncurses_h2=$cf_header
8063
8064 else
8065   echo "$as_me: failed program was:" >&5
8066 cat conftest.$ac_ext >&5
8067 cf_cv_ncurses_h2=no
8068 fi
8069 rm -f conftest.$ac_objext conftest.$ac_ext
8070
8071                         if test "$cf_cv_ncurses_h2" != no ; then
8072                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8073                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8074                                 break
8075                         fi
8076                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8077                 done
8078                 CPPFLAGS="$cf_save2_CPPFLAGS"
8079                 test "$cf_cv_ncurses_h2" != no && break
8080         done
8081         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8081: error: not found" >&5
8082 echo "$as_me: error: not found" >&2;}
8083    { (exit 1); exit 1; }; }
8084
8085 fi
8086 echo "$as_me:8086: result: $cf_cv_ncurses_h2" >&5
8087 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8088
8089         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8090         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8091         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8092                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8093         fi
8094
8095 if test -n "$cf_1st_incdir" ; then
8096   for cf_add_incdir in $cf_1st_incdir
8097   do
8098         while test $cf_add_incdir != /usr/include
8099         do
8100           if test -d $cf_add_incdir
8101           then
8102                 cf_have_incdir=no
8103                 if test -n "$CFLAGS$CPPFLAGS" ; then
8104                   # a loop is needed to ensure we can add subdirs of existing dirs
8105                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8106                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8107                           cf_have_incdir=yes; break
8108                         fi
8109                   done
8110                 fi
8111
8112                 if test "$cf_have_incdir" = no ; then
8113                   if test "$cf_add_incdir" = /usr/local/include ; then
8114                         if test "$GCC" = yes
8115                         then
8116                           cf_save_CPPFLAGS=$CPPFLAGS
8117                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8118                           cat >conftest.$ac_ext <<_ACEOF
8119 #line 8119 "configure"
8120 #include "confdefs.h"
8121 #include <stdio.h>
8122 int
8123 main ()
8124 {
8125 printf("Hello")
8126   ;
8127   return 0;
8128 }
8129 _ACEOF
8130 rm -f conftest.$ac_objext
8131 if { (eval echo "$as_me:8131: \"$ac_compile\"") >&5
8132   (eval $ac_compile) 2>&5
8133   ac_status=$?
8134   echo "$as_me:8134: \$? = $ac_status" >&5
8135   (exit $ac_status); } &&
8136          { ac_try='test -s conftest.$ac_objext'
8137   { (eval echo "$as_me:8137: \"$ac_try\"") >&5
8138   (eval $ac_try) 2>&5
8139   ac_status=$?
8140   echo "$as_me:8140: \$? = $ac_status" >&5
8141   (exit $ac_status); }; }; then
8142   :
8143 else
8144   echo "$as_me: failed program was:" >&5
8145 cat conftest.$ac_ext >&5
8146 cf_have_incdir=yes
8147 fi
8148 rm -f conftest.$ac_objext conftest.$ac_ext
8149                           CPPFLAGS=$cf_save_CPPFLAGS
8150                         fi
8151                   fi
8152                 fi
8153
8154                 if test "$cf_have_incdir" = no ; then
8155                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8156
8157 echo "${as_me:-configure}:8157: testing adding $cf_add_incdir to include-path ..." 1>&5
8158
8159                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8160
8161                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8162                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8163                   cf_add_incdir="$cf_top_incdir"
8164                 else
8165                   break
8166                 fi
8167           fi
8168         done
8169   done
8170 fi
8171
8172 fi
8173
8174 # Set definitions to allow ifdef'ing for ncurses.h
8175
8176 case $cf_cv_ncurses_header in # (vi
8177 *ncurses.h)
8178
8179 cat >>confdefs.h <<\EOF
8180 #define HAVE_NCURSES_H 1
8181 EOF
8182
8183         ;;
8184 esac
8185
8186 case $cf_cv_ncurses_header in # (vi
8187 ncurses/curses.h|ncurses/ncurses.h)
8188
8189 cat >>confdefs.h <<\EOF
8190 #define HAVE_NCURSES_NCURSES_H 1
8191 EOF
8192
8193         ;;
8194 ncursesw/curses.h|ncursesw/ncurses.h)
8195
8196 cat >>confdefs.h <<\EOF
8197 #define HAVE_NCURSESW_NCURSES_H 1
8198 EOF
8199
8200         ;;
8201 esac
8202
8203 echo "$as_me:8203: checking for terminfo header" >&5
8204 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8205 if test "${cf_cv_term_header+set}" = set; then
8206   echo $ECHO_N "(cached) $ECHO_C" >&6
8207 else
8208
8209 case ${cf_cv_ncurses_header} in #(vi
8210 */ncurses.h|*/ncursesw.h) #(vi
8211         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8212         ;;
8213 *)
8214         cf_term_header=term.h
8215         ;;
8216 esac
8217
8218 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8219 do
8220 cat >conftest.$ac_ext <<_ACEOF
8221 #line 8221 "configure"
8222 #include "confdefs.h"
8223 #include <stdio.h>
8224 #include <${cf_cv_ncurses_header:-curses.h}>
8225 #include <$cf_test>
8226
8227 int
8228 main ()
8229 {
8230 int x = auto_left_margin
8231   ;
8232   return 0;
8233 }
8234 _ACEOF
8235 rm -f conftest.$ac_objext
8236 if { (eval echo "$as_me:8236: \"$ac_compile\"") >&5
8237   (eval $ac_compile) 2>&5
8238   ac_status=$?
8239   echo "$as_me:8239: \$? = $ac_status" >&5
8240   (exit $ac_status); } &&
8241          { ac_try='test -s conftest.$ac_objext'
8242   { (eval echo "$as_me:8242: \"$ac_try\"") >&5
8243   (eval $ac_try) 2>&5
8244   ac_status=$?
8245   echo "$as_me:8245: \$? = $ac_status" >&5
8246   (exit $ac_status); }; }; then
8247
8248         cf_cv_term_header="$cf_test"
8249 else
8250   echo "$as_me: failed program was:" >&5
8251 cat conftest.$ac_ext >&5
8252
8253         cf_cv_term_header=unknown
8254
8255 fi
8256 rm -f conftest.$ac_objext conftest.$ac_ext
8257         test "$cf_cv_term_header" != unknown && break
8258 done
8259
8260 fi
8261 echo "$as_me:8261: result: $cf_cv_term_header" >&5
8262 echo "${ECHO_T}$cf_cv_term_header" >&6
8263
8264 # Set definitions to allow ifdef'ing to accommodate subdirectories
8265
8266 case $cf_cv_term_header in # (vi
8267 *term.h)
8268
8269 cat >>confdefs.h <<\EOF
8270 #define HAVE_TERM_H 1
8271 EOF
8272
8273         ;;
8274 esac
8275
8276 case $cf_cv_term_header in # (vi
8277 ncurses/term.h) #(vi
8278
8279 cat >>confdefs.h <<\EOF
8280 #define HAVE_NCURSES_TERM_H 1
8281 EOF
8282
8283         ;;
8284 ncursesw/term.h)
8285
8286 cat >>confdefs.h <<\EOF
8287 #define HAVE_NCURSESW_TERM_H 1
8288 EOF
8289
8290         ;;
8291 esac
8292
8293 # some applications need this, but should check for NCURSES_VERSION
8294
8295 cat >>confdefs.h <<\EOF
8296 #define NCURSES 1
8297 EOF
8298
8299 echo "$as_me:8299: checking for ncurses version" >&5
8300 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8301 if test "${cf_cv_ncurses_version+set}" = set; then
8302   echo $ECHO_N "(cached) $ECHO_C" >&6
8303 else
8304
8305         cf_cv_ncurses_version=no
8306         cf_tempfile=out$$
8307         rm -f $cf_tempfile
8308         if test "$cross_compiling" = yes; then
8309
8310         # This will not work if the preprocessor splits the line after the
8311         # Autoconf token.  The 'unproto' program does that.
8312         cat > conftest.$ac_ext <<EOF
8313 #include <${cf_cv_ncurses_header:-curses.h}>
8314 #undef Autoconf
8315 #ifdef NCURSES_VERSION
8316 Autoconf NCURSES_VERSION
8317 #else
8318 #ifdef __NCURSES_H
8319 Autoconf "old"
8320 #endif
8321 ;
8322 #endif
8323 EOF
8324         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8325         { (eval echo "$as_me:8325: \"$cf_try\"") >&5
8326   (eval $cf_try) 2>&5
8327   ac_status=$?
8328   echo "$as_me:8328: \$? = $ac_status" >&5
8329   (exit $ac_status); }
8330         if test -f conftest.out ; then
8331                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8332                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8333                 rm -f conftest.out
8334         fi
8335
8336 else
8337   cat >conftest.$ac_ext <<_ACEOF
8338 #line 8338 "configure"
8339 #include "confdefs.h"
8340
8341 #include <${cf_cv_ncurses_header:-curses.h}>
8342 #include <stdio.h>
8343 int main()
8344 {
8345         FILE *fp = fopen("$cf_tempfile", "w");
8346 #ifdef NCURSES_VERSION
8347 # ifdef NCURSES_VERSION_PATCH
8348         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8349 # else
8350         fprintf(fp, "%s\n", NCURSES_VERSION);
8351 # endif
8352 #else
8353 # ifdef __NCURSES_H
8354         fprintf(fp, "old\n");
8355 # else
8356         make an error
8357 # endif
8358 #endif
8359         ${cf_cv_main_return:-return}(0);
8360 }
8361 _ACEOF
8362 rm -f conftest$ac_exeext
8363 if { (eval echo "$as_me:8363: \"$ac_link\"") >&5
8364   (eval $ac_link) 2>&5
8365   ac_status=$?
8366   echo "$as_me:8366: \$? = $ac_status" >&5
8367   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8368   { (eval echo "$as_me:8368: \"$ac_try\"") >&5
8369   (eval $ac_try) 2>&5
8370   ac_status=$?
8371   echo "$as_me:8371: \$? = $ac_status" >&5
8372   (exit $ac_status); }; }; then
8373
8374         cf_cv_ncurses_version=`cat $cf_tempfile`
8375 else
8376   echo "$as_me: program exited with status $ac_status" >&5
8377 echo "$as_me: failed program was:" >&5
8378 cat conftest.$ac_ext >&5
8379 fi
8380 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8381 fi
8382         rm -f $cf_tempfile
8383
8384 fi
8385 echo "$as_me:8385: result: $cf_cv_ncurses_version" >&5
8386 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8387 test "$cf_cv_ncurses_version" = no ||
8388 cat >>confdefs.h <<\EOF
8389 #define NCURSES 1
8390 EOF
8391
8392 cf_nculib_root=ncursesw
8393         # This works, except for the special case where we find gpm, but
8394         # ncurses is in a nonstandard location via $LIBS, and we really want
8395         # to link gpm.
8396 cf_ncurses_LIBS=""
8397 cf_ncurses_SAVE="$LIBS"
8398 echo "$as_me:8398: checking for Gpm_Open in -lgpm" >&5
8399 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8400 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8401   echo $ECHO_N "(cached) $ECHO_C" >&6
8402 else
8403   ac_check_lib_save_LIBS=$LIBS
8404 LIBS="-lgpm  $LIBS"
8405 cat >conftest.$ac_ext <<_ACEOF
8406 #line 8406 "configure"
8407 #include "confdefs.h"
8408
8409 /* Override any gcc2 internal prototype to avoid an error.  */
8410 #ifdef __cplusplus
8411 extern "C"
8412 #endif
8413 /* We use char because int might match the return type of a gcc2
8414    builtin and then its argument prototype would still apply.  */
8415 char Gpm_Open ();
8416 int
8417 main ()
8418 {
8419 Gpm_Open ();
8420   ;
8421   return 0;
8422 }
8423 _ACEOF
8424 rm -f conftest.$ac_objext conftest$ac_exeext
8425 if { (eval echo "$as_me:8425: \"$ac_link\"") >&5
8426   (eval $ac_link) 2>&5
8427   ac_status=$?
8428   echo "$as_me:8428: \$? = $ac_status" >&5
8429   (exit $ac_status); } &&
8430          { ac_try='test -s conftest$ac_exeext'
8431   { (eval echo "$as_me:8431: \"$ac_try\"") >&5
8432   (eval $ac_try) 2>&5
8433   ac_status=$?
8434   echo "$as_me:8434: \$? = $ac_status" >&5
8435   (exit $ac_status); }; }; then
8436   ac_cv_lib_gpm_Gpm_Open=yes
8437 else
8438   echo "$as_me: failed program was:" >&5
8439 cat conftest.$ac_ext >&5
8440 ac_cv_lib_gpm_Gpm_Open=no
8441 fi
8442 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8443 LIBS=$ac_check_lib_save_LIBS
8444 fi
8445 echo "$as_me:8445: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8446 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8447 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8448   echo "$as_me:8448: checking for initscr in -lgpm" >&5
8449 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8450 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8451   echo $ECHO_N "(cached) $ECHO_C" >&6
8452 else
8453   ac_check_lib_save_LIBS=$LIBS
8454 LIBS="-lgpm  $LIBS"
8455 cat >conftest.$ac_ext <<_ACEOF
8456 #line 8456 "configure"
8457 #include "confdefs.h"
8458
8459 /* Override any gcc2 internal prototype to avoid an error.  */
8460 #ifdef __cplusplus
8461 extern "C"
8462 #endif
8463 /* We use char because int might match the return type of a gcc2
8464    builtin and then its argument prototype would still apply.  */
8465 char initscr ();
8466 int
8467 main ()
8468 {
8469 initscr ();
8470   ;
8471   return 0;
8472 }
8473 _ACEOF
8474 rm -f conftest.$ac_objext conftest$ac_exeext
8475 if { (eval echo "$as_me:8475: \"$ac_link\"") >&5
8476   (eval $ac_link) 2>&5
8477   ac_status=$?
8478   echo "$as_me:8478: \$? = $ac_status" >&5
8479   (exit $ac_status); } &&
8480          { ac_try='test -s conftest$ac_exeext'
8481   { (eval echo "$as_me:8481: \"$ac_try\"") >&5
8482   (eval $ac_try) 2>&5
8483   ac_status=$?
8484   echo "$as_me:8484: \$? = $ac_status" >&5
8485   (exit $ac_status); }; }; then
8486   ac_cv_lib_gpm_initscr=yes
8487 else
8488   echo "$as_me: failed program was:" >&5
8489 cat conftest.$ac_ext >&5
8490 ac_cv_lib_gpm_initscr=no
8491 fi
8492 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8493 LIBS=$ac_check_lib_save_LIBS
8494 fi
8495 echo "$as_me:8495: result: $ac_cv_lib_gpm_initscr" >&5
8496 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8497 if test $ac_cv_lib_gpm_initscr = yes; then
8498   LIBS="$cf_ncurses_SAVE"
8499 else
8500   cf_ncurses_LIBS="-lgpm"
8501 fi
8502
8503 fi
8504
8505 case $host_os in #(vi
8506 freebsd*)
8507         # This is only necessary if you are linking against an obsolete
8508         # version of ncurses (but it should do no harm, since it's static).
8509         if test "$cf_nculib_root" = ncurses ; then
8510                 echo "$as_me:8510: checking for tgoto in -lmytinfo" >&5
8511 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8512 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8513   echo $ECHO_N "(cached) $ECHO_C" >&6
8514 else
8515   ac_check_lib_save_LIBS=$LIBS
8516 LIBS="-lmytinfo  $LIBS"
8517 cat >conftest.$ac_ext <<_ACEOF
8518 #line 8518 "configure"
8519 #include "confdefs.h"
8520
8521 /* Override any gcc2 internal prototype to avoid an error.  */
8522 #ifdef __cplusplus
8523 extern "C"
8524 #endif
8525 /* We use char because int might match the return type of a gcc2
8526    builtin and then its argument prototype would still apply.  */
8527 char tgoto ();
8528 int
8529 main ()
8530 {
8531 tgoto ();
8532   ;
8533   return 0;
8534 }
8535 _ACEOF
8536 rm -f conftest.$ac_objext conftest$ac_exeext
8537 if { (eval echo "$as_me:8537: \"$ac_link\"") >&5
8538   (eval $ac_link) 2>&5
8539   ac_status=$?
8540   echo "$as_me:8540: \$? = $ac_status" >&5
8541   (exit $ac_status); } &&
8542          { ac_try='test -s conftest$ac_exeext'
8543   { (eval echo "$as_me:8543: \"$ac_try\"") >&5
8544   (eval $ac_try) 2>&5
8545   ac_status=$?
8546   echo "$as_me:8546: \$? = $ac_status" >&5
8547   (exit $ac_status); }; }; then
8548   ac_cv_lib_mytinfo_tgoto=yes
8549 else
8550   echo "$as_me: failed program was:" >&5
8551 cat conftest.$ac_ext >&5
8552 ac_cv_lib_mytinfo_tgoto=no
8553 fi
8554 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8555 LIBS=$ac_check_lib_save_LIBS
8556 fi
8557 echo "$as_me:8557: result: $ac_cv_lib_mytinfo_tgoto" >&5
8558 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8559 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8560   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8561 fi
8562
8563         fi
8564         ;;
8565 esac
8566
8567 cf_add_libs="$cf_ncurses_LIBS"
8568 # Filter out duplicates - this happens with badly-designed ".pc" files...
8569 for cf_add_1lib in $LIBS
8570 do
8571         for cf_add_2lib in $cf_add_libs
8572         do
8573                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8574                 then
8575                         cf_add_1lib=
8576                         break
8577                 fi
8578         done
8579         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8580 done
8581 LIBS="$cf_add_libs"
8582
8583 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8584 then
8585
8586 cf_add_libs="-l$cf_nculib_root"
8587 # Filter out duplicates - this happens with badly-designed ".pc" files...
8588 for cf_add_1lib in $LIBS
8589 do
8590         for cf_add_2lib in $cf_add_libs
8591         do
8592                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8593                 then
8594                         cf_add_1lib=
8595                         break
8596                 fi
8597         done
8598         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8599 done
8600 LIBS="$cf_add_libs"
8601
8602 else
8603
8604         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8605         cf_libdir=""
8606         echo "$as_me:8606: checking for initscr" >&5
8607 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8608 if test "${ac_cv_func_initscr+set}" = set; then
8609   echo $ECHO_N "(cached) $ECHO_C" >&6
8610 else
8611   cat >conftest.$ac_ext <<_ACEOF
8612 #line 8612 "configure"
8613 #include "confdefs.h"
8614 /* System header to define __stub macros and hopefully few prototypes,
8615     which can conflict with char initscr (); below.  */
8616 #include <assert.h>
8617 /* Override any gcc2 internal prototype to avoid an error.  */
8618 #ifdef __cplusplus
8619 extern "C"
8620 #endif
8621 /* We use char because int might match the return type of a gcc2
8622    builtin and then its argument prototype would still apply.  */
8623 char initscr ();
8624 char (*f) ();
8625
8626 int
8627 main ()
8628 {
8629 /* The GNU C library defines this for functions which it implements
8630     to always fail with ENOSYS.  Some functions are actually named
8631     something starting with __ and the normal name is an alias.  */
8632 #if defined (__stub_initscr) || defined (__stub___initscr)
8633 choke me
8634 #else
8635 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8636 #endif
8637
8638   ;
8639   return 0;
8640 }
8641 _ACEOF
8642 rm -f conftest.$ac_objext conftest$ac_exeext
8643 if { (eval echo "$as_me:8643: \"$ac_link\"") >&5
8644   (eval $ac_link) 2>&5
8645   ac_status=$?
8646   echo "$as_me:8646: \$? = $ac_status" >&5
8647   (exit $ac_status); } &&
8648          { ac_try='test -s conftest$ac_exeext'
8649   { (eval echo "$as_me:8649: \"$ac_try\"") >&5
8650   (eval $ac_try) 2>&5
8651   ac_status=$?
8652   echo "$as_me:8652: \$? = $ac_status" >&5
8653   (exit $ac_status); }; }; then
8654   ac_cv_func_initscr=yes
8655 else
8656   echo "$as_me: failed program was:" >&5
8657 cat conftest.$ac_ext >&5
8658 ac_cv_func_initscr=no
8659 fi
8660 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8661 fi
8662 echo "$as_me:8662: result: $ac_cv_func_initscr" >&5
8663 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8664 if test $ac_cv_func_initscr = yes; then
8665   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8666 else
8667
8668                 cf_save_LIBS="$LIBS"
8669                 echo "$as_me:8669: checking for initscr in -l$cf_nculib_root" >&5
8670 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8671                 LIBS="-l$cf_nculib_root $LIBS"
8672                 cat >conftest.$ac_ext <<_ACEOF
8673 #line 8673 "configure"
8674 #include "confdefs.h"
8675 #include <${cf_cv_ncurses_header:-curses.h}>
8676 int
8677 main ()
8678 {
8679 initscr()
8680   ;
8681   return 0;
8682 }
8683 _ACEOF
8684 rm -f conftest.$ac_objext conftest$ac_exeext
8685 if { (eval echo "$as_me:8685: \"$ac_link\"") >&5
8686   (eval $ac_link) 2>&5
8687   ac_status=$?
8688   echo "$as_me:8688: \$? = $ac_status" >&5
8689   (exit $ac_status); } &&
8690          { ac_try='test -s conftest$ac_exeext'
8691   { (eval echo "$as_me:8691: \"$ac_try\"") >&5
8692   (eval $ac_try) 2>&5
8693   ac_status=$?
8694   echo "$as_me:8694: \$? = $ac_status" >&5
8695   (exit $ac_status); }; }; then
8696   echo "$as_me:8696: result: yes" >&5
8697 echo "${ECHO_T}yes" >&6
8698                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8699
8700 else
8701   echo "$as_me: failed program was:" >&5
8702 cat conftest.$ac_ext >&5
8703 echo "$as_me:8703: result: no" >&5
8704 echo "${ECHO_T}no" >&6
8705
8706 cf_search=
8707 cf_library_path_list=""
8708 if test -n "${LDFLAGS}${LIBS}" ; then
8709         for cf_library_path in $LDFLAGS $LIBS
8710         do
8711                 case $cf_library_path in #(vi
8712                 -L*)
8713                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8714
8715 test "x$cf_library_path" != "xNONE" && \
8716 test -d "$cf_library_path" && \
8717  {
8718         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8719         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8720         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8721         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8722         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8723         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"
8724 }
8725
8726                         cf_library_path_list="$cf_library_path_list $cf_search"
8727                         ;;
8728                 esac
8729         done
8730 fi
8731
8732 cf_search=
8733
8734 test "x$prefix" != "xNONE" && \
8735 test -d "$prefix" && \
8736  {
8737         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8738         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8739         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8740         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8741         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8742         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8743 }
8744
8745 for cf_subdir_prefix in \
8746         /usr \
8747         /usr/local \
8748         /usr/pkg \
8749         /opt \
8750         /opt/local \
8751         $HOME
8752 do
8753
8754 test "x$cf_subdir_prefix" != "x$prefix" && \
8755 test -d "$cf_subdir_prefix" && \
8756 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8757         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8758         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8759         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8760         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8761         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8762         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"
8763 }
8764
8765 done
8766
8767 cf_search="$cf_library_path_list $cf_search"
8768
8769                         for cf_libdir in $cf_search
8770                         do
8771                                 echo "$as_me:8771: checking for -l$cf_nculib_root in $cf_libdir" >&5
8772 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8773                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8774                                 cat >conftest.$ac_ext <<_ACEOF
8775 #line 8775 "configure"
8776 #include "confdefs.h"
8777 #include <${cf_cv_ncurses_header:-curses.h}>
8778 int
8779 main ()
8780 {
8781 initscr()
8782   ;
8783   return 0;
8784 }
8785 _ACEOF
8786 rm -f conftest.$ac_objext conftest$ac_exeext
8787 if { (eval echo "$as_me:8787: \"$ac_link\"") >&5
8788   (eval $ac_link) 2>&5
8789   ac_status=$?
8790   echo "$as_me:8790: \$? = $ac_status" >&5
8791   (exit $ac_status); } &&
8792          { ac_try='test -s conftest$ac_exeext'
8793   { (eval echo "$as_me:8793: \"$ac_try\"") >&5
8794   (eval $ac_try) 2>&5
8795   ac_status=$?
8796   echo "$as_me:8796: \$? = $ac_status" >&5
8797   (exit $ac_status); }; }; then
8798   echo "$as_me:8798: result: yes" >&5
8799 echo "${ECHO_T}yes" >&6
8800                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8801                                          break
8802 else
8803   echo "$as_me: failed program was:" >&5
8804 cat conftest.$ac_ext >&5
8805 echo "$as_me:8805: result: no" >&5
8806 echo "${ECHO_T}no" >&6
8807                                          LIBS="$cf_save_LIBS"
8808 fi
8809 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8810                         done
8811
8812 fi
8813 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8814
8815 fi
8816
8817 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8818
8819 if test $cf_found_library = no ; then
8820         { { echo "$as_me:8820: error: Cannot link $cf_nculib_root library" >&5
8821 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8822    { (exit 1); exit 1; }; }
8823 fi
8824
8825 fi
8826
8827 if test -n "$cf_ncurses_LIBS" ; then
8828         echo "$as_me:8828: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8829 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8830         cf_ncurses_SAVE="$LIBS"
8831         for p in $cf_ncurses_LIBS ; do
8832                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8833                 if test "$q" != "$LIBS" ; then
8834                         LIBS="$q"
8835                 fi
8836         done
8837         cat >conftest.$ac_ext <<_ACEOF
8838 #line 8838 "configure"
8839 #include "confdefs.h"
8840 #include <${cf_cv_ncurses_header:-curses.h}>
8841 int
8842 main ()
8843 {
8844 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8845   ;
8846   return 0;
8847 }
8848 _ACEOF
8849 rm -f conftest.$ac_objext conftest$ac_exeext
8850 if { (eval echo "$as_me:8850: \"$ac_link\"") >&5
8851   (eval $ac_link) 2>&5
8852   ac_status=$?
8853   echo "$as_me:8853: \$? = $ac_status" >&5
8854   (exit $ac_status); } &&
8855          { ac_try='test -s conftest$ac_exeext'
8856   { (eval echo "$as_me:8856: \"$ac_try\"") >&5
8857   (eval $ac_try) 2>&5
8858   ac_status=$?
8859   echo "$as_me:8859: \$? = $ac_status" >&5
8860   (exit $ac_status); }; }; then
8861   echo "$as_me:8861: result: yes" >&5
8862 echo "${ECHO_T}yes" >&6
8863 else
8864   echo "$as_me: failed program was:" >&5
8865 cat conftest.$ac_ext >&5
8866 echo "$as_me:8866: result: no" >&5
8867 echo "${ECHO_T}no" >&6
8868                  LIBS="$cf_ncurses_SAVE"
8869 fi
8870 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8871 fi
8872
8873 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8874
8875 cat >>confdefs.h <<EOF
8876 #define $cf_nculib_ROOT 1
8877 EOF
8878
8879 fi
8880
8881         ;;
8882 pdcurses)
8883         echo "$as_me:8883: checking for X" >&5
8884 echo $ECHO_N "checking for X... $ECHO_C" >&6
8885
8886 # Check whether --with-x or --without-x was given.
8887 if test "${with_x+set}" = set; then
8888   withval="$with_x"
8889
8890 fi;
8891 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
8892 if test "x$with_x" = xno; then
8893   # The user explicitly disabled X.
8894   have_x=disabled
8895 else
8896   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
8897     # Both variables are already set.
8898     have_x=yes
8899   else
8900     if test "${ac_cv_have_x+set}" = set; then
8901   echo $ECHO_N "(cached) $ECHO_C" >&6
8902 else
8903   # One or both of the vars are not set, and there is no cached value.
8904 ac_x_includes=no ac_x_libraries=no
8905 rm -fr conftest.dir
8906 if mkdir conftest.dir; then
8907   cd conftest.dir
8908   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
8909   cat >Imakefile <<'EOF'
8910 acfindx:
8911         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
8912 EOF
8913   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
8914     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
8915     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
8916     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
8917     for ac_extension in a so sl dylib dll; do
8918       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
8919          test -f $ac_im_libdir/libX11.$ac_extension; then
8920         ac_im_usrlibdir=$ac_im_libdir; break
8921       fi
8922     done
8923     # Screen out bogus values from the imake configuration.  They are
8924     # bogus both because they are the default anyway, and because
8925     # using them would break gcc on systems where it needs fixed includes.
8926     case $ac_im_incroot in
8927         /usr/include) ;;
8928         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
8929     esac
8930     case $ac_im_usrlibdir in
8931         /usr/lib | /lib) ;;
8932         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
8933     esac
8934   fi
8935   cd ..
8936   rm -fr conftest.dir
8937 fi
8938
8939 # Standard set of common directories for X headers.
8940 # Check X11 before X11Rn because it is often a symlink to the current release.
8941 ac_x_header_dirs='
8942 /usr/X11/include
8943 /usr/X11R6/include
8944 /usr/X11R5/include
8945 /usr/X11R4/include
8946
8947 /usr/include/X11
8948 /usr/include/X11R6
8949 /usr/include/X11R5
8950 /usr/include/X11R4
8951
8952 /usr/local/X11/include
8953 /usr/local/X11R6/include
8954 /usr/local/X11R5/include
8955 /usr/local/X11R4/include
8956
8957 /usr/local/include/X11
8958 /usr/local/include/X11R6
8959 /usr/local/include/X11R5
8960 /usr/local/include/X11R4
8961
8962 /usr/X386/include
8963 /usr/x386/include
8964 /usr/XFree86/include/X11
8965
8966 /usr/include
8967 /usr/local/include
8968 /usr/unsupported/include
8969 /usr/athena/include
8970 /usr/local/x11r5/include
8971 /usr/lpp/Xamples/include
8972
8973 /usr/openwin/include
8974 /usr/openwin/share/include'
8975
8976 if test "$ac_x_includes" = no; then
8977   # Guess where to find include files, by looking for Intrinsic.h.
8978   # First, try using that file with no special directory specified.
8979   cat >conftest.$ac_ext <<_ACEOF
8980 #line 8980 "configure"
8981 #include "confdefs.h"
8982 #include <X11/Intrinsic.h>
8983 _ACEOF
8984 if { (eval echo "$as_me:8984: \"$ac_cpp conftest.$ac_ext\"") >&5
8985   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8986   ac_status=$?
8987   egrep -v '^ *\+' conftest.er1 >conftest.err
8988   rm -f conftest.er1
8989   cat conftest.err >&5
8990   echo "$as_me:8990: \$? = $ac_status" >&5
8991   (exit $ac_status); } >/dev/null; then
8992   if test -s conftest.err; then
8993     ac_cpp_err=$ac_c_preproc_warn_flag
8994   else
8995     ac_cpp_err=
8996   fi
8997 else
8998   ac_cpp_err=yes
8999 fi
9000 if test -z "$ac_cpp_err"; then
9001   # We can compile using X headers with no special include directory.
9002 ac_x_includes=
9003 else
9004   echo "$as_me: failed program was:" >&5
9005   cat conftest.$ac_ext >&5
9006   for ac_dir in $ac_x_header_dirs; do
9007   if test -r "$ac_dir/X11/Intrinsic.h"; then
9008     ac_x_includes=$ac_dir
9009     break
9010   fi
9011 done
9012 fi
9013 rm -f conftest.err conftest.$ac_ext
9014 fi # $ac_x_includes = no
9015
9016 if test "$ac_x_libraries" = no; then
9017   # Check for the libraries.
9018   # See if we find them without any special options.
9019   # Don't add to $LIBS permanently.
9020   ac_save_LIBS=$LIBS
9021   LIBS="-lXt $LIBS"
9022   cat >conftest.$ac_ext <<_ACEOF
9023 #line 9023 "configure"
9024 #include "confdefs.h"
9025 #include <X11/Intrinsic.h>
9026 int
9027 main ()
9028 {
9029 XtMalloc (0)
9030   ;
9031   return 0;
9032 }
9033 _ACEOF
9034 rm -f conftest.$ac_objext conftest$ac_exeext
9035 if { (eval echo "$as_me:9035: \"$ac_link\"") >&5
9036   (eval $ac_link) 2>&5
9037   ac_status=$?
9038   echo "$as_me:9038: \$? = $ac_status" >&5
9039   (exit $ac_status); } &&
9040          { ac_try='test -s conftest$ac_exeext'
9041   { (eval echo "$as_me:9041: \"$ac_try\"") >&5
9042   (eval $ac_try) 2>&5
9043   ac_status=$?
9044   echo "$as_me:9044: \$? = $ac_status" >&5
9045   (exit $ac_status); }; }; then
9046   LIBS=$ac_save_LIBS
9047 # We can link X programs with no special library path.
9048 ac_x_libraries=
9049 else
9050   echo "$as_me: failed program was:" >&5
9051 cat conftest.$ac_ext >&5
9052 LIBS=$ac_save_LIBS
9053 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9054 do
9055   # Don't even attempt the hair of trying to link an X program!
9056   for ac_extension in a so sl dylib dll; do
9057     if test -r $ac_dir/libXt.$ac_extension; then
9058       ac_x_libraries=$ac_dir
9059       break 2
9060     fi
9061   done
9062 done
9063 fi
9064 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9065 fi # $ac_x_libraries = no
9066
9067 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9068   # Didn't find X anywhere.  Cache the known absence of X.
9069   ac_cv_have_x="have_x=no"
9070 else
9071   # Record where we found X for the cache.
9072   ac_cv_have_x="have_x=yes \
9073                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9074 fi
9075 fi
9076
9077   fi
9078   eval "$ac_cv_have_x"
9079 fi # $with_x != no
9080
9081 if test "$have_x" != yes; then
9082   echo "$as_me:9082: result: $have_x" >&5
9083 echo "${ECHO_T}$have_x" >&6
9084   no_x=yes
9085 else
9086   # If each of the values was on the command line, it overrides each guess.
9087   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9088   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9089   # Update the cache value to reflect the command line values.
9090   ac_cv_have_x="have_x=yes \
9091                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9092   echo "$as_me:9092: result: libraries $x_libraries, headers $x_includes" >&5
9093 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9094 fi
9095
9096 if test "$no_x" = yes; then
9097   # Not all programs may use this symbol, but it does not hurt to define it.
9098
9099 cat >>confdefs.h <<\EOF
9100 #define X_DISPLAY_MISSING 1
9101 EOF
9102
9103   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9104 else
9105   if test -n "$x_includes"; then
9106     X_CFLAGS="$X_CFLAGS -I$x_includes"
9107   fi
9108
9109   # It would also be nice to do this for all -L options, not just this one.
9110   if test -n "$x_libraries"; then
9111     X_LIBS="$X_LIBS -L$x_libraries"
9112     # For Solaris; some versions of Sun CC require a space after -R and
9113     # others require no space.  Words are not sufficient . . . .
9114     case `(uname -sr) 2>/dev/null` in
9115     "SunOS 5"*)
9116       echo "$as_me:9116: checking whether -R must be followed by a space" >&5
9117 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9118       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9119       cat >conftest.$ac_ext <<_ACEOF
9120 #line 9120 "configure"
9121 #include "confdefs.h"
9122
9123 int
9124 main ()
9125 {
9126
9127   ;
9128   return 0;
9129 }
9130 _ACEOF
9131 rm -f conftest.$ac_objext conftest$ac_exeext
9132 if { (eval echo "$as_me:9132: \"$ac_link\"") >&5
9133   (eval $ac_link) 2>&5
9134   ac_status=$?
9135   echo "$as_me:9135: \$? = $ac_status" >&5
9136   (exit $ac_status); } &&
9137          { ac_try='test -s conftest$ac_exeext'
9138   { (eval echo "$as_me:9138: \"$ac_try\"") >&5
9139   (eval $ac_try) 2>&5
9140   ac_status=$?
9141   echo "$as_me:9141: \$? = $ac_status" >&5
9142   (exit $ac_status); }; }; then
9143   ac_R_nospace=yes
9144 else
9145   echo "$as_me: failed program was:" >&5
9146 cat conftest.$ac_ext >&5
9147 ac_R_nospace=no
9148 fi
9149 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9150       if test $ac_R_nospace = yes; then
9151         echo "$as_me:9151: result: no" >&5
9152 echo "${ECHO_T}no" >&6
9153         X_LIBS="$X_LIBS -R$x_libraries"
9154       else
9155         LIBS="$ac_xsave_LIBS -R $x_libraries"
9156         cat >conftest.$ac_ext <<_ACEOF
9157 #line 9157 "configure"
9158 #include "confdefs.h"
9159
9160 int
9161 main ()
9162 {
9163
9164   ;
9165   return 0;
9166 }
9167 _ACEOF
9168 rm -f conftest.$ac_objext conftest$ac_exeext
9169 if { (eval echo "$as_me:9169: \"$ac_link\"") >&5
9170   (eval $ac_link) 2>&5
9171   ac_status=$?
9172   echo "$as_me:9172: \$? = $ac_status" >&5
9173   (exit $ac_status); } &&
9174          { ac_try='test -s conftest$ac_exeext'
9175   { (eval echo "$as_me:9175: \"$ac_try\"") >&5
9176   (eval $ac_try) 2>&5
9177   ac_status=$?
9178   echo "$as_me:9178: \$? = $ac_status" >&5
9179   (exit $ac_status); }; }; then
9180   ac_R_space=yes
9181 else
9182   echo "$as_me: failed program was:" >&5
9183 cat conftest.$ac_ext >&5
9184 ac_R_space=no
9185 fi
9186 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9187         if test $ac_R_space = yes; then
9188           echo "$as_me:9188: result: yes" >&5
9189 echo "${ECHO_T}yes" >&6
9190           X_LIBS="$X_LIBS -R $x_libraries"
9191         else
9192           echo "$as_me:9192: result: neither works" >&5
9193 echo "${ECHO_T}neither works" >&6
9194         fi
9195       fi
9196       LIBS=$ac_xsave_LIBS
9197     esac
9198   fi
9199
9200   # Check for system-dependent libraries X programs must link with.
9201   # Do this before checking for the system-independent R6 libraries
9202   # (-lICE), since we may need -lsocket or whatever for X linking.
9203
9204   if test "$ISC" = yes; then
9205     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9206   else
9207     # Martyn Johnson says this is needed for Ultrix, if the X
9208     # libraries were built with DECnet support.  And Karl Berry says
9209     # the Alpha needs dnet_stub (dnet does not exist).
9210     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9211     cat >conftest.$ac_ext <<_ACEOF
9212 #line 9212 "configure"
9213 #include "confdefs.h"
9214
9215 /* Override any gcc2 internal prototype to avoid an error.  */
9216 #ifdef __cplusplus
9217 extern "C"
9218 #endif
9219 /* We use char because int might match the return type of a gcc2
9220    builtin and then its argument prototype would still apply.  */
9221 char XOpenDisplay ();
9222 int
9223 main ()
9224 {
9225 XOpenDisplay ();
9226   ;
9227   return 0;
9228 }
9229 _ACEOF
9230 rm -f conftest.$ac_objext conftest$ac_exeext
9231 if { (eval echo "$as_me:9231: \"$ac_link\"") >&5
9232   (eval $ac_link) 2>&5
9233   ac_status=$?
9234   echo "$as_me:9234: \$? = $ac_status" >&5
9235   (exit $ac_status); } &&
9236          { ac_try='test -s conftest$ac_exeext'
9237   { (eval echo "$as_me:9237: \"$ac_try\"") >&5
9238   (eval $ac_try) 2>&5
9239   ac_status=$?
9240   echo "$as_me:9240: \$? = $ac_status" >&5
9241   (exit $ac_status); }; }; then
9242   :
9243 else
9244   echo "$as_me: failed program was:" >&5
9245 cat conftest.$ac_ext >&5
9246 echo "$as_me:9246: checking for dnet_ntoa in -ldnet" >&5
9247 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9248 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9249   echo $ECHO_N "(cached) $ECHO_C" >&6
9250 else
9251   ac_check_lib_save_LIBS=$LIBS
9252 LIBS="-ldnet  $LIBS"
9253 cat >conftest.$ac_ext <<_ACEOF
9254 #line 9254 "configure"
9255 #include "confdefs.h"
9256
9257 /* Override any gcc2 internal prototype to avoid an error.  */
9258 #ifdef __cplusplus
9259 extern "C"
9260 #endif
9261 /* We use char because int might match the return type of a gcc2
9262    builtin and then its argument prototype would still apply.  */
9263 char dnet_ntoa ();
9264 int
9265 main ()
9266 {
9267 dnet_ntoa ();
9268   ;
9269   return 0;
9270 }
9271 _ACEOF
9272 rm -f conftest.$ac_objext conftest$ac_exeext
9273 if { (eval echo "$as_me:9273: \"$ac_link\"") >&5
9274   (eval $ac_link) 2>&5
9275   ac_status=$?
9276   echo "$as_me:9276: \$? = $ac_status" >&5
9277   (exit $ac_status); } &&
9278          { ac_try='test -s conftest$ac_exeext'
9279   { (eval echo "$as_me:9279: \"$ac_try\"") >&5
9280   (eval $ac_try) 2>&5
9281   ac_status=$?
9282   echo "$as_me:9282: \$? = $ac_status" >&5
9283   (exit $ac_status); }; }; then
9284   ac_cv_lib_dnet_dnet_ntoa=yes
9285 else
9286   echo "$as_me: failed program was:" >&5
9287 cat conftest.$ac_ext >&5
9288 ac_cv_lib_dnet_dnet_ntoa=no
9289 fi
9290 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9291 LIBS=$ac_check_lib_save_LIBS
9292 fi
9293 echo "$as_me:9293: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9294 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9295 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9296   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9297 fi
9298
9299     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9300       echo "$as_me:9300: checking for dnet_ntoa in -ldnet_stub" >&5
9301 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9302 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9303   echo $ECHO_N "(cached) $ECHO_C" >&6
9304 else
9305   ac_check_lib_save_LIBS=$LIBS
9306 LIBS="-ldnet_stub  $LIBS"
9307 cat >conftest.$ac_ext <<_ACEOF
9308 #line 9308 "configure"
9309 #include "confdefs.h"
9310
9311 /* Override any gcc2 internal prototype to avoid an error.  */
9312 #ifdef __cplusplus
9313 extern "C"
9314 #endif
9315 /* We use char because int might match the return type of a gcc2
9316    builtin and then its argument prototype would still apply.  */
9317 char dnet_ntoa ();
9318 int
9319 main ()
9320 {
9321 dnet_ntoa ();
9322   ;
9323   return 0;
9324 }
9325 _ACEOF
9326 rm -f conftest.$ac_objext conftest$ac_exeext
9327 if { (eval echo "$as_me:9327: \"$ac_link\"") >&5
9328   (eval $ac_link) 2>&5
9329   ac_status=$?
9330   echo "$as_me:9330: \$? = $ac_status" >&5
9331   (exit $ac_status); } &&
9332          { ac_try='test -s conftest$ac_exeext'
9333   { (eval echo "$as_me:9333: \"$ac_try\"") >&5
9334   (eval $ac_try) 2>&5
9335   ac_status=$?
9336   echo "$as_me:9336: \$? = $ac_status" >&5
9337   (exit $ac_status); }; }; then
9338   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9339 else
9340   echo "$as_me: failed program was:" >&5
9341 cat conftest.$ac_ext >&5
9342 ac_cv_lib_dnet_stub_dnet_ntoa=no
9343 fi
9344 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9345 LIBS=$ac_check_lib_save_LIBS
9346 fi
9347 echo "$as_me:9347: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9348 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9349 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9350   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9351 fi
9352
9353     fi
9354 fi
9355 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9356     LIBS="$ac_xsave_LIBS"
9357
9358     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9359     # to get the SysV transport functions.
9360     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9361     # needs -lnsl.
9362     # The nsl library prevents programs from opening the X display
9363     # on Irix 5.2, according to T.E. Dickey.
9364     # The functions gethostbyname, getservbyname, and inet_addr are
9365     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9366     echo "$as_me:9366: checking for gethostbyname" >&5
9367 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9368 if test "${ac_cv_func_gethostbyname+set}" = set; then
9369   echo $ECHO_N "(cached) $ECHO_C" >&6
9370 else
9371   cat >conftest.$ac_ext <<_ACEOF
9372 #line 9372 "configure"
9373 #include "confdefs.h"
9374 /* System header to define __stub macros and hopefully few prototypes,
9375     which can conflict with char gethostbyname (); below.  */
9376 #include <assert.h>
9377 /* Override any gcc2 internal prototype to avoid an error.  */
9378 #ifdef __cplusplus
9379 extern "C"
9380 #endif
9381 /* We use char because int might match the return type of a gcc2
9382    builtin and then its argument prototype would still apply.  */
9383 char gethostbyname ();
9384 char (*f) ();
9385
9386 int
9387 main ()
9388 {
9389 /* The GNU C library defines this for functions which it implements
9390     to always fail with ENOSYS.  Some functions are actually named
9391     something starting with __ and the normal name is an alias.  */
9392 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9393 choke me
9394 #else
9395 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9396 #endif
9397
9398   ;
9399   return 0;
9400 }
9401 _ACEOF
9402 rm -f conftest.$ac_objext conftest$ac_exeext
9403 if { (eval echo "$as_me:9403: \"$ac_link\"") >&5
9404   (eval $ac_link) 2>&5
9405   ac_status=$?
9406   echo "$as_me:9406: \$? = $ac_status" >&5
9407   (exit $ac_status); } &&
9408          { ac_try='test -s conftest$ac_exeext'
9409   { (eval echo "$as_me:9409: \"$ac_try\"") >&5
9410   (eval $ac_try) 2>&5
9411   ac_status=$?
9412   echo "$as_me:9412: \$? = $ac_status" >&5
9413   (exit $ac_status); }; }; then
9414   ac_cv_func_gethostbyname=yes
9415 else
9416   echo "$as_me: failed program was:" >&5
9417 cat conftest.$ac_ext >&5
9418 ac_cv_func_gethostbyname=no
9419 fi
9420 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9421 fi
9422 echo "$as_me:9422: result: $ac_cv_func_gethostbyname" >&5
9423 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9424
9425     if test $ac_cv_func_gethostbyname = no; then
9426       echo "$as_me:9426: checking for gethostbyname in -lnsl" >&5
9427 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9428 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9429   echo $ECHO_N "(cached) $ECHO_C" >&6
9430 else
9431   ac_check_lib_save_LIBS=$LIBS
9432 LIBS="-lnsl  $LIBS"
9433 cat >conftest.$ac_ext <<_ACEOF
9434 #line 9434 "configure"
9435 #include "confdefs.h"
9436
9437 /* Override any gcc2 internal prototype to avoid an error.  */
9438 #ifdef __cplusplus
9439 extern "C"
9440 #endif
9441 /* We use char because int might match the return type of a gcc2
9442    builtin and then its argument prototype would still apply.  */
9443 char gethostbyname ();
9444 int
9445 main ()
9446 {
9447 gethostbyname ();
9448   ;
9449   return 0;
9450 }
9451 _ACEOF
9452 rm -f conftest.$ac_objext conftest$ac_exeext
9453 if { (eval echo "$as_me:9453: \"$ac_link\"") >&5
9454   (eval $ac_link) 2>&5
9455   ac_status=$?
9456   echo "$as_me:9456: \$? = $ac_status" >&5
9457   (exit $ac_status); } &&
9458          { ac_try='test -s conftest$ac_exeext'
9459   { (eval echo "$as_me:9459: \"$ac_try\"") >&5
9460   (eval $ac_try) 2>&5
9461   ac_status=$?
9462   echo "$as_me:9462: \$? = $ac_status" >&5
9463   (exit $ac_status); }; }; then
9464   ac_cv_lib_nsl_gethostbyname=yes
9465 else
9466   echo "$as_me: failed program was:" >&5
9467 cat conftest.$ac_ext >&5
9468 ac_cv_lib_nsl_gethostbyname=no
9469 fi
9470 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9471 LIBS=$ac_check_lib_save_LIBS
9472 fi
9473 echo "$as_me:9473: result: $ac_cv_lib_nsl_gethostbyname" >&5
9474 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9475 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9476   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9477 fi
9478
9479       if test $ac_cv_lib_nsl_gethostbyname = no; then
9480         echo "$as_me:9480: checking for gethostbyname in -lbsd" >&5
9481 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9482 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9483   echo $ECHO_N "(cached) $ECHO_C" >&6
9484 else
9485   ac_check_lib_save_LIBS=$LIBS
9486 LIBS="-lbsd  $LIBS"
9487 cat >conftest.$ac_ext <<_ACEOF
9488 #line 9488 "configure"
9489 #include "confdefs.h"
9490
9491 /* Override any gcc2 internal prototype to avoid an error.  */
9492 #ifdef __cplusplus
9493 extern "C"
9494 #endif
9495 /* We use char because int might match the return type of a gcc2
9496    builtin and then its argument prototype would still apply.  */
9497 char gethostbyname ();
9498 int
9499 main ()
9500 {
9501 gethostbyname ();
9502   ;
9503   return 0;
9504 }
9505 _ACEOF
9506 rm -f conftest.$ac_objext conftest$ac_exeext
9507 if { (eval echo "$as_me:9507: \"$ac_link\"") >&5
9508   (eval $ac_link) 2>&5
9509   ac_status=$?
9510   echo "$as_me:9510: \$? = $ac_status" >&5
9511   (exit $ac_status); } &&
9512          { ac_try='test -s conftest$ac_exeext'
9513   { (eval echo "$as_me:9513: \"$ac_try\"") >&5
9514   (eval $ac_try) 2>&5
9515   ac_status=$?
9516   echo "$as_me:9516: \$? = $ac_status" >&5
9517   (exit $ac_status); }; }; then
9518   ac_cv_lib_bsd_gethostbyname=yes
9519 else
9520   echo "$as_me: failed program was:" >&5
9521 cat conftest.$ac_ext >&5
9522 ac_cv_lib_bsd_gethostbyname=no
9523 fi
9524 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9525 LIBS=$ac_check_lib_save_LIBS
9526 fi
9527 echo "$as_me:9527: result: $ac_cv_lib_bsd_gethostbyname" >&5
9528 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
9529 if test $ac_cv_lib_bsd_gethostbyname = yes; then
9530   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
9531 fi
9532
9533       fi
9534     fi
9535
9536     # lieder@skyler.mavd.honeywell.com says without -lsocket,
9537     # socket/setsockopt and other routines are undefined under SCO ODT
9538     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
9539     # on later versions), says Simon Leinen: it contains gethostby*
9540     # variants that don't use the nameserver (or something).  -lsocket
9541     # must be given before -lnsl if both are needed.  We assume that
9542     # if connect needs -lnsl, so does gethostbyname.
9543     echo "$as_me:9543: checking for connect" >&5
9544 echo $ECHO_N "checking for connect... $ECHO_C" >&6
9545 if test "${ac_cv_func_connect+set}" = set; then
9546   echo $ECHO_N "(cached) $ECHO_C" >&6
9547 else
9548   cat >conftest.$ac_ext <<_ACEOF
9549 #line 9549 "configure"
9550 #include "confdefs.h"
9551 /* System header to define __stub macros and hopefully few prototypes,
9552     which can conflict with char connect (); below.  */
9553 #include <assert.h>
9554 /* Override any gcc2 internal prototype to avoid an error.  */
9555 #ifdef __cplusplus
9556 extern "C"
9557 #endif
9558 /* We use char because int might match the return type of a gcc2
9559    builtin and then its argument prototype would still apply.  */
9560 char connect ();
9561 char (*f) ();
9562
9563 int
9564 main ()
9565 {
9566 /* The GNU C library defines this for functions which it implements
9567     to always fail with ENOSYS.  Some functions are actually named
9568     something starting with __ and the normal name is an alias.  */
9569 #if defined (__stub_connect) || defined (__stub___connect)
9570 choke me
9571 #else
9572 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9573 #endif
9574
9575   ;
9576   return 0;
9577 }
9578 _ACEOF
9579 rm -f conftest.$ac_objext conftest$ac_exeext
9580 if { (eval echo "$as_me:9580: \"$ac_link\"") >&5
9581   (eval $ac_link) 2>&5
9582   ac_status=$?
9583   echo "$as_me:9583: \$? = $ac_status" >&5
9584   (exit $ac_status); } &&
9585          { ac_try='test -s conftest$ac_exeext'
9586   { (eval echo "$as_me:9586: \"$ac_try\"") >&5
9587   (eval $ac_try) 2>&5
9588   ac_status=$?
9589   echo "$as_me:9589: \$? = $ac_status" >&5
9590   (exit $ac_status); }; }; then
9591   ac_cv_func_connect=yes
9592 else
9593   echo "$as_me: failed program was:" >&5
9594 cat conftest.$ac_ext >&5
9595 ac_cv_func_connect=no
9596 fi
9597 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9598 fi
9599 echo "$as_me:9599: result: $ac_cv_func_connect" >&5
9600 echo "${ECHO_T}$ac_cv_func_connect" >&6
9601
9602     if test $ac_cv_func_connect = no; then
9603       echo "$as_me:9603: checking for connect in -lsocket" >&5
9604 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
9605 if test "${ac_cv_lib_socket_connect+set}" = set; then
9606   echo $ECHO_N "(cached) $ECHO_C" >&6
9607 else
9608   ac_check_lib_save_LIBS=$LIBS
9609 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
9610 cat >conftest.$ac_ext <<_ACEOF
9611 #line 9611 "configure"
9612 #include "confdefs.h"
9613
9614 /* Override any gcc2 internal prototype to avoid an error.  */
9615 #ifdef __cplusplus
9616 extern "C"
9617 #endif
9618 /* We use char because int might match the return type of a gcc2
9619    builtin and then its argument prototype would still apply.  */
9620 char connect ();
9621 int
9622 main ()
9623 {
9624 connect ();
9625   ;
9626   return 0;
9627 }
9628 _ACEOF
9629 rm -f conftest.$ac_objext conftest$ac_exeext
9630 if { (eval echo "$as_me:9630: \"$ac_link\"") >&5
9631   (eval $ac_link) 2>&5
9632   ac_status=$?
9633   echo "$as_me:9633: \$? = $ac_status" >&5
9634   (exit $ac_status); } &&
9635          { ac_try='test -s conftest$ac_exeext'
9636   { (eval echo "$as_me:9636: \"$ac_try\"") >&5
9637   (eval $ac_try) 2>&5
9638   ac_status=$?
9639   echo "$as_me:9639: \$? = $ac_status" >&5
9640   (exit $ac_status); }; }; then
9641   ac_cv_lib_socket_connect=yes
9642 else
9643   echo "$as_me: failed program was:" >&5
9644 cat conftest.$ac_ext >&5
9645 ac_cv_lib_socket_connect=no
9646 fi
9647 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9648 LIBS=$ac_check_lib_save_LIBS
9649 fi
9650 echo "$as_me:9650: result: $ac_cv_lib_socket_connect" >&5
9651 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
9652 if test $ac_cv_lib_socket_connect = yes; then
9653   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
9654 fi
9655
9656     fi
9657
9658     # Guillermo Gomez says -lposix is necessary on A/UX.
9659     echo "$as_me:9659: checking for remove" >&5
9660 echo $ECHO_N "checking for remove... $ECHO_C" >&6
9661 if test "${ac_cv_func_remove+set}" = set; then
9662   echo $ECHO_N "(cached) $ECHO_C" >&6
9663 else
9664   cat >conftest.$ac_ext <<_ACEOF
9665 #line 9665 "configure"
9666 #include "confdefs.h"
9667 /* System header to define __stub macros and hopefully few prototypes,
9668     which can conflict with char remove (); below.  */
9669 #include <assert.h>
9670 /* Override any gcc2 internal prototype to avoid an error.  */
9671 #ifdef __cplusplus
9672 extern "C"
9673 #endif
9674 /* We use char because int might match the return type of a gcc2
9675    builtin and then its argument prototype would still apply.  */
9676 char remove ();
9677 char (*f) ();
9678
9679 int
9680 main ()
9681 {
9682 /* The GNU C library defines this for functions which it implements
9683     to always fail with ENOSYS.  Some functions are actually named
9684     something starting with __ and the normal name is an alias.  */
9685 #if defined (__stub_remove) || defined (__stub___remove)
9686 choke me
9687 #else
9688 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9689 #endif
9690
9691   ;
9692   return 0;
9693 }
9694 _ACEOF
9695 rm -f conftest.$ac_objext conftest$ac_exeext
9696 if { (eval echo "$as_me:9696: \"$ac_link\"") >&5
9697   (eval $ac_link) 2>&5
9698   ac_status=$?
9699   echo "$as_me:9699: \$? = $ac_status" >&5
9700   (exit $ac_status); } &&
9701          { ac_try='test -s conftest$ac_exeext'
9702   { (eval echo "$as_me:9702: \"$ac_try\"") >&5
9703   (eval $ac_try) 2>&5
9704   ac_status=$?
9705   echo "$as_me:9705: \$? = $ac_status" >&5
9706   (exit $ac_status); }; }; then
9707   ac_cv_func_remove=yes
9708 else
9709   echo "$as_me: failed program was:" >&5
9710 cat conftest.$ac_ext >&5
9711 ac_cv_func_remove=no
9712 fi
9713 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9714 fi
9715 echo "$as_me:9715: result: $ac_cv_func_remove" >&5
9716 echo "${ECHO_T}$ac_cv_func_remove" >&6
9717
9718     if test $ac_cv_func_remove = no; then
9719       echo "$as_me:9719: checking for remove in -lposix" >&5
9720 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
9721 if test "${ac_cv_lib_posix_remove+set}" = set; then
9722   echo $ECHO_N "(cached) $ECHO_C" >&6
9723 else
9724   ac_check_lib_save_LIBS=$LIBS
9725 LIBS="-lposix  $LIBS"
9726 cat >conftest.$ac_ext <<_ACEOF
9727 #line 9727 "configure"
9728 #include "confdefs.h"
9729
9730 /* Override any gcc2 internal prototype to avoid an error.  */
9731 #ifdef __cplusplus
9732 extern "C"
9733 #endif
9734 /* We use char because int might match the return type of a gcc2
9735    builtin and then its argument prototype would still apply.  */
9736 char remove ();
9737 int
9738 main ()
9739 {
9740 remove ();
9741   ;
9742   return 0;
9743 }
9744 _ACEOF
9745 rm -f conftest.$ac_objext conftest$ac_exeext
9746 if { (eval echo "$as_me:9746: \"$ac_link\"") >&5
9747   (eval $ac_link) 2>&5
9748   ac_status=$?
9749   echo "$as_me:9749: \$? = $ac_status" >&5
9750   (exit $ac_status); } &&
9751          { ac_try='test -s conftest$ac_exeext'
9752   { (eval echo "$as_me:9752: \"$ac_try\"") >&5
9753   (eval $ac_try) 2>&5
9754   ac_status=$?
9755   echo "$as_me:9755: \$? = $ac_status" >&5
9756   (exit $ac_status); }; }; then
9757   ac_cv_lib_posix_remove=yes
9758 else
9759   echo "$as_me: failed program was:" >&5
9760 cat conftest.$ac_ext >&5
9761 ac_cv_lib_posix_remove=no
9762 fi
9763 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9764 LIBS=$ac_check_lib_save_LIBS
9765 fi
9766 echo "$as_me:9766: result: $ac_cv_lib_posix_remove" >&5
9767 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
9768 if test $ac_cv_lib_posix_remove = yes; then
9769   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
9770 fi
9771
9772     fi
9773
9774     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
9775     echo "$as_me:9775: checking for shmat" >&5
9776 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
9777 if test "${ac_cv_func_shmat+set}" = set; then
9778   echo $ECHO_N "(cached) $ECHO_C" >&6
9779 else
9780   cat >conftest.$ac_ext <<_ACEOF
9781 #line 9781 "configure"
9782 #include "confdefs.h"
9783 /* System header to define __stub macros and hopefully few prototypes,
9784     which can conflict with char shmat (); below.  */
9785 #include <assert.h>
9786 /* Override any gcc2 internal prototype to avoid an error.  */
9787 #ifdef __cplusplus
9788 extern "C"
9789 #endif
9790 /* We use char because int might match the return type of a gcc2
9791    builtin and then its argument prototype would still apply.  */
9792 char shmat ();
9793 char (*f) ();
9794
9795 int
9796 main ()
9797 {
9798 /* The GNU C library defines this for functions which it implements
9799     to always fail with ENOSYS.  Some functions are actually named
9800     something starting with __ and the normal name is an alias.  */
9801 #if defined (__stub_shmat) || defined (__stub___shmat)
9802 choke me
9803 #else
9804 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9805 #endif
9806
9807   ;
9808   return 0;
9809 }
9810 _ACEOF
9811 rm -f conftest.$ac_objext conftest$ac_exeext
9812 if { (eval echo "$as_me:9812: \"$ac_link\"") >&5
9813   (eval $ac_link) 2>&5
9814   ac_status=$?
9815   echo "$as_me:9815: \$? = $ac_status" >&5
9816   (exit $ac_status); } &&
9817          { ac_try='test -s conftest$ac_exeext'
9818   { (eval echo "$as_me:9818: \"$ac_try\"") >&5
9819   (eval $ac_try) 2>&5
9820   ac_status=$?
9821   echo "$as_me:9821: \$? = $ac_status" >&5
9822   (exit $ac_status); }; }; then
9823   ac_cv_func_shmat=yes
9824 else
9825   echo "$as_me: failed program was:" >&5
9826 cat conftest.$ac_ext >&5
9827 ac_cv_func_shmat=no
9828 fi
9829 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9830 fi
9831 echo "$as_me:9831: result: $ac_cv_func_shmat" >&5
9832 echo "${ECHO_T}$ac_cv_func_shmat" >&6
9833
9834     if test $ac_cv_func_shmat = no; then
9835       echo "$as_me:9835: checking for shmat in -lipc" >&5
9836 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
9837 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
9838   echo $ECHO_N "(cached) $ECHO_C" >&6
9839 else
9840   ac_check_lib_save_LIBS=$LIBS
9841 LIBS="-lipc  $LIBS"
9842 cat >conftest.$ac_ext <<_ACEOF
9843 #line 9843 "configure"
9844 #include "confdefs.h"
9845
9846 /* Override any gcc2 internal prototype to avoid an error.  */
9847 #ifdef __cplusplus
9848 extern "C"
9849 #endif
9850 /* We use char because int might match the return type of a gcc2
9851    builtin and then its argument prototype would still apply.  */
9852 char shmat ();
9853 int
9854 main ()
9855 {
9856 shmat ();
9857   ;
9858   return 0;
9859 }
9860 _ACEOF
9861 rm -f conftest.$ac_objext conftest$ac_exeext
9862 if { (eval echo "$as_me:9862: \"$ac_link\"") >&5
9863   (eval $ac_link) 2>&5
9864   ac_status=$?
9865   echo "$as_me:9865: \$? = $ac_status" >&5
9866   (exit $ac_status); } &&
9867          { ac_try='test -s conftest$ac_exeext'
9868   { (eval echo "$as_me:9868: \"$ac_try\"") >&5
9869   (eval $ac_try) 2>&5
9870   ac_status=$?
9871   echo "$as_me:9871: \$? = $ac_status" >&5
9872   (exit $ac_status); }; }; then
9873   ac_cv_lib_ipc_shmat=yes
9874 else
9875   echo "$as_me: failed program was:" >&5
9876 cat conftest.$ac_ext >&5
9877 ac_cv_lib_ipc_shmat=no
9878 fi
9879 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9880 LIBS=$ac_check_lib_save_LIBS
9881 fi
9882 echo "$as_me:9882: result: $ac_cv_lib_ipc_shmat" >&5
9883 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
9884 if test $ac_cv_lib_ipc_shmat = yes; then
9885   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
9886 fi
9887
9888     fi
9889   fi
9890
9891   # Check for libraries that X11R6 Xt/Xaw programs need.
9892   ac_save_LDFLAGS=$LDFLAGS
9893   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
9894   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
9895   # check for ICE first), but we must link in the order -lSM -lICE or
9896   # we get undefined symbols.  So assume we have SM if we have ICE.
9897   # These have to be linked with before -lX11, unlike the other
9898   # libraries we check for below, so use a different variable.
9899   # John Interrante, Karl Berry
9900   echo "$as_me:9900: checking for IceConnectionNumber in -lICE" >&5
9901 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
9902 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
9903   echo $ECHO_N "(cached) $ECHO_C" >&6
9904 else
9905   ac_check_lib_save_LIBS=$LIBS
9906 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
9907 cat >conftest.$ac_ext <<_ACEOF
9908 #line 9908 "configure"
9909 #include "confdefs.h"
9910
9911 /* Override any gcc2 internal prototype to avoid an error.  */
9912 #ifdef __cplusplus
9913 extern "C"
9914 #endif
9915 /* We use char because int might match the return type of a gcc2
9916    builtin and then its argument prototype would still apply.  */
9917 char IceConnectionNumber ();
9918 int
9919 main ()
9920 {
9921 IceConnectionNumber ();
9922   ;
9923   return 0;
9924 }
9925 _ACEOF
9926 rm -f conftest.$ac_objext conftest$ac_exeext
9927 if { (eval echo "$as_me:9927: \"$ac_link\"") >&5
9928   (eval $ac_link) 2>&5
9929   ac_status=$?
9930   echo "$as_me:9930: \$? = $ac_status" >&5
9931   (exit $ac_status); } &&
9932          { ac_try='test -s conftest$ac_exeext'
9933   { (eval echo "$as_me:9933: \"$ac_try\"") >&5
9934   (eval $ac_try) 2>&5
9935   ac_status=$?
9936   echo "$as_me:9936: \$? = $ac_status" >&5
9937   (exit $ac_status); }; }; then
9938   ac_cv_lib_ICE_IceConnectionNumber=yes
9939 else
9940   echo "$as_me: failed program was:" >&5
9941 cat conftest.$ac_ext >&5
9942 ac_cv_lib_ICE_IceConnectionNumber=no
9943 fi
9944 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9945 LIBS=$ac_check_lib_save_LIBS
9946 fi
9947 echo "$as_me:9947: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
9948 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
9949 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
9950   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
9951 fi
9952
9953   LDFLAGS=$ac_save_LDFLAGS
9954
9955 fi
9956
9957 cf_x_athena=${cf_x_athena:-Xaw}
9958
9959 echo "$as_me:9959: checking if you want to link with Xaw 3d library" >&5
9960 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
9961 withval=
9962
9963 # Check whether --with-Xaw3d or --without-Xaw3d was given.
9964 if test "${with_Xaw3d+set}" = set; then
9965   withval="$with_Xaw3d"
9966
9967 fi;
9968 if test "$withval" = yes ; then
9969         cf_x_athena=Xaw3d
9970         echo "$as_me:9970: result: yes" >&5
9971 echo "${ECHO_T}yes" >&6
9972 else
9973         echo "$as_me:9973: result: no" >&5
9974 echo "${ECHO_T}no" >&6
9975 fi
9976
9977 echo "$as_me:9977: checking if you want to link with Xaw 3d xft library" >&5
9978 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
9979 withval=
9980
9981 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
9982 if test "${with_Xaw3dxft+set}" = set; then
9983   withval="$with_Xaw3dxft"
9984
9985 fi;
9986 if test "$withval" = yes ; then
9987         cf_x_athena=Xaw3dxft
9988         echo "$as_me:9988: result: yes" >&5
9989 echo "${ECHO_T}yes" >&6
9990 else
9991         echo "$as_me:9991: result: no" >&5
9992 echo "${ECHO_T}no" >&6
9993 fi
9994
9995 echo "$as_me:9995: checking if you want to link with neXT Athena library" >&5
9996 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
9997 withval=
9998
9999 # Check whether --with-neXtaw or --without-neXtaw was given.
10000 if test "${with_neXtaw+set}" = set; then
10001   withval="$with_neXtaw"
10002
10003 fi;
10004 if test "$withval" = yes ; then
10005         cf_x_athena=neXtaw
10006         echo "$as_me:10006: result: yes" >&5
10007 echo "${ECHO_T}yes" >&6
10008 else
10009         echo "$as_me:10009: result: no" >&5
10010 echo "${ECHO_T}no" >&6
10011 fi
10012
10013 echo "$as_me:10013: checking if you want to link with Athena-Plus library" >&5
10014 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10015 withval=
10016
10017 # Check whether --with-XawPlus or --without-XawPlus was given.
10018 if test "${with_XawPlus+set}" = set; then
10019   withval="$with_XawPlus"
10020
10021 fi;
10022 if test "$withval" = yes ; then
10023         cf_x_athena=XawPlus
10024         echo "$as_me:10024: result: yes" >&5
10025 echo "${ECHO_T}yes" >&6
10026 else
10027         echo "$as_me:10027: result: no" >&5
10028 echo "${ECHO_T}no" >&6
10029 fi
10030
10031 cf_x_athena_lib=""
10032
10033 if test "$PKG_CONFIG" != none ; then
10034         cf_athena_list=
10035         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10036         for cf_athena_pkg in \
10037                 $cf_athena_list \
10038                 ${cf_x_athena} \
10039                 ${cf_x_athena}-devel \
10040                 lib${cf_x_athena} \
10041                 lib${cf_x_athena}-devel
10042         do
10043
10044 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10045         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10046
10047 echo "${as_me:-configure}:10047: testing found package $cf_athena_pkg ..." 1>&5
10048
10049         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10050         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10051         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10052
10053 echo "${as_me:-configure}:10053: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10054
10055         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10056
10057 echo "${as_me:-configure}:10057: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10058
10059 cf_fix_cppflags=no
10060 cf_new_cflags=
10061 cf_new_cppflags=
10062 cf_new_extra_cppflags=
10063
10064 for cf_add_cflags in $cf_pkgconfig_incs
10065 do
10066 case $cf_fix_cppflags in
10067 no)
10068         case $cf_add_cflags in #(vi
10069         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10070                 case $cf_add_cflags in
10071                 -D*)
10072                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10073
10074                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10075                                 && test -z "${cf_tst_cflags}" \
10076                                 && cf_fix_cppflags=yes
10077
10078                         if test $cf_fix_cppflags = yes ; then
10079                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10080                                 continue
10081                         elif test "${cf_tst_cflags}" = "\"'" ; then
10082                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10083                                 continue
10084                         fi
10085                         ;;
10086                 esac
10087                 case "$CPPFLAGS" in
10088                 *$cf_add_cflags) #(vi
10089                         ;;
10090                 *) #(vi
10091                         case $cf_add_cflags in #(vi
10092                         -D*)
10093                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10094
10095 CPPFLAGS=`echo "$CPPFLAGS" | \
10096         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10097                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10098
10099                                 ;;
10100                         esac
10101                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10102                         ;;
10103                 esac
10104                 ;;
10105         *)
10106                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10107                 ;;
10108         esac
10109         ;;
10110 yes)
10111         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10112
10113         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10114
10115         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10116                 && test -z "${cf_tst_cflags}" \
10117                 && cf_fix_cppflags=no
10118         ;;
10119 esac
10120 done
10121
10122 if test -n "$cf_new_cflags" ; then
10123
10124         CFLAGS="$CFLAGS $cf_new_cflags"
10125 fi
10126
10127 if test -n "$cf_new_cppflags" ; then
10128
10129         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10130 fi
10131
10132 if test -n "$cf_new_extra_cppflags" ; then
10133
10134         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10135 fi
10136
10137 cf_add_libs="$cf_pkgconfig_libs"
10138 # Filter out duplicates - this happens with badly-designed ".pc" files...
10139 for cf_add_1lib in $LIBS
10140 do
10141         for cf_add_2lib in $cf_add_libs
10142         do
10143                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10144                 then
10145                         cf_add_1lib=
10146                         break
10147                 fi
10148         done
10149         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10150 done
10151 LIBS="$cf_add_libs"
10152
10153                         cf_x_athena_lib="$cf_pkgconfig_libs"
10154
10155 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10156
10157                         cat >>confdefs.h <<EOF
10158 #define $cf_x_athena_LIBS 1
10159 EOF
10160
10161         for cf_trim_lib in Xmu Xt X11
10162         do
10163                 case "$LIBS" in
10164                 *-l$cf_trim_lib\ *-l$cf_trim_lib*)
10165                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10166                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10167
10168 echo "${as_me:-configure}:10168: testing ..trimmed $LIBS ..." 1>&5
10169
10170                         ;;
10171                 esac
10172         done
10173
10174 echo "$as_me:10174: checking for usable $cf_x_athena/Xmu package" >&5
10175 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10176 if test "${cf_cv_xaw_compat+set}" = set; then
10177   echo $ECHO_N "(cached) $ECHO_C" >&6
10178 else
10179
10180 cat >conftest.$ac_ext <<_ACEOF
10181 #line 10181 "configure"
10182 #include "confdefs.h"
10183
10184 #include <X11/Xmu/CharSet.h>
10185
10186 int
10187 main ()
10188 {
10189
10190 int check = XmuCompareISOLatin1("big", "small")
10191
10192   ;
10193   return 0;
10194 }
10195 _ACEOF
10196 rm -f conftest.$ac_objext conftest$ac_exeext
10197 if { (eval echo "$as_me:10197: \"$ac_link\"") >&5
10198   (eval $ac_link) 2>&5
10199   ac_status=$?
10200   echo "$as_me:10200: \$? = $ac_status" >&5
10201   (exit $ac_status); } &&
10202          { ac_try='test -s conftest$ac_exeext'
10203   { (eval echo "$as_me:10203: \"$ac_try\"") >&5
10204   (eval $ac_try) 2>&5
10205   ac_status=$?
10206   echo "$as_me:10206: \$? = $ac_status" >&5
10207   (exit $ac_status); }; }; then
10208   cf_cv_xaw_compat=yes
10209 else
10210   echo "$as_me: failed program was:" >&5
10211 cat conftest.$ac_ext >&5
10212 cf_cv_xaw_compat=no
10213 fi
10214 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10215 fi
10216 echo "$as_me:10216: result: $cf_cv_xaw_compat" >&5
10217 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10218
10219                         if test "$cf_cv_xaw_compat" = no
10220                         then
10221                                 # workaround for broken ".pc" files...
10222                                 case "$cf_x_athena_lib" in #(vi
10223                                 *-lXmu*) #(vi
10224                                         ;;
10225                                 *)
10226                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10227
10228 echo "${as_me:-configure}:10228: testing work around broken package ..." 1>&5
10229
10230                                         cf_save_xmu="$LIBS"
10231                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
10232
10233 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10234         test -n "$verbose" && echo "    found package xmu" 1>&6
10235
10236 echo "${as_me:-configure}:10236: testing found package xmu ..." 1>&5
10237
10238         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10239         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10240         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10241
10242 echo "${as_me:-configure}:10242: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10243
10244         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10245
10246 echo "${as_me:-configure}:10246: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10247
10248 cf_fix_cppflags=no
10249 cf_new_cflags=
10250 cf_new_cppflags=
10251 cf_new_extra_cppflags=
10252
10253 for cf_add_cflags in $cf_pkgconfig_incs
10254 do
10255 case $cf_fix_cppflags in
10256 no)
10257         case $cf_add_cflags in #(vi
10258         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10259                 case $cf_add_cflags in
10260                 -D*)
10261                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10262
10263                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10264                                 && test -z "${cf_tst_cflags}" \
10265                                 && cf_fix_cppflags=yes
10266
10267                         if test $cf_fix_cppflags = yes ; then
10268                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10269                                 continue
10270                         elif test "${cf_tst_cflags}" = "\"'" ; then
10271                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10272                                 continue
10273                         fi
10274                         ;;
10275                 esac
10276                 case "$CPPFLAGS" in
10277                 *$cf_add_cflags) #(vi
10278                         ;;
10279                 *) #(vi
10280                         case $cf_add_cflags in #(vi
10281                         -D*)
10282                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10283
10284 CPPFLAGS=`echo "$CPPFLAGS" | \
10285         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10286                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10287
10288                                 ;;
10289                         esac
10290                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10291                         ;;
10292                 esac
10293                 ;;
10294         *)
10295                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10296                 ;;
10297         esac
10298         ;;
10299 yes)
10300         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10301
10302         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10303
10304         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10305                 && test -z "${cf_tst_cflags}" \
10306                 && cf_fix_cppflags=no
10307         ;;
10308 esac
10309 done
10310
10311 if test -n "$cf_new_cflags" ; then
10312
10313         CFLAGS="$CFLAGS $cf_new_cflags"
10314 fi
10315
10316 if test -n "$cf_new_cppflags" ; then
10317
10318         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10319 fi
10320
10321 if test -n "$cf_new_extra_cppflags" ; then
10322
10323         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10324 fi
10325
10326 cf_add_libs="$cf_pkgconfig_libs"
10327 # Filter out duplicates - this happens with badly-designed ".pc" files...
10328 for cf_add_1lib in $LIBS
10329 do
10330         for cf_add_2lib in $cf_add_libs
10331         do
10332                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10333                 then
10334                         cf_add_1lib=
10335                         break
10336                 fi
10337         done
10338         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10339 done
10340 LIBS="$cf_add_libs"
10341
10342                                                         LIBS="$cf_save_xmu"
10343
10344 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10345
10346 echo "${as_me:-configure}:10346: testing ...before $LIBS ..." 1>&5
10347
10348 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
10349 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10350
10351 echo "${as_me:-configure}:10351: testing ...after  $LIBS ..." 1>&5
10352
10353 else
10354         cf_pkgconfig_incs=
10355         cf_pkgconfig_libs=
10356
10357 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10358
10359 echo "${as_me:-configure}:10359: testing ...before $LIBS ..." 1>&5
10360
10361 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
10362 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10363
10364 echo "${as_me:-configure}:10364: testing ...after  $LIBS ..." 1>&5
10365
10366 fi
10367
10368         for cf_trim_lib in Xmu Xt X11
10369         do
10370                 case "$LIBS" in
10371                 *-l$cf_trim_lib\ *-l$cf_trim_lib*)
10372                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10373                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10374
10375 echo "${as_me:-configure}:10375: testing ..trimmed $LIBS ..." 1>&5
10376
10377                         ;;
10378                 esac
10379         done
10380
10381                                         ;;
10382                                 esac
10383                         fi
10384
10385                         break
10386 else
10387         cf_pkgconfig_incs=
10388         cf_pkgconfig_libs=
10389         :
10390 fi
10391
10392         done
10393 fi
10394
10395 if test -z "$cf_x_athena_lib" ; then
10396
10397 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10398         test -n "$verbose" && echo "    found package Xext" 1>&6
10399
10400 echo "${as_me:-configure}:10400: testing found package Xext ..." 1>&5
10401
10402         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10403         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10404         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10405
10406 echo "${as_me:-configure}:10406: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10407
10408         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10409
10410 echo "${as_me:-configure}:10410: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10411
10412 cf_fix_cppflags=no
10413 cf_new_cflags=
10414 cf_new_cppflags=
10415 cf_new_extra_cppflags=
10416
10417 for cf_add_cflags in $cf_pkgconfig_incs
10418 do
10419 case $cf_fix_cppflags in
10420 no)
10421         case $cf_add_cflags in #(vi
10422         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10423                 case $cf_add_cflags in
10424                 -D*)
10425                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10426
10427                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10428                                 && test -z "${cf_tst_cflags}" \
10429                                 && cf_fix_cppflags=yes
10430
10431                         if test $cf_fix_cppflags = yes ; then
10432                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10433                                 continue
10434                         elif test "${cf_tst_cflags}" = "\"'" ; then
10435                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10436                                 continue
10437                         fi
10438                         ;;
10439                 esac
10440                 case "$CPPFLAGS" in
10441                 *$cf_add_cflags) #(vi
10442                         ;;
10443                 *) #(vi
10444                         case $cf_add_cflags in #(vi
10445                         -D*)
10446                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10447
10448 CPPFLAGS=`echo "$CPPFLAGS" | \
10449         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10450                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10451
10452                                 ;;
10453                         esac
10454                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10455                         ;;
10456                 esac
10457                 ;;
10458         *)
10459                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10460                 ;;
10461         esac
10462         ;;
10463 yes)
10464         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10465
10466         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10467
10468         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10469                 && test -z "${cf_tst_cflags}" \
10470                 && cf_fix_cppflags=no
10471         ;;
10472 esac
10473 done
10474
10475 if test -n "$cf_new_cflags" ; then
10476
10477         CFLAGS="$CFLAGS $cf_new_cflags"
10478 fi
10479
10480 if test -n "$cf_new_cppflags" ; then
10481
10482         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10483 fi
10484
10485 if test -n "$cf_new_extra_cppflags" ; then
10486
10487         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10488 fi
10489
10490 cf_add_libs="$cf_pkgconfig_libs"
10491 # Filter out duplicates - this happens with badly-designed ".pc" files...
10492 for cf_add_1lib in $LIBS
10493 do
10494         for cf_add_2lib in $cf_add_libs
10495         do
10496                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10497                 then
10498                         cf_add_1lib=
10499                         break
10500                 fi
10501         done
10502         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10503 done
10504 LIBS="$cf_add_libs"
10505
10506         :
10507 else
10508         cf_pkgconfig_incs=
10509         cf_pkgconfig_libs=
10510
10511         echo "$as_me:10511: checking for XextCreateExtension in -lXext" >&5
10512 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10513 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10514   echo $ECHO_N "(cached) $ECHO_C" >&6
10515 else
10516   ac_check_lib_save_LIBS=$LIBS
10517 LIBS="-lXext  $LIBS"
10518 cat >conftest.$ac_ext <<_ACEOF
10519 #line 10519 "configure"
10520 #include "confdefs.h"
10521
10522 /* Override any gcc2 internal prototype to avoid an error.  */
10523 #ifdef __cplusplus
10524 extern "C"
10525 #endif
10526 /* We use char because int might match the return type of a gcc2
10527    builtin and then its argument prototype would still apply.  */
10528 char XextCreateExtension ();
10529 int
10530 main ()
10531 {
10532 XextCreateExtension ();
10533   ;
10534   return 0;
10535 }
10536 _ACEOF
10537 rm -f conftest.$ac_objext conftest$ac_exeext
10538 if { (eval echo "$as_me:10538: \"$ac_link\"") >&5
10539   (eval $ac_link) 2>&5
10540   ac_status=$?
10541   echo "$as_me:10541: \$? = $ac_status" >&5
10542   (exit $ac_status); } &&
10543          { ac_try='test -s conftest$ac_exeext'
10544   { (eval echo "$as_me:10544: \"$ac_try\"") >&5
10545   (eval $ac_try) 2>&5
10546   ac_status=$?
10547   echo "$as_me:10547: \$? = $ac_status" >&5
10548   (exit $ac_status); }; }; then
10549   ac_cv_lib_Xext_XextCreateExtension=yes
10550 else
10551   echo "$as_me: failed program was:" >&5
10552 cat conftest.$ac_ext >&5
10553 ac_cv_lib_Xext_XextCreateExtension=no
10554 fi
10555 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10556 LIBS=$ac_check_lib_save_LIBS
10557 fi
10558 echo "$as_me:10558: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
10559 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
10560 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
10561
10562 cf_add_libs="-lXext"
10563 # Filter out duplicates - this happens with badly-designed ".pc" files...
10564 for cf_add_1lib in $LIBS
10565 do
10566         for cf_add_2lib in $cf_add_libs
10567         do
10568                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10569                 then
10570                         cf_add_1lib=
10571                         break
10572                 fi
10573         done
10574         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10575 done
10576 LIBS="$cf_add_libs"
10577
10578 fi
10579
10580 fi
10581
10582 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
10583 # in some cases has installed dummy files in the former, other cases replaced
10584 # it with a link to the new location).  This complicates the configure script.
10585 # Check for that pitfall, and recover using pkg-config
10586 #
10587 # If none of these are set, the configuration is almost certainly broken.
10588 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
10589 then
10590
10591 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
10592         test -n "$verbose" && echo "    found package x11" 1>&6
10593
10594 echo "${as_me:-configure}:10594: testing found package x11 ..." 1>&5
10595
10596         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
10597         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
10598         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
10599
10600 echo "${as_me:-configure}:10600: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10601
10602         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
10603
10604 echo "${as_me:-configure}:10604: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
10605
10606 cf_fix_cppflags=no
10607 cf_new_cflags=
10608 cf_new_cppflags=
10609 cf_new_extra_cppflags=
10610
10611 for cf_add_cflags in $cf_pkgconfig_incs
10612 do
10613 case $cf_fix_cppflags in
10614 no)
10615         case $cf_add_cflags in #(vi
10616         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10617                 case $cf_add_cflags in
10618                 -D*)
10619                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10620
10621                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10622                                 && test -z "${cf_tst_cflags}" \
10623                                 && cf_fix_cppflags=yes
10624
10625                         if test $cf_fix_cppflags = yes ; then
10626                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10627                                 continue
10628                         elif test "${cf_tst_cflags}" = "\"'" ; then
10629                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10630                                 continue
10631                         fi
10632                         ;;
10633                 esac
10634                 case "$CPPFLAGS" in
10635                 *$cf_add_cflags) #(vi
10636                         ;;
10637                 *) #(vi
10638                         case $cf_add_cflags in #(vi
10639                         -D*)
10640                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10641
10642 CPPFLAGS=`echo "$CPPFLAGS" | \
10643         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10644                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10645
10646                                 ;;
10647                         esac
10648                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10649                         ;;
10650                 esac
10651                 ;;
10652         *)
10653                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10654                 ;;
10655         esac
10656         ;;
10657 yes)
10658         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10659
10660         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10661
10662         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10663                 && test -z "${cf_tst_cflags}" \
10664                 && cf_fix_cppflags=no
10665         ;;
10666 esac
10667 done
10668
10669 if test -n "$cf_new_cflags" ; then
10670
10671         CFLAGS="$CFLAGS $cf_new_cflags"
10672 fi
10673
10674 if test -n "$cf_new_cppflags" ; then
10675
10676         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10677 fi
10678
10679 if test -n "$cf_new_extra_cppflags" ; then
10680
10681         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10682 fi
10683
10684 cf_add_libs="$cf_pkgconfig_libs"
10685 # Filter out duplicates - this happens with badly-designed ".pc" files...
10686 for cf_add_1lib in $LIBS
10687 do
10688         for cf_add_2lib in $cf_add_libs
10689         do
10690                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10691                 then
10692                         cf_add_1lib=
10693                         break
10694                 fi
10695         done
10696         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10697 done
10698 LIBS="$cf_add_libs"
10699
10700         :
10701 else
10702         cf_pkgconfig_incs=
10703         cf_pkgconfig_libs=
10704         { echo "$as_me:10704: WARNING: unable to find X11 library" >&5
10705 echo "$as_me: WARNING: unable to find X11 library" >&2;}
10706 fi
10707
10708 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
10709         test -n "$verbose" && echo "    found package ice" 1>&6
10710
10711 echo "${as_me:-configure}:10711: testing found package ice ..." 1>&5
10712
10713         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
10714         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
10715         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
10716
10717 echo "${as_me:-configure}:10717: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10718
10719         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
10720
10721 echo "${as_me:-configure}:10721: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
10722
10723 cf_fix_cppflags=no
10724 cf_new_cflags=
10725 cf_new_cppflags=
10726 cf_new_extra_cppflags=
10727
10728 for cf_add_cflags in $cf_pkgconfig_incs
10729 do
10730 case $cf_fix_cppflags in
10731 no)
10732         case $cf_add_cflags in #(vi
10733         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10734                 case $cf_add_cflags in
10735                 -D*)
10736                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10737
10738                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10739                                 && test -z "${cf_tst_cflags}" \
10740                                 && cf_fix_cppflags=yes
10741
10742                         if test $cf_fix_cppflags = yes ; then
10743                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10744                                 continue
10745                         elif test "${cf_tst_cflags}" = "\"'" ; then
10746                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10747                                 continue
10748                         fi
10749                         ;;
10750                 esac
10751                 case "$CPPFLAGS" in
10752                 *$cf_add_cflags) #(vi
10753                         ;;
10754                 *) #(vi
10755                         case $cf_add_cflags in #(vi
10756                         -D*)
10757                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10758
10759 CPPFLAGS=`echo "$CPPFLAGS" | \
10760         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10761                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10762
10763                                 ;;
10764                         esac
10765                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10766                         ;;
10767                 esac
10768                 ;;
10769         *)
10770                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10771                 ;;
10772         esac
10773         ;;
10774 yes)
10775         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10776
10777         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10778
10779         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10780                 && test -z "${cf_tst_cflags}" \
10781                 && cf_fix_cppflags=no
10782         ;;
10783 esac
10784 done
10785
10786 if test -n "$cf_new_cflags" ; then
10787
10788         CFLAGS="$CFLAGS $cf_new_cflags"
10789 fi
10790
10791 if test -n "$cf_new_cppflags" ; then
10792
10793         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10794 fi
10795
10796 if test -n "$cf_new_extra_cppflags" ; then
10797
10798         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10799 fi
10800
10801 cf_add_libs="$cf_pkgconfig_libs"
10802 # Filter out duplicates - this happens with badly-designed ".pc" files...
10803 for cf_add_1lib in $LIBS
10804 do
10805         for cf_add_2lib in $cf_add_libs
10806         do
10807                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10808                 then
10809                         cf_add_1lib=
10810                         break
10811                 fi
10812         done
10813         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10814 done
10815 LIBS="$cf_add_libs"
10816
10817         :
10818 else
10819         cf_pkgconfig_incs=
10820         cf_pkgconfig_libs=
10821         { echo "$as_me:10821: WARNING: unable to find ICE library" >&5
10822 echo "$as_me: WARNING: unable to find ICE library" >&2;}
10823 fi
10824
10825 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
10826         test -n "$verbose" && echo "    found package sm" 1>&6
10827
10828 echo "${as_me:-configure}:10828: testing found package sm ..." 1>&5
10829
10830         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
10831         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
10832         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
10833
10834 echo "${as_me:-configure}:10834: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10835
10836         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
10837
10838 echo "${as_me:-configure}:10838: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
10839
10840 cf_fix_cppflags=no
10841 cf_new_cflags=
10842 cf_new_cppflags=
10843 cf_new_extra_cppflags=
10844
10845 for cf_add_cflags in $cf_pkgconfig_incs
10846 do
10847 case $cf_fix_cppflags in
10848 no)
10849         case $cf_add_cflags in #(vi
10850         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10851                 case $cf_add_cflags in
10852                 -D*)
10853                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10854
10855                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10856                                 && test -z "${cf_tst_cflags}" \
10857                                 && cf_fix_cppflags=yes
10858
10859                         if test $cf_fix_cppflags = yes ; then
10860                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10861                                 continue
10862                         elif test "${cf_tst_cflags}" = "\"'" ; then
10863                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10864                                 continue
10865                         fi
10866                         ;;
10867                 esac
10868                 case "$CPPFLAGS" in
10869                 *$cf_add_cflags) #(vi
10870                         ;;
10871                 *) #(vi
10872                         case $cf_add_cflags in #(vi
10873                         -D*)
10874                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10875
10876 CPPFLAGS=`echo "$CPPFLAGS" | \
10877         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10878                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10879
10880                                 ;;
10881                         esac
10882                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10883                         ;;
10884                 esac
10885                 ;;
10886         *)
10887                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10888                 ;;
10889         esac
10890         ;;
10891 yes)
10892         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10893
10894         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10895
10896         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10897                 && test -z "${cf_tst_cflags}" \
10898                 && cf_fix_cppflags=no
10899         ;;
10900 esac
10901 done
10902
10903 if test -n "$cf_new_cflags" ; then
10904
10905         CFLAGS="$CFLAGS $cf_new_cflags"
10906 fi
10907
10908 if test -n "$cf_new_cppflags" ; then
10909
10910         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10911 fi
10912
10913 if test -n "$cf_new_extra_cppflags" ; then
10914
10915         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10916 fi
10917
10918 cf_add_libs="$cf_pkgconfig_libs"
10919 # Filter out duplicates - this happens with badly-designed ".pc" files...
10920 for cf_add_1lib in $LIBS
10921 do
10922         for cf_add_2lib in $cf_add_libs
10923         do
10924                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10925                 then
10926                         cf_add_1lib=
10927                         break
10928                 fi
10929         done
10930         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10931 done
10932 LIBS="$cf_add_libs"
10933
10934         :
10935 else
10936         cf_pkgconfig_incs=
10937         cf_pkgconfig_libs=
10938         { echo "$as_me:10938: WARNING: unable to find SM library" >&5
10939 echo "$as_me: WARNING: unable to find SM library" >&2;}
10940 fi
10941
10942 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
10943         test -n "$verbose" && echo "    found package xt" 1>&6
10944
10945 echo "${as_me:-configure}:10945: testing found package xt ..." 1>&5
10946
10947         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
10948         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
10949         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
10950
10951 echo "${as_me:-configure}:10951: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10952
10953         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
10954
10955 echo "${as_me:-configure}:10955: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
10956
10957 cf_fix_cppflags=no
10958 cf_new_cflags=
10959 cf_new_cppflags=
10960 cf_new_extra_cppflags=
10961
10962 for cf_add_cflags in $cf_pkgconfig_incs
10963 do
10964 case $cf_fix_cppflags in
10965 no)
10966         case $cf_add_cflags in #(vi
10967         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10968                 case $cf_add_cflags in
10969                 -D*)
10970                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10971
10972                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10973                                 && test -z "${cf_tst_cflags}" \
10974                                 && cf_fix_cppflags=yes
10975
10976                         if test $cf_fix_cppflags = yes ; then
10977                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10978                                 continue
10979                         elif test "${cf_tst_cflags}" = "\"'" ; then
10980                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10981                                 continue
10982                         fi
10983                         ;;
10984                 esac
10985                 case "$CPPFLAGS" in
10986                 *$cf_add_cflags) #(vi
10987                         ;;
10988                 *) #(vi
10989                         case $cf_add_cflags in #(vi
10990                         -D*)
10991                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10992
10993 CPPFLAGS=`echo "$CPPFLAGS" | \
10994         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10995                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10996
10997                                 ;;
10998                         esac
10999                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11000                         ;;
11001                 esac
11002                 ;;
11003         *)
11004                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11005                 ;;
11006         esac
11007         ;;
11008 yes)
11009         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11010
11011         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11012
11013         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11014                 && test -z "${cf_tst_cflags}" \
11015                 && cf_fix_cppflags=no
11016         ;;
11017 esac
11018 done
11019
11020 if test -n "$cf_new_cflags" ; then
11021
11022         CFLAGS="$CFLAGS $cf_new_cflags"
11023 fi
11024
11025 if test -n "$cf_new_cppflags" ; then
11026
11027         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11028 fi
11029
11030 if test -n "$cf_new_extra_cppflags" ; then
11031
11032         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11033 fi
11034
11035 cf_add_libs="$cf_pkgconfig_libs"
11036 # Filter out duplicates - this happens with badly-designed ".pc" files...
11037 for cf_add_1lib in $LIBS
11038 do
11039         for cf_add_2lib in $cf_add_libs
11040         do
11041                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11042                 then
11043                         cf_add_1lib=
11044                         break
11045                 fi
11046         done
11047         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11048 done
11049 LIBS="$cf_add_libs"
11050
11051         :
11052 else
11053         cf_pkgconfig_incs=
11054         cf_pkgconfig_libs=
11055         { echo "$as_me:11055: WARNING: unable to find Xt library" >&5
11056 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11057 fi
11058
11059 fi
11060
11061 cf_have_X_LIBS=no
11062
11063 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11064         test -n "$verbose" && echo "    found package xt" 1>&6
11065
11066 echo "${as_me:-configure}:11066: testing found package xt ..." 1>&5
11067
11068         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11069         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11070         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11071
11072 echo "${as_me:-configure}:11072: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11073
11074         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11075
11076 echo "${as_me:-configure}:11076: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11077
11078 cf_fix_cppflags=no
11079 cf_new_cflags=
11080 cf_new_cppflags=
11081 cf_new_extra_cppflags=
11082
11083 for cf_add_cflags in $cf_pkgconfig_incs
11084 do
11085 case $cf_fix_cppflags in
11086 no)
11087         case $cf_add_cflags in #(vi
11088         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11089                 case $cf_add_cflags in
11090                 -D*)
11091                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11092
11093                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11094                                 && test -z "${cf_tst_cflags}" \
11095                                 && cf_fix_cppflags=yes
11096
11097                         if test $cf_fix_cppflags = yes ; then
11098                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11099                                 continue
11100                         elif test "${cf_tst_cflags}" = "\"'" ; then
11101                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11102                                 continue
11103                         fi
11104                         ;;
11105                 esac
11106                 case "$CPPFLAGS" in
11107                 *$cf_add_cflags) #(vi
11108                         ;;
11109                 *) #(vi
11110                         case $cf_add_cflags in #(vi
11111                         -D*)
11112                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11113
11114 CPPFLAGS=`echo "$CPPFLAGS" | \
11115         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11116                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11117
11118                                 ;;
11119                         esac
11120                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11121                         ;;
11122                 esac
11123                 ;;
11124         *)
11125                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11126                 ;;
11127         esac
11128         ;;
11129 yes)
11130         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11131
11132         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11133
11134         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11135                 && test -z "${cf_tst_cflags}" \
11136                 && cf_fix_cppflags=no
11137         ;;
11138 esac
11139 done
11140
11141 if test -n "$cf_new_cflags" ; then
11142
11143         CFLAGS="$CFLAGS $cf_new_cflags"
11144 fi
11145
11146 if test -n "$cf_new_cppflags" ; then
11147
11148         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11149 fi
11150
11151 if test -n "$cf_new_extra_cppflags" ; then
11152
11153         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11154 fi
11155
11156 cf_add_libs="$cf_pkgconfig_libs"
11157 # Filter out duplicates - this happens with badly-designed ".pc" files...
11158 for cf_add_1lib in $LIBS
11159 do
11160         for cf_add_2lib in $cf_add_libs
11161         do
11162                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11163                 then
11164                         cf_add_1lib=
11165                         break
11166                 fi
11167         done
11168         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11169 done
11170 LIBS="$cf_add_libs"
11171
11172         case "x$LIBS" in #(vi
11173         *-lX11*) #(vi
11174                 ;;
11175         *)
11176 # we have an "xt" package, but it may omit Xt's dependency on X11
11177 echo "$as_me:11177: checking for usable X dependency" >&5
11178 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11179 if test "${cf_cv_xt_x11_compat+set}" = set; then
11180   echo $ECHO_N "(cached) $ECHO_C" >&6
11181 else
11182
11183 cat >conftest.$ac_ext <<_ACEOF
11184 #line 11184 "configure"
11185 #include "confdefs.h"
11186
11187 #include <X11/Xlib.h>
11188
11189 int
11190 main ()
11191 {
11192
11193         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11194         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11195         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11196         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11197
11198   ;
11199   return 0;
11200 }
11201 _ACEOF
11202 rm -f conftest.$ac_objext conftest$ac_exeext
11203 if { (eval echo "$as_me:11203: \"$ac_link\"") >&5
11204   (eval $ac_link) 2>&5
11205   ac_status=$?
11206   echo "$as_me:11206: \$? = $ac_status" >&5
11207   (exit $ac_status); } &&
11208          { ac_try='test -s conftest$ac_exeext'
11209   { (eval echo "$as_me:11209: \"$ac_try\"") >&5
11210   (eval $ac_try) 2>&5
11211   ac_status=$?
11212   echo "$as_me:11212: \$? = $ac_status" >&5
11213   (exit $ac_status); }; }; then
11214   cf_cv_xt_x11_compat=yes
11215 else
11216   echo "$as_me: failed program was:" >&5
11217 cat conftest.$ac_ext >&5
11218 cf_cv_xt_x11_compat=no
11219 fi
11220 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11221 fi
11222 echo "$as_me:11222: result: $cf_cv_xt_x11_compat" >&5
11223 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11224                 if test "$cf_cv_xt_x11_compat" = no
11225                 then
11226                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11227
11228 echo "${as_me:-configure}:11228: testing work around broken X11 dependency ..." 1>&5
11229
11230                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11231
11232 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11233         test -n "$verbose" && echo "    found package x11" 1>&6
11234
11235 echo "${as_me:-configure}:11235: testing found package x11 ..." 1>&5
11236
11237         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11238         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11239         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11240
11241 echo "${as_me:-configure}:11241: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11242
11243         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11244
11245 echo "${as_me:-configure}:11245: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11246
11247 cf_fix_cppflags=no
11248 cf_new_cflags=
11249 cf_new_cppflags=
11250 cf_new_extra_cppflags=
11251
11252 for cf_add_cflags in $cf_pkgconfig_incs
11253 do
11254 case $cf_fix_cppflags in
11255 no)
11256         case $cf_add_cflags in #(vi
11257         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11258                 case $cf_add_cflags in
11259                 -D*)
11260                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11261
11262                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11263                                 && test -z "${cf_tst_cflags}" \
11264                                 && cf_fix_cppflags=yes
11265
11266                         if test $cf_fix_cppflags = yes ; then
11267                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11268                                 continue
11269                         elif test "${cf_tst_cflags}" = "\"'" ; then
11270                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11271                                 continue
11272                         fi
11273                         ;;
11274                 esac
11275                 case "$CPPFLAGS" in
11276                 *$cf_add_cflags) #(vi
11277                         ;;
11278                 *) #(vi
11279                         case $cf_add_cflags in #(vi
11280                         -D*)
11281                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11282
11283 CPPFLAGS=`echo "$CPPFLAGS" | \
11284         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11285                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11286
11287                                 ;;
11288                         esac
11289                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11290                         ;;
11291                 esac
11292                 ;;
11293         *)
11294                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11295                 ;;
11296         esac
11297         ;;
11298 yes)
11299         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11300
11301         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11302
11303         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11304                 && test -z "${cf_tst_cflags}" \
11305                 && cf_fix_cppflags=no
11306         ;;
11307 esac
11308 done
11309
11310 if test -n "$cf_new_cflags" ; then
11311
11312         CFLAGS="$CFLAGS $cf_new_cflags"
11313 fi
11314
11315 if test -n "$cf_new_cppflags" ; then
11316
11317         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11318 fi
11319
11320 if test -n "$cf_new_extra_cppflags" ; then
11321
11322         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11323 fi
11324
11325 cf_add_libs="$cf_pkgconfig_libs"
11326 # Filter out duplicates - this happens with badly-designed ".pc" files...
11327 for cf_add_1lib in $LIBS
11328 do
11329         for cf_add_2lib in $cf_add_libs
11330         do
11331                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11332                 then
11333                         cf_add_1lib=
11334                         break
11335                 fi
11336         done
11337         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11338 done
11339 LIBS="$cf_add_libs"
11340
11341         :
11342 else
11343         cf_pkgconfig_incs=
11344         cf_pkgconfig_libs=
11345
11346 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11347
11348 echo "${as_me:-configure}:11348: testing ...before $LIBS ..." 1>&5
11349
11350 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
11351 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11352
11353 echo "${as_me:-configure}:11353: testing ...after  $LIBS ..." 1>&5
11354
11355 fi
11356
11357                 fi
11358                 ;;
11359         esac
11360
11361 echo "$as_me:11361: checking for usable X Toolkit package" >&5
11362 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11363 if test "${cf_cv_xt_ice_compat+set}" = set; then
11364   echo $ECHO_N "(cached) $ECHO_C" >&6
11365 else
11366
11367 cat >conftest.$ac_ext <<_ACEOF
11368 #line 11368 "configure"
11369 #include "confdefs.h"
11370
11371 #include <X11/Shell.h>
11372
11373 int
11374 main ()
11375 {
11376 int num = IceConnectionNumber(0)
11377
11378   ;
11379   return 0;
11380 }
11381 _ACEOF
11382 rm -f conftest.$ac_objext conftest$ac_exeext
11383 if { (eval echo "$as_me:11383: \"$ac_link\"") >&5
11384   (eval $ac_link) 2>&5
11385   ac_status=$?
11386   echo "$as_me:11386: \$? = $ac_status" >&5
11387   (exit $ac_status); } &&
11388          { ac_try='test -s conftest$ac_exeext'
11389   { (eval echo "$as_me:11389: \"$ac_try\"") >&5
11390   (eval $ac_try) 2>&5
11391   ac_status=$?
11392   echo "$as_me:11392: \$? = $ac_status" >&5
11393   (exit $ac_status); }; }; then
11394   cf_cv_xt_ice_compat=yes
11395 else
11396   echo "$as_me: failed program was:" >&5
11397 cat conftest.$ac_ext >&5
11398 cf_cv_xt_ice_compat=no
11399 fi
11400 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11401 fi
11402 echo "$as_me:11402: result: $cf_cv_xt_ice_compat" >&5
11403 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11404
11405         if test "$cf_cv_xt_ice_compat" = no
11406         then
11407                 # workaround for broken ".pc" files used for X Toolkit.
11408                 case "x$X_PRE_LIBS" in #(vi
11409                 *-lICE*)
11410                         case "x$LIBS" in #(vi
11411                         *-lICE*) #(vi
11412                                 ;;
11413                         *)
11414                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11415
11416 echo "${as_me:-configure}:11416: testing work around broken ICE dependency ..." 1>&5
11417
11418 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11419         test -n "$verbose" && echo "    found package ice" 1>&6
11420
11421 echo "${as_me:-configure}:11421: testing found package ice ..." 1>&5
11422
11423         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11424         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11425         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11426
11427 echo "${as_me:-configure}:11427: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11428
11429         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11430
11431 echo "${as_me:-configure}:11431: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11432
11433 cf_fix_cppflags=no
11434 cf_new_cflags=
11435 cf_new_cppflags=
11436 cf_new_extra_cppflags=
11437
11438 for cf_add_cflags in $cf_pkgconfig_incs
11439 do
11440 case $cf_fix_cppflags in
11441 no)
11442         case $cf_add_cflags in #(vi
11443         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11444                 case $cf_add_cflags in
11445                 -D*)
11446                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11447
11448                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11449                                 && test -z "${cf_tst_cflags}" \
11450                                 && cf_fix_cppflags=yes
11451
11452                         if test $cf_fix_cppflags = yes ; then
11453                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11454                                 continue
11455                         elif test "${cf_tst_cflags}" = "\"'" ; then
11456                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11457                                 continue
11458                         fi
11459                         ;;
11460                 esac
11461                 case "$CPPFLAGS" in
11462                 *$cf_add_cflags) #(vi
11463                         ;;
11464                 *) #(vi
11465                         case $cf_add_cflags in #(vi
11466                         -D*)
11467                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11468
11469 CPPFLAGS=`echo "$CPPFLAGS" | \
11470         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11471                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11472
11473                                 ;;
11474                         esac
11475                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11476                         ;;
11477                 esac
11478                 ;;
11479         *)
11480                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11481                 ;;
11482         esac
11483         ;;
11484 yes)
11485         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11486
11487         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11488
11489         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11490                 && test -z "${cf_tst_cflags}" \
11491                 && cf_fix_cppflags=no
11492         ;;
11493 esac
11494 done
11495
11496 if test -n "$cf_new_cflags" ; then
11497
11498         CFLAGS="$CFLAGS $cf_new_cflags"
11499 fi
11500
11501 if test -n "$cf_new_cppflags" ; then
11502
11503         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11504 fi
11505
11506 if test -n "$cf_new_extra_cppflags" ; then
11507
11508         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11509 fi
11510
11511 cf_add_libs="$cf_pkgconfig_libs"
11512 # Filter out duplicates - this happens with badly-designed ".pc" files...
11513 for cf_add_1lib in $LIBS
11514 do
11515         for cf_add_2lib in $cf_add_libs
11516         do
11517                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11518                 then
11519                         cf_add_1lib=
11520                         break
11521                 fi
11522         done
11523         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11524 done
11525 LIBS="$cf_add_libs"
11526
11527 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11528         test -n "$verbose" && echo "    found package sm" 1>&6
11529
11530 echo "${as_me:-configure}:11530: testing found package sm ..." 1>&5
11531
11532         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11533         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11534         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11535
11536 echo "${as_me:-configure}:11536: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11537
11538         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11539
11540 echo "${as_me:-configure}:11540: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11541
11542 cf_fix_cppflags=no
11543 cf_new_cflags=
11544 cf_new_cppflags=
11545 cf_new_extra_cppflags=
11546
11547 for cf_add_cflags in $cf_pkgconfig_incs
11548 do
11549 case $cf_fix_cppflags in
11550 no)
11551         case $cf_add_cflags in #(vi
11552         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11553                 case $cf_add_cflags in
11554                 -D*)
11555                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11556
11557                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11558                                 && test -z "${cf_tst_cflags}" \
11559                                 && cf_fix_cppflags=yes
11560
11561                         if test $cf_fix_cppflags = yes ; then
11562                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11563                                 continue
11564                         elif test "${cf_tst_cflags}" = "\"'" ; then
11565                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11566                                 continue
11567                         fi
11568                         ;;
11569                 esac
11570                 case "$CPPFLAGS" in
11571                 *$cf_add_cflags) #(vi
11572                         ;;
11573                 *) #(vi
11574                         case $cf_add_cflags in #(vi
11575                         -D*)
11576                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11577
11578 CPPFLAGS=`echo "$CPPFLAGS" | \
11579         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11580                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11581
11582                                 ;;
11583                         esac
11584                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11585                         ;;
11586                 esac
11587                 ;;
11588         *)
11589                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11590                 ;;
11591         esac
11592         ;;
11593 yes)
11594         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11595
11596         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11597
11598         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11599                 && test -z "${cf_tst_cflags}" \
11600                 && cf_fix_cppflags=no
11601         ;;
11602 esac
11603 done
11604
11605 if test -n "$cf_new_cflags" ; then
11606
11607         CFLAGS="$CFLAGS $cf_new_cflags"
11608 fi
11609
11610 if test -n "$cf_new_cppflags" ; then
11611
11612         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11613 fi
11614
11615 if test -n "$cf_new_extra_cppflags" ; then
11616
11617         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11618 fi
11619
11620 cf_add_libs="$cf_pkgconfig_libs"
11621 # Filter out duplicates - this happens with badly-designed ".pc" files...
11622 for cf_add_1lib in $LIBS
11623 do
11624         for cf_add_2lib in $cf_add_libs
11625         do
11626                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11627                 then
11628                         cf_add_1lib=
11629                         break
11630                 fi
11631         done
11632         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11633 done
11634 LIBS="$cf_add_libs"
11635
11636         :
11637 else
11638         cf_pkgconfig_incs=
11639         cf_pkgconfig_libs=
11640         :
11641 fi
11642
11643 else
11644         cf_pkgconfig_incs=
11645         cf_pkgconfig_libs=
11646
11647 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11648
11649 echo "${as_me:-configure}:11649: testing ...before $LIBS ..." 1>&5
11650
11651 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
11652 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11653
11654 echo "${as_me:-configure}:11654: testing ...after  $LIBS ..." 1>&5
11655
11656 fi
11657
11658                                 ;;
11659                         esac
11660                         ;;
11661                 esac
11662         fi
11663
11664         cf_have_X_LIBS=yes
11665
11666 else
11667         cf_pkgconfig_incs=
11668         cf_pkgconfig_libs=
11669
11670         LDFLAGS="$X_LIBS $LDFLAGS"
11671
11672 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11673
11674 echo "${as_me:-configure}:11674: testing checking additions to CFLAGS ..." 1>&5
11675
11676 cf_check_cflags="$CFLAGS"
11677 cf_check_cppflags="$CPPFLAGS"
11678
11679 cf_fix_cppflags=no
11680 cf_new_cflags=
11681 cf_new_cppflags=
11682 cf_new_extra_cppflags=
11683
11684 for cf_add_cflags in $X_CFLAGS
11685 do
11686 case $cf_fix_cppflags in
11687 no)
11688         case $cf_add_cflags in #(vi
11689         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11690                 case $cf_add_cflags in
11691                 -D*)
11692                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11693
11694                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11695                                 && test -z "${cf_tst_cflags}" \
11696                                 && cf_fix_cppflags=yes
11697
11698                         if test $cf_fix_cppflags = yes ; then
11699                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11700                                 continue
11701                         elif test "${cf_tst_cflags}" = "\"'" ; then
11702                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11703                                 continue
11704                         fi
11705                         ;;
11706                 esac
11707                 case "$CPPFLAGS" in
11708                 *$cf_add_cflags) #(vi
11709                         ;;
11710                 *) #(vi
11711                         case $cf_add_cflags in #(vi
11712                         -D*)
11713                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11714
11715 CPPFLAGS=`echo "$CPPFLAGS" | \
11716         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11717                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11718
11719                                 ;;
11720                         esac
11721                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11722                         ;;
11723                 esac
11724                 ;;
11725         *)
11726                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11727                 ;;
11728         esac
11729         ;;
11730 yes)
11731         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11732
11733         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11734
11735         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11736                 && test -z "${cf_tst_cflags}" \
11737                 && cf_fix_cppflags=no
11738         ;;
11739 esac
11740 done
11741
11742 if test -n "$cf_new_cflags" ; then
11743         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11744
11745 echo "${as_me:-configure}:11745: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11746
11747         CFLAGS="$CFLAGS $cf_new_cflags"
11748 fi
11749
11750 if test -n "$cf_new_cppflags" ; then
11751         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11752
11753 echo "${as_me:-configure}:11753: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11754
11755         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11756 fi
11757
11758 if test -n "$cf_new_extra_cppflags" ; then
11759         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11760
11761 echo "${as_me:-configure}:11761: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11762
11763         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11764 fi
11765
11766 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
11767 cat >conftest.$ac_ext <<_ACEOF
11768 #line 11768 "configure"
11769 #include "confdefs.h"
11770 #include <stdio.h>
11771 int
11772 main ()
11773 {
11774 printf("Hello world");
11775   ;
11776   return 0;
11777 }
11778 _ACEOF
11779 rm -f conftest.$ac_objext conftest$ac_exeext
11780 if { (eval echo "$as_me:11780: \"$ac_link\"") >&5
11781   (eval $ac_link) 2>&5
11782   ac_status=$?
11783   echo "$as_me:11783: \$? = $ac_status" >&5
11784   (exit $ac_status); } &&
11785          { ac_try='test -s conftest$ac_exeext'
11786   { (eval echo "$as_me:11786: \"$ac_try\"") >&5
11787   (eval $ac_try) 2>&5
11788   ac_status=$?
11789   echo "$as_me:11789: \$? = $ac_status" >&5
11790   (exit $ac_status); }; }; then
11791   :
11792 else
11793   echo "$as_me: failed program was:" >&5
11794 cat conftest.$ac_ext >&5
11795 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
11796
11797 echo "${as_me:-configure}:11797: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
11798
11799          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
11800                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
11801
11802 echo "${as_me:-configure}:11802: testing but keeping change to \$CPPFLAGS ..." 1>&5
11803
11804          fi
11805          CFLAGS="$cf_check_flags"
11806 fi
11807 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11808 fi
11809
11810         echo "$as_me:11810: checking for XOpenDisplay" >&5
11811 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
11812 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
11813   echo $ECHO_N "(cached) $ECHO_C" >&6
11814 else
11815   cat >conftest.$ac_ext <<_ACEOF
11816 #line 11816 "configure"
11817 #include "confdefs.h"
11818 /* System header to define __stub macros and hopefully few prototypes,
11819     which can conflict with char XOpenDisplay (); below.  */
11820 #include <assert.h>
11821 /* Override any gcc2 internal prototype to avoid an error.  */
11822 #ifdef __cplusplus
11823 extern "C"
11824 #endif
11825 /* We use char because int might match the return type of a gcc2
11826    builtin and then its argument prototype would still apply.  */
11827 char XOpenDisplay ();
11828 char (*f) ();
11829
11830 int
11831 main ()
11832 {
11833 /* The GNU C library defines this for functions which it implements
11834     to always fail with ENOSYS.  Some functions are actually named
11835     something starting with __ and the normal name is an alias.  */
11836 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
11837 choke me
11838 #else
11839 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11840 #endif
11841
11842   ;
11843   return 0;
11844 }
11845 _ACEOF
11846 rm -f conftest.$ac_objext conftest$ac_exeext
11847 if { (eval echo "$as_me:11847: \"$ac_link\"") >&5
11848   (eval $ac_link) 2>&5
11849   ac_status=$?
11850   echo "$as_me:11850: \$? = $ac_status" >&5
11851   (exit $ac_status); } &&
11852          { ac_try='test -s conftest$ac_exeext'
11853   { (eval echo "$as_me:11853: \"$ac_try\"") >&5
11854   (eval $ac_try) 2>&5
11855   ac_status=$?
11856   echo "$as_me:11856: \$? = $ac_status" >&5
11857   (exit $ac_status); }; }; then
11858   ac_cv_func_XOpenDisplay=yes
11859 else
11860   echo "$as_me: failed program was:" >&5
11861 cat conftest.$ac_ext >&5
11862 ac_cv_func_XOpenDisplay=no
11863 fi
11864 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11865 fi
11866 echo "$as_me:11866: result: $ac_cv_func_XOpenDisplay" >&5
11867 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
11868 if test $ac_cv_func_XOpenDisplay = yes; then
11869   :
11870 else
11871
11872         echo "$as_me:11872: checking for XOpenDisplay in -lX11" >&5
11873 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
11874 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
11875   echo $ECHO_N "(cached) $ECHO_C" >&6
11876 else
11877   ac_check_lib_save_LIBS=$LIBS
11878 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11879 cat >conftest.$ac_ext <<_ACEOF
11880 #line 11880 "configure"
11881 #include "confdefs.h"
11882
11883 /* Override any gcc2 internal prototype to avoid an error.  */
11884 #ifdef __cplusplus
11885 extern "C"
11886 #endif
11887 /* We use char because int might match the return type of a gcc2
11888    builtin and then its argument prototype would still apply.  */
11889 char XOpenDisplay ();
11890 int
11891 main ()
11892 {
11893 XOpenDisplay ();
11894   ;
11895   return 0;
11896 }
11897 _ACEOF
11898 rm -f conftest.$ac_objext conftest$ac_exeext
11899 if { (eval echo "$as_me:11899: \"$ac_link\"") >&5
11900   (eval $ac_link) 2>&5
11901   ac_status=$?
11902   echo "$as_me:11902: \$? = $ac_status" >&5
11903   (exit $ac_status); } &&
11904          { ac_try='test -s conftest$ac_exeext'
11905   { (eval echo "$as_me:11905: \"$ac_try\"") >&5
11906   (eval $ac_try) 2>&5
11907   ac_status=$?
11908   echo "$as_me:11908: \$? = $ac_status" >&5
11909   (exit $ac_status); }; }; then
11910   ac_cv_lib_X11_XOpenDisplay=yes
11911 else
11912   echo "$as_me: failed program was:" >&5
11913 cat conftest.$ac_ext >&5
11914 ac_cv_lib_X11_XOpenDisplay=no
11915 fi
11916 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11917 LIBS=$ac_check_lib_save_LIBS
11918 fi
11919 echo "$as_me:11919: result: $ac_cv_lib_X11_XOpenDisplay" >&5
11920 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
11921 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
11922
11923 cf_add_libs="-lX11"
11924 # Filter out duplicates - this happens with badly-designed ".pc" files...
11925 for cf_add_1lib in $LIBS
11926 do
11927         for cf_add_2lib in $cf_add_libs
11928         do
11929                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11930                 then
11931                         cf_add_1lib=
11932                         break
11933                 fi
11934         done
11935         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11936 done
11937 LIBS="$cf_add_libs"
11938
11939 fi
11940
11941 fi
11942
11943         echo "$as_me:11943: checking for XtAppInitialize" >&5
11944 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
11945 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
11946   echo $ECHO_N "(cached) $ECHO_C" >&6
11947 else
11948   cat >conftest.$ac_ext <<_ACEOF
11949 #line 11949 "configure"
11950 #include "confdefs.h"
11951 /* System header to define __stub macros and hopefully few prototypes,
11952     which can conflict with char XtAppInitialize (); below.  */
11953 #include <assert.h>
11954 /* Override any gcc2 internal prototype to avoid an error.  */
11955 #ifdef __cplusplus
11956 extern "C"
11957 #endif
11958 /* We use char because int might match the return type of a gcc2
11959    builtin and then its argument prototype would still apply.  */
11960 char XtAppInitialize ();
11961 char (*f) ();
11962
11963 int
11964 main ()
11965 {
11966 /* The GNU C library defines this for functions which it implements
11967     to always fail with ENOSYS.  Some functions are actually named
11968     something starting with __ and the normal name is an alias.  */
11969 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
11970 choke me
11971 #else
11972 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11973 #endif
11974
11975   ;
11976   return 0;
11977 }
11978 _ACEOF
11979 rm -f conftest.$ac_objext conftest$ac_exeext
11980 if { (eval echo "$as_me:11980: \"$ac_link\"") >&5
11981   (eval $ac_link) 2>&5
11982   ac_status=$?
11983   echo "$as_me:11983: \$? = $ac_status" >&5
11984   (exit $ac_status); } &&
11985          { ac_try='test -s conftest$ac_exeext'
11986   { (eval echo "$as_me:11986: \"$ac_try\"") >&5
11987   (eval $ac_try) 2>&5
11988   ac_status=$?
11989   echo "$as_me:11989: \$? = $ac_status" >&5
11990   (exit $ac_status); }; }; then
11991   ac_cv_func_XtAppInitialize=yes
11992 else
11993   echo "$as_me: failed program was:" >&5
11994 cat conftest.$ac_ext >&5
11995 ac_cv_func_XtAppInitialize=no
11996 fi
11997 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11998 fi
11999 echo "$as_me:11999: result: $ac_cv_func_XtAppInitialize" >&5
12000 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12001 if test $ac_cv_func_XtAppInitialize = yes; then
12002   :
12003 else
12004
12005         echo "$as_me:12005: checking for XtAppInitialize in -lXt" >&5
12006 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12007 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12008   echo $ECHO_N "(cached) $ECHO_C" >&6
12009 else
12010   ac_check_lib_save_LIBS=$LIBS
12011 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12012 cat >conftest.$ac_ext <<_ACEOF
12013 #line 12013 "configure"
12014 #include "confdefs.h"
12015
12016 /* Override any gcc2 internal prototype to avoid an error.  */
12017 #ifdef __cplusplus
12018 extern "C"
12019 #endif
12020 /* We use char because int might match the return type of a gcc2
12021    builtin and then its argument prototype would still apply.  */
12022 char XtAppInitialize ();
12023 int
12024 main ()
12025 {
12026 XtAppInitialize ();
12027   ;
12028   return 0;
12029 }
12030 _ACEOF
12031 rm -f conftest.$ac_objext conftest$ac_exeext
12032 if { (eval echo "$as_me:12032: \"$ac_link\"") >&5
12033   (eval $ac_link) 2>&5
12034   ac_status=$?
12035   echo "$as_me:12035: \$? = $ac_status" >&5
12036   (exit $ac_status); } &&
12037          { ac_try='test -s conftest$ac_exeext'
12038   { (eval echo "$as_me:12038: \"$ac_try\"") >&5
12039   (eval $ac_try) 2>&5
12040   ac_status=$?
12041   echo "$as_me:12041: \$? = $ac_status" >&5
12042   (exit $ac_status); }; }; then
12043   ac_cv_lib_Xt_XtAppInitialize=yes
12044 else
12045   echo "$as_me: failed program was:" >&5
12046 cat conftest.$ac_ext >&5
12047 ac_cv_lib_Xt_XtAppInitialize=no
12048 fi
12049 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12050 LIBS=$ac_check_lib_save_LIBS
12051 fi
12052 echo "$as_me:12052: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12053 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12054 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12055
12056 cat >>confdefs.h <<\EOF
12057 #define HAVE_LIBXT 1
12058 EOF
12059
12060                  cf_have_X_LIBS=Xt
12061                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12062 fi
12063
12064 fi
12065
12066 fi
12067
12068 if test $cf_have_X_LIBS = no ; then
12069         { echo "$as_me:12069: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12070 test program.  You will have to check and add the proper libraries by hand
12071 to makefile." >&5
12072 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12073 test program.  You will have to check and add the proper libraries by hand
12074 to makefile." >&2;}
12075 fi
12076
12077 cf_x_athena_root=$cf_x_athena
12078 cf_x_athena_inc=""
12079
12080 for cf_path in default \
12081         /usr/contrib/X11R6 \
12082         /usr/contrib/X11R5 \
12083         /usr/lib/X11R5 \
12084         /usr/local
12085 do
12086         if test -z "$cf_x_athena_inc" ; then
12087                 cf_save="$CPPFLAGS"
12088                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12089                 if test $cf_path != default ; then
12090                         CPPFLAGS="$cf_save -I$cf_path/include"
12091                         echo "$as_me:12091: checking for $cf_test in $cf_path" >&5
12092 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12093                 else
12094                         echo "$as_me:12094: checking for $cf_test" >&5
12095 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12096                 fi
12097                 cat >conftest.$ac_ext <<_ACEOF
12098 #line 12098 "configure"
12099 #include "confdefs.h"
12100
12101 #include <X11/Intrinsic.h>
12102 #include <$cf_test>
12103 int
12104 main ()
12105 {
12106
12107   ;
12108   return 0;
12109 }
12110 _ACEOF
12111 rm -f conftest.$ac_objext
12112 if { (eval echo "$as_me:12112: \"$ac_compile\"") >&5
12113   (eval $ac_compile) 2>&5
12114   ac_status=$?
12115   echo "$as_me:12115: \$? = $ac_status" >&5
12116   (exit $ac_status); } &&
12117          { ac_try='test -s conftest.$ac_objext'
12118   { (eval echo "$as_me:12118: \"$ac_try\"") >&5
12119   (eval $ac_try) 2>&5
12120   ac_status=$?
12121   echo "$as_me:12121: \$? = $ac_status" >&5
12122   (exit $ac_status); }; }; then
12123   cf_result=yes
12124 else
12125   echo "$as_me: failed program was:" >&5
12126 cat conftest.$ac_ext >&5
12127 cf_result=no
12128 fi
12129 rm -f conftest.$ac_objext conftest.$ac_ext
12130                 echo "$as_me:12130: result: $cf_result" >&5
12131 echo "${ECHO_T}$cf_result" >&6
12132                 if test "$cf_result" = yes ; then
12133                         cf_x_athena_inc=$cf_path
12134                         break
12135                 else
12136                         CPPFLAGS="$cf_save"
12137                 fi
12138         fi
12139 done
12140
12141 if test -z "$cf_x_athena_inc" ; then
12142         { echo "$as_me:12142: WARNING: Unable to successfully find Athena header files with test program" >&5
12143 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12144 elif test "$cf_x_athena_inc" != default ; then
12145         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12146 fi
12147
12148 cf_x_athena_root=$cf_x_athena
12149 cf_x_athena_lib=""
12150
12151 for cf_path in default \
12152         /usr/contrib/X11R6 \
12153         /usr/contrib/X11R5 \
12154         /usr/lib/X11R5 \
12155         /usr/local
12156 do
12157         for cf_lib in \
12158                 ${cf_x_athena_root} \
12159                 ${cf_x_athena_root}7 \
12160                 ${cf_x_athena_root}6
12161         do
12162         for cf_libs in \
12163                 "-l$cf_lib -lXmu" \
12164                 "-l$cf_lib -lXpm -lXmu" \
12165                 "-l${cf_lib}_s -lXmu_s"
12166         do
12167                 if test -z "$cf_x_athena_lib" ; then
12168                         cf_save="$LIBS"
12169                         cf_test=XawSimpleMenuAddGlobalActions
12170                         if test $cf_path != default ; then
12171
12172 cf_add_libs="-L$cf_path/lib $cf_libs"
12173 # Filter out duplicates - this happens with badly-designed ".pc" files...
12174 for cf_add_1lib in $LIBS
12175 do
12176         for cf_add_2lib in $cf_add_libs
12177         do
12178                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12179                 then
12180                         cf_add_1lib=
12181                         break
12182                 fi
12183         done
12184         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12185 done
12186 LIBS="$cf_add_libs"
12187
12188                                 echo "$as_me:12188: checking for $cf_libs in $cf_path" >&5
12189 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12190                         else
12191
12192 cf_add_libs="$cf_libs"
12193 # Filter out duplicates - this happens with badly-designed ".pc" files...
12194 for cf_add_1lib in $LIBS
12195 do
12196         for cf_add_2lib in $cf_add_libs
12197         do
12198                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12199                 then
12200                         cf_add_1lib=
12201                         break
12202                 fi
12203         done
12204         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12205 done
12206 LIBS="$cf_add_libs"
12207
12208                                 echo "$as_me:12208: checking for $cf_test in $cf_libs" >&5
12209 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12210                         fi
12211                         cat >conftest.$ac_ext <<_ACEOF
12212 #line 12212 "configure"
12213 #include "confdefs.h"
12214
12215 #include <X11/Intrinsic.h>
12216 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12217
12218 int
12219 main ()
12220 {
12221
12222 $cf_test((XtAppContext) 0)
12223   ;
12224   return 0;
12225 }
12226 _ACEOF
12227 rm -f conftest.$ac_objext conftest$ac_exeext
12228 if { (eval echo "$as_me:12228: \"$ac_link\"") >&5
12229   (eval $ac_link) 2>&5
12230   ac_status=$?
12231   echo "$as_me:12231: \$? = $ac_status" >&5
12232   (exit $ac_status); } &&
12233          { ac_try='test -s conftest$ac_exeext'
12234   { (eval echo "$as_me:12234: \"$ac_try\"") >&5
12235   (eval $ac_try) 2>&5
12236   ac_status=$?
12237   echo "$as_me:12237: \$? = $ac_status" >&5
12238   (exit $ac_status); }; }; then
12239   cf_result=yes
12240 else
12241   echo "$as_me: failed program was:" >&5
12242 cat conftest.$ac_ext >&5
12243 cf_result=no
12244 fi
12245 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12246                         echo "$as_me:12246: result: $cf_result" >&5
12247 echo "${ECHO_T}$cf_result" >&6
12248                         if test "$cf_result" = yes ; then
12249                                 cf_x_athena_lib="$cf_libs"
12250                                 break
12251                         fi
12252                         LIBS="$cf_save"
12253                 fi
12254         done # cf_libs
12255                 test -n "$cf_x_athena_lib" && break
12256         done # cf_lib
12257 done
12258
12259 if test -z "$cf_x_athena_lib" ; then
12260         { { echo "$as_me:12260: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12261 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12262    { (exit 1); exit 1; }; }
12263 fi
12264
12265 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12266
12267 cat >>confdefs.h <<EOF
12268 #define $cf_x_athena_LIBS 1
12269 EOF
12270
12271 fi
12272
12273 if test -n "$ac_tool_prefix"; then
12274   for ac_prog in xcurses-config
12275   do
12276     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12277 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12278 echo "$as_me:12278: checking for $ac_word" >&5
12279 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12280 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12281   echo $ECHO_N "(cached) $ECHO_C" >&6
12282 else
12283   if test -n "$XCURSES_CONFIG"; then
12284   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12285 else
12286   ac_save_IFS=$IFS; IFS=$ac_path_separator
12287 ac_dummy="$PATH"
12288 for ac_dir in $ac_dummy; do
12289   IFS=$ac_save_IFS
12290   test -z "$ac_dir" && ac_dir=.
12291   $as_executable_p "$ac_dir/$ac_word" || continue
12292 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12293 echo "$as_me:12293: found $ac_dir/$ac_word" >&5
12294 break
12295 done
12296
12297 fi
12298 fi
12299 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12300 if test -n "$XCURSES_CONFIG"; then
12301   echo "$as_me:12301: result: $XCURSES_CONFIG" >&5
12302 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12303 else
12304   echo "$as_me:12304: result: no" >&5
12305 echo "${ECHO_T}no" >&6
12306 fi
12307
12308     test -n "$XCURSES_CONFIG" && break
12309   done
12310 fi
12311 if test -z "$XCURSES_CONFIG"; then
12312   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12313   for ac_prog in xcurses-config
12314 do
12315   # Extract the first word of "$ac_prog", so it can be a program name with args.
12316 set dummy $ac_prog; ac_word=$2
12317 echo "$as_me:12317: checking for $ac_word" >&5
12318 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12319 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12320   echo $ECHO_N "(cached) $ECHO_C" >&6
12321 else
12322   if test -n "$ac_ct_XCURSES_CONFIG"; then
12323   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12324 else
12325   ac_save_IFS=$IFS; IFS=$ac_path_separator
12326 ac_dummy="$PATH"
12327 for ac_dir in $ac_dummy; do
12328   IFS=$ac_save_IFS
12329   test -z "$ac_dir" && ac_dir=.
12330   $as_executable_p "$ac_dir/$ac_word" || continue
12331 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12332 echo "$as_me:12332: found $ac_dir/$ac_word" >&5
12333 break
12334 done
12335
12336 fi
12337 fi
12338 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12339 if test -n "$ac_ct_XCURSES_CONFIG"; then
12340   echo "$as_me:12340: result: $ac_ct_XCURSES_CONFIG" >&5
12341 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12342 else
12343   echo "$as_me:12343: result: no" >&5
12344 echo "${ECHO_T}no" >&6
12345 fi
12346
12347   test -n "$ac_ct_XCURSES_CONFIG" && break
12348 done
12349 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12350
12351   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12352 fi
12353
12354 if test "$XCURSES_CONFIG" != none ; then
12355
12356 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12357
12358 cf_add_libs="`$XCURSES_CONFIG --libs`"
12359 # Filter out duplicates - this happens with badly-designed ".pc" files...
12360 for cf_add_1lib in $LIBS
12361 do
12362         for cf_add_2lib in $cf_add_libs
12363         do
12364                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12365                 then
12366                         cf_add_1lib=
12367                         break
12368                 fi
12369         done
12370         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12371 done
12372 LIBS="$cf_add_libs"
12373
12374 cf_cv_lib_XCurses=yes
12375
12376 else
12377
12378 LDFLAGS="$LDFLAGS $X_LIBS"
12379
12380 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12381
12382 echo "${as_me:-configure}:12382: testing checking additions to CFLAGS ..." 1>&5
12383
12384 cf_check_cflags="$CFLAGS"
12385 cf_check_cppflags="$CPPFLAGS"
12386
12387 cf_fix_cppflags=no
12388 cf_new_cflags=
12389 cf_new_cppflags=
12390 cf_new_extra_cppflags=
12391
12392 for cf_add_cflags in $X_CFLAGS
12393 do
12394 case $cf_fix_cppflags in
12395 no)
12396         case $cf_add_cflags in #(vi
12397         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12398                 case $cf_add_cflags in
12399                 -D*)
12400                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12401
12402                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12403                                 && test -z "${cf_tst_cflags}" \
12404                                 && cf_fix_cppflags=yes
12405
12406                         if test $cf_fix_cppflags = yes ; then
12407                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12408                                 continue
12409                         elif test "${cf_tst_cflags}" = "\"'" ; then
12410                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12411                                 continue
12412                         fi
12413                         ;;
12414                 esac
12415                 case "$CPPFLAGS" in
12416                 *$cf_add_cflags) #(vi
12417                         ;;
12418                 *) #(vi
12419                         case $cf_add_cflags in #(vi
12420                         -D*)
12421                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12422
12423 CPPFLAGS=`echo "$CPPFLAGS" | \
12424         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12425                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12426
12427                                 ;;
12428                         esac
12429                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12430                         ;;
12431                 esac
12432                 ;;
12433         *)
12434                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12435                 ;;
12436         esac
12437         ;;
12438 yes)
12439         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12440
12441         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12442
12443         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12444                 && test -z "${cf_tst_cflags}" \
12445                 && cf_fix_cppflags=no
12446         ;;
12447 esac
12448 done
12449
12450 if test -n "$cf_new_cflags" ; then
12451         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12452
12453 echo "${as_me:-configure}:12453: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12454
12455         CFLAGS="$CFLAGS $cf_new_cflags"
12456 fi
12457
12458 if test -n "$cf_new_cppflags" ; then
12459         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12460
12461 echo "${as_me:-configure}:12461: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12462
12463         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12464 fi
12465
12466 if test -n "$cf_new_extra_cppflags" ; then
12467         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12468
12469 echo "${as_me:-configure}:12469: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12470
12471         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12472 fi
12473
12474 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12475 cat >conftest.$ac_ext <<_ACEOF
12476 #line 12476 "configure"
12477 #include "confdefs.h"
12478 #include <stdio.h>
12479 int
12480 main ()
12481 {
12482 printf("Hello world");
12483   ;
12484   return 0;
12485 }
12486 _ACEOF
12487 rm -f conftest.$ac_objext conftest$ac_exeext
12488 if { (eval echo "$as_me:12488: \"$ac_link\"") >&5
12489   (eval $ac_link) 2>&5
12490   ac_status=$?
12491   echo "$as_me:12491: \$? = $ac_status" >&5
12492   (exit $ac_status); } &&
12493          { ac_try='test -s conftest$ac_exeext'
12494   { (eval echo "$as_me:12494: \"$ac_try\"") >&5
12495   (eval $ac_try) 2>&5
12496   ac_status=$?
12497   echo "$as_me:12497: \$? = $ac_status" >&5
12498   (exit $ac_status); }; }; then
12499   :
12500 else
12501   echo "$as_me: failed program was:" >&5
12502 cat conftest.$ac_ext >&5
12503 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12504
12505 echo "${as_me:-configure}:12505: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12506
12507          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12508                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12509
12510 echo "${as_me:-configure}:12510: testing but keeping change to \$CPPFLAGS ..." 1>&5
12511
12512          fi
12513          CFLAGS="$cf_check_flags"
12514 fi
12515 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12516 fi
12517
12518 echo "$as_me:12518: checking for XOpenDisplay in -lX11" >&5
12519 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12520 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12521   echo $ECHO_N "(cached) $ECHO_C" >&6
12522 else
12523   ac_check_lib_save_LIBS=$LIBS
12524 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12525 cat >conftest.$ac_ext <<_ACEOF
12526 #line 12526 "configure"
12527 #include "confdefs.h"
12528
12529 /* Override any gcc2 internal prototype to avoid an error.  */
12530 #ifdef __cplusplus
12531 extern "C"
12532 #endif
12533 /* We use char because int might match the return type of a gcc2
12534    builtin and then its argument prototype would still apply.  */
12535 char XOpenDisplay ();
12536 int
12537 main ()
12538 {
12539 XOpenDisplay ();
12540   ;
12541   return 0;
12542 }
12543 _ACEOF
12544 rm -f conftest.$ac_objext conftest$ac_exeext
12545 if { (eval echo "$as_me:12545: \"$ac_link\"") >&5
12546   (eval $ac_link) 2>&5
12547   ac_status=$?
12548   echo "$as_me:12548: \$? = $ac_status" >&5
12549   (exit $ac_status); } &&
12550          { ac_try='test -s conftest$ac_exeext'
12551   { (eval echo "$as_me:12551: \"$ac_try\"") >&5
12552   (eval $ac_try) 2>&5
12553   ac_status=$?
12554   echo "$as_me:12554: \$? = $ac_status" >&5
12555   (exit $ac_status); }; }; then
12556   ac_cv_lib_X11_XOpenDisplay=yes
12557 else
12558   echo "$as_me: failed program was:" >&5
12559 cat conftest.$ac_ext >&5
12560 ac_cv_lib_X11_XOpenDisplay=no
12561 fi
12562 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12563 LIBS=$ac_check_lib_save_LIBS
12564 fi
12565 echo "$as_me:12565: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12566 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12567 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12568
12569 cf_add_libs="-lX11"
12570 # Filter out duplicates - this happens with badly-designed ".pc" files...
12571 for cf_add_1lib in $LIBS
12572 do
12573         for cf_add_2lib in $cf_add_libs
12574         do
12575                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12576                 then
12577                         cf_add_1lib=
12578                         break
12579                 fi
12580         done
12581         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12582 done
12583 LIBS="$cf_add_libs"
12584
12585 fi
12586
12587 echo "$as_me:12587: checking for XCurses library" >&5
12588 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
12589 if test "${cf_cv_lib_XCurses+set}" = set; then
12590   echo $ECHO_N "(cached) $ECHO_C" >&6
12591 else
12592
12593 cf_add_libs="-lXCurses"
12594 # Filter out duplicates - this happens with badly-designed ".pc" files...
12595 for cf_add_1lib in $LIBS
12596 do
12597         for cf_add_2lib in $cf_add_libs
12598         do
12599                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12600                 then
12601                         cf_add_1lib=
12602                         break
12603                 fi
12604         done
12605         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12606 done
12607 LIBS="$cf_add_libs"
12608
12609 cat >conftest.$ac_ext <<_ACEOF
12610 #line 12610 "configure"
12611 #include "confdefs.h"
12612
12613 #include <xcurses.h>
12614 char *XCursesProgramName = "test";
12615
12616 int
12617 main ()
12618 {
12619 XCursesExit();
12620   ;
12621   return 0;
12622 }
12623 _ACEOF
12624 rm -f conftest.$ac_objext conftest$ac_exeext
12625 if { (eval echo "$as_me:12625: \"$ac_link\"") >&5
12626   (eval $ac_link) 2>&5
12627   ac_status=$?
12628   echo "$as_me:12628: \$? = $ac_status" >&5
12629   (exit $ac_status); } &&
12630          { ac_try='test -s conftest$ac_exeext'
12631   { (eval echo "$as_me:12631: \"$ac_try\"") >&5
12632   (eval $ac_try) 2>&5
12633   ac_status=$?
12634   echo "$as_me:12634: \$? = $ac_status" >&5
12635   (exit $ac_status); }; }; then
12636   cf_cv_lib_XCurses=yes
12637 else
12638   echo "$as_me: failed program was:" >&5
12639 cat conftest.$ac_ext >&5
12640 cf_cv_lib_XCurses=no
12641 fi
12642 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12643
12644 fi
12645 echo "$as_me:12645: result: $cf_cv_lib_XCurses" >&5
12646 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
12647
12648 fi
12649
12650 if test $cf_cv_lib_XCurses = yes ; then
12651
12652 cat >>confdefs.h <<\EOF
12653 #define UNIX 1
12654 EOF
12655
12656 cat >>confdefs.h <<\EOF
12657 #define XCURSES 1
12658 EOF
12659
12660         echo "$as_me:12660: checking for xcurses.h" >&5
12661 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
12662 if test "${ac_cv_header_xcurses_h+set}" = set; then
12663   echo $ECHO_N "(cached) $ECHO_C" >&6
12664 else
12665   cat >conftest.$ac_ext <<_ACEOF
12666 #line 12666 "configure"
12667 #include "confdefs.h"
12668 #include <xcurses.h>
12669 _ACEOF
12670 if { (eval echo "$as_me:12670: \"$ac_cpp conftest.$ac_ext\"") >&5
12671   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12672   ac_status=$?
12673   egrep -v '^ *\+' conftest.er1 >conftest.err
12674   rm -f conftest.er1
12675   cat conftest.err >&5
12676   echo "$as_me:12676: \$? = $ac_status" >&5
12677   (exit $ac_status); } >/dev/null; then
12678   if test -s conftest.err; then
12679     ac_cpp_err=$ac_c_preproc_warn_flag
12680   else
12681     ac_cpp_err=
12682   fi
12683 else
12684   ac_cpp_err=yes
12685 fi
12686 if test -z "$ac_cpp_err"; then
12687   ac_cv_header_xcurses_h=yes
12688 else
12689   echo "$as_me: failed program was:" >&5
12690   cat conftest.$ac_ext >&5
12691   ac_cv_header_xcurses_h=no
12692 fi
12693 rm -f conftest.err conftest.$ac_ext
12694 fi
12695 echo "$as_me:12695: result: $ac_cv_header_xcurses_h" >&5
12696 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
12697 if test $ac_cv_header_xcurses_h = yes; then
12698
12699 cat >>confdefs.h <<\EOF
12700 #define HAVE_XCURSES 1
12701 EOF
12702
12703 fi
12704
12705 else
12706         { { echo "$as_me:12706: error: Cannot link with XCurses" >&5
12707 echo "$as_me: error: Cannot link with XCurses" >&2;}
12708    { (exit 1); exit 1; }; }
12709 fi
12710
12711         ;;
12712 esac
12713
12714 case $cf_cv_screen in
12715 curses|curses_*)
12716
12717 echo "$as_me:12717: checking for NetBSD form.h" >&5
12718 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
12719 if test "${cf_cv_netbsd_form_h+set}" = set; then
12720   echo $ECHO_N "(cached) $ECHO_C" >&6
12721 else
12722
12723 cat >conftest.$ac_ext <<_ACEOF
12724 #line 12724 "configure"
12725 #include "confdefs.h"
12726
12727 #include <${cf_cv_ncurses_header:-curses.h}>
12728 #include <form.h>
12729
12730 int
12731 main ()
12732 {
12733
12734         FORM *form;
12735         int y = current_field(form)->cursor_ypos;
12736         int x = current_field(form)->cursor_xpos;
12737
12738   ;
12739   return 0;
12740 }
12741 _ACEOF
12742 rm -f conftest.$ac_objext
12743 if { (eval echo "$as_me:12743: \"$ac_compile\"") >&5
12744   (eval $ac_compile) 2>&5
12745   ac_status=$?
12746   echo "$as_me:12746: \$? = $ac_status" >&5
12747   (exit $ac_status); } &&
12748          { ac_try='test -s conftest.$ac_objext'
12749   { (eval echo "$as_me:12749: \"$ac_try\"") >&5
12750   (eval $ac_try) 2>&5
12751   ac_status=$?
12752   echo "$as_me:12752: \$? = $ac_status" >&5
12753   (exit $ac_status); }; }; then
12754   cf_cv_netbsd_form_h=yes
12755
12756 else
12757   echo "$as_me: failed program was:" >&5
12758 cat conftest.$ac_ext >&5
12759 cf_cv_netbsd_form_h=no
12760 fi
12761 rm -f conftest.$ac_objext conftest.$ac_ext
12762
12763 fi
12764 echo "$as_me:12764: result: $cf_cv_netbsd_form_h" >&5
12765 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
12766
12767 test "$cf_cv_netbsd_form_h" = yes &&
12768 cat >>confdefs.h <<\EOF
12769 #define HAVE_NETBSD_FORM_H 1
12770 EOF
12771
12772 echo "$as_me:12772: checking for NetBSD menu.h" >&5
12773 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
12774 if test "${cf_cv_netbsd_menu_h+set}" = set; then
12775   echo $ECHO_N "(cached) $ECHO_C" >&6
12776 else
12777
12778 cat >conftest.$ac_ext <<_ACEOF
12779 #line 12779 "configure"
12780 #include "confdefs.h"
12781
12782 #include <${cf_cv_ncurses_header:-curses.h}>
12783 #include <menu.h>
12784
12785 int
12786 main ()
12787 {
12788
12789         MENU *menu;
12790         int y = menu->max_item_width;
12791
12792   ;
12793   return 0;
12794 }
12795 _ACEOF
12796 rm -f conftest.$ac_objext
12797 if { (eval echo "$as_me:12797: \"$ac_compile\"") >&5
12798   (eval $ac_compile) 2>&5
12799   ac_status=$?
12800   echo "$as_me:12800: \$? = $ac_status" >&5
12801   (exit $ac_status); } &&
12802          { ac_try='test -s conftest.$ac_objext'
12803   { (eval echo "$as_me:12803: \"$ac_try\"") >&5
12804   (eval $ac_try) 2>&5
12805   ac_status=$?
12806   echo "$as_me:12806: \$? = $ac_status" >&5
12807   (exit $ac_status); }; }; then
12808   cf_cv_netbsd_menu_h=yes
12809
12810 else
12811   echo "$as_me: failed program was:" >&5
12812 cat conftest.$ac_ext >&5
12813 cf_cv_netbsd_menu_h=no
12814 fi
12815 rm -f conftest.$ac_objext conftest.$ac_ext
12816
12817 fi
12818 echo "$as_me:12818: result: $cf_cv_netbsd_menu_h" >&5
12819 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
12820
12821 test "$cf_cv_netbsd_menu_h" = yes &&
12822 cat >>confdefs.h <<\EOF
12823 #define HAVE_NETBSD_MENU_H 1
12824 EOF
12825
12826         ;;
12827 ncursesw)
12828         cf_cv_libtype=w
12829         ;;
12830 esac
12831
12832 case $cf_cv_screen in #(vi
12833 pdcurses) #(vi
12834         ;;
12835 *)
12836         # look for curses-related libraries
12837         : ${cf_panel_lib:=panel}
12838         : ${cf_menu_lib:=menu}
12839         : ${cf_form_lib:=form}
12840
12841 as_ac_Lib=`echo "ac_cv_lib_$cf_panel_lib$cf_cv_libtype''_new_panel" | $as_tr_sh`
12842 echo "$as_me:12842: checking for new_panel in -l$cf_panel_lib$cf_cv_libtype" >&5
12843 echo $ECHO_N "checking for new_panel in -l$cf_panel_lib$cf_cv_libtype... $ECHO_C" >&6
12844 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12845   echo $ECHO_N "(cached) $ECHO_C" >&6
12846 else
12847   ac_check_lib_save_LIBS=$LIBS
12848 LIBS="-l$cf_panel_lib$cf_cv_libtype  $LIBS"
12849 cat >conftest.$ac_ext <<_ACEOF
12850 #line 12850 "configure"
12851 #include "confdefs.h"
12852
12853 /* Override any gcc2 internal prototype to avoid an error.  */
12854 #ifdef __cplusplus
12855 extern "C"
12856 #endif
12857 /* We use char because int might match the return type of a gcc2
12858    builtin and then its argument prototype would still apply.  */
12859 char new_panel ();
12860 int
12861 main ()
12862 {
12863 new_panel ();
12864   ;
12865   return 0;
12866 }
12867 _ACEOF
12868 rm -f conftest.$ac_objext conftest$ac_exeext
12869 if { (eval echo "$as_me:12869: \"$ac_link\"") >&5
12870   (eval $ac_link) 2>&5
12871   ac_status=$?
12872   echo "$as_me:12872: \$? = $ac_status" >&5
12873   (exit $ac_status); } &&
12874          { ac_try='test -s conftest$ac_exeext'
12875   { (eval echo "$as_me:12875: \"$ac_try\"") >&5
12876   (eval $ac_try) 2>&5
12877   ac_status=$?
12878   echo "$as_me:12878: \$? = $ac_status" >&5
12879   (exit $ac_status); }; }; then
12880   eval "$as_ac_Lib=yes"
12881 else
12882   echo "$as_me: failed program was:" >&5
12883 cat conftest.$ac_ext >&5
12884 eval "$as_ac_Lib=no"
12885 fi
12886 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12887 LIBS=$ac_check_lib_save_LIBS
12888 fi
12889 echo "$as_me:12889: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12890 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12891 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12892   cat >>confdefs.h <<EOF
12893 #define `echo "HAVE_LIB$cf_panel_lib$cf_cv_libtype" | $as_tr_cpp` 1
12894 EOF
12895
12896   LIBS="-l$cf_panel_lib$cf_cv_libtype $LIBS"
12897
12898 fi
12899
12900 as_ac_Lib=`echo "ac_cv_lib_$cf_menu_lib$cf_cv_libtype''_menu_driver" | $as_tr_sh`
12901 echo "$as_me:12901: checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype" >&5
12902 echo $ECHO_N "checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype... $ECHO_C" >&6
12903 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12904   echo $ECHO_N "(cached) $ECHO_C" >&6
12905 else
12906   ac_check_lib_save_LIBS=$LIBS
12907 LIBS="-l$cf_menu_lib$cf_cv_libtype  $LIBS"
12908 cat >conftest.$ac_ext <<_ACEOF
12909 #line 12909 "configure"
12910 #include "confdefs.h"
12911
12912 /* Override any gcc2 internal prototype to avoid an error.  */
12913 #ifdef __cplusplus
12914 extern "C"
12915 #endif
12916 /* We use char because int might match the return type of a gcc2
12917    builtin and then its argument prototype would still apply.  */
12918 char menu_driver ();
12919 int
12920 main ()
12921 {
12922 menu_driver ();
12923   ;
12924   return 0;
12925 }
12926 _ACEOF
12927 rm -f conftest.$ac_objext conftest$ac_exeext
12928 if { (eval echo "$as_me:12928: \"$ac_link\"") >&5
12929   (eval $ac_link) 2>&5
12930   ac_status=$?
12931   echo "$as_me:12931: \$? = $ac_status" >&5
12932   (exit $ac_status); } &&
12933          { ac_try='test -s conftest$ac_exeext'
12934   { (eval echo "$as_me:12934: \"$ac_try\"") >&5
12935   (eval $ac_try) 2>&5
12936   ac_status=$?
12937   echo "$as_me:12937: \$? = $ac_status" >&5
12938   (exit $ac_status); }; }; then
12939   eval "$as_ac_Lib=yes"
12940 else
12941   echo "$as_me: failed program was:" >&5
12942 cat conftest.$ac_ext >&5
12943 eval "$as_ac_Lib=no"
12944 fi
12945 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12946 LIBS=$ac_check_lib_save_LIBS
12947 fi
12948 echo "$as_me:12948: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12949 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12950 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12951   cat >>confdefs.h <<EOF
12952 #define `echo "HAVE_LIB$cf_menu_lib$cf_cv_libtype" | $as_tr_cpp` 1
12953 EOF
12954
12955   LIBS="-l$cf_menu_lib$cf_cv_libtype $LIBS"
12956
12957 fi
12958
12959 as_ac_Lib=`echo "ac_cv_lib_$cf_form_lib$cf_cv_libtype''_form_driver" | $as_tr_sh`
12960 echo "$as_me:12960: checking for form_driver in -l$cf_form_lib$cf_cv_libtype" >&5
12961 echo $ECHO_N "checking for form_driver in -l$cf_form_lib$cf_cv_libtype... $ECHO_C" >&6
12962 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12963   echo $ECHO_N "(cached) $ECHO_C" >&6
12964 else
12965   ac_check_lib_save_LIBS=$LIBS
12966 LIBS="-l$cf_form_lib$cf_cv_libtype  $LIBS"
12967 cat >conftest.$ac_ext <<_ACEOF
12968 #line 12968 "configure"
12969 #include "confdefs.h"
12970
12971 /* Override any gcc2 internal prototype to avoid an error.  */
12972 #ifdef __cplusplus
12973 extern "C"
12974 #endif
12975 /* We use char because int might match the return type of a gcc2
12976    builtin and then its argument prototype would still apply.  */
12977 char form_driver ();
12978 int
12979 main ()
12980 {
12981 form_driver ();
12982   ;
12983   return 0;
12984 }
12985 _ACEOF
12986 rm -f conftest.$ac_objext conftest$ac_exeext
12987 if { (eval echo "$as_me:12987: \"$ac_link\"") >&5
12988   (eval $ac_link) 2>&5
12989   ac_status=$?
12990   echo "$as_me:12990: \$? = $ac_status" >&5
12991   (exit $ac_status); } &&
12992          { ac_try='test -s conftest$ac_exeext'
12993   { (eval echo "$as_me:12993: \"$ac_try\"") >&5
12994   (eval $ac_try) 2>&5
12995   ac_status=$?
12996   echo "$as_me:12996: \$? = $ac_status" >&5
12997   (exit $ac_status); }; }; then
12998   eval "$as_ac_Lib=yes"
12999 else
13000   echo "$as_me: failed program was:" >&5
13001 cat conftest.$ac_ext >&5
13002 eval "$as_ac_Lib=no"
13003 fi
13004 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13005 LIBS=$ac_check_lib_save_LIBS
13006 fi
13007 echo "$as_me:13007: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13008 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13009 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13010   cat >>confdefs.h <<EOF
13011 #define `echo "HAVE_LIB$cf_form_lib$cf_cv_libtype" | $as_tr_cpp` 1
13012 EOF
13013
13014   LIBS="-l$cf_form_lib$cf_cv_libtype $LIBS"
13015
13016 fi
13017
13018         # look for curses-related headers
13019
13020 for ac_header in \
13021                 nc_alloc.h \
13022                 nomacros.h \
13023                 form.h \
13024                 menu.h \
13025                 panel.h \
13026                 term_entry.h \
13027
13028 do
13029 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13030 echo "$as_me:13030: checking for $ac_header" >&5
13031 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13032 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13033   echo $ECHO_N "(cached) $ECHO_C" >&6
13034 else
13035   cat >conftest.$ac_ext <<_ACEOF
13036 #line 13036 "configure"
13037 #include "confdefs.h"
13038 #include <$ac_header>
13039 _ACEOF
13040 if { (eval echo "$as_me:13040: \"$ac_cpp conftest.$ac_ext\"") >&5
13041   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13042   ac_status=$?
13043   egrep -v '^ *\+' conftest.er1 >conftest.err
13044   rm -f conftest.er1
13045   cat conftest.err >&5
13046   echo "$as_me:13046: \$? = $ac_status" >&5
13047   (exit $ac_status); } >/dev/null; then
13048   if test -s conftest.err; then
13049     ac_cpp_err=$ac_c_preproc_warn_flag
13050   else
13051     ac_cpp_err=
13052   fi
13053 else
13054   ac_cpp_err=yes
13055 fi
13056 if test -z "$ac_cpp_err"; then
13057   eval "$as_ac_Header=yes"
13058 else
13059   echo "$as_me: failed program was:" >&5
13060   cat conftest.$ac_ext >&5
13061   eval "$as_ac_Header=no"
13062 fi
13063 rm -f conftest.err conftest.$ac_ext
13064 fi
13065 echo "$as_me:13065: result: `eval echo '${'$as_ac_Header'}'`" >&5
13066 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13067 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13068   cat >>confdefs.h <<EOF
13069 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13070 EOF
13071
13072 fi
13073 done
13074
13075         ;;
13076 esac
13077
13078 echo "$as_me:13078: checking for ANSI C header files" >&5
13079 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13080 if test "${ac_cv_header_stdc+set}" = set; then
13081   echo $ECHO_N "(cached) $ECHO_C" >&6
13082 else
13083   cat >conftest.$ac_ext <<_ACEOF
13084 #line 13084 "configure"
13085 #include "confdefs.h"
13086 #include <stdlib.h>
13087 #include <stdarg.h>
13088 #include <string.h>
13089 #include <float.h>
13090
13091 _ACEOF
13092 if { (eval echo "$as_me:13092: \"$ac_cpp conftest.$ac_ext\"") >&5
13093   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13094   ac_status=$?
13095   egrep -v '^ *\+' conftest.er1 >conftest.err
13096   rm -f conftest.er1
13097   cat conftest.err >&5
13098   echo "$as_me:13098: \$? = $ac_status" >&5
13099   (exit $ac_status); } >/dev/null; then
13100   if test -s conftest.err; then
13101     ac_cpp_err=$ac_c_preproc_warn_flag
13102   else
13103     ac_cpp_err=
13104   fi
13105 else
13106   ac_cpp_err=yes
13107 fi
13108 if test -z "$ac_cpp_err"; then
13109   ac_cv_header_stdc=yes
13110 else
13111   echo "$as_me: failed program was:" >&5
13112   cat conftest.$ac_ext >&5
13113   ac_cv_header_stdc=no
13114 fi
13115 rm -f conftest.err conftest.$ac_ext
13116
13117 if test $ac_cv_header_stdc = yes; then
13118   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13119   cat >conftest.$ac_ext <<_ACEOF
13120 #line 13120 "configure"
13121 #include "confdefs.h"
13122 #include <string.h>
13123
13124 _ACEOF
13125 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13126   egrep "memchr" >/dev/null 2>&1; then
13127   :
13128 else
13129   ac_cv_header_stdc=no
13130 fi
13131 rm -rf conftest*
13132
13133 fi
13134
13135 if test $ac_cv_header_stdc = yes; then
13136   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13137   cat >conftest.$ac_ext <<_ACEOF
13138 #line 13138 "configure"
13139 #include "confdefs.h"
13140 #include <stdlib.h>
13141
13142 _ACEOF
13143 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13144   egrep "free" >/dev/null 2>&1; then
13145   :
13146 else
13147   ac_cv_header_stdc=no
13148 fi
13149 rm -rf conftest*
13150
13151 fi
13152
13153 if test $ac_cv_header_stdc = yes; then
13154   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13155   if test "$cross_compiling" = yes; then
13156   :
13157 else
13158   cat >conftest.$ac_ext <<_ACEOF
13159 #line 13159 "configure"
13160 #include "confdefs.h"
13161 #include <ctype.h>
13162 #if ((' ' & 0x0FF) == 0x020)
13163 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13164 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13165 #else
13166 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13167                      || ('j' <= (c) && (c) <= 'r') \
13168                      || ('s' <= (c) && (c) <= 'z'))
13169 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13170 #endif
13171
13172 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13173 int
13174 main ()
13175 {
13176   int i;
13177   for (i = 0; i < 256; i++)
13178     if (XOR (islower (i), ISLOWER (i))
13179         || toupper (i) != TOUPPER (i))
13180       $ac_main_return(2);
13181   $ac_main_return (0);
13182 }
13183 _ACEOF
13184 rm -f conftest$ac_exeext
13185 if { (eval echo "$as_me:13185: \"$ac_link\"") >&5
13186   (eval $ac_link) 2>&5
13187   ac_status=$?
13188   echo "$as_me:13188: \$? = $ac_status" >&5
13189   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13190   { (eval echo "$as_me:13190: \"$ac_try\"") >&5
13191   (eval $ac_try) 2>&5
13192   ac_status=$?
13193   echo "$as_me:13193: \$? = $ac_status" >&5
13194   (exit $ac_status); }; }; then
13195   :
13196 else
13197   echo "$as_me: program exited with status $ac_status" >&5
13198 echo "$as_me: failed program was:" >&5
13199 cat conftest.$ac_ext >&5
13200 ac_cv_header_stdc=no
13201 fi
13202 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13203 fi
13204 fi
13205 fi
13206 echo "$as_me:13206: result: $ac_cv_header_stdc" >&5
13207 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13208 if test $ac_cv_header_stdc = yes; then
13209
13210 cat >>confdefs.h <<\EOF
13211 #define STDC_HEADERS 1
13212 EOF
13213
13214 fi
13215
13216 echo "$as_me:13216: checking whether time.h and sys/time.h may both be included" >&5
13217 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13218 if test "${ac_cv_header_time+set}" = set; then
13219   echo $ECHO_N "(cached) $ECHO_C" >&6
13220 else
13221   cat >conftest.$ac_ext <<_ACEOF
13222 #line 13222 "configure"
13223 #include "confdefs.h"
13224 #include <sys/types.h>
13225 #include <sys/time.h>
13226 #include <time.h>
13227
13228 int
13229 main ()
13230 {
13231 if ((struct tm *) 0)
13232 return 0;
13233   ;
13234   return 0;
13235 }
13236 _ACEOF
13237 rm -f conftest.$ac_objext
13238 if { (eval echo "$as_me:13238: \"$ac_compile\"") >&5
13239   (eval $ac_compile) 2>&5
13240   ac_status=$?
13241   echo "$as_me:13241: \$? = $ac_status" >&5
13242   (exit $ac_status); } &&
13243          { ac_try='test -s conftest.$ac_objext'
13244   { (eval echo "$as_me:13244: \"$ac_try\"") >&5
13245   (eval $ac_try) 2>&5
13246   ac_status=$?
13247   echo "$as_me:13247: \$? = $ac_status" >&5
13248   (exit $ac_status); }; }; then
13249   ac_cv_header_time=yes
13250 else
13251   echo "$as_me: failed program was:" >&5
13252 cat conftest.$ac_ext >&5
13253 ac_cv_header_time=no
13254 fi
13255 rm -f conftest.$ac_objext conftest.$ac_ext
13256 fi
13257 echo "$as_me:13257: result: $ac_cv_header_time" >&5
13258 echo "${ECHO_T}$ac_cv_header_time" >&6
13259 if test $ac_cv_header_time = yes; then
13260
13261 cat >>confdefs.h <<\EOF
13262 #define TIME_WITH_SYS_TIME 1
13263 EOF
13264
13265 fi
13266
13267 for ac_header in \
13268 getopt.h \
13269 locale.h \
13270 math.h \
13271 stdarg.h \
13272 sys/ioctl.h \
13273 sys/select.h \
13274 sys/time.h \
13275 termios.h \
13276 unistd.h \
13277
13278 do
13279 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13280 echo "$as_me:13280: checking for $ac_header" >&5
13281 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13282 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13283   echo $ECHO_N "(cached) $ECHO_C" >&6
13284 else
13285   cat >conftest.$ac_ext <<_ACEOF
13286 #line 13286 "configure"
13287 #include "confdefs.h"
13288 #include <$ac_header>
13289 _ACEOF
13290 if { (eval echo "$as_me:13290: \"$ac_cpp conftest.$ac_ext\"") >&5
13291   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13292   ac_status=$?
13293   egrep -v '^ *\+' conftest.er1 >conftest.err
13294   rm -f conftest.er1
13295   cat conftest.err >&5
13296   echo "$as_me:13296: \$? = $ac_status" >&5
13297   (exit $ac_status); } >/dev/null; then
13298   if test -s conftest.err; then
13299     ac_cpp_err=$ac_c_preproc_warn_flag
13300   else
13301     ac_cpp_err=
13302   fi
13303 else
13304   ac_cpp_err=yes
13305 fi
13306 if test -z "$ac_cpp_err"; then
13307   eval "$as_ac_Header=yes"
13308 else
13309   echo "$as_me: failed program was:" >&5
13310   cat conftest.$ac_ext >&5
13311   eval "$as_ac_Header=no"
13312 fi
13313 rm -f conftest.err conftest.$ac_ext
13314 fi
13315 echo "$as_me:13315: result: `eval echo '${'$as_ac_Header'}'`" >&5
13316 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13317 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13318   cat >>confdefs.h <<EOF
13319 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13320 EOF
13321
13322 fi
13323 done
13324
13325 for ac_header in unistd.h getopt.h
13326 do
13327 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13328 echo "$as_me:13328: checking for $ac_header" >&5
13329 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13330 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13331   echo $ECHO_N "(cached) $ECHO_C" >&6
13332 else
13333   cat >conftest.$ac_ext <<_ACEOF
13334 #line 13334 "configure"
13335 #include "confdefs.h"
13336 #include <$ac_header>
13337 _ACEOF
13338 if { (eval echo "$as_me:13338: \"$ac_cpp conftest.$ac_ext\"") >&5
13339   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13340   ac_status=$?
13341   egrep -v '^ *\+' conftest.er1 >conftest.err
13342   rm -f conftest.er1
13343   cat conftest.err >&5
13344   echo "$as_me:13344: \$? = $ac_status" >&5
13345   (exit $ac_status); } >/dev/null; then
13346   if test -s conftest.err; then
13347     ac_cpp_err=$ac_c_preproc_warn_flag
13348   else
13349     ac_cpp_err=
13350   fi
13351 else
13352   ac_cpp_err=yes
13353 fi
13354 if test -z "$ac_cpp_err"; then
13355   eval "$as_ac_Header=yes"
13356 else
13357   echo "$as_me: failed program was:" >&5
13358   cat conftest.$ac_ext >&5
13359   eval "$as_ac_Header=no"
13360 fi
13361 rm -f conftest.err conftest.$ac_ext
13362 fi
13363 echo "$as_me:13363: result: `eval echo '${'$as_ac_Header'}'`" >&5
13364 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13365 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13366   cat >>confdefs.h <<EOF
13367 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13368 EOF
13369
13370 fi
13371 done
13372
13373 echo "$as_me:13373: checking for header declaring getopt variables" >&5
13374 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13375 if test "${cf_cv_getopt_header+set}" = set; then
13376   echo $ECHO_N "(cached) $ECHO_C" >&6
13377 else
13378
13379 cf_cv_getopt_header=none
13380 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13381 do
13382 cat >conftest.$ac_ext <<_ACEOF
13383 #line 13383 "configure"
13384 #include "confdefs.h"
13385
13386 #include <$cf_header>
13387 int
13388 main ()
13389 {
13390 int x = optind; char *y = optarg
13391   ;
13392   return 0;
13393 }
13394 _ACEOF
13395 rm -f conftest.$ac_objext
13396 if { (eval echo "$as_me:13396: \"$ac_compile\"") >&5
13397   (eval $ac_compile) 2>&5
13398   ac_status=$?
13399   echo "$as_me:13399: \$? = $ac_status" >&5
13400   (exit $ac_status); } &&
13401          { ac_try='test -s conftest.$ac_objext'
13402   { (eval echo "$as_me:13402: \"$ac_try\"") >&5
13403   (eval $ac_try) 2>&5
13404   ac_status=$?
13405   echo "$as_me:13405: \$? = $ac_status" >&5
13406   (exit $ac_status); }; }; then
13407   cf_cv_getopt_header=$cf_header
13408  break
13409 else
13410   echo "$as_me: failed program was:" >&5
13411 cat conftest.$ac_ext >&5
13412 fi
13413 rm -f conftest.$ac_objext conftest.$ac_ext
13414 done
13415
13416 fi
13417 echo "$as_me:13417: result: $cf_cv_getopt_header" >&5
13418 echo "${ECHO_T}$cf_cv_getopt_header" >&6
13419 if test $cf_cv_getopt_header != none ; then
13420
13421 cat >>confdefs.h <<\EOF
13422 #define HAVE_GETOPT_HEADER 1
13423 EOF
13424
13425 fi
13426 if test $cf_cv_getopt_header = getopt.h ; then
13427
13428 cat >>confdefs.h <<\EOF
13429 #define NEED_GETOPT_H 1
13430 EOF
13431
13432 fi
13433
13434 for ac_func in \
13435 getopt \
13436 gettimeofday \
13437
13438 do
13439 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13440 echo "$as_me:13440: checking for $ac_func" >&5
13441 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13442 if eval "test \"\${$as_ac_var+set}\" = set"; then
13443   echo $ECHO_N "(cached) $ECHO_C" >&6
13444 else
13445   cat >conftest.$ac_ext <<_ACEOF
13446 #line 13446 "configure"
13447 #include "confdefs.h"
13448 /* System header to define __stub macros and hopefully few prototypes,
13449     which can conflict with char $ac_func (); below.  */
13450 #include <assert.h>
13451 /* Override any gcc2 internal prototype to avoid an error.  */
13452 #ifdef __cplusplus
13453 extern "C"
13454 #endif
13455 /* We use char because int might match the return type of a gcc2
13456    builtin and then its argument prototype would still apply.  */
13457 char $ac_func ();
13458 char (*f) ();
13459
13460 int
13461 main ()
13462 {
13463 /* The GNU C library defines this for functions which it implements
13464     to always fail with ENOSYS.  Some functions are actually named
13465     something starting with __ and the normal name is an alias.  */
13466 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13467 choke me
13468 #else
13469 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13470 #endif
13471
13472   ;
13473   return 0;
13474 }
13475 _ACEOF
13476 rm -f conftest.$ac_objext conftest$ac_exeext
13477 if { (eval echo "$as_me:13477: \"$ac_link\"") >&5
13478   (eval $ac_link) 2>&5
13479   ac_status=$?
13480   echo "$as_me:13480: \$? = $ac_status" >&5
13481   (exit $ac_status); } &&
13482          { ac_try='test -s conftest$ac_exeext'
13483   { (eval echo "$as_me:13483: \"$ac_try\"") >&5
13484   (eval $ac_try) 2>&5
13485   ac_status=$?
13486   echo "$as_me:13486: \$? = $ac_status" >&5
13487   (exit $ac_status); }; }; then
13488   eval "$as_ac_var=yes"
13489 else
13490   echo "$as_me: failed program was:" >&5
13491 cat conftest.$ac_ext >&5
13492 eval "$as_ac_var=no"
13493 fi
13494 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13495 fi
13496 echo "$as_me:13496: result: `eval echo '${'$as_ac_var'}'`" >&5
13497 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13498 if test `eval echo '${'$as_ac_var'}'` = yes; then
13499   cat >>confdefs.h <<EOF
13500 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13501 EOF
13502
13503 fi
13504 done
13505
13506 if test "x$ac_cv_func_getopt" = xno; then
13507         { { echo "$as_me:13507: error: getopt is required for building programs" >&5
13508 echo "$as_me: error: getopt is required for building programs" >&2;}
13509    { (exit 1); exit 1; }; }
13510 fi
13511
13512 if test "$cf_enable_widec" = yes; then
13513
13514 for ac_func in \
13515 mblen \
13516 mbrlen \
13517 mbrtowc \
13518 mbsrtowcs \
13519 mbstowcs \
13520 mbtowc \
13521 wcsrtombs \
13522 wcstombs \
13523
13524 do
13525 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13526 echo "$as_me:13526: checking for $ac_func" >&5
13527 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13528 if eval "test \"\${$as_ac_var+set}\" = set"; then
13529   echo $ECHO_N "(cached) $ECHO_C" >&6
13530 else
13531   cat >conftest.$ac_ext <<_ACEOF
13532 #line 13532 "configure"
13533 #include "confdefs.h"
13534 /* System header to define __stub macros and hopefully few prototypes,
13535     which can conflict with char $ac_func (); below.  */
13536 #include <assert.h>
13537 /* Override any gcc2 internal prototype to avoid an error.  */
13538 #ifdef __cplusplus
13539 extern "C"
13540 #endif
13541 /* We use char because int might match the return type of a gcc2
13542    builtin and then its argument prototype would still apply.  */
13543 char $ac_func ();
13544 char (*f) ();
13545
13546 int
13547 main ()
13548 {
13549 /* The GNU C library defines this for functions which it implements
13550     to always fail with ENOSYS.  Some functions are actually named
13551     something starting with __ and the normal name is an alias.  */
13552 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13553 choke me
13554 #else
13555 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13556 #endif
13557
13558   ;
13559   return 0;
13560 }
13561 _ACEOF
13562 rm -f conftest.$ac_objext conftest$ac_exeext
13563 if { (eval echo "$as_me:13563: \"$ac_link\"") >&5
13564   (eval $ac_link) 2>&5
13565   ac_status=$?
13566   echo "$as_me:13566: \$? = $ac_status" >&5
13567   (exit $ac_status); } &&
13568          { ac_try='test -s conftest$ac_exeext'
13569   { (eval echo "$as_me:13569: \"$ac_try\"") >&5
13570   (eval $ac_try) 2>&5
13571   ac_status=$?
13572   echo "$as_me:13572: \$? = $ac_status" >&5
13573   (exit $ac_status); }; }; then
13574   eval "$as_ac_var=yes"
13575 else
13576   echo "$as_me: failed program was:" >&5
13577 cat conftest.$ac_ext >&5
13578 eval "$as_ac_var=no"
13579 fi
13580 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13581 fi
13582 echo "$as_me:13582: result: `eval echo '${'$as_ac_var'}'`" >&5
13583 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13584 if test `eval echo '${'$as_ac_var'}'` = yes; then
13585   cat >>confdefs.h <<EOF
13586 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13587 EOF
13588
13589 fi
13590 done
13591
13592 fi
13593
13594 echo "$as_me:13594: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
13595 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
13596 if test "${cf_cv_need_xopen_extension+set}" = set; then
13597   echo $ECHO_N "(cached) $ECHO_C" >&6
13598 else
13599
13600 cat >conftest.$ac_ext <<_ACEOF
13601 #line 13601 "configure"
13602 #include "confdefs.h"
13603
13604 #include <stdlib.h>
13605 #include <${cf_cv_ncurses_header:-curses.h}>
13606 int
13607 main ()
13608 {
13609
13610 #if defined(NCURSES_VERSION_PATCH)
13611 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
13612         make an error
13613 #endif
13614 #endif
13615         long x = winnstr(stdscr, "", 0);
13616         int x1, y1;
13617         getbegyx(stdscr, y1, x1)
13618   ;
13619   return 0;
13620 }
13621 _ACEOF
13622 rm -f conftest.$ac_objext conftest$ac_exeext
13623 if { (eval echo "$as_me:13623: \"$ac_link\"") >&5
13624   (eval $ac_link) 2>&5
13625   ac_status=$?
13626   echo "$as_me:13626: \$? = $ac_status" >&5
13627   (exit $ac_status); } &&
13628          { ac_try='test -s conftest$ac_exeext'
13629   { (eval echo "$as_me:13629: \"$ac_try\"") >&5
13630   (eval $ac_try) 2>&5
13631   ac_status=$?
13632   echo "$as_me:13632: \$? = $ac_status" >&5
13633   (exit $ac_status); }; }; then
13634   cf_cv_need_xopen_extension=no
13635 else
13636   echo "$as_me: failed program was:" >&5
13637 cat conftest.$ac_ext >&5
13638 cat >conftest.$ac_ext <<_ACEOF
13639 #line 13639 "configure"
13640 #include "confdefs.h"
13641
13642 #define _XOPEN_SOURCE_EXTENDED
13643 #include <stdlib.h>
13644 #include <${cf_cv_ncurses_header:-curses.h}>
13645 int
13646 main ()
13647 {
13648
13649 #ifdef NCURSES_VERSION
13650         cchar_t check;
13651         int check2 = curs_set((int)sizeof(check));
13652 #endif
13653         long x = winnstr(stdscr, "", 0);
13654         int x1, y1;
13655         getbegyx(stdscr, y1, x1)
13656   ;
13657   return 0;
13658 }
13659 _ACEOF
13660 rm -f conftest.$ac_objext conftest$ac_exeext
13661 if { (eval echo "$as_me:13661: \"$ac_link\"") >&5
13662   (eval $ac_link) 2>&5
13663   ac_status=$?
13664   echo "$as_me:13664: \$? = $ac_status" >&5
13665   (exit $ac_status); } &&
13666          { ac_try='test -s conftest$ac_exeext'
13667   { (eval echo "$as_me:13667: \"$ac_try\"") >&5
13668   (eval $ac_try) 2>&5
13669   ac_status=$?
13670   echo "$as_me:13670: \$? = $ac_status" >&5
13671   (exit $ac_status); }; }; then
13672   cf_cv_need_xopen_extension=yes
13673 else
13674   echo "$as_me: failed program was:" >&5
13675 cat conftest.$ac_ext >&5
13676 cf_cv_need_xopen_extension=unknown
13677 fi
13678 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13679 fi
13680 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13681 fi
13682 echo "$as_me:13682: result: $cf_cv_need_xopen_extension" >&5
13683 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
13684 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
13685
13686 echo "$as_me:13686: checking for term.h" >&5
13687 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
13688 if test "${cf_cv_term_header+set}" = set; then
13689   echo $ECHO_N "(cached) $ECHO_C" >&6
13690 else
13691
13692 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
13693 # for <term.h> if we do not find the variant.
13694
13695 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
13696
13697 case ${cf_cv_ncurses_header:-curses.h} in #(vi
13698 */*)
13699         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
13700         cf_header_list="$cf_header_item $cf_header_list"
13701         ;;
13702 esac
13703
13704 for cf_header in $cf_header_list
13705 do
13706         cat >conftest.$ac_ext <<_ACEOF
13707 #line 13707 "configure"
13708 #include "confdefs.h"
13709
13710 #include <${cf_cv_ncurses_header:-curses.h}>
13711 #include <${cf_header}>
13712 int
13713 main ()
13714 {
13715 WINDOW *x
13716   ;
13717   return 0;
13718 }
13719 _ACEOF
13720 rm -f conftest.$ac_objext
13721 if { (eval echo "$as_me:13721: \"$ac_compile\"") >&5
13722   (eval $ac_compile) 2>&5
13723   ac_status=$?
13724   echo "$as_me:13724: \$? = $ac_status" >&5
13725   (exit $ac_status); } &&
13726          { ac_try='test -s conftest.$ac_objext'
13727   { (eval echo "$as_me:13727: \"$ac_try\"") >&5
13728   (eval $ac_try) 2>&5
13729   ac_status=$?
13730   echo "$as_me:13730: \$? = $ac_status" >&5
13731   (exit $ac_status); }; }; then
13732   cf_cv_term_header=$cf_header
13733          break
13734 else
13735   echo "$as_me: failed program was:" >&5
13736 cat conftest.$ac_ext >&5
13737 cf_cv_term_header=no
13738 fi
13739 rm -f conftest.$ac_objext conftest.$ac_ext
13740 done
13741
13742 case $cf_cv_term_header in #(vi
13743 no)
13744         # If curses is ncurses, some packagers still mess it up by trying to make
13745         # us use GNU termcap.  This handles the most common case.
13746         for cf_header in ncurses/term.h ncursesw/term.h
13747         do
13748                 cat >conftest.$ac_ext <<_ACEOF
13749 #line 13749 "configure"
13750 #include "confdefs.h"
13751
13752 #include <${cf_cv_ncurses_header:-curses.h}>
13753 #ifdef NCURSES_VERSION
13754 #include <${cf_header}>
13755 #else
13756 make an error
13757 #endif
13758 int
13759 main ()
13760 {
13761 WINDOW *x
13762   ;
13763   return 0;
13764 }
13765 _ACEOF
13766 rm -f conftest.$ac_objext
13767 if { (eval echo "$as_me:13767: \"$ac_compile\"") >&5
13768   (eval $ac_compile) 2>&5
13769   ac_status=$?
13770   echo "$as_me:13770: \$? = $ac_status" >&5
13771   (exit $ac_status); } &&
13772          { ac_try='test -s conftest.$ac_objext'
13773   { (eval echo "$as_me:13773: \"$ac_try\"") >&5
13774   (eval $ac_try) 2>&5
13775   ac_status=$?
13776   echo "$as_me:13776: \$? = $ac_status" >&5
13777   (exit $ac_status); }; }; then
13778   cf_cv_term_header=$cf_header
13779                          break
13780 else
13781   echo "$as_me: failed program was:" >&5
13782 cat conftest.$ac_ext >&5
13783 cf_cv_term_header=no
13784 fi
13785 rm -f conftest.$ac_objext conftest.$ac_ext
13786         done
13787         ;;
13788 esac
13789
13790 fi
13791 echo "$as_me:13791: result: $cf_cv_term_header" >&5
13792 echo "${ECHO_T}$cf_cv_term_header" >&6
13793
13794 case $cf_cv_term_header in #(vi
13795 term.h) #(vi
13796
13797 cat >>confdefs.h <<\EOF
13798 #define HAVE_TERM_H 1
13799 EOF
13800
13801         ;;
13802 ncurses/term.h) #(vi
13803
13804 cat >>confdefs.h <<\EOF
13805 #define HAVE_NCURSES_TERM_H 1
13806 EOF
13807
13808         ;;
13809 ncursesw/term.h)
13810
13811 cat >>confdefs.h <<\EOF
13812 #define HAVE_NCURSESW_TERM_H 1
13813 EOF
13814
13815         ;;
13816 esac
13817
13818 echo "$as_me:13818: checking for unctrl.h" >&5
13819 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
13820 if test "${cf_cv_unctrl_header+set}" = set; then
13821   echo $ECHO_N "(cached) $ECHO_C" >&6
13822 else
13823
13824 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
13825 # for <unctrl.h> if we do not find the variant.
13826
13827 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
13828
13829 case ${cf_cv_ncurses_header:-curses.h} in #(vi
13830 */*)
13831         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
13832         cf_header_list="$cf_header_item $cf_header_list"
13833         ;;
13834 esac
13835
13836 for cf_header in $cf_header_list
13837 do
13838         cat >conftest.$ac_ext <<_ACEOF
13839 #line 13839 "configure"
13840 #include "confdefs.h"
13841
13842 #include <${cf_cv_ncurses_header:-curses.h}>
13843 #include <${cf_header}>
13844 int
13845 main ()
13846 {
13847 WINDOW *x
13848   ;
13849   return 0;
13850 }
13851 _ACEOF
13852 rm -f conftest.$ac_objext
13853 if { (eval echo "$as_me:13853: \"$ac_compile\"") >&5
13854   (eval $ac_compile) 2>&5
13855   ac_status=$?
13856   echo "$as_me:13856: \$? = $ac_status" >&5
13857   (exit $ac_status); } &&
13858          { ac_try='test -s conftest.$ac_objext'
13859   { (eval echo "$as_me:13859: \"$ac_try\"") >&5
13860   (eval $ac_try) 2>&5
13861   ac_status=$?
13862   echo "$as_me:13862: \$? = $ac_status" >&5
13863   (exit $ac_status); }; }; then
13864   cf_cv_unctrl_header=$cf_header
13865          break
13866 else
13867   echo "$as_me: failed program was:" >&5
13868 cat conftest.$ac_ext >&5
13869 cf_cv_unctrl_header=no
13870 fi
13871 rm -f conftest.$ac_objext conftest.$ac_ext
13872 done
13873
13874 fi
13875 echo "$as_me:13875: result: $cf_cv_unctrl_header" >&5
13876 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
13877
13878 case $cf_cv_unctrl_header in #(vi
13879 no)
13880         { echo "$as_me:13880: WARNING: unctrl.h header not found" >&5
13881 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
13882         ;;
13883 esac
13884
13885 case $cf_cv_unctrl_header in #(vi
13886 unctrl.h) #(vi
13887
13888 cat >>confdefs.h <<\EOF
13889 #define HAVE_UNCTRL_H 1
13890 EOF
13891
13892         ;;
13893 ncurses/unctrl.h) #(vi
13894
13895 cat >>confdefs.h <<\EOF
13896 #define HAVE_NCURSES_UNCTRL_H 1
13897 EOF
13898
13899         ;;
13900 ncursesw/unctrl.h)
13901
13902 cat >>confdefs.h <<\EOF
13903 #define HAVE_NCURSESW_UNCTRL_H 1
13904 EOF
13905
13906         ;;
13907 esac
13908
13909 for cf_func in \
13910 assume_default_colors \
13911 chgat \
13912 color_set \
13913 filter \
13914 getbegx \
13915 getcurx \
13916 getmaxx \
13917 getnstr \
13918 getparx \
13919 getwin \
13920 mvvline \
13921 mvwvline \
13922 napms \
13923 putwin \
13924 resize_term \
13925 resizeterm \
13926 ripoffline \
13927 scr_dump \
13928 setupterm \
13929 slk_color \
13930 slk_init \
13931 termattrs \
13932 tgetent \
13933 tigetnum \
13934 tigetstr \
13935 typeahead \
13936 use_default_colors \
13937 use_env \
13938 use_extended_names \
13939 use_screen \
13940 use_window \
13941 vid_puts \
13942 vidputs \
13943 vsscanf \
13944 vw_printw \
13945 wchgat \
13946 winsstr \
13947 wresize \
13948 wsyncdown \
13949
13950 do
13951
13952 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13953
13954         echo "$as_me:13954: checking for ${cf_func}" >&5
13955 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
13956
13957 echo "${as_me:-configure}:13957: testing ${cf_func} ..." 1>&5
13958
13959         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
13960   echo $ECHO_N "(cached) $ECHO_C" >&6
13961 else
13962
13963                 eval cf_result='$ac_cv_func_'$cf_func
13964                 if test ".$cf_result" != ".no"; then
13965                         cat >conftest.$ac_ext <<_ACEOF
13966 #line 13966 "configure"
13967 #include "confdefs.h"
13968
13969 #ifdef HAVE_XCURSES
13970 #include <xcurses.h>
13971 char * XCursesProgramName = "test";
13972 #else
13973 #include <${cf_cv_ncurses_header:-curses.h}>
13974 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13975 #include <ncursesw/term.h>
13976 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13977 #include <ncurses/term.h>
13978 #elif defined(HAVE_TERM_H)
13979 #include <term.h>
13980 #endif
13981 #endif
13982
13983 int
13984 main ()
13985 {
13986
13987 #ifndef ${cf_func}
13988 long foo = (long)(&${cf_func});
13989 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
13990 if (foo + 1234 > 5678)
13991         ${cf_cv_main_return:-return}(foo);
13992 #endif
13993
13994   ;
13995   return 0;
13996 }
13997 _ACEOF
13998 rm -f conftest.$ac_objext conftest$ac_exeext
13999 if { (eval echo "$as_me:13999: \"$ac_link\"") >&5
14000   (eval $ac_link) 2>&5
14001   ac_status=$?
14002   echo "$as_me:14002: \$? = $ac_status" >&5
14003   (exit $ac_status); } &&
14004          { ac_try='test -s conftest$ac_exeext'
14005   { (eval echo "$as_me:14005: \"$ac_try\"") >&5
14006   (eval $ac_try) 2>&5
14007   ac_status=$?
14008   echo "$as_me:14008: \$? = $ac_status" >&5
14009   (exit $ac_status); }; }; then
14010   cf_result=yes
14011 else
14012   echo "$as_me: failed program was:" >&5
14013 cat conftest.$ac_ext >&5
14014 cf_result=no
14015 fi
14016 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14017                 fi
14018                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14019
14020 fi
14021
14022         # use the computed/retrieved cache-value:
14023         eval 'cf_result=$cf_cv_func_'$cf_func
14024         echo "$as_me:14024: result: $cf_result" >&5
14025 echo "${ECHO_T}$cf_result" >&6
14026         if test $cf_result != no; then
14027                 cat >>confdefs.h <<EOF
14028 #define HAVE_${cf_tr_func} 1
14029 EOF
14030
14031         fi
14032 done
14033
14034 for cf_func in tputs
14035 do
14036
14037 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14038
14039         echo "$as_me:14039: checking for ${cf_func}" >&5
14040 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14041
14042 echo "${as_me:-configure}:14042: testing ${cf_func} ..." 1>&5
14043
14044         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14045   echo $ECHO_N "(cached) $ECHO_C" >&6
14046 else
14047
14048                 eval cf_result='$ac_cv_func_'$cf_func
14049                 if test ".$cf_result" != ".no"; then
14050                         cat >conftest.$ac_ext <<_ACEOF
14051 #line 14051 "configure"
14052 #include "confdefs.h"
14053
14054 #ifdef HAVE_XCURSES
14055 #include <xcurses.h>
14056 char * XCursesProgramName = "test";
14057 #else
14058 #include <${cf_cv_ncurses_header:-curses.h}>
14059 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14060 #include <ncursesw/term.h>
14061 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14062 #include <ncurses/term.h>
14063 #elif defined(HAVE_TERM_H)
14064 #include <term.h>
14065 #endif
14066 #endif
14067
14068 int
14069 main ()
14070 {
14071
14072 #ifndef ${cf_func}
14073 long foo = (long)(&${cf_func});
14074 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14075 if (foo + 1234 > 5678)
14076         ${cf_cv_main_return:-return}(foo);
14077 #endif
14078
14079   ;
14080   return 0;
14081 }
14082 _ACEOF
14083 rm -f conftest.$ac_objext conftest$ac_exeext
14084 if { (eval echo "$as_me:14084: \"$ac_link\"") >&5
14085   (eval $ac_link) 2>&5
14086   ac_status=$?
14087   echo "$as_me:14087: \$? = $ac_status" >&5
14088   (exit $ac_status); } &&
14089          { ac_try='test -s conftest$ac_exeext'
14090   { (eval echo "$as_me:14090: \"$ac_try\"") >&5
14091   (eval $ac_try) 2>&5
14092   ac_status=$?
14093   echo "$as_me:14093: \$? = $ac_status" >&5
14094   (exit $ac_status); }; }; then
14095   cf_result=yes
14096 else
14097   echo "$as_me: failed program was:" >&5
14098 cat conftest.$ac_ext >&5
14099 cf_result=no
14100 fi
14101 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14102                 fi
14103                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14104
14105 fi
14106
14107         # use the computed/retrieved cache-value:
14108         eval 'cf_result=$cf_cv_func_'$cf_func
14109         echo "$as_me:14109: result: $cf_result" >&5
14110 echo "${ECHO_T}$cf_result" >&6
14111         if test $cf_result != no; then
14112                 cat >>confdefs.h <<EOF
14113 #define HAVE_${cf_tr_func} 1
14114 EOF
14115
14116         fi
14117 done
14118
14119 if test x$cf_cv_func_tputs = xyes
14120 then
14121         cf_done=no
14122         for cf_arg in int char
14123         do
14124                 for cf_ret in int void
14125                 do
14126                         if test $cf_ret = void
14127                         then
14128                                 cf_return="/* nothing */"
14129                         else
14130                                 cf_return="return value"
14131                         fi
14132                         cat >conftest.$ac_ext <<_ACEOF
14133 #line 14133 "configure"
14134 #include "confdefs.h"
14135
14136 #include <${cf_cv_ncurses_header:-curses.h}>
14137 #include <$cf_cv_term_header>
14138
14139 static $cf_ret outc($cf_arg value) { $cf_return; }
14140
14141 int
14142 main ()
14143 {
14144
14145         tputs("hello", 0, outc);
14146         ${cf_cv_main_return:-return}(0);
14147
14148   ;
14149   return 0;
14150 }
14151 _ACEOF
14152 rm -f conftest.$ac_objext
14153 if { (eval echo "$as_me:14153: \"$ac_compile\"") >&5
14154   (eval $ac_compile) 2>&5
14155   ac_status=$?
14156   echo "$as_me:14156: \$? = $ac_status" >&5
14157   (exit $ac_status); } &&
14158          { ac_try='test -s conftest.$ac_objext'
14159   { (eval echo "$as_me:14159: \"$ac_try\"") >&5
14160   (eval $ac_try) 2>&5
14161   ac_status=$?
14162   echo "$as_me:14162: \$? = $ac_status" >&5
14163   (exit $ac_status); }; }; then
14164
14165                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14166
14167 echo "${as_me:-configure}:14167: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14168
14169                 cat >>confdefs.h <<EOF
14170 #define TPUTS_ARG               $cf_arg
14171 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14172 #define TPUTS_RETURN(value)     $cf_return
14173 EOF
14174                 cf_done=yes
14175                 break
14176
14177 else
14178   echo "$as_me: failed program was:" >&5
14179 cat conftest.$ac_ext >&5
14180 fi
14181 rm -f conftest.$ac_objext conftest.$ac_ext
14182                 done
14183                 test $cf_done = yes && break
14184         done
14185 fi
14186
14187 echo "$as_me:14187: checking for ncurses extended functions" >&5
14188 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14189 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14190   echo $ECHO_N "(cached) $ECHO_C" >&6
14191 else
14192
14193 cat >conftest.$ac_ext <<_ACEOF
14194 #line 14194 "configure"
14195 #include "confdefs.h"
14196
14197 #include <${cf_cv_ncurses_header:-curses.h}>
14198 int
14199 main ()
14200 {
14201
14202 int x = NCURSES_EXT_FUNCS
14203
14204   ;
14205   return 0;
14206 }
14207 _ACEOF
14208 rm -f conftest.$ac_objext
14209 if { (eval echo "$as_me:14209: \"$ac_compile\"") >&5
14210   (eval $ac_compile) 2>&5
14211   ac_status=$?
14212   echo "$as_me:14212: \$? = $ac_status" >&5
14213   (exit $ac_status); } &&
14214          { ac_try='test -s conftest.$ac_objext'
14215   { (eval echo "$as_me:14215: \"$ac_try\"") >&5
14216   (eval $ac_try) 2>&5
14217   ac_status=$?
14218   echo "$as_me:14218: \$? = $ac_status" >&5
14219   (exit $ac_status); }; }; then
14220   cf_cv_ncurses_ext_funcs=defined
14221 else
14222   echo "$as_me: failed program was:" >&5
14223 cat conftest.$ac_ext >&5
14224
14225 cat >conftest.$ac_ext <<_ACEOF
14226 #line 14226 "configure"
14227 #include "confdefs.h"
14228
14229 #include <${cf_cv_ncurses_header:-curses.h}>
14230 int
14231 main ()
14232 {
14233
14234         (void) assume_default_colors (0, 0);
14235         (void) curses_version ();
14236         (void) define_key (0, 0);
14237         (void) is_term_resized (0, 0);
14238         (void) key_defined (0);
14239         (void) keybound (0, 0);
14240         (void) keyok (0, 0);
14241         (void) resize_term (0, 0);
14242         (void) resizeterm (0, 0);
14243         (void) use_default_colors ();
14244         (void) use_extended_names (0);
14245         (void) wresize (0, 0, 0);
14246   ;
14247   return 0;
14248 }
14249 _ACEOF
14250 rm -f conftest.$ac_objext conftest$ac_exeext
14251 if { (eval echo "$as_me:14251: \"$ac_link\"") >&5
14252   (eval $ac_link) 2>&5
14253   ac_status=$?
14254   echo "$as_me:14254: \$? = $ac_status" >&5
14255   (exit $ac_status); } &&
14256          { ac_try='test -s conftest$ac_exeext'
14257   { (eval echo "$as_me:14257: \"$ac_try\"") >&5
14258   (eval $ac_try) 2>&5
14259   ac_status=$?
14260   echo "$as_me:14260: \$? = $ac_status" >&5
14261   (exit $ac_status); }; }; then
14262   cf_cv_ncurses_ext_funcs=yes
14263 else
14264   echo "$as_me: failed program was:" >&5
14265 cat conftest.$ac_ext >&5
14266 cf_cv_ncurses_ext_funcs=no
14267 fi
14268 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14269
14270 fi
14271 rm -f conftest.$ac_objext conftest.$ac_ext
14272
14273 fi
14274 echo "$as_me:14274: result: $cf_cv_ncurses_ext_funcs" >&5
14275 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14276 test "$cf_cv_ncurses_ext_funcs" = yes &&
14277 cat >>confdefs.h <<\EOF
14278 #define NCURSES_EXT_FUNCS 1
14279 EOF
14280
14281 if test "$cf_enable_widec" = yes
14282 then
14283         # workaround for systems with ncurses before 20111029, due to change of
14284         # feature test macro from _XPG5 to _XOPEN_SOURCE
14285         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14286         then
14287                 cf_define_xpg5=no
14288                 echo "$as_me:14288: checking if _XPG5 should be defined to enable wide-characters" >&5
14289 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14290
14291                 cat >conftest.$ac_ext <<_ACEOF
14292 #line 14292 "configure"
14293 #include "confdefs.h"
14294
14295 #include <${cf_cv_ncurses_header:-curses.h}>
14296 int
14297 main ()
14298 {
14299 int x = _XPG5
14300   ;
14301   return 0;
14302 }
14303 _ACEOF
14304 rm -f conftest.$ac_objext
14305 if { (eval echo "$as_me:14305: \"$ac_compile\"") >&5
14306   (eval $ac_compile) 2>&5
14307   ac_status=$?
14308   echo "$as_me:14308: \$? = $ac_status" >&5
14309   (exit $ac_status); } &&
14310          { ac_try='test -s conftest.$ac_objext'
14311   { (eval echo "$as_me:14311: \"$ac_try\"") >&5
14312   (eval $ac_try) 2>&5
14313   ac_status=$?
14314   echo "$as_me:14314: \$? = $ac_status" >&5
14315   (exit $ac_status); }; }; then
14316   :
14317 else
14318   echo "$as_me: failed program was:" >&5
14319 cat conftest.$ac_ext >&5
14320 cf_save_cppflags="$CPPFLAGS"
14321                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14322                          cat >conftest.$ac_ext <<_ACEOF
14323 #line 14323 "configure"
14324 #include "confdefs.h"
14325
14326 #include <${cf_cv_ncurses_header:-curses.h}>
14327 int
14328 main ()
14329 {
14330 int x = _XPG5
14331   ;
14332   return 0;
14333 }
14334 _ACEOF
14335 rm -f conftest.$ac_objext
14336 if { (eval echo "$as_me:14336: \"$ac_compile\"") >&5
14337   (eval $ac_compile) 2>&5
14338   ac_status=$?
14339   echo "$as_me:14339: \$? = $ac_status" >&5
14340   (exit $ac_status); } &&
14341          { ac_try='test -s conftest.$ac_objext'
14342   { (eval echo "$as_me:14342: \"$ac_try\"") >&5
14343   (eval $ac_try) 2>&5
14344   ac_status=$?
14345   echo "$as_me:14345: \$? = $ac_status" >&5
14346   (exit $ac_status); }; }; then
14347   cf_define_xpg5=yes
14348 else
14349   echo "$as_me: failed program was:" >&5
14350 cat conftest.$ac_ext >&5
14351 fi
14352 rm -f conftest.$ac_objext conftest.$ac_ext
14353                          CPPFLAGS="$cf_save_cppflags"
14354 fi
14355 rm -f conftest.$ac_objext conftest.$ac_ext
14356                 echo "$as_me:14356: result: $cf_define_xpg5" >&5
14357 echo "${ECHO_T}$cf_define_xpg5" >&6
14358
14359                 if test "$cf_define_xpg5" = yes
14360                 then
14361                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14362                 fi
14363         fi
14364
14365         echo "$as_me:14365: checking for wide-character functions" >&5
14366 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14367 if test "${cf_cv_widechar_funcs+set}" = set; then
14368   echo $ECHO_N "(cached) $ECHO_C" >&6
14369 else
14370
14371         cat >conftest.$ac_ext <<_ACEOF
14372 #line 14372 "configure"
14373 #include "confdefs.h"
14374
14375 #include <${cf_cv_ncurses_header:-curses.h}>
14376 int
14377 main ()
14378 {
14379
14380                 static wchar_t src_wchar[2];
14381                 static cchar_t dst_cchar;
14382                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
14383
14384   ;
14385   return 0;
14386 }
14387 _ACEOF
14388 rm -f conftest.$ac_objext conftest$ac_exeext
14389 if { (eval echo "$as_me:14389: \"$ac_link\"") >&5
14390   (eval $ac_link) 2>&5
14391   ac_status=$?
14392   echo "$as_me:14392: \$? = $ac_status" >&5
14393   (exit $ac_status); } &&
14394          { ac_try='test -s conftest$ac_exeext'
14395   { (eval echo "$as_me:14395: \"$ac_try\"") >&5
14396   (eval $ac_try) 2>&5
14397   ac_status=$?
14398   echo "$as_me:14398: \$? = $ac_status" >&5
14399   (exit $ac_status); }; }; then
14400   cf_cv_widechar_funcs=yes
14401 else
14402   echo "$as_me: failed program was:" >&5
14403 cat conftest.$ac_ext >&5
14404 cf_cv_widechar_funcs=no
14405 fi
14406 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14407
14408 fi
14409 echo "$as_me:14409: result: $cf_cv_widechar_funcs" >&5
14410 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
14411         if test "$cf_cv_widechar_funcs" != no ; then
14412
14413 cat >>confdefs.h <<\EOF
14414 #define USE_WIDEC_SUPPORT 1
14415 EOF
14416
14417         else
14418                 cat >>confdefs.h <<\EOF
14419 #define USE_WIDEC_SUPPORT 0
14420 EOF
14421
14422         fi
14423 else
14424         cat >>confdefs.h <<\EOF
14425 #define USE_WIDEC_SUPPORT 0
14426 EOF
14427
14428 fi
14429
14430 echo "$as_me:14430: checking if sys/time.h works with sys/select.h" >&5
14431 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
14432 if test "${cf_cv_sys_time_select+set}" = set; then
14433   echo $ECHO_N "(cached) $ECHO_C" >&6
14434 else
14435
14436 cat >conftest.$ac_ext <<_ACEOF
14437 #line 14437 "configure"
14438 #include "confdefs.h"
14439
14440 #include <sys/types.h>
14441 #ifdef HAVE_SYS_TIME_H
14442 #include <sys/time.h>
14443 #endif
14444 #ifdef HAVE_SYS_SELECT_H
14445 #include <sys/select.h>
14446 #endif
14447
14448 int
14449 main ()
14450 {
14451
14452   ;
14453   return 0;
14454 }
14455 _ACEOF
14456 rm -f conftest.$ac_objext
14457 if { (eval echo "$as_me:14457: \"$ac_compile\"") >&5
14458   (eval $ac_compile) 2>&5
14459   ac_status=$?
14460   echo "$as_me:14460: \$? = $ac_status" >&5
14461   (exit $ac_status); } &&
14462          { ac_try='test -s conftest.$ac_objext'
14463   { (eval echo "$as_me:14463: \"$ac_try\"") >&5
14464   (eval $ac_try) 2>&5
14465   ac_status=$?
14466   echo "$as_me:14466: \$? = $ac_status" >&5
14467   (exit $ac_status); }; }; then
14468   cf_cv_sys_time_select=yes
14469 else
14470   echo "$as_me: failed program was:" >&5
14471 cat conftest.$ac_ext >&5
14472 cf_cv_sys_time_select=no
14473 fi
14474 rm -f conftest.$ac_objext conftest.$ac_ext
14475
14476 fi
14477
14478 echo "$as_me:14478: result: $cf_cv_sys_time_select" >&5
14479 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
14480 test "$cf_cv_sys_time_select" = yes &&
14481 cat >>confdefs.h <<\EOF
14482 #define HAVE_SYS_TIME_SELECT 1
14483 EOF
14484
14485 echo "$as_me:14485: checking for function curses_version" >&5
14486 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
14487 if test "${cf_cv_func_curses_version+set}" = set; then
14488   echo $ECHO_N "(cached) $ECHO_C" >&6
14489 else
14490
14491 if test "$cross_compiling" = yes; then
14492   cf_cv_func_curses_version=unknown
14493 else
14494   cat >conftest.$ac_ext <<_ACEOF
14495 #line 14495 "configure"
14496 #include "confdefs.h"
14497
14498 #include <${cf_cv_ncurses_header:-curses.h}>
14499 int main()
14500 {
14501         char temp[1024];
14502         sprintf(temp, "%s\n", curses_version());
14503         ${cf_cv_main_return:-return}(0);
14504 }
14505
14506 _ACEOF
14507 rm -f conftest$ac_exeext
14508 if { (eval echo "$as_me:14508: \"$ac_link\"") >&5
14509   (eval $ac_link) 2>&5
14510   ac_status=$?
14511   echo "$as_me:14511: \$? = $ac_status" >&5
14512   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14513   { (eval echo "$as_me:14513: \"$ac_try\"") >&5
14514   (eval $ac_try) 2>&5
14515   ac_status=$?
14516   echo "$as_me:14516: \$? = $ac_status" >&5
14517   (exit $ac_status); }; }; then
14518   cf_cv_func_curses_version=yes
14519
14520 else
14521   echo "$as_me: program exited with status $ac_status" >&5
14522 echo "$as_me: failed program was:" >&5
14523 cat conftest.$ac_ext >&5
14524 cf_cv_func_curses_version=no
14525
14526 fi
14527 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14528 fi
14529 rm -f core
14530 fi
14531 echo "$as_me:14531: result: $cf_cv_func_curses_version" >&5
14532 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
14533 test "$cf_cv_func_curses_version" = yes &&
14534 cat >>confdefs.h <<\EOF
14535 #define HAVE_CURSES_VERSION 1
14536 EOF
14537
14538 echo "$as_me:14538: checking for alternate character set array" >&5
14539 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
14540 if test "${cf_cv_curses_acs_map+set}" = set; then
14541   echo $ECHO_N "(cached) $ECHO_C" >&6
14542 else
14543
14544 cf_cv_curses_acs_map=unknown
14545 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
14546 do
14547 cat >conftest.$ac_ext <<_ACEOF
14548 #line 14548 "configure"
14549 #include "confdefs.h"
14550
14551 #include <${cf_cv_ncurses_header:-curses.h}>
14552
14553 int
14554 main ()
14555 {
14556
14557 $name['k'] = ACS_PLUS
14558
14559   ;
14560   return 0;
14561 }
14562 _ACEOF
14563 rm -f conftest.$ac_objext conftest$ac_exeext
14564 if { (eval echo "$as_me:14564: \"$ac_link\"") >&5
14565   (eval $ac_link) 2>&5
14566   ac_status=$?
14567   echo "$as_me:14567: \$? = $ac_status" >&5
14568   (exit $ac_status); } &&
14569          { ac_try='test -s conftest$ac_exeext'
14570   { (eval echo "$as_me:14570: \"$ac_try\"") >&5
14571   (eval $ac_try) 2>&5
14572   ac_status=$?
14573   echo "$as_me:14573: \$? = $ac_status" >&5
14574   (exit $ac_status); }; }; then
14575   cf_cv_curses_acs_map=$name; break
14576 else
14577   echo "$as_me: failed program was:" >&5
14578 cat conftest.$ac_ext >&5
14579 fi
14580 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14581 done
14582
14583 fi
14584 echo "$as_me:14584: result: $cf_cv_curses_acs_map" >&5
14585 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
14586
14587 test "$cf_cv_curses_acs_map" != unknown &&
14588 cat >>confdefs.h <<EOF
14589 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
14590 EOF
14591
14592 if test "$cf_enable_widec" = yes; then
14593
14594 echo "$as_me:14594: checking for wide alternate character set array" >&5
14595 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
14596 if test "${cf_cv_curses_wacs_map+set}" = set; then
14597   echo $ECHO_N "(cached) $ECHO_C" >&6
14598 else
14599
14600         cf_cv_curses_wacs_map=unknown
14601         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
14602         do
14603         cat >conftest.$ac_ext <<_ACEOF
14604 #line 14604 "configure"
14605 #include "confdefs.h"
14606
14607 #ifndef _XOPEN_SOURCE_EXTENDED
14608 #define _XOPEN_SOURCE_EXTENDED
14609 #endif
14610 #include <${cf_cv_ncurses_header:-curses.h}>
14611 int
14612 main ()
14613 {
14614 void *foo = &($name['k'])
14615   ;
14616   return 0;
14617 }
14618 _ACEOF
14619 rm -f conftest.$ac_objext conftest$ac_exeext
14620 if { (eval echo "$as_me:14620: \"$ac_link\"") >&5
14621   (eval $ac_link) 2>&5
14622   ac_status=$?
14623   echo "$as_me:14623: \$? = $ac_status" >&5
14624   (exit $ac_status); } &&
14625          { ac_try='test -s conftest$ac_exeext'
14626   { (eval echo "$as_me:14626: \"$ac_try\"") >&5
14627   (eval $ac_try) 2>&5
14628   ac_status=$?
14629   echo "$as_me:14629: \$? = $ac_status" >&5
14630   (exit $ac_status); }; }; then
14631   cf_cv_curses_wacs_map=$name
14632          break
14633 else
14634   echo "$as_me: failed program was:" >&5
14635 cat conftest.$ac_ext >&5
14636 fi
14637 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14638         done
14639 fi
14640 echo "$as_me:14640: result: $cf_cv_curses_wacs_map" >&5
14641 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
14642
14643 test "$cf_cv_curses_wacs_map" != unknown &&
14644 cat >>confdefs.h <<EOF
14645 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
14646 EOF
14647
14648 echo "$as_me:14648: checking for wide alternate character constants" >&5
14649 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
14650 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
14651   echo $ECHO_N "(cached) $ECHO_C" >&6
14652 else
14653
14654 cf_cv_curses_wacs_symbols=no
14655 if test "$cf_cv_curses_wacs_map" != unknown
14656 then
14657         cat >conftest.$ac_ext <<_ACEOF
14658 #line 14658 "configure"
14659 #include "confdefs.h"
14660
14661 #ifndef _XOPEN_SOURCE_EXTENDED
14662 #define _XOPEN_SOURCE_EXTENDED
14663 #endif
14664 #include <${cf_cv_ncurses_header:-curses.h}>
14665 int
14666 main ()
14667 {
14668 cchar_t *foo = WACS_PLUS;
14669          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
14670   ;
14671   return 0;
14672 }
14673 _ACEOF
14674 rm -f conftest.$ac_objext conftest$ac_exeext
14675 if { (eval echo "$as_me:14675: \"$ac_link\"") >&5
14676   (eval $ac_link) 2>&5
14677   ac_status=$?
14678   echo "$as_me:14678: \$? = $ac_status" >&5
14679   (exit $ac_status); } &&
14680          { ac_try='test -s conftest$ac_exeext'
14681   { (eval echo "$as_me:14681: \"$ac_try\"") >&5
14682   (eval $ac_try) 2>&5
14683   ac_status=$?
14684   echo "$as_me:14684: \$? = $ac_status" >&5
14685   (exit $ac_status); }; }; then
14686   cf_cv_curses_wacs_symbols=yes
14687 else
14688   echo "$as_me: failed program was:" >&5
14689 cat conftest.$ac_ext >&5
14690 fi
14691 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14692 else
14693         cat >conftest.$ac_ext <<_ACEOF
14694 #line 14694 "configure"
14695 #include "confdefs.h"
14696
14697 #ifndef _XOPEN_SOURCE_EXTENDED
14698 #define _XOPEN_SOURCE_EXTENDED
14699 #endif
14700 #include <${cf_cv_ncurses_header:-curses.h}>
14701 int
14702 main ()
14703 {
14704 cchar_t *foo = WACS_PLUS
14705   ;
14706   return 0;
14707 }
14708 _ACEOF
14709 rm -f conftest.$ac_objext conftest$ac_exeext
14710 if { (eval echo "$as_me:14710: \"$ac_link\"") >&5
14711   (eval $ac_link) 2>&5
14712   ac_status=$?
14713   echo "$as_me:14713: \$? = $ac_status" >&5
14714   (exit $ac_status); } &&
14715          { ac_try='test -s conftest$ac_exeext'
14716   { (eval echo "$as_me:14716: \"$ac_try\"") >&5
14717   (eval $ac_try) 2>&5
14718   ac_status=$?
14719   echo "$as_me:14719: \$? = $ac_status" >&5
14720   (exit $ac_status); }; }; then
14721   cf_cv_curses_wacs_symbols=yes
14722 else
14723   echo "$as_me: failed program was:" >&5
14724 cat conftest.$ac_ext >&5
14725 fi
14726 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14727 fi
14728
14729 fi
14730 echo "$as_me:14730: result: $cf_cv_curses_wacs_symbols" >&5
14731 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
14732
14733 test "$cf_cv_curses_wacs_symbols" != no &&
14734 cat >>confdefs.h <<\EOF
14735 #define CURSES_WACS_SYMBOLS 1
14736 EOF
14737
14738 fi
14739
14740 echo "$as_me:14740: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14741 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14742 cat >conftest.$ac_ext <<_ACEOF
14743 #line 14743 "configure"
14744 #include "confdefs.h"
14745
14746 #ifndef _XOPEN_SOURCE_EXTENDED
14747 #define _XOPEN_SOURCE_EXTENDED
14748 #endif
14749 #include <${cf_cv_ncurses_header:-curses.h}>
14750 int
14751 main ()
14752 {
14753
14754 attr_t foo
14755
14756   ;
14757   return 0;
14758 }
14759 _ACEOF
14760 rm -f conftest.$ac_objext
14761 if { (eval echo "$as_me:14761: \"$ac_compile\"") >&5
14762   (eval $ac_compile) 2>&5
14763   ac_status=$?
14764   echo "$as_me:14764: \$? = $ac_status" >&5
14765   (exit $ac_status); } &&
14766          { ac_try='test -s conftest.$ac_objext'
14767   { (eval echo "$as_me:14767: \"$ac_try\"") >&5
14768   (eval $ac_try) 2>&5
14769   ac_status=$?
14770   echo "$as_me:14770: \$? = $ac_status" >&5
14771   (exit $ac_status); }; }; then
14772   cf_result=yes
14773 else
14774   echo "$as_me: failed program was:" >&5
14775 cat conftest.$ac_ext >&5
14776 cf_result=no
14777 fi
14778 rm -f conftest.$ac_objext conftest.$ac_ext
14779 echo "$as_me:14779: result: $cf_result" >&5
14780 echo "${ECHO_T}$cf_result" >&6
14781 if test $cf_result = yes ; then
14782
14783 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14784
14785 cat >>confdefs.h <<EOF
14786 #define $cf_result 1
14787 EOF
14788
14789 else
14790
14791 cat >>confdefs.h <<EOF
14792 #define attr_t long
14793 EOF
14794
14795 fi
14796
14797 if test "$cf_enable_widec" = yes; then
14798
14799 # This is needed on Tru64 5.0 to declare mbstate_t
14800 echo "$as_me:14800: checking if we must include wchar.h to declare mbstate_t" >&5
14801 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
14802 if test "${cf_cv_mbstate_t+set}" = set; then
14803   echo $ECHO_N "(cached) $ECHO_C" >&6
14804 else
14805
14806 cat >conftest.$ac_ext <<_ACEOF
14807 #line 14807 "configure"
14808 #include "confdefs.h"
14809
14810 #include <stdlib.h>
14811 #include <stdarg.h>
14812 #include <stdio.h>
14813 #ifdef HAVE_LIBUTF8_H
14814 #include <libutf8.h>
14815 #endif
14816 int
14817 main ()
14818 {
14819 mbstate_t state
14820   ;
14821   return 0;
14822 }
14823 _ACEOF
14824 rm -f conftest.$ac_objext
14825 if { (eval echo "$as_me:14825: \"$ac_compile\"") >&5
14826   (eval $ac_compile) 2>&5
14827   ac_status=$?
14828   echo "$as_me:14828: \$? = $ac_status" >&5
14829   (exit $ac_status); } &&
14830          { ac_try='test -s conftest.$ac_objext'
14831   { (eval echo "$as_me:14831: \"$ac_try\"") >&5
14832   (eval $ac_try) 2>&5
14833   ac_status=$?
14834   echo "$as_me:14834: \$? = $ac_status" >&5
14835   (exit $ac_status); }; }; then
14836   cf_cv_mbstate_t=no
14837 else
14838   echo "$as_me: failed program was:" >&5
14839 cat conftest.$ac_ext >&5
14840 cat >conftest.$ac_ext <<_ACEOF
14841 #line 14841 "configure"
14842 #include "confdefs.h"
14843
14844 #include <stdlib.h>
14845 #include <stdarg.h>
14846 #include <stdio.h>
14847 #include <wchar.h>
14848 #ifdef HAVE_LIBUTF8_H
14849 #include <libutf8.h>
14850 #endif
14851 int
14852 main ()
14853 {
14854 mbstate_t value
14855   ;
14856   return 0;
14857 }
14858 _ACEOF
14859 rm -f conftest.$ac_objext
14860 if { (eval echo "$as_me:14860: \"$ac_compile\"") >&5
14861   (eval $ac_compile) 2>&5
14862   ac_status=$?
14863   echo "$as_me:14863: \$? = $ac_status" >&5
14864   (exit $ac_status); } &&
14865          { ac_try='test -s conftest.$ac_objext'
14866   { (eval echo "$as_me:14866: \"$ac_try\"") >&5
14867   (eval $ac_try) 2>&5
14868   ac_status=$?
14869   echo "$as_me:14869: \$? = $ac_status" >&5
14870   (exit $ac_status); }; }; then
14871   cf_cv_mbstate_t=yes
14872 else
14873   echo "$as_me: failed program was:" >&5
14874 cat conftest.$ac_ext >&5
14875 cf_cv_mbstate_t=unknown
14876 fi
14877 rm -f conftest.$ac_objext conftest.$ac_ext
14878 fi
14879 rm -f conftest.$ac_objext conftest.$ac_ext
14880 fi
14881 echo "$as_me:14881: result: $cf_cv_mbstate_t" >&5
14882 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
14883
14884 if test "$cf_cv_mbstate_t" = yes ; then
14885
14886 cat >>confdefs.h <<\EOF
14887 #define NEED_WCHAR_H 1
14888 EOF
14889
14890         NEED_WCHAR_H=1
14891 fi
14892
14893 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
14894 if test "$cf_cv_mbstate_t" = unknown ; then
14895         NCURSES_MBSTATE_T=1
14896 fi
14897
14898 # if we find mbstate_t in either place, use substitution to provide a fallback.
14899 if test "$cf_cv_mbstate_t" != unknown ; then
14900         NCURSES_OK_MBSTATE_T=1
14901 fi
14902
14903 # This is needed on Tru64 5.0 to declare wchar_t
14904 echo "$as_me:14904: checking if we must include wchar.h to declare wchar_t" >&5
14905 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
14906 if test "${cf_cv_wchar_t+set}" = set; then
14907   echo $ECHO_N "(cached) $ECHO_C" >&6
14908 else
14909
14910 cat >conftest.$ac_ext <<_ACEOF
14911 #line 14911 "configure"
14912 #include "confdefs.h"
14913
14914 #include <stdlib.h>
14915 #include <stdarg.h>
14916 #include <stdio.h>
14917 #ifdef HAVE_LIBUTF8_H
14918 #include <libutf8.h>
14919 #endif
14920 int
14921 main ()
14922 {
14923 wchar_t state
14924   ;
14925   return 0;
14926 }
14927 _ACEOF
14928 rm -f conftest.$ac_objext
14929 if { (eval echo "$as_me:14929: \"$ac_compile\"") >&5
14930   (eval $ac_compile) 2>&5
14931   ac_status=$?
14932   echo "$as_me:14932: \$? = $ac_status" >&5
14933   (exit $ac_status); } &&
14934          { ac_try='test -s conftest.$ac_objext'
14935   { (eval echo "$as_me:14935: \"$ac_try\"") >&5
14936   (eval $ac_try) 2>&5
14937   ac_status=$?
14938   echo "$as_me:14938: \$? = $ac_status" >&5
14939   (exit $ac_status); }; }; then
14940   cf_cv_wchar_t=no
14941 else
14942   echo "$as_me: failed program was:" >&5
14943 cat conftest.$ac_ext >&5
14944 cat >conftest.$ac_ext <<_ACEOF
14945 #line 14945 "configure"
14946 #include "confdefs.h"
14947
14948 #include <stdlib.h>
14949 #include <stdarg.h>
14950 #include <stdio.h>
14951 #include <wchar.h>
14952 #ifdef HAVE_LIBUTF8_H
14953 #include <libutf8.h>
14954 #endif
14955 int
14956 main ()
14957 {
14958 wchar_t value
14959   ;
14960   return 0;
14961 }
14962 _ACEOF
14963 rm -f conftest.$ac_objext
14964 if { (eval echo "$as_me:14964: \"$ac_compile\"") >&5
14965   (eval $ac_compile) 2>&5
14966   ac_status=$?
14967   echo "$as_me:14967: \$? = $ac_status" >&5
14968   (exit $ac_status); } &&
14969          { ac_try='test -s conftest.$ac_objext'
14970   { (eval echo "$as_me:14970: \"$ac_try\"") >&5
14971   (eval $ac_try) 2>&5
14972   ac_status=$?
14973   echo "$as_me:14973: \$? = $ac_status" >&5
14974   (exit $ac_status); }; }; then
14975   cf_cv_wchar_t=yes
14976 else
14977   echo "$as_me: failed program was:" >&5
14978 cat conftest.$ac_ext >&5
14979 cf_cv_wchar_t=unknown
14980 fi
14981 rm -f conftest.$ac_objext conftest.$ac_ext
14982 fi
14983 rm -f conftest.$ac_objext conftest.$ac_ext
14984 fi
14985 echo "$as_me:14985: result: $cf_cv_wchar_t" >&5
14986 echo "${ECHO_T}$cf_cv_wchar_t" >&6
14987
14988 if test "$cf_cv_wchar_t" = yes ; then
14989
14990 cat >>confdefs.h <<\EOF
14991 #define NEED_WCHAR_H 1
14992 EOF
14993
14994         NEED_WCHAR_H=1
14995 fi
14996
14997 # if we do not find wchar_t in either place, use substitution to provide a fallback.
14998 if test "$cf_cv_wchar_t" = unknown ; then
14999         NCURSES_WCHAR_T=1
15000 fi
15001
15002 # if we find wchar_t in either place, use substitution to provide a fallback.
15003 if test "$cf_cv_wchar_t" != unknown ; then
15004         NCURSES_OK_WCHAR_T=1
15005 fi
15006
15007 # This is needed on Tru64 5.0 to declare wint_t
15008 echo "$as_me:15008: checking if we must include wchar.h to declare wint_t" >&5
15009 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15010 if test "${cf_cv_wint_t+set}" = set; then
15011   echo $ECHO_N "(cached) $ECHO_C" >&6
15012 else
15013
15014 cat >conftest.$ac_ext <<_ACEOF
15015 #line 15015 "configure"
15016 #include "confdefs.h"
15017
15018 #include <stdlib.h>
15019 #include <stdarg.h>
15020 #include <stdio.h>
15021 #ifdef HAVE_LIBUTF8_H
15022 #include <libutf8.h>
15023 #endif
15024 int
15025 main ()
15026 {
15027 wint_t state
15028   ;
15029   return 0;
15030 }
15031 _ACEOF
15032 rm -f conftest.$ac_objext
15033 if { (eval echo "$as_me:15033: \"$ac_compile\"") >&5
15034   (eval $ac_compile) 2>&5
15035   ac_status=$?
15036   echo "$as_me:15036: \$? = $ac_status" >&5
15037   (exit $ac_status); } &&
15038          { ac_try='test -s conftest.$ac_objext'
15039   { (eval echo "$as_me:15039: \"$ac_try\"") >&5
15040   (eval $ac_try) 2>&5
15041   ac_status=$?
15042   echo "$as_me:15042: \$? = $ac_status" >&5
15043   (exit $ac_status); }; }; then
15044   cf_cv_wint_t=no
15045 else
15046   echo "$as_me: failed program was:" >&5
15047 cat conftest.$ac_ext >&5
15048 cat >conftest.$ac_ext <<_ACEOF
15049 #line 15049 "configure"
15050 #include "confdefs.h"
15051
15052 #include <stdlib.h>
15053 #include <stdarg.h>
15054 #include <stdio.h>
15055 #include <wchar.h>
15056 #ifdef HAVE_LIBUTF8_H
15057 #include <libutf8.h>
15058 #endif
15059 int
15060 main ()
15061 {
15062 wint_t value
15063   ;
15064   return 0;
15065 }
15066 _ACEOF
15067 rm -f conftest.$ac_objext
15068 if { (eval echo "$as_me:15068: \"$ac_compile\"") >&5
15069   (eval $ac_compile) 2>&5
15070   ac_status=$?
15071   echo "$as_me:15071: \$? = $ac_status" >&5
15072   (exit $ac_status); } &&
15073          { ac_try='test -s conftest.$ac_objext'
15074   { (eval echo "$as_me:15074: \"$ac_try\"") >&5
15075   (eval $ac_try) 2>&5
15076   ac_status=$?
15077   echo "$as_me:15077: \$? = $ac_status" >&5
15078   (exit $ac_status); }; }; then
15079   cf_cv_wint_t=yes
15080 else
15081   echo "$as_me: failed program was:" >&5
15082 cat conftest.$ac_ext >&5
15083 cf_cv_wint_t=unknown
15084 fi
15085 rm -f conftest.$ac_objext conftest.$ac_ext
15086 fi
15087 rm -f conftest.$ac_objext conftest.$ac_ext
15088 fi
15089 echo "$as_me:15089: result: $cf_cv_wint_t" >&5
15090 echo "${ECHO_T}$cf_cv_wint_t" >&6
15091
15092 if test "$cf_cv_wint_t" = yes ; then
15093
15094 cat >>confdefs.h <<\EOF
15095 #define NEED_WCHAR_H 1
15096 EOF
15097
15098         NEED_WCHAR_H=1
15099 fi
15100
15101 # if we do not find wint_t in either place, use substitution to provide a fallback.
15102 if test "$cf_cv_wint_t" = unknown ; then
15103         NCURSES_WINT_T=1
15104 fi
15105
15106 # if we find wint_t in either place, use substitution to provide a fallback.
15107 if test "$cf_cv_wint_t" != unknown ; then
15108         NCURSES_OK_WINT_T=1
15109 fi
15110
15111         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15112
15113 echo "$as_me:15113: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15114 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15115 cat >conftest.$ac_ext <<_ACEOF
15116 #line 15116 "configure"
15117 #include "confdefs.h"
15118
15119 #ifndef _XOPEN_SOURCE_EXTENDED
15120 #define _XOPEN_SOURCE_EXTENDED
15121 #endif
15122 #include <${cf_cv_ncurses_header:-curses.h}>
15123 int
15124 main ()
15125 {
15126
15127 mbstate_t foo
15128
15129   ;
15130   return 0;
15131 }
15132 _ACEOF
15133 rm -f conftest.$ac_objext
15134 if { (eval echo "$as_me:15134: \"$ac_compile\"") >&5
15135   (eval $ac_compile) 2>&5
15136   ac_status=$?
15137   echo "$as_me:15137: \$? = $ac_status" >&5
15138   (exit $ac_status); } &&
15139          { ac_try='test -s conftest.$ac_objext'
15140   { (eval echo "$as_me:15140: \"$ac_try\"") >&5
15141   (eval $ac_try) 2>&5
15142   ac_status=$?
15143   echo "$as_me:15143: \$? = $ac_status" >&5
15144   (exit $ac_status); }; }; then
15145   cf_result=yes
15146 else
15147   echo "$as_me: failed program was:" >&5
15148 cat conftest.$ac_ext >&5
15149 cf_result=no
15150 fi
15151 rm -f conftest.$ac_objext conftest.$ac_ext
15152 echo "$as_me:15152: result: $cf_result" >&5
15153 echo "${ECHO_T}$cf_result" >&6
15154 if test $cf_result = yes ; then
15155
15156 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15157
15158 cat >>confdefs.h <<EOF
15159 #define $cf_result 1
15160 EOF
15161
15162 else
15163
15164 cat >>confdefs.h <<EOF
15165 #define mbstate_t long
15166 EOF
15167
15168 fi
15169
15170         fi
15171
15172         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
15173
15174 echo "$as_me:15174: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15175 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15176 cat >conftest.$ac_ext <<_ACEOF
15177 #line 15177 "configure"
15178 #include "confdefs.h"
15179
15180 #ifndef _XOPEN_SOURCE_EXTENDED
15181 #define _XOPEN_SOURCE_EXTENDED
15182 #endif
15183 #include <${cf_cv_ncurses_header:-curses.h}>
15184 int
15185 main ()
15186 {
15187
15188 wchar_t foo
15189
15190   ;
15191   return 0;
15192 }
15193 _ACEOF
15194 rm -f conftest.$ac_objext
15195 if { (eval echo "$as_me:15195: \"$ac_compile\"") >&5
15196   (eval $ac_compile) 2>&5
15197   ac_status=$?
15198   echo "$as_me:15198: \$? = $ac_status" >&5
15199   (exit $ac_status); } &&
15200          { ac_try='test -s conftest.$ac_objext'
15201   { (eval echo "$as_me:15201: \"$ac_try\"") >&5
15202   (eval $ac_try) 2>&5
15203   ac_status=$?
15204   echo "$as_me:15204: \$? = $ac_status" >&5
15205   (exit $ac_status); }; }; then
15206   cf_result=yes
15207 else
15208   echo "$as_me: failed program was:" >&5
15209 cat conftest.$ac_ext >&5
15210 cf_result=no
15211 fi
15212 rm -f conftest.$ac_objext conftest.$ac_ext
15213 echo "$as_me:15213: result: $cf_result" >&5
15214 echo "${ECHO_T}$cf_result" >&6
15215 if test $cf_result = yes ; then
15216
15217 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15218
15219 cat >>confdefs.h <<EOF
15220 #define $cf_result 1
15221 EOF
15222
15223 else
15224
15225 cat >>confdefs.h <<EOF
15226 #define wchar_t long
15227 EOF
15228
15229 fi
15230
15231         fi
15232
15233         if test "$NCURSES_OK_WINT_T" = 0 ; then
15234
15235 echo "$as_me:15235: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15236 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15237 cat >conftest.$ac_ext <<_ACEOF
15238 #line 15238 "configure"
15239 #include "confdefs.h"
15240
15241 #ifndef _XOPEN_SOURCE_EXTENDED
15242 #define _XOPEN_SOURCE_EXTENDED
15243 #endif
15244 #include <${cf_cv_ncurses_header:-curses.h}>
15245 int
15246 main ()
15247 {
15248
15249 wint_t foo
15250
15251   ;
15252   return 0;
15253 }
15254 _ACEOF
15255 rm -f conftest.$ac_objext
15256 if { (eval echo "$as_me:15256: \"$ac_compile\"") >&5
15257   (eval $ac_compile) 2>&5
15258   ac_status=$?
15259   echo "$as_me:15259: \$? = $ac_status" >&5
15260   (exit $ac_status); } &&
15261          { ac_try='test -s conftest.$ac_objext'
15262   { (eval echo "$as_me:15262: \"$ac_try\"") >&5
15263   (eval $ac_try) 2>&5
15264   ac_status=$?
15265   echo "$as_me:15265: \$? = $ac_status" >&5
15266   (exit $ac_status); }; }; then
15267   cf_result=yes
15268 else
15269   echo "$as_me: failed program was:" >&5
15270 cat conftest.$ac_ext >&5
15271 cf_result=no
15272 fi
15273 rm -f conftest.$ac_objext conftest.$ac_ext
15274 echo "$as_me:15274: result: $cf_result" >&5
15275 echo "${ECHO_T}$cf_result" >&6
15276 if test $cf_result = yes ; then
15277
15278 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15279
15280 cat >>confdefs.h <<EOF
15281 #define $cf_result 1
15282 EOF
15283
15284 else
15285
15286 cat >>confdefs.h <<EOF
15287 #define wint_t long
15288 EOF
15289
15290 fi
15291
15292         fi
15293 fi
15294
15295 echo "$as_me:15295: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15296 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15297
15298 cat >conftest.$ac_ext <<_ACEOF
15299 #line 15299 "configure"
15300 #include "confdefs.h"
15301
15302 #ifdef HAVE_XCURSES
15303 #include <xcurses.h>
15304 char * XCursesProgramName = "test";
15305 #else
15306 #include <${cf_cv_ncurses_header:-curses.h}>
15307 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15308 #include <ncursesw/term.h>
15309 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15310 #include <ncurses/term.h>
15311 #elif defined(HAVE_TERM_H)
15312 #include <term.h>
15313 #endif
15314 #endif
15315
15316 int
15317 main ()
15318 {
15319
15320 void *foo = &(boolnames)
15321
15322   ;
15323   return 0;
15324 }
15325 _ACEOF
15326 rm -f conftest.$ac_objext
15327 if { (eval echo "$as_me:15327: \"$ac_compile\"") >&5
15328   (eval $ac_compile) 2>&5
15329   ac_status=$?
15330   echo "$as_me:15330: \$? = $ac_status" >&5
15331   (exit $ac_status); } &&
15332          { ac_try='test -s conftest.$ac_objext'
15333   { (eval echo "$as_me:15333: \"$ac_try\"") >&5
15334   (eval $ac_try) 2>&5
15335   ac_status=$?
15336   echo "$as_me:15336: \$? = $ac_status" >&5
15337   (exit $ac_status); }; }; then
15338   cf_result=yes
15339 else
15340   echo "$as_me: failed program was:" >&5
15341 cat conftest.$ac_ext >&5
15342 cf_result=no
15343 fi
15344 rm -f conftest.$ac_objext conftest.$ac_ext
15345 echo "$as_me:15345: result: $cf_result" >&5
15346 echo "${ECHO_T}$cf_result" >&6
15347
15348 if test $cf_result = yes ; then
15349
15350 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15351
15352         cat >>confdefs.h <<EOF
15353 #define $cf_result 1
15354 EOF
15355
15356 else
15357         echo "$as_me:15357: checking for data boolnames in library" >&5
15358 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
15359         # BSD linkers insist on making weak linkage, but resolve at runtime.
15360         if test "$cross_compiling" = yes; then
15361
15362         # cross-compiling
15363         cat >conftest.$ac_ext <<_ACEOF
15364 #line 15364 "configure"
15365 #include "confdefs.h"
15366
15367 #ifdef HAVE_XCURSES
15368 #include <xcurses.h>
15369 char * XCursesProgramName = "test";
15370 #else
15371 #include <${cf_cv_ncurses_header:-curses.h}>
15372 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15373 #include <ncursesw/term.h>
15374 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15375 #include <ncurses/term.h>
15376 #elif defined(HAVE_TERM_H)
15377 #include <term.h>
15378 #endif
15379 #endif
15380
15381 extern char boolnames;
15382 int
15383 main ()
15384 {
15385
15386         do {
15387                 void *foo = &(boolnames);
15388                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
15389                 ${cf_cv_main_return:-return}(foo == 0);
15390         } while (0)
15391
15392   ;
15393   return 0;
15394 }
15395 _ACEOF
15396 rm -f conftest.$ac_objext conftest$ac_exeext
15397 if { (eval echo "$as_me:15397: \"$ac_link\"") >&5
15398   (eval $ac_link) 2>&5
15399   ac_status=$?
15400   echo "$as_me:15400: \$? = $ac_status" >&5
15401   (exit $ac_status); } &&
15402          { ac_try='test -s conftest$ac_exeext'
15403   { (eval echo "$as_me:15403: \"$ac_try\"") >&5
15404   (eval $ac_try) 2>&5
15405   ac_status=$?
15406   echo "$as_me:15406: \$? = $ac_status" >&5
15407   (exit $ac_status); }; }; then
15408   cf_result=yes
15409 else
15410   echo "$as_me: failed program was:" >&5
15411 cat conftest.$ac_ext >&5
15412 cf_result=no
15413 fi
15414 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15415
15416 else
15417   cat >conftest.$ac_ext <<_ACEOF
15418 #line 15418 "configure"
15419 #include "confdefs.h"
15420
15421 #ifdef HAVE_XCURSES
15422 #include <xcurses.h>
15423 char * XCursesProgramName = "test";
15424 #else
15425 #include <${cf_cv_ncurses_header:-curses.h}>
15426 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15427 #include <ncursesw/term.h>
15428 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15429 #include <ncurses/term.h>
15430 #elif defined(HAVE_TERM_H)
15431 #include <term.h>
15432 #endif
15433 #endif
15434
15435 extern char boolnames;
15436 int main(void)
15437 {
15438         void *foo = &(boolnames);
15439         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
15440         ${cf_cv_main_return:-return}(foo == 0);
15441 }
15442 _ACEOF
15443 rm -f conftest$ac_exeext
15444 if { (eval echo "$as_me:15444: \"$ac_link\"") >&5
15445   (eval $ac_link) 2>&5
15446   ac_status=$?
15447   echo "$as_me:15447: \$? = $ac_status" >&5
15448   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15449   { (eval echo "$as_me:15449: \"$ac_try\"") >&5
15450   (eval $ac_try) 2>&5
15451   ac_status=$?
15452   echo "$as_me:15452: \$? = $ac_status" >&5
15453   (exit $ac_status); }; }; then
15454   cf_result=yes
15455 else
15456   echo "$as_me: program exited with status $ac_status" >&5
15457 echo "$as_me: failed program was:" >&5
15458 cat conftest.$ac_ext >&5
15459 cf_result=no
15460 fi
15461 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15462 fi
15463         echo "$as_me:15463: result: $cf_result" >&5
15464 echo "${ECHO_T}$cf_result" >&6
15465         if test $cf_result = yes ; then
15466
15467 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15468
15469                 cat >>confdefs.h <<EOF
15470 #define $cf_result 1
15471 EOF
15472
15473         fi
15474 fi
15475
15476 echo "$as_me:15476: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15477 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15478
15479 cat >conftest.$ac_ext <<_ACEOF
15480 #line 15480 "configure"
15481 #include "confdefs.h"
15482
15483 #ifdef HAVE_XCURSES
15484 #include <xcurses.h>
15485 char * XCursesProgramName = "test";
15486 #else
15487 #include <${cf_cv_ncurses_header:-curses.h}>
15488 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15489 #include <ncursesw/term.h>
15490 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15491 #include <ncurses/term.h>
15492 #elif defined(HAVE_TERM_H)
15493 #include <term.h>
15494 #endif
15495 #endif
15496
15497 int
15498 main ()
15499 {
15500
15501 void *foo = &(boolfnames)
15502
15503   ;
15504   return 0;
15505 }
15506 _ACEOF
15507 rm -f conftest.$ac_objext
15508 if { (eval echo "$as_me:15508: \"$ac_compile\"") >&5
15509   (eval $ac_compile) 2>&5
15510   ac_status=$?
15511   echo "$as_me:15511: \$? = $ac_status" >&5
15512   (exit $ac_status); } &&
15513          { ac_try='test -s conftest.$ac_objext'
15514   { (eval echo "$as_me:15514: \"$ac_try\"") >&5
15515   (eval $ac_try) 2>&5
15516   ac_status=$?
15517   echo "$as_me:15517: \$? = $ac_status" >&5
15518   (exit $ac_status); }; }; then
15519   cf_result=yes
15520 else
15521   echo "$as_me: failed program was:" >&5
15522 cat conftest.$ac_ext >&5
15523 cf_result=no
15524 fi
15525 rm -f conftest.$ac_objext conftest.$ac_ext
15526 echo "$as_me:15526: result: $cf_result" >&5
15527 echo "${ECHO_T}$cf_result" >&6
15528
15529 if test $cf_result = yes ; then
15530
15531 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15532
15533         cat >>confdefs.h <<EOF
15534 #define $cf_result 1
15535 EOF
15536
15537 else
15538         echo "$as_me:15538: checking for data boolfnames in library" >&5
15539 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
15540         # BSD linkers insist on making weak linkage, but resolve at runtime.
15541         if test "$cross_compiling" = yes; then
15542
15543         # cross-compiling
15544         cat >conftest.$ac_ext <<_ACEOF
15545 #line 15545 "configure"
15546 #include "confdefs.h"
15547
15548 #ifdef HAVE_XCURSES
15549 #include <xcurses.h>
15550 char * XCursesProgramName = "test";
15551 #else
15552 #include <${cf_cv_ncurses_header:-curses.h}>
15553 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15554 #include <ncursesw/term.h>
15555 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15556 #include <ncurses/term.h>
15557 #elif defined(HAVE_TERM_H)
15558 #include <term.h>
15559 #endif
15560 #endif
15561
15562 extern char boolfnames;
15563 int
15564 main ()
15565 {
15566
15567         do {
15568                 void *foo = &(boolfnames);
15569                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
15570                 ${cf_cv_main_return:-return}(foo == 0);
15571         } while (0)
15572
15573   ;
15574   return 0;
15575 }
15576 _ACEOF
15577 rm -f conftest.$ac_objext conftest$ac_exeext
15578 if { (eval echo "$as_me:15578: \"$ac_link\"") >&5
15579   (eval $ac_link) 2>&5
15580   ac_status=$?
15581   echo "$as_me:15581: \$? = $ac_status" >&5
15582   (exit $ac_status); } &&
15583          { ac_try='test -s conftest$ac_exeext'
15584   { (eval echo "$as_me:15584: \"$ac_try\"") >&5
15585   (eval $ac_try) 2>&5
15586   ac_status=$?
15587   echo "$as_me:15587: \$? = $ac_status" >&5
15588   (exit $ac_status); }; }; then
15589   cf_result=yes
15590 else
15591   echo "$as_me: failed program was:" >&5
15592 cat conftest.$ac_ext >&5
15593 cf_result=no
15594 fi
15595 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15596
15597 else
15598   cat >conftest.$ac_ext <<_ACEOF
15599 #line 15599 "configure"
15600 #include "confdefs.h"
15601
15602 #ifdef HAVE_XCURSES
15603 #include <xcurses.h>
15604 char * XCursesProgramName = "test";
15605 #else
15606 #include <${cf_cv_ncurses_header:-curses.h}>
15607 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15608 #include <ncursesw/term.h>
15609 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15610 #include <ncurses/term.h>
15611 #elif defined(HAVE_TERM_H)
15612 #include <term.h>
15613 #endif
15614 #endif
15615
15616 extern char boolfnames;
15617 int main(void)
15618 {
15619         void *foo = &(boolfnames);
15620         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
15621         ${cf_cv_main_return:-return}(foo == 0);
15622 }
15623 _ACEOF
15624 rm -f conftest$ac_exeext
15625 if { (eval echo "$as_me:15625: \"$ac_link\"") >&5
15626   (eval $ac_link) 2>&5
15627   ac_status=$?
15628   echo "$as_me:15628: \$? = $ac_status" >&5
15629   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15630   { (eval echo "$as_me:15630: \"$ac_try\"") >&5
15631   (eval $ac_try) 2>&5
15632   ac_status=$?
15633   echo "$as_me:15633: \$? = $ac_status" >&5
15634   (exit $ac_status); }; }; then
15635   cf_result=yes
15636 else
15637   echo "$as_me: program exited with status $ac_status" >&5
15638 echo "$as_me: failed program was:" >&5
15639 cat conftest.$ac_ext >&5
15640 cf_result=no
15641 fi
15642 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15643 fi
15644         echo "$as_me:15644: result: $cf_result" >&5
15645 echo "${ECHO_T}$cf_result" >&6
15646         if test $cf_result = yes ; then
15647
15648 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15649
15650                 cat >>confdefs.h <<EOF
15651 #define $cf_result 1
15652 EOF
15653
15654         fi
15655 fi
15656
15657 if ( test "$GCC" = yes || test "$GXX" = yes )
15658 then
15659 echo "$as_me:15659: checking if you want to turn on gcc warnings" >&5
15660 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15661
15662 # Check whether --enable-warnings or --disable-warnings was given.
15663 if test "${enable_warnings+set}" = set; then
15664   enableval="$enable_warnings"
15665   test "$enableval" != yes && enableval=no
15666   if test "$enableval" != "no" ; then
15667     with_warnings=yes
15668   else
15669     with_warnings=no
15670   fi
15671 else
15672   enableval=no
15673   with_warnings=no
15674
15675 fi;
15676 echo "$as_me:15676: result: $with_warnings" >&5
15677 echo "${ECHO_T}$with_warnings" >&6
15678 if test "$with_warnings" = "yes"
15679 then
15680
15681 if test "$GCC" = yes
15682 then
15683 cat > conftest.i <<EOF
15684 #ifndef GCC_PRINTF
15685 #define GCC_PRINTF 0
15686 #endif
15687 #ifndef GCC_SCANF
15688 #define GCC_SCANF 0
15689 #endif
15690 #ifndef GCC_NORETURN
15691 #define GCC_NORETURN /* nothing */
15692 #endif
15693 #ifndef GCC_UNUSED
15694 #define GCC_UNUSED /* nothing */
15695 #endif
15696 EOF
15697 if test "$GCC" = yes
15698 then
15699         { echo "$as_me:15699: checking for $CC __attribute__ directives..." >&5
15700 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15701 cat > conftest.$ac_ext <<EOF
15702 #line 15702 "${as_me:-configure}"
15703 #include "confdefs.h"
15704 #include "conftest.h"
15705 #include "conftest.i"
15706 #if     GCC_PRINTF
15707 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15708 #else
15709 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15710 #endif
15711 #if     GCC_SCANF
15712 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15713 #else
15714 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15715 #endif
15716 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15717 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
15718 extern void foo(void) GCC_NORETURN;
15719 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
15720 EOF
15721         cf_printf_attribute=no
15722         cf_scanf_attribute=no
15723         for cf_attribute in scanf printf unused noreturn
15724         do
15725
15726 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15727
15728                 cf_directive="__attribute__(($cf_attribute))"
15729                 echo "checking for $CC $cf_directive" 1>&5
15730
15731                 case $cf_attribute in #(vi
15732                 printf) #(vi
15733                         cf_printf_attribute=yes
15734                         cat >conftest.h <<EOF
15735 #define GCC_$cf_ATTRIBUTE 1
15736 EOF
15737                         ;;
15738                 scanf) #(vi
15739                         cf_scanf_attribute=yes
15740                         cat >conftest.h <<EOF
15741 #define GCC_$cf_ATTRIBUTE 1
15742 EOF
15743                         ;;
15744                 *) #(vi
15745                         cat >conftest.h <<EOF
15746 #define GCC_$cf_ATTRIBUTE $cf_directive
15747 EOF
15748                         ;;
15749                 esac
15750
15751                 if { (eval echo "$as_me:15751: \"$ac_compile\"") >&5
15752   (eval $ac_compile) 2>&5
15753   ac_status=$?
15754   echo "$as_me:15754: \$? = $ac_status" >&5
15755   (exit $ac_status); }; then
15756                         test -n "$verbose" && echo "$as_me:15756: result: ... $cf_attribute" >&5
15757 echo "${ECHO_T}... $cf_attribute" >&6
15758                         cat conftest.h >>confdefs.h
15759                         case $cf_attribute in #(vi
15760                         noreturn) #(vi
15761
15762 cat >>confdefs.h <<EOF
15763 #define GCC_NORETURN $cf_directive
15764 EOF
15765
15766                                 ;;
15767                         printf) #(vi
15768                                 cf_value='/* nothing */'
15769                                 if test "$cf_printf_attribute" != no ; then
15770                                         cf_value='__attribute__((format(printf,fmt,var)))'
15771
15772 cat >>confdefs.h <<\EOF
15773 #define GCC_PRINTF 1
15774 EOF
15775
15776                                 fi
15777
15778 cat >>confdefs.h <<EOF
15779 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15780 EOF
15781
15782                                 ;;
15783                         scanf) #(vi
15784                                 cf_value='/* nothing */'
15785                                 if test "$cf_scanf_attribute" != no ; then
15786                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15787
15788 cat >>confdefs.h <<\EOF
15789 #define GCC_SCANF 1
15790 EOF
15791
15792                                 fi
15793
15794 cat >>confdefs.h <<EOF
15795 #define GCC_SCANFLIKE(fmt,var) $cf_value
15796 EOF
15797
15798                                 ;;
15799                         unused) #(vi
15800
15801 cat >>confdefs.h <<EOF
15802 #define GCC_UNUSED $cf_directive
15803 EOF
15804
15805                                 ;;
15806                         esac
15807                 fi
15808         done
15809 else
15810         fgrep define conftest.i >>confdefs.h
15811 fi
15812 rm -rf conftest*
15813 fi
15814
15815 INTEL_COMPILER=no
15816
15817 if test "$GCC" = yes ; then
15818         case $host_os in
15819         linux*|gnu*)
15820                 echo "$as_me:15820: checking if this is really Intel C compiler" >&5
15821 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
15822                 cf_save_CFLAGS="$CFLAGS"
15823                 CFLAGS="$CFLAGS -no-gcc"
15824                 cat >conftest.$ac_ext <<_ACEOF
15825 #line 15825 "configure"
15826 #include "confdefs.h"
15827
15828 int
15829 main ()
15830 {
15831
15832 #ifdef __INTEL_COMPILER
15833 #else
15834 make an error
15835 #endif
15836
15837   ;
15838   return 0;
15839 }
15840 _ACEOF
15841 rm -f conftest.$ac_objext
15842 if { (eval echo "$as_me:15842: \"$ac_compile\"") >&5
15843   (eval $ac_compile) 2>&5
15844   ac_status=$?
15845   echo "$as_me:15845: \$? = $ac_status" >&5
15846   (exit $ac_status); } &&
15847          { ac_try='test -s conftest.$ac_objext'
15848   { (eval echo "$as_me:15848: \"$ac_try\"") >&5
15849   (eval $ac_try) 2>&5
15850   ac_status=$?
15851   echo "$as_me:15851: \$? = $ac_status" >&5
15852   (exit $ac_status); }; }; then
15853   INTEL_COMPILER=yes
15854 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
15855
15856 else
15857   echo "$as_me: failed program was:" >&5
15858 cat conftest.$ac_ext >&5
15859 fi
15860 rm -f conftest.$ac_objext conftest.$ac_ext
15861                 CFLAGS="$cf_save_CFLAGS"
15862                 echo "$as_me:15862: result: $INTEL_COMPILER" >&5
15863 echo "${ECHO_T}$INTEL_COMPILER" >&6
15864                 ;;
15865         esac
15866 fi
15867
15868 CLANG_COMPILER=no
15869
15870 if test "$GCC" = yes ; then
15871         echo "$as_me:15871: checking if this is really Clang C compiler" >&5
15872 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
15873         cf_save_CFLAGS="$CFLAGS"
15874         CFLAGS="$CFLAGS -Qunused-arguments"
15875         cat >conftest.$ac_ext <<_ACEOF
15876 #line 15876 "configure"
15877 #include "confdefs.h"
15878
15879 int
15880 main ()
15881 {
15882
15883 #ifdef __clang__
15884 #else
15885 make an error
15886 #endif
15887
15888   ;
15889   return 0;
15890 }
15891 _ACEOF
15892 rm -f conftest.$ac_objext
15893 if { (eval echo "$as_me:15893: \"$ac_compile\"") >&5
15894   (eval $ac_compile) 2>&5
15895   ac_status=$?
15896   echo "$as_me:15896: \$? = $ac_status" >&5
15897   (exit $ac_status); } &&
15898          { ac_try='test -s conftest.$ac_objext'
15899   { (eval echo "$as_me:15899: \"$ac_try\"") >&5
15900   (eval $ac_try) 2>&5
15901   ac_status=$?
15902   echo "$as_me:15902: \$? = $ac_status" >&5
15903   (exit $ac_status); }; }; then
15904   CLANG_COMPILER=yes
15905 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
15906
15907 else
15908   echo "$as_me: failed program was:" >&5
15909 cat conftest.$ac_ext >&5
15910 fi
15911 rm -f conftest.$ac_objext conftest.$ac_ext
15912         CFLAGS="$cf_save_CFLAGS"
15913         echo "$as_me:15913: result: $CLANG_COMPILER" >&5
15914 echo "${ECHO_T}$CLANG_COMPILER" >&6
15915 fi
15916
15917 cat > conftest.$ac_ext <<EOF
15918 #line 15918 "${as_me:-configure}"
15919 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15920 EOF
15921
15922 if test "$INTEL_COMPILER" = yes
15923 then
15924 # The "-wdXXX" options suppress warnings:
15925 # remark #1419: external declaration in primary source file
15926 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15927 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15928 # remark #193: zero used for undefined preprocessing identifier
15929 # remark #593: variable "curs_sb_left_arrow" was set but never used
15930 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15931 # remark #869: parameter "tw" was never referenced
15932 # remark #981: operands are evaluated in unspecified order
15933 # warning #279: controlling expression is constant
15934
15935         { echo "$as_me:15935: checking for $CC warning options..." >&5
15936 echo "$as_me: checking for $CC warning options..." >&6;}
15937         cf_save_CFLAGS="$CFLAGS"
15938         EXTRA_CFLAGS="-Wall"
15939         for cf_opt in \
15940                 wd1419 \
15941                 wd1683 \
15942                 wd1684 \
15943                 wd193 \
15944                 wd593 \
15945                 wd279 \
15946                 wd810 \
15947                 wd869 \
15948                 wd981
15949         do
15950                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15951                 if { (eval echo "$as_me:15951: \"$ac_compile\"") >&5
15952   (eval $ac_compile) 2>&5
15953   ac_status=$?
15954   echo "$as_me:15954: \$? = $ac_status" >&5
15955   (exit $ac_status); }; then
15956                         test -n "$verbose" && echo "$as_me:15956: result: ... -$cf_opt" >&5
15957 echo "${ECHO_T}... -$cf_opt" >&6
15958                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15959                 fi
15960         done
15961         CFLAGS="$cf_save_CFLAGS"
15962
15963 elif test "$GCC" = yes
15964 then
15965         { echo "$as_me:15965: checking for $CC warning options..." >&5
15966 echo "$as_me: checking for $CC warning options..." >&6;}
15967         cf_save_CFLAGS="$CFLAGS"
15968         EXTRA_CFLAGS=
15969         cf_warn_CONST=""
15970         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15971         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15972         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15973         for cf_opt in W Wall \
15974                 Wbad-function-cast \
15975                 Wcast-align \
15976                 Wcast-qual \
15977                 Wdeclaration-after-statement \
15978                 Wextra \
15979                 Winline \
15980                 Wmissing-declarations \
15981                 Wmissing-prototypes \
15982                 Wnested-externs \
15983                 Wpointer-arith \
15984                 Wshadow \
15985                 Wstrict-prototypes \
15986                 Wundef $cf_gcc_warnings $cf_warn_CONST
15987         do
15988                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15989                 if { (eval echo "$as_me:15989: \"$ac_compile\"") >&5
15990   (eval $ac_compile) 2>&5
15991   ac_status=$?
15992   echo "$as_me:15992: \$? = $ac_status" >&5
15993   (exit $ac_status); }; then
15994                         test -n "$verbose" && echo "$as_me:15994: result: ... -$cf_opt" >&5
15995 echo "${ECHO_T}... -$cf_opt" >&6
15996                         case $cf_opt in #(vi
15997                         Wcast-qual) #(vi
15998                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
15999                                 ;;
16000                         Winline) #(vi
16001                                 case $GCC_VERSION in
16002                                 [34].*)
16003                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16004
16005 echo "${as_me:-configure}:16005: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16006
16007                                         continue;;
16008                                 esac
16009                                 ;;
16010                         Wpointer-arith) #(vi
16011                                 case $GCC_VERSION in
16012                                 [12].*)
16013                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16014
16015 echo "${as_me:-configure}:16015: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16016
16017                                         continue;;
16018                                 esac
16019                                 ;;
16020                         esac
16021                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16022                 fi
16023         done
16024         CFLAGS="$cf_save_CFLAGS"
16025 fi
16026 rm -rf conftest*
16027
16028 fi
16029 fi
16030
16031 echo "$as_me:16031: checking if you want to use dmalloc for testing" >&5
16032 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
16033
16034 # Check whether --with-dmalloc or --without-dmalloc was given.
16035 if test "${with_dmalloc+set}" = set; then
16036   withval="$with_dmalloc"
16037
16038 cat >>confdefs.h <<EOF
16039 #define USE_DMALLOC 1
16040 EOF
16041
16042         : ${with_cflags:=-g}
16043         : ${with_no_leaks:=yes}
16044          with_dmalloc=yes
16045 else
16046   with_dmalloc=
16047 fi;
16048 echo "$as_me:16048: result: ${with_dmalloc:-no}" >&5
16049 echo "${ECHO_T}${with_dmalloc:-no}" >&6
16050
16051 case .$with_cflags in #(vi
16052 .*-g*)
16053         case .$CFLAGS in #(vi
16054         .*-g*) #(vi
16055                 ;;
16056         *)
16057
16058 cf_fix_cppflags=no
16059 cf_new_cflags=
16060 cf_new_cppflags=
16061 cf_new_extra_cppflags=
16062
16063 for cf_add_cflags in -g
16064 do
16065 case $cf_fix_cppflags in
16066 no)
16067         case $cf_add_cflags in #(vi
16068         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
16069                 case $cf_add_cflags in
16070                 -D*)
16071                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16072
16073                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16074                                 && test -z "${cf_tst_cflags}" \
16075                                 && cf_fix_cppflags=yes
16076
16077                         if test $cf_fix_cppflags = yes ; then
16078                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16079                                 continue
16080                         elif test "${cf_tst_cflags}" = "\"'" ; then
16081                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16082                                 continue
16083                         fi
16084                         ;;
16085                 esac
16086                 case "$CPPFLAGS" in
16087                 *$cf_add_cflags) #(vi
16088                         ;;
16089                 *) #(vi
16090                         case $cf_add_cflags in #(vi
16091                         -D*)
16092                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16093
16094 CPPFLAGS=`echo "$CPPFLAGS" | \
16095         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16096                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16097
16098                                 ;;
16099                         esac
16100                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16101                         ;;
16102                 esac
16103                 ;;
16104         *)
16105                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16106                 ;;
16107         esac
16108         ;;
16109 yes)
16110         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16111
16112         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16113
16114         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16115                 && test -z "${cf_tst_cflags}" \
16116                 && cf_fix_cppflags=no
16117         ;;
16118 esac
16119 done
16120
16121 if test -n "$cf_new_cflags" ; then
16122
16123         CFLAGS="$CFLAGS $cf_new_cflags"
16124 fi
16125
16126 if test -n "$cf_new_cppflags" ; then
16127
16128         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16129 fi
16130
16131 if test -n "$cf_new_extra_cppflags" ; then
16132
16133         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16134 fi
16135
16136                 ;;
16137         esac
16138         ;;
16139 esac
16140
16141 if test "$with_dmalloc" = yes ; then
16142         echo "$as_me:16142: checking for dmalloc.h" >&5
16143 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
16144 if test "${ac_cv_header_dmalloc_h+set}" = set; then
16145   echo $ECHO_N "(cached) $ECHO_C" >&6
16146 else
16147   cat >conftest.$ac_ext <<_ACEOF
16148 #line 16148 "configure"
16149 #include "confdefs.h"
16150 #include <dmalloc.h>
16151 _ACEOF
16152 if { (eval echo "$as_me:16152: \"$ac_cpp conftest.$ac_ext\"") >&5
16153   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16154   ac_status=$?
16155   egrep -v '^ *\+' conftest.er1 >conftest.err
16156   rm -f conftest.er1
16157   cat conftest.err >&5
16158   echo "$as_me:16158: \$? = $ac_status" >&5
16159   (exit $ac_status); } >/dev/null; then
16160   if test -s conftest.err; then
16161     ac_cpp_err=$ac_c_preproc_warn_flag
16162   else
16163     ac_cpp_err=
16164   fi
16165 else
16166   ac_cpp_err=yes
16167 fi
16168 if test -z "$ac_cpp_err"; then
16169   ac_cv_header_dmalloc_h=yes
16170 else
16171   echo "$as_me: failed program was:" >&5
16172   cat conftest.$ac_ext >&5
16173   ac_cv_header_dmalloc_h=no
16174 fi
16175 rm -f conftest.err conftest.$ac_ext
16176 fi
16177 echo "$as_me:16177: result: $ac_cv_header_dmalloc_h" >&5
16178 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
16179 if test $ac_cv_header_dmalloc_h = yes; then
16180
16181 echo "$as_me:16181: checking for dmalloc_debug in -ldmalloc" >&5
16182 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
16183 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
16184   echo $ECHO_N "(cached) $ECHO_C" >&6
16185 else
16186   ac_check_lib_save_LIBS=$LIBS
16187 LIBS="-ldmalloc  $LIBS"
16188 cat >conftest.$ac_ext <<_ACEOF
16189 #line 16189 "configure"
16190 #include "confdefs.h"
16191
16192 /* Override any gcc2 internal prototype to avoid an error.  */
16193 #ifdef __cplusplus
16194 extern "C"
16195 #endif
16196 /* We use char because int might match the return type of a gcc2
16197    builtin and then its argument prototype would still apply.  */
16198 char dmalloc_debug ();
16199 int
16200 main ()
16201 {
16202 dmalloc_debug ();
16203   ;
16204   return 0;
16205 }
16206 _ACEOF
16207 rm -f conftest.$ac_objext conftest$ac_exeext
16208 if { (eval echo "$as_me:16208: \"$ac_link\"") >&5
16209   (eval $ac_link) 2>&5
16210   ac_status=$?
16211   echo "$as_me:16211: \$? = $ac_status" >&5
16212   (exit $ac_status); } &&
16213          { ac_try='test -s conftest$ac_exeext'
16214   { (eval echo "$as_me:16214: \"$ac_try\"") >&5
16215   (eval $ac_try) 2>&5
16216   ac_status=$?
16217   echo "$as_me:16217: \$? = $ac_status" >&5
16218   (exit $ac_status); }; }; then
16219   ac_cv_lib_dmalloc_dmalloc_debug=yes
16220 else
16221   echo "$as_me: failed program was:" >&5
16222 cat conftest.$ac_ext >&5
16223 ac_cv_lib_dmalloc_dmalloc_debug=no
16224 fi
16225 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16226 LIBS=$ac_check_lib_save_LIBS
16227 fi
16228 echo "$as_me:16228: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
16229 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
16230 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
16231   cat >>confdefs.h <<EOF
16232 #define HAVE_LIBDMALLOC 1
16233 EOF
16234
16235   LIBS="-ldmalloc $LIBS"
16236
16237 fi
16238
16239 fi
16240
16241 fi
16242
16243 echo "$as_me:16243: checking if you want to use dbmalloc for testing" >&5
16244 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
16245
16246 # Check whether --with-dbmalloc or --without-dbmalloc was given.
16247 if test "${with_dbmalloc+set}" = set; then
16248   withval="$with_dbmalloc"
16249
16250 cat >>confdefs.h <<EOF
16251 #define USE_DBMALLOC 1
16252 EOF
16253
16254         : ${with_cflags:=-g}
16255         : ${with_no_leaks:=yes}
16256          with_dbmalloc=yes
16257 else
16258   with_dbmalloc=
16259 fi;
16260 echo "$as_me:16260: result: ${with_dbmalloc:-no}" >&5
16261 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
16262
16263 case .$with_cflags in #(vi
16264 .*-g*)
16265         case .$CFLAGS in #(vi
16266         .*-g*) #(vi
16267                 ;;
16268         *)
16269
16270 cf_fix_cppflags=no
16271 cf_new_cflags=
16272 cf_new_cppflags=
16273 cf_new_extra_cppflags=
16274
16275 for cf_add_cflags in -g
16276 do
16277 case $cf_fix_cppflags in
16278 no)
16279         case $cf_add_cflags in #(vi
16280         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
16281                 case $cf_add_cflags in
16282                 -D*)
16283                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16284
16285                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16286                                 && test -z "${cf_tst_cflags}" \
16287                                 && cf_fix_cppflags=yes
16288
16289                         if test $cf_fix_cppflags = yes ; then
16290                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16291                                 continue
16292                         elif test "${cf_tst_cflags}" = "\"'" ; then
16293                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16294                                 continue
16295                         fi
16296                         ;;
16297                 esac
16298                 case "$CPPFLAGS" in
16299                 *$cf_add_cflags) #(vi
16300                         ;;
16301                 *) #(vi
16302                         case $cf_add_cflags in #(vi
16303                         -D*)
16304                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16305
16306 CPPFLAGS=`echo "$CPPFLAGS" | \
16307         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16308                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16309
16310                                 ;;
16311                         esac
16312                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16313                         ;;
16314                 esac
16315                 ;;
16316         *)
16317                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16318                 ;;
16319         esac
16320         ;;
16321 yes)
16322         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16323
16324         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16325
16326         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16327                 && test -z "${cf_tst_cflags}" \
16328                 && cf_fix_cppflags=no
16329         ;;
16330 esac
16331 done
16332
16333 if test -n "$cf_new_cflags" ; then
16334
16335         CFLAGS="$CFLAGS $cf_new_cflags"
16336 fi
16337
16338 if test -n "$cf_new_cppflags" ; then
16339
16340         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16341 fi
16342
16343 if test -n "$cf_new_extra_cppflags" ; then
16344
16345         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16346 fi
16347
16348                 ;;
16349         esac
16350         ;;
16351 esac
16352
16353 if test "$with_dbmalloc" = yes ; then
16354         echo "$as_me:16354: checking for dbmalloc.h" >&5
16355 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
16356 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
16357   echo $ECHO_N "(cached) $ECHO_C" >&6
16358 else
16359   cat >conftest.$ac_ext <<_ACEOF
16360 #line 16360 "configure"
16361 #include "confdefs.h"
16362 #include <dbmalloc.h>
16363 _ACEOF
16364 if { (eval echo "$as_me:16364: \"$ac_cpp conftest.$ac_ext\"") >&5
16365   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16366   ac_status=$?
16367   egrep -v '^ *\+' conftest.er1 >conftest.err
16368   rm -f conftest.er1
16369   cat conftest.err >&5
16370   echo "$as_me:16370: \$? = $ac_status" >&5
16371   (exit $ac_status); } >/dev/null; then
16372   if test -s conftest.err; then
16373     ac_cpp_err=$ac_c_preproc_warn_flag
16374   else
16375     ac_cpp_err=
16376   fi
16377 else
16378   ac_cpp_err=yes
16379 fi
16380 if test -z "$ac_cpp_err"; then
16381   ac_cv_header_dbmalloc_h=yes
16382 else
16383   echo "$as_me: failed program was:" >&5
16384   cat conftest.$ac_ext >&5
16385   ac_cv_header_dbmalloc_h=no
16386 fi
16387 rm -f conftest.err conftest.$ac_ext
16388 fi
16389 echo "$as_me:16389: result: $ac_cv_header_dbmalloc_h" >&5
16390 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
16391 if test $ac_cv_header_dbmalloc_h = yes; then
16392
16393 echo "$as_me:16393: checking for debug_malloc in -ldbmalloc" >&5
16394 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
16395 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
16396   echo $ECHO_N "(cached) $ECHO_C" >&6
16397 else
16398   ac_check_lib_save_LIBS=$LIBS
16399 LIBS="-ldbmalloc  $LIBS"
16400 cat >conftest.$ac_ext <<_ACEOF
16401 #line 16401 "configure"
16402 #include "confdefs.h"
16403
16404 /* Override any gcc2 internal prototype to avoid an error.  */
16405 #ifdef __cplusplus
16406 extern "C"
16407 #endif
16408 /* We use char because int might match the return type of a gcc2
16409    builtin and then its argument prototype would still apply.  */
16410 char debug_malloc ();
16411 int
16412 main ()
16413 {
16414 debug_malloc ();
16415   ;
16416   return 0;
16417 }
16418 _ACEOF
16419 rm -f conftest.$ac_objext conftest$ac_exeext
16420 if { (eval echo "$as_me:16420: \"$ac_link\"") >&5
16421   (eval $ac_link) 2>&5
16422   ac_status=$?
16423   echo "$as_me:16423: \$? = $ac_status" >&5
16424   (exit $ac_status); } &&
16425          { ac_try='test -s conftest$ac_exeext'
16426   { (eval echo "$as_me:16426: \"$ac_try\"") >&5
16427   (eval $ac_try) 2>&5
16428   ac_status=$?
16429   echo "$as_me:16429: \$? = $ac_status" >&5
16430   (exit $ac_status); }; }; then
16431   ac_cv_lib_dbmalloc_debug_malloc=yes
16432 else
16433   echo "$as_me: failed program was:" >&5
16434 cat conftest.$ac_ext >&5
16435 ac_cv_lib_dbmalloc_debug_malloc=no
16436 fi
16437 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16438 LIBS=$ac_check_lib_save_LIBS
16439 fi
16440 echo "$as_me:16440: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
16441 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
16442 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
16443   cat >>confdefs.h <<EOF
16444 #define HAVE_LIBDBMALLOC 1
16445 EOF
16446
16447   LIBS="-ldbmalloc $LIBS"
16448
16449 fi
16450
16451 fi
16452
16453 fi
16454
16455 echo "$as_me:16455: checking if you want to use valgrind for testing" >&5
16456 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
16457
16458 # Check whether --with-valgrind or --without-valgrind was given.
16459 if test "${with_valgrind+set}" = set; then
16460   withval="$with_valgrind"
16461
16462 cat >>confdefs.h <<EOF
16463 #define USE_VALGRIND 1
16464 EOF
16465
16466         : ${with_cflags:=-g}
16467         : ${with_no_leaks:=yes}
16468          with_valgrind=yes
16469 else
16470   with_valgrind=
16471 fi;
16472 echo "$as_me:16472: result: ${with_valgrind:-no}" >&5
16473 echo "${ECHO_T}${with_valgrind:-no}" >&6
16474
16475 case .$with_cflags in #(vi
16476 .*-g*)
16477         case .$CFLAGS in #(vi
16478         .*-g*) #(vi
16479                 ;;
16480         *)
16481
16482 cf_fix_cppflags=no
16483 cf_new_cflags=
16484 cf_new_cppflags=
16485 cf_new_extra_cppflags=
16486
16487 for cf_add_cflags in -g
16488 do
16489 case $cf_fix_cppflags in
16490 no)
16491         case $cf_add_cflags in #(vi
16492         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
16493                 case $cf_add_cflags in
16494                 -D*)
16495                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16496
16497                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16498                                 && test -z "${cf_tst_cflags}" \
16499                                 && cf_fix_cppflags=yes
16500
16501                         if test $cf_fix_cppflags = yes ; then
16502                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16503                                 continue
16504                         elif test "${cf_tst_cflags}" = "\"'" ; then
16505                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16506                                 continue
16507                         fi
16508                         ;;
16509                 esac
16510                 case "$CPPFLAGS" in
16511                 *$cf_add_cflags) #(vi
16512                         ;;
16513                 *) #(vi
16514                         case $cf_add_cflags in #(vi
16515                         -D*)
16516                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16517
16518 CPPFLAGS=`echo "$CPPFLAGS" | \
16519         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16520                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16521
16522                                 ;;
16523                         esac
16524                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16525                         ;;
16526                 esac
16527                 ;;
16528         *)
16529                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16530                 ;;
16531         esac
16532         ;;
16533 yes)
16534         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16535
16536         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16537
16538         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16539                 && test -z "${cf_tst_cflags}" \
16540                 && cf_fix_cppflags=no
16541         ;;
16542 esac
16543 done
16544
16545 if test -n "$cf_new_cflags" ; then
16546
16547         CFLAGS="$CFLAGS $cf_new_cflags"
16548 fi
16549
16550 if test -n "$cf_new_cppflags" ; then
16551
16552         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16553 fi
16554
16555 if test -n "$cf_new_extra_cppflags" ; then
16556
16557         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16558 fi
16559
16560                 ;;
16561         esac
16562         ;;
16563 esac
16564
16565 echo "$as_me:16565: checking if you want to perform memory-leak testing" >&5
16566 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
16567
16568 # Check whether --enable-leaks or --disable-leaks was given.
16569 if test "${enable_leaks+set}" = set; then
16570   enableval="$enable_leaks"
16571   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
16572 else
16573   : ${with_no_leaks:=no}
16574 fi;
16575 echo "$as_me:16575: result: $with_no_leaks" >&5
16576 echo "${ECHO_T}$with_no_leaks" >&6
16577
16578 if test "$with_no_leaks" = yes ; then
16579
16580 cat >>confdefs.h <<\EOF
16581 #define NO_LEAKS 1
16582 EOF
16583
16584 cat >>confdefs.h <<\EOF
16585 #define YY_NO_LEAKS 1
16586 EOF
16587
16588 fi
16589
16590 LD_RPATH_OPT=
16591 echo "$as_me:16591: checking for an rpath option" >&5
16592 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
16593 case $cf_cv_system_name in #(vi
16594 irix*) #(vi
16595         if test "$GCC" = yes; then
16596                 LD_RPATH_OPT="-Wl,-rpath,"
16597         else
16598                 LD_RPATH_OPT="-rpath "
16599         fi
16600         ;;
16601 linux*|gnu*|k*bsd*-gnu) #(vi
16602         LD_RPATH_OPT="-Wl,-rpath,"
16603         ;;
16604 openbsd[2-9].*|mirbsd*) #(vi
16605         LD_RPATH_OPT="-Wl,-rpath,"
16606         ;;
16607 dragonfly*|freebsd*) #(vi
16608         LD_RPATH_OPT="-rpath "
16609         ;;
16610 netbsd*) #(vi
16611         LD_RPATH_OPT="-Wl,-rpath,"
16612         ;;
16613 osf*|mls+*) #(vi
16614         LD_RPATH_OPT="-rpath "
16615         ;;
16616 solaris2*) #(vi
16617         LD_RPATH_OPT="-R"
16618         ;;
16619 *)
16620         ;;
16621 esac
16622 echo "$as_me:16622: result: $LD_RPATH_OPT" >&5
16623 echo "${ECHO_T}$LD_RPATH_OPT" >&6
16624
16625 case "x$LD_RPATH_OPT" in #(vi
16626 x-R*)
16627         echo "$as_me:16627: checking if we need a space after rpath option" >&5
16628 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
16629         cf_save_LIBS="$LIBS"
16630
16631 cf_add_libs="${LD_RPATH_OPT}$libdir"
16632 # Filter out duplicates - this happens with badly-designed ".pc" files...
16633 for cf_add_1lib in $LIBS
16634 do
16635         for cf_add_2lib in $cf_add_libs
16636         do
16637                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16638                 then
16639                         cf_add_1lib=
16640                         break
16641                 fi
16642         done
16643         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16644 done
16645 LIBS="$cf_add_libs"
16646
16647         cat >conftest.$ac_ext <<_ACEOF
16648 #line 16648 "configure"
16649 #include "confdefs.h"
16650
16651 int
16652 main ()
16653 {
16654
16655   ;
16656   return 0;
16657 }
16658 _ACEOF
16659 rm -f conftest.$ac_objext conftest$ac_exeext
16660 if { (eval echo "$as_me:16660: \"$ac_link\"") >&5
16661   (eval $ac_link) 2>&5
16662   ac_status=$?
16663   echo "$as_me:16663: \$? = $ac_status" >&5
16664   (exit $ac_status); } &&
16665          { ac_try='test -s conftest$ac_exeext'
16666   { (eval echo "$as_me:16666: \"$ac_try\"") >&5
16667   (eval $ac_try) 2>&5
16668   ac_status=$?
16669   echo "$as_me:16669: \$? = $ac_status" >&5
16670   (exit $ac_status); }; }; then
16671   cf_rpath_space=no
16672 else
16673   echo "$as_me: failed program was:" >&5
16674 cat conftest.$ac_ext >&5
16675 cf_rpath_space=yes
16676 fi
16677 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16678         LIBS="$cf_save_LIBS"
16679         echo "$as_me:16679: result: $cf_rpath_space" >&5
16680 echo "${ECHO_T}$cf_rpath_space" >&6
16681         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
16682         ;;
16683 esac
16684
16685 echo "$as_me:16685: checking if rpath-hack should be disabled" >&5
16686 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
16687
16688 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
16689 if test "${enable_rpath_hack+set}" = set; then
16690   enableval="$enable_rpath_hack"
16691   test "$enableval" != no && enableval=yes
16692   if test "$enableval" != "yes" ; then
16693     cf_disable_rpath_hack=yes
16694   else
16695     cf_disable_rpath_hack=no
16696   fi
16697 else
16698   enableval=yes
16699   cf_disable_rpath_hack=no
16700
16701 fi;
16702 echo "$as_me:16702: result: $cf_disable_rpath_hack" >&5
16703 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
16704 if test "$cf_disable_rpath_hack" = no ; then
16705
16706 echo "$as_me:16706: checking for updated LDFLAGS" >&5
16707 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
16708 if test -n "$LD_RPATH_OPT" ; then
16709         echo "$as_me:16709: result: maybe" >&5
16710 echo "${ECHO_T}maybe" >&6
16711
16712         for ac_prog in ldd
16713 do
16714   # Extract the first word of "$ac_prog", so it can be a program name with args.
16715 set dummy $ac_prog; ac_word=$2
16716 echo "$as_me:16716: checking for $ac_word" >&5
16717 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16718 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
16719   echo $ECHO_N "(cached) $ECHO_C" >&6
16720 else
16721   if test -n "$cf_ldd_prog"; then
16722   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
16723 else
16724   ac_save_IFS=$IFS; IFS=$ac_path_separator
16725 ac_dummy="$PATH"
16726 for ac_dir in $ac_dummy; do
16727   IFS=$ac_save_IFS
16728   test -z "$ac_dir" && ac_dir=.
16729   $as_executable_p "$ac_dir/$ac_word" || continue
16730 ac_cv_prog_cf_ldd_prog="$ac_prog"
16731 echo "$as_me:16731: found $ac_dir/$ac_word" >&5
16732 break
16733 done
16734
16735 fi
16736 fi
16737 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
16738 if test -n "$cf_ldd_prog"; then
16739   echo "$as_me:16739: result: $cf_ldd_prog" >&5
16740 echo "${ECHO_T}$cf_ldd_prog" >&6
16741 else
16742   echo "$as_me:16742: result: no" >&5
16743 echo "${ECHO_T}no" >&6
16744 fi
16745
16746   test -n "$cf_ldd_prog" && break
16747 done
16748 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
16749
16750         cf_rpath_list="/usr/lib /lib"
16751         if test "$cf_ldd_prog" != no
16752         then
16753                 cf_rpath_oops=
16754
16755 cat >conftest.$ac_ext <<_ACEOF
16756 #line 16756 "configure"
16757 #include "confdefs.h"
16758 #include <stdio.h>
16759 int
16760 main ()
16761 {
16762 printf("Hello");
16763   ;
16764   return 0;
16765 }
16766 _ACEOF
16767 rm -f conftest.$ac_objext conftest$ac_exeext
16768 if { (eval echo "$as_me:16768: \"$ac_link\"") >&5
16769   (eval $ac_link) 2>&5
16770   ac_status=$?
16771   echo "$as_me:16771: \$? = $ac_status" >&5
16772   (exit $ac_status); } &&
16773          { ac_try='test -s conftest$ac_exeext'
16774   { (eval echo "$as_me:16774: \"$ac_try\"") >&5
16775   (eval $ac_try) 2>&5
16776   ac_status=$?
16777   echo "$as_me:16777: \$? = $ac_status" >&5
16778   (exit $ac_status); }; }; then
16779   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
16780                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
16781 else
16782   echo "$as_me: failed program was:" >&5
16783 cat conftest.$ac_ext >&5
16784 fi
16785 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16786
16787                 # If we passed the link-test, but get a "not found" on a given library,
16788                 # this could be due to inept reconfiguration of gcc to make it only
16789                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
16790                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
16791                 # /usr/local libraries.
16792                 if test -n "$cf_rpath_oops"
16793                 then
16794                         for cf_rpath_src in $cf_rpath_oops
16795                         do
16796                                 for cf_rpath_dir in \
16797                                         /usr/local \
16798                                         /usr/pkg \
16799                                         /opt/sfw
16800                                 do
16801                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
16802                                         then
16803                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
16804
16805 echo "${as_me:-configure}:16805: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
16806
16807                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
16808                                                 break
16809                                         fi
16810                                 done
16811                         done
16812                 fi
16813         fi
16814
16815         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16816
16817 echo "${as_me:-configure}:16817: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16818
16819 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
16820
16821 echo "${as_me:-configure}:16821: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
16822
16823 cf_rpath_dst=
16824 for cf_rpath_src in $LDFLAGS
16825 do
16826         case $cf_rpath_src in #(vi
16827         -L*) #(vi
16828
16829                 # check if this refers to a directory which we will ignore
16830                 cf_rpath_skip=no
16831                 if test -n "$cf_rpath_list"
16832                 then
16833                         for cf_rpath_item in $cf_rpath_list
16834                         do
16835                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16836                                 then
16837                                         cf_rpath_skip=yes
16838                                         break
16839                                 fi
16840                         done
16841                 fi
16842
16843                 if test "$cf_rpath_skip" = no
16844                 then
16845                         # transform the option
16846                         if test "$LD_RPATH_OPT" = "-R " ; then
16847                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16848                         else
16849                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16850                         fi
16851
16852                         # if we have not already added this, add it now
16853                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16854                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16855                         then
16856                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16857
16858 echo "${as_me:-configure}:16858: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16859
16860                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16861                         fi
16862                 fi
16863                 ;;
16864         esac
16865         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16866 done
16867 LDFLAGS=$cf_rpath_dst
16868
16869 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
16870
16871 echo "${as_me:-configure}:16871: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
16872
16873 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
16874
16875 echo "${as_me:-configure}:16875: testing ...checking LIBS $LIBS ..." 1>&5
16876
16877 cf_rpath_dst=
16878 for cf_rpath_src in $LIBS
16879 do
16880         case $cf_rpath_src in #(vi
16881         -L*) #(vi
16882
16883                 # check if this refers to a directory which we will ignore
16884                 cf_rpath_skip=no
16885                 if test -n "$cf_rpath_list"
16886                 then
16887                         for cf_rpath_item in $cf_rpath_list
16888                         do
16889                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16890                                 then
16891                                         cf_rpath_skip=yes
16892                                         break
16893                                 fi
16894                         done
16895                 fi
16896
16897                 if test "$cf_rpath_skip" = no
16898                 then
16899                         # transform the option
16900                         if test "$LD_RPATH_OPT" = "-R " ; then
16901                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16902                         else
16903                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16904                         fi
16905
16906                         # if we have not already added this, add it now
16907                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16908                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16909                         then
16910                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16911
16912 echo "${as_me:-configure}:16912: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16913
16914                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16915                         fi
16916                 fi
16917                 ;;
16918         esac
16919         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16920 done
16921 LIBS=$cf_rpath_dst
16922
16923 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
16924
16925 echo "${as_me:-configure}:16925: testing ...checked LIBS $LIBS ..." 1>&5
16926
16927         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16928
16929 echo "${as_me:-configure}:16929: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16930
16931 else
16932         echo "$as_me:16932: result: no" >&5
16933 echo "${ECHO_T}no" >&6
16934 fi
16935
16936 fi
16937
16938 TEST_ARGS="$LIBS"
16939 LIBS=
16940
16941 ac_config_files="$ac_config_files Makefile"
16942 ac_config_commands="$ac_config_commands default"
16943 cat >confcache <<\_ACEOF
16944 # This file is a shell script that caches the results of configure
16945 # tests run on this system so they can be shared between configure
16946 # scripts and configure runs, see configure's option --config-cache.
16947 # It is not useful on other systems.  If it contains results you don't
16948 # want to keep, you may remove or edit it.
16949 #
16950 # config.status only pays attention to the cache file if you give it
16951 # the --recheck option to rerun configure.
16952 #
16953 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16954 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16955 # following values.
16956
16957 _ACEOF
16958
16959 # The following way of writing the cache mishandles newlines in values,
16960 # but we know of no workaround that is simple, portable, and efficient.
16961 # So, don't put newlines in cache variables' values.
16962 # Ultrix sh set writes to stderr and can't be redirected directly,
16963 # and sets the high bit in the cache file unless we assign to the vars.
16964 {
16965   (set) 2>&1 |
16966     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16967     *ac_space=\ *)
16968       # `set' does not quote correctly, so add quotes (double-quote
16969       # substitution turns \\\\ into \\, and sed turns \\ into \).
16970       sed -n \
16971         "s/'/'\\\\''/g;
16972           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16973       ;;
16974     *)
16975       # `set' quotes correctly as required by POSIX, so do not add quotes.
16976       sed -n \
16977         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16978       ;;
16979     esac;
16980 } |
16981   sed '
16982      t clear
16983      : clear
16984      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16985      t end
16986      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16987      : end' >>confcache
16988 if cmp -s $cache_file confcache; then :; else
16989   if test -w $cache_file; then
16990     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16991     cat confcache >$cache_file
16992   else
16993     echo "not updating unwritable cache $cache_file"
16994   fi
16995 fi
16996 rm -f confcache
16997
16998 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16999 # Let make expand exec_prefix.
17000 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17001
17002 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17003 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17004 # trailing colons and then remove the whole line if VPATH becomes empty
17005 # (actually we leave an empty line to preserve line numbers).
17006 if test "x$srcdir" = x.; then
17007   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17008 s/:*\$(srcdir):*/:/;
17009 s/:*\${srcdir}:*/:/;
17010 s/:*@srcdir@:*/:/;
17011 s/^\([^=]*=[    ]*\):*/\1/;
17012 s/:*$//;
17013 s/^[^=]*=[      ]*$//;
17014 }'
17015 fi
17016
17017 DEFS=-DHAVE_CONFIG_H
17018
17019 : ${CONFIG_STATUS=./config.status}
17020 ac_clean_files_save=$ac_clean_files
17021 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17022 { echo "$as_me:17022: creating $CONFIG_STATUS" >&5
17023 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17024 cat >$CONFIG_STATUS <<_ACEOF
17025 #! $SHELL
17026 # Generated automatically by configure.
17027 # Run this file to recreate the current configuration.
17028 # Compiler output produced by configure, useful for debugging
17029 # configure, is in config.log if it exists.
17030
17031 debug=false
17032 SHELL=\${CONFIG_SHELL-$SHELL}
17033 ac_cs_invocation="\$0 \$@"
17034
17035 _ACEOF
17036
17037 cat >>$CONFIG_STATUS <<\_ACEOF
17038 # Be Bourne compatible
17039 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17040   emulate sh
17041   NULLCMD=:
17042 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17043   set -o posix
17044 fi
17045
17046 # Name of the executable.
17047 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17048
17049 if expr a : '\(a\)' >/dev/null 2>&1; then
17050   as_expr=expr
17051 else
17052   as_expr=false
17053 fi
17054
17055 rm -f conf$$ conf$$.exe conf$$.file
17056 echo >conf$$.file
17057 if ln -s conf$$.file conf$$ 2>/dev/null; then
17058   # We could just check for DJGPP; but this test a) works b) is more generic
17059   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17060   if test -f conf$$.exe; then
17061     # Don't use ln at all; we don't have any links
17062     as_ln_s='cp -p'
17063   else
17064     as_ln_s='ln -s'
17065   fi
17066 elif ln conf$$.file conf$$ 2>/dev/null; then
17067   as_ln_s=ln
17068 else
17069   as_ln_s='cp -p'
17070 fi
17071 rm -f conf$$ conf$$.exe conf$$.file
17072
17073 as_executable_p="test -f"
17074
17075 # Support unset when possible.
17076 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17077   as_unset=unset
17078 else
17079   as_unset=false
17080 fi
17081
17082 # NLS nuisances.
17083 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17084 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17085 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17086 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17087 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17088 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17089 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17090 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17091
17092 # IFS
17093 # We need space, tab and new line, in precisely that order.
17094 as_nl='
17095 '
17096 IFS="   $as_nl"
17097
17098 # CDPATH.
17099 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17100
17101 exec 6>&1
17102
17103 _ACEOF
17104
17105 # Files that config.status was made for.
17106 if test -n "$ac_config_files"; then
17107   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
17108 fi
17109
17110 if test -n "$ac_config_headers"; then
17111   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
17112 fi
17113
17114 if test -n "$ac_config_links"; then
17115   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
17116 fi
17117
17118 if test -n "$ac_config_commands"; then
17119   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
17120 fi
17121
17122 cat >>$CONFIG_STATUS <<\EOF
17123
17124 ac_cs_usage="\
17125 \`$as_me' instantiates files from templates according to the
17126 current configuration.
17127
17128 Usage: $0 [OPTIONS] [FILE]...
17129
17130   -h, --help       print this help, then exit
17131   -V, --version    print version number, then exit
17132   -d, --debug      don't remove temporary files
17133       --recheck    update $as_me by reconfiguring in the same conditions
17134   --file=FILE[:TEMPLATE]
17135                    instantiate the configuration file FILE
17136   --header=FILE[:TEMPLATE]
17137                    instantiate the configuration header FILE
17138
17139 Configuration files:
17140 $config_files
17141
17142 Configuration headers:
17143 $config_headers
17144
17145 Configuration commands:
17146 $config_commands
17147
17148 Report bugs to <dickey@invisible-island.net>."
17149 EOF
17150
17151 cat >>$CONFIG_STATUS <<EOF
17152 ac_cs_version="\\
17153 config.status
17154 configured by $0, generated by GNU Autoconf 2.52.20141204,
17155   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17156
17157 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17158 Free Software Foundation, Inc.
17159 This config.status script is free software; the Free Software Foundation
17160 gives unlimited permission to copy, distribute and modify it."
17161 srcdir=$srcdir
17162 INSTALL="$INSTALL"
17163 EOF
17164
17165 cat >>$CONFIG_STATUS <<\EOF
17166 # If no file are specified by the user, then we need to provide default
17167 # value.  By we need to know if files were specified by the user.
17168 ac_need_defaults=:
17169 while test $# != 0
17170 do
17171   case $1 in
17172   --*=*)
17173     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17174     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17175     shift
17176     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17177     shift
17178     ;;
17179   -*);;
17180   *) # This is not an option, so the user has probably given explicit
17181      # arguments.
17182      ac_need_defaults=false;;
17183   esac
17184
17185   case $1 in
17186   # Handling of the options.
17187 EOF
17188 cat >>$CONFIG_STATUS <<EOF
17189   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17190     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
17191     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
17192 EOF
17193 cat >>$CONFIG_STATUS <<\EOF
17194   --version | --vers* | -V )
17195     echo "$ac_cs_version"; exit 0 ;;
17196   --he | --h)
17197     # Conflict between --help and --header
17198     { { echo "$as_me:17198: error: ambiguous option: $1
17199 Try \`$0 --help' for more information." >&5
17200 echo "$as_me: error: ambiguous option: $1
17201 Try \`$0 --help' for more information." >&2;}
17202    { (exit 1); exit 1; }; };;
17203   --help | --hel | -h )
17204     echo "$ac_cs_usage"; exit 0 ;;
17205   --debug | --d* | -d )
17206     debug=: ;;
17207   --file | --fil | --fi | --f )
17208     shift
17209     CONFIG_FILES="$CONFIG_FILES $1"
17210     ac_need_defaults=false;;
17211   --header | --heade | --head | --hea )
17212     shift
17213     CONFIG_HEADERS="$CONFIG_HEADERS $1"
17214     ac_need_defaults=false;;
17215
17216   # This is an error.
17217   -*) { { echo "$as_me:17217: error: unrecognized option: $1
17218 Try \`$0 --help' for more information." >&5
17219 echo "$as_me: error: unrecognized option: $1
17220 Try \`$0 --help' for more information." >&2;}
17221    { (exit 1); exit 1; }; } ;;
17222
17223   *) ac_config_targets="$ac_config_targets $1" ;;
17224
17225   esac
17226   shift
17227 done
17228
17229 exec 5>>config.log
17230 cat >&5 << _ACEOF
17231
17232 ## ----------------------- ##
17233 ## Running config.status.  ##
17234 ## ----------------------- ##
17235
17236 This file was extended by $as_me 2.52.20141204, executed with
17237   CONFIG_FILES    = $CONFIG_FILES
17238   CONFIG_HEADERS  = $CONFIG_HEADERS
17239   CONFIG_LINKS    = $CONFIG_LINKS
17240   CONFIG_COMMANDS = $CONFIG_COMMANDS
17241   > $ac_cs_invocation
17242 on `(hostname || uname -n) 2>/dev/null | sed 1q`
17243
17244 _ACEOF
17245 EOF
17246
17247 cat >>$CONFIG_STATUS <<EOF
17248 #
17249 # INIT-COMMANDS section.
17250 #
17251
17252 AWK="$AWK"
17253 ECHO_CC="$ECHO_CC"
17254 ECHO_LD="$ECHO_LD"
17255 SHOW_CC="$SHOW_LD"
17256
17257 EOF
17258
17259 cat >>$CONFIG_STATUS <<\EOF
17260 for ac_config_target in $ac_config_targets
17261 do
17262   case "$ac_config_target" in
17263   # Handling of arguments.
17264   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
17265   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
17266   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
17267   *) { { echo "$as_me:17267: error: invalid argument: $ac_config_target" >&5
17268 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
17269    { (exit 1); exit 1; }; };;
17270   esac
17271 done
17272
17273 # If the user did not use the arguments to specify the items to instantiate,
17274 # then the envvar interface is used.  Set only those that are not.
17275 # We use the long form for the default assignment because of an extremely
17276 # bizarre bug on SunOS 4.1.3.
17277 if $ac_need_defaults; then
17278   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
17279   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
17280   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
17281 fi
17282
17283 # Create a temporary directory, and hook for its removal unless debugging.
17284 $debug ||
17285 {
17286   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
17287   trap '{ (exit 1); exit 1; }' 1 2 13 15
17288 }
17289
17290 # Create a (secure) tmp directory for tmp files.
17291 : ${TMPDIR=/tmp}
17292 {
17293   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
17294   test -n "$tmp" && test -d "$tmp"
17295 }  ||
17296 {
17297   tmp=$TMPDIR/cs$$-$RANDOM
17298   (umask 077 && mkdir $tmp)
17299 } ||
17300 {
17301    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
17302    { (exit 1); exit 1; }
17303 }
17304
17305 EOF
17306
17307 cat >>$CONFIG_STATUS <<EOF
17308
17309 #
17310 # CONFIG_FILES section.
17311 #
17312
17313 # No need to generate the scripts if there are no CONFIG_FILES.
17314 # This happens for instance when ./config.status config.h
17315 if test -n "\$CONFIG_FILES"; then
17316   # Protect against being on the right side of a sed subst in config.status.
17317   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
17318    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
17319 s,@SHELL@,$SHELL,;t t
17320 s,@exec_prefix@,$exec_prefix,;t t
17321 s,@prefix@,$prefix,;t t
17322 s,@program_transform_name@,$program_transform_name,;t t
17323 s,@bindir@,$bindir,;t t
17324 s,@sbindir@,$sbindir,;t t
17325 s,@libexecdir@,$libexecdir,;t t
17326 s,@datarootdir@,$datarootdir,;t t
17327 s,@datadir@,$datadir,;t t
17328 s,@sysconfdir@,$sysconfdir,;t t
17329 s,@sharedstatedir@,$sharedstatedir,;t t
17330 s,@localstatedir@,$localstatedir,;t t
17331 s,@libdir@,$libdir,;t t
17332 s,@includedir@,$includedir,;t t
17333 s,@oldincludedir@,$oldincludedir,;t t
17334 s,@infodir@,$infodir,;t t
17335 s,@mandir@,$mandir,;t t
17336 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
17337 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
17338 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
17339 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
17340 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
17341 s,@build_alias@,$build_alias,;t t
17342 s,@host_alias@,$host_alias,;t t
17343 s,@target_alias@,$target_alias,;t t
17344 s,@ECHO_C@,$ECHO_C,;t t
17345 s,@ECHO_N@,$ECHO_N,;t t
17346 s,@ECHO_T@,$ECHO_T,;t t
17347 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
17348 s,@DEFS@,$DEFS,;t t
17349 s,@LIBS@,$LIBS,;t t
17350 s,@build@,$build,;t t
17351 s,@build_cpu@,$build_cpu,;t t
17352 s,@build_vendor@,$build_vendor,;t t
17353 s,@build_os@,$build_os,;t t
17354 s,@host@,$host,;t t
17355 s,@host_cpu@,$host_cpu,;t t
17356 s,@host_vendor@,$host_vendor,;t t
17357 s,@host_os@,$host_os,;t t
17358 s,@SET_MAKE@,$SET_MAKE,;t t
17359 s,@CC@,$CC,;t t
17360 s,@CFLAGS@,$CFLAGS,;t t
17361 s,@LDFLAGS@,$LDFLAGS,;t t
17362 s,@CPPFLAGS@,$CPPFLAGS,;t t
17363 s,@ac_ct_CC@,$ac_ct_CC,;t t
17364 s,@EXEEXT@,$EXEEXT,;t t
17365 s,@OBJEXT@,$OBJEXT,;t t
17366 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
17367 s,@CPP@,$CPP,;t t
17368 s,@AWK@,$AWK,;t t
17369 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
17370 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
17371 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
17372 s,@LINT@,$LINT,;t t
17373 s,@LINT_OPTS@,$LINT_OPTS,;t t
17374 s,@CTAGS@,$CTAGS,;t t
17375 s,@ETAGS@,$ETAGS,;t t
17376 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
17377 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
17378 s,@MATH_LIB@,$MATH_LIB,;t t
17379 s,@top_builddir@,$top_builddir,;t t
17380 s,@CC_G_OPT@,$CC_G_OPT,;t t
17381 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
17382 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
17383 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
17384 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
17385 s,@LD@,$LD,;t t
17386 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
17387 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
17388 s,@LD_MODEL@,$LD_MODEL,;t t
17389 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
17390 s,@LIBTOOL@,$LIBTOOL,;t t
17391 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
17392 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
17393 s,@LIB_LINK@,$LIB_LINK,;t t
17394 s,@LINK_TESTS@,$LINK_TESTS,;t t
17395 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
17396 s,@PTHREAD@,$PTHREAD,;t t
17397 s,@TEST_ARGS@,$TEST_ARGS,;t t
17398 s,@TEST_DEPS@,$TEST_DEPS,;t t
17399 s,@TEST_LIBS@,$TEST_LIBS,;t t
17400 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
17401 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
17402 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
17403 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
17404 s,@includesubdir@,$includesubdir,;t t
17405 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
17406 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
17407 s,@ECHO_LT@,$ECHO_LT,;t t
17408 s,@ECHO_LD@,$ECHO_LD,;t t
17409 s,@RULE_CC@,$RULE_CC,;t t
17410 s,@SHOW_CC@,$SHOW_CC,;t t
17411 s,@ECHO_CC@,$ECHO_CC,;t t
17412 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
17413 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
17414 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
17415 s,@X_CFLAGS@,$X_CFLAGS,;t t
17416 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
17417 s,@X_LIBS@,$X_LIBS,;t t
17418 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
17419 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
17420 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
17421 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
17422 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
17423 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
17424 CEOF
17425
17426 EOF
17427
17428   cat >>$CONFIG_STATUS <<\EOF
17429   # Split the substitutions into bite-sized pieces for seds with
17430   # small command number limits, like on Digital OSF/1 and HP-UX.
17431   ac_max_sed_lines=48
17432   ac_sed_frag=1 # Number of current file.
17433   ac_beg=1 # First line for current file.
17434   ac_end=$ac_max_sed_lines # Line after last line for current file.
17435   ac_more_lines=:
17436   ac_sed_cmds=
17437   while $ac_more_lines; do
17438     if test $ac_beg -gt 1; then
17439       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17440     else
17441       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17442     fi
17443     if test ! -s $tmp/subs.frag; then
17444       ac_more_lines=false
17445     else
17446       # The purpose of the label and of the branching condition is to
17447       # speed up the sed processing (if there are no `@' at all, there
17448       # is no need to browse any of the substitutions).
17449       # These are the two extra sed commands mentioned above.
17450       (echo ':t
17451   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
17452       if test -z "$ac_sed_cmds"; then
17453         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
17454       else
17455         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
17456       fi
17457       ac_sed_frag=`expr $ac_sed_frag + 1`
17458       ac_beg=$ac_end
17459       ac_end=`expr $ac_end + $ac_max_sed_lines`
17460     fi
17461   done
17462   if test -z "$ac_sed_cmds"; then
17463     ac_sed_cmds=cat
17464   fi
17465 fi # test -n "$CONFIG_FILES"
17466
17467 EOF
17468 cat >>$CONFIG_STATUS <<\EOF
17469 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
17470   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17471   case $ac_file in
17472   - | *:- | *:-:* ) # input from stdin
17473         cat >$tmp/stdin
17474         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17475         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17476   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17477         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17478   * )   ac_file_in=$ac_file.in ;;
17479   esac
17480
17481   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
17482   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17483          X"$ac_file" : 'X\(//\)[^/]' \| \
17484          X"$ac_file" : 'X\(//\)$' \| \
17485          X"$ac_file" : 'X\(/\)' \| \
17486          .     : '\(.\)' 2>/dev/null ||
17487 echo X"$ac_file" |
17488     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17489           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17490           /^X\(\/\/\)$/{ s//\1/; q; }
17491           /^X\(\/\).*/{ s//\1/; q; }
17492           s/.*/./; q'`
17493   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17494     { case "$ac_dir" in
17495   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17496   *)                      as_incr_dir=.;;
17497 esac
17498 as_dummy="$ac_dir"
17499 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17500   case $as_mkdir_dir in
17501     # Skip DOS drivespec
17502     ?:) as_incr_dir=$as_mkdir_dir ;;
17503     *)
17504       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17505       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17506     ;;
17507   esac
17508 done; }
17509
17510     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
17511     # A "../" for each directory in $ac_dir_suffix.
17512     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
17513   else
17514     ac_dir_suffix= ac_dots=
17515   fi
17516
17517   case $srcdir in
17518   .)  ac_srcdir=.
17519       if test -z "$ac_dots"; then
17520          ac_top_srcdir=.
17521       else
17522          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
17523       fi ;;
17524   [\\/]* | ?:[\\/]* )
17525       ac_srcdir=$srcdir$ac_dir_suffix;
17526       ac_top_srcdir=$srcdir ;;
17527   *) # Relative path.
17528     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
17529     ac_top_srcdir=$ac_dots$srcdir ;;
17530   esac
17531
17532   case $INSTALL in
17533   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
17534   *) ac_INSTALL=$ac_dots$INSTALL ;;
17535   esac
17536
17537   if test x"$ac_file" != x-; then
17538     { echo "$as_me:17538: creating $ac_file" >&5
17539 echo "$as_me: creating $ac_file" >&6;}
17540     rm -f "$ac_file"
17541   fi
17542   # Let's still pretend it is `configure' which instantiates (i.e., don't
17543   # use $as_me), people would be surprised to read:
17544   #    /* config.h.  Generated automatically by config.status.  */
17545   configure_input="Generated automatically from `echo $ac_file_in |
17546                                                  sed 's,.*/,,'` by configure."
17547
17548   # First look for the input files in the build tree, otherwise in the
17549   # src tree.
17550   ac_file_inputs=`IFS=:
17551     for f in $ac_file_in; do
17552       case $f in
17553       -) echo $tmp/stdin ;;
17554       [\\/$]*)
17555          # Absolute (can't be DOS-style, as IFS=:)
17556          test -f "$f" || { { echo "$as_me:17556: error: cannot find input file: $f" >&5
17557 echo "$as_me: error: cannot find input file: $f" >&2;}
17558    { (exit 1); exit 1; }; }
17559          echo $f;;
17560       *) # Relative
17561          if test -f "$f"; then
17562            # Build tree
17563            echo $f
17564          elif test -f "$srcdir/$f"; then
17565            # Source tree
17566            echo $srcdir/$f
17567          else
17568            # /dev/null tree
17569            { { echo "$as_me:17569: error: cannot find input file: $f" >&5
17570 echo "$as_me: error: cannot find input file: $f" >&2;}
17571    { (exit 1); exit 1; }; }
17572          fi;;
17573       esac
17574     done` || { (exit 1); exit 1; }
17575 EOF
17576 cat >>$CONFIG_STATUS <<\EOF
17577   ac_warn_datarootdir=no
17578   if test x"$ac_file" != x-; then
17579     for ac_item in $ac_file_inputs
17580     do
17581       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
17582       if test -n "$ac_seen"; then
17583         ac_used=`grep '@datarootdir@' $ac_item`
17584         if test -z "$ac_used"; then
17585           { echo "$as_me:17585: WARNING: datarootdir was used implicitly but not set:
17586 $ac_seen" >&5
17587 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
17588 $ac_seen" >&2;}
17589           ac_warn_datarootdir=yes
17590         fi
17591       fi
17592       ac_seen=`grep '${datarootdir}' $ac_item`
17593       if test -n "$ac_seen"; then
17594         { echo "$as_me:17594: WARNING: datarootdir was used explicitly but not set:
17595 $ac_seen" >&5
17596 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
17597 $ac_seen" >&2;}
17598         ac_warn_datarootdir=yes
17599       fi
17600     done
17601   fi
17602
17603 if test "x$ac_warn_datarootdir" = xyes; then
17604   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
17605 fi
17606
17607 EOF
17608 cat >>$CONFIG_STATUS <<EOF
17609   sed "$ac_vpsub
17610 $extrasub
17611 EOF
17612 cat >>$CONFIG_STATUS <<\EOF
17613 :t
17614 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17615 s,@configure_input@,$configure_input,;t t
17616 s,@srcdir@,$ac_srcdir,;t t
17617 s,@top_srcdir@,$ac_top_srcdir,;t t
17618 s,@INSTALL@,$ac_INSTALL,;t t
17619 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
17620   rm -f $tmp/stdin
17621   if test x"$ac_file" != x-; then
17622     cp $tmp/out $ac_file
17623
17624     for ac_name in prefix exec_prefix datarootdir
17625     do
17626         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
17627         if test -n "$ac_seen"; then
17628             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
17629             if test -z "$ac_init"; then
17630               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
17631               { echo "$as_me:17631: WARNING: Variable $ac_name is used but was not set:
17632 $ac_seen" >&5
17633 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
17634 $ac_seen" >&2;}
17635             fi
17636         fi
17637     done
17638     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
17639     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
17640     if test -s $tmp/out; then
17641       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
17642       { echo "$as_me:17642: WARNING: Some variables may not be substituted:
17643 $ac_seen" >&5
17644 echo "$as_me: WARNING: Some variables may not be substituted:
17645 $ac_seen" >&2;}
17646     fi
17647   else
17648     cat $tmp/out
17649   fi
17650   rm -f $tmp/out
17651
17652 done
17653 EOF
17654 cat >>$CONFIG_STATUS <<\EOF
17655
17656 #
17657 # CONFIG_HEADER section.
17658 #
17659
17660 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17661 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17662 #
17663 # ac_d sets the value in "#define NAME VALUE" lines.
17664 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17665 ac_dB='[        ].*$,\1#\2'
17666 ac_dC=' '
17667 ac_dD=',;t'
17668 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17669 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17670 ac_iB='\([      ]\),\1#\2define\3'
17671 ac_iC=' '
17672 ac_iD='\4,;t'
17673 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17674 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17675 ac_uB='$,\1#\2define\3'
17676 ac_uC=' '
17677 ac_uD=',;t'
17678
17679 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
17680   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17681   case $ac_file in
17682   - | *:- | *:-:* ) # input from stdin
17683         cat >$tmp/stdin
17684         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17685         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17686   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17687         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17688   * )   ac_file_in=$ac_file.in ;;
17689   esac
17690
17691   test x"$ac_file" != x- && { echo "$as_me:17691: creating $ac_file" >&5
17692 echo "$as_me: creating $ac_file" >&6;}
17693
17694   # First look for the input files in the build tree, otherwise in the
17695   # src tree.
17696   ac_file_inputs=`IFS=:
17697     for f in $ac_file_in; do
17698       case $f in
17699       -) echo $tmp/stdin ;;
17700       [\\/$]*)
17701          # Absolute (can't be DOS-style, as IFS=:)
17702          test -f "$f" || { { echo "$as_me:17702: error: cannot find input file: $f" >&5
17703 echo "$as_me: error: cannot find input file: $f" >&2;}
17704    { (exit 1); exit 1; }; }
17705          echo $f;;
17706       *) # Relative
17707          if test -f "$f"; then
17708            # Build tree
17709            echo $f
17710          elif test -f "$srcdir/$f"; then
17711            # Source tree
17712            echo $srcdir/$f
17713          else
17714            # /dev/null tree
17715            { { echo "$as_me:17715: error: cannot find input file: $f" >&5
17716 echo "$as_me: error: cannot find input file: $f" >&2;}
17717    { (exit 1); exit 1; }; }
17718          fi;;
17719       esac
17720     done` || { (exit 1); exit 1; }
17721   # Remove the trailing spaces.
17722   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
17723
17724 EOF
17725
17726 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
17727 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
17728 # be either 'cat' or 'sort'.
17729 cat confdefs.h | uniq >conftest.vals
17730
17731 # Break up conftest.vals because some shells have a limit on
17732 # the size of here documents, and old seds have small limits too.
17733
17734 rm -f conftest.tail
17735 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
17736 while grep . conftest.vals >/dev/null
17737 do
17738   # Write chunks of a limited-size here document to conftest.frag.
17739   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
17740   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
17741   echo 'CEOF' >> $CONFIG_STATUS
17742   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17743   rm -f conftest.vals
17744   mv conftest.tail conftest.vals
17745 done
17746 rm -f conftest.vals
17747
17748 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
17749 # marker @DEFS@.
17750 echo '  cat >> conftest.edit <<CEOF
17751 /@DEFS@/r conftest.frag
17752 /@DEFS@/d
17753 CEOF
17754 sed -f conftest.edit $tmp/in > $tmp/out
17755 rm -f $tmp/in
17756 mv $tmp/out $tmp/in
17757 rm -f conftest.edit conftest.frag
17758 ' >> $CONFIG_STATUS
17759
17760 cat >>$CONFIG_STATUS <<\EOF
17761   # Let's still pretend it is `configure' which instantiates (i.e., don't
17762   # use $as_me), people would be surprised to read:
17763   #    /* config.h.  Generated automatically by config.status.  */
17764   if test x"$ac_file" = x-; then
17765     echo "/* Generated automatically by configure.  */" >$tmp/config.h
17766   else
17767     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
17768   fi
17769   cat $tmp/in >>$tmp/config.h
17770   rm -f $tmp/in
17771   if test x"$ac_file" != x-; then
17772     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
17773       { echo "$as_me:17773: $ac_file is unchanged" >&5
17774 echo "$as_me: $ac_file is unchanged" >&6;}
17775     else
17776       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17777          X"$ac_file" : 'X\(//\)[^/]' \| \
17778          X"$ac_file" : 'X\(//\)$' \| \
17779          X"$ac_file" : 'X\(/\)' \| \
17780          .     : '\(.\)' 2>/dev/null ||
17781 echo X"$ac_file" |
17782     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17783           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17784           /^X\(\/\/\)$/{ s//\1/; q; }
17785           /^X\(\/\).*/{ s//\1/; q; }
17786           s/.*/./; q'`
17787       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17788         { case "$ac_dir" in
17789   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17790   *)                      as_incr_dir=.;;
17791 esac
17792 as_dummy="$ac_dir"
17793 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17794   case $as_mkdir_dir in
17795     # Skip DOS drivespec
17796     ?:) as_incr_dir=$as_mkdir_dir ;;
17797     *)
17798       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17799       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17800     ;;
17801   esac
17802 done; }
17803
17804       fi
17805       rm -f $ac_file
17806       mv $tmp/config.h $ac_file
17807     fi
17808   else
17809     cat $tmp/config.h
17810     rm -f $tmp/config.h
17811   fi
17812 done
17813 EOF
17814 cat >>$CONFIG_STATUS <<\EOF
17815 #
17816 # CONFIG_COMMANDS section.
17817 #
17818 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17819   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17820   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17821
17822   case $ac_dest in
17823     default )
17824
17825 for cf_dir in .
17826 do
17827         if test ! -d $srcdir/$cf_dir; then
17828                 continue
17829         elif test -f $srcdir/$cf_dir/programs; then
17830                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
17831         fi
17832 done
17833
17834         cat >>Makefile <<TEST_EOF
17835
17836 # These rules are generated so we do not rely on suffix rules, which do not
17837 # work consistently for different make-programs (the '\$(MODEL)/' confuses
17838 # some, and the '\$x' confuses others).
17839 TEST_EOF
17840
17841 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
17842 for N in $LIST
17843 do
17844         cat >>Makefile <<TEST_EOF
17845
17846 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
17847         \$(srcdir)/test.priv.h \\
17848         ncurses_cfg.h
17849         $SHOW_CC
17850         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
17851 TEST_EOF
17852 done
17853
17854 if test -f ../config.guess && test -f ../config.sub
17855 then
17856         cat >>Makefile <<TEST_EOF
17857
17858 # if we used CF_INHERIT for getting these files, we can remove them
17859 distclean::
17860         rm -f config.guess config.sub
17861 TEST_EOF
17862 fi
17863  ;;
17864   esac
17865 done
17866 EOF
17867
17868 cat >>$CONFIG_STATUS <<\EOF
17869
17870 { (exit 0); exit 0; }
17871 EOF
17872 chmod +x $CONFIG_STATUS
17873 ac_clean_files=$ac_clean_files_save
17874
17875 # configure is writing to config.log, and then calls config.status.
17876 # config.status does its own redirection, appending to config.log.
17877 # Unfortunately, on DOS this fails, as config.log is still kept open
17878 # by configure, so config.status won't be able to write to it; its
17879 # output is simply discarded.  So we exec the FD to /dev/null,
17880 # effectively closing config.log, so it can be properly (re)opened and
17881 # appended to by config.status.  When coming back to configure, we
17882 # need to make the FD available again.
17883 if test "$no_create" != yes; then
17884   ac_cs_success=:
17885   exec 5>/dev/null
17886   $SHELL $CONFIG_STATUS || ac_cs_success=false
17887   exec 5>>config.log
17888   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17889   # would make configure fail if this is the last instruction.
17890   $ac_cs_success || { (exit 1); exit 1; }
17891 fi
17892