]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
b36373949ed2ec1095b212e0dfee271dc4e0a5fc
[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
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
1957         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
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)
1977                         ;;
1978                 (*)
1979                         case $cf_add_cflags in
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
2398         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
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 LIBTOOL_OPTS=""
2644 LIB_CLEAN=""
2645 LIB_COMPILE=""
2646 LIB_LINK='${CC}'
2647 LINK_TESTS=""
2648 LOCAL_LDFLAGS=""
2649 PACKAGE="ncurses-examples"
2650 PTHREAD="-lm"
2651 TEST_ARGS=""
2652 TEST_DEPS=""
2653 TEST_LIBS=""
2654 TINFO_LDFLAGS=''
2655 TINFO_LIBS='$(LIBS_CURSES)'
2656 cf_cv_abi_version=""
2657 cf_cv_rel_version=""
2658 includesubdir=""
2659
2660 cf_cv_screen=curses
2661 cf_cv_libtype=
2662
2663 if test "$GCC" = yes
2664 then
2665 cat > conftest.i <<EOF
2666 #ifndef GCC_PRINTF
2667 #define GCC_PRINTF 0
2668 #endif
2669 #ifndef GCC_SCANF
2670 #define GCC_SCANF 0
2671 #endif
2672 #ifndef GCC_NORETURN
2673 #define GCC_NORETURN /* nothing */
2674 #endif
2675 #ifndef GCC_UNUSED
2676 #define GCC_UNUSED /* nothing */
2677 #endif
2678 EOF
2679 if test "$GCC" = yes
2680 then
2681         { echo "$as_me:2681: checking for $CC __attribute__ directives..." >&5
2682 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2683 cat > conftest.$ac_ext <<EOF
2684 #line 2684 "${as_me:-configure}"
2685 #include "confdefs.h"
2686 #include "conftest.h"
2687 #include "conftest.i"
2688 #if     GCC_PRINTF
2689 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2690 #else
2691 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2692 #endif
2693 #if     GCC_SCANF
2694 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2695 #else
2696 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2697 #endif
2698 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2699 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2700 extern void foo(void) GCC_NORETURN;
2701 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2702 EOF
2703         cf_printf_attribute=no
2704         cf_scanf_attribute=no
2705         for cf_attribute in scanf printf unused noreturn
2706         do
2707
2708 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2709
2710                 cf_directive="__attribute__(($cf_attribute))"
2711                 echo "checking for $CC $cf_directive" 1>&5
2712
2713                 case $cf_attribute in
2714                 (printf)
2715                         cf_printf_attribute=yes
2716                         cat >conftest.h <<EOF
2717 #define GCC_$cf_ATTRIBUTE 1
2718 EOF
2719                         ;;
2720                 (scanf)
2721                         cf_scanf_attribute=yes
2722                         cat >conftest.h <<EOF
2723 #define GCC_$cf_ATTRIBUTE 1
2724 EOF
2725                         ;;
2726                 (*)
2727                         cat >conftest.h <<EOF
2728 #define GCC_$cf_ATTRIBUTE $cf_directive
2729 EOF
2730                         ;;
2731                 esac
2732
2733                 if { (eval echo "$as_me:2733: \"$ac_compile\"") >&5
2734   (eval $ac_compile) 2>&5
2735   ac_status=$?
2736   echo "$as_me:2736: \$? = $ac_status" >&5
2737   (exit $ac_status); }; then
2738                         test -n "$verbose" && echo "$as_me:2738: result: ... $cf_attribute" >&5
2739 echo "${ECHO_T}... $cf_attribute" >&6
2740                         cat conftest.h >>confdefs.h
2741                         case $cf_attribute in
2742                         (noreturn)
2743
2744 cat >>confdefs.h <<EOF
2745 #define GCC_NORETURN $cf_directive
2746 EOF
2747
2748                                 ;;
2749                         (printf)
2750                                 cf_value='/* nothing */'
2751                                 if test "$cf_printf_attribute" != no ; then
2752                                         cf_value='__attribute__((format(printf,fmt,var)))'
2753
2754 cat >>confdefs.h <<\EOF
2755 #define GCC_PRINTF 1
2756 EOF
2757
2758                                 fi
2759
2760 cat >>confdefs.h <<EOF
2761 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2762 EOF
2763
2764                                 ;;
2765                         (scanf)
2766                                 cf_value='/* nothing */'
2767                                 if test "$cf_scanf_attribute" != no ; then
2768                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2769
2770 cat >>confdefs.h <<\EOF
2771 #define GCC_SCANF 1
2772 EOF
2773
2774                                 fi
2775
2776 cat >>confdefs.h <<EOF
2777 #define GCC_SCANFLIKE(fmt,var) $cf_value
2778 EOF
2779
2780                                 ;;
2781                         (unused)
2782
2783 cat >>confdefs.h <<EOF
2784 #define GCC_UNUSED $cf_directive
2785 EOF
2786
2787                                 ;;
2788                         esac
2789                 fi
2790         done
2791 else
2792         fgrep define conftest.i >>confdefs.h
2793 fi
2794 rm -rf conftest*
2795 fi
2796
2797 cf_XOPEN_SOURCE=500
2798 cf_POSIX_C_SOURCE=199506L
2799 cf_xopen_source=
2800
2801 case $host_os in
2802 (aix[4-7]*)
2803         cf_xopen_source="-D_ALL_SOURCE"
2804         ;;
2805 (cygwin|msys)
2806         cf_XOPEN_SOURCE=600
2807         ;;
2808 (darwin[0-8].*)
2809         cf_xopen_source="-D_APPLE_C_SOURCE"
2810         ;;
2811 (darwin*)
2812         cf_xopen_source="-D_DARWIN_C_SOURCE"
2813         cf_XOPEN_SOURCE=
2814         ;;
2815 (freebsd*|dragonfly*)
2816         # 5.x headers associate
2817         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2818         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2819         cf_POSIX_C_SOURCE=200112L
2820         cf_XOPEN_SOURCE=600
2821         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2822         ;;
2823 (hpux11*)
2824         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2825         ;;
2826 (hpux*)
2827         cf_xopen_source="-D_HPUX_SOURCE"
2828         ;;
2829 (irix[56].*)
2830         cf_xopen_source="-D_SGI_SOURCE"
2831         cf_XOPEN_SOURCE=
2832         ;;
2833 (linux*|gnu*|mint*|k*bsd*-gnu)
2834
2835 echo "$as_me:2835: checking if we must define _GNU_SOURCE" >&5
2836 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2837 if test "${cf_cv_gnu_source+set}" = set; then
2838   echo $ECHO_N "(cached) $ECHO_C" >&6
2839 else
2840
2841 cat >conftest.$ac_ext <<_ACEOF
2842 #line 2842 "configure"
2843 #include "confdefs.h"
2844 #include <sys/types.h>
2845 int
2846 main ()
2847 {
2848
2849 #ifndef _XOPEN_SOURCE
2850 make an error
2851 #endif
2852   ;
2853   return 0;
2854 }
2855 _ACEOF
2856 rm -f conftest.$ac_objext
2857 if { (eval echo "$as_me:2857: \"$ac_compile\"") >&5
2858   (eval $ac_compile) 2>&5
2859   ac_status=$?
2860   echo "$as_me:2860: \$? = $ac_status" >&5
2861   (exit $ac_status); } &&
2862          { ac_try='test -s conftest.$ac_objext'
2863   { (eval echo "$as_me:2863: \"$ac_try\"") >&5
2864   (eval $ac_try) 2>&5
2865   ac_status=$?
2866   echo "$as_me:2866: \$? = $ac_status" >&5
2867   (exit $ac_status); }; }; then
2868   cf_cv_gnu_source=no
2869 else
2870   echo "$as_me: failed program was:" >&5
2871 cat conftest.$ac_ext >&5
2872 cf_save="$CPPFLAGS"
2873          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2874          cat >conftest.$ac_ext <<_ACEOF
2875 #line 2875 "configure"
2876 #include "confdefs.h"
2877 #include <sys/types.h>
2878 int
2879 main ()
2880 {
2881
2882 #ifdef _XOPEN_SOURCE
2883 make an error
2884 #endif
2885   ;
2886   return 0;
2887 }
2888 _ACEOF
2889 rm -f conftest.$ac_objext
2890 if { (eval echo "$as_me:2890: \"$ac_compile\"") >&5
2891   (eval $ac_compile) 2>&5
2892   ac_status=$?
2893   echo "$as_me:2893: \$? = $ac_status" >&5
2894   (exit $ac_status); } &&
2895          { ac_try='test -s conftest.$ac_objext'
2896   { (eval echo "$as_me:2896: \"$ac_try\"") >&5
2897   (eval $ac_try) 2>&5
2898   ac_status=$?
2899   echo "$as_me:2899: \$? = $ac_status" >&5
2900   (exit $ac_status); }; }; then
2901   cf_cv_gnu_source=no
2902 else
2903   echo "$as_me: failed program was:" >&5
2904 cat conftest.$ac_ext >&5
2905 cf_cv_gnu_source=yes
2906 fi
2907 rm -f conftest.$ac_objext conftest.$ac_ext
2908         CPPFLAGS="$cf_save"
2909
2910 fi
2911 rm -f conftest.$ac_objext conftest.$ac_ext
2912
2913 fi
2914 echo "$as_me:2914: result: $cf_cv_gnu_source" >&5
2915 echo "${ECHO_T}$cf_cv_gnu_source" >&6
2916 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2917
2918         ;;
2919 (minix*)
2920         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
2921         ;;
2922 (mirbsd*)
2923         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
2924         cf_XOPEN_SOURCE=
2925
2926 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2927
2928 cf_save_CFLAGS="$CFLAGS"
2929 cf_save_CPPFLAGS="$CPPFLAGS"
2930
2931 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2932         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2933                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2934
2935 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2936         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2937                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2938
2939 echo "$as_me:2939: checking if we should define _POSIX_C_SOURCE" >&5
2940 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
2941 if test "${cf_cv_posix_c_source+set}" = set; then
2942   echo $ECHO_N "(cached) $ECHO_C" >&6
2943 else
2944
2945 echo "${as_me:-configure}:2945: testing if the symbol is already defined go no further ..." 1>&5
2946
2947         cat >conftest.$ac_ext <<_ACEOF
2948 #line 2948 "configure"
2949 #include "confdefs.h"
2950 #include <sys/types.h>
2951 int
2952 main ()
2953 {
2954
2955 #ifndef _POSIX_C_SOURCE
2956 make an error
2957 #endif
2958   ;
2959   return 0;
2960 }
2961 _ACEOF
2962 rm -f conftest.$ac_objext
2963 if { (eval echo "$as_me:2963: \"$ac_compile\"") >&5
2964   (eval $ac_compile) 2>&5
2965   ac_status=$?
2966   echo "$as_me:2966: \$? = $ac_status" >&5
2967   (exit $ac_status); } &&
2968          { ac_try='test -s conftest.$ac_objext'
2969   { (eval echo "$as_me:2969: \"$ac_try\"") >&5
2970   (eval $ac_try) 2>&5
2971   ac_status=$?
2972   echo "$as_me:2972: \$? = $ac_status" >&5
2973   (exit $ac_status); }; }; then
2974   cf_cv_posix_c_source=no
2975 else
2976   echo "$as_me: failed program was:" >&5
2977 cat conftest.$ac_ext >&5
2978 cf_want_posix_source=no
2979          case .$cf_POSIX_C_SOURCE in
2980          (.[12]??*)
2981                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2982                 ;;
2983          (.2)
2984                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2985                 cf_want_posix_source=yes
2986                 ;;
2987          (.*)
2988                 cf_want_posix_source=yes
2989                 ;;
2990          esac
2991          if test "$cf_want_posix_source" = yes ; then
2992                 cat >conftest.$ac_ext <<_ACEOF
2993 #line 2993 "configure"
2994 #include "confdefs.h"
2995 #include <sys/types.h>
2996 int
2997 main ()
2998 {
2999
3000 #ifdef _POSIX_SOURCE
3001 make an error
3002 #endif
3003   ;
3004   return 0;
3005 }
3006 _ACEOF
3007 rm -f conftest.$ac_objext
3008 if { (eval echo "$as_me:3008: \"$ac_compile\"") >&5
3009   (eval $ac_compile) 2>&5
3010   ac_status=$?
3011   echo "$as_me:3011: \$? = $ac_status" >&5
3012   (exit $ac_status); } &&
3013          { ac_try='test -s conftest.$ac_objext'
3014   { (eval echo "$as_me:3014: \"$ac_try\"") >&5
3015   (eval $ac_try) 2>&5
3016   ac_status=$?
3017   echo "$as_me:3017: \$? = $ac_status" >&5
3018   (exit $ac_status); }; }; then
3019   :
3020 else
3021   echo "$as_me: failed program was:" >&5
3022 cat conftest.$ac_ext >&5
3023 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3024 fi
3025 rm -f conftest.$ac_objext conftest.$ac_ext
3026          fi
3027
3028 echo "${as_me:-configure}:3028: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3029
3030          CFLAGS="$cf_trim_CFLAGS"
3031          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3032
3033 echo "${as_me:-configure}:3033: testing if the second compile does not leave our definition intact error ..." 1>&5
3034
3035          cat >conftest.$ac_ext <<_ACEOF
3036 #line 3036 "configure"
3037 #include "confdefs.h"
3038 #include <sys/types.h>
3039 int
3040 main ()
3041 {
3042
3043 #ifndef _POSIX_C_SOURCE
3044 make an error
3045 #endif
3046   ;
3047   return 0;
3048 }
3049 _ACEOF
3050 rm -f conftest.$ac_objext
3051 if { (eval echo "$as_me:3051: \"$ac_compile\"") >&5
3052   (eval $ac_compile) 2>&5
3053   ac_status=$?
3054   echo "$as_me:3054: \$? = $ac_status" >&5
3055   (exit $ac_status); } &&
3056          { ac_try='test -s conftest.$ac_objext'
3057   { (eval echo "$as_me:3057: \"$ac_try\"") >&5
3058   (eval $ac_try) 2>&5
3059   ac_status=$?
3060   echo "$as_me:3060: \$? = $ac_status" >&5
3061   (exit $ac_status); }; }; then
3062   :
3063 else
3064   echo "$as_me: failed program was:" >&5
3065 cat conftest.$ac_ext >&5
3066 cf_cv_posix_c_source=no
3067 fi
3068 rm -f conftest.$ac_objext conftest.$ac_ext
3069          CFLAGS="$cf_save_CFLAGS"
3070          CPPFLAGS="$cf_save_CPPFLAGS"
3071
3072 fi
3073 rm -f conftest.$ac_objext conftest.$ac_ext
3074
3075 fi
3076 echo "$as_me:3076: result: $cf_cv_posix_c_source" >&5
3077 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3078
3079 if test "$cf_cv_posix_c_source" != no ; then
3080         CFLAGS="$cf_trim_CFLAGS"
3081         CPPFLAGS="$cf_trim_CPPFLAGS"
3082
3083 cf_fix_cppflags=no
3084 cf_new_cflags=
3085 cf_new_cppflags=
3086 cf_new_extra_cppflags=
3087
3088 for cf_add_cflags in $cf_cv_posix_c_source
3089 do
3090 case $cf_fix_cppflags in
3091 (no)
3092         case $cf_add_cflags in
3093         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3094                 case $cf_add_cflags in
3095                 (-D*)
3096                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3097
3098                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3099                                 && test -z "${cf_tst_cflags}" \
3100                                 && cf_fix_cppflags=yes
3101
3102                         if test $cf_fix_cppflags = yes ; then
3103                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3104                                 continue
3105                         elif test "${cf_tst_cflags}" = "\"'" ; then
3106                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3107                                 continue
3108                         fi
3109                         ;;
3110                 esac
3111                 case "$CPPFLAGS" in
3112                 (*$cf_add_cflags)
3113                         ;;
3114                 (*)
3115                         case $cf_add_cflags in
3116                         (-D*)
3117                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3118
3119 CPPFLAGS=`echo "$CPPFLAGS" | \
3120         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3121                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3122
3123                                 ;;
3124                         esac
3125                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3126                         ;;
3127                 esac
3128                 ;;
3129         (*)
3130                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3131                 ;;
3132         esac
3133         ;;
3134 (yes)
3135         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3136
3137         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3138
3139         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3140                 && test -z "${cf_tst_cflags}" \
3141                 && cf_fix_cppflags=no
3142         ;;
3143 esac
3144 done
3145
3146 if test -n "$cf_new_cflags" ; then
3147
3148         CFLAGS="$CFLAGS $cf_new_cflags"
3149 fi
3150
3151 if test -n "$cf_new_cppflags" ; then
3152
3153         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3154 fi
3155
3156 if test -n "$cf_new_extra_cppflags" ; then
3157
3158         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3159 fi
3160
3161 fi
3162
3163         ;;
3164 (netbsd*)
3165         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3166         ;;
3167 (openbsd[4-9]*)
3168         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3169         cf_xopen_source="-D_BSD_SOURCE"
3170         cf_XOPEN_SOURCE=600
3171         ;;
3172 (openbsd*)
3173         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3174         ;;
3175 (osf[45]*)
3176         cf_xopen_source="-D_OSF_SOURCE"
3177         ;;
3178 (nto-qnx*)
3179         cf_xopen_source="-D_QNX_SOURCE"
3180         ;;
3181 (sco*)
3182         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3183         ;;
3184 (solaris2.*)
3185         cf_xopen_source="-D__EXTENSIONS__"
3186         cf_cv_xopen_source=broken
3187         ;;
3188 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3189         cf_XOPEN_SOURCE=
3190         cf_POSIX_C_SOURCE=
3191         ;;
3192 (*)
3193
3194 echo "$as_me:3194: checking if we should define _XOPEN_SOURCE" >&5
3195 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3196 if test "${cf_cv_xopen_source+set}" = set; then
3197   echo $ECHO_N "(cached) $ECHO_C" >&6
3198 else
3199
3200         cat >conftest.$ac_ext <<_ACEOF
3201 #line 3201 "configure"
3202 #include "confdefs.h"
3203
3204 #include <stdlib.h>
3205 #include <string.h>
3206 #include <sys/types.h>
3207
3208 int
3209 main ()
3210 {
3211
3212 #ifndef _XOPEN_SOURCE
3213 make an error
3214 #endif
3215   ;
3216   return 0;
3217 }
3218 _ACEOF
3219 rm -f conftest.$ac_objext
3220 if { (eval echo "$as_me:3220: \"$ac_compile\"") >&5
3221   (eval $ac_compile) 2>&5
3222   ac_status=$?
3223   echo "$as_me:3223: \$? = $ac_status" >&5
3224   (exit $ac_status); } &&
3225          { ac_try='test -s conftest.$ac_objext'
3226   { (eval echo "$as_me:3226: \"$ac_try\"") >&5
3227   (eval $ac_try) 2>&5
3228   ac_status=$?
3229   echo "$as_me:3229: \$? = $ac_status" >&5
3230   (exit $ac_status); }; }; then
3231   cf_cv_xopen_source=no
3232 else
3233   echo "$as_me: failed program was:" >&5
3234 cat conftest.$ac_ext >&5
3235 cf_save="$CPPFLAGS"
3236          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3237          cat >conftest.$ac_ext <<_ACEOF
3238 #line 3238 "configure"
3239 #include "confdefs.h"
3240
3241 #include <stdlib.h>
3242 #include <string.h>
3243 #include <sys/types.h>
3244
3245 int
3246 main ()
3247 {
3248
3249 #ifdef _XOPEN_SOURCE
3250 make an error
3251 #endif
3252   ;
3253   return 0;
3254 }
3255 _ACEOF
3256 rm -f conftest.$ac_objext
3257 if { (eval echo "$as_me:3257: \"$ac_compile\"") >&5
3258   (eval $ac_compile) 2>&5
3259   ac_status=$?
3260   echo "$as_me:3260: \$? = $ac_status" >&5
3261   (exit $ac_status); } &&
3262          { ac_try='test -s conftest.$ac_objext'
3263   { (eval echo "$as_me:3263: \"$ac_try\"") >&5
3264   (eval $ac_try) 2>&5
3265   ac_status=$?
3266   echo "$as_me:3266: \$? = $ac_status" >&5
3267   (exit $ac_status); }; }; then
3268   cf_cv_xopen_source=no
3269 else
3270   echo "$as_me: failed program was:" >&5
3271 cat conftest.$ac_ext >&5
3272 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3273 fi
3274 rm -f conftest.$ac_objext conftest.$ac_ext
3275         CPPFLAGS="$cf_save"
3276
3277 fi
3278 rm -f conftest.$ac_objext conftest.$ac_ext
3279
3280 fi
3281 echo "$as_me:3281: result: $cf_cv_xopen_source" >&5
3282 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3283
3284 if test "$cf_cv_xopen_source" != no ; then
3285
3286 CFLAGS=`echo "$CFLAGS" | \
3287         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3288                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3289
3290 CPPFLAGS=`echo "$CPPFLAGS" | \
3291         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3292                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3293
3294         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3295
3296 cf_fix_cppflags=no
3297 cf_new_cflags=
3298 cf_new_cppflags=
3299 cf_new_extra_cppflags=
3300
3301 for cf_add_cflags in $cf_temp_xopen_source
3302 do
3303 case $cf_fix_cppflags in
3304 (no)
3305         case $cf_add_cflags in
3306         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3307                 case $cf_add_cflags in
3308                 (-D*)
3309                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3310
3311                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3312                                 && test -z "${cf_tst_cflags}" \
3313                                 && cf_fix_cppflags=yes
3314
3315                         if test $cf_fix_cppflags = yes ; then
3316                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3317                                 continue
3318                         elif test "${cf_tst_cflags}" = "\"'" ; then
3319                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3320                                 continue
3321                         fi
3322                         ;;
3323                 esac
3324                 case "$CPPFLAGS" in
3325                 (*$cf_add_cflags)
3326                         ;;
3327                 (*)
3328                         case $cf_add_cflags in
3329                         (-D*)
3330                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3331
3332 CPPFLAGS=`echo "$CPPFLAGS" | \
3333         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3334                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3335
3336                                 ;;
3337                         esac
3338                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3339                         ;;
3340                 esac
3341                 ;;
3342         (*)
3343                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3344                 ;;
3345         esac
3346         ;;
3347 (yes)
3348         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3349
3350         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3351
3352         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3353                 && test -z "${cf_tst_cflags}" \
3354                 && cf_fix_cppflags=no
3355         ;;
3356 esac
3357 done
3358
3359 if test -n "$cf_new_cflags" ; then
3360
3361         CFLAGS="$CFLAGS $cf_new_cflags"
3362 fi
3363
3364 if test -n "$cf_new_cppflags" ; then
3365
3366         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3367 fi
3368
3369 if test -n "$cf_new_extra_cppflags" ; then
3370
3371         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3372 fi
3373
3374 fi
3375
3376 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3377
3378 cf_save_CFLAGS="$CFLAGS"
3379 cf_save_CPPFLAGS="$CPPFLAGS"
3380
3381 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3382         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3383                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3384
3385 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3386         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3387                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3388
3389 echo "$as_me:3389: checking if we should define _POSIX_C_SOURCE" >&5
3390 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3391 if test "${cf_cv_posix_c_source+set}" = set; then
3392   echo $ECHO_N "(cached) $ECHO_C" >&6
3393 else
3394
3395 echo "${as_me:-configure}:3395: testing if the symbol is already defined go no further ..." 1>&5
3396
3397         cat >conftest.$ac_ext <<_ACEOF
3398 #line 3398 "configure"
3399 #include "confdefs.h"
3400 #include <sys/types.h>
3401 int
3402 main ()
3403 {
3404
3405 #ifndef _POSIX_C_SOURCE
3406 make an error
3407 #endif
3408   ;
3409   return 0;
3410 }
3411 _ACEOF
3412 rm -f conftest.$ac_objext
3413 if { (eval echo "$as_me:3413: \"$ac_compile\"") >&5
3414   (eval $ac_compile) 2>&5
3415   ac_status=$?
3416   echo "$as_me:3416: \$? = $ac_status" >&5
3417   (exit $ac_status); } &&
3418          { ac_try='test -s conftest.$ac_objext'
3419   { (eval echo "$as_me:3419: \"$ac_try\"") >&5
3420   (eval $ac_try) 2>&5
3421   ac_status=$?
3422   echo "$as_me:3422: \$? = $ac_status" >&5
3423   (exit $ac_status); }; }; then
3424   cf_cv_posix_c_source=no
3425 else
3426   echo "$as_me: failed program was:" >&5
3427 cat conftest.$ac_ext >&5
3428 cf_want_posix_source=no
3429          case .$cf_POSIX_C_SOURCE in
3430          (.[12]??*)
3431                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3432                 ;;
3433          (.2)
3434                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3435                 cf_want_posix_source=yes
3436                 ;;
3437          (.*)
3438                 cf_want_posix_source=yes
3439                 ;;
3440          esac
3441          if test "$cf_want_posix_source" = yes ; then
3442                 cat >conftest.$ac_ext <<_ACEOF
3443 #line 3443 "configure"
3444 #include "confdefs.h"
3445 #include <sys/types.h>
3446 int
3447 main ()
3448 {
3449
3450 #ifdef _POSIX_SOURCE
3451 make an error
3452 #endif
3453   ;
3454   return 0;
3455 }
3456 _ACEOF
3457 rm -f conftest.$ac_objext
3458 if { (eval echo "$as_me:3458: \"$ac_compile\"") >&5
3459   (eval $ac_compile) 2>&5
3460   ac_status=$?
3461   echo "$as_me:3461: \$? = $ac_status" >&5
3462   (exit $ac_status); } &&
3463          { ac_try='test -s conftest.$ac_objext'
3464   { (eval echo "$as_me:3464: \"$ac_try\"") >&5
3465   (eval $ac_try) 2>&5
3466   ac_status=$?
3467   echo "$as_me:3467: \$? = $ac_status" >&5
3468   (exit $ac_status); }; }; then
3469   :
3470 else
3471   echo "$as_me: failed program was:" >&5
3472 cat conftest.$ac_ext >&5
3473 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3474 fi
3475 rm -f conftest.$ac_objext conftest.$ac_ext
3476          fi
3477
3478 echo "${as_me:-configure}:3478: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3479
3480          CFLAGS="$cf_trim_CFLAGS"
3481          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3482
3483 echo "${as_me:-configure}:3483: testing if the second compile does not leave our definition intact error ..." 1>&5
3484
3485          cat >conftest.$ac_ext <<_ACEOF
3486 #line 3486 "configure"
3487 #include "confdefs.h"
3488 #include <sys/types.h>
3489 int
3490 main ()
3491 {
3492
3493 #ifndef _POSIX_C_SOURCE
3494 make an error
3495 #endif
3496   ;
3497   return 0;
3498 }
3499 _ACEOF
3500 rm -f conftest.$ac_objext
3501 if { (eval echo "$as_me:3501: \"$ac_compile\"") >&5
3502   (eval $ac_compile) 2>&5
3503   ac_status=$?
3504   echo "$as_me:3504: \$? = $ac_status" >&5
3505   (exit $ac_status); } &&
3506          { ac_try='test -s conftest.$ac_objext'
3507   { (eval echo "$as_me:3507: \"$ac_try\"") >&5
3508   (eval $ac_try) 2>&5
3509   ac_status=$?
3510   echo "$as_me:3510: \$? = $ac_status" >&5
3511   (exit $ac_status); }; }; then
3512   :
3513 else
3514   echo "$as_me: failed program was:" >&5
3515 cat conftest.$ac_ext >&5
3516 cf_cv_posix_c_source=no
3517 fi
3518 rm -f conftest.$ac_objext conftest.$ac_ext
3519          CFLAGS="$cf_save_CFLAGS"
3520          CPPFLAGS="$cf_save_CPPFLAGS"
3521
3522 fi
3523 rm -f conftest.$ac_objext conftest.$ac_ext
3524
3525 fi
3526 echo "$as_me:3526: result: $cf_cv_posix_c_source" >&5
3527 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3528
3529 if test "$cf_cv_posix_c_source" != no ; then
3530         CFLAGS="$cf_trim_CFLAGS"
3531         CPPFLAGS="$cf_trim_CPPFLAGS"
3532
3533 cf_fix_cppflags=no
3534 cf_new_cflags=
3535 cf_new_cppflags=
3536 cf_new_extra_cppflags=
3537
3538 for cf_add_cflags in $cf_cv_posix_c_source
3539 do
3540 case $cf_fix_cppflags in
3541 (no)
3542         case $cf_add_cflags in
3543         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3544                 case $cf_add_cflags in
3545                 (-D*)
3546                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3547
3548                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3549                                 && test -z "${cf_tst_cflags}" \
3550                                 && cf_fix_cppflags=yes
3551
3552                         if test $cf_fix_cppflags = yes ; then
3553                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3554                                 continue
3555                         elif test "${cf_tst_cflags}" = "\"'" ; then
3556                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3557                                 continue
3558                         fi
3559                         ;;
3560                 esac
3561                 case "$CPPFLAGS" in
3562                 (*$cf_add_cflags)
3563                         ;;
3564                 (*)
3565                         case $cf_add_cflags in
3566                         (-D*)
3567                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3568
3569 CPPFLAGS=`echo "$CPPFLAGS" | \
3570         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3571                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3572
3573                                 ;;
3574                         esac
3575                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3576                         ;;
3577                 esac
3578                 ;;
3579         (*)
3580                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3581                 ;;
3582         esac
3583         ;;
3584 (yes)
3585         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3586
3587         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3588
3589         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3590                 && test -z "${cf_tst_cflags}" \
3591                 && cf_fix_cppflags=no
3592         ;;
3593 esac
3594 done
3595
3596 if test -n "$cf_new_cflags" ; then
3597
3598         CFLAGS="$CFLAGS $cf_new_cflags"
3599 fi
3600
3601 if test -n "$cf_new_cppflags" ; then
3602
3603         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3604 fi
3605
3606 if test -n "$cf_new_extra_cppflags" ; then
3607
3608         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3609 fi
3610
3611 fi
3612
3613         ;;
3614 esac
3615
3616 if test -n "$cf_xopen_source" ; then
3617
3618 cf_fix_cppflags=no
3619 cf_new_cflags=
3620 cf_new_cppflags=
3621 cf_new_extra_cppflags=
3622
3623 for cf_add_cflags in $cf_xopen_source
3624 do
3625 case $cf_fix_cppflags in
3626 (no)
3627         case $cf_add_cflags in
3628         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3629                 case $cf_add_cflags in
3630                 (-D*)
3631                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3632
3633                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3634                                 && test -z "${cf_tst_cflags}" \
3635                                 && cf_fix_cppflags=yes
3636
3637                         if test $cf_fix_cppflags = yes ; then
3638                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3639                                 continue
3640                         elif test "${cf_tst_cflags}" = "\"'" ; then
3641                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3642                                 continue
3643                         fi
3644                         ;;
3645                 esac
3646                 case "$CPPFLAGS" in
3647                 (*$cf_add_cflags)
3648                         ;;
3649                 (*)
3650                         case $cf_add_cflags in
3651                         (-D*)
3652                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3653
3654 CPPFLAGS=`echo "$CPPFLAGS" | \
3655         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3656                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3657
3658                                 ;;
3659                         esac
3660                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3661                         ;;
3662                 esac
3663                 ;;
3664         (*)
3665                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3666                 ;;
3667         esac
3668         ;;
3669 (yes)
3670         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3671
3672         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3673
3674         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3675                 && test -z "${cf_tst_cflags}" \
3676                 && cf_fix_cppflags=no
3677         ;;
3678 esac
3679 done
3680
3681 if test -n "$cf_new_cflags" ; then
3682         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
3683
3684 echo "${as_me:-configure}:3684: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
3685
3686         CFLAGS="$CFLAGS $cf_new_cflags"
3687 fi
3688
3689 if test -n "$cf_new_cppflags" ; then
3690         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
3691
3692 echo "${as_me:-configure}:3692: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
3693
3694         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3695 fi
3696
3697 if test -n "$cf_new_extra_cppflags" ; then
3698         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
3699
3700 echo "${as_me:-configure}:3700: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
3701
3702         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3703 fi
3704
3705 fi
3706
3707 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3708         echo "$as_me:3708: checking if _XOPEN_SOURCE really is set" >&5
3709 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3710         cat >conftest.$ac_ext <<_ACEOF
3711 #line 3711 "configure"
3712 #include "confdefs.h"
3713 #include <stdlib.h>
3714 int
3715 main ()
3716 {
3717
3718 #ifndef _XOPEN_SOURCE
3719 make an error
3720 #endif
3721   ;
3722   return 0;
3723 }
3724 _ACEOF
3725 rm -f conftest.$ac_objext
3726 if { (eval echo "$as_me:3726: \"$ac_compile\"") >&5
3727   (eval $ac_compile) 2>&5
3728   ac_status=$?
3729   echo "$as_me:3729: \$? = $ac_status" >&5
3730   (exit $ac_status); } &&
3731          { ac_try='test -s conftest.$ac_objext'
3732   { (eval echo "$as_me:3732: \"$ac_try\"") >&5
3733   (eval $ac_try) 2>&5
3734   ac_status=$?
3735   echo "$as_me:3735: \$? = $ac_status" >&5
3736   (exit $ac_status); }; }; then
3737   cf_XOPEN_SOURCE_set=yes
3738 else
3739   echo "$as_me: failed program was:" >&5
3740 cat conftest.$ac_ext >&5
3741 cf_XOPEN_SOURCE_set=no
3742 fi
3743 rm -f conftest.$ac_objext conftest.$ac_ext
3744         echo "$as_me:3744: result: $cf_XOPEN_SOURCE_set" >&5
3745 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3746         if test $cf_XOPEN_SOURCE_set = yes
3747         then
3748                 cat >conftest.$ac_ext <<_ACEOF
3749 #line 3749 "configure"
3750 #include "confdefs.h"
3751 #include <stdlib.h>
3752 int
3753 main ()
3754 {
3755
3756 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3757 make an error
3758 #endif
3759   ;
3760   return 0;
3761 }
3762 _ACEOF
3763 rm -f conftest.$ac_objext
3764 if { (eval echo "$as_me:3764: \"$ac_compile\"") >&5
3765   (eval $ac_compile) 2>&5
3766   ac_status=$?
3767   echo "$as_me:3767: \$? = $ac_status" >&5
3768   (exit $ac_status); } &&
3769          { ac_try='test -s conftest.$ac_objext'
3770   { (eval echo "$as_me:3770: \"$ac_try\"") >&5
3771   (eval $ac_try) 2>&5
3772   ac_status=$?
3773   echo "$as_me:3773: \$? = $ac_status" >&5
3774   (exit $ac_status); }; }; then
3775   cf_XOPEN_SOURCE_set_ok=yes
3776 else
3777   echo "$as_me: failed program was:" >&5
3778 cat conftest.$ac_ext >&5
3779 cf_XOPEN_SOURCE_set_ok=no
3780 fi
3781 rm -f conftest.$ac_objext conftest.$ac_ext
3782                 if test $cf_XOPEN_SOURCE_set_ok = no
3783                 then
3784                         { echo "$as_me:3784: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3785 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3786                 fi
3787         else
3788
3789 echo "$as_me:3789: checking if we should define _XOPEN_SOURCE" >&5
3790 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3791 if test "${cf_cv_xopen_source+set}" = set; then
3792   echo $ECHO_N "(cached) $ECHO_C" >&6
3793 else
3794
3795         cat >conftest.$ac_ext <<_ACEOF
3796 #line 3796 "configure"
3797 #include "confdefs.h"
3798
3799 #include <stdlib.h>
3800 #include <string.h>
3801 #include <sys/types.h>
3802
3803 int
3804 main ()
3805 {
3806
3807 #ifndef _XOPEN_SOURCE
3808 make an error
3809 #endif
3810   ;
3811   return 0;
3812 }
3813 _ACEOF
3814 rm -f conftest.$ac_objext
3815 if { (eval echo "$as_me:3815: \"$ac_compile\"") >&5
3816   (eval $ac_compile) 2>&5
3817   ac_status=$?
3818   echo "$as_me:3818: \$? = $ac_status" >&5
3819   (exit $ac_status); } &&
3820          { ac_try='test -s conftest.$ac_objext'
3821   { (eval echo "$as_me:3821: \"$ac_try\"") >&5
3822   (eval $ac_try) 2>&5
3823   ac_status=$?
3824   echo "$as_me:3824: \$? = $ac_status" >&5
3825   (exit $ac_status); }; }; then
3826   cf_cv_xopen_source=no
3827 else
3828   echo "$as_me: failed program was:" >&5
3829 cat conftest.$ac_ext >&5
3830 cf_save="$CPPFLAGS"
3831          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3832          cat >conftest.$ac_ext <<_ACEOF
3833 #line 3833 "configure"
3834 #include "confdefs.h"
3835
3836 #include <stdlib.h>
3837 #include <string.h>
3838 #include <sys/types.h>
3839
3840 int
3841 main ()
3842 {
3843
3844 #ifdef _XOPEN_SOURCE
3845 make an error
3846 #endif
3847   ;
3848   return 0;
3849 }
3850 _ACEOF
3851 rm -f conftest.$ac_objext
3852 if { (eval echo "$as_me:3852: \"$ac_compile\"") >&5
3853   (eval $ac_compile) 2>&5
3854   ac_status=$?
3855   echo "$as_me:3855: \$? = $ac_status" >&5
3856   (exit $ac_status); } &&
3857          { ac_try='test -s conftest.$ac_objext'
3858   { (eval echo "$as_me:3858: \"$ac_try\"") >&5
3859   (eval $ac_try) 2>&5
3860   ac_status=$?
3861   echo "$as_me:3861: \$? = $ac_status" >&5
3862   (exit $ac_status); }; }; then
3863   cf_cv_xopen_source=no
3864 else
3865   echo "$as_me: failed program was:" >&5
3866 cat conftest.$ac_ext >&5
3867 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3868 fi
3869 rm -f conftest.$ac_objext conftest.$ac_ext
3870         CPPFLAGS="$cf_save"
3871
3872 fi
3873 rm -f conftest.$ac_objext conftest.$ac_ext
3874
3875 fi
3876 echo "$as_me:3876: result: $cf_cv_xopen_source" >&5
3877 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3878
3879 if test "$cf_cv_xopen_source" != no ; then
3880
3881 CFLAGS=`echo "$CFLAGS" | \
3882         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3883                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3884
3885 CPPFLAGS=`echo "$CPPFLAGS" | \
3886         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3887                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3888
3889         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3890
3891 cf_fix_cppflags=no
3892 cf_new_cflags=
3893 cf_new_cppflags=
3894 cf_new_extra_cppflags=
3895
3896 for cf_add_cflags in $cf_temp_xopen_source
3897 do
3898 case $cf_fix_cppflags in
3899 (no)
3900         case $cf_add_cflags in
3901         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3902                 case $cf_add_cflags in
3903                 (-D*)
3904                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3905
3906                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3907                                 && test -z "${cf_tst_cflags}" \
3908                                 && cf_fix_cppflags=yes
3909
3910                         if test $cf_fix_cppflags = yes ; then
3911                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3912                                 continue
3913                         elif test "${cf_tst_cflags}" = "\"'" ; then
3914                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3915                                 continue
3916                         fi
3917                         ;;
3918                 esac
3919                 case "$CPPFLAGS" in
3920                 (*$cf_add_cflags)
3921                         ;;
3922                 (*)
3923                         case $cf_add_cflags in
3924                         (-D*)
3925                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3926
3927 CPPFLAGS=`echo "$CPPFLAGS" | \
3928         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3929                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3930
3931                                 ;;
3932                         esac
3933                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3934                         ;;
3935                 esac
3936                 ;;
3937         (*)
3938                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3939                 ;;
3940         esac
3941         ;;
3942 (yes)
3943         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3944
3945         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3946
3947         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3948                 && test -z "${cf_tst_cflags}" \
3949                 && cf_fix_cppflags=no
3950         ;;
3951 esac
3952 done
3953
3954 if test -n "$cf_new_cflags" ; then
3955
3956         CFLAGS="$CFLAGS $cf_new_cflags"
3957 fi
3958
3959 if test -n "$cf_new_cppflags" ; then
3960
3961         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3962 fi
3963
3964 if test -n "$cf_new_extra_cppflags" ; then
3965
3966         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3967 fi
3968
3969 fi
3970
3971         fi
3972 fi
3973
3974 echo "$as_me:3974: checking for signal global datatype" >&5
3975 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
3976 if test "${cf_cv_sig_atomic_t+set}" = set; then
3977   echo $ECHO_N "(cached) $ECHO_C" >&6
3978 else
3979
3980         for cf_type in \
3981                 "volatile sig_atomic_t" \
3982                 "sig_atomic_t" \
3983                 "int"
3984         do
3985         cat >conftest.$ac_ext <<_ACEOF
3986 #line 3986 "configure"
3987 #include "confdefs.h"
3988
3989 #include <sys/types.h>
3990 #include <signal.h>
3991 #include <stdio.h>
3992
3993 extern $cf_type x;
3994 $cf_type x;
3995 static void handler(int sig)
3996 {
3997         x = 5;
3998 }
3999 int
4000 main ()
4001 {
4002 signal(SIGINT, handler);
4003                  x = 1
4004   ;
4005   return 0;
4006 }
4007 _ACEOF
4008 rm -f conftest.$ac_objext
4009 if { (eval echo "$as_me:4009: \"$ac_compile\"") >&5
4010   (eval $ac_compile) 2>&5
4011   ac_status=$?
4012   echo "$as_me:4012: \$? = $ac_status" >&5
4013   (exit $ac_status); } &&
4014          { ac_try='test -s conftest.$ac_objext'
4015   { (eval echo "$as_me:4015: \"$ac_try\"") >&5
4016   (eval $ac_try) 2>&5
4017   ac_status=$?
4018   echo "$as_me:4018: \$? = $ac_status" >&5
4019   (exit $ac_status); }; }; then
4020   cf_cv_sig_atomic_t=$cf_type
4021 else
4022   echo "$as_me: failed program was:" >&5
4023 cat conftest.$ac_ext >&5
4024 cf_cv_sig_atomic_t=no
4025 fi
4026 rm -f conftest.$ac_objext conftest.$ac_ext
4027                 test "$cf_cv_sig_atomic_t" != no && break
4028         done
4029
4030 fi
4031
4032 echo "$as_me:4032: result: $cf_cv_sig_atomic_t" >&5
4033 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4034 test "$cf_cv_sig_atomic_t" != no &&
4035 cat >>confdefs.h <<EOF
4036 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4037 EOF
4038
4039 echo "$as_me:4039: checking if you want to use pkg-config" >&5
4040 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4041
4042 # Check whether --with-pkg-config or --without-pkg-config was given.
4043 if test "${with_pkg_config+set}" = set; then
4044   withval="$with_pkg_config"
4045   cf_pkg_config=$withval
4046 else
4047   cf_pkg_config=yes
4048 fi;
4049 echo "$as_me:4049: result: $cf_pkg_config" >&5
4050 echo "${ECHO_T}$cf_pkg_config" >&6
4051
4052 case $cf_pkg_config in
4053 (no)
4054         PKG_CONFIG=none
4055         ;;
4056 (yes)
4057
4058 if test -n "$ac_tool_prefix"; then
4059   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4060 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4061 echo "$as_me:4061: checking for $ac_word" >&5
4062 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4063 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4064   echo $ECHO_N "(cached) $ECHO_C" >&6
4065 else
4066   case $PKG_CONFIG in
4067   [\\/]* | ?:[\\/]*)
4068   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4069   ;;
4070   *)
4071   ac_save_IFS=$IFS; IFS=$ac_path_separator
4072 ac_dummy="$PATH"
4073 for ac_dir in $ac_dummy; do
4074   IFS=$ac_save_IFS
4075   test -z "$ac_dir" && ac_dir=.
4076   if $as_executable_p "$ac_dir/$ac_word"; then
4077    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4078    echo "$as_me:4078: found $ac_dir/$ac_word" >&5
4079    break
4080 fi
4081 done
4082
4083   ;;
4084 esac
4085 fi
4086 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4087
4088 if test -n "$PKG_CONFIG"; then
4089   echo "$as_me:4089: result: $PKG_CONFIG" >&5
4090 echo "${ECHO_T}$PKG_CONFIG" >&6
4091 else
4092   echo "$as_me:4092: result: no" >&5
4093 echo "${ECHO_T}no" >&6
4094 fi
4095
4096 fi
4097 if test -z "$ac_cv_path_PKG_CONFIG"; then
4098   ac_pt_PKG_CONFIG=$PKG_CONFIG
4099   # Extract the first word of "pkg-config", so it can be a program name with args.
4100 set dummy pkg-config; ac_word=$2
4101 echo "$as_me:4101: checking for $ac_word" >&5
4102 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4103 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4104   echo $ECHO_N "(cached) $ECHO_C" >&6
4105 else
4106   case $ac_pt_PKG_CONFIG in
4107   [\\/]* | ?:[\\/]*)
4108   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4109   ;;
4110   *)
4111   ac_save_IFS=$IFS; IFS=$ac_path_separator
4112 ac_dummy="$PATH"
4113 for ac_dir in $ac_dummy; do
4114   IFS=$ac_save_IFS
4115   test -z "$ac_dir" && ac_dir=.
4116   if $as_executable_p "$ac_dir/$ac_word"; then
4117    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4118    echo "$as_me:4118: found $ac_dir/$ac_word" >&5
4119    break
4120 fi
4121 done
4122
4123   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4124   ;;
4125 esac
4126 fi
4127 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4128
4129 if test -n "$ac_pt_PKG_CONFIG"; then
4130   echo "$as_me:4130: result: $ac_pt_PKG_CONFIG" >&5
4131 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4132 else
4133   echo "$as_me:4133: result: no" >&5
4134 echo "${ECHO_T}no" >&6
4135 fi
4136
4137   PKG_CONFIG=$ac_pt_PKG_CONFIG
4138 else
4139   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4140 fi
4141
4142         ;;
4143 (*)
4144         PKG_CONFIG=$withval
4145         ;;
4146 esac
4147
4148 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4149 if test "$PKG_CONFIG" != none ; then
4150
4151 if test "x$prefix" != xNONE; then
4152         cf_path_syntax="$prefix"
4153 else
4154         cf_path_syntax="$ac_default_prefix"
4155 fi
4156
4157 case ".$PKG_CONFIG" in
4158 (.\$\(*\)*|.\'*\'*)
4159         ;;
4160 (..|./*|.\\*)
4161         ;;
4162 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4163         ;;
4164 (.\${*prefix}*|.\${*dir}*)
4165         eval PKG_CONFIG="$PKG_CONFIG"
4166         case ".$PKG_CONFIG" in
4167         (.NONE/*)
4168                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4169                 ;;
4170         esac
4171         ;;
4172 (.no|.NONE/*)
4173         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4174         ;;
4175 (*)
4176         { { echo "$as_me:4176: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4177 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4178    { (exit 1); exit 1; }; }
4179         ;;
4180 esac
4181
4182 else
4183         { echo "$as_me:4183: WARNING: pkg-config is not installed" >&5
4184 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4185 fi
4186
4187 echo "$as_me:4187: checking if you want to see long compiling messages" >&5
4188 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4189
4190 # Check whether --enable-echo or --disable-echo was given.
4191 if test "${enable_echo+set}" = set; then
4192   enableval="$enable_echo"
4193   test "$enableval" != no && enableval=yes
4194   if test "$enableval" != "yes" ; then
4195
4196         ECHO_LT='--silent'
4197         ECHO_LD='@echo linking $@;'
4198         RULE_CC='@echo compiling $<'
4199         SHOW_CC='@echo compiling $@'
4200         ECHO_CC='@'
4201
4202   else
4203
4204         ECHO_LT=''
4205         ECHO_LD=''
4206         RULE_CC=''
4207         SHOW_CC=''
4208         ECHO_CC=''
4209
4210   fi
4211 else
4212   enableval=yes
4213
4214         ECHO_LT=''
4215         ECHO_LD=''
4216         RULE_CC=''
4217         SHOW_CC=''
4218         ECHO_CC=''
4219
4220 fi;
4221 echo "$as_me:4221: result: $enableval" >&5
4222 echo "${ECHO_T}$enableval" >&6
4223
4224 echo "$as_me:4224: checking for ncurses wrap-prefix" >&5
4225 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4226
4227 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4228 if test "${with_ncurses_wrap_prefix+set}" = set; then
4229   withval="$with_ncurses_wrap_prefix"
4230   NCURSES_WRAP_PREFIX=$withval
4231 else
4232   NCURSES_WRAP_PREFIX=_nc_
4233 fi;
4234 echo "$as_me:4234: result: $NCURSES_WRAP_PREFIX" >&5
4235 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4236
4237 echo "$as_me:4237: checking if you want to check for wide-character functions" >&5
4238 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4239
4240 # Check whether --enable-widec or --disable-widec was given.
4241 if test "${enable_widec+set}" = set; then
4242   enableval="$enable_widec"
4243   test "$enableval" != no && enableval=yes
4244   if test "$enableval" != "yes" ; then
4245     cf_enable_widec=no
4246   else
4247     cf_enable_widec=yes
4248   fi
4249 else
4250   enableval=yes
4251   cf_enable_widec=yes
4252
4253 fi;
4254 echo "$as_me:4254: result: $cf_enable_widec" >&5
4255 echo "${ECHO_T}$cf_enable_widec" >&6
4256
4257 echo "$as_me:4257: checking for specific curses-directory" >&5
4258 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4259
4260 # Check whether --with-curses-dir or --without-curses-dir was given.
4261 if test "${with_curses_dir+set}" = set; then
4262   withval="$with_curses_dir"
4263   cf_cv_curses_dir=$withval
4264 else
4265   cf_cv_curses_dir=no
4266 fi;
4267 echo "$as_me:4267: result: $cf_cv_curses_dir" >&5
4268 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4269
4270 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4271 then
4272
4273 if test "x$prefix" != xNONE; then
4274         cf_path_syntax="$prefix"
4275 else
4276         cf_path_syntax="$ac_default_prefix"
4277 fi
4278
4279 case ".$withval" in
4280 (.\$\(*\)*|.\'*\'*)
4281         ;;
4282 (..|./*|.\\*)
4283         ;;
4284 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4285         ;;
4286 (.\${*prefix}*|.\${*dir}*)
4287         eval withval="$withval"
4288         case ".$withval" in
4289         (.NONE/*)
4290                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4291                 ;;
4292         esac
4293         ;;
4294 (.no|.NONE/*)
4295         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4296         ;;
4297 (*)
4298         { { echo "$as_me:4298: error: expected a pathname, not \"$withval\"" >&5
4299 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4300    { (exit 1); exit 1; }; }
4301         ;;
4302 esac
4303
4304         if test -d "$cf_cv_curses_dir"
4305         then
4306
4307 if test -n "$cf_cv_curses_dir/include" ; then
4308   for cf_add_incdir in $cf_cv_curses_dir/include
4309   do
4310         while test $cf_add_incdir != /usr/include
4311         do
4312           if test -d $cf_add_incdir
4313           then
4314                 cf_have_incdir=no
4315                 if test -n "$CFLAGS$CPPFLAGS" ; then
4316                   # a loop is needed to ensure we can add subdirs of existing dirs
4317                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4318                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4319                           cf_have_incdir=yes; break
4320                         fi
4321                   done
4322                 fi
4323
4324                 if test "$cf_have_incdir" = no ; then
4325                   if test "$cf_add_incdir" = /usr/local/include ; then
4326                         if test "$GCC" = yes
4327                         then
4328                           cf_save_CPPFLAGS=$CPPFLAGS
4329                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4330                           cat >conftest.$ac_ext <<_ACEOF
4331 #line 4331 "configure"
4332 #include "confdefs.h"
4333 #include <stdio.h>
4334 int
4335 main ()
4336 {
4337 printf("Hello")
4338   ;
4339   return 0;
4340 }
4341 _ACEOF
4342 rm -f conftest.$ac_objext
4343 if { (eval echo "$as_me:4343: \"$ac_compile\"") >&5
4344   (eval $ac_compile) 2>&5
4345   ac_status=$?
4346   echo "$as_me:4346: \$? = $ac_status" >&5
4347   (exit $ac_status); } &&
4348          { ac_try='test -s conftest.$ac_objext'
4349   { (eval echo "$as_me:4349: \"$ac_try\"") >&5
4350   (eval $ac_try) 2>&5
4351   ac_status=$?
4352   echo "$as_me:4352: \$? = $ac_status" >&5
4353   (exit $ac_status); }; }; then
4354   :
4355 else
4356   echo "$as_me: failed program was:" >&5
4357 cat conftest.$ac_ext >&5
4358 cf_have_incdir=yes
4359 fi
4360 rm -f conftest.$ac_objext conftest.$ac_ext
4361                           CPPFLAGS=$cf_save_CPPFLAGS
4362                         fi
4363                   fi
4364                 fi
4365
4366                 if test "$cf_have_incdir" = no ; then
4367                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4368
4369 echo "${as_me:-configure}:4369: testing adding $cf_add_incdir to include-path ..." 1>&5
4370
4371                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4372
4373                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4374                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4375                   cf_add_incdir="$cf_top_incdir"
4376                 else
4377                   break
4378                 fi
4379           fi
4380         done
4381   done
4382 fi
4383
4384 if test -n "$cf_cv_curses_dir/lib" ; then
4385         for cf_add_libdir in $cf_cv_curses_dir/lib
4386         do
4387                 if test $cf_add_libdir = /usr/lib ; then
4388                         :
4389                 elif test -d $cf_add_libdir
4390                 then
4391                         cf_have_libdir=no
4392                         if test -n "$LDFLAGS$LIBS" ; then
4393                                 # a loop is needed to ensure we can add subdirs of existing dirs
4394                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4395                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4396                                                 cf_have_libdir=yes; break
4397                                         fi
4398                                 done
4399                         fi
4400                         if test "$cf_have_libdir" = no ; then
4401                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4402
4403 echo "${as_me:-configure}:4403: testing adding $cf_add_libdir to library-path ..." 1>&5
4404
4405                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4406                         fi
4407                 fi
4408         done
4409 fi
4410
4411         fi
4412 fi
4413
4414 cf_cv_screen=curses
4415
4416 echo "$as_me:4416: checking for specified curses library type" >&5
4417 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4418
4419 # Check whether --with-ncursesw or --without-ncursesw was given.
4420 if test "${with_ncursesw+set}" = set; then
4421   withval="$with_ncursesw"
4422   cf_cv_screen=ncursesw
4423 else
4424
4425 # Check whether --with-ncurses or --without-ncurses was given.
4426 if test "${with_ncurses+set}" = set; then
4427   withval="$with_ncurses"
4428   cf_cv_screen=ncurses
4429 else
4430
4431 # Check whether --with-pdcurses or --without-pdcurses was given.
4432 if test "${with_pdcurses+set}" = set; then
4433   withval="$with_pdcurses"
4434   cf_cv_screen=pdcurses
4435 else
4436
4437 # Check whether --with-curses-colr or --without-curses-colr was given.
4438 if test "${with_curses_colr+set}" = set; then
4439   withval="$with_curses_colr"
4440   cf_cv_screen=curses_colr
4441 else
4442
4443 # Check whether --with-curses-5lib or --without-curses-5lib was given.
4444 if test "${with_curses_5lib+set}" = set; then
4445   withval="$with_curses_5lib"
4446   cf_cv_screen=curses_5lib
4447 fi;
4448 fi;
4449 fi;
4450 fi;
4451 fi;
4452
4453 echo "$as_me:4453: result: $cf_cv_screen" >&5
4454 echo "${ECHO_T}$cf_cv_screen" >&6
4455
4456 case $cf_cv_screen in
4457 (curses|curses_*)
4458
4459 echo "$as_me:4459: checking for extra include directories" >&5
4460 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4461 if test "${cf_cv_curses_incdir+set}" = set; then
4462   echo $ECHO_N "(cached) $ECHO_C" >&6
4463 else
4464
4465 cf_cv_curses_incdir=no
4466 case $host_os in
4467 (hpux10.*)
4468         if test "x$cf_cv_screen" = "xcurses_colr"
4469         then
4470                 test -d /usr/include/curses_colr && \
4471                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
4472         fi
4473         ;;
4474 (sunos3*|sunos4*)
4475         if test "x$cf_cv_screen" = "xcurses_5lib"
4476         then
4477                 test -d /usr/5lib && \
4478                 test -d /usr/5include && \
4479                 cf_cv_curses_incdir="-I/usr/5include"
4480         fi
4481         ;;
4482 esac
4483
4484 fi
4485 echo "$as_me:4485: result: $cf_cv_curses_incdir" >&5
4486 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4487 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4488
4489 echo "$as_me:4489: checking if we have identified curses headers" >&5
4490 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4491 if test "${cf_cv_ncurses_header+set}" = set; then
4492   echo $ECHO_N "(cached) $ECHO_C" >&6
4493 else
4494
4495 cf_cv_ncurses_header=none
4496 for cf_header in  \
4497         ncurses.h \
4498         curses.h ncurses/ncurses.h ncurses/curses.h
4499 do
4500 cat >conftest.$ac_ext <<_ACEOF
4501 #line 4501 "configure"
4502 #include "confdefs.h"
4503 #include <${cf_header}>
4504 int
4505 main ()
4506 {
4507 initscr(); tgoto("?", 0,0)
4508   ;
4509   return 0;
4510 }
4511 _ACEOF
4512 rm -f conftest.$ac_objext
4513 if { (eval echo "$as_me:4513: \"$ac_compile\"") >&5
4514   (eval $ac_compile) 2>&5
4515   ac_status=$?
4516   echo "$as_me:4516: \$? = $ac_status" >&5
4517   (exit $ac_status); } &&
4518          { ac_try='test -s conftest.$ac_objext'
4519   { (eval echo "$as_me:4519: \"$ac_try\"") >&5
4520   (eval $ac_try) 2>&5
4521   ac_status=$?
4522   echo "$as_me:4522: \$? = $ac_status" >&5
4523   (exit $ac_status); }; }; then
4524   cf_cv_ncurses_header=$cf_header; break
4525 else
4526   echo "$as_me: failed program was:" >&5
4527 cat conftest.$ac_ext >&5
4528 fi
4529 rm -f conftest.$ac_objext conftest.$ac_ext
4530 done
4531
4532 fi
4533 echo "$as_me:4533: result: $cf_cv_ncurses_header" >&5
4534 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4535
4536 if test "$cf_cv_ncurses_header" = none ; then
4537         { { echo "$as_me:4537: error: No curses header-files found" >&5
4538 echo "$as_me: error: No curses header-files found" >&2;}
4539    { (exit 1); exit 1; }; }
4540 fi
4541
4542 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4543
4544 for ac_header in $cf_cv_ncurses_header
4545 do
4546 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4547 echo "$as_me:4547: checking for $ac_header" >&5
4548 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4549 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4550   echo $ECHO_N "(cached) $ECHO_C" >&6
4551 else
4552   cat >conftest.$ac_ext <<_ACEOF
4553 #line 4553 "configure"
4554 #include "confdefs.h"
4555 #include <$ac_header>
4556 _ACEOF
4557 if { (eval echo "$as_me:4557: \"$ac_cpp conftest.$ac_ext\"") >&5
4558   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4559   ac_status=$?
4560   egrep -v '^ *\+' conftest.er1 >conftest.err
4561   rm -f conftest.er1
4562   cat conftest.err >&5
4563   echo "$as_me:4563: \$? = $ac_status" >&5
4564   (exit $ac_status); } >/dev/null; then
4565   if test -s conftest.err; then
4566     ac_cpp_err=$ac_c_preproc_warn_flag
4567   else
4568     ac_cpp_err=
4569   fi
4570 else
4571   ac_cpp_err=yes
4572 fi
4573 if test -z "$ac_cpp_err"; then
4574   eval "$as_ac_Header=yes"
4575 else
4576   echo "$as_me: failed program was:" >&5
4577   cat conftest.$ac_ext >&5
4578   eval "$as_ac_Header=no"
4579 fi
4580 rm -f conftest.err conftest.$ac_ext
4581 fi
4582 echo "$as_me:4582: result: `eval echo '${'$as_ac_Header'}'`" >&5
4583 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4584 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4585   cat >>confdefs.h <<EOF
4586 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4587 EOF
4588
4589 fi
4590 done
4591
4592 echo "$as_me:4592: checking for terminfo header" >&5
4593 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4594 if test "${cf_cv_term_header+set}" = set; then
4595   echo $ECHO_N "(cached) $ECHO_C" >&6
4596 else
4597
4598 case ${cf_cv_ncurses_header} in
4599 (*/ncurses.h|*/ncursesw.h)
4600         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4601         ;;
4602 (*)
4603         cf_term_header=term.h
4604         ;;
4605 esac
4606
4607 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4608 do
4609 cat >conftest.$ac_ext <<_ACEOF
4610 #line 4610 "configure"
4611 #include "confdefs.h"
4612 #include <stdio.h>
4613 #include <${cf_cv_ncurses_header:-curses.h}>
4614 #include <$cf_test>
4615
4616 int
4617 main ()
4618 {
4619 int x = auto_left_margin
4620   ;
4621   return 0;
4622 }
4623 _ACEOF
4624 rm -f conftest.$ac_objext
4625 if { (eval echo "$as_me:4625: \"$ac_compile\"") >&5
4626   (eval $ac_compile) 2>&5
4627   ac_status=$?
4628   echo "$as_me:4628: \$? = $ac_status" >&5
4629   (exit $ac_status); } &&
4630          { ac_try='test -s conftest.$ac_objext'
4631   { (eval echo "$as_me:4631: \"$ac_try\"") >&5
4632   (eval $ac_try) 2>&5
4633   ac_status=$?
4634   echo "$as_me:4634: \$? = $ac_status" >&5
4635   (exit $ac_status); }; }; then
4636
4637         cf_cv_term_header="$cf_test"
4638 else
4639   echo "$as_me: failed program was:" >&5
4640 cat conftest.$ac_ext >&5
4641
4642         cf_cv_term_header=unknown
4643
4644 fi
4645 rm -f conftest.$ac_objext conftest.$ac_ext
4646         test "$cf_cv_term_header" != unknown && break
4647 done
4648
4649 fi
4650 echo "$as_me:4650: result: $cf_cv_term_header" >&5
4651 echo "${ECHO_T}$cf_cv_term_header" >&6
4652
4653 # Set definitions to allow ifdef'ing to accommodate subdirectories
4654
4655 case $cf_cv_term_header in
4656 (*term.h)
4657
4658 cat >>confdefs.h <<\EOF
4659 #define HAVE_TERM_H 1
4660 EOF
4661
4662         ;;
4663 esac
4664
4665 case $cf_cv_term_header in
4666 (ncurses/term.h)
4667
4668 cat >>confdefs.h <<\EOF
4669 #define HAVE_NCURSES_TERM_H 1
4670 EOF
4671
4672         ;;
4673 (ncursesw/term.h)
4674
4675 cat >>confdefs.h <<\EOF
4676 #define HAVE_NCURSESW_TERM_H 1
4677 EOF
4678
4679         ;;
4680 esac
4681
4682 echo "$as_me:4682: checking for ncurses version" >&5
4683 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4684 if test "${cf_cv_ncurses_version+set}" = set; then
4685   echo $ECHO_N "(cached) $ECHO_C" >&6
4686 else
4687
4688         cf_cv_ncurses_version=no
4689         cf_tempfile=out$$
4690         rm -f $cf_tempfile
4691         if test "$cross_compiling" = yes; then
4692
4693         # This will not work if the preprocessor splits the line after the
4694         # Autoconf token.  The 'unproto' program does that.
4695         cat > conftest.$ac_ext <<EOF
4696 #include <${cf_cv_ncurses_header:-curses.h}>
4697 #undef Autoconf
4698 #ifdef NCURSES_VERSION
4699 Autoconf NCURSES_VERSION
4700 #else
4701 #ifdef __NCURSES_H
4702 Autoconf "old"
4703 #endif
4704 ;
4705 #endif
4706 EOF
4707         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4708         { (eval echo "$as_me:4708: \"$cf_try\"") >&5
4709   (eval $cf_try) 2>&5
4710   ac_status=$?
4711   echo "$as_me:4711: \$? = $ac_status" >&5
4712   (exit $ac_status); }
4713         if test -f conftest.out ; then
4714                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4715                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4716                 rm -f conftest.out
4717         fi
4718
4719 else
4720   cat >conftest.$ac_ext <<_ACEOF
4721 #line 4721 "configure"
4722 #include "confdefs.h"
4723
4724 #include <${cf_cv_ncurses_header:-curses.h}>
4725 #include <stdio.h>
4726 int main()
4727 {
4728         FILE *fp = fopen("$cf_tempfile", "w");
4729 #ifdef NCURSES_VERSION
4730 # ifdef NCURSES_VERSION_PATCH
4731         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4732 # else
4733         fprintf(fp, "%s\n", NCURSES_VERSION);
4734 # endif
4735 #else
4736 # ifdef __NCURSES_H
4737         fprintf(fp, "old\n");
4738 # else
4739         make an error
4740 # endif
4741 #endif
4742         ${cf_cv_main_return:-return}(0);
4743 }
4744 _ACEOF
4745 rm -f conftest$ac_exeext
4746 if { (eval echo "$as_me:4746: \"$ac_link\"") >&5
4747   (eval $ac_link) 2>&5
4748   ac_status=$?
4749   echo "$as_me:4749: \$? = $ac_status" >&5
4750   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4751   { (eval echo "$as_me:4751: \"$ac_try\"") >&5
4752   (eval $ac_try) 2>&5
4753   ac_status=$?
4754   echo "$as_me:4754: \$? = $ac_status" >&5
4755   (exit $ac_status); }; }; then
4756
4757         cf_cv_ncurses_version=`cat $cf_tempfile`
4758 else
4759   echo "$as_me: program exited with status $ac_status" >&5
4760 echo "$as_me: failed program was:" >&5
4761 cat conftest.$ac_ext >&5
4762 fi
4763 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4764 fi
4765         rm -f $cf_tempfile
4766
4767 fi
4768 echo "$as_me:4768: result: $cf_cv_ncurses_version" >&5
4769 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4770 test "$cf_cv_ncurses_version" = no ||
4771 cat >>confdefs.h <<\EOF
4772 #define NCURSES 1
4773 EOF
4774
4775 echo "$as_me:4775: checking if we have identified curses libraries" >&5
4776 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
4777 cat >conftest.$ac_ext <<_ACEOF
4778 #line 4778 "configure"
4779 #include "confdefs.h"
4780 #include <${cf_cv_ncurses_header:-curses.h}>
4781 int
4782 main ()
4783 {
4784 initscr(); tgoto("?", 0,0)
4785   ;
4786   return 0;
4787 }
4788 _ACEOF
4789 rm -f conftest.$ac_objext conftest$ac_exeext
4790 if { (eval echo "$as_me:4790: \"$ac_link\"") >&5
4791   (eval $ac_link) 2>&5
4792   ac_status=$?
4793   echo "$as_me:4793: \$? = $ac_status" >&5
4794   (exit $ac_status); } &&
4795          { ac_try='test -s conftest$ac_exeext'
4796   { (eval echo "$as_me:4796: \"$ac_try\"") >&5
4797   (eval $ac_try) 2>&5
4798   ac_status=$?
4799   echo "$as_me:4799: \$? = $ac_status" >&5
4800   (exit $ac_status); }; }; then
4801   cf_result=yes
4802 else
4803   echo "$as_me: failed program was:" >&5
4804 cat conftest.$ac_ext >&5
4805 cf_result=no
4806 fi
4807 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4808 echo "$as_me:4808: result: $cf_result" >&5
4809 echo "${ECHO_T}$cf_result" >&6
4810
4811 if test "$cf_result" = no ; then
4812 case $host_os in
4813 (freebsd*)
4814     echo "$as_me:4814: checking for tgoto in -lmytinfo" >&5
4815 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4816 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4817   echo $ECHO_N "(cached) $ECHO_C" >&6
4818 else
4819   ac_check_lib_save_LIBS=$LIBS
4820 LIBS="-lmytinfo  $LIBS"
4821 cat >conftest.$ac_ext <<_ACEOF
4822 #line 4822 "configure"
4823 #include "confdefs.h"
4824
4825 /* Override any gcc2 internal prototype to avoid an error.  */
4826 #ifdef __cplusplus
4827 extern "C"
4828 #endif
4829 /* We use char because int might match the return type of a gcc2
4830    builtin and then its argument prototype would still apply.  */
4831 char tgoto ();
4832 int
4833 main ()
4834 {
4835 tgoto ();
4836   ;
4837   return 0;
4838 }
4839 _ACEOF
4840 rm -f conftest.$ac_objext conftest$ac_exeext
4841 if { (eval echo "$as_me:4841: \"$ac_link\"") >&5
4842   (eval $ac_link) 2>&5
4843   ac_status=$?
4844   echo "$as_me:4844: \$? = $ac_status" >&5
4845   (exit $ac_status); } &&
4846          { ac_try='test -s conftest$ac_exeext'
4847   { (eval echo "$as_me:4847: \"$ac_try\"") >&5
4848   (eval $ac_try) 2>&5
4849   ac_status=$?
4850   echo "$as_me:4850: \$? = $ac_status" >&5
4851   (exit $ac_status); }; }; then
4852   ac_cv_lib_mytinfo_tgoto=yes
4853 else
4854   echo "$as_me: failed program was:" >&5
4855 cat conftest.$ac_ext >&5
4856 ac_cv_lib_mytinfo_tgoto=no
4857 fi
4858 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4859 LIBS=$ac_check_lib_save_LIBS
4860 fi
4861 echo "$as_me:4861: result: $ac_cv_lib_mytinfo_tgoto" >&5
4862 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4863 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4864
4865 cf_add_libs="-lmytinfo"
4866 # Filter out duplicates - this happens with badly-designed ".pc" files...
4867 for cf_add_1lib in $LIBS
4868 do
4869         for cf_add_2lib in $cf_add_libs
4870         do
4871                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4872                 then
4873                         cf_add_1lib=
4874                         break
4875                 fi
4876         done
4877         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4878 done
4879 LIBS="$cf_add_libs"
4880
4881 fi
4882
4883     ;;
4884 (hpux10.*)
4885         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
4886         # next (1998), and xcurses "newer" (2000).  There is no header file for
4887         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
4888         # term.h) for cur_colr
4889         if test "x$cf_cv_screen" = "xcurses_colr"
4890         then
4891                 echo "$as_me:4891: checking for initscr in -lcur_colr" >&5
4892 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
4893 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
4894   echo $ECHO_N "(cached) $ECHO_C" >&6
4895 else
4896   ac_check_lib_save_LIBS=$LIBS
4897 LIBS="-lcur_colr  $LIBS"
4898 cat >conftest.$ac_ext <<_ACEOF
4899 #line 4899 "configure"
4900 #include "confdefs.h"
4901
4902 /* Override any gcc2 internal prototype to avoid an error.  */
4903 #ifdef __cplusplus
4904 extern "C"
4905 #endif
4906 /* We use char because int might match the return type of a gcc2
4907    builtin and then its argument prototype would still apply.  */
4908 char initscr ();
4909 int
4910 main ()
4911 {
4912 initscr ();
4913   ;
4914   return 0;
4915 }
4916 _ACEOF
4917 rm -f conftest.$ac_objext conftest$ac_exeext
4918 if { (eval echo "$as_me:4918: \"$ac_link\"") >&5
4919   (eval $ac_link) 2>&5
4920   ac_status=$?
4921   echo "$as_me:4921: \$? = $ac_status" >&5
4922   (exit $ac_status); } &&
4923          { ac_try='test -s conftest$ac_exeext'
4924   { (eval echo "$as_me:4924: \"$ac_try\"") >&5
4925   (eval $ac_try) 2>&5
4926   ac_status=$?
4927   echo "$as_me:4927: \$? = $ac_status" >&5
4928   (exit $ac_status); }; }; then
4929   ac_cv_lib_cur_colr_initscr=yes
4930 else
4931   echo "$as_me: failed program was:" >&5
4932 cat conftest.$ac_ext >&5
4933 ac_cv_lib_cur_colr_initscr=no
4934 fi
4935 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4936 LIBS=$ac_check_lib_save_LIBS
4937 fi
4938 echo "$as_me:4938: result: $ac_cv_lib_cur_colr_initscr" >&5
4939 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
4940 if test $ac_cv_lib_cur_colr_initscr = yes; then
4941
4942 cf_add_libs="-lcur_colr"
4943 # Filter out duplicates - this happens with badly-designed ".pc" files...
4944 for cf_add_1lib in $LIBS
4945 do
4946         for cf_add_2lib in $cf_add_libs
4947         do
4948                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4949                 then
4950                         cf_add_1lib=
4951                         break
4952                 fi
4953         done
4954         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4955 done
4956 LIBS="$cf_add_libs"
4957
4958                         ac_cv_func_initscr=yes
4959
4960 else
4961
4962                 echo "$as_me:4962: checking for initscr in -lHcurses" >&5
4963 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
4964 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
4965   echo $ECHO_N "(cached) $ECHO_C" >&6
4966 else
4967   ac_check_lib_save_LIBS=$LIBS
4968 LIBS="-lHcurses  $LIBS"
4969 cat >conftest.$ac_ext <<_ACEOF
4970 #line 4970 "configure"
4971 #include "confdefs.h"
4972
4973 /* Override any gcc2 internal prototype to avoid an error.  */
4974 #ifdef __cplusplus
4975 extern "C"
4976 #endif
4977 /* We use char because int might match the return type of a gcc2
4978    builtin and then its argument prototype would still apply.  */
4979 char initscr ();
4980 int
4981 main ()
4982 {
4983 initscr ();
4984   ;
4985   return 0;
4986 }
4987 _ACEOF
4988 rm -f conftest.$ac_objext conftest$ac_exeext
4989 if { (eval echo "$as_me:4989: \"$ac_link\"") >&5
4990   (eval $ac_link) 2>&5
4991   ac_status=$?
4992   echo "$as_me:4992: \$? = $ac_status" >&5
4993   (exit $ac_status); } &&
4994          { ac_try='test -s conftest$ac_exeext'
4995   { (eval echo "$as_me:4995: \"$ac_try\"") >&5
4996   (eval $ac_try) 2>&5
4997   ac_status=$?
4998   echo "$as_me:4998: \$? = $ac_status" >&5
4999   (exit $ac_status); }; }; then
5000   ac_cv_lib_Hcurses_initscr=yes
5001 else
5002   echo "$as_me: failed program was:" >&5
5003 cat conftest.$ac_ext >&5
5004 ac_cv_lib_Hcurses_initscr=no
5005 fi
5006 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5007 LIBS=$ac_check_lib_save_LIBS
5008 fi
5009 echo "$as_me:5009: result: $ac_cv_lib_Hcurses_initscr" >&5
5010 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5011 if test $ac_cv_lib_Hcurses_initscr = yes; then
5012
5013                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5014
5015 cf_add_libs="-lHcurses"
5016 # Filter out duplicates - this happens with badly-designed ".pc" files...
5017 for cf_add_1lib in $LIBS
5018 do
5019         for cf_add_2lib in $cf_add_libs
5020         do
5021                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5022                 then
5023                         cf_add_1lib=
5024                         break
5025                 fi
5026         done
5027         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5028 done
5029 LIBS="$cf_add_libs"
5030
5031                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5032                         ac_cv_func_initscr=yes
5033
5034 fi
5035
5036 fi
5037
5038         fi
5039         ;;
5040 (linux*)
5041         case `arch 2>/dev/null` in
5042         (x86_64)
5043                 if test -d /lib64
5044                 then
5045
5046 if test -n "/lib64" ; then
5047         for cf_add_libdir in /lib64
5048         do
5049                 if test $cf_add_libdir = /usr/lib ; then
5050                         :
5051                 elif test -d $cf_add_libdir
5052                 then
5053                         cf_have_libdir=no
5054                         if test -n "$LDFLAGS$LIBS" ; then
5055                                 # a loop is needed to ensure we can add subdirs of existing dirs
5056                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5057                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5058                                                 cf_have_libdir=yes; break
5059                                         fi
5060                                 done
5061                         fi
5062                         if test "$cf_have_libdir" = no ; then
5063                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5064
5065 echo "${as_me:-configure}:5065: testing adding $cf_add_libdir to library-path ..." 1>&5
5066
5067                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5068                         fi
5069                 fi
5070         done
5071 fi
5072
5073                 else
5074
5075 if test -n "/lib" ; then
5076         for cf_add_libdir in /lib
5077         do
5078                 if test $cf_add_libdir = /usr/lib ; then
5079                         :
5080                 elif test -d $cf_add_libdir
5081                 then
5082                         cf_have_libdir=no
5083                         if test -n "$LDFLAGS$LIBS" ; then
5084                                 # a loop is needed to ensure we can add subdirs of existing dirs
5085                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5086                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5087                                                 cf_have_libdir=yes; break
5088                                         fi
5089                                 done
5090                         fi
5091                         if test "$cf_have_libdir" = no ; then
5092                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5093
5094 echo "${as_me:-configure}:5094: testing adding $cf_add_libdir to library-path ..." 1>&5
5095
5096                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5097                         fi
5098                 fi
5099         done
5100 fi
5101
5102                 fi
5103                 ;;
5104         (*)
5105
5106 if test -n "/lib" ; then
5107         for cf_add_libdir in /lib
5108         do
5109                 if test $cf_add_libdir = /usr/lib ; then
5110                         :
5111                 elif test -d $cf_add_libdir
5112                 then
5113                         cf_have_libdir=no
5114                         if test -n "$LDFLAGS$LIBS" ; then
5115                                 # a loop is needed to ensure we can add subdirs of existing dirs
5116                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5117                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5118                                                 cf_have_libdir=yes; break
5119                                         fi
5120                                 done
5121                         fi
5122                         if test "$cf_have_libdir" = no ; then
5123                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5124
5125 echo "${as_me:-configure}:5125: testing adding $cf_add_libdir to library-path ..." 1>&5
5126
5127                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5128                         fi
5129                 fi
5130         done
5131 fi
5132
5133                 ;;
5134         esac
5135         ;;
5136 (sunos3*|sunos4*)
5137         if test "x$cf_cv_screen" = "xcurses_5lib"
5138         then
5139                 if test -d /usr/5lib ; then
5140
5141 if test -n "/usr/5lib" ; then
5142         for cf_add_libdir in /usr/5lib
5143         do
5144                 if test $cf_add_libdir = /usr/lib ; then
5145                         :
5146                 elif test -d $cf_add_libdir
5147                 then
5148                         cf_have_libdir=no
5149                         if test -n "$LDFLAGS$LIBS" ; then
5150                                 # a loop is needed to ensure we can add subdirs of existing dirs
5151                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5152                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5153                                                 cf_have_libdir=yes; break
5154                                         fi
5155                                 done
5156                         fi
5157                         if test "$cf_have_libdir" = no ; then
5158                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5159
5160 echo "${as_me:-configure}:5160: testing adding $cf_add_libdir to library-path ..." 1>&5
5161
5162                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5163                         fi
5164                 fi
5165         done
5166 fi
5167
5168 cf_add_libs="-lcurses -ltermcap"
5169 # Filter out duplicates - this happens with badly-designed ".pc" files...
5170 for cf_add_1lib in $LIBS
5171 do
5172         for cf_add_2lib in $cf_add_libs
5173         do
5174                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5175                 then
5176                         cf_add_1lib=
5177                         break
5178                 fi
5179         done
5180         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5181 done
5182 LIBS="$cf_add_libs"
5183
5184                 fi
5185     fi
5186     ac_cv_func_initscr=yes
5187     ;;
5188 esac
5189
5190 if test ".$ac_cv_func_initscr" != .yes ; then
5191         cf_save_LIBS="$LIBS"
5192
5193         if test ".${cf_cv_ncurses_version:-no}" != .no
5194         then
5195                 cf_check_list="ncurses curses cursesX"
5196         else
5197                 cf_check_list="cursesX curses ncurses"
5198         fi
5199
5200         # Check for library containing tgoto.  Do this before curses library
5201         # because it may be needed to link the test-case for initscr.
5202         if test "x$cf_term_lib" = x
5203         then
5204                 echo "$as_me:5204: checking for tgoto" >&5
5205 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5206 if test "${ac_cv_func_tgoto+set}" = set; then
5207   echo $ECHO_N "(cached) $ECHO_C" >&6
5208 else
5209   cat >conftest.$ac_ext <<_ACEOF
5210 #line 5210 "configure"
5211 #include "confdefs.h"
5212 /* System header to define __stub macros and hopefully few prototypes,
5213     which can conflict with char tgoto (); below.  */
5214 #include <assert.h>
5215 /* Override any gcc2 internal prototype to avoid an error.  */
5216 #ifdef __cplusplus
5217 extern "C"
5218 #endif
5219 /* We use char because int might match the return type of a gcc2
5220    builtin and then its argument prototype would still apply.  */
5221 char tgoto ();
5222 char (*f) ();
5223
5224 int
5225 main ()
5226 {
5227 /* The GNU C library defines this for functions which it implements
5228     to always fail with ENOSYS.  Some functions are actually named
5229     something starting with __ and the normal name is an alias.  */
5230 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5231 choke me
5232 #else
5233 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5234 #endif
5235
5236   ;
5237   return 0;
5238 }
5239 _ACEOF
5240 rm -f conftest.$ac_objext conftest$ac_exeext
5241 if { (eval echo "$as_me:5241: \"$ac_link\"") >&5
5242   (eval $ac_link) 2>&5
5243   ac_status=$?
5244   echo "$as_me:5244: \$? = $ac_status" >&5
5245   (exit $ac_status); } &&
5246          { ac_try='test -s conftest$ac_exeext'
5247   { (eval echo "$as_me:5247: \"$ac_try\"") >&5
5248   (eval $ac_try) 2>&5
5249   ac_status=$?
5250   echo "$as_me:5250: \$? = $ac_status" >&5
5251   (exit $ac_status); }; }; then
5252   ac_cv_func_tgoto=yes
5253 else
5254   echo "$as_me: failed program was:" >&5
5255 cat conftest.$ac_ext >&5
5256 ac_cv_func_tgoto=no
5257 fi
5258 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5259 fi
5260 echo "$as_me:5260: result: $ac_cv_func_tgoto" >&5
5261 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5262 if test $ac_cv_func_tgoto = yes; then
5263   cf_term_lib=predefined
5264 else
5265
5266                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5267                         do
5268                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5269 echo "$as_me:5269: checking for tgoto in -l$cf_term_lib" >&5
5270 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5271 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5272   echo $ECHO_N "(cached) $ECHO_C" >&6
5273 else
5274   ac_check_lib_save_LIBS=$LIBS
5275 LIBS="-l$cf_term_lib  $LIBS"
5276 cat >conftest.$ac_ext <<_ACEOF
5277 #line 5277 "configure"
5278 #include "confdefs.h"
5279
5280 /* Override any gcc2 internal prototype to avoid an error.  */
5281 #ifdef __cplusplus
5282 extern "C"
5283 #endif
5284 /* We use char because int might match the return type of a gcc2
5285    builtin and then its argument prototype would still apply.  */
5286 char tgoto ();
5287 int
5288 main ()
5289 {
5290 tgoto ();
5291   ;
5292   return 0;
5293 }
5294 _ACEOF
5295 rm -f conftest.$ac_objext conftest$ac_exeext
5296 if { (eval echo "$as_me:5296: \"$ac_link\"") >&5
5297   (eval $ac_link) 2>&5
5298   ac_status=$?
5299   echo "$as_me:5299: \$? = $ac_status" >&5
5300   (exit $ac_status); } &&
5301          { ac_try='test -s conftest$ac_exeext'
5302   { (eval echo "$as_me:5302: \"$ac_try\"") >&5
5303   (eval $ac_try) 2>&5
5304   ac_status=$?
5305   echo "$as_me:5305: \$? = $ac_status" >&5
5306   (exit $ac_status); }; }; then
5307   eval "$as_ac_Lib=yes"
5308 else
5309   echo "$as_me: failed program was:" >&5
5310 cat conftest.$ac_ext >&5
5311 eval "$as_ac_Lib=no"
5312 fi
5313 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5314 LIBS=$ac_check_lib_save_LIBS
5315 fi
5316 echo "$as_me:5316: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5317 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5318 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5319   break
5320 fi
5321
5322                         done
5323
5324 fi
5325
5326         fi
5327
5328         # Check for library containing initscr
5329         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5330         if test "x$cf_curs_lib" = x
5331         then
5332                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5333                 do
5334                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5335 echo "$as_me:5335: checking for initscr in -l$cf_curs_lib" >&5
5336 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5337 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5338   echo $ECHO_N "(cached) $ECHO_C" >&6
5339 else
5340   ac_check_lib_save_LIBS=$LIBS
5341 LIBS="-l$cf_curs_lib  $LIBS"
5342 cat >conftest.$ac_ext <<_ACEOF
5343 #line 5343 "configure"
5344 #include "confdefs.h"
5345
5346 /* Override any gcc2 internal prototype to avoid an error.  */
5347 #ifdef __cplusplus
5348 extern "C"
5349 #endif
5350 /* We use char because int might match the return type of a gcc2
5351    builtin and then its argument prototype would still apply.  */
5352 char initscr ();
5353 int
5354 main ()
5355 {
5356 initscr ();
5357   ;
5358   return 0;
5359 }
5360 _ACEOF
5361 rm -f conftest.$ac_objext conftest$ac_exeext
5362 if { (eval echo "$as_me:5362: \"$ac_link\"") >&5
5363   (eval $ac_link) 2>&5
5364   ac_status=$?
5365   echo "$as_me:5365: \$? = $ac_status" >&5
5366   (exit $ac_status); } &&
5367          { ac_try='test -s conftest$ac_exeext'
5368   { (eval echo "$as_me:5368: \"$ac_try\"") >&5
5369   (eval $ac_try) 2>&5
5370   ac_status=$?
5371   echo "$as_me:5371: \$? = $ac_status" >&5
5372   (exit $ac_status); }; }; then
5373   eval "$as_ac_Lib=yes"
5374 else
5375   echo "$as_me: failed program was:" >&5
5376 cat conftest.$ac_ext >&5
5377 eval "$as_ac_Lib=no"
5378 fi
5379 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5380 LIBS=$ac_check_lib_save_LIBS
5381 fi
5382 echo "$as_me:5382: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5383 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5384 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5385   break
5386 fi
5387
5388                 done
5389         fi
5390         test $cf_curs_lib = unknown && { { echo "$as_me:5390: error: no curses library found" >&5
5391 echo "$as_me: error: no curses library found" >&2;}
5392    { (exit 1); exit 1; }; }
5393
5394         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5395         if test "$cf_term_lib" = unknown ; then
5396                 echo "$as_me:5396: checking if we can link with $cf_curs_lib library" >&5
5397 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5398                 cat >conftest.$ac_ext <<_ACEOF
5399 #line 5399 "configure"
5400 #include "confdefs.h"
5401 #include <${cf_cv_ncurses_header:-curses.h}>
5402 int
5403 main ()
5404 {
5405 initscr()
5406   ;
5407   return 0;
5408 }
5409 _ACEOF
5410 rm -f conftest.$ac_objext conftest$ac_exeext
5411 if { (eval echo "$as_me:5411: \"$ac_link\"") >&5
5412   (eval $ac_link) 2>&5
5413   ac_status=$?
5414   echo "$as_me:5414: \$? = $ac_status" >&5
5415   (exit $ac_status); } &&
5416          { ac_try='test -s conftest$ac_exeext'
5417   { (eval echo "$as_me:5417: \"$ac_try\"") >&5
5418   (eval $ac_try) 2>&5
5419   ac_status=$?
5420   echo "$as_me:5420: \$? = $ac_status" >&5
5421   (exit $ac_status); }; }; then
5422   cf_result=yes
5423 else
5424   echo "$as_me: failed program was:" >&5
5425 cat conftest.$ac_ext >&5
5426 cf_result=no
5427 fi
5428 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5429                 echo "$as_me:5429: result: $cf_result" >&5
5430 echo "${ECHO_T}$cf_result" >&6
5431                 test $cf_result = no && { { echo "$as_me:5431: error: Cannot link curses library" >&5
5432 echo "$as_me: error: Cannot link curses library" >&2;}
5433    { (exit 1); exit 1; }; }
5434         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5435                 :
5436         elif test "$cf_term_lib" != predefined ; then
5437                 echo "$as_me:5437: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5438 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5439                 cat >conftest.$ac_ext <<_ACEOF
5440 #line 5440 "configure"
5441 #include "confdefs.h"
5442 #include <${cf_cv_ncurses_header:-curses.h}>
5443 int
5444 main ()
5445 {
5446 initscr(); tgoto((char *)0, 0, 0);
5447   ;
5448   return 0;
5449 }
5450 _ACEOF
5451 rm -f conftest.$ac_objext conftest$ac_exeext
5452 if { (eval echo "$as_me:5452: \"$ac_link\"") >&5
5453   (eval $ac_link) 2>&5
5454   ac_status=$?
5455   echo "$as_me:5455: \$? = $ac_status" >&5
5456   (exit $ac_status); } &&
5457          { ac_try='test -s conftest$ac_exeext'
5458   { (eval echo "$as_me:5458: \"$ac_try\"") >&5
5459   (eval $ac_try) 2>&5
5460   ac_status=$?
5461   echo "$as_me:5461: \$? = $ac_status" >&5
5462   (exit $ac_status); }; }; then
5463   cf_result=no
5464 else
5465   echo "$as_me: failed program was:" >&5
5466 cat conftest.$ac_ext >&5
5467
5468                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5469                         cat >conftest.$ac_ext <<_ACEOF
5470 #line 5470 "configure"
5471 #include "confdefs.h"
5472 #include <${cf_cv_ncurses_header:-curses.h}>
5473 int
5474 main ()
5475 {
5476 initscr()
5477   ;
5478   return 0;
5479 }
5480 _ACEOF
5481 rm -f conftest.$ac_objext conftest$ac_exeext
5482 if { (eval echo "$as_me:5482: \"$ac_link\"") >&5
5483   (eval $ac_link) 2>&5
5484   ac_status=$?
5485   echo "$as_me:5485: \$? = $ac_status" >&5
5486   (exit $ac_status); } &&
5487          { ac_try='test -s conftest$ac_exeext'
5488   { (eval echo "$as_me:5488: \"$ac_try\"") >&5
5489   (eval $ac_try) 2>&5
5490   ac_status=$?
5491   echo "$as_me:5491: \$? = $ac_status" >&5
5492   (exit $ac_status); }; }; then
5493   cf_result=yes
5494 else
5495   echo "$as_me: failed program was:" >&5
5496 cat conftest.$ac_ext >&5
5497 cf_result=error
5498 fi
5499 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5500
5501 fi
5502 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5503                 echo "$as_me:5503: result: $cf_result" >&5
5504 echo "${ECHO_T}$cf_result" >&6
5505         fi
5506 fi
5507 fi
5508
5509         ;;
5510 (ncurses)
5511
5512 cf_ncuconfig_root=ncurses
5513
5514 echo "Looking for ${cf_ncuconfig_root}-config"
5515
5516 if test -n "$ac_tool_prefix"; then
5517   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5518   do
5519     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5520 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5521 echo "$as_me:5521: checking for $ac_word" >&5
5522 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5523 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5524   echo $ECHO_N "(cached) $ECHO_C" >&6
5525 else
5526   if test -n "$NCURSES_CONFIG"; then
5527   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5528 else
5529   ac_save_IFS=$IFS; IFS=$ac_path_separator
5530 ac_dummy="$PATH"
5531 for ac_dir in $ac_dummy; do
5532   IFS=$ac_save_IFS
5533   test -z "$ac_dir" && ac_dir=.
5534   $as_executable_p "$ac_dir/$ac_word" || continue
5535 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5536 echo "$as_me:5536: found $ac_dir/$ac_word" >&5
5537 break
5538 done
5539
5540 fi
5541 fi
5542 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5543 if test -n "$NCURSES_CONFIG"; then
5544   echo "$as_me:5544: result: $NCURSES_CONFIG" >&5
5545 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5546 else
5547   echo "$as_me:5547: result: no" >&5
5548 echo "${ECHO_T}no" >&6
5549 fi
5550
5551     test -n "$NCURSES_CONFIG" && break
5552   done
5553 fi
5554 if test -z "$NCURSES_CONFIG"; then
5555   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5556   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5557 do
5558   # Extract the first word of "$ac_prog", so it can be a program name with args.
5559 set dummy $ac_prog; ac_word=$2
5560 echo "$as_me:5560: checking for $ac_word" >&5
5561 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5562 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5563   echo $ECHO_N "(cached) $ECHO_C" >&6
5564 else
5565   if test -n "$ac_ct_NCURSES_CONFIG"; then
5566   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5567 else
5568   ac_save_IFS=$IFS; IFS=$ac_path_separator
5569 ac_dummy="$PATH"
5570 for ac_dir in $ac_dummy; do
5571   IFS=$ac_save_IFS
5572   test -z "$ac_dir" && ac_dir=.
5573   $as_executable_p "$ac_dir/$ac_word" || continue
5574 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5575 echo "$as_me:5575: found $ac_dir/$ac_word" >&5
5576 break
5577 done
5578
5579 fi
5580 fi
5581 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5582 if test -n "$ac_ct_NCURSES_CONFIG"; then
5583   echo "$as_me:5583: result: $ac_ct_NCURSES_CONFIG" >&5
5584 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5585 else
5586   echo "$as_me:5586: result: no" >&5
5587 echo "${ECHO_T}no" >&6
5588 fi
5589
5590   test -n "$ac_ct_NCURSES_CONFIG" && break
5591 done
5592 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5593
5594   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5595 fi
5596
5597 if test "$NCURSES_CONFIG" != none ; then
5598
5599 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5600
5601 cf_add_libs="`$NCURSES_CONFIG --libs`"
5602 # Filter out duplicates - this happens with badly-designed ".pc" files...
5603 for cf_add_1lib in $LIBS
5604 do
5605         for cf_add_2lib in $cf_add_libs
5606         do
5607                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5608                 then
5609                         cf_add_1lib=
5610                         break
5611                 fi
5612         done
5613         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5614 done
5615 LIBS="$cf_add_libs"
5616
5617 # even with config script, some packages use no-override for curses.h
5618
5619 echo "$as_me:5619: checking if we have identified curses headers" >&5
5620 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5621 if test "${cf_cv_ncurses_header+set}" = set; then
5622   echo $ECHO_N "(cached) $ECHO_C" >&6
5623 else
5624
5625 cf_cv_ncurses_header=none
5626 for cf_header in  \
5627         ncurses/ncurses.h \
5628         ncurses/curses.h \
5629         ncurses.h \
5630         curses.h
5631 do
5632 cat >conftest.$ac_ext <<_ACEOF
5633 #line 5633 "configure"
5634 #include "confdefs.h"
5635 #include <${cf_header}>
5636 int
5637 main ()
5638 {
5639 initscr(); tgoto("?", 0,0)
5640   ;
5641   return 0;
5642 }
5643 _ACEOF
5644 rm -f conftest.$ac_objext
5645 if { (eval echo "$as_me:5645: \"$ac_compile\"") >&5
5646   (eval $ac_compile) 2>&5
5647   ac_status=$?
5648   echo "$as_me:5648: \$? = $ac_status" >&5
5649   (exit $ac_status); } &&
5650          { ac_try='test -s conftest.$ac_objext'
5651   { (eval echo "$as_me:5651: \"$ac_try\"") >&5
5652   (eval $ac_try) 2>&5
5653   ac_status=$?
5654   echo "$as_me:5654: \$? = $ac_status" >&5
5655   (exit $ac_status); }; }; then
5656   cf_cv_ncurses_header=$cf_header; break
5657 else
5658   echo "$as_me: failed program was:" >&5
5659 cat conftest.$ac_ext >&5
5660 fi
5661 rm -f conftest.$ac_objext conftest.$ac_ext
5662 done
5663
5664 fi
5665 echo "$as_me:5665: result: $cf_cv_ncurses_header" >&5
5666 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5667
5668 if test "$cf_cv_ncurses_header" = none ; then
5669         { { echo "$as_me:5669: error: No curses header-files found" >&5
5670 echo "$as_me: error: No curses header-files found" >&2;}
5671    { (exit 1); exit 1; }; }
5672 fi
5673
5674 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5675
5676 for ac_header in $cf_cv_ncurses_header
5677 do
5678 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5679 echo "$as_me:5679: checking for $ac_header" >&5
5680 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5681 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5682   echo $ECHO_N "(cached) $ECHO_C" >&6
5683 else
5684   cat >conftest.$ac_ext <<_ACEOF
5685 #line 5685 "configure"
5686 #include "confdefs.h"
5687 #include <$ac_header>
5688 _ACEOF
5689 if { (eval echo "$as_me:5689: \"$ac_cpp conftest.$ac_ext\"") >&5
5690   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5691   ac_status=$?
5692   egrep -v '^ *\+' conftest.er1 >conftest.err
5693   rm -f conftest.er1
5694   cat conftest.err >&5
5695   echo "$as_me:5695: \$? = $ac_status" >&5
5696   (exit $ac_status); } >/dev/null; then
5697   if test -s conftest.err; then
5698     ac_cpp_err=$ac_c_preproc_warn_flag
5699   else
5700     ac_cpp_err=
5701   fi
5702 else
5703   ac_cpp_err=yes
5704 fi
5705 if test -z "$ac_cpp_err"; then
5706   eval "$as_ac_Header=yes"
5707 else
5708   echo "$as_me: failed program was:" >&5
5709   cat conftest.$ac_ext >&5
5710   eval "$as_ac_Header=no"
5711 fi
5712 rm -f conftest.err conftest.$ac_ext
5713 fi
5714 echo "$as_me:5714: result: `eval echo '${'$as_ac_Header'}'`" >&5
5715 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5716 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5717   cat >>confdefs.h <<EOF
5718 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5719 EOF
5720
5721 fi
5722 done
5723
5724 cat >>confdefs.h <<\EOF
5725 #define NCURSES 1
5726 EOF
5727
5728 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5729
5730 cat >>confdefs.h <<EOF
5731 #define $cf_nculib_ROOT 1
5732 EOF
5733
5734 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5735
5736 else
5737
5738 cf_ncuhdr_root=ncurses
5739
5740 test -n "$cf_cv_curses_dir" && \
5741 test "$cf_cv_curses_dir" != "no" && { \
5742
5743 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5744   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5745   do
5746         while test $cf_add_incdir != /usr/include
5747         do
5748           if test -d $cf_add_incdir
5749           then
5750                 cf_have_incdir=no
5751                 if test -n "$CFLAGS$CPPFLAGS" ; then
5752                   # a loop is needed to ensure we can add subdirs of existing dirs
5753                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5754                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5755                           cf_have_incdir=yes; break
5756                         fi
5757                   done
5758                 fi
5759
5760                 if test "$cf_have_incdir" = no ; then
5761                   if test "$cf_add_incdir" = /usr/local/include ; then
5762                         if test "$GCC" = yes
5763                         then
5764                           cf_save_CPPFLAGS=$CPPFLAGS
5765                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5766                           cat >conftest.$ac_ext <<_ACEOF
5767 #line 5767 "configure"
5768 #include "confdefs.h"
5769 #include <stdio.h>
5770 int
5771 main ()
5772 {
5773 printf("Hello")
5774   ;
5775   return 0;
5776 }
5777 _ACEOF
5778 rm -f conftest.$ac_objext
5779 if { (eval echo "$as_me:5779: \"$ac_compile\"") >&5
5780   (eval $ac_compile) 2>&5
5781   ac_status=$?
5782   echo "$as_me:5782: \$? = $ac_status" >&5
5783   (exit $ac_status); } &&
5784          { ac_try='test -s conftest.$ac_objext'
5785   { (eval echo "$as_me:5785: \"$ac_try\"") >&5
5786   (eval $ac_try) 2>&5
5787   ac_status=$?
5788   echo "$as_me:5788: \$? = $ac_status" >&5
5789   (exit $ac_status); }; }; then
5790   :
5791 else
5792   echo "$as_me: failed program was:" >&5
5793 cat conftest.$ac_ext >&5
5794 cf_have_incdir=yes
5795 fi
5796 rm -f conftest.$ac_objext conftest.$ac_ext
5797                           CPPFLAGS=$cf_save_CPPFLAGS
5798                         fi
5799                   fi
5800                 fi
5801
5802                 if test "$cf_have_incdir" = no ; then
5803                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5804
5805 echo "${as_me:-configure}:5805: testing adding $cf_add_incdir to include-path ..." 1>&5
5806
5807                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5808
5809                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5810                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5811                   cf_add_incdir="$cf_top_incdir"
5812                 else
5813                   break
5814                 fi
5815           fi
5816         done
5817   done
5818 fi
5819
5820 }
5821
5822 echo "$as_me:5822: checking for $cf_ncuhdr_root header in include-path" >&5
5823 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5824 if test "${cf_cv_ncurses_h+set}" = set; then
5825   echo $ECHO_N "(cached) $ECHO_C" >&6
5826 else
5827
5828         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5829         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5830         for cf_header in $cf_header_list
5831         do
5832
5833         cat >conftest.$ac_ext <<_ACEOF
5834 #line 5834 "configure"
5835 #include "confdefs.h"
5836
5837 #include <$cf_header>
5838 int
5839 main ()
5840 {
5841
5842 #ifdef NCURSES_VERSION
5843
5844 printf("%s\n", NCURSES_VERSION);
5845 #else
5846 #ifdef __NCURSES_H
5847 printf("old\n");
5848 #else
5849         make an error
5850 #endif
5851 #endif
5852
5853   ;
5854   return 0;
5855 }
5856 _ACEOF
5857 rm -f conftest.$ac_objext
5858 if { (eval echo "$as_me:5858: \"$ac_compile\"") >&5
5859   (eval $ac_compile) 2>&5
5860   ac_status=$?
5861   echo "$as_me:5861: \$? = $ac_status" >&5
5862   (exit $ac_status); } &&
5863          { ac_try='test -s conftest.$ac_objext'
5864   { (eval echo "$as_me:5864: \"$ac_try\"") >&5
5865   (eval $ac_try) 2>&5
5866   ac_status=$?
5867   echo "$as_me:5867: \$? = $ac_status" >&5
5868   (exit $ac_status); }; }; then
5869   cf_cv_ncurses_h=$cf_header
5870
5871 else
5872   echo "$as_me: failed program was:" >&5
5873 cat conftest.$ac_ext >&5
5874 cf_cv_ncurses_h=no
5875 fi
5876 rm -f conftest.$ac_objext conftest.$ac_ext
5877
5878                 test "$cf_cv_ncurses_h" != no && break
5879         done
5880
5881 fi
5882 echo "$as_me:5882: result: $cf_cv_ncurses_h" >&5
5883 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5884
5885 if test "$cf_cv_ncurses_h" != no ; then
5886         cf_cv_ncurses_header=$cf_cv_ncurses_h
5887 else
5888
5889 echo "$as_me:5889: checking for $cf_ncuhdr_root include-path" >&5
5890 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5891 if test "${cf_cv_ncurses_h2+set}" = set; then
5892   echo $ECHO_N "(cached) $ECHO_C" >&6
5893 else
5894
5895         test -n "$verbose" && echo
5896
5897 cf_search=
5898
5899 # collect the current set of include-directories from compiler flags
5900 cf_header_path_list=""
5901 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5902         for cf_header_path in $CPPFLAGS $CFLAGS
5903         do
5904                 case $cf_header_path in
5905                 (-I*)
5906                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5907
5908 test "x$cf_header_path" != "xNONE" && \
5909 test -d "$cf_header_path" && \
5910  {
5911         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5912         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5913         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5914         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5915         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5916         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"
5917 }
5918
5919                         cf_header_path_list="$cf_header_path_list $cf_search"
5920                         ;;
5921                 esac
5922         done
5923 fi
5924
5925 # add the variations for the package we are looking for
5926
5927 cf_search=
5928
5929 test "x$prefix" != "xNONE" && \
5930 test -d "$prefix" && \
5931  {
5932         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5933         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5934         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5935         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5936         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5937         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5938 }
5939
5940 for cf_subdir_prefix in \
5941         /usr \
5942         /usr/local \
5943         /usr/pkg \
5944         /opt \
5945         /opt/local \
5946         $HOME
5947 do
5948
5949 test "x$cf_subdir_prefix" != "x$prefix" && \
5950 test -d "$cf_subdir_prefix" && \
5951 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5952         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5953         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5954         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5955         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5956         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5957         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"
5958 }
5959
5960 done
5961
5962 test "$includedir" != NONE && \
5963 test "$includedir" != "/usr/include" && \
5964 test -d "$includedir" && {
5965         test -d $includedir &&    cf_search="$cf_search $includedir"
5966         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5967 }
5968
5969 test "$oldincludedir" != NONE && \
5970 test "$oldincludedir" != "/usr/include" && \
5971 test -d "$oldincludedir" && {
5972         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5973         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5974 }
5975
5976 cf_search="$cf_search $cf_header_path_list"
5977
5978         test -n "$verbose" && echo search path $cf_search
5979         cf_save2_CPPFLAGS="$CPPFLAGS"
5980         for cf_incdir in $cf_search
5981         do
5982
5983 if test -n "$cf_incdir" ; then
5984   for cf_add_incdir in $cf_incdir
5985   do
5986         while test $cf_add_incdir != /usr/include
5987         do
5988           if test -d $cf_add_incdir
5989           then
5990                 cf_have_incdir=no
5991                 if test -n "$CFLAGS$CPPFLAGS" ; then
5992                   # a loop is needed to ensure we can add subdirs of existing dirs
5993                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5994                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5995                           cf_have_incdir=yes; break
5996                         fi
5997                   done
5998                 fi
5999
6000                 if test "$cf_have_incdir" = no ; then
6001                   if test "$cf_add_incdir" = /usr/local/include ; then
6002                         if test "$GCC" = yes
6003                         then
6004                           cf_save_CPPFLAGS=$CPPFLAGS
6005                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6006                           cat >conftest.$ac_ext <<_ACEOF
6007 #line 6007 "configure"
6008 #include "confdefs.h"
6009 #include <stdio.h>
6010 int
6011 main ()
6012 {
6013 printf("Hello")
6014   ;
6015   return 0;
6016 }
6017 _ACEOF
6018 rm -f conftest.$ac_objext
6019 if { (eval echo "$as_me:6019: \"$ac_compile\"") >&5
6020   (eval $ac_compile) 2>&5
6021   ac_status=$?
6022   echo "$as_me:6022: \$? = $ac_status" >&5
6023   (exit $ac_status); } &&
6024          { ac_try='test -s conftest.$ac_objext'
6025   { (eval echo "$as_me:6025: \"$ac_try\"") >&5
6026   (eval $ac_try) 2>&5
6027   ac_status=$?
6028   echo "$as_me:6028: \$? = $ac_status" >&5
6029   (exit $ac_status); }; }; then
6030   :
6031 else
6032   echo "$as_me: failed program was:" >&5
6033 cat conftest.$ac_ext >&5
6034 cf_have_incdir=yes
6035 fi
6036 rm -f conftest.$ac_objext conftest.$ac_ext
6037                           CPPFLAGS=$cf_save_CPPFLAGS
6038                         fi
6039                   fi
6040                 fi
6041
6042                 if test "$cf_have_incdir" = no ; then
6043                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6044
6045 echo "${as_me:-configure}:6045: testing adding $cf_add_incdir to include-path ..." 1>&5
6046
6047                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6048
6049                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6050                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6051                   cf_add_incdir="$cf_top_incdir"
6052                 else
6053                   break
6054                 fi
6055           fi
6056         done
6057   done
6058 fi
6059
6060                 for cf_header in \
6061                         ncurses.h \
6062                         curses.h
6063                 do
6064
6065         cat >conftest.$ac_ext <<_ACEOF
6066 #line 6066 "configure"
6067 #include "confdefs.h"
6068
6069 #include <$cf_header>
6070 int
6071 main ()
6072 {
6073
6074 #ifdef NCURSES_VERSION
6075
6076 printf("%s\n", NCURSES_VERSION);
6077 #else
6078 #ifdef __NCURSES_H
6079 printf("old\n");
6080 #else
6081         make an error
6082 #endif
6083 #endif
6084
6085   ;
6086   return 0;
6087 }
6088 _ACEOF
6089 rm -f conftest.$ac_objext
6090 if { (eval echo "$as_me:6090: \"$ac_compile\"") >&5
6091   (eval $ac_compile) 2>&5
6092   ac_status=$?
6093   echo "$as_me:6093: \$? = $ac_status" >&5
6094   (exit $ac_status); } &&
6095          { ac_try='test -s conftest.$ac_objext'
6096   { (eval echo "$as_me:6096: \"$ac_try\"") >&5
6097   (eval $ac_try) 2>&5
6098   ac_status=$?
6099   echo "$as_me:6099: \$? = $ac_status" >&5
6100   (exit $ac_status); }; }; then
6101   cf_cv_ncurses_h2=$cf_header
6102
6103 else
6104   echo "$as_me: failed program was:" >&5
6105 cat conftest.$ac_ext >&5
6106 cf_cv_ncurses_h2=no
6107 fi
6108 rm -f conftest.$ac_objext conftest.$ac_ext
6109
6110                         if test "$cf_cv_ncurses_h2" != no ; then
6111                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6112                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6113                                 break
6114                         fi
6115                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6116                 done
6117                 CPPFLAGS="$cf_save2_CPPFLAGS"
6118                 test "$cf_cv_ncurses_h2" != no && break
6119         done
6120         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6120: error: not found" >&5
6121 echo "$as_me: error: not found" >&2;}
6122    { (exit 1); exit 1; }; }
6123
6124 fi
6125 echo "$as_me:6125: result: $cf_cv_ncurses_h2" >&5
6126 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6127
6128         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6129         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6130         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6131                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6132         fi
6133
6134 if test -n "$cf_1st_incdir" ; then
6135   for cf_add_incdir in $cf_1st_incdir
6136   do
6137         while test $cf_add_incdir != /usr/include
6138         do
6139           if test -d $cf_add_incdir
6140           then
6141                 cf_have_incdir=no
6142                 if test -n "$CFLAGS$CPPFLAGS" ; then
6143                   # a loop is needed to ensure we can add subdirs of existing dirs
6144                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6145                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6146                           cf_have_incdir=yes; break
6147                         fi
6148                   done
6149                 fi
6150
6151                 if test "$cf_have_incdir" = no ; then
6152                   if test "$cf_add_incdir" = /usr/local/include ; then
6153                         if test "$GCC" = yes
6154                         then
6155                           cf_save_CPPFLAGS=$CPPFLAGS
6156                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6157                           cat >conftest.$ac_ext <<_ACEOF
6158 #line 6158 "configure"
6159 #include "confdefs.h"
6160 #include <stdio.h>
6161 int
6162 main ()
6163 {
6164 printf("Hello")
6165   ;
6166   return 0;
6167 }
6168 _ACEOF
6169 rm -f conftest.$ac_objext
6170 if { (eval echo "$as_me:6170: \"$ac_compile\"") >&5
6171   (eval $ac_compile) 2>&5
6172   ac_status=$?
6173   echo "$as_me:6173: \$? = $ac_status" >&5
6174   (exit $ac_status); } &&
6175          { ac_try='test -s conftest.$ac_objext'
6176   { (eval echo "$as_me:6176: \"$ac_try\"") >&5
6177   (eval $ac_try) 2>&5
6178   ac_status=$?
6179   echo "$as_me:6179: \$? = $ac_status" >&5
6180   (exit $ac_status); }; }; then
6181   :
6182 else
6183   echo "$as_me: failed program was:" >&5
6184 cat conftest.$ac_ext >&5
6185 cf_have_incdir=yes
6186 fi
6187 rm -f conftest.$ac_objext conftest.$ac_ext
6188                           CPPFLAGS=$cf_save_CPPFLAGS
6189                         fi
6190                   fi
6191                 fi
6192
6193                 if test "$cf_have_incdir" = no ; then
6194                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6195
6196 echo "${as_me:-configure}:6196: testing adding $cf_add_incdir to include-path ..." 1>&5
6197
6198                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6199
6200                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6201                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6202                   cf_add_incdir="$cf_top_incdir"
6203                 else
6204                   break
6205                 fi
6206           fi
6207         done
6208   done
6209 fi
6210
6211 fi
6212
6213 # Set definitions to allow ifdef'ing for ncurses.h
6214
6215 case $cf_cv_ncurses_header in
6216 (*ncurses.h)
6217
6218 cat >>confdefs.h <<\EOF
6219 #define HAVE_NCURSES_H 1
6220 EOF
6221
6222         ;;
6223 esac
6224
6225 case $cf_cv_ncurses_header in
6226 (ncurses/curses.h|ncurses/ncurses.h)
6227
6228 cat >>confdefs.h <<\EOF
6229 #define HAVE_NCURSES_NCURSES_H 1
6230 EOF
6231
6232         ;;
6233 (ncursesw/curses.h|ncursesw/ncurses.h)
6234
6235 cat >>confdefs.h <<\EOF
6236 #define HAVE_NCURSESW_NCURSES_H 1
6237 EOF
6238
6239         ;;
6240 esac
6241
6242 echo "$as_me:6242: checking for terminfo header" >&5
6243 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6244 if test "${cf_cv_term_header+set}" = set; then
6245   echo $ECHO_N "(cached) $ECHO_C" >&6
6246 else
6247
6248 case ${cf_cv_ncurses_header} in
6249 (*/ncurses.h|*/ncursesw.h)
6250         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6251         ;;
6252 (*)
6253         cf_term_header=term.h
6254         ;;
6255 esac
6256
6257 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6258 do
6259 cat >conftest.$ac_ext <<_ACEOF
6260 #line 6260 "configure"
6261 #include "confdefs.h"
6262 #include <stdio.h>
6263 #include <${cf_cv_ncurses_header:-curses.h}>
6264 #include <$cf_test>
6265
6266 int
6267 main ()
6268 {
6269 int x = auto_left_margin
6270   ;
6271   return 0;
6272 }
6273 _ACEOF
6274 rm -f conftest.$ac_objext
6275 if { (eval echo "$as_me:6275: \"$ac_compile\"") >&5
6276   (eval $ac_compile) 2>&5
6277   ac_status=$?
6278   echo "$as_me:6278: \$? = $ac_status" >&5
6279   (exit $ac_status); } &&
6280          { ac_try='test -s conftest.$ac_objext'
6281   { (eval echo "$as_me:6281: \"$ac_try\"") >&5
6282   (eval $ac_try) 2>&5
6283   ac_status=$?
6284   echo "$as_me:6284: \$? = $ac_status" >&5
6285   (exit $ac_status); }; }; then
6286
6287         cf_cv_term_header="$cf_test"
6288 else
6289   echo "$as_me: failed program was:" >&5
6290 cat conftest.$ac_ext >&5
6291
6292         cf_cv_term_header=unknown
6293
6294 fi
6295 rm -f conftest.$ac_objext conftest.$ac_ext
6296         test "$cf_cv_term_header" != unknown && break
6297 done
6298
6299 fi
6300 echo "$as_me:6300: result: $cf_cv_term_header" >&5
6301 echo "${ECHO_T}$cf_cv_term_header" >&6
6302
6303 # Set definitions to allow ifdef'ing to accommodate subdirectories
6304
6305 case $cf_cv_term_header in
6306 (*term.h)
6307
6308 cat >>confdefs.h <<\EOF
6309 #define HAVE_TERM_H 1
6310 EOF
6311
6312         ;;
6313 esac
6314
6315 case $cf_cv_term_header in
6316 (ncurses/term.h)
6317
6318 cat >>confdefs.h <<\EOF
6319 #define HAVE_NCURSES_TERM_H 1
6320 EOF
6321
6322         ;;
6323 (ncursesw/term.h)
6324
6325 cat >>confdefs.h <<\EOF
6326 #define HAVE_NCURSESW_TERM_H 1
6327 EOF
6328
6329         ;;
6330 esac
6331
6332 # some applications need this, but should check for NCURSES_VERSION
6333
6334 cat >>confdefs.h <<\EOF
6335 #define NCURSES 1
6336 EOF
6337
6338 echo "$as_me:6338: checking for ncurses version" >&5
6339 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6340 if test "${cf_cv_ncurses_version+set}" = set; then
6341   echo $ECHO_N "(cached) $ECHO_C" >&6
6342 else
6343
6344         cf_cv_ncurses_version=no
6345         cf_tempfile=out$$
6346         rm -f $cf_tempfile
6347         if test "$cross_compiling" = yes; then
6348
6349         # This will not work if the preprocessor splits the line after the
6350         # Autoconf token.  The 'unproto' program does that.
6351         cat > conftest.$ac_ext <<EOF
6352 #include <${cf_cv_ncurses_header:-curses.h}>
6353 #undef Autoconf
6354 #ifdef NCURSES_VERSION
6355 Autoconf NCURSES_VERSION
6356 #else
6357 #ifdef __NCURSES_H
6358 Autoconf "old"
6359 #endif
6360 ;
6361 #endif
6362 EOF
6363         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6364         { (eval echo "$as_me:6364: \"$cf_try\"") >&5
6365   (eval $cf_try) 2>&5
6366   ac_status=$?
6367   echo "$as_me:6367: \$? = $ac_status" >&5
6368   (exit $ac_status); }
6369         if test -f conftest.out ; then
6370                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6371                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6372                 rm -f conftest.out
6373         fi
6374
6375 else
6376   cat >conftest.$ac_ext <<_ACEOF
6377 #line 6377 "configure"
6378 #include "confdefs.h"
6379
6380 #include <${cf_cv_ncurses_header:-curses.h}>
6381 #include <stdio.h>
6382 int main()
6383 {
6384         FILE *fp = fopen("$cf_tempfile", "w");
6385 #ifdef NCURSES_VERSION
6386 # ifdef NCURSES_VERSION_PATCH
6387         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6388 # else
6389         fprintf(fp, "%s\n", NCURSES_VERSION);
6390 # endif
6391 #else
6392 # ifdef __NCURSES_H
6393         fprintf(fp, "old\n");
6394 # else
6395         make an error
6396 # endif
6397 #endif
6398         ${cf_cv_main_return:-return}(0);
6399 }
6400 _ACEOF
6401 rm -f conftest$ac_exeext
6402 if { (eval echo "$as_me:6402: \"$ac_link\"") >&5
6403   (eval $ac_link) 2>&5
6404   ac_status=$?
6405   echo "$as_me:6405: \$? = $ac_status" >&5
6406   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6407   { (eval echo "$as_me:6407: \"$ac_try\"") >&5
6408   (eval $ac_try) 2>&5
6409   ac_status=$?
6410   echo "$as_me:6410: \$? = $ac_status" >&5
6411   (exit $ac_status); }; }; then
6412
6413         cf_cv_ncurses_version=`cat $cf_tempfile`
6414 else
6415   echo "$as_me: program exited with status $ac_status" >&5
6416 echo "$as_me: failed program was:" >&5
6417 cat conftest.$ac_ext >&5
6418 fi
6419 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6420 fi
6421         rm -f $cf_tempfile
6422
6423 fi
6424 echo "$as_me:6424: result: $cf_cv_ncurses_version" >&5
6425 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6426 test "$cf_cv_ncurses_version" = no ||
6427 cat >>confdefs.h <<\EOF
6428 #define NCURSES 1
6429 EOF
6430
6431 cf_nculib_root=ncurses
6432         # This works, except for the special case where we find gpm, but
6433         # ncurses is in a nonstandard location via $LIBS, and we really want
6434         # to link gpm.
6435 cf_ncurses_LIBS=""
6436 cf_ncurses_SAVE="$LIBS"
6437 echo "$as_me:6437: checking for Gpm_Open in -lgpm" >&5
6438 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6439 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6440   echo $ECHO_N "(cached) $ECHO_C" >&6
6441 else
6442   ac_check_lib_save_LIBS=$LIBS
6443 LIBS="-lgpm  $LIBS"
6444 cat >conftest.$ac_ext <<_ACEOF
6445 #line 6445 "configure"
6446 #include "confdefs.h"
6447
6448 /* Override any gcc2 internal prototype to avoid an error.  */
6449 #ifdef __cplusplus
6450 extern "C"
6451 #endif
6452 /* We use char because int might match the return type of a gcc2
6453    builtin and then its argument prototype would still apply.  */
6454 char Gpm_Open ();
6455 int
6456 main ()
6457 {
6458 Gpm_Open ();
6459   ;
6460   return 0;
6461 }
6462 _ACEOF
6463 rm -f conftest.$ac_objext conftest$ac_exeext
6464 if { (eval echo "$as_me:6464: \"$ac_link\"") >&5
6465   (eval $ac_link) 2>&5
6466   ac_status=$?
6467   echo "$as_me:6467: \$? = $ac_status" >&5
6468   (exit $ac_status); } &&
6469          { ac_try='test -s conftest$ac_exeext'
6470   { (eval echo "$as_me:6470: \"$ac_try\"") >&5
6471   (eval $ac_try) 2>&5
6472   ac_status=$?
6473   echo "$as_me:6473: \$? = $ac_status" >&5
6474   (exit $ac_status); }; }; then
6475   ac_cv_lib_gpm_Gpm_Open=yes
6476 else
6477   echo "$as_me: failed program was:" >&5
6478 cat conftest.$ac_ext >&5
6479 ac_cv_lib_gpm_Gpm_Open=no
6480 fi
6481 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6482 LIBS=$ac_check_lib_save_LIBS
6483 fi
6484 echo "$as_me:6484: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6485 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6486 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6487   echo "$as_me:6487: checking for initscr in -lgpm" >&5
6488 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6489 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6490   echo $ECHO_N "(cached) $ECHO_C" >&6
6491 else
6492   ac_check_lib_save_LIBS=$LIBS
6493 LIBS="-lgpm  $LIBS"
6494 cat >conftest.$ac_ext <<_ACEOF
6495 #line 6495 "configure"
6496 #include "confdefs.h"
6497
6498 /* Override any gcc2 internal prototype to avoid an error.  */
6499 #ifdef __cplusplus
6500 extern "C"
6501 #endif
6502 /* We use char because int might match the return type of a gcc2
6503    builtin and then its argument prototype would still apply.  */
6504 char initscr ();
6505 int
6506 main ()
6507 {
6508 initscr ();
6509   ;
6510   return 0;
6511 }
6512 _ACEOF
6513 rm -f conftest.$ac_objext conftest$ac_exeext
6514 if { (eval echo "$as_me:6514: \"$ac_link\"") >&5
6515   (eval $ac_link) 2>&5
6516   ac_status=$?
6517   echo "$as_me:6517: \$? = $ac_status" >&5
6518   (exit $ac_status); } &&
6519          { ac_try='test -s conftest$ac_exeext'
6520   { (eval echo "$as_me:6520: \"$ac_try\"") >&5
6521   (eval $ac_try) 2>&5
6522   ac_status=$?
6523   echo "$as_me:6523: \$? = $ac_status" >&5
6524   (exit $ac_status); }; }; then
6525   ac_cv_lib_gpm_initscr=yes
6526 else
6527   echo "$as_me: failed program was:" >&5
6528 cat conftest.$ac_ext >&5
6529 ac_cv_lib_gpm_initscr=no
6530 fi
6531 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6532 LIBS=$ac_check_lib_save_LIBS
6533 fi
6534 echo "$as_me:6534: result: $ac_cv_lib_gpm_initscr" >&5
6535 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6536 if test $ac_cv_lib_gpm_initscr = yes; then
6537   LIBS="$cf_ncurses_SAVE"
6538 else
6539   cf_ncurses_LIBS="-lgpm"
6540 fi
6541
6542 fi
6543
6544 case $host_os in
6545 (freebsd*)
6546         # This is only necessary if you are linking against an obsolete
6547         # version of ncurses (but it should do no harm, since it's static).
6548         if test "$cf_nculib_root" = ncurses ; then
6549                 echo "$as_me:6549: checking for tgoto in -lmytinfo" >&5
6550 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6551 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6552   echo $ECHO_N "(cached) $ECHO_C" >&6
6553 else
6554   ac_check_lib_save_LIBS=$LIBS
6555 LIBS="-lmytinfo  $LIBS"
6556 cat >conftest.$ac_ext <<_ACEOF
6557 #line 6557 "configure"
6558 #include "confdefs.h"
6559
6560 /* Override any gcc2 internal prototype to avoid an error.  */
6561 #ifdef __cplusplus
6562 extern "C"
6563 #endif
6564 /* We use char because int might match the return type of a gcc2
6565    builtin and then its argument prototype would still apply.  */
6566 char tgoto ();
6567 int
6568 main ()
6569 {
6570 tgoto ();
6571   ;
6572   return 0;
6573 }
6574 _ACEOF
6575 rm -f conftest.$ac_objext conftest$ac_exeext
6576 if { (eval echo "$as_me:6576: \"$ac_link\"") >&5
6577   (eval $ac_link) 2>&5
6578   ac_status=$?
6579   echo "$as_me:6579: \$? = $ac_status" >&5
6580   (exit $ac_status); } &&
6581          { ac_try='test -s conftest$ac_exeext'
6582   { (eval echo "$as_me:6582: \"$ac_try\"") >&5
6583   (eval $ac_try) 2>&5
6584   ac_status=$?
6585   echo "$as_me:6585: \$? = $ac_status" >&5
6586   (exit $ac_status); }; }; then
6587   ac_cv_lib_mytinfo_tgoto=yes
6588 else
6589   echo "$as_me: failed program was:" >&5
6590 cat conftest.$ac_ext >&5
6591 ac_cv_lib_mytinfo_tgoto=no
6592 fi
6593 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6594 LIBS=$ac_check_lib_save_LIBS
6595 fi
6596 echo "$as_me:6596: result: $ac_cv_lib_mytinfo_tgoto" >&5
6597 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6598 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6599   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6600 fi
6601
6602         fi
6603         ;;
6604 esac
6605
6606 cf_add_libs="$cf_ncurses_LIBS"
6607 # Filter out duplicates - this happens with badly-designed ".pc" files...
6608 for cf_add_1lib in $LIBS
6609 do
6610         for cf_add_2lib in $cf_add_libs
6611         do
6612                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6613                 then
6614                         cf_add_1lib=
6615                         break
6616                 fi
6617         done
6618         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6619 done
6620 LIBS="$cf_add_libs"
6621
6622 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6623 then
6624
6625 cf_add_libs="-l$cf_nculib_root"
6626 # Filter out duplicates - this happens with badly-designed ".pc" files...
6627 for cf_add_1lib in $LIBS
6628 do
6629         for cf_add_2lib in $cf_add_libs
6630         do
6631                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6632                 then
6633                         cf_add_1lib=
6634                         break
6635                 fi
6636         done
6637         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6638 done
6639 LIBS="$cf_add_libs"
6640
6641 else
6642
6643         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6644         cf_libdir=""
6645         echo "$as_me:6645: checking for initscr" >&5
6646 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6647 if test "${ac_cv_func_initscr+set}" = set; then
6648   echo $ECHO_N "(cached) $ECHO_C" >&6
6649 else
6650   cat >conftest.$ac_ext <<_ACEOF
6651 #line 6651 "configure"
6652 #include "confdefs.h"
6653 /* System header to define __stub macros and hopefully few prototypes,
6654     which can conflict with char initscr (); below.  */
6655 #include <assert.h>
6656 /* Override any gcc2 internal prototype to avoid an error.  */
6657 #ifdef __cplusplus
6658 extern "C"
6659 #endif
6660 /* We use char because int might match the return type of a gcc2
6661    builtin and then its argument prototype would still apply.  */
6662 char initscr ();
6663 char (*f) ();
6664
6665 int
6666 main ()
6667 {
6668 /* The GNU C library defines this for functions which it implements
6669     to always fail with ENOSYS.  Some functions are actually named
6670     something starting with __ and the normal name is an alias.  */
6671 #if defined (__stub_initscr) || defined (__stub___initscr)
6672 choke me
6673 #else
6674 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6675 #endif
6676
6677   ;
6678   return 0;
6679 }
6680 _ACEOF
6681 rm -f conftest.$ac_objext conftest$ac_exeext
6682 if { (eval echo "$as_me:6682: \"$ac_link\"") >&5
6683   (eval $ac_link) 2>&5
6684   ac_status=$?
6685   echo "$as_me:6685: \$? = $ac_status" >&5
6686   (exit $ac_status); } &&
6687          { ac_try='test -s conftest$ac_exeext'
6688   { (eval echo "$as_me:6688: \"$ac_try\"") >&5
6689   (eval $ac_try) 2>&5
6690   ac_status=$?
6691   echo "$as_me:6691: \$? = $ac_status" >&5
6692   (exit $ac_status); }; }; then
6693   ac_cv_func_initscr=yes
6694 else
6695   echo "$as_me: failed program was:" >&5
6696 cat conftest.$ac_ext >&5
6697 ac_cv_func_initscr=no
6698 fi
6699 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6700 fi
6701 echo "$as_me:6701: result: $ac_cv_func_initscr" >&5
6702 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6703 if test $ac_cv_func_initscr = yes; then
6704   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6705 else
6706
6707                 cf_save_LIBS="$LIBS"
6708                 echo "$as_me:6708: checking for initscr in -l$cf_nculib_root" >&5
6709 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6710                 LIBS="-l$cf_nculib_root $LIBS"
6711                 cat >conftest.$ac_ext <<_ACEOF
6712 #line 6712 "configure"
6713 #include "confdefs.h"
6714 #include <${cf_cv_ncurses_header:-curses.h}>
6715 int
6716 main ()
6717 {
6718 initscr()
6719   ;
6720   return 0;
6721 }
6722 _ACEOF
6723 rm -f conftest.$ac_objext conftest$ac_exeext
6724 if { (eval echo "$as_me:6724: \"$ac_link\"") >&5
6725   (eval $ac_link) 2>&5
6726   ac_status=$?
6727   echo "$as_me:6727: \$? = $ac_status" >&5
6728   (exit $ac_status); } &&
6729          { ac_try='test -s conftest$ac_exeext'
6730   { (eval echo "$as_me:6730: \"$ac_try\"") >&5
6731   (eval $ac_try) 2>&5
6732   ac_status=$?
6733   echo "$as_me:6733: \$? = $ac_status" >&5
6734   (exit $ac_status); }; }; then
6735   echo "$as_me:6735: result: yes" >&5
6736 echo "${ECHO_T}yes" >&6
6737                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6738
6739 else
6740   echo "$as_me: failed program was:" >&5
6741 cat conftest.$ac_ext >&5
6742 echo "$as_me:6742: result: no" >&5
6743 echo "${ECHO_T}no" >&6
6744
6745 cf_search=
6746 cf_library_path_list=""
6747 if test -n "${LDFLAGS}${LIBS}" ; then
6748         for cf_library_path in $LDFLAGS $LIBS
6749         do
6750                 case $cf_library_path in
6751                 (-L*)
6752                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6753
6754 test "x$cf_library_path" != "xNONE" && \
6755 test -d "$cf_library_path" && \
6756  {
6757         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6758         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6759         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6760         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6761         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6762         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"
6763 }
6764
6765                         cf_library_path_list="$cf_library_path_list $cf_search"
6766                         ;;
6767                 esac
6768         done
6769 fi
6770
6771 cf_search=
6772
6773 test "x$prefix" != "xNONE" && \
6774 test -d "$prefix" && \
6775  {
6776         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6777         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6778         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6779         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6780         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6781         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6782 }
6783
6784 for cf_subdir_prefix in \
6785         /usr \
6786         /usr/local \
6787         /usr/pkg \
6788         /opt \
6789         /opt/local \
6790         $HOME
6791 do
6792
6793 test "x$cf_subdir_prefix" != "x$prefix" && \
6794 test -d "$cf_subdir_prefix" && \
6795 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6796         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6797         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6798         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6799         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6800         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6801         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"
6802 }
6803
6804 done
6805
6806 cf_search="$cf_library_path_list $cf_search"
6807
6808                         for cf_libdir in $cf_search
6809                         do
6810                                 echo "$as_me:6810: checking for -l$cf_nculib_root in $cf_libdir" >&5
6811 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6812                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6813                                 cat >conftest.$ac_ext <<_ACEOF
6814 #line 6814 "configure"
6815 #include "confdefs.h"
6816 #include <${cf_cv_ncurses_header:-curses.h}>
6817 int
6818 main ()
6819 {
6820 initscr()
6821   ;
6822   return 0;
6823 }
6824 _ACEOF
6825 rm -f conftest.$ac_objext conftest$ac_exeext
6826 if { (eval echo "$as_me:6826: \"$ac_link\"") >&5
6827   (eval $ac_link) 2>&5
6828   ac_status=$?
6829   echo "$as_me:6829: \$? = $ac_status" >&5
6830   (exit $ac_status); } &&
6831          { ac_try='test -s conftest$ac_exeext'
6832   { (eval echo "$as_me:6832: \"$ac_try\"") >&5
6833   (eval $ac_try) 2>&5
6834   ac_status=$?
6835   echo "$as_me:6835: \$? = $ac_status" >&5
6836   (exit $ac_status); }; }; then
6837   echo "$as_me:6837: result: yes" >&5
6838 echo "${ECHO_T}yes" >&6
6839                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6840                                          break
6841 else
6842   echo "$as_me: failed program was:" >&5
6843 cat conftest.$ac_ext >&5
6844 echo "$as_me:6844: result: no" >&5
6845 echo "${ECHO_T}no" >&6
6846                                          LIBS="$cf_save_LIBS"
6847 fi
6848 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6849                         done
6850
6851 fi
6852 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6853
6854 fi
6855
6856 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6857
6858 if test $cf_found_library = no ; then
6859         { { echo "$as_me:6859: error: Cannot link $cf_nculib_root library" >&5
6860 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6861    { (exit 1); exit 1; }; }
6862 fi
6863
6864 fi
6865
6866 if test -n "$cf_ncurses_LIBS" ; then
6867         echo "$as_me:6867: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6868 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6869         cf_ncurses_SAVE="$LIBS"
6870         for p in $cf_ncurses_LIBS ; do
6871                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6872                 if test "$q" != "$LIBS" ; then
6873                         LIBS="$q"
6874                 fi
6875         done
6876         cat >conftest.$ac_ext <<_ACEOF
6877 #line 6877 "configure"
6878 #include "confdefs.h"
6879 #include <${cf_cv_ncurses_header:-curses.h}>
6880 int
6881 main ()
6882 {
6883 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6884   ;
6885   return 0;
6886 }
6887 _ACEOF
6888 rm -f conftest.$ac_objext conftest$ac_exeext
6889 if { (eval echo "$as_me:6889: \"$ac_link\"") >&5
6890   (eval $ac_link) 2>&5
6891   ac_status=$?
6892   echo "$as_me:6892: \$? = $ac_status" >&5
6893   (exit $ac_status); } &&
6894          { ac_try='test -s conftest$ac_exeext'
6895   { (eval echo "$as_me:6895: \"$ac_try\"") >&5
6896   (eval $ac_try) 2>&5
6897   ac_status=$?
6898   echo "$as_me:6898: \$? = $ac_status" >&5
6899   (exit $ac_status); }; }; then
6900   echo "$as_me:6900: result: yes" >&5
6901 echo "${ECHO_T}yes" >&6
6902 else
6903   echo "$as_me: failed program was:" >&5
6904 cat conftest.$ac_ext >&5
6905 echo "$as_me:6905: result: no" >&5
6906 echo "${ECHO_T}no" >&6
6907                  LIBS="$cf_ncurses_SAVE"
6908 fi
6909 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6910 fi
6911
6912 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6913
6914 cat >>confdefs.h <<EOF
6915 #define $cf_nculib_ROOT 1
6916 EOF
6917
6918 fi
6919
6920         ;;
6921 (ncursesw)
6922
6923 echo "$as_me:6923: checking for multibyte character support" >&5
6924 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6925 if test "${cf_cv_utf8_lib+set}" = set; then
6926   echo $ECHO_N "(cached) $ECHO_C" >&6
6927 else
6928
6929         cf_save_LIBS="$LIBS"
6930         cat >conftest.$ac_ext <<_ACEOF
6931 #line 6931 "configure"
6932 #include "confdefs.h"
6933
6934 #include <stdlib.h>
6935 int
6936 main ()
6937 {
6938 putwc(0,0);
6939   ;
6940   return 0;
6941 }
6942 _ACEOF
6943 rm -f conftest.$ac_objext conftest$ac_exeext
6944 if { (eval echo "$as_me:6944: \"$ac_link\"") >&5
6945   (eval $ac_link) 2>&5
6946   ac_status=$?
6947   echo "$as_me:6947: \$? = $ac_status" >&5
6948   (exit $ac_status); } &&
6949          { ac_try='test -s conftest$ac_exeext'
6950   { (eval echo "$as_me:6950: \"$ac_try\"") >&5
6951   (eval $ac_try) 2>&5
6952   ac_status=$?
6953   echo "$as_me:6953: \$? = $ac_status" >&5
6954   (exit $ac_status); }; }; then
6955   cf_cv_utf8_lib=yes
6956 else
6957   echo "$as_me: failed program was:" >&5
6958 cat conftest.$ac_ext >&5
6959
6960 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6961 # will be set on completion of the AC_TRY_LINK below.
6962 cf_cv_header_path_utf8=
6963 cf_cv_library_path_utf8=
6964
6965 echo "${as_me:-configure}:6965: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6966
6967 cf_save_LIBS="$LIBS"
6968
6969 cat >conftest.$ac_ext <<_ACEOF
6970 #line 6970 "configure"
6971 #include "confdefs.h"
6972
6973 #include <libutf8.h>
6974 int
6975 main ()
6976 {
6977 putwc(0,0);
6978   ;
6979   return 0;
6980 }
6981 _ACEOF
6982 rm -f conftest.$ac_objext conftest$ac_exeext
6983 if { (eval echo "$as_me:6983: \"$ac_link\"") >&5
6984   (eval $ac_link) 2>&5
6985   ac_status=$?
6986   echo "$as_me:6986: \$? = $ac_status" >&5
6987   (exit $ac_status); } &&
6988          { ac_try='test -s conftest$ac_exeext'
6989   { (eval echo "$as_me:6989: \"$ac_try\"") >&5
6990   (eval $ac_try) 2>&5
6991   ac_status=$?
6992   echo "$as_me:6992: \$? = $ac_status" >&5
6993   (exit $ac_status); }; }; then
6994
6995         cf_cv_find_linkage_utf8=yes
6996         cf_cv_header_path_utf8=/usr/include
6997         cf_cv_library_path_utf8=/usr/lib
6998
6999 else
7000   echo "$as_me: failed program was:" >&5
7001 cat conftest.$ac_ext >&5
7002
7003 LIBS="-lutf8  $cf_save_LIBS"
7004
7005 cat >conftest.$ac_ext <<_ACEOF
7006 #line 7006 "configure"
7007 #include "confdefs.h"
7008
7009 #include <libutf8.h>
7010 int
7011 main ()
7012 {
7013 putwc(0,0);
7014   ;
7015   return 0;
7016 }
7017 _ACEOF
7018 rm -f conftest.$ac_objext conftest$ac_exeext
7019 if { (eval echo "$as_me:7019: \"$ac_link\"") >&5
7020   (eval $ac_link) 2>&5
7021   ac_status=$?
7022   echo "$as_me:7022: \$? = $ac_status" >&5
7023   (exit $ac_status); } &&
7024          { ac_try='test -s conftest$ac_exeext'
7025   { (eval echo "$as_me:7025: \"$ac_try\"") >&5
7026   (eval $ac_try) 2>&5
7027   ac_status=$?
7028   echo "$as_me:7028: \$? = $ac_status" >&5
7029   (exit $ac_status); }; }; then
7030
7031         cf_cv_find_linkage_utf8=yes
7032         cf_cv_header_path_utf8=/usr/include
7033         cf_cv_library_path_utf8=/usr/lib
7034         cf_cv_library_file_utf8="-lutf8"
7035
7036 else
7037   echo "$as_me: failed program was:" >&5
7038 cat conftest.$ac_ext >&5
7039
7040         cf_cv_find_linkage_utf8=no
7041         LIBS="$cf_save_LIBS"
7042
7043         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7044
7045 echo "${as_me:-configure}:7045: testing find linkage for utf8 library ..." 1>&5
7046
7047 echo "${as_me:-configure}:7047: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7048
7049         cf_save_CPPFLAGS="$CPPFLAGS"
7050         cf_test_CPPFLAGS="$CPPFLAGS"
7051
7052 cf_search=
7053
7054 # collect the current set of include-directories from compiler flags
7055 cf_header_path_list=""
7056 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7057         for cf_header_path in $CPPFLAGS $CFLAGS
7058         do
7059                 case $cf_header_path in
7060                 (-I*)
7061                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7062
7063 test "x$cf_header_path" != "xNONE" && \
7064 test -d "$cf_header_path" && \
7065  {
7066         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7067         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7068         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7069         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7070         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7071         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7072 }
7073
7074                         cf_header_path_list="$cf_header_path_list $cf_search"
7075                         ;;
7076                 esac
7077         done
7078 fi
7079
7080 # add the variations for the package we are looking for
7081
7082 cf_search=
7083
7084 test "x$prefix" != "xNONE" && \
7085 test -d "$prefix" && \
7086  {
7087         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7088         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7089         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7090         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7091         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7092         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7093 }
7094
7095 for cf_subdir_prefix in \
7096         /usr \
7097         /usr/local \
7098         /usr/pkg \
7099         /opt \
7100         /opt/local \
7101         $HOME
7102 do
7103
7104 test "x$cf_subdir_prefix" != "x$prefix" && \
7105 test -d "$cf_subdir_prefix" && \
7106 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7107         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7108         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7109         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7110         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7111         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7112         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7113 }
7114
7115 done
7116
7117 test "$includedir" != NONE && \
7118 test "$includedir" != "/usr/include" && \
7119 test -d "$includedir" && {
7120         test -d $includedir &&    cf_search="$cf_search $includedir"
7121         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7122 }
7123
7124 test "$oldincludedir" != NONE && \
7125 test "$oldincludedir" != "/usr/include" && \
7126 test -d "$oldincludedir" && {
7127         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7128         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7129 }
7130
7131 cf_search="$cf_search $cf_header_path_list"
7132
7133         for cf_cv_header_path_utf8 in $cf_search
7134         do
7135                 if test -d $cf_cv_header_path_utf8 ; then
7136                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7137
7138 echo "${as_me:-configure}:7138: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7139
7140                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
7141                         cat >conftest.$ac_ext <<_ACEOF
7142 #line 7142 "configure"
7143 #include "confdefs.h"
7144
7145 #include <libutf8.h>
7146 int
7147 main ()
7148 {
7149 putwc(0,0);
7150   ;
7151   return 0;
7152 }
7153 _ACEOF
7154 rm -f conftest.$ac_objext
7155 if { (eval echo "$as_me:7155: \"$ac_compile\"") >&5
7156   (eval $ac_compile) 2>&5
7157   ac_status=$?
7158   echo "$as_me:7158: \$? = $ac_status" >&5
7159   (exit $ac_status); } &&
7160          { ac_try='test -s conftest.$ac_objext'
7161   { (eval echo "$as_me:7161: \"$ac_try\"") >&5
7162   (eval $ac_try) 2>&5
7163   ac_status=$?
7164   echo "$as_me:7164: \$? = $ac_status" >&5
7165   (exit $ac_status); }; }; then
7166
7167                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7168
7169 echo "${as_me:-configure}:7169: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7170
7171                                 cf_cv_find_linkage_utf8=maybe
7172                                 cf_test_CPPFLAGS="$CPPFLAGS"
7173                                 break
7174 else
7175   echo "$as_me: failed program was:" >&5
7176 cat conftest.$ac_ext >&5
7177
7178                                 CPPFLAGS="$cf_save_CPPFLAGS"
7179
7180 fi
7181 rm -f conftest.$ac_objext conftest.$ac_ext
7182                 fi
7183         done
7184
7185         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7186
7187 echo "${as_me:-configure}:7187: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7188
7189                 cf_save_LIBS="$LIBS"
7190                 cf_save_LDFLAGS="$LDFLAGS"
7191
7192                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7193
7194 cf_search=
7195 cf_library_path_list=""
7196 if test -n "${LDFLAGS}${LIBS}" ; then
7197         for cf_library_path in $LDFLAGS $LIBS
7198         do
7199                 case $cf_library_path in
7200                 (-L*)
7201                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7202
7203 test "x$cf_library_path" != "xNONE" && \
7204 test -d "$cf_library_path" && \
7205  {
7206         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7207         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7208         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7209         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7210         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7211         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7212 }
7213
7214                         cf_library_path_list="$cf_library_path_list $cf_search"
7215                         ;;
7216                 esac
7217         done
7218 fi
7219
7220 cf_search=
7221
7222 test "x$prefix" != "xNONE" && \
7223 test -d "$prefix" && \
7224  {
7225         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7226         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7227         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7228         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7229         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7230         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7231 }
7232
7233 for cf_subdir_prefix in \
7234         /usr \
7235         /usr/local \
7236         /usr/pkg \
7237         /opt \
7238         /opt/local \
7239         $HOME
7240 do
7241
7242 test "x$cf_subdir_prefix" != "x$prefix" && \
7243 test -d "$cf_subdir_prefix" && \
7244 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7245         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7246         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7247         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7248         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7249         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7250         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7251 }
7252
7253 done
7254
7255 cf_search="$cf_library_path_list $cf_search"
7256
7257                         for cf_cv_library_path_utf8 in $cf_search
7258                         do
7259                                 if test -d $cf_cv_library_path_utf8 ; then
7260                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7261
7262 echo "${as_me:-configure}:7262: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7263
7264                                         CPPFLAGS="$cf_test_CPPFLAGS"
7265                                         LIBS="-lutf8  $cf_save_LIBS"
7266                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7267                                         cat >conftest.$ac_ext <<_ACEOF
7268 #line 7268 "configure"
7269 #include "confdefs.h"
7270
7271 #include <libutf8.h>
7272 int
7273 main ()
7274 {
7275 putwc(0,0);
7276   ;
7277   return 0;
7278 }
7279 _ACEOF
7280 rm -f conftest.$ac_objext conftest$ac_exeext
7281 if { (eval echo "$as_me:7281: \"$ac_link\"") >&5
7282   (eval $ac_link) 2>&5
7283   ac_status=$?
7284   echo "$as_me:7284: \$? = $ac_status" >&5
7285   (exit $ac_status); } &&
7286          { ac_try='test -s conftest$ac_exeext'
7287   { (eval echo "$as_me:7287: \"$ac_try\"") >&5
7288   (eval $ac_try) 2>&5
7289   ac_status=$?
7290   echo "$as_me:7290: \$? = $ac_status" >&5
7291   (exit $ac_status); }; }; then
7292
7293                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7294
7295 echo "${as_me:-configure}:7295: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7296
7297                                         cf_cv_find_linkage_utf8=yes
7298                                         cf_cv_library_file_utf8="-lutf8"
7299                                         break
7300 else
7301   echo "$as_me: failed program was:" >&5
7302 cat conftest.$ac_ext >&5
7303
7304                                         CPPFLAGS="$cf_save_CPPFLAGS"
7305                                         LIBS="$cf_save_LIBS"
7306                                         LDFLAGS="$cf_save_LDFLAGS"
7307
7308 fi
7309 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7310                                 fi
7311                         done
7312                         CPPFLAGS="$cf_save_CPPFLAGS"
7313                         LDFLAGS="$cf_save_LDFLAGS"
7314                 fi
7315
7316         else
7317                 cf_cv_find_linkage_utf8=no
7318         fi
7319
7320 fi
7321 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7322
7323 fi
7324 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7325
7326 LIBS="$cf_save_LIBS"
7327
7328 if test "$cf_cv_find_linkage_utf8" = yes ; then
7329 cf_cv_utf8_lib=add-on
7330 else
7331 cf_cv_utf8_lib=no
7332 fi
7333
7334 fi
7335 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7336 fi
7337 echo "$as_me:7337: result: $cf_cv_utf8_lib" >&5
7338 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7339
7340 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7341 # ncurses/ncursesw:
7342 if test "$cf_cv_utf8_lib" = "add-on" ; then
7343
7344 cat >>confdefs.h <<\EOF
7345 #define HAVE_LIBUTF8_H 1
7346 EOF
7347
7348 if test -n "$cf_cv_header_path_utf8" ; then
7349   for cf_add_incdir in $cf_cv_header_path_utf8
7350   do
7351         while test $cf_add_incdir != /usr/include
7352         do
7353           if test -d $cf_add_incdir
7354           then
7355                 cf_have_incdir=no
7356                 if test -n "$CFLAGS$CPPFLAGS" ; then
7357                   # a loop is needed to ensure we can add subdirs of existing dirs
7358                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7359                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7360                           cf_have_incdir=yes; break
7361                         fi
7362                   done
7363                 fi
7364
7365                 if test "$cf_have_incdir" = no ; then
7366                   if test "$cf_add_incdir" = /usr/local/include ; then
7367                         if test "$GCC" = yes
7368                         then
7369                           cf_save_CPPFLAGS=$CPPFLAGS
7370                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7371                           cat >conftest.$ac_ext <<_ACEOF
7372 #line 7372 "configure"
7373 #include "confdefs.h"
7374 #include <stdio.h>
7375 int
7376 main ()
7377 {
7378 printf("Hello")
7379   ;
7380   return 0;
7381 }
7382 _ACEOF
7383 rm -f conftest.$ac_objext
7384 if { (eval echo "$as_me:7384: \"$ac_compile\"") >&5
7385   (eval $ac_compile) 2>&5
7386   ac_status=$?
7387   echo "$as_me:7387: \$? = $ac_status" >&5
7388   (exit $ac_status); } &&
7389          { ac_try='test -s conftest.$ac_objext'
7390   { (eval echo "$as_me:7390: \"$ac_try\"") >&5
7391   (eval $ac_try) 2>&5
7392   ac_status=$?
7393   echo "$as_me:7393: \$? = $ac_status" >&5
7394   (exit $ac_status); }; }; then
7395   :
7396 else
7397   echo "$as_me: failed program was:" >&5
7398 cat conftest.$ac_ext >&5
7399 cf_have_incdir=yes
7400 fi
7401 rm -f conftest.$ac_objext conftest.$ac_ext
7402                           CPPFLAGS=$cf_save_CPPFLAGS
7403                         fi
7404                   fi
7405                 fi
7406
7407                 if test "$cf_have_incdir" = no ; then
7408                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7409
7410 echo "${as_me:-configure}:7410: testing adding $cf_add_incdir to include-path ..." 1>&5
7411
7412                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7413
7414                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7415                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7416                   cf_add_incdir="$cf_top_incdir"
7417                 else
7418                   break
7419                 fi
7420           fi
7421         done
7422   done
7423 fi
7424
7425 if test -n "$cf_cv_library_path_utf8" ; then
7426         for cf_add_libdir in $cf_cv_library_path_utf8
7427         do
7428                 if test $cf_add_libdir = /usr/lib ; then
7429                         :
7430                 elif test -d $cf_add_libdir
7431                 then
7432                         cf_have_libdir=no
7433                         if test -n "$LDFLAGS$LIBS" ; then
7434                                 # a loop is needed to ensure we can add subdirs of existing dirs
7435                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7436                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7437                                                 cf_have_libdir=yes; break
7438                                         fi
7439                                 done
7440                         fi
7441                         if test "$cf_have_libdir" = no ; then
7442                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7443
7444 echo "${as_me:-configure}:7444: testing adding $cf_add_libdir to library-path ..." 1>&5
7445
7446                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7447                         fi
7448                 fi
7449         done
7450 fi
7451
7452 cf_add_libs="$cf_cv_library_file_utf8"
7453 # Filter out duplicates - this happens with badly-designed ".pc" files...
7454 for cf_add_1lib in $LIBS
7455 do
7456         for cf_add_2lib in $cf_add_libs
7457         do
7458                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7459                 then
7460                         cf_add_1lib=
7461                         break
7462                 fi
7463         done
7464         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7465 done
7466 LIBS="$cf_add_libs"
7467
7468 fi
7469
7470 cf_ncuconfig_root=ncursesw
7471
7472 echo "Looking for ${cf_ncuconfig_root}-config"
7473
7474 if test -n "$ac_tool_prefix"; then
7475   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7476   do
7477     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7478 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7479 echo "$as_me:7479: checking for $ac_word" >&5
7480 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7481 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7482   echo $ECHO_N "(cached) $ECHO_C" >&6
7483 else
7484   if test -n "$NCURSES_CONFIG"; then
7485   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7486 else
7487   ac_save_IFS=$IFS; IFS=$ac_path_separator
7488 ac_dummy="$PATH"
7489 for ac_dir in $ac_dummy; do
7490   IFS=$ac_save_IFS
7491   test -z "$ac_dir" && ac_dir=.
7492   $as_executable_p "$ac_dir/$ac_word" || continue
7493 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7494 echo "$as_me:7494: found $ac_dir/$ac_word" >&5
7495 break
7496 done
7497
7498 fi
7499 fi
7500 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7501 if test -n "$NCURSES_CONFIG"; then
7502   echo "$as_me:7502: result: $NCURSES_CONFIG" >&5
7503 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7504 else
7505   echo "$as_me:7505: result: no" >&5
7506 echo "${ECHO_T}no" >&6
7507 fi
7508
7509     test -n "$NCURSES_CONFIG" && break
7510   done
7511 fi
7512 if test -z "$NCURSES_CONFIG"; then
7513   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7514   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7515 do
7516   # Extract the first word of "$ac_prog", so it can be a program name with args.
7517 set dummy $ac_prog; ac_word=$2
7518 echo "$as_me:7518: checking for $ac_word" >&5
7519 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7520 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7521   echo $ECHO_N "(cached) $ECHO_C" >&6
7522 else
7523   if test -n "$ac_ct_NCURSES_CONFIG"; then
7524   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7525 else
7526   ac_save_IFS=$IFS; IFS=$ac_path_separator
7527 ac_dummy="$PATH"
7528 for ac_dir in $ac_dummy; do
7529   IFS=$ac_save_IFS
7530   test -z "$ac_dir" && ac_dir=.
7531   $as_executable_p "$ac_dir/$ac_word" || continue
7532 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7533 echo "$as_me:7533: found $ac_dir/$ac_word" >&5
7534 break
7535 done
7536
7537 fi
7538 fi
7539 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7540 if test -n "$ac_ct_NCURSES_CONFIG"; then
7541   echo "$as_me:7541: result: $ac_ct_NCURSES_CONFIG" >&5
7542 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7543 else
7544   echo "$as_me:7544: result: no" >&5
7545 echo "${ECHO_T}no" >&6
7546 fi
7547
7548   test -n "$ac_ct_NCURSES_CONFIG" && break
7549 done
7550 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7551
7552   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7553 fi
7554
7555 if test "$NCURSES_CONFIG" != none ; then
7556
7557 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7558
7559 cf_add_libs="`$NCURSES_CONFIG --libs`"
7560 # Filter out duplicates - this happens with badly-designed ".pc" files...
7561 for cf_add_1lib in $LIBS
7562 do
7563         for cf_add_2lib in $cf_add_libs
7564         do
7565                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7566                 then
7567                         cf_add_1lib=
7568                         break
7569                 fi
7570         done
7571         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7572 done
7573 LIBS="$cf_add_libs"
7574
7575 # even with config script, some packages use no-override for curses.h
7576
7577 echo "$as_me:7577: checking if we have identified curses headers" >&5
7578 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7579 if test "${cf_cv_ncurses_header+set}" = set; then
7580   echo $ECHO_N "(cached) $ECHO_C" >&6
7581 else
7582
7583 cf_cv_ncurses_header=none
7584 for cf_header in  \
7585         ncursesw/ncurses.h \
7586         ncursesw/curses.h \
7587         ncurses.h \
7588         curses.h
7589 do
7590 cat >conftest.$ac_ext <<_ACEOF
7591 #line 7591 "configure"
7592 #include "confdefs.h"
7593 #include <${cf_header}>
7594 int
7595 main ()
7596 {
7597 initscr(); tgoto("?", 0,0)
7598   ;
7599   return 0;
7600 }
7601 _ACEOF
7602 rm -f conftest.$ac_objext
7603 if { (eval echo "$as_me:7603: \"$ac_compile\"") >&5
7604   (eval $ac_compile) 2>&5
7605   ac_status=$?
7606   echo "$as_me:7606: \$? = $ac_status" >&5
7607   (exit $ac_status); } &&
7608          { ac_try='test -s conftest.$ac_objext'
7609   { (eval echo "$as_me:7609: \"$ac_try\"") >&5
7610   (eval $ac_try) 2>&5
7611   ac_status=$?
7612   echo "$as_me:7612: \$? = $ac_status" >&5
7613   (exit $ac_status); }; }; then
7614   cf_cv_ncurses_header=$cf_header; break
7615 else
7616   echo "$as_me: failed program was:" >&5
7617 cat conftest.$ac_ext >&5
7618 fi
7619 rm -f conftest.$ac_objext conftest.$ac_ext
7620 done
7621
7622 fi
7623 echo "$as_me:7623: result: $cf_cv_ncurses_header" >&5
7624 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7625
7626 if test "$cf_cv_ncurses_header" = none ; then
7627         { { echo "$as_me:7627: error: No curses header-files found" >&5
7628 echo "$as_me: error: No curses header-files found" >&2;}
7629    { (exit 1); exit 1; }; }
7630 fi
7631
7632 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7633
7634 for ac_header in $cf_cv_ncurses_header
7635 do
7636 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7637 echo "$as_me:7637: checking for $ac_header" >&5
7638 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7639 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7640   echo $ECHO_N "(cached) $ECHO_C" >&6
7641 else
7642   cat >conftest.$ac_ext <<_ACEOF
7643 #line 7643 "configure"
7644 #include "confdefs.h"
7645 #include <$ac_header>
7646 _ACEOF
7647 if { (eval echo "$as_me:7647: \"$ac_cpp conftest.$ac_ext\"") >&5
7648   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7649   ac_status=$?
7650   egrep -v '^ *\+' conftest.er1 >conftest.err
7651   rm -f conftest.er1
7652   cat conftest.err >&5
7653   echo "$as_me:7653: \$? = $ac_status" >&5
7654   (exit $ac_status); } >/dev/null; then
7655   if test -s conftest.err; then
7656     ac_cpp_err=$ac_c_preproc_warn_flag
7657   else
7658     ac_cpp_err=
7659   fi
7660 else
7661   ac_cpp_err=yes
7662 fi
7663 if test -z "$ac_cpp_err"; then
7664   eval "$as_ac_Header=yes"
7665 else
7666   echo "$as_me: failed program was:" >&5
7667   cat conftest.$ac_ext >&5
7668   eval "$as_ac_Header=no"
7669 fi
7670 rm -f conftest.err conftest.$ac_ext
7671 fi
7672 echo "$as_me:7672: result: `eval echo '${'$as_ac_Header'}'`" >&5
7673 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7674 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7675   cat >>confdefs.h <<EOF
7676 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7677 EOF
7678
7679 fi
7680 done
7681
7682 cat >>confdefs.h <<\EOF
7683 #define NCURSES 1
7684 EOF
7685
7686 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7687
7688 cat >>confdefs.h <<EOF
7689 #define $cf_nculib_ROOT 1
7690 EOF
7691
7692 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7693
7694 else
7695
7696 cf_ncuhdr_root=ncursesw
7697
7698 test -n "$cf_cv_curses_dir" && \
7699 test "$cf_cv_curses_dir" != "no" && { \
7700
7701 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7702   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7703   do
7704         while test $cf_add_incdir != /usr/include
7705         do
7706           if test -d $cf_add_incdir
7707           then
7708                 cf_have_incdir=no
7709                 if test -n "$CFLAGS$CPPFLAGS" ; then
7710                   # a loop is needed to ensure we can add subdirs of existing dirs
7711                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7712                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7713                           cf_have_incdir=yes; break
7714                         fi
7715                   done
7716                 fi
7717
7718                 if test "$cf_have_incdir" = no ; then
7719                   if test "$cf_add_incdir" = /usr/local/include ; then
7720                         if test "$GCC" = yes
7721                         then
7722                           cf_save_CPPFLAGS=$CPPFLAGS
7723                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7724                           cat >conftest.$ac_ext <<_ACEOF
7725 #line 7725 "configure"
7726 #include "confdefs.h"
7727 #include <stdio.h>
7728 int
7729 main ()
7730 {
7731 printf("Hello")
7732   ;
7733   return 0;
7734 }
7735 _ACEOF
7736 rm -f conftest.$ac_objext
7737 if { (eval echo "$as_me:7737: \"$ac_compile\"") >&5
7738   (eval $ac_compile) 2>&5
7739   ac_status=$?
7740   echo "$as_me:7740: \$? = $ac_status" >&5
7741   (exit $ac_status); } &&
7742          { ac_try='test -s conftest.$ac_objext'
7743   { (eval echo "$as_me:7743: \"$ac_try\"") >&5
7744   (eval $ac_try) 2>&5
7745   ac_status=$?
7746   echo "$as_me:7746: \$? = $ac_status" >&5
7747   (exit $ac_status); }; }; then
7748   :
7749 else
7750   echo "$as_me: failed program was:" >&5
7751 cat conftest.$ac_ext >&5
7752 cf_have_incdir=yes
7753 fi
7754 rm -f conftest.$ac_objext conftest.$ac_ext
7755                           CPPFLAGS=$cf_save_CPPFLAGS
7756                         fi
7757                   fi
7758                 fi
7759
7760                 if test "$cf_have_incdir" = no ; then
7761                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7762
7763 echo "${as_me:-configure}:7763: testing adding $cf_add_incdir to include-path ..." 1>&5
7764
7765                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7766
7767                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7768                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7769                   cf_add_incdir="$cf_top_incdir"
7770                 else
7771                   break
7772                 fi
7773           fi
7774         done
7775   done
7776 fi
7777
7778 }
7779
7780 echo "$as_me:7780: checking for $cf_ncuhdr_root header in include-path" >&5
7781 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7782 if test "${cf_cv_ncurses_h+set}" = set; then
7783   echo $ECHO_N "(cached) $ECHO_C" >&6
7784 else
7785
7786         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7787         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7788         for cf_header in $cf_header_list
7789         do
7790
7791         cat >conftest.$ac_ext <<_ACEOF
7792 #line 7792 "configure"
7793 #include "confdefs.h"
7794
7795 #define _XOPEN_SOURCE_EXTENDED
7796 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7797 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7798
7799 #include <$cf_header>
7800 int
7801 main ()
7802 {
7803
7804 #ifdef NCURSES_VERSION
7805
7806 #ifndef WACS_BSSB
7807         make an error
7808 #endif
7809
7810 printf("%s\n", NCURSES_VERSION);
7811 #else
7812 #ifdef __NCURSES_H
7813 printf("old\n");
7814 #else
7815         make an error
7816 #endif
7817 #endif
7818
7819   ;
7820   return 0;
7821 }
7822 _ACEOF
7823 rm -f conftest.$ac_objext
7824 if { (eval echo "$as_me:7824: \"$ac_compile\"") >&5
7825   (eval $ac_compile) 2>&5
7826   ac_status=$?
7827   echo "$as_me:7827: \$? = $ac_status" >&5
7828   (exit $ac_status); } &&
7829          { ac_try='test -s conftest.$ac_objext'
7830   { (eval echo "$as_me:7830: \"$ac_try\"") >&5
7831   (eval $ac_try) 2>&5
7832   ac_status=$?
7833   echo "$as_me:7833: \$? = $ac_status" >&5
7834   (exit $ac_status); }; }; then
7835   cf_cv_ncurses_h=$cf_header
7836
7837 else
7838   echo "$as_me: failed program was:" >&5
7839 cat conftest.$ac_ext >&5
7840 cf_cv_ncurses_h=no
7841 fi
7842 rm -f conftest.$ac_objext conftest.$ac_ext
7843
7844                 test "$cf_cv_ncurses_h" != no && break
7845         done
7846
7847 fi
7848 echo "$as_me:7848: result: $cf_cv_ncurses_h" >&5
7849 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7850
7851 if test "$cf_cv_ncurses_h" != no ; then
7852         cf_cv_ncurses_header=$cf_cv_ncurses_h
7853 else
7854
7855 echo "$as_me:7855: checking for $cf_ncuhdr_root include-path" >&5
7856 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7857 if test "${cf_cv_ncurses_h2+set}" = set; then
7858   echo $ECHO_N "(cached) $ECHO_C" >&6
7859 else
7860
7861         test -n "$verbose" && echo
7862
7863 cf_search=
7864
7865 # collect the current set of include-directories from compiler flags
7866 cf_header_path_list=""
7867 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7868         for cf_header_path in $CPPFLAGS $CFLAGS
7869         do
7870                 case $cf_header_path in
7871                 (-I*)
7872                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7873
7874 test "x$cf_header_path" != "xNONE" && \
7875 test -d "$cf_header_path" && \
7876  {
7877         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7878         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7879         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7880         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7881         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7882         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"
7883 }
7884
7885                         cf_header_path_list="$cf_header_path_list $cf_search"
7886                         ;;
7887                 esac
7888         done
7889 fi
7890
7891 # add the variations for the package we are looking for
7892
7893 cf_search=
7894
7895 test "x$prefix" != "xNONE" && \
7896 test -d "$prefix" && \
7897  {
7898         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7899         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7900         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7901         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7902         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7903         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7904 }
7905
7906 for cf_subdir_prefix in \
7907         /usr \
7908         /usr/local \
7909         /usr/pkg \
7910         /opt \
7911         /opt/local \
7912         $HOME
7913 do
7914
7915 test "x$cf_subdir_prefix" != "x$prefix" && \
7916 test -d "$cf_subdir_prefix" && \
7917 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7918         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7919         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7920         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7921         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7922         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7923         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"
7924 }
7925
7926 done
7927
7928 test "$includedir" != NONE && \
7929 test "$includedir" != "/usr/include" && \
7930 test -d "$includedir" && {
7931         test -d $includedir &&    cf_search="$cf_search $includedir"
7932         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7933 }
7934
7935 test "$oldincludedir" != NONE && \
7936 test "$oldincludedir" != "/usr/include" && \
7937 test -d "$oldincludedir" && {
7938         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7939         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7940 }
7941
7942 cf_search="$cf_search $cf_header_path_list"
7943
7944         test -n "$verbose" && echo search path $cf_search
7945         cf_save2_CPPFLAGS="$CPPFLAGS"
7946         for cf_incdir in $cf_search
7947         do
7948
7949 if test -n "$cf_incdir" ; then
7950   for cf_add_incdir in $cf_incdir
7951   do
7952         while test $cf_add_incdir != /usr/include
7953         do
7954           if test -d $cf_add_incdir
7955           then
7956                 cf_have_incdir=no
7957                 if test -n "$CFLAGS$CPPFLAGS" ; then
7958                   # a loop is needed to ensure we can add subdirs of existing dirs
7959                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7960                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7961                           cf_have_incdir=yes; break
7962                         fi
7963                   done
7964                 fi
7965
7966                 if test "$cf_have_incdir" = no ; then
7967                   if test "$cf_add_incdir" = /usr/local/include ; then
7968                         if test "$GCC" = yes
7969                         then
7970                           cf_save_CPPFLAGS=$CPPFLAGS
7971                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7972                           cat >conftest.$ac_ext <<_ACEOF
7973 #line 7973 "configure"
7974 #include "confdefs.h"
7975 #include <stdio.h>
7976 int
7977 main ()
7978 {
7979 printf("Hello")
7980   ;
7981   return 0;
7982 }
7983 _ACEOF
7984 rm -f conftest.$ac_objext
7985 if { (eval echo "$as_me:7985: \"$ac_compile\"") >&5
7986   (eval $ac_compile) 2>&5
7987   ac_status=$?
7988   echo "$as_me:7988: \$? = $ac_status" >&5
7989   (exit $ac_status); } &&
7990          { ac_try='test -s conftest.$ac_objext'
7991   { (eval echo "$as_me:7991: \"$ac_try\"") >&5
7992   (eval $ac_try) 2>&5
7993   ac_status=$?
7994   echo "$as_me:7994: \$? = $ac_status" >&5
7995   (exit $ac_status); }; }; then
7996   :
7997 else
7998   echo "$as_me: failed program was:" >&5
7999 cat conftest.$ac_ext >&5
8000 cf_have_incdir=yes
8001 fi
8002 rm -f conftest.$ac_objext conftest.$ac_ext
8003                           CPPFLAGS=$cf_save_CPPFLAGS
8004                         fi
8005                   fi
8006                 fi
8007
8008                 if test "$cf_have_incdir" = no ; then
8009                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8010
8011 echo "${as_me:-configure}:8011: testing adding $cf_add_incdir to include-path ..." 1>&5
8012
8013                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8014
8015                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8016                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8017                   cf_add_incdir="$cf_top_incdir"
8018                 else
8019                   break
8020                 fi
8021           fi
8022         done
8023   done
8024 fi
8025
8026                 for cf_header in \
8027                         ncurses.h \
8028                         curses.h
8029                 do
8030
8031         cat >conftest.$ac_ext <<_ACEOF
8032 #line 8032 "configure"
8033 #include "confdefs.h"
8034
8035 #include <$cf_header>
8036 int
8037 main ()
8038 {
8039
8040 #ifdef NCURSES_VERSION
8041
8042 printf("%s\n", NCURSES_VERSION);
8043 #else
8044 #ifdef __NCURSES_H
8045 printf("old\n");
8046 #else
8047         make an error
8048 #endif
8049 #endif
8050
8051   ;
8052   return 0;
8053 }
8054 _ACEOF
8055 rm -f conftest.$ac_objext
8056 if { (eval echo "$as_me:8056: \"$ac_compile\"") >&5
8057   (eval $ac_compile) 2>&5
8058   ac_status=$?
8059   echo "$as_me:8059: \$? = $ac_status" >&5
8060   (exit $ac_status); } &&
8061          { ac_try='test -s conftest.$ac_objext'
8062   { (eval echo "$as_me:8062: \"$ac_try\"") >&5
8063   (eval $ac_try) 2>&5
8064   ac_status=$?
8065   echo "$as_me:8065: \$? = $ac_status" >&5
8066   (exit $ac_status); }; }; then
8067   cf_cv_ncurses_h2=$cf_header
8068
8069 else
8070   echo "$as_me: failed program was:" >&5
8071 cat conftest.$ac_ext >&5
8072 cf_cv_ncurses_h2=no
8073 fi
8074 rm -f conftest.$ac_objext conftest.$ac_ext
8075
8076                         if test "$cf_cv_ncurses_h2" != no ; then
8077                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8078                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8079                                 break
8080                         fi
8081                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8082                 done
8083                 CPPFLAGS="$cf_save2_CPPFLAGS"
8084                 test "$cf_cv_ncurses_h2" != no && break
8085         done
8086         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8086: error: not found" >&5
8087 echo "$as_me: error: not found" >&2;}
8088    { (exit 1); exit 1; }; }
8089
8090 fi
8091 echo "$as_me:8091: result: $cf_cv_ncurses_h2" >&5
8092 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8093
8094         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8095         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8096         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8097                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8098         fi
8099
8100 if test -n "$cf_1st_incdir" ; then
8101   for cf_add_incdir in $cf_1st_incdir
8102   do
8103         while test $cf_add_incdir != /usr/include
8104         do
8105           if test -d $cf_add_incdir
8106           then
8107                 cf_have_incdir=no
8108                 if test -n "$CFLAGS$CPPFLAGS" ; then
8109                   # a loop is needed to ensure we can add subdirs of existing dirs
8110                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8111                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8112                           cf_have_incdir=yes; break
8113                         fi
8114                   done
8115                 fi
8116
8117                 if test "$cf_have_incdir" = no ; then
8118                   if test "$cf_add_incdir" = /usr/local/include ; then
8119                         if test "$GCC" = yes
8120                         then
8121                           cf_save_CPPFLAGS=$CPPFLAGS
8122                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8123                           cat >conftest.$ac_ext <<_ACEOF
8124 #line 8124 "configure"
8125 #include "confdefs.h"
8126 #include <stdio.h>
8127 int
8128 main ()
8129 {
8130 printf("Hello")
8131   ;
8132   return 0;
8133 }
8134 _ACEOF
8135 rm -f conftest.$ac_objext
8136 if { (eval echo "$as_me:8136: \"$ac_compile\"") >&5
8137   (eval $ac_compile) 2>&5
8138   ac_status=$?
8139   echo "$as_me:8139: \$? = $ac_status" >&5
8140   (exit $ac_status); } &&
8141          { ac_try='test -s conftest.$ac_objext'
8142   { (eval echo "$as_me:8142: \"$ac_try\"") >&5
8143   (eval $ac_try) 2>&5
8144   ac_status=$?
8145   echo "$as_me:8145: \$? = $ac_status" >&5
8146   (exit $ac_status); }; }; then
8147   :
8148 else
8149   echo "$as_me: failed program was:" >&5
8150 cat conftest.$ac_ext >&5
8151 cf_have_incdir=yes
8152 fi
8153 rm -f conftest.$ac_objext conftest.$ac_ext
8154                           CPPFLAGS=$cf_save_CPPFLAGS
8155                         fi
8156                   fi
8157                 fi
8158
8159                 if test "$cf_have_incdir" = no ; then
8160                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8161
8162 echo "${as_me:-configure}:8162: testing adding $cf_add_incdir to include-path ..." 1>&5
8163
8164                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8165
8166                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8167                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8168                   cf_add_incdir="$cf_top_incdir"
8169                 else
8170                   break
8171                 fi
8172           fi
8173         done
8174   done
8175 fi
8176
8177 fi
8178
8179 # Set definitions to allow ifdef'ing for ncurses.h
8180
8181 case $cf_cv_ncurses_header in
8182 (*ncurses.h)
8183
8184 cat >>confdefs.h <<\EOF
8185 #define HAVE_NCURSES_H 1
8186 EOF
8187
8188         ;;
8189 esac
8190
8191 case $cf_cv_ncurses_header in
8192 (ncurses/curses.h|ncurses/ncurses.h)
8193
8194 cat >>confdefs.h <<\EOF
8195 #define HAVE_NCURSES_NCURSES_H 1
8196 EOF
8197
8198         ;;
8199 (ncursesw/curses.h|ncursesw/ncurses.h)
8200
8201 cat >>confdefs.h <<\EOF
8202 #define HAVE_NCURSESW_NCURSES_H 1
8203 EOF
8204
8205         ;;
8206 esac
8207
8208 echo "$as_me:8208: checking for terminfo header" >&5
8209 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8210 if test "${cf_cv_term_header+set}" = set; then
8211   echo $ECHO_N "(cached) $ECHO_C" >&6
8212 else
8213
8214 case ${cf_cv_ncurses_header} in
8215 (*/ncurses.h|*/ncursesw.h)
8216         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8217         ;;
8218 (*)
8219         cf_term_header=term.h
8220         ;;
8221 esac
8222
8223 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8224 do
8225 cat >conftest.$ac_ext <<_ACEOF
8226 #line 8226 "configure"
8227 #include "confdefs.h"
8228 #include <stdio.h>
8229 #include <${cf_cv_ncurses_header:-curses.h}>
8230 #include <$cf_test>
8231
8232 int
8233 main ()
8234 {
8235 int x = auto_left_margin
8236   ;
8237   return 0;
8238 }
8239 _ACEOF
8240 rm -f conftest.$ac_objext
8241 if { (eval echo "$as_me:8241: \"$ac_compile\"") >&5
8242   (eval $ac_compile) 2>&5
8243   ac_status=$?
8244   echo "$as_me:8244: \$? = $ac_status" >&5
8245   (exit $ac_status); } &&
8246          { ac_try='test -s conftest.$ac_objext'
8247   { (eval echo "$as_me:8247: \"$ac_try\"") >&5
8248   (eval $ac_try) 2>&5
8249   ac_status=$?
8250   echo "$as_me:8250: \$? = $ac_status" >&5
8251   (exit $ac_status); }; }; then
8252
8253         cf_cv_term_header="$cf_test"
8254 else
8255   echo "$as_me: failed program was:" >&5
8256 cat conftest.$ac_ext >&5
8257
8258         cf_cv_term_header=unknown
8259
8260 fi
8261 rm -f conftest.$ac_objext conftest.$ac_ext
8262         test "$cf_cv_term_header" != unknown && break
8263 done
8264
8265 fi
8266 echo "$as_me:8266: result: $cf_cv_term_header" >&5
8267 echo "${ECHO_T}$cf_cv_term_header" >&6
8268
8269 # Set definitions to allow ifdef'ing to accommodate subdirectories
8270
8271 case $cf_cv_term_header in
8272 (*term.h)
8273
8274 cat >>confdefs.h <<\EOF
8275 #define HAVE_TERM_H 1
8276 EOF
8277
8278         ;;
8279 esac
8280
8281 case $cf_cv_term_header in
8282 (ncurses/term.h)
8283
8284 cat >>confdefs.h <<\EOF
8285 #define HAVE_NCURSES_TERM_H 1
8286 EOF
8287
8288         ;;
8289 (ncursesw/term.h)
8290
8291 cat >>confdefs.h <<\EOF
8292 #define HAVE_NCURSESW_TERM_H 1
8293 EOF
8294
8295         ;;
8296 esac
8297
8298 # some applications need this, but should check for NCURSES_VERSION
8299
8300 cat >>confdefs.h <<\EOF
8301 #define NCURSES 1
8302 EOF
8303
8304 echo "$as_me:8304: checking for ncurses version" >&5
8305 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8306 if test "${cf_cv_ncurses_version+set}" = set; then
8307   echo $ECHO_N "(cached) $ECHO_C" >&6
8308 else
8309
8310         cf_cv_ncurses_version=no
8311         cf_tempfile=out$$
8312         rm -f $cf_tempfile
8313         if test "$cross_compiling" = yes; then
8314
8315         # This will not work if the preprocessor splits the line after the
8316         # Autoconf token.  The 'unproto' program does that.
8317         cat > conftest.$ac_ext <<EOF
8318 #include <${cf_cv_ncurses_header:-curses.h}>
8319 #undef Autoconf
8320 #ifdef NCURSES_VERSION
8321 Autoconf NCURSES_VERSION
8322 #else
8323 #ifdef __NCURSES_H
8324 Autoconf "old"
8325 #endif
8326 ;
8327 #endif
8328 EOF
8329         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8330         { (eval echo "$as_me:8330: \"$cf_try\"") >&5
8331   (eval $cf_try) 2>&5
8332   ac_status=$?
8333   echo "$as_me:8333: \$? = $ac_status" >&5
8334   (exit $ac_status); }
8335         if test -f conftest.out ; then
8336                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8337                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8338                 rm -f conftest.out
8339         fi
8340
8341 else
8342   cat >conftest.$ac_ext <<_ACEOF
8343 #line 8343 "configure"
8344 #include "confdefs.h"
8345
8346 #include <${cf_cv_ncurses_header:-curses.h}>
8347 #include <stdio.h>
8348 int main()
8349 {
8350         FILE *fp = fopen("$cf_tempfile", "w");
8351 #ifdef NCURSES_VERSION
8352 # ifdef NCURSES_VERSION_PATCH
8353         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8354 # else
8355         fprintf(fp, "%s\n", NCURSES_VERSION);
8356 # endif
8357 #else
8358 # ifdef __NCURSES_H
8359         fprintf(fp, "old\n");
8360 # else
8361         make an error
8362 # endif
8363 #endif
8364         ${cf_cv_main_return:-return}(0);
8365 }
8366 _ACEOF
8367 rm -f conftest$ac_exeext
8368 if { (eval echo "$as_me:8368: \"$ac_link\"") >&5
8369   (eval $ac_link) 2>&5
8370   ac_status=$?
8371   echo "$as_me:8371: \$? = $ac_status" >&5
8372   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8373   { (eval echo "$as_me:8373: \"$ac_try\"") >&5
8374   (eval $ac_try) 2>&5
8375   ac_status=$?
8376   echo "$as_me:8376: \$? = $ac_status" >&5
8377   (exit $ac_status); }; }; then
8378
8379         cf_cv_ncurses_version=`cat $cf_tempfile`
8380 else
8381   echo "$as_me: program exited with status $ac_status" >&5
8382 echo "$as_me: failed program was:" >&5
8383 cat conftest.$ac_ext >&5
8384 fi
8385 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8386 fi
8387         rm -f $cf_tempfile
8388
8389 fi
8390 echo "$as_me:8390: result: $cf_cv_ncurses_version" >&5
8391 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8392 test "$cf_cv_ncurses_version" = no ||
8393 cat >>confdefs.h <<\EOF
8394 #define NCURSES 1
8395 EOF
8396
8397 cf_nculib_root=ncursesw
8398         # This works, except for the special case where we find gpm, but
8399         # ncurses is in a nonstandard location via $LIBS, and we really want
8400         # to link gpm.
8401 cf_ncurses_LIBS=""
8402 cf_ncurses_SAVE="$LIBS"
8403 echo "$as_me:8403: checking for Gpm_Open in -lgpm" >&5
8404 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8405 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8406   echo $ECHO_N "(cached) $ECHO_C" >&6
8407 else
8408   ac_check_lib_save_LIBS=$LIBS
8409 LIBS="-lgpm  $LIBS"
8410 cat >conftest.$ac_ext <<_ACEOF
8411 #line 8411 "configure"
8412 #include "confdefs.h"
8413
8414 /* Override any gcc2 internal prototype to avoid an error.  */
8415 #ifdef __cplusplus
8416 extern "C"
8417 #endif
8418 /* We use char because int might match the return type of a gcc2
8419    builtin and then its argument prototype would still apply.  */
8420 char Gpm_Open ();
8421 int
8422 main ()
8423 {
8424 Gpm_Open ();
8425   ;
8426   return 0;
8427 }
8428 _ACEOF
8429 rm -f conftest.$ac_objext conftest$ac_exeext
8430 if { (eval echo "$as_me:8430: \"$ac_link\"") >&5
8431   (eval $ac_link) 2>&5
8432   ac_status=$?
8433   echo "$as_me:8433: \$? = $ac_status" >&5
8434   (exit $ac_status); } &&
8435          { ac_try='test -s conftest$ac_exeext'
8436   { (eval echo "$as_me:8436: \"$ac_try\"") >&5
8437   (eval $ac_try) 2>&5
8438   ac_status=$?
8439   echo "$as_me:8439: \$? = $ac_status" >&5
8440   (exit $ac_status); }; }; then
8441   ac_cv_lib_gpm_Gpm_Open=yes
8442 else
8443   echo "$as_me: failed program was:" >&5
8444 cat conftest.$ac_ext >&5
8445 ac_cv_lib_gpm_Gpm_Open=no
8446 fi
8447 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8448 LIBS=$ac_check_lib_save_LIBS
8449 fi
8450 echo "$as_me:8450: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8451 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8452 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8453   echo "$as_me:8453: checking for initscr in -lgpm" >&5
8454 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8455 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8456   echo $ECHO_N "(cached) $ECHO_C" >&6
8457 else
8458   ac_check_lib_save_LIBS=$LIBS
8459 LIBS="-lgpm  $LIBS"
8460 cat >conftest.$ac_ext <<_ACEOF
8461 #line 8461 "configure"
8462 #include "confdefs.h"
8463
8464 /* Override any gcc2 internal prototype to avoid an error.  */
8465 #ifdef __cplusplus
8466 extern "C"
8467 #endif
8468 /* We use char because int might match the return type of a gcc2
8469    builtin and then its argument prototype would still apply.  */
8470 char initscr ();
8471 int
8472 main ()
8473 {
8474 initscr ();
8475   ;
8476   return 0;
8477 }
8478 _ACEOF
8479 rm -f conftest.$ac_objext conftest$ac_exeext
8480 if { (eval echo "$as_me:8480: \"$ac_link\"") >&5
8481   (eval $ac_link) 2>&5
8482   ac_status=$?
8483   echo "$as_me:8483: \$? = $ac_status" >&5
8484   (exit $ac_status); } &&
8485          { ac_try='test -s conftest$ac_exeext'
8486   { (eval echo "$as_me:8486: \"$ac_try\"") >&5
8487   (eval $ac_try) 2>&5
8488   ac_status=$?
8489   echo "$as_me:8489: \$? = $ac_status" >&5
8490   (exit $ac_status); }; }; then
8491   ac_cv_lib_gpm_initscr=yes
8492 else
8493   echo "$as_me: failed program was:" >&5
8494 cat conftest.$ac_ext >&5
8495 ac_cv_lib_gpm_initscr=no
8496 fi
8497 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8498 LIBS=$ac_check_lib_save_LIBS
8499 fi
8500 echo "$as_me:8500: result: $ac_cv_lib_gpm_initscr" >&5
8501 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8502 if test $ac_cv_lib_gpm_initscr = yes; then
8503   LIBS="$cf_ncurses_SAVE"
8504 else
8505   cf_ncurses_LIBS="-lgpm"
8506 fi
8507
8508 fi
8509
8510 case $host_os in
8511 (freebsd*)
8512         # This is only necessary if you are linking against an obsolete
8513         # version of ncurses (but it should do no harm, since it's static).
8514         if test "$cf_nculib_root" = ncurses ; then
8515                 echo "$as_me:8515: checking for tgoto in -lmytinfo" >&5
8516 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8517 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8518   echo $ECHO_N "(cached) $ECHO_C" >&6
8519 else
8520   ac_check_lib_save_LIBS=$LIBS
8521 LIBS="-lmytinfo  $LIBS"
8522 cat >conftest.$ac_ext <<_ACEOF
8523 #line 8523 "configure"
8524 #include "confdefs.h"
8525
8526 /* Override any gcc2 internal prototype to avoid an error.  */
8527 #ifdef __cplusplus
8528 extern "C"
8529 #endif
8530 /* We use char because int might match the return type of a gcc2
8531    builtin and then its argument prototype would still apply.  */
8532 char tgoto ();
8533 int
8534 main ()
8535 {
8536 tgoto ();
8537   ;
8538   return 0;
8539 }
8540 _ACEOF
8541 rm -f conftest.$ac_objext conftest$ac_exeext
8542 if { (eval echo "$as_me:8542: \"$ac_link\"") >&5
8543   (eval $ac_link) 2>&5
8544   ac_status=$?
8545   echo "$as_me:8545: \$? = $ac_status" >&5
8546   (exit $ac_status); } &&
8547          { ac_try='test -s conftest$ac_exeext'
8548   { (eval echo "$as_me:8548: \"$ac_try\"") >&5
8549   (eval $ac_try) 2>&5
8550   ac_status=$?
8551   echo "$as_me:8551: \$? = $ac_status" >&5
8552   (exit $ac_status); }; }; then
8553   ac_cv_lib_mytinfo_tgoto=yes
8554 else
8555   echo "$as_me: failed program was:" >&5
8556 cat conftest.$ac_ext >&5
8557 ac_cv_lib_mytinfo_tgoto=no
8558 fi
8559 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8560 LIBS=$ac_check_lib_save_LIBS
8561 fi
8562 echo "$as_me:8562: result: $ac_cv_lib_mytinfo_tgoto" >&5
8563 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8564 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8565   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8566 fi
8567
8568         fi
8569         ;;
8570 esac
8571
8572 cf_add_libs="$cf_ncurses_LIBS"
8573 # Filter out duplicates - this happens with badly-designed ".pc" files...
8574 for cf_add_1lib in $LIBS
8575 do
8576         for cf_add_2lib in $cf_add_libs
8577         do
8578                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8579                 then
8580                         cf_add_1lib=
8581                         break
8582                 fi
8583         done
8584         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8585 done
8586 LIBS="$cf_add_libs"
8587
8588 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8589 then
8590
8591 cf_add_libs="-l$cf_nculib_root"
8592 # Filter out duplicates - this happens with badly-designed ".pc" files...
8593 for cf_add_1lib in $LIBS
8594 do
8595         for cf_add_2lib in $cf_add_libs
8596         do
8597                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8598                 then
8599                         cf_add_1lib=
8600                         break
8601                 fi
8602         done
8603         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8604 done
8605 LIBS="$cf_add_libs"
8606
8607 else
8608
8609         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8610         cf_libdir=""
8611         echo "$as_me:8611: checking for initscr" >&5
8612 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8613 if test "${ac_cv_func_initscr+set}" = set; then
8614   echo $ECHO_N "(cached) $ECHO_C" >&6
8615 else
8616   cat >conftest.$ac_ext <<_ACEOF
8617 #line 8617 "configure"
8618 #include "confdefs.h"
8619 /* System header to define __stub macros and hopefully few prototypes,
8620     which can conflict with char initscr (); below.  */
8621 #include <assert.h>
8622 /* Override any gcc2 internal prototype to avoid an error.  */
8623 #ifdef __cplusplus
8624 extern "C"
8625 #endif
8626 /* We use char because int might match the return type of a gcc2
8627    builtin and then its argument prototype would still apply.  */
8628 char initscr ();
8629 char (*f) ();
8630
8631 int
8632 main ()
8633 {
8634 /* The GNU C library defines this for functions which it implements
8635     to always fail with ENOSYS.  Some functions are actually named
8636     something starting with __ and the normal name is an alias.  */
8637 #if defined (__stub_initscr) || defined (__stub___initscr)
8638 choke me
8639 #else
8640 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8641 #endif
8642
8643   ;
8644   return 0;
8645 }
8646 _ACEOF
8647 rm -f conftest.$ac_objext conftest$ac_exeext
8648 if { (eval echo "$as_me:8648: \"$ac_link\"") >&5
8649   (eval $ac_link) 2>&5
8650   ac_status=$?
8651   echo "$as_me:8651: \$? = $ac_status" >&5
8652   (exit $ac_status); } &&
8653          { ac_try='test -s conftest$ac_exeext'
8654   { (eval echo "$as_me:8654: \"$ac_try\"") >&5
8655   (eval $ac_try) 2>&5
8656   ac_status=$?
8657   echo "$as_me:8657: \$? = $ac_status" >&5
8658   (exit $ac_status); }; }; then
8659   ac_cv_func_initscr=yes
8660 else
8661   echo "$as_me: failed program was:" >&5
8662 cat conftest.$ac_ext >&5
8663 ac_cv_func_initscr=no
8664 fi
8665 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8666 fi
8667 echo "$as_me:8667: result: $ac_cv_func_initscr" >&5
8668 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8669 if test $ac_cv_func_initscr = yes; then
8670   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8671 else
8672
8673                 cf_save_LIBS="$LIBS"
8674                 echo "$as_me:8674: checking for initscr in -l$cf_nculib_root" >&5
8675 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8676                 LIBS="-l$cf_nculib_root $LIBS"
8677                 cat >conftest.$ac_ext <<_ACEOF
8678 #line 8678 "configure"
8679 #include "confdefs.h"
8680 #include <${cf_cv_ncurses_header:-curses.h}>
8681 int
8682 main ()
8683 {
8684 initscr()
8685   ;
8686   return 0;
8687 }
8688 _ACEOF
8689 rm -f conftest.$ac_objext conftest$ac_exeext
8690 if { (eval echo "$as_me:8690: \"$ac_link\"") >&5
8691   (eval $ac_link) 2>&5
8692   ac_status=$?
8693   echo "$as_me:8693: \$? = $ac_status" >&5
8694   (exit $ac_status); } &&
8695          { ac_try='test -s conftest$ac_exeext'
8696   { (eval echo "$as_me:8696: \"$ac_try\"") >&5
8697   (eval $ac_try) 2>&5
8698   ac_status=$?
8699   echo "$as_me:8699: \$? = $ac_status" >&5
8700   (exit $ac_status); }; }; then
8701   echo "$as_me:8701: result: yes" >&5
8702 echo "${ECHO_T}yes" >&6
8703                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8704
8705 else
8706   echo "$as_me: failed program was:" >&5
8707 cat conftest.$ac_ext >&5
8708 echo "$as_me:8708: result: no" >&5
8709 echo "${ECHO_T}no" >&6
8710
8711 cf_search=
8712 cf_library_path_list=""
8713 if test -n "${LDFLAGS}${LIBS}" ; then
8714         for cf_library_path in $LDFLAGS $LIBS
8715         do
8716                 case $cf_library_path in
8717                 (-L*)
8718                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8719
8720 test "x$cf_library_path" != "xNONE" && \
8721 test -d "$cf_library_path" && \
8722  {
8723         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8724         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8725         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8726         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8727         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8728         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"
8729 }
8730
8731                         cf_library_path_list="$cf_library_path_list $cf_search"
8732                         ;;
8733                 esac
8734         done
8735 fi
8736
8737 cf_search=
8738
8739 test "x$prefix" != "xNONE" && \
8740 test -d "$prefix" && \
8741  {
8742         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8743         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8744         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8745         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8746         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8747         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8748 }
8749
8750 for cf_subdir_prefix in \
8751         /usr \
8752         /usr/local \
8753         /usr/pkg \
8754         /opt \
8755         /opt/local \
8756         $HOME
8757 do
8758
8759 test "x$cf_subdir_prefix" != "x$prefix" && \
8760 test -d "$cf_subdir_prefix" && \
8761 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8762         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8763         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8764         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8765         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8766         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8767         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"
8768 }
8769
8770 done
8771
8772 cf_search="$cf_library_path_list $cf_search"
8773
8774                         for cf_libdir in $cf_search
8775                         do
8776                                 echo "$as_me:8776: checking for -l$cf_nculib_root in $cf_libdir" >&5
8777 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8778                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8779                                 cat >conftest.$ac_ext <<_ACEOF
8780 #line 8780 "configure"
8781 #include "confdefs.h"
8782 #include <${cf_cv_ncurses_header:-curses.h}>
8783 int
8784 main ()
8785 {
8786 initscr()
8787   ;
8788   return 0;
8789 }
8790 _ACEOF
8791 rm -f conftest.$ac_objext conftest$ac_exeext
8792 if { (eval echo "$as_me:8792: \"$ac_link\"") >&5
8793   (eval $ac_link) 2>&5
8794   ac_status=$?
8795   echo "$as_me:8795: \$? = $ac_status" >&5
8796   (exit $ac_status); } &&
8797          { ac_try='test -s conftest$ac_exeext'
8798   { (eval echo "$as_me:8798: \"$ac_try\"") >&5
8799   (eval $ac_try) 2>&5
8800   ac_status=$?
8801   echo "$as_me:8801: \$? = $ac_status" >&5
8802   (exit $ac_status); }; }; then
8803   echo "$as_me:8803: result: yes" >&5
8804 echo "${ECHO_T}yes" >&6
8805                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8806                                          break
8807 else
8808   echo "$as_me: failed program was:" >&5
8809 cat conftest.$ac_ext >&5
8810 echo "$as_me:8810: result: no" >&5
8811 echo "${ECHO_T}no" >&6
8812                                          LIBS="$cf_save_LIBS"
8813 fi
8814 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8815                         done
8816
8817 fi
8818 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8819
8820 fi
8821
8822 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8823
8824 if test $cf_found_library = no ; then
8825         { { echo "$as_me:8825: error: Cannot link $cf_nculib_root library" >&5
8826 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8827    { (exit 1); exit 1; }; }
8828 fi
8829
8830 fi
8831
8832 if test -n "$cf_ncurses_LIBS" ; then
8833         echo "$as_me:8833: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8834 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8835         cf_ncurses_SAVE="$LIBS"
8836         for p in $cf_ncurses_LIBS ; do
8837                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8838                 if test "$q" != "$LIBS" ; then
8839                         LIBS="$q"
8840                 fi
8841         done
8842         cat >conftest.$ac_ext <<_ACEOF
8843 #line 8843 "configure"
8844 #include "confdefs.h"
8845 #include <${cf_cv_ncurses_header:-curses.h}>
8846 int
8847 main ()
8848 {
8849 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8850   ;
8851   return 0;
8852 }
8853 _ACEOF
8854 rm -f conftest.$ac_objext conftest$ac_exeext
8855 if { (eval echo "$as_me:8855: \"$ac_link\"") >&5
8856   (eval $ac_link) 2>&5
8857   ac_status=$?
8858   echo "$as_me:8858: \$? = $ac_status" >&5
8859   (exit $ac_status); } &&
8860          { ac_try='test -s conftest$ac_exeext'
8861   { (eval echo "$as_me:8861: \"$ac_try\"") >&5
8862   (eval $ac_try) 2>&5
8863   ac_status=$?
8864   echo "$as_me:8864: \$? = $ac_status" >&5
8865   (exit $ac_status); }; }; then
8866   echo "$as_me:8866: result: yes" >&5
8867 echo "${ECHO_T}yes" >&6
8868 else
8869   echo "$as_me: failed program was:" >&5
8870 cat conftest.$ac_ext >&5
8871 echo "$as_me:8871: result: no" >&5
8872 echo "${ECHO_T}no" >&6
8873                  LIBS="$cf_ncurses_SAVE"
8874 fi
8875 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8876 fi
8877
8878 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8879
8880 cat >>confdefs.h <<EOF
8881 #define $cf_nculib_ROOT 1
8882 EOF
8883
8884 fi
8885
8886         ;;
8887 (pdcurses)
8888         echo "$as_me:8888: checking for X" >&5
8889 echo $ECHO_N "checking for X... $ECHO_C" >&6
8890
8891 # Check whether --with-x or --without-x was given.
8892 if test "${with_x+set}" = set; then
8893   withval="$with_x"
8894
8895 fi;
8896 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
8897 if test "x$with_x" = xno; then
8898   # The user explicitly disabled X.
8899   have_x=disabled
8900 else
8901   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
8902     # Both variables are already set.
8903     have_x=yes
8904   else
8905     if test "${ac_cv_have_x+set}" = set; then
8906   echo $ECHO_N "(cached) $ECHO_C" >&6
8907 else
8908   # One or both of the vars are not set, and there is no cached value.
8909 ac_x_includes=no ac_x_libraries=no
8910 rm -fr conftest.dir
8911 if mkdir conftest.dir; then
8912   cd conftest.dir
8913   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
8914   cat >Imakefile <<'EOF'
8915 acfindx:
8916         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
8917 EOF
8918   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
8919     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
8920     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
8921     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
8922     for ac_extension in a so sl dylib dll; do
8923       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
8924          test -f $ac_im_libdir/libX11.$ac_extension; then
8925         ac_im_usrlibdir=$ac_im_libdir; break
8926       fi
8927     done
8928     # Screen out bogus values from the imake configuration.  They are
8929     # bogus both because they are the default anyway, and because
8930     # using them would break gcc on systems where it needs fixed includes.
8931     case $ac_im_incroot in
8932         /usr/include) ;;
8933         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
8934     esac
8935     case $ac_im_usrlibdir in
8936         /usr/lib | /lib) ;;
8937         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
8938     esac
8939   fi
8940   cd ..
8941   rm -fr conftest.dir
8942 fi
8943
8944 # Standard set of common directories for X headers.
8945 # Check X11 before X11Rn because it is often a symlink to the current release.
8946 ac_x_header_dirs='
8947 /usr/X11/include
8948 /usr/X11R6/include
8949 /usr/X11R5/include
8950 /usr/X11R4/include
8951
8952 /usr/include/X11
8953 /usr/include/X11R6
8954 /usr/include/X11R5
8955 /usr/include/X11R4
8956
8957 /usr/local/X11/include
8958 /usr/local/X11R6/include
8959 /usr/local/X11R5/include
8960 /usr/local/X11R4/include
8961
8962 /usr/local/include/X11
8963 /usr/local/include/X11R6
8964 /usr/local/include/X11R5
8965 /usr/local/include/X11R4
8966
8967 /usr/X386/include
8968 /usr/x386/include
8969 /usr/XFree86/include/X11
8970
8971 /usr/include
8972 /usr/local/include
8973 /usr/unsupported/include
8974 /usr/athena/include
8975 /usr/local/x11r5/include
8976 /usr/lpp/Xamples/include
8977
8978 /usr/openwin/include
8979 /usr/openwin/share/include'
8980
8981 if test "$ac_x_includes" = no; then
8982   # Guess where to find include files, by looking for Intrinsic.h.
8983   # First, try using that file with no special directory specified.
8984   cat >conftest.$ac_ext <<_ACEOF
8985 #line 8985 "configure"
8986 #include "confdefs.h"
8987 #include <X11/Intrinsic.h>
8988 _ACEOF
8989 if { (eval echo "$as_me:8989: \"$ac_cpp conftest.$ac_ext\"") >&5
8990   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8991   ac_status=$?
8992   egrep -v '^ *\+' conftest.er1 >conftest.err
8993   rm -f conftest.er1
8994   cat conftest.err >&5
8995   echo "$as_me:8995: \$? = $ac_status" >&5
8996   (exit $ac_status); } >/dev/null; then
8997   if test -s conftest.err; then
8998     ac_cpp_err=$ac_c_preproc_warn_flag
8999   else
9000     ac_cpp_err=
9001   fi
9002 else
9003   ac_cpp_err=yes
9004 fi
9005 if test -z "$ac_cpp_err"; then
9006   # We can compile using X headers with no special include directory.
9007 ac_x_includes=
9008 else
9009   echo "$as_me: failed program was:" >&5
9010   cat conftest.$ac_ext >&5
9011   for ac_dir in $ac_x_header_dirs; do
9012   if test -r "$ac_dir/X11/Intrinsic.h"; then
9013     ac_x_includes=$ac_dir
9014     break
9015   fi
9016 done
9017 fi
9018 rm -f conftest.err conftest.$ac_ext
9019 fi # $ac_x_includes = no
9020
9021 if test "$ac_x_libraries" = no; then
9022   # Check for the libraries.
9023   # See if we find them without any special options.
9024   # Don't add to $LIBS permanently.
9025   ac_save_LIBS=$LIBS
9026   LIBS="-lXt $LIBS"
9027   cat >conftest.$ac_ext <<_ACEOF
9028 #line 9028 "configure"
9029 #include "confdefs.h"
9030 #include <X11/Intrinsic.h>
9031 int
9032 main ()
9033 {
9034 XtMalloc (0)
9035   ;
9036   return 0;
9037 }
9038 _ACEOF
9039 rm -f conftest.$ac_objext conftest$ac_exeext
9040 if { (eval echo "$as_me:9040: \"$ac_link\"") >&5
9041   (eval $ac_link) 2>&5
9042   ac_status=$?
9043   echo "$as_me:9043: \$? = $ac_status" >&5
9044   (exit $ac_status); } &&
9045          { ac_try='test -s conftest$ac_exeext'
9046   { (eval echo "$as_me:9046: \"$ac_try\"") >&5
9047   (eval $ac_try) 2>&5
9048   ac_status=$?
9049   echo "$as_me:9049: \$? = $ac_status" >&5
9050   (exit $ac_status); }; }; then
9051   LIBS=$ac_save_LIBS
9052 # We can link X programs with no special library path.
9053 ac_x_libraries=
9054 else
9055   echo "$as_me: failed program was:" >&5
9056 cat conftest.$ac_ext >&5
9057 LIBS=$ac_save_LIBS
9058 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9059 do
9060   # Don't even attempt the hair of trying to link an X program!
9061   for ac_extension in a so sl dylib dll; do
9062     if test -r $ac_dir/libXt.$ac_extension; then
9063       ac_x_libraries=$ac_dir
9064       break 2
9065     fi
9066   done
9067 done
9068 fi
9069 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9070 fi # $ac_x_libraries = no
9071
9072 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9073   # Didn't find X anywhere.  Cache the known absence of X.
9074   ac_cv_have_x="have_x=no"
9075 else
9076   # Record where we found X for the cache.
9077   ac_cv_have_x="have_x=yes \
9078                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9079 fi
9080 fi
9081
9082   fi
9083   eval "$ac_cv_have_x"
9084 fi # $with_x != no
9085
9086 if test "$have_x" != yes; then
9087   echo "$as_me:9087: result: $have_x" >&5
9088 echo "${ECHO_T}$have_x" >&6
9089   no_x=yes
9090 else
9091   # If each of the values was on the command line, it overrides each guess.
9092   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9093   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9094   # Update the cache value to reflect the command line values.
9095   ac_cv_have_x="have_x=yes \
9096                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9097   echo "$as_me:9097: result: libraries $x_libraries, headers $x_includes" >&5
9098 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9099 fi
9100
9101 if test "$no_x" = yes; then
9102   # Not all programs may use this symbol, but it does not hurt to define it.
9103
9104 cat >>confdefs.h <<\EOF
9105 #define X_DISPLAY_MISSING 1
9106 EOF
9107
9108   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9109 else
9110   if test -n "$x_includes"; then
9111     X_CFLAGS="$X_CFLAGS -I$x_includes"
9112   fi
9113
9114   # It would also be nice to do this for all -L options, not just this one.
9115   if test -n "$x_libraries"; then
9116     X_LIBS="$X_LIBS -L$x_libraries"
9117     # For Solaris; some versions of Sun CC require a space after -R and
9118     # others require no space.  Words are not sufficient . . . .
9119     case `(uname -sr) 2>/dev/null` in
9120     "SunOS 5"*)
9121       echo "$as_me:9121: checking whether -R must be followed by a space" >&5
9122 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9123       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9124       cat >conftest.$ac_ext <<_ACEOF
9125 #line 9125 "configure"
9126 #include "confdefs.h"
9127
9128 int
9129 main ()
9130 {
9131
9132   ;
9133   return 0;
9134 }
9135 _ACEOF
9136 rm -f conftest.$ac_objext conftest$ac_exeext
9137 if { (eval echo "$as_me:9137: \"$ac_link\"") >&5
9138   (eval $ac_link) 2>&5
9139   ac_status=$?
9140   echo "$as_me:9140: \$? = $ac_status" >&5
9141   (exit $ac_status); } &&
9142          { ac_try='test -s conftest$ac_exeext'
9143   { (eval echo "$as_me:9143: \"$ac_try\"") >&5
9144   (eval $ac_try) 2>&5
9145   ac_status=$?
9146   echo "$as_me:9146: \$? = $ac_status" >&5
9147   (exit $ac_status); }; }; then
9148   ac_R_nospace=yes
9149 else
9150   echo "$as_me: failed program was:" >&5
9151 cat conftest.$ac_ext >&5
9152 ac_R_nospace=no
9153 fi
9154 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9155       if test $ac_R_nospace = yes; then
9156         echo "$as_me:9156: result: no" >&5
9157 echo "${ECHO_T}no" >&6
9158         X_LIBS="$X_LIBS -R$x_libraries"
9159       else
9160         LIBS="$ac_xsave_LIBS -R $x_libraries"
9161         cat >conftest.$ac_ext <<_ACEOF
9162 #line 9162 "configure"
9163 #include "confdefs.h"
9164
9165 int
9166 main ()
9167 {
9168
9169   ;
9170   return 0;
9171 }
9172 _ACEOF
9173 rm -f conftest.$ac_objext conftest$ac_exeext
9174 if { (eval echo "$as_me:9174: \"$ac_link\"") >&5
9175   (eval $ac_link) 2>&5
9176   ac_status=$?
9177   echo "$as_me:9177: \$? = $ac_status" >&5
9178   (exit $ac_status); } &&
9179          { ac_try='test -s conftest$ac_exeext'
9180   { (eval echo "$as_me:9180: \"$ac_try\"") >&5
9181   (eval $ac_try) 2>&5
9182   ac_status=$?
9183   echo "$as_me:9183: \$? = $ac_status" >&5
9184   (exit $ac_status); }; }; then
9185   ac_R_space=yes
9186 else
9187   echo "$as_me: failed program was:" >&5
9188 cat conftest.$ac_ext >&5
9189 ac_R_space=no
9190 fi
9191 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9192         if test $ac_R_space = yes; then
9193           echo "$as_me:9193: result: yes" >&5
9194 echo "${ECHO_T}yes" >&6
9195           X_LIBS="$X_LIBS -R $x_libraries"
9196         else
9197           echo "$as_me:9197: result: neither works" >&5
9198 echo "${ECHO_T}neither works" >&6
9199         fi
9200       fi
9201       LIBS=$ac_xsave_LIBS
9202     esac
9203   fi
9204
9205   # Check for system-dependent libraries X programs must link with.
9206   # Do this before checking for the system-independent R6 libraries
9207   # (-lICE), since we may need -lsocket or whatever for X linking.
9208
9209   if test "$ISC" = yes; then
9210     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9211   else
9212     # Martyn Johnson says this is needed for Ultrix, if the X
9213     # libraries were built with DECnet support.  And Karl Berry says
9214     # the Alpha needs dnet_stub (dnet does not exist).
9215     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9216     cat >conftest.$ac_ext <<_ACEOF
9217 #line 9217 "configure"
9218 #include "confdefs.h"
9219
9220 /* Override any gcc2 internal prototype to avoid an error.  */
9221 #ifdef __cplusplus
9222 extern "C"
9223 #endif
9224 /* We use char because int might match the return type of a gcc2
9225    builtin and then its argument prototype would still apply.  */
9226 char XOpenDisplay ();
9227 int
9228 main ()
9229 {
9230 XOpenDisplay ();
9231   ;
9232   return 0;
9233 }
9234 _ACEOF
9235 rm -f conftest.$ac_objext conftest$ac_exeext
9236 if { (eval echo "$as_me:9236: \"$ac_link\"") >&5
9237   (eval $ac_link) 2>&5
9238   ac_status=$?
9239   echo "$as_me:9239: \$? = $ac_status" >&5
9240   (exit $ac_status); } &&
9241          { ac_try='test -s conftest$ac_exeext'
9242   { (eval echo "$as_me:9242: \"$ac_try\"") >&5
9243   (eval $ac_try) 2>&5
9244   ac_status=$?
9245   echo "$as_me:9245: \$? = $ac_status" >&5
9246   (exit $ac_status); }; }; then
9247   :
9248 else
9249   echo "$as_me: failed program was:" >&5
9250 cat conftest.$ac_ext >&5
9251 echo "$as_me:9251: checking for dnet_ntoa in -ldnet" >&5
9252 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9253 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9254   echo $ECHO_N "(cached) $ECHO_C" >&6
9255 else
9256   ac_check_lib_save_LIBS=$LIBS
9257 LIBS="-ldnet  $LIBS"
9258 cat >conftest.$ac_ext <<_ACEOF
9259 #line 9259 "configure"
9260 #include "confdefs.h"
9261
9262 /* Override any gcc2 internal prototype to avoid an error.  */
9263 #ifdef __cplusplus
9264 extern "C"
9265 #endif
9266 /* We use char because int might match the return type of a gcc2
9267    builtin and then its argument prototype would still apply.  */
9268 char dnet_ntoa ();
9269 int
9270 main ()
9271 {
9272 dnet_ntoa ();
9273   ;
9274   return 0;
9275 }
9276 _ACEOF
9277 rm -f conftest.$ac_objext conftest$ac_exeext
9278 if { (eval echo "$as_me:9278: \"$ac_link\"") >&5
9279   (eval $ac_link) 2>&5
9280   ac_status=$?
9281   echo "$as_me:9281: \$? = $ac_status" >&5
9282   (exit $ac_status); } &&
9283          { ac_try='test -s conftest$ac_exeext'
9284   { (eval echo "$as_me:9284: \"$ac_try\"") >&5
9285   (eval $ac_try) 2>&5
9286   ac_status=$?
9287   echo "$as_me:9287: \$? = $ac_status" >&5
9288   (exit $ac_status); }; }; then
9289   ac_cv_lib_dnet_dnet_ntoa=yes
9290 else
9291   echo "$as_me: failed program was:" >&5
9292 cat conftest.$ac_ext >&5
9293 ac_cv_lib_dnet_dnet_ntoa=no
9294 fi
9295 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9296 LIBS=$ac_check_lib_save_LIBS
9297 fi
9298 echo "$as_me:9298: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9299 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9300 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9301   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9302 fi
9303
9304     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9305       echo "$as_me:9305: checking for dnet_ntoa in -ldnet_stub" >&5
9306 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9307 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9308   echo $ECHO_N "(cached) $ECHO_C" >&6
9309 else
9310   ac_check_lib_save_LIBS=$LIBS
9311 LIBS="-ldnet_stub  $LIBS"
9312 cat >conftest.$ac_ext <<_ACEOF
9313 #line 9313 "configure"
9314 #include "confdefs.h"
9315
9316 /* Override any gcc2 internal prototype to avoid an error.  */
9317 #ifdef __cplusplus
9318 extern "C"
9319 #endif
9320 /* We use char because int might match the return type of a gcc2
9321    builtin and then its argument prototype would still apply.  */
9322 char dnet_ntoa ();
9323 int
9324 main ()
9325 {
9326 dnet_ntoa ();
9327   ;
9328   return 0;
9329 }
9330 _ACEOF
9331 rm -f conftest.$ac_objext conftest$ac_exeext
9332 if { (eval echo "$as_me:9332: \"$ac_link\"") >&5
9333   (eval $ac_link) 2>&5
9334   ac_status=$?
9335   echo "$as_me:9335: \$? = $ac_status" >&5
9336   (exit $ac_status); } &&
9337          { ac_try='test -s conftest$ac_exeext'
9338   { (eval echo "$as_me:9338: \"$ac_try\"") >&5
9339   (eval $ac_try) 2>&5
9340   ac_status=$?
9341   echo "$as_me:9341: \$? = $ac_status" >&5
9342   (exit $ac_status); }; }; then
9343   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9344 else
9345   echo "$as_me: failed program was:" >&5
9346 cat conftest.$ac_ext >&5
9347 ac_cv_lib_dnet_stub_dnet_ntoa=no
9348 fi
9349 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9350 LIBS=$ac_check_lib_save_LIBS
9351 fi
9352 echo "$as_me:9352: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9353 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9354 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9355   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9356 fi
9357
9358     fi
9359 fi
9360 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9361     LIBS="$ac_xsave_LIBS"
9362
9363     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9364     # to get the SysV transport functions.
9365     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9366     # needs -lnsl.
9367     # The nsl library prevents programs from opening the X display
9368     # on Irix 5.2, according to T.E. Dickey.
9369     # The functions gethostbyname, getservbyname, and inet_addr are
9370     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9371     echo "$as_me:9371: checking for gethostbyname" >&5
9372 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9373 if test "${ac_cv_func_gethostbyname+set}" = set; then
9374   echo $ECHO_N "(cached) $ECHO_C" >&6
9375 else
9376   cat >conftest.$ac_ext <<_ACEOF
9377 #line 9377 "configure"
9378 #include "confdefs.h"
9379 /* System header to define __stub macros and hopefully few prototypes,
9380     which can conflict with char gethostbyname (); below.  */
9381 #include <assert.h>
9382 /* Override any gcc2 internal prototype to avoid an error.  */
9383 #ifdef __cplusplus
9384 extern "C"
9385 #endif
9386 /* We use char because int might match the return type of a gcc2
9387    builtin and then its argument prototype would still apply.  */
9388 char gethostbyname ();
9389 char (*f) ();
9390
9391 int
9392 main ()
9393 {
9394 /* The GNU C library defines this for functions which it implements
9395     to always fail with ENOSYS.  Some functions are actually named
9396     something starting with __ and the normal name is an alias.  */
9397 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9398 choke me
9399 #else
9400 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9401 #endif
9402
9403   ;
9404   return 0;
9405 }
9406 _ACEOF
9407 rm -f conftest.$ac_objext conftest$ac_exeext
9408 if { (eval echo "$as_me:9408: \"$ac_link\"") >&5
9409   (eval $ac_link) 2>&5
9410   ac_status=$?
9411   echo "$as_me:9411: \$? = $ac_status" >&5
9412   (exit $ac_status); } &&
9413          { ac_try='test -s conftest$ac_exeext'
9414   { (eval echo "$as_me:9414: \"$ac_try\"") >&5
9415   (eval $ac_try) 2>&5
9416   ac_status=$?
9417   echo "$as_me:9417: \$? = $ac_status" >&5
9418   (exit $ac_status); }; }; then
9419   ac_cv_func_gethostbyname=yes
9420 else
9421   echo "$as_me: failed program was:" >&5
9422 cat conftest.$ac_ext >&5
9423 ac_cv_func_gethostbyname=no
9424 fi
9425 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9426 fi
9427 echo "$as_me:9427: result: $ac_cv_func_gethostbyname" >&5
9428 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9429
9430     if test $ac_cv_func_gethostbyname = no; then
9431       echo "$as_me:9431: checking for gethostbyname in -lnsl" >&5
9432 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9433 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9434   echo $ECHO_N "(cached) $ECHO_C" >&6
9435 else
9436   ac_check_lib_save_LIBS=$LIBS
9437 LIBS="-lnsl  $LIBS"
9438 cat >conftest.$ac_ext <<_ACEOF
9439 #line 9439 "configure"
9440 #include "confdefs.h"
9441
9442 /* Override any gcc2 internal prototype to avoid an error.  */
9443 #ifdef __cplusplus
9444 extern "C"
9445 #endif
9446 /* We use char because int might match the return type of a gcc2
9447    builtin and then its argument prototype would still apply.  */
9448 char gethostbyname ();
9449 int
9450 main ()
9451 {
9452 gethostbyname ();
9453   ;
9454   return 0;
9455 }
9456 _ACEOF
9457 rm -f conftest.$ac_objext conftest$ac_exeext
9458 if { (eval echo "$as_me:9458: \"$ac_link\"") >&5
9459   (eval $ac_link) 2>&5
9460   ac_status=$?
9461   echo "$as_me:9461: \$? = $ac_status" >&5
9462   (exit $ac_status); } &&
9463          { ac_try='test -s conftest$ac_exeext'
9464   { (eval echo "$as_me:9464: \"$ac_try\"") >&5
9465   (eval $ac_try) 2>&5
9466   ac_status=$?
9467   echo "$as_me:9467: \$? = $ac_status" >&5
9468   (exit $ac_status); }; }; then
9469   ac_cv_lib_nsl_gethostbyname=yes
9470 else
9471   echo "$as_me: failed program was:" >&5
9472 cat conftest.$ac_ext >&5
9473 ac_cv_lib_nsl_gethostbyname=no
9474 fi
9475 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9476 LIBS=$ac_check_lib_save_LIBS
9477 fi
9478 echo "$as_me:9478: result: $ac_cv_lib_nsl_gethostbyname" >&5
9479 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9480 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9481   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9482 fi
9483
9484       if test $ac_cv_lib_nsl_gethostbyname = no; then
9485         echo "$as_me:9485: checking for gethostbyname in -lbsd" >&5
9486 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9487 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9488   echo $ECHO_N "(cached) $ECHO_C" >&6
9489 else
9490   ac_check_lib_save_LIBS=$LIBS
9491 LIBS="-lbsd  $LIBS"
9492 cat >conftest.$ac_ext <<_ACEOF
9493 #line 9493 "configure"
9494 #include "confdefs.h"
9495
9496 /* Override any gcc2 internal prototype to avoid an error.  */
9497 #ifdef __cplusplus
9498 extern "C"
9499 #endif
9500 /* We use char because int might match the return type of a gcc2
9501    builtin and then its argument prototype would still apply.  */
9502 char gethostbyname ();
9503 int
9504 main ()
9505 {
9506 gethostbyname ();
9507   ;
9508   return 0;
9509 }
9510 _ACEOF
9511 rm -f conftest.$ac_objext conftest$ac_exeext
9512 if { (eval echo "$as_me:9512: \"$ac_link\"") >&5
9513   (eval $ac_link) 2>&5
9514   ac_status=$?
9515   echo "$as_me:9515: \$? = $ac_status" >&5
9516   (exit $ac_status); } &&
9517          { ac_try='test -s conftest$ac_exeext'
9518   { (eval echo "$as_me:9518: \"$ac_try\"") >&5
9519   (eval $ac_try) 2>&5
9520   ac_status=$?
9521   echo "$as_me:9521: \$? = $ac_status" >&5
9522   (exit $ac_status); }; }; then
9523   ac_cv_lib_bsd_gethostbyname=yes
9524 else
9525   echo "$as_me: failed program was:" >&5
9526 cat conftest.$ac_ext >&5
9527 ac_cv_lib_bsd_gethostbyname=no
9528 fi
9529 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9530 LIBS=$ac_check_lib_save_LIBS
9531 fi
9532 echo "$as_me:9532: result: $ac_cv_lib_bsd_gethostbyname" >&5
9533 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
9534 if test $ac_cv_lib_bsd_gethostbyname = yes; then
9535   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
9536 fi
9537
9538       fi
9539     fi
9540
9541     # lieder@skyler.mavd.honeywell.com says without -lsocket,
9542     # socket/setsockopt and other routines are undefined under SCO ODT
9543     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
9544     # on later versions), says Simon Leinen: it contains gethostby*
9545     # variants that don't use the nameserver (or something).  -lsocket
9546     # must be given before -lnsl if both are needed.  We assume that
9547     # if connect needs -lnsl, so does gethostbyname.
9548     echo "$as_me:9548: checking for connect" >&5
9549 echo $ECHO_N "checking for connect... $ECHO_C" >&6
9550 if test "${ac_cv_func_connect+set}" = set; then
9551   echo $ECHO_N "(cached) $ECHO_C" >&6
9552 else
9553   cat >conftest.$ac_ext <<_ACEOF
9554 #line 9554 "configure"
9555 #include "confdefs.h"
9556 /* System header to define __stub macros and hopefully few prototypes,
9557     which can conflict with char connect (); below.  */
9558 #include <assert.h>
9559 /* Override any gcc2 internal prototype to avoid an error.  */
9560 #ifdef __cplusplus
9561 extern "C"
9562 #endif
9563 /* We use char because int might match the return type of a gcc2
9564    builtin and then its argument prototype would still apply.  */
9565 char connect ();
9566 char (*f) ();
9567
9568 int
9569 main ()
9570 {
9571 /* The GNU C library defines this for functions which it implements
9572     to always fail with ENOSYS.  Some functions are actually named
9573     something starting with __ and the normal name is an alias.  */
9574 #if defined (__stub_connect) || defined (__stub___connect)
9575 choke me
9576 #else
9577 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9578 #endif
9579
9580   ;
9581   return 0;
9582 }
9583 _ACEOF
9584 rm -f conftest.$ac_objext conftest$ac_exeext
9585 if { (eval echo "$as_me:9585: \"$ac_link\"") >&5
9586   (eval $ac_link) 2>&5
9587   ac_status=$?
9588   echo "$as_me:9588: \$? = $ac_status" >&5
9589   (exit $ac_status); } &&
9590          { ac_try='test -s conftest$ac_exeext'
9591   { (eval echo "$as_me:9591: \"$ac_try\"") >&5
9592   (eval $ac_try) 2>&5
9593   ac_status=$?
9594   echo "$as_me:9594: \$? = $ac_status" >&5
9595   (exit $ac_status); }; }; then
9596   ac_cv_func_connect=yes
9597 else
9598   echo "$as_me: failed program was:" >&5
9599 cat conftest.$ac_ext >&5
9600 ac_cv_func_connect=no
9601 fi
9602 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9603 fi
9604 echo "$as_me:9604: result: $ac_cv_func_connect" >&5
9605 echo "${ECHO_T}$ac_cv_func_connect" >&6
9606
9607     if test $ac_cv_func_connect = no; then
9608       echo "$as_me:9608: checking for connect in -lsocket" >&5
9609 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
9610 if test "${ac_cv_lib_socket_connect+set}" = set; then
9611   echo $ECHO_N "(cached) $ECHO_C" >&6
9612 else
9613   ac_check_lib_save_LIBS=$LIBS
9614 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
9615 cat >conftest.$ac_ext <<_ACEOF
9616 #line 9616 "configure"
9617 #include "confdefs.h"
9618
9619 /* Override any gcc2 internal prototype to avoid an error.  */
9620 #ifdef __cplusplus
9621 extern "C"
9622 #endif
9623 /* We use char because int might match the return type of a gcc2
9624    builtin and then its argument prototype would still apply.  */
9625 char connect ();
9626 int
9627 main ()
9628 {
9629 connect ();
9630   ;
9631   return 0;
9632 }
9633 _ACEOF
9634 rm -f conftest.$ac_objext conftest$ac_exeext
9635 if { (eval echo "$as_me:9635: \"$ac_link\"") >&5
9636   (eval $ac_link) 2>&5
9637   ac_status=$?
9638   echo "$as_me:9638: \$? = $ac_status" >&5
9639   (exit $ac_status); } &&
9640          { ac_try='test -s conftest$ac_exeext'
9641   { (eval echo "$as_me:9641: \"$ac_try\"") >&5
9642   (eval $ac_try) 2>&5
9643   ac_status=$?
9644   echo "$as_me:9644: \$? = $ac_status" >&5
9645   (exit $ac_status); }; }; then
9646   ac_cv_lib_socket_connect=yes
9647 else
9648   echo "$as_me: failed program was:" >&5
9649 cat conftest.$ac_ext >&5
9650 ac_cv_lib_socket_connect=no
9651 fi
9652 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9653 LIBS=$ac_check_lib_save_LIBS
9654 fi
9655 echo "$as_me:9655: result: $ac_cv_lib_socket_connect" >&5
9656 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
9657 if test $ac_cv_lib_socket_connect = yes; then
9658   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
9659 fi
9660
9661     fi
9662
9663     # Guillermo Gomez says -lposix is necessary on A/UX.
9664     echo "$as_me:9664: checking for remove" >&5
9665 echo $ECHO_N "checking for remove... $ECHO_C" >&6
9666 if test "${ac_cv_func_remove+set}" = set; then
9667   echo $ECHO_N "(cached) $ECHO_C" >&6
9668 else
9669   cat >conftest.$ac_ext <<_ACEOF
9670 #line 9670 "configure"
9671 #include "confdefs.h"
9672 /* System header to define __stub macros and hopefully few prototypes,
9673     which can conflict with char remove (); below.  */
9674 #include <assert.h>
9675 /* Override any gcc2 internal prototype to avoid an error.  */
9676 #ifdef __cplusplus
9677 extern "C"
9678 #endif
9679 /* We use char because int might match the return type of a gcc2
9680    builtin and then its argument prototype would still apply.  */
9681 char remove ();
9682 char (*f) ();
9683
9684 int
9685 main ()
9686 {
9687 /* The GNU C library defines this for functions which it implements
9688     to always fail with ENOSYS.  Some functions are actually named
9689     something starting with __ and the normal name is an alias.  */
9690 #if defined (__stub_remove) || defined (__stub___remove)
9691 choke me
9692 #else
9693 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9694 #endif
9695
9696   ;
9697   return 0;
9698 }
9699 _ACEOF
9700 rm -f conftest.$ac_objext conftest$ac_exeext
9701 if { (eval echo "$as_me:9701: \"$ac_link\"") >&5
9702   (eval $ac_link) 2>&5
9703   ac_status=$?
9704   echo "$as_me:9704: \$? = $ac_status" >&5
9705   (exit $ac_status); } &&
9706          { ac_try='test -s conftest$ac_exeext'
9707   { (eval echo "$as_me:9707: \"$ac_try\"") >&5
9708   (eval $ac_try) 2>&5
9709   ac_status=$?
9710   echo "$as_me:9710: \$? = $ac_status" >&5
9711   (exit $ac_status); }; }; then
9712   ac_cv_func_remove=yes
9713 else
9714   echo "$as_me: failed program was:" >&5
9715 cat conftest.$ac_ext >&5
9716 ac_cv_func_remove=no
9717 fi
9718 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9719 fi
9720 echo "$as_me:9720: result: $ac_cv_func_remove" >&5
9721 echo "${ECHO_T}$ac_cv_func_remove" >&6
9722
9723     if test $ac_cv_func_remove = no; then
9724       echo "$as_me:9724: checking for remove in -lposix" >&5
9725 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
9726 if test "${ac_cv_lib_posix_remove+set}" = set; then
9727   echo $ECHO_N "(cached) $ECHO_C" >&6
9728 else
9729   ac_check_lib_save_LIBS=$LIBS
9730 LIBS="-lposix  $LIBS"
9731 cat >conftest.$ac_ext <<_ACEOF
9732 #line 9732 "configure"
9733 #include "confdefs.h"
9734
9735 /* Override any gcc2 internal prototype to avoid an error.  */
9736 #ifdef __cplusplus
9737 extern "C"
9738 #endif
9739 /* We use char because int might match the return type of a gcc2
9740    builtin and then its argument prototype would still apply.  */
9741 char remove ();
9742 int
9743 main ()
9744 {
9745 remove ();
9746   ;
9747   return 0;
9748 }
9749 _ACEOF
9750 rm -f conftest.$ac_objext conftest$ac_exeext
9751 if { (eval echo "$as_me:9751: \"$ac_link\"") >&5
9752   (eval $ac_link) 2>&5
9753   ac_status=$?
9754   echo "$as_me:9754: \$? = $ac_status" >&5
9755   (exit $ac_status); } &&
9756          { ac_try='test -s conftest$ac_exeext'
9757   { (eval echo "$as_me:9757: \"$ac_try\"") >&5
9758   (eval $ac_try) 2>&5
9759   ac_status=$?
9760   echo "$as_me:9760: \$? = $ac_status" >&5
9761   (exit $ac_status); }; }; then
9762   ac_cv_lib_posix_remove=yes
9763 else
9764   echo "$as_me: failed program was:" >&5
9765 cat conftest.$ac_ext >&5
9766 ac_cv_lib_posix_remove=no
9767 fi
9768 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9769 LIBS=$ac_check_lib_save_LIBS
9770 fi
9771 echo "$as_me:9771: result: $ac_cv_lib_posix_remove" >&5
9772 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
9773 if test $ac_cv_lib_posix_remove = yes; then
9774   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
9775 fi
9776
9777     fi
9778
9779     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
9780     echo "$as_me:9780: checking for shmat" >&5
9781 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
9782 if test "${ac_cv_func_shmat+set}" = set; then
9783   echo $ECHO_N "(cached) $ECHO_C" >&6
9784 else
9785   cat >conftest.$ac_ext <<_ACEOF
9786 #line 9786 "configure"
9787 #include "confdefs.h"
9788 /* System header to define __stub macros and hopefully few prototypes,
9789     which can conflict with char shmat (); below.  */
9790 #include <assert.h>
9791 /* Override any gcc2 internal prototype to avoid an error.  */
9792 #ifdef __cplusplus
9793 extern "C"
9794 #endif
9795 /* We use char because int might match the return type of a gcc2
9796    builtin and then its argument prototype would still apply.  */
9797 char shmat ();
9798 char (*f) ();
9799
9800 int
9801 main ()
9802 {
9803 /* The GNU C library defines this for functions which it implements
9804     to always fail with ENOSYS.  Some functions are actually named
9805     something starting with __ and the normal name is an alias.  */
9806 #if defined (__stub_shmat) || defined (__stub___shmat)
9807 choke me
9808 #else
9809 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9810 #endif
9811
9812   ;
9813   return 0;
9814 }
9815 _ACEOF
9816 rm -f conftest.$ac_objext conftest$ac_exeext
9817 if { (eval echo "$as_me:9817: \"$ac_link\"") >&5
9818   (eval $ac_link) 2>&5
9819   ac_status=$?
9820   echo "$as_me:9820: \$? = $ac_status" >&5
9821   (exit $ac_status); } &&
9822          { ac_try='test -s conftest$ac_exeext'
9823   { (eval echo "$as_me:9823: \"$ac_try\"") >&5
9824   (eval $ac_try) 2>&5
9825   ac_status=$?
9826   echo "$as_me:9826: \$? = $ac_status" >&5
9827   (exit $ac_status); }; }; then
9828   ac_cv_func_shmat=yes
9829 else
9830   echo "$as_me: failed program was:" >&5
9831 cat conftest.$ac_ext >&5
9832 ac_cv_func_shmat=no
9833 fi
9834 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9835 fi
9836 echo "$as_me:9836: result: $ac_cv_func_shmat" >&5
9837 echo "${ECHO_T}$ac_cv_func_shmat" >&6
9838
9839     if test $ac_cv_func_shmat = no; then
9840       echo "$as_me:9840: checking for shmat in -lipc" >&5
9841 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
9842 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
9843   echo $ECHO_N "(cached) $ECHO_C" >&6
9844 else
9845   ac_check_lib_save_LIBS=$LIBS
9846 LIBS="-lipc  $LIBS"
9847 cat >conftest.$ac_ext <<_ACEOF
9848 #line 9848 "configure"
9849 #include "confdefs.h"
9850
9851 /* Override any gcc2 internal prototype to avoid an error.  */
9852 #ifdef __cplusplus
9853 extern "C"
9854 #endif
9855 /* We use char because int might match the return type of a gcc2
9856    builtin and then its argument prototype would still apply.  */
9857 char shmat ();
9858 int
9859 main ()
9860 {
9861 shmat ();
9862   ;
9863   return 0;
9864 }
9865 _ACEOF
9866 rm -f conftest.$ac_objext conftest$ac_exeext
9867 if { (eval echo "$as_me:9867: \"$ac_link\"") >&5
9868   (eval $ac_link) 2>&5
9869   ac_status=$?
9870   echo "$as_me:9870: \$? = $ac_status" >&5
9871   (exit $ac_status); } &&
9872          { ac_try='test -s conftest$ac_exeext'
9873   { (eval echo "$as_me:9873: \"$ac_try\"") >&5
9874   (eval $ac_try) 2>&5
9875   ac_status=$?
9876   echo "$as_me:9876: \$? = $ac_status" >&5
9877   (exit $ac_status); }; }; then
9878   ac_cv_lib_ipc_shmat=yes
9879 else
9880   echo "$as_me: failed program was:" >&5
9881 cat conftest.$ac_ext >&5
9882 ac_cv_lib_ipc_shmat=no
9883 fi
9884 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9885 LIBS=$ac_check_lib_save_LIBS
9886 fi
9887 echo "$as_me:9887: result: $ac_cv_lib_ipc_shmat" >&5
9888 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
9889 if test $ac_cv_lib_ipc_shmat = yes; then
9890   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
9891 fi
9892
9893     fi
9894   fi
9895
9896   # Check for libraries that X11R6 Xt/Xaw programs need.
9897   ac_save_LDFLAGS=$LDFLAGS
9898   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
9899   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
9900   # check for ICE first), but we must link in the order -lSM -lICE or
9901   # we get undefined symbols.  So assume we have SM if we have ICE.
9902   # These have to be linked with before -lX11, unlike the other
9903   # libraries we check for below, so use a different variable.
9904   # John Interrante, Karl Berry
9905   echo "$as_me:9905: checking for IceConnectionNumber in -lICE" >&5
9906 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
9907 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
9908   echo $ECHO_N "(cached) $ECHO_C" >&6
9909 else
9910   ac_check_lib_save_LIBS=$LIBS
9911 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
9912 cat >conftest.$ac_ext <<_ACEOF
9913 #line 9913 "configure"
9914 #include "confdefs.h"
9915
9916 /* Override any gcc2 internal prototype to avoid an error.  */
9917 #ifdef __cplusplus
9918 extern "C"
9919 #endif
9920 /* We use char because int might match the return type of a gcc2
9921    builtin and then its argument prototype would still apply.  */
9922 char IceConnectionNumber ();
9923 int
9924 main ()
9925 {
9926 IceConnectionNumber ();
9927   ;
9928   return 0;
9929 }
9930 _ACEOF
9931 rm -f conftest.$ac_objext conftest$ac_exeext
9932 if { (eval echo "$as_me:9932: \"$ac_link\"") >&5
9933   (eval $ac_link) 2>&5
9934   ac_status=$?
9935   echo "$as_me:9935: \$? = $ac_status" >&5
9936   (exit $ac_status); } &&
9937          { ac_try='test -s conftest$ac_exeext'
9938   { (eval echo "$as_me:9938: \"$ac_try\"") >&5
9939   (eval $ac_try) 2>&5
9940   ac_status=$?
9941   echo "$as_me:9941: \$? = $ac_status" >&5
9942   (exit $ac_status); }; }; then
9943   ac_cv_lib_ICE_IceConnectionNumber=yes
9944 else
9945   echo "$as_me: failed program was:" >&5
9946 cat conftest.$ac_ext >&5
9947 ac_cv_lib_ICE_IceConnectionNumber=no
9948 fi
9949 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9950 LIBS=$ac_check_lib_save_LIBS
9951 fi
9952 echo "$as_me:9952: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
9953 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
9954 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
9955   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
9956 fi
9957
9958   LDFLAGS=$ac_save_LDFLAGS
9959
9960 fi
9961
9962 cf_x_athena=${cf_x_athena:-Xaw}
9963
9964 echo "$as_me:9964: checking if you want to link with Xaw 3d library" >&5
9965 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
9966 withval=
9967
9968 # Check whether --with-Xaw3d or --without-Xaw3d was given.
9969 if test "${with_Xaw3d+set}" = set; then
9970   withval="$with_Xaw3d"
9971
9972 fi;
9973 if test "$withval" = yes ; then
9974         cf_x_athena=Xaw3d
9975         echo "$as_me:9975: result: yes" >&5
9976 echo "${ECHO_T}yes" >&6
9977 else
9978         echo "$as_me:9978: result: no" >&5
9979 echo "${ECHO_T}no" >&6
9980 fi
9981
9982 echo "$as_me:9982: checking if you want to link with Xaw 3d xft library" >&5
9983 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
9984 withval=
9985
9986 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
9987 if test "${with_Xaw3dxft+set}" = set; then
9988   withval="$with_Xaw3dxft"
9989
9990 fi;
9991 if test "$withval" = yes ; then
9992         cf_x_athena=Xaw3dxft
9993         echo "$as_me:9993: result: yes" >&5
9994 echo "${ECHO_T}yes" >&6
9995 else
9996         echo "$as_me:9996: result: no" >&5
9997 echo "${ECHO_T}no" >&6
9998 fi
9999
10000 echo "$as_me:10000: checking if you want to link with neXT Athena library" >&5
10001 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10002 withval=
10003
10004 # Check whether --with-neXtaw or --without-neXtaw was given.
10005 if test "${with_neXtaw+set}" = set; then
10006   withval="$with_neXtaw"
10007
10008 fi;
10009 if test "$withval" = yes ; then
10010         cf_x_athena=neXtaw
10011         echo "$as_me:10011: result: yes" >&5
10012 echo "${ECHO_T}yes" >&6
10013 else
10014         echo "$as_me:10014: result: no" >&5
10015 echo "${ECHO_T}no" >&6
10016 fi
10017
10018 echo "$as_me:10018: checking if you want to link with Athena-Plus library" >&5
10019 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10020 withval=
10021
10022 # Check whether --with-XawPlus or --without-XawPlus was given.
10023 if test "${with_XawPlus+set}" = set; then
10024   withval="$with_XawPlus"
10025
10026 fi;
10027 if test "$withval" = yes ; then
10028         cf_x_athena=XawPlus
10029         echo "$as_me:10029: result: yes" >&5
10030 echo "${ECHO_T}yes" >&6
10031 else
10032         echo "$as_me:10032: result: no" >&5
10033 echo "${ECHO_T}no" >&6
10034 fi
10035
10036 cf_x_athena_lib=""
10037
10038 if test "$PKG_CONFIG" != none ; then
10039         cf_athena_list=
10040         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10041         for cf_athena_pkg in \
10042                 $cf_athena_list \
10043                 ${cf_x_athena} \
10044                 ${cf_x_athena}-devel \
10045                 lib${cf_x_athena} \
10046                 lib${cf_x_athena}-devel
10047         do
10048
10049 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10050         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10051
10052 echo "${as_me:-configure}:10052: testing found package $cf_athena_pkg ..." 1>&5
10053
10054         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10055         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10056         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10057
10058 echo "${as_me:-configure}:10058: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10059
10060         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10061
10062 echo "${as_me:-configure}:10062: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10063
10064 cf_fix_cppflags=no
10065 cf_new_cflags=
10066 cf_new_cppflags=
10067 cf_new_extra_cppflags=
10068
10069 for cf_add_cflags in $cf_pkgconfig_incs
10070 do
10071 case $cf_fix_cppflags in
10072 (no)
10073         case $cf_add_cflags in
10074         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10075                 case $cf_add_cflags in
10076                 (-D*)
10077                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10078
10079                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10080                                 && test -z "${cf_tst_cflags}" \
10081                                 && cf_fix_cppflags=yes
10082
10083                         if test $cf_fix_cppflags = yes ; then
10084                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10085                                 continue
10086                         elif test "${cf_tst_cflags}" = "\"'" ; then
10087                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10088                                 continue
10089                         fi
10090                         ;;
10091                 esac
10092                 case "$CPPFLAGS" in
10093                 (*$cf_add_cflags)
10094                         ;;
10095                 (*)
10096                         case $cf_add_cflags in
10097                         (-D*)
10098                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10099
10100 CPPFLAGS=`echo "$CPPFLAGS" | \
10101         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10102                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10103
10104                                 ;;
10105                         esac
10106                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10107                         ;;
10108                 esac
10109                 ;;
10110         (*)
10111                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10112                 ;;
10113         esac
10114         ;;
10115 (yes)
10116         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10117
10118         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10119
10120         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10121                 && test -z "${cf_tst_cflags}" \
10122                 && cf_fix_cppflags=no
10123         ;;
10124 esac
10125 done
10126
10127 if test -n "$cf_new_cflags" ; then
10128
10129         CFLAGS="$CFLAGS $cf_new_cflags"
10130 fi
10131
10132 if test -n "$cf_new_cppflags" ; then
10133
10134         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10135 fi
10136
10137 if test -n "$cf_new_extra_cppflags" ; then
10138
10139         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10140 fi
10141
10142 cf_add_libs="$cf_pkgconfig_libs"
10143 # Filter out duplicates - this happens with badly-designed ".pc" files...
10144 for cf_add_1lib in $LIBS
10145 do
10146         for cf_add_2lib in $cf_add_libs
10147         do
10148                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10149                 then
10150                         cf_add_1lib=
10151                         break
10152                 fi
10153         done
10154         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10155 done
10156 LIBS="$cf_add_libs"
10157
10158                         cf_x_athena_lib="$cf_pkgconfig_libs"
10159
10160 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10161
10162                         cat >>confdefs.h <<EOF
10163 #define $cf_x_athena_LIBS 1
10164 EOF
10165
10166         for cf_trim_lib in Xmu Xt X11
10167         do
10168                 case "$LIBS" in
10169                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10170                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10171                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10172
10173 echo "${as_me:-configure}:10173: testing ..trimmed $LIBS ..." 1>&5
10174
10175                         ;;
10176                 esac
10177         done
10178
10179 echo "$as_me:10179: checking for usable $cf_x_athena/Xmu package" >&5
10180 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10181 if test "${cf_cv_xaw_compat+set}" = set; then
10182   echo $ECHO_N "(cached) $ECHO_C" >&6
10183 else
10184
10185 cat >conftest.$ac_ext <<_ACEOF
10186 #line 10186 "configure"
10187 #include "confdefs.h"
10188
10189 #include <X11/Xmu/CharSet.h>
10190
10191 int
10192 main ()
10193 {
10194
10195 int check = XmuCompareISOLatin1("big", "small")
10196
10197   ;
10198   return 0;
10199 }
10200 _ACEOF
10201 rm -f conftest.$ac_objext conftest$ac_exeext
10202 if { (eval echo "$as_me:10202: \"$ac_link\"") >&5
10203   (eval $ac_link) 2>&5
10204   ac_status=$?
10205   echo "$as_me:10205: \$? = $ac_status" >&5
10206   (exit $ac_status); } &&
10207          { ac_try='test -s conftest$ac_exeext'
10208   { (eval echo "$as_me:10208: \"$ac_try\"") >&5
10209   (eval $ac_try) 2>&5
10210   ac_status=$?
10211   echo "$as_me:10211: \$? = $ac_status" >&5
10212   (exit $ac_status); }; }; then
10213   cf_cv_xaw_compat=yes
10214 else
10215   echo "$as_me: failed program was:" >&5
10216 cat conftest.$ac_ext >&5
10217 cf_cv_xaw_compat=no
10218 fi
10219 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10220 fi
10221 echo "$as_me:10221: result: $cf_cv_xaw_compat" >&5
10222 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10223
10224                         if test "$cf_cv_xaw_compat" = no
10225                         then
10226                                 # workaround for broken ".pc" files...
10227                                 case "$cf_x_athena_lib" in
10228                                 (*-lXmu*)
10229                                         ;;
10230                                 (*)
10231                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10232
10233 echo "${as_me:-configure}:10233: testing work around broken package ..." 1>&5
10234
10235                                         cf_save_xmu="$LIBS"
10236                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
10237
10238 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10239         test -n "$verbose" && echo "    found package xmu" 1>&6
10240
10241 echo "${as_me:-configure}:10241: testing found package xmu ..." 1>&5
10242
10243         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10244         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10245         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10246
10247 echo "${as_me:-configure}:10247: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10248
10249         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10250
10251 echo "${as_me:-configure}:10251: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10252
10253 cf_fix_cppflags=no
10254 cf_new_cflags=
10255 cf_new_cppflags=
10256 cf_new_extra_cppflags=
10257
10258 for cf_add_cflags in $cf_pkgconfig_incs
10259 do
10260 case $cf_fix_cppflags in
10261 (no)
10262         case $cf_add_cflags in
10263         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10264                 case $cf_add_cflags in
10265                 (-D*)
10266                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10267
10268                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10269                                 && test -z "${cf_tst_cflags}" \
10270                                 && cf_fix_cppflags=yes
10271
10272                         if test $cf_fix_cppflags = yes ; then
10273                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10274                                 continue
10275                         elif test "${cf_tst_cflags}" = "\"'" ; then
10276                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10277                                 continue
10278                         fi
10279                         ;;
10280                 esac
10281                 case "$CPPFLAGS" in
10282                 (*$cf_add_cflags)
10283                         ;;
10284                 (*)
10285                         case $cf_add_cflags in
10286                         (-D*)
10287                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10288
10289 CPPFLAGS=`echo "$CPPFLAGS" | \
10290         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10291                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10292
10293                                 ;;
10294                         esac
10295                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10296                         ;;
10297                 esac
10298                 ;;
10299         (*)
10300                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10301                 ;;
10302         esac
10303         ;;
10304 (yes)
10305         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10306
10307         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10308
10309         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10310                 && test -z "${cf_tst_cflags}" \
10311                 && cf_fix_cppflags=no
10312         ;;
10313 esac
10314 done
10315
10316 if test -n "$cf_new_cflags" ; then
10317
10318         CFLAGS="$CFLAGS $cf_new_cflags"
10319 fi
10320
10321 if test -n "$cf_new_cppflags" ; then
10322
10323         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10324 fi
10325
10326 if test -n "$cf_new_extra_cppflags" ; then
10327
10328         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10329 fi
10330
10331 cf_add_libs="$cf_pkgconfig_libs"
10332 # Filter out duplicates - this happens with badly-designed ".pc" files...
10333 for cf_add_1lib in $LIBS
10334 do
10335         for cf_add_2lib in $cf_add_libs
10336         do
10337                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10338                 then
10339                         cf_add_1lib=
10340                         break
10341                 fi
10342         done
10343         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10344 done
10345 LIBS="$cf_add_libs"
10346
10347                                                         LIBS="$cf_save_xmu"
10348
10349 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10350
10351 echo "${as_me:-configure}:10351: testing ...before $LIBS ..." 1>&5
10352
10353 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
10354 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10355
10356 echo "${as_me:-configure}:10356: testing ...after  $LIBS ..." 1>&5
10357
10358 else
10359         cf_pkgconfig_incs=
10360         cf_pkgconfig_libs=
10361
10362 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10363
10364 echo "${as_me:-configure}:10364: testing ...before $LIBS ..." 1>&5
10365
10366 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
10367 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10368
10369 echo "${as_me:-configure}:10369: testing ...after  $LIBS ..." 1>&5
10370
10371 fi
10372
10373         for cf_trim_lib in Xmu Xt X11
10374         do
10375                 case "$LIBS" in
10376                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10377                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10378                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10379
10380 echo "${as_me:-configure}:10380: testing ..trimmed $LIBS ..." 1>&5
10381
10382                         ;;
10383                 esac
10384         done
10385
10386                                         ;;
10387                                 esac
10388                         fi
10389
10390                         break
10391 else
10392         cf_pkgconfig_incs=
10393         cf_pkgconfig_libs=
10394         :
10395 fi
10396
10397         done
10398 fi
10399
10400 if test -z "$cf_x_athena_lib" ; then
10401
10402 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10403         test -n "$verbose" && echo "    found package Xext" 1>&6
10404
10405 echo "${as_me:-configure}:10405: testing found package Xext ..." 1>&5
10406
10407         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10408         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10409         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10410
10411 echo "${as_me:-configure}:10411: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10412
10413         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10414
10415 echo "${as_me:-configure}:10415: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10416
10417 cf_fix_cppflags=no
10418 cf_new_cflags=
10419 cf_new_cppflags=
10420 cf_new_extra_cppflags=
10421
10422 for cf_add_cflags in $cf_pkgconfig_incs
10423 do
10424 case $cf_fix_cppflags in
10425 (no)
10426         case $cf_add_cflags in
10427         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10428                 case $cf_add_cflags in
10429                 (-D*)
10430                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10431
10432                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10433                                 && test -z "${cf_tst_cflags}" \
10434                                 && cf_fix_cppflags=yes
10435
10436                         if test $cf_fix_cppflags = yes ; then
10437                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10438                                 continue
10439                         elif test "${cf_tst_cflags}" = "\"'" ; then
10440                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10441                                 continue
10442                         fi
10443                         ;;
10444                 esac
10445                 case "$CPPFLAGS" in
10446                 (*$cf_add_cflags)
10447                         ;;
10448                 (*)
10449                         case $cf_add_cflags in
10450                         (-D*)
10451                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10452
10453 CPPFLAGS=`echo "$CPPFLAGS" | \
10454         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10455                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10456
10457                                 ;;
10458                         esac
10459                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10460                         ;;
10461                 esac
10462                 ;;
10463         (*)
10464                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10465                 ;;
10466         esac
10467         ;;
10468 (yes)
10469         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10470
10471         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10472
10473         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10474                 && test -z "${cf_tst_cflags}" \
10475                 && cf_fix_cppflags=no
10476         ;;
10477 esac
10478 done
10479
10480 if test -n "$cf_new_cflags" ; then
10481
10482         CFLAGS="$CFLAGS $cf_new_cflags"
10483 fi
10484
10485 if test -n "$cf_new_cppflags" ; then
10486
10487         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10488 fi
10489
10490 if test -n "$cf_new_extra_cppflags" ; then
10491
10492         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10493 fi
10494
10495 cf_add_libs="$cf_pkgconfig_libs"
10496 # Filter out duplicates - this happens with badly-designed ".pc" files...
10497 for cf_add_1lib in $LIBS
10498 do
10499         for cf_add_2lib in $cf_add_libs
10500         do
10501                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10502                 then
10503                         cf_add_1lib=
10504                         break
10505                 fi
10506         done
10507         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10508 done
10509 LIBS="$cf_add_libs"
10510
10511         :
10512 else
10513         cf_pkgconfig_incs=
10514         cf_pkgconfig_libs=
10515
10516         echo "$as_me:10516: checking for XextCreateExtension in -lXext" >&5
10517 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10518 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10519   echo $ECHO_N "(cached) $ECHO_C" >&6
10520 else
10521   ac_check_lib_save_LIBS=$LIBS
10522 LIBS="-lXext  $LIBS"
10523 cat >conftest.$ac_ext <<_ACEOF
10524 #line 10524 "configure"
10525 #include "confdefs.h"
10526
10527 /* Override any gcc2 internal prototype to avoid an error.  */
10528 #ifdef __cplusplus
10529 extern "C"
10530 #endif
10531 /* We use char because int might match the return type of a gcc2
10532    builtin and then its argument prototype would still apply.  */
10533 char XextCreateExtension ();
10534 int
10535 main ()
10536 {
10537 XextCreateExtension ();
10538   ;
10539   return 0;
10540 }
10541 _ACEOF
10542 rm -f conftest.$ac_objext conftest$ac_exeext
10543 if { (eval echo "$as_me:10543: \"$ac_link\"") >&5
10544   (eval $ac_link) 2>&5
10545   ac_status=$?
10546   echo "$as_me:10546: \$? = $ac_status" >&5
10547   (exit $ac_status); } &&
10548          { ac_try='test -s conftest$ac_exeext'
10549   { (eval echo "$as_me:10549: \"$ac_try\"") >&5
10550   (eval $ac_try) 2>&5
10551   ac_status=$?
10552   echo "$as_me:10552: \$? = $ac_status" >&5
10553   (exit $ac_status); }; }; then
10554   ac_cv_lib_Xext_XextCreateExtension=yes
10555 else
10556   echo "$as_me: failed program was:" >&5
10557 cat conftest.$ac_ext >&5
10558 ac_cv_lib_Xext_XextCreateExtension=no
10559 fi
10560 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10561 LIBS=$ac_check_lib_save_LIBS
10562 fi
10563 echo "$as_me:10563: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
10564 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
10565 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
10566
10567 cf_add_libs="-lXext"
10568 # Filter out duplicates - this happens with badly-designed ".pc" files...
10569 for cf_add_1lib in $LIBS
10570 do
10571         for cf_add_2lib in $cf_add_libs
10572         do
10573                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10574                 then
10575                         cf_add_1lib=
10576                         break
10577                 fi
10578         done
10579         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10580 done
10581 LIBS="$cf_add_libs"
10582
10583 fi
10584
10585 fi
10586
10587 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
10588 # in some cases has installed dummy files in the former, other cases replaced
10589 # it with a link to the new location).  This complicates the configure script.
10590 # Check for that pitfall, and recover using pkg-config
10591 #
10592 # If none of these are set, the configuration is almost certainly broken.
10593 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
10594 then
10595
10596 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
10597         test -n "$verbose" && echo "    found package x11" 1>&6
10598
10599 echo "${as_me:-configure}:10599: testing found package x11 ..." 1>&5
10600
10601         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
10602         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
10603         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
10604
10605 echo "${as_me:-configure}:10605: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10606
10607         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
10608
10609 echo "${as_me:-configure}:10609: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
10610
10611 cf_fix_cppflags=no
10612 cf_new_cflags=
10613 cf_new_cppflags=
10614 cf_new_extra_cppflags=
10615
10616 for cf_add_cflags in $cf_pkgconfig_incs
10617 do
10618 case $cf_fix_cppflags in
10619 (no)
10620         case $cf_add_cflags in
10621         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10622                 case $cf_add_cflags in
10623                 (-D*)
10624                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10625
10626                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10627                                 && test -z "${cf_tst_cflags}" \
10628                                 && cf_fix_cppflags=yes
10629
10630                         if test $cf_fix_cppflags = yes ; then
10631                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10632                                 continue
10633                         elif test "${cf_tst_cflags}" = "\"'" ; then
10634                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10635                                 continue
10636                         fi
10637                         ;;
10638                 esac
10639                 case "$CPPFLAGS" in
10640                 (*$cf_add_cflags)
10641                         ;;
10642                 (*)
10643                         case $cf_add_cflags in
10644                         (-D*)
10645                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10646
10647 CPPFLAGS=`echo "$CPPFLAGS" | \
10648         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10649                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10650
10651                                 ;;
10652                         esac
10653                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10654                         ;;
10655                 esac
10656                 ;;
10657         (*)
10658                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10659                 ;;
10660         esac
10661         ;;
10662 (yes)
10663         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10664
10665         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10666
10667         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10668                 && test -z "${cf_tst_cflags}" \
10669                 && cf_fix_cppflags=no
10670         ;;
10671 esac
10672 done
10673
10674 if test -n "$cf_new_cflags" ; then
10675
10676         CFLAGS="$CFLAGS $cf_new_cflags"
10677 fi
10678
10679 if test -n "$cf_new_cppflags" ; then
10680
10681         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10682 fi
10683
10684 if test -n "$cf_new_extra_cppflags" ; then
10685
10686         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10687 fi
10688
10689 cf_add_libs="$cf_pkgconfig_libs"
10690 # Filter out duplicates - this happens with badly-designed ".pc" files...
10691 for cf_add_1lib in $LIBS
10692 do
10693         for cf_add_2lib in $cf_add_libs
10694         do
10695                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10696                 then
10697                         cf_add_1lib=
10698                         break
10699                 fi
10700         done
10701         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10702 done
10703 LIBS="$cf_add_libs"
10704
10705         :
10706 else
10707         cf_pkgconfig_incs=
10708         cf_pkgconfig_libs=
10709         { echo "$as_me:10709: WARNING: unable to find X11 library" >&5
10710 echo "$as_me: WARNING: unable to find X11 library" >&2;}
10711 fi
10712
10713 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
10714         test -n "$verbose" && echo "    found package ice" 1>&6
10715
10716 echo "${as_me:-configure}:10716: testing found package ice ..." 1>&5
10717
10718         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
10719         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
10720         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
10721
10722 echo "${as_me:-configure}:10722: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10723
10724         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
10725
10726 echo "${as_me:-configure}:10726: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
10727
10728 cf_fix_cppflags=no
10729 cf_new_cflags=
10730 cf_new_cppflags=
10731 cf_new_extra_cppflags=
10732
10733 for cf_add_cflags in $cf_pkgconfig_incs
10734 do
10735 case $cf_fix_cppflags in
10736 (no)
10737         case $cf_add_cflags in
10738         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10739                 case $cf_add_cflags in
10740                 (-D*)
10741                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10742
10743                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10744                                 && test -z "${cf_tst_cflags}" \
10745                                 && cf_fix_cppflags=yes
10746
10747                         if test $cf_fix_cppflags = yes ; then
10748                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10749                                 continue
10750                         elif test "${cf_tst_cflags}" = "\"'" ; then
10751                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10752                                 continue
10753                         fi
10754                         ;;
10755                 esac
10756                 case "$CPPFLAGS" in
10757                 (*$cf_add_cflags)
10758                         ;;
10759                 (*)
10760                         case $cf_add_cflags in
10761                         (-D*)
10762                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10763
10764 CPPFLAGS=`echo "$CPPFLAGS" | \
10765         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10766                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10767
10768                                 ;;
10769                         esac
10770                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10771                         ;;
10772                 esac
10773                 ;;
10774         (*)
10775                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10776                 ;;
10777         esac
10778         ;;
10779 (yes)
10780         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10781
10782         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10783
10784         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10785                 && test -z "${cf_tst_cflags}" \
10786                 && cf_fix_cppflags=no
10787         ;;
10788 esac
10789 done
10790
10791 if test -n "$cf_new_cflags" ; then
10792
10793         CFLAGS="$CFLAGS $cf_new_cflags"
10794 fi
10795
10796 if test -n "$cf_new_cppflags" ; then
10797
10798         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10799 fi
10800
10801 if test -n "$cf_new_extra_cppflags" ; then
10802
10803         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10804 fi
10805
10806 cf_add_libs="$cf_pkgconfig_libs"
10807 # Filter out duplicates - this happens with badly-designed ".pc" files...
10808 for cf_add_1lib in $LIBS
10809 do
10810         for cf_add_2lib in $cf_add_libs
10811         do
10812                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10813                 then
10814                         cf_add_1lib=
10815                         break
10816                 fi
10817         done
10818         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10819 done
10820 LIBS="$cf_add_libs"
10821
10822         :
10823 else
10824         cf_pkgconfig_incs=
10825         cf_pkgconfig_libs=
10826         { echo "$as_me:10826: WARNING: unable to find ICE library" >&5
10827 echo "$as_me: WARNING: unable to find ICE library" >&2;}
10828 fi
10829
10830 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
10831         test -n "$verbose" && echo "    found package sm" 1>&6
10832
10833 echo "${as_me:-configure}:10833: testing found package sm ..." 1>&5
10834
10835         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
10836         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
10837         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
10838
10839 echo "${as_me:-configure}:10839: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10840
10841         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
10842
10843 echo "${as_me:-configure}:10843: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
10844
10845 cf_fix_cppflags=no
10846 cf_new_cflags=
10847 cf_new_cppflags=
10848 cf_new_extra_cppflags=
10849
10850 for cf_add_cflags in $cf_pkgconfig_incs
10851 do
10852 case $cf_fix_cppflags in
10853 (no)
10854         case $cf_add_cflags in
10855         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10856                 case $cf_add_cflags in
10857                 (-D*)
10858                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10859
10860                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10861                                 && test -z "${cf_tst_cflags}" \
10862                                 && cf_fix_cppflags=yes
10863
10864                         if test $cf_fix_cppflags = yes ; then
10865                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10866                                 continue
10867                         elif test "${cf_tst_cflags}" = "\"'" ; then
10868                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10869                                 continue
10870                         fi
10871                         ;;
10872                 esac
10873                 case "$CPPFLAGS" in
10874                 (*$cf_add_cflags)
10875                         ;;
10876                 (*)
10877                         case $cf_add_cflags in
10878                         (-D*)
10879                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10880
10881 CPPFLAGS=`echo "$CPPFLAGS" | \
10882         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10883                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10884
10885                                 ;;
10886                         esac
10887                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10888                         ;;
10889                 esac
10890                 ;;
10891         (*)
10892                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10893                 ;;
10894         esac
10895         ;;
10896 (yes)
10897         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10898
10899         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10900
10901         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10902                 && test -z "${cf_tst_cflags}" \
10903                 && cf_fix_cppflags=no
10904         ;;
10905 esac
10906 done
10907
10908 if test -n "$cf_new_cflags" ; then
10909
10910         CFLAGS="$CFLAGS $cf_new_cflags"
10911 fi
10912
10913 if test -n "$cf_new_cppflags" ; then
10914
10915         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10916 fi
10917
10918 if test -n "$cf_new_extra_cppflags" ; then
10919
10920         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10921 fi
10922
10923 cf_add_libs="$cf_pkgconfig_libs"
10924 # Filter out duplicates - this happens with badly-designed ".pc" files...
10925 for cf_add_1lib in $LIBS
10926 do
10927         for cf_add_2lib in $cf_add_libs
10928         do
10929                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10930                 then
10931                         cf_add_1lib=
10932                         break
10933                 fi
10934         done
10935         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10936 done
10937 LIBS="$cf_add_libs"
10938
10939         :
10940 else
10941         cf_pkgconfig_incs=
10942         cf_pkgconfig_libs=
10943         { echo "$as_me:10943: WARNING: unable to find SM library" >&5
10944 echo "$as_me: WARNING: unable to find SM library" >&2;}
10945 fi
10946
10947 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
10948         test -n "$verbose" && echo "    found package xt" 1>&6
10949
10950 echo "${as_me:-configure}:10950: testing found package xt ..." 1>&5
10951
10952         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
10953         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
10954         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
10955
10956 echo "${as_me:-configure}:10956: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10957
10958         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
10959
10960 echo "${as_me:-configure}:10960: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
10961
10962 cf_fix_cppflags=no
10963 cf_new_cflags=
10964 cf_new_cppflags=
10965 cf_new_extra_cppflags=
10966
10967 for cf_add_cflags in $cf_pkgconfig_incs
10968 do
10969 case $cf_fix_cppflags in
10970 (no)
10971         case $cf_add_cflags in
10972         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10973                 case $cf_add_cflags in
10974                 (-D*)
10975                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10976
10977                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10978                                 && test -z "${cf_tst_cflags}" \
10979                                 && cf_fix_cppflags=yes
10980
10981                         if test $cf_fix_cppflags = yes ; then
10982                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10983                                 continue
10984                         elif test "${cf_tst_cflags}" = "\"'" ; then
10985                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10986                                 continue
10987                         fi
10988                         ;;
10989                 esac
10990                 case "$CPPFLAGS" in
10991                 (*$cf_add_cflags)
10992                         ;;
10993                 (*)
10994                         case $cf_add_cflags in
10995                         (-D*)
10996                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10997
10998 CPPFLAGS=`echo "$CPPFLAGS" | \
10999         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11000                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11001
11002                                 ;;
11003                         esac
11004                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11005                         ;;
11006                 esac
11007                 ;;
11008         (*)
11009                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11010                 ;;
11011         esac
11012         ;;
11013 (yes)
11014         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11015
11016         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11017
11018         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11019                 && test -z "${cf_tst_cflags}" \
11020                 && cf_fix_cppflags=no
11021         ;;
11022 esac
11023 done
11024
11025 if test -n "$cf_new_cflags" ; then
11026
11027         CFLAGS="$CFLAGS $cf_new_cflags"
11028 fi
11029
11030 if test -n "$cf_new_cppflags" ; then
11031
11032         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11033 fi
11034
11035 if test -n "$cf_new_extra_cppflags" ; then
11036
11037         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11038 fi
11039
11040 cf_add_libs="$cf_pkgconfig_libs"
11041 # Filter out duplicates - this happens with badly-designed ".pc" files...
11042 for cf_add_1lib in $LIBS
11043 do
11044         for cf_add_2lib in $cf_add_libs
11045         do
11046                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11047                 then
11048                         cf_add_1lib=
11049                         break
11050                 fi
11051         done
11052         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11053 done
11054 LIBS="$cf_add_libs"
11055
11056         :
11057 else
11058         cf_pkgconfig_incs=
11059         cf_pkgconfig_libs=
11060         { echo "$as_me:11060: WARNING: unable to find Xt library" >&5
11061 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11062 fi
11063
11064 fi
11065
11066 cf_have_X_LIBS=no
11067
11068 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11069         test -n "$verbose" && echo "    found package xt" 1>&6
11070
11071 echo "${as_me:-configure}:11071: testing found package xt ..." 1>&5
11072
11073         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11074         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11075         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11076
11077 echo "${as_me:-configure}:11077: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11078
11079         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11080
11081 echo "${as_me:-configure}:11081: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11082
11083 cf_fix_cppflags=no
11084 cf_new_cflags=
11085 cf_new_cppflags=
11086 cf_new_extra_cppflags=
11087
11088 for cf_add_cflags in $cf_pkgconfig_incs
11089 do
11090 case $cf_fix_cppflags in
11091 (no)
11092         case $cf_add_cflags in
11093         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11094                 case $cf_add_cflags in
11095                 (-D*)
11096                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11097
11098                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11099                                 && test -z "${cf_tst_cflags}" \
11100                                 && cf_fix_cppflags=yes
11101
11102                         if test $cf_fix_cppflags = yes ; then
11103                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11104                                 continue
11105                         elif test "${cf_tst_cflags}" = "\"'" ; then
11106                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11107                                 continue
11108                         fi
11109                         ;;
11110                 esac
11111                 case "$CPPFLAGS" in
11112                 (*$cf_add_cflags)
11113                         ;;
11114                 (*)
11115                         case $cf_add_cflags in
11116                         (-D*)
11117                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11118
11119 CPPFLAGS=`echo "$CPPFLAGS" | \
11120         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11121                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11122
11123                                 ;;
11124                         esac
11125                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11126                         ;;
11127                 esac
11128                 ;;
11129         (*)
11130                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11131                 ;;
11132         esac
11133         ;;
11134 (yes)
11135         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11136
11137         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11138
11139         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11140                 && test -z "${cf_tst_cflags}" \
11141                 && cf_fix_cppflags=no
11142         ;;
11143 esac
11144 done
11145
11146 if test -n "$cf_new_cflags" ; then
11147
11148         CFLAGS="$CFLAGS $cf_new_cflags"
11149 fi
11150
11151 if test -n "$cf_new_cppflags" ; then
11152
11153         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11154 fi
11155
11156 if test -n "$cf_new_extra_cppflags" ; then
11157
11158         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11159 fi
11160
11161 cf_add_libs="$cf_pkgconfig_libs"
11162 # Filter out duplicates - this happens with badly-designed ".pc" files...
11163 for cf_add_1lib in $LIBS
11164 do
11165         for cf_add_2lib in $cf_add_libs
11166         do
11167                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11168                 then
11169                         cf_add_1lib=
11170                         break
11171                 fi
11172         done
11173         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11174 done
11175 LIBS="$cf_add_libs"
11176
11177         case "x$LIBS" in
11178         (*-lX11*)
11179                 ;;
11180         (*)
11181 # we have an "xt" package, but it may omit Xt's dependency on X11
11182 echo "$as_me:11182: checking for usable X dependency" >&5
11183 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11184 if test "${cf_cv_xt_x11_compat+set}" = set; then
11185   echo $ECHO_N "(cached) $ECHO_C" >&6
11186 else
11187
11188 cat >conftest.$ac_ext <<_ACEOF
11189 #line 11189 "configure"
11190 #include "confdefs.h"
11191
11192 #include <X11/Xlib.h>
11193
11194 int
11195 main ()
11196 {
11197
11198         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11199         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11200         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11201         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11202
11203   ;
11204   return 0;
11205 }
11206 _ACEOF
11207 rm -f conftest.$ac_objext conftest$ac_exeext
11208 if { (eval echo "$as_me:11208: \"$ac_link\"") >&5
11209   (eval $ac_link) 2>&5
11210   ac_status=$?
11211   echo "$as_me:11211: \$? = $ac_status" >&5
11212   (exit $ac_status); } &&
11213          { ac_try='test -s conftest$ac_exeext'
11214   { (eval echo "$as_me:11214: \"$ac_try\"") >&5
11215   (eval $ac_try) 2>&5
11216   ac_status=$?
11217   echo "$as_me:11217: \$? = $ac_status" >&5
11218   (exit $ac_status); }; }; then
11219   cf_cv_xt_x11_compat=yes
11220 else
11221   echo "$as_me: failed program was:" >&5
11222 cat conftest.$ac_ext >&5
11223 cf_cv_xt_x11_compat=no
11224 fi
11225 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11226 fi
11227 echo "$as_me:11227: result: $cf_cv_xt_x11_compat" >&5
11228 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11229                 if test "$cf_cv_xt_x11_compat" = no
11230                 then
11231                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11232
11233 echo "${as_me:-configure}:11233: testing work around broken X11 dependency ..." 1>&5
11234
11235                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11236
11237 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11238         test -n "$verbose" && echo "    found package x11" 1>&6
11239
11240 echo "${as_me:-configure}:11240: testing found package x11 ..." 1>&5
11241
11242         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11243         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11244         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11245
11246 echo "${as_me:-configure}:11246: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11247
11248         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11249
11250 echo "${as_me:-configure}:11250: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11251
11252 cf_fix_cppflags=no
11253 cf_new_cflags=
11254 cf_new_cppflags=
11255 cf_new_extra_cppflags=
11256
11257 for cf_add_cflags in $cf_pkgconfig_incs
11258 do
11259 case $cf_fix_cppflags in
11260 (no)
11261         case $cf_add_cflags in
11262         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11263                 case $cf_add_cflags in
11264                 (-D*)
11265                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11266
11267                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11268                                 && test -z "${cf_tst_cflags}" \
11269                                 && cf_fix_cppflags=yes
11270
11271                         if test $cf_fix_cppflags = yes ; then
11272                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11273                                 continue
11274                         elif test "${cf_tst_cflags}" = "\"'" ; then
11275                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11276                                 continue
11277                         fi
11278                         ;;
11279                 esac
11280                 case "$CPPFLAGS" in
11281                 (*$cf_add_cflags)
11282                         ;;
11283                 (*)
11284                         case $cf_add_cflags in
11285                         (-D*)
11286                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11287
11288 CPPFLAGS=`echo "$CPPFLAGS" | \
11289         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11290                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11291
11292                                 ;;
11293                         esac
11294                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11295                         ;;
11296                 esac
11297                 ;;
11298         (*)
11299                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11300                 ;;
11301         esac
11302         ;;
11303 (yes)
11304         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11305
11306         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11307
11308         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11309                 && test -z "${cf_tst_cflags}" \
11310                 && cf_fix_cppflags=no
11311         ;;
11312 esac
11313 done
11314
11315 if test -n "$cf_new_cflags" ; then
11316
11317         CFLAGS="$CFLAGS $cf_new_cflags"
11318 fi
11319
11320 if test -n "$cf_new_cppflags" ; then
11321
11322         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11323 fi
11324
11325 if test -n "$cf_new_extra_cppflags" ; then
11326
11327         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11328 fi
11329
11330 cf_add_libs="$cf_pkgconfig_libs"
11331 # Filter out duplicates - this happens with badly-designed ".pc" files...
11332 for cf_add_1lib in $LIBS
11333 do
11334         for cf_add_2lib in $cf_add_libs
11335         do
11336                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11337                 then
11338                         cf_add_1lib=
11339                         break
11340                 fi
11341         done
11342         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11343 done
11344 LIBS="$cf_add_libs"
11345
11346         :
11347 else
11348         cf_pkgconfig_incs=
11349         cf_pkgconfig_libs=
11350
11351 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11352
11353 echo "${as_me:-configure}:11353: testing ...before $LIBS ..." 1>&5
11354
11355 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
11356 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11357
11358 echo "${as_me:-configure}:11358: testing ...after  $LIBS ..." 1>&5
11359
11360 fi
11361
11362                 fi
11363                 ;;
11364         esac
11365
11366 echo "$as_me:11366: checking for usable X Toolkit package" >&5
11367 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11368 if test "${cf_cv_xt_ice_compat+set}" = set; then
11369   echo $ECHO_N "(cached) $ECHO_C" >&6
11370 else
11371
11372 cat >conftest.$ac_ext <<_ACEOF
11373 #line 11373 "configure"
11374 #include "confdefs.h"
11375
11376 #include <X11/Shell.h>
11377
11378 int
11379 main ()
11380 {
11381 int num = IceConnectionNumber(0)
11382
11383   ;
11384   return 0;
11385 }
11386 _ACEOF
11387 rm -f conftest.$ac_objext conftest$ac_exeext
11388 if { (eval echo "$as_me:11388: \"$ac_link\"") >&5
11389   (eval $ac_link) 2>&5
11390   ac_status=$?
11391   echo "$as_me:11391: \$? = $ac_status" >&5
11392   (exit $ac_status); } &&
11393          { ac_try='test -s conftest$ac_exeext'
11394   { (eval echo "$as_me:11394: \"$ac_try\"") >&5
11395   (eval $ac_try) 2>&5
11396   ac_status=$?
11397   echo "$as_me:11397: \$? = $ac_status" >&5
11398   (exit $ac_status); }; }; then
11399   cf_cv_xt_ice_compat=yes
11400 else
11401   echo "$as_me: failed program was:" >&5
11402 cat conftest.$ac_ext >&5
11403 cf_cv_xt_ice_compat=no
11404 fi
11405 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11406 fi
11407 echo "$as_me:11407: result: $cf_cv_xt_ice_compat" >&5
11408 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11409
11410         if test "$cf_cv_xt_ice_compat" = no
11411         then
11412                 # workaround for broken ".pc" files used for X Toolkit.
11413                 case "x$X_PRE_LIBS" in
11414                 (*-lICE*)
11415                         case "x$LIBS" in
11416                         (*-lICE*)
11417                                 ;;
11418                         (*)
11419                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11420
11421 echo "${as_me:-configure}:11421: testing work around broken ICE dependency ..." 1>&5
11422
11423 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11424         test -n "$verbose" && echo "    found package ice" 1>&6
11425
11426 echo "${as_me:-configure}:11426: testing found package ice ..." 1>&5
11427
11428         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11429         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11430         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11431
11432 echo "${as_me:-configure}:11432: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11433
11434         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11435
11436 echo "${as_me:-configure}:11436: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11437
11438 cf_fix_cppflags=no
11439 cf_new_cflags=
11440 cf_new_cppflags=
11441 cf_new_extra_cppflags=
11442
11443 for cf_add_cflags in $cf_pkgconfig_incs
11444 do
11445 case $cf_fix_cppflags in
11446 (no)
11447         case $cf_add_cflags in
11448         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11449                 case $cf_add_cflags in
11450                 (-D*)
11451                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11452
11453                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11454                                 && test -z "${cf_tst_cflags}" \
11455                                 && cf_fix_cppflags=yes
11456
11457                         if test $cf_fix_cppflags = yes ; then
11458                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11459                                 continue
11460                         elif test "${cf_tst_cflags}" = "\"'" ; then
11461                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11462                                 continue
11463                         fi
11464                         ;;
11465                 esac
11466                 case "$CPPFLAGS" in
11467                 (*$cf_add_cflags)
11468                         ;;
11469                 (*)
11470                         case $cf_add_cflags in
11471                         (-D*)
11472                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11473
11474 CPPFLAGS=`echo "$CPPFLAGS" | \
11475         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11476                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11477
11478                                 ;;
11479                         esac
11480                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11481                         ;;
11482                 esac
11483                 ;;
11484         (*)
11485                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11486                 ;;
11487         esac
11488         ;;
11489 (yes)
11490         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11491
11492         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11493
11494         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11495                 && test -z "${cf_tst_cflags}" \
11496                 && cf_fix_cppflags=no
11497         ;;
11498 esac
11499 done
11500
11501 if test -n "$cf_new_cflags" ; then
11502
11503         CFLAGS="$CFLAGS $cf_new_cflags"
11504 fi
11505
11506 if test -n "$cf_new_cppflags" ; then
11507
11508         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11509 fi
11510
11511 if test -n "$cf_new_extra_cppflags" ; then
11512
11513         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11514 fi
11515
11516 cf_add_libs="$cf_pkgconfig_libs"
11517 # Filter out duplicates - this happens with badly-designed ".pc" files...
11518 for cf_add_1lib in $LIBS
11519 do
11520         for cf_add_2lib in $cf_add_libs
11521         do
11522                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11523                 then
11524                         cf_add_1lib=
11525                         break
11526                 fi
11527         done
11528         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11529 done
11530 LIBS="$cf_add_libs"
11531
11532 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11533         test -n "$verbose" && echo "    found package sm" 1>&6
11534
11535 echo "${as_me:-configure}:11535: testing found package sm ..." 1>&5
11536
11537         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11538         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11539         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11540
11541 echo "${as_me:-configure}:11541: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11542
11543         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11544
11545 echo "${as_me:-configure}:11545: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11546
11547 cf_fix_cppflags=no
11548 cf_new_cflags=
11549 cf_new_cppflags=
11550 cf_new_extra_cppflags=
11551
11552 for cf_add_cflags in $cf_pkgconfig_incs
11553 do
11554 case $cf_fix_cppflags in
11555 (no)
11556         case $cf_add_cflags in
11557         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11558                 case $cf_add_cflags in
11559                 (-D*)
11560                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11561
11562                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11563                                 && test -z "${cf_tst_cflags}" \
11564                                 && cf_fix_cppflags=yes
11565
11566                         if test $cf_fix_cppflags = yes ; then
11567                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11568                                 continue
11569                         elif test "${cf_tst_cflags}" = "\"'" ; then
11570                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11571                                 continue
11572                         fi
11573                         ;;
11574                 esac
11575                 case "$CPPFLAGS" in
11576                 (*$cf_add_cflags)
11577                         ;;
11578                 (*)
11579                         case $cf_add_cflags in
11580                         (-D*)
11581                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11582
11583 CPPFLAGS=`echo "$CPPFLAGS" | \
11584         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11585                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11586
11587                                 ;;
11588                         esac
11589                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11590                         ;;
11591                 esac
11592                 ;;
11593         (*)
11594                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11595                 ;;
11596         esac
11597         ;;
11598 (yes)
11599         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11600
11601         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11602
11603         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11604                 && test -z "${cf_tst_cflags}" \
11605                 && cf_fix_cppflags=no
11606         ;;
11607 esac
11608 done
11609
11610 if test -n "$cf_new_cflags" ; then
11611
11612         CFLAGS="$CFLAGS $cf_new_cflags"
11613 fi
11614
11615 if test -n "$cf_new_cppflags" ; then
11616
11617         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11618 fi
11619
11620 if test -n "$cf_new_extra_cppflags" ; then
11621
11622         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11623 fi
11624
11625 cf_add_libs="$cf_pkgconfig_libs"
11626 # Filter out duplicates - this happens with badly-designed ".pc" files...
11627 for cf_add_1lib in $LIBS
11628 do
11629         for cf_add_2lib in $cf_add_libs
11630         do
11631                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11632                 then
11633                         cf_add_1lib=
11634                         break
11635                 fi
11636         done
11637         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11638 done
11639 LIBS="$cf_add_libs"
11640
11641         :
11642 else
11643         cf_pkgconfig_incs=
11644         cf_pkgconfig_libs=
11645         :
11646 fi
11647
11648 else
11649         cf_pkgconfig_incs=
11650         cf_pkgconfig_libs=
11651
11652 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11653
11654 echo "${as_me:-configure}:11654: testing ...before $LIBS ..." 1>&5
11655
11656 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
11657 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11658
11659 echo "${as_me:-configure}:11659: testing ...after  $LIBS ..." 1>&5
11660
11661 fi
11662
11663                                 ;;
11664                         esac
11665                         ;;
11666                 esac
11667         fi
11668
11669         cf_have_X_LIBS=yes
11670
11671 else
11672         cf_pkgconfig_incs=
11673         cf_pkgconfig_libs=
11674
11675         LDFLAGS="$X_LIBS $LDFLAGS"
11676
11677 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11678
11679 echo "${as_me:-configure}:11679: testing checking additions to CFLAGS ..." 1>&5
11680
11681 cf_check_cflags="$CFLAGS"
11682 cf_check_cppflags="$CPPFLAGS"
11683
11684 cf_fix_cppflags=no
11685 cf_new_cflags=
11686 cf_new_cppflags=
11687 cf_new_extra_cppflags=
11688
11689 for cf_add_cflags in $X_CFLAGS
11690 do
11691 case $cf_fix_cppflags in
11692 (no)
11693         case $cf_add_cflags in
11694         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11695                 case $cf_add_cflags in
11696                 (-D*)
11697                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11698
11699                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11700                                 && test -z "${cf_tst_cflags}" \
11701                                 && cf_fix_cppflags=yes
11702
11703                         if test $cf_fix_cppflags = yes ; then
11704                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11705                                 continue
11706                         elif test "${cf_tst_cflags}" = "\"'" ; then
11707                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11708                                 continue
11709                         fi
11710                         ;;
11711                 esac
11712                 case "$CPPFLAGS" in
11713                 (*$cf_add_cflags)
11714                         ;;
11715                 (*)
11716                         case $cf_add_cflags in
11717                         (-D*)
11718                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11719
11720 CPPFLAGS=`echo "$CPPFLAGS" | \
11721         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11722                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11723
11724                                 ;;
11725                         esac
11726                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11727                         ;;
11728                 esac
11729                 ;;
11730         (*)
11731                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11732                 ;;
11733         esac
11734         ;;
11735 (yes)
11736         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11737
11738         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11739
11740         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11741                 && test -z "${cf_tst_cflags}" \
11742                 && cf_fix_cppflags=no
11743         ;;
11744 esac
11745 done
11746
11747 if test -n "$cf_new_cflags" ; then
11748         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11749
11750 echo "${as_me:-configure}:11750: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11751
11752         CFLAGS="$CFLAGS $cf_new_cflags"
11753 fi
11754
11755 if test -n "$cf_new_cppflags" ; then
11756         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11757
11758 echo "${as_me:-configure}:11758: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11759
11760         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11761 fi
11762
11763 if test -n "$cf_new_extra_cppflags" ; then
11764         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11765
11766 echo "${as_me:-configure}:11766: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11767
11768         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11769 fi
11770
11771 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
11772 cat >conftest.$ac_ext <<_ACEOF
11773 #line 11773 "configure"
11774 #include "confdefs.h"
11775 #include <stdio.h>
11776 int
11777 main ()
11778 {
11779 printf("Hello world");
11780   ;
11781   return 0;
11782 }
11783 _ACEOF
11784 rm -f conftest.$ac_objext conftest$ac_exeext
11785 if { (eval echo "$as_me:11785: \"$ac_link\"") >&5
11786   (eval $ac_link) 2>&5
11787   ac_status=$?
11788   echo "$as_me:11788: \$? = $ac_status" >&5
11789   (exit $ac_status); } &&
11790          { ac_try='test -s conftest$ac_exeext'
11791   { (eval echo "$as_me:11791: \"$ac_try\"") >&5
11792   (eval $ac_try) 2>&5
11793   ac_status=$?
11794   echo "$as_me:11794: \$? = $ac_status" >&5
11795   (exit $ac_status); }; }; then
11796   :
11797 else
11798   echo "$as_me: failed program was:" >&5
11799 cat conftest.$ac_ext >&5
11800 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
11801
11802 echo "${as_me:-configure}:11802: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
11803
11804          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
11805                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
11806
11807 echo "${as_me:-configure}:11807: testing but keeping change to \$CPPFLAGS ..." 1>&5
11808
11809          fi
11810          CFLAGS="$cf_check_flags"
11811 fi
11812 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11813 fi
11814
11815         echo "$as_me:11815: checking for XOpenDisplay" >&5
11816 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
11817 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
11818   echo $ECHO_N "(cached) $ECHO_C" >&6
11819 else
11820   cat >conftest.$ac_ext <<_ACEOF
11821 #line 11821 "configure"
11822 #include "confdefs.h"
11823 /* System header to define __stub macros and hopefully few prototypes,
11824     which can conflict with char XOpenDisplay (); below.  */
11825 #include <assert.h>
11826 /* Override any gcc2 internal prototype to avoid an error.  */
11827 #ifdef __cplusplus
11828 extern "C"
11829 #endif
11830 /* We use char because int might match the return type of a gcc2
11831    builtin and then its argument prototype would still apply.  */
11832 char XOpenDisplay ();
11833 char (*f) ();
11834
11835 int
11836 main ()
11837 {
11838 /* The GNU C library defines this for functions which it implements
11839     to always fail with ENOSYS.  Some functions are actually named
11840     something starting with __ and the normal name is an alias.  */
11841 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
11842 choke me
11843 #else
11844 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11845 #endif
11846
11847   ;
11848   return 0;
11849 }
11850 _ACEOF
11851 rm -f conftest.$ac_objext conftest$ac_exeext
11852 if { (eval echo "$as_me:11852: \"$ac_link\"") >&5
11853   (eval $ac_link) 2>&5
11854   ac_status=$?
11855   echo "$as_me:11855: \$? = $ac_status" >&5
11856   (exit $ac_status); } &&
11857          { ac_try='test -s conftest$ac_exeext'
11858   { (eval echo "$as_me:11858: \"$ac_try\"") >&5
11859   (eval $ac_try) 2>&5
11860   ac_status=$?
11861   echo "$as_me:11861: \$? = $ac_status" >&5
11862   (exit $ac_status); }; }; then
11863   ac_cv_func_XOpenDisplay=yes
11864 else
11865   echo "$as_me: failed program was:" >&5
11866 cat conftest.$ac_ext >&5
11867 ac_cv_func_XOpenDisplay=no
11868 fi
11869 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11870 fi
11871 echo "$as_me:11871: result: $ac_cv_func_XOpenDisplay" >&5
11872 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
11873 if test $ac_cv_func_XOpenDisplay = yes; then
11874   :
11875 else
11876
11877         echo "$as_me:11877: checking for XOpenDisplay in -lX11" >&5
11878 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
11879 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
11880   echo $ECHO_N "(cached) $ECHO_C" >&6
11881 else
11882   ac_check_lib_save_LIBS=$LIBS
11883 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11884 cat >conftest.$ac_ext <<_ACEOF
11885 #line 11885 "configure"
11886 #include "confdefs.h"
11887
11888 /* Override any gcc2 internal prototype to avoid an error.  */
11889 #ifdef __cplusplus
11890 extern "C"
11891 #endif
11892 /* We use char because int might match the return type of a gcc2
11893    builtin and then its argument prototype would still apply.  */
11894 char XOpenDisplay ();
11895 int
11896 main ()
11897 {
11898 XOpenDisplay ();
11899   ;
11900   return 0;
11901 }
11902 _ACEOF
11903 rm -f conftest.$ac_objext conftest$ac_exeext
11904 if { (eval echo "$as_me:11904: \"$ac_link\"") >&5
11905   (eval $ac_link) 2>&5
11906   ac_status=$?
11907   echo "$as_me:11907: \$? = $ac_status" >&5
11908   (exit $ac_status); } &&
11909          { ac_try='test -s conftest$ac_exeext'
11910   { (eval echo "$as_me:11910: \"$ac_try\"") >&5
11911   (eval $ac_try) 2>&5
11912   ac_status=$?
11913   echo "$as_me:11913: \$? = $ac_status" >&5
11914   (exit $ac_status); }; }; then
11915   ac_cv_lib_X11_XOpenDisplay=yes
11916 else
11917   echo "$as_me: failed program was:" >&5
11918 cat conftest.$ac_ext >&5
11919 ac_cv_lib_X11_XOpenDisplay=no
11920 fi
11921 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11922 LIBS=$ac_check_lib_save_LIBS
11923 fi
11924 echo "$as_me:11924: result: $ac_cv_lib_X11_XOpenDisplay" >&5
11925 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
11926 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
11927
11928 cf_add_libs="-lX11"
11929 # Filter out duplicates - this happens with badly-designed ".pc" files...
11930 for cf_add_1lib in $LIBS
11931 do
11932         for cf_add_2lib in $cf_add_libs
11933         do
11934                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11935                 then
11936                         cf_add_1lib=
11937                         break
11938                 fi
11939         done
11940         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11941 done
11942 LIBS="$cf_add_libs"
11943
11944 fi
11945
11946 fi
11947
11948         echo "$as_me:11948: checking for XtAppInitialize" >&5
11949 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
11950 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
11951   echo $ECHO_N "(cached) $ECHO_C" >&6
11952 else
11953   cat >conftest.$ac_ext <<_ACEOF
11954 #line 11954 "configure"
11955 #include "confdefs.h"
11956 /* System header to define __stub macros and hopefully few prototypes,
11957     which can conflict with char XtAppInitialize (); below.  */
11958 #include <assert.h>
11959 /* Override any gcc2 internal prototype to avoid an error.  */
11960 #ifdef __cplusplus
11961 extern "C"
11962 #endif
11963 /* We use char because int might match the return type of a gcc2
11964    builtin and then its argument prototype would still apply.  */
11965 char XtAppInitialize ();
11966 char (*f) ();
11967
11968 int
11969 main ()
11970 {
11971 /* The GNU C library defines this for functions which it implements
11972     to always fail with ENOSYS.  Some functions are actually named
11973     something starting with __ and the normal name is an alias.  */
11974 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
11975 choke me
11976 #else
11977 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11978 #endif
11979
11980   ;
11981   return 0;
11982 }
11983 _ACEOF
11984 rm -f conftest.$ac_objext conftest$ac_exeext
11985 if { (eval echo "$as_me:11985: \"$ac_link\"") >&5
11986   (eval $ac_link) 2>&5
11987   ac_status=$?
11988   echo "$as_me:11988: \$? = $ac_status" >&5
11989   (exit $ac_status); } &&
11990          { ac_try='test -s conftest$ac_exeext'
11991   { (eval echo "$as_me:11991: \"$ac_try\"") >&5
11992   (eval $ac_try) 2>&5
11993   ac_status=$?
11994   echo "$as_me:11994: \$? = $ac_status" >&5
11995   (exit $ac_status); }; }; then
11996   ac_cv_func_XtAppInitialize=yes
11997 else
11998   echo "$as_me: failed program was:" >&5
11999 cat conftest.$ac_ext >&5
12000 ac_cv_func_XtAppInitialize=no
12001 fi
12002 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12003 fi
12004 echo "$as_me:12004: result: $ac_cv_func_XtAppInitialize" >&5
12005 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12006 if test $ac_cv_func_XtAppInitialize = yes; then
12007   :
12008 else
12009
12010         echo "$as_me:12010: checking for XtAppInitialize in -lXt" >&5
12011 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12012 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12013   echo $ECHO_N "(cached) $ECHO_C" >&6
12014 else
12015   ac_check_lib_save_LIBS=$LIBS
12016 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12017 cat >conftest.$ac_ext <<_ACEOF
12018 #line 12018 "configure"
12019 #include "confdefs.h"
12020
12021 /* Override any gcc2 internal prototype to avoid an error.  */
12022 #ifdef __cplusplus
12023 extern "C"
12024 #endif
12025 /* We use char because int might match the return type of a gcc2
12026    builtin and then its argument prototype would still apply.  */
12027 char XtAppInitialize ();
12028 int
12029 main ()
12030 {
12031 XtAppInitialize ();
12032   ;
12033   return 0;
12034 }
12035 _ACEOF
12036 rm -f conftest.$ac_objext conftest$ac_exeext
12037 if { (eval echo "$as_me:12037: \"$ac_link\"") >&5
12038   (eval $ac_link) 2>&5
12039   ac_status=$?
12040   echo "$as_me:12040: \$? = $ac_status" >&5
12041   (exit $ac_status); } &&
12042          { ac_try='test -s conftest$ac_exeext'
12043   { (eval echo "$as_me:12043: \"$ac_try\"") >&5
12044   (eval $ac_try) 2>&5
12045   ac_status=$?
12046   echo "$as_me:12046: \$? = $ac_status" >&5
12047   (exit $ac_status); }; }; then
12048   ac_cv_lib_Xt_XtAppInitialize=yes
12049 else
12050   echo "$as_me: failed program was:" >&5
12051 cat conftest.$ac_ext >&5
12052 ac_cv_lib_Xt_XtAppInitialize=no
12053 fi
12054 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12055 LIBS=$ac_check_lib_save_LIBS
12056 fi
12057 echo "$as_me:12057: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12058 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12059 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12060
12061 cat >>confdefs.h <<\EOF
12062 #define HAVE_LIBXT 1
12063 EOF
12064
12065                  cf_have_X_LIBS=Xt
12066                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12067 fi
12068
12069 fi
12070
12071 fi
12072
12073 if test $cf_have_X_LIBS = no ; then
12074         { echo "$as_me:12074: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12075 test program.  You will have to check and add the proper libraries by hand
12076 to makefile." >&5
12077 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12078 test program.  You will have to check and add the proper libraries by hand
12079 to makefile." >&2;}
12080 fi
12081
12082 cf_x_athena_root=$cf_x_athena
12083 cf_x_athena_inc=""
12084
12085 for cf_path in default \
12086         /usr/contrib/X11R6 \
12087         /usr/contrib/X11R5 \
12088         /usr/lib/X11R5 \
12089         /usr/local
12090 do
12091         if test -z "$cf_x_athena_inc" ; then
12092                 cf_save="$CPPFLAGS"
12093                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12094                 if test $cf_path != default ; then
12095                         CPPFLAGS="$cf_save -I$cf_path/include"
12096                         echo "$as_me:12096: checking for $cf_test in $cf_path" >&5
12097 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12098                 else
12099                         echo "$as_me:12099: checking for $cf_test" >&5
12100 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12101                 fi
12102                 cat >conftest.$ac_ext <<_ACEOF
12103 #line 12103 "configure"
12104 #include "confdefs.h"
12105
12106 #include <X11/Intrinsic.h>
12107 #include <$cf_test>
12108 int
12109 main ()
12110 {
12111
12112   ;
12113   return 0;
12114 }
12115 _ACEOF
12116 rm -f conftest.$ac_objext
12117 if { (eval echo "$as_me:12117: \"$ac_compile\"") >&5
12118   (eval $ac_compile) 2>&5
12119   ac_status=$?
12120   echo "$as_me:12120: \$? = $ac_status" >&5
12121   (exit $ac_status); } &&
12122          { ac_try='test -s conftest.$ac_objext'
12123   { (eval echo "$as_me:12123: \"$ac_try\"") >&5
12124   (eval $ac_try) 2>&5
12125   ac_status=$?
12126   echo "$as_me:12126: \$? = $ac_status" >&5
12127   (exit $ac_status); }; }; then
12128   cf_result=yes
12129 else
12130   echo "$as_me: failed program was:" >&5
12131 cat conftest.$ac_ext >&5
12132 cf_result=no
12133 fi
12134 rm -f conftest.$ac_objext conftest.$ac_ext
12135                 echo "$as_me:12135: result: $cf_result" >&5
12136 echo "${ECHO_T}$cf_result" >&6
12137                 if test "$cf_result" = yes ; then
12138                         cf_x_athena_inc=$cf_path
12139                         break
12140                 else
12141                         CPPFLAGS="$cf_save"
12142                 fi
12143         fi
12144 done
12145
12146 if test -z "$cf_x_athena_inc" ; then
12147         { echo "$as_me:12147: WARNING: Unable to successfully find Athena header files with test program" >&5
12148 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12149 elif test "$cf_x_athena_inc" != default ; then
12150         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12151 fi
12152
12153 cf_x_athena_root=$cf_x_athena
12154 cf_x_athena_lib=""
12155
12156 for cf_path in default \
12157         /usr/contrib/X11R6 \
12158         /usr/contrib/X11R5 \
12159         /usr/lib/X11R5 \
12160         /usr/local
12161 do
12162         for cf_lib in \
12163                 ${cf_x_athena_root} \
12164                 ${cf_x_athena_root}7 \
12165                 ${cf_x_athena_root}6
12166         do
12167         for cf_libs in \
12168                 "-l$cf_lib -lXmu" \
12169                 "-l$cf_lib -lXpm -lXmu" \
12170                 "-l${cf_lib}_s -lXmu_s"
12171         do
12172                 if test -z "$cf_x_athena_lib" ; then
12173                         cf_save="$LIBS"
12174                         cf_test=XawSimpleMenuAddGlobalActions
12175                         if test $cf_path != default ; then
12176
12177 cf_add_libs="-L$cf_path/lib $cf_libs"
12178 # Filter out duplicates - this happens with badly-designed ".pc" files...
12179 for cf_add_1lib in $LIBS
12180 do
12181         for cf_add_2lib in $cf_add_libs
12182         do
12183                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12184                 then
12185                         cf_add_1lib=
12186                         break
12187                 fi
12188         done
12189         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12190 done
12191 LIBS="$cf_add_libs"
12192
12193                                 echo "$as_me:12193: checking for $cf_libs in $cf_path" >&5
12194 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12195                         else
12196
12197 cf_add_libs="$cf_libs"
12198 # Filter out duplicates - this happens with badly-designed ".pc" files...
12199 for cf_add_1lib in $LIBS
12200 do
12201         for cf_add_2lib in $cf_add_libs
12202         do
12203                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12204                 then
12205                         cf_add_1lib=
12206                         break
12207                 fi
12208         done
12209         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12210 done
12211 LIBS="$cf_add_libs"
12212
12213                                 echo "$as_me:12213: checking for $cf_test in $cf_libs" >&5
12214 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12215                         fi
12216                         cat >conftest.$ac_ext <<_ACEOF
12217 #line 12217 "configure"
12218 #include "confdefs.h"
12219
12220 #include <X11/Intrinsic.h>
12221 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12222
12223 int
12224 main ()
12225 {
12226
12227 $cf_test((XtAppContext) 0)
12228   ;
12229   return 0;
12230 }
12231 _ACEOF
12232 rm -f conftest.$ac_objext conftest$ac_exeext
12233 if { (eval echo "$as_me:12233: \"$ac_link\"") >&5
12234   (eval $ac_link) 2>&5
12235   ac_status=$?
12236   echo "$as_me:12236: \$? = $ac_status" >&5
12237   (exit $ac_status); } &&
12238          { ac_try='test -s conftest$ac_exeext'
12239   { (eval echo "$as_me:12239: \"$ac_try\"") >&5
12240   (eval $ac_try) 2>&5
12241   ac_status=$?
12242   echo "$as_me:12242: \$? = $ac_status" >&5
12243   (exit $ac_status); }; }; then
12244   cf_result=yes
12245 else
12246   echo "$as_me: failed program was:" >&5
12247 cat conftest.$ac_ext >&5
12248 cf_result=no
12249 fi
12250 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12251                         echo "$as_me:12251: result: $cf_result" >&5
12252 echo "${ECHO_T}$cf_result" >&6
12253                         if test "$cf_result" = yes ; then
12254                                 cf_x_athena_lib="$cf_libs"
12255                                 break
12256                         fi
12257                         LIBS="$cf_save"
12258                 fi
12259         done # cf_libs
12260                 test -n "$cf_x_athena_lib" && break
12261         done # cf_lib
12262 done
12263
12264 if test -z "$cf_x_athena_lib" ; then
12265         { { echo "$as_me:12265: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12266 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12267    { (exit 1); exit 1; }; }
12268 fi
12269
12270 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12271
12272 cat >>confdefs.h <<EOF
12273 #define $cf_x_athena_LIBS 1
12274 EOF
12275
12276 fi
12277
12278 if test -n "$ac_tool_prefix"; then
12279   for ac_prog in xcurses-config
12280   do
12281     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12282 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12283 echo "$as_me:12283: checking for $ac_word" >&5
12284 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12285 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12286   echo $ECHO_N "(cached) $ECHO_C" >&6
12287 else
12288   if test -n "$XCURSES_CONFIG"; then
12289   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12290 else
12291   ac_save_IFS=$IFS; IFS=$ac_path_separator
12292 ac_dummy="$PATH"
12293 for ac_dir in $ac_dummy; do
12294   IFS=$ac_save_IFS
12295   test -z "$ac_dir" && ac_dir=.
12296   $as_executable_p "$ac_dir/$ac_word" || continue
12297 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12298 echo "$as_me:12298: found $ac_dir/$ac_word" >&5
12299 break
12300 done
12301
12302 fi
12303 fi
12304 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12305 if test -n "$XCURSES_CONFIG"; then
12306   echo "$as_me:12306: result: $XCURSES_CONFIG" >&5
12307 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12308 else
12309   echo "$as_me:12309: result: no" >&5
12310 echo "${ECHO_T}no" >&6
12311 fi
12312
12313     test -n "$XCURSES_CONFIG" && break
12314   done
12315 fi
12316 if test -z "$XCURSES_CONFIG"; then
12317   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12318   for ac_prog in xcurses-config
12319 do
12320   # Extract the first word of "$ac_prog", so it can be a program name with args.
12321 set dummy $ac_prog; ac_word=$2
12322 echo "$as_me:12322: checking for $ac_word" >&5
12323 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12324 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12325   echo $ECHO_N "(cached) $ECHO_C" >&6
12326 else
12327   if test -n "$ac_ct_XCURSES_CONFIG"; then
12328   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12329 else
12330   ac_save_IFS=$IFS; IFS=$ac_path_separator
12331 ac_dummy="$PATH"
12332 for ac_dir in $ac_dummy; do
12333   IFS=$ac_save_IFS
12334   test -z "$ac_dir" && ac_dir=.
12335   $as_executable_p "$ac_dir/$ac_word" || continue
12336 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12337 echo "$as_me:12337: found $ac_dir/$ac_word" >&5
12338 break
12339 done
12340
12341 fi
12342 fi
12343 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12344 if test -n "$ac_ct_XCURSES_CONFIG"; then
12345   echo "$as_me:12345: result: $ac_ct_XCURSES_CONFIG" >&5
12346 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12347 else
12348   echo "$as_me:12348: result: no" >&5
12349 echo "${ECHO_T}no" >&6
12350 fi
12351
12352   test -n "$ac_ct_XCURSES_CONFIG" && break
12353 done
12354 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12355
12356   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12357 fi
12358
12359 if test "$XCURSES_CONFIG" != none ; then
12360
12361 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12362
12363 cf_add_libs="`$XCURSES_CONFIG --libs`"
12364 # Filter out duplicates - this happens with badly-designed ".pc" files...
12365 for cf_add_1lib in $LIBS
12366 do
12367         for cf_add_2lib in $cf_add_libs
12368         do
12369                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12370                 then
12371                         cf_add_1lib=
12372                         break
12373                 fi
12374         done
12375         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12376 done
12377 LIBS="$cf_add_libs"
12378
12379 cf_cv_lib_XCurses=yes
12380
12381 else
12382
12383 LDFLAGS="$LDFLAGS $X_LIBS"
12384
12385 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12386
12387 echo "${as_me:-configure}:12387: testing checking additions to CFLAGS ..." 1>&5
12388
12389 cf_check_cflags="$CFLAGS"
12390 cf_check_cppflags="$CPPFLAGS"
12391
12392 cf_fix_cppflags=no
12393 cf_new_cflags=
12394 cf_new_cppflags=
12395 cf_new_extra_cppflags=
12396
12397 for cf_add_cflags in $X_CFLAGS
12398 do
12399 case $cf_fix_cppflags in
12400 (no)
12401         case $cf_add_cflags in
12402         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12403                 case $cf_add_cflags in
12404                 (-D*)
12405                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12406
12407                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12408                                 && test -z "${cf_tst_cflags}" \
12409                                 && cf_fix_cppflags=yes
12410
12411                         if test $cf_fix_cppflags = yes ; then
12412                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12413                                 continue
12414                         elif test "${cf_tst_cflags}" = "\"'" ; then
12415                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12416                                 continue
12417                         fi
12418                         ;;
12419                 esac
12420                 case "$CPPFLAGS" in
12421                 (*$cf_add_cflags)
12422                         ;;
12423                 (*)
12424                         case $cf_add_cflags in
12425                         (-D*)
12426                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12427
12428 CPPFLAGS=`echo "$CPPFLAGS" | \
12429         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12430                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12431
12432                                 ;;
12433                         esac
12434                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12435                         ;;
12436                 esac
12437                 ;;
12438         (*)
12439                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12440                 ;;
12441         esac
12442         ;;
12443 (yes)
12444         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12445
12446         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12447
12448         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12449                 && test -z "${cf_tst_cflags}" \
12450                 && cf_fix_cppflags=no
12451         ;;
12452 esac
12453 done
12454
12455 if test -n "$cf_new_cflags" ; then
12456         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12457
12458 echo "${as_me:-configure}:12458: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12459
12460         CFLAGS="$CFLAGS $cf_new_cflags"
12461 fi
12462
12463 if test -n "$cf_new_cppflags" ; then
12464         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12465
12466 echo "${as_me:-configure}:12466: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12467
12468         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12469 fi
12470
12471 if test -n "$cf_new_extra_cppflags" ; then
12472         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12473
12474 echo "${as_me:-configure}:12474: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12475
12476         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12477 fi
12478
12479 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12480 cat >conftest.$ac_ext <<_ACEOF
12481 #line 12481 "configure"
12482 #include "confdefs.h"
12483 #include <stdio.h>
12484 int
12485 main ()
12486 {
12487 printf("Hello world");
12488   ;
12489   return 0;
12490 }
12491 _ACEOF
12492 rm -f conftest.$ac_objext conftest$ac_exeext
12493 if { (eval echo "$as_me:12493: \"$ac_link\"") >&5
12494   (eval $ac_link) 2>&5
12495   ac_status=$?
12496   echo "$as_me:12496: \$? = $ac_status" >&5
12497   (exit $ac_status); } &&
12498          { ac_try='test -s conftest$ac_exeext'
12499   { (eval echo "$as_me:12499: \"$ac_try\"") >&5
12500   (eval $ac_try) 2>&5
12501   ac_status=$?
12502   echo "$as_me:12502: \$? = $ac_status" >&5
12503   (exit $ac_status); }; }; then
12504   :
12505 else
12506   echo "$as_me: failed program was:" >&5
12507 cat conftest.$ac_ext >&5
12508 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12509
12510 echo "${as_me:-configure}:12510: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12511
12512          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12513                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12514
12515 echo "${as_me:-configure}:12515: testing but keeping change to \$CPPFLAGS ..." 1>&5
12516
12517          fi
12518          CFLAGS="$cf_check_flags"
12519 fi
12520 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12521 fi
12522
12523 echo "$as_me:12523: checking for XOpenDisplay in -lX11" >&5
12524 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12525 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12526   echo $ECHO_N "(cached) $ECHO_C" >&6
12527 else
12528   ac_check_lib_save_LIBS=$LIBS
12529 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12530 cat >conftest.$ac_ext <<_ACEOF
12531 #line 12531 "configure"
12532 #include "confdefs.h"
12533
12534 /* Override any gcc2 internal prototype to avoid an error.  */
12535 #ifdef __cplusplus
12536 extern "C"
12537 #endif
12538 /* We use char because int might match the return type of a gcc2
12539    builtin and then its argument prototype would still apply.  */
12540 char XOpenDisplay ();
12541 int
12542 main ()
12543 {
12544 XOpenDisplay ();
12545   ;
12546   return 0;
12547 }
12548 _ACEOF
12549 rm -f conftest.$ac_objext conftest$ac_exeext
12550 if { (eval echo "$as_me:12550: \"$ac_link\"") >&5
12551   (eval $ac_link) 2>&5
12552   ac_status=$?
12553   echo "$as_me:12553: \$? = $ac_status" >&5
12554   (exit $ac_status); } &&
12555          { ac_try='test -s conftest$ac_exeext'
12556   { (eval echo "$as_me:12556: \"$ac_try\"") >&5
12557   (eval $ac_try) 2>&5
12558   ac_status=$?
12559   echo "$as_me:12559: \$? = $ac_status" >&5
12560   (exit $ac_status); }; }; then
12561   ac_cv_lib_X11_XOpenDisplay=yes
12562 else
12563   echo "$as_me: failed program was:" >&5
12564 cat conftest.$ac_ext >&5
12565 ac_cv_lib_X11_XOpenDisplay=no
12566 fi
12567 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12568 LIBS=$ac_check_lib_save_LIBS
12569 fi
12570 echo "$as_me:12570: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12571 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12572 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12573
12574 cf_add_libs="-lX11"
12575 # Filter out duplicates - this happens with badly-designed ".pc" files...
12576 for cf_add_1lib in $LIBS
12577 do
12578         for cf_add_2lib in $cf_add_libs
12579         do
12580                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12581                 then
12582                         cf_add_1lib=
12583                         break
12584                 fi
12585         done
12586         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12587 done
12588 LIBS="$cf_add_libs"
12589
12590 fi
12591
12592 echo "$as_me:12592: checking for XCurses library" >&5
12593 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
12594 if test "${cf_cv_lib_XCurses+set}" = set; then
12595   echo $ECHO_N "(cached) $ECHO_C" >&6
12596 else
12597
12598 cf_add_libs="-lXCurses"
12599 # Filter out duplicates - this happens with badly-designed ".pc" files...
12600 for cf_add_1lib in $LIBS
12601 do
12602         for cf_add_2lib in $cf_add_libs
12603         do
12604                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12605                 then
12606                         cf_add_1lib=
12607                         break
12608                 fi
12609         done
12610         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12611 done
12612 LIBS="$cf_add_libs"
12613
12614 cat >conftest.$ac_ext <<_ACEOF
12615 #line 12615 "configure"
12616 #include "confdefs.h"
12617
12618 #include <xcurses.h>
12619 char *XCursesProgramName = "test";
12620
12621 int
12622 main ()
12623 {
12624 XCursesExit();
12625   ;
12626   return 0;
12627 }
12628 _ACEOF
12629 rm -f conftest.$ac_objext conftest$ac_exeext
12630 if { (eval echo "$as_me:12630: \"$ac_link\"") >&5
12631   (eval $ac_link) 2>&5
12632   ac_status=$?
12633   echo "$as_me:12633: \$? = $ac_status" >&5
12634   (exit $ac_status); } &&
12635          { ac_try='test -s conftest$ac_exeext'
12636   { (eval echo "$as_me:12636: \"$ac_try\"") >&5
12637   (eval $ac_try) 2>&5
12638   ac_status=$?
12639   echo "$as_me:12639: \$? = $ac_status" >&5
12640   (exit $ac_status); }; }; then
12641   cf_cv_lib_XCurses=yes
12642 else
12643   echo "$as_me: failed program was:" >&5
12644 cat conftest.$ac_ext >&5
12645 cf_cv_lib_XCurses=no
12646 fi
12647 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12648
12649 fi
12650 echo "$as_me:12650: result: $cf_cv_lib_XCurses" >&5
12651 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
12652
12653 fi
12654
12655 if test $cf_cv_lib_XCurses = yes ; then
12656
12657 cat >>confdefs.h <<\EOF
12658 #define UNIX 1
12659 EOF
12660
12661 cat >>confdefs.h <<\EOF
12662 #define XCURSES 1
12663 EOF
12664
12665         echo "$as_me:12665: checking for xcurses.h" >&5
12666 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
12667 if test "${ac_cv_header_xcurses_h+set}" = set; then
12668   echo $ECHO_N "(cached) $ECHO_C" >&6
12669 else
12670   cat >conftest.$ac_ext <<_ACEOF
12671 #line 12671 "configure"
12672 #include "confdefs.h"
12673 #include <xcurses.h>
12674 _ACEOF
12675 if { (eval echo "$as_me:12675: \"$ac_cpp conftest.$ac_ext\"") >&5
12676   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12677   ac_status=$?
12678   egrep -v '^ *\+' conftest.er1 >conftest.err
12679   rm -f conftest.er1
12680   cat conftest.err >&5
12681   echo "$as_me:12681: \$? = $ac_status" >&5
12682   (exit $ac_status); } >/dev/null; then
12683   if test -s conftest.err; then
12684     ac_cpp_err=$ac_c_preproc_warn_flag
12685   else
12686     ac_cpp_err=
12687   fi
12688 else
12689   ac_cpp_err=yes
12690 fi
12691 if test -z "$ac_cpp_err"; then
12692   ac_cv_header_xcurses_h=yes
12693 else
12694   echo "$as_me: failed program was:" >&5
12695   cat conftest.$ac_ext >&5
12696   ac_cv_header_xcurses_h=no
12697 fi
12698 rm -f conftest.err conftest.$ac_ext
12699 fi
12700 echo "$as_me:12700: result: $ac_cv_header_xcurses_h" >&5
12701 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
12702 if test $ac_cv_header_xcurses_h = yes; then
12703
12704 cat >>confdefs.h <<\EOF
12705 #define HAVE_XCURSES 1
12706 EOF
12707
12708 fi
12709
12710 else
12711         { { echo "$as_me:12711: error: Cannot link with XCurses" >&5
12712 echo "$as_me: error: Cannot link with XCurses" >&2;}
12713    { (exit 1); exit 1; }; }
12714 fi
12715
12716         ;;
12717 esac
12718
12719 case $cf_cv_screen in
12720 (curses|curses_*)
12721
12722 echo "$as_me:12722: checking for NetBSD form.h" >&5
12723 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
12724 if test "${cf_cv_netbsd_form_h+set}" = set; then
12725   echo $ECHO_N "(cached) $ECHO_C" >&6
12726 else
12727
12728 cat >conftest.$ac_ext <<_ACEOF
12729 #line 12729 "configure"
12730 #include "confdefs.h"
12731
12732 #include <${cf_cv_ncurses_header:-curses.h}>
12733 #include <form.h>
12734
12735 int
12736 main ()
12737 {
12738
12739         FORM *form;
12740         int y = current_field(form)->cursor_ypos;
12741         int x = current_field(form)->cursor_xpos;
12742
12743   ;
12744   return 0;
12745 }
12746 _ACEOF
12747 rm -f conftest.$ac_objext
12748 if { (eval echo "$as_me:12748: \"$ac_compile\"") >&5
12749   (eval $ac_compile) 2>&5
12750   ac_status=$?
12751   echo "$as_me:12751: \$? = $ac_status" >&5
12752   (exit $ac_status); } &&
12753          { ac_try='test -s conftest.$ac_objext'
12754   { (eval echo "$as_me:12754: \"$ac_try\"") >&5
12755   (eval $ac_try) 2>&5
12756   ac_status=$?
12757   echo "$as_me:12757: \$? = $ac_status" >&5
12758   (exit $ac_status); }; }; then
12759   cf_cv_netbsd_form_h=yes
12760
12761 else
12762   echo "$as_me: failed program was:" >&5
12763 cat conftest.$ac_ext >&5
12764 cf_cv_netbsd_form_h=no
12765 fi
12766 rm -f conftest.$ac_objext conftest.$ac_ext
12767
12768 fi
12769 echo "$as_me:12769: result: $cf_cv_netbsd_form_h" >&5
12770 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
12771
12772 test "$cf_cv_netbsd_form_h" = yes &&
12773 cat >>confdefs.h <<\EOF
12774 #define HAVE_NETBSD_FORM_H 1
12775 EOF
12776
12777 echo "$as_me:12777: checking for NetBSD menu.h" >&5
12778 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
12779 if test "${cf_cv_netbsd_menu_h+set}" = set; then
12780   echo $ECHO_N "(cached) $ECHO_C" >&6
12781 else
12782
12783 cat >conftest.$ac_ext <<_ACEOF
12784 #line 12784 "configure"
12785 #include "confdefs.h"
12786
12787 #include <${cf_cv_ncurses_header:-curses.h}>
12788 #include <menu.h>
12789
12790 int
12791 main ()
12792 {
12793
12794         MENU *menu;
12795         int y = menu->max_item_width;
12796
12797   ;
12798   return 0;
12799 }
12800 _ACEOF
12801 rm -f conftest.$ac_objext
12802 if { (eval echo "$as_me:12802: \"$ac_compile\"") >&5
12803   (eval $ac_compile) 2>&5
12804   ac_status=$?
12805   echo "$as_me:12805: \$? = $ac_status" >&5
12806   (exit $ac_status); } &&
12807          { ac_try='test -s conftest.$ac_objext'
12808   { (eval echo "$as_me:12808: \"$ac_try\"") >&5
12809   (eval $ac_try) 2>&5
12810   ac_status=$?
12811   echo "$as_me:12811: \$? = $ac_status" >&5
12812   (exit $ac_status); }; }; then
12813   cf_cv_netbsd_menu_h=yes
12814
12815 else
12816   echo "$as_me: failed program was:" >&5
12817 cat conftest.$ac_ext >&5
12818 cf_cv_netbsd_menu_h=no
12819 fi
12820 rm -f conftest.$ac_objext conftest.$ac_ext
12821
12822 fi
12823 echo "$as_me:12823: result: $cf_cv_netbsd_menu_h" >&5
12824 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
12825
12826 test "$cf_cv_netbsd_menu_h" = yes &&
12827 cat >>confdefs.h <<\EOF
12828 #define HAVE_NETBSD_MENU_H 1
12829 EOF
12830
12831         ;;
12832 (ncursesw)
12833         cf_cv_libtype=w
12834         ;;
12835 esac
12836
12837 case $cf_cv_screen in
12838 (pdcurses)
12839         ;;
12840 (*)
12841         # look for curses-related libraries
12842         : ${cf_panel_lib:=panel}
12843         : ${cf_menu_lib:=menu}
12844         : ${cf_form_lib:=form}
12845
12846 as_ac_Lib=`echo "ac_cv_lib_$cf_panel_lib$cf_cv_libtype''_new_panel" | $as_tr_sh`
12847 echo "$as_me:12847: checking for new_panel in -l$cf_panel_lib$cf_cv_libtype" >&5
12848 echo $ECHO_N "checking for new_panel in -l$cf_panel_lib$cf_cv_libtype... $ECHO_C" >&6
12849 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12850   echo $ECHO_N "(cached) $ECHO_C" >&6
12851 else
12852   ac_check_lib_save_LIBS=$LIBS
12853 LIBS="-l$cf_panel_lib$cf_cv_libtype  $LIBS"
12854 cat >conftest.$ac_ext <<_ACEOF
12855 #line 12855 "configure"
12856 #include "confdefs.h"
12857
12858 /* Override any gcc2 internal prototype to avoid an error.  */
12859 #ifdef __cplusplus
12860 extern "C"
12861 #endif
12862 /* We use char because int might match the return type of a gcc2
12863    builtin and then its argument prototype would still apply.  */
12864 char new_panel ();
12865 int
12866 main ()
12867 {
12868 new_panel ();
12869   ;
12870   return 0;
12871 }
12872 _ACEOF
12873 rm -f conftest.$ac_objext conftest$ac_exeext
12874 if { (eval echo "$as_me:12874: \"$ac_link\"") >&5
12875   (eval $ac_link) 2>&5
12876   ac_status=$?
12877   echo "$as_me:12877: \$? = $ac_status" >&5
12878   (exit $ac_status); } &&
12879          { ac_try='test -s conftest$ac_exeext'
12880   { (eval echo "$as_me:12880: \"$ac_try\"") >&5
12881   (eval $ac_try) 2>&5
12882   ac_status=$?
12883   echo "$as_me:12883: \$? = $ac_status" >&5
12884   (exit $ac_status); }; }; then
12885   eval "$as_ac_Lib=yes"
12886 else
12887   echo "$as_me: failed program was:" >&5
12888 cat conftest.$ac_ext >&5
12889 eval "$as_ac_Lib=no"
12890 fi
12891 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12892 LIBS=$ac_check_lib_save_LIBS
12893 fi
12894 echo "$as_me:12894: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12895 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12896 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12897   cat >>confdefs.h <<EOF
12898 #define `echo "HAVE_LIB$cf_panel_lib$cf_cv_libtype" | $as_tr_cpp` 1
12899 EOF
12900
12901   LIBS="-l$cf_panel_lib$cf_cv_libtype $LIBS"
12902
12903 fi
12904
12905 as_ac_Lib=`echo "ac_cv_lib_$cf_menu_lib$cf_cv_libtype''_menu_driver" | $as_tr_sh`
12906 echo "$as_me:12906: checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype" >&5
12907 echo $ECHO_N "checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype... $ECHO_C" >&6
12908 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12909   echo $ECHO_N "(cached) $ECHO_C" >&6
12910 else
12911   ac_check_lib_save_LIBS=$LIBS
12912 LIBS="-l$cf_menu_lib$cf_cv_libtype  $LIBS"
12913 cat >conftest.$ac_ext <<_ACEOF
12914 #line 12914 "configure"
12915 #include "confdefs.h"
12916
12917 /* Override any gcc2 internal prototype to avoid an error.  */
12918 #ifdef __cplusplus
12919 extern "C"
12920 #endif
12921 /* We use char because int might match the return type of a gcc2
12922    builtin and then its argument prototype would still apply.  */
12923 char menu_driver ();
12924 int
12925 main ()
12926 {
12927 menu_driver ();
12928   ;
12929   return 0;
12930 }
12931 _ACEOF
12932 rm -f conftest.$ac_objext conftest$ac_exeext
12933 if { (eval echo "$as_me:12933: \"$ac_link\"") >&5
12934   (eval $ac_link) 2>&5
12935   ac_status=$?
12936   echo "$as_me:12936: \$? = $ac_status" >&5
12937   (exit $ac_status); } &&
12938          { ac_try='test -s conftest$ac_exeext'
12939   { (eval echo "$as_me:12939: \"$ac_try\"") >&5
12940   (eval $ac_try) 2>&5
12941   ac_status=$?
12942   echo "$as_me:12942: \$? = $ac_status" >&5
12943   (exit $ac_status); }; }; then
12944   eval "$as_ac_Lib=yes"
12945 else
12946   echo "$as_me: failed program was:" >&5
12947 cat conftest.$ac_ext >&5
12948 eval "$as_ac_Lib=no"
12949 fi
12950 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12951 LIBS=$ac_check_lib_save_LIBS
12952 fi
12953 echo "$as_me:12953: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12954 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12955 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12956   cat >>confdefs.h <<EOF
12957 #define `echo "HAVE_LIB$cf_menu_lib$cf_cv_libtype" | $as_tr_cpp` 1
12958 EOF
12959
12960   LIBS="-l$cf_menu_lib$cf_cv_libtype $LIBS"
12961
12962 fi
12963
12964 as_ac_Lib=`echo "ac_cv_lib_$cf_form_lib$cf_cv_libtype''_form_driver" | $as_tr_sh`
12965 echo "$as_me:12965: checking for form_driver in -l$cf_form_lib$cf_cv_libtype" >&5
12966 echo $ECHO_N "checking for form_driver in -l$cf_form_lib$cf_cv_libtype... $ECHO_C" >&6
12967 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12968   echo $ECHO_N "(cached) $ECHO_C" >&6
12969 else
12970   ac_check_lib_save_LIBS=$LIBS
12971 LIBS="-l$cf_form_lib$cf_cv_libtype  $LIBS"
12972 cat >conftest.$ac_ext <<_ACEOF
12973 #line 12973 "configure"
12974 #include "confdefs.h"
12975
12976 /* Override any gcc2 internal prototype to avoid an error.  */
12977 #ifdef __cplusplus
12978 extern "C"
12979 #endif
12980 /* We use char because int might match the return type of a gcc2
12981    builtin and then its argument prototype would still apply.  */
12982 char form_driver ();
12983 int
12984 main ()
12985 {
12986 form_driver ();
12987   ;
12988   return 0;
12989 }
12990 _ACEOF
12991 rm -f conftest.$ac_objext conftest$ac_exeext
12992 if { (eval echo "$as_me:12992: \"$ac_link\"") >&5
12993   (eval $ac_link) 2>&5
12994   ac_status=$?
12995   echo "$as_me:12995: \$? = $ac_status" >&5
12996   (exit $ac_status); } &&
12997          { ac_try='test -s conftest$ac_exeext'
12998   { (eval echo "$as_me:12998: \"$ac_try\"") >&5
12999   (eval $ac_try) 2>&5
13000   ac_status=$?
13001   echo "$as_me:13001: \$? = $ac_status" >&5
13002   (exit $ac_status); }; }; then
13003   eval "$as_ac_Lib=yes"
13004 else
13005   echo "$as_me: failed program was:" >&5
13006 cat conftest.$ac_ext >&5
13007 eval "$as_ac_Lib=no"
13008 fi
13009 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13010 LIBS=$ac_check_lib_save_LIBS
13011 fi
13012 echo "$as_me:13012: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13013 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13014 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13015   cat >>confdefs.h <<EOF
13016 #define `echo "HAVE_LIB$cf_form_lib$cf_cv_libtype" | $as_tr_cpp` 1
13017 EOF
13018
13019   LIBS="-l$cf_form_lib$cf_cv_libtype $LIBS"
13020
13021 fi
13022
13023         # look for curses-related headers
13024
13025 for ac_header in \
13026                 nc_alloc.h \
13027                 nomacros.h \
13028                 form.h \
13029                 menu.h \
13030                 panel.h \
13031                 term_entry.h \
13032
13033 do
13034 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13035 echo "$as_me:13035: checking for $ac_header" >&5
13036 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13037 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13038   echo $ECHO_N "(cached) $ECHO_C" >&6
13039 else
13040   cat >conftest.$ac_ext <<_ACEOF
13041 #line 13041 "configure"
13042 #include "confdefs.h"
13043 #include <$ac_header>
13044 _ACEOF
13045 if { (eval echo "$as_me:13045: \"$ac_cpp conftest.$ac_ext\"") >&5
13046   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13047   ac_status=$?
13048   egrep -v '^ *\+' conftest.er1 >conftest.err
13049   rm -f conftest.er1
13050   cat conftest.err >&5
13051   echo "$as_me:13051: \$? = $ac_status" >&5
13052   (exit $ac_status); } >/dev/null; then
13053   if test -s conftest.err; then
13054     ac_cpp_err=$ac_c_preproc_warn_flag
13055   else
13056     ac_cpp_err=
13057   fi
13058 else
13059   ac_cpp_err=yes
13060 fi
13061 if test -z "$ac_cpp_err"; then
13062   eval "$as_ac_Header=yes"
13063 else
13064   echo "$as_me: failed program was:" >&5
13065   cat conftest.$ac_ext >&5
13066   eval "$as_ac_Header=no"
13067 fi
13068 rm -f conftest.err conftest.$ac_ext
13069 fi
13070 echo "$as_me:13070: result: `eval echo '${'$as_ac_Header'}'`" >&5
13071 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13072 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13073   cat >>confdefs.h <<EOF
13074 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13075 EOF
13076
13077 fi
13078 done
13079
13080         ;;
13081 esac
13082
13083 echo "$as_me:13083: checking for ANSI C header files" >&5
13084 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13085 if test "${ac_cv_header_stdc+set}" = set; then
13086   echo $ECHO_N "(cached) $ECHO_C" >&6
13087 else
13088   cat >conftest.$ac_ext <<_ACEOF
13089 #line 13089 "configure"
13090 #include "confdefs.h"
13091 #include <stdlib.h>
13092 #include <stdarg.h>
13093 #include <string.h>
13094 #include <float.h>
13095
13096 _ACEOF
13097 if { (eval echo "$as_me:13097: \"$ac_cpp conftest.$ac_ext\"") >&5
13098   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13099   ac_status=$?
13100   egrep -v '^ *\+' conftest.er1 >conftest.err
13101   rm -f conftest.er1
13102   cat conftest.err >&5
13103   echo "$as_me:13103: \$? = $ac_status" >&5
13104   (exit $ac_status); } >/dev/null; then
13105   if test -s conftest.err; then
13106     ac_cpp_err=$ac_c_preproc_warn_flag
13107   else
13108     ac_cpp_err=
13109   fi
13110 else
13111   ac_cpp_err=yes
13112 fi
13113 if test -z "$ac_cpp_err"; then
13114   ac_cv_header_stdc=yes
13115 else
13116   echo "$as_me: failed program was:" >&5
13117   cat conftest.$ac_ext >&5
13118   ac_cv_header_stdc=no
13119 fi
13120 rm -f conftest.err conftest.$ac_ext
13121
13122 if test $ac_cv_header_stdc = yes; then
13123   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13124   cat >conftest.$ac_ext <<_ACEOF
13125 #line 13125 "configure"
13126 #include "confdefs.h"
13127 #include <string.h>
13128
13129 _ACEOF
13130 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13131   egrep "memchr" >/dev/null 2>&1; then
13132   :
13133 else
13134   ac_cv_header_stdc=no
13135 fi
13136 rm -rf conftest*
13137
13138 fi
13139
13140 if test $ac_cv_header_stdc = yes; then
13141   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13142   cat >conftest.$ac_ext <<_ACEOF
13143 #line 13143 "configure"
13144 #include "confdefs.h"
13145 #include <stdlib.h>
13146
13147 _ACEOF
13148 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13149   egrep "free" >/dev/null 2>&1; then
13150   :
13151 else
13152   ac_cv_header_stdc=no
13153 fi
13154 rm -rf conftest*
13155
13156 fi
13157
13158 if test $ac_cv_header_stdc = yes; then
13159   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13160   if test "$cross_compiling" = yes; then
13161   :
13162 else
13163   cat >conftest.$ac_ext <<_ACEOF
13164 #line 13164 "configure"
13165 #include "confdefs.h"
13166 #include <ctype.h>
13167 #if ((' ' & 0x0FF) == 0x020)
13168 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13169 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13170 #else
13171 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13172                      || ('j' <= (c) && (c) <= 'r') \
13173                      || ('s' <= (c) && (c) <= 'z'))
13174 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13175 #endif
13176
13177 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13178 int
13179 main ()
13180 {
13181   int i;
13182   for (i = 0; i < 256; i++)
13183     if (XOR (islower (i), ISLOWER (i))
13184         || toupper (i) != TOUPPER (i))
13185       $ac_main_return(2);
13186   $ac_main_return (0);
13187 }
13188 _ACEOF
13189 rm -f conftest$ac_exeext
13190 if { (eval echo "$as_me:13190: \"$ac_link\"") >&5
13191   (eval $ac_link) 2>&5
13192   ac_status=$?
13193   echo "$as_me:13193: \$? = $ac_status" >&5
13194   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13195   { (eval echo "$as_me:13195: \"$ac_try\"") >&5
13196   (eval $ac_try) 2>&5
13197   ac_status=$?
13198   echo "$as_me:13198: \$? = $ac_status" >&5
13199   (exit $ac_status); }; }; then
13200   :
13201 else
13202   echo "$as_me: program exited with status $ac_status" >&5
13203 echo "$as_me: failed program was:" >&5
13204 cat conftest.$ac_ext >&5
13205 ac_cv_header_stdc=no
13206 fi
13207 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13208 fi
13209 fi
13210 fi
13211 echo "$as_me:13211: result: $ac_cv_header_stdc" >&5
13212 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13213 if test $ac_cv_header_stdc = yes; then
13214
13215 cat >>confdefs.h <<\EOF
13216 #define STDC_HEADERS 1
13217 EOF
13218
13219 fi
13220
13221 echo "$as_me:13221: checking whether time.h and sys/time.h may both be included" >&5
13222 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13223 if test "${ac_cv_header_time+set}" = set; then
13224   echo $ECHO_N "(cached) $ECHO_C" >&6
13225 else
13226   cat >conftest.$ac_ext <<_ACEOF
13227 #line 13227 "configure"
13228 #include "confdefs.h"
13229 #include <sys/types.h>
13230 #include <sys/time.h>
13231 #include <time.h>
13232
13233 int
13234 main ()
13235 {
13236 if ((struct tm *) 0)
13237 return 0;
13238   ;
13239   return 0;
13240 }
13241 _ACEOF
13242 rm -f conftest.$ac_objext
13243 if { (eval echo "$as_me:13243: \"$ac_compile\"") >&5
13244   (eval $ac_compile) 2>&5
13245   ac_status=$?
13246   echo "$as_me:13246: \$? = $ac_status" >&5
13247   (exit $ac_status); } &&
13248          { ac_try='test -s conftest.$ac_objext'
13249   { (eval echo "$as_me:13249: \"$ac_try\"") >&5
13250   (eval $ac_try) 2>&5
13251   ac_status=$?
13252   echo "$as_me:13252: \$? = $ac_status" >&5
13253   (exit $ac_status); }; }; then
13254   ac_cv_header_time=yes
13255 else
13256   echo "$as_me: failed program was:" >&5
13257 cat conftest.$ac_ext >&5
13258 ac_cv_header_time=no
13259 fi
13260 rm -f conftest.$ac_objext conftest.$ac_ext
13261 fi
13262 echo "$as_me:13262: result: $ac_cv_header_time" >&5
13263 echo "${ECHO_T}$ac_cv_header_time" >&6
13264 if test $ac_cv_header_time = yes; then
13265
13266 cat >>confdefs.h <<\EOF
13267 #define TIME_WITH_SYS_TIME 1
13268 EOF
13269
13270 fi
13271
13272 for ac_header in \
13273 getopt.h \
13274 locale.h \
13275 math.h \
13276 stdarg.h \
13277 sys/ioctl.h \
13278 sys/select.h \
13279 sys/time.h \
13280 termios.h \
13281 unistd.h \
13282
13283 do
13284 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13285 echo "$as_me:13285: checking for $ac_header" >&5
13286 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13287 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13288   echo $ECHO_N "(cached) $ECHO_C" >&6
13289 else
13290   cat >conftest.$ac_ext <<_ACEOF
13291 #line 13291 "configure"
13292 #include "confdefs.h"
13293 #include <$ac_header>
13294 _ACEOF
13295 if { (eval echo "$as_me:13295: \"$ac_cpp conftest.$ac_ext\"") >&5
13296   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13297   ac_status=$?
13298   egrep -v '^ *\+' conftest.er1 >conftest.err
13299   rm -f conftest.er1
13300   cat conftest.err >&5
13301   echo "$as_me:13301: \$? = $ac_status" >&5
13302   (exit $ac_status); } >/dev/null; then
13303   if test -s conftest.err; then
13304     ac_cpp_err=$ac_c_preproc_warn_flag
13305   else
13306     ac_cpp_err=
13307   fi
13308 else
13309   ac_cpp_err=yes
13310 fi
13311 if test -z "$ac_cpp_err"; then
13312   eval "$as_ac_Header=yes"
13313 else
13314   echo "$as_me: failed program was:" >&5
13315   cat conftest.$ac_ext >&5
13316   eval "$as_ac_Header=no"
13317 fi
13318 rm -f conftest.err conftest.$ac_ext
13319 fi
13320 echo "$as_me:13320: result: `eval echo '${'$as_ac_Header'}'`" >&5
13321 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13322 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13323   cat >>confdefs.h <<EOF
13324 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13325 EOF
13326
13327 fi
13328 done
13329
13330 for ac_header in unistd.h getopt.h
13331 do
13332 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13333 echo "$as_me:13333: checking for $ac_header" >&5
13334 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13335 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13336   echo $ECHO_N "(cached) $ECHO_C" >&6
13337 else
13338   cat >conftest.$ac_ext <<_ACEOF
13339 #line 13339 "configure"
13340 #include "confdefs.h"
13341 #include <$ac_header>
13342 _ACEOF
13343 if { (eval echo "$as_me:13343: \"$ac_cpp conftest.$ac_ext\"") >&5
13344   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13345   ac_status=$?
13346   egrep -v '^ *\+' conftest.er1 >conftest.err
13347   rm -f conftest.er1
13348   cat conftest.err >&5
13349   echo "$as_me:13349: \$? = $ac_status" >&5
13350   (exit $ac_status); } >/dev/null; then
13351   if test -s conftest.err; then
13352     ac_cpp_err=$ac_c_preproc_warn_flag
13353   else
13354     ac_cpp_err=
13355   fi
13356 else
13357   ac_cpp_err=yes
13358 fi
13359 if test -z "$ac_cpp_err"; then
13360   eval "$as_ac_Header=yes"
13361 else
13362   echo "$as_me: failed program was:" >&5
13363   cat conftest.$ac_ext >&5
13364   eval "$as_ac_Header=no"
13365 fi
13366 rm -f conftest.err conftest.$ac_ext
13367 fi
13368 echo "$as_me:13368: result: `eval echo '${'$as_ac_Header'}'`" >&5
13369 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13370 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13371   cat >>confdefs.h <<EOF
13372 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13373 EOF
13374
13375 fi
13376 done
13377
13378 echo "$as_me:13378: checking for header declaring getopt variables" >&5
13379 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13380 if test "${cf_cv_getopt_header+set}" = set; then
13381   echo $ECHO_N "(cached) $ECHO_C" >&6
13382 else
13383
13384 cf_cv_getopt_header=none
13385 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13386 do
13387 cat >conftest.$ac_ext <<_ACEOF
13388 #line 13388 "configure"
13389 #include "confdefs.h"
13390
13391 #include <$cf_header>
13392 int
13393 main ()
13394 {
13395 int x = optind; char *y = optarg
13396   ;
13397   return 0;
13398 }
13399 _ACEOF
13400 rm -f conftest.$ac_objext
13401 if { (eval echo "$as_me:13401: \"$ac_compile\"") >&5
13402   (eval $ac_compile) 2>&5
13403   ac_status=$?
13404   echo "$as_me:13404: \$? = $ac_status" >&5
13405   (exit $ac_status); } &&
13406          { ac_try='test -s conftest.$ac_objext'
13407   { (eval echo "$as_me:13407: \"$ac_try\"") >&5
13408   (eval $ac_try) 2>&5
13409   ac_status=$?
13410   echo "$as_me:13410: \$? = $ac_status" >&5
13411   (exit $ac_status); }; }; then
13412   cf_cv_getopt_header=$cf_header
13413  break
13414 else
13415   echo "$as_me: failed program was:" >&5
13416 cat conftest.$ac_ext >&5
13417 fi
13418 rm -f conftest.$ac_objext conftest.$ac_ext
13419 done
13420
13421 fi
13422 echo "$as_me:13422: result: $cf_cv_getopt_header" >&5
13423 echo "${ECHO_T}$cf_cv_getopt_header" >&6
13424 if test $cf_cv_getopt_header != none ; then
13425
13426 cat >>confdefs.h <<\EOF
13427 #define HAVE_GETOPT_HEADER 1
13428 EOF
13429
13430 fi
13431 if test $cf_cv_getopt_header = getopt.h ; then
13432
13433 cat >>confdefs.h <<\EOF
13434 #define NEED_GETOPT_H 1
13435 EOF
13436
13437 fi
13438
13439 for ac_func in \
13440 getopt \
13441 gettimeofday \
13442
13443 do
13444 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13445 echo "$as_me:13445: checking for $ac_func" >&5
13446 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13447 if eval "test \"\${$as_ac_var+set}\" = set"; then
13448   echo $ECHO_N "(cached) $ECHO_C" >&6
13449 else
13450   cat >conftest.$ac_ext <<_ACEOF
13451 #line 13451 "configure"
13452 #include "confdefs.h"
13453 /* System header to define __stub macros and hopefully few prototypes,
13454     which can conflict with char $ac_func (); below.  */
13455 #include <assert.h>
13456 /* Override any gcc2 internal prototype to avoid an error.  */
13457 #ifdef __cplusplus
13458 extern "C"
13459 #endif
13460 /* We use char because int might match the return type of a gcc2
13461    builtin and then its argument prototype would still apply.  */
13462 char $ac_func ();
13463 char (*f) ();
13464
13465 int
13466 main ()
13467 {
13468 /* The GNU C library defines this for functions which it implements
13469     to always fail with ENOSYS.  Some functions are actually named
13470     something starting with __ and the normal name is an alias.  */
13471 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13472 choke me
13473 #else
13474 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13475 #endif
13476
13477   ;
13478   return 0;
13479 }
13480 _ACEOF
13481 rm -f conftest.$ac_objext conftest$ac_exeext
13482 if { (eval echo "$as_me:13482: \"$ac_link\"") >&5
13483   (eval $ac_link) 2>&5
13484   ac_status=$?
13485   echo "$as_me:13485: \$? = $ac_status" >&5
13486   (exit $ac_status); } &&
13487          { ac_try='test -s conftest$ac_exeext'
13488   { (eval echo "$as_me:13488: \"$ac_try\"") >&5
13489   (eval $ac_try) 2>&5
13490   ac_status=$?
13491   echo "$as_me:13491: \$? = $ac_status" >&5
13492   (exit $ac_status); }; }; then
13493   eval "$as_ac_var=yes"
13494 else
13495   echo "$as_me: failed program was:" >&5
13496 cat conftest.$ac_ext >&5
13497 eval "$as_ac_var=no"
13498 fi
13499 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13500 fi
13501 echo "$as_me:13501: result: `eval echo '${'$as_ac_var'}'`" >&5
13502 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13503 if test `eval echo '${'$as_ac_var'}'` = yes; then
13504   cat >>confdefs.h <<EOF
13505 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13506 EOF
13507
13508 fi
13509 done
13510
13511 if test "x$ac_cv_func_getopt" = xno; then
13512         { { echo "$as_me:13512: error: getopt is required for building programs" >&5
13513 echo "$as_me: error: getopt is required for building programs" >&2;}
13514    { (exit 1); exit 1; }; }
13515 fi
13516
13517 if test "$cf_enable_widec" = yes; then
13518
13519 for ac_func in \
13520 mblen \
13521 mbrlen \
13522 mbrtowc \
13523 mbsrtowcs \
13524 mbstowcs \
13525 mbtowc \
13526 wcsrtombs \
13527 wcstombs \
13528
13529 do
13530 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13531 echo "$as_me:13531: checking for $ac_func" >&5
13532 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13533 if eval "test \"\${$as_ac_var+set}\" = set"; then
13534   echo $ECHO_N "(cached) $ECHO_C" >&6
13535 else
13536   cat >conftest.$ac_ext <<_ACEOF
13537 #line 13537 "configure"
13538 #include "confdefs.h"
13539 /* System header to define __stub macros and hopefully few prototypes,
13540     which can conflict with char $ac_func (); below.  */
13541 #include <assert.h>
13542 /* Override any gcc2 internal prototype to avoid an error.  */
13543 #ifdef __cplusplus
13544 extern "C"
13545 #endif
13546 /* We use char because int might match the return type of a gcc2
13547    builtin and then its argument prototype would still apply.  */
13548 char $ac_func ();
13549 char (*f) ();
13550
13551 int
13552 main ()
13553 {
13554 /* The GNU C library defines this for functions which it implements
13555     to always fail with ENOSYS.  Some functions are actually named
13556     something starting with __ and the normal name is an alias.  */
13557 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13558 choke me
13559 #else
13560 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13561 #endif
13562
13563   ;
13564   return 0;
13565 }
13566 _ACEOF
13567 rm -f conftest.$ac_objext conftest$ac_exeext
13568 if { (eval echo "$as_me:13568: \"$ac_link\"") >&5
13569   (eval $ac_link) 2>&5
13570   ac_status=$?
13571   echo "$as_me:13571: \$? = $ac_status" >&5
13572   (exit $ac_status); } &&
13573          { ac_try='test -s conftest$ac_exeext'
13574   { (eval echo "$as_me:13574: \"$ac_try\"") >&5
13575   (eval $ac_try) 2>&5
13576   ac_status=$?
13577   echo "$as_me:13577: \$? = $ac_status" >&5
13578   (exit $ac_status); }; }; then
13579   eval "$as_ac_var=yes"
13580 else
13581   echo "$as_me: failed program was:" >&5
13582 cat conftest.$ac_ext >&5
13583 eval "$as_ac_var=no"
13584 fi
13585 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13586 fi
13587 echo "$as_me:13587: result: `eval echo '${'$as_ac_var'}'`" >&5
13588 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13589 if test `eval echo '${'$as_ac_var'}'` = yes; then
13590   cat >>confdefs.h <<EOF
13591 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13592 EOF
13593
13594 fi
13595 done
13596
13597 fi
13598
13599 echo "$as_me:13599: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
13600 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
13601 if test "${cf_cv_need_xopen_extension+set}" = set; then
13602   echo $ECHO_N "(cached) $ECHO_C" >&6
13603 else
13604
13605 cat >conftest.$ac_ext <<_ACEOF
13606 #line 13606 "configure"
13607 #include "confdefs.h"
13608
13609 #include <stdlib.h>
13610 #include <${cf_cv_ncurses_header:-curses.h}>
13611 int
13612 main ()
13613 {
13614
13615 #if defined(NCURSES_VERSION_PATCH)
13616 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
13617         make an error
13618 #endif
13619 #endif
13620         long x = winnstr(stdscr, "", 0);
13621         int x1, y1;
13622         getbegyx(stdscr, y1, x1)
13623   ;
13624   return 0;
13625 }
13626 _ACEOF
13627 rm -f conftest.$ac_objext conftest$ac_exeext
13628 if { (eval echo "$as_me:13628: \"$ac_link\"") >&5
13629   (eval $ac_link) 2>&5
13630   ac_status=$?
13631   echo "$as_me:13631: \$? = $ac_status" >&5
13632   (exit $ac_status); } &&
13633          { ac_try='test -s conftest$ac_exeext'
13634   { (eval echo "$as_me:13634: \"$ac_try\"") >&5
13635   (eval $ac_try) 2>&5
13636   ac_status=$?
13637   echo "$as_me:13637: \$? = $ac_status" >&5
13638   (exit $ac_status); }; }; then
13639   cf_cv_need_xopen_extension=no
13640 else
13641   echo "$as_me: failed program was:" >&5
13642 cat conftest.$ac_ext >&5
13643 cat >conftest.$ac_ext <<_ACEOF
13644 #line 13644 "configure"
13645 #include "confdefs.h"
13646
13647 #define _XOPEN_SOURCE_EXTENDED
13648 #include <stdlib.h>
13649 #include <${cf_cv_ncurses_header:-curses.h}>
13650 int
13651 main ()
13652 {
13653
13654 #ifdef NCURSES_VERSION
13655         cchar_t check;
13656         int check2 = curs_set((int)sizeof(check));
13657 #endif
13658         long x = winnstr(stdscr, "", 0);
13659         int x1, y1;
13660         getbegyx(stdscr, y1, x1)
13661   ;
13662   return 0;
13663 }
13664 _ACEOF
13665 rm -f conftest.$ac_objext conftest$ac_exeext
13666 if { (eval echo "$as_me:13666: \"$ac_link\"") >&5
13667   (eval $ac_link) 2>&5
13668   ac_status=$?
13669   echo "$as_me:13669: \$? = $ac_status" >&5
13670   (exit $ac_status); } &&
13671          { ac_try='test -s conftest$ac_exeext'
13672   { (eval echo "$as_me:13672: \"$ac_try\"") >&5
13673   (eval $ac_try) 2>&5
13674   ac_status=$?
13675   echo "$as_me:13675: \$? = $ac_status" >&5
13676   (exit $ac_status); }; }; then
13677   cf_cv_need_xopen_extension=yes
13678 else
13679   echo "$as_me: failed program was:" >&5
13680 cat conftest.$ac_ext >&5
13681 cf_cv_need_xopen_extension=unknown
13682 fi
13683 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13684 fi
13685 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13686 fi
13687 echo "$as_me:13687: result: $cf_cv_need_xopen_extension" >&5
13688 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
13689 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
13690
13691 echo "$as_me:13691: checking for term.h" >&5
13692 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
13693 if test "${cf_cv_term_header+set}" = set; then
13694   echo $ECHO_N "(cached) $ECHO_C" >&6
13695 else
13696
13697 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
13698 # for <term.h> if we do not find the variant.
13699
13700 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
13701
13702 case ${cf_cv_ncurses_header:-curses.h} in
13703 (*/*)
13704         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
13705         cf_header_list="$cf_header_item $cf_header_list"
13706         ;;
13707 esac
13708
13709 for cf_header in $cf_header_list
13710 do
13711         cat >conftest.$ac_ext <<_ACEOF
13712 #line 13712 "configure"
13713 #include "confdefs.h"
13714
13715 #include <${cf_cv_ncurses_header:-curses.h}>
13716 #include <${cf_header}>
13717 int
13718 main ()
13719 {
13720 WINDOW *x
13721   ;
13722   return 0;
13723 }
13724 _ACEOF
13725 rm -f conftest.$ac_objext
13726 if { (eval echo "$as_me:13726: \"$ac_compile\"") >&5
13727   (eval $ac_compile) 2>&5
13728   ac_status=$?
13729   echo "$as_me:13729: \$? = $ac_status" >&5
13730   (exit $ac_status); } &&
13731          { ac_try='test -s conftest.$ac_objext'
13732   { (eval echo "$as_me:13732: \"$ac_try\"") >&5
13733   (eval $ac_try) 2>&5
13734   ac_status=$?
13735   echo "$as_me:13735: \$? = $ac_status" >&5
13736   (exit $ac_status); }; }; then
13737   cf_cv_term_header=$cf_header
13738          break
13739 else
13740   echo "$as_me: failed program was:" >&5
13741 cat conftest.$ac_ext >&5
13742 cf_cv_term_header=no
13743 fi
13744 rm -f conftest.$ac_objext conftest.$ac_ext
13745 done
13746
13747 case $cf_cv_term_header in
13748 (no)
13749         # If curses is ncurses, some packagers still mess it up by trying to make
13750         # us use GNU termcap.  This handles the most common case.
13751         for cf_header in ncurses/term.h ncursesw/term.h
13752         do
13753                 cat >conftest.$ac_ext <<_ACEOF
13754 #line 13754 "configure"
13755 #include "confdefs.h"
13756
13757 #include <${cf_cv_ncurses_header:-curses.h}>
13758 #ifdef NCURSES_VERSION
13759 #include <${cf_header}>
13760 #else
13761 make an error
13762 #endif
13763 int
13764 main ()
13765 {
13766 WINDOW *x
13767   ;
13768   return 0;
13769 }
13770 _ACEOF
13771 rm -f conftest.$ac_objext
13772 if { (eval echo "$as_me:13772: \"$ac_compile\"") >&5
13773   (eval $ac_compile) 2>&5
13774   ac_status=$?
13775   echo "$as_me:13775: \$? = $ac_status" >&5
13776   (exit $ac_status); } &&
13777          { ac_try='test -s conftest.$ac_objext'
13778   { (eval echo "$as_me:13778: \"$ac_try\"") >&5
13779   (eval $ac_try) 2>&5
13780   ac_status=$?
13781   echo "$as_me:13781: \$? = $ac_status" >&5
13782   (exit $ac_status); }; }; then
13783   cf_cv_term_header=$cf_header
13784                          break
13785 else
13786   echo "$as_me: failed program was:" >&5
13787 cat conftest.$ac_ext >&5
13788 cf_cv_term_header=no
13789 fi
13790 rm -f conftest.$ac_objext conftest.$ac_ext
13791         done
13792         ;;
13793 esac
13794
13795 fi
13796 echo "$as_me:13796: result: $cf_cv_term_header" >&5
13797 echo "${ECHO_T}$cf_cv_term_header" >&6
13798
13799 case $cf_cv_term_header in
13800 (term.h)
13801
13802 cat >>confdefs.h <<\EOF
13803 #define HAVE_TERM_H 1
13804 EOF
13805
13806         ;;
13807 (ncurses/term.h)
13808
13809 cat >>confdefs.h <<\EOF
13810 #define HAVE_NCURSES_TERM_H 1
13811 EOF
13812
13813         ;;
13814 (ncursesw/term.h)
13815
13816 cat >>confdefs.h <<\EOF
13817 #define HAVE_NCURSESW_TERM_H 1
13818 EOF
13819
13820         ;;
13821 esac
13822
13823 echo "$as_me:13823: checking for unctrl.h" >&5
13824 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
13825 if test "${cf_cv_unctrl_header+set}" = set; then
13826   echo $ECHO_N "(cached) $ECHO_C" >&6
13827 else
13828
13829 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
13830 # for <unctrl.h> if we do not find the variant.
13831
13832 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
13833
13834 case ${cf_cv_ncurses_header:-curses.h} in
13835 (*/*)
13836         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
13837         cf_header_list="$cf_header_item $cf_header_list"
13838         ;;
13839 esac
13840
13841 for cf_header in $cf_header_list
13842 do
13843         cat >conftest.$ac_ext <<_ACEOF
13844 #line 13844 "configure"
13845 #include "confdefs.h"
13846
13847 #include <${cf_cv_ncurses_header:-curses.h}>
13848 #include <${cf_header}>
13849 int
13850 main ()
13851 {
13852 WINDOW *x
13853   ;
13854   return 0;
13855 }
13856 _ACEOF
13857 rm -f conftest.$ac_objext
13858 if { (eval echo "$as_me:13858: \"$ac_compile\"") >&5
13859   (eval $ac_compile) 2>&5
13860   ac_status=$?
13861   echo "$as_me:13861: \$? = $ac_status" >&5
13862   (exit $ac_status); } &&
13863          { ac_try='test -s conftest.$ac_objext'
13864   { (eval echo "$as_me:13864: \"$ac_try\"") >&5
13865   (eval $ac_try) 2>&5
13866   ac_status=$?
13867   echo "$as_me:13867: \$? = $ac_status" >&5
13868   (exit $ac_status); }; }; then
13869   cf_cv_unctrl_header=$cf_header
13870          break
13871 else
13872   echo "$as_me: failed program was:" >&5
13873 cat conftest.$ac_ext >&5
13874 cf_cv_unctrl_header=no
13875 fi
13876 rm -f conftest.$ac_objext conftest.$ac_ext
13877 done
13878
13879 fi
13880 echo "$as_me:13880: result: $cf_cv_unctrl_header" >&5
13881 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
13882
13883 case $cf_cv_unctrl_header in
13884 (no)
13885         { echo "$as_me:13885: WARNING: unctrl.h header not found" >&5
13886 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
13887         ;;
13888 esac
13889
13890 case $cf_cv_unctrl_header in
13891 (unctrl.h)
13892
13893 cat >>confdefs.h <<\EOF
13894 #define HAVE_UNCTRL_H 1
13895 EOF
13896
13897         ;;
13898 (ncurses/unctrl.h)
13899
13900 cat >>confdefs.h <<\EOF
13901 #define HAVE_NCURSES_UNCTRL_H 1
13902 EOF
13903
13904         ;;
13905 (ncursesw/unctrl.h)
13906
13907 cat >>confdefs.h <<\EOF
13908 #define HAVE_NCURSESW_UNCTRL_H 1
13909 EOF
13910
13911         ;;
13912 esac
13913
13914 for cf_func in \
13915 assume_default_colors \
13916 chgat \
13917 color_set \
13918 filter \
13919 getbegx \
13920 getcurx \
13921 getmaxx \
13922 getnstr \
13923 getparx \
13924 getwin \
13925 mvvline \
13926 mvwvline \
13927 napms \
13928 putwin \
13929 resize_term \
13930 resizeterm \
13931 ripoffline \
13932 scr_dump \
13933 setupterm \
13934 slk_color \
13935 slk_init \
13936 termattrs \
13937 tgetent \
13938 tigetnum \
13939 tigetstr \
13940 typeahead \
13941 use_default_colors \
13942 use_env \
13943 use_extended_names \
13944 use_screen \
13945 use_window \
13946 vid_puts \
13947 vidputs \
13948 vsscanf \
13949 vw_printw \
13950 wchgat \
13951 winsstr \
13952 wresize \
13953 wsyncdown \
13954
13955 do
13956
13957 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13958
13959         echo "$as_me:13959: checking for ${cf_func}" >&5
13960 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
13961
13962 echo "${as_me:-configure}:13962: testing ${cf_func} ..." 1>&5
13963
13964         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
13965   echo $ECHO_N "(cached) $ECHO_C" >&6
13966 else
13967
13968                 eval cf_result='$ac_cv_func_'$cf_func
13969                 if test ".$cf_result" != ".no"; then
13970                         cat >conftest.$ac_ext <<_ACEOF
13971 #line 13971 "configure"
13972 #include "confdefs.h"
13973
13974 #ifdef HAVE_XCURSES
13975 #include <xcurses.h>
13976 char * XCursesProgramName = "test";
13977 #else
13978 #include <${cf_cv_ncurses_header:-curses.h}>
13979 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13980 #include <ncursesw/term.h>
13981 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13982 #include <ncurses/term.h>
13983 #elif defined(HAVE_TERM_H)
13984 #include <term.h>
13985 #endif
13986 #endif
13987
13988 int
13989 main ()
13990 {
13991
13992 #ifndef ${cf_func}
13993 long foo = (long)(&${cf_func});
13994 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
13995 if (foo + 1234 > 5678)
13996         ${cf_cv_main_return:-return}(foo);
13997 #endif
13998
13999   ;
14000   return 0;
14001 }
14002 _ACEOF
14003 rm -f conftest.$ac_objext conftest$ac_exeext
14004 if { (eval echo "$as_me:14004: \"$ac_link\"") >&5
14005   (eval $ac_link) 2>&5
14006   ac_status=$?
14007   echo "$as_me:14007: \$? = $ac_status" >&5
14008   (exit $ac_status); } &&
14009          { ac_try='test -s conftest$ac_exeext'
14010   { (eval echo "$as_me:14010: \"$ac_try\"") >&5
14011   (eval $ac_try) 2>&5
14012   ac_status=$?
14013   echo "$as_me:14013: \$? = $ac_status" >&5
14014   (exit $ac_status); }; }; then
14015   cf_result=yes
14016 else
14017   echo "$as_me: failed program was:" >&5
14018 cat conftest.$ac_ext >&5
14019 cf_result=no
14020 fi
14021 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14022                 fi
14023                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14024
14025 fi
14026
14027         # use the computed/retrieved cache-value:
14028         eval 'cf_result=$cf_cv_func_'$cf_func
14029         echo "$as_me:14029: result: $cf_result" >&5
14030 echo "${ECHO_T}$cf_result" >&6
14031         if test $cf_result != no; then
14032                 cat >>confdefs.h <<EOF
14033 #define HAVE_${cf_tr_func} 1
14034 EOF
14035
14036         fi
14037 done
14038
14039 for cf_func in tputs
14040 do
14041
14042 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14043
14044         echo "$as_me:14044: checking for ${cf_func}" >&5
14045 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14046
14047 echo "${as_me:-configure}:14047: testing ${cf_func} ..." 1>&5
14048
14049         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14050   echo $ECHO_N "(cached) $ECHO_C" >&6
14051 else
14052
14053                 eval cf_result='$ac_cv_func_'$cf_func
14054                 if test ".$cf_result" != ".no"; then
14055                         cat >conftest.$ac_ext <<_ACEOF
14056 #line 14056 "configure"
14057 #include "confdefs.h"
14058
14059 #ifdef HAVE_XCURSES
14060 #include <xcurses.h>
14061 char * XCursesProgramName = "test";
14062 #else
14063 #include <${cf_cv_ncurses_header:-curses.h}>
14064 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14065 #include <ncursesw/term.h>
14066 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14067 #include <ncurses/term.h>
14068 #elif defined(HAVE_TERM_H)
14069 #include <term.h>
14070 #endif
14071 #endif
14072
14073 int
14074 main ()
14075 {
14076
14077 #ifndef ${cf_func}
14078 long foo = (long)(&${cf_func});
14079 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14080 if (foo + 1234 > 5678)
14081         ${cf_cv_main_return:-return}(foo);
14082 #endif
14083
14084   ;
14085   return 0;
14086 }
14087 _ACEOF
14088 rm -f conftest.$ac_objext conftest$ac_exeext
14089 if { (eval echo "$as_me:14089: \"$ac_link\"") >&5
14090   (eval $ac_link) 2>&5
14091   ac_status=$?
14092   echo "$as_me:14092: \$? = $ac_status" >&5
14093   (exit $ac_status); } &&
14094          { ac_try='test -s conftest$ac_exeext'
14095   { (eval echo "$as_me:14095: \"$ac_try\"") >&5
14096   (eval $ac_try) 2>&5
14097   ac_status=$?
14098   echo "$as_me:14098: \$? = $ac_status" >&5
14099   (exit $ac_status); }; }; then
14100   cf_result=yes
14101 else
14102   echo "$as_me: failed program was:" >&5
14103 cat conftest.$ac_ext >&5
14104 cf_result=no
14105 fi
14106 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14107                 fi
14108                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14109
14110 fi
14111
14112         # use the computed/retrieved cache-value:
14113         eval 'cf_result=$cf_cv_func_'$cf_func
14114         echo "$as_me:14114: result: $cf_result" >&5
14115 echo "${ECHO_T}$cf_result" >&6
14116         if test $cf_result != no; then
14117                 cat >>confdefs.h <<EOF
14118 #define HAVE_${cf_tr_func} 1
14119 EOF
14120
14121         fi
14122 done
14123
14124 if test x$cf_cv_func_tputs = xyes
14125 then
14126         cf_done=no
14127         for cf_arg in int char
14128         do
14129                 for cf_ret in int void
14130                 do
14131                         if test $cf_ret = void
14132                         then
14133                                 cf_return="/* nothing */"
14134                         else
14135                                 cf_return="return value"
14136                         fi
14137                         cat >conftest.$ac_ext <<_ACEOF
14138 #line 14138 "configure"
14139 #include "confdefs.h"
14140
14141 #include <${cf_cv_ncurses_header:-curses.h}>
14142 #include <$cf_cv_term_header>
14143
14144 static $cf_ret outc($cf_arg value) { $cf_return; }
14145
14146 int
14147 main ()
14148 {
14149
14150         tputs("hello", 0, outc);
14151         ${cf_cv_main_return:-return}(0);
14152
14153   ;
14154   return 0;
14155 }
14156 _ACEOF
14157 rm -f conftest.$ac_objext
14158 if { (eval echo "$as_me:14158: \"$ac_compile\"") >&5
14159   (eval $ac_compile) 2>&5
14160   ac_status=$?
14161   echo "$as_me:14161: \$? = $ac_status" >&5
14162   (exit $ac_status); } &&
14163          { ac_try='test -s conftest.$ac_objext'
14164   { (eval echo "$as_me:14164: \"$ac_try\"") >&5
14165   (eval $ac_try) 2>&5
14166   ac_status=$?
14167   echo "$as_me:14167: \$? = $ac_status" >&5
14168   (exit $ac_status); }; }; then
14169
14170                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14171
14172 echo "${as_me:-configure}:14172: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14173
14174                 cat >>confdefs.h <<EOF
14175 #define TPUTS_ARG               $cf_arg
14176 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14177 #define TPUTS_RETURN(value)     $cf_return
14178 EOF
14179                 cf_done=yes
14180                 break
14181
14182 else
14183   echo "$as_me: failed program was:" >&5
14184 cat conftest.$ac_ext >&5
14185 fi
14186 rm -f conftest.$ac_objext conftest.$ac_ext
14187                 done
14188                 test $cf_done = yes && break
14189         done
14190 fi
14191
14192 echo "$as_me:14192: checking for ncurses extended functions" >&5
14193 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14194 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14195   echo $ECHO_N "(cached) $ECHO_C" >&6
14196 else
14197
14198 cat >conftest.$ac_ext <<_ACEOF
14199 #line 14199 "configure"
14200 #include "confdefs.h"
14201
14202 #include <${cf_cv_ncurses_header:-curses.h}>
14203 int
14204 main ()
14205 {
14206
14207 int x = NCURSES_EXT_FUNCS
14208
14209   ;
14210   return 0;
14211 }
14212 _ACEOF
14213 rm -f conftest.$ac_objext
14214 if { (eval echo "$as_me:14214: \"$ac_compile\"") >&5
14215   (eval $ac_compile) 2>&5
14216   ac_status=$?
14217   echo "$as_me:14217: \$? = $ac_status" >&5
14218   (exit $ac_status); } &&
14219          { ac_try='test -s conftest.$ac_objext'
14220   { (eval echo "$as_me:14220: \"$ac_try\"") >&5
14221   (eval $ac_try) 2>&5
14222   ac_status=$?
14223   echo "$as_me:14223: \$? = $ac_status" >&5
14224   (exit $ac_status); }; }; then
14225   cf_cv_ncurses_ext_funcs=defined
14226 else
14227   echo "$as_me: failed program was:" >&5
14228 cat conftest.$ac_ext >&5
14229
14230 cat >conftest.$ac_ext <<_ACEOF
14231 #line 14231 "configure"
14232 #include "confdefs.h"
14233
14234 #include <${cf_cv_ncurses_header:-curses.h}>
14235 int
14236 main ()
14237 {
14238
14239         (void) assume_default_colors (0, 0);
14240         (void) curses_version ();
14241         (void) define_key (0, 0);
14242         (void) is_term_resized (0, 0);
14243         (void) key_defined (0);
14244         (void) keybound (0, 0);
14245         (void) keyok (0, 0);
14246         (void) resize_term (0, 0);
14247         (void) resizeterm (0, 0);
14248         (void) use_default_colors ();
14249         (void) use_extended_names (0);
14250         (void) wresize (0, 0, 0);
14251   ;
14252   return 0;
14253 }
14254 _ACEOF
14255 rm -f conftest.$ac_objext conftest$ac_exeext
14256 if { (eval echo "$as_me:14256: \"$ac_link\"") >&5
14257   (eval $ac_link) 2>&5
14258   ac_status=$?
14259   echo "$as_me:14259: \$? = $ac_status" >&5
14260   (exit $ac_status); } &&
14261          { ac_try='test -s conftest$ac_exeext'
14262   { (eval echo "$as_me:14262: \"$ac_try\"") >&5
14263   (eval $ac_try) 2>&5
14264   ac_status=$?
14265   echo "$as_me:14265: \$? = $ac_status" >&5
14266   (exit $ac_status); }; }; then
14267   cf_cv_ncurses_ext_funcs=yes
14268 else
14269   echo "$as_me: failed program was:" >&5
14270 cat conftest.$ac_ext >&5
14271 cf_cv_ncurses_ext_funcs=no
14272 fi
14273 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14274
14275 fi
14276 rm -f conftest.$ac_objext conftest.$ac_ext
14277
14278 fi
14279 echo "$as_me:14279: result: $cf_cv_ncurses_ext_funcs" >&5
14280 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14281 test "$cf_cv_ncurses_ext_funcs" = yes &&
14282 cat >>confdefs.h <<\EOF
14283 #define NCURSES_EXT_FUNCS 1
14284 EOF
14285
14286 if test "$cf_enable_widec" = yes
14287 then
14288         # workaround for systems with ncurses before 20111029, due to change of
14289         # feature test macro from _XPG5 to _XOPEN_SOURCE
14290         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14291         then
14292                 cf_define_xpg5=no
14293                 echo "$as_me:14293: checking if _XPG5 should be defined to enable wide-characters" >&5
14294 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14295
14296                 cat >conftest.$ac_ext <<_ACEOF
14297 #line 14297 "configure"
14298 #include "confdefs.h"
14299
14300 #include <${cf_cv_ncurses_header:-curses.h}>
14301 int
14302 main ()
14303 {
14304 int x = _XPG5
14305   ;
14306   return 0;
14307 }
14308 _ACEOF
14309 rm -f conftest.$ac_objext
14310 if { (eval echo "$as_me:14310: \"$ac_compile\"") >&5
14311   (eval $ac_compile) 2>&5
14312   ac_status=$?
14313   echo "$as_me:14313: \$? = $ac_status" >&5
14314   (exit $ac_status); } &&
14315          { ac_try='test -s conftest.$ac_objext'
14316   { (eval echo "$as_me:14316: \"$ac_try\"") >&5
14317   (eval $ac_try) 2>&5
14318   ac_status=$?
14319   echo "$as_me:14319: \$? = $ac_status" >&5
14320   (exit $ac_status); }; }; then
14321   :
14322 else
14323   echo "$as_me: failed program was:" >&5
14324 cat conftest.$ac_ext >&5
14325 cf_save_cppflags="$CPPFLAGS"
14326                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14327                          cat >conftest.$ac_ext <<_ACEOF
14328 #line 14328 "configure"
14329 #include "confdefs.h"
14330
14331 #include <${cf_cv_ncurses_header:-curses.h}>
14332 int
14333 main ()
14334 {
14335 int x = _XPG5
14336   ;
14337   return 0;
14338 }
14339 _ACEOF
14340 rm -f conftest.$ac_objext
14341 if { (eval echo "$as_me:14341: \"$ac_compile\"") >&5
14342   (eval $ac_compile) 2>&5
14343   ac_status=$?
14344   echo "$as_me:14344: \$? = $ac_status" >&5
14345   (exit $ac_status); } &&
14346          { ac_try='test -s conftest.$ac_objext'
14347   { (eval echo "$as_me:14347: \"$ac_try\"") >&5
14348   (eval $ac_try) 2>&5
14349   ac_status=$?
14350   echo "$as_me:14350: \$? = $ac_status" >&5
14351   (exit $ac_status); }; }; then
14352   cf_define_xpg5=yes
14353 else
14354   echo "$as_me: failed program was:" >&5
14355 cat conftest.$ac_ext >&5
14356 fi
14357 rm -f conftest.$ac_objext conftest.$ac_ext
14358                          CPPFLAGS="$cf_save_cppflags"
14359 fi
14360 rm -f conftest.$ac_objext conftest.$ac_ext
14361                 echo "$as_me:14361: result: $cf_define_xpg5" >&5
14362 echo "${ECHO_T}$cf_define_xpg5" >&6
14363
14364                 if test "$cf_define_xpg5" = yes
14365                 then
14366                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14367                 fi
14368         fi
14369
14370         echo "$as_me:14370: checking for wide-character functions" >&5
14371 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14372 if test "${cf_cv_widechar_funcs+set}" = set; then
14373   echo $ECHO_N "(cached) $ECHO_C" >&6
14374 else
14375
14376         cat >conftest.$ac_ext <<_ACEOF
14377 #line 14377 "configure"
14378 #include "confdefs.h"
14379
14380 #include <${cf_cv_ncurses_header:-curses.h}>
14381 int
14382 main ()
14383 {
14384
14385                 static wchar_t src_wchar[2];
14386                 static cchar_t dst_cchar;
14387                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
14388
14389   ;
14390   return 0;
14391 }
14392 _ACEOF
14393 rm -f conftest.$ac_objext conftest$ac_exeext
14394 if { (eval echo "$as_me:14394: \"$ac_link\"") >&5
14395   (eval $ac_link) 2>&5
14396   ac_status=$?
14397   echo "$as_me:14397: \$? = $ac_status" >&5
14398   (exit $ac_status); } &&
14399          { ac_try='test -s conftest$ac_exeext'
14400   { (eval echo "$as_me:14400: \"$ac_try\"") >&5
14401   (eval $ac_try) 2>&5
14402   ac_status=$?
14403   echo "$as_me:14403: \$? = $ac_status" >&5
14404   (exit $ac_status); }; }; then
14405   cf_cv_widechar_funcs=yes
14406 else
14407   echo "$as_me: failed program was:" >&5
14408 cat conftest.$ac_ext >&5
14409 cf_cv_widechar_funcs=no
14410 fi
14411 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14412
14413 fi
14414 echo "$as_me:14414: result: $cf_cv_widechar_funcs" >&5
14415 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
14416         if test "$cf_cv_widechar_funcs" != no ; then
14417
14418 cat >>confdefs.h <<\EOF
14419 #define USE_WIDEC_SUPPORT 1
14420 EOF
14421
14422         else
14423                 cat >>confdefs.h <<\EOF
14424 #define USE_WIDEC_SUPPORT 0
14425 EOF
14426
14427         fi
14428 else
14429         cat >>confdefs.h <<\EOF
14430 #define USE_WIDEC_SUPPORT 0
14431 EOF
14432
14433 fi
14434
14435 echo "$as_me:14435: checking if sys/time.h works with sys/select.h" >&5
14436 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
14437 if test "${cf_cv_sys_time_select+set}" = set; then
14438   echo $ECHO_N "(cached) $ECHO_C" >&6
14439 else
14440
14441 cat >conftest.$ac_ext <<_ACEOF
14442 #line 14442 "configure"
14443 #include "confdefs.h"
14444
14445 #include <sys/types.h>
14446 #ifdef HAVE_SYS_TIME_H
14447 #include <sys/time.h>
14448 #endif
14449 #ifdef HAVE_SYS_SELECT_H
14450 #include <sys/select.h>
14451 #endif
14452
14453 int
14454 main ()
14455 {
14456
14457   ;
14458   return 0;
14459 }
14460 _ACEOF
14461 rm -f conftest.$ac_objext
14462 if { (eval echo "$as_me:14462: \"$ac_compile\"") >&5
14463   (eval $ac_compile) 2>&5
14464   ac_status=$?
14465   echo "$as_me:14465: \$? = $ac_status" >&5
14466   (exit $ac_status); } &&
14467          { ac_try='test -s conftest.$ac_objext'
14468   { (eval echo "$as_me:14468: \"$ac_try\"") >&5
14469   (eval $ac_try) 2>&5
14470   ac_status=$?
14471   echo "$as_me:14471: \$? = $ac_status" >&5
14472   (exit $ac_status); }; }; then
14473   cf_cv_sys_time_select=yes
14474 else
14475   echo "$as_me: failed program was:" >&5
14476 cat conftest.$ac_ext >&5
14477 cf_cv_sys_time_select=no
14478 fi
14479 rm -f conftest.$ac_objext conftest.$ac_ext
14480
14481 fi
14482
14483 echo "$as_me:14483: result: $cf_cv_sys_time_select" >&5
14484 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
14485 test "$cf_cv_sys_time_select" = yes &&
14486 cat >>confdefs.h <<\EOF
14487 #define HAVE_SYS_TIME_SELECT 1
14488 EOF
14489
14490 echo "$as_me:14490: checking for function curses_version" >&5
14491 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
14492 if test "${cf_cv_func_curses_version+set}" = set; then
14493   echo $ECHO_N "(cached) $ECHO_C" >&6
14494 else
14495
14496 if test "$cross_compiling" = yes; then
14497   cf_cv_func_curses_version=unknown
14498 else
14499   cat >conftest.$ac_ext <<_ACEOF
14500 #line 14500 "configure"
14501 #include "confdefs.h"
14502
14503 #include <${cf_cv_ncurses_header:-curses.h}>
14504 int main()
14505 {
14506         char temp[1024];
14507         sprintf(temp, "%s\n", curses_version());
14508         ${cf_cv_main_return:-return}(0);
14509 }
14510
14511 _ACEOF
14512 rm -f conftest$ac_exeext
14513 if { (eval echo "$as_me:14513: \"$ac_link\"") >&5
14514   (eval $ac_link) 2>&5
14515   ac_status=$?
14516   echo "$as_me:14516: \$? = $ac_status" >&5
14517   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14518   { (eval echo "$as_me:14518: \"$ac_try\"") >&5
14519   (eval $ac_try) 2>&5
14520   ac_status=$?
14521   echo "$as_me:14521: \$? = $ac_status" >&5
14522   (exit $ac_status); }; }; then
14523   cf_cv_func_curses_version=yes
14524
14525 else
14526   echo "$as_me: program exited with status $ac_status" >&5
14527 echo "$as_me: failed program was:" >&5
14528 cat conftest.$ac_ext >&5
14529 cf_cv_func_curses_version=no
14530
14531 fi
14532 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14533 fi
14534 rm -f core
14535 fi
14536 echo "$as_me:14536: result: $cf_cv_func_curses_version" >&5
14537 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
14538 test "$cf_cv_func_curses_version" = yes &&
14539 cat >>confdefs.h <<\EOF
14540 #define HAVE_CURSES_VERSION 1
14541 EOF
14542
14543 echo "$as_me:14543: checking for alternate character set array" >&5
14544 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
14545 if test "${cf_cv_curses_acs_map+set}" = set; then
14546   echo $ECHO_N "(cached) $ECHO_C" >&6
14547 else
14548
14549 cf_cv_curses_acs_map=unknown
14550 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
14551 do
14552 cat >conftest.$ac_ext <<_ACEOF
14553 #line 14553 "configure"
14554 #include "confdefs.h"
14555
14556 #include <${cf_cv_ncurses_header:-curses.h}>
14557
14558 int
14559 main ()
14560 {
14561
14562 $name['k'] = ACS_PLUS
14563
14564   ;
14565   return 0;
14566 }
14567 _ACEOF
14568 rm -f conftest.$ac_objext conftest$ac_exeext
14569 if { (eval echo "$as_me:14569: \"$ac_link\"") >&5
14570   (eval $ac_link) 2>&5
14571   ac_status=$?
14572   echo "$as_me:14572: \$? = $ac_status" >&5
14573   (exit $ac_status); } &&
14574          { ac_try='test -s conftest$ac_exeext'
14575   { (eval echo "$as_me:14575: \"$ac_try\"") >&5
14576   (eval $ac_try) 2>&5
14577   ac_status=$?
14578   echo "$as_me:14578: \$? = $ac_status" >&5
14579   (exit $ac_status); }; }; then
14580   cf_cv_curses_acs_map=$name; break
14581 else
14582   echo "$as_me: failed program was:" >&5
14583 cat conftest.$ac_ext >&5
14584 fi
14585 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14586 done
14587
14588 fi
14589 echo "$as_me:14589: result: $cf_cv_curses_acs_map" >&5
14590 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
14591
14592 test "$cf_cv_curses_acs_map" != unknown &&
14593 cat >>confdefs.h <<EOF
14594 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
14595 EOF
14596
14597 if test "$cf_enable_widec" = yes; then
14598
14599 echo "$as_me:14599: checking for wide alternate character set array" >&5
14600 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
14601 if test "${cf_cv_curses_wacs_map+set}" = set; then
14602   echo $ECHO_N "(cached) $ECHO_C" >&6
14603 else
14604
14605         cf_cv_curses_wacs_map=unknown
14606         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
14607         do
14608         cat >conftest.$ac_ext <<_ACEOF
14609 #line 14609 "configure"
14610 #include "confdefs.h"
14611
14612 #ifndef _XOPEN_SOURCE_EXTENDED
14613 #define _XOPEN_SOURCE_EXTENDED
14614 #endif
14615 #include <${cf_cv_ncurses_header:-curses.h}>
14616 int
14617 main ()
14618 {
14619 void *foo = &($name['k'])
14620   ;
14621   return 0;
14622 }
14623 _ACEOF
14624 rm -f conftest.$ac_objext conftest$ac_exeext
14625 if { (eval echo "$as_me:14625: \"$ac_link\"") >&5
14626   (eval $ac_link) 2>&5
14627   ac_status=$?
14628   echo "$as_me:14628: \$? = $ac_status" >&5
14629   (exit $ac_status); } &&
14630          { ac_try='test -s conftest$ac_exeext'
14631   { (eval echo "$as_me:14631: \"$ac_try\"") >&5
14632   (eval $ac_try) 2>&5
14633   ac_status=$?
14634   echo "$as_me:14634: \$? = $ac_status" >&5
14635   (exit $ac_status); }; }; then
14636   cf_cv_curses_wacs_map=$name
14637          break
14638 else
14639   echo "$as_me: failed program was:" >&5
14640 cat conftest.$ac_ext >&5
14641 fi
14642 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14643         done
14644 fi
14645 echo "$as_me:14645: result: $cf_cv_curses_wacs_map" >&5
14646 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
14647
14648 test "$cf_cv_curses_wacs_map" != unknown &&
14649 cat >>confdefs.h <<EOF
14650 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
14651 EOF
14652
14653 echo "$as_me:14653: checking for wide alternate character constants" >&5
14654 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
14655 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
14656   echo $ECHO_N "(cached) $ECHO_C" >&6
14657 else
14658
14659 cf_cv_curses_wacs_symbols=no
14660 if test "$cf_cv_curses_wacs_map" != unknown
14661 then
14662         cat >conftest.$ac_ext <<_ACEOF
14663 #line 14663 "configure"
14664 #include "confdefs.h"
14665
14666 #ifndef _XOPEN_SOURCE_EXTENDED
14667 #define _XOPEN_SOURCE_EXTENDED
14668 #endif
14669 #include <${cf_cv_ncurses_header:-curses.h}>
14670 int
14671 main ()
14672 {
14673 cchar_t *foo = WACS_PLUS;
14674          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
14675   ;
14676   return 0;
14677 }
14678 _ACEOF
14679 rm -f conftest.$ac_objext conftest$ac_exeext
14680 if { (eval echo "$as_me:14680: \"$ac_link\"") >&5
14681   (eval $ac_link) 2>&5
14682   ac_status=$?
14683   echo "$as_me:14683: \$? = $ac_status" >&5
14684   (exit $ac_status); } &&
14685          { ac_try='test -s conftest$ac_exeext'
14686   { (eval echo "$as_me:14686: \"$ac_try\"") >&5
14687   (eval $ac_try) 2>&5
14688   ac_status=$?
14689   echo "$as_me:14689: \$? = $ac_status" >&5
14690   (exit $ac_status); }; }; then
14691   cf_cv_curses_wacs_symbols=yes
14692 else
14693   echo "$as_me: failed program was:" >&5
14694 cat conftest.$ac_ext >&5
14695 fi
14696 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14697 else
14698         cat >conftest.$ac_ext <<_ACEOF
14699 #line 14699 "configure"
14700 #include "confdefs.h"
14701
14702 #ifndef _XOPEN_SOURCE_EXTENDED
14703 #define _XOPEN_SOURCE_EXTENDED
14704 #endif
14705 #include <${cf_cv_ncurses_header:-curses.h}>
14706 int
14707 main ()
14708 {
14709 cchar_t *foo = WACS_PLUS
14710   ;
14711   return 0;
14712 }
14713 _ACEOF
14714 rm -f conftest.$ac_objext conftest$ac_exeext
14715 if { (eval echo "$as_me:14715: \"$ac_link\"") >&5
14716   (eval $ac_link) 2>&5
14717   ac_status=$?
14718   echo "$as_me:14718: \$? = $ac_status" >&5
14719   (exit $ac_status); } &&
14720          { ac_try='test -s conftest$ac_exeext'
14721   { (eval echo "$as_me:14721: \"$ac_try\"") >&5
14722   (eval $ac_try) 2>&5
14723   ac_status=$?
14724   echo "$as_me:14724: \$? = $ac_status" >&5
14725   (exit $ac_status); }; }; then
14726   cf_cv_curses_wacs_symbols=yes
14727 else
14728   echo "$as_me: failed program was:" >&5
14729 cat conftest.$ac_ext >&5
14730 fi
14731 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14732 fi
14733
14734 fi
14735 echo "$as_me:14735: result: $cf_cv_curses_wacs_symbols" >&5
14736 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
14737
14738 test "$cf_cv_curses_wacs_symbols" != no &&
14739 cat >>confdefs.h <<\EOF
14740 #define CURSES_WACS_SYMBOLS 1
14741 EOF
14742
14743 fi
14744
14745 echo "$as_me:14745: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14746 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14747 cat >conftest.$ac_ext <<_ACEOF
14748 #line 14748 "configure"
14749 #include "confdefs.h"
14750
14751 #ifndef _XOPEN_SOURCE_EXTENDED
14752 #define _XOPEN_SOURCE_EXTENDED
14753 #endif
14754 #include <${cf_cv_ncurses_header:-curses.h}>
14755 int
14756 main ()
14757 {
14758
14759 attr_t foo
14760
14761   ;
14762   return 0;
14763 }
14764 _ACEOF
14765 rm -f conftest.$ac_objext
14766 if { (eval echo "$as_me:14766: \"$ac_compile\"") >&5
14767   (eval $ac_compile) 2>&5
14768   ac_status=$?
14769   echo "$as_me:14769: \$? = $ac_status" >&5
14770   (exit $ac_status); } &&
14771          { ac_try='test -s conftest.$ac_objext'
14772   { (eval echo "$as_me:14772: \"$ac_try\"") >&5
14773   (eval $ac_try) 2>&5
14774   ac_status=$?
14775   echo "$as_me:14775: \$? = $ac_status" >&5
14776   (exit $ac_status); }; }; then
14777   cf_result=yes
14778 else
14779   echo "$as_me: failed program was:" >&5
14780 cat conftest.$ac_ext >&5
14781 cf_result=no
14782 fi
14783 rm -f conftest.$ac_objext conftest.$ac_ext
14784 echo "$as_me:14784: result: $cf_result" >&5
14785 echo "${ECHO_T}$cf_result" >&6
14786 if test $cf_result = yes ; then
14787
14788 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14789
14790 cat >>confdefs.h <<EOF
14791 #define $cf_result 1
14792 EOF
14793
14794 else
14795
14796 cat >>confdefs.h <<EOF
14797 #define attr_t long
14798 EOF
14799
14800 fi
14801
14802 if test "$cf_enable_widec" = yes; then
14803
14804 # This is needed on Tru64 5.0 to declare mbstate_t
14805 echo "$as_me:14805: checking if we must include wchar.h to declare mbstate_t" >&5
14806 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
14807 if test "${cf_cv_mbstate_t+set}" = set; then
14808   echo $ECHO_N "(cached) $ECHO_C" >&6
14809 else
14810
14811 cat >conftest.$ac_ext <<_ACEOF
14812 #line 14812 "configure"
14813 #include "confdefs.h"
14814
14815 #include <stdlib.h>
14816 #include <stdarg.h>
14817 #include <stdio.h>
14818 #ifdef HAVE_LIBUTF8_H
14819 #include <libutf8.h>
14820 #endif
14821 int
14822 main ()
14823 {
14824 mbstate_t state
14825   ;
14826   return 0;
14827 }
14828 _ACEOF
14829 rm -f conftest.$ac_objext
14830 if { (eval echo "$as_me:14830: \"$ac_compile\"") >&5
14831   (eval $ac_compile) 2>&5
14832   ac_status=$?
14833   echo "$as_me:14833: \$? = $ac_status" >&5
14834   (exit $ac_status); } &&
14835          { ac_try='test -s conftest.$ac_objext'
14836   { (eval echo "$as_me:14836: \"$ac_try\"") >&5
14837   (eval $ac_try) 2>&5
14838   ac_status=$?
14839   echo "$as_me:14839: \$? = $ac_status" >&5
14840   (exit $ac_status); }; }; then
14841   cf_cv_mbstate_t=no
14842 else
14843   echo "$as_me: failed program was:" >&5
14844 cat conftest.$ac_ext >&5
14845 cat >conftest.$ac_ext <<_ACEOF
14846 #line 14846 "configure"
14847 #include "confdefs.h"
14848
14849 #include <stdlib.h>
14850 #include <stdarg.h>
14851 #include <stdio.h>
14852 #include <wchar.h>
14853 #ifdef HAVE_LIBUTF8_H
14854 #include <libutf8.h>
14855 #endif
14856 int
14857 main ()
14858 {
14859 mbstate_t value
14860   ;
14861   return 0;
14862 }
14863 _ACEOF
14864 rm -f conftest.$ac_objext
14865 if { (eval echo "$as_me:14865: \"$ac_compile\"") >&5
14866   (eval $ac_compile) 2>&5
14867   ac_status=$?
14868   echo "$as_me:14868: \$? = $ac_status" >&5
14869   (exit $ac_status); } &&
14870          { ac_try='test -s conftest.$ac_objext'
14871   { (eval echo "$as_me:14871: \"$ac_try\"") >&5
14872   (eval $ac_try) 2>&5
14873   ac_status=$?
14874   echo "$as_me:14874: \$? = $ac_status" >&5
14875   (exit $ac_status); }; }; then
14876   cf_cv_mbstate_t=yes
14877 else
14878   echo "$as_me: failed program was:" >&5
14879 cat conftest.$ac_ext >&5
14880 cf_cv_mbstate_t=unknown
14881 fi
14882 rm -f conftest.$ac_objext conftest.$ac_ext
14883 fi
14884 rm -f conftest.$ac_objext conftest.$ac_ext
14885 fi
14886 echo "$as_me:14886: result: $cf_cv_mbstate_t" >&5
14887 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
14888
14889 if test "$cf_cv_mbstate_t" = yes ; then
14890
14891 cat >>confdefs.h <<\EOF
14892 #define NEED_WCHAR_H 1
14893 EOF
14894
14895         NEED_WCHAR_H=1
14896 fi
14897
14898 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
14899 if test "$cf_cv_mbstate_t" = unknown ; then
14900         NCURSES_MBSTATE_T=1
14901 fi
14902
14903 # if we find mbstate_t in either place, use substitution to provide a fallback.
14904 if test "$cf_cv_mbstate_t" != unknown ; then
14905         NCURSES_OK_MBSTATE_T=1
14906 fi
14907
14908 # This is needed on Tru64 5.0 to declare wchar_t
14909 echo "$as_me:14909: checking if we must include wchar.h to declare wchar_t" >&5
14910 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
14911 if test "${cf_cv_wchar_t+set}" = set; then
14912   echo $ECHO_N "(cached) $ECHO_C" >&6
14913 else
14914
14915 cat >conftest.$ac_ext <<_ACEOF
14916 #line 14916 "configure"
14917 #include "confdefs.h"
14918
14919 #include <stdlib.h>
14920 #include <stdarg.h>
14921 #include <stdio.h>
14922 #ifdef HAVE_LIBUTF8_H
14923 #include <libutf8.h>
14924 #endif
14925 int
14926 main ()
14927 {
14928 wchar_t state
14929   ;
14930   return 0;
14931 }
14932 _ACEOF
14933 rm -f conftest.$ac_objext
14934 if { (eval echo "$as_me:14934: \"$ac_compile\"") >&5
14935   (eval $ac_compile) 2>&5
14936   ac_status=$?
14937   echo "$as_me:14937: \$? = $ac_status" >&5
14938   (exit $ac_status); } &&
14939          { ac_try='test -s conftest.$ac_objext'
14940   { (eval echo "$as_me:14940: \"$ac_try\"") >&5
14941   (eval $ac_try) 2>&5
14942   ac_status=$?
14943   echo "$as_me:14943: \$? = $ac_status" >&5
14944   (exit $ac_status); }; }; then
14945   cf_cv_wchar_t=no
14946 else
14947   echo "$as_me: failed program was:" >&5
14948 cat conftest.$ac_ext >&5
14949 cat >conftest.$ac_ext <<_ACEOF
14950 #line 14950 "configure"
14951 #include "confdefs.h"
14952
14953 #include <stdlib.h>
14954 #include <stdarg.h>
14955 #include <stdio.h>
14956 #include <wchar.h>
14957 #ifdef HAVE_LIBUTF8_H
14958 #include <libutf8.h>
14959 #endif
14960 int
14961 main ()
14962 {
14963 wchar_t value
14964   ;
14965   return 0;
14966 }
14967 _ACEOF
14968 rm -f conftest.$ac_objext
14969 if { (eval echo "$as_me:14969: \"$ac_compile\"") >&5
14970   (eval $ac_compile) 2>&5
14971   ac_status=$?
14972   echo "$as_me:14972: \$? = $ac_status" >&5
14973   (exit $ac_status); } &&
14974          { ac_try='test -s conftest.$ac_objext'
14975   { (eval echo "$as_me:14975: \"$ac_try\"") >&5
14976   (eval $ac_try) 2>&5
14977   ac_status=$?
14978   echo "$as_me:14978: \$? = $ac_status" >&5
14979   (exit $ac_status); }; }; then
14980   cf_cv_wchar_t=yes
14981 else
14982   echo "$as_me: failed program was:" >&5
14983 cat conftest.$ac_ext >&5
14984 cf_cv_wchar_t=unknown
14985 fi
14986 rm -f conftest.$ac_objext conftest.$ac_ext
14987 fi
14988 rm -f conftest.$ac_objext conftest.$ac_ext
14989 fi
14990 echo "$as_me:14990: result: $cf_cv_wchar_t" >&5
14991 echo "${ECHO_T}$cf_cv_wchar_t" >&6
14992
14993 if test "$cf_cv_wchar_t" = yes ; then
14994
14995 cat >>confdefs.h <<\EOF
14996 #define NEED_WCHAR_H 1
14997 EOF
14998
14999         NEED_WCHAR_H=1
15000 fi
15001
15002 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15003 if test "$cf_cv_wchar_t" = unknown ; then
15004         NCURSES_WCHAR_T=1
15005 fi
15006
15007 # if we find wchar_t in either place, use substitution to provide a fallback.
15008 if test "$cf_cv_wchar_t" != unknown ; then
15009         NCURSES_OK_WCHAR_T=1
15010 fi
15011
15012 # This is needed on Tru64 5.0 to declare wint_t
15013 echo "$as_me:15013: checking if we must include wchar.h to declare wint_t" >&5
15014 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15015 if test "${cf_cv_wint_t+set}" = set; then
15016   echo $ECHO_N "(cached) $ECHO_C" >&6
15017 else
15018
15019 cat >conftest.$ac_ext <<_ACEOF
15020 #line 15020 "configure"
15021 #include "confdefs.h"
15022
15023 #include <stdlib.h>
15024 #include <stdarg.h>
15025 #include <stdio.h>
15026 #ifdef HAVE_LIBUTF8_H
15027 #include <libutf8.h>
15028 #endif
15029 int
15030 main ()
15031 {
15032 wint_t state
15033   ;
15034   return 0;
15035 }
15036 _ACEOF
15037 rm -f conftest.$ac_objext
15038 if { (eval echo "$as_me:15038: \"$ac_compile\"") >&5
15039   (eval $ac_compile) 2>&5
15040   ac_status=$?
15041   echo "$as_me:15041: \$? = $ac_status" >&5
15042   (exit $ac_status); } &&
15043          { ac_try='test -s conftest.$ac_objext'
15044   { (eval echo "$as_me:15044: \"$ac_try\"") >&5
15045   (eval $ac_try) 2>&5
15046   ac_status=$?
15047   echo "$as_me:15047: \$? = $ac_status" >&5
15048   (exit $ac_status); }; }; then
15049   cf_cv_wint_t=no
15050 else
15051   echo "$as_me: failed program was:" >&5
15052 cat conftest.$ac_ext >&5
15053 cat >conftest.$ac_ext <<_ACEOF
15054 #line 15054 "configure"
15055 #include "confdefs.h"
15056
15057 #include <stdlib.h>
15058 #include <stdarg.h>
15059 #include <stdio.h>
15060 #include <wchar.h>
15061 #ifdef HAVE_LIBUTF8_H
15062 #include <libutf8.h>
15063 #endif
15064 int
15065 main ()
15066 {
15067 wint_t value
15068   ;
15069   return 0;
15070 }
15071 _ACEOF
15072 rm -f conftest.$ac_objext
15073 if { (eval echo "$as_me:15073: \"$ac_compile\"") >&5
15074   (eval $ac_compile) 2>&5
15075   ac_status=$?
15076   echo "$as_me:15076: \$? = $ac_status" >&5
15077   (exit $ac_status); } &&
15078          { ac_try='test -s conftest.$ac_objext'
15079   { (eval echo "$as_me:15079: \"$ac_try\"") >&5
15080   (eval $ac_try) 2>&5
15081   ac_status=$?
15082   echo "$as_me:15082: \$? = $ac_status" >&5
15083   (exit $ac_status); }; }; then
15084   cf_cv_wint_t=yes
15085 else
15086   echo "$as_me: failed program was:" >&5
15087 cat conftest.$ac_ext >&5
15088 cf_cv_wint_t=unknown
15089 fi
15090 rm -f conftest.$ac_objext conftest.$ac_ext
15091 fi
15092 rm -f conftest.$ac_objext conftest.$ac_ext
15093 fi
15094 echo "$as_me:15094: result: $cf_cv_wint_t" >&5
15095 echo "${ECHO_T}$cf_cv_wint_t" >&6
15096
15097 if test "$cf_cv_wint_t" = yes ; then
15098
15099 cat >>confdefs.h <<\EOF
15100 #define NEED_WCHAR_H 1
15101 EOF
15102
15103         NEED_WCHAR_H=1
15104 fi
15105
15106 # if we do not find wint_t in either place, use substitution to provide a fallback.
15107 if test "$cf_cv_wint_t" = unknown ; then
15108         NCURSES_WINT_T=1
15109 fi
15110
15111 # if we find wint_t in either place, use substitution to provide a fallback.
15112 if test "$cf_cv_wint_t" != unknown ; then
15113         NCURSES_OK_WINT_T=1
15114 fi
15115
15116         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15117
15118 echo "$as_me:15118: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15119 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15120 cat >conftest.$ac_ext <<_ACEOF
15121 #line 15121 "configure"
15122 #include "confdefs.h"
15123
15124 #ifndef _XOPEN_SOURCE_EXTENDED
15125 #define _XOPEN_SOURCE_EXTENDED
15126 #endif
15127 #include <${cf_cv_ncurses_header:-curses.h}>
15128 int
15129 main ()
15130 {
15131
15132 mbstate_t foo
15133
15134   ;
15135   return 0;
15136 }
15137 _ACEOF
15138 rm -f conftest.$ac_objext
15139 if { (eval echo "$as_me:15139: \"$ac_compile\"") >&5
15140   (eval $ac_compile) 2>&5
15141   ac_status=$?
15142   echo "$as_me:15142: \$? = $ac_status" >&5
15143   (exit $ac_status); } &&
15144          { ac_try='test -s conftest.$ac_objext'
15145   { (eval echo "$as_me:15145: \"$ac_try\"") >&5
15146   (eval $ac_try) 2>&5
15147   ac_status=$?
15148   echo "$as_me:15148: \$? = $ac_status" >&5
15149   (exit $ac_status); }; }; then
15150   cf_result=yes
15151 else
15152   echo "$as_me: failed program was:" >&5
15153 cat conftest.$ac_ext >&5
15154 cf_result=no
15155 fi
15156 rm -f conftest.$ac_objext conftest.$ac_ext
15157 echo "$as_me:15157: result: $cf_result" >&5
15158 echo "${ECHO_T}$cf_result" >&6
15159 if test $cf_result = yes ; then
15160
15161 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15162
15163 cat >>confdefs.h <<EOF
15164 #define $cf_result 1
15165 EOF
15166
15167 else
15168
15169 cat >>confdefs.h <<EOF
15170 #define mbstate_t long
15171 EOF
15172
15173 fi
15174
15175         fi
15176
15177         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
15178
15179 echo "$as_me:15179: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15180 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15181 cat >conftest.$ac_ext <<_ACEOF
15182 #line 15182 "configure"
15183 #include "confdefs.h"
15184
15185 #ifndef _XOPEN_SOURCE_EXTENDED
15186 #define _XOPEN_SOURCE_EXTENDED
15187 #endif
15188 #include <${cf_cv_ncurses_header:-curses.h}>
15189 int
15190 main ()
15191 {
15192
15193 wchar_t foo
15194
15195   ;
15196   return 0;
15197 }
15198 _ACEOF
15199 rm -f conftest.$ac_objext
15200 if { (eval echo "$as_me:15200: \"$ac_compile\"") >&5
15201   (eval $ac_compile) 2>&5
15202   ac_status=$?
15203   echo "$as_me:15203: \$? = $ac_status" >&5
15204   (exit $ac_status); } &&
15205          { ac_try='test -s conftest.$ac_objext'
15206   { (eval echo "$as_me:15206: \"$ac_try\"") >&5
15207   (eval $ac_try) 2>&5
15208   ac_status=$?
15209   echo "$as_me:15209: \$? = $ac_status" >&5
15210   (exit $ac_status); }; }; then
15211   cf_result=yes
15212 else
15213   echo "$as_me: failed program was:" >&5
15214 cat conftest.$ac_ext >&5
15215 cf_result=no
15216 fi
15217 rm -f conftest.$ac_objext conftest.$ac_ext
15218 echo "$as_me:15218: result: $cf_result" >&5
15219 echo "${ECHO_T}$cf_result" >&6
15220 if test $cf_result = yes ; then
15221
15222 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15223
15224 cat >>confdefs.h <<EOF
15225 #define $cf_result 1
15226 EOF
15227
15228 else
15229
15230 cat >>confdefs.h <<EOF
15231 #define wchar_t long
15232 EOF
15233
15234 fi
15235
15236         fi
15237
15238         if test "$NCURSES_OK_WINT_T" = 0 ; then
15239
15240 echo "$as_me:15240: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15241 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15242 cat >conftest.$ac_ext <<_ACEOF
15243 #line 15243 "configure"
15244 #include "confdefs.h"
15245
15246 #ifndef _XOPEN_SOURCE_EXTENDED
15247 #define _XOPEN_SOURCE_EXTENDED
15248 #endif
15249 #include <${cf_cv_ncurses_header:-curses.h}>
15250 int
15251 main ()
15252 {
15253
15254 wint_t foo
15255
15256   ;
15257   return 0;
15258 }
15259 _ACEOF
15260 rm -f conftest.$ac_objext
15261 if { (eval echo "$as_me:15261: \"$ac_compile\"") >&5
15262   (eval $ac_compile) 2>&5
15263   ac_status=$?
15264   echo "$as_me:15264: \$? = $ac_status" >&5
15265   (exit $ac_status); } &&
15266          { ac_try='test -s conftest.$ac_objext'
15267   { (eval echo "$as_me:15267: \"$ac_try\"") >&5
15268   (eval $ac_try) 2>&5
15269   ac_status=$?
15270   echo "$as_me:15270: \$? = $ac_status" >&5
15271   (exit $ac_status); }; }; then
15272   cf_result=yes
15273 else
15274   echo "$as_me: failed program was:" >&5
15275 cat conftest.$ac_ext >&5
15276 cf_result=no
15277 fi
15278 rm -f conftest.$ac_objext conftest.$ac_ext
15279 echo "$as_me:15279: result: $cf_result" >&5
15280 echo "${ECHO_T}$cf_result" >&6
15281 if test $cf_result = yes ; then
15282
15283 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15284
15285 cat >>confdefs.h <<EOF
15286 #define $cf_result 1
15287 EOF
15288
15289 else
15290
15291 cat >>confdefs.h <<EOF
15292 #define wint_t long
15293 EOF
15294
15295 fi
15296
15297         fi
15298 fi
15299
15300 echo "$as_me:15300: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15301 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15302
15303 cat >conftest.$ac_ext <<_ACEOF
15304 #line 15304 "configure"
15305 #include "confdefs.h"
15306
15307 #ifdef HAVE_XCURSES
15308 #include <xcurses.h>
15309 char * XCursesProgramName = "test";
15310 #else
15311 #include <${cf_cv_ncurses_header:-curses.h}>
15312 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15313 #include <ncursesw/term.h>
15314 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15315 #include <ncurses/term.h>
15316 #elif defined(HAVE_TERM_H)
15317 #include <term.h>
15318 #endif
15319 #endif
15320
15321 int
15322 main ()
15323 {
15324
15325 void *foo = &(boolnames)
15326
15327   ;
15328   return 0;
15329 }
15330 _ACEOF
15331 rm -f conftest.$ac_objext
15332 if { (eval echo "$as_me:15332: \"$ac_compile\"") >&5
15333   (eval $ac_compile) 2>&5
15334   ac_status=$?
15335   echo "$as_me:15335: \$? = $ac_status" >&5
15336   (exit $ac_status); } &&
15337          { ac_try='test -s conftest.$ac_objext'
15338   { (eval echo "$as_me:15338: \"$ac_try\"") >&5
15339   (eval $ac_try) 2>&5
15340   ac_status=$?
15341   echo "$as_me:15341: \$? = $ac_status" >&5
15342   (exit $ac_status); }; }; then
15343   cf_result=yes
15344 else
15345   echo "$as_me: failed program was:" >&5
15346 cat conftest.$ac_ext >&5
15347 cf_result=no
15348 fi
15349 rm -f conftest.$ac_objext conftest.$ac_ext
15350 echo "$as_me:15350: result: $cf_result" >&5
15351 echo "${ECHO_T}$cf_result" >&6
15352
15353 if test $cf_result = yes ; then
15354
15355 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15356
15357         cat >>confdefs.h <<EOF
15358 #define $cf_result 1
15359 EOF
15360
15361 else
15362         echo "$as_me:15362: checking for data boolnames in library" >&5
15363 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
15364         # BSD linkers insist on making weak linkage, but resolve at runtime.
15365         if test "$cross_compiling" = yes; then
15366
15367         # cross-compiling
15368         cat >conftest.$ac_ext <<_ACEOF
15369 #line 15369 "configure"
15370 #include "confdefs.h"
15371
15372 #ifdef HAVE_XCURSES
15373 #include <xcurses.h>
15374 char * XCursesProgramName = "test";
15375 #else
15376 #include <${cf_cv_ncurses_header:-curses.h}>
15377 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15378 #include <ncursesw/term.h>
15379 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15380 #include <ncurses/term.h>
15381 #elif defined(HAVE_TERM_H)
15382 #include <term.h>
15383 #endif
15384 #endif
15385
15386 extern char boolnames;
15387 int
15388 main ()
15389 {
15390
15391         do {
15392                 void *foo = &(boolnames);
15393                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
15394                 ${cf_cv_main_return:-return}(foo == 0);
15395         } while (0)
15396
15397   ;
15398   return 0;
15399 }
15400 _ACEOF
15401 rm -f conftest.$ac_objext conftest$ac_exeext
15402 if { (eval echo "$as_me:15402: \"$ac_link\"") >&5
15403   (eval $ac_link) 2>&5
15404   ac_status=$?
15405   echo "$as_me:15405: \$? = $ac_status" >&5
15406   (exit $ac_status); } &&
15407          { ac_try='test -s conftest$ac_exeext'
15408   { (eval echo "$as_me:15408: \"$ac_try\"") >&5
15409   (eval $ac_try) 2>&5
15410   ac_status=$?
15411   echo "$as_me:15411: \$? = $ac_status" >&5
15412   (exit $ac_status); }; }; then
15413   cf_result=yes
15414 else
15415   echo "$as_me: failed program was:" >&5
15416 cat conftest.$ac_ext >&5
15417 cf_result=no
15418 fi
15419 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15420
15421 else
15422   cat >conftest.$ac_ext <<_ACEOF
15423 #line 15423 "configure"
15424 #include "confdefs.h"
15425
15426 #ifdef HAVE_XCURSES
15427 #include <xcurses.h>
15428 char * XCursesProgramName = "test";
15429 #else
15430 #include <${cf_cv_ncurses_header:-curses.h}>
15431 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15432 #include <ncursesw/term.h>
15433 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15434 #include <ncurses/term.h>
15435 #elif defined(HAVE_TERM_H)
15436 #include <term.h>
15437 #endif
15438 #endif
15439
15440 extern char boolnames;
15441 int main(void)
15442 {
15443         void *foo = &(boolnames);
15444         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
15445         ${cf_cv_main_return:-return}(foo == 0);
15446 }
15447 _ACEOF
15448 rm -f conftest$ac_exeext
15449 if { (eval echo "$as_me:15449: \"$ac_link\"") >&5
15450   (eval $ac_link) 2>&5
15451   ac_status=$?
15452   echo "$as_me:15452: \$? = $ac_status" >&5
15453   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15454   { (eval echo "$as_me:15454: \"$ac_try\"") >&5
15455   (eval $ac_try) 2>&5
15456   ac_status=$?
15457   echo "$as_me:15457: \$? = $ac_status" >&5
15458   (exit $ac_status); }; }; then
15459   cf_result=yes
15460 else
15461   echo "$as_me: program exited with status $ac_status" >&5
15462 echo "$as_me: failed program was:" >&5
15463 cat conftest.$ac_ext >&5
15464 cf_result=no
15465 fi
15466 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15467 fi
15468         echo "$as_me:15468: result: $cf_result" >&5
15469 echo "${ECHO_T}$cf_result" >&6
15470         if test $cf_result = yes ; then
15471
15472 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15473
15474                 cat >>confdefs.h <<EOF
15475 #define $cf_result 1
15476 EOF
15477
15478         fi
15479 fi
15480
15481 echo "$as_me:15481: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15482 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15483
15484 cat >conftest.$ac_ext <<_ACEOF
15485 #line 15485 "configure"
15486 #include "confdefs.h"
15487
15488 #ifdef HAVE_XCURSES
15489 #include <xcurses.h>
15490 char * XCursesProgramName = "test";
15491 #else
15492 #include <${cf_cv_ncurses_header:-curses.h}>
15493 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15494 #include <ncursesw/term.h>
15495 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15496 #include <ncurses/term.h>
15497 #elif defined(HAVE_TERM_H)
15498 #include <term.h>
15499 #endif
15500 #endif
15501
15502 int
15503 main ()
15504 {
15505
15506 void *foo = &(boolfnames)
15507
15508   ;
15509   return 0;
15510 }
15511 _ACEOF
15512 rm -f conftest.$ac_objext
15513 if { (eval echo "$as_me:15513: \"$ac_compile\"") >&5
15514   (eval $ac_compile) 2>&5
15515   ac_status=$?
15516   echo "$as_me:15516: \$? = $ac_status" >&5
15517   (exit $ac_status); } &&
15518          { ac_try='test -s conftest.$ac_objext'
15519   { (eval echo "$as_me:15519: \"$ac_try\"") >&5
15520   (eval $ac_try) 2>&5
15521   ac_status=$?
15522   echo "$as_me:15522: \$? = $ac_status" >&5
15523   (exit $ac_status); }; }; then
15524   cf_result=yes
15525 else
15526   echo "$as_me: failed program was:" >&5
15527 cat conftest.$ac_ext >&5
15528 cf_result=no
15529 fi
15530 rm -f conftest.$ac_objext conftest.$ac_ext
15531 echo "$as_me:15531: result: $cf_result" >&5
15532 echo "${ECHO_T}$cf_result" >&6
15533
15534 if test $cf_result = yes ; then
15535
15536 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15537
15538         cat >>confdefs.h <<EOF
15539 #define $cf_result 1
15540 EOF
15541
15542 else
15543         echo "$as_me:15543: checking for data boolfnames in library" >&5
15544 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
15545         # BSD linkers insist on making weak linkage, but resolve at runtime.
15546         if test "$cross_compiling" = yes; then
15547
15548         # cross-compiling
15549         cat >conftest.$ac_ext <<_ACEOF
15550 #line 15550 "configure"
15551 #include "confdefs.h"
15552
15553 #ifdef HAVE_XCURSES
15554 #include <xcurses.h>
15555 char * XCursesProgramName = "test";
15556 #else
15557 #include <${cf_cv_ncurses_header:-curses.h}>
15558 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15559 #include <ncursesw/term.h>
15560 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15561 #include <ncurses/term.h>
15562 #elif defined(HAVE_TERM_H)
15563 #include <term.h>
15564 #endif
15565 #endif
15566
15567 extern char boolfnames;
15568 int
15569 main ()
15570 {
15571
15572         do {
15573                 void *foo = &(boolfnames);
15574                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
15575                 ${cf_cv_main_return:-return}(foo == 0);
15576         } while (0)
15577
15578   ;
15579   return 0;
15580 }
15581 _ACEOF
15582 rm -f conftest.$ac_objext conftest$ac_exeext
15583 if { (eval echo "$as_me:15583: \"$ac_link\"") >&5
15584   (eval $ac_link) 2>&5
15585   ac_status=$?
15586   echo "$as_me:15586: \$? = $ac_status" >&5
15587   (exit $ac_status); } &&
15588          { ac_try='test -s conftest$ac_exeext'
15589   { (eval echo "$as_me:15589: \"$ac_try\"") >&5
15590   (eval $ac_try) 2>&5
15591   ac_status=$?
15592   echo "$as_me:15592: \$? = $ac_status" >&5
15593   (exit $ac_status); }; }; then
15594   cf_result=yes
15595 else
15596   echo "$as_me: failed program was:" >&5
15597 cat conftest.$ac_ext >&5
15598 cf_result=no
15599 fi
15600 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15601
15602 else
15603   cat >conftest.$ac_ext <<_ACEOF
15604 #line 15604 "configure"
15605 #include "confdefs.h"
15606
15607 #ifdef HAVE_XCURSES
15608 #include <xcurses.h>
15609 char * XCursesProgramName = "test";
15610 #else
15611 #include <${cf_cv_ncurses_header:-curses.h}>
15612 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15613 #include <ncursesw/term.h>
15614 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15615 #include <ncurses/term.h>
15616 #elif defined(HAVE_TERM_H)
15617 #include <term.h>
15618 #endif
15619 #endif
15620
15621 extern char boolfnames;
15622 int main(void)
15623 {
15624         void *foo = &(boolfnames);
15625         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
15626         ${cf_cv_main_return:-return}(foo == 0);
15627 }
15628 _ACEOF
15629 rm -f conftest$ac_exeext
15630 if { (eval echo "$as_me:15630: \"$ac_link\"") >&5
15631   (eval $ac_link) 2>&5
15632   ac_status=$?
15633   echo "$as_me:15633: \$? = $ac_status" >&5
15634   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15635   { (eval echo "$as_me:15635: \"$ac_try\"") >&5
15636   (eval $ac_try) 2>&5
15637   ac_status=$?
15638   echo "$as_me:15638: \$? = $ac_status" >&5
15639   (exit $ac_status); }; }; then
15640   cf_result=yes
15641 else
15642   echo "$as_me: program exited with status $ac_status" >&5
15643 echo "$as_me: failed program was:" >&5
15644 cat conftest.$ac_ext >&5
15645 cf_result=no
15646 fi
15647 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15648 fi
15649         echo "$as_me:15649: result: $cf_result" >&5
15650 echo "${ECHO_T}$cf_result" >&6
15651         if test $cf_result = yes ; then
15652
15653 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15654
15655                 cat >>confdefs.h <<EOF
15656 #define $cf_result 1
15657 EOF
15658
15659         fi
15660 fi
15661
15662 if ( test "$GCC" = yes || test "$GXX" = yes )
15663 then
15664 echo "$as_me:15664: checking if you want to turn on gcc warnings" >&5
15665 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15666
15667 # Check whether --enable-warnings or --disable-warnings was given.
15668 if test "${enable_warnings+set}" = set; then
15669   enableval="$enable_warnings"
15670   test "$enableval" != yes && enableval=no
15671   if test "$enableval" != "no" ; then
15672     with_warnings=yes
15673   else
15674     with_warnings=no
15675   fi
15676 else
15677   enableval=no
15678   with_warnings=no
15679
15680 fi;
15681 echo "$as_me:15681: result: $with_warnings" >&5
15682 echo "${ECHO_T}$with_warnings" >&6
15683 if test "$with_warnings" = "yes"
15684 then
15685
15686 if test "$GCC" = yes
15687 then
15688 cat > conftest.i <<EOF
15689 #ifndef GCC_PRINTF
15690 #define GCC_PRINTF 0
15691 #endif
15692 #ifndef GCC_SCANF
15693 #define GCC_SCANF 0
15694 #endif
15695 #ifndef GCC_NORETURN
15696 #define GCC_NORETURN /* nothing */
15697 #endif
15698 #ifndef GCC_UNUSED
15699 #define GCC_UNUSED /* nothing */
15700 #endif
15701 EOF
15702 if test "$GCC" = yes
15703 then
15704         { echo "$as_me:15704: checking for $CC __attribute__ directives..." >&5
15705 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15706 cat > conftest.$ac_ext <<EOF
15707 #line 15707 "${as_me:-configure}"
15708 #include "confdefs.h"
15709 #include "conftest.h"
15710 #include "conftest.i"
15711 #if     GCC_PRINTF
15712 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15713 #else
15714 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15715 #endif
15716 #if     GCC_SCANF
15717 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15718 #else
15719 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15720 #endif
15721 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15722 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
15723 extern void foo(void) GCC_NORETURN;
15724 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
15725 EOF
15726         cf_printf_attribute=no
15727         cf_scanf_attribute=no
15728         for cf_attribute in scanf printf unused noreturn
15729         do
15730
15731 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15732
15733                 cf_directive="__attribute__(($cf_attribute))"
15734                 echo "checking for $CC $cf_directive" 1>&5
15735
15736                 case $cf_attribute in
15737                 (printf)
15738                         cf_printf_attribute=yes
15739                         cat >conftest.h <<EOF
15740 #define GCC_$cf_ATTRIBUTE 1
15741 EOF
15742                         ;;
15743                 (scanf)
15744                         cf_scanf_attribute=yes
15745                         cat >conftest.h <<EOF
15746 #define GCC_$cf_ATTRIBUTE 1
15747 EOF
15748                         ;;
15749                 (*)
15750                         cat >conftest.h <<EOF
15751 #define GCC_$cf_ATTRIBUTE $cf_directive
15752 EOF
15753                         ;;
15754                 esac
15755
15756                 if { (eval echo "$as_me:15756: \"$ac_compile\"") >&5
15757   (eval $ac_compile) 2>&5
15758   ac_status=$?
15759   echo "$as_me:15759: \$? = $ac_status" >&5
15760   (exit $ac_status); }; then
15761                         test -n "$verbose" && echo "$as_me:15761: result: ... $cf_attribute" >&5
15762 echo "${ECHO_T}... $cf_attribute" >&6
15763                         cat conftest.h >>confdefs.h
15764                         case $cf_attribute in
15765                         (noreturn)
15766
15767 cat >>confdefs.h <<EOF
15768 #define GCC_NORETURN $cf_directive
15769 EOF
15770
15771                                 ;;
15772                         (printf)
15773                                 cf_value='/* nothing */'
15774                                 if test "$cf_printf_attribute" != no ; then
15775                                         cf_value='__attribute__((format(printf,fmt,var)))'
15776
15777 cat >>confdefs.h <<\EOF
15778 #define GCC_PRINTF 1
15779 EOF
15780
15781                                 fi
15782
15783 cat >>confdefs.h <<EOF
15784 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15785 EOF
15786
15787                                 ;;
15788                         (scanf)
15789                                 cf_value='/* nothing */'
15790                                 if test "$cf_scanf_attribute" != no ; then
15791                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15792
15793 cat >>confdefs.h <<\EOF
15794 #define GCC_SCANF 1
15795 EOF
15796
15797                                 fi
15798
15799 cat >>confdefs.h <<EOF
15800 #define GCC_SCANFLIKE(fmt,var) $cf_value
15801 EOF
15802
15803                                 ;;
15804                         (unused)
15805
15806 cat >>confdefs.h <<EOF
15807 #define GCC_UNUSED $cf_directive
15808 EOF
15809
15810                                 ;;
15811                         esac
15812                 fi
15813         done
15814 else
15815         fgrep define conftest.i >>confdefs.h
15816 fi
15817 rm -rf conftest*
15818 fi
15819
15820 INTEL_COMPILER=no
15821
15822 if test "$GCC" = yes ; then
15823         case $host_os in
15824         (linux*|gnu*)
15825                 echo "$as_me:15825: checking if this is really Intel C compiler" >&5
15826 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
15827                 cf_save_CFLAGS="$CFLAGS"
15828                 CFLAGS="$CFLAGS -no-gcc"
15829                 cat >conftest.$ac_ext <<_ACEOF
15830 #line 15830 "configure"
15831 #include "confdefs.h"
15832
15833 int
15834 main ()
15835 {
15836
15837 #ifdef __INTEL_COMPILER
15838 #else
15839 make an error
15840 #endif
15841
15842   ;
15843   return 0;
15844 }
15845 _ACEOF
15846 rm -f conftest.$ac_objext
15847 if { (eval echo "$as_me:15847: \"$ac_compile\"") >&5
15848   (eval $ac_compile) 2>&5
15849   ac_status=$?
15850   echo "$as_me:15850: \$? = $ac_status" >&5
15851   (exit $ac_status); } &&
15852          { ac_try='test -s conftest.$ac_objext'
15853   { (eval echo "$as_me:15853: \"$ac_try\"") >&5
15854   (eval $ac_try) 2>&5
15855   ac_status=$?
15856   echo "$as_me:15856: \$? = $ac_status" >&5
15857   (exit $ac_status); }; }; then
15858   INTEL_COMPILER=yes
15859 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
15860
15861 else
15862   echo "$as_me: failed program was:" >&5
15863 cat conftest.$ac_ext >&5
15864 fi
15865 rm -f conftest.$ac_objext conftest.$ac_ext
15866                 CFLAGS="$cf_save_CFLAGS"
15867                 echo "$as_me:15867: result: $INTEL_COMPILER" >&5
15868 echo "${ECHO_T}$INTEL_COMPILER" >&6
15869                 ;;
15870         esac
15871 fi
15872
15873 CLANG_COMPILER=no
15874
15875 if test "$GCC" = yes ; then
15876         echo "$as_me:15876: checking if this is really Clang C compiler" >&5
15877 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
15878         cf_save_CFLAGS="$CFLAGS"
15879         CFLAGS="$CFLAGS -Qunused-arguments"
15880         cat >conftest.$ac_ext <<_ACEOF
15881 #line 15881 "configure"
15882 #include "confdefs.h"
15883
15884 int
15885 main ()
15886 {
15887
15888 #ifdef __clang__
15889 #else
15890 make an error
15891 #endif
15892
15893   ;
15894   return 0;
15895 }
15896 _ACEOF
15897 rm -f conftest.$ac_objext
15898 if { (eval echo "$as_me:15898: \"$ac_compile\"") >&5
15899   (eval $ac_compile) 2>&5
15900   ac_status=$?
15901   echo "$as_me:15901: \$? = $ac_status" >&5
15902   (exit $ac_status); } &&
15903          { ac_try='test -s conftest.$ac_objext'
15904   { (eval echo "$as_me:15904: \"$ac_try\"") >&5
15905   (eval $ac_try) 2>&5
15906   ac_status=$?
15907   echo "$as_me:15907: \$? = $ac_status" >&5
15908   (exit $ac_status); }; }; then
15909   CLANG_COMPILER=yes
15910 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
15911
15912 else
15913   echo "$as_me: failed program was:" >&5
15914 cat conftest.$ac_ext >&5
15915 fi
15916 rm -f conftest.$ac_objext conftest.$ac_ext
15917         CFLAGS="$cf_save_CFLAGS"
15918         echo "$as_me:15918: result: $CLANG_COMPILER" >&5
15919 echo "${ECHO_T}$CLANG_COMPILER" >&6
15920 fi
15921
15922 cat > conftest.$ac_ext <<EOF
15923 #line 15923 "${as_me:-configure}"
15924 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15925 EOF
15926
15927 if test "$INTEL_COMPILER" = yes
15928 then
15929 # The "-wdXXX" options suppress warnings:
15930 # remark #1419: external declaration in primary source file
15931 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15932 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15933 # remark #193: zero used for undefined preprocessing identifier
15934 # remark #593: variable "curs_sb_left_arrow" was set but never used
15935 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15936 # remark #869: parameter "tw" was never referenced
15937 # remark #981: operands are evaluated in unspecified order
15938 # warning #279: controlling expression is constant
15939
15940         { echo "$as_me:15940: checking for $CC warning options..." >&5
15941 echo "$as_me: checking for $CC warning options..." >&6;}
15942         cf_save_CFLAGS="$CFLAGS"
15943         EXTRA_CFLAGS="-Wall"
15944         for cf_opt in \
15945                 wd1419 \
15946                 wd1683 \
15947                 wd1684 \
15948                 wd193 \
15949                 wd593 \
15950                 wd279 \
15951                 wd810 \
15952                 wd869 \
15953                 wd981
15954         do
15955                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15956                 if { (eval echo "$as_me:15956: \"$ac_compile\"") >&5
15957   (eval $ac_compile) 2>&5
15958   ac_status=$?
15959   echo "$as_me:15959: \$? = $ac_status" >&5
15960   (exit $ac_status); }; then
15961                         test -n "$verbose" && echo "$as_me:15961: result: ... -$cf_opt" >&5
15962 echo "${ECHO_T}... -$cf_opt" >&6
15963                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15964                 fi
15965         done
15966         CFLAGS="$cf_save_CFLAGS"
15967
15968 elif test "$GCC" = yes
15969 then
15970         { echo "$as_me:15970: checking for $CC warning options..." >&5
15971 echo "$as_me: checking for $CC warning options..." >&6;}
15972         cf_save_CFLAGS="$CFLAGS"
15973         EXTRA_CFLAGS=
15974         cf_warn_CONST=""
15975         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15976         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15977         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15978         for cf_opt in W Wall \
15979                 Wbad-function-cast \
15980                 Wcast-align \
15981                 Wcast-qual \
15982                 Wdeclaration-after-statement \
15983                 Wextra \
15984                 Winline \
15985                 Wmissing-declarations \
15986                 Wmissing-prototypes \
15987                 Wnested-externs \
15988                 Wpointer-arith \
15989                 Wshadow \
15990                 Wstrict-prototypes \
15991                 Wundef $cf_gcc_warnings $cf_warn_CONST
15992         do
15993                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15994                 if { (eval echo "$as_me:15994: \"$ac_compile\"") >&5
15995   (eval $ac_compile) 2>&5
15996   ac_status=$?
15997   echo "$as_me:15997: \$? = $ac_status" >&5
15998   (exit $ac_status); }; then
15999                         test -n "$verbose" && echo "$as_me:15999: result: ... -$cf_opt" >&5
16000 echo "${ECHO_T}... -$cf_opt" >&6
16001                         case $cf_opt in
16002                         (Wcast-qual)
16003                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
16004                                 ;;
16005                         (Winline)
16006                                 case $GCC_VERSION in
16007                                 ([34].*)
16008                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16009
16010 echo "${as_me:-configure}:16010: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16011
16012                                         continue;;
16013                                 esac
16014                                 ;;
16015                         (Wpointer-arith)
16016                                 case $GCC_VERSION in
16017                                 ([12].*)
16018                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16019
16020 echo "${as_me:-configure}:16020: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16021
16022                                         continue;;
16023                                 esac
16024                                 ;;
16025                         esac
16026                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16027                 fi
16028         done
16029         CFLAGS="$cf_save_CFLAGS"
16030 fi
16031 rm -rf conftest*
16032
16033 fi
16034 fi
16035
16036 echo "$as_me:16036: checking if you want to use dmalloc for testing" >&5
16037 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
16038
16039 # Check whether --with-dmalloc or --without-dmalloc was given.
16040 if test "${with_dmalloc+set}" = set; then
16041   withval="$with_dmalloc"
16042
16043 cat >>confdefs.h <<EOF
16044 #define USE_DMALLOC 1
16045 EOF
16046
16047         : ${with_cflags:=-g}
16048         : ${with_no_leaks:=yes}
16049          with_dmalloc=yes
16050 else
16051   with_dmalloc=
16052 fi;
16053 echo "$as_me:16053: result: ${with_dmalloc:-no}" >&5
16054 echo "${ECHO_T}${with_dmalloc:-no}" >&6
16055
16056 case .$with_cflags in
16057 (.*-g*)
16058         case .$CFLAGS in
16059         (.*-g*)
16060                 ;;
16061         (*)
16062
16063 cf_fix_cppflags=no
16064 cf_new_cflags=
16065 cf_new_cppflags=
16066 cf_new_extra_cppflags=
16067
16068 for cf_add_cflags in -g
16069 do
16070 case $cf_fix_cppflags in
16071 (no)
16072         case $cf_add_cflags in
16073         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16074                 case $cf_add_cflags in
16075                 (-D*)
16076                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16077
16078                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16079                                 && test -z "${cf_tst_cflags}" \
16080                                 && cf_fix_cppflags=yes
16081
16082                         if test $cf_fix_cppflags = yes ; then
16083                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16084                                 continue
16085                         elif test "${cf_tst_cflags}" = "\"'" ; then
16086                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16087                                 continue
16088                         fi
16089                         ;;
16090                 esac
16091                 case "$CPPFLAGS" in
16092                 (*$cf_add_cflags)
16093                         ;;
16094                 (*)
16095                         case $cf_add_cflags in
16096                         (-D*)
16097                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16098
16099 CPPFLAGS=`echo "$CPPFLAGS" | \
16100         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16101                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16102
16103                                 ;;
16104                         esac
16105                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16106                         ;;
16107                 esac
16108                 ;;
16109         (*)
16110                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16111                 ;;
16112         esac
16113         ;;
16114 (yes)
16115         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16116
16117         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16118
16119         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16120                 && test -z "${cf_tst_cflags}" \
16121                 && cf_fix_cppflags=no
16122         ;;
16123 esac
16124 done
16125
16126 if test -n "$cf_new_cflags" ; then
16127
16128         CFLAGS="$CFLAGS $cf_new_cflags"
16129 fi
16130
16131 if test -n "$cf_new_cppflags" ; then
16132
16133         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16134 fi
16135
16136 if test -n "$cf_new_extra_cppflags" ; then
16137
16138         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16139 fi
16140
16141                 ;;
16142         esac
16143         ;;
16144 esac
16145
16146 if test "$with_dmalloc" = yes ; then
16147         echo "$as_me:16147: checking for dmalloc.h" >&5
16148 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
16149 if test "${ac_cv_header_dmalloc_h+set}" = set; then
16150   echo $ECHO_N "(cached) $ECHO_C" >&6
16151 else
16152   cat >conftest.$ac_ext <<_ACEOF
16153 #line 16153 "configure"
16154 #include "confdefs.h"
16155 #include <dmalloc.h>
16156 _ACEOF
16157 if { (eval echo "$as_me:16157: \"$ac_cpp conftest.$ac_ext\"") >&5
16158   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16159   ac_status=$?
16160   egrep -v '^ *\+' conftest.er1 >conftest.err
16161   rm -f conftest.er1
16162   cat conftest.err >&5
16163   echo "$as_me:16163: \$? = $ac_status" >&5
16164   (exit $ac_status); } >/dev/null; then
16165   if test -s conftest.err; then
16166     ac_cpp_err=$ac_c_preproc_warn_flag
16167   else
16168     ac_cpp_err=
16169   fi
16170 else
16171   ac_cpp_err=yes
16172 fi
16173 if test -z "$ac_cpp_err"; then
16174   ac_cv_header_dmalloc_h=yes
16175 else
16176   echo "$as_me: failed program was:" >&5
16177   cat conftest.$ac_ext >&5
16178   ac_cv_header_dmalloc_h=no
16179 fi
16180 rm -f conftest.err conftest.$ac_ext
16181 fi
16182 echo "$as_me:16182: result: $ac_cv_header_dmalloc_h" >&5
16183 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
16184 if test $ac_cv_header_dmalloc_h = yes; then
16185
16186 echo "$as_me:16186: checking for dmalloc_debug in -ldmalloc" >&5
16187 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
16188 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
16189   echo $ECHO_N "(cached) $ECHO_C" >&6
16190 else
16191   ac_check_lib_save_LIBS=$LIBS
16192 LIBS="-ldmalloc  $LIBS"
16193 cat >conftest.$ac_ext <<_ACEOF
16194 #line 16194 "configure"
16195 #include "confdefs.h"
16196
16197 /* Override any gcc2 internal prototype to avoid an error.  */
16198 #ifdef __cplusplus
16199 extern "C"
16200 #endif
16201 /* We use char because int might match the return type of a gcc2
16202    builtin and then its argument prototype would still apply.  */
16203 char dmalloc_debug ();
16204 int
16205 main ()
16206 {
16207 dmalloc_debug ();
16208   ;
16209   return 0;
16210 }
16211 _ACEOF
16212 rm -f conftest.$ac_objext conftest$ac_exeext
16213 if { (eval echo "$as_me:16213: \"$ac_link\"") >&5
16214   (eval $ac_link) 2>&5
16215   ac_status=$?
16216   echo "$as_me:16216: \$? = $ac_status" >&5
16217   (exit $ac_status); } &&
16218          { ac_try='test -s conftest$ac_exeext'
16219   { (eval echo "$as_me:16219: \"$ac_try\"") >&5
16220   (eval $ac_try) 2>&5
16221   ac_status=$?
16222   echo "$as_me:16222: \$? = $ac_status" >&5
16223   (exit $ac_status); }; }; then
16224   ac_cv_lib_dmalloc_dmalloc_debug=yes
16225 else
16226   echo "$as_me: failed program was:" >&5
16227 cat conftest.$ac_ext >&5
16228 ac_cv_lib_dmalloc_dmalloc_debug=no
16229 fi
16230 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16231 LIBS=$ac_check_lib_save_LIBS
16232 fi
16233 echo "$as_me:16233: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
16234 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
16235 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
16236   cat >>confdefs.h <<EOF
16237 #define HAVE_LIBDMALLOC 1
16238 EOF
16239
16240   LIBS="-ldmalloc $LIBS"
16241
16242 fi
16243
16244 fi
16245
16246 fi
16247
16248 echo "$as_me:16248: checking if you want to use dbmalloc for testing" >&5
16249 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
16250
16251 # Check whether --with-dbmalloc or --without-dbmalloc was given.
16252 if test "${with_dbmalloc+set}" = set; then
16253   withval="$with_dbmalloc"
16254
16255 cat >>confdefs.h <<EOF
16256 #define USE_DBMALLOC 1
16257 EOF
16258
16259         : ${with_cflags:=-g}
16260         : ${with_no_leaks:=yes}
16261          with_dbmalloc=yes
16262 else
16263   with_dbmalloc=
16264 fi;
16265 echo "$as_me:16265: result: ${with_dbmalloc:-no}" >&5
16266 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
16267
16268 case .$with_cflags in
16269 (.*-g*)
16270         case .$CFLAGS in
16271         (.*-g*)
16272                 ;;
16273         (*)
16274
16275 cf_fix_cppflags=no
16276 cf_new_cflags=
16277 cf_new_cppflags=
16278 cf_new_extra_cppflags=
16279
16280 for cf_add_cflags in -g
16281 do
16282 case $cf_fix_cppflags in
16283 (no)
16284         case $cf_add_cflags in
16285         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16286                 case $cf_add_cflags in
16287                 (-D*)
16288                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16289
16290                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16291                                 && test -z "${cf_tst_cflags}" \
16292                                 && cf_fix_cppflags=yes
16293
16294                         if test $cf_fix_cppflags = yes ; then
16295                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16296                                 continue
16297                         elif test "${cf_tst_cflags}" = "\"'" ; then
16298                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16299                                 continue
16300                         fi
16301                         ;;
16302                 esac
16303                 case "$CPPFLAGS" in
16304                 (*$cf_add_cflags)
16305                         ;;
16306                 (*)
16307                         case $cf_add_cflags in
16308                         (-D*)
16309                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16310
16311 CPPFLAGS=`echo "$CPPFLAGS" | \
16312         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16313                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16314
16315                                 ;;
16316                         esac
16317                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16318                         ;;
16319                 esac
16320                 ;;
16321         (*)
16322                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16323                 ;;
16324         esac
16325         ;;
16326 (yes)
16327         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16328
16329         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16330
16331         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16332                 && test -z "${cf_tst_cflags}" \
16333                 && cf_fix_cppflags=no
16334         ;;
16335 esac
16336 done
16337
16338 if test -n "$cf_new_cflags" ; then
16339
16340         CFLAGS="$CFLAGS $cf_new_cflags"
16341 fi
16342
16343 if test -n "$cf_new_cppflags" ; then
16344
16345         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16346 fi
16347
16348 if test -n "$cf_new_extra_cppflags" ; then
16349
16350         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16351 fi
16352
16353                 ;;
16354         esac
16355         ;;
16356 esac
16357
16358 if test "$with_dbmalloc" = yes ; then
16359         echo "$as_me:16359: checking for dbmalloc.h" >&5
16360 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
16361 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
16362   echo $ECHO_N "(cached) $ECHO_C" >&6
16363 else
16364   cat >conftest.$ac_ext <<_ACEOF
16365 #line 16365 "configure"
16366 #include "confdefs.h"
16367 #include <dbmalloc.h>
16368 _ACEOF
16369 if { (eval echo "$as_me:16369: \"$ac_cpp conftest.$ac_ext\"") >&5
16370   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16371   ac_status=$?
16372   egrep -v '^ *\+' conftest.er1 >conftest.err
16373   rm -f conftest.er1
16374   cat conftest.err >&5
16375   echo "$as_me:16375: \$? = $ac_status" >&5
16376   (exit $ac_status); } >/dev/null; then
16377   if test -s conftest.err; then
16378     ac_cpp_err=$ac_c_preproc_warn_flag
16379   else
16380     ac_cpp_err=
16381   fi
16382 else
16383   ac_cpp_err=yes
16384 fi
16385 if test -z "$ac_cpp_err"; then
16386   ac_cv_header_dbmalloc_h=yes
16387 else
16388   echo "$as_me: failed program was:" >&5
16389   cat conftest.$ac_ext >&5
16390   ac_cv_header_dbmalloc_h=no
16391 fi
16392 rm -f conftest.err conftest.$ac_ext
16393 fi
16394 echo "$as_me:16394: result: $ac_cv_header_dbmalloc_h" >&5
16395 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
16396 if test $ac_cv_header_dbmalloc_h = yes; then
16397
16398 echo "$as_me:16398: checking for debug_malloc in -ldbmalloc" >&5
16399 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
16400 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
16401   echo $ECHO_N "(cached) $ECHO_C" >&6
16402 else
16403   ac_check_lib_save_LIBS=$LIBS
16404 LIBS="-ldbmalloc  $LIBS"
16405 cat >conftest.$ac_ext <<_ACEOF
16406 #line 16406 "configure"
16407 #include "confdefs.h"
16408
16409 /* Override any gcc2 internal prototype to avoid an error.  */
16410 #ifdef __cplusplus
16411 extern "C"
16412 #endif
16413 /* We use char because int might match the return type of a gcc2
16414    builtin and then its argument prototype would still apply.  */
16415 char debug_malloc ();
16416 int
16417 main ()
16418 {
16419 debug_malloc ();
16420   ;
16421   return 0;
16422 }
16423 _ACEOF
16424 rm -f conftest.$ac_objext conftest$ac_exeext
16425 if { (eval echo "$as_me:16425: \"$ac_link\"") >&5
16426   (eval $ac_link) 2>&5
16427   ac_status=$?
16428   echo "$as_me:16428: \$? = $ac_status" >&5
16429   (exit $ac_status); } &&
16430          { ac_try='test -s conftest$ac_exeext'
16431   { (eval echo "$as_me:16431: \"$ac_try\"") >&5
16432   (eval $ac_try) 2>&5
16433   ac_status=$?
16434   echo "$as_me:16434: \$? = $ac_status" >&5
16435   (exit $ac_status); }; }; then
16436   ac_cv_lib_dbmalloc_debug_malloc=yes
16437 else
16438   echo "$as_me: failed program was:" >&5
16439 cat conftest.$ac_ext >&5
16440 ac_cv_lib_dbmalloc_debug_malloc=no
16441 fi
16442 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16443 LIBS=$ac_check_lib_save_LIBS
16444 fi
16445 echo "$as_me:16445: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
16446 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
16447 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
16448   cat >>confdefs.h <<EOF
16449 #define HAVE_LIBDBMALLOC 1
16450 EOF
16451
16452   LIBS="-ldbmalloc $LIBS"
16453
16454 fi
16455
16456 fi
16457
16458 fi
16459
16460 echo "$as_me:16460: checking if you want to use valgrind for testing" >&5
16461 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
16462
16463 # Check whether --with-valgrind or --without-valgrind was given.
16464 if test "${with_valgrind+set}" = set; then
16465   withval="$with_valgrind"
16466
16467 cat >>confdefs.h <<EOF
16468 #define USE_VALGRIND 1
16469 EOF
16470
16471         : ${with_cflags:=-g}
16472         : ${with_no_leaks:=yes}
16473          with_valgrind=yes
16474 else
16475   with_valgrind=
16476 fi;
16477 echo "$as_me:16477: result: ${with_valgrind:-no}" >&5
16478 echo "${ECHO_T}${with_valgrind:-no}" >&6
16479
16480 case .$with_cflags in
16481 (.*-g*)
16482         case .$CFLAGS in
16483         (.*-g*)
16484                 ;;
16485         (*)
16486
16487 cf_fix_cppflags=no
16488 cf_new_cflags=
16489 cf_new_cppflags=
16490 cf_new_extra_cppflags=
16491
16492 for cf_add_cflags in -g
16493 do
16494 case $cf_fix_cppflags in
16495 (no)
16496         case $cf_add_cflags in
16497         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16498                 case $cf_add_cflags in
16499                 (-D*)
16500                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16501
16502                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16503                                 && test -z "${cf_tst_cflags}" \
16504                                 && cf_fix_cppflags=yes
16505
16506                         if test $cf_fix_cppflags = yes ; then
16507                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16508                                 continue
16509                         elif test "${cf_tst_cflags}" = "\"'" ; then
16510                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16511                                 continue
16512                         fi
16513                         ;;
16514                 esac
16515                 case "$CPPFLAGS" in
16516                 (*$cf_add_cflags)
16517                         ;;
16518                 (*)
16519                         case $cf_add_cflags in
16520                         (-D*)
16521                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16522
16523 CPPFLAGS=`echo "$CPPFLAGS" | \
16524         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16525                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16526
16527                                 ;;
16528                         esac
16529                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16530                         ;;
16531                 esac
16532                 ;;
16533         (*)
16534                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16535                 ;;
16536         esac
16537         ;;
16538 (yes)
16539         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16540
16541         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16542
16543         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16544                 && test -z "${cf_tst_cflags}" \
16545                 && cf_fix_cppflags=no
16546         ;;
16547 esac
16548 done
16549
16550 if test -n "$cf_new_cflags" ; then
16551
16552         CFLAGS="$CFLAGS $cf_new_cflags"
16553 fi
16554
16555 if test -n "$cf_new_cppflags" ; then
16556
16557         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16558 fi
16559
16560 if test -n "$cf_new_extra_cppflags" ; then
16561
16562         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16563 fi
16564
16565                 ;;
16566         esac
16567         ;;
16568 esac
16569
16570 echo "$as_me:16570: checking if you want to perform memory-leak testing" >&5
16571 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
16572
16573 # Check whether --enable-leaks or --disable-leaks was given.
16574 if test "${enable_leaks+set}" = set; then
16575   enableval="$enable_leaks"
16576   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
16577 else
16578   : ${with_no_leaks:=no}
16579 fi;
16580 echo "$as_me:16580: result: $with_no_leaks" >&5
16581 echo "${ECHO_T}$with_no_leaks" >&6
16582
16583 if test "$with_no_leaks" = yes ; then
16584
16585 cat >>confdefs.h <<\EOF
16586 #define NO_LEAKS 1
16587 EOF
16588
16589 cat >>confdefs.h <<\EOF
16590 #define YY_NO_LEAKS 1
16591 EOF
16592
16593 fi
16594
16595 LD_RPATH_OPT=
16596 echo "$as_me:16596: checking for an rpath option" >&5
16597 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
16598 case $cf_cv_system_name in
16599 (irix*)
16600         if test "$GCC" = yes; then
16601                 LD_RPATH_OPT="-Wl,-rpath,"
16602         else
16603                 LD_RPATH_OPT="-rpath "
16604         fi
16605         ;;
16606 (linux*|gnu*|k*bsd*-gnu)
16607         LD_RPATH_OPT="-Wl,-rpath,"
16608         ;;
16609 (openbsd[2-9].*|mirbsd*)
16610         LD_RPATH_OPT="-Wl,-rpath,"
16611         ;;
16612 (dragonfly*|freebsd*)
16613         LD_RPATH_OPT="-rpath "
16614         ;;
16615 (netbsd*)
16616         LD_RPATH_OPT="-Wl,-rpath,"
16617         ;;
16618 (osf*|mls+*)
16619         LD_RPATH_OPT="-rpath "
16620         ;;
16621 (solaris2*)
16622         LD_RPATH_OPT="-R"
16623         ;;
16624 (*)
16625         ;;
16626 esac
16627 echo "$as_me:16627: result: $LD_RPATH_OPT" >&5
16628 echo "${ECHO_T}$LD_RPATH_OPT" >&6
16629
16630 case "x$LD_RPATH_OPT" in
16631 (x-R*)
16632         echo "$as_me:16632: checking if we need a space after rpath option" >&5
16633 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
16634         cf_save_LIBS="$LIBS"
16635
16636 cf_add_libs="${LD_RPATH_OPT}$libdir"
16637 # Filter out duplicates - this happens with badly-designed ".pc" files...
16638 for cf_add_1lib in $LIBS
16639 do
16640         for cf_add_2lib in $cf_add_libs
16641         do
16642                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16643                 then
16644                         cf_add_1lib=
16645                         break
16646                 fi
16647         done
16648         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16649 done
16650 LIBS="$cf_add_libs"
16651
16652         cat >conftest.$ac_ext <<_ACEOF
16653 #line 16653 "configure"
16654 #include "confdefs.h"
16655
16656 int
16657 main ()
16658 {
16659
16660   ;
16661   return 0;
16662 }
16663 _ACEOF
16664 rm -f conftest.$ac_objext conftest$ac_exeext
16665 if { (eval echo "$as_me:16665: \"$ac_link\"") >&5
16666   (eval $ac_link) 2>&5
16667   ac_status=$?
16668   echo "$as_me:16668: \$? = $ac_status" >&5
16669   (exit $ac_status); } &&
16670          { ac_try='test -s conftest$ac_exeext'
16671   { (eval echo "$as_me:16671: \"$ac_try\"") >&5
16672   (eval $ac_try) 2>&5
16673   ac_status=$?
16674   echo "$as_me:16674: \$? = $ac_status" >&5
16675   (exit $ac_status); }; }; then
16676   cf_rpath_space=no
16677 else
16678   echo "$as_me: failed program was:" >&5
16679 cat conftest.$ac_ext >&5
16680 cf_rpath_space=yes
16681 fi
16682 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16683         LIBS="$cf_save_LIBS"
16684         echo "$as_me:16684: result: $cf_rpath_space" >&5
16685 echo "${ECHO_T}$cf_rpath_space" >&6
16686         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
16687         ;;
16688 esac
16689
16690 echo "$as_me:16690: checking if rpath-hack should be disabled" >&5
16691 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
16692
16693 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
16694 if test "${enable_rpath_hack+set}" = set; then
16695   enableval="$enable_rpath_hack"
16696   test "$enableval" != no && enableval=yes
16697   if test "$enableval" != "yes" ; then
16698     cf_disable_rpath_hack=yes
16699   else
16700     cf_disable_rpath_hack=no
16701   fi
16702 else
16703   enableval=yes
16704   cf_disable_rpath_hack=no
16705
16706 fi;
16707 echo "$as_me:16707: result: $cf_disable_rpath_hack" >&5
16708 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
16709 if test "$cf_disable_rpath_hack" = no ; then
16710
16711 echo "$as_me:16711: checking for updated LDFLAGS" >&5
16712 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
16713 if test -n "$LD_RPATH_OPT" ; then
16714         echo "$as_me:16714: result: maybe" >&5
16715 echo "${ECHO_T}maybe" >&6
16716
16717         for ac_prog in ldd
16718 do
16719   # Extract the first word of "$ac_prog", so it can be a program name with args.
16720 set dummy $ac_prog; ac_word=$2
16721 echo "$as_me:16721: checking for $ac_word" >&5
16722 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16723 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
16724   echo $ECHO_N "(cached) $ECHO_C" >&6
16725 else
16726   if test -n "$cf_ldd_prog"; then
16727   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
16728 else
16729   ac_save_IFS=$IFS; IFS=$ac_path_separator
16730 ac_dummy="$PATH"
16731 for ac_dir in $ac_dummy; do
16732   IFS=$ac_save_IFS
16733   test -z "$ac_dir" && ac_dir=.
16734   $as_executable_p "$ac_dir/$ac_word" || continue
16735 ac_cv_prog_cf_ldd_prog="$ac_prog"
16736 echo "$as_me:16736: found $ac_dir/$ac_word" >&5
16737 break
16738 done
16739
16740 fi
16741 fi
16742 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
16743 if test -n "$cf_ldd_prog"; then
16744   echo "$as_me:16744: result: $cf_ldd_prog" >&5
16745 echo "${ECHO_T}$cf_ldd_prog" >&6
16746 else
16747   echo "$as_me:16747: result: no" >&5
16748 echo "${ECHO_T}no" >&6
16749 fi
16750
16751   test -n "$cf_ldd_prog" && break
16752 done
16753 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
16754
16755         cf_rpath_list="/usr/lib /lib"
16756         if test "$cf_ldd_prog" != no
16757         then
16758                 cf_rpath_oops=
16759
16760 cat >conftest.$ac_ext <<_ACEOF
16761 #line 16761 "configure"
16762 #include "confdefs.h"
16763 #include <stdio.h>
16764 int
16765 main ()
16766 {
16767 printf("Hello");
16768   ;
16769   return 0;
16770 }
16771 _ACEOF
16772 rm -f conftest.$ac_objext conftest$ac_exeext
16773 if { (eval echo "$as_me:16773: \"$ac_link\"") >&5
16774   (eval $ac_link) 2>&5
16775   ac_status=$?
16776   echo "$as_me:16776: \$? = $ac_status" >&5
16777   (exit $ac_status); } &&
16778          { ac_try='test -s conftest$ac_exeext'
16779   { (eval echo "$as_me:16779: \"$ac_try\"") >&5
16780   (eval $ac_try) 2>&5
16781   ac_status=$?
16782   echo "$as_me:16782: \$? = $ac_status" >&5
16783   (exit $ac_status); }; }; then
16784   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
16785                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
16786 else
16787   echo "$as_me: failed program was:" >&5
16788 cat conftest.$ac_ext >&5
16789 fi
16790 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16791
16792                 # If we passed the link-test, but get a "not found" on a given library,
16793                 # this could be due to inept reconfiguration of gcc to make it only
16794                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
16795                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
16796                 # /usr/local libraries.
16797                 if test -n "$cf_rpath_oops"
16798                 then
16799                         for cf_rpath_src in $cf_rpath_oops
16800                         do
16801                                 for cf_rpath_dir in \
16802                                         /usr/local \
16803                                         /usr/pkg \
16804                                         /opt/sfw
16805                                 do
16806                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
16807                                         then
16808                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
16809
16810 echo "${as_me:-configure}:16810: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
16811
16812                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
16813                                                 break
16814                                         fi
16815                                 done
16816                         done
16817                 fi
16818         fi
16819
16820         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16821
16822 echo "${as_me:-configure}:16822: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16823
16824 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
16825
16826 echo "${as_me:-configure}:16826: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
16827
16828 cf_rpath_dst=
16829 for cf_rpath_src in $LDFLAGS
16830 do
16831         case $cf_rpath_src in
16832         (-L*)
16833
16834                 # check if this refers to a directory which we will ignore
16835                 cf_rpath_skip=no
16836                 if test -n "$cf_rpath_list"
16837                 then
16838                         for cf_rpath_item in $cf_rpath_list
16839                         do
16840                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16841                                 then
16842                                         cf_rpath_skip=yes
16843                                         break
16844                                 fi
16845                         done
16846                 fi
16847
16848                 if test "$cf_rpath_skip" = no
16849                 then
16850                         # transform the option
16851                         if test "$LD_RPATH_OPT" = "-R " ; then
16852                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16853                         else
16854                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16855                         fi
16856
16857                         # if we have not already added this, add it now
16858                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16859                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16860                         then
16861                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16862
16863 echo "${as_me:-configure}:16863: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16864
16865                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16866                         fi
16867                 fi
16868                 ;;
16869         esac
16870         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16871 done
16872 LDFLAGS=$cf_rpath_dst
16873
16874 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
16875
16876 echo "${as_me:-configure}:16876: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
16877
16878 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
16879
16880 echo "${as_me:-configure}:16880: testing ...checking LIBS $LIBS ..." 1>&5
16881
16882 cf_rpath_dst=
16883 for cf_rpath_src in $LIBS
16884 do
16885         case $cf_rpath_src in
16886         (-L*)
16887
16888                 # check if this refers to a directory which we will ignore
16889                 cf_rpath_skip=no
16890                 if test -n "$cf_rpath_list"
16891                 then
16892                         for cf_rpath_item in $cf_rpath_list
16893                         do
16894                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16895                                 then
16896                                         cf_rpath_skip=yes
16897                                         break
16898                                 fi
16899                         done
16900                 fi
16901
16902                 if test "$cf_rpath_skip" = no
16903                 then
16904                         # transform the option
16905                         if test "$LD_RPATH_OPT" = "-R " ; then
16906                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16907                         else
16908                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16909                         fi
16910
16911                         # if we have not already added this, add it now
16912                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16913                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16914                         then
16915                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16916
16917 echo "${as_me:-configure}:16917: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16918
16919                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16920                         fi
16921                 fi
16922                 ;;
16923         esac
16924         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16925 done
16926 LIBS=$cf_rpath_dst
16927
16928 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
16929
16930 echo "${as_me:-configure}:16930: testing ...checked LIBS $LIBS ..." 1>&5
16931
16932         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16933
16934 echo "${as_me:-configure}:16934: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16935
16936 else
16937         echo "$as_me:16937: result: no" >&5
16938 echo "${ECHO_T}no" >&6
16939 fi
16940
16941 fi
16942
16943 TEST_ARGS="$LIBS"
16944 LIBS=
16945
16946 ac_config_files="$ac_config_files Makefile"
16947 ac_config_commands="$ac_config_commands default"
16948 cat >confcache <<\_ACEOF
16949 # This file is a shell script that caches the results of configure
16950 # tests run on this system so they can be shared between configure
16951 # scripts and configure runs, see configure's option --config-cache.
16952 # It is not useful on other systems.  If it contains results you don't
16953 # want to keep, you may remove or edit it.
16954 #
16955 # config.status only pays attention to the cache file if you give it
16956 # the --recheck option to rerun configure.
16957 #
16958 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16959 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16960 # following values.
16961
16962 _ACEOF
16963
16964 # The following way of writing the cache mishandles newlines in values,
16965 # but we know of no workaround that is simple, portable, and efficient.
16966 # So, don't put newlines in cache variables' values.
16967 # Ultrix sh set writes to stderr and can't be redirected directly,
16968 # and sets the high bit in the cache file unless we assign to the vars.
16969 {
16970   (set) 2>&1 |
16971     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16972     *ac_space=\ *)
16973       # `set' does not quote correctly, so add quotes (double-quote
16974       # substitution turns \\\\ into \\, and sed turns \\ into \).
16975       sed -n \
16976         "s/'/'\\\\''/g;
16977           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16978       ;;
16979     *)
16980       # `set' quotes correctly as required by POSIX, so do not add quotes.
16981       sed -n \
16982         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16983       ;;
16984     esac;
16985 } |
16986   sed '
16987      t clear
16988      : clear
16989      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16990      t end
16991      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16992      : end' >>confcache
16993 if cmp -s $cache_file confcache; then :; else
16994   if test -w $cache_file; then
16995     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16996     cat confcache >$cache_file
16997   else
16998     echo "not updating unwritable cache $cache_file"
16999   fi
17000 fi
17001 rm -f confcache
17002
17003 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17004 # Let make expand exec_prefix.
17005 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17006
17007 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17008 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17009 # trailing colons and then remove the whole line if VPATH becomes empty
17010 # (actually we leave an empty line to preserve line numbers).
17011 if test "x$srcdir" = x.; then
17012   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17013 s/:*\$(srcdir):*/:/;
17014 s/:*\${srcdir}:*/:/;
17015 s/:*@srcdir@:*/:/;
17016 s/^\([^=]*=[    ]*\):*/\1/;
17017 s/:*$//;
17018 s/^[^=]*=[      ]*$//;
17019 }'
17020 fi
17021
17022 DEFS=-DHAVE_CONFIG_H
17023
17024 : ${CONFIG_STATUS=./config.status}
17025 ac_clean_files_save=$ac_clean_files
17026 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17027 { echo "$as_me:17027: creating $CONFIG_STATUS" >&5
17028 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17029 cat >$CONFIG_STATUS <<_ACEOF
17030 #! $SHELL
17031 # Generated automatically by configure.
17032 # Run this file to recreate the current configuration.
17033 # Compiler output produced by configure, useful for debugging
17034 # configure, is in config.log if it exists.
17035
17036 debug=false
17037 SHELL=\${CONFIG_SHELL-$SHELL}
17038 ac_cs_invocation="\$0 \$@"
17039
17040 _ACEOF
17041
17042 cat >>$CONFIG_STATUS <<\_ACEOF
17043 # Be Bourne compatible
17044 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17045   emulate sh
17046   NULLCMD=:
17047 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17048   set -o posix
17049 fi
17050
17051 # Name of the executable.
17052 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17053
17054 if expr a : '\(a\)' >/dev/null 2>&1; then
17055   as_expr=expr
17056 else
17057   as_expr=false
17058 fi
17059
17060 rm -f conf$$ conf$$.exe conf$$.file
17061 echo >conf$$.file
17062 if ln -s conf$$.file conf$$ 2>/dev/null; then
17063   # We could just check for DJGPP; but this test a) works b) is more generic
17064   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17065   if test -f conf$$.exe; then
17066     # Don't use ln at all; we don't have any links
17067     as_ln_s='cp -p'
17068   else
17069     as_ln_s='ln -s'
17070   fi
17071 elif ln conf$$.file conf$$ 2>/dev/null; then
17072   as_ln_s=ln
17073 else
17074   as_ln_s='cp -p'
17075 fi
17076 rm -f conf$$ conf$$.exe conf$$.file
17077
17078 as_executable_p="test -f"
17079
17080 # Support unset when possible.
17081 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17082   as_unset=unset
17083 else
17084   as_unset=false
17085 fi
17086
17087 # NLS nuisances.
17088 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17089 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17090 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17091 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17092 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17093 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17094 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17095 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17096
17097 # IFS
17098 # We need space, tab and new line, in precisely that order.
17099 as_nl='
17100 '
17101 IFS="   $as_nl"
17102
17103 # CDPATH.
17104 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17105
17106 exec 6>&1
17107
17108 _ACEOF
17109
17110 # Files that config.status was made for.
17111 if test -n "$ac_config_files"; then
17112   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
17113 fi
17114
17115 if test -n "$ac_config_headers"; then
17116   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
17117 fi
17118
17119 if test -n "$ac_config_links"; then
17120   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
17121 fi
17122
17123 if test -n "$ac_config_commands"; then
17124   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
17125 fi
17126
17127 cat >>$CONFIG_STATUS <<\EOF
17128
17129 ac_cs_usage="\
17130 \`$as_me' instantiates files from templates according to the
17131 current configuration.
17132
17133 Usage: $0 [OPTIONS] [FILE]...
17134
17135   -h, --help       print this help, then exit
17136   -V, --version    print version number, then exit
17137   -d, --debug      don't remove temporary files
17138       --recheck    update $as_me by reconfiguring in the same conditions
17139   --file=FILE[:TEMPLATE]
17140                    instantiate the configuration file FILE
17141   --header=FILE[:TEMPLATE]
17142                    instantiate the configuration header FILE
17143
17144 Configuration files:
17145 $config_files
17146
17147 Configuration headers:
17148 $config_headers
17149
17150 Configuration commands:
17151 $config_commands
17152
17153 Report bugs to <dickey@invisible-island.net>."
17154 EOF
17155
17156 cat >>$CONFIG_STATUS <<EOF
17157 ac_cs_version="\\
17158 config.status
17159 configured by $0, generated by GNU Autoconf 2.52.20141204,
17160   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17161
17162 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17163 Free Software Foundation, Inc.
17164 This config.status script is free software; the Free Software Foundation
17165 gives unlimited permission to copy, distribute and modify it."
17166 srcdir=$srcdir
17167 INSTALL="$INSTALL"
17168 EOF
17169
17170 cat >>$CONFIG_STATUS <<\EOF
17171 # If no file are specified by the user, then we need to provide default
17172 # value.  By we need to know if files were specified by the user.
17173 ac_need_defaults=:
17174 while test $# != 0
17175 do
17176   case $1 in
17177   --*=*)
17178     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17179     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17180     shift
17181     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17182     shift
17183     ;;
17184   -*);;
17185   *) # This is not an option, so the user has probably given explicit
17186      # arguments.
17187      ac_need_defaults=false;;
17188   esac
17189
17190   case $1 in
17191   # Handling of the options.
17192 EOF
17193 cat >>$CONFIG_STATUS <<EOF
17194   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17195     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
17196     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
17197 EOF
17198 cat >>$CONFIG_STATUS <<\EOF
17199   --version | --vers* | -V )
17200     echo "$ac_cs_version"; exit 0 ;;
17201   --he | --h)
17202     # Conflict between --help and --header
17203     { { echo "$as_me:17203: error: ambiguous option: $1
17204 Try \`$0 --help' for more information." >&5
17205 echo "$as_me: error: ambiguous option: $1
17206 Try \`$0 --help' for more information." >&2;}
17207    { (exit 1); exit 1; }; };;
17208   --help | --hel | -h )
17209     echo "$ac_cs_usage"; exit 0 ;;
17210   --debug | --d* | -d )
17211     debug=: ;;
17212   --file | --fil | --fi | --f )
17213     shift
17214     CONFIG_FILES="$CONFIG_FILES $1"
17215     ac_need_defaults=false;;
17216   --header | --heade | --head | --hea )
17217     shift
17218     CONFIG_HEADERS="$CONFIG_HEADERS $1"
17219     ac_need_defaults=false;;
17220
17221   # This is an error.
17222   -*) { { echo "$as_me:17222: error: unrecognized option: $1
17223 Try \`$0 --help' for more information." >&5
17224 echo "$as_me: error: unrecognized option: $1
17225 Try \`$0 --help' for more information." >&2;}
17226    { (exit 1); exit 1; }; } ;;
17227
17228   *) ac_config_targets="$ac_config_targets $1" ;;
17229
17230   esac
17231   shift
17232 done
17233
17234 exec 5>>config.log
17235 cat >&5 << _ACEOF
17236
17237 ## ----------------------- ##
17238 ## Running config.status.  ##
17239 ## ----------------------- ##
17240
17241 This file was extended by $as_me 2.52.20141204, executed with
17242   CONFIG_FILES    = $CONFIG_FILES
17243   CONFIG_HEADERS  = $CONFIG_HEADERS
17244   CONFIG_LINKS    = $CONFIG_LINKS
17245   CONFIG_COMMANDS = $CONFIG_COMMANDS
17246   > $ac_cs_invocation
17247 on `(hostname || uname -n) 2>/dev/null | sed 1q`
17248
17249 _ACEOF
17250 EOF
17251
17252 cat >>$CONFIG_STATUS <<EOF
17253 #
17254 # INIT-COMMANDS section.
17255 #
17256
17257 AWK="$AWK"
17258 ECHO_CC="$ECHO_CC"
17259 ECHO_LD="$ECHO_LD"
17260 SHOW_CC="$SHOW_LD"
17261
17262 EOF
17263
17264 cat >>$CONFIG_STATUS <<\EOF
17265 for ac_config_target in $ac_config_targets
17266 do
17267   case "$ac_config_target" in
17268   # Handling of arguments.
17269   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
17270   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
17271   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
17272   *) { { echo "$as_me:17272: error: invalid argument: $ac_config_target" >&5
17273 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
17274    { (exit 1); exit 1; }; };;
17275   esac
17276 done
17277
17278 # If the user did not use the arguments to specify the items to instantiate,
17279 # then the envvar interface is used.  Set only those that are not.
17280 # We use the long form for the default assignment because of an extremely
17281 # bizarre bug on SunOS 4.1.3.
17282 if $ac_need_defaults; then
17283   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
17284   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
17285   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
17286 fi
17287
17288 # Create a temporary directory, and hook for its removal unless debugging.
17289 $debug ||
17290 {
17291   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
17292   trap '{ (exit 1); exit 1; }' 1 2 13 15
17293 }
17294
17295 # Create a (secure) tmp directory for tmp files.
17296 : ${TMPDIR=/tmp}
17297 {
17298   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
17299   test -n "$tmp" && test -d "$tmp"
17300 }  ||
17301 {
17302   tmp=$TMPDIR/cs$$-$RANDOM
17303   (umask 077 && mkdir $tmp)
17304 } ||
17305 {
17306    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
17307    { (exit 1); exit 1; }
17308 }
17309
17310 EOF
17311
17312 cat >>$CONFIG_STATUS <<EOF
17313
17314 #
17315 # CONFIG_FILES section.
17316 #
17317
17318 # No need to generate the scripts if there are no CONFIG_FILES.
17319 # This happens for instance when ./config.status config.h
17320 if test -n "\$CONFIG_FILES"; then
17321   # Protect against being on the right side of a sed subst in config.status.
17322   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
17323    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
17324 s,@SHELL@,$SHELL,;t t
17325 s,@exec_prefix@,$exec_prefix,;t t
17326 s,@prefix@,$prefix,;t t
17327 s,@program_transform_name@,$program_transform_name,;t t
17328 s,@bindir@,$bindir,;t t
17329 s,@sbindir@,$sbindir,;t t
17330 s,@libexecdir@,$libexecdir,;t t
17331 s,@datarootdir@,$datarootdir,;t t
17332 s,@datadir@,$datadir,;t t
17333 s,@sysconfdir@,$sysconfdir,;t t
17334 s,@sharedstatedir@,$sharedstatedir,;t t
17335 s,@localstatedir@,$localstatedir,;t t
17336 s,@libdir@,$libdir,;t t
17337 s,@includedir@,$includedir,;t t
17338 s,@oldincludedir@,$oldincludedir,;t t
17339 s,@infodir@,$infodir,;t t
17340 s,@mandir@,$mandir,;t t
17341 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
17342 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
17343 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
17344 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
17345 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
17346 s,@build_alias@,$build_alias,;t t
17347 s,@host_alias@,$host_alias,;t t
17348 s,@target_alias@,$target_alias,;t t
17349 s,@ECHO_C@,$ECHO_C,;t t
17350 s,@ECHO_N@,$ECHO_N,;t t
17351 s,@ECHO_T@,$ECHO_T,;t t
17352 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
17353 s,@DEFS@,$DEFS,;t t
17354 s,@LIBS@,$LIBS,;t t
17355 s,@build@,$build,;t t
17356 s,@build_cpu@,$build_cpu,;t t
17357 s,@build_vendor@,$build_vendor,;t t
17358 s,@build_os@,$build_os,;t t
17359 s,@host@,$host,;t t
17360 s,@host_cpu@,$host_cpu,;t t
17361 s,@host_vendor@,$host_vendor,;t t
17362 s,@host_os@,$host_os,;t t
17363 s,@SET_MAKE@,$SET_MAKE,;t t
17364 s,@CC@,$CC,;t t
17365 s,@CFLAGS@,$CFLAGS,;t t
17366 s,@LDFLAGS@,$LDFLAGS,;t t
17367 s,@CPPFLAGS@,$CPPFLAGS,;t t
17368 s,@ac_ct_CC@,$ac_ct_CC,;t t
17369 s,@EXEEXT@,$EXEEXT,;t t
17370 s,@OBJEXT@,$OBJEXT,;t t
17371 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
17372 s,@CPP@,$CPP,;t t
17373 s,@AWK@,$AWK,;t t
17374 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
17375 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
17376 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
17377 s,@LINT@,$LINT,;t t
17378 s,@LINT_OPTS@,$LINT_OPTS,;t t
17379 s,@CTAGS@,$CTAGS,;t t
17380 s,@ETAGS@,$ETAGS,;t t
17381 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
17382 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
17383 s,@MATH_LIB@,$MATH_LIB,;t t
17384 s,@top_builddir@,$top_builddir,;t t
17385 s,@CC_G_OPT@,$CC_G_OPT,;t t
17386 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
17387 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
17388 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
17389 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
17390 s,@LD@,$LD,;t t
17391 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
17392 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
17393 s,@LD_MODEL@,$LD_MODEL,;t t
17394 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
17395 s,@LIBTOOL@,$LIBTOOL,;t t
17396 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
17397 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
17398 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
17399 s,@LIB_LINK@,$LIB_LINK,;t t
17400 s,@LINK_TESTS@,$LINK_TESTS,;t t
17401 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
17402 s,@PACKAGE@,$PACKAGE,;t t
17403 s,@PTHREAD@,$PTHREAD,;t t
17404 s,@TEST_ARGS@,$TEST_ARGS,;t t
17405 s,@TEST_DEPS@,$TEST_DEPS,;t t
17406 s,@TEST_LIBS@,$TEST_LIBS,;t t
17407 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
17408 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
17409 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
17410 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
17411 s,@includesubdir@,$includesubdir,;t t
17412 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
17413 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
17414 s,@ECHO_LT@,$ECHO_LT,;t t
17415 s,@ECHO_LD@,$ECHO_LD,;t t
17416 s,@RULE_CC@,$RULE_CC,;t t
17417 s,@SHOW_CC@,$SHOW_CC,;t t
17418 s,@ECHO_CC@,$ECHO_CC,;t t
17419 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
17420 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
17421 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
17422 s,@X_CFLAGS@,$X_CFLAGS,;t t
17423 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
17424 s,@X_LIBS@,$X_LIBS,;t t
17425 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
17426 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
17427 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
17428 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
17429 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
17430 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
17431 CEOF
17432
17433 EOF
17434
17435   cat >>$CONFIG_STATUS <<\EOF
17436   # Split the substitutions into bite-sized pieces for seds with
17437   # small command number limits, like on Digital OSF/1 and HP-UX.
17438   ac_max_sed_lines=48
17439   ac_sed_frag=1 # Number of current file.
17440   ac_beg=1 # First line for current file.
17441   ac_end=$ac_max_sed_lines # Line after last line for current file.
17442   ac_more_lines=:
17443   ac_sed_cmds=
17444   while $ac_more_lines; do
17445     if test $ac_beg -gt 1; then
17446       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17447     else
17448       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17449     fi
17450     if test ! -s $tmp/subs.frag; then
17451       ac_more_lines=false
17452     else
17453       # The purpose of the label and of the branching condition is to
17454       # speed up the sed processing (if there are no `@' at all, there
17455       # is no need to browse any of the substitutions).
17456       # These are the two extra sed commands mentioned above.
17457       (echo ':t
17458   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
17459       if test -z "$ac_sed_cmds"; then
17460         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
17461       else
17462         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
17463       fi
17464       ac_sed_frag=`expr $ac_sed_frag + 1`
17465       ac_beg=$ac_end
17466       ac_end=`expr $ac_end + $ac_max_sed_lines`
17467     fi
17468   done
17469   if test -z "$ac_sed_cmds"; then
17470     ac_sed_cmds=cat
17471   fi
17472 fi # test -n "$CONFIG_FILES"
17473
17474 EOF
17475 cat >>$CONFIG_STATUS <<\EOF
17476 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
17477   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17478   case $ac_file in
17479   - | *:- | *:-:* ) # input from stdin
17480         cat >$tmp/stdin
17481         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17482         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17483   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17484         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17485   * )   ac_file_in=$ac_file.in ;;
17486   esac
17487
17488   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
17489   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17490          X"$ac_file" : 'X\(//\)[^/]' \| \
17491          X"$ac_file" : 'X\(//\)$' \| \
17492          X"$ac_file" : 'X\(/\)' \| \
17493          .     : '\(.\)' 2>/dev/null ||
17494 echo X"$ac_file" |
17495     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17496           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17497           /^X\(\/\/\)$/{ s//\1/; q; }
17498           /^X\(\/\).*/{ s//\1/; q; }
17499           s/.*/./; q'`
17500   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17501     { case "$ac_dir" in
17502   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17503   *)                      as_incr_dir=.;;
17504 esac
17505 as_dummy="$ac_dir"
17506 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17507   case $as_mkdir_dir in
17508     # Skip DOS drivespec
17509     ?:) as_incr_dir=$as_mkdir_dir ;;
17510     *)
17511       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17512       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17513     ;;
17514   esac
17515 done; }
17516
17517     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
17518     # A "../" for each directory in $ac_dir_suffix.
17519     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
17520   else
17521     ac_dir_suffix= ac_dots=
17522   fi
17523
17524   case $srcdir in
17525   .)  ac_srcdir=.
17526       if test -z "$ac_dots"; then
17527          ac_top_srcdir=.
17528       else
17529          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
17530       fi ;;
17531   [\\/]* | ?:[\\/]* )
17532       ac_srcdir=$srcdir$ac_dir_suffix;
17533       ac_top_srcdir=$srcdir ;;
17534   *) # Relative path.
17535     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
17536     ac_top_srcdir=$ac_dots$srcdir ;;
17537   esac
17538
17539   case $INSTALL in
17540   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
17541   *) ac_INSTALL=$ac_dots$INSTALL ;;
17542   esac
17543
17544   if test x"$ac_file" != x-; then
17545     { echo "$as_me:17545: creating $ac_file" >&5
17546 echo "$as_me: creating $ac_file" >&6;}
17547     rm -f "$ac_file"
17548   fi
17549   # Let's still pretend it is `configure' which instantiates (i.e., don't
17550   # use $as_me), people would be surprised to read:
17551   #    /* config.h.  Generated automatically by config.status.  */
17552   configure_input="Generated automatically from `echo $ac_file_in |
17553                                                  sed 's,.*/,,'` by configure."
17554
17555   # First look for the input files in the build tree, otherwise in the
17556   # src tree.
17557   ac_file_inputs=`IFS=:
17558     for f in $ac_file_in; do
17559       case $f in
17560       -) echo $tmp/stdin ;;
17561       [\\/$]*)
17562          # Absolute (can't be DOS-style, as IFS=:)
17563          test -f "$f" || { { echo "$as_me:17563: error: cannot find input file: $f" >&5
17564 echo "$as_me: error: cannot find input file: $f" >&2;}
17565    { (exit 1); exit 1; }; }
17566          echo $f;;
17567       *) # Relative
17568          if test -f "$f"; then
17569            # Build tree
17570            echo $f
17571          elif test -f "$srcdir/$f"; then
17572            # Source tree
17573            echo $srcdir/$f
17574          else
17575            # /dev/null tree
17576            { { echo "$as_me:17576: error: cannot find input file: $f" >&5
17577 echo "$as_me: error: cannot find input file: $f" >&2;}
17578    { (exit 1); exit 1; }; }
17579          fi;;
17580       esac
17581     done` || { (exit 1); exit 1; }
17582 EOF
17583 cat >>$CONFIG_STATUS <<\EOF
17584   ac_warn_datarootdir=no
17585   if test x"$ac_file" != x-; then
17586     for ac_item in $ac_file_inputs
17587     do
17588       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
17589       if test -n "$ac_seen"; then
17590         ac_used=`grep '@datarootdir@' $ac_item`
17591         if test -z "$ac_used"; then
17592           { echo "$as_me:17592: WARNING: datarootdir was used implicitly but not set:
17593 $ac_seen" >&5
17594 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
17595 $ac_seen" >&2;}
17596           ac_warn_datarootdir=yes
17597         fi
17598       fi
17599       ac_seen=`grep '${datarootdir}' $ac_item`
17600       if test -n "$ac_seen"; then
17601         { echo "$as_me:17601: WARNING: datarootdir was used explicitly but not set:
17602 $ac_seen" >&5
17603 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
17604 $ac_seen" >&2;}
17605         ac_warn_datarootdir=yes
17606       fi
17607     done
17608   fi
17609
17610 if test "x$ac_warn_datarootdir" = xyes; then
17611   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
17612 fi
17613
17614 EOF
17615 cat >>$CONFIG_STATUS <<EOF
17616   sed "$ac_vpsub
17617 $extrasub
17618 EOF
17619 cat >>$CONFIG_STATUS <<\EOF
17620 :t
17621 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17622 s,@configure_input@,$configure_input,;t t
17623 s,@srcdir@,$ac_srcdir,;t t
17624 s,@top_srcdir@,$ac_top_srcdir,;t t
17625 s,@INSTALL@,$ac_INSTALL,;t t
17626 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
17627   rm -f $tmp/stdin
17628   if test x"$ac_file" != x-; then
17629     cp $tmp/out $ac_file
17630
17631     for ac_name in prefix exec_prefix datarootdir
17632     do
17633         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
17634         if test -n "$ac_seen"; then
17635             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
17636             if test -z "$ac_init"; then
17637               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
17638               { echo "$as_me:17638: WARNING: Variable $ac_name is used but was not set:
17639 $ac_seen" >&5
17640 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
17641 $ac_seen" >&2;}
17642             fi
17643         fi
17644     done
17645     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
17646     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
17647     if test -s $tmp/out; then
17648       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
17649       { echo "$as_me:17649: WARNING: Some variables may not be substituted:
17650 $ac_seen" >&5
17651 echo "$as_me: WARNING: Some variables may not be substituted:
17652 $ac_seen" >&2;}
17653     fi
17654   else
17655     cat $tmp/out
17656   fi
17657   rm -f $tmp/out
17658
17659 done
17660 EOF
17661 cat >>$CONFIG_STATUS <<\EOF
17662
17663 #
17664 # CONFIG_HEADER section.
17665 #
17666
17667 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17668 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17669 #
17670 # ac_d sets the value in "#define NAME VALUE" lines.
17671 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17672 ac_dB='[        ].*$,\1#\2'
17673 ac_dC=' '
17674 ac_dD=',;t'
17675 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17676 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17677 ac_iB='\([      ]\),\1#\2define\3'
17678 ac_iC=' '
17679 ac_iD='\4,;t'
17680 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17681 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17682 ac_uB='$,\1#\2define\3'
17683 ac_uC=' '
17684 ac_uD=',;t'
17685
17686 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
17687   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17688   case $ac_file in
17689   - | *:- | *:-:* ) # input from stdin
17690         cat >$tmp/stdin
17691         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17692         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17693   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17694         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17695   * )   ac_file_in=$ac_file.in ;;
17696   esac
17697
17698   test x"$ac_file" != x- && { echo "$as_me:17698: creating $ac_file" >&5
17699 echo "$as_me: creating $ac_file" >&6;}
17700
17701   # First look for the input files in the build tree, otherwise in the
17702   # src tree.
17703   ac_file_inputs=`IFS=:
17704     for f in $ac_file_in; do
17705       case $f in
17706       -) echo $tmp/stdin ;;
17707       [\\/$]*)
17708          # Absolute (can't be DOS-style, as IFS=:)
17709          test -f "$f" || { { echo "$as_me:17709: error: cannot find input file: $f" >&5
17710 echo "$as_me: error: cannot find input file: $f" >&2;}
17711    { (exit 1); exit 1; }; }
17712          echo $f;;
17713       *) # Relative
17714          if test -f "$f"; then
17715            # Build tree
17716            echo $f
17717          elif test -f "$srcdir/$f"; then
17718            # Source tree
17719            echo $srcdir/$f
17720          else
17721            # /dev/null tree
17722            { { echo "$as_me:17722: error: cannot find input file: $f" >&5
17723 echo "$as_me: error: cannot find input file: $f" >&2;}
17724    { (exit 1); exit 1; }; }
17725          fi;;
17726       esac
17727     done` || { (exit 1); exit 1; }
17728   # Remove the trailing spaces.
17729   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
17730
17731 EOF
17732
17733 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
17734 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
17735 # be either 'cat' or 'sort'.
17736 cat confdefs.h | uniq >conftest.vals
17737
17738 # Break up conftest.vals because some shells have a limit on
17739 # the size of here documents, and old seds have small limits too.
17740
17741 rm -f conftest.tail
17742 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
17743 while grep . conftest.vals >/dev/null
17744 do
17745   # Write chunks of a limited-size here document to conftest.frag.
17746   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
17747   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
17748   echo 'CEOF' >> $CONFIG_STATUS
17749   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17750   rm -f conftest.vals
17751   mv conftest.tail conftest.vals
17752 done
17753 rm -f conftest.vals
17754
17755 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
17756 # marker @DEFS@.
17757 echo '  cat >> conftest.edit <<CEOF
17758 /@DEFS@/r conftest.frag
17759 /@DEFS@/d
17760 CEOF
17761 sed -f conftest.edit $tmp/in > $tmp/out
17762 rm -f $tmp/in
17763 mv $tmp/out $tmp/in
17764 rm -f conftest.edit conftest.frag
17765 ' >> $CONFIG_STATUS
17766
17767 cat >>$CONFIG_STATUS <<\EOF
17768   # Let's still pretend it is `configure' which instantiates (i.e., don't
17769   # use $as_me), people would be surprised to read:
17770   #    /* config.h.  Generated automatically by config.status.  */
17771   if test x"$ac_file" = x-; then
17772     echo "/* Generated automatically by configure.  */" >$tmp/config.h
17773   else
17774     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
17775   fi
17776   cat $tmp/in >>$tmp/config.h
17777   rm -f $tmp/in
17778   if test x"$ac_file" != x-; then
17779     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
17780       { echo "$as_me:17780: $ac_file is unchanged" >&5
17781 echo "$as_me: $ac_file is unchanged" >&6;}
17782     else
17783       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17784          X"$ac_file" : 'X\(//\)[^/]' \| \
17785          X"$ac_file" : 'X\(//\)$' \| \
17786          X"$ac_file" : 'X\(/\)' \| \
17787          .     : '\(.\)' 2>/dev/null ||
17788 echo X"$ac_file" |
17789     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17790           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17791           /^X\(\/\/\)$/{ s//\1/; q; }
17792           /^X\(\/\).*/{ s//\1/; q; }
17793           s/.*/./; q'`
17794       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17795         { case "$ac_dir" in
17796   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17797   *)                      as_incr_dir=.;;
17798 esac
17799 as_dummy="$ac_dir"
17800 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17801   case $as_mkdir_dir in
17802     # Skip DOS drivespec
17803     ?:) as_incr_dir=$as_mkdir_dir ;;
17804     *)
17805       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17806       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17807     ;;
17808   esac
17809 done; }
17810
17811       fi
17812       rm -f $ac_file
17813       mv $tmp/config.h $ac_file
17814     fi
17815   else
17816     cat $tmp/config.h
17817     rm -f $tmp/config.h
17818   fi
17819 done
17820 EOF
17821 cat >>$CONFIG_STATUS <<\EOF
17822 #
17823 # CONFIG_COMMANDS section.
17824 #
17825 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17826   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17827   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17828
17829   case $ac_dest in
17830     default )
17831
17832 for cf_dir in .
17833 do
17834         if test ! -d $srcdir/$cf_dir; then
17835                 continue
17836         elif test -f $srcdir/$cf_dir/programs; then
17837                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
17838         fi
17839 done
17840
17841         cat >>Makefile <<TEST_EOF
17842
17843 # These rules are generated so we do not rely on suffix rules, which do not
17844 # work consistently for different make-programs (the '\$(MODEL)/' confuses
17845 # some, and the '\$x' confuses others).
17846 TEST_EOF
17847
17848 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
17849 for N in $LIST
17850 do
17851         cat >>Makefile <<TEST_EOF
17852
17853 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
17854         \$(srcdir)/test.priv.h \\
17855         ncurses_cfg.h
17856         $SHOW_CC
17857         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
17858 TEST_EOF
17859 done
17860
17861 if test -f ../config.guess && test -f ../config.sub
17862 then
17863         cat >>Makefile <<TEST_EOF
17864
17865 # if we used CF_INHERIT for getting these files, we can remove them
17866 distclean::
17867         rm -f config.guess config.sub
17868 TEST_EOF
17869 fi
17870  ;;
17871   esac
17872 done
17873 EOF
17874
17875 cat >>$CONFIG_STATUS <<\EOF
17876
17877 { (exit 0); exit 0; }
17878 EOF
17879 chmod +x $CONFIG_STATUS
17880 ac_clean_files=$ac_clean_files_save
17881
17882 # configure is writing to config.log, and then calls config.status.
17883 # config.status does its own redirection, appending to config.log.
17884 # Unfortunately, on DOS this fails, as config.log is still kept open
17885 # by configure, so config.status won't be able to write to it; its
17886 # output is simply discarded.  So we exec the FD to /dev/null,
17887 # effectively closing config.log, so it can be properly (re)opened and
17888 # appended to by config.status.  When coming back to configure, we
17889 # need to make the FD available again.
17890 if test "$no_create" != yes; then
17891   ac_cs_success=:
17892   exec 5>/dev/null
17893   $SHELL $CONFIG_STATUS || ac_cs_success=false
17894   exec 5>>config.log
17895   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17896   # would make configure fail if this is the last instruction.
17897   $ac_cs_success || { (exit 1); exit 1; }
17898 fi
17899