]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.2 - patch 20210904
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20210509.
4 #
5 # Copyright 2003-2020,2021      Thomas E. Dickey
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr=expr
37 else
38   as_expr=false
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s=ln
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset="unset"
64 else
65   as_unset="false"
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS=
101 MAKEFLAGS=
102 SHELL=${CONFIG_SHELL-/bin/sh}
103
104 # Maximum number of lines to put in a shell here document.
105 # This variable seems obsolete.  It should probably be removed, and
106 # only ac_max_sed_lines should be used.
107 : "${ac_max_here_lines=38}"
108
109 ac_unique_file="ncurses.c"
110
111 # Initialize some variables set by options.
112 ac_init_help=
113 ac_init_version=false
114 # The variables have the same names as the options, with
115 # dashes changed to underlines.
116 cache_file=/dev/null
117 exec_prefix=NONE
118 no_create=
119 no_recursion=
120 prefix=NONE
121 program_prefix=NONE
122 program_suffix=NONE
123 program_transform_name=s,x,x,
124 silent=
125 site=
126 srcdir=
127 verbose=
128 x_includes=NONE
129 x_libraries=NONE
130
131 # Installation directory options.
132 # These are left unexpanded so users can "make install exec_prefix=/foo"
133 # and all the variables that are supposed to be based on exec_prefix
134 # by default will actually change.
135 # Use braces instead of parens because sh, perl, etc. also accept them.
136 bindir='${exec_prefix}/bin'
137 sbindir='${exec_prefix}/sbin'
138 libexecdir='${exec_prefix}/libexec'
139 datarootdir='${prefix}/share'
140 datadir='${datarootdir}'
141 sysconfdir='${prefix}/etc'
142 sharedstatedir='${prefix}/com'
143 localstatedir='${prefix}/var'
144 runstatedir='${localstatedir}/run'
145 libdir='${exec_prefix}/lib'
146 includedir='${prefix}/include'
147 oldincludedir='/usr/include'
148 infodir='${datarootdir}/info'
149 mandir='${datarootdir}/man'
150
151 # Identity of this package.
152 PACKAGE_NAME=
153 PACKAGE_TARNAME=
154 PACKAGE_VERSION=
155 PACKAGE_STRING=
156 PACKAGE_BUGREPORT=
157
158 ac_prev=
159 for ac_option
160 do
161   # If the previous option needs an argument, assign it.
162   if test -n "$ac_prev"; then
163     eval "$ac_prev=\$ac_option"
164     ac_prev=
165     continue
166   fi
167
168   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
169
170   # Accept the important Cygnus configure options, so we can diagnose typos.
171
172   case "$ac_option" in
173
174   -bindir | --bindir | --bindi | --bind | --bin | --bi)
175     ac_prev=bindir ;;
176   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
177     bindir=$ac_optarg ;;
178
179   -build | --build | --buil | --bui | --bu)
180     ac_prev=build_alias ;;
181   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
182     build_alias=$ac_optarg ;;
183
184   -cache-file | --cache-file | --cache-fil | --cache-fi \
185   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
186     ac_prev=cache_file ;;
187   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
188   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
189     cache_file=$ac_optarg ;;
190
191   --config-cache | -C)
192     cache_file=config.cache ;;
193
194   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
195     ac_prev=datadir ;;
196   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
197   | --da=*)
198     datadir=$ac_optarg ;;
199
200   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
201   | --dataroo | --dataro | --datar)
202     ac_prev=datarootdir ;;
203   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
204   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
205     datarootdir=$ac_optarg ;;
206
207   -disable-* | --disable-*)
208     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
209     # Reject names that are not valid shell variable names.
210     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
211       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
212    { (exit 1); exit 1; }; }
213     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
214     eval "enable_$ac_feature=no" ;;
215
216   -enable-* | --enable-*)
217     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
218     # Reject names that are not valid shell variable names.
219     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
220       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
221    { (exit 1); exit 1; }; }
222     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
223     case "$ac_option" in
224       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
225       *) ac_optarg=yes ;;
226     esac
227     eval "enable_$ac_feature='$ac_optarg'" ;;
228
229   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
230   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
231   | --exec | --exe | --ex)
232     ac_prev=exec_prefix ;;
233   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
234   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
235   | --exec=* | --exe=* | --ex=*)
236     exec_prefix=$ac_optarg ;;
237
238   -gas | --gas | --ga | --g)
239     # Obsolete; use --with-gas.
240     with_gas=yes ;;
241
242   -help | --help | --hel | --he | -h)
243     ac_init_help=long ;;
244   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
245     ac_init_help=recursive ;;
246   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
247     ac_init_help=short ;;
248
249   -host | --host | --hos | --ho)
250     ac_prev=host_alias ;;
251   -host=* | --host=* | --hos=* | --ho=*)
252     host_alias=$ac_optarg ;;
253
254   -includedir | --includedir | --includedi | --included | --include \
255   | --includ | --inclu | --incl | --inc)
256     ac_prev=includedir ;;
257   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
258   | --includ=* | --inclu=* | --incl=* | --inc=*)
259     includedir=$ac_optarg ;;
260
261   -infodir | --infodir | --infodi | --infod | --info | --inf)
262     ac_prev=infodir ;;
263   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
264     infodir=$ac_optarg ;;
265
266   -libdir | --libdir | --libdi | --libd)
267     ac_prev=libdir ;;
268   -libdir=* | --libdir=* | --libdi=* | --libd=*)
269     libdir=$ac_optarg ;;
270
271   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
272   | --libexe | --libex | --libe)
273     ac_prev=libexecdir ;;
274   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
275   | --libexe=* | --libex=* | --libe=*)
276     libexecdir=$ac_optarg ;;
277
278   -localstatedir | --localstatedir | --localstatedi | --localstated \
279   | --localstate | --localstat | --localsta | --localst \
280   | --locals | --local | --loca | --loc | --lo)
281     ac_prev=localstatedir ;;
282   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
283   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
284   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
285     localstatedir=$ac_optarg ;;
286
287   -runstatedir | --runstatedir | --runstatedi | --runstated \
288   | --runstate | --runstat | --runsta | --runst \
289   | --runs | --run | --ru)
290     ac_prev=runstatedir ;;
291   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
292   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
293   | --runs=* | --run=* | --ru=*)
294     runstatedir=$ac_optarg ;;
295
296   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
297     ac_prev=mandir ;;
298   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
299     mandir=$ac_optarg ;;
300
301   -nfp | --nfp | --nf)
302     # Obsolete; use --without-fp.
303     with_fp=no ;;
304
305   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
306   | --no-cr | --no-c)
307     no_create=yes ;;
308
309   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
310   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
311     no_recursion=yes ;;
312
313   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
314   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
315   | --oldin | --oldi | --old | --ol | --o)
316     ac_prev=oldincludedir ;;
317   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
318   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
319   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
320     oldincludedir=$ac_optarg ;;
321
322   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
323     ac_prev=prefix ;;
324   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
325     prefix=$ac_optarg ;;
326
327   -program-prefix | --program-prefix | --program-prefi | --program-pref \
328   | --program-pre | --program-pr | --program-p)
329     ac_prev=program_prefix ;;
330   -program-prefix=* | --program-prefix=* | --program-prefi=* \
331   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
332     program_prefix=$ac_optarg ;;
333
334   -program-suffix | --program-suffix | --program-suffi | --program-suff \
335   | --program-suf | --program-su | --program-s)
336     ac_prev=program_suffix ;;
337   -program-suffix=* | --program-suffix=* | --program-suffi=* \
338   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
339     program_suffix=$ac_optarg ;;
340
341   -program-transform-name | --program-transform-name \
342   | --program-transform-nam | --program-transform-na \
343   | --program-transform-n | --program-transform- \
344   | --program-transform | --program-transfor \
345   | --program-transfo | --program-transf \
346   | --program-trans | --program-tran \
347   | --progr-tra | --program-tr | --program-t)
348     ac_prev=program_transform_name ;;
349   -program-transform-name=* | --program-transform-name=* \
350   | --program-transform-nam=* | --program-transform-na=* \
351   | --program-transform-n=* | --program-transform-=* \
352   | --program-transform=* | --program-transfor=* \
353   | --program-transfo=* | --program-transf=* \
354   | --program-trans=* | --program-tran=* \
355   | --progr-tra=* | --program-tr=* | --program-t=*)
356     program_transform_name=$ac_optarg ;;
357
358   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
359   | -silent | --silent | --silen | --sile | --sil)
360     silent=yes ;;
361
362   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
363     ac_prev=sbindir ;;
364   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
365   | --sbi=* | --sb=*)
366     sbindir=$ac_optarg ;;
367
368   -sharedstatedir | --sharedstatedir | --sharedstatedi \
369   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
370   | --sharedst | --shareds | --shared | --share | --shar \
371   | --sha | --sh)
372     ac_prev=sharedstatedir ;;
373   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
374   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
375   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
376   | --sha=* | --sh=*)
377     sharedstatedir=$ac_optarg ;;
378
379   -site | --site | --sit)
380     ac_prev=site ;;
381   -site=* | --site=* | --sit=*)
382     site=$ac_optarg ;;
383
384   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
385     ac_prev=srcdir ;;
386   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
387     srcdir=$ac_optarg ;;
388
389   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
390   | --syscon | --sysco | --sysc | --sys | --sy)
391     ac_prev=sysconfdir ;;
392   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
393   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
394     sysconfdir=$ac_optarg ;;
395
396   -target | --target | --targe | --targ | --tar | --ta | --t)
397     ac_prev=target_alias ;;
398   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
399     target_alias=$ac_optarg ;;
400
401   -v | -verbose | --verbose | --verbos | --verbo | --verb)
402     verbose=yes ;;
403
404   -version | --version | --versio | --versi | --vers | -V)
405     ac_init_version=: ;;
406
407   -with-* | --with-*)
408     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
409     # Reject names that are not valid shell variable names.
410     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
411       { echo "$as_me: error: invalid package name: $ac_package" >&2
412    { (exit 1); exit 1; }; }
413     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
414     case "$ac_option" in
415       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
416       *) ac_optarg=yes ;;
417     esac
418     eval "with_$ac_package='$ac_optarg'" ;;
419
420   -without-* | --without-*)
421     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
422     # Reject names that are not valid shell variable names.
423     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
424       { echo "$as_me: error: invalid package name: $ac_package" >&2
425    { (exit 1); exit 1; }; }
426     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
427     eval "with_$ac_package=no" ;;
428
429   --x)
430     # Obsolete; use --with-x.
431     with_x=yes ;;
432
433   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
434   | --x-incl | --x-inc | --x-in | --x-i)
435     ac_prev=x_includes ;;
436   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
437   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
438     x_includes=$ac_optarg ;;
439
440   -x-libraries | --x-libraries | --x-librarie | --x-librari \
441   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
442     ac_prev=x_libraries ;;
443   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
444   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
445     x_libraries=$ac_optarg ;;
446
447   -*) { echo "$as_me: error: unrecognized option: $ac_option
448 Try \`$0 --help' for more information." >&2
449    { (exit 1); exit 1; }; }
450     ;;
451
452   *=*)
453     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
454     # Reject names that are not valid shell variable names.
455     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
456       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
457    { (exit 1); exit 1; }; }
458     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
459     eval "$ac_envvar='$ac_optarg'"
460     export "$ac_envvar" ;;
461
462   *)
463     # FIXME: should be removed in autoconf 3.0.
464     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
465     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
466       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
467     : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
468     ;;
469
470   esac
471 done
472
473 if test -n "$ac_prev"; then
474   ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
475   { echo "$as_me: error: missing argument to $ac_option" >&2
476    { (exit 1); exit 1; }; }
477 fi
478
479 # Be sure to have absolute paths.
480 for ac_var in exec_prefix prefix
481 do
482   eval ac_val=$`echo "$ac_var"`
483   case "$ac_val" in
484     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
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 # Be sure to have absolute paths.
491 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
492               localstatedir libdir includedir oldincludedir infodir mandir
493 do
494   eval ac_val=$`echo "$ac_var"`
495   case "$ac_val" in
496     [\\/$]* | ?:[\\/]* ) ;;
497     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
498    { (exit 1); exit 1; }; };;
499   esac
500 done
501
502 # There might be people who depend on the old broken behavior: `$host'
503 # used to hold the argument of --host etc.
504 build=$build_alias
505 host=$host_alias
506 target=$target_alias
507
508 # FIXME: should be removed in autoconf 3.0.
509 if test "x$host_alias" != x; then
510   if test "x$build_alias" = x; then
511     cross_compiling=maybe
512     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
513     If a cross compiler is detected then cross compile mode will be used." >&2
514   elif test "x$build_alias" != "x$host_alias"; then
515     cross_compiling=yes
516   fi
517 fi
518
519 ac_tool_prefix=
520 test -n "$host_alias" && ac_tool_prefix=$host_alias-
521
522 test "$silent" = yes && exec 6>/dev/null
523
524 # Find the source files, if location was not specified.
525 if test -z "$srcdir"; then
526   ac_srcdir_defaulted=yes
527   # Try the directory containing this script, then its parent.
528   ac_prog=$0
529   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
530   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
531   srcdir=$ac_confdir
532   if test ! -r "$srcdir/$ac_unique_file"; then
533     srcdir=..
534   fi
535 else
536   ac_srcdir_defaulted=no
537 fi
538 if test ! -r "$srcdir/$ac_unique_file"; then
539   if test "$ac_srcdir_defaulted" = yes; then
540     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
541    { (exit 1); exit 1; }; }
542   else
543     { echo "$as_me: error: cannot find sources in $srcdir" >&2
544    { (exit 1); exit 1; }; }
545   fi
546 fi
547 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
548 ac_env_build_alias_set=${build_alias+set}
549 ac_env_build_alias_value=$build_alias
550 ac_cv_env_build_alias_set=${build_alias+set}
551 ac_cv_env_build_alias_value=$build_alias
552 ac_env_host_alias_set=${host_alias+set}
553 ac_env_host_alias_value=$host_alias
554 ac_cv_env_host_alias_set=${host_alias+set}
555 ac_cv_env_host_alias_value=$host_alias
556 ac_env_target_alias_set=${target_alias+set}
557 ac_env_target_alias_value=$target_alias
558 ac_cv_env_target_alias_set=${target_alias+set}
559 ac_cv_env_target_alias_value=$target_alias
560 ac_env_CC_set=${CC+set}
561 ac_env_CC_value=$CC
562 ac_cv_env_CC_set=${CC+set}
563 ac_cv_env_CC_value=$CC
564 ac_env_CFLAGS_set=${CFLAGS+set}
565 ac_env_CFLAGS_value=$CFLAGS
566 ac_cv_env_CFLAGS_set=${CFLAGS+set}
567 ac_cv_env_CFLAGS_value=$CFLAGS
568 ac_env_LDFLAGS_set=${LDFLAGS+set}
569 ac_env_LDFLAGS_value=$LDFLAGS
570 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
571 ac_cv_env_LDFLAGS_value=$LDFLAGS
572 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
573 ac_env_CPPFLAGS_value=$CPPFLAGS
574 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
575 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
576 ac_env_CPP_set=${CPP+set}
577 ac_env_CPP_value=$CPP
578 ac_cv_env_CPP_set=${CPP+set}
579 ac_cv_env_CPP_value=$CPP
580
581 #
582 # Report the --help message.
583 #
584 if test "$ac_init_help" = "long"; then
585   # Omit some internal or obsolete options to make the list less imposing.
586   # This message is too long to be a string in the A/UX 3.1 sh.
587   cat <<EOF
588 \`configure' configures this package to adapt to many kinds of systems.
589
590 Usage: $0 [OPTION]... [VAR=VALUE]...
591
592 To assign environment variables (e.g., CC, CFLAGS...), specify them as
593 VAR=VALUE.  See below for descriptions of some of the useful variables.
594
595 Defaults for the options are specified in brackets.
596
597 Configuration:
598   -h, --help              display this help and exit
599       --help=short        display options specific to this package
600       --help=recursive    display the short help of all the included packages
601   -V, --version           display version information and exit
602   -q, --quiet, --silent   do not print \`checking...' messages
603       --cache-file=FILE   cache test results in FILE [disabled]
604   -C, --config-cache      alias for \`--cache-file=config.cache'
605   -n, --no-create         do not create output files
606       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
607
608 EOF
609
610   cat <<EOF
611 Installation directories:
612   --prefix=PREFIX         install architecture-independent files in PREFIX
613                           [$ac_default_prefix]
614   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
615                           [PREFIX]
616
617 By default, \`make install' will install all the files in
618 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
619 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
620 for instance \`--prefix=\$HOME'.
621
622 For better control, use the options below.
623
624 Fine tuning of the installation directories:
625   --bindir=DIR            user executables [EPREFIX/bin]
626   --sbindir=DIR           system admin executables [EPREFIX/sbin]
627   --libexecdir=DIR        program executables [EPREFIX/libexec]
628   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
629   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
630   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
631   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
632   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
633   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
634   --libdir=DIR            object code libraries [EPREFIX/lib]
635   --includedir=DIR        C header files [PREFIX/include]
636   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
637   --infodir=DIR           info documentation [DATAROOTDIR/info]
638   --mandir=DIR            man documentation [DATAROOTDIR/man]
639 EOF
640
641   cat <<\EOF
642
643 Program names:
644   --program-prefix=PREFIX            prepend PREFIX to installed program names
645   --program-suffix=SUFFIX            append SUFFIX to installed program names
646   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
647
648 X features:
649   --x-includes=DIR    X include files are in DIR
650   --x-libraries=DIR   X library files are in DIR
651
652 System types:
653   --build=BUILD           configure for building on BUILD [guessed]
654   --host=HOST       build programs to run on HOST [BUILD]
655 EOF
656 fi
657
658 if test -n "$ac_init_help"; then
659
660   cat <<\EOF
661
662 Optional Features:
663   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
664   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
665
666 Optional Packages:
667   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
668   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
669
670 General Options:
671   --disable-stripping     do not strip (debug info) installed executables
672   --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics
673   --enable-string-hacks   work around bogus compiler/loader warnings
674   --with-pkg-config{=path} enable/disable use of pkg-config
675   --disable-echo          do not display "compiling" commands
676 Curses Version-dependent Options:
677   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
678   --disable-widec         disable checks for wide-character functions
679   --with-curses-dir=DIR   directory in which (n)curses is installed
680   --with-screen=XXX       use specified curses-libraries
681   --with-ncursesw         use wide ncurses-libraries
682   --with-ncurses          use ncurses-libraries
683   --with-pdcurses         compile/link with pdcurses X11 library
684   --with-curses-colr      compile/link with HPUX 10.x color-curses
685   --with-curses-5lib      compile/link with SunOS 5lib curses
686   --with-Xaw3d            link with Xaw 3d library
687   --with-Xaw3dxft         link with Xaw 3d xft library
688   --with-neXtaw           link with neXT Athena library
689   --with-XawPlus          link with Athena-Plus library
690   --with-x                use the X Window System
691   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
692   --with-form-libname=XXX override form basename of library
693   --with-menu-libname=XXX override menu basename of library
694   --with-panel-libname=XXX override panel basename of library
695   --disable-panel         disable checks for panel functions
696   --disable-menu          disable checks for menu functions
697   --disable-form          disable checks for form functions
698 Testing/development Options:
699   --enable-warnings       test: turn on gcc compiler warnings
700   --with-dmalloc          test: use Gray Watson's dmalloc library
701   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
702   --with-valgrind         test: use valgrind
703   --disable-leaks         test: free permanent memory, analyze leaks
704   --disable-rpath-hack    don't add rpath options for additional libraries
705
706 Some influential environment variables:
707   CC          C compiler command
708   CFLAGS      C compiler flags
709   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
710               nonstandard directory <lib dir>
711   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
712               headers in a nonstandard directory <include dir>
713   CPP         C preprocessor
714
715 Use these variables to override the choices made by `configure' or to help
716 it to find libraries and programs with nonstandard names/locations.
717
718 EOF
719 fi
720
721 if test "$ac_init_help" = "recursive"; then
722   # If there are subdirs, report their specific --help.
723   ac_popdir=`pwd`
724   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
725     cd "$ac_subdir"
726     # A "../" for each directory in /$ac_subdir.
727     ac_dots=`echo "$ac_subdir" |
728              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
729
730     case "$srcdir" in
731     .) # No --srcdir option.  We are building in place.
732       ac_sub_srcdir="$srcdir" ;;
733     [\\/]* | ?:[\\/]* ) # Absolute path.
734       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
735     *) # Relative path.
736       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
737     esac
738
739     # Check for guested configure; otherwise get Cygnus style configure.
740     if test -f "$ac_sub_srcdir/configure.gnu"; then
741       echo
742       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
743     elif test -f "$ac_sub_srcdir/configure"; then
744       echo
745       $SHELL "$ac_sub_srcdir/configure" --help=recursive
746     elif test -f "$ac_sub_srcdir/configure.ac" ||
747            test -f "$ac_sub_srcdir/configure.in"; then
748       echo
749       "$ac_configure" --help
750     else
751       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
752     fi
753     cd "$ac_popdir"
754   done
755 fi
756
757 test -n "$ac_init_help" && exit 0
758 if "$ac_init_version"; then
759   cat <<\EOF
760
761 Copyright 2003-2020,2021        Thomas E. Dickey
762 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
763 Free Software Foundation, Inc.
764 This configure script is free software; the Free Software Foundation
765 gives unlimited permission to copy, distribute and modify it.
766 EOF
767   exit 0
768 fi
769 exec 5>config.log
770 cat >&5 <<EOF
771 This file contains any messages produced by compilers while
772 running configure, to aid debugging if configure makes a mistake.
773
774 It was created by $as_me, which was
775 generated by GNU Autoconf 2.52.20210509.  Invocation command line was
776
777   $ $0 $@
778
779 EOF
780 {
781 cat <<_ASUNAME
782 ## ---------- ##
783 ## Platform.  ##
784 ## ---------- ##
785
786 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
787 uname -m = `(uname -m) 2>/dev/null || echo unknown`
788 uname -r = `(uname -r) 2>/dev/null || echo unknown`
789 uname -s = `(uname -s) 2>/dev/null || echo unknown`
790 uname -v = `(uname -v) 2>/dev/null || echo unknown`
791
792 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
793 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
794
795 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
796 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
797 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
798 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
799 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
800 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
801 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
802
803 PATH = $PATH
804
805 _ASUNAME
806 } >&5
807
808 cat >&5 <<EOF
809 ## ------------ ##
810 ## Core tests.  ##
811 ## ------------ ##
812
813 EOF
814
815 # Keep a trace of the command line.
816 # Strip out --no-create and --no-recursion so they do not pile up.
817 # Also quote any args containing shell meta-characters.
818 ac_configure_args=
819 ac_sep=
820 for ac_arg
821 do
822   case "$ac_arg" in
823   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
824   | --no-cr | --no-c) ;;
825   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
826   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
827   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
828     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
829     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
830     ac_sep=" " ;;
831   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
832      ac_sep=" " ;;
833   esac
834   # Get rid of the leading space.
835 done
836
837 # When interrupted or exit'd, cleanup temporary files, and complete
838 # config.log.  We remove comments because anyway the quotes in there
839 # would cause problems or look ugly.
840 trap 'exit_status=$?
841   # Save into config.log some information that might help in debugging.
842   echo >&5
843   echo "## ----------------- ##" >&5
844   echo "## Cache variables.  ##" >&5
845   echo "## ----------------- ##" >&5
846   echo >&5
847   # The following way of writing the cache mishandles newlines in values,
848 {
849   (set) 2>&1 |
850     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
851     *ac_space=\ *)
852       sed -n \
853         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
854           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
855       ;;
856     *)
857       sed -n \
858         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
859       ;;
860     esac;
861 } >&5
862   sed "/^$/d" confdefs.h >conftest.log
863   if test -s conftest.log; then
864     echo >&5
865     echo "## ------------ ##" >&5
866     echo "## confdefs.h.  ##" >&5
867     echo "## ------------ ##" >&5
868     echo >&5
869     cat conftest.log >&5
870   fi
871   (echo; echo) >&5
872   test "$ac_signal" != 0 &&
873     echo "$as_me: caught signal $ac_signal" >&5
874   echo "$as_me: exit $exit_status" >&5
875   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
876     exit $exit_status
877      ' 0
878 for ac_signal in 1 2 13 15; do
879   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
880 done
881 ac_signal=0
882
883 # confdefs.h avoids OS command line length limits that DEFS can exceed.
884 rm -rf conftest* confdefs.h
885 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
886 echo >confdefs.h
887
888 # Let the site file select an alternate cache file if it wants to.
889 # Prefer explicitly selected file to automatically selected ones.
890 if test -z "$CONFIG_SITE"; then
891   if test "x$prefix" != xNONE; then
892     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
893   else
894     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
895   fi
896 fi
897 for ac_site_file in $CONFIG_SITE; do
898   if test -r "$ac_site_file"; then
899     { echo "$as_me:899: loading site script $ac_site_file" >&5
900 echo "$as_me: loading site script $ac_site_file" >&6;}
901     cat "$ac_site_file" >&5
902     . "$ac_site_file"
903   fi
904 done
905
906 if test -r "$cache_file"; then
907   # Some versions of bash will fail to source /dev/null (special
908   # files actually), so we avoid doing that.
909   if test -f "$cache_file"; then
910     { echo "$as_me:910: loading cache $cache_file" >&5
911 echo "$as_me: loading cache $cache_file" >&6;}
912     case $cache_file in
913       [\\/]* | ?:[\\/]* ) . $cache_file;;
914       *)                      . ./$cache_file;;
915     esac
916   fi
917 else
918   { echo "$as_me:918: creating cache $cache_file" >&5
919 echo "$as_me: creating cache $cache_file" >&6;}
920   >$cache_file
921 fi
922
923 # Check that the precious variables saved in the cache have kept the same
924 # value.
925 ac_cache_corrupted=false
926 for ac_var in `(set) 2>&1 |
927                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
928   eval ac_old_set=\$ac_cv_env_${ac_var}_set
929   eval ac_new_set=\$ac_env_${ac_var}_set
930   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
931   eval ac_new_val="\$ac_env_${ac_var}_value"
932   case "$ac_old_set,$ac_new_set" in
933     set,)
934       { echo "$as_me:934: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
935 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
936       ac_cache_corrupted=: ;;
937     ,set)
938       { echo "$as_me:938: error: \`$ac_var' was not set in the previous run" >&5
939 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
940       ac_cache_corrupted=: ;;
941     ,);;
942     *)
943       if test "x$ac_old_val" != "x$ac_new_val"; then
944         { echo "$as_me:944: error: \`$ac_var' has changed since the previous run:" >&5
945 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
946         { echo "$as_me:946:   former value:  $ac_old_val" >&5
947 echo "$as_me:   former value:  $ac_old_val" >&2;}
948         { echo "$as_me:948:   current value: $ac_new_val" >&5
949 echo "$as_me:   current value: $ac_new_val" >&2;}
950         ac_cache_corrupted=:
951       fi;;
952   esac
953   # Pass precious variables to config.status.  It doesn't matter if
954   # we pass some twice (in addition to the command line arguments).
955   if test "$ac_new_set" = set; then
956     case "$ac_new_val" in
957     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
958       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
959       ac_configure_args="$ac_configure_args '$ac_arg'"
960       ;;
961     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
962        ;;
963     esac
964   fi
965 done
966 if "$ac_cache_corrupted"; then
967   { echo "$as_me:967: error: changes in the environment can compromise the build" >&5
968 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
969   { { echo "$as_me:969: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
970 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
971    { (exit 1); exit 1; }; }
972 fi
973
974 ac_ext=c
975 ac_cpp='$CPP $CPPFLAGS'
976 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
977 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
978 ac_compiler_gnu=$ac_cv_c_compiler_gnu
979 ac_main_return="return"
980
981 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
982   *c*,-n*) ECHO_N=
983            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
984            ECHO_T='     '
985            ;;
986   *c*,*  ) ECHO_N=-n
987            ECHO_C=
988            ECHO_T=
989            ;;
990   *)       ECHO_N=
991            ECHO_C='\c'
992            ECHO_T=
993            ;;
994 esac
995 echo "#! $SHELL" >conftest.sh
996 echo  "exit 0"   >>conftest.sh
997 chmod +x conftest.sh
998 if { (echo "$as_me:998: PATH=\".;.\"; conftest.sh") >&5
999   (PATH=".;."; conftest.sh) 2>&5
1000   ac_status=$?
1001   echo "$as_me:1001: \$? = $ac_status" >&5
1002   (exit "$ac_status"); }; then
1003   ac_path_separator=';'
1004 else
1005   ac_path_separator=:
1006 fi
1007 PATH_SEPARATOR="$ac_path_separator"
1008 rm -f conftest.sh
1009
1010 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
1011
1012 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
1013
1014 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1015
1016 ac_aux_dir=
1017 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1018   if test -f "$ac_dir/install-sh"; then
1019     ac_aux_dir=$ac_dir
1020     ac_install_sh="$ac_aux_dir/install-sh -c"
1021     break
1022   elif test -f "$ac_dir/install.sh"; then
1023     ac_aux_dir=$ac_dir
1024     ac_install_sh="$ac_aux_dir/install.sh -c"
1025     break
1026   elif test -f "$ac_dir/shtool"; then
1027     ac_aux_dir=$ac_dir
1028     ac_install_sh="$ac_aux_dir/shtool install -c"
1029     break
1030   fi
1031 done
1032 if test -z "$ac_aux_dir"; then
1033   { { echo "$as_me:1033: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1034 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1035    { (exit 1); exit 1; }; }
1036 fi
1037 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1038 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1039 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1040
1041 # Make sure we can run config.sub.
1042 $ac_config_sub sun4 >/dev/null 2>&1 ||
1043   { { echo "$as_me:1043: error: cannot run $ac_config_sub" >&5
1044 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1045    { (exit 1); exit 1; }; }
1046
1047 echo "$as_me:1047: checking build system type" >&5
1048 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1049 if test "${ac_cv_build+set}" = set; then
1050   echo $ECHO_N "(cached) $ECHO_C" >&6
1051 else
1052   ac_cv_build_alias=$build_alias
1053 test -z "$ac_cv_build_alias" &&
1054   ac_cv_build_alias=`$ac_config_guess`
1055 test -z "$ac_cv_build_alias" &&
1056   { { echo "$as_me:1056: error: cannot guess build type; you must specify one" >&5
1057 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1058    { (exit 1); exit 1; }; }
1059 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1060   { { echo "$as_me:1060: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1061 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1062    { (exit 1); exit 1; }; }
1063
1064 fi
1065 echo "$as_me:1065: result: $ac_cv_build" >&5
1066 echo "${ECHO_T}$ac_cv_build" >&6
1067 build=$ac_cv_build
1068 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1069 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1070 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1071
1072 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1073         echo "$as_me:1073: checking host system type" >&5
1074 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1075 if test "${ac_cv_host+set}" = set; then
1076   echo $ECHO_N "(cached) $ECHO_C" >&6
1077 else
1078   ac_cv_host_alias=$host_alias
1079 test -z "$ac_cv_host_alias" &&
1080   ac_cv_host_alias=$ac_cv_build_alias
1081 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1082   { { echo "$as_me:1082: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1083 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1084    { (exit 1); exit 1; }; }
1085
1086 fi
1087 echo "$as_me:1087: result: $ac_cv_host" >&5
1088 echo "${ECHO_T}$ac_cv_host" >&6
1089 host=$ac_cv_host
1090 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1091 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1092 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1093
1094         system_name="$host_os"
1095 else
1096         system_name="`(uname -s -r) 2>/dev/null`"
1097         if test -z "$system_name" ; then
1098                 system_name="`(hostname) 2>/dev/null`"
1099         fi
1100 fi
1101 test -n "$system_name" &&
1102 cat >>confdefs.h <<EOF
1103 #define SYSTEM_NAME "$system_name"
1104 EOF
1105
1106 if test "${cf_cv_system_name+set}" = set; then
1107   echo $ECHO_N "(cached) $ECHO_C" >&6
1108 else
1109   cf_cv_system_name="$system_name"
1110 fi
1111
1112 test -z "$system_name" && system_name="$cf_cv_system_name"
1113 test -n "$cf_cv_system_name" && echo "$as_me:1113: result: Configuring for $cf_cv_system_name" >&5
1114 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1115
1116 if test ".$system_name" != ".$cf_cv_system_name" ; then
1117         echo "$as_me:1117: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1118 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1119         { { echo "$as_me:1119: error: \"Please remove config.cache and try again.\"" >&5
1120 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1121    { (exit 1); exit 1; }; }
1122 fi
1123
1124 test "$program_prefix" != NONE &&
1125   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1126 # Use a double $ so make ignores it.
1127 test "$program_suffix" != NONE &&
1128   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1129 # Double any \ or $.  echo might interpret backslashes.
1130 # By default was `s,x,x', remove it if useless.
1131 cat <<\_ACEOF >conftest.sed
1132 s/[\\$]/&&/g;s/;s,x,x,$//
1133 _ACEOF
1134 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1135 rm conftest.sed
1136
1137 echo "$as_me:1137: checking whether ${MAKE-make} sets \${MAKE}" >&5
1138 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1139 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1140 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1141   echo $ECHO_N "(cached) $ECHO_C" >&6
1142 else
1143   cat >conftest.make <<\EOF
1144 all:
1145         @echo 'ac_maketemp="${MAKE}"'
1146 EOF
1147 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1148 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1149 if test -n "$ac_maketemp"; then
1150   eval ac_cv_prog_make_${ac_make}_set=yes
1151 else
1152   eval ac_cv_prog_make_${ac_make}_set=no
1153 fi
1154 rm -f conftest.make
1155 fi
1156 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1157   echo "$as_me:1157: result: yes" >&5
1158 echo "${ECHO_T}yes" >&6
1159   SET_MAKE=
1160 else
1161   echo "$as_me:1161: result: no" >&5
1162 echo "${ECHO_T}no" >&6
1163   SET_MAKE="MAKE=${MAKE-make}"
1164 fi
1165
1166 ac_ext=c
1167 ac_cpp='$CPP $CPPFLAGS'
1168 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1169 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1170 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1171 ac_main_return="return"
1172 if test -n "$ac_tool_prefix"; then
1173   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1174 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1175 echo "$as_me:1175: checking for $ac_word" >&5
1176 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1177 if test "${ac_cv_prog_CC+set}" = set; then
1178   echo $ECHO_N "(cached) $ECHO_C" >&6
1179 else
1180   if test -n "$CC"; then
1181   ac_cv_prog_CC="$CC" # Let the user override the test.
1182 else
1183   ac_save_IFS=$IFS; IFS=$ac_path_separator
1184 ac_dummy="$PATH"
1185 for ac_dir in $ac_dummy; do
1186   IFS=$ac_save_IFS
1187   test -z "$ac_dir" && ac_dir=.
1188   $as_executable_p "$ac_dir/$ac_word" || continue
1189 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1190 echo "$as_me:1190: found $ac_dir/$ac_word" >&5
1191 break
1192 done
1193
1194 fi
1195 fi
1196 CC=$ac_cv_prog_CC
1197 if test -n "$CC"; then
1198   echo "$as_me:1198: result: $CC" >&5
1199 echo "${ECHO_T}$CC" >&6
1200 else
1201   echo "$as_me:1201: result: no" >&5
1202 echo "${ECHO_T}no" >&6
1203 fi
1204
1205 fi
1206 if test -z "$ac_cv_prog_CC"; then
1207   ac_ct_CC=$CC
1208   # Extract the first word of "gcc", so it can be a program name with args.
1209 set dummy gcc; ac_word=$2
1210 echo "$as_me:1210: checking for $ac_word" >&5
1211 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1212 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1213   echo $ECHO_N "(cached) $ECHO_C" >&6
1214 else
1215   if test -n "$ac_ct_CC"; then
1216   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1217 else
1218   ac_save_IFS=$IFS; IFS=$ac_path_separator
1219 ac_dummy="$PATH"
1220 for ac_dir in $ac_dummy; do
1221   IFS=$ac_save_IFS
1222   test -z "$ac_dir" && ac_dir=.
1223   $as_executable_p "$ac_dir/$ac_word" || continue
1224 ac_cv_prog_ac_ct_CC="gcc"
1225 echo "$as_me:1225: found $ac_dir/$ac_word" >&5
1226 break
1227 done
1228
1229 fi
1230 fi
1231 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1232 if test -n "$ac_ct_CC"; then
1233   echo "$as_me:1233: result: $ac_ct_CC" >&5
1234 echo "${ECHO_T}$ac_ct_CC" >&6
1235 else
1236   echo "$as_me:1236: result: no" >&5
1237 echo "${ECHO_T}no" >&6
1238 fi
1239
1240   CC=$ac_ct_CC
1241 else
1242   CC="$ac_cv_prog_CC"
1243 fi
1244
1245 if test -z "$CC"; then
1246   if test -n "$ac_tool_prefix"; then
1247   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1248 set dummy ${ac_tool_prefix}cc; ac_word=$2
1249 echo "$as_me:1249: checking for $ac_word" >&5
1250 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1251 if test "${ac_cv_prog_CC+set}" = set; then
1252   echo $ECHO_N "(cached) $ECHO_C" >&6
1253 else
1254   if test -n "$CC"; then
1255   ac_cv_prog_CC="$CC" # Let the user override the test.
1256 else
1257   ac_save_IFS=$IFS; IFS=$ac_path_separator
1258 ac_dummy="$PATH"
1259 for ac_dir in $ac_dummy; do
1260   IFS=$ac_save_IFS
1261   test -z "$ac_dir" && ac_dir=.
1262   $as_executable_p "$ac_dir/$ac_word" || continue
1263 ac_cv_prog_CC="${ac_tool_prefix}cc"
1264 echo "$as_me:1264: found $ac_dir/$ac_word" >&5
1265 break
1266 done
1267
1268 fi
1269 fi
1270 CC=$ac_cv_prog_CC
1271 if test -n "$CC"; then
1272   echo "$as_me:1272: result: $CC" >&5
1273 echo "${ECHO_T}$CC" >&6
1274 else
1275   echo "$as_me:1275: result: no" >&5
1276 echo "${ECHO_T}no" >&6
1277 fi
1278
1279 fi
1280 if test -z "$ac_cv_prog_CC"; then
1281   ac_ct_CC=$CC
1282   # Extract the first word of "cc", so it can be a program name with args.
1283 set dummy cc; ac_word=$2
1284 echo "$as_me:1284: checking for $ac_word" >&5
1285 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1286 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1287   echo $ECHO_N "(cached) $ECHO_C" >&6
1288 else
1289   if test -n "$ac_ct_CC"; then
1290   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1291 else
1292   ac_save_IFS=$IFS; IFS=$ac_path_separator
1293 ac_dummy="$PATH"
1294 for ac_dir in $ac_dummy; do
1295   IFS=$ac_save_IFS
1296   test -z "$ac_dir" && ac_dir=.
1297   $as_executable_p "$ac_dir/$ac_word" || continue
1298 ac_cv_prog_ac_ct_CC="cc"
1299 echo "$as_me:1299: found $ac_dir/$ac_word" >&5
1300 break
1301 done
1302
1303 fi
1304 fi
1305 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1306 if test -n "$ac_ct_CC"; then
1307   echo "$as_me:1307: result: $ac_ct_CC" >&5
1308 echo "${ECHO_T}$ac_ct_CC" >&6
1309 else
1310   echo "$as_me:1310: result: no" >&5
1311 echo "${ECHO_T}no" >&6
1312 fi
1313
1314   CC=$ac_ct_CC
1315 else
1316   CC="$ac_cv_prog_CC"
1317 fi
1318
1319 fi
1320 if test -z "$CC"; then
1321   # Extract the first word of "cc", so it can be a program name with args.
1322 set dummy cc; ac_word=$2
1323 echo "$as_me:1323: checking for $ac_word" >&5
1324 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1325 if test "${ac_cv_prog_CC+set}" = set; then
1326   echo $ECHO_N "(cached) $ECHO_C" >&6
1327 else
1328   if test -n "$CC"; then
1329   ac_cv_prog_CC="$CC" # Let the user override the test.
1330 else
1331   ac_prog_rejected=no
1332   ac_save_IFS=$IFS; IFS=$ac_path_separator
1333 ac_dummy="$PATH"
1334 for ac_dir in $ac_dummy; do
1335   IFS=$ac_save_IFS
1336   test -z "$ac_dir" && ac_dir=.
1337   $as_executable_p "$ac_dir/$ac_word" || continue
1338 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1339   ac_prog_rejected=yes
1340   continue
1341 fi
1342 ac_cv_prog_CC="cc"
1343 echo "$as_me:1343: found $ac_dir/$ac_word" >&5
1344 break
1345 done
1346
1347 if test "$ac_prog_rejected" = yes; then
1348   # We found a bogon in the path, so make sure we never use it.
1349   set dummy $ac_cv_prog_CC
1350   shift
1351   if test $# != 0; then
1352     # We chose a different compiler from the bogus one.
1353     # However, it has the same basename, so the bogon will be chosen
1354     # first if we set CC to just the basename; use the full file name.
1355     shift
1356     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1357     shift
1358     ac_cv_prog_CC="$@"
1359   fi
1360 fi
1361 fi
1362 fi
1363 CC=$ac_cv_prog_CC
1364 if test -n "$CC"; then
1365   echo "$as_me:1365: result: $CC" >&5
1366 echo "${ECHO_T}$CC" >&6
1367 else
1368   echo "$as_me:1368: result: no" >&5
1369 echo "${ECHO_T}no" >&6
1370 fi
1371
1372 fi
1373 if test -z "$CC"; then
1374   if test -n "$ac_tool_prefix"; then
1375   for ac_prog in cl
1376   do
1377     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1378 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1379 echo "$as_me:1379: checking for $ac_word" >&5
1380 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1381 if test "${ac_cv_prog_CC+set}" = set; then
1382   echo $ECHO_N "(cached) $ECHO_C" >&6
1383 else
1384   if test -n "$CC"; then
1385   ac_cv_prog_CC="$CC" # Let the user override the test.
1386 else
1387   ac_save_IFS=$IFS; IFS=$ac_path_separator
1388 ac_dummy="$PATH"
1389 for ac_dir in $ac_dummy; do
1390   IFS=$ac_save_IFS
1391   test -z "$ac_dir" && ac_dir=.
1392   $as_executable_p "$ac_dir/$ac_word" || continue
1393 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1394 echo "$as_me:1394: found $ac_dir/$ac_word" >&5
1395 break
1396 done
1397
1398 fi
1399 fi
1400 CC=$ac_cv_prog_CC
1401 if test -n "$CC"; then
1402   echo "$as_me:1402: result: $CC" >&5
1403 echo "${ECHO_T}$CC" >&6
1404 else
1405   echo "$as_me:1405: result: no" >&5
1406 echo "${ECHO_T}no" >&6
1407 fi
1408
1409     test -n "$CC" && break
1410   done
1411 fi
1412 if test -z "$CC"; then
1413   ac_ct_CC=$CC
1414   for ac_prog in cl
1415 do
1416   # Extract the first word of "$ac_prog", so it can be a program name with args.
1417 set dummy $ac_prog; ac_word=$2
1418 echo "$as_me:1418: checking for $ac_word" >&5
1419 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1420 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1421   echo $ECHO_N "(cached) $ECHO_C" >&6
1422 else
1423   if test -n "$ac_ct_CC"; then
1424   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1425 else
1426   ac_save_IFS=$IFS; IFS=$ac_path_separator
1427 ac_dummy="$PATH"
1428 for ac_dir in $ac_dummy; do
1429   IFS=$ac_save_IFS
1430   test -z "$ac_dir" && ac_dir=.
1431   $as_executable_p "$ac_dir/$ac_word" || continue
1432 ac_cv_prog_ac_ct_CC="$ac_prog"
1433 echo "$as_me:1433: found $ac_dir/$ac_word" >&5
1434 break
1435 done
1436
1437 fi
1438 fi
1439 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1440 if test -n "$ac_ct_CC"; then
1441   echo "$as_me:1441: result: $ac_ct_CC" >&5
1442 echo "${ECHO_T}$ac_ct_CC" >&6
1443 else
1444   echo "$as_me:1444: result: no" >&5
1445 echo "${ECHO_T}no" >&6
1446 fi
1447
1448   test -n "$ac_ct_CC" && break
1449 done
1450
1451   CC=$ac_ct_CC
1452 fi
1453
1454 fi
1455
1456 test -z "$CC" && { { echo "$as_me:1456: error: no acceptable cc found in \$PATH" >&5
1457 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1458    { (exit 1); exit 1; }; }
1459
1460 # Provide some information about the compiler.
1461 echo "$as_me:1461:" \
1462      "checking for C compiler version" >&5
1463 ac_compiler=`set X $ac_compile; echo "$2"`
1464 { (eval echo "$as_me:1464: \"$ac_compiler --version </dev/null >&5\"") >&5
1465   (eval $ac_compiler --version </dev/null >&5) 2>&5
1466   ac_status=$?
1467   echo "$as_me:1467: \$? = $ac_status" >&5
1468   (exit "$ac_status"); }
1469 { (eval echo "$as_me:1469: \"$ac_compiler -v </dev/null >&5\"") >&5
1470   (eval $ac_compiler -v </dev/null >&5) 2>&5
1471   ac_status=$?
1472   echo "$as_me:1472: \$? = $ac_status" >&5
1473   (exit "$ac_status"); }
1474 { (eval echo "$as_me:1474: \"$ac_compiler -V </dev/null >&5\"") >&5
1475   (eval $ac_compiler -V </dev/null >&5) 2>&5
1476   ac_status=$?
1477   echo "$as_me:1477: \$? = $ac_status" >&5
1478   (exit "$ac_status"); }
1479
1480 cat >"conftest.$ac_ext" <<_ACEOF
1481 #line 1481 "configure"
1482 #include "confdefs.h"
1483
1484 int
1485 main (void)
1486 {
1487
1488   ;
1489   return 0;
1490 }
1491 _ACEOF
1492 ac_clean_files_save=$ac_clean_files
1493 ac_clean_files="$ac_clean_files a.out a.exe"
1494 # Try to create an executable without -o first, disregard a.out.
1495 # It will help us diagnose broken compilers, and finding out an intuition
1496 # of exeext.
1497 echo "$as_me:1497: checking for C compiler default output" >&5
1498 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1499 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1500 if { (eval echo "$as_me:1500: \"$ac_link_default\"") >&5
1501   (eval $ac_link_default) 2>&5
1502   ac_status=$?
1503   echo "$as_me:1503: \$? = $ac_status" >&5
1504   (exit "$ac_status"); }; then
1505   # Find the output, starting from the most likely.  This scheme is
1506 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1507 # resort.
1508 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1509                 ls a.out conftest 2>/dev/null;
1510                 ls a.* conftest.* 2>/dev/null`; do
1511   case $ac_file in
1512     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1513     a.out ) # We found the default executable, but exeext='' is most
1514             # certainly right.
1515             break;;
1516     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1517           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1518           export ac_cv_exeext
1519           break;;
1520     * ) break;;
1521   esac
1522 done
1523 else
1524   echo "$as_me: failed program was:" >&5
1525 cat "conftest.$ac_ext" >&5
1526 { { echo "$as_me:1526: error: C compiler cannot create executables" >&5
1527 echo "$as_me: error: C compiler cannot create executables" >&2;}
1528    { (exit 77); exit 77; }; }
1529 fi
1530
1531 ac_exeext=$ac_cv_exeext
1532 echo "$as_me:1532: result: $ac_file" >&5
1533 echo "${ECHO_T}$ac_file" >&6
1534
1535 # Check the compiler produces executables we can run.  If not, either
1536 # the compiler is broken, or we cross compile.
1537 echo "$as_me:1537: checking whether the C compiler works" >&5
1538 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1539 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1540 # If not cross compiling, check that we can run a simple program.
1541 if test "$cross_compiling" != yes; then
1542   if { ac_try='./$ac_file'
1543   { (eval echo "$as_me:1543: \"$ac_try\"") >&5
1544   (eval $ac_try) 2>&5
1545   ac_status=$?
1546   echo "$as_me:1546: \$? = $ac_status" >&5
1547   (exit "$ac_status"); }; }; then
1548     cross_compiling=no
1549   else
1550     if test "$cross_compiling" = maybe; then
1551         cross_compiling=yes
1552     else
1553         { { echo "$as_me:1553: error: cannot run C compiled programs.
1554 If you meant to cross compile, use \`--host'." >&5
1555 echo "$as_me: error: cannot run C compiled programs.
1556 If you meant to cross compile, use \`--host'." >&2;}
1557    { (exit 1); exit 1; }; }
1558     fi
1559   fi
1560 fi
1561 echo "$as_me:1561: result: yes" >&5
1562 echo "${ECHO_T}yes" >&6
1563
1564 rm -f a.out a.exe "conftest$ac_cv_exeext"
1565 ac_clean_files=$ac_clean_files_save
1566 # Check the compiler produces executables we can run.  If not, either
1567 # the compiler is broken, or we cross compile.
1568 echo "$as_me:1568: checking whether we are cross compiling" >&5
1569 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1570 echo "$as_me:1570: result: $cross_compiling" >&5
1571 echo "${ECHO_T}$cross_compiling" >&6
1572
1573 echo "$as_me:1573: checking for executable suffix" >&5
1574 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1575 if { (eval echo "$as_me:1575: \"$ac_link\"") >&5
1576   (eval $ac_link) 2>&5
1577   ac_status=$?
1578   echo "$as_me:1578: \$? = $ac_status" >&5
1579   (exit "$ac_status"); }; then
1580   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1581 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1582 # work properly (i.e., refer to `conftest.exe'), while it won't with
1583 # `rm'.
1584 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1585   case $ac_file in
1586     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1587     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1588           export ac_cv_exeext
1589           break;;
1590     * ) break;;
1591   esac
1592 done
1593 else
1594   { { echo "$as_me:1594: error: cannot compute EXEEXT: cannot compile and link" >&5
1595 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1596    { (exit 1); exit 1; }; }
1597 fi
1598
1599 rm -f "conftest$ac_cv_exeext"
1600 echo "$as_me:1600: result: $ac_cv_exeext" >&5
1601 echo "${ECHO_T}$ac_cv_exeext" >&6
1602
1603 rm -f "conftest.$ac_ext"
1604 EXEEXT=$ac_cv_exeext
1605 ac_exeext=$EXEEXT
1606 echo "$as_me:1606: checking for object suffix" >&5
1607 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1608 if test "${ac_cv_objext+set}" = set; then
1609   echo $ECHO_N "(cached) $ECHO_C" >&6
1610 else
1611   cat >"conftest.$ac_ext" <<_ACEOF
1612 #line 1612 "configure"
1613 #include "confdefs.h"
1614
1615 int
1616 main (void)
1617 {
1618
1619   ;
1620   return 0;
1621 }
1622 _ACEOF
1623 rm -f conftest.o conftest.obj
1624 if { (eval echo "$as_me:1624: \"$ac_compile\"") >&5
1625   (eval $ac_compile) 2>&5
1626   ac_status=$?
1627   echo "$as_me:1627: \$? = $ac_status" >&5
1628   (exit "$ac_status"); }; then
1629   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1630   case $ac_file in
1631     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1632     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1633        break;;
1634   esac
1635 done
1636 else
1637   echo "$as_me: failed program was:" >&5
1638 cat "conftest.$ac_ext" >&5
1639 { { echo "$as_me:1639: error: cannot compute OBJEXT: cannot compile" >&5
1640 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1641    { (exit 1); exit 1; }; }
1642 fi
1643
1644 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1645 fi
1646 echo "$as_me:1646: result: $ac_cv_objext" >&5
1647 echo "${ECHO_T}$ac_cv_objext" >&6
1648 OBJEXT=$ac_cv_objext
1649 ac_objext=$OBJEXT
1650 echo "$as_me:1650: checking whether we are using the GNU C compiler" >&5
1651 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1652 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1653   echo $ECHO_N "(cached) $ECHO_C" >&6
1654 else
1655   cat >"conftest.$ac_ext" <<_ACEOF
1656 #line 1656 "configure"
1657 #include "confdefs.h"
1658
1659 int
1660 main (void)
1661 {
1662 #ifndef __GNUC__
1663        choke me
1664 #endif
1665
1666   ;
1667   return 0;
1668 }
1669 _ACEOF
1670 rm -f "conftest.$ac_objext"
1671 if { (eval echo "$as_me:1671: \"$ac_compile\"") >&5
1672   (eval $ac_compile) 2>&5
1673   ac_status=$?
1674   echo "$as_me:1674: \$? = $ac_status" >&5
1675   (exit "$ac_status"); } &&
1676          { ac_try='test -s "conftest.$ac_objext"'
1677   { (eval echo "$as_me:1677: \"$ac_try\"") >&5
1678   (eval $ac_try) 2>&5
1679   ac_status=$?
1680   echo "$as_me:1680: \$? = $ac_status" >&5
1681   (exit "$ac_status"); }; }; then
1682   ac_compiler_gnu=yes
1683 else
1684   echo "$as_me: failed program was:" >&5
1685 cat "conftest.$ac_ext" >&5
1686 ac_compiler_gnu=no
1687 fi
1688 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1689 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1690
1691 fi
1692 echo "$as_me:1692: result: $ac_cv_c_compiler_gnu" >&5
1693 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1694 GCC=`test $ac_compiler_gnu = yes && echo yes`
1695 ac_test_CFLAGS=${CFLAGS+set}
1696 ac_save_CFLAGS=$CFLAGS
1697 CFLAGS="-g"
1698 echo "$as_me:1698: checking whether $CC accepts -g" >&5
1699 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1700 if test "${ac_cv_prog_cc_g+set}" = set; then
1701   echo $ECHO_N "(cached) $ECHO_C" >&6
1702 else
1703   cat >"conftest.$ac_ext" <<_ACEOF
1704 #line 1704 "configure"
1705 #include "confdefs.h"
1706
1707 int
1708 main (void)
1709 {
1710
1711   ;
1712   return 0;
1713 }
1714 _ACEOF
1715 rm -f "conftest.$ac_objext"
1716 if { (eval echo "$as_me:1716: \"$ac_compile\"") >&5
1717   (eval $ac_compile) 2>&5
1718   ac_status=$?
1719   echo "$as_me:1719: \$? = $ac_status" >&5
1720   (exit "$ac_status"); } &&
1721          { ac_try='test -s "conftest.$ac_objext"'
1722   { (eval echo "$as_me:1722: \"$ac_try\"") >&5
1723   (eval $ac_try) 2>&5
1724   ac_status=$?
1725   echo "$as_me:1725: \$? = $ac_status" >&5
1726   (exit "$ac_status"); }; }; then
1727   ac_cv_prog_cc_g=yes
1728 else
1729   echo "$as_me: failed program was:" >&5
1730 cat "conftest.$ac_ext" >&5
1731 ac_cv_prog_cc_g=no
1732 fi
1733 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1734 fi
1735 echo "$as_me:1735: result: $ac_cv_prog_cc_g" >&5
1736 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1737 if test "$ac_test_CFLAGS" = set; then
1738   CFLAGS=$ac_save_CFLAGS
1739 elif test $ac_cv_prog_cc_g = yes; then
1740   if test "$GCC" = yes; then
1741     CFLAGS="-g -O2"
1742   else
1743     CFLAGS="-g"
1744   fi
1745 else
1746   if test "$GCC" = yes; then
1747     CFLAGS="-O2"
1748   else
1749     CFLAGS=
1750   fi
1751 fi
1752 # Some people use a C++ compiler to compile C.  Since we use `exit',
1753 # in C++ we need to declare it.  In case someone uses the same compiler
1754 # for both compiling C and C++ we need to have the C++ compiler decide
1755 # the declaration of exit, since it's the most demanding environment.
1756 cat >"conftest.$ac_ext" <<_ACEOF
1757 #ifndef __cplusplus
1758   choke me
1759 #endif
1760 _ACEOF
1761 rm -f "conftest.$ac_objext"
1762 if { (eval echo "$as_me:1762: \"$ac_compile\"") >&5
1763   (eval $ac_compile) 2>&5
1764   ac_status=$?
1765   echo "$as_me:1765: \$? = $ac_status" >&5
1766   (exit "$ac_status"); } &&
1767          { ac_try='test -s "conftest.$ac_objext"'
1768   { (eval echo "$as_me:1768: \"$ac_try\"") >&5
1769   (eval $ac_try) 2>&5
1770   ac_status=$?
1771   echo "$as_me:1771: \$? = $ac_status" >&5
1772   (exit "$ac_status"); }; }; then
1773   for ac_declaration in \
1774    ''\
1775    '#include <stdlib.h>' \
1776    'extern "C" void std::exit (int) throw (); using std::exit;' \
1777    'extern "C" void std::exit (int); using std::exit;' \
1778    'extern "C" void exit (int) throw ();' \
1779    'extern "C" void exit (int);' \
1780    'void exit (int);'
1781 do
1782   cat >"conftest.$ac_ext" <<_ACEOF
1783 #line 1783 "configure"
1784 #include "confdefs.h"
1785 #include <stdlib.h>
1786 $ac_declaration
1787 int
1788 main (void)
1789 {
1790 exit (42);
1791   ;
1792   return 0;
1793 }
1794 _ACEOF
1795 rm -f "conftest.$ac_objext"
1796 if { (eval echo "$as_me:1796: \"$ac_compile\"") >&5
1797   (eval $ac_compile) 2>&5
1798   ac_status=$?
1799   echo "$as_me:1799: \$? = $ac_status" >&5
1800   (exit "$ac_status"); } &&
1801          { ac_try='test -s "conftest.$ac_objext"'
1802   { (eval echo "$as_me:1802: \"$ac_try\"") >&5
1803   (eval $ac_try) 2>&5
1804   ac_status=$?
1805   echo "$as_me:1805: \$? = $ac_status" >&5
1806   (exit "$ac_status"); }; }; then
1807   :
1808 else
1809   echo "$as_me: failed program was:" >&5
1810 cat "conftest.$ac_ext" >&5
1811 continue
1812 fi
1813 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1814   cat >"conftest.$ac_ext" <<_ACEOF
1815 #line 1815 "configure"
1816 #include "confdefs.h"
1817 $ac_declaration
1818 int
1819 main (void)
1820 {
1821 exit (42);
1822   ;
1823   return 0;
1824 }
1825 _ACEOF
1826 rm -f "conftest.$ac_objext"
1827 if { (eval echo "$as_me:1827: \"$ac_compile\"") >&5
1828   (eval $ac_compile) 2>&5
1829   ac_status=$?
1830   echo "$as_me:1830: \$? = $ac_status" >&5
1831   (exit "$ac_status"); } &&
1832          { ac_try='test -s "conftest.$ac_objext"'
1833   { (eval echo "$as_me:1833: \"$ac_try\"") >&5
1834   (eval $ac_try) 2>&5
1835   ac_status=$?
1836   echo "$as_me:1836: \$? = $ac_status" >&5
1837   (exit "$ac_status"); }; }; then
1838   break
1839 else
1840   echo "$as_me: failed program was:" >&5
1841 cat "conftest.$ac_ext" >&5
1842 fi
1843 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1844 done
1845 rm -rf conftest*
1846 if test -n "$ac_declaration"; then
1847   echo '#ifdef __cplusplus' >>confdefs.h
1848   echo "$ac_declaration"    >>confdefs.h
1849   echo '#endif'             >>confdefs.h
1850 fi
1851
1852 else
1853   echo "$as_me: failed program was:" >&5
1854 cat "conftest.$ac_ext" >&5
1855 fi
1856 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1857 ac_ext=c
1858 ac_cpp='$CPP $CPPFLAGS'
1859 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1860 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1861 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1862 ac_main_return="return"
1863
1864 GCC_VERSION=none
1865 if test "$GCC" = yes ; then
1866         echo "$as_me:1866: checking version of $CC" >&5
1867 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1868         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.].*//'`"
1869         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1870         echo "$as_me:1870: result: $GCC_VERSION" >&5
1871 echo "${ECHO_T}$GCC_VERSION" >&6
1872 fi
1873
1874 INTEL_COMPILER=no
1875
1876 if test "$GCC" = yes ; then
1877         case "$host_os" in
1878         (linux*|gnu*)
1879                 echo "$as_me:1879: checking if this is really Intel C compiler" >&5
1880 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1881                 cf_save_CFLAGS="$CFLAGS"
1882                 CFLAGS="$CFLAGS -no-gcc"
1883                 cat >"conftest.$ac_ext" <<_ACEOF
1884 #line 1884 "configure"
1885 #include "confdefs.h"
1886
1887 int
1888 main (void)
1889 {
1890
1891 #ifdef __INTEL_COMPILER
1892 #else
1893 make an error
1894 #endif
1895
1896   ;
1897   return 0;
1898 }
1899 _ACEOF
1900 rm -f "conftest.$ac_objext"
1901 if { (eval echo "$as_me:1901: \"$ac_compile\"") >&5
1902   (eval $ac_compile) 2>&5
1903   ac_status=$?
1904   echo "$as_me:1904: \$? = $ac_status" >&5
1905   (exit "$ac_status"); } &&
1906          { ac_try='test -s "conftest.$ac_objext"'
1907   { (eval echo "$as_me:1907: \"$ac_try\"") >&5
1908   (eval $ac_try) 2>&5
1909   ac_status=$?
1910   echo "$as_me:1910: \$? = $ac_status" >&5
1911   (exit "$ac_status"); }; }; then
1912   INTEL_COMPILER=yes
1913 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1914
1915 else
1916   echo "$as_me: failed program was:" >&5
1917 cat "conftest.$ac_ext" >&5
1918 fi
1919 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1920                 CFLAGS="$cf_save_CFLAGS"
1921                 echo "$as_me:1921: result: $INTEL_COMPILER" >&5
1922 echo "${ECHO_T}$INTEL_COMPILER" >&6
1923                 ;;
1924         esac
1925 fi
1926
1927 CLANG_COMPILER=no
1928
1929 if test "$GCC" = yes ; then
1930         echo "$as_me:1930: checking if this is really Clang C compiler" >&5
1931 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1932         cf_save_CFLAGS="$CFLAGS"
1933         cat >"conftest.$ac_ext" <<_ACEOF
1934 #line 1934 "configure"
1935 #include "confdefs.h"
1936
1937 int
1938 main (void)
1939 {
1940
1941 #ifdef __clang__
1942 #else
1943 make an error
1944 #endif
1945
1946   ;
1947   return 0;
1948 }
1949 _ACEOF
1950 rm -f "conftest.$ac_objext"
1951 if { (eval echo "$as_me:1951: \"$ac_compile\"") >&5
1952   (eval $ac_compile) 2>&5
1953   ac_status=$?
1954   echo "$as_me:1954: \$? = $ac_status" >&5
1955   (exit "$ac_status"); } &&
1956          { ac_try='test -s "conftest.$ac_objext"'
1957   { (eval echo "$as_me:1957: \"$ac_try\"") >&5
1958   (eval $ac_try) 2>&5
1959   ac_status=$?
1960   echo "$as_me:1960: \$? = $ac_status" >&5
1961   (exit "$ac_status"); }; }; then
1962   CLANG_COMPILER=yes
1963
1964 else
1965   echo "$as_me: failed program was:" >&5
1966 cat "conftest.$ac_ext" >&5
1967 fi
1968 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1969         CFLAGS="$cf_save_CFLAGS"
1970         echo "$as_me:1970: result: $CLANG_COMPILER" >&5
1971 echo "${ECHO_T}$CLANG_COMPILER" >&6
1972 fi
1973
1974 CLANG_VERSION=none
1975
1976 if test "x$CLANG_COMPILER" = "xyes" ; then
1977         case "$CC" in
1978         (c[1-9][0-9]|*/c[1-9][0-9])
1979                 { echo "$as_me:1979: WARNING: replacing broken compiler alias $CC" >&5
1980 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1981                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1982                 CC=clang
1983                 ;;
1984         esac
1985
1986         echo "$as_me:1986: checking version of $CC" >&5
1987 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1988         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1989         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1990         echo "$as_me:1990: result: $CLANG_VERSION" >&5
1991 echo "${ECHO_T}$CLANG_VERSION" >&6
1992
1993         for cf_clang_opt in \
1994                 -Qunused-arguments \
1995                 -Wno-error=implicit-function-declaration
1996         do
1997                 echo "$as_me:1997: checking if option $cf_clang_opt works" >&5
1998 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1999                 cf_save_CFLAGS="$CFLAGS"
2000                 CFLAGS="$CFLAGS $cf_clang_opt"
2001                 cat >"conftest.$ac_ext" <<_ACEOF
2002 #line 2002 "configure"
2003 #include "confdefs.h"
2004
2005                         #include <stdio.h>
2006 int
2007 main (void)
2008 {
2009
2010                         printf("hello!\\n");
2011   ;
2012   return 0;
2013 }
2014 _ACEOF
2015 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2016 if { (eval echo "$as_me:2016: \"$ac_link\"") >&5
2017   (eval $ac_link) 2>&5
2018   ac_status=$?
2019   echo "$as_me:2019: \$? = $ac_status" >&5
2020   (exit "$ac_status"); } &&
2021          { ac_try='test -s "conftest$ac_exeext"'
2022   { (eval echo "$as_me:2022: \"$ac_try\"") >&5
2023   (eval $ac_try) 2>&5
2024   ac_status=$?
2025   echo "$as_me:2025: \$? = $ac_status" >&5
2026   (exit "$ac_status"); }; }; then
2027
2028                         cf_clang_optok=yes
2029 else
2030   echo "$as_me: failed program was:" >&5
2031 cat "conftest.$ac_ext" >&5
2032
2033                         cf_clang_optok=no
2034 fi
2035 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2036                 echo "$as_me:2036: result: $cf_clang_optok" >&5
2037 echo "${ECHO_T}$cf_clang_optok" >&6
2038                 CFLAGS="$cf_save_CFLAGS"
2039                 if test "$cf_clang_optok" = yes; then
2040                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2041
2042 echo "${as_me:-configure}:2042: testing adding option $cf_clang_opt ..." 1>&5
2043
2044         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2045         CFLAGS="${CFLAGS}$cf_clang_opt"
2046
2047                 fi
2048         done
2049 fi
2050
2051 echo "$as_me:2051: checking for $CC option to accept ANSI C" >&5
2052 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2053 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2054   echo $ECHO_N "(cached) $ECHO_C" >&6
2055 else
2056   ac_cv_prog_cc_stdc=no
2057 ac_save_CC=$CC
2058 cat >"conftest.$ac_ext" <<_ACEOF
2059 #line 2059 "configure"
2060 #include "confdefs.h"
2061 #include <stdarg.h>
2062 #include <stdio.h>
2063 #include <sys/types.h>
2064 #include <sys/stat.h>
2065 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2066 struct buf { int x; };
2067 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2068 static char *e (p, i)
2069      char **p;
2070      int i;
2071 {
2072   return p[i];
2073 }
2074 static char *f (char * (*g) (char **, int), char **p, ...)
2075 {
2076   char *s;
2077   va_list v;
2078   va_start (v,p);
2079   s = g (p, va_arg (v,int));
2080   va_end (v);
2081   return s;
2082 }
2083 int test (int i, double x);
2084 struct s1 {int (*f) (int a);};
2085 struct s2 {int (*f) (double a);};
2086 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2087 int argc;
2088 char **argv;
2089 int
2090 main (void)
2091 {
2092 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2093   ;
2094   return 0;
2095 }
2096 _ACEOF
2097 # Don't try gcc -ansi; that turns off useful extensions and
2098 # breaks some systems' header files.
2099 # AIX                   -qlanglvl=ansi
2100 # Ultrix and OSF/1      -std1
2101 # HP-UX 10.20 and later -Ae
2102 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2103 # SVR4                  -Xc -D__EXTENSIONS__
2104 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2105 do
2106   CC="$ac_save_CC $ac_arg"
2107   rm -f "conftest.$ac_objext"
2108 if { (eval echo "$as_me:2108: \"$ac_compile\"") >&5
2109   (eval $ac_compile) 2>&5
2110   ac_status=$?
2111   echo "$as_me:2111: \$? = $ac_status" >&5
2112   (exit "$ac_status"); } &&
2113          { ac_try='test -s "conftest.$ac_objext"'
2114   { (eval echo "$as_me:2114: \"$ac_try\"") >&5
2115   (eval $ac_try) 2>&5
2116   ac_status=$?
2117   echo "$as_me:2117: \$? = $ac_status" >&5
2118   (exit "$ac_status"); }; }; then
2119   ac_cv_prog_cc_stdc=$ac_arg
2120 break
2121 else
2122   echo "$as_me: failed program was:" >&5
2123 cat "conftest.$ac_ext" >&5
2124 fi
2125 rm -f "conftest.$ac_objext"
2126 done
2127 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2128 CC=$ac_save_CC
2129
2130 fi
2131
2132 case "x$ac_cv_prog_cc_stdc" in
2133   x|xno)
2134     echo "$as_me:2134: result: none needed" >&5
2135 echo "${ECHO_T}none needed" >&6 ;;
2136   *)
2137     echo "$as_me:2137: result: $ac_cv_prog_cc_stdc" >&5
2138 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2139     CC="$CC $ac_cv_prog_cc_stdc" ;;
2140 esac
2141
2142 # This should have been defined by AC_PROG_CC
2143 : "${CC:=cc}"
2144
2145 echo "$as_me:2145: checking \$CFLAGS variable" >&5
2146 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2147 case "x$CFLAGS" in
2148 (*-[IUD]*)
2149         echo "$as_me:2149: result: broken" >&5
2150 echo "${ECHO_T}broken" >&6
2151         { echo "$as_me:2151: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2152 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2153         cf_flags="$CFLAGS"
2154         CFLAGS=
2155         for cf_arg in $cf_flags
2156         do
2157
2158 cf_fix_cppflags=no
2159 cf_new_cflags=
2160 cf_new_cppflags=
2161 cf_new_extra_cppflags=
2162
2163 for cf_add_cflags in $cf_arg
2164 do
2165 case "$cf_fix_cppflags" in
2166 (no)
2167         case "$cf_add_cflags" in
2168         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2169                 case "$cf_add_cflags" in
2170                 (-D*)
2171                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2172
2173                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2174                                 && test -z "${cf_tst_cflags}" \
2175                                 && cf_fix_cppflags=yes
2176
2177                         if test "$cf_fix_cppflags" = yes ; then
2178
2179         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2180         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2181
2182                                 continue
2183                         elif test "${cf_tst_cflags}" = "\"'" ; then
2184
2185         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2186         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2187
2188                                 continue
2189                         fi
2190                         ;;
2191                 esac
2192                 case "$CPPFLAGS" in
2193                 (*$cf_add_cflags)
2194                         ;;
2195                 (*)
2196                         case "$cf_add_cflags" in
2197                         (-D*)
2198                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2199
2200 CPPFLAGS=`echo "$CPPFLAGS" | \
2201         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2202                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2203
2204                                 ;;
2205                         esac
2206
2207         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2208         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2209
2210                         ;;
2211                 esac
2212                 ;;
2213         (*)
2214
2215         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2216         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2217
2218                 ;;
2219         esac
2220         ;;
2221 (yes)
2222
2223         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2224         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2225
2226         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2227
2228         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2229                 && test -z "${cf_tst_cflags}" \
2230                 && cf_fix_cppflags=no
2231         ;;
2232 esac
2233 done
2234
2235 if test -n "$cf_new_cflags" ; then
2236
2237         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2238         CFLAGS="${CFLAGS}$cf_new_cflags"
2239
2240 fi
2241
2242 if test -n "$cf_new_cppflags" ; then
2243
2244         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2245         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2246
2247 fi
2248
2249 if test -n "$cf_new_extra_cppflags" ; then
2250
2251         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2252         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2253
2254 fi
2255
2256         done
2257         ;;
2258 (*)
2259         echo "$as_me:2259: result: ok" >&5
2260 echo "${ECHO_T}ok" >&6
2261         ;;
2262 esac
2263
2264 echo "$as_me:2264: checking \$CC variable" >&5
2265 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2266 case "$CC" in
2267 (*[\ \  ]-*)
2268         echo "$as_me:2268: result: broken" >&5
2269 echo "${ECHO_T}broken" >&6
2270         { echo "$as_me:2270: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2271 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2272         # humor him...
2273         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2274         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2275         CC="$cf_prog"
2276         for cf_arg in $cf_flags
2277         do
2278                 case "x$cf_arg" in
2279                 (x-[IUDfgOW]*)
2280
2281 cf_fix_cppflags=no
2282 cf_new_cflags=
2283 cf_new_cppflags=
2284 cf_new_extra_cppflags=
2285
2286 for cf_add_cflags in $cf_arg
2287 do
2288 case "$cf_fix_cppflags" in
2289 (no)
2290         case "$cf_add_cflags" in
2291         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2292                 case "$cf_add_cflags" in
2293                 (-D*)
2294                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2295
2296                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2297                                 && test -z "${cf_tst_cflags}" \
2298                                 && cf_fix_cppflags=yes
2299
2300                         if test "$cf_fix_cppflags" = yes ; then
2301
2302         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2303         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2304
2305                                 continue
2306                         elif test "${cf_tst_cflags}" = "\"'" ; then
2307
2308         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2309         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2310
2311                                 continue
2312                         fi
2313                         ;;
2314                 esac
2315                 case "$CPPFLAGS" in
2316                 (*$cf_add_cflags)
2317                         ;;
2318                 (*)
2319                         case "$cf_add_cflags" in
2320                         (-D*)
2321                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2322
2323 CPPFLAGS=`echo "$CPPFLAGS" | \
2324         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2325                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2326
2327                                 ;;
2328                         esac
2329
2330         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2331         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2332
2333                         ;;
2334                 esac
2335                 ;;
2336         (*)
2337
2338         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2339         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2340
2341                 ;;
2342         esac
2343         ;;
2344 (yes)
2345
2346         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2347         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2348
2349         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2350
2351         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2352                 && test -z "${cf_tst_cflags}" \
2353                 && cf_fix_cppflags=no
2354         ;;
2355 esac
2356 done
2357
2358 if test -n "$cf_new_cflags" ; then
2359
2360         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2361         CFLAGS="${CFLAGS}$cf_new_cflags"
2362
2363 fi
2364
2365 if test -n "$cf_new_cppflags" ; then
2366
2367         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2368         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2369
2370 fi
2371
2372 if test -n "$cf_new_extra_cppflags" ; then
2373
2374         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2375         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2376
2377 fi
2378
2379                         ;;
2380                 (*)
2381                         CC="$CC $cf_arg"
2382                         ;;
2383                 esac
2384         done
2385         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2386
2387 echo "${as_me:-configure}:2387: testing resulting CC: '$CC' ..." 1>&5
2388
2389         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2390
2391 echo "${as_me:-configure}:2391: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2392
2393         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2394
2395 echo "${as_me:-configure}:2395: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2396
2397         ;;
2398 (*)
2399         echo "$as_me:2399: result: ok" >&5
2400 echo "${ECHO_T}ok" >&6
2401         ;;
2402 esac
2403
2404 echo "$as_me:2404: checking for inline" >&5
2405 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2406 if test "${ac_cv_c_inline+set}" = set; then
2407   echo $ECHO_N "(cached) $ECHO_C" >&6
2408 else
2409   ac_cv_c_inline=no
2410 for ac_kw in inline __inline__ __inline; do
2411   cat >"conftest.$ac_ext" <<_ACEOF
2412 #line 2412 "configure"
2413 #include "confdefs.h"
2414 #ifndef __cplusplus
2415 static $ac_kw int static_foo () {return 0; }
2416 $ac_kw int foo () {return 0; }
2417 #endif
2418
2419 _ACEOF
2420 rm -f "conftest.$ac_objext"
2421 if { (eval echo "$as_me:2421: \"$ac_compile\"") >&5
2422   (eval $ac_compile) 2>&5
2423   ac_status=$?
2424   echo "$as_me:2424: \$? = $ac_status" >&5
2425   (exit "$ac_status"); } &&
2426          { ac_try='test -s "conftest.$ac_objext"'
2427   { (eval echo "$as_me:2427: \"$ac_try\"") >&5
2428   (eval $ac_try) 2>&5
2429   ac_status=$?
2430   echo "$as_me:2430: \$? = $ac_status" >&5
2431   (exit "$ac_status"); }; }; then
2432   ac_cv_c_inline=$ac_kw; break
2433 else
2434   echo "$as_me: failed program was:" >&5
2435 cat "conftest.$ac_ext" >&5
2436 fi
2437 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2438 done
2439
2440 fi
2441 echo "$as_me:2441: result: $ac_cv_c_inline" >&5
2442 echo "${ECHO_T}$ac_cv_c_inline" >&6
2443 case $ac_cv_c_inline in
2444   inline | yes) ;;
2445   no)
2446 cat >>confdefs.h <<\EOF
2447 #define inline
2448 EOF
2449  ;;
2450   *)  cat >>confdefs.h <<EOF
2451 #define inline $ac_cv_c_inline
2452 EOF
2453  ;;
2454 esac
2455
2456 for ac_prog in ggrep grep
2457 do
2458   # Extract the first word of "$ac_prog", so it can be a program name with args.
2459 set dummy $ac_prog; ac_word=$2
2460 echo "$as_me:2460: checking for $ac_word" >&5
2461 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2462 if test "${ac_cv_prog_GREP+set}" = set; then
2463   echo $ECHO_N "(cached) $ECHO_C" >&6
2464 else
2465   if test -n "$GREP"; then
2466   ac_cv_prog_GREP="$GREP" # Let the user override the test.
2467 else
2468   ac_save_IFS=$IFS; IFS=$ac_path_separator
2469 ac_dummy="$PATH"
2470 for ac_dir in $ac_dummy; do
2471   IFS=$ac_save_IFS
2472   test -z "$ac_dir" && ac_dir=.
2473   $as_executable_p "$ac_dir/$ac_word" || continue
2474 ac_cv_prog_GREP="$ac_prog"
2475 echo "$as_me:2475: found $ac_dir/$ac_word" >&5
2476 break
2477 done
2478
2479 fi
2480 fi
2481 GREP=$ac_cv_prog_GREP
2482 if test -n "$GREP"; then
2483   echo "$as_me:2483: result: $GREP" >&5
2484 echo "${ECHO_T}$GREP" >&6
2485 else
2486   echo "$as_me:2486: result: no" >&5
2487 echo "${ECHO_T}no" >&6
2488 fi
2489
2490   test -n "$GREP" && break
2491 done
2492 test -n "$GREP" || GREP=": "
2493
2494 echo "$as_me:2494: checking for egrep" >&5
2495 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2496 if test "${ac_cv_path_EGREP+set}" = set; then
2497   echo $ECHO_N "(cached) $ECHO_C" >&6
2498 else
2499   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2500    then ac_cv_path_EGREP="$GREP -E"
2501    else
2502      for ac_prog in gegrep egrep
2503 do
2504   # Extract the first word of "$ac_prog", so it can be a program name with args.
2505 set dummy $ac_prog; ac_word=$2
2506 echo "$as_me:2506: checking for $ac_word" >&5
2507 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2508 if test "${ac_cv_path_EGREP+set}" = set; then
2509   echo $ECHO_N "(cached) $ECHO_C" >&6
2510 else
2511   case $EGREP in
2512   [\\/]* | ?:[\\/]*)
2513   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2514   ;;
2515   *)
2516   ac_save_IFS=$IFS; IFS=$ac_path_separator
2517 ac_dummy="$PATH"
2518 for ac_dir in $ac_dummy; do
2519   IFS=$ac_save_IFS
2520   test -z "$ac_dir" && ac_dir=.
2521   if $as_executable_p "$ac_dir/$ac_word"; then
2522    ac_cv_path_EGREP="$ac_dir/$ac_word"
2523    echo "$as_me:2523: found $ac_dir/$ac_word" >&5
2524    break
2525 fi
2526 done
2527
2528   ;;
2529 esac
2530 fi
2531 EGREP=$ac_cv_path_EGREP
2532
2533 if test -n "$EGREP"; then
2534   echo "$as_me:2534: result: $EGREP" >&5
2535 echo "${ECHO_T}$EGREP" >&6
2536 else
2537   echo "$as_me:2537: result: no" >&5
2538 echo "${ECHO_T}no" >&6
2539 fi
2540
2541   test -n "$EGREP" && break
2542 done
2543 test -n "$EGREP" || EGREP=": "
2544
2545      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2545: error: cannot find workable egrep" >&5
2546 echo "$as_me: error: cannot find workable egrep" >&2;}
2547    { (exit 1); exit 1; }; }
2548    fi
2549 fi
2550 echo "$as_me:2550: result: $ac_cv_path_EGREP" >&5
2551 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2552  EGREP="$ac_cv_path_EGREP"
2553
2554 ac_ext=c
2555 ac_cpp='$CPP $CPPFLAGS'
2556 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2557 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2558 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2559 ac_main_return="return"
2560 echo "$as_me:2560: checking how to run the C preprocessor" >&5
2561 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2562 # On Suns, sometimes $CPP names a directory.
2563 if test -n "$CPP" && test -d "$CPP"; then
2564   CPP=
2565 fi
2566 if test -z "$CPP"; then
2567   if test "${ac_cv_prog_CPP+set}" = set; then
2568   echo $ECHO_N "(cached) $ECHO_C" >&6
2569 else
2570       # Double quotes because CPP needs to be expanded
2571     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2572     do
2573       ac_preproc_ok=false
2574 for ac_c_preproc_warn_flag in '' yes
2575 do
2576   # Use a header file that comes with gcc, so configuring glibc
2577   # with a fresh cross-compiler works.
2578   # On the NeXT, cc -E runs the code through the compiler's parser,
2579   # not just through cpp. "Syntax error" is here to catch this case.
2580   cat >"conftest.$ac_ext" <<_ACEOF
2581 #line 2581 "configure"
2582 #include "confdefs.h"
2583 #include <assert.h>
2584                      Syntax error
2585 _ACEOF
2586 if { (eval echo "$as_me:2586: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2587   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2588   ac_status=$?
2589   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2590   rm -f conftest.er1
2591   cat conftest.err >&5
2592   echo "$as_me:2592: \$? = $ac_status" >&5
2593   (exit "$ac_status"); } >/dev/null; then
2594   if test -s conftest.err; then
2595     ac_cpp_err=$ac_c_preproc_warn_flag
2596   else
2597     ac_cpp_err=
2598   fi
2599 else
2600   ac_cpp_err=yes
2601 fi
2602 if test -z "$ac_cpp_err"; then
2603   :
2604 else
2605   echo "$as_me: failed program was:" >&5
2606   cat "conftest.$ac_ext" >&5
2607   # Broken: fails on valid input.
2608 continue
2609 fi
2610 rm -f conftest.err "conftest.$ac_ext"
2611
2612   # OK, works on sane cases.  Now check whether non-existent headers
2613   # can be detected and how.
2614   cat >"conftest.$ac_ext" <<_ACEOF
2615 #line 2615 "configure"
2616 #include "confdefs.h"
2617 #include <ac_nonexistent.h>
2618 _ACEOF
2619 if { (eval echo "$as_me:2619: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2620   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2621   ac_status=$?
2622   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2623   rm -f conftest.er1
2624   cat conftest.err >&5
2625   echo "$as_me:2625: \$? = $ac_status" >&5
2626   (exit "$ac_status"); } >/dev/null; then
2627   if test -s conftest.err; then
2628     ac_cpp_err=$ac_c_preproc_warn_flag
2629   else
2630     ac_cpp_err=
2631   fi
2632 else
2633   ac_cpp_err=yes
2634 fi
2635 if test -z "$ac_cpp_err"; then
2636   # Broken: success on invalid input.
2637 continue
2638 else
2639   echo "$as_me: failed program was:" >&5
2640   cat "conftest.$ac_ext" >&5
2641   # Passes both tests.
2642 ac_preproc_ok=:
2643 break
2644 fi
2645 rm -f conftest.err "conftest.$ac_ext"
2646
2647 done
2648 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2649 rm -f conftest.err "conftest.$ac_ext"
2650 if $ac_preproc_ok; then
2651   break
2652 fi
2653
2654     done
2655     ac_cv_prog_CPP=$CPP
2656
2657 fi
2658   CPP=$ac_cv_prog_CPP
2659 else
2660   ac_cv_prog_CPP=$CPP
2661 fi
2662 echo "$as_me:2662: result: $CPP" >&5
2663 echo "${ECHO_T}$CPP" >&6
2664 ac_preproc_ok=false
2665 for ac_c_preproc_warn_flag in '' yes
2666 do
2667   # Use a header file that comes with gcc, so configuring glibc
2668   # with a fresh cross-compiler works.
2669   # On the NeXT, cc -E runs the code through the compiler's parser,
2670   # not just through cpp. "Syntax error" is here to catch this case.
2671   cat >"conftest.$ac_ext" <<_ACEOF
2672 #line 2672 "configure"
2673 #include "confdefs.h"
2674 #include <assert.h>
2675                      Syntax error
2676 _ACEOF
2677 if { (eval echo "$as_me:2677: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2678   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2679   ac_status=$?
2680   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2681   rm -f conftest.er1
2682   cat conftest.err >&5
2683   echo "$as_me:2683: \$? = $ac_status" >&5
2684   (exit "$ac_status"); } >/dev/null; then
2685   if test -s conftest.err; then
2686     ac_cpp_err=$ac_c_preproc_warn_flag
2687   else
2688     ac_cpp_err=
2689   fi
2690 else
2691   ac_cpp_err=yes
2692 fi
2693 if test -z "$ac_cpp_err"; then
2694   :
2695 else
2696   echo "$as_me: failed program was:" >&5
2697   cat "conftest.$ac_ext" >&5
2698   # Broken: fails on valid input.
2699 continue
2700 fi
2701 rm -f conftest.err "conftest.$ac_ext"
2702
2703   # OK, works on sane cases.  Now check whether non-existent headers
2704   # can be detected and how.
2705   cat >"conftest.$ac_ext" <<_ACEOF
2706 #line 2706 "configure"
2707 #include "confdefs.h"
2708 #include <ac_nonexistent.h>
2709 _ACEOF
2710 if { (eval echo "$as_me:2710: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2711   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2712   ac_status=$?
2713   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2714   rm -f conftest.er1
2715   cat conftest.err >&5
2716   echo "$as_me:2716: \$? = $ac_status" >&5
2717   (exit "$ac_status"); } >/dev/null; then
2718   if test -s conftest.err; then
2719     ac_cpp_err=$ac_c_preproc_warn_flag
2720   else
2721     ac_cpp_err=
2722   fi
2723 else
2724   ac_cpp_err=yes
2725 fi
2726 if test -z "$ac_cpp_err"; then
2727   # Broken: success on invalid input.
2728 continue
2729 else
2730   echo "$as_me: failed program was:" >&5
2731   cat "conftest.$ac_ext" >&5
2732   # Passes both tests.
2733 ac_preproc_ok=:
2734 break
2735 fi
2736 rm -f conftest.err "conftest.$ac_ext"
2737
2738 done
2739 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2740 rm -f conftest.err "conftest.$ac_ext"
2741 if $ac_preproc_ok; then
2742   :
2743 else
2744   { { echo "$as_me:2744: error: C preprocessor \"$CPP\" fails sanity check" >&5
2745 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2746    { (exit 1); exit 1; }; }
2747 fi
2748
2749 ac_ext=c
2750 ac_cpp='$CPP $CPPFLAGS'
2751 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2752 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2753 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2754 ac_main_return="return"
2755
2756 for ac_prog in mawk gawk nawk awk
2757 do
2758   # Extract the first word of "$ac_prog", so it can be a program name with args.
2759 set dummy $ac_prog; ac_word=$2
2760 echo "$as_me:2760: checking for $ac_word" >&5
2761 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2762 if test "${ac_cv_prog_AWK+set}" = set; then
2763   echo $ECHO_N "(cached) $ECHO_C" >&6
2764 else
2765   if test -n "$AWK"; then
2766   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2767 else
2768   ac_save_IFS=$IFS; IFS=$ac_path_separator
2769 ac_dummy="$PATH"
2770 for ac_dir in $ac_dummy; do
2771   IFS=$ac_save_IFS
2772   test -z "$ac_dir" && ac_dir=.
2773   $as_executable_p "$ac_dir/$ac_word" || continue
2774 ac_cv_prog_AWK="$ac_prog"
2775 echo "$as_me:2775: found $ac_dir/$ac_word" >&5
2776 break
2777 done
2778
2779 fi
2780 fi
2781 AWK=$ac_cv_prog_AWK
2782 if test -n "$AWK"; then
2783   echo "$as_me:2783: result: $AWK" >&5
2784 echo "${ECHO_T}$AWK" >&6
2785 else
2786   echo "$as_me:2786: result: no" >&5
2787 echo "${ECHO_T}no" >&6
2788 fi
2789
2790   test -n "$AWK" && break
2791 done
2792
2793 # Find a good install program.  We prefer a C program (faster),
2794 # so one script is as good as another.  But avoid the broken or
2795 # incompatible versions:
2796 # SysV /etc/install, /usr/sbin/install
2797 # SunOS /usr/etc/install
2798 # IRIX /sbin/install
2799 # AIX /bin/install
2800 # AmigaOS /C/install, which installs bootblocks on floppy discs
2801 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2802 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2803 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2804 # ./install, which can be erroneously created by make from ./install.sh.
2805 echo "$as_me:2805: checking for a BSD compatible install" >&5
2806 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2807 if test -z "$INSTALL"; then
2808 if test "${ac_cv_path_install+set}" = set; then
2809   echo $ECHO_N "(cached) $ECHO_C" >&6
2810 else
2811     ac_save_IFS=$IFS; IFS=$ac_path_separator
2812   for ac_dir in $PATH; do
2813     IFS=$ac_save_IFS
2814     # Account for people who put trailing slashes in PATH elements.
2815     case $ac_dir/ in
2816     / | ./ | .// | /cC/* \
2817     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2818     | /usr/ucb/* ) ;;
2819     *)
2820       # OSF1 and SCO ODT 3.0 have their own names for install.
2821       # Don't use installbsd from OSF since it installs stuff as root
2822       # by default.
2823       for ac_prog in ginstall scoinst install; do
2824         if $as_executable_p "$ac_dir/$ac_prog"; then
2825           if test $ac_prog = install &&
2826             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2827             # AIX install.  It has an incompatible calling convention.
2828             :
2829           elif test $ac_prog = install &&
2830             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2831             # program-specific install script used by HP pwplus--don't use.
2832             :
2833           else
2834             ac_cv_path_install="$ac_dir/$ac_prog -c"
2835             break 2
2836           fi
2837         fi
2838       done
2839       ;;
2840     esac
2841   done
2842
2843 fi
2844   if test "${ac_cv_path_install+set}" = set; then
2845     INSTALL=$ac_cv_path_install
2846   else
2847     # As a last resort, use the slow shell script.  We don't cache a
2848     # path for INSTALL within a source directory, because that will
2849     # break other packages using the cache if that directory is
2850     # removed, or if the path is relative.
2851     INSTALL=$ac_install_sh
2852   fi
2853 fi
2854 echo "$as_me:2854: result: $INSTALL" >&5
2855 echo "${ECHO_T}$INSTALL" >&6
2856
2857 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2858 # It thinks the first close brace ends the variable substitution.
2859 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2860
2861 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2862
2863 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2864
2865 case $INSTALL in
2866 (/*)
2867         ;;
2868 (*)
2869         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2870         test -z "$cf_dir" && cf_dir=.
2871         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2872         ;;
2873 esac
2874
2875 echo "$as_me:2875: checking if you want to install stripped executables" >&5
2876 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2877
2878 # Check whether --enable-stripping or --disable-stripping was given.
2879 if test "${enable_stripping+set}" = set; then
2880   enableval="$enable_stripping"
2881   test "$enableval" != no && enableval=yes
2882         if test "$enableval" != "yes" ; then
2883     enable_stripping=no
2884         else
2885                 enable_stripping=yes
2886         fi
2887 else
2888   enableval=yes
2889         enable_stripping=yes
2890
2891 fi;
2892 echo "$as_me:2892: result: $enable_stripping" >&5
2893 echo "${ECHO_T}$enable_stripping" >&6
2894
2895 if test "$enable_stripping" = yes
2896 then
2897         INSTALL_OPT_S="-s"
2898 else
2899         INSTALL_OPT_S=
2900 fi
2901
2902 : "${INSTALL:=install}"
2903 echo "$as_me:2903: checking if install accepts -p option" >&5
2904 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2905 if test "${cf_cv_install_p+set}" = set; then
2906   echo $ECHO_N "(cached) $ECHO_C" >&6
2907 else
2908
2909         rm -rf ./conftest*
2910         date >conftest.in
2911         mkdir conftest.out
2912         sleep 3
2913         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2914         then
2915                 if test -f conftest.out/conftest.in
2916                 then
2917                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2918                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2919                         if test -s conftest.err
2920                         then
2921                                 cf_cv_install_p=no
2922                         else
2923                                 cf_cv_install_p=yes
2924                         fi
2925                 else
2926                         cf_cv_install_p=no
2927                 fi
2928         else
2929                 cf_cv_install_p=no
2930         fi
2931         rm -rf ./conftest*
2932
2933 fi
2934 echo "$as_me:2934: result: $cf_cv_install_p" >&5
2935 echo "${ECHO_T}$cf_cv_install_p" >&6
2936
2937 echo "$as_me:2937: checking if install needs to be told about ownership" >&5
2938 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2939 case `$ac_config_guess` in
2940 (*minix)
2941         with_install_o=yes
2942         ;;
2943 (*)
2944         with_install_o=no
2945         ;;
2946 esac
2947
2948 echo "$as_me:2948: result: $with_install_o" >&5
2949 echo "${ECHO_T}$with_install_o" >&6
2950 if test "x$with_install_o" = xyes
2951 then
2952         INSTALL_OPT_O="`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`"
2953 else
2954         INSTALL_OPT_O=
2955 fi
2956
2957 for ac_prog in lint cppcheck splint
2958 do
2959   # Extract the first word of "$ac_prog", so it can be a program name with args.
2960 set dummy $ac_prog; ac_word=$2
2961 echo "$as_me:2961: checking for $ac_word" >&5
2962 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2963 if test "${ac_cv_prog_LINT+set}" = set; then
2964   echo $ECHO_N "(cached) $ECHO_C" >&6
2965 else
2966   if test -n "$LINT"; then
2967   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2968 else
2969   ac_save_IFS=$IFS; IFS=$ac_path_separator
2970 ac_dummy="$PATH"
2971 for ac_dir in $ac_dummy; do
2972   IFS=$ac_save_IFS
2973   test -z "$ac_dir" && ac_dir=.
2974   $as_executable_p "$ac_dir/$ac_word" || continue
2975 ac_cv_prog_LINT="$ac_prog"
2976 echo "$as_me:2976: found $ac_dir/$ac_word" >&5
2977 break
2978 done
2979
2980 fi
2981 fi
2982 LINT=$ac_cv_prog_LINT
2983 if test -n "$LINT"; then
2984   echo "$as_me:2984: result: $LINT" >&5
2985 echo "${ECHO_T}$LINT" >&6
2986 else
2987   echo "$as_me:2987: result: no" >&5
2988 echo "${ECHO_T}no" >&6
2989 fi
2990
2991   test -n "$LINT" && break
2992 done
2993
2994 case "x$LINT" in
2995 (xcppcheck|x*/cppcheck)
2996         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
2997         ;;
2998 esac
2999
3000 echo "$as_me:3000: checking for \".PHONY\" make-support" >&5
3001 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3002 if test "${cf_cv_make_PHONY+set}" = set; then
3003   echo $ECHO_N "(cached) $ECHO_C" >&6
3004 else
3005
3006         rm -rf conftest*
3007         (
3008                 mkdir conftest || exit 1
3009                 cd conftest
3010                 cat >makefile <<'CF_EOF'
3011 .PHONY: always
3012 DATA=0
3013 always: always.out
3014         @echo "** making $@ $(DATA)"
3015 once: once.out
3016         @echo "** making $@ $(DATA)"
3017 always.out:
3018         @echo "** making $@ $(DATA)"
3019         echo $(DATA) > $@
3020 once.out:
3021         @echo "** making $@ $(DATA)"
3022         echo $(DATA) > $@
3023 CF_EOF
3024                 for cf_data in 1 2 3
3025                 do
3026                         ${MAKE:-make} always DATA=$cf_data
3027                         ${MAKE:-make} once   DATA=$cf_data
3028                         ${MAKE:-make} -t always once
3029                         if test -f always ; then
3030                                 echo "no (case 1)" > ../conftest.tmp
3031                         elif test ! -f always.out ; then
3032                                 echo "no (case 2)" > ../conftest.tmp
3033                         elif test ! -f once.out ; then
3034                                 echo "no (case 3)" > ../conftest.tmp
3035                         elif ! cmp -s always.out once.out ; then
3036                                 echo "no (case 4)" > ../conftest.tmp
3037                                 diff always.out once.out
3038                         else
3039                                 cf_check="`cat always.out`"
3040                                 if test "x$cf_check" != "x$cf_data" ; then
3041                                         echo "no (case 5)" > ../conftest.tmp
3042                                 else
3043                                         echo yes > ../conftest.tmp
3044                                         rm -f ./*.out
3045                                         continue
3046                                 fi
3047                         fi
3048                         break
3049                 done
3050         ) >&5 2>&1
3051         cf_cv_make_PHONY="`cat conftest.tmp`"
3052         rm -rf conftest*
3053
3054 fi
3055 echo "$as_me:3055: result: $cf_cv_make_PHONY" >&5
3056 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3057 MAKE_NO_PHONY="#"
3058 MAKE_PHONY="#"
3059 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3060 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3061
3062 echo "$as_me:3062: checking if filesystem supports mixed-case filenames" >&5
3063 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3064 if test "${cf_cv_mixedcase+set}" = set; then
3065   echo $ECHO_N "(cached) $ECHO_C" >&6
3066 else
3067
3068 if test "$cross_compiling" = yes ; then
3069         case "$target_alias" in
3070         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3071                 cf_cv_mixedcase=no
3072                 ;;
3073         (*)
3074                 cf_cv_mixedcase=yes
3075                 ;;
3076         esac
3077 else
3078         rm -f conftest CONFTEST
3079         echo test >conftest
3080         if test -f CONFTEST ; then
3081                 cf_cv_mixedcase=no
3082         else
3083                 cf_cv_mixedcase=yes
3084         fi
3085         rm -f conftest CONFTEST
3086 fi
3087
3088 fi
3089 echo "$as_me:3089: result: $cf_cv_mixedcase" >&5
3090 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3091 test "$cf_cv_mixedcase" = yes &&
3092 cat >>confdefs.h <<\EOF
3093 #define MIXEDCASE_FILENAMES 1
3094 EOF
3095
3096 for ac_prog in exctags ctags
3097 do
3098   # Extract the first word of "$ac_prog", so it can be a program name with args.
3099 set dummy $ac_prog; ac_word=$2
3100 echo "$as_me:3100: checking for $ac_word" >&5
3101 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3102 if test "${ac_cv_prog_CTAGS+set}" = set; then
3103   echo $ECHO_N "(cached) $ECHO_C" >&6
3104 else
3105   if test -n "$CTAGS"; then
3106   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3107 else
3108   ac_save_IFS=$IFS; IFS=$ac_path_separator
3109 ac_dummy="$PATH"
3110 for ac_dir in $ac_dummy; do
3111   IFS=$ac_save_IFS
3112   test -z "$ac_dir" && ac_dir=.
3113   $as_executable_p "$ac_dir/$ac_word" || continue
3114 ac_cv_prog_CTAGS="$ac_prog"
3115 echo "$as_me:3115: found $ac_dir/$ac_word" >&5
3116 break
3117 done
3118
3119 fi
3120 fi
3121 CTAGS=$ac_cv_prog_CTAGS
3122 if test -n "$CTAGS"; then
3123   echo "$as_me:3123: result: $CTAGS" >&5
3124 echo "${ECHO_T}$CTAGS" >&6
3125 else
3126   echo "$as_me:3126: result: no" >&5
3127 echo "${ECHO_T}no" >&6
3128 fi
3129
3130   test -n "$CTAGS" && break
3131 done
3132
3133 for ac_prog in exetags etags
3134 do
3135   # Extract the first word of "$ac_prog", so it can be a program name with args.
3136 set dummy $ac_prog; ac_word=$2
3137 echo "$as_me:3137: checking for $ac_word" >&5
3138 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3139 if test "${ac_cv_prog_ETAGS+set}" = set; then
3140   echo $ECHO_N "(cached) $ECHO_C" >&6
3141 else
3142   if test -n "$ETAGS"; then
3143   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3144 else
3145   ac_save_IFS=$IFS; IFS=$ac_path_separator
3146 ac_dummy="$PATH"
3147 for ac_dir in $ac_dummy; do
3148   IFS=$ac_save_IFS
3149   test -z "$ac_dir" && ac_dir=.
3150   $as_executable_p "$ac_dir/$ac_word" || continue
3151 ac_cv_prog_ETAGS="$ac_prog"
3152 echo "$as_me:3152: found $ac_dir/$ac_word" >&5
3153 break
3154 done
3155
3156 fi
3157 fi
3158 ETAGS=$ac_cv_prog_ETAGS
3159 if test -n "$ETAGS"; then
3160   echo "$as_me:3160: result: $ETAGS" >&5
3161 echo "${ECHO_T}$ETAGS" >&6
3162 else
3163   echo "$as_me:3163: result: no" >&5
3164 echo "${ECHO_T}no" >&6
3165 fi
3166
3167   test -n "$ETAGS" && break
3168 done
3169
3170 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3171 set dummy ${CTAGS:-ctags}; ac_word=$2
3172 echo "$as_me:3172: checking for $ac_word" >&5
3173 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3174 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3175   echo $ECHO_N "(cached) $ECHO_C" >&6
3176 else
3177   if test -n "$MAKE_LOWER_TAGS"; then
3178   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3179 else
3180   ac_save_IFS=$IFS; IFS=$ac_path_separator
3181 ac_dummy="$PATH"
3182 for ac_dir in $ac_dummy; do
3183   IFS=$ac_save_IFS
3184   test -z "$ac_dir" && ac_dir=.
3185   $as_executable_p "$ac_dir/$ac_word" || continue
3186 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3187 echo "$as_me:3187: found $ac_dir/$ac_word" >&5
3188 break
3189 done
3190
3191   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3192 fi
3193 fi
3194 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3195 if test -n "$MAKE_LOWER_TAGS"; then
3196   echo "$as_me:3196: result: $MAKE_LOWER_TAGS" >&5
3197 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3198 else
3199   echo "$as_me:3199: result: no" >&5
3200 echo "${ECHO_T}no" >&6
3201 fi
3202
3203 if test "$cf_cv_mixedcase" = yes ; then
3204         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3205 set dummy ${ETAGS:-etags}; ac_word=$2
3206 echo "$as_me:3206: checking for $ac_word" >&5
3207 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3208 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3209   echo $ECHO_N "(cached) $ECHO_C" >&6
3210 else
3211   if test -n "$MAKE_UPPER_TAGS"; then
3212   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3213 else
3214   ac_save_IFS=$IFS; IFS=$ac_path_separator
3215 ac_dummy="$PATH"
3216 for ac_dir in $ac_dummy; do
3217   IFS=$ac_save_IFS
3218   test -z "$ac_dir" && ac_dir=.
3219   $as_executable_p "$ac_dir/$ac_word" || continue
3220 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3221 echo "$as_me:3221: found $ac_dir/$ac_word" >&5
3222 break
3223 done
3224
3225   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3226 fi
3227 fi
3228 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3229 if test -n "$MAKE_UPPER_TAGS"; then
3230   echo "$as_me:3230: result: $MAKE_UPPER_TAGS" >&5
3231 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3232 else
3233   echo "$as_me:3233: result: no" >&5
3234 echo "${ECHO_T}no" >&6
3235 fi
3236
3237 else
3238         MAKE_UPPER_TAGS=no
3239 fi
3240
3241 if test "$MAKE_UPPER_TAGS" = yes ; then
3242         MAKE_UPPER_TAGS=
3243 else
3244         MAKE_UPPER_TAGS="#"
3245 fi
3246
3247 if test "$MAKE_LOWER_TAGS" = yes ; then
3248         MAKE_LOWER_TAGS=
3249 else
3250         MAKE_LOWER_TAGS="#"
3251 fi
3252
3253 echo "$as_me:3253: checking if -lm needed for math functions" >&5
3254 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3255 if test "${cf_cv_need_libm+set}" = set; then
3256   echo $ECHO_N "(cached) $ECHO_C" >&6
3257 else
3258
3259         cat >"conftest.$ac_ext" <<_ACEOF
3260 #line 3260 "configure"
3261 #include "confdefs.h"
3262
3263         #include <stdio.h>
3264         #include <stdlib.h>
3265         #include <math.h>
3266
3267 int
3268 main (void)
3269 {
3270 double x = rand(); printf("result = %g\\n", pow(sin(x),x))
3271   ;
3272   return 0;
3273 }
3274 _ACEOF
3275 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3276 if { (eval echo "$as_me:3276: \"$ac_link\"") >&5
3277   (eval $ac_link) 2>&5
3278   ac_status=$?
3279   echo "$as_me:3279: \$? = $ac_status" >&5
3280   (exit "$ac_status"); } &&
3281          { ac_try='test -s "conftest$ac_exeext"'
3282   { (eval echo "$as_me:3282: \"$ac_try\"") >&5
3283   (eval $ac_try) 2>&5
3284   ac_status=$?
3285   echo "$as_me:3285: \$? = $ac_status" >&5
3286   (exit "$ac_status"); }; }; then
3287   cf_cv_need_libm=no
3288 else
3289   echo "$as_me: failed program was:" >&5
3290 cat "conftest.$ac_ext" >&5
3291 cf_cv_need_libm=yes
3292 fi
3293 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3294 fi
3295 echo "$as_me:3295: result: $cf_cv_need_libm" >&5
3296 echo "${ECHO_T}$cf_cv_need_libm" >&6
3297 if test "$cf_cv_need_libm" = yes
3298 then
3299 MATH_LIB=-lm
3300 fi
3301
3302 top_builddir=`pwd`
3303
3304 CC_G_OPT="-g"
3305 CC_SHARED_OPTS=unknown
3306 CPPFLAGS="$CPPFLAGS"
3307 DFT_DEP_SUFFIX=""
3308 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3309 DFT_UPR_MODEL="NORMAL"
3310 LD="ld"
3311 LDFLAGS_SHARED=""
3312 LDFLAGS_STATIC=""
3313 LD_MODEL=""
3314 LD_SHARED_OPTS=""
3315 LIBTOOL=""
3316 LIBTOOL_OPTS=""
3317 LIB_CLEAN=""
3318 LIB_COMPILE=""
3319 LIB_LINK='${CC}'
3320 LINK_TESTS=""
3321 LOCAL_LDFLAGS=""
3322 PACKAGE="ncurses-examples"
3323 PTHREAD="-lm"
3324 TEST_ARGS=""
3325 TEST_DEPS=""
3326 TEST_LIBS=""
3327 TINFO_LDFLAGS=''
3328 TINFO_LIBS='$(LIBS_CURSES)'
3329 cf_cv_abi_version=""
3330 cf_cv_rel_version=""
3331 includesubdir=""
3332
3333 cf_cv_screen=curses
3334 cf_cv_libtype=
3335
3336 echo "$as_me:3336: checking for fgrep" >&5
3337 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
3338 if test "${ac_cv_path_FGREP+set}" = set; then
3339   echo $ECHO_N "(cached) $ECHO_C" >&6
3340 else
3341   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
3342    then ac_cv_path_FGREP="$GREP -F"
3343    else
3344      for ac_prog in gfgrep fgrep
3345 do
3346   # Extract the first word of "$ac_prog", so it can be a program name with args.
3347 set dummy $ac_prog; ac_word=$2
3348 echo "$as_me:3348: checking for $ac_word" >&5
3349 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3350 if test "${ac_cv_path_FGREP+set}" = set; then
3351   echo $ECHO_N "(cached) $ECHO_C" >&6
3352 else
3353   case $FGREP in
3354   [\\/]* | ?:[\\/]*)
3355   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
3356   ;;
3357   *)
3358   ac_save_IFS=$IFS; IFS=$ac_path_separator
3359 ac_dummy="$PATH"
3360 for ac_dir in $ac_dummy; do
3361   IFS=$ac_save_IFS
3362   test -z "$ac_dir" && ac_dir=.
3363   if $as_executable_p "$ac_dir/$ac_word"; then
3364    ac_cv_path_FGREP="$ac_dir/$ac_word"
3365    echo "$as_me:3365: found $ac_dir/$ac_word" >&5
3366    break
3367 fi
3368 done
3369
3370   ;;
3371 esac
3372 fi
3373 FGREP=$ac_cv_path_FGREP
3374
3375 if test -n "$FGREP"; then
3376   echo "$as_me:3376: result: $FGREP" >&5
3377 echo "${ECHO_T}$FGREP" >&6
3378 else
3379   echo "$as_me:3379: result: no" >&5
3380 echo "${ECHO_T}no" >&6
3381 fi
3382
3383   test -n "$FGREP" && break
3384 done
3385 test -n "$FGREP" || FGREP=": "
3386
3387      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:3387: error: cannot find workable fgrep" >&5
3388 echo "$as_me: error: cannot find workable fgrep" >&2;}
3389    { (exit 1); exit 1; }; }
3390    fi
3391 fi
3392 echo "$as_me:3392: result: $ac_cv_path_FGREP" >&5
3393 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
3394  FGREP="$ac_cv_path_FGREP"
3395
3396 echo "$as_me:3396: checking if you want to use C11 _Noreturn feature" >&5
3397 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
3398
3399 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
3400 if test "${enable_stdnoreturn+set}" = set; then
3401   enableval="$enable_stdnoreturn"
3402   test "$enableval" != yes && enableval=no
3403         if test "$enableval" != "no" ; then
3404     enable_stdnoreturn=yes
3405         else
3406                 enable_stdnoreturn=no
3407         fi
3408 else
3409   enableval=no
3410         enable_stdnoreturn=no
3411
3412 fi;
3413 echo "$as_me:3413: result: $enable_stdnoreturn" >&5
3414 echo "${ECHO_T}$enable_stdnoreturn" >&6
3415
3416 if test $enable_stdnoreturn = yes; then
3417 echo "$as_me:3417: checking for C11 _Noreturn feature" >&5
3418 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
3419 if test "${cf_cv_c11_noreturn+set}" = set; then
3420   echo $ECHO_N "(cached) $ECHO_C" >&6
3421 else
3422   cat >"conftest.$ac_ext" <<_ACEOF
3423 #line 3423 "configure"
3424 #include "confdefs.h"
3425
3426 #include <stdio.h>
3427 #include <stdlib.h>
3428 #include <stdnoreturn.h>
3429 static _Noreturn void giveup(void) { exit(0); }
3430
3431 int
3432 main (void)
3433 {
3434 if (feof(stdin)) giveup()
3435   ;
3436   return 0;
3437 }
3438 _ACEOF
3439 rm -f "conftest.$ac_objext"
3440 if { (eval echo "$as_me:3440: \"$ac_compile\"") >&5
3441   (eval $ac_compile) 2>&5
3442   ac_status=$?
3443   echo "$as_me:3443: \$? = $ac_status" >&5
3444   (exit "$ac_status"); } &&
3445          { ac_try='test -s "conftest.$ac_objext"'
3446   { (eval echo "$as_me:3446: \"$ac_try\"") >&5
3447   (eval $ac_try) 2>&5
3448   ac_status=$?
3449   echo "$as_me:3449: \$? = $ac_status" >&5
3450   (exit "$ac_status"); }; }; then
3451   cf_cv_c11_noreturn=yes
3452 else
3453   echo "$as_me: failed program was:" >&5
3454 cat "conftest.$ac_ext" >&5
3455 cf_cv_c11_noreturn=no
3456 fi
3457 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3458
3459 fi
3460 echo "$as_me:3460: result: $cf_cv_c11_noreturn" >&5
3461 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
3462 else
3463         cf_cv_c11_noreturn=no,
3464 fi
3465
3466 if test "$cf_cv_c11_noreturn" = yes; then
3467
3468 cat >>confdefs.h <<\EOF
3469 #define HAVE_STDNORETURN_H 1
3470 EOF
3471
3472 cat >>confdefs.h <<EOF
3473 #define STDC_NORETURN _Noreturn
3474 EOF
3475
3476         HAVE_STDNORETURN_H=1
3477 else
3478         HAVE_STDNORETURN_H=0
3479 fi
3480
3481 if test "$GCC" = yes || test "$GXX" = yes
3482 then
3483 cat > conftest.i <<EOF
3484 #ifndef GCC_PRINTF
3485 #define GCC_PRINTF 0
3486 #endif
3487 #ifndef GCC_SCANF
3488 #define GCC_SCANF 0
3489 #endif
3490 #ifndef GCC_NORETURN
3491 #define GCC_NORETURN /* nothing */
3492 #endif
3493 #ifndef GCC_UNUSED
3494 #define GCC_UNUSED /* nothing */
3495 #endif
3496 EOF
3497 if test "$GCC" = yes
3498 then
3499         { echo "$as_me:3499: checking for $CC __attribute__ directives..." >&5
3500 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3501 cat > "conftest.$ac_ext" <<EOF
3502 #line 3502 "${as_me:-configure}"
3503 #include "confdefs.h"
3504 #include "conftest.h"
3505 #include "conftest.i"
3506 #if     GCC_PRINTF
3507 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3508 #else
3509 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3510 #endif
3511 #if     GCC_SCANF
3512 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3513 #else
3514 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3515 #endif
3516 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3517 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
3518 extern GCC_NORETURN void foo(void);
3519 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3520 EOF
3521         cf_printf_attribute=no
3522         cf_scanf_attribute=no
3523         for cf_attribute in scanf printf unused noreturn
3524         do
3525
3526 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3527
3528                 cf_directive="__attribute__(($cf_attribute))"
3529                 echo "checking for $CC $cf_directive" 1>&5
3530
3531                 case "$cf_attribute" in
3532                 (printf)
3533                         cf_printf_attribute=yes
3534                         cat >conftest.h <<EOF
3535 #define GCC_$cf_ATTRIBUTE 1
3536 EOF
3537                         ;;
3538                 (scanf)
3539                         cf_scanf_attribute=yes
3540                         cat >conftest.h <<EOF
3541 #define GCC_$cf_ATTRIBUTE 1
3542 EOF
3543                         ;;
3544                 (*)
3545                         cat >conftest.h <<EOF
3546 #define GCC_$cf_ATTRIBUTE $cf_directive
3547 EOF
3548                         ;;
3549                 esac
3550
3551                 if { (eval echo "$as_me:3551: \"$ac_compile\"") >&5
3552   (eval $ac_compile) 2>&5
3553   ac_status=$?
3554   echo "$as_me:3554: \$? = $ac_status" >&5
3555   (exit "$ac_status"); }; then
3556                         test -n "$verbose" && echo "$as_me:3556: result: ... $cf_attribute" >&5
3557 echo "${ECHO_T}... $cf_attribute" >&6
3558                         cat conftest.h >>confdefs.h
3559                         case "$cf_attribute" in
3560                         (noreturn)
3561
3562 cat >>confdefs.h <<EOF
3563 #define GCC_NORETURN $cf_directive
3564 EOF
3565
3566                                 ;;
3567                         (printf)
3568                                 cf_value='/* nothing */'
3569                                 if test "$cf_printf_attribute" != no ; then
3570                                         cf_value='__attribute__((format(printf,fmt,var)))'
3571
3572 cat >>confdefs.h <<\EOF
3573 #define GCC_PRINTF 1
3574 EOF
3575
3576                                 fi
3577
3578 cat >>confdefs.h <<EOF
3579 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3580 EOF
3581
3582                                 ;;
3583                         (scanf)
3584                                 cf_value='/* nothing */'
3585                                 if test "$cf_scanf_attribute" != no ; then
3586                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3587
3588 cat >>confdefs.h <<\EOF
3589 #define GCC_SCANF 1
3590 EOF
3591
3592                                 fi
3593
3594 cat >>confdefs.h <<EOF
3595 #define GCC_SCANFLIKE(fmt,var) $cf_value
3596 EOF
3597
3598                                 ;;
3599                         (unused)
3600
3601 cat >>confdefs.h <<EOF
3602 #define GCC_UNUSED $cf_directive
3603 EOF
3604
3605                                 ;;
3606                         esac
3607                 fi
3608         done
3609 else
3610         ${FGREP-fgrep} define conftest.i >>confdefs.h
3611 fi
3612 rm -rf ./conftest*
3613 fi
3614
3615 echo "$as_me:3615: checking if you want to work around bogus compiler/loader warnings" >&5
3616 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3617
3618 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3619 if test "${enable_string_hacks+set}" = set; then
3620   enableval="$enable_string_hacks"
3621   enable_string_hacks=$enableval
3622 else
3623   enable_string_hacks=no
3624 fi;
3625 echo "$as_me:3625: result: $enable_string_hacks" >&5
3626 echo "${ECHO_T}$enable_string_hacks" >&6
3627
3628 if test "x$enable_string_hacks" = "xyes"; then
3629
3630 cat >>confdefs.h <<\EOF
3631 #define USE_STRING_HACKS 1
3632 EOF
3633
3634         { echo "$as_me:3634: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3635 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3636         echo "$as_me:3636: checking for strlcat" >&5
3637 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3638 if test "${ac_cv_func_strlcat+set}" = set; then
3639   echo $ECHO_N "(cached) $ECHO_C" >&6
3640 else
3641   cat >"conftest.$ac_ext" <<_ACEOF
3642 #line 3642 "configure"
3643 #include "confdefs.h"
3644 #define strlcat autoconf_temporary
3645 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3646 #undef strlcat
3647
3648 #ifdef __cplusplus
3649 extern "C"
3650 #endif
3651
3652 /* We use char because int might match the return type of a gcc2
3653    builtin and then its argument prototype would still apply.  */
3654 char strlcat (void);
3655
3656 int
3657 main (void)
3658 {
3659
3660 /* The GNU C library defines stubs for functions which it implements
3661     to always fail with ENOSYS.  Some functions are actually named
3662     something starting with __ and the normal name is an alias.  */
3663 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3664 #error found stub for strlcat
3665 #endif
3666
3667         return strlcat ();
3668   ;
3669   return 0;
3670 }
3671 _ACEOF
3672 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3673 if { (eval echo "$as_me:3673: \"$ac_link\"") >&5
3674   (eval $ac_link) 2>&5
3675   ac_status=$?
3676   echo "$as_me:3676: \$? = $ac_status" >&5
3677   (exit "$ac_status"); } &&
3678          { ac_try='test -s "conftest$ac_exeext"'
3679   { (eval echo "$as_me:3679: \"$ac_try\"") >&5
3680   (eval $ac_try) 2>&5
3681   ac_status=$?
3682   echo "$as_me:3682: \$? = $ac_status" >&5
3683   (exit "$ac_status"); }; }; then
3684   ac_cv_func_strlcat=yes
3685 else
3686   echo "$as_me: failed program was:" >&5
3687 cat "conftest.$ac_ext" >&5
3688 ac_cv_func_strlcat=no
3689 fi
3690 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3691 fi
3692 echo "$as_me:3692: result: $ac_cv_func_strlcat" >&5
3693 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3694 if test "$ac_cv_func_strlcat" = yes; then
3695
3696 cat >>confdefs.h <<\EOF
3697 #define HAVE_STRLCAT 1
3698 EOF
3699
3700 else
3701
3702                 echo "$as_me:3702: checking for strlcat in -lbsd" >&5
3703 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3704 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3705   echo $ECHO_N "(cached) $ECHO_C" >&6
3706 else
3707   ac_check_lib_save_LIBS=$LIBS
3708 LIBS="-lbsd  $LIBS"
3709 cat >"conftest.$ac_ext" <<_ACEOF
3710 #line 3710 "configure"
3711 #include "confdefs.h"
3712
3713 /* Override any gcc2 internal prototype to avoid an error.  */
3714 #ifdef __cplusplus
3715 extern "C"
3716 #endif
3717 /* We use char because int might match the return type of a gcc2
3718    builtin and then its argument prototype would still apply.  */
3719 char strlcat ();
3720 int
3721 main (void)
3722 {
3723 strlcat ();
3724   ;
3725   return 0;
3726 }
3727 _ACEOF
3728 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3729 if { (eval echo "$as_me:3729: \"$ac_link\"") >&5
3730   (eval $ac_link) 2>&5
3731   ac_status=$?
3732   echo "$as_me:3732: \$? = $ac_status" >&5
3733   (exit "$ac_status"); } &&
3734          { ac_try='test -s "conftest$ac_exeext"'
3735   { (eval echo "$as_me:3735: \"$ac_try\"") >&5
3736   (eval $ac_try) 2>&5
3737   ac_status=$?
3738   echo "$as_me:3738: \$? = $ac_status" >&5
3739   (exit "$ac_status"); }; }; then
3740   ac_cv_lib_bsd_strlcat=yes
3741 else
3742   echo "$as_me: failed program was:" >&5
3743 cat "conftest.$ac_ext" >&5
3744 ac_cv_lib_bsd_strlcat=no
3745 fi
3746 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3747 LIBS=$ac_check_lib_save_LIBS
3748 fi
3749 echo "$as_me:3749: result: $ac_cv_lib_bsd_strlcat" >&5
3750 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3751 if test "$ac_cv_lib_bsd_strlcat" = yes; then
3752
3753 cf_add_libs="$LIBS"
3754 # reverse order
3755 cf_add_0lib=
3756 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3757 # filter duplicates
3758 for cf_add_1lib in $cf_add_0lib; do
3759         for cf_add_2lib in $cf_add_libs; do
3760                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3761                         cf_add_1lib=
3762                         break
3763                 fi
3764         done
3765         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3766 done
3767 LIBS="$cf_add_libs"
3768
3769 for ac_header in bsd/string.h
3770 do
3771 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3772 echo "$as_me:3772: checking for $ac_header" >&5
3773 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3774 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3775   echo $ECHO_N "(cached) $ECHO_C" >&6
3776 else
3777   cat >"conftest.$ac_ext" <<_ACEOF
3778 #line 3778 "configure"
3779 #include "confdefs.h"
3780 #include <$ac_header>
3781 _ACEOF
3782 if { (eval echo "$as_me:3782: \"$ac_cpp "conftest.$ac_ext"\"") >&5
3783   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
3784   ac_status=$?
3785   $EGREP -v '^ *\+' conftest.er1 >conftest.err
3786   rm -f conftest.er1
3787   cat conftest.err >&5
3788   echo "$as_me:3788: \$? = $ac_status" >&5
3789   (exit "$ac_status"); } >/dev/null; then
3790   if test -s conftest.err; then
3791     ac_cpp_err=$ac_c_preproc_warn_flag
3792   else
3793     ac_cpp_err=
3794   fi
3795 else
3796   ac_cpp_err=yes
3797 fi
3798 if test -z "$ac_cpp_err"; then
3799   eval "$as_ac_Header=yes"
3800 else
3801   echo "$as_me: failed program was:" >&5
3802   cat "conftest.$ac_ext" >&5
3803   eval "$as_ac_Header=no"
3804 fi
3805 rm -f conftest.err "conftest.$ac_ext"
3806 fi
3807 echo "$as_me:3807: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
3808 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
3809 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
3810   cat >>confdefs.h <<EOF
3811 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3812 EOF
3813
3814 fi
3815 done
3816
3817 cat >>confdefs.h <<\EOF
3818 #define HAVE_STRLCAT 1
3819 EOF
3820
3821 fi
3822
3823 fi
3824
3825 for ac_func in strlcpy snprintf
3826 do
3827 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3828 echo "$as_me:3828: checking for $ac_func" >&5
3829 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3830 if eval "test \"\${$as_ac_var+set}\" = set"; then
3831   echo $ECHO_N "(cached) $ECHO_C" >&6
3832 else
3833   cat >"conftest.$ac_ext" <<_ACEOF
3834 #line 3834 "configure"
3835 #include "confdefs.h"
3836 #define $ac_func autoconf_temporary
3837 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3838 #undef $ac_func
3839
3840 #ifdef __cplusplus
3841 extern "C"
3842 #endif
3843
3844 /* We use char because int might match the return type of a gcc2
3845    builtin and then its argument prototype would still apply.  */
3846 char $ac_func (void);
3847
3848 int
3849 main (void)
3850 {
3851
3852 /* The GNU C library defines stubs for functions which it implements
3853     to always fail with ENOSYS.  Some functions are actually named
3854     something starting with __ and the normal name is an alias.  */
3855 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3856 #error found stub for $ac_func
3857 #endif
3858
3859         return $ac_func ();
3860   ;
3861   return 0;
3862 }
3863 _ACEOF
3864 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3865 if { (eval echo "$as_me:3865: \"$ac_link\"") >&5
3866   (eval $ac_link) 2>&5
3867   ac_status=$?
3868   echo "$as_me:3868: \$? = $ac_status" >&5
3869   (exit "$ac_status"); } &&
3870          { ac_try='test -s "conftest$ac_exeext"'
3871   { (eval echo "$as_me:3871: \"$ac_try\"") >&5
3872   (eval $ac_try) 2>&5
3873   ac_status=$?
3874   echo "$as_me:3874: \$? = $ac_status" >&5
3875   (exit "$ac_status"); }; }; then
3876   eval "$as_ac_var=yes"
3877 else
3878   echo "$as_me: failed program was:" >&5
3879 cat "conftest.$ac_ext" >&5
3880 eval "$as_ac_var=no"
3881 fi
3882 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3883 fi
3884 echo "$as_me:3884: result: `eval echo '${'"$as_ac_var"'}'`" >&5
3885 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
3886 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
3887   cat >>confdefs.h <<EOF
3888 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3889 EOF
3890
3891 fi
3892 done
3893
3894 fi
3895
3896 echo "$as_me:3896: checking if the POSIX test-macros are already defined" >&5
3897 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3898 if test "${cf_cv_posix_visible+set}" = set; then
3899   echo $ECHO_N "(cached) $ECHO_C" >&6
3900 else
3901
3902 cat >"conftest.$ac_ext" <<_ACEOF
3903 #line 3903 "configure"
3904 #include "confdefs.h"
3905 #include <stdio.h>
3906 int
3907 main (void)
3908 {
3909
3910 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3911         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3912         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3913         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3914 #error conflicting symbols found
3915 #endif
3916
3917   ;
3918   return 0;
3919 }
3920 _ACEOF
3921 rm -f "conftest.$ac_objext"
3922 if { (eval echo "$as_me:3922: \"$ac_compile\"") >&5
3923   (eval $ac_compile) 2>&5
3924   ac_status=$?
3925   echo "$as_me:3925: \$? = $ac_status" >&5
3926   (exit "$ac_status"); } &&
3927          { ac_try='test -s "conftest.$ac_objext"'
3928   { (eval echo "$as_me:3928: \"$ac_try\"") >&5
3929   (eval $ac_try) 2>&5
3930   ac_status=$?
3931   echo "$as_me:3931: \$? = $ac_status" >&5
3932   (exit "$ac_status"); }; }; then
3933   cf_cv_posix_visible=no
3934 else
3935   echo "$as_me: failed program was:" >&5
3936 cat "conftest.$ac_ext" >&5
3937 cf_cv_posix_visible=yes
3938 fi
3939 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3940
3941 fi
3942 echo "$as_me:3942: result: $cf_cv_posix_visible" >&5
3943 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3944
3945 if test "$cf_cv_posix_visible" = no; then
3946
3947 cf_XOPEN_SOURCE=600
3948 cf_POSIX_C_SOURCE=199506L
3949 cf_xopen_source=
3950
3951 case "$host_os" in
3952 (aix[4-7]*)
3953         cf_xopen_source="-D_ALL_SOURCE"
3954         ;;
3955 (msys)
3956         cf_XOPEN_SOURCE=600
3957         ;;
3958 (darwin[0-8].*)
3959         cf_xopen_source="-D_APPLE_C_SOURCE"
3960         ;;
3961 (darwin*)
3962         cf_xopen_source="-D_DARWIN_C_SOURCE"
3963         cf_XOPEN_SOURCE=
3964         ;;
3965 (freebsd*|dragonfly*|midnightbsd*)
3966         # 5.x headers associate
3967         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3968         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3969         cf_POSIX_C_SOURCE=200112L
3970         cf_XOPEN_SOURCE=600
3971         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3972         ;;
3973 (hpux11*)
3974         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3975         ;;
3976 (hpux*)
3977         cf_xopen_source="-D_HPUX_SOURCE"
3978         ;;
3979 (irix[56].*)
3980         cf_xopen_source="-D_SGI_SOURCE"
3981         cf_XOPEN_SOURCE=
3982         ;;
3983 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3984
3985 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3986
3987 echo "$as_me:3987: checking if this is the GNU C library" >&5
3988 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3989 if test "${cf_cv_gnu_library+set}" = set; then
3990   echo $ECHO_N "(cached) $ECHO_C" >&6
3991 else
3992
3993 cat >"conftest.$ac_ext" <<_ACEOF
3994 #line 3994 "configure"
3995 #include "confdefs.h"
3996 #include <sys/types.h>
3997 int
3998 main (void)
3999 {
4000
4001         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
4002                 return 0;
4003         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
4004                 return 0;
4005         #else
4006         #       error not GNU C library
4007         #endif
4008   ;
4009   return 0;
4010 }
4011 _ACEOF
4012 rm -f "conftest.$ac_objext"
4013 if { (eval echo "$as_me:4013: \"$ac_compile\"") >&5
4014   (eval $ac_compile) 2>&5
4015   ac_status=$?
4016   echo "$as_me:4016: \$? = $ac_status" >&5
4017   (exit "$ac_status"); } &&
4018          { ac_try='test -s "conftest.$ac_objext"'
4019   { (eval echo "$as_me:4019: \"$ac_try\"") >&5
4020   (eval $ac_try) 2>&5
4021   ac_status=$?
4022   echo "$as_me:4022: \$? = $ac_status" >&5
4023   (exit "$ac_status"); }; }; then
4024   cf_cv_gnu_library=yes
4025 else
4026   echo "$as_me: failed program was:" >&5
4027 cat "conftest.$ac_ext" >&5
4028 cf_cv_gnu_library=no
4029 fi
4030 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4031
4032 fi
4033 echo "$as_me:4033: result: $cf_cv_gnu_library" >&5
4034 echo "${ECHO_T}$cf_cv_gnu_library" >&6
4035
4036 if test x$cf_cv_gnu_library = xyes; then
4037
4038         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
4039         # was changed to help a little.  newlib incorporated the change about 4
4040         # years later.
4041         echo "$as_me:4041: checking if _DEFAULT_SOURCE can be used as a basis" >&5
4042 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
4043 if test "${cf_cv_gnu_library_219+set}" = set; then
4044   echo $ECHO_N "(cached) $ECHO_C" >&6
4045 else
4046
4047                 cf_save="$CPPFLAGS"
4048
4049         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4050         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4051
4052                 cat >"conftest.$ac_ext" <<_ACEOF
4053 #line 4053 "configure"
4054 #include "confdefs.h"
4055 #include <sys/types.h>
4056 int
4057 main (void)
4058 {
4059
4060                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
4061                                 return 0;
4062                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
4063                                 return 0;
4064                         #else
4065                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
4066                         #endif
4067   ;
4068   return 0;
4069 }
4070 _ACEOF
4071 rm -f "conftest.$ac_objext"
4072 if { (eval echo "$as_me:4072: \"$ac_compile\"") >&5
4073   (eval $ac_compile) 2>&5
4074   ac_status=$?
4075   echo "$as_me:4075: \$? = $ac_status" >&5
4076   (exit "$ac_status"); } &&
4077          { ac_try='test -s "conftest.$ac_objext"'
4078   { (eval echo "$as_me:4078: \"$ac_try\"") >&5
4079   (eval $ac_try) 2>&5
4080   ac_status=$?
4081   echo "$as_me:4081: \$? = $ac_status" >&5
4082   (exit "$ac_status"); }; }; then
4083   cf_cv_gnu_library_219=yes
4084 else
4085   echo "$as_me: failed program was:" >&5
4086 cat "conftest.$ac_ext" >&5
4087 cf_cv_gnu_library_219=no
4088 fi
4089 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4090                 CPPFLAGS="$cf_save"
4091
4092 fi
4093 echo "$as_me:4093: result: $cf_cv_gnu_library_219" >&5
4094 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
4095
4096         if test "x$cf_cv_gnu_library_219" = xyes; then
4097                 cf_save="$CPPFLAGS"
4098                 echo "$as_me:4098: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
4099 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
4100 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
4101   echo $ECHO_N "(cached) $ECHO_C" >&6
4102 else
4103
4104 cf_fix_cppflags=no
4105 cf_new_cflags=
4106 cf_new_cppflags=
4107 cf_new_extra_cppflags=
4108
4109 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
4110 do
4111 case "$cf_fix_cppflags" in
4112 (no)
4113         case "$cf_add_cflags" in
4114         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4115                 case "$cf_add_cflags" in
4116                 (-D*)
4117                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4118
4119                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4120                                 && test -z "${cf_tst_cflags}" \
4121                                 && cf_fix_cppflags=yes
4122
4123                         if test "$cf_fix_cppflags" = yes ; then
4124
4125         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4126         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4127
4128                                 continue
4129                         elif test "${cf_tst_cflags}" = "\"'" ; then
4130
4131         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4132         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4133
4134                                 continue
4135                         fi
4136                         ;;
4137                 esac
4138                 case "$CPPFLAGS" in
4139                 (*$cf_add_cflags)
4140                         ;;
4141                 (*)
4142                         case "$cf_add_cflags" in
4143                         (-D*)
4144                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4145
4146 CPPFLAGS=`echo "$CPPFLAGS" | \
4147         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4148                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4149
4150                                 ;;
4151                         esac
4152
4153         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4154         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4155
4156                         ;;
4157                 esac
4158                 ;;
4159         (*)
4160
4161         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4162         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4163
4164                 ;;
4165         esac
4166         ;;
4167 (yes)
4168
4169         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4170         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4171
4172         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4173
4174         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4175                 && test -z "${cf_tst_cflags}" \
4176                 && cf_fix_cppflags=no
4177         ;;
4178 esac
4179 done
4180
4181 if test -n "$cf_new_cflags" ; then
4182
4183         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4184         CFLAGS="${CFLAGS}$cf_new_cflags"
4185
4186 fi
4187
4188 if test -n "$cf_new_cppflags" ; then
4189
4190         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4191         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4192
4193 fi
4194
4195 if test -n "$cf_new_extra_cppflags" ; then
4196
4197         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4198         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4199
4200 fi
4201
4202                         cat >"conftest.$ac_ext" <<_ACEOF
4203 #line 4203 "configure"
4204 #include "confdefs.h"
4205
4206                                 #include <limits.h>
4207                                 #include <sys/types.h>
4208
4209 int
4210 main (void)
4211 {
4212
4213                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
4214                                         return 0;
4215                                 #else
4216                                 #       error GNU C library is too old
4217                                 #endif
4218   ;
4219   return 0;
4220 }
4221 _ACEOF
4222 rm -f "conftest.$ac_objext"
4223 if { (eval echo "$as_me:4223: \"$ac_compile\"") >&5
4224   (eval $ac_compile) 2>&5
4225   ac_status=$?
4226   echo "$as_me:4226: \$? = $ac_status" >&5
4227   (exit "$ac_status"); } &&
4228          { ac_try='test -s "conftest.$ac_objext"'
4229   { (eval echo "$as_me:4229: \"$ac_try\"") >&5
4230   (eval $ac_try) 2>&5
4231   ac_status=$?
4232   echo "$as_me:4232: \$? = $ac_status" >&5
4233   (exit "$ac_status"); }; }; then
4234   cf_cv_gnu_dftsrc_219=yes
4235 else
4236   echo "$as_me: failed program was:" >&5
4237 cat "conftest.$ac_ext" >&5
4238 cf_cv_gnu_dftsrc_219=no
4239 fi
4240 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4241
4242 fi
4243 echo "$as_me:4243: result: $cf_cv_gnu_dftsrc_219" >&5
4244 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
4245                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
4246         else
4247                 cf_cv_gnu_dftsrc_219=maybe
4248         fi
4249
4250         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
4251
4252                 echo "$as_me:4252: checking if we must define _GNU_SOURCE" >&5
4253 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
4254 if test "${cf_cv_gnu_source+set}" = set; then
4255   echo $ECHO_N "(cached) $ECHO_C" >&6
4256 else
4257
4258                 cat >"conftest.$ac_ext" <<_ACEOF
4259 #line 4259 "configure"
4260 #include "confdefs.h"
4261 #include <sys/types.h>
4262 int
4263 main (void)
4264 {
4265
4266                         #ifndef _XOPEN_SOURCE
4267                         #error  expected _XOPEN_SOURCE to be defined
4268                         #endif
4269   ;
4270   return 0;
4271 }
4272 _ACEOF
4273 rm -f "conftest.$ac_objext"
4274 if { (eval echo "$as_me:4274: \"$ac_compile\"") >&5
4275   (eval $ac_compile) 2>&5
4276   ac_status=$?
4277   echo "$as_me:4277: \$? = $ac_status" >&5
4278   (exit "$ac_status"); } &&
4279          { ac_try='test -s "conftest.$ac_objext"'
4280   { (eval echo "$as_me:4280: \"$ac_try\"") >&5
4281   (eval $ac_try) 2>&5
4282   ac_status=$?
4283   echo "$as_me:4283: \$? = $ac_status" >&5
4284   (exit "$ac_status"); }; }; then
4285   cf_cv_gnu_source=no
4286 else
4287   echo "$as_me: failed program was:" >&5
4288 cat "conftest.$ac_ext" >&5
4289 cf_save="$CPPFLAGS"
4290
4291 cf_fix_cppflags=no
4292 cf_new_cflags=
4293 cf_new_cppflags=
4294 cf_new_extra_cppflags=
4295
4296 for cf_add_cflags in -D_GNU_SOURCE
4297 do
4298 case "$cf_fix_cppflags" in
4299 (no)
4300         case "$cf_add_cflags" in
4301         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4302                 case "$cf_add_cflags" in
4303                 (-D*)
4304                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4305
4306                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4307                                 && test -z "${cf_tst_cflags}" \
4308                                 && cf_fix_cppflags=yes
4309
4310                         if test "$cf_fix_cppflags" = yes ; then
4311
4312         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4313         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4314
4315                                 continue
4316                         elif test "${cf_tst_cflags}" = "\"'" ; then
4317
4318         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4319         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4320
4321                                 continue
4322                         fi
4323                         ;;
4324                 esac
4325                 case "$CPPFLAGS" in
4326                 (*$cf_add_cflags)
4327                         ;;
4328                 (*)
4329                         case "$cf_add_cflags" in
4330                         (-D*)
4331                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4332
4333 CPPFLAGS=`echo "$CPPFLAGS" | \
4334         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4335                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4336
4337                                 ;;
4338                         esac
4339
4340         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4341         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4342
4343                         ;;
4344                 esac
4345                 ;;
4346         (*)
4347
4348         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4349         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4350
4351                 ;;
4352         esac
4353         ;;
4354 (yes)
4355
4356         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4357         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4358
4359         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4360
4361         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4362                 && test -z "${cf_tst_cflags}" \
4363                 && cf_fix_cppflags=no
4364         ;;
4365 esac
4366 done
4367
4368 if test -n "$cf_new_cflags" ; then
4369
4370         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4371         CFLAGS="${CFLAGS}$cf_new_cflags"
4372
4373 fi
4374
4375 if test -n "$cf_new_cppflags" ; then
4376
4377         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4378         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4379
4380 fi
4381
4382 if test -n "$cf_new_extra_cppflags" ; then
4383
4384         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4385         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4386
4387 fi
4388
4389                          cat >"conftest.$ac_ext" <<_ACEOF
4390 #line 4390 "configure"
4391 #include "confdefs.h"
4392 #include <sys/types.h>
4393 int
4394 main (void)
4395 {
4396
4397                                 #ifdef _XOPEN_SOURCE
4398                                 #error  expected _XOPEN_SOURCE to be undefined
4399                                 #endif
4400   ;
4401   return 0;
4402 }
4403 _ACEOF
4404 rm -f "conftest.$ac_objext"
4405 if { (eval echo "$as_me:4405: \"$ac_compile\"") >&5
4406   (eval $ac_compile) 2>&5
4407   ac_status=$?
4408   echo "$as_me:4408: \$? = $ac_status" >&5
4409   (exit "$ac_status"); } &&
4410          { ac_try='test -s "conftest.$ac_objext"'
4411   { (eval echo "$as_me:4411: \"$ac_try\"") >&5
4412   (eval $ac_try) 2>&5
4413   ac_status=$?
4414   echo "$as_me:4414: \$? = $ac_status" >&5
4415   (exit "$ac_status"); }; }; then
4416   cf_cv_gnu_source=no
4417 else
4418   echo "$as_me: failed program was:" >&5
4419 cat "conftest.$ac_ext" >&5
4420 cf_cv_gnu_source=yes
4421 fi
4422 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4423                         CPPFLAGS="$cf_save"
4424
4425 fi
4426 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4427
4428 fi
4429 echo "$as_me:4429: result: $cf_cv_gnu_source" >&5
4430 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4431
4432                 if test "$cf_cv_gnu_source" = yes
4433                 then
4434                 echo "$as_me:4434: checking if we should also define _DEFAULT_SOURCE" >&5
4435 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4436 if test "${cf_cv_default_source+set}" = set; then
4437   echo $ECHO_N "(cached) $ECHO_C" >&6
4438 else
4439
4440         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4441         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4442
4443                         cat >"conftest.$ac_ext" <<_ACEOF
4444 #line 4444 "configure"
4445 #include "confdefs.h"
4446 #include <sys/types.h>
4447 int
4448 main (void)
4449 {
4450
4451                                 #ifdef _DEFAULT_SOURCE
4452                                 #error  expected _DEFAULT_SOURCE to be undefined
4453                                 #endif
4454   ;
4455   return 0;
4456 }
4457 _ACEOF
4458 rm -f "conftest.$ac_objext"
4459 if { (eval echo "$as_me:4459: \"$ac_compile\"") >&5
4460   (eval $ac_compile) 2>&5
4461   ac_status=$?
4462   echo "$as_me:4462: \$? = $ac_status" >&5
4463   (exit "$ac_status"); } &&
4464          { ac_try='test -s "conftest.$ac_objext"'
4465   { (eval echo "$as_me:4465: \"$ac_try\"") >&5
4466   (eval $ac_try) 2>&5
4467   ac_status=$?
4468   echo "$as_me:4468: \$? = $ac_status" >&5
4469   (exit "$ac_status"); }; }; then
4470   cf_cv_default_source=no
4471 else
4472   echo "$as_me: failed program was:" >&5
4473 cat "conftest.$ac_ext" >&5
4474 cf_cv_default_source=yes
4475 fi
4476 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4477
4478 fi
4479 echo "$as_me:4479: result: $cf_cv_default_source" >&5
4480 echo "${ECHO_T}$cf_cv_default_source" >&6
4481                         if test "$cf_cv_default_source" = yes
4482                         then
4483
4484         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4485         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4486
4487                         fi
4488                 fi
4489         fi
4490
4491 fi
4492
4493         ;;
4494 (minix*)
4495         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4496         ;;
4497 (mirbsd*)
4498         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4499         cf_XOPEN_SOURCE=
4500
4501 if test "$cf_cv_posix_visible" = no; then
4502
4503 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4504
4505 cf_save_CFLAGS="$CFLAGS"
4506 cf_save_CPPFLAGS="$CPPFLAGS"
4507
4508 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4509         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4510                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4511
4512 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4513         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4514                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4515
4516 echo "$as_me:4516: checking if we should define _POSIX_C_SOURCE" >&5
4517 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4518 if test "${cf_cv_posix_c_source+set}" = set; then
4519   echo $ECHO_N "(cached) $ECHO_C" >&6
4520 else
4521
4522 echo "${as_me:-configure}:4522: testing if the symbol is already defined go no further ..." 1>&5
4523
4524         cat >"conftest.$ac_ext" <<_ACEOF
4525 #line 4525 "configure"
4526 #include "confdefs.h"
4527 #include <sys/types.h>
4528 int
4529 main (void)
4530 {
4531
4532 #ifndef _POSIX_C_SOURCE
4533 make an error
4534 #endif
4535   ;
4536   return 0;
4537 }
4538 _ACEOF
4539 rm -f "conftest.$ac_objext"
4540 if { (eval echo "$as_me:4540: \"$ac_compile\"") >&5
4541   (eval $ac_compile) 2>&5
4542   ac_status=$?
4543   echo "$as_me:4543: \$? = $ac_status" >&5
4544   (exit "$ac_status"); } &&
4545          { ac_try='test -s "conftest.$ac_objext"'
4546   { (eval echo "$as_me:4546: \"$ac_try\"") >&5
4547   (eval $ac_try) 2>&5
4548   ac_status=$?
4549   echo "$as_me:4549: \$? = $ac_status" >&5
4550   (exit "$ac_status"); }; }; then
4551   cf_cv_posix_c_source=no
4552 else
4553   echo "$as_me: failed program was:" >&5
4554 cat "conftest.$ac_ext" >&5
4555 cf_want_posix_source=no
4556          case .$cf_POSIX_C_SOURCE in
4557          (.[12]??*)
4558                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4559                 ;;
4560          (.2)
4561                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4562                 cf_want_posix_source=yes
4563                 ;;
4564          (.*)
4565                 cf_want_posix_source=yes
4566                 ;;
4567          esac
4568          if test "$cf_want_posix_source" = yes ; then
4569                 cat >"conftest.$ac_ext" <<_ACEOF
4570 #line 4570 "configure"
4571 #include "confdefs.h"
4572 #include <sys/types.h>
4573 int
4574 main (void)
4575 {
4576
4577 #ifdef _POSIX_SOURCE
4578 make an error
4579 #endif
4580   ;
4581   return 0;
4582 }
4583 _ACEOF
4584 rm -f "conftest.$ac_objext"
4585 if { (eval echo "$as_me:4585: \"$ac_compile\"") >&5
4586   (eval $ac_compile) 2>&5
4587   ac_status=$?
4588   echo "$as_me:4588: \$? = $ac_status" >&5
4589   (exit "$ac_status"); } &&
4590          { ac_try='test -s "conftest.$ac_objext"'
4591   { (eval echo "$as_me:4591: \"$ac_try\"") >&5
4592   (eval $ac_try) 2>&5
4593   ac_status=$?
4594   echo "$as_me:4594: \$? = $ac_status" >&5
4595   (exit "$ac_status"); }; }; then
4596   :
4597 else
4598   echo "$as_me: failed program was:" >&5
4599 cat "conftest.$ac_ext" >&5
4600 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4601 fi
4602 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4603          fi
4604
4605 echo "${as_me:-configure}:4605: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4606
4607          CFLAGS="$cf_trim_CFLAGS"
4608          CPPFLAGS="$cf_trim_CPPFLAGS"
4609
4610         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4611         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4612
4613 echo "${as_me:-configure}:4613: testing if the second compile does not leave our definition intact error ..." 1>&5
4614
4615          cat >"conftest.$ac_ext" <<_ACEOF
4616 #line 4616 "configure"
4617 #include "confdefs.h"
4618 #include <sys/types.h>
4619 int
4620 main (void)
4621 {
4622
4623 #ifndef _POSIX_C_SOURCE
4624 make an error
4625 #endif
4626   ;
4627   return 0;
4628 }
4629 _ACEOF
4630 rm -f "conftest.$ac_objext"
4631 if { (eval echo "$as_me:4631: \"$ac_compile\"") >&5
4632   (eval $ac_compile) 2>&5
4633   ac_status=$?
4634   echo "$as_me:4634: \$? = $ac_status" >&5
4635   (exit "$ac_status"); } &&
4636          { ac_try='test -s "conftest.$ac_objext"'
4637   { (eval echo "$as_me:4637: \"$ac_try\"") >&5
4638   (eval $ac_try) 2>&5
4639   ac_status=$?
4640   echo "$as_me:4640: \$? = $ac_status" >&5
4641   (exit "$ac_status"); }; }; then
4642   :
4643 else
4644   echo "$as_me: failed program was:" >&5
4645 cat "conftest.$ac_ext" >&5
4646 cf_cv_posix_c_source=no
4647 fi
4648 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4649          CFLAGS="$cf_save_CFLAGS"
4650          CPPFLAGS="$cf_save_CPPFLAGS"
4651
4652 fi
4653 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4654
4655 fi
4656 echo "$as_me:4656: result: $cf_cv_posix_c_source" >&5
4657 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4658
4659 if test "$cf_cv_posix_c_source" != no ; then
4660         CFLAGS="$cf_trim_CFLAGS"
4661         CPPFLAGS="$cf_trim_CPPFLAGS"
4662
4663 cf_fix_cppflags=no
4664 cf_new_cflags=
4665 cf_new_cppflags=
4666 cf_new_extra_cppflags=
4667
4668 for cf_add_cflags in $cf_cv_posix_c_source
4669 do
4670 case "$cf_fix_cppflags" in
4671 (no)
4672         case "$cf_add_cflags" in
4673         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4674                 case "$cf_add_cflags" in
4675                 (-D*)
4676                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4677
4678                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4679                                 && test -z "${cf_tst_cflags}" \
4680                                 && cf_fix_cppflags=yes
4681
4682                         if test "$cf_fix_cppflags" = yes ; then
4683
4684         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4685         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4686
4687                                 continue
4688                         elif test "${cf_tst_cflags}" = "\"'" ; then
4689
4690         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4691         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4692
4693                                 continue
4694                         fi
4695                         ;;
4696                 esac
4697                 case "$CPPFLAGS" in
4698                 (*$cf_add_cflags)
4699                         ;;
4700                 (*)
4701                         case "$cf_add_cflags" in
4702                         (-D*)
4703                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4704
4705 CPPFLAGS=`echo "$CPPFLAGS" | \
4706         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4707                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4708
4709                                 ;;
4710                         esac
4711
4712         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4713         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4714
4715                         ;;
4716                 esac
4717                 ;;
4718         (*)
4719
4720         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4721         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4722
4723                 ;;
4724         esac
4725         ;;
4726 (yes)
4727
4728         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4729         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4730
4731         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4732
4733         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4734                 && test -z "${cf_tst_cflags}" \
4735                 && cf_fix_cppflags=no
4736         ;;
4737 esac
4738 done
4739
4740 if test -n "$cf_new_cflags" ; then
4741
4742         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4743         CFLAGS="${CFLAGS}$cf_new_cflags"
4744
4745 fi
4746
4747 if test -n "$cf_new_cppflags" ; then
4748
4749         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4750         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4751
4752 fi
4753
4754 if test -n "$cf_new_extra_cppflags" ; then
4755
4756         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4757         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4758
4759 fi
4760
4761 fi
4762
4763 fi # cf_cv_posix_visible
4764
4765         ;;
4766 (netbsd*)
4767         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4768         ;;
4769 (openbsd[6-9]*)
4770         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
4771         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
4772         # Abusing the conformance level is a workaround.
4773         { echo "$as_me:4773: WARNING: this system does not provide usable locale support" >&5
4774 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
4775         cf_xopen_source="-D_BSD_SOURCE"
4776         cf_XOPEN_SOURCE=700
4777         ;;
4778 (openbsd[4-5]*)
4779         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4780         cf_xopen_source="-D_BSD_SOURCE"
4781         cf_XOPEN_SOURCE=600
4782         ;;
4783 (openbsd*)
4784         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4785         ;;
4786 (osf[45]*)
4787         cf_xopen_source="-D_OSF_SOURCE"
4788         ;;
4789 (nto-qnx*)
4790         cf_xopen_source="-D_QNX_SOURCE"
4791         ;;
4792 (sco*)
4793         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4794         ;;
4795 (solaris2.*)
4796         cf_xopen_source="-D__EXTENSIONS__"
4797         cf_cv_xopen_source=broken
4798         ;;
4799 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4800         cf_XOPEN_SOURCE=
4801         cf_POSIX_C_SOURCE=
4802         ;;
4803 (*)
4804
4805 echo "$as_me:4805: checking if we should define _XOPEN_SOURCE" >&5
4806 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4807 if test "${cf_cv_xopen_source+set}" = set; then
4808   echo $ECHO_N "(cached) $ECHO_C" >&6
4809 else
4810
4811         cat >"conftest.$ac_ext" <<_ACEOF
4812 #line 4812 "configure"
4813 #include "confdefs.h"
4814
4815 #include <stdlib.h>
4816 #include <string.h>
4817 #include <sys/types.h>
4818
4819 int
4820 main (void)
4821 {
4822
4823 #ifndef _XOPEN_SOURCE
4824 make an error
4825 #endif
4826   ;
4827   return 0;
4828 }
4829 _ACEOF
4830 rm -f "conftest.$ac_objext"
4831 if { (eval echo "$as_me:4831: \"$ac_compile\"") >&5
4832   (eval $ac_compile) 2>&5
4833   ac_status=$?
4834   echo "$as_me:4834: \$? = $ac_status" >&5
4835   (exit "$ac_status"); } &&
4836          { ac_try='test -s "conftest.$ac_objext"'
4837   { (eval echo "$as_me:4837: \"$ac_try\"") >&5
4838   (eval $ac_try) 2>&5
4839   ac_status=$?
4840   echo "$as_me:4840: \$? = $ac_status" >&5
4841   (exit "$ac_status"); }; }; then
4842   cf_cv_xopen_source=no
4843 else
4844   echo "$as_me: failed program was:" >&5
4845 cat "conftest.$ac_ext" >&5
4846 cf_save="$CPPFLAGS"
4847
4848         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4849         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4850
4851          cat >"conftest.$ac_ext" <<_ACEOF
4852 #line 4852 "configure"
4853 #include "confdefs.h"
4854
4855 #include <stdlib.h>
4856 #include <string.h>
4857 #include <sys/types.h>
4858
4859 int
4860 main (void)
4861 {
4862
4863 #ifdef _XOPEN_SOURCE
4864 make an error
4865 #endif
4866   ;
4867   return 0;
4868 }
4869 _ACEOF
4870 rm -f "conftest.$ac_objext"
4871 if { (eval echo "$as_me:4871: \"$ac_compile\"") >&5
4872   (eval $ac_compile) 2>&5
4873   ac_status=$?
4874   echo "$as_me:4874: \$? = $ac_status" >&5
4875   (exit "$ac_status"); } &&
4876          { ac_try='test -s "conftest.$ac_objext"'
4877   { (eval echo "$as_me:4877: \"$ac_try\"") >&5
4878   (eval $ac_try) 2>&5
4879   ac_status=$?
4880   echo "$as_me:4880: \$? = $ac_status" >&5
4881   (exit "$ac_status"); }; }; then
4882   cf_cv_xopen_source=no
4883 else
4884   echo "$as_me: failed program was:" >&5
4885 cat "conftest.$ac_ext" >&5
4886 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4887 fi
4888 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4889         CPPFLAGS="$cf_save"
4890
4891 fi
4892 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4893
4894 fi
4895 echo "$as_me:4895: result: $cf_cv_xopen_source" >&5
4896 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4897
4898 if test "$cf_cv_xopen_source" != no ; then
4899
4900 CFLAGS=`echo "$CFLAGS" | \
4901         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4902                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4903
4904 CPPFLAGS=`echo "$CPPFLAGS" | \
4905         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4906                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4907
4908         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4909
4910 for cf_add_cflags in $cf_temp_xopen_source
4911 do
4912
4913 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4914 cf_old_cflag="$CFLAGS"
4915
4916 case "$CFLAGS" in
4917 (*$cf_add_cflags=*)
4918         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
4919         ;;
4920 (*$cf_add_cflags\ *)
4921         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
4922         ;;
4923 (*$cf_add_cflags)
4924         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
4925         ;;
4926 esac
4927
4928 if test "$CFLAGS" != "$cf_old_cflag" ;
4929 then
4930
4931         CFLAGS="$cf_new_cflag"
4932 fi
4933
4934 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4935 cf_old_cflag="$CPPFLAGS"
4936
4937 case "$CPPFLAGS" in
4938 (*$cf_add_cflags=*)
4939         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
4940         ;;
4941 (*$cf_add_cflags\ *)
4942         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
4943         ;;
4944 (*$cf_add_cflags)
4945         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
4946         ;;
4947 esac
4948
4949 if test "$CPPFLAGS" != "$cf_old_cflag" ;
4950 then
4951
4952         CPPFLAGS="$cf_new_cflag"
4953 fi
4954
4955 done
4956
4957 cf_fix_cppflags=no
4958 cf_new_cflags=
4959 cf_new_cppflags=
4960 cf_new_extra_cppflags=
4961
4962 for cf_add_cflags in $cf_temp_xopen_source
4963 do
4964 case "$cf_fix_cppflags" in
4965 (no)
4966         case "$cf_add_cflags" in
4967         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4968                 case "$cf_add_cflags" in
4969                 (-D*)
4970                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4971
4972                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4973                                 && test -z "${cf_tst_cflags}" \
4974                                 && cf_fix_cppflags=yes
4975
4976                         if test "$cf_fix_cppflags" = yes ; then
4977
4978         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4979         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4980
4981                                 continue
4982                         elif test "${cf_tst_cflags}" = "\"'" ; then
4983
4984         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4985         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4986
4987                                 continue
4988                         fi
4989                         ;;
4990                 esac
4991                 case "$CPPFLAGS" in
4992                 (*$cf_add_cflags)
4993                         ;;
4994                 (*)
4995                         case "$cf_add_cflags" in
4996                         (-D*)
4997                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4998
4999 CPPFLAGS=`echo "$CPPFLAGS" | \
5000         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5001                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5002
5003                                 ;;
5004                         esac
5005
5006         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5007         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5008
5009                         ;;
5010                 esac
5011                 ;;
5012         (*)
5013
5014         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5015         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5016
5017                 ;;
5018         esac
5019         ;;
5020 (yes)
5021
5022         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5023         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5024
5025         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5026
5027         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5028                 && test -z "${cf_tst_cflags}" \
5029                 && cf_fix_cppflags=no
5030         ;;
5031 esac
5032 done
5033
5034 if test -n "$cf_new_cflags" ; then
5035
5036         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5037         CFLAGS="${CFLAGS}$cf_new_cflags"
5038
5039 fi
5040
5041 if test -n "$cf_new_cppflags" ; then
5042
5043         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5044         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5045
5046 fi
5047
5048 if test -n "$cf_new_extra_cppflags" ; then
5049
5050         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5051         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5052
5053 fi
5054
5055 fi
5056
5057 if test "$cf_cv_posix_visible" = no; then
5058
5059 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
5060
5061 cf_save_CFLAGS="$CFLAGS"
5062 cf_save_CPPFLAGS="$CPPFLAGS"
5063
5064 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
5065         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
5066                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
5067
5068 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
5069         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
5070                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
5071
5072 echo "$as_me:5072: checking if we should define _POSIX_C_SOURCE" >&5
5073 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
5074 if test "${cf_cv_posix_c_source+set}" = set; then
5075   echo $ECHO_N "(cached) $ECHO_C" >&6
5076 else
5077
5078 echo "${as_me:-configure}:5078: testing if the symbol is already defined go no further ..." 1>&5
5079
5080         cat >"conftest.$ac_ext" <<_ACEOF
5081 #line 5081 "configure"
5082 #include "confdefs.h"
5083 #include <sys/types.h>
5084 int
5085 main (void)
5086 {
5087
5088 #ifndef _POSIX_C_SOURCE
5089 make an error
5090 #endif
5091   ;
5092   return 0;
5093 }
5094 _ACEOF
5095 rm -f "conftest.$ac_objext"
5096 if { (eval echo "$as_me:5096: \"$ac_compile\"") >&5
5097   (eval $ac_compile) 2>&5
5098   ac_status=$?
5099   echo "$as_me:5099: \$? = $ac_status" >&5
5100   (exit "$ac_status"); } &&
5101          { ac_try='test -s "conftest.$ac_objext"'
5102   { (eval echo "$as_me:5102: \"$ac_try\"") >&5
5103   (eval $ac_try) 2>&5
5104   ac_status=$?
5105   echo "$as_me:5105: \$? = $ac_status" >&5
5106   (exit "$ac_status"); }; }; then
5107   cf_cv_posix_c_source=no
5108 else
5109   echo "$as_me: failed program was:" >&5
5110 cat "conftest.$ac_ext" >&5
5111 cf_want_posix_source=no
5112          case .$cf_POSIX_C_SOURCE in
5113          (.[12]??*)
5114                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5115                 ;;
5116          (.2)
5117                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5118                 cf_want_posix_source=yes
5119                 ;;
5120          (.*)
5121                 cf_want_posix_source=yes
5122                 ;;
5123          esac
5124          if test "$cf_want_posix_source" = yes ; then
5125                 cat >"conftest.$ac_ext" <<_ACEOF
5126 #line 5126 "configure"
5127 #include "confdefs.h"
5128 #include <sys/types.h>
5129 int
5130 main (void)
5131 {
5132
5133 #ifdef _POSIX_SOURCE
5134 make an error
5135 #endif
5136   ;
5137   return 0;
5138 }
5139 _ACEOF
5140 rm -f "conftest.$ac_objext"
5141 if { (eval echo "$as_me:5141: \"$ac_compile\"") >&5
5142   (eval $ac_compile) 2>&5
5143   ac_status=$?
5144   echo "$as_me:5144: \$? = $ac_status" >&5
5145   (exit "$ac_status"); } &&
5146          { ac_try='test -s "conftest.$ac_objext"'
5147   { (eval echo "$as_me:5147: \"$ac_try\"") >&5
5148   (eval $ac_try) 2>&5
5149   ac_status=$?
5150   echo "$as_me:5150: \$? = $ac_status" >&5
5151   (exit "$ac_status"); }; }; then
5152   :
5153 else
5154   echo "$as_me: failed program was:" >&5
5155 cat "conftest.$ac_ext" >&5
5156 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
5157 fi
5158 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5159          fi
5160
5161 echo "${as_me:-configure}:5161: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
5162
5163          CFLAGS="$cf_trim_CFLAGS"
5164          CPPFLAGS="$cf_trim_CPPFLAGS"
5165
5166         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5167         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
5168
5169 echo "${as_me:-configure}:5169: testing if the second compile does not leave our definition intact error ..." 1>&5
5170
5171          cat >"conftest.$ac_ext" <<_ACEOF
5172 #line 5172 "configure"
5173 #include "confdefs.h"
5174 #include <sys/types.h>
5175 int
5176 main (void)
5177 {
5178
5179 #ifndef _POSIX_C_SOURCE
5180 make an error
5181 #endif
5182   ;
5183   return 0;
5184 }
5185 _ACEOF
5186 rm -f "conftest.$ac_objext"
5187 if { (eval echo "$as_me:5187: \"$ac_compile\"") >&5
5188   (eval $ac_compile) 2>&5
5189   ac_status=$?
5190   echo "$as_me:5190: \$? = $ac_status" >&5
5191   (exit "$ac_status"); } &&
5192          { ac_try='test -s "conftest.$ac_objext"'
5193   { (eval echo "$as_me:5193: \"$ac_try\"") >&5
5194   (eval $ac_try) 2>&5
5195   ac_status=$?
5196   echo "$as_me:5196: \$? = $ac_status" >&5
5197   (exit "$ac_status"); }; }; then
5198   :
5199 else
5200   echo "$as_me: failed program was:" >&5
5201 cat "conftest.$ac_ext" >&5
5202 cf_cv_posix_c_source=no
5203 fi
5204 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5205          CFLAGS="$cf_save_CFLAGS"
5206          CPPFLAGS="$cf_save_CPPFLAGS"
5207
5208 fi
5209 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5210
5211 fi
5212 echo "$as_me:5212: result: $cf_cv_posix_c_source" >&5
5213 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
5214
5215 if test "$cf_cv_posix_c_source" != no ; then
5216         CFLAGS="$cf_trim_CFLAGS"
5217         CPPFLAGS="$cf_trim_CPPFLAGS"
5218
5219 cf_fix_cppflags=no
5220 cf_new_cflags=
5221 cf_new_cppflags=
5222 cf_new_extra_cppflags=
5223
5224 for cf_add_cflags in $cf_cv_posix_c_source
5225 do
5226 case "$cf_fix_cppflags" in
5227 (no)
5228         case "$cf_add_cflags" in
5229         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5230                 case "$cf_add_cflags" in
5231                 (-D*)
5232                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5233
5234                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5235                                 && test -z "${cf_tst_cflags}" \
5236                                 && cf_fix_cppflags=yes
5237
5238                         if test "$cf_fix_cppflags" = yes ; then
5239
5240         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5241         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5242
5243                                 continue
5244                         elif test "${cf_tst_cflags}" = "\"'" ; then
5245
5246         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5247         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5248
5249                                 continue
5250                         fi
5251                         ;;
5252                 esac
5253                 case "$CPPFLAGS" in
5254                 (*$cf_add_cflags)
5255                         ;;
5256                 (*)
5257                         case "$cf_add_cflags" in
5258                         (-D*)
5259                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5260
5261 CPPFLAGS=`echo "$CPPFLAGS" | \
5262         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5263                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5264
5265                                 ;;
5266                         esac
5267
5268         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5269         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5270
5271                         ;;
5272                 esac
5273                 ;;
5274         (*)
5275
5276         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5277         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5278
5279                 ;;
5280         esac
5281         ;;
5282 (yes)
5283
5284         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5285         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5286
5287         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5288
5289         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5290                 && test -z "${cf_tst_cflags}" \
5291                 && cf_fix_cppflags=no
5292         ;;
5293 esac
5294 done
5295
5296 if test -n "$cf_new_cflags" ; then
5297
5298         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5299         CFLAGS="${CFLAGS}$cf_new_cflags"
5300
5301 fi
5302
5303 if test -n "$cf_new_cppflags" ; then
5304
5305         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5306         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5307
5308 fi
5309
5310 if test -n "$cf_new_extra_cppflags" ; then
5311
5312         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5313         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5314
5315 fi
5316
5317 fi
5318
5319 fi # cf_cv_posix_visible
5320
5321         ;;
5322 esac
5323
5324 if test -n "$cf_xopen_source" ; then
5325
5326 for cf_add_cflags in $cf_xopen_source
5327 do
5328
5329 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5330 cf_old_cflag="$CFLAGS"
5331
5332 case "$CFLAGS" in
5333 (*$cf_add_cflags=*)
5334         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
5335         ;;
5336 (*$cf_add_cflags\ *)
5337         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
5338         ;;
5339 (*$cf_add_cflags)
5340         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
5341         ;;
5342 esac
5343
5344 if test "$CFLAGS" != "$cf_old_cflag" ;
5345 then
5346         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
5347
5348 echo "${as_me:-configure}:5348: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
5349
5350         CFLAGS="$cf_new_cflag"
5351 fi
5352
5353 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5354 cf_old_cflag="$CPPFLAGS"
5355
5356 case "$CPPFLAGS" in
5357 (*$cf_add_cflags=*)
5358         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
5359         ;;
5360 (*$cf_add_cflags\ *)
5361         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
5362         ;;
5363 (*$cf_add_cflags)
5364         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
5365         ;;
5366 esac
5367
5368 if test "$CPPFLAGS" != "$cf_old_cflag" ;
5369 then
5370         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
5371
5372 echo "${as_me:-configure}:5372: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
5373
5374         CPPFLAGS="$cf_new_cflag"
5375 fi
5376
5377 done
5378
5379 cf_fix_cppflags=no
5380 cf_new_cflags=
5381 cf_new_cppflags=
5382 cf_new_extra_cppflags=
5383
5384 for cf_add_cflags in $cf_xopen_source
5385 do
5386 case "$cf_fix_cppflags" in
5387 (no)
5388         case "$cf_add_cflags" in
5389         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5390                 case "$cf_add_cflags" in
5391                 (-D*)
5392                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5393
5394                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5395                                 && test -z "${cf_tst_cflags}" \
5396                                 && cf_fix_cppflags=yes
5397
5398                         if test "$cf_fix_cppflags" = yes ; then
5399
5400         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5401         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5402
5403                                 continue
5404                         elif test "${cf_tst_cflags}" = "\"'" ; then
5405
5406         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5407         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5408
5409                                 continue
5410                         fi
5411                         ;;
5412                 esac
5413                 case "$CPPFLAGS" in
5414                 (*$cf_add_cflags)
5415                         ;;
5416                 (*)
5417                         case "$cf_add_cflags" in
5418                         (-D*)
5419                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5420
5421 CPPFLAGS=`echo "$CPPFLAGS" | \
5422         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5423                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5424
5425                                 ;;
5426                         esac
5427
5428         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5429         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5430
5431                         ;;
5432                 esac
5433                 ;;
5434         (*)
5435
5436         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5437         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5438
5439                 ;;
5440         esac
5441         ;;
5442 (yes)
5443
5444         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5445         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5446
5447         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5448
5449         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5450                 && test -z "${cf_tst_cflags}" \
5451                 && cf_fix_cppflags=no
5452         ;;
5453 esac
5454 done
5455
5456 if test -n "$cf_new_cflags" ; then
5457         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5458
5459 echo "${as_me:-configure}:5459: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
5460
5461         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5462         CFLAGS="${CFLAGS}$cf_new_cflags"
5463
5464 fi
5465
5466 if test -n "$cf_new_cppflags" ; then
5467         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5468
5469 echo "${as_me:-configure}:5469: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
5470
5471         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5472         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5473
5474 fi
5475
5476 if test -n "$cf_new_extra_cppflags" ; then
5477         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5478
5479 echo "${as_me:-configure}:5479: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
5480
5481         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5482         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5483
5484 fi
5485
5486 fi
5487
5488 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5489         echo "$as_me:5489: checking if _XOPEN_SOURCE really is set" >&5
5490 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
5491         cat >"conftest.$ac_ext" <<_ACEOF
5492 #line 5492 "configure"
5493 #include "confdefs.h"
5494 #include <stdlib.h>
5495 int
5496 main (void)
5497 {
5498
5499 #ifndef _XOPEN_SOURCE
5500 make an error
5501 #endif
5502   ;
5503   return 0;
5504 }
5505 _ACEOF
5506 rm -f "conftest.$ac_objext"
5507 if { (eval echo "$as_me:5507: \"$ac_compile\"") >&5
5508   (eval $ac_compile) 2>&5
5509   ac_status=$?
5510   echo "$as_me:5510: \$? = $ac_status" >&5
5511   (exit "$ac_status"); } &&
5512          { ac_try='test -s "conftest.$ac_objext"'
5513   { (eval echo "$as_me:5513: \"$ac_try\"") >&5
5514   (eval $ac_try) 2>&5
5515   ac_status=$?
5516   echo "$as_me:5516: \$? = $ac_status" >&5
5517   (exit "$ac_status"); }; }; then
5518   cf_XOPEN_SOURCE_set=yes
5519 else
5520   echo "$as_me: failed program was:" >&5
5521 cat "conftest.$ac_ext" >&5
5522 cf_XOPEN_SOURCE_set=no
5523 fi
5524 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5525         echo "$as_me:5525: result: $cf_XOPEN_SOURCE_set" >&5
5526 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5527         if test "$cf_XOPEN_SOURCE_set" = yes
5528         then
5529                 cat >"conftest.$ac_ext" <<_ACEOF
5530 #line 5530 "configure"
5531 #include "confdefs.h"
5532 #include <stdlib.h>
5533 int
5534 main (void)
5535 {
5536
5537 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5538 make an error
5539 #endif
5540   ;
5541   return 0;
5542 }
5543 _ACEOF
5544 rm -f "conftest.$ac_objext"
5545 if { (eval echo "$as_me:5545: \"$ac_compile\"") >&5
5546   (eval $ac_compile) 2>&5
5547   ac_status=$?
5548   echo "$as_me:5548: \$? = $ac_status" >&5
5549   (exit "$ac_status"); } &&
5550          { ac_try='test -s "conftest.$ac_objext"'
5551   { (eval echo "$as_me:5551: \"$ac_try\"") >&5
5552   (eval $ac_try) 2>&5
5553   ac_status=$?
5554   echo "$as_me:5554: \$? = $ac_status" >&5
5555   (exit "$ac_status"); }; }; then
5556   cf_XOPEN_SOURCE_set_ok=yes
5557 else
5558   echo "$as_me: failed program was:" >&5
5559 cat "conftest.$ac_ext" >&5
5560 cf_XOPEN_SOURCE_set_ok=no
5561 fi
5562 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5563                 if test "$cf_XOPEN_SOURCE_set_ok" = no
5564                 then
5565                         { echo "$as_me:5565: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5566 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5567                 fi
5568         else
5569
5570 echo "$as_me:5570: checking if we should define _XOPEN_SOURCE" >&5
5571 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5572 if test "${cf_cv_xopen_source+set}" = set; then
5573   echo $ECHO_N "(cached) $ECHO_C" >&6
5574 else
5575
5576         cat >"conftest.$ac_ext" <<_ACEOF
5577 #line 5577 "configure"
5578 #include "confdefs.h"
5579
5580 #include <stdlib.h>
5581 #include <string.h>
5582 #include <sys/types.h>
5583
5584 int
5585 main (void)
5586 {
5587
5588 #ifndef _XOPEN_SOURCE
5589 make an error
5590 #endif
5591   ;
5592   return 0;
5593 }
5594 _ACEOF
5595 rm -f "conftest.$ac_objext"
5596 if { (eval echo "$as_me:5596: \"$ac_compile\"") >&5
5597   (eval $ac_compile) 2>&5
5598   ac_status=$?
5599   echo "$as_me:5599: \$? = $ac_status" >&5
5600   (exit "$ac_status"); } &&
5601          { ac_try='test -s "conftest.$ac_objext"'
5602   { (eval echo "$as_me:5602: \"$ac_try\"") >&5
5603   (eval $ac_try) 2>&5
5604   ac_status=$?
5605   echo "$as_me:5605: \$? = $ac_status" >&5
5606   (exit "$ac_status"); }; }; then
5607   cf_cv_xopen_source=no
5608 else
5609   echo "$as_me: failed program was:" >&5
5610 cat "conftest.$ac_ext" >&5
5611 cf_save="$CPPFLAGS"
5612
5613         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5614         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5615
5616          cat >"conftest.$ac_ext" <<_ACEOF
5617 #line 5617 "configure"
5618 #include "confdefs.h"
5619
5620 #include <stdlib.h>
5621 #include <string.h>
5622 #include <sys/types.h>
5623
5624 int
5625 main (void)
5626 {
5627
5628 #ifdef _XOPEN_SOURCE
5629 make an error
5630 #endif
5631   ;
5632   return 0;
5633 }
5634 _ACEOF
5635 rm -f "conftest.$ac_objext"
5636 if { (eval echo "$as_me:5636: \"$ac_compile\"") >&5
5637   (eval $ac_compile) 2>&5
5638   ac_status=$?
5639   echo "$as_me:5639: \$? = $ac_status" >&5
5640   (exit "$ac_status"); } &&
5641          { ac_try='test -s "conftest.$ac_objext"'
5642   { (eval echo "$as_me:5642: \"$ac_try\"") >&5
5643   (eval $ac_try) 2>&5
5644   ac_status=$?
5645   echo "$as_me:5645: \$? = $ac_status" >&5
5646   (exit "$ac_status"); }; }; then
5647   cf_cv_xopen_source=no
5648 else
5649   echo "$as_me: failed program was:" >&5
5650 cat "conftest.$ac_ext" >&5
5651 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5652 fi
5653 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5654         CPPFLAGS="$cf_save"
5655
5656 fi
5657 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5658
5659 fi
5660 echo "$as_me:5660: result: $cf_cv_xopen_source" >&5
5661 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5662
5663 if test "$cf_cv_xopen_source" != no ; then
5664
5665 CFLAGS=`echo "$CFLAGS" | \
5666         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5667                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5668
5669 CPPFLAGS=`echo "$CPPFLAGS" | \
5670         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5671                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5672
5673         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5674
5675 for cf_add_cflags in $cf_temp_xopen_source
5676 do
5677
5678 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5679 cf_old_cflag="$CFLAGS"
5680
5681 case "$CFLAGS" in
5682 (*$cf_add_cflags=*)
5683         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
5684         ;;
5685 (*$cf_add_cflags\ *)
5686         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
5687         ;;
5688 (*$cf_add_cflags)
5689         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
5690         ;;
5691 esac
5692
5693 if test "$CFLAGS" != "$cf_old_cflag" ;
5694 then
5695
5696         CFLAGS="$cf_new_cflag"
5697 fi
5698
5699 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5700 cf_old_cflag="$CPPFLAGS"
5701
5702 case "$CPPFLAGS" in
5703 (*$cf_add_cflags=*)
5704         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
5705         ;;
5706 (*$cf_add_cflags\ *)
5707         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
5708         ;;
5709 (*$cf_add_cflags)
5710         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
5711         ;;
5712 esac
5713
5714 if test "$CPPFLAGS" != "$cf_old_cflag" ;
5715 then
5716
5717         CPPFLAGS="$cf_new_cflag"
5718 fi
5719
5720 done
5721
5722 cf_fix_cppflags=no
5723 cf_new_cflags=
5724 cf_new_cppflags=
5725 cf_new_extra_cppflags=
5726
5727 for cf_add_cflags in $cf_temp_xopen_source
5728 do
5729 case "$cf_fix_cppflags" in
5730 (no)
5731         case "$cf_add_cflags" in
5732         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5733                 case "$cf_add_cflags" in
5734                 (-D*)
5735                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5736
5737                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5738                                 && test -z "${cf_tst_cflags}" \
5739                                 && cf_fix_cppflags=yes
5740
5741                         if test "$cf_fix_cppflags" = yes ; then
5742
5743         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5744         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5745
5746                                 continue
5747                         elif test "${cf_tst_cflags}" = "\"'" ; then
5748
5749         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5750         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5751
5752                                 continue
5753                         fi
5754                         ;;
5755                 esac
5756                 case "$CPPFLAGS" in
5757                 (*$cf_add_cflags)
5758                         ;;
5759                 (*)
5760                         case "$cf_add_cflags" in
5761                         (-D*)
5762                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5763
5764 CPPFLAGS=`echo "$CPPFLAGS" | \
5765         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5766                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5767
5768                                 ;;
5769                         esac
5770
5771         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5772         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5773
5774                         ;;
5775                 esac
5776                 ;;
5777         (*)
5778
5779         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5780         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5781
5782                 ;;
5783         esac
5784         ;;
5785 (yes)
5786
5787         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5788         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5789
5790         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5791
5792         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5793                 && test -z "${cf_tst_cflags}" \
5794                 && cf_fix_cppflags=no
5795         ;;
5796 esac
5797 done
5798
5799 if test -n "$cf_new_cflags" ; then
5800
5801         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5802         CFLAGS="${CFLAGS}$cf_new_cflags"
5803
5804 fi
5805
5806 if test -n "$cf_new_cppflags" ; then
5807
5808         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5809         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5810
5811 fi
5812
5813 if test -n "$cf_new_extra_cppflags" ; then
5814
5815         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5816         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5817
5818 fi
5819
5820 fi
5821
5822         fi
5823 fi
5824 fi # cf_cv_posix_visible
5825
5826 echo "$as_me:5826: checking for signal global datatype" >&5
5827 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5828 if test "${cf_cv_sig_atomic_t+set}" = set; then
5829   echo $ECHO_N "(cached) $ECHO_C" >&6
5830 else
5831
5832         for cf_type in \
5833                 "volatile sig_atomic_t" \
5834                 "sig_atomic_t" \
5835                 "int"
5836         do
5837         cat >"conftest.$ac_ext" <<_ACEOF
5838 #line 5838 "configure"
5839 #include "confdefs.h"
5840
5841 #include <sys/types.h>
5842 #include <signal.h>
5843 #include <stdio.h>
5844
5845 extern $cf_type x;
5846 $cf_type x;
5847 static void handler(int sig)
5848 {
5849         (void)sig;
5850         x = 5;
5851 }
5852 int
5853 main (void)
5854 {
5855 signal(SIGINT, handler);
5856                  x = 1
5857   ;
5858   return 0;
5859 }
5860 _ACEOF
5861 rm -f "conftest.$ac_objext"
5862 if { (eval echo "$as_me:5862: \"$ac_compile\"") >&5
5863   (eval $ac_compile) 2>&5
5864   ac_status=$?
5865   echo "$as_me:5865: \$? = $ac_status" >&5
5866   (exit "$ac_status"); } &&
5867          { ac_try='test -s "conftest.$ac_objext"'
5868   { (eval echo "$as_me:5868: \"$ac_try\"") >&5
5869   (eval $ac_try) 2>&5
5870   ac_status=$?
5871   echo "$as_me:5871: \$? = $ac_status" >&5
5872   (exit "$ac_status"); }; }; then
5873   cf_cv_sig_atomic_t=$cf_type
5874 else
5875   echo "$as_me: failed program was:" >&5
5876 cat "conftest.$ac_ext" >&5
5877 cf_cv_sig_atomic_t=no
5878 fi
5879 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5880                 test "$cf_cv_sig_atomic_t" != no && break
5881         done
5882
5883 fi
5884
5885 echo "$as_me:5885: result: $cf_cv_sig_atomic_t" >&5
5886 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5887 test "$cf_cv_sig_atomic_t" != no &&
5888 cat >>confdefs.h <<EOF
5889 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5890 EOF
5891
5892 # Work around breakage on OS X
5893
5894 echo "$as_me:5894: checking if SIGWINCH is defined" >&5
5895 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5896 if test "${cf_cv_define_sigwinch+set}" = set; then
5897   echo $ECHO_N "(cached) $ECHO_C" >&6
5898 else
5899
5900         cat >"conftest.$ac_ext" <<_ACEOF
5901 #line 5901 "configure"
5902 #include "confdefs.h"
5903
5904 #include <sys/types.h>
5905 #include <sys/signal.h>
5906
5907 int
5908 main (void)
5909 {
5910 int x = SIGWINCH; (void)x
5911   ;
5912   return 0;
5913 }
5914 _ACEOF
5915 rm -f "conftest.$ac_objext"
5916 if { (eval echo "$as_me:5916: \"$ac_compile\"") >&5
5917   (eval $ac_compile) 2>&5
5918   ac_status=$?
5919   echo "$as_me:5919: \$? = $ac_status" >&5
5920   (exit "$ac_status"); } &&
5921          { ac_try='test -s "conftest.$ac_objext"'
5922   { (eval echo "$as_me:5922: \"$ac_try\"") >&5
5923   (eval $ac_try) 2>&5
5924   ac_status=$?
5925   echo "$as_me:5925: \$? = $ac_status" >&5
5926   (exit "$ac_status"); }; }; then
5927   cf_cv_define_sigwinch=yes
5928 else
5929   echo "$as_me: failed program was:" >&5
5930 cat "conftest.$ac_ext" >&5
5931 cat >"conftest.$ac_ext" <<_ACEOF
5932 #line 5932 "configure"
5933 #include "confdefs.h"
5934
5935 #undef _XOPEN_SOURCE
5936 #undef _POSIX_SOURCE
5937 #undef _POSIX_C_SOURCE
5938 #include <sys/types.h>
5939 #include <sys/signal.h>
5940
5941 int
5942 main (void)
5943 {
5944 int x = SIGWINCH; (void)x
5945   ;
5946   return 0;
5947 }
5948 _ACEOF
5949 rm -f "conftest.$ac_objext"
5950 if { (eval echo "$as_me:5950: \"$ac_compile\"") >&5
5951   (eval $ac_compile) 2>&5
5952   ac_status=$?
5953   echo "$as_me:5953: \$? = $ac_status" >&5
5954   (exit "$ac_status"); } &&
5955          { ac_try='test -s "conftest.$ac_objext"'
5956   { (eval echo "$as_me:5956: \"$ac_try\"") >&5
5957   (eval $ac_try) 2>&5
5958   ac_status=$?
5959   echo "$as_me:5959: \$? = $ac_status" >&5
5960   (exit "$ac_status"); }; }; then
5961   cf_cv_define_sigwinch=maybe
5962 else
5963   echo "$as_me: failed program was:" >&5
5964 cat "conftest.$ac_ext" >&5
5965 cf_cv_define_sigwinch=no
5966 fi
5967 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5968
5969 fi
5970 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5971
5972 fi
5973 echo "$as_me:5973: result: $cf_cv_define_sigwinch" >&5
5974 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5975
5976 if test "$cf_cv_define_sigwinch" = maybe ; then
5977 echo "$as_me:5977: checking for actual SIGWINCH definition" >&5
5978 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5979 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5980   echo $ECHO_N "(cached) $ECHO_C" >&6
5981 else
5982
5983 cf_cv_fixup_sigwinch=unknown
5984 cf_sigwinch=32
5985 while test "$cf_sigwinch" != 1
5986 do
5987         cat >"conftest.$ac_ext" <<_ACEOF
5988 #line 5988 "configure"
5989 #include "confdefs.h"
5990
5991 #undef _XOPEN_SOURCE
5992 #undef _POSIX_SOURCE
5993 #undef _POSIX_C_SOURCE
5994 #include <sys/types.h>
5995 #include <sys/signal.h>
5996
5997 int
5998 main (void)
5999 {
6000
6001 #if SIGWINCH != $cf_sigwinch
6002 make an error
6003 #endif
6004 int x = SIGWINCH; (void)x
6005   ;
6006   return 0;
6007 }
6008 _ACEOF
6009 rm -f "conftest.$ac_objext"
6010 if { (eval echo "$as_me:6010: \"$ac_compile\"") >&5
6011   (eval $ac_compile) 2>&5
6012   ac_status=$?
6013   echo "$as_me:6013: \$? = $ac_status" >&5
6014   (exit "$ac_status"); } &&
6015          { ac_try='test -s "conftest.$ac_objext"'
6016   { (eval echo "$as_me:6016: \"$ac_try\"") >&5
6017   (eval $ac_try) 2>&5
6018   ac_status=$?
6019   echo "$as_me:6019: \$? = $ac_status" >&5
6020   (exit "$ac_status"); }; }; then
6021   cf_cv_fixup_sigwinch=$cf_sigwinch
6022          break
6023 else
6024   echo "$as_me: failed program was:" >&5
6025 cat "conftest.$ac_ext" >&5
6026 fi
6027 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6028
6029 cf_sigwinch="`expr "$cf_sigwinch" - 1`"
6030 done
6031
6032 fi
6033 echo "$as_me:6033: result: $cf_cv_fixup_sigwinch" >&5
6034 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
6035
6036         if test "$cf_cv_fixup_sigwinch" != unknown ; then
6037                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
6038         fi
6039 fi
6040
6041 # Checks for CODESET support.
6042
6043 echo "$as_me:6043: checking for nl_langinfo and CODESET" >&5
6044 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
6045 if test "${am_cv_langinfo_codeset+set}" = set; then
6046   echo $ECHO_N "(cached) $ECHO_C" >&6
6047 else
6048   cat >"conftest.$ac_ext" <<_ACEOF
6049 #line 6049 "configure"
6050 #include "confdefs.h"
6051 #include <langinfo.h>
6052 int
6053 main (void)
6054 {
6055 char* cs = nl_langinfo(CODESET); (void)cs
6056   ;
6057   return 0;
6058 }
6059 _ACEOF
6060 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6061 if { (eval echo "$as_me:6061: \"$ac_link\"") >&5
6062   (eval $ac_link) 2>&5
6063   ac_status=$?
6064   echo "$as_me:6064: \$? = $ac_status" >&5
6065   (exit "$ac_status"); } &&
6066          { ac_try='test -s "conftest$ac_exeext"'
6067   { (eval echo "$as_me:6067: \"$ac_try\"") >&5
6068   (eval $ac_try) 2>&5
6069   ac_status=$?
6070   echo "$as_me:6070: \$? = $ac_status" >&5
6071   (exit "$ac_status"); }; }; then
6072   am_cv_langinfo_codeset=yes
6073 else
6074   echo "$as_me: failed program was:" >&5
6075 cat "conftest.$ac_ext" >&5
6076 am_cv_langinfo_codeset=no
6077 fi
6078 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6079
6080 fi
6081 echo "$as_me:6081: result: $am_cv_langinfo_codeset" >&5
6082 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
6083         if test "$am_cv_langinfo_codeset" = yes; then
6084
6085 cat >>confdefs.h <<\EOF
6086 #define HAVE_LANGINFO_CODESET 1
6087 EOF
6088
6089         fi
6090
6091 echo "$as_me:6091: checking if you want to use pkg-config" >&5
6092 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
6093
6094 # Check whether --with-pkg-config or --without-pkg-config was given.
6095 if test "${with_pkg_config+set}" = set; then
6096   withval="$with_pkg_config"
6097   cf_pkg_config=$withval
6098 else
6099   cf_pkg_config=yes
6100 fi;
6101 echo "$as_me:6101: result: $cf_pkg_config" >&5
6102 echo "${ECHO_T}$cf_pkg_config" >&6
6103
6104 case "$cf_pkg_config" in
6105 (no)
6106         PKG_CONFIG=none
6107         ;;
6108 (yes)
6109
6110 if test -n "$ac_tool_prefix"; then
6111   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
6112 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
6113 echo "$as_me:6113: checking for $ac_word" >&5
6114 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6115 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
6116   echo $ECHO_N "(cached) $ECHO_C" >&6
6117 else
6118   case $PKG_CONFIG in
6119   [\\/]* | ?:[\\/]*)
6120   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
6121   ;;
6122   *)
6123   ac_save_IFS=$IFS; IFS=$ac_path_separator
6124 ac_dummy="$PATH"
6125 for ac_dir in $ac_dummy; do
6126   IFS=$ac_save_IFS
6127   test -z "$ac_dir" && ac_dir=.
6128   if $as_executable_p "$ac_dir/$ac_word"; then
6129    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
6130    echo "$as_me:6130: found $ac_dir/$ac_word" >&5
6131    break
6132 fi
6133 done
6134
6135   ;;
6136 esac
6137 fi
6138 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
6139
6140 if test -n "$PKG_CONFIG"; then
6141   echo "$as_me:6141: result: $PKG_CONFIG" >&5
6142 echo "${ECHO_T}$PKG_CONFIG" >&6
6143 else
6144   echo "$as_me:6144: result: no" >&5
6145 echo "${ECHO_T}no" >&6
6146 fi
6147
6148 fi
6149 if test -z "$ac_cv_path_PKG_CONFIG"; then
6150   ac_pt_PKG_CONFIG=$PKG_CONFIG
6151   # Extract the first word of "pkg-config", so it can be a program name with args.
6152 set dummy pkg-config; ac_word=$2
6153 echo "$as_me:6153: checking for $ac_word" >&5
6154 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6155 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
6156   echo $ECHO_N "(cached) $ECHO_C" >&6
6157 else
6158   case $ac_pt_PKG_CONFIG in
6159   [\\/]* | ?:[\\/]*)
6160   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
6161   ;;
6162   *)
6163   ac_save_IFS=$IFS; IFS=$ac_path_separator
6164 ac_dummy="$PATH"
6165 for ac_dir in $ac_dummy; do
6166   IFS=$ac_save_IFS
6167   test -z "$ac_dir" && ac_dir=.
6168   if $as_executable_p "$ac_dir/$ac_word"; then
6169    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
6170    echo "$as_me:6170: found $ac_dir/$ac_word" >&5
6171    break
6172 fi
6173 done
6174
6175   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
6176   ;;
6177 esac
6178 fi
6179 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
6180
6181 if test -n "$ac_pt_PKG_CONFIG"; then
6182   echo "$as_me:6182: result: $ac_pt_PKG_CONFIG" >&5
6183 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
6184 else
6185   echo "$as_me:6185: result: no" >&5
6186 echo "${ECHO_T}no" >&6
6187 fi
6188
6189   PKG_CONFIG=$ac_pt_PKG_CONFIG
6190 else
6191   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
6192 fi
6193
6194         ;;
6195 (*)
6196         PKG_CONFIG=$withval
6197         ;;
6198 esac
6199
6200 test -z "$PKG_CONFIG" && PKG_CONFIG=none
6201 if test "$PKG_CONFIG" != none ; then
6202
6203 if test "x$prefix" != xNONE; then
6204         cf_path_syntax="$prefix"
6205 else
6206         cf_path_syntax="$ac_default_prefix"
6207 fi
6208
6209 case ".$PKG_CONFIG" in
6210 (.\$\(*\)*|.\'*\'*)
6211         ;;
6212 (..|./*|.\\*)
6213         ;;
6214 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6215         ;;
6216 (.\$\{*prefix\}*|.\$\{*dir\}*)
6217         eval PKG_CONFIG="$PKG_CONFIG"
6218         case ".$PKG_CONFIG" in
6219         (.NONE/*)
6220                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6221                 ;;
6222         esac
6223         ;;
6224 (.no|.NONE/*)
6225         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6226         ;;
6227 (*)
6228         { { echo "$as_me:6228: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
6229 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
6230    { (exit 1); exit 1; }; }
6231         ;;
6232 esac
6233
6234 elif test "x$cf_pkg_config" != xno ; then
6235         { echo "$as_me:6235: WARNING: pkg-config is not installed" >&5
6236 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
6237 fi
6238
6239 echo "$as_me:6239: checking if you want to see long compiling messages" >&5
6240 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
6241
6242 # Check whether --enable-echo or --disable-echo was given.
6243 if test "${enable_echo+set}" = set; then
6244   enableval="$enable_echo"
6245   test "$enableval" != no && enableval=yes
6246         if test "$enableval" != "yes" ; then
6247
6248         ECHO_LT='--silent'
6249         ECHO_LD='@echo linking $@;'
6250         RULE_CC='@echo compiling $<'
6251         SHOW_CC='@echo compiling $@'
6252         ECHO_CC='@'
6253
6254         else
6255
6256         ECHO_LT=''
6257         ECHO_LD=''
6258         RULE_CC=''
6259         SHOW_CC=''
6260         ECHO_CC=''
6261
6262         fi
6263 else
6264   enableval=yes
6265
6266         ECHO_LT=''
6267         ECHO_LD=''
6268         RULE_CC=''
6269         SHOW_CC=''
6270         ECHO_CC=''
6271
6272 fi;
6273 echo "$as_me:6273: result: $enableval" >&5
6274 echo "${ECHO_T}$enableval" >&6
6275
6276 echo "$as_me:6276: checking for ncurses wrap-prefix" >&5
6277 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
6278
6279 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
6280 if test "${with_ncurses_wrap_prefix+set}" = set; then
6281   withval="$with_ncurses_wrap_prefix"
6282   NCURSES_WRAP_PREFIX=$withval
6283 else
6284   NCURSES_WRAP_PREFIX=_nc_
6285 fi;
6286 echo "$as_me:6286: result: $NCURSES_WRAP_PREFIX" >&5
6287 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
6288
6289 echo "$as_me:6289: checking if you want to check for wide-character functions" >&5
6290 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
6291
6292 # Check whether --enable-widec or --disable-widec was given.
6293 if test "${enable_widec+set}" = set; then
6294   enableval="$enable_widec"
6295   test "$enableval" != no && enableval=yes
6296         if test "$enableval" != "yes" ; then
6297     cf_enable_widec=no
6298         else
6299                 cf_enable_widec=yes
6300         fi
6301 else
6302   enableval=yes
6303         cf_enable_widec=yes
6304
6305 fi;
6306 echo "$as_me:6306: result: $cf_enable_widec" >&5
6307 echo "${ECHO_T}$cf_enable_widec" >&6
6308
6309 echo "$as_me:6309: checking for specific curses-directory" >&5
6310 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
6311
6312 # Check whether --with-curses-dir or --without-curses-dir was given.
6313 if test "${with_curses_dir+set}" = set; then
6314   withval="$with_curses_dir"
6315   cf_cv_curses_dir=$withval
6316 else
6317   cf_cv_curses_dir=no
6318 fi;
6319 echo "$as_me:6319: result: $cf_cv_curses_dir" >&5
6320 echo "${ECHO_T}$cf_cv_curses_dir" >&6
6321
6322 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6323 then
6324
6325 if test "x$prefix" != xNONE; then
6326         cf_path_syntax="$prefix"
6327 else
6328         cf_path_syntax="$ac_default_prefix"
6329 fi
6330
6331 case ".$withval" in
6332 (.\$\(*\)*|.\'*\'*)
6333         ;;
6334 (..|./*|.\\*)
6335         ;;
6336 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6337         ;;
6338 (.\$\{*prefix\}*|.\$\{*dir\}*)
6339         eval withval="$withval"
6340         case ".$withval" in
6341         (.NONE/*)
6342                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6343                 ;;
6344         esac
6345         ;;
6346 (.no|.NONE/*)
6347         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6348         ;;
6349 (*)
6350         { { echo "$as_me:6350: error: expected a pathname, not \"$withval\"" >&5
6351 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
6352    { (exit 1); exit 1; }; }
6353         ;;
6354 esac
6355
6356         if test -d "$cf_cv_curses_dir"
6357         then
6358
6359 if test -n "$cf_cv_curses_dir/include" ; then
6360   for cf_add_incdir in $cf_cv_curses_dir/include
6361   do
6362         while test "$cf_add_incdir" != /usr/include
6363         do
6364           if test -d "$cf_add_incdir"
6365           then
6366                 cf_have_incdir=no
6367                 if test -n "$CFLAGS$CPPFLAGS" ; then
6368                   # a loop is needed to ensure we can add subdirs of existing dirs
6369                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6370                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6371                           cf_have_incdir=yes; break
6372                         fi
6373                   done
6374                 fi
6375
6376                 if test "$cf_have_incdir" = no ; then
6377                   if test "$cf_add_incdir" = /usr/local/include ; then
6378                         if test "$GCC" = yes
6379                         then
6380                           cf_save_CPPFLAGS=$CPPFLAGS
6381
6382         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6383         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6384
6385                           cat >"conftest.$ac_ext" <<_ACEOF
6386 #line 6386 "configure"
6387 #include "confdefs.h"
6388 #include <stdio.h>
6389 int
6390 main (void)
6391 {
6392 printf("Hello")
6393   ;
6394   return 0;
6395 }
6396 _ACEOF
6397 rm -f "conftest.$ac_objext"
6398 if { (eval echo "$as_me:6398: \"$ac_compile\"") >&5
6399   (eval $ac_compile) 2>&5
6400   ac_status=$?
6401   echo "$as_me:6401: \$? = $ac_status" >&5
6402   (exit "$ac_status"); } &&
6403          { ac_try='test -s "conftest.$ac_objext"'
6404   { (eval echo "$as_me:6404: \"$ac_try\"") >&5
6405   (eval $ac_try) 2>&5
6406   ac_status=$?
6407   echo "$as_me:6407: \$? = $ac_status" >&5
6408   (exit "$ac_status"); }; }; then
6409   :
6410 else
6411   echo "$as_me: failed program was:" >&5
6412 cat "conftest.$ac_ext" >&5
6413 cf_have_incdir=yes
6414 fi
6415 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6416                           CPPFLAGS=$cf_save_CPPFLAGS
6417                         fi
6418                   fi
6419                 fi
6420
6421                 if test "$cf_have_incdir" = no ; then
6422                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6423
6424 echo "${as_me:-configure}:6424: testing adding $cf_add_incdir to include-path ..." 1>&5
6425
6426                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6427
6428                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6429                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6430                   cf_add_incdir="$cf_top_incdir"
6431                 else
6432                   break
6433                 fi
6434           else
6435                 break
6436           fi
6437         done
6438   done
6439 fi
6440
6441 if test -n "$cf_cv_curses_dir/lib" ; then
6442         for cf_add_libdir in $cf_cv_curses_dir/lib
6443         do
6444                 if test "$cf_add_libdir" = /usr/lib ; then
6445                         :
6446                 elif test -d "$cf_add_libdir"
6447                 then
6448                         cf_have_libdir=no
6449                         if test -n "$LDFLAGS$LIBS" ; then
6450                                 # a loop is needed to ensure we can add subdirs of existing dirs
6451                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6452                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6453                                                 cf_have_libdir=yes; break
6454                                         fi
6455                                 done
6456                         fi
6457                         if test "$cf_have_libdir" = no ; then
6458                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6459
6460 echo "${as_me:-configure}:6460: testing adding $cf_add_libdir to library-path ..." 1>&5
6461
6462                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6463                         fi
6464                 fi
6465         done
6466 fi
6467
6468         fi
6469 fi
6470
6471 cf_cv_screen=curses
6472
6473 echo "$as_me:6473: checking for specified curses library type" >&5
6474 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
6475
6476 # Check whether --with-screen or --without-screen was given.
6477 if test "${with_screen+set}" = set; then
6478   withval="$with_screen"
6479   cf_cv_screen=$withval
6480 else
6481
6482 # Check whether --with-ncursesw or --without-ncursesw was given.
6483 if test "${with_ncursesw+set}" = set; then
6484   withval="$with_ncursesw"
6485   cf_cv_screen=ncursesw
6486 else
6487
6488 # Check whether --with-ncurses or --without-ncurses was given.
6489 if test "${with_ncurses+set}" = set; then
6490   withval="$with_ncurses"
6491   cf_cv_screen=ncurses
6492 else
6493
6494 # Check whether --with-pdcurses or --without-pdcurses was given.
6495 if test "${with_pdcurses+set}" = set; then
6496   withval="$with_pdcurses"
6497   cf_cv_screen=pdcurses
6498 else
6499
6500 # Check whether --with-curses-colr or --without-curses-colr was given.
6501 if test "${with_curses_colr+set}" = set; then
6502   withval="$with_curses_colr"
6503   cf_cv_screen=curses_colr
6504 else
6505
6506 # Check whether --with-curses-5lib or --without-curses-5lib was given.
6507 if test "${with_curses_5lib+set}" = set; then
6508   withval="$with_curses_5lib"
6509   cf_cv_screen=curses_5lib
6510 fi;
6511 fi;
6512 fi;
6513 fi;
6514 fi;
6515 fi;
6516
6517 echo "$as_me:6517: result: $cf_cv_screen" >&5
6518 echo "${ECHO_T}$cf_cv_screen" >&6
6519
6520 case $cf_cv_screen in
6521 (curses|curses_*)
6522
6523 echo "$as_me:6523: checking for extra include directories" >&5
6524 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6525 if test "${cf_cv_curses_incdir+set}" = set; then
6526   echo $ECHO_N "(cached) $ECHO_C" >&6
6527 else
6528
6529 cf_cv_curses_incdir=no
6530 case "$host_os" in
6531 (hpux10.*)
6532         if test "x$cf_cv_screen" = "xcurses_colr"
6533         then
6534                 test -d /usr/include/curses_colr && \
6535                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6536         fi
6537         ;;
6538 (sunos3*|sunos4*)
6539         if test "x$cf_cv_screen" = "xcurses_5lib"
6540         then
6541                 test -d /usr/5lib && \
6542                 test -d /usr/5include && \
6543                 cf_cv_curses_incdir="-I/usr/5include"
6544         fi
6545         ;;
6546 esac
6547
6548 fi
6549 echo "$as_me:6549: result: $cf_cv_curses_incdir" >&5
6550 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6551 if test "$cf_cv_curses_incdir" != no
6552 then
6553
6554         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6555         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6556
6557 fi
6558
6559 echo "$as_me:6559: checking if we have identified curses headers" >&5
6560 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6561 if test "${cf_cv_ncurses_header+set}" = set; then
6562   echo $ECHO_N "(cached) $ECHO_C" >&6
6563 else
6564
6565 cf_cv_ncurses_header=none
6566 for cf_header in \
6567         ncurses.h  \
6568         curses.h  ncurses/ncurses.h ncurses/curses.h
6569 do
6570 cat >"conftest.$ac_ext" <<_ACEOF
6571 #line 6571 "configure"
6572 #include "confdefs.h"
6573 #include <${cf_header}>
6574 int
6575 main (void)
6576 {
6577 initscr(); tgoto("?", 0,0)
6578   ;
6579   return 0;
6580 }
6581 _ACEOF
6582 rm -f "conftest.$ac_objext"
6583 if { (eval echo "$as_me:6583: \"$ac_compile\"") >&5
6584   (eval $ac_compile) 2>&5
6585   ac_status=$?
6586   echo "$as_me:6586: \$? = $ac_status" >&5
6587   (exit "$ac_status"); } &&
6588          { ac_try='test -s "conftest.$ac_objext"'
6589   { (eval echo "$as_me:6589: \"$ac_try\"") >&5
6590   (eval $ac_try) 2>&5
6591   ac_status=$?
6592   echo "$as_me:6592: \$? = $ac_status" >&5
6593   (exit "$ac_status"); }; }; then
6594   cf_cv_ncurses_header=$cf_header; break
6595 else
6596   echo "$as_me: failed program was:" >&5
6597 cat "conftest.$ac_ext" >&5
6598 fi
6599 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6600 done
6601
6602 fi
6603 echo "$as_me:6603: result: $cf_cv_ncurses_header" >&5
6604 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6605
6606 if test "$cf_cv_ncurses_header" = none ; then
6607         { { echo "$as_me:6607: error: No curses header-files found" >&5
6608 echo "$as_me: error: No curses header-files found" >&2;}
6609    { (exit 1); exit 1; }; }
6610 fi
6611
6612 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6613
6614 for ac_header in $cf_cv_ncurses_header
6615 do
6616 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6617 echo "$as_me:6617: checking for $ac_header" >&5
6618 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6619 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6620   echo $ECHO_N "(cached) $ECHO_C" >&6
6621 else
6622   cat >"conftest.$ac_ext" <<_ACEOF
6623 #line 6623 "configure"
6624 #include "confdefs.h"
6625 #include <$ac_header>
6626 _ACEOF
6627 if { (eval echo "$as_me:6627: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6628   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6629   ac_status=$?
6630   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6631   rm -f conftest.er1
6632   cat conftest.err >&5
6633   echo "$as_me:6633: \$? = $ac_status" >&5
6634   (exit "$ac_status"); } >/dev/null; then
6635   if test -s conftest.err; then
6636     ac_cpp_err=$ac_c_preproc_warn_flag
6637   else
6638     ac_cpp_err=
6639   fi
6640 else
6641   ac_cpp_err=yes
6642 fi
6643 if test -z "$ac_cpp_err"; then
6644   eval "$as_ac_Header=yes"
6645 else
6646   echo "$as_me: failed program was:" >&5
6647   cat "conftest.$ac_ext" >&5
6648   eval "$as_ac_Header=no"
6649 fi
6650 rm -f conftest.err "conftest.$ac_ext"
6651 fi
6652 echo "$as_me:6652: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6653 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6654 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6655   cat >>confdefs.h <<EOF
6656 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6657 EOF
6658
6659 fi
6660 done
6661
6662 echo "$as_me:6662: checking for terminfo header" >&5
6663 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6664 if test "${cf_cv_term_header+set}" = set; then
6665   echo $ECHO_N "(cached) $ECHO_C" >&6
6666 else
6667
6668 case "${cf_cv_ncurses_header}" in
6669 (*/ncurses.h|*/ncursesw.h)
6670         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6671         ;;
6672 (*)
6673         cf_term_header=term.h
6674         ;;
6675 esac
6676
6677 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6678 do
6679 cat >"conftest.$ac_ext" <<_ACEOF
6680 #line 6680 "configure"
6681 #include "confdefs.h"
6682 #include <stdio.h>
6683 #include <${cf_cv_ncurses_header:-curses.h}>
6684 #include <$cf_test>
6685
6686 int
6687 main (void)
6688 {
6689 int x = auto_left_margin; (void)x
6690   ;
6691   return 0;
6692 }
6693 _ACEOF
6694 rm -f "conftest.$ac_objext"
6695 if { (eval echo "$as_me:6695: \"$ac_compile\"") >&5
6696   (eval $ac_compile) 2>&5
6697   ac_status=$?
6698   echo "$as_me:6698: \$? = $ac_status" >&5
6699   (exit "$ac_status"); } &&
6700          { ac_try='test -s "conftest.$ac_objext"'
6701   { (eval echo "$as_me:6701: \"$ac_try\"") >&5
6702   (eval $ac_try) 2>&5
6703   ac_status=$?
6704   echo "$as_me:6704: \$? = $ac_status" >&5
6705   (exit "$ac_status"); }; }; then
6706
6707         cf_cv_term_header="$cf_test"
6708 else
6709   echo "$as_me: failed program was:" >&5
6710 cat "conftest.$ac_ext" >&5
6711
6712         cf_cv_term_header=unknown
6713
6714 fi
6715 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6716         test "$cf_cv_term_header" != unknown && break
6717 done
6718
6719 fi
6720 echo "$as_me:6720: result: $cf_cv_term_header" >&5
6721 echo "${ECHO_T}$cf_cv_term_header" >&6
6722
6723 # Set definitions to allow ifdef'ing to accommodate subdirectories
6724
6725 case "$cf_cv_term_header" in
6726 (*term.h)
6727
6728 cat >>confdefs.h <<\EOF
6729 #define HAVE_TERM_H 1
6730 EOF
6731
6732         ;;
6733 esac
6734
6735 case "$cf_cv_term_header" in
6736 (ncurses/term.h)
6737
6738 cat >>confdefs.h <<\EOF
6739 #define HAVE_NCURSES_TERM_H 1
6740 EOF
6741
6742         ;;
6743 (ncursesw/term.h)
6744
6745 cat >>confdefs.h <<\EOF
6746 #define HAVE_NCURSESW_TERM_H 1
6747 EOF
6748
6749         ;;
6750 esac
6751
6752 echo "$as_me:6752: checking for ncurses version" >&5
6753 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6754 if test "${cf_cv_ncurses_version+set}" = set; then
6755   echo $ECHO_N "(cached) $ECHO_C" >&6
6756 else
6757
6758         cf_cv_ncurses_version=no
6759         cf_tempfile=out$$
6760         rm -f "$cf_tempfile"
6761         if test "$cross_compiling" = yes; then
6762
6763         # This will not work if the preprocessor splits the line after the
6764         # Autoconf token.  The 'unproto' program does that.
6765         cat > "conftest.$ac_ext" <<EOF
6766 #include <${cf_cv_ncurses_header:-curses.h}>
6767 #undef Autoconf
6768 #ifdef NCURSES_VERSION
6769 Autoconf NCURSES_VERSION
6770 #else
6771 #ifdef __NCURSES_H
6772 Autoconf "old"
6773 #endif
6774 ;
6775 #endif
6776 EOF
6777         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6778         { (eval echo "$as_me:6778: \"$cf_try\"") >&5
6779   (eval $cf_try) 2>&5
6780   ac_status=$?
6781   echo "$as_me:6781: \$? = $ac_status" >&5
6782   (exit "$ac_status"); }
6783         if test -f conftest.out ; then
6784                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6785                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6786                 rm -f conftest.out
6787         fi
6788
6789 else
6790   cat >"conftest.$ac_ext" <<_ACEOF
6791 #line 6791 "configure"
6792 #include "confdefs.h"
6793
6794 #include <${cf_cv_ncurses_header:-curses.h}>
6795 #include <stdio.h>
6796 int main(void)
6797 {
6798         FILE *fp = fopen("$cf_tempfile", "w");
6799 #ifdef NCURSES_VERSION
6800 # ifdef NCURSES_VERSION_PATCH
6801         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6802 # else
6803         fprintf(fp, "%s\\n", NCURSES_VERSION);
6804 # endif
6805 #else
6806 # ifdef __NCURSES_H
6807         fprintf(fp, "old\\n");
6808 # else
6809         make an error
6810 # endif
6811 #endif
6812         ${cf_cv_main_return:-return}(0);
6813 }
6814 _ACEOF
6815 rm -f "conftest$ac_exeext"
6816 if { (eval echo "$as_me:6816: \"$ac_link\"") >&5
6817   (eval $ac_link) 2>&5
6818   ac_status=$?
6819   echo "$as_me:6819: \$? = $ac_status" >&5
6820   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6821   { (eval echo "$as_me:6821: \"$ac_try\"") >&5
6822   (eval $ac_try) 2>&5
6823   ac_status=$?
6824   echo "$as_me:6824: \$? = $ac_status" >&5
6825   (exit "$ac_status"); }; }; then
6826
6827         cf_cv_ncurses_version=`cat $cf_tempfile`
6828 else
6829   echo "$as_me: program exited with status $ac_status" >&5
6830 echo "$as_me: failed program was:" >&5
6831 cat "conftest.$ac_ext" >&5
6832 fi
6833 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6834 fi
6835         rm -f "$cf_tempfile"
6836
6837 fi
6838 echo "$as_me:6838: result: $cf_cv_ncurses_version" >&5
6839 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6840 test "$cf_cv_ncurses_version" = no ||
6841 cat >>confdefs.h <<\EOF
6842 #define NCURSES 1
6843 EOF
6844
6845 echo "$as_me:6845: checking if we have identified curses libraries" >&5
6846 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6847 cat >"conftest.$ac_ext" <<_ACEOF
6848 #line 6848 "configure"
6849 #include "confdefs.h"
6850 #include <${cf_cv_ncurses_header:-curses.h}>
6851 int
6852 main (void)
6853 {
6854 initscr(); tgoto("?", 0,0)
6855   ;
6856   return 0;
6857 }
6858 _ACEOF
6859 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6860 if { (eval echo "$as_me:6860: \"$ac_link\"") >&5
6861   (eval $ac_link) 2>&5
6862   ac_status=$?
6863   echo "$as_me:6863: \$? = $ac_status" >&5
6864   (exit "$ac_status"); } &&
6865          { ac_try='test -s "conftest$ac_exeext"'
6866   { (eval echo "$as_me:6866: \"$ac_try\"") >&5
6867   (eval $ac_try) 2>&5
6868   ac_status=$?
6869   echo "$as_me:6869: \$? = $ac_status" >&5
6870   (exit "$ac_status"); }; }; then
6871   cf_result=yes
6872 else
6873   echo "$as_me: failed program was:" >&5
6874 cat "conftest.$ac_ext" >&5
6875 cf_result=no
6876 fi
6877 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6878 echo "$as_me:6878: result: $cf_result" >&5
6879 echo "${ECHO_T}$cf_result" >&6
6880
6881 if test "$cf_result" = no ; then
6882 case "$host_os" in
6883 (freebsd*)
6884         echo "$as_me:6884: checking for tgoto in -lmytinfo" >&5
6885 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6886 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6887   echo $ECHO_N "(cached) $ECHO_C" >&6
6888 else
6889   ac_check_lib_save_LIBS=$LIBS
6890 LIBS="-lmytinfo  $LIBS"
6891 cat >"conftest.$ac_ext" <<_ACEOF
6892 #line 6892 "configure"
6893 #include "confdefs.h"
6894
6895 /* Override any gcc2 internal prototype to avoid an error.  */
6896 #ifdef __cplusplus
6897 extern "C"
6898 #endif
6899 /* We use char because int might match the return type of a gcc2
6900    builtin and then its argument prototype would still apply.  */
6901 char tgoto ();
6902 int
6903 main (void)
6904 {
6905 tgoto ();
6906   ;
6907   return 0;
6908 }
6909 _ACEOF
6910 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6911 if { (eval echo "$as_me:6911: \"$ac_link\"") >&5
6912   (eval $ac_link) 2>&5
6913   ac_status=$?
6914   echo "$as_me:6914: \$? = $ac_status" >&5
6915   (exit "$ac_status"); } &&
6916          { ac_try='test -s "conftest$ac_exeext"'
6917   { (eval echo "$as_me:6917: \"$ac_try\"") >&5
6918   (eval $ac_try) 2>&5
6919   ac_status=$?
6920   echo "$as_me:6920: \$? = $ac_status" >&5
6921   (exit "$ac_status"); }; }; then
6922   ac_cv_lib_mytinfo_tgoto=yes
6923 else
6924   echo "$as_me: failed program was:" >&5
6925 cat "conftest.$ac_ext" >&5
6926 ac_cv_lib_mytinfo_tgoto=no
6927 fi
6928 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6929 LIBS=$ac_check_lib_save_LIBS
6930 fi
6931 echo "$as_me:6931: result: $ac_cv_lib_mytinfo_tgoto" >&5
6932 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6933 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6934
6935 cf_add_libs="$LIBS"
6936 # reverse order
6937 cf_add_0lib=
6938 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6939 # filter duplicates
6940 for cf_add_1lib in $cf_add_0lib; do
6941         for cf_add_2lib in $cf_add_libs; do
6942                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6943                         cf_add_1lib=
6944                         break
6945                 fi
6946         done
6947         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6948 done
6949 LIBS="$cf_add_libs"
6950
6951 fi
6952
6953         ;;
6954 (hpux10.*)
6955         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6956         # next (1998), and xcurses "newer" (2000).  There is no header file for
6957         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6958         # term.h) for cur_colr
6959         if test "x$cf_cv_screen" = "xcurses_colr"
6960         then
6961                 echo "$as_me:6961: checking for initscr in -lcur_colr" >&5
6962 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6963 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6964   echo $ECHO_N "(cached) $ECHO_C" >&6
6965 else
6966   ac_check_lib_save_LIBS=$LIBS
6967 LIBS="-lcur_colr  $LIBS"
6968 cat >"conftest.$ac_ext" <<_ACEOF
6969 #line 6969 "configure"
6970 #include "confdefs.h"
6971
6972 /* Override any gcc2 internal prototype to avoid an error.  */
6973 #ifdef __cplusplus
6974 extern "C"
6975 #endif
6976 /* We use char because int might match the return type of a gcc2
6977    builtin and then its argument prototype would still apply.  */
6978 char initscr ();
6979 int
6980 main (void)
6981 {
6982 initscr ();
6983   ;
6984   return 0;
6985 }
6986 _ACEOF
6987 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6988 if { (eval echo "$as_me:6988: \"$ac_link\"") >&5
6989   (eval $ac_link) 2>&5
6990   ac_status=$?
6991   echo "$as_me:6991: \$? = $ac_status" >&5
6992   (exit "$ac_status"); } &&
6993          { ac_try='test -s "conftest$ac_exeext"'
6994   { (eval echo "$as_me:6994: \"$ac_try\"") >&5
6995   (eval $ac_try) 2>&5
6996   ac_status=$?
6997   echo "$as_me:6997: \$? = $ac_status" >&5
6998   (exit "$ac_status"); }; }; then
6999   ac_cv_lib_cur_colr_initscr=yes
7000 else
7001   echo "$as_me: failed program was:" >&5
7002 cat "conftest.$ac_ext" >&5
7003 ac_cv_lib_cur_colr_initscr=no
7004 fi
7005 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7006 LIBS=$ac_check_lib_save_LIBS
7007 fi
7008 echo "$as_me:7008: result: $ac_cv_lib_cur_colr_initscr" >&5
7009 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
7010 if test "$ac_cv_lib_cur_colr_initscr" = yes; then
7011
7012 cf_add_libs="$LIBS"
7013 # reverse order
7014 cf_add_0lib=
7015 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7016 # filter duplicates
7017 for cf_add_1lib in $cf_add_0lib; do
7018         for cf_add_2lib in $cf_add_libs; do
7019                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7020                         cf_add_1lib=
7021                         break
7022                 fi
7023         done
7024         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7025 done
7026 LIBS="$cf_add_libs"
7027
7028                         ac_cv_func_initscr=yes
7029
7030 else
7031
7032                 echo "$as_me:7032: checking for initscr in -lHcurses" >&5
7033 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
7034 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
7035   echo $ECHO_N "(cached) $ECHO_C" >&6
7036 else
7037   ac_check_lib_save_LIBS=$LIBS
7038 LIBS="-lHcurses  $LIBS"
7039 cat >"conftest.$ac_ext" <<_ACEOF
7040 #line 7040 "configure"
7041 #include "confdefs.h"
7042
7043 /* Override any gcc2 internal prototype to avoid an error.  */
7044 #ifdef __cplusplus
7045 extern "C"
7046 #endif
7047 /* We use char because int might match the return type of a gcc2
7048    builtin and then its argument prototype would still apply.  */
7049 char initscr ();
7050 int
7051 main (void)
7052 {
7053 initscr ();
7054   ;
7055   return 0;
7056 }
7057 _ACEOF
7058 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7059 if { (eval echo "$as_me:7059: \"$ac_link\"") >&5
7060   (eval $ac_link) 2>&5
7061   ac_status=$?
7062   echo "$as_me:7062: \$? = $ac_status" >&5
7063   (exit "$ac_status"); } &&
7064          { ac_try='test -s "conftest$ac_exeext"'
7065   { (eval echo "$as_me:7065: \"$ac_try\"") >&5
7066   (eval $ac_try) 2>&5
7067   ac_status=$?
7068   echo "$as_me:7068: \$? = $ac_status" >&5
7069   (exit "$ac_status"); }; }; then
7070   ac_cv_lib_Hcurses_initscr=yes
7071 else
7072   echo "$as_me: failed program was:" >&5
7073 cat "conftest.$ac_ext" >&5
7074 ac_cv_lib_Hcurses_initscr=no
7075 fi
7076 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7077 LIBS=$ac_check_lib_save_LIBS
7078 fi
7079 echo "$as_me:7079: result: $ac_cv_lib_Hcurses_initscr" >&5
7080 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
7081 if test "$ac_cv_lib_Hcurses_initscr" = yes; then
7082
7083                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
7084
7085 cf_add_libs="$LIBS"
7086 # reverse order
7087 cf_add_0lib=
7088 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7089 # filter duplicates
7090 for cf_add_1lib in $cf_add_0lib; do
7091         for cf_add_2lib in $cf_add_libs; do
7092                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7093                         cf_add_1lib=
7094                         break
7095                 fi
7096         done
7097         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7098 done
7099 LIBS="$cf_add_libs"
7100
7101         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7102         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
7103
7104                         ac_cv_func_initscr=yes
7105
7106 fi
7107
7108 fi
7109
7110         fi
7111         ;;
7112 (linux*)
7113         case `arch 2>/dev/null` in
7114         (x86_64)
7115                 if test -d /lib64
7116                 then
7117
7118 if test -n "/lib64" ; then
7119         for cf_add_libdir in /lib64
7120         do
7121                 if test "$cf_add_libdir" = /usr/lib ; then
7122                         :
7123                 elif test -d "$cf_add_libdir"
7124                 then
7125                         cf_have_libdir=no
7126                         if test -n "$LDFLAGS$LIBS" ; then
7127                                 # a loop is needed to ensure we can add subdirs of existing dirs
7128                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7129                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7130                                                 cf_have_libdir=yes; break
7131                                         fi
7132                                 done
7133                         fi
7134                         if test "$cf_have_libdir" = no ; then
7135                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7136
7137 echo "${as_me:-configure}:7137: testing adding $cf_add_libdir to library-path ..." 1>&5
7138
7139                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7140                         fi
7141                 fi
7142         done
7143 fi
7144
7145                 else
7146
7147 if test -n "/lib" ; then
7148         for cf_add_libdir in /lib
7149         do
7150                 if test "$cf_add_libdir" = /usr/lib ; then
7151                         :
7152                 elif test -d "$cf_add_libdir"
7153                 then
7154                         cf_have_libdir=no
7155                         if test -n "$LDFLAGS$LIBS" ; then
7156                                 # a loop is needed to ensure we can add subdirs of existing dirs
7157                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7158                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7159                                                 cf_have_libdir=yes; break
7160                                         fi
7161                                 done
7162                         fi
7163                         if test "$cf_have_libdir" = no ; then
7164                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7165
7166 echo "${as_me:-configure}:7166: testing adding $cf_add_libdir to library-path ..." 1>&5
7167
7168                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7169                         fi
7170                 fi
7171         done
7172 fi
7173
7174                 fi
7175                 ;;
7176         (*)
7177
7178 if test -n "/lib" ; then
7179         for cf_add_libdir in /lib
7180         do
7181                 if test "$cf_add_libdir" = /usr/lib ; then
7182                         :
7183                 elif test -d "$cf_add_libdir"
7184                 then
7185                         cf_have_libdir=no
7186                         if test -n "$LDFLAGS$LIBS" ; then
7187                                 # a loop is needed to ensure we can add subdirs of existing dirs
7188                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7189                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7190                                                 cf_have_libdir=yes; break
7191                                         fi
7192                                 done
7193                         fi
7194                         if test "$cf_have_libdir" = no ; then
7195                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7196
7197 echo "${as_me:-configure}:7197: testing adding $cf_add_libdir to library-path ..." 1>&5
7198
7199                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7200                         fi
7201                 fi
7202         done
7203 fi
7204
7205                 ;;
7206         esac
7207         ;;
7208 (sunos3*|sunos4*)
7209         if test "x$cf_cv_screen" = "xcurses_5lib"
7210         then
7211                 if test -d /usr/5lib ; then
7212
7213 if test -n "/usr/5lib" ; then
7214         for cf_add_libdir in /usr/5lib
7215         do
7216                 if test "$cf_add_libdir" = /usr/lib ; then
7217                         :
7218                 elif test -d "$cf_add_libdir"
7219                 then
7220                         cf_have_libdir=no
7221                         if test -n "$LDFLAGS$LIBS" ; then
7222                                 # a loop is needed to ensure we can add subdirs of existing dirs
7223                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7224                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7225                                                 cf_have_libdir=yes; break
7226                                         fi
7227                                 done
7228                         fi
7229                         if test "$cf_have_libdir" = no ; then
7230                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7231
7232 echo "${as_me:-configure}:7232: testing adding $cf_add_libdir to library-path ..." 1>&5
7233
7234                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7235                         fi
7236                 fi
7237         done
7238 fi
7239
7240 cf_add_libs="$LIBS"
7241 # reverse order
7242 cf_add_0lib=
7243 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7244 # filter duplicates
7245 for cf_add_1lib in $cf_add_0lib; do
7246         for cf_add_2lib in $cf_add_libs; do
7247                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7248                         cf_add_1lib=
7249                         break
7250                 fi
7251         done
7252         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7253 done
7254 LIBS="$cf_add_libs"
7255
7256                 fi
7257         fi
7258         ac_cv_func_initscr=yes
7259         ;;
7260 esac
7261
7262 if test ".$ac_cv_func_initscr" != .yes ; then
7263         cf_save_LIBS="$LIBS"
7264
7265         if test ".${cf_cv_ncurses_version:-no}" != .no
7266         then
7267                 cf_check_list="ncurses curses cursesX"
7268         else
7269                 cf_check_list="cursesX curses ncurses"
7270         fi
7271
7272         # Check for library containing tgoto.  Do this before curses library
7273         # because it may be needed to link the test-case for initscr.
7274         if test "x$cf_term_lib" = x
7275         then
7276                 echo "$as_me:7276: checking for tgoto" >&5
7277 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
7278 if test "${ac_cv_func_tgoto+set}" = set; then
7279   echo $ECHO_N "(cached) $ECHO_C" >&6
7280 else
7281   cat >"conftest.$ac_ext" <<_ACEOF
7282 #line 7282 "configure"
7283 #include "confdefs.h"
7284 #define tgoto autoconf_temporary
7285 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
7286 #undef tgoto
7287
7288 #ifdef __cplusplus
7289 extern "C"
7290 #endif
7291
7292 /* We use char because int might match the return type of a gcc2
7293    builtin and then its argument prototype would still apply.  */
7294 char tgoto (void);
7295
7296 int
7297 main (void)
7298 {
7299
7300 /* The GNU C library defines stubs for functions which it implements
7301     to always fail with ENOSYS.  Some functions are actually named
7302     something starting with __ and the normal name is an alias.  */
7303 #if defined (__stub_tgoto) || defined (__stub___tgoto)
7304 #error found stub for tgoto
7305 #endif
7306
7307         return tgoto ();
7308   ;
7309   return 0;
7310 }
7311 _ACEOF
7312 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7313 if { (eval echo "$as_me:7313: \"$ac_link\"") >&5
7314   (eval $ac_link) 2>&5
7315   ac_status=$?
7316   echo "$as_me:7316: \$? = $ac_status" >&5
7317   (exit "$ac_status"); } &&
7318          { ac_try='test -s "conftest$ac_exeext"'
7319   { (eval echo "$as_me:7319: \"$ac_try\"") >&5
7320   (eval $ac_try) 2>&5
7321   ac_status=$?
7322   echo "$as_me:7322: \$? = $ac_status" >&5
7323   (exit "$ac_status"); }; }; then
7324   ac_cv_func_tgoto=yes
7325 else
7326   echo "$as_me: failed program was:" >&5
7327 cat "conftest.$ac_ext" >&5
7328 ac_cv_func_tgoto=no
7329 fi
7330 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7331 fi
7332 echo "$as_me:7332: result: $ac_cv_func_tgoto" >&5
7333 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
7334 if test "$ac_cv_func_tgoto" = yes; then
7335   cf_term_lib=predefined
7336 else
7337
7338                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
7339                         do
7340                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
7341 echo "$as_me:7341: checking for tgoto in -l$cf_term_lib" >&5
7342 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
7343 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
7344   echo $ECHO_N "(cached) $ECHO_C" >&6
7345 else
7346   ac_check_lib_save_LIBS=$LIBS
7347 LIBS="-l$cf_term_lib  $LIBS"
7348 cat >"conftest.$ac_ext" <<_ACEOF
7349 #line 7349 "configure"
7350 #include "confdefs.h"
7351
7352 /* Override any gcc2 internal prototype to avoid an error.  */
7353 #ifdef __cplusplus
7354 extern "C"
7355 #endif
7356 /* We use char because int might match the return type of a gcc2
7357    builtin and then its argument prototype would still apply.  */
7358 char tgoto ();
7359 int
7360 main (void)
7361 {
7362 tgoto ();
7363   ;
7364   return 0;
7365 }
7366 _ACEOF
7367 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7368 if { (eval echo "$as_me:7368: \"$ac_link\"") >&5
7369   (eval $ac_link) 2>&5
7370   ac_status=$?
7371   echo "$as_me:7371: \$? = $ac_status" >&5
7372   (exit "$ac_status"); } &&
7373          { ac_try='test -s "conftest$ac_exeext"'
7374   { (eval echo "$as_me:7374: \"$ac_try\"") >&5
7375   (eval $ac_try) 2>&5
7376   ac_status=$?
7377   echo "$as_me:7377: \$? = $ac_status" >&5
7378   (exit "$ac_status"); }; }; then
7379   eval "$as_ac_Lib=yes"
7380 else
7381   echo "$as_me: failed program was:" >&5
7382 cat "conftest.$ac_ext" >&5
7383 eval "$as_ac_Lib=no"
7384 fi
7385 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7386 LIBS=$ac_check_lib_save_LIBS
7387 fi
7388 echo "$as_me:7388: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
7389 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
7390 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
7391
7392                                         : "${cf_nculib_root:=$cf_term_lib}"
7393                                         break
7394
7395 fi
7396
7397                         done
7398
7399 fi
7400
7401         fi
7402
7403         # Check for library containing initscr
7404         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
7405         if test "x$cf_curs_lib" = x
7406         then
7407                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
7408                 do
7409                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
7410                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
7411                                 echo "$as_me:7411: checking if we can link with $cf_curs_lib library" >&5
7412 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
7413                                 cat >"conftest.$ac_ext" <<_ACEOF
7414 #line 7414 "configure"
7415 #include "confdefs.h"
7416 #include <${cf_cv_ncurses_header:-curses.h}>
7417 int
7418 main (void)
7419 {
7420 initscr()
7421   ;
7422   return 0;
7423 }
7424 _ACEOF
7425 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7426 if { (eval echo "$as_me:7426: \"$ac_link\"") >&5
7427   (eval $ac_link) 2>&5
7428   ac_status=$?
7429   echo "$as_me:7429: \$? = $ac_status" >&5
7430   (exit "$ac_status"); } &&
7431          { ac_try='test -s "conftest$ac_exeext"'
7432   { (eval echo "$as_me:7432: \"$ac_try\"") >&5
7433   (eval $ac_try) 2>&5
7434   ac_status=$?
7435   echo "$as_me:7435: \$? = $ac_status" >&5
7436   (exit "$ac_status"); }; }; then
7437   cf_result=yes
7438 else
7439   echo "$as_me: failed program was:" >&5
7440 cat "conftest.$ac_ext" >&5
7441 cf_result=no
7442 fi
7443 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7444                                 echo "$as_me:7444: result: $cf_result" >&5
7445 echo "${ECHO_T}$cf_result" >&6
7446                                 test "$cf_result" = yes && break
7447                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
7448                                 cf_result=no
7449                         elif test "$cf_term_lib" != predefined ; then
7450                                 echo "$as_me:7450: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
7451 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
7452                                 cat >"conftest.$ac_ext" <<_ACEOF
7453 #line 7453 "configure"
7454 #include "confdefs.h"
7455 #include <${cf_cv_ncurses_header:-curses.h}>
7456 int
7457 main (void)
7458 {
7459 initscr(); tgoto((char *)0, 0, 0);
7460   ;
7461   return 0;
7462 }
7463 _ACEOF
7464 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7465 if { (eval echo "$as_me:7465: \"$ac_link\"") >&5
7466   (eval $ac_link) 2>&5
7467   ac_status=$?
7468   echo "$as_me:7468: \$? = $ac_status" >&5
7469   (exit "$ac_status"); } &&
7470          { ac_try='test -s "conftest$ac_exeext"'
7471   { (eval echo "$as_me:7471: \"$ac_try\"") >&5
7472   (eval $ac_try) 2>&5
7473   ac_status=$?
7474   echo "$as_me:7474: \$? = $ac_status" >&5
7475   (exit "$ac_status"); }; }; then
7476   cf_result=no
7477 else
7478   echo "$as_me: failed program was:" >&5
7479 cat "conftest.$ac_ext" >&5
7480
7481                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
7482                                         cat >"conftest.$ac_ext" <<_ACEOF
7483 #line 7483 "configure"
7484 #include "confdefs.h"
7485 #include <${cf_cv_ncurses_header:-curses.h}>
7486 int
7487 main (void)
7488 {
7489 initscr()
7490   ;
7491   return 0;
7492 }
7493 _ACEOF
7494 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7495 if { (eval echo "$as_me:7495: \"$ac_link\"") >&5
7496   (eval $ac_link) 2>&5
7497   ac_status=$?
7498   echo "$as_me:7498: \$? = $ac_status" >&5
7499   (exit "$ac_status"); } &&
7500          { ac_try='test -s "conftest$ac_exeext"'
7501   { (eval echo "$as_me:7501: \"$ac_try\"") >&5
7502   (eval $ac_try) 2>&5
7503   ac_status=$?
7504   echo "$as_me:7504: \$? = $ac_status" >&5
7505   (exit "$ac_status"); }; }; then
7506   cf_result=yes
7507 else
7508   echo "$as_me: failed program was:" >&5
7509 cat "conftest.$ac_ext" >&5
7510 cf_result=error
7511 fi
7512 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7513
7514 fi
7515 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7516                                 echo "$as_me:7516: result: $cf_result" >&5
7517 echo "${ECHO_T}$cf_result" >&6
7518                                 test "$cf_result" != error && break
7519                         fi
7520                 done
7521         fi
7522         test "$cf_curs_lib" = unknown && { { echo "$as_me:7522: error: no curses library found" >&5
7523 echo "$as_me: error: no curses library found" >&2;}
7524    { (exit 1); exit 1; }; }
7525 fi
7526 fi
7527
7528         ;;
7529 (ncursesw*)
7530
7531 for ac_header in wchar.h
7532 do
7533 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7534 echo "$as_me:7534: checking for $ac_header" >&5
7535 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7536 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7537   echo $ECHO_N "(cached) $ECHO_C" >&6
7538 else
7539   cat >"conftest.$ac_ext" <<_ACEOF
7540 #line 7540 "configure"
7541 #include "confdefs.h"
7542 #include <$ac_header>
7543 _ACEOF
7544 if { (eval echo "$as_me:7544: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7545   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7546   ac_status=$?
7547   $EGREP -v '^ *\+' conftest.er1 >conftest.err
7548   rm -f conftest.er1
7549   cat conftest.err >&5
7550   echo "$as_me:7550: \$? = $ac_status" >&5
7551   (exit "$ac_status"); } >/dev/null; then
7552   if test -s conftest.err; then
7553     ac_cpp_err=$ac_c_preproc_warn_flag
7554   else
7555     ac_cpp_err=
7556   fi
7557 else
7558   ac_cpp_err=yes
7559 fi
7560 if test -z "$ac_cpp_err"; then
7561   eval "$as_ac_Header=yes"
7562 else
7563   echo "$as_me: failed program was:" >&5
7564   cat "conftest.$ac_ext" >&5
7565   eval "$as_ac_Header=no"
7566 fi
7567 rm -f conftest.err "conftest.$ac_ext"
7568 fi
7569 echo "$as_me:7569: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7570 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7571 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7572   cat >>confdefs.h <<EOF
7573 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7574 EOF
7575
7576 fi
7577 done
7578
7579 echo "$as_me:7579: checking for multibyte character support" >&5
7580 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7581 if test "${cf_cv_utf8_lib+set}" = set; then
7582   echo $ECHO_N "(cached) $ECHO_C" >&6
7583 else
7584
7585         cf_save_LIBS="$LIBS"
7586         cat >"conftest.$ac_ext" <<_ACEOF
7587 #line 7587 "configure"
7588 #include "confdefs.h"
7589
7590 #include <stdlib.h>
7591 #include <stdio.h>
7592 #ifdef HAVE_WCHAR_H
7593 #include <wchar.h>
7594 #endif
7595
7596 int
7597 main (void)
7598 {
7599 putwc(0,0);
7600   ;
7601   return 0;
7602 }
7603 _ACEOF
7604 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7605 if { (eval echo "$as_me:7605: \"$ac_link\"") >&5
7606   (eval $ac_link) 2>&5
7607   ac_status=$?
7608   echo "$as_me:7608: \$? = $ac_status" >&5
7609   (exit "$ac_status"); } &&
7610          { ac_try='test -s "conftest$ac_exeext"'
7611   { (eval echo "$as_me:7611: \"$ac_try\"") >&5
7612   (eval $ac_try) 2>&5
7613   ac_status=$?
7614   echo "$as_me:7614: \$? = $ac_status" >&5
7615   (exit "$ac_status"); }; }; then
7616   cf_cv_utf8_lib=yes
7617 else
7618   echo "$as_me: failed program was:" >&5
7619 cat "conftest.$ac_ext" >&5
7620
7621 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7622 # will be set on completion of the AC_TRY_LINK below.
7623 cf_cv_header_path_utf8=
7624 cf_cv_library_path_utf8=
7625
7626 echo "${as_me:-configure}:7626: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7627
7628 cf_save_LIBS="$LIBS"
7629
7630 cat >"conftest.$ac_ext" <<_ACEOF
7631 #line 7631 "configure"
7632 #include "confdefs.h"
7633
7634 #include <libutf8.h>
7635 int
7636 main (void)
7637 {
7638 putwc(0,0);
7639   ;
7640   return 0;
7641 }
7642 _ACEOF
7643 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7644 if { (eval echo "$as_me:7644: \"$ac_link\"") >&5
7645   (eval $ac_link) 2>&5
7646   ac_status=$?
7647   echo "$as_me:7647: \$? = $ac_status" >&5
7648   (exit "$ac_status"); } &&
7649          { ac_try='test -s "conftest$ac_exeext"'
7650   { (eval echo "$as_me:7650: \"$ac_try\"") >&5
7651   (eval $ac_try) 2>&5
7652   ac_status=$?
7653   echo "$as_me:7653: \$? = $ac_status" >&5
7654   (exit "$ac_status"); }; }; then
7655
7656         cf_cv_find_linkage_utf8=yes
7657         cf_cv_header_path_utf8=/usr/include
7658         cf_cv_library_path_utf8=/usr/lib
7659
7660 else
7661   echo "$as_me: failed program was:" >&5
7662 cat "conftest.$ac_ext" >&5
7663
7664 LIBS="-lutf8  $cf_save_LIBS"
7665
7666 cat >"conftest.$ac_ext" <<_ACEOF
7667 #line 7667 "configure"
7668 #include "confdefs.h"
7669
7670 #include <libutf8.h>
7671 int
7672 main (void)
7673 {
7674 putwc(0,0);
7675   ;
7676   return 0;
7677 }
7678 _ACEOF
7679 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7680 if { (eval echo "$as_me:7680: \"$ac_link\"") >&5
7681   (eval $ac_link) 2>&5
7682   ac_status=$?
7683   echo "$as_me:7683: \$? = $ac_status" >&5
7684   (exit "$ac_status"); } &&
7685          { ac_try='test -s "conftest$ac_exeext"'
7686   { (eval echo "$as_me:7686: \"$ac_try\"") >&5
7687   (eval $ac_try) 2>&5
7688   ac_status=$?
7689   echo "$as_me:7689: \$? = $ac_status" >&5
7690   (exit "$ac_status"); }; }; then
7691
7692         cf_cv_find_linkage_utf8=yes
7693         cf_cv_header_path_utf8=/usr/include
7694         cf_cv_library_path_utf8=/usr/lib
7695         cf_cv_library_file_utf8="-lutf8"
7696
7697 else
7698   echo "$as_me: failed program was:" >&5
7699 cat "conftest.$ac_ext" >&5
7700
7701         cf_cv_find_linkage_utf8=no
7702         LIBS="$cf_save_LIBS"
7703
7704         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7705
7706 echo "${as_me:-configure}:7706: testing find linkage for utf8 library ..." 1>&5
7707
7708 echo "${as_me:-configure}:7708: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7709
7710         cf_save_CPPFLAGS="$CPPFLAGS"
7711         cf_test_CPPFLAGS="$CPPFLAGS"
7712
7713 cf_search=
7714
7715 # collect the current set of include-directories from compiler flags
7716 cf_header_path_list=""
7717 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7718         for cf_header_path in $CPPFLAGS $CFLAGS
7719         do
7720                 case "$cf_header_path" in
7721                 (-I*)
7722                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7723
7724 test "x$cf_header_path" != "xNONE" && \
7725 test -d "$cf_header_path" && \
7726  {
7727         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7728         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
7729         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
7730         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7731         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
7732         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7733 }
7734
7735                         cf_header_path_list="$cf_header_path_list $cf_search"
7736                         ;;
7737                 esac
7738         done
7739 fi
7740
7741 # add the variations for the package we are looking for
7742
7743 cf_search=
7744
7745 test "x$prefix" != "xNONE" && \
7746 test -d "$prefix" && \
7747  {
7748         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7749         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
7750         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
7751         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
7752         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
7753         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7754 }
7755
7756 for cf_subdir_prefix in \
7757         /usr \
7758         /usr/local \
7759         /usr/pkg \
7760         /opt \
7761         /opt/local \
7762         $HOME
7763 do
7764
7765 test "x$cf_subdir_prefix" != "x$prefix" && \
7766 test -d "$cf_subdir_prefix" && \
7767 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7768         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7769         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
7770         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7771         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7772         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7773         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7774 }
7775
7776 done
7777
7778 test "$includedir" != NONE && \
7779 test "$includedir" != "/usr/include" && \
7780 test -d "$includedir" && {
7781         test -d "$includedir" &&    cf_search="$cf_search $includedir"
7782         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
7783 }
7784
7785 test "$oldincludedir" != NONE && \
7786 test "$oldincludedir" != "/usr/include" && \
7787 test -d "$oldincludedir" && {
7788         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
7789         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
7790 }
7791
7792 cf_search="$cf_search $cf_header_path_list"
7793
7794         for cf_cv_header_path_utf8 in $cf_search
7795         do
7796                 if test -d "$cf_cv_header_path_utf8" ; then
7797                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7798
7799 echo "${as_me:-configure}:7799: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7800
7801                         CPPFLAGS="$cf_save_CPPFLAGS"
7802
7803         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7804         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7805
7806                         cat >"conftest.$ac_ext" <<_ACEOF
7807 #line 7807 "configure"
7808 #include "confdefs.h"
7809
7810 #include <libutf8.h>
7811 int
7812 main (void)
7813 {
7814 putwc(0,0);
7815   ;
7816   return 0;
7817 }
7818 _ACEOF
7819 rm -f "conftest.$ac_objext"
7820 if { (eval echo "$as_me:7820: \"$ac_compile\"") >&5
7821   (eval $ac_compile) 2>&5
7822   ac_status=$?
7823   echo "$as_me:7823: \$? = $ac_status" >&5
7824   (exit "$ac_status"); } &&
7825          { ac_try='test -s "conftest.$ac_objext"'
7826   { (eval echo "$as_me:7826: \"$ac_try\"") >&5
7827   (eval $ac_try) 2>&5
7828   ac_status=$?
7829   echo "$as_me:7829: \$? = $ac_status" >&5
7830   (exit "$ac_status"); }; }; then
7831
7832                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7833
7834 echo "${as_me:-configure}:7834: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7835
7836                                 cf_cv_find_linkage_utf8=maybe
7837                                 cf_test_CPPFLAGS="$CPPFLAGS"
7838                                 break
7839 else
7840   echo "$as_me: failed program was:" >&5
7841 cat "conftest.$ac_ext" >&5
7842
7843                                 CPPFLAGS="$cf_save_CPPFLAGS"
7844
7845 fi
7846 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7847                 fi
7848         done
7849
7850         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7851
7852 echo "${as_me:-configure}:7852: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7853
7854                 cf_save_LIBS="$LIBS"
7855                 cf_save_LDFLAGS="$LDFLAGS"
7856
7857                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7858
7859 cf_search=
7860 cf_library_path_list=""
7861 if test -n "${LDFLAGS}${LIBS}" ; then
7862         for cf_library_path in $LDFLAGS $LIBS
7863         do
7864                 case "$cf_library_path" in
7865                 (-L*)
7866                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7867
7868 test "x$cf_library_path" != "xNONE" && \
7869 test -d "$cf_library_path" && \
7870  {
7871         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7872         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7873         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7874         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7875         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7876         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7877 }
7878
7879                         cf_library_path_list="$cf_library_path_list $cf_search"
7880                         ;;
7881                 esac
7882         done
7883 fi
7884
7885 cf_search=
7886
7887 test "x$prefix" != "xNONE" && \
7888 test -d "$prefix" && \
7889  {
7890         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7891         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7892         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7893         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7894         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7895         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7896 }
7897
7898 for cf_subdir_prefix in \
7899         /usr \
7900         /usr/local \
7901         /usr/pkg \
7902         /opt \
7903         /opt/local \
7904         $HOME
7905 do
7906
7907 test "x$cf_subdir_prefix" != "x$prefix" && \
7908 test -d "$cf_subdir_prefix" && \
7909 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7910         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7911         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7912         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7913         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7914         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7915         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7916 }
7917
7918 done
7919
7920 cf_search="$cf_library_path_list $cf_search"
7921
7922                         for cf_cv_library_path_utf8 in $cf_search
7923                         do
7924                                 if test -d "$cf_cv_library_path_utf8" ; then
7925                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7926
7927 echo "${as_me:-configure}:7927: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7928
7929                                         CPPFLAGS="$cf_test_CPPFLAGS"
7930                                         LIBS="-lutf8  $cf_save_LIBS"
7931                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7932                                         cat >"conftest.$ac_ext" <<_ACEOF
7933 #line 7933 "configure"
7934 #include "confdefs.h"
7935
7936 #include <libutf8.h>
7937 int
7938 main (void)
7939 {
7940 putwc(0,0);
7941   ;
7942   return 0;
7943 }
7944 _ACEOF
7945 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7946 if { (eval echo "$as_me:7946: \"$ac_link\"") >&5
7947   (eval $ac_link) 2>&5
7948   ac_status=$?
7949   echo "$as_me:7949: \$? = $ac_status" >&5
7950   (exit "$ac_status"); } &&
7951          { ac_try='test -s "conftest$ac_exeext"'
7952   { (eval echo "$as_me:7952: \"$ac_try\"") >&5
7953   (eval $ac_try) 2>&5
7954   ac_status=$?
7955   echo "$as_me:7955: \$? = $ac_status" >&5
7956   (exit "$ac_status"); }; }; then
7957
7958                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7959
7960 echo "${as_me:-configure}:7960: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7961
7962                                         cf_cv_find_linkage_utf8=yes
7963                                         cf_cv_library_file_utf8="-lutf8"
7964                                         break
7965 else
7966   echo "$as_me: failed program was:" >&5
7967 cat "conftest.$ac_ext" >&5
7968
7969                                         CPPFLAGS="$cf_save_CPPFLAGS"
7970                                         LIBS="$cf_save_LIBS"
7971                                         LDFLAGS="$cf_save_LDFLAGS"
7972
7973 fi
7974 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7975                                 fi
7976                         done
7977                         CPPFLAGS="$cf_save_CPPFLAGS"
7978                         LDFLAGS="$cf_save_LDFLAGS"
7979                 fi
7980
7981         else
7982                 cf_cv_find_linkage_utf8=no
7983         fi
7984
7985 fi
7986 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7987
7988 fi
7989 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7990
7991 LIBS="$cf_save_LIBS"
7992
7993 if test "$cf_cv_find_linkage_utf8" = yes ; then
7994 cf_cv_utf8_lib=add-on
7995 else
7996 cf_cv_utf8_lib=no
7997 fi
7998
7999 fi
8000 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8001 fi
8002 echo "$as_me:8002: result: $cf_cv_utf8_lib" >&5
8003 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
8004
8005 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
8006 # ncurses/ncursesw:
8007 if test "$cf_cv_utf8_lib" = "add-on" ; then
8008
8009 cat >>confdefs.h <<\EOF
8010 #define HAVE_LIBUTF8_H 1
8011 EOF
8012
8013 if test -n "$cf_cv_header_path_utf8" ; then
8014   for cf_add_incdir in $cf_cv_header_path_utf8
8015   do
8016         while test "$cf_add_incdir" != /usr/include
8017         do
8018           if test -d "$cf_add_incdir"
8019           then
8020                 cf_have_incdir=no
8021                 if test -n "$CFLAGS$CPPFLAGS" ; then
8022                   # a loop is needed to ensure we can add subdirs of existing dirs
8023                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8024                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8025                           cf_have_incdir=yes; break
8026                         fi
8027                   done
8028                 fi
8029
8030                 if test "$cf_have_incdir" = no ; then
8031                   if test "$cf_add_incdir" = /usr/local/include ; then
8032                         if test "$GCC" = yes
8033                         then
8034                           cf_save_CPPFLAGS=$CPPFLAGS
8035
8036         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8037         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8038
8039                           cat >"conftest.$ac_ext" <<_ACEOF
8040 #line 8040 "configure"
8041 #include "confdefs.h"
8042 #include <stdio.h>
8043 int
8044 main (void)
8045 {
8046 printf("Hello")
8047   ;
8048   return 0;
8049 }
8050 _ACEOF
8051 rm -f "conftest.$ac_objext"
8052 if { (eval echo "$as_me:8052: \"$ac_compile\"") >&5
8053   (eval $ac_compile) 2>&5
8054   ac_status=$?
8055   echo "$as_me:8055: \$? = $ac_status" >&5
8056   (exit "$ac_status"); } &&
8057          { ac_try='test -s "conftest.$ac_objext"'
8058   { (eval echo "$as_me:8058: \"$ac_try\"") >&5
8059   (eval $ac_try) 2>&5
8060   ac_status=$?
8061   echo "$as_me:8061: \$? = $ac_status" >&5
8062   (exit "$ac_status"); }; }; then
8063   :
8064 else
8065   echo "$as_me: failed program was:" >&5
8066 cat "conftest.$ac_ext" >&5
8067 cf_have_incdir=yes
8068 fi
8069 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8070                           CPPFLAGS=$cf_save_CPPFLAGS
8071                         fi
8072                   fi
8073                 fi
8074
8075                 if test "$cf_have_incdir" = no ; then
8076                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8077
8078 echo "${as_me:-configure}:8078: testing adding $cf_add_incdir to include-path ..." 1>&5
8079
8080                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8081
8082                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8083                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8084                   cf_add_incdir="$cf_top_incdir"
8085                 else
8086                   break
8087                 fi
8088           else
8089                 break
8090           fi
8091         done
8092   done
8093 fi
8094
8095 if test -n "$cf_cv_library_path_utf8" ; then
8096         for cf_add_libdir in $cf_cv_library_path_utf8
8097         do
8098                 if test "$cf_add_libdir" = /usr/lib ; then
8099                         :
8100                 elif test -d "$cf_add_libdir"
8101                 then
8102                         cf_have_libdir=no
8103                         if test -n "$LDFLAGS$LIBS" ; then
8104                                 # a loop is needed to ensure we can add subdirs of existing dirs
8105                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
8106                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
8107                                                 cf_have_libdir=yes; break
8108                                         fi
8109                                 done
8110                         fi
8111                         if test "$cf_have_libdir" = no ; then
8112                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
8113
8114 echo "${as_me:-configure}:8114: testing adding $cf_add_libdir to library-path ..." 1>&5
8115
8116                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
8117                         fi
8118                 fi
8119         done
8120 fi
8121
8122 cf_add_libs="$LIBS"
8123 # reverse order
8124 cf_add_0lib=
8125 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8126 # filter duplicates
8127 for cf_add_1lib in $cf_add_0lib; do
8128         for cf_add_2lib in $cf_add_libs; do
8129                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8130                         cf_add_1lib=
8131                         break
8132                 fi
8133         done
8134         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8135 done
8136 LIBS="$cf_add_libs"
8137
8138 fi
8139
8140 cf_ncuconfig_root=$cf_cv_screen
8141 cf_have_ncuconfig=no
8142
8143 if test "x${PKG_CONFIG:=none}" != xnone; then
8144         echo "$as_me:8144: checking pkg-config for $cf_ncuconfig_root" >&5
8145 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8146         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8147                 echo "$as_me:8147: result: yes" >&5
8148 echo "${ECHO_T}yes" >&6
8149
8150                 echo "$as_me:8150: checking if the $cf_ncuconfig_root package files work" >&5
8151 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8152                 cf_have_ncuconfig=unknown
8153
8154                 cf_save_CFLAGS="$CFLAGS"
8155                 cf_save_CPPFLAGS="$CPPFLAGS"
8156                 cf_save_LIBS="$LIBS"
8157
8158                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8159                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8160
8161                 # while -W for passing linker flags is prevalent, it is not "standard".
8162                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
8163                 # incompatible _and_ non-standard -W option which gives an error.  Work
8164                 # around that pitfall.
8165                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
8166                 (x*c[89]9@@*-W*)
8167
8168 cf_fix_cppflags=no
8169 cf_new_cflags=
8170 cf_new_cppflags=
8171 cf_new_extra_cppflags=
8172
8173 for cf_add_cflags in $cf_pkg_cflags
8174 do
8175 case "$cf_fix_cppflags" in
8176 (no)
8177         case "$cf_add_cflags" in
8178         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8179                 case "$cf_add_cflags" in
8180                 (-D*)
8181                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8182
8183                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8184                                 && test -z "${cf_tst_cflags}" \
8185                                 && cf_fix_cppflags=yes
8186
8187                         if test "$cf_fix_cppflags" = yes ; then
8188
8189         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8190         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8191
8192                                 continue
8193                         elif test "${cf_tst_cflags}" = "\"'" ; then
8194
8195         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8196         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8197
8198                                 continue
8199                         fi
8200                         ;;
8201                 esac
8202                 case "$CPPFLAGS" in
8203                 (*$cf_add_cflags)
8204                         ;;
8205                 (*)
8206                         case "$cf_add_cflags" in
8207                         (-D*)
8208                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8209
8210 CPPFLAGS=`echo "$CPPFLAGS" | \
8211         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8212                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8213
8214                                 ;;
8215                         esac
8216
8217         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8218         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8219
8220                         ;;
8221                 esac
8222                 ;;
8223         (*)
8224
8225         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8226         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8227
8228                 ;;
8229         esac
8230         ;;
8231 (yes)
8232
8233         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8234         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8235
8236         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8237
8238         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8239                 && test -z "${cf_tst_cflags}" \
8240                 && cf_fix_cppflags=no
8241         ;;
8242 esac
8243 done
8244
8245 if test -n "$cf_new_cflags" ; then
8246
8247         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8248         CFLAGS="${CFLAGS}$cf_new_cflags"
8249
8250 fi
8251
8252 if test -n "$cf_new_cppflags" ; then
8253
8254         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8255         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8256
8257 fi
8258
8259 if test -n "$cf_new_extra_cppflags" ; then
8260
8261         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8262         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8263
8264 fi
8265
8266 cf_add_libs="$LIBS"
8267 # reverse order
8268 cf_add_0lib=
8269 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8270 # filter duplicates
8271 for cf_add_1lib in $cf_add_0lib; do
8272         for cf_add_2lib in $cf_add_libs; do
8273                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8274                         cf_add_1lib=
8275                         break
8276                 fi
8277         done
8278         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8279 done
8280 LIBS="$cf_add_libs"
8281
8282                         cat >"conftest.$ac_ext" <<_ACEOF
8283 #line 8283 "configure"
8284 #include "confdefs.h"
8285 #include <${cf_cv_ncurses_header:-curses.h}>
8286 int
8287 main (void)
8288 {
8289 initscr(); mousemask(0,0); tigetstr((char *)0);
8290   ;
8291   return 0;
8292 }
8293 _ACEOF
8294 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8295 if { (eval echo "$as_me:8295: \"$ac_link\"") >&5
8296   (eval $ac_link) 2>&5
8297   ac_status=$?
8298   echo "$as_me:8298: \$? = $ac_status" >&5
8299   (exit "$ac_status"); } &&
8300          { ac_try='test -s "conftest$ac_exeext"'
8301   { (eval echo "$as_me:8301: \"$ac_try\"") >&5
8302   (eval $ac_try) 2>&5
8303   ac_status=$?
8304   echo "$as_me:8304: \$? = $ac_status" >&5
8305   (exit "$ac_status"); }; }; then
8306   if test "$cross_compiling" = yes; then
8307   cf_test_ncuconfig=maybe
8308 else
8309   cat >"conftest.$ac_ext" <<_ACEOF
8310 #line 8310 "configure"
8311 #include "confdefs.h"
8312 #include <${cf_cv_ncurses_header:-curses.h}>
8313                                         int main(void)
8314                                         { const char *xx = curses_version(); return (xx == 0); }
8315 _ACEOF
8316 rm -f "conftest$ac_exeext"
8317 if { (eval echo "$as_me:8317: \"$ac_link\"") >&5
8318   (eval $ac_link) 2>&5
8319   ac_status=$?
8320   echo "$as_me:8320: \$? = $ac_status" >&5
8321   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8322   { (eval echo "$as_me:8322: \"$ac_try\"") >&5
8323   (eval $ac_try) 2>&5
8324   ac_status=$?
8325   echo "$as_me:8325: \$? = $ac_status" >&5
8326   (exit "$ac_status"); }; }; then
8327   cf_test_ncuconfig=yes
8328 else
8329   echo "$as_me: program exited with status $ac_status" >&5
8330 echo "$as_me: failed program was:" >&5
8331 cat "conftest.$ac_ext" >&5
8332 cf_test_ncuconfig=no
8333 fi
8334 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8335 fi
8336 else
8337   echo "$as_me: failed program was:" >&5
8338 cat "conftest.$ac_ext" >&5
8339 cf_test_ncuconfig=no
8340 fi
8341 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8342
8343                         CFLAGS="$cf_save_CFLAGS"
8344                         CPPFLAGS="$cf_save_CPPFLAGS"
8345                         LIBS="$cf_save_LIBS"
8346
8347                         if test "x$cf_test_ncuconfig" != xyes; then
8348                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
8349                                 cf_pkg_cflags="$cf_temp"
8350                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
8351                                 cf_pkg_libs="$cf_temp"
8352                         fi
8353                         ;;
8354                 esac
8355
8356 for cf_add_cflags in $cf_pkg_cflags
8357 do
8358
8359 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8360 cf_old_cflag="$CFLAGS"
8361
8362 case "$CFLAGS" in
8363 (*$cf_add_cflags=*)
8364         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
8365         ;;
8366 (*$cf_add_cflags\ *)
8367         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
8368         ;;
8369 (*$cf_add_cflags)
8370         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
8371         ;;
8372 esac
8373
8374 if test "$CFLAGS" != "$cf_old_cflag" ;
8375 then
8376
8377         CFLAGS="$cf_new_cflag"
8378 fi
8379
8380 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8381 cf_old_cflag="$CPPFLAGS"
8382
8383 case "$CPPFLAGS" in
8384 (*$cf_add_cflags=*)
8385         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
8386         ;;
8387 (*$cf_add_cflags\ *)
8388         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
8389         ;;
8390 (*$cf_add_cflags)
8391         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
8392         ;;
8393 esac
8394
8395 if test "$CPPFLAGS" != "$cf_old_cflag" ;
8396 then
8397
8398         CPPFLAGS="$cf_new_cflag"
8399 fi
8400
8401 done
8402
8403 cf_fix_cppflags=no
8404 cf_new_cflags=
8405 cf_new_cppflags=
8406 cf_new_extra_cppflags=
8407
8408 for cf_add_cflags in $cf_pkg_cflags
8409 do
8410 case "$cf_fix_cppflags" in
8411 (no)
8412         case "$cf_add_cflags" in
8413         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8414                 case "$cf_add_cflags" in
8415                 (-D*)
8416                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8417
8418                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8419                                 && test -z "${cf_tst_cflags}" \
8420                                 && cf_fix_cppflags=yes
8421
8422                         if test "$cf_fix_cppflags" = yes ; then
8423
8424         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8425         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8426
8427                                 continue
8428                         elif test "${cf_tst_cflags}" = "\"'" ; then
8429
8430         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8431         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8432
8433                                 continue
8434                         fi
8435                         ;;
8436                 esac
8437                 case "$CPPFLAGS" in
8438                 (*$cf_add_cflags)
8439                         ;;
8440                 (*)
8441                         case "$cf_add_cflags" in
8442                         (-D*)
8443                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8444
8445 CPPFLAGS=`echo "$CPPFLAGS" | \
8446         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8447                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8448
8449                                 ;;
8450                         esac
8451
8452         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8453         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8454
8455                         ;;
8456                 esac
8457                 ;;
8458         (*)
8459
8460         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8461         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8462
8463                 ;;
8464         esac
8465         ;;
8466 (yes)
8467
8468         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8469         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8470
8471         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8472
8473         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8474                 && test -z "${cf_tst_cflags}" \
8475                 && cf_fix_cppflags=no
8476         ;;
8477 esac
8478 done
8479
8480 if test -n "$cf_new_cflags" ; then
8481
8482         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8483         CFLAGS="${CFLAGS}$cf_new_cflags"
8484
8485 fi
8486
8487 if test -n "$cf_new_cppflags" ; then
8488
8489         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8490         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8491
8492 fi
8493
8494 if test -n "$cf_new_extra_cppflags" ; then
8495
8496         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8497         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8498
8499 fi
8500
8501 cf_add_libs="$LIBS"
8502 # reverse order
8503 cf_add_0lib=
8504 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8505 # filter duplicates
8506 for cf_add_1lib in $cf_add_0lib; do
8507         for cf_add_2lib in $cf_add_libs; do
8508                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8509                         cf_add_1lib=
8510                         break
8511                 fi
8512         done
8513         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8514 done
8515 LIBS="$cf_add_libs"
8516
8517                 cat >"conftest.$ac_ext" <<_ACEOF
8518 #line 8518 "configure"
8519 #include "confdefs.h"
8520 #include <${cf_cv_ncurses_header:-curses.h}>
8521 int
8522 main (void)
8523 {
8524 initscr(); mousemask(0,0); tigetstr((char *)0);
8525   ;
8526   return 0;
8527 }
8528 _ACEOF
8529 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8530 if { (eval echo "$as_me:8530: \"$ac_link\"") >&5
8531   (eval $ac_link) 2>&5
8532   ac_status=$?
8533   echo "$as_me:8533: \$? = $ac_status" >&5
8534   (exit "$ac_status"); } &&
8535          { ac_try='test -s "conftest$ac_exeext"'
8536   { (eval echo "$as_me:8536: \"$ac_try\"") >&5
8537   (eval $ac_try) 2>&5
8538   ac_status=$?
8539   echo "$as_me:8539: \$? = $ac_status" >&5
8540   (exit "$ac_status"); }; }; then
8541   if test "$cross_compiling" = yes; then
8542   cf_have_ncuconfig=maybe
8543 else
8544   cat >"conftest.$ac_ext" <<_ACEOF
8545 #line 8545 "configure"
8546 #include "confdefs.h"
8547 #include <${cf_cv_ncurses_header:-curses.h}>
8548                                 int main(void)
8549                                 { const char *xx = curses_version(); return (xx == 0); }
8550 _ACEOF
8551 rm -f "conftest$ac_exeext"
8552 if { (eval echo "$as_me:8552: \"$ac_link\"") >&5
8553   (eval $ac_link) 2>&5
8554   ac_status=$?
8555   echo "$as_me:8555: \$? = $ac_status" >&5
8556   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8557   { (eval echo "$as_me:8557: \"$ac_try\"") >&5
8558   (eval $ac_try) 2>&5
8559   ac_status=$?
8560   echo "$as_me:8560: \$? = $ac_status" >&5
8561   (exit "$ac_status"); }; }; then
8562   cf_have_ncuconfig=yes
8563 else
8564   echo "$as_me: program exited with status $ac_status" >&5
8565 echo "$as_me: failed program was:" >&5
8566 cat "conftest.$ac_ext" >&5
8567 cf_have_ncuconfig=no
8568 fi
8569 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8570 fi
8571 else
8572   echo "$as_me: failed program was:" >&5
8573 cat "conftest.$ac_ext" >&5
8574 cf_have_ncuconfig=no
8575 fi
8576 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8577                 echo "$as_me:8577: result: $cf_have_ncuconfig" >&5
8578 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8579                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8580                 if test "$cf_have_ncuconfig" != "yes"
8581                 then
8582                         CPPFLAGS="$cf_save_CPPFLAGS"
8583                         LIBS="$cf_save_LIBS"
8584                         NCURSES_CONFIG_PKG=none
8585                 else
8586
8587 cat >>confdefs.h <<\EOF
8588 #define NCURSES 1
8589 EOF
8590
8591                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8592
8593 echo "$as_me:8593: checking for terminfo header" >&5
8594 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8595 if test "${cf_cv_term_header+set}" = set; then
8596   echo $ECHO_N "(cached) $ECHO_C" >&6
8597 else
8598
8599 case "${cf_cv_ncurses_header}" in
8600 (*/ncurses.h|*/ncursesw.h)
8601         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8602         ;;
8603 (*)
8604         cf_term_header=term.h
8605         ;;
8606 esac
8607
8608 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8609 do
8610 cat >"conftest.$ac_ext" <<_ACEOF
8611 #line 8611 "configure"
8612 #include "confdefs.h"
8613 #include <stdio.h>
8614 #include <${cf_cv_ncurses_header:-curses.h}>
8615 #include <$cf_test>
8616
8617 int
8618 main (void)
8619 {
8620 int x = auto_left_margin; (void)x
8621   ;
8622   return 0;
8623 }
8624 _ACEOF
8625 rm -f "conftest.$ac_objext"
8626 if { (eval echo "$as_me:8626: \"$ac_compile\"") >&5
8627   (eval $ac_compile) 2>&5
8628   ac_status=$?
8629   echo "$as_me:8629: \$? = $ac_status" >&5
8630   (exit "$ac_status"); } &&
8631          { ac_try='test -s "conftest.$ac_objext"'
8632   { (eval echo "$as_me:8632: \"$ac_try\"") >&5
8633   (eval $ac_try) 2>&5
8634   ac_status=$?
8635   echo "$as_me:8635: \$? = $ac_status" >&5
8636   (exit "$ac_status"); }; }; then
8637
8638         cf_cv_term_header="$cf_test"
8639 else
8640   echo "$as_me: failed program was:" >&5
8641 cat "conftest.$ac_ext" >&5
8642
8643         cf_cv_term_header=unknown
8644
8645 fi
8646 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8647         test "$cf_cv_term_header" != unknown && break
8648 done
8649
8650 fi
8651 echo "$as_me:8651: result: $cf_cv_term_header" >&5
8652 echo "${ECHO_T}$cf_cv_term_header" >&6
8653
8654 # Set definitions to allow ifdef'ing to accommodate subdirectories
8655
8656 case "$cf_cv_term_header" in
8657 (*term.h)
8658
8659 cat >>confdefs.h <<\EOF
8660 #define HAVE_TERM_H 1
8661 EOF
8662
8663         ;;
8664 esac
8665
8666 case "$cf_cv_term_header" in
8667 (ncurses/term.h)
8668
8669 cat >>confdefs.h <<\EOF
8670 #define HAVE_NCURSES_TERM_H 1
8671 EOF
8672
8673         ;;
8674 (ncursesw/term.h)
8675
8676 cat >>confdefs.h <<\EOF
8677 #define HAVE_NCURSESW_TERM_H 1
8678 EOF
8679
8680         ;;
8681 esac
8682
8683                 fi
8684
8685         else
8686                 echo "$as_me:8686: result: no" >&5
8687 echo "${ECHO_T}no" >&6
8688                 NCURSES_CONFIG_PKG=none
8689         fi
8690 else
8691         NCURSES_CONFIG_PKG=none
8692 fi
8693
8694 if test "x$cf_have_ncuconfig" = "xno"; then
8695         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8696
8697 if test -n "$ac_tool_prefix"; then
8698   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8699   do
8700     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8701 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8702 echo "$as_me:8702: checking for $ac_word" >&5
8703 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8704 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8705   echo $ECHO_N "(cached) $ECHO_C" >&6
8706 else
8707   if test -n "$NCURSES_CONFIG"; then
8708   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8709 else
8710   ac_save_IFS=$IFS; IFS=$ac_path_separator
8711 ac_dummy="$PATH"
8712 for ac_dir in $ac_dummy; do
8713   IFS=$ac_save_IFS
8714   test -z "$ac_dir" && ac_dir=.
8715   $as_executable_p "$ac_dir/$ac_word" || continue
8716 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8717 echo "$as_me:8717: found $ac_dir/$ac_word" >&5
8718 break
8719 done
8720
8721 fi
8722 fi
8723 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8724 if test -n "$NCURSES_CONFIG"; then
8725   echo "$as_me:8725: result: $NCURSES_CONFIG" >&5
8726 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8727 else
8728   echo "$as_me:8728: result: no" >&5
8729 echo "${ECHO_T}no" >&6
8730 fi
8731
8732     test -n "$NCURSES_CONFIG" && break
8733   done
8734 fi
8735 if test -z "$NCURSES_CONFIG"; then
8736   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8737   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8738 do
8739   # Extract the first word of "$ac_prog", so it can be a program name with args.
8740 set dummy $ac_prog; ac_word=$2
8741 echo "$as_me:8741: checking for $ac_word" >&5
8742 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8743 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8744   echo $ECHO_N "(cached) $ECHO_C" >&6
8745 else
8746   if test -n "$ac_ct_NCURSES_CONFIG"; then
8747   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8748 else
8749   ac_save_IFS=$IFS; IFS=$ac_path_separator
8750 ac_dummy="$PATH"
8751 for ac_dir in $ac_dummy; do
8752   IFS=$ac_save_IFS
8753   test -z "$ac_dir" && ac_dir=.
8754   $as_executable_p "$ac_dir/$ac_word" || continue
8755 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8756 echo "$as_me:8756: found $ac_dir/$ac_word" >&5
8757 break
8758 done
8759
8760 fi
8761 fi
8762 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8763 if test -n "$ac_ct_NCURSES_CONFIG"; then
8764   echo "$as_me:8764: result: $ac_ct_NCURSES_CONFIG" >&5
8765 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8766 else
8767   echo "$as_me:8767: result: no" >&5
8768 echo "${ECHO_T}no" >&6
8769 fi
8770
8771   test -n "$ac_ct_NCURSES_CONFIG" && break
8772 done
8773 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8774
8775   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8776 fi
8777
8778         if test "$NCURSES_CONFIG" != none ; then
8779
8780 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8781 do
8782
8783 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8784 cf_old_cflag="$CFLAGS"
8785
8786 case "$CFLAGS" in
8787 (*$cf_add_cflags=*)
8788         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
8789         ;;
8790 (*$cf_add_cflags\ *)
8791         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
8792         ;;
8793 (*$cf_add_cflags)
8794         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
8795         ;;
8796 esac
8797
8798 if test "$CFLAGS" != "$cf_old_cflag" ;
8799 then
8800
8801         CFLAGS="$cf_new_cflag"
8802 fi
8803
8804 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8805 cf_old_cflag="$CPPFLAGS"
8806
8807 case "$CPPFLAGS" in
8808 (*$cf_add_cflags=*)
8809         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
8810         ;;
8811 (*$cf_add_cflags\ *)
8812         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
8813         ;;
8814 (*$cf_add_cflags)
8815         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
8816         ;;
8817 esac
8818
8819 if test "$CPPFLAGS" != "$cf_old_cflag" ;
8820 then
8821
8822         CPPFLAGS="$cf_new_cflag"
8823 fi
8824
8825 done
8826
8827 cf_fix_cppflags=no
8828 cf_new_cflags=
8829 cf_new_cppflags=
8830 cf_new_extra_cppflags=
8831
8832 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8833 do
8834 case "$cf_fix_cppflags" in
8835 (no)
8836         case "$cf_add_cflags" in
8837         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8838                 case "$cf_add_cflags" in
8839                 (-D*)
8840                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8841
8842                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8843                                 && test -z "${cf_tst_cflags}" \
8844                                 && cf_fix_cppflags=yes
8845
8846                         if test "$cf_fix_cppflags" = yes ; then
8847
8848         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8849         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8850
8851                                 continue
8852                         elif test "${cf_tst_cflags}" = "\"'" ; then
8853
8854         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8855         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8856
8857                                 continue
8858                         fi
8859                         ;;
8860                 esac
8861                 case "$CPPFLAGS" in
8862                 (*$cf_add_cflags)
8863                         ;;
8864                 (*)
8865                         case "$cf_add_cflags" in
8866                         (-D*)
8867                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8868
8869 CPPFLAGS=`echo "$CPPFLAGS" | \
8870         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8871                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8872
8873                                 ;;
8874                         esac
8875
8876         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8877         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8878
8879                         ;;
8880                 esac
8881                 ;;
8882         (*)
8883
8884         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8885         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8886
8887                 ;;
8888         esac
8889         ;;
8890 (yes)
8891
8892         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8893         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8894
8895         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8896
8897         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8898                 && test -z "${cf_tst_cflags}" \
8899                 && cf_fix_cppflags=no
8900         ;;
8901 esac
8902 done
8903
8904 if test -n "$cf_new_cflags" ; then
8905
8906         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8907         CFLAGS="${CFLAGS}$cf_new_cflags"
8908
8909 fi
8910
8911 if test -n "$cf_new_cppflags" ; then
8912
8913         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8914         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8915
8916 fi
8917
8918 if test -n "$cf_new_extra_cppflags" ; then
8919
8920         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8921         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8922
8923 fi
8924
8925 cf_add_libs="$LIBS"
8926 # reverse order
8927 cf_add_0lib=
8928 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8929 # filter duplicates
8930 for cf_add_1lib in $cf_add_0lib; do
8931         for cf_add_2lib in $cf_add_libs; do
8932                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8933                         cf_add_1lib=
8934                         break
8935                 fi
8936         done
8937         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8938 done
8939 LIBS="$cf_add_libs"
8940
8941                 # even with config script, some packages use no-override for curses.h
8942
8943 echo "$as_me:8943: checking if we have identified curses headers" >&5
8944 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8945 if test "${cf_cv_ncurses_header+set}" = set; then
8946   echo $ECHO_N "(cached) $ECHO_C" >&6
8947 else
8948
8949 cf_cv_ncurses_header=none
8950 for cf_header in \
8951         ncurses.h $cf_cv_screen/ncurses.h \
8952         curses.h $cf_cv_screen/curses.h
8953 do
8954 cat >"conftest.$ac_ext" <<_ACEOF
8955 #line 8955 "configure"
8956 #include "confdefs.h"
8957 #include <${cf_header}>
8958 int
8959 main (void)
8960 {
8961 initscr(); tgoto("?", 0,0)
8962   ;
8963   return 0;
8964 }
8965 _ACEOF
8966 rm -f "conftest.$ac_objext"
8967 if { (eval echo "$as_me:8967: \"$ac_compile\"") >&5
8968   (eval $ac_compile) 2>&5
8969   ac_status=$?
8970   echo "$as_me:8970: \$? = $ac_status" >&5
8971   (exit "$ac_status"); } &&
8972          { ac_try='test -s "conftest.$ac_objext"'
8973   { (eval echo "$as_me:8973: \"$ac_try\"") >&5
8974   (eval $ac_try) 2>&5
8975   ac_status=$?
8976   echo "$as_me:8976: \$? = $ac_status" >&5
8977   (exit "$ac_status"); }; }; then
8978   cf_cv_ncurses_header=$cf_header; break
8979 else
8980   echo "$as_me: failed program was:" >&5
8981 cat "conftest.$ac_ext" >&5
8982 fi
8983 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8984 done
8985
8986 fi
8987 echo "$as_me:8987: result: $cf_cv_ncurses_header" >&5
8988 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8989
8990 if test "$cf_cv_ncurses_header" = none ; then
8991         { { echo "$as_me:8991: error: No curses header-files found" >&5
8992 echo "$as_me: error: No curses header-files found" >&2;}
8993    { (exit 1); exit 1; }; }
8994 fi
8995
8996 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8997
8998 for ac_header in $cf_cv_ncurses_header
8999 do
9000 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9001 echo "$as_me:9001: checking for $ac_header" >&5
9002 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9003 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9004   echo $ECHO_N "(cached) $ECHO_C" >&6
9005 else
9006   cat >"conftest.$ac_ext" <<_ACEOF
9007 #line 9007 "configure"
9008 #include "confdefs.h"
9009 #include <$ac_header>
9010 _ACEOF
9011 if { (eval echo "$as_me:9011: \"$ac_cpp "conftest.$ac_ext"\"") >&5
9012   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
9013   ac_status=$?
9014   $EGREP -v '^ *\+' conftest.er1 >conftest.err
9015   rm -f conftest.er1
9016   cat conftest.err >&5
9017   echo "$as_me:9017: \$? = $ac_status" >&5
9018   (exit "$ac_status"); } >/dev/null; then
9019   if test -s conftest.err; then
9020     ac_cpp_err=$ac_c_preproc_warn_flag
9021   else
9022     ac_cpp_err=
9023   fi
9024 else
9025   ac_cpp_err=yes
9026 fi
9027 if test -z "$ac_cpp_err"; then
9028   eval "$as_ac_Header=yes"
9029 else
9030   echo "$as_me: failed program was:" >&5
9031   cat "conftest.$ac_ext" >&5
9032   eval "$as_ac_Header=no"
9033 fi
9034 rm -f conftest.err "conftest.$ac_ext"
9035 fi
9036 echo "$as_me:9036: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
9037 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
9038 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
9039   cat >>confdefs.h <<EOF
9040 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9041 EOF
9042
9043 fi
9044 done
9045
9046 cat >>confdefs.h <<\EOF
9047 #define NCURSES 1
9048 EOF
9049
9050 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9051
9052                 cat >>confdefs.h <<EOF
9053 #define $cf_nculib_ROOT 1
9054 EOF
9055
9056                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
9057
9058         else
9059
9060 cf_ncuhdr_root=$cf_cv_screen
9061
9062 test -n "$cf_cv_curses_dir" && \
9063 test "$cf_cv_curses_dir" != "no" && { \
9064
9065 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9066   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9067   do
9068         while test "$cf_add_incdir" != /usr/include
9069         do
9070           if test -d "$cf_add_incdir"
9071           then
9072                 cf_have_incdir=no
9073                 if test -n "$CFLAGS$CPPFLAGS" ; then
9074                   # a loop is needed to ensure we can add subdirs of existing dirs
9075                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9076                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9077                           cf_have_incdir=yes; break
9078                         fi
9079                   done
9080                 fi
9081
9082                 if test "$cf_have_incdir" = no ; then
9083                   if test "$cf_add_incdir" = /usr/local/include ; then
9084                         if test "$GCC" = yes
9085                         then
9086                           cf_save_CPPFLAGS=$CPPFLAGS
9087
9088         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9089         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9090
9091                           cat >"conftest.$ac_ext" <<_ACEOF
9092 #line 9092 "configure"
9093 #include "confdefs.h"
9094 #include <stdio.h>
9095 int
9096 main (void)
9097 {
9098 printf("Hello")
9099   ;
9100   return 0;
9101 }
9102 _ACEOF
9103 rm -f "conftest.$ac_objext"
9104 if { (eval echo "$as_me:9104: \"$ac_compile\"") >&5
9105   (eval $ac_compile) 2>&5
9106   ac_status=$?
9107   echo "$as_me:9107: \$? = $ac_status" >&5
9108   (exit "$ac_status"); } &&
9109          { ac_try='test -s "conftest.$ac_objext"'
9110   { (eval echo "$as_me:9110: \"$ac_try\"") >&5
9111   (eval $ac_try) 2>&5
9112   ac_status=$?
9113   echo "$as_me:9113: \$? = $ac_status" >&5
9114   (exit "$ac_status"); }; }; then
9115   :
9116 else
9117   echo "$as_me: failed program was:" >&5
9118 cat "conftest.$ac_ext" >&5
9119 cf_have_incdir=yes
9120 fi
9121 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9122                           CPPFLAGS=$cf_save_CPPFLAGS
9123                         fi
9124                   fi
9125                 fi
9126
9127                 if test "$cf_have_incdir" = no ; then
9128                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9129
9130 echo "${as_me:-configure}:9130: testing adding $cf_add_incdir to include-path ..." 1>&5
9131
9132                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9133
9134                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9135                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9136                   cf_add_incdir="$cf_top_incdir"
9137                 else
9138                   break
9139                 fi
9140           else
9141                 break
9142           fi
9143         done
9144   done
9145 fi
9146
9147 }
9148
9149 echo "$as_me:9149: checking for $cf_ncuhdr_root header in include-path" >&5
9150 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9151 if test "${cf_cv_ncurses_h+set}" = set; then
9152   echo $ECHO_N "(cached) $ECHO_C" >&6
9153 else
9154
9155         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9156         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
9157         for cf_header in $cf_header_list
9158         do
9159
9160         cat >"conftest.$ac_ext" <<_ACEOF
9161 #line 9161 "configure"
9162 #include "confdefs.h"
9163
9164 #include <$cf_header>
9165 int
9166 main (void)
9167 {
9168
9169 #ifdef NCURSES_VERSION
9170
9171 printf("%s\\n", NCURSES_VERSION);
9172 #else
9173 #ifdef __NCURSES_H
9174 printf("old\\n");
9175 #else
9176         make an error
9177 #endif
9178 #endif
9179
9180   ;
9181   return 0;
9182 }
9183 _ACEOF
9184 rm -f "conftest.$ac_objext"
9185 if { (eval echo "$as_me:9185: \"$ac_compile\"") >&5
9186   (eval $ac_compile) 2>&5
9187   ac_status=$?
9188   echo "$as_me:9188: \$? = $ac_status" >&5
9189   (exit "$ac_status"); } &&
9190          { ac_try='test -s "conftest.$ac_objext"'
9191   { (eval echo "$as_me:9191: \"$ac_try\"") >&5
9192   (eval $ac_try) 2>&5
9193   ac_status=$?
9194   echo "$as_me:9194: \$? = $ac_status" >&5
9195   (exit "$ac_status"); }; }; then
9196   cf_cv_ncurses_h=$cf_header
9197
9198 else
9199   echo "$as_me: failed program was:" >&5
9200 cat "conftest.$ac_ext" >&5
9201 cf_cv_ncurses_h=no
9202 fi
9203 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9204
9205                 test "$cf_cv_ncurses_h" != no && break
9206         done
9207
9208 fi
9209 echo "$as_me:9209: result: $cf_cv_ncurses_h" >&5
9210 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9211
9212 if test "$cf_cv_ncurses_h" != no ; then
9213         cf_cv_ncurses_header=$cf_cv_ncurses_h
9214 else
9215
9216 echo "$as_me:9216: checking for $cf_ncuhdr_root include-path" >&5
9217 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9218 if test "${cf_cv_ncurses_h2+set}" = set; then
9219   echo $ECHO_N "(cached) $ECHO_C" >&6
9220 else
9221
9222         test -n "$verbose" && echo
9223
9224 cf_search=
9225
9226 # collect the current set of include-directories from compiler flags
9227 cf_header_path_list=""
9228 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9229         for cf_header_path in $CPPFLAGS $CFLAGS
9230         do
9231                 case "$cf_header_path" in
9232                 (-I*)
9233                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9234
9235 test "x$cf_header_path" != "xNONE" && \
9236 test -d "$cf_header_path" && \
9237  {
9238         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9239         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
9240         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9241         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9242         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9243         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"
9244 }
9245
9246                         cf_header_path_list="$cf_header_path_list $cf_search"
9247                         ;;
9248                 esac
9249         done
9250 fi
9251
9252 # add the variations for the package we are looking for
9253
9254 cf_search=
9255
9256 test "x$prefix" != "xNONE" && \
9257 test -d "$prefix" && \
9258  {
9259         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9260         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
9261         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9262         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9263         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9264         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9265 }
9266
9267 for cf_subdir_prefix in \
9268         /usr \
9269         /usr/local \
9270         /usr/pkg \
9271         /opt \
9272         /opt/local \
9273         $HOME
9274 do
9275
9276 test "x$cf_subdir_prefix" != "x$prefix" && \
9277 test -d "$cf_subdir_prefix" && \
9278 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9279         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9280         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
9281         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9282         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9283         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9284         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"
9285 }
9286
9287 done
9288
9289 test "$includedir" != NONE && \
9290 test "$includedir" != "/usr/include" && \
9291 test -d "$includedir" && {
9292         test -d "$includedir" &&    cf_search="$cf_search $includedir"
9293         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9294 }
9295
9296 test "$oldincludedir" != NONE && \
9297 test "$oldincludedir" != "/usr/include" && \
9298 test -d "$oldincludedir" && {
9299         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
9300         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9301 }
9302
9303 cf_search="$cf_search $cf_header_path_list"
9304
9305         test -n "$verbose" && echo "search path $cf_search"
9306         cf_save2_CPPFLAGS="$CPPFLAGS"
9307         for cf_incdir in $cf_search
9308         do
9309
9310 if test -n "$cf_incdir" ; then
9311   for cf_add_incdir in $cf_incdir
9312   do
9313         while test "$cf_add_incdir" != /usr/include
9314         do
9315           if test -d "$cf_add_incdir"
9316           then
9317                 cf_have_incdir=no
9318                 if test -n "$CFLAGS$CPPFLAGS" ; then
9319                   # a loop is needed to ensure we can add subdirs of existing dirs
9320                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9321                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9322                           cf_have_incdir=yes; break
9323                         fi
9324                   done
9325                 fi
9326
9327                 if test "$cf_have_incdir" = no ; then
9328                   if test "$cf_add_incdir" = /usr/local/include ; then
9329                         if test "$GCC" = yes
9330                         then
9331                           cf_save_CPPFLAGS=$CPPFLAGS
9332
9333         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9334         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9335
9336                           cat >"conftest.$ac_ext" <<_ACEOF
9337 #line 9337 "configure"
9338 #include "confdefs.h"
9339 #include <stdio.h>
9340 int
9341 main (void)
9342 {
9343 printf("Hello")
9344   ;
9345   return 0;
9346 }
9347 _ACEOF
9348 rm -f "conftest.$ac_objext"
9349 if { (eval echo "$as_me:9349: \"$ac_compile\"") >&5
9350   (eval $ac_compile) 2>&5
9351   ac_status=$?
9352   echo "$as_me:9352: \$? = $ac_status" >&5
9353   (exit "$ac_status"); } &&
9354          { ac_try='test -s "conftest.$ac_objext"'
9355   { (eval echo "$as_me:9355: \"$ac_try\"") >&5
9356   (eval $ac_try) 2>&5
9357   ac_status=$?
9358   echo "$as_me:9358: \$? = $ac_status" >&5
9359   (exit "$ac_status"); }; }; then
9360   :
9361 else
9362   echo "$as_me: failed program was:" >&5
9363 cat "conftest.$ac_ext" >&5
9364 cf_have_incdir=yes
9365 fi
9366 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9367                           CPPFLAGS=$cf_save_CPPFLAGS
9368                         fi
9369                   fi
9370                 fi
9371
9372                 if test "$cf_have_incdir" = no ; then
9373                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9374
9375 echo "${as_me:-configure}:9375: testing adding $cf_add_incdir to include-path ..." 1>&5
9376
9377                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9378
9379                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9380                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9381                   cf_add_incdir="$cf_top_incdir"
9382                 else
9383                   break
9384                 fi
9385           else
9386                 break
9387           fi
9388         done
9389   done
9390 fi
9391
9392                 for cf_header in \
9393                         ncurses.h \
9394                         curses.h
9395                 do
9396
9397         cat >"conftest.$ac_ext" <<_ACEOF
9398 #line 9398 "configure"
9399 #include "confdefs.h"
9400
9401 #include <$cf_header>
9402 int
9403 main (void)
9404 {
9405
9406 #ifdef NCURSES_VERSION
9407
9408 printf("%s\\n", NCURSES_VERSION);
9409 #else
9410 #ifdef __NCURSES_H
9411 printf("old\\n");
9412 #else
9413         make an error
9414 #endif
9415 #endif
9416
9417   ;
9418   return 0;
9419 }
9420 _ACEOF
9421 rm -f "conftest.$ac_objext"
9422 if { (eval echo "$as_me:9422: \"$ac_compile\"") >&5
9423   (eval $ac_compile) 2>&5
9424   ac_status=$?
9425   echo "$as_me:9425: \$? = $ac_status" >&5
9426   (exit "$ac_status"); } &&
9427          { ac_try='test -s "conftest.$ac_objext"'
9428   { (eval echo "$as_me:9428: \"$ac_try\"") >&5
9429   (eval $ac_try) 2>&5
9430   ac_status=$?
9431   echo "$as_me:9431: \$? = $ac_status" >&5
9432   (exit "$ac_status"); }; }; then
9433   cf_cv_ncurses_h2=$cf_header
9434
9435 else
9436   echo "$as_me: failed program was:" >&5
9437 cat "conftest.$ac_ext" >&5
9438 cf_cv_ncurses_h2=no
9439 fi
9440 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9441
9442                         if test "$cf_cv_ncurses_h2" != no ; then
9443                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9444                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
9445                                 break
9446                         fi
9447                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9448                 done
9449                 CPPFLAGS="$cf_save2_CPPFLAGS"
9450                 test "$cf_cv_ncurses_h2" != no && break
9451         done
9452         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9452: error: not found" >&5
9453 echo "$as_me: error: not found" >&2;}
9454    { (exit 1); exit 1; }; }
9455
9456 fi
9457 echo "$as_me:9457: result: $cf_cv_ncurses_h2" >&5
9458 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9459
9460         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
9461         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
9462         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
9463                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
9464         fi
9465
9466 if test -n "$cf_1st_incdir" ; then
9467   for cf_add_incdir in $cf_1st_incdir
9468   do
9469         while test "$cf_add_incdir" != /usr/include
9470         do
9471           if test -d "$cf_add_incdir"
9472           then
9473                 cf_have_incdir=no
9474                 if test -n "$CFLAGS$CPPFLAGS" ; then
9475                   # a loop is needed to ensure we can add subdirs of existing dirs
9476                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9477                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9478                           cf_have_incdir=yes; break
9479                         fi
9480                   done
9481                 fi
9482
9483                 if test "$cf_have_incdir" = no ; then
9484                   if test "$cf_add_incdir" = /usr/local/include ; then
9485                         if test "$GCC" = yes
9486                         then
9487                           cf_save_CPPFLAGS=$CPPFLAGS
9488
9489         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9490         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9491
9492                           cat >"conftest.$ac_ext" <<_ACEOF
9493 #line 9493 "configure"
9494 #include "confdefs.h"
9495 #include <stdio.h>
9496 int
9497 main (void)
9498 {
9499 printf("Hello")
9500   ;
9501   return 0;
9502 }
9503 _ACEOF
9504 rm -f "conftest.$ac_objext"
9505 if { (eval echo "$as_me:9505: \"$ac_compile\"") >&5
9506   (eval $ac_compile) 2>&5
9507   ac_status=$?
9508   echo "$as_me:9508: \$? = $ac_status" >&5
9509   (exit "$ac_status"); } &&
9510          { ac_try='test -s "conftest.$ac_objext"'
9511   { (eval echo "$as_me:9511: \"$ac_try\"") >&5
9512   (eval $ac_try) 2>&5
9513   ac_status=$?
9514   echo "$as_me:9514: \$? = $ac_status" >&5
9515   (exit "$ac_status"); }; }; then
9516   :
9517 else
9518   echo "$as_me: failed program was:" >&5
9519 cat "conftest.$ac_ext" >&5
9520 cf_have_incdir=yes
9521 fi
9522 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9523                           CPPFLAGS=$cf_save_CPPFLAGS
9524                         fi
9525                   fi
9526                 fi
9527
9528                 if test "$cf_have_incdir" = no ; then
9529                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9530
9531 echo "${as_me:-configure}:9531: testing adding $cf_add_incdir to include-path ..." 1>&5
9532
9533                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9534
9535                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9536                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9537                   cf_add_incdir="$cf_top_incdir"
9538                 else
9539                   break
9540                 fi
9541           else
9542                 break
9543           fi
9544         done
9545   done
9546 fi
9547
9548 fi
9549
9550 # Set definitions to allow ifdef'ing for ncurses.h
9551
9552 case "$cf_cv_ncurses_header" in
9553 (*ncurses.h)
9554
9555 cat >>confdefs.h <<\EOF
9556 #define HAVE_NCURSES_H 1
9557 EOF
9558
9559         ;;
9560 esac
9561
9562 case "$cf_cv_ncurses_header" in
9563 (ncurses/curses.h|ncurses/ncurses.h)
9564
9565 cat >>confdefs.h <<\EOF
9566 #define HAVE_NCURSES_NCURSES_H 1
9567 EOF
9568
9569         ;;
9570 (ncursesw/curses.h|ncursesw/ncurses.h)
9571
9572 cat >>confdefs.h <<\EOF
9573 #define HAVE_NCURSESW_NCURSES_H 1
9574 EOF
9575
9576         ;;
9577 esac
9578
9579 echo "$as_me:9579: checking for terminfo header" >&5
9580 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9581 if test "${cf_cv_term_header+set}" = set; then
9582   echo $ECHO_N "(cached) $ECHO_C" >&6
9583 else
9584
9585 case "${cf_cv_ncurses_header}" in
9586 (*/ncurses.h|*/ncursesw.h)
9587         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9588         ;;
9589 (*)
9590         cf_term_header=term.h
9591         ;;
9592 esac
9593
9594 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9595 do
9596 cat >"conftest.$ac_ext" <<_ACEOF
9597 #line 9597 "configure"
9598 #include "confdefs.h"
9599 #include <stdio.h>
9600 #include <${cf_cv_ncurses_header:-curses.h}>
9601 #include <$cf_test>
9602
9603 int
9604 main (void)
9605 {
9606 int x = auto_left_margin; (void)x
9607   ;
9608   return 0;
9609 }
9610 _ACEOF
9611 rm -f "conftest.$ac_objext"
9612 if { (eval echo "$as_me:9612: \"$ac_compile\"") >&5
9613   (eval $ac_compile) 2>&5
9614   ac_status=$?
9615   echo "$as_me:9615: \$? = $ac_status" >&5
9616   (exit "$ac_status"); } &&
9617          { ac_try='test -s "conftest.$ac_objext"'
9618   { (eval echo "$as_me:9618: \"$ac_try\"") >&5
9619   (eval $ac_try) 2>&5
9620   ac_status=$?
9621   echo "$as_me:9621: \$? = $ac_status" >&5
9622   (exit "$ac_status"); }; }; then
9623
9624         cf_cv_term_header="$cf_test"
9625 else
9626   echo "$as_me: failed program was:" >&5
9627 cat "conftest.$ac_ext" >&5
9628
9629         cf_cv_term_header=unknown
9630
9631 fi
9632 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9633         test "$cf_cv_term_header" != unknown && break
9634 done
9635
9636 fi
9637 echo "$as_me:9637: result: $cf_cv_term_header" >&5
9638 echo "${ECHO_T}$cf_cv_term_header" >&6
9639
9640 # Set definitions to allow ifdef'ing to accommodate subdirectories
9641
9642 case "$cf_cv_term_header" in
9643 (*term.h)
9644
9645 cat >>confdefs.h <<\EOF
9646 #define HAVE_TERM_H 1
9647 EOF
9648
9649         ;;
9650 esac
9651
9652 case "$cf_cv_term_header" in
9653 (ncurses/term.h)
9654
9655 cat >>confdefs.h <<\EOF
9656 #define HAVE_NCURSES_TERM_H 1
9657 EOF
9658
9659         ;;
9660 (ncursesw/term.h)
9661
9662 cat >>confdefs.h <<\EOF
9663 #define HAVE_NCURSESW_TERM_H 1
9664 EOF
9665
9666         ;;
9667 esac
9668
9669 # some applications need this, but should check for NCURSES_VERSION
9670
9671 cat >>confdefs.h <<\EOF
9672 #define NCURSES 1
9673 EOF
9674
9675 echo "$as_me:9675: checking for ncurses version" >&5
9676 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9677 if test "${cf_cv_ncurses_version+set}" = set; then
9678   echo $ECHO_N "(cached) $ECHO_C" >&6
9679 else
9680
9681         cf_cv_ncurses_version=no
9682         cf_tempfile=out$$
9683         rm -f "$cf_tempfile"
9684         if test "$cross_compiling" = yes; then
9685
9686         # This will not work if the preprocessor splits the line after the
9687         # Autoconf token.  The 'unproto' program does that.
9688         cat > "conftest.$ac_ext" <<EOF
9689 #include <${cf_cv_ncurses_header:-curses.h}>
9690 #undef Autoconf
9691 #ifdef NCURSES_VERSION
9692 Autoconf NCURSES_VERSION
9693 #else
9694 #ifdef __NCURSES_H
9695 Autoconf "old"
9696 #endif
9697 ;
9698 #endif
9699 EOF
9700         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9701         { (eval echo "$as_me:9701: \"$cf_try\"") >&5
9702   (eval $cf_try) 2>&5
9703   ac_status=$?
9704   echo "$as_me:9704: \$? = $ac_status" >&5
9705   (exit "$ac_status"); }
9706         if test -f conftest.out ; then
9707                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
9708                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9709                 rm -f conftest.out
9710         fi
9711
9712 else
9713   cat >"conftest.$ac_ext" <<_ACEOF
9714 #line 9714 "configure"
9715 #include "confdefs.h"
9716
9717 #include <${cf_cv_ncurses_header:-curses.h}>
9718 #include <stdio.h>
9719 int main(void)
9720 {
9721         FILE *fp = fopen("$cf_tempfile", "w");
9722 #ifdef NCURSES_VERSION
9723 # ifdef NCURSES_VERSION_PATCH
9724         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9725 # else
9726         fprintf(fp, "%s\\n", NCURSES_VERSION);
9727 # endif
9728 #else
9729 # ifdef __NCURSES_H
9730         fprintf(fp, "old\\n");
9731 # else
9732         make an error
9733 # endif
9734 #endif
9735         ${cf_cv_main_return:-return}(0);
9736 }
9737 _ACEOF
9738 rm -f "conftest$ac_exeext"
9739 if { (eval echo "$as_me:9739: \"$ac_link\"") >&5
9740   (eval $ac_link) 2>&5
9741   ac_status=$?
9742   echo "$as_me:9742: \$? = $ac_status" >&5
9743   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9744   { (eval echo "$as_me:9744: \"$ac_try\"") >&5
9745   (eval $ac_try) 2>&5
9746   ac_status=$?
9747   echo "$as_me:9747: \$? = $ac_status" >&5
9748   (exit "$ac_status"); }; }; then
9749
9750         cf_cv_ncurses_version=`cat $cf_tempfile`
9751 else
9752   echo "$as_me: program exited with status $ac_status" >&5
9753 echo "$as_me: failed program was:" >&5
9754 cat "conftest.$ac_ext" >&5
9755 fi
9756 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9757 fi
9758         rm -f "$cf_tempfile"
9759
9760 fi
9761 echo "$as_me:9761: result: $cf_cv_ncurses_version" >&5
9762 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9763 test "$cf_cv_ncurses_version" = no ||
9764 cat >>confdefs.h <<\EOF
9765 #define NCURSES 1
9766 EOF
9767
9768 cf_nculib_root=$cf_cv_screen
9769         # This works, except for the special case where we find gpm, but
9770         # ncurses is in a nonstandard location via $LIBS, and we really want
9771         # to link gpm.
9772 cf_ncurses_LIBS=""
9773 cf_ncurses_SAVE="$LIBS"
9774 echo "$as_me:9774: checking for Gpm_Open in -lgpm" >&5
9775 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9776 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9777   echo $ECHO_N "(cached) $ECHO_C" >&6
9778 else
9779   ac_check_lib_save_LIBS=$LIBS
9780 LIBS="-lgpm  $LIBS"
9781 cat >"conftest.$ac_ext" <<_ACEOF
9782 #line 9782 "configure"
9783 #include "confdefs.h"
9784
9785 /* Override any gcc2 internal prototype to avoid an error.  */
9786 #ifdef __cplusplus
9787 extern "C"
9788 #endif
9789 /* We use char because int might match the return type of a gcc2
9790    builtin and then its argument prototype would still apply.  */
9791 char Gpm_Open ();
9792 int
9793 main (void)
9794 {
9795 Gpm_Open ();
9796   ;
9797   return 0;
9798 }
9799 _ACEOF
9800 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9801 if { (eval echo "$as_me:9801: \"$ac_link\"") >&5
9802   (eval $ac_link) 2>&5
9803   ac_status=$?
9804   echo "$as_me:9804: \$? = $ac_status" >&5
9805   (exit "$ac_status"); } &&
9806          { ac_try='test -s "conftest$ac_exeext"'
9807   { (eval echo "$as_me:9807: \"$ac_try\"") >&5
9808   (eval $ac_try) 2>&5
9809   ac_status=$?
9810   echo "$as_me:9810: \$? = $ac_status" >&5
9811   (exit "$ac_status"); }; }; then
9812   ac_cv_lib_gpm_Gpm_Open=yes
9813 else
9814   echo "$as_me: failed program was:" >&5
9815 cat "conftest.$ac_ext" >&5
9816 ac_cv_lib_gpm_Gpm_Open=no
9817 fi
9818 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9819 LIBS=$ac_check_lib_save_LIBS
9820 fi
9821 echo "$as_me:9821: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9822 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9823 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
9824   echo "$as_me:9824: checking for initscr in -lgpm" >&5
9825 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9826 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9827   echo $ECHO_N "(cached) $ECHO_C" >&6
9828 else
9829   ac_check_lib_save_LIBS=$LIBS
9830 LIBS="-lgpm  $LIBS"
9831 cat >"conftest.$ac_ext" <<_ACEOF
9832 #line 9832 "configure"
9833 #include "confdefs.h"
9834
9835 /* Override any gcc2 internal prototype to avoid an error.  */
9836 #ifdef __cplusplus
9837 extern "C"
9838 #endif
9839 /* We use char because int might match the return type of a gcc2
9840    builtin and then its argument prototype would still apply.  */
9841 char initscr ();
9842 int
9843 main (void)
9844 {
9845 initscr ();
9846   ;
9847   return 0;
9848 }
9849 _ACEOF
9850 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9851 if { (eval echo "$as_me:9851: \"$ac_link\"") >&5
9852   (eval $ac_link) 2>&5
9853   ac_status=$?
9854   echo "$as_me:9854: \$? = $ac_status" >&5
9855   (exit "$ac_status"); } &&
9856          { ac_try='test -s "conftest$ac_exeext"'
9857   { (eval echo "$as_me:9857: \"$ac_try\"") >&5
9858   (eval $ac_try) 2>&5
9859   ac_status=$?
9860   echo "$as_me:9860: \$? = $ac_status" >&5
9861   (exit "$ac_status"); }; }; then
9862   ac_cv_lib_gpm_initscr=yes
9863 else
9864   echo "$as_me: failed program was:" >&5
9865 cat "conftest.$ac_ext" >&5
9866 ac_cv_lib_gpm_initscr=no
9867 fi
9868 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9869 LIBS=$ac_check_lib_save_LIBS
9870 fi
9871 echo "$as_me:9871: result: $ac_cv_lib_gpm_initscr" >&5
9872 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9873 if test "$ac_cv_lib_gpm_initscr" = yes; then
9874   LIBS="$cf_ncurses_SAVE"
9875 else
9876   cf_ncurses_LIBS="-lgpm"
9877 fi
9878
9879 fi
9880
9881 case "$host_os" in
9882 (freebsd*)
9883         # This is only necessary if you are linking against an obsolete
9884         # version of ncurses (but it should do no harm, since it is static).
9885         if test "$cf_nculib_root" = ncurses ; then
9886                 echo "$as_me:9886: checking for tgoto in -lmytinfo" >&5
9887 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9888 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9889   echo $ECHO_N "(cached) $ECHO_C" >&6
9890 else
9891   ac_check_lib_save_LIBS=$LIBS
9892 LIBS="-lmytinfo  $LIBS"
9893 cat >"conftest.$ac_ext" <<_ACEOF
9894 #line 9894 "configure"
9895 #include "confdefs.h"
9896
9897 /* Override any gcc2 internal prototype to avoid an error.  */
9898 #ifdef __cplusplus
9899 extern "C"
9900 #endif
9901 /* We use char because int might match the return type of a gcc2
9902    builtin and then its argument prototype would still apply.  */
9903 char tgoto ();
9904 int
9905 main (void)
9906 {
9907 tgoto ();
9908   ;
9909   return 0;
9910 }
9911 _ACEOF
9912 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9913 if { (eval echo "$as_me:9913: \"$ac_link\"") >&5
9914   (eval $ac_link) 2>&5
9915   ac_status=$?
9916   echo "$as_me:9916: \$? = $ac_status" >&5
9917   (exit "$ac_status"); } &&
9918          { ac_try='test -s "conftest$ac_exeext"'
9919   { (eval echo "$as_me:9919: \"$ac_try\"") >&5
9920   (eval $ac_try) 2>&5
9921   ac_status=$?
9922   echo "$as_me:9922: \$? = $ac_status" >&5
9923   (exit "$ac_status"); }; }; then
9924   ac_cv_lib_mytinfo_tgoto=yes
9925 else
9926   echo "$as_me: failed program was:" >&5
9927 cat "conftest.$ac_ext" >&5
9928 ac_cv_lib_mytinfo_tgoto=no
9929 fi
9930 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9931 LIBS=$ac_check_lib_save_LIBS
9932 fi
9933 echo "$as_me:9933: result: $ac_cv_lib_mytinfo_tgoto" >&5
9934 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9935 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9936   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9937 fi
9938
9939         fi
9940         ;;
9941 esac
9942
9943 cf_add_libs="$LIBS"
9944 # reverse order
9945 cf_add_0lib=
9946 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9947 # filter duplicates
9948 for cf_add_1lib in $cf_add_0lib; do
9949         for cf_add_2lib in $cf_add_libs; do
9950                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9951                         cf_add_1lib=
9952                         break
9953                 fi
9954         done
9955         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9956 done
9957 LIBS="$cf_add_libs"
9958
9959 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9960 then
9961
9962 cf_add_libs="$LIBS"
9963 # reverse order
9964 cf_add_0lib=
9965 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9966 # filter duplicates
9967 for cf_add_1lib in $cf_add_0lib; do
9968         for cf_add_2lib in $cf_add_libs; do
9969                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9970                         cf_add_1lib=
9971                         break
9972                 fi
9973         done
9974         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9975 done
9976 LIBS="$cf_add_libs"
9977
9978 else
9979
9980         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9981         cf_libdir=""
9982         echo "$as_me:9982: checking for initscr" >&5
9983 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9984 if test "${ac_cv_func_initscr+set}" = set; then
9985   echo $ECHO_N "(cached) $ECHO_C" >&6
9986 else
9987   cat >"conftest.$ac_ext" <<_ACEOF
9988 #line 9988 "configure"
9989 #include "confdefs.h"
9990 #define initscr autoconf_temporary
9991 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9992 #undef initscr
9993
9994 #ifdef __cplusplus
9995 extern "C"
9996 #endif
9997
9998 /* We use char because int might match the return type of a gcc2
9999    builtin and then its argument prototype would still apply.  */
10000 char initscr (void);
10001
10002 int
10003 main (void)
10004 {
10005
10006 /* The GNU C library defines stubs for functions which it implements
10007     to always fail with ENOSYS.  Some functions are actually named
10008     something starting with __ and the normal name is an alias.  */
10009 #if defined (__stub_initscr) || defined (__stub___initscr)
10010 #error found stub for initscr
10011 #endif
10012
10013         return initscr ();
10014   ;
10015   return 0;
10016 }
10017 _ACEOF
10018 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10019 if { (eval echo "$as_me:10019: \"$ac_link\"") >&5
10020   (eval $ac_link) 2>&5
10021   ac_status=$?
10022   echo "$as_me:10022: \$? = $ac_status" >&5
10023   (exit "$ac_status"); } &&
10024          { ac_try='test -s "conftest$ac_exeext"'
10025   { (eval echo "$as_me:10025: \"$ac_try\"") >&5
10026   (eval $ac_try) 2>&5
10027   ac_status=$?
10028   echo "$as_me:10028: \$? = $ac_status" >&5
10029   (exit "$ac_status"); }; }; then
10030   ac_cv_func_initscr=yes
10031 else
10032   echo "$as_me: failed program was:" >&5
10033 cat "conftest.$ac_ext" >&5
10034 ac_cv_func_initscr=no
10035 fi
10036 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10037 fi
10038 echo "$as_me:10038: result: $ac_cv_func_initscr" >&5
10039 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10040 if test "$ac_cv_func_initscr" = yes; then
10041   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10042 else
10043
10044                 cf_save_LIBS="$LIBS"
10045                 echo "$as_me:10045: checking for initscr in -l$cf_nculib_root" >&5
10046 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10047                 LIBS="-l$cf_nculib_root $LIBS"
10048                 cat >"conftest.$ac_ext" <<_ACEOF
10049 #line 10049 "configure"
10050 #include "confdefs.h"
10051 #include <${cf_cv_ncurses_header:-curses.h}>
10052 int
10053 main (void)
10054 {
10055 initscr()
10056   ;
10057   return 0;
10058 }
10059 _ACEOF
10060 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10061 if { (eval echo "$as_me:10061: \"$ac_link\"") >&5
10062   (eval $ac_link) 2>&5
10063   ac_status=$?
10064   echo "$as_me:10064: \$? = $ac_status" >&5
10065   (exit "$ac_status"); } &&
10066          { ac_try='test -s "conftest$ac_exeext"'
10067   { (eval echo "$as_me:10067: \"$ac_try\"") >&5
10068   (eval $ac_try) 2>&5
10069   ac_status=$?
10070   echo "$as_me:10070: \$? = $ac_status" >&5
10071   (exit "$ac_status"); }; }; then
10072   echo "$as_me:10072: result: yes" >&5
10073 echo "${ECHO_T}yes" >&6
10074                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10075
10076 else
10077   echo "$as_me: failed program was:" >&5
10078 cat "conftest.$ac_ext" >&5
10079 echo "$as_me:10079: result: no" >&5
10080 echo "${ECHO_T}no" >&6
10081
10082 cf_search=
10083 cf_library_path_list=""
10084 if test -n "${LDFLAGS}${LIBS}" ; then
10085         for cf_library_path in $LDFLAGS $LIBS
10086         do
10087                 case "$cf_library_path" in
10088                 (-L*)
10089                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10090
10091 test "x$cf_library_path" != "xNONE" && \
10092 test -d "$cf_library_path" && \
10093  {
10094         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10095         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
10096         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10097         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10098         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10099         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"
10100 }
10101
10102                         cf_library_path_list="$cf_library_path_list $cf_search"
10103                         ;;
10104                 esac
10105         done
10106 fi
10107
10108 cf_search=
10109
10110 test "x$prefix" != "xNONE" && \
10111 test -d "$prefix" && \
10112  {
10113         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10114         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
10115         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10116         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10117         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10118         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10119 }
10120
10121 for cf_subdir_prefix in \
10122         /usr \
10123         /usr/local \
10124         /usr/pkg \
10125         /opt \
10126         /opt/local \
10127         $HOME
10128 do
10129
10130 test "x$cf_subdir_prefix" != "x$prefix" && \
10131 test -d "$cf_subdir_prefix" && \
10132 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10133         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10134         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10135         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10136         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10137         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10138         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"
10139 }
10140
10141 done
10142
10143 cf_search="$cf_library_path_list $cf_search"
10144
10145                         for cf_libdir in $cf_search
10146                         do
10147                                 echo "$as_me:10147: checking for -l$cf_nculib_root in $cf_libdir" >&5
10148 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10149                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10150                                 cat >"conftest.$ac_ext" <<_ACEOF
10151 #line 10151 "configure"
10152 #include "confdefs.h"
10153 #include <${cf_cv_ncurses_header:-curses.h}>
10154 int
10155 main (void)
10156 {
10157 initscr()
10158   ;
10159   return 0;
10160 }
10161 _ACEOF
10162 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10163 if { (eval echo "$as_me:10163: \"$ac_link\"") >&5
10164   (eval $ac_link) 2>&5
10165   ac_status=$?
10166   echo "$as_me:10166: \$? = $ac_status" >&5
10167   (exit "$ac_status"); } &&
10168          { ac_try='test -s "conftest$ac_exeext"'
10169   { (eval echo "$as_me:10169: \"$ac_try\"") >&5
10170   (eval $ac_try) 2>&5
10171   ac_status=$?
10172   echo "$as_me:10172: \$? = $ac_status" >&5
10173   (exit "$ac_status"); }; }; then
10174   echo "$as_me:10174: result: yes" >&5
10175 echo "${ECHO_T}yes" >&6
10176                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10177                                          break
10178 else
10179   echo "$as_me: failed program was:" >&5
10180 cat "conftest.$ac_ext" >&5
10181 echo "$as_me:10181: result: no" >&5
10182 echo "${ECHO_T}no" >&6
10183                                          LIBS="$cf_save_LIBS"
10184 fi
10185 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10186                         done
10187
10188 fi
10189 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10190
10191 fi
10192
10193 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
10194
10195 if test "$cf_found_library" = no ; then
10196         { { echo "$as_me:10196: error: Cannot link $cf_nculib_root library" >&5
10197 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10198    { (exit 1); exit 1; }; }
10199 fi
10200
10201 fi
10202
10203 if test -n "$cf_ncurses_LIBS" ; then
10204         echo "$as_me:10204: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10205 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10206         cf_ncurses_SAVE="$LIBS"
10207         for p in $cf_ncurses_LIBS ; do
10208                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
10209                 if test "$q" != "$LIBS" ; then
10210                         LIBS="$q"
10211                 fi
10212         done
10213         cat >"conftest.$ac_ext" <<_ACEOF
10214 #line 10214 "configure"
10215 #include "confdefs.h"
10216 #include <${cf_cv_ncurses_header:-curses.h}>
10217 int
10218 main (void)
10219 {
10220 initscr(); mousemask(0,0); tigetstr((char *)0);
10221   ;
10222   return 0;
10223 }
10224 _ACEOF
10225 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10226 if { (eval echo "$as_me:10226: \"$ac_link\"") >&5
10227   (eval $ac_link) 2>&5
10228   ac_status=$?
10229   echo "$as_me:10229: \$? = $ac_status" >&5
10230   (exit "$ac_status"); } &&
10231          { ac_try='test -s "conftest$ac_exeext"'
10232   { (eval echo "$as_me:10232: \"$ac_try\"") >&5
10233   (eval $ac_try) 2>&5
10234   ac_status=$?
10235   echo "$as_me:10235: \$? = $ac_status" >&5
10236   (exit "$ac_status"); }; }; then
10237   echo "$as_me:10237: result: yes" >&5
10238 echo "${ECHO_T}yes" >&6
10239 else
10240   echo "$as_me: failed program was:" >&5
10241 cat "conftest.$ac_ext" >&5
10242 echo "$as_me:10242: result: no" >&5
10243 echo "${ECHO_T}no" >&6
10244                  LIBS="$cf_ncurses_SAVE"
10245 fi
10246 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10247 fi
10248
10249 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10250
10251 cat >>confdefs.h <<EOF
10252 #define $cf_nculib_ROOT 1
10253 EOF
10254
10255         fi
10256 else
10257         NCURSES_CONFIG=none
10258 fi
10259
10260         ;;
10261 (ncurses*)
10262
10263 cf_ncuconfig_root=$cf_cv_screen
10264 cf_have_ncuconfig=no
10265
10266 if test "x${PKG_CONFIG:=none}" != xnone; then
10267         echo "$as_me:10267: checking pkg-config for $cf_ncuconfig_root" >&5
10268 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
10269         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
10270                 echo "$as_me:10270: result: yes" >&5
10271 echo "${ECHO_T}yes" >&6
10272
10273                 echo "$as_me:10273: checking if the $cf_ncuconfig_root package files work" >&5
10274 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
10275                 cf_have_ncuconfig=unknown
10276
10277                 cf_save_CFLAGS="$CFLAGS"
10278                 cf_save_CPPFLAGS="$CPPFLAGS"
10279                 cf_save_LIBS="$LIBS"
10280
10281                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
10282                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
10283
10284                 # while -W for passing linker flags is prevalent, it is not "standard".
10285                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
10286                 # incompatible _and_ non-standard -W option which gives an error.  Work
10287                 # around that pitfall.
10288                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
10289                 (x*c[89]9@@*-W*)
10290
10291 cf_fix_cppflags=no
10292 cf_new_cflags=
10293 cf_new_cppflags=
10294 cf_new_extra_cppflags=
10295
10296 for cf_add_cflags in $cf_pkg_cflags
10297 do
10298 case "$cf_fix_cppflags" in
10299 (no)
10300         case "$cf_add_cflags" in
10301         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10302                 case "$cf_add_cflags" in
10303                 (-D*)
10304                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10305
10306                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10307                                 && test -z "${cf_tst_cflags}" \
10308                                 && cf_fix_cppflags=yes
10309
10310                         if test "$cf_fix_cppflags" = yes ; then
10311
10312         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10313         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10314
10315                                 continue
10316                         elif test "${cf_tst_cflags}" = "\"'" ; then
10317
10318         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10319         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10320
10321                                 continue
10322                         fi
10323                         ;;
10324                 esac
10325                 case "$CPPFLAGS" in
10326                 (*$cf_add_cflags)
10327                         ;;
10328                 (*)
10329                         case "$cf_add_cflags" in
10330                         (-D*)
10331                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10332
10333 CPPFLAGS=`echo "$CPPFLAGS" | \
10334         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10335                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10336
10337                                 ;;
10338                         esac
10339
10340         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10341         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10342
10343                         ;;
10344                 esac
10345                 ;;
10346         (*)
10347
10348         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10349         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10350
10351                 ;;
10352         esac
10353         ;;
10354 (yes)
10355
10356         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10357         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10358
10359         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10360
10361         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10362                 && test -z "${cf_tst_cflags}" \
10363                 && cf_fix_cppflags=no
10364         ;;
10365 esac
10366 done
10367
10368 if test -n "$cf_new_cflags" ; then
10369
10370         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10371         CFLAGS="${CFLAGS}$cf_new_cflags"
10372
10373 fi
10374
10375 if test -n "$cf_new_cppflags" ; then
10376
10377         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10378         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10379
10380 fi
10381
10382 if test -n "$cf_new_extra_cppflags" ; then
10383
10384         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10385         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10386
10387 fi
10388
10389 cf_add_libs="$LIBS"
10390 # reverse order
10391 cf_add_0lib=
10392 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10393 # filter duplicates
10394 for cf_add_1lib in $cf_add_0lib; do
10395         for cf_add_2lib in $cf_add_libs; do
10396                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10397                         cf_add_1lib=
10398                         break
10399                 fi
10400         done
10401         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10402 done
10403 LIBS="$cf_add_libs"
10404
10405                         cat >"conftest.$ac_ext" <<_ACEOF
10406 #line 10406 "configure"
10407 #include "confdefs.h"
10408 #include <${cf_cv_ncurses_header:-curses.h}>
10409 int
10410 main (void)
10411 {
10412 initscr(); mousemask(0,0); tigetstr((char *)0);
10413   ;
10414   return 0;
10415 }
10416 _ACEOF
10417 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10418 if { (eval echo "$as_me:10418: \"$ac_link\"") >&5
10419   (eval $ac_link) 2>&5
10420   ac_status=$?
10421   echo "$as_me:10421: \$? = $ac_status" >&5
10422   (exit "$ac_status"); } &&
10423          { ac_try='test -s "conftest$ac_exeext"'
10424   { (eval echo "$as_me:10424: \"$ac_try\"") >&5
10425   (eval $ac_try) 2>&5
10426   ac_status=$?
10427   echo "$as_me:10427: \$? = $ac_status" >&5
10428   (exit "$ac_status"); }; }; then
10429   if test "$cross_compiling" = yes; then
10430   cf_test_ncuconfig=maybe
10431 else
10432   cat >"conftest.$ac_ext" <<_ACEOF
10433 #line 10433 "configure"
10434 #include "confdefs.h"
10435 #include <${cf_cv_ncurses_header:-curses.h}>
10436                                         int main(void)
10437                                         { const char *xx = curses_version(); return (xx == 0); }
10438 _ACEOF
10439 rm -f "conftest$ac_exeext"
10440 if { (eval echo "$as_me:10440: \"$ac_link\"") >&5
10441   (eval $ac_link) 2>&5
10442   ac_status=$?
10443   echo "$as_me:10443: \$? = $ac_status" >&5
10444   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10445   { (eval echo "$as_me:10445: \"$ac_try\"") >&5
10446   (eval $ac_try) 2>&5
10447   ac_status=$?
10448   echo "$as_me:10448: \$? = $ac_status" >&5
10449   (exit "$ac_status"); }; }; then
10450   cf_test_ncuconfig=yes
10451 else
10452   echo "$as_me: program exited with status $ac_status" >&5
10453 echo "$as_me: failed program was:" >&5
10454 cat "conftest.$ac_ext" >&5
10455 cf_test_ncuconfig=no
10456 fi
10457 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10458 fi
10459 else
10460   echo "$as_me: failed program was:" >&5
10461 cat "conftest.$ac_ext" >&5
10462 cf_test_ncuconfig=no
10463 fi
10464 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10465
10466                         CFLAGS="$cf_save_CFLAGS"
10467                         CPPFLAGS="$cf_save_CPPFLAGS"
10468                         LIBS="$cf_save_LIBS"
10469
10470                         if test "x$cf_test_ncuconfig" != xyes; then
10471                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
10472                                 cf_pkg_cflags="$cf_temp"
10473                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
10474                                 cf_pkg_libs="$cf_temp"
10475                         fi
10476                         ;;
10477                 esac
10478
10479 for cf_add_cflags in $cf_pkg_cflags
10480 do
10481
10482 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10483 cf_old_cflag="$CFLAGS"
10484
10485 case "$CFLAGS" in
10486 (*$cf_add_cflags=*)
10487         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
10488         ;;
10489 (*$cf_add_cflags\ *)
10490         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
10491         ;;
10492 (*$cf_add_cflags)
10493         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
10494         ;;
10495 esac
10496
10497 if test "$CFLAGS" != "$cf_old_cflag" ;
10498 then
10499
10500         CFLAGS="$cf_new_cflag"
10501 fi
10502
10503 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10504 cf_old_cflag="$CPPFLAGS"
10505
10506 case "$CPPFLAGS" in
10507 (*$cf_add_cflags=*)
10508         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
10509         ;;
10510 (*$cf_add_cflags\ *)
10511         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
10512         ;;
10513 (*$cf_add_cflags)
10514         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
10515         ;;
10516 esac
10517
10518 if test "$CPPFLAGS" != "$cf_old_cflag" ;
10519 then
10520
10521         CPPFLAGS="$cf_new_cflag"
10522 fi
10523
10524 done
10525
10526 cf_fix_cppflags=no
10527 cf_new_cflags=
10528 cf_new_cppflags=
10529 cf_new_extra_cppflags=
10530
10531 for cf_add_cflags in $cf_pkg_cflags
10532 do
10533 case "$cf_fix_cppflags" in
10534 (no)
10535         case "$cf_add_cflags" in
10536         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10537                 case "$cf_add_cflags" in
10538                 (-D*)
10539                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10540
10541                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10542                                 && test -z "${cf_tst_cflags}" \
10543                                 && cf_fix_cppflags=yes
10544
10545                         if test "$cf_fix_cppflags" = yes ; then
10546
10547         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10548         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10549
10550                                 continue
10551                         elif test "${cf_tst_cflags}" = "\"'" ; then
10552
10553         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10554         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10555
10556                                 continue
10557                         fi
10558                         ;;
10559                 esac
10560                 case "$CPPFLAGS" in
10561                 (*$cf_add_cflags)
10562                         ;;
10563                 (*)
10564                         case "$cf_add_cflags" in
10565                         (-D*)
10566                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10567
10568 CPPFLAGS=`echo "$CPPFLAGS" | \
10569         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10570                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10571
10572                                 ;;
10573                         esac
10574
10575         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10576         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10577
10578                         ;;
10579                 esac
10580                 ;;
10581         (*)
10582
10583         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10584         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10585
10586                 ;;
10587         esac
10588         ;;
10589 (yes)
10590
10591         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10592         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10593
10594         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10595
10596         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10597                 && test -z "${cf_tst_cflags}" \
10598                 && cf_fix_cppflags=no
10599         ;;
10600 esac
10601 done
10602
10603 if test -n "$cf_new_cflags" ; then
10604
10605         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10606         CFLAGS="${CFLAGS}$cf_new_cflags"
10607
10608 fi
10609
10610 if test -n "$cf_new_cppflags" ; then
10611
10612         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10613         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10614
10615 fi
10616
10617 if test -n "$cf_new_extra_cppflags" ; then
10618
10619         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10620         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10621
10622 fi
10623
10624 cf_add_libs="$LIBS"
10625 # reverse order
10626 cf_add_0lib=
10627 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10628 # filter duplicates
10629 for cf_add_1lib in $cf_add_0lib; do
10630         for cf_add_2lib in $cf_add_libs; do
10631                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10632                         cf_add_1lib=
10633                         break
10634                 fi
10635         done
10636         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10637 done
10638 LIBS="$cf_add_libs"
10639
10640                 cat >"conftest.$ac_ext" <<_ACEOF
10641 #line 10641 "configure"
10642 #include "confdefs.h"
10643 #include <${cf_cv_ncurses_header:-curses.h}>
10644 int
10645 main (void)
10646 {
10647 initscr(); mousemask(0,0); tigetstr((char *)0);
10648   ;
10649   return 0;
10650 }
10651 _ACEOF
10652 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10653 if { (eval echo "$as_me:10653: \"$ac_link\"") >&5
10654   (eval $ac_link) 2>&5
10655   ac_status=$?
10656   echo "$as_me:10656: \$? = $ac_status" >&5
10657   (exit "$ac_status"); } &&
10658          { ac_try='test -s "conftest$ac_exeext"'
10659   { (eval echo "$as_me:10659: \"$ac_try\"") >&5
10660   (eval $ac_try) 2>&5
10661   ac_status=$?
10662   echo "$as_me:10662: \$? = $ac_status" >&5
10663   (exit "$ac_status"); }; }; then
10664   if test "$cross_compiling" = yes; then
10665   cf_have_ncuconfig=maybe
10666 else
10667   cat >"conftest.$ac_ext" <<_ACEOF
10668 #line 10668 "configure"
10669 #include "confdefs.h"
10670 #include <${cf_cv_ncurses_header:-curses.h}>
10671                                 int main(void)
10672                                 { const char *xx = curses_version(); return (xx == 0); }
10673 _ACEOF
10674 rm -f "conftest$ac_exeext"
10675 if { (eval echo "$as_me:10675: \"$ac_link\"") >&5
10676   (eval $ac_link) 2>&5
10677   ac_status=$?
10678   echo "$as_me:10678: \$? = $ac_status" >&5
10679   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10680   { (eval echo "$as_me:10680: \"$ac_try\"") >&5
10681   (eval $ac_try) 2>&5
10682   ac_status=$?
10683   echo "$as_me:10683: \$? = $ac_status" >&5
10684   (exit "$ac_status"); }; }; then
10685   cf_have_ncuconfig=yes
10686 else
10687   echo "$as_me: program exited with status $ac_status" >&5
10688 echo "$as_me: failed program was:" >&5
10689 cat "conftest.$ac_ext" >&5
10690 cf_have_ncuconfig=no
10691 fi
10692 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10693 fi
10694 else
10695   echo "$as_me: failed program was:" >&5
10696 cat "conftest.$ac_ext" >&5
10697 cf_have_ncuconfig=no
10698 fi
10699 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10700                 echo "$as_me:10700: result: $cf_have_ncuconfig" >&5
10701 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10702                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10703                 if test "$cf_have_ncuconfig" != "yes"
10704                 then
10705                         CPPFLAGS="$cf_save_CPPFLAGS"
10706                         LIBS="$cf_save_LIBS"
10707                         NCURSES_CONFIG_PKG=none
10708                 else
10709
10710 cat >>confdefs.h <<\EOF
10711 #define NCURSES 1
10712 EOF
10713
10714                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10715
10716 echo "$as_me:10716: checking for terminfo header" >&5
10717 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10718 if test "${cf_cv_term_header+set}" = set; then
10719   echo $ECHO_N "(cached) $ECHO_C" >&6
10720 else
10721
10722 case "${cf_cv_ncurses_header}" in
10723 (*/ncurses.h|*/ncursesw.h)
10724         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10725         ;;
10726 (*)
10727         cf_term_header=term.h
10728         ;;
10729 esac
10730
10731 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10732 do
10733 cat >"conftest.$ac_ext" <<_ACEOF
10734 #line 10734 "configure"
10735 #include "confdefs.h"
10736 #include <stdio.h>
10737 #include <${cf_cv_ncurses_header:-curses.h}>
10738 #include <$cf_test>
10739
10740 int
10741 main (void)
10742 {
10743 int x = auto_left_margin; (void)x
10744   ;
10745   return 0;
10746 }
10747 _ACEOF
10748 rm -f "conftest.$ac_objext"
10749 if { (eval echo "$as_me:10749: \"$ac_compile\"") >&5
10750   (eval $ac_compile) 2>&5
10751   ac_status=$?
10752   echo "$as_me:10752: \$? = $ac_status" >&5
10753   (exit "$ac_status"); } &&
10754          { ac_try='test -s "conftest.$ac_objext"'
10755   { (eval echo "$as_me:10755: \"$ac_try\"") >&5
10756   (eval $ac_try) 2>&5
10757   ac_status=$?
10758   echo "$as_me:10758: \$? = $ac_status" >&5
10759   (exit "$ac_status"); }; }; then
10760
10761         cf_cv_term_header="$cf_test"
10762 else
10763   echo "$as_me: failed program was:" >&5
10764 cat "conftest.$ac_ext" >&5
10765
10766         cf_cv_term_header=unknown
10767
10768 fi
10769 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10770         test "$cf_cv_term_header" != unknown && break
10771 done
10772
10773 fi
10774 echo "$as_me:10774: result: $cf_cv_term_header" >&5
10775 echo "${ECHO_T}$cf_cv_term_header" >&6
10776
10777 # Set definitions to allow ifdef'ing to accommodate subdirectories
10778
10779 case "$cf_cv_term_header" in
10780 (*term.h)
10781
10782 cat >>confdefs.h <<\EOF
10783 #define HAVE_TERM_H 1
10784 EOF
10785
10786         ;;
10787 esac
10788
10789 case "$cf_cv_term_header" in
10790 (ncurses/term.h)
10791
10792 cat >>confdefs.h <<\EOF
10793 #define HAVE_NCURSES_TERM_H 1
10794 EOF
10795
10796         ;;
10797 (ncursesw/term.h)
10798
10799 cat >>confdefs.h <<\EOF
10800 #define HAVE_NCURSESW_TERM_H 1
10801 EOF
10802
10803         ;;
10804 esac
10805
10806                 fi
10807
10808         else
10809                 echo "$as_me:10809: result: no" >&5
10810 echo "${ECHO_T}no" >&6
10811                 NCURSES_CONFIG_PKG=none
10812         fi
10813 else
10814         NCURSES_CONFIG_PKG=none
10815 fi
10816
10817 if test "x$cf_have_ncuconfig" = "xno"; then
10818         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10819
10820 if test -n "$ac_tool_prefix"; then
10821   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10822   do
10823     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10824 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10825 echo "$as_me:10825: checking for $ac_word" >&5
10826 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10827 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10828   echo $ECHO_N "(cached) $ECHO_C" >&6
10829 else
10830   if test -n "$NCURSES_CONFIG"; then
10831   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10832 else
10833   ac_save_IFS=$IFS; IFS=$ac_path_separator
10834 ac_dummy="$PATH"
10835 for ac_dir in $ac_dummy; do
10836   IFS=$ac_save_IFS
10837   test -z "$ac_dir" && ac_dir=.
10838   $as_executable_p "$ac_dir/$ac_word" || continue
10839 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10840 echo "$as_me:10840: found $ac_dir/$ac_word" >&5
10841 break
10842 done
10843
10844 fi
10845 fi
10846 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10847 if test -n "$NCURSES_CONFIG"; then
10848   echo "$as_me:10848: result: $NCURSES_CONFIG" >&5
10849 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10850 else
10851   echo "$as_me:10851: result: no" >&5
10852 echo "${ECHO_T}no" >&6
10853 fi
10854
10855     test -n "$NCURSES_CONFIG" && break
10856   done
10857 fi
10858 if test -z "$NCURSES_CONFIG"; then
10859   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10860   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10861 do
10862   # Extract the first word of "$ac_prog", so it can be a program name with args.
10863 set dummy $ac_prog; ac_word=$2
10864 echo "$as_me:10864: checking for $ac_word" >&5
10865 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10866 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10867   echo $ECHO_N "(cached) $ECHO_C" >&6
10868 else
10869   if test -n "$ac_ct_NCURSES_CONFIG"; then
10870   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10871 else
10872   ac_save_IFS=$IFS; IFS=$ac_path_separator
10873 ac_dummy="$PATH"
10874 for ac_dir in $ac_dummy; do
10875   IFS=$ac_save_IFS
10876   test -z "$ac_dir" && ac_dir=.
10877   $as_executable_p "$ac_dir/$ac_word" || continue
10878 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10879 echo "$as_me:10879: found $ac_dir/$ac_word" >&5
10880 break
10881 done
10882
10883 fi
10884 fi
10885 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10886 if test -n "$ac_ct_NCURSES_CONFIG"; then
10887   echo "$as_me:10887: result: $ac_ct_NCURSES_CONFIG" >&5
10888 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10889 else
10890   echo "$as_me:10890: result: no" >&5
10891 echo "${ECHO_T}no" >&6
10892 fi
10893
10894   test -n "$ac_ct_NCURSES_CONFIG" && break
10895 done
10896 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10897
10898   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10899 fi
10900
10901         if test "$NCURSES_CONFIG" != none ; then
10902
10903 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10904 do
10905
10906 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10907 cf_old_cflag="$CFLAGS"
10908
10909 case "$CFLAGS" in
10910 (*$cf_add_cflags=*)
10911         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
10912         ;;
10913 (*$cf_add_cflags\ *)
10914         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
10915         ;;
10916 (*$cf_add_cflags)
10917         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
10918         ;;
10919 esac
10920
10921 if test "$CFLAGS" != "$cf_old_cflag" ;
10922 then
10923
10924         CFLAGS="$cf_new_cflag"
10925 fi
10926
10927 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10928 cf_old_cflag="$CPPFLAGS"
10929
10930 case "$CPPFLAGS" in
10931 (*$cf_add_cflags=*)
10932         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[^    ]*%%g"`
10933         ;;
10934 (*$cf_add_cflags\ *)
10935         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"`
10936         ;;
10937 (*$cf_add_cflags)
10938         cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"`
10939         ;;
10940 esac
10941
10942 if test "$CPPFLAGS" != "$cf_old_cflag" ;
10943 then
10944
10945         CPPFLAGS="$cf_new_cflag"
10946 fi
10947
10948 done
10949
10950 cf_fix_cppflags=no
10951 cf_new_cflags=
10952 cf_new_cppflags=
10953 cf_new_extra_cppflags=
10954
10955 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10956 do
10957 case "$cf_fix_cppflags" in
10958 (no)
10959         case "$cf_add_cflags" in
10960         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10961                 case "$cf_add_cflags" in
10962                 (-D*)
10963                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10964
10965                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10966                                 && test -z "${cf_tst_cflags}" \
10967                                 && cf_fix_cppflags=yes
10968
10969                         if test "$cf_fix_cppflags" = yes ; then
10970
10971         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10972         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10973
10974                                 continue
10975                         elif test "${cf_tst_cflags}" = "\"'" ; then
10976
10977         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10978         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10979
10980                                 continue
10981                         fi
10982                         ;;
10983                 esac
10984                 case "$CPPFLAGS" in
10985                 (*$cf_add_cflags)
10986                         ;;
10987                 (*)
10988                         case "$cf_add_cflags" in
10989                         (-D*)
10990                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10991
10992 CPPFLAGS=`echo "$CPPFLAGS" | \
10993         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10994                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10995
10996                                 ;;
10997                         esac
10998
10999         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11000         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11001
11002                         ;;
11003                 esac
11004                 ;;
11005         (*)
11006
11007         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11008         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11009
11010                 ;;
11011         esac
11012         ;;
11013 (yes)
11014
11015         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11016         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11017
11018         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
11019
11020         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11021                 && test -z "${cf_tst_cflags}" \
11022                 && cf_fix_cppflags=no
11023         ;;
11024 esac
11025 done
11026
11027 if test -n "$cf_new_cflags" ; then
11028
11029         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11030         CFLAGS="${CFLAGS}$cf_new_cflags"
11031
11032 fi
11033
11034 if test -n "$cf_new_cppflags" ; then
11035
11036         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11037         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11038
11039 fi
11040
11041 if test -n "$cf_new_extra_cppflags" ; then
11042
11043         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11044         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11045
11046 fi
11047
11048 cf_add_libs="$LIBS"
11049 # reverse order
11050 cf_add_0lib=
11051 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11052 # filter duplicates
11053 for cf_add_1lib in $cf_add_0lib; do
11054         for cf_add_2lib in $cf_add_libs; do
11055                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11056                         cf_add_1lib=
11057                         break
11058                 fi
11059         done
11060         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11061 done
11062 LIBS="$cf_add_libs"
11063
11064                 # even with config script, some packages use no-override for curses.h
11065
11066 echo "$as_me:11066: checking if we have identified curses headers" >&5
11067 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
11068 if test "${cf_cv_ncurses_header+set}" = set; then
11069   echo $ECHO_N "(cached) $ECHO_C" >&6
11070 else
11071
11072 cf_cv_ncurses_header=none
11073 for cf_header in \
11074         ncurses.h $cf_cv_screen/ncurses.h \
11075         curses.h $cf_cv_screen/curses.h
11076 do
11077 cat >"conftest.$ac_ext" <<_ACEOF
11078 #line 11078 "configure"
11079 #include "confdefs.h"
11080 #include <${cf_header}>
11081 int
11082 main (void)
11083 {
11084 initscr(); tgoto("?", 0,0)
11085   ;
11086   return 0;
11087 }
11088 _ACEOF
11089 rm -f "conftest.$ac_objext"
11090 if { (eval echo "$as_me:11090: \"$ac_compile\"") >&5
11091   (eval $ac_compile) 2>&5
11092   ac_status=$?
11093   echo "$as_me:11093: \$? = $ac_status" >&5
11094   (exit "$ac_status"); } &&
11095          { ac_try='test -s "conftest.$ac_objext"'
11096   { (eval echo "$as_me:11096: \"$ac_try\"") >&5
11097   (eval $ac_try) 2>&5
11098   ac_status=$?
11099   echo "$as_me:11099: \$? = $ac_status" >&5
11100   (exit "$ac_status"); }; }; then
11101   cf_cv_ncurses_header=$cf_header; break
11102 else
11103   echo "$as_me: failed program was:" >&5
11104 cat "conftest.$ac_ext" >&5
11105 fi
11106 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11107 done
11108
11109 fi
11110 echo "$as_me:11110: result: $cf_cv_ncurses_header" >&5
11111 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
11112
11113 if test "$cf_cv_ncurses_header" = none ; then
11114         { { echo "$as_me:11114: error: No curses header-files found" >&5
11115 echo "$as_me: error: No curses header-files found" >&2;}
11116    { (exit 1); exit 1; }; }
11117 fi
11118
11119 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
11120
11121 for ac_header in $cf_cv_ncurses_header
11122 do
11123 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
11124 echo "$as_me:11124: checking for $ac_header" >&5
11125 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
11126 if eval "test \"\${$as_ac_Header+set}\" = set"; then
11127   echo $ECHO_N "(cached) $ECHO_C" >&6
11128 else
11129   cat >"conftest.$ac_ext" <<_ACEOF
11130 #line 11130 "configure"
11131 #include "confdefs.h"
11132 #include <$ac_header>
11133 _ACEOF
11134 if { (eval echo "$as_me:11134: \"$ac_cpp "conftest.$ac_ext"\"") >&5
11135   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
11136   ac_status=$?
11137   $EGREP -v '^ *\+' conftest.er1 >conftest.err
11138   rm -f conftest.er1
11139   cat conftest.err >&5
11140   echo "$as_me:11140: \$? = $ac_status" >&5
11141   (exit "$ac_status"); } >/dev/null; then
11142   if test -s conftest.err; then
11143     ac_cpp_err=$ac_c_preproc_warn_flag
11144   else
11145     ac_cpp_err=
11146   fi
11147 else
11148   ac_cpp_err=yes
11149 fi
11150 if test -z "$ac_cpp_err"; then
11151   eval "$as_ac_Header=yes"
11152 else
11153   echo "$as_me: failed program was:" >&5
11154   cat "conftest.$ac_ext" >&5
11155   eval "$as_ac_Header=no"
11156 fi
11157 rm -f conftest.err "conftest.$ac_ext"
11158 fi
11159 echo "$as_me:11159: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
11160 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
11161 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
11162   cat >>confdefs.h <<EOF
11163 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
11164 EOF
11165
11166 fi
11167 done
11168
11169 cat >>confdefs.h <<\EOF
11170 #define NCURSES 1
11171 EOF
11172
11173 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11174
11175                 cat >>confdefs.h <<EOF
11176 #define $cf_nculib_ROOT 1
11177 EOF
11178
11179                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
11180
11181         else
11182
11183 cf_ncuhdr_root=$cf_cv_screen
11184
11185 test -n "$cf_cv_curses_dir" && \
11186 test "$cf_cv_curses_dir" != "no" && { \
11187
11188 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
11189   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
11190   do
11191         while test "$cf_add_incdir" != /usr/include
11192         do
11193           if test -d "$cf_add_incdir"
11194           then
11195                 cf_have_incdir=no
11196                 if test -n "$CFLAGS$CPPFLAGS" ; then
11197                   # a loop is needed to ensure we can add subdirs of existing dirs
11198                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11199                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11200                           cf_have_incdir=yes; break
11201                         fi
11202                   done
11203                 fi
11204
11205                 if test "$cf_have_incdir" = no ; then
11206                   if test "$cf_add_incdir" = /usr/local/include ; then
11207                         if test "$GCC" = yes
11208                         then
11209                           cf_save_CPPFLAGS=$CPPFLAGS
11210
11211         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11212         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11213
11214                           cat >"conftest.$ac_ext" <<_ACEOF
11215 #line 11215 "configure"
11216 #include "confdefs.h"
11217 #include <stdio.h>
11218 int
11219 main (void)
11220 {
11221 printf("Hello")
11222   ;
11223   return 0;
11224 }
11225 _ACEOF
11226 rm -f "conftest.$ac_objext"
11227 if { (eval echo "$as_me:11227: \"$ac_compile\"") >&5
11228   (eval $ac_compile) 2>&5
11229   ac_status=$?
11230   echo "$as_me:11230: \$? = $ac_status" >&5
11231   (exit "$ac_status"); } &&
11232          { ac_try='test -s "conftest.$ac_objext"'
11233   { (eval echo "$as_me:11233: \"$ac_try\"") >&5
11234   (eval $ac_try) 2>&5
11235   ac_status=$?
11236   echo "$as_me:11236: \$? = $ac_status" >&5
11237   (exit "$ac_status"); }; }; then
11238   :
11239 else
11240   echo "$as_me: failed program was:" >&5
11241 cat "conftest.$ac_ext" >&5
11242 cf_have_incdir=yes
11243 fi
11244 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11245                           CPPFLAGS=$cf_save_CPPFLAGS
11246                         fi
11247                   fi
11248                 fi
11249
11250                 if test "$cf_have_incdir" = no ; then
11251                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11252
11253 echo "${as_me:-configure}:11253: testing adding $cf_add_incdir to include-path ..." 1>&5
11254
11255                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11256
11257                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11258                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11259                   cf_add_incdir="$cf_top_incdir"
11260                 else
11261                   break
11262                 fi
11263           else
11264                 break
11265           fi
11266         done
11267   done
11268 fi
11269
11270 }
11271
11272 echo "$as_me:11272: checking for $cf_ncuhdr_root header in include-path" >&5
11273 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
11274 if test "${cf_cv_ncurses_h+set}" = set; then
11275   echo $ECHO_N "(cached) $ECHO_C" >&6
11276 else
11277
11278         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
11279         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
11280         for cf_header in $cf_header_list
11281         do
11282
11283         cat >"conftest.$ac_ext" <<_ACEOF
11284 #line 11284 "configure"
11285 #include "confdefs.h"
11286
11287 #include <$cf_header>
11288 int
11289 main (void)
11290 {
11291
11292 #ifdef NCURSES_VERSION
11293
11294 printf("%s\\n", NCURSES_VERSION);
11295 #else
11296 #ifdef __NCURSES_H
11297 printf("old\\n");
11298 #else
11299         make an error
11300 #endif
11301 #endif
11302
11303   ;
11304   return 0;
11305 }
11306 _ACEOF
11307 rm -f "conftest.$ac_objext"
11308 if { (eval echo "$as_me:11308: \"$ac_compile\"") >&5
11309   (eval $ac_compile) 2>&5
11310   ac_status=$?
11311   echo "$as_me:11311: \$? = $ac_status" >&5
11312   (exit "$ac_status"); } &&
11313          { ac_try='test -s "conftest.$ac_objext"'
11314   { (eval echo "$as_me:11314: \"$ac_try\"") >&5
11315   (eval $ac_try) 2>&5
11316   ac_status=$?
11317   echo "$as_me:11317: \$? = $ac_status" >&5
11318   (exit "$ac_status"); }; }; then
11319   cf_cv_ncurses_h=$cf_header
11320
11321 else
11322   echo "$as_me: failed program was:" >&5
11323 cat "conftest.$ac_ext" >&5
11324 cf_cv_ncurses_h=no
11325 fi
11326 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11327
11328                 test "$cf_cv_ncurses_h" != no && break
11329         done
11330
11331 fi
11332 echo "$as_me:11332: result: $cf_cv_ncurses_h" >&5
11333 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
11334
11335 if test "$cf_cv_ncurses_h" != no ; then
11336         cf_cv_ncurses_header=$cf_cv_ncurses_h
11337 else
11338
11339 echo "$as_me:11339: checking for $cf_ncuhdr_root include-path" >&5
11340 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
11341 if test "${cf_cv_ncurses_h2+set}" = set; then
11342   echo $ECHO_N "(cached) $ECHO_C" >&6
11343 else
11344
11345         test -n "$verbose" && echo
11346
11347 cf_search=
11348
11349 # collect the current set of include-directories from compiler flags
11350 cf_header_path_list=""
11351 if test -n "${CFLAGS}${CPPFLAGS}" ; then
11352         for cf_header_path in $CPPFLAGS $CFLAGS
11353         do
11354                 case "$cf_header_path" in
11355                 (-I*)
11356                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
11357
11358 test "x$cf_header_path" != "xNONE" && \
11359 test -d "$cf_header_path" && \
11360  {
11361         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
11362         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
11363         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
11364         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
11365         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
11366         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"
11367 }
11368
11369                         cf_header_path_list="$cf_header_path_list $cf_search"
11370                         ;;
11371                 esac
11372         done
11373 fi
11374
11375 # add the variations for the package we are looking for
11376
11377 cf_search=
11378
11379 test "x$prefix" != "xNONE" && \
11380 test -d "$prefix" && \
11381  {
11382         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
11383         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
11384         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
11385         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
11386         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
11387         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
11388 }
11389
11390 for cf_subdir_prefix in \
11391         /usr \
11392         /usr/local \
11393         /usr/pkg \
11394         /opt \
11395         /opt/local \
11396         $HOME
11397 do
11398
11399 test "x$cf_subdir_prefix" != "x$prefix" && \
11400 test -d "$cf_subdir_prefix" && \
11401 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11402         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
11403         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
11404         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
11405         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
11406         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
11407         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"
11408 }
11409
11410 done
11411
11412 test "$includedir" != NONE && \
11413 test "$includedir" != "/usr/include" && \
11414 test -d "$includedir" && {
11415         test -d "$includedir" &&    cf_search="$cf_search $includedir"
11416         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
11417 }
11418
11419 test "$oldincludedir" != NONE && \
11420 test "$oldincludedir" != "/usr/include" && \
11421 test -d "$oldincludedir" && {
11422         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
11423         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
11424 }
11425
11426 cf_search="$cf_search $cf_header_path_list"
11427
11428         test -n "$verbose" && echo "search path $cf_search"
11429         cf_save2_CPPFLAGS="$CPPFLAGS"
11430         for cf_incdir in $cf_search
11431         do
11432
11433 if test -n "$cf_incdir" ; then
11434   for cf_add_incdir in $cf_incdir
11435   do
11436         while test "$cf_add_incdir" != /usr/include
11437         do
11438           if test -d "$cf_add_incdir"
11439           then
11440                 cf_have_incdir=no
11441                 if test -n "$CFLAGS$CPPFLAGS" ; then
11442                   # a loop is needed to ensure we can add subdirs of existing dirs
11443                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11444                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11445                           cf_have_incdir=yes; break
11446                         fi
11447                   done
11448                 fi
11449
11450                 if test "$cf_have_incdir" = no ; then
11451                   if test "$cf_add_incdir" = /usr/local/include ; then
11452                         if test "$GCC" = yes
11453                         then
11454                           cf_save_CPPFLAGS=$CPPFLAGS
11455
11456         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11457         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11458
11459                           cat >"conftest.$ac_ext" <<_ACEOF
11460 #line 11460 "configure"
11461 #include "confdefs.h"
11462 #include <stdio.h>
11463 int
11464 main (void)
11465 {
11466 printf("Hello")
11467   ;
11468   return 0;
11469 }
11470 _ACEOF
11471 rm -f "conftest.$ac_objext"
11472 if { (eval echo "$as_me:11472: \"$ac_compile\"") >&5
11473   (eval $ac_compile) 2>&5
11474   ac_status=$?
11475   echo "$as_me:11475: \$? = $ac_status" >&5
11476   (exit "$ac_status"); } &&
11477          { ac_try='test -s "conftest.$ac_objext"'
11478   { (eval echo "$as_me:11478: \"$ac_try\"") >&5
11479   (eval $ac_try) 2>&5
11480   ac_status=$?
11481   echo "$as_me:11481: \$? = $ac_status" >&5
11482   (exit "$ac_status"); }; }; then
11483   :
11484 else
11485   echo "$as_me: failed program was:" >&5
11486 cat "conftest.$ac_ext" >&5
11487 cf_have_incdir=yes
11488 fi
11489 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11490                           CPPFLAGS=$cf_save_CPPFLAGS
11491                         fi
11492                   fi
11493                 fi
11494
11495                 if test "$cf_have_incdir" = no ; then
11496                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11497
11498 echo "${as_me:-configure}:11498: testing adding $cf_add_incdir to include-path ..." 1>&5
11499
11500                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11501
11502                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11503                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11504                   cf_add_incdir="$cf_top_incdir"
11505                 else
11506                   break
11507                 fi
11508           else
11509                 break
11510           fi
11511         done
11512   done
11513 fi
11514
11515                 for cf_header in \
11516                         ncurses.h \
11517                         curses.h
11518                 do
11519
11520         cat >"conftest.$ac_ext" <<_ACEOF
11521 #line 11521 "configure"
11522 #include "confdefs.h"
11523
11524 #include <$cf_header>
11525 int
11526 main (void)
11527 {
11528
11529 #ifdef NCURSES_VERSION
11530
11531 printf("%s\\n", NCURSES_VERSION);
11532 #else
11533 #ifdef __NCURSES_H
11534 printf("old\\n");
11535 #else
11536         make an error
11537 #endif
11538 #endif
11539
11540   ;
11541   return 0;
11542 }
11543 _ACEOF
11544 rm -f "conftest.$ac_objext"
11545 if { (eval echo "$as_me:11545: \"$ac_compile\"") >&5
11546   (eval $ac_compile) 2>&5
11547   ac_status=$?
11548   echo "$as_me:11548: \$? = $ac_status" >&5
11549   (exit "$ac_status"); } &&
11550          { ac_try='test -s "conftest.$ac_objext"'
11551   { (eval echo "$as_me:11551: \"$ac_try\"") >&5
11552   (eval $ac_try) 2>&5
11553   ac_status=$?
11554   echo "$as_me:11554: \$? = $ac_status" >&5
11555   (exit "$ac_status"); }; }; then
11556   cf_cv_ncurses_h2=$cf_header
11557
11558 else
11559   echo "$as_me: failed program was:" >&5
11560 cat "conftest.$ac_ext" >&5
11561 cf_cv_ncurses_h2=no
11562 fi
11563 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11564
11565                         if test "$cf_cv_ncurses_h2" != no ; then
11566                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
11567                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
11568                                 break
11569                         fi
11570                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
11571                 done
11572                 CPPFLAGS="$cf_save2_CPPFLAGS"
11573                 test "$cf_cv_ncurses_h2" != no && break
11574         done
11575         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11575: error: not found" >&5
11576 echo "$as_me: error: not found" >&2;}
11577    { (exit 1); exit 1; }; }
11578
11579 fi
11580 echo "$as_me:11580: result: $cf_cv_ncurses_h2" >&5
11581 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
11582
11583         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
11584         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
11585         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
11586                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
11587         fi
11588
11589 if test -n "$cf_1st_incdir" ; then
11590   for cf_add_incdir in $cf_1st_incdir
11591   do
11592         while test "$cf_add_incdir" != /usr/include
11593         do
11594           if test -d "$cf_add_incdir"
11595           then
11596                 cf_have_incdir=no
11597                 if test -n "$CFLAGS$CPPFLAGS" ; then
11598                   # a loop is needed to ensure we can add subdirs of existing dirs
11599                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11600                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11601                           cf_have_incdir=yes; break
11602                         fi
11603                   done
11604                 fi
11605
11606                 if test "$cf_have_incdir" = no ; then
11607                   if test "$cf_add_incdir" = /usr/local/include ; then
11608                         if test "$GCC" = yes
11609                         then
11610                           cf_save_CPPFLAGS=$CPPFLAGS
11611
11612         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11613         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11614
11615                           cat >"conftest.$ac_ext" <<_ACEOF
11616 #line 11616 "configure"
11617 #include "confdefs.h"
11618 #include <stdio.h>
11619 int
11620 main (void)
11621 {
11622 printf("Hello")
11623   ;
11624   return 0;
11625 }
11626 _ACEOF
11627 rm -f "conftest.$ac_objext"
11628 if { (eval echo "$as_me:11628: \"$ac_compile\"") >&5
11629   (eval $ac_compile) 2>&5
11630   ac_status=$?
11631   echo "$as_me:11631: \$? = $ac_status" >&5
11632   (exit "$ac_status"); } &&
11633          { ac_try='test -s "conftest.$ac_objext"'
11634   { (eval echo "$as_me:11634: \"$ac_try\"") >&5
11635   (eval $ac_try) 2>&5
11636   ac_status=$?
11637   echo "$as_me:11637: \$? = $ac_status" >&5
11638   (exit "$ac_status"); }; }; then
11639   :
11640 else
11641   echo "$as_me: failed program was:" >&5
11642 cat "conftest.$ac_ext" >&5
11643 cf_have_incdir=yes
11644 fi
11645 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11646                           CPPFLAGS=$cf_save_CPPFLAGS
11647                         fi
11648                   fi
11649                 fi
11650
11651                 if test "$cf_have_incdir" = no ; then
11652                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11653
11654 echo "${as_me:-configure}:11654: testing adding $cf_add_incdir to include-path ..." 1>&5
11655
11656                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11657
11658                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11659                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11660                   cf_add_incdir="$cf_top_incdir"
11661                 else
11662                   break
11663                 fi
11664           else
11665                 break
11666           fi
11667         done
11668   done
11669 fi
11670
11671 fi
11672
11673 # Set definitions to allow ifdef'ing for ncurses.h
11674
11675 case "$cf_cv_ncurses_header" in
11676 (*ncurses.h)
11677
11678 cat >>confdefs.h <<\EOF
11679 #define HAVE_NCURSES_H 1
11680 EOF
11681
11682         ;;
11683 esac
11684
11685 case "$cf_cv_ncurses_header" in
11686 (ncurses/curses.h|ncurses/ncurses.h)
11687
11688 cat >>confdefs.h <<\EOF
11689 #define HAVE_NCURSES_NCURSES_H 1
11690 EOF
11691
11692         ;;
11693 (ncursesw/curses.h|ncursesw/ncurses.h)
11694
11695 cat >>confdefs.h <<\EOF
11696 #define HAVE_NCURSESW_NCURSES_H 1
11697 EOF
11698
11699         ;;
11700 esac
11701
11702 echo "$as_me:11702: checking for terminfo header" >&5
11703 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
11704 if test "${cf_cv_term_header+set}" = set; then
11705   echo $ECHO_N "(cached) $ECHO_C" >&6
11706 else
11707
11708 case "${cf_cv_ncurses_header}" in
11709 (*/ncurses.h|*/ncursesw.h)
11710         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
11711         ;;
11712 (*)
11713         cf_term_header=term.h
11714         ;;
11715 esac
11716
11717 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11718 do
11719 cat >"conftest.$ac_ext" <<_ACEOF
11720 #line 11720 "configure"
11721 #include "confdefs.h"
11722 #include <stdio.h>
11723 #include <${cf_cv_ncurses_header:-curses.h}>
11724 #include <$cf_test>
11725
11726 int
11727 main (void)
11728 {
11729 int x = auto_left_margin; (void)x
11730   ;
11731   return 0;
11732 }
11733 _ACEOF
11734 rm -f "conftest.$ac_objext"
11735 if { (eval echo "$as_me:11735: \"$ac_compile\"") >&5
11736   (eval $ac_compile) 2>&5
11737   ac_status=$?
11738   echo "$as_me:11738: \$? = $ac_status" >&5
11739   (exit "$ac_status"); } &&
11740          { ac_try='test -s "conftest.$ac_objext"'
11741   { (eval echo "$as_me:11741: \"$ac_try\"") >&5
11742   (eval $ac_try) 2>&5
11743   ac_status=$?
11744   echo "$as_me:11744: \$? = $ac_status" >&5
11745   (exit "$ac_status"); }; }; then
11746
11747         cf_cv_term_header="$cf_test"
11748 else
11749   echo "$as_me: failed program was:" >&5
11750 cat "conftest.$ac_ext" >&5
11751
11752         cf_cv_term_header=unknown
11753
11754 fi
11755 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11756         test "$cf_cv_term_header" != unknown && break
11757 done
11758
11759 fi
11760 echo "$as_me:11760: result: $cf_cv_term_header" >&5
11761 echo "${ECHO_T}$cf_cv_term_header" >&6
11762
11763 # Set definitions to allow ifdef'ing to accommodate subdirectories
11764
11765 case "$cf_cv_term_header" in
11766 (*term.h)
11767
11768 cat >>confdefs.h <<\EOF
11769 #define HAVE_TERM_H 1
11770 EOF
11771
11772         ;;
11773 esac
11774
11775 case "$cf_cv_term_header" in
11776 (ncurses/term.h)
11777
11778 cat >>confdefs.h <<\EOF
11779 #define HAVE_NCURSES_TERM_H 1
11780 EOF
11781
11782         ;;
11783 (ncursesw/term.h)
11784
11785 cat >>confdefs.h <<\EOF
11786 #define HAVE_NCURSESW_TERM_H 1
11787 EOF
11788
11789         ;;
11790 esac
11791
11792 # some applications need this, but should check for NCURSES_VERSION
11793
11794 cat >>confdefs.h <<\EOF
11795 #define NCURSES 1
11796 EOF
11797
11798 echo "$as_me:11798: checking for ncurses version" >&5
11799 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11800 if test "${cf_cv_ncurses_version+set}" = set; then
11801   echo $ECHO_N "(cached) $ECHO_C" >&6
11802 else
11803
11804         cf_cv_ncurses_version=no
11805         cf_tempfile=out$$
11806         rm -f "$cf_tempfile"
11807         if test "$cross_compiling" = yes; then
11808
11809         # This will not work if the preprocessor splits the line after the
11810         # Autoconf token.  The 'unproto' program does that.
11811         cat > "conftest.$ac_ext" <<EOF
11812 #include <${cf_cv_ncurses_header:-curses.h}>
11813 #undef Autoconf
11814 #ifdef NCURSES_VERSION
11815 Autoconf NCURSES_VERSION
11816 #else
11817 #ifdef __NCURSES_H
11818 Autoconf "old"
11819 #endif
11820 ;
11821 #endif
11822 EOF
11823         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11824         { (eval echo "$as_me:11824: \"$cf_try\"") >&5
11825   (eval $cf_try) 2>&5
11826   ac_status=$?
11827   echo "$as_me:11827: \$? = $ac_status" >&5
11828   (exit "$ac_status"); }
11829         if test -f conftest.out ; then
11830                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
11831                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11832                 rm -f conftest.out
11833         fi
11834
11835 else
11836   cat >"conftest.$ac_ext" <<_ACEOF
11837 #line 11837 "configure"
11838 #include "confdefs.h"
11839
11840 #include <${cf_cv_ncurses_header:-curses.h}>
11841 #include <stdio.h>
11842 int main(void)
11843 {
11844         FILE *fp = fopen("$cf_tempfile", "w");
11845 #ifdef NCURSES_VERSION
11846 # ifdef NCURSES_VERSION_PATCH
11847         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11848 # else
11849         fprintf(fp, "%s\\n", NCURSES_VERSION);
11850 # endif
11851 #else
11852 # ifdef __NCURSES_H
11853         fprintf(fp, "old\\n");
11854 # else
11855         make an error
11856 # endif
11857 #endif
11858         ${cf_cv_main_return:-return}(0);
11859 }
11860 _ACEOF
11861 rm -f "conftest$ac_exeext"
11862 if { (eval echo "$as_me:11862: \"$ac_link\"") >&5
11863   (eval $ac_link) 2>&5
11864   ac_status=$?
11865   echo "$as_me:11865: \$? = $ac_status" >&5
11866   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
11867   { (eval echo "$as_me:11867: \"$ac_try\"") >&5
11868   (eval $ac_try) 2>&5
11869   ac_status=$?
11870   echo "$as_me:11870: \$? = $ac_status" >&5
11871   (exit "$ac_status"); }; }; then
11872
11873         cf_cv_ncurses_version=`cat $cf_tempfile`
11874 else
11875   echo "$as_me: program exited with status $ac_status" >&5
11876 echo "$as_me: failed program was:" >&5
11877 cat "conftest.$ac_ext" >&5
11878 fi
11879 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
11880 fi
11881         rm -f "$cf_tempfile"
11882
11883 fi
11884 echo "$as_me:11884: result: $cf_cv_ncurses_version" >&5
11885 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11886 test "$cf_cv_ncurses_version" = no ||
11887 cat >>confdefs.h <<\EOF
11888 #define NCURSES 1
11889 EOF
11890
11891 cf_nculib_root=$cf_cv_screen
11892         # This works, except for the special case where we find gpm, but
11893         # ncurses is in a nonstandard location via $LIBS, and we really want
11894         # to link gpm.
11895 cf_ncurses_LIBS=""
11896 cf_ncurses_SAVE="$LIBS"
11897 echo "$as_me:11897: checking for Gpm_Open in -lgpm" >&5
11898 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11899 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11900   echo $ECHO_N "(cached) $ECHO_C" >&6
11901 else
11902   ac_check_lib_save_LIBS=$LIBS
11903 LIBS="-lgpm  $LIBS"
11904 cat >"conftest.$ac_ext" <<_ACEOF
11905 #line 11905 "configure"
11906 #include "confdefs.h"
11907
11908 /* Override any gcc2 internal prototype to avoid an error.  */
11909 #ifdef __cplusplus
11910 extern "C"
11911 #endif
11912 /* We use char because int might match the return type of a gcc2
11913    builtin and then its argument prototype would still apply.  */
11914 char Gpm_Open ();
11915 int
11916 main (void)
11917 {
11918 Gpm_Open ();
11919   ;
11920   return 0;
11921 }
11922 _ACEOF
11923 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11924 if { (eval echo "$as_me:11924: \"$ac_link\"") >&5
11925   (eval $ac_link) 2>&5
11926   ac_status=$?
11927   echo "$as_me:11927: \$? = $ac_status" >&5
11928   (exit "$ac_status"); } &&
11929          { ac_try='test -s "conftest$ac_exeext"'
11930   { (eval echo "$as_me:11930: \"$ac_try\"") >&5
11931   (eval $ac_try) 2>&5
11932   ac_status=$?
11933   echo "$as_me:11933: \$? = $ac_status" >&5
11934   (exit "$ac_status"); }; }; then
11935   ac_cv_lib_gpm_Gpm_Open=yes
11936 else
11937   echo "$as_me: failed program was:" >&5
11938 cat "conftest.$ac_ext" >&5
11939 ac_cv_lib_gpm_Gpm_Open=no
11940 fi
11941 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11942 LIBS=$ac_check_lib_save_LIBS
11943 fi
11944 echo "$as_me:11944: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11945 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11946 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11947   echo "$as_me:11947: checking for initscr in -lgpm" >&5
11948 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11949 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11950   echo $ECHO_N "(cached) $ECHO_C" >&6
11951 else
11952   ac_check_lib_save_LIBS=$LIBS
11953 LIBS="-lgpm  $LIBS"
11954 cat >"conftest.$ac_ext" <<_ACEOF
11955 #line 11955 "configure"
11956 #include "confdefs.h"
11957
11958 /* Override any gcc2 internal prototype to avoid an error.  */
11959 #ifdef __cplusplus
11960 extern "C"
11961 #endif
11962 /* We use char because int might match the return type of a gcc2
11963    builtin and then its argument prototype would still apply.  */
11964 char initscr ();
11965 int
11966 main (void)
11967 {
11968 initscr ();
11969   ;
11970   return 0;
11971 }
11972 _ACEOF
11973 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11974 if { (eval echo "$as_me:11974: \"$ac_link\"") >&5
11975   (eval $ac_link) 2>&5
11976   ac_status=$?
11977   echo "$as_me:11977: \$? = $ac_status" >&5
11978   (exit "$ac_status"); } &&
11979          { ac_try='test -s "conftest$ac_exeext"'
11980   { (eval echo "$as_me:11980: \"$ac_try\"") >&5
11981   (eval $ac_try) 2>&5
11982   ac_status=$?
11983   echo "$as_me:11983: \$? = $ac_status" >&5
11984   (exit "$ac_status"); }; }; then
11985   ac_cv_lib_gpm_initscr=yes
11986 else
11987   echo "$as_me: failed program was:" >&5
11988 cat "conftest.$ac_ext" >&5
11989 ac_cv_lib_gpm_initscr=no
11990 fi
11991 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11992 LIBS=$ac_check_lib_save_LIBS
11993 fi
11994 echo "$as_me:11994: result: $ac_cv_lib_gpm_initscr" >&5
11995 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11996 if test "$ac_cv_lib_gpm_initscr" = yes; then
11997   LIBS="$cf_ncurses_SAVE"
11998 else
11999   cf_ncurses_LIBS="-lgpm"
12000 fi
12001
12002 fi
12003
12004 case "$host_os" in
12005 (freebsd*)
12006         # This is only necessary if you are linking against an obsolete
12007         # version of ncurses (but it should do no harm, since it is static).
12008         if test "$cf_nculib_root" = ncurses ; then
12009                 echo "$as_me:12009: checking for tgoto in -lmytinfo" >&5
12010 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
12011 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
12012   echo $ECHO_N "(cached) $ECHO_C" >&6
12013 else
12014   ac_check_lib_save_LIBS=$LIBS
12015 LIBS="-lmytinfo  $LIBS"
12016 cat >"conftest.$ac_ext" <<_ACEOF
12017 #line 12017 "configure"
12018 #include "confdefs.h"
12019
12020 /* Override any gcc2 internal prototype to avoid an error.  */
12021 #ifdef __cplusplus
12022 extern "C"
12023 #endif
12024 /* We use char because int might match the return type of a gcc2
12025    builtin and then its argument prototype would still apply.  */
12026 char tgoto ();
12027 int
12028 main (void)
12029 {
12030 tgoto ();
12031   ;
12032   return 0;
12033 }
12034 _ACEOF
12035 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12036 if { (eval echo "$as_me:12036: \"$ac_link\"") >&5
12037   (eval $ac_link) 2>&5
12038   ac_status=$?
12039   echo "$as_me:12039: \$? = $ac_status" >&5
12040   (exit "$ac_status"); } &&
12041          { ac_try='test -s "conftest$ac_exeext"'
12042   { (eval echo "$as_me:12042: \"$ac_try\"") >&5
12043   (eval $ac_try) 2>&5
12044   ac_status=$?
12045   echo "$as_me:12045: \$? = $ac_status" >&5
12046   (exit "$ac_status"); }; }; then
12047   ac_cv_lib_mytinfo_tgoto=yes
12048 else
12049   echo "$as_me: failed program was:" >&5
12050 cat "conftest.$ac_ext" >&5
12051 ac_cv_lib_mytinfo_tgoto=no
12052 fi
12053 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12054 LIBS=$ac_check_lib_save_LIBS
12055 fi
12056 echo "$as_me:12056: result: $ac_cv_lib_mytinfo_tgoto" >&5
12057 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
12058 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
12059   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
12060 fi
12061
12062         fi
12063         ;;
12064 esac
12065
12066 cf_add_libs="$LIBS"
12067 # reverse order
12068 cf_add_0lib=
12069 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12070 # filter duplicates
12071 for cf_add_1lib in $cf_add_0lib; do
12072         for cf_add_2lib in $cf_add_libs; do
12073                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12074                         cf_add_1lib=
12075                         break
12076                 fi
12077         done
12078         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12079 done
12080 LIBS="$cf_add_libs"
12081
12082 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
12083 then
12084
12085 cf_add_libs="$LIBS"
12086 # reverse order
12087 cf_add_0lib=
12088 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12089 # filter duplicates
12090 for cf_add_1lib in $cf_add_0lib; do
12091         for cf_add_2lib in $cf_add_libs; do
12092                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12093                         cf_add_1lib=
12094                         break
12095                 fi
12096         done
12097         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12098 done
12099 LIBS="$cf_add_libs"
12100
12101 else
12102
12103         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
12104         cf_libdir=""
12105         echo "$as_me:12105: checking for initscr" >&5
12106 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
12107 if test "${ac_cv_func_initscr+set}" = set; then
12108   echo $ECHO_N "(cached) $ECHO_C" >&6
12109 else
12110   cat >"conftest.$ac_ext" <<_ACEOF
12111 #line 12111 "configure"
12112 #include "confdefs.h"
12113 #define initscr autoconf_temporary
12114 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12115 #undef initscr
12116
12117 #ifdef __cplusplus
12118 extern "C"
12119 #endif
12120
12121 /* We use char because int might match the return type of a gcc2
12122    builtin and then its argument prototype would still apply.  */
12123 char initscr (void);
12124
12125 int
12126 main (void)
12127 {
12128
12129 /* The GNU C library defines stubs for functions which it implements
12130     to always fail with ENOSYS.  Some functions are actually named
12131     something starting with __ and the normal name is an alias.  */
12132 #if defined (__stub_initscr) || defined (__stub___initscr)
12133 #error found stub for initscr
12134 #endif
12135
12136         return initscr ();
12137   ;
12138   return 0;
12139 }
12140 _ACEOF
12141 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12142 if { (eval echo "$as_me:12142: \"$ac_link\"") >&5
12143   (eval $ac_link) 2>&5
12144   ac_status=$?
12145   echo "$as_me:12145: \$? = $ac_status" >&5
12146   (exit "$ac_status"); } &&
12147          { ac_try='test -s "conftest$ac_exeext"'
12148   { (eval echo "$as_me:12148: \"$ac_try\"") >&5
12149   (eval $ac_try) 2>&5
12150   ac_status=$?
12151   echo "$as_me:12151: \$? = $ac_status" >&5
12152   (exit "$ac_status"); }; }; then
12153   ac_cv_func_initscr=yes
12154 else
12155   echo "$as_me: failed program was:" >&5
12156 cat "conftest.$ac_ext" >&5
12157 ac_cv_func_initscr=no
12158 fi
12159 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12160 fi
12161 echo "$as_me:12161: result: $ac_cv_func_initscr" >&5
12162 echo "${ECHO_T}$ac_cv_func_initscr" >&6
12163 if test "$ac_cv_func_initscr" = yes; then
12164   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12165 else
12166
12167                 cf_save_LIBS="$LIBS"
12168                 echo "$as_me:12168: checking for initscr in -l$cf_nculib_root" >&5
12169 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
12170                 LIBS="-l$cf_nculib_root $LIBS"
12171                 cat >"conftest.$ac_ext" <<_ACEOF
12172 #line 12172 "configure"
12173 #include "confdefs.h"
12174 #include <${cf_cv_ncurses_header:-curses.h}>
12175 int
12176 main (void)
12177 {
12178 initscr()
12179   ;
12180   return 0;
12181 }
12182 _ACEOF
12183 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12184 if { (eval echo "$as_me:12184: \"$ac_link\"") >&5
12185   (eval $ac_link) 2>&5
12186   ac_status=$?
12187   echo "$as_me:12187: \$? = $ac_status" >&5
12188   (exit "$ac_status"); } &&
12189          { ac_try='test -s "conftest$ac_exeext"'
12190   { (eval echo "$as_me:12190: \"$ac_try\"") >&5
12191   (eval $ac_try) 2>&5
12192   ac_status=$?
12193   echo "$as_me:12193: \$? = $ac_status" >&5
12194   (exit "$ac_status"); }; }; then
12195   echo "$as_me:12195: result: yes" >&5
12196 echo "${ECHO_T}yes" >&6
12197                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12198
12199 else
12200   echo "$as_me: failed program was:" >&5
12201 cat "conftest.$ac_ext" >&5
12202 echo "$as_me:12202: result: no" >&5
12203 echo "${ECHO_T}no" >&6
12204
12205 cf_search=
12206 cf_library_path_list=""
12207 if test -n "${LDFLAGS}${LIBS}" ; then
12208         for cf_library_path in $LDFLAGS $LIBS
12209         do
12210                 case "$cf_library_path" in
12211                 (-L*)
12212                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
12213
12214 test "x$cf_library_path" != "xNONE" && \
12215 test -d "$cf_library_path" && \
12216  {
12217         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
12218         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
12219         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
12220         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
12221         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
12222         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"
12223 }
12224
12225                         cf_library_path_list="$cf_library_path_list $cf_search"
12226                         ;;
12227                 esac
12228         done
12229 fi
12230
12231 cf_search=
12232
12233 test "x$prefix" != "xNONE" && \
12234 test -d "$prefix" && \
12235  {
12236         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
12237         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
12238         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
12239         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
12240         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
12241         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
12242 }
12243
12244 for cf_subdir_prefix in \
12245         /usr \
12246         /usr/local \
12247         /usr/pkg \
12248         /opt \
12249         /opt/local \
12250         $HOME
12251 do
12252
12253 test "x$cf_subdir_prefix" != "x$prefix" && \
12254 test -d "$cf_subdir_prefix" && \
12255 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
12256         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
12257         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
12258         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
12259         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
12260         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
12261         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"
12262 }
12263
12264 done
12265
12266 cf_search="$cf_library_path_list $cf_search"
12267
12268                         for cf_libdir in $cf_search
12269                         do
12270                                 echo "$as_me:12270: checking for -l$cf_nculib_root in $cf_libdir" >&5
12271 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
12272                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
12273                                 cat >"conftest.$ac_ext" <<_ACEOF
12274 #line 12274 "configure"
12275 #include "confdefs.h"
12276 #include <${cf_cv_ncurses_header:-curses.h}>
12277 int
12278 main (void)
12279 {
12280 initscr()
12281   ;
12282   return 0;
12283 }
12284 _ACEOF
12285 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12286 if { (eval echo "$as_me:12286: \"$ac_link\"") >&5
12287   (eval $ac_link) 2>&5
12288   ac_status=$?
12289   echo "$as_me:12289: \$? = $ac_status" >&5
12290   (exit "$ac_status"); } &&
12291          { ac_try='test -s "conftest$ac_exeext"'
12292   { (eval echo "$as_me:12292: \"$ac_try\"") >&5
12293   (eval $ac_try) 2>&5
12294   ac_status=$?
12295   echo "$as_me:12295: \$? = $ac_status" >&5
12296   (exit "$ac_status"); }; }; then
12297   echo "$as_me:12297: result: yes" >&5
12298 echo "${ECHO_T}yes" >&6
12299                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12300                                          break
12301 else
12302   echo "$as_me: failed program was:" >&5
12303 cat "conftest.$ac_ext" >&5
12304 echo "$as_me:12304: result: no" >&5
12305 echo "${ECHO_T}no" >&6
12306                                          LIBS="$cf_save_LIBS"
12307 fi
12308 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12309                         done
12310
12311 fi
12312 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12313
12314 fi
12315
12316 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
12317
12318 if test "$cf_found_library" = no ; then
12319         { { echo "$as_me:12319: error: Cannot link $cf_nculib_root library" >&5
12320 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
12321    { (exit 1); exit 1; }; }
12322 fi
12323
12324 fi
12325
12326 if test -n "$cf_ncurses_LIBS" ; then
12327         echo "$as_me:12327: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
12328 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
12329         cf_ncurses_SAVE="$LIBS"
12330         for p in $cf_ncurses_LIBS ; do
12331                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
12332                 if test "$q" != "$LIBS" ; then
12333                         LIBS="$q"
12334                 fi
12335         done
12336         cat >"conftest.$ac_ext" <<_ACEOF
12337 #line 12337 "configure"
12338 #include "confdefs.h"
12339 #include <${cf_cv_ncurses_header:-curses.h}>
12340 int
12341 main (void)
12342 {
12343 initscr(); mousemask(0,0); tigetstr((char *)0);
12344   ;
12345   return 0;
12346 }
12347 _ACEOF
12348 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12349 if { (eval echo "$as_me:12349: \"$ac_link\"") >&5
12350   (eval $ac_link) 2>&5
12351   ac_status=$?
12352   echo "$as_me:12352: \$? = $ac_status" >&5
12353   (exit "$ac_status"); } &&
12354          { ac_try='test -s "conftest$ac_exeext"'
12355   { (eval echo "$as_me:12355: \"$ac_try\"") >&5
12356   (eval $ac_try) 2>&5
12357   ac_status=$?
12358   echo "$as_me:12358: \$? = $ac_status" >&5
12359   (exit "$ac_status"); }; }; then
12360   echo "$as_me:12360: result: yes" >&5
12361 echo "${ECHO_T}yes" >&6
12362 else
12363   echo "$as_me: failed program was:" >&5
12364 cat "conftest.$ac_ext" >&5
12365 echo "$as_me:12365: result: no" >&5
12366 echo "${ECHO_T}no" >&6
12367                  LIBS="$cf_ncurses_SAVE"
12368 fi
12369 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12370 fi
12371
12372 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12373
12374 cat >>confdefs.h <<EOF
12375 #define $cf_nculib_ROOT 1
12376 EOF
12377
12378         fi
12379 else
12380         NCURSES_CONFIG=none
12381 fi
12382
12383         ;;
12384 (pdcurses)
12385         echo "$as_me:12385: checking for X" >&5
12386 echo $ECHO_N "checking for X... $ECHO_C" >&6
12387
12388 # Check whether --with-x or --without-x was given.
12389 if test "${with_x+set}" = set; then
12390   withval="$with_x"
12391
12392 fi;
12393 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
12394 if test "x$with_x" = xno; then
12395   # The user explicitly disabled X.
12396   have_x=disabled
12397 else
12398   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
12399     # Both variables are already set.
12400     have_x=yes
12401   else
12402     if test "${ac_cv_have_x+set}" = set; then
12403   echo $ECHO_N "(cached) $ECHO_C" >&6
12404 else
12405   # One or both of the vars are not set, and there is no cached value.
12406 ac_x_includes=no ac_x_libraries=no
12407 rm -fr conftest.dir
12408 if mkdir conftest.dir; then
12409   cd conftest.dir
12410   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
12411   cat >Imakefile <<'EOF'
12412 acfindx:
12413         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
12414 EOF
12415   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
12416     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
12417     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
12418     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
12419     for ac_extension in a so sl dylib dll; do
12420       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
12421          test -f "$ac_im_libdir/libX11.$ac_extension"; then
12422         ac_im_usrlibdir=$ac_im_libdir; break
12423       fi
12424     done
12425     # Screen out bogus values from the imake configuration.  They are
12426     # bogus both because they are the default anyway, and because
12427     # using them would break gcc on systems where it needs fixed includes.
12428     case $ac_im_incroot in
12429         /usr/include) ;;
12430         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
12431     esac
12432     case $ac_im_usrlibdir in
12433         /usr/lib | /lib) ;;
12434         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
12435     esac
12436   fi
12437   cd ..
12438   rm -fr conftest.dir
12439 fi
12440
12441 # Standard set of common directories for X headers.
12442 # Check X11 before X11Rn because it is often a symlink to the current release.
12443 ac_x_header_dirs='
12444 /usr/X11/include
12445 /usr/X11R7/include
12446 /usr/X11R6/include
12447 /usr/X11R5/include
12448 /usr/X11R4/include
12449
12450 /opt/local/include
12451 /opt/X11/include
12452
12453 /usr/include/X11
12454 /usr/include/X11R7
12455 /usr/include/X11R6
12456 /usr/include/X11R5
12457 /usr/include/X11R4
12458
12459 /usr/local/X11/include
12460 /usr/local/X11R7/include
12461 /usr/local/X11R6/include
12462 /usr/local/X11R5/include
12463 /usr/local/X11R4/include
12464
12465 /usr/local/include/X11
12466 /usr/local/include/X11R7
12467 /usr/local/include/X11R6
12468 /usr/local/include/X11R5
12469 /usr/local/include/X11R4
12470
12471 /usr/X386/include
12472 /usr/x386/include
12473 /usr/XFree86/include/X11
12474
12475 /usr/include
12476 /usr/local/include
12477 /usr/unsupported/include
12478 /usr/athena/include
12479 /usr/local/x11r5/include
12480 /usr/lpp/Xamples/include
12481
12482 /usr/openwin/include
12483 /usr/openwin/share/include'
12484
12485 if test "$ac_x_includes" = no; then
12486   # Guess where to find include files, by looking for Intrinsic.h.
12487   # First, try using that file with no special directory specified.
12488   cat >"conftest.$ac_ext" <<_ACEOF
12489 #line 12489 "configure"
12490 #include "confdefs.h"
12491 #include <X11/Intrinsic.h>
12492 _ACEOF
12493 if { (eval echo "$as_me:12493: \"$ac_cpp "conftest.$ac_ext"\"") >&5
12494   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
12495   ac_status=$?
12496   $EGREP -v '^ *\+' conftest.er1 >conftest.err
12497   rm -f conftest.er1
12498   cat conftest.err >&5
12499   echo "$as_me:12499: \$? = $ac_status" >&5
12500   (exit "$ac_status"); } >/dev/null; then
12501   if test -s conftest.err; then
12502     ac_cpp_err=$ac_c_preproc_warn_flag
12503   else
12504     ac_cpp_err=
12505   fi
12506 else
12507   ac_cpp_err=yes
12508 fi
12509 if test -z "$ac_cpp_err"; then
12510   # We can compile using X headers with no special include directory.
12511 ac_x_includes=
12512 else
12513   echo "$as_me: failed program was:" >&5
12514   cat "conftest.$ac_ext" >&5
12515   for ac_dir in $ac_x_header_dirs; do
12516   if test -r "$ac_dir/X11/Intrinsic.h"; then
12517     ac_x_includes=$ac_dir
12518     break
12519   fi
12520 done
12521 fi
12522 rm -f conftest.err "conftest.$ac_ext"
12523 fi # $ac_x_includes = no
12524
12525 if test "$ac_x_libraries" = no; then
12526   # Check for the libraries.
12527   # See if we find them without any special options.
12528   # Don't add to $LIBS permanently.
12529   ac_save_LIBS=$LIBS
12530   LIBS="-lXt $LIBS"
12531   cat >"conftest.$ac_ext" <<_ACEOF
12532 #line 12532 "configure"
12533 #include "confdefs.h"
12534 #include <X11/Intrinsic.h>
12535 int
12536 main (void)
12537 {
12538 XtMalloc (0)
12539   ;
12540   return 0;
12541 }
12542 _ACEOF
12543 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12544 if { (eval echo "$as_me:12544: \"$ac_link\"") >&5
12545   (eval $ac_link) 2>&5
12546   ac_status=$?
12547   echo "$as_me:12547: \$? = $ac_status" >&5
12548   (exit "$ac_status"); } &&
12549          { ac_try='test -s "conftest$ac_exeext"'
12550   { (eval echo "$as_me:12550: \"$ac_try\"") >&5
12551   (eval $ac_try) 2>&5
12552   ac_status=$?
12553   echo "$as_me:12553: \$? = $ac_status" >&5
12554   (exit "$ac_status"); }; }; then
12555   LIBS=$ac_save_LIBS
12556 # We can link X programs with no special library path.
12557 ac_x_libraries=
12558 else
12559   echo "$as_me: failed program was:" >&5
12560 cat "conftest.$ac_ext" >&5
12561 LIBS=$ac_save_LIBS
12562 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
12563 do
12564   # Don't even attempt the hair of trying to link an X program!
12565   for ac_extension in a so sl dylib dll; do
12566     if test -r "$ac_dir/libXt.$ac_extension"; then
12567       ac_x_libraries=$ac_dir
12568       break 2
12569     fi
12570   done
12571 done
12572 fi
12573 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12574 fi # $ac_x_libraries = no
12575
12576 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
12577   # Didn't find X anywhere.  Cache the known absence of X.
12578   ac_cv_have_x="have_x=no"
12579 else
12580   # Record where we found X for the cache.
12581   ac_cv_have_x="have_x=yes \
12582                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
12583 fi
12584 fi
12585
12586   fi
12587   eval "$ac_cv_have_x"
12588 fi # $with_x != no
12589
12590 if test "$have_x" != yes; then
12591   echo "$as_me:12591: result: $have_x" >&5
12592 echo "${ECHO_T}$have_x" >&6
12593   no_x=yes
12594 else
12595   # If each of the values was on the command line, it overrides each guess.
12596   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
12597   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
12598   # Update the cache value to reflect the command line values.
12599   ac_cv_have_x="have_x=yes \
12600                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
12601   echo "$as_me:12601: result: libraries $x_libraries, headers $x_includes" >&5
12602 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
12603 fi
12604
12605 if test "$no_x" = yes; then
12606   # Not all programs may use this symbol, but it does not hurt to define it.
12607
12608 cat >>confdefs.h <<\EOF
12609 #define X_DISPLAY_MISSING 1
12610 EOF
12611
12612   X_CFLAGS=
12613   X_PRE_LIBS=
12614   X_LIBS=
12615   X_EXTRA_LIBS=
12616 else
12617   if test -n "$x_includes"; then
12618     X_CFLAGS="$X_CFLAGS -I$x_includes"
12619   fi
12620
12621   # It would also be nice to do this for all -L options, not just this one.
12622   if test -n "$x_libraries"; then
12623     X_LIBS="$X_LIBS -L$x_libraries"
12624     # For Solaris; some versions of Sun CC require a space after -R and
12625     # others require no space.  Words are not sufficient . . . .
12626     case `(uname -sr) 2>/dev/null` in
12627     "SunOS 5"*)
12628       echo "$as_me:12628: checking whether -R must be followed by a space" >&5
12629 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
12630       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
12631       cat >"conftest.$ac_ext" <<_ACEOF
12632 #line 12632 "configure"
12633 #include "confdefs.h"
12634
12635 int
12636 main (void)
12637 {
12638
12639   ;
12640   return 0;
12641 }
12642 _ACEOF
12643 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12644 if { (eval echo "$as_me:12644: \"$ac_link\"") >&5
12645   (eval $ac_link) 2>&5
12646   ac_status=$?
12647   echo "$as_me:12647: \$? = $ac_status" >&5
12648   (exit "$ac_status"); } &&
12649          { ac_try='test -s "conftest$ac_exeext"'
12650   { (eval echo "$as_me:12650: \"$ac_try\"") >&5
12651   (eval $ac_try) 2>&5
12652   ac_status=$?
12653   echo "$as_me:12653: \$? = $ac_status" >&5
12654   (exit "$ac_status"); }; }; then
12655   ac_R_nospace=yes
12656 else
12657   echo "$as_me: failed program was:" >&5
12658 cat "conftest.$ac_ext" >&5
12659 ac_R_nospace=no
12660 fi
12661 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12662       if test $ac_R_nospace = yes; then
12663         echo "$as_me:12663: result: no" >&5
12664 echo "${ECHO_T}no" >&6
12665         X_LIBS="$X_LIBS -R$x_libraries"
12666       else
12667         LIBS="$ac_xsave_LIBS -R $x_libraries"
12668         cat >"conftest.$ac_ext" <<_ACEOF
12669 #line 12669 "configure"
12670 #include "confdefs.h"
12671
12672 int
12673 main (void)
12674 {
12675
12676   ;
12677   return 0;
12678 }
12679 _ACEOF
12680 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12681 if { (eval echo "$as_me:12681: \"$ac_link\"") >&5
12682   (eval $ac_link) 2>&5
12683   ac_status=$?
12684   echo "$as_me:12684: \$? = $ac_status" >&5
12685   (exit "$ac_status"); } &&
12686          { ac_try='test -s "conftest$ac_exeext"'
12687   { (eval echo "$as_me:12687: \"$ac_try\"") >&5
12688   (eval $ac_try) 2>&5
12689   ac_status=$?
12690   echo "$as_me:12690: \$? = $ac_status" >&5
12691   (exit "$ac_status"); }; }; then
12692   ac_R_space=yes
12693 else
12694   echo "$as_me: failed program was:" >&5
12695 cat "conftest.$ac_ext" >&5
12696 ac_R_space=no
12697 fi
12698 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12699         if test $ac_R_space = yes; then
12700           echo "$as_me:12700: result: yes" >&5
12701 echo "${ECHO_T}yes" >&6
12702           X_LIBS="$X_LIBS -R $x_libraries"
12703         else
12704           echo "$as_me:12704: result: neither works" >&5
12705 echo "${ECHO_T}neither works" >&6
12706         fi
12707       fi
12708       LIBS=$ac_xsave_LIBS
12709     esac
12710   fi
12711
12712   # Check for system-dependent libraries X programs must link with.
12713   # Do this before checking for the system-independent R6 libraries
12714   # (-lICE), since we may need -lsocket or whatever for X linking.
12715
12716   if test "$ISC" = yes; then
12717     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
12718   else
12719     # Martyn Johnson says this is needed for Ultrix, if the X
12720     # libraries were built with DECnet support.  And Karl Berry says
12721     # the Alpha needs dnet_stub (dnet does not exist).
12722     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
12723     cat >"conftest.$ac_ext" <<_ACEOF
12724 #line 12724 "configure"
12725 #include "confdefs.h"
12726
12727 /* Override any gcc2 internal prototype to avoid an error.  */
12728 #ifdef __cplusplus
12729 extern "C"
12730 #endif
12731 /* We use char because int might match the return type of a gcc2
12732    builtin and then its argument prototype would still apply.  */
12733 char XOpenDisplay ();
12734 int
12735 main (void)
12736 {
12737 XOpenDisplay ();
12738   ;
12739   return 0;
12740 }
12741 _ACEOF
12742 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12743 if { (eval echo "$as_me:12743: \"$ac_link\"") >&5
12744   (eval $ac_link) 2>&5
12745   ac_status=$?
12746   echo "$as_me:12746: \$? = $ac_status" >&5
12747   (exit "$ac_status"); } &&
12748          { ac_try='test -s "conftest$ac_exeext"'
12749   { (eval echo "$as_me:12749: \"$ac_try\"") >&5
12750   (eval $ac_try) 2>&5
12751   ac_status=$?
12752   echo "$as_me:12752: \$? = $ac_status" >&5
12753   (exit "$ac_status"); }; }; then
12754   :
12755 else
12756   echo "$as_me: failed program was:" >&5
12757 cat "conftest.$ac_ext" >&5
12758 echo "$as_me:12758: checking for dnet_ntoa in -ldnet" >&5
12759 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
12760 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
12761   echo $ECHO_N "(cached) $ECHO_C" >&6
12762 else
12763   ac_check_lib_save_LIBS=$LIBS
12764 LIBS="-ldnet  $LIBS"
12765 cat >"conftest.$ac_ext" <<_ACEOF
12766 #line 12766 "configure"
12767 #include "confdefs.h"
12768
12769 /* Override any gcc2 internal prototype to avoid an error.  */
12770 #ifdef __cplusplus
12771 extern "C"
12772 #endif
12773 /* We use char because int might match the return type of a gcc2
12774    builtin and then its argument prototype would still apply.  */
12775 char dnet_ntoa ();
12776 int
12777 main (void)
12778 {
12779 dnet_ntoa ();
12780   ;
12781   return 0;
12782 }
12783 _ACEOF
12784 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12785 if { (eval echo "$as_me:12785: \"$ac_link\"") >&5
12786   (eval $ac_link) 2>&5
12787   ac_status=$?
12788   echo "$as_me:12788: \$? = $ac_status" >&5
12789   (exit "$ac_status"); } &&
12790          { ac_try='test -s "conftest$ac_exeext"'
12791   { (eval echo "$as_me:12791: \"$ac_try\"") >&5
12792   (eval $ac_try) 2>&5
12793   ac_status=$?
12794   echo "$as_me:12794: \$? = $ac_status" >&5
12795   (exit "$ac_status"); }; }; then
12796   ac_cv_lib_dnet_dnet_ntoa=yes
12797 else
12798   echo "$as_me: failed program was:" >&5
12799 cat "conftest.$ac_ext" >&5
12800 ac_cv_lib_dnet_dnet_ntoa=no
12801 fi
12802 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12803 LIBS=$ac_check_lib_save_LIBS
12804 fi
12805 echo "$as_me:12805: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12806 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12807 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
12808   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12809 fi
12810
12811     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12812       echo "$as_me:12812: checking for dnet_ntoa in -ldnet_stub" >&5
12813 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12814 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12815   echo $ECHO_N "(cached) $ECHO_C" >&6
12816 else
12817   ac_check_lib_save_LIBS=$LIBS
12818 LIBS="-ldnet_stub  $LIBS"
12819 cat >"conftest.$ac_ext" <<_ACEOF
12820 #line 12820 "configure"
12821 #include "confdefs.h"
12822
12823 /* Override any gcc2 internal prototype to avoid an error.  */
12824 #ifdef __cplusplus
12825 extern "C"
12826 #endif
12827 /* We use char because int might match the return type of a gcc2
12828    builtin and then its argument prototype would still apply.  */
12829 char dnet_ntoa ();
12830 int
12831 main (void)
12832 {
12833 dnet_ntoa ();
12834   ;
12835   return 0;
12836 }
12837 _ACEOF
12838 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12839 if { (eval echo "$as_me:12839: \"$ac_link\"") >&5
12840   (eval $ac_link) 2>&5
12841   ac_status=$?
12842   echo "$as_me:12842: \$? = $ac_status" >&5
12843   (exit "$ac_status"); } &&
12844          { ac_try='test -s "conftest$ac_exeext"'
12845   { (eval echo "$as_me:12845: \"$ac_try\"") >&5
12846   (eval $ac_try) 2>&5
12847   ac_status=$?
12848   echo "$as_me:12848: \$? = $ac_status" >&5
12849   (exit "$ac_status"); }; }; then
12850   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12851 else
12852   echo "$as_me: failed program was:" >&5
12853 cat "conftest.$ac_ext" >&5
12854 ac_cv_lib_dnet_stub_dnet_ntoa=no
12855 fi
12856 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12857 LIBS=$ac_check_lib_save_LIBS
12858 fi
12859 echo "$as_me:12859: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12860 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12861 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
12862   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12863 fi
12864
12865     fi
12866 fi
12867 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12868     LIBS="$ac_xsave_LIBS"
12869
12870     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12871     # to get the SysV transport functions.
12872     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12873     # needs -lnsl.
12874     # The nsl library prevents programs from opening the X display
12875     # on Irix 5.2, according to T.E. Dickey.
12876     # The functions gethostbyname, getservbyname, and inet_addr are
12877     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12878     echo "$as_me:12878: checking for gethostbyname" >&5
12879 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12880 if test "${ac_cv_func_gethostbyname+set}" = set; then
12881   echo $ECHO_N "(cached) $ECHO_C" >&6
12882 else
12883   cat >"conftest.$ac_ext" <<_ACEOF
12884 #line 12884 "configure"
12885 #include "confdefs.h"
12886 #define gethostbyname autoconf_temporary
12887 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12888 #undef gethostbyname
12889
12890 #ifdef __cplusplus
12891 extern "C"
12892 #endif
12893
12894 /* We use char because int might match the return type of a gcc2
12895    builtin and then its argument prototype would still apply.  */
12896 char gethostbyname (void);
12897
12898 int
12899 main (void)
12900 {
12901
12902 /* The GNU C library defines stubs for functions which it implements
12903     to always fail with ENOSYS.  Some functions are actually named
12904     something starting with __ and the normal name is an alias.  */
12905 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12906 #error found stub for gethostbyname
12907 #endif
12908
12909         return gethostbyname ();
12910   ;
12911   return 0;
12912 }
12913 _ACEOF
12914 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12915 if { (eval echo "$as_me:12915: \"$ac_link\"") >&5
12916   (eval $ac_link) 2>&5
12917   ac_status=$?
12918   echo "$as_me:12918: \$? = $ac_status" >&5
12919   (exit "$ac_status"); } &&
12920          { ac_try='test -s "conftest$ac_exeext"'
12921   { (eval echo "$as_me:12921: \"$ac_try\"") >&5
12922   (eval $ac_try) 2>&5
12923   ac_status=$?
12924   echo "$as_me:12924: \$? = $ac_status" >&5
12925   (exit "$ac_status"); }; }; then
12926   ac_cv_func_gethostbyname=yes
12927 else
12928   echo "$as_me: failed program was:" >&5
12929 cat "conftest.$ac_ext" >&5
12930 ac_cv_func_gethostbyname=no
12931 fi
12932 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12933 fi
12934 echo "$as_me:12934: result: $ac_cv_func_gethostbyname" >&5
12935 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12936
12937     if test $ac_cv_func_gethostbyname = no; then
12938       echo "$as_me:12938: checking for gethostbyname in -lnsl" >&5
12939 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12940 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12941   echo $ECHO_N "(cached) $ECHO_C" >&6
12942 else
12943   ac_check_lib_save_LIBS=$LIBS
12944 LIBS="-lnsl  $LIBS"
12945 cat >"conftest.$ac_ext" <<_ACEOF
12946 #line 12946 "configure"
12947 #include "confdefs.h"
12948
12949 /* Override any gcc2 internal prototype to avoid an error.  */
12950 #ifdef __cplusplus
12951 extern "C"
12952 #endif
12953 /* We use char because int might match the return type of a gcc2
12954    builtin and then its argument prototype would still apply.  */
12955 char gethostbyname ();
12956 int
12957 main (void)
12958 {
12959 gethostbyname ();
12960   ;
12961   return 0;
12962 }
12963 _ACEOF
12964 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12965 if { (eval echo "$as_me:12965: \"$ac_link\"") >&5
12966   (eval $ac_link) 2>&5
12967   ac_status=$?
12968   echo "$as_me:12968: \$? = $ac_status" >&5
12969   (exit "$ac_status"); } &&
12970          { ac_try='test -s "conftest$ac_exeext"'
12971   { (eval echo "$as_me:12971: \"$ac_try\"") >&5
12972   (eval $ac_try) 2>&5
12973   ac_status=$?
12974   echo "$as_me:12974: \$? = $ac_status" >&5
12975   (exit "$ac_status"); }; }; then
12976   ac_cv_lib_nsl_gethostbyname=yes
12977 else
12978   echo "$as_me: failed program was:" >&5
12979 cat "conftest.$ac_ext" >&5
12980 ac_cv_lib_nsl_gethostbyname=no
12981 fi
12982 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12983 LIBS=$ac_check_lib_save_LIBS
12984 fi
12985 echo "$as_me:12985: result: $ac_cv_lib_nsl_gethostbyname" >&5
12986 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12987 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
12988   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12989 fi
12990
12991       if test $ac_cv_lib_nsl_gethostbyname = no; then
12992         echo "$as_me:12992: checking for gethostbyname in -lbsd" >&5
12993 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12994 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12995   echo $ECHO_N "(cached) $ECHO_C" >&6
12996 else
12997   ac_check_lib_save_LIBS=$LIBS
12998 LIBS="-lbsd  $LIBS"
12999 cat >"conftest.$ac_ext" <<_ACEOF
13000 #line 13000 "configure"
13001 #include "confdefs.h"
13002
13003 /* Override any gcc2 internal prototype to avoid an error.  */
13004 #ifdef __cplusplus
13005 extern "C"
13006 #endif
13007 /* We use char because int might match the return type of a gcc2
13008    builtin and then its argument prototype would still apply.  */
13009 char gethostbyname ();
13010 int
13011 main (void)
13012 {
13013 gethostbyname ();
13014   ;
13015   return 0;
13016 }
13017 _ACEOF
13018 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13019 if { (eval echo "$as_me:13019: \"$ac_link\"") >&5
13020   (eval $ac_link) 2>&5
13021   ac_status=$?
13022   echo "$as_me:13022: \$? = $ac_status" >&5
13023   (exit "$ac_status"); } &&
13024          { ac_try='test -s "conftest$ac_exeext"'
13025   { (eval echo "$as_me:13025: \"$ac_try\"") >&5
13026   (eval $ac_try) 2>&5
13027   ac_status=$?
13028   echo "$as_me:13028: \$? = $ac_status" >&5
13029   (exit "$ac_status"); }; }; then
13030   ac_cv_lib_bsd_gethostbyname=yes
13031 else
13032   echo "$as_me: failed program was:" >&5
13033 cat "conftest.$ac_ext" >&5
13034 ac_cv_lib_bsd_gethostbyname=no
13035 fi
13036 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13037 LIBS=$ac_check_lib_save_LIBS
13038 fi
13039 echo "$as_me:13039: result: $ac_cv_lib_bsd_gethostbyname" >&5
13040 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
13041 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
13042   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
13043 fi
13044
13045       fi
13046     fi
13047
13048     # lieder@skyler.mavd.honeywell.com says without -lsocket,
13049     # socket/setsockopt and other routines are undefined under SCO ODT
13050     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
13051     # on later versions), says Simon Leinen: it contains gethostby*
13052     # variants that don't use the nameserver (or something).  -lsocket
13053     # must be given before -lnsl if both are needed.  We assume that
13054     # if connect needs -lnsl, so does gethostbyname.
13055     echo "$as_me:13055: checking for connect" >&5
13056 echo $ECHO_N "checking for connect... $ECHO_C" >&6
13057 if test "${ac_cv_func_connect+set}" = set; then
13058   echo $ECHO_N "(cached) $ECHO_C" >&6
13059 else
13060   cat >"conftest.$ac_ext" <<_ACEOF
13061 #line 13061 "configure"
13062 #include "confdefs.h"
13063 #define connect autoconf_temporary
13064 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13065 #undef connect
13066
13067 #ifdef __cplusplus
13068 extern "C"
13069 #endif
13070
13071 /* We use char because int might match the return type of a gcc2
13072    builtin and then its argument prototype would still apply.  */
13073 char connect (void);
13074
13075 int
13076 main (void)
13077 {
13078
13079 /* The GNU C library defines stubs for functions which it implements
13080     to always fail with ENOSYS.  Some functions are actually named
13081     something starting with __ and the normal name is an alias.  */
13082 #if defined (__stub_connect) || defined (__stub___connect)
13083 #error found stub for connect
13084 #endif
13085
13086         return connect ();
13087   ;
13088   return 0;
13089 }
13090 _ACEOF
13091 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13092 if { (eval echo "$as_me:13092: \"$ac_link\"") >&5
13093   (eval $ac_link) 2>&5
13094   ac_status=$?
13095   echo "$as_me:13095: \$? = $ac_status" >&5
13096   (exit "$ac_status"); } &&
13097          { ac_try='test -s "conftest$ac_exeext"'
13098   { (eval echo "$as_me:13098: \"$ac_try\"") >&5
13099   (eval $ac_try) 2>&5
13100   ac_status=$?
13101   echo "$as_me:13101: \$? = $ac_status" >&5
13102   (exit "$ac_status"); }; }; then
13103   ac_cv_func_connect=yes
13104 else
13105   echo "$as_me: failed program was:" >&5
13106 cat "conftest.$ac_ext" >&5
13107 ac_cv_func_connect=no
13108 fi
13109 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13110 fi
13111 echo "$as_me:13111: result: $ac_cv_func_connect" >&5
13112 echo "${ECHO_T}$ac_cv_func_connect" >&6
13113
13114     if test $ac_cv_func_connect = no; then
13115       echo "$as_me:13115: checking for connect in -lsocket" >&5
13116 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
13117 if test "${ac_cv_lib_socket_connect+set}" = set; then
13118   echo $ECHO_N "(cached) $ECHO_C" >&6
13119 else
13120   ac_check_lib_save_LIBS=$LIBS
13121 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
13122 cat >"conftest.$ac_ext" <<_ACEOF
13123 #line 13123 "configure"
13124 #include "confdefs.h"
13125
13126 /* Override any gcc2 internal prototype to avoid an error.  */
13127 #ifdef __cplusplus
13128 extern "C"
13129 #endif
13130 /* We use char because int might match the return type of a gcc2
13131    builtin and then its argument prototype would still apply.  */
13132 char connect ();
13133 int
13134 main (void)
13135 {
13136 connect ();
13137   ;
13138   return 0;
13139 }
13140 _ACEOF
13141 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13142 if { (eval echo "$as_me:13142: \"$ac_link\"") >&5
13143   (eval $ac_link) 2>&5
13144   ac_status=$?
13145   echo "$as_me:13145: \$? = $ac_status" >&5
13146   (exit "$ac_status"); } &&
13147          { ac_try='test -s "conftest$ac_exeext"'
13148   { (eval echo "$as_me:13148: \"$ac_try\"") >&5
13149   (eval $ac_try) 2>&5
13150   ac_status=$?
13151   echo "$as_me:13151: \$? = $ac_status" >&5
13152   (exit "$ac_status"); }; }; then
13153   ac_cv_lib_socket_connect=yes
13154 else
13155   echo "$as_me: failed program was:" >&5
13156 cat "conftest.$ac_ext" >&5
13157 ac_cv_lib_socket_connect=no
13158 fi
13159 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13160 LIBS=$ac_check_lib_save_LIBS
13161 fi
13162 echo "$as_me:13162: result: $ac_cv_lib_socket_connect" >&5
13163 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
13164 if test "$ac_cv_lib_socket_connect" = yes; then
13165   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
13166 fi
13167
13168     fi
13169
13170     # Guillermo Gomez says -lposix is necessary on A/UX.
13171     echo "$as_me:13171: checking for remove" >&5
13172 echo $ECHO_N "checking for remove... $ECHO_C" >&6
13173 if test "${ac_cv_func_remove+set}" = set; then
13174   echo $ECHO_N "(cached) $ECHO_C" >&6
13175 else
13176   cat >"conftest.$ac_ext" <<_ACEOF
13177 #line 13177 "configure"
13178 #include "confdefs.h"
13179 #define remove autoconf_temporary
13180 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13181 #undef remove
13182
13183 #ifdef __cplusplus
13184 extern "C"
13185 #endif
13186
13187 /* We use char because int might match the return type of a gcc2
13188    builtin and then its argument prototype would still apply.  */
13189 char remove (void);
13190
13191 int
13192 main (void)
13193 {
13194
13195 /* The GNU C library defines stubs for functions which it implements
13196     to always fail with ENOSYS.  Some functions are actually named
13197     something starting with __ and the normal name is an alias.  */
13198 #if defined (__stub_remove) || defined (__stub___remove)
13199 #error found stub for remove
13200 #endif
13201
13202         return remove ();
13203   ;
13204   return 0;
13205 }
13206 _ACEOF
13207 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13208 if { (eval echo "$as_me:13208: \"$ac_link\"") >&5
13209   (eval $ac_link) 2>&5
13210   ac_status=$?
13211   echo "$as_me:13211: \$? = $ac_status" >&5
13212   (exit "$ac_status"); } &&
13213          { ac_try='test -s "conftest$ac_exeext"'
13214   { (eval echo "$as_me:13214: \"$ac_try\"") >&5
13215   (eval $ac_try) 2>&5
13216   ac_status=$?
13217   echo "$as_me:13217: \$? = $ac_status" >&5
13218   (exit "$ac_status"); }; }; then
13219   ac_cv_func_remove=yes
13220 else
13221   echo "$as_me: failed program was:" >&5
13222 cat "conftest.$ac_ext" >&5
13223 ac_cv_func_remove=no
13224 fi
13225 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13226 fi
13227 echo "$as_me:13227: result: $ac_cv_func_remove" >&5
13228 echo "${ECHO_T}$ac_cv_func_remove" >&6
13229
13230     if test $ac_cv_func_remove = no; then
13231       echo "$as_me:13231: checking for remove in -lposix" >&5
13232 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
13233 if test "${ac_cv_lib_posix_remove+set}" = set; then
13234   echo $ECHO_N "(cached) $ECHO_C" >&6
13235 else
13236   ac_check_lib_save_LIBS=$LIBS
13237 LIBS="-lposix  $LIBS"
13238 cat >"conftest.$ac_ext" <<_ACEOF
13239 #line 13239 "configure"
13240 #include "confdefs.h"
13241
13242 /* Override any gcc2 internal prototype to avoid an error.  */
13243 #ifdef __cplusplus
13244 extern "C"
13245 #endif
13246 /* We use char because int might match the return type of a gcc2
13247    builtin and then its argument prototype would still apply.  */
13248 char remove ();
13249 int
13250 main (void)
13251 {
13252 remove ();
13253   ;
13254   return 0;
13255 }
13256 _ACEOF
13257 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13258 if { (eval echo "$as_me:13258: \"$ac_link\"") >&5
13259   (eval $ac_link) 2>&5
13260   ac_status=$?
13261   echo "$as_me:13261: \$? = $ac_status" >&5
13262   (exit "$ac_status"); } &&
13263          { ac_try='test -s "conftest$ac_exeext"'
13264   { (eval echo "$as_me:13264: \"$ac_try\"") >&5
13265   (eval $ac_try) 2>&5
13266   ac_status=$?
13267   echo "$as_me:13267: \$? = $ac_status" >&5
13268   (exit "$ac_status"); }; }; then
13269   ac_cv_lib_posix_remove=yes
13270 else
13271   echo "$as_me: failed program was:" >&5
13272 cat "conftest.$ac_ext" >&5
13273 ac_cv_lib_posix_remove=no
13274 fi
13275 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13276 LIBS=$ac_check_lib_save_LIBS
13277 fi
13278 echo "$as_me:13278: result: $ac_cv_lib_posix_remove" >&5
13279 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
13280 if test "$ac_cv_lib_posix_remove" = yes; then
13281   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
13282 fi
13283
13284     fi
13285
13286     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
13287     echo "$as_me:13287: checking for shmat" >&5
13288 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
13289 if test "${ac_cv_func_shmat+set}" = set; then
13290   echo $ECHO_N "(cached) $ECHO_C" >&6
13291 else
13292   cat >"conftest.$ac_ext" <<_ACEOF
13293 #line 13293 "configure"
13294 #include "confdefs.h"
13295 #define shmat autoconf_temporary
13296 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13297 #undef shmat
13298
13299 #ifdef __cplusplus
13300 extern "C"
13301 #endif
13302
13303 /* We use char because int might match the return type of a gcc2
13304    builtin and then its argument prototype would still apply.  */
13305 char shmat (void);
13306
13307 int
13308 main (void)
13309 {
13310
13311 /* The GNU C library defines stubs for functions which it implements
13312     to always fail with ENOSYS.  Some functions are actually named
13313     something starting with __ and the normal name is an alias.  */
13314 #if defined (__stub_shmat) || defined (__stub___shmat)
13315 #error found stub for shmat
13316 #endif
13317
13318         return shmat ();
13319   ;
13320   return 0;
13321 }
13322 _ACEOF
13323 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13324 if { (eval echo "$as_me:13324: \"$ac_link\"") >&5
13325   (eval $ac_link) 2>&5
13326   ac_status=$?
13327   echo "$as_me:13327: \$? = $ac_status" >&5
13328   (exit "$ac_status"); } &&
13329          { ac_try='test -s "conftest$ac_exeext"'
13330   { (eval echo "$as_me:13330: \"$ac_try\"") >&5
13331   (eval $ac_try) 2>&5
13332   ac_status=$?
13333   echo "$as_me:13333: \$? = $ac_status" >&5
13334   (exit "$ac_status"); }; }; then
13335   ac_cv_func_shmat=yes
13336 else
13337   echo "$as_me: failed program was:" >&5
13338 cat "conftest.$ac_ext" >&5
13339 ac_cv_func_shmat=no
13340 fi
13341 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13342 fi
13343 echo "$as_me:13343: result: $ac_cv_func_shmat" >&5
13344 echo "${ECHO_T}$ac_cv_func_shmat" >&6
13345
13346     if test $ac_cv_func_shmat = no; then
13347       echo "$as_me:13347: checking for shmat in -lipc" >&5
13348 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
13349 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
13350   echo $ECHO_N "(cached) $ECHO_C" >&6
13351 else
13352   ac_check_lib_save_LIBS=$LIBS
13353 LIBS="-lipc  $LIBS"
13354 cat >"conftest.$ac_ext" <<_ACEOF
13355 #line 13355 "configure"
13356 #include "confdefs.h"
13357
13358 /* Override any gcc2 internal prototype to avoid an error.  */
13359 #ifdef __cplusplus
13360 extern "C"
13361 #endif
13362 /* We use char because int might match the return type of a gcc2
13363    builtin and then its argument prototype would still apply.  */
13364 char shmat ();
13365 int
13366 main (void)
13367 {
13368 shmat ();
13369   ;
13370   return 0;
13371 }
13372 _ACEOF
13373 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13374 if { (eval echo "$as_me:13374: \"$ac_link\"") >&5
13375   (eval $ac_link) 2>&5
13376   ac_status=$?
13377   echo "$as_me:13377: \$? = $ac_status" >&5
13378   (exit "$ac_status"); } &&
13379          { ac_try='test -s "conftest$ac_exeext"'
13380   { (eval echo "$as_me:13380: \"$ac_try\"") >&5
13381   (eval $ac_try) 2>&5
13382   ac_status=$?
13383   echo "$as_me:13383: \$? = $ac_status" >&5
13384   (exit "$ac_status"); }; }; then
13385   ac_cv_lib_ipc_shmat=yes
13386 else
13387   echo "$as_me: failed program was:" >&5
13388 cat "conftest.$ac_ext" >&5
13389 ac_cv_lib_ipc_shmat=no
13390 fi
13391 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13392 LIBS=$ac_check_lib_save_LIBS
13393 fi
13394 echo "$as_me:13394: result: $ac_cv_lib_ipc_shmat" >&5
13395 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
13396 if test "$ac_cv_lib_ipc_shmat" = yes; then
13397   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
13398 fi
13399
13400     fi
13401   fi
13402
13403   # Check for libraries that X11R6 Xt/Xaw programs need.
13404   ac_save_LDFLAGS=$LDFLAGS
13405   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
13406   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
13407   # check for ICE first), but we must link in the order -lSM -lICE or
13408   # we get undefined symbols.  So assume we have SM if we have ICE.
13409   # These have to be linked with before -lX11, unlike the other
13410   # libraries we check for below, so use a different variable.
13411   # John Interrante, Karl Berry
13412   echo "$as_me:13412: checking for IceConnectionNumber in -lICE" >&5
13413 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
13414 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
13415   echo $ECHO_N "(cached) $ECHO_C" >&6
13416 else
13417   ac_check_lib_save_LIBS=$LIBS
13418 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
13419 cat >"conftest.$ac_ext" <<_ACEOF
13420 #line 13420 "configure"
13421 #include "confdefs.h"
13422
13423 /* Override any gcc2 internal prototype to avoid an error.  */
13424 #ifdef __cplusplus
13425 extern "C"
13426 #endif
13427 /* We use char because int might match the return type of a gcc2
13428    builtin and then its argument prototype would still apply.  */
13429 char IceConnectionNumber ();
13430 int
13431 main (void)
13432 {
13433 IceConnectionNumber ();
13434   ;
13435   return 0;
13436 }
13437 _ACEOF
13438 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13439 if { (eval echo "$as_me:13439: \"$ac_link\"") >&5
13440   (eval $ac_link) 2>&5
13441   ac_status=$?
13442   echo "$as_me:13442: \$? = $ac_status" >&5
13443   (exit "$ac_status"); } &&
13444          { ac_try='test -s "conftest$ac_exeext"'
13445   { (eval echo "$as_me:13445: \"$ac_try\"") >&5
13446   (eval $ac_try) 2>&5
13447   ac_status=$?
13448   echo "$as_me:13448: \$? = $ac_status" >&5
13449   (exit "$ac_status"); }; }; then
13450   ac_cv_lib_ICE_IceConnectionNumber=yes
13451 else
13452   echo "$as_me: failed program was:" >&5
13453 cat "conftest.$ac_ext" >&5
13454 ac_cv_lib_ICE_IceConnectionNumber=no
13455 fi
13456 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13457 LIBS=$ac_check_lib_save_LIBS
13458 fi
13459 echo "$as_me:13459: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
13460 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
13461 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
13462   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
13463 fi
13464
13465   LDFLAGS=$ac_save_LDFLAGS
13466
13467 fi
13468
13469 cf_x_athena=${cf_x_athena:-Xaw}
13470
13471 echo "$as_me:13471: checking if you want to link with Xaw 3d library" >&5
13472 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
13473 withval=
13474
13475 # Check whether --with-Xaw3d or --without-Xaw3d was given.
13476 if test "${with_Xaw3d+set}" = set; then
13477   withval="$with_Xaw3d"
13478
13479 fi;
13480 if test "$withval" = yes ; then
13481         cf_x_athena=Xaw3d
13482         echo "$as_me:13482: result: yes" >&5
13483 echo "${ECHO_T}yes" >&6
13484 else
13485         echo "$as_me:13485: result: no" >&5
13486 echo "${ECHO_T}no" >&6
13487 fi
13488
13489 echo "$as_me:13489: checking if you want to link with Xaw 3d xft library" >&5
13490 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
13491 withval=
13492
13493 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
13494 if test "${with_Xaw3dxft+set}" = set; then
13495   withval="$with_Xaw3dxft"
13496
13497 fi;
13498 if test "$withval" = yes ; then
13499         cf_x_athena=Xaw3dxft
13500         echo "$as_me:13500: result: yes" >&5
13501 echo "${ECHO_T}yes" >&6
13502 else
13503         echo "$as_me:13503: result: no" >&5
13504 echo "${ECHO_T}no" >&6
13505 fi
13506
13507 echo "$as_me:13507: checking if you want to link with neXT Athena library" >&5
13508 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
13509 withval=
13510
13511 # Check whether --with-neXtaw or --without-neXtaw was given.
13512 if test "${with_neXtaw+set}" = set; then
13513   withval="$with_neXtaw"
13514
13515 fi;
13516 if test "$withval" = yes ; then
13517         cf_x_athena=neXtaw
13518         echo "$as_me:13518: result: yes" >&5
13519 echo "${ECHO_T}yes" >&6
13520 else
13521         echo "$as_me:13521: result: no" >&5
13522 echo "${ECHO_T}no" >&6
13523 fi
13524
13525 echo "$as_me:13525: checking if you want to link with Athena-Plus library" >&5
13526 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
13527 withval=
13528
13529 # Check whether --with-XawPlus or --without-XawPlus was given.
13530 if test "${with_XawPlus+set}" = set; then
13531   withval="$with_XawPlus"
13532
13533 fi;
13534 if test "$withval" = yes ; then
13535         cf_x_athena=XawPlus
13536         echo "$as_me:13536: result: yes" >&5
13537 echo "${ECHO_T}yes" >&6
13538 else
13539         echo "$as_me:13539: result: no" >&5
13540 echo "${ECHO_T}no" >&6
13541 fi
13542
13543 cf_x_athena_lib=""
13544
13545 if test "$PKG_CONFIG" != none ; then
13546         cf_athena_list=
13547         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
13548         for cf_athena_pkg in \
13549                 $cf_athena_list \
13550                 ${cf_x_athena} \
13551                 ${cf_x_athena}-devel \
13552                 lib${cf_x_athena} \
13553                 lib${cf_x_athena}-devel
13554         do
13555
13556 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_athena_pkg"; then
13557         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
13558
13559 echo "${as_me:-configure}:13559: testing found package $cf_athena_pkg ..." 1>&5
13560
13561         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$cf_athena_pkg" 2>/dev/null`"
13562         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "$cf_athena_pkg" 2>/dev/null`"
13563         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
13564
13565 echo "${as_me:-configure}:13565: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13566
13567         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
13568
13569 echo "${as_me:-configure}:13569: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
13570
13571 cf_fix_cppflags=no
13572 cf_new_cflags=
13573 cf_new_cppflags=
13574 cf_new_extra_cppflags=
13575
13576 for cf_add_cflags in $cf_pkgconfig_incs
13577 do
13578 case "$cf_fix_cppflags" in
13579 (no)
13580         case "$cf_add_cflags" in
13581         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13582                 case "$cf_add_cflags" in
13583                 (-D*)
13584                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13585
13586                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13587                                 && test -z "${cf_tst_cflags}" \
13588                                 && cf_fix_cppflags=yes
13589
13590                         if test "$cf_fix_cppflags" = yes ; then
13591
13592         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13593         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13594
13595                                 continue
13596                         elif test "${cf_tst_cflags}" = "\"'" ; then
13597
13598         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13599         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13600
13601                                 continue
13602                         fi
13603                         ;;
13604                 esac
13605                 case "$CPPFLAGS" in
13606                 (*$cf_add_cflags)
13607                         ;;
13608                 (*)
13609                         case "$cf_add_cflags" in
13610                         (-D*)
13611                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13612
13613 CPPFLAGS=`echo "$CPPFLAGS" | \
13614         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13615                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13616
13617                                 ;;
13618                         esac
13619
13620         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13621         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13622
13623                         ;;
13624                 esac
13625                 ;;
13626         (*)
13627
13628         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13629         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13630
13631                 ;;
13632         esac
13633         ;;
13634 (yes)
13635
13636         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13637         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13638
13639         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13640
13641         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13642                 && test -z "${cf_tst_cflags}" \
13643                 && cf_fix_cppflags=no
13644         ;;
13645 esac
13646 done
13647
13648 if test -n "$cf_new_cflags" ; then
13649
13650         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13651         CFLAGS="${CFLAGS}$cf_new_cflags"
13652
13653 fi
13654
13655 if test -n "$cf_new_cppflags" ; then
13656
13657         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13658         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13659
13660 fi
13661
13662 if test -n "$cf_new_extra_cppflags" ; then
13663
13664         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13665         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13666
13667 fi
13668
13669 cf_add_libs="$LIBS"
13670 # reverse order
13671 cf_add_0lib=
13672 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13673 # filter duplicates
13674 for cf_add_1lib in $cf_add_0lib; do
13675         for cf_add_2lib in $cf_add_libs; do
13676                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13677                         cf_add_1lib=
13678                         break
13679                 fi
13680         done
13681         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13682 done
13683 LIBS="$cf_add_libs"
13684
13685                         cf_x_athena_lib="$cf_pkgconfig_libs"
13686
13687 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13688
13689                         cat >>confdefs.h <<EOF
13690 #define $cf_x_athena_LIBS 1
13691 EOF
13692
13693         for cf_trim_lib in Xmu Xt X11
13694         do
13695                 case "$LIBS" in
13696                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13697                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13698                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13699
13700 echo "${as_me:-configure}:13700: testing ..trimmed $LIBS ..." 1>&5
13701
13702                         ;;
13703                 esac
13704         done
13705
13706 echo "$as_me:13706: checking for usable $cf_x_athena/Xmu package" >&5
13707 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
13708 if test "${cf_cv_xaw_compat+set}" = set; then
13709   echo $ECHO_N "(cached) $ECHO_C" >&6
13710 else
13711
13712 cat >"conftest.$ac_ext" <<_ACEOF
13713 #line 13713 "configure"
13714 #include "confdefs.h"
13715
13716 #include <X11/Xmu/CharSet.h>
13717
13718 int
13719 main (void)
13720 {
13721
13722 int check = XmuCompareISOLatin1("big", "small");
13723 (void)check;
13724
13725   ;
13726   return 0;
13727 }
13728 _ACEOF
13729 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13730 if { (eval echo "$as_me:13730: \"$ac_link\"") >&5
13731   (eval $ac_link) 2>&5
13732   ac_status=$?
13733   echo "$as_me:13733: \$? = $ac_status" >&5
13734   (exit "$ac_status"); } &&
13735          { ac_try='test -s "conftest$ac_exeext"'
13736   { (eval echo "$as_me:13736: \"$ac_try\"") >&5
13737   (eval $ac_try) 2>&5
13738   ac_status=$?
13739   echo "$as_me:13739: \$? = $ac_status" >&5
13740   (exit "$ac_status"); }; }; then
13741   cf_cv_xaw_compat=yes
13742 else
13743   echo "$as_me: failed program was:" >&5
13744 cat "conftest.$ac_ext" >&5
13745 cf_cv_xaw_compat=no
13746 fi
13747 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13748 fi
13749 echo "$as_me:13749: result: $cf_cv_xaw_compat" >&5
13750 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
13751
13752                         if test "$cf_cv_xaw_compat" = no
13753                         then
13754                                 # workaround for broken ".pc" files...
13755                                 case "$cf_x_athena_lib" in
13756                                 (*-lXmu*)
13757                                         ;;
13758                                 (*)
13759                                         test -n "$verbose" && echo "    work around broken package" 1>&6
13760
13761 echo "${as_me:-configure}:13761: testing work around broken package ..." 1>&5
13762
13763                                         cf_save_xmu="$LIBS"
13764                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
13765
13766 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xmu"; then
13767         test -n "$verbose" && echo "    found package xmu" 1>&6
13768
13769 echo "${as_me:-configure}:13769: testing found package xmu ..." 1>&5
13770
13771         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xmu" 2>/dev/null`"
13772         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xmu" 2>/dev/null`"
13773         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
13774
13775 echo "${as_me:-configure}:13775: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13776
13777         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
13778
13779 echo "${as_me:-configure}:13779: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
13780
13781 cf_fix_cppflags=no
13782 cf_new_cflags=
13783 cf_new_cppflags=
13784 cf_new_extra_cppflags=
13785
13786 for cf_add_cflags in $cf_pkgconfig_incs
13787 do
13788 case "$cf_fix_cppflags" in
13789 (no)
13790         case "$cf_add_cflags" in
13791         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13792                 case "$cf_add_cflags" in
13793                 (-D*)
13794                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13795
13796                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13797                                 && test -z "${cf_tst_cflags}" \
13798                                 && cf_fix_cppflags=yes
13799
13800                         if test "$cf_fix_cppflags" = yes ; then
13801
13802         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13803         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13804
13805                                 continue
13806                         elif test "${cf_tst_cflags}" = "\"'" ; then
13807
13808         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13809         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13810
13811                                 continue
13812                         fi
13813                         ;;
13814                 esac
13815                 case "$CPPFLAGS" in
13816                 (*$cf_add_cflags)
13817                         ;;
13818                 (*)
13819                         case "$cf_add_cflags" in
13820                         (-D*)
13821                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13822
13823 CPPFLAGS=`echo "$CPPFLAGS" | \
13824         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13825                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13826
13827                                 ;;
13828                         esac
13829
13830         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13831         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13832
13833                         ;;
13834                 esac
13835                 ;;
13836         (*)
13837
13838         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13839         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13840
13841                 ;;
13842         esac
13843         ;;
13844 (yes)
13845
13846         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13847         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13848
13849         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13850
13851         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13852                 && test -z "${cf_tst_cflags}" \
13853                 && cf_fix_cppflags=no
13854         ;;
13855 esac
13856 done
13857
13858 if test -n "$cf_new_cflags" ; then
13859
13860         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13861         CFLAGS="${CFLAGS}$cf_new_cflags"
13862
13863 fi
13864
13865 if test -n "$cf_new_cppflags" ; then
13866
13867         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13868         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13869
13870 fi
13871
13872 if test -n "$cf_new_extra_cppflags" ; then
13873
13874         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13875         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13876
13877 fi
13878
13879 cf_add_libs="$LIBS"
13880 # reverse order
13881 cf_add_0lib=
13882 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13883 # filter duplicates
13884 for cf_add_1lib in $cf_add_0lib; do
13885         for cf_add_2lib in $cf_add_libs; do
13886                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13887                         cf_add_1lib=
13888                         break
13889                 fi
13890         done
13891         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13892 done
13893 LIBS="$cf_add_libs"
13894
13895                                                         LIBS="$cf_save_xmu"
13896
13897 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13898
13899 echo "${as_me:-configure}:13899: testing ...before $LIBS ..." 1>&5
13900
13901 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13902 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13903
13904 echo "${as_me:-configure}:13904: testing ...after  $LIBS ..." 1>&5
13905
13906 else
13907         cf_pkgconfig_incs=
13908         cf_pkgconfig_libs=
13909
13910 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13911
13912 echo "${as_me:-configure}:13912: testing ...before $LIBS ..." 1>&5
13913
13914 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13915 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13916
13917 echo "${as_me:-configure}:13917: testing ...after  $LIBS ..." 1>&5
13918
13919 fi
13920
13921         for cf_trim_lib in Xmu Xt X11
13922         do
13923                 case "$LIBS" in
13924                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13925                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13926                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13927
13928 echo "${as_me:-configure}:13928: testing ..trimmed $LIBS ..." 1>&5
13929
13930                         ;;
13931                 esac
13932         done
13933
13934                                         ;;
13935                                 esac
13936                         fi
13937
13938                         break
13939 else
13940         cf_pkgconfig_incs=
13941         cf_pkgconfig_libs=
13942         :
13943 fi
13944
13945         done
13946 fi
13947
13948 if test -z "$cf_x_athena_lib" ; then
13949
13950 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "Xext"; then
13951         test -n "$verbose" && echo "    found package Xext" 1>&6
13952
13953 echo "${as_me:-configure}:13953: testing found package Xext ..." 1>&5
13954
13955         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "Xext" 2>/dev/null`"
13956         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "Xext" 2>/dev/null`"
13957         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13958
13959 echo "${as_me:-configure}:13959: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13960
13961         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13962
13963 echo "${as_me:-configure}:13963: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13964
13965 cf_fix_cppflags=no
13966 cf_new_cflags=
13967 cf_new_cppflags=
13968 cf_new_extra_cppflags=
13969
13970 for cf_add_cflags in $cf_pkgconfig_incs
13971 do
13972 case "$cf_fix_cppflags" in
13973 (no)
13974         case "$cf_add_cflags" in
13975         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13976                 case "$cf_add_cflags" in
13977                 (-D*)
13978                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13979
13980                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13981                                 && test -z "${cf_tst_cflags}" \
13982                                 && cf_fix_cppflags=yes
13983
13984                         if test "$cf_fix_cppflags" = yes ; then
13985
13986         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13987         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13988
13989                                 continue
13990                         elif test "${cf_tst_cflags}" = "\"'" ; then
13991
13992         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13993         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13994
13995                                 continue
13996                         fi
13997                         ;;
13998                 esac
13999                 case "$CPPFLAGS" in
14000                 (*$cf_add_cflags)
14001                         ;;
14002                 (*)
14003                         case "$cf_add_cflags" in
14004                         (-D*)
14005                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14006
14007 CPPFLAGS=`echo "$CPPFLAGS" | \
14008         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14009                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14010
14011                                 ;;
14012                         esac
14013
14014         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14015         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14016
14017                         ;;
14018                 esac
14019                 ;;
14020         (*)
14021
14022         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14023         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14024
14025                 ;;
14026         esac
14027         ;;
14028 (yes)
14029
14030         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14031         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14032
14033         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14034
14035         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14036                 && test -z "${cf_tst_cflags}" \
14037                 && cf_fix_cppflags=no
14038         ;;
14039 esac
14040 done
14041
14042 if test -n "$cf_new_cflags" ; then
14043
14044         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14045         CFLAGS="${CFLAGS}$cf_new_cflags"
14046
14047 fi
14048
14049 if test -n "$cf_new_cppflags" ; then
14050
14051         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14052         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14053
14054 fi
14055
14056 if test -n "$cf_new_extra_cppflags" ; then
14057
14058         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14059         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14060
14061 fi
14062
14063 cf_add_libs="$LIBS"
14064 # reverse order
14065 cf_add_0lib=
14066 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14067 # filter duplicates
14068 for cf_add_1lib in $cf_add_0lib; do
14069         for cf_add_2lib in $cf_add_libs; do
14070                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14071                         cf_add_1lib=
14072                         break
14073                 fi
14074         done
14075         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14076 done
14077 LIBS="$cf_add_libs"
14078
14079         :
14080 else
14081         cf_pkgconfig_incs=
14082         cf_pkgconfig_libs=
14083
14084         echo "$as_me:14084: checking for XextCreateExtension in -lXext" >&5
14085 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
14086 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
14087   echo $ECHO_N "(cached) $ECHO_C" >&6
14088 else
14089   ac_check_lib_save_LIBS=$LIBS
14090 LIBS="-lXext  $LIBS"
14091 cat >"conftest.$ac_ext" <<_ACEOF
14092 #line 14092 "configure"
14093 #include "confdefs.h"
14094
14095 /* Override any gcc2 internal prototype to avoid an error.  */
14096 #ifdef __cplusplus
14097 extern "C"
14098 #endif
14099 /* We use char because int might match the return type of a gcc2
14100    builtin and then its argument prototype would still apply.  */
14101 char XextCreateExtension ();
14102 int
14103 main (void)
14104 {
14105 XextCreateExtension ();
14106   ;
14107   return 0;
14108 }
14109 _ACEOF
14110 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14111 if { (eval echo "$as_me:14111: \"$ac_link\"") >&5
14112   (eval $ac_link) 2>&5
14113   ac_status=$?
14114   echo "$as_me:14114: \$? = $ac_status" >&5
14115   (exit "$ac_status"); } &&
14116          { ac_try='test -s "conftest$ac_exeext"'
14117   { (eval echo "$as_me:14117: \"$ac_try\"") >&5
14118   (eval $ac_try) 2>&5
14119   ac_status=$?
14120   echo "$as_me:14120: \$? = $ac_status" >&5
14121   (exit "$ac_status"); }; }; then
14122   ac_cv_lib_Xext_XextCreateExtension=yes
14123 else
14124   echo "$as_me: failed program was:" >&5
14125 cat "conftest.$ac_ext" >&5
14126 ac_cv_lib_Xext_XextCreateExtension=no
14127 fi
14128 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14129 LIBS=$ac_check_lib_save_LIBS
14130 fi
14131 echo "$as_me:14131: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
14132 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
14133 if test "$ac_cv_lib_Xext_XextCreateExtension" = yes; then
14134
14135 cf_add_libs="$LIBS"
14136 # reverse order
14137 cf_add_0lib=
14138 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14139 # filter duplicates
14140 for cf_add_1lib in $cf_add_0lib; do
14141         for cf_add_2lib in $cf_add_libs; do
14142                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14143                         cf_add_1lib=
14144                         break
14145                 fi
14146         done
14147         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14148 done
14149 LIBS="$cf_add_libs"
14150
14151 fi
14152
14153 fi
14154
14155 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
14156 # in some cases has installed dummy files in the former, other cases replaced
14157 # it with a link to the new location).  This complicates the configure script.
14158 # Check for that pitfall, and recover using pkg-config
14159 #
14160 # If none of these are set, the configuration is almost certainly broken.
14161 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
14162 then
14163
14164 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14165         test -n "$verbose" && echo "    found package x11" 1>&6
14166
14167 echo "${as_me:-configure}:14167: testing found package x11 ..." 1>&5
14168
14169         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14170         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14171         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14172
14173 echo "${as_me:-configure}:14173: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14174
14175         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14176
14177 echo "${as_me:-configure}:14177: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14178
14179 cf_fix_cppflags=no
14180 cf_new_cflags=
14181 cf_new_cppflags=
14182 cf_new_extra_cppflags=
14183
14184 for cf_add_cflags in $cf_pkgconfig_incs
14185 do
14186 case "$cf_fix_cppflags" in
14187 (no)
14188         case "$cf_add_cflags" in
14189         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14190                 case "$cf_add_cflags" in
14191                 (-D*)
14192                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14193
14194                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14195                                 && test -z "${cf_tst_cflags}" \
14196                                 && cf_fix_cppflags=yes
14197
14198                         if test "$cf_fix_cppflags" = yes ; then
14199
14200         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14201         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14202
14203                                 continue
14204                         elif test "${cf_tst_cflags}" = "\"'" ; then
14205
14206         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14207         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14208
14209                                 continue
14210                         fi
14211                         ;;
14212                 esac
14213                 case "$CPPFLAGS" in
14214                 (*$cf_add_cflags)
14215                         ;;
14216                 (*)
14217                         case "$cf_add_cflags" in
14218                         (-D*)
14219                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14220
14221 CPPFLAGS=`echo "$CPPFLAGS" | \
14222         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14223                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14224
14225                                 ;;
14226                         esac
14227
14228         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14229         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14230
14231                         ;;
14232                 esac
14233                 ;;
14234         (*)
14235
14236         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14237         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14238
14239                 ;;
14240         esac
14241         ;;
14242 (yes)
14243
14244         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14245         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14246
14247         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14248
14249         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14250                 && test -z "${cf_tst_cflags}" \
14251                 && cf_fix_cppflags=no
14252         ;;
14253 esac
14254 done
14255
14256 if test -n "$cf_new_cflags" ; then
14257
14258         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14259         CFLAGS="${CFLAGS}$cf_new_cflags"
14260
14261 fi
14262
14263 if test -n "$cf_new_cppflags" ; then
14264
14265         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14266         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14267
14268 fi
14269
14270 if test -n "$cf_new_extra_cppflags" ; then
14271
14272         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14273         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14274
14275 fi
14276
14277 cf_add_libs="$LIBS"
14278 # reverse order
14279 cf_add_0lib=
14280 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14281 # filter duplicates
14282 for cf_add_1lib in $cf_add_0lib; do
14283         for cf_add_2lib in $cf_add_libs; do
14284                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14285                         cf_add_1lib=
14286                         break
14287                 fi
14288         done
14289         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14290 done
14291 LIBS="$cf_add_libs"
14292
14293         :
14294 else
14295         cf_pkgconfig_incs=
14296         cf_pkgconfig_libs=
14297         { echo "$as_me:14297: WARNING: unable to find X11 library" >&5
14298 echo "$as_me: WARNING: unable to find X11 library" >&2;}
14299 fi
14300
14301 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
14302         test -n "$verbose" && echo "    found package ice" 1>&6
14303
14304 echo "${as_me:-configure}:14304: testing found package ice ..." 1>&5
14305
14306         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
14307         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
14308         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14309
14310 echo "${as_me:-configure}:14310: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14311
14312         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14313
14314 echo "${as_me:-configure}:14314: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14315
14316 cf_fix_cppflags=no
14317 cf_new_cflags=
14318 cf_new_cppflags=
14319 cf_new_extra_cppflags=
14320
14321 for cf_add_cflags in $cf_pkgconfig_incs
14322 do
14323 case "$cf_fix_cppflags" in
14324 (no)
14325         case "$cf_add_cflags" in
14326         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14327                 case "$cf_add_cflags" in
14328                 (-D*)
14329                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14330
14331                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14332                                 && test -z "${cf_tst_cflags}" \
14333                                 && cf_fix_cppflags=yes
14334
14335                         if test "$cf_fix_cppflags" = yes ; then
14336
14337         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14338         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14339
14340                                 continue
14341                         elif test "${cf_tst_cflags}" = "\"'" ; then
14342
14343         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14344         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14345
14346                                 continue
14347                         fi
14348                         ;;
14349                 esac
14350                 case "$CPPFLAGS" in
14351                 (*$cf_add_cflags)
14352                         ;;
14353                 (*)
14354                         case "$cf_add_cflags" in
14355                         (-D*)
14356                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14357
14358 CPPFLAGS=`echo "$CPPFLAGS" | \
14359         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14360                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14361
14362                                 ;;
14363                         esac
14364
14365         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14366         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14367
14368                         ;;
14369                 esac
14370                 ;;
14371         (*)
14372
14373         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14374         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14375
14376                 ;;
14377         esac
14378         ;;
14379 (yes)
14380
14381         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14382         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14383
14384         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14385
14386         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14387                 && test -z "${cf_tst_cflags}" \
14388                 && cf_fix_cppflags=no
14389         ;;
14390 esac
14391 done
14392
14393 if test -n "$cf_new_cflags" ; then
14394
14395         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14396         CFLAGS="${CFLAGS}$cf_new_cflags"
14397
14398 fi
14399
14400 if test -n "$cf_new_cppflags" ; then
14401
14402         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14403         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14404
14405 fi
14406
14407 if test -n "$cf_new_extra_cppflags" ; then
14408
14409         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14410         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14411
14412 fi
14413
14414 cf_add_libs="$LIBS"
14415 # reverse order
14416 cf_add_0lib=
14417 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14418 # filter duplicates
14419 for cf_add_1lib in $cf_add_0lib; do
14420         for cf_add_2lib in $cf_add_libs; do
14421                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14422                         cf_add_1lib=
14423                         break
14424                 fi
14425         done
14426         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14427 done
14428 LIBS="$cf_add_libs"
14429
14430         :
14431 else
14432         cf_pkgconfig_incs=
14433         cf_pkgconfig_libs=
14434         { echo "$as_me:14434: WARNING: unable to find ICE library" >&5
14435 echo "$as_me: WARNING: unable to find ICE library" >&2;}
14436 fi
14437
14438 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
14439         test -n "$verbose" && echo "    found package sm" 1>&6
14440
14441 echo "${as_me:-configure}:14441: testing found package sm ..." 1>&5
14442
14443         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
14444         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
14445         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14446
14447 echo "${as_me:-configure}:14447: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14448
14449         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14450
14451 echo "${as_me:-configure}:14451: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14452
14453 cf_fix_cppflags=no
14454 cf_new_cflags=
14455 cf_new_cppflags=
14456 cf_new_extra_cppflags=
14457
14458 for cf_add_cflags in $cf_pkgconfig_incs
14459 do
14460 case "$cf_fix_cppflags" in
14461 (no)
14462         case "$cf_add_cflags" in
14463         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14464                 case "$cf_add_cflags" in
14465                 (-D*)
14466                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14467
14468                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14469                                 && test -z "${cf_tst_cflags}" \
14470                                 && cf_fix_cppflags=yes
14471
14472                         if test "$cf_fix_cppflags" = yes ; then
14473
14474         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14475         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14476
14477                                 continue
14478                         elif test "${cf_tst_cflags}" = "\"'" ; then
14479
14480         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14481         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14482
14483                                 continue
14484                         fi
14485                         ;;
14486                 esac
14487                 case "$CPPFLAGS" in
14488                 (*$cf_add_cflags)
14489                         ;;
14490                 (*)
14491                         case "$cf_add_cflags" in
14492                         (-D*)
14493                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14494
14495 CPPFLAGS=`echo "$CPPFLAGS" | \
14496         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14497                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14498
14499                                 ;;
14500                         esac
14501
14502         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14503         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14504
14505                         ;;
14506                 esac
14507                 ;;
14508         (*)
14509
14510         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14511         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14512
14513                 ;;
14514         esac
14515         ;;
14516 (yes)
14517
14518         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14519         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14520
14521         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14522
14523         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14524                 && test -z "${cf_tst_cflags}" \
14525                 && cf_fix_cppflags=no
14526         ;;
14527 esac
14528 done
14529
14530 if test -n "$cf_new_cflags" ; then
14531
14532         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14533         CFLAGS="${CFLAGS}$cf_new_cflags"
14534
14535 fi
14536
14537 if test -n "$cf_new_cppflags" ; then
14538
14539         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14540         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14541
14542 fi
14543
14544 if test -n "$cf_new_extra_cppflags" ; then
14545
14546         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14547         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14548
14549 fi
14550
14551 cf_add_libs="$LIBS"
14552 # reverse order
14553 cf_add_0lib=
14554 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14555 # filter duplicates
14556 for cf_add_1lib in $cf_add_0lib; do
14557         for cf_add_2lib in $cf_add_libs; do
14558                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14559                         cf_add_1lib=
14560                         break
14561                 fi
14562         done
14563         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14564 done
14565 LIBS="$cf_add_libs"
14566
14567         :
14568 else
14569         cf_pkgconfig_incs=
14570         cf_pkgconfig_libs=
14571         { echo "$as_me:14571: WARNING: unable to find SM library" >&5
14572 echo "$as_me: WARNING: unable to find SM library" >&2;}
14573 fi
14574
14575 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14576         test -n "$verbose" && echo "    found package xt" 1>&6
14577
14578 echo "${as_me:-configure}:14578: testing found package xt ..." 1>&5
14579
14580         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14581         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14582         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14583
14584 echo "${as_me:-configure}:14584: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14585
14586         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14587
14588 echo "${as_me:-configure}:14588: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14589
14590 cf_fix_cppflags=no
14591 cf_new_cflags=
14592 cf_new_cppflags=
14593 cf_new_extra_cppflags=
14594
14595 for cf_add_cflags in $cf_pkgconfig_incs
14596 do
14597 case "$cf_fix_cppflags" in
14598 (no)
14599         case "$cf_add_cflags" in
14600         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14601                 case "$cf_add_cflags" in
14602                 (-D*)
14603                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14604
14605                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14606                                 && test -z "${cf_tst_cflags}" \
14607                                 && cf_fix_cppflags=yes
14608
14609                         if test "$cf_fix_cppflags" = yes ; then
14610
14611         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14612         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14613
14614                                 continue
14615                         elif test "${cf_tst_cflags}" = "\"'" ; then
14616
14617         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14618         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14619
14620                                 continue
14621                         fi
14622                         ;;
14623                 esac
14624                 case "$CPPFLAGS" in
14625                 (*$cf_add_cflags)
14626                         ;;
14627                 (*)
14628                         case "$cf_add_cflags" in
14629                         (-D*)
14630                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14631
14632 CPPFLAGS=`echo "$CPPFLAGS" | \
14633         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14634                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14635
14636                                 ;;
14637                         esac
14638
14639         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14640         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14641
14642                         ;;
14643                 esac
14644                 ;;
14645         (*)
14646
14647         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14648         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14649
14650                 ;;
14651         esac
14652         ;;
14653 (yes)
14654
14655         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14656         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14657
14658         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14659
14660         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14661                 && test -z "${cf_tst_cflags}" \
14662                 && cf_fix_cppflags=no
14663         ;;
14664 esac
14665 done
14666
14667 if test -n "$cf_new_cflags" ; then
14668
14669         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14670         CFLAGS="${CFLAGS}$cf_new_cflags"
14671
14672 fi
14673
14674 if test -n "$cf_new_cppflags" ; then
14675
14676         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14677         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14678
14679 fi
14680
14681 if test -n "$cf_new_extra_cppflags" ; then
14682
14683         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14684         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14685
14686 fi
14687
14688 cf_add_libs="$LIBS"
14689 # reverse order
14690 cf_add_0lib=
14691 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14692 # filter duplicates
14693 for cf_add_1lib in $cf_add_0lib; do
14694         for cf_add_2lib in $cf_add_libs; do
14695                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14696                         cf_add_1lib=
14697                         break
14698                 fi
14699         done
14700         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14701 done
14702 LIBS="$cf_add_libs"
14703
14704         :
14705 else
14706         cf_pkgconfig_incs=
14707         cf_pkgconfig_libs=
14708         { echo "$as_me:14708: WARNING: unable to find Xt library" >&5
14709 echo "$as_me: WARNING: unable to find Xt library" >&2;}
14710 fi
14711
14712 else
14713         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14714 fi
14715
14716 cf_have_X_LIBS=no
14717
14718 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14719         test -n "$verbose" && echo "    found package xt" 1>&6
14720
14721 echo "${as_me:-configure}:14721: testing found package xt ..." 1>&5
14722
14723         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14724         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14725         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14726
14727 echo "${as_me:-configure}:14727: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14728
14729         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14730
14731 echo "${as_me:-configure}:14731: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14732
14733 cf_fix_cppflags=no
14734 cf_new_cflags=
14735 cf_new_cppflags=
14736 cf_new_extra_cppflags=
14737
14738 for cf_add_cflags in $cf_pkgconfig_incs
14739 do
14740 case "$cf_fix_cppflags" in
14741 (no)
14742         case "$cf_add_cflags" in
14743         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14744                 case "$cf_add_cflags" in
14745                 (-D*)
14746                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14747
14748                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14749                                 && test -z "${cf_tst_cflags}" \
14750                                 && cf_fix_cppflags=yes
14751
14752                         if test "$cf_fix_cppflags" = yes ; then
14753
14754         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14755         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14756
14757                                 continue
14758                         elif test "${cf_tst_cflags}" = "\"'" ; then
14759
14760         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14761         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14762
14763                                 continue
14764                         fi
14765                         ;;
14766                 esac
14767                 case "$CPPFLAGS" in
14768                 (*$cf_add_cflags)
14769                         ;;
14770                 (*)
14771                         case "$cf_add_cflags" in
14772                         (-D*)
14773                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14774
14775 CPPFLAGS=`echo "$CPPFLAGS" | \
14776         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14777                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14778
14779                                 ;;
14780                         esac
14781
14782         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14783         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14784
14785                         ;;
14786                 esac
14787                 ;;
14788         (*)
14789
14790         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14791         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14792
14793                 ;;
14794         esac
14795         ;;
14796 (yes)
14797
14798         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14799         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14800
14801         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14802
14803         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14804                 && test -z "${cf_tst_cflags}" \
14805                 && cf_fix_cppflags=no
14806         ;;
14807 esac
14808 done
14809
14810 if test -n "$cf_new_cflags" ; then
14811
14812         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14813         CFLAGS="${CFLAGS}$cf_new_cflags"
14814
14815 fi
14816
14817 if test -n "$cf_new_cppflags" ; then
14818
14819         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14820         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14821
14822 fi
14823
14824 if test -n "$cf_new_extra_cppflags" ; then
14825
14826         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14827         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14828
14829 fi
14830
14831 cf_add_libs="$LIBS"
14832 # reverse order
14833 cf_add_0lib=
14834 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14835 # filter duplicates
14836 for cf_add_1lib in $cf_add_0lib; do
14837         for cf_add_2lib in $cf_add_libs; do
14838                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14839                         cf_add_1lib=
14840                         break
14841                 fi
14842         done
14843         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14844 done
14845 LIBS="$cf_add_libs"
14846
14847         case "x$LIBS" in
14848         (*-lX11*)
14849                 ;;
14850         (*)
14851 # we have an "xt" package, but it may omit Xt's dependency on X11
14852 echo "$as_me:14852: checking for usable X dependency" >&5
14853 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14854 if test "${cf_cv_xt_x11_compat+set}" = set; then
14855   echo $ECHO_N "(cached) $ECHO_C" >&6
14856 else
14857
14858 cat >"conftest.$ac_ext" <<_ACEOF
14859 #line 14859 "configure"
14860 #include "confdefs.h"
14861
14862 #include <X11/Xlib.h>
14863
14864 int
14865 main (void)
14866 {
14867
14868         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14869         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14870         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14871         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14872
14873   ;
14874   return 0;
14875 }
14876 _ACEOF
14877 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14878 if { (eval echo "$as_me:14878: \"$ac_link\"") >&5
14879   (eval $ac_link) 2>&5
14880   ac_status=$?
14881   echo "$as_me:14881: \$? = $ac_status" >&5
14882   (exit "$ac_status"); } &&
14883          { ac_try='test -s "conftest$ac_exeext"'
14884   { (eval echo "$as_me:14884: \"$ac_try\"") >&5
14885   (eval $ac_try) 2>&5
14886   ac_status=$?
14887   echo "$as_me:14887: \$? = $ac_status" >&5
14888   (exit "$ac_status"); }; }; then
14889   cf_cv_xt_x11_compat=yes
14890 else
14891   echo "$as_me: failed program was:" >&5
14892 cat "conftest.$ac_ext" >&5
14893 cf_cv_xt_x11_compat=no
14894 fi
14895 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14896 fi
14897 echo "$as_me:14897: result: $cf_cv_xt_x11_compat" >&5
14898 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14899                 if test "$cf_cv_xt_x11_compat" = no
14900                 then
14901                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14902
14903 echo "${as_me:-configure}:14903: testing work around broken X11 dependency ..." 1>&5
14904
14905                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14906
14907 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14908         test -n "$verbose" && echo "    found package x11" 1>&6
14909
14910 echo "${as_me:-configure}:14910: testing found package x11 ..." 1>&5
14911
14912         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14913         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14914         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14915
14916 echo "${as_me:-configure}:14916: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14917
14918         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14919
14920 echo "${as_me:-configure}:14920: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14921
14922 cf_fix_cppflags=no
14923 cf_new_cflags=
14924 cf_new_cppflags=
14925 cf_new_extra_cppflags=
14926
14927 for cf_add_cflags in $cf_pkgconfig_incs
14928 do
14929 case "$cf_fix_cppflags" in
14930 (no)
14931         case "$cf_add_cflags" in
14932         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14933                 case "$cf_add_cflags" in
14934                 (-D*)
14935                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14936
14937                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14938                                 && test -z "${cf_tst_cflags}" \
14939                                 && cf_fix_cppflags=yes
14940
14941                         if test "$cf_fix_cppflags" = yes ; then
14942
14943         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14944         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14945
14946                                 continue
14947                         elif test "${cf_tst_cflags}" = "\"'" ; then
14948
14949         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14950         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14951
14952                                 continue
14953                         fi
14954                         ;;
14955                 esac
14956                 case "$CPPFLAGS" in
14957                 (*$cf_add_cflags)
14958                         ;;
14959                 (*)
14960                         case "$cf_add_cflags" in
14961                         (-D*)
14962                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14963
14964 CPPFLAGS=`echo "$CPPFLAGS" | \
14965         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14966                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14967
14968                                 ;;
14969                         esac
14970
14971         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14972         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14973
14974                         ;;
14975                 esac
14976                 ;;
14977         (*)
14978
14979         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14980         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14981
14982                 ;;
14983         esac
14984         ;;
14985 (yes)
14986
14987         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14988         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14989
14990         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14991
14992         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14993                 && test -z "${cf_tst_cflags}" \
14994                 && cf_fix_cppflags=no
14995         ;;
14996 esac
14997 done
14998
14999 if test -n "$cf_new_cflags" ; then
15000
15001         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15002         CFLAGS="${CFLAGS}$cf_new_cflags"
15003
15004 fi
15005
15006 if test -n "$cf_new_cppflags" ; then
15007
15008         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15009         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15010
15011 fi
15012
15013 if test -n "$cf_new_extra_cppflags" ; then
15014
15015         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15016         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15017
15018 fi
15019
15020 cf_add_libs="$LIBS"
15021 # reverse order
15022 cf_add_0lib=
15023 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15024 # filter duplicates
15025 for cf_add_1lib in $cf_add_0lib; do
15026         for cf_add_2lib in $cf_add_libs; do
15027                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15028                         cf_add_1lib=
15029                         break
15030                 fi
15031         done
15032         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15033 done
15034 LIBS="$cf_add_libs"
15035
15036         :
15037 else
15038         cf_pkgconfig_incs=
15039         cf_pkgconfig_libs=
15040
15041 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
15042
15043 echo "${as_me:-configure}:15043: testing ...before $LIBS ..." 1>&5
15044
15045 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
15046 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
15047
15048 echo "${as_me:-configure}:15048: testing ...after  $LIBS ..." 1>&5
15049
15050 fi
15051
15052                 fi
15053                 ;;
15054         esac
15055
15056 echo "$as_me:15056: checking for usable X Toolkit package" >&5
15057 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
15058 if test "${cf_cv_xt_ice_compat+set}" = set; then
15059   echo $ECHO_N "(cached) $ECHO_C" >&6
15060 else
15061
15062 cat >"conftest.$ac_ext" <<_ACEOF
15063 #line 15063 "configure"
15064 #include "confdefs.h"
15065
15066 #include <X11/Shell.h>
15067
15068 int
15069 main (void)
15070 {
15071 int num = IceConnectionNumber(0); (void) num
15072
15073   ;
15074   return 0;
15075 }
15076 _ACEOF
15077 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15078 if { (eval echo "$as_me:15078: \"$ac_link\"") >&5
15079   (eval $ac_link) 2>&5
15080   ac_status=$?
15081   echo "$as_me:15081: \$? = $ac_status" >&5
15082   (exit "$ac_status"); } &&
15083          { ac_try='test -s "conftest$ac_exeext"'
15084   { (eval echo "$as_me:15084: \"$ac_try\"") >&5
15085   (eval $ac_try) 2>&5
15086   ac_status=$?
15087   echo "$as_me:15087: \$? = $ac_status" >&5
15088   (exit "$ac_status"); }; }; then
15089   cf_cv_xt_ice_compat=yes
15090 else
15091   echo "$as_me: failed program was:" >&5
15092 cat "conftest.$ac_ext" >&5
15093 cf_cv_xt_ice_compat=no
15094 fi
15095 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15096 fi
15097 echo "$as_me:15097: result: $cf_cv_xt_ice_compat" >&5
15098 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
15099
15100         if test "$cf_cv_xt_ice_compat" = no
15101         then
15102                 # workaround for broken ".pc" files used for X Toolkit.
15103                 case "x$X_PRE_LIBS" in
15104                 (*-lICE*)
15105                         case "x$LIBS" in
15106                         (*-lICE*)
15107                                 ;;
15108                         (*)
15109                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
15110
15111 echo "${as_me:-configure}:15111: testing work around broken ICE dependency ..." 1>&5
15112
15113 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
15114         test -n "$verbose" && echo "    found package ice" 1>&6
15115
15116 echo "${as_me:-configure}:15116: testing found package ice ..." 1>&5
15117
15118         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
15119         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
15120         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
15121
15122 echo "${as_me:-configure}:15122: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
15123
15124         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
15125
15126 echo "${as_me:-configure}:15126: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
15127
15128 cf_fix_cppflags=no
15129 cf_new_cflags=
15130 cf_new_cppflags=
15131 cf_new_extra_cppflags=
15132
15133 for cf_add_cflags in $cf_pkgconfig_incs
15134 do
15135 case "$cf_fix_cppflags" in
15136 (no)
15137         case "$cf_add_cflags" in
15138         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15139                 case "$cf_add_cflags" in
15140                 (-D*)
15141                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15142
15143                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15144                                 && test -z "${cf_tst_cflags}" \
15145                                 && cf_fix_cppflags=yes
15146
15147                         if test "$cf_fix_cppflags" = yes ; then
15148
15149         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15150         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15151
15152                                 continue
15153                         elif test "${cf_tst_cflags}" = "\"'" ; then
15154
15155         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15156         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15157
15158                                 continue
15159                         fi
15160                         ;;
15161                 esac
15162                 case "$CPPFLAGS" in
15163                 (*$cf_add_cflags)
15164                         ;;
15165                 (*)
15166                         case "$cf_add_cflags" in
15167                         (-D*)
15168                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15169
15170 CPPFLAGS=`echo "$CPPFLAGS" | \
15171         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15172                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15173
15174                                 ;;
15175                         esac
15176
15177         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15178         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15179
15180                         ;;
15181                 esac
15182                 ;;
15183         (*)
15184
15185         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15186         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15187
15188                 ;;
15189         esac
15190         ;;
15191 (yes)
15192
15193         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15194         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15195
15196         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15197
15198         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15199                 && test -z "${cf_tst_cflags}" \
15200                 && cf_fix_cppflags=no
15201         ;;
15202 esac
15203 done
15204
15205 if test -n "$cf_new_cflags" ; then
15206
15207         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15208         CFLAGS="${CFLAGS}$cf_new_cflags"
15209
15210 fi
15211
15212 if test -n "$cf_new_cppflags" ; then
15213
15214         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15215         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15216
15217 fi
15218
15219 if test -n "$cf_new_extra_cppflags" ; then
15220
15221         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15222         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15223
15224 fi
15225
15226 cf_add_libs="$LIBS"
15227 # reverse order
15228 cf_add_0lib=
15229 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15230 # filter duplicates
15231 for cf_add_1lib in $cf_add_0lib; do
15232         for cf_add_2lib in $cf_add_libs; do
15233                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15234                         cf_add_1lib=
15235                         break
15236                 fi
15237         done
15238         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15239 done
15240 LIBS="$cf_add_libs"
15241
15242 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
15243         test -n "$verbose" && echo "    found package sm" 1>&6
15244
15245 echo "${as_me:-configure}:15245: testing found package sm ..." 1>&5
15246
15247         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
15248         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
15249         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
15250
15251 echo "${as_me:-configure}:15251: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
15252
15253         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
15254
15255 echo "${as_me:-configure}:15255: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
15256
15257 cf_fix_cppflags=no
15258 cf_new_cflags=
15259 cf_new_cppflags=
15260 cf_new_extra_cppflags=
15261
15262 for cf_add_cflags in $cf_pkgconfig_incs
15263 do
15264 case "$cf_fix_cppflags" in
15265 (no)
15266         case "$cf_add_cflags" in
15267         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15268                 case "$cf_add_cflags" in
15269                 (-D*)
15270                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15271
15272                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15273                                 && test -z "${cf_tst_cflags}" \
15274                                 && cf_fix_cppflags=yes
15275
15276                         if test "$cf_fix_cppflags" = yes ; then
15277
15278         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15279         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15280
15281                                 continue
15282                         elif test "${cf_tst_cflags}" = "\"'" ; then
15283
15284         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15285         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15286
15287                                 continue
15288                         fi
15289                         ;;
15290                 esac
15291                 case "$CPPFLAGS" in
15292                 (*$cf_add_cflags)
15293                         ;;
15294                 (*)
15295                         case "$cf_add_cflags" in
15296                         (-D*)
15297                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15298
15299 CPPFLAGS=`echo "$CPPFLAGS" | \
15300         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15301                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15302
15303                                 ;;
15304                         esac
15305
15306         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15307         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15308
15309                         ;;
15310                 esac
15311                 ;;
15312         (*)
15313
15314         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15315         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15316
15317                 ;;
15318         esac
15319         ;;
15320 (yes)
15321
15322         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15323         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15324
15325         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15326
15327         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15328                 && test -z "${cf_tst_cflags}" \
15329                 && cf_fix_cppflags=no
15330         ;;
15331 esac
15332 done
15333
15334 if test -n "$cf_new_cflags" ; then
15335
15336         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15337         CFLAGS="${CFLAGS}$cf_new_cflags"
15338
15339 fi
15340
15341 if test -n "$cf_new_cppflags" ; then
15342
15343         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15344         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15345
15346 fi
15347
15348 if test -n "$cf_new_extra_cppflags" ; then
15349
15350         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15351         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15352
15353 fi
15354
15355 cf_add_libs="$LIBS"
15356 # reverse order
15357 cf_add_0lib=
15358 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15359 # filter duplicates
15360 for cf_add_1lib in $cf_add_0lib; do
15361         for cf_add_2lib in $cf_add_libs; do
15362                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15363                         cf_add_1lib=
15364                         break
15365                 fi
15366         done
15367         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15368 done
15369 LIBS="$cf_add_libs"
15370
15371         :
15372 else
15373         cf_pkgconfig_incs=
15374         cf_pkgconfig_libs=
15375         :
15376 fi
15377
15378 else
15379         cf_pkgconfig_incs=
15380         cf_pkgconfig_libs=
15381
15382 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
15383
15384 echo "${as_me:-configure}:15384: testing ...before $LIBS ..." 1>&5
15385
15386 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
15387 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
15388
15389 echo "${as_me:-configure}:15389: testing ...after  $LIBS ..." 1>&5
15390
15391 fi
15392
15393                                 ;;
15394                         esac
15395                         ;;
15396                 esac
15397         fi
15398
15399         cf_have_X_LIBS=yes
15400
15401 else
15402         cf_pkgconfig_incs=
15403         cf_pkgconfig_libs=
15404
15405         LDFLAGS="$X_LIBS $LDFLAGS"
15406
15407 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15408
15409 echo "${as_me:-configure}:15409: testing checking additions to CFLAGS ..." 1>&5
15410
15411 cf_check_cflags="$CFLAGS"
15412 cf_check_cppflags="$CPPFLAGS"
15413
15414 cf_fix_cppflags=no
15415 cf_new_cflags=
15416 cf_new_cppflags=
15417 cf_new_extra_cppflags=
15418
15419 for cf_add_cflags in $X_CFLAGS
15420 do
15421 case "$cf_fix_cppflags" in
15422 (no)
15423         case "$cf_add_cflags" in
15424         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15425                 case "$cf_add_cflags" in
15426                 (-D*)
15427                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15428
15429                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15430                                 && test -z "${cf_tst_cflags}" \
15431                                 && cf_fix_cppflags=yes
15432
15433                         if test "$cf_fix_cppflags" = yes ; then
15434
15435         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15436         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15437
15438                                 continue
15439                         elif test "${cf_tst_cflags}" = "\"'" ; then
15440
15441         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15442         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15443
15444                                 continue
15445                         fi
15446                         ;;
15447                 esac
15448                 case "$CPPFLAGS" in
15449                 (*$cf_add_cflags)
15450                         ;;
15451                 (*)
15452                         case "$cf_add_cflags" in
15453                         (-D*)
15454                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15455
15456 CPPFLAGS=`echo "$CPPFLAGS" | \
15457         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15458                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15459
15460                                 ;;
15461                         esac
15462
15463         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15464         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15465
15466                         ;;
15467                 esac
15468                 ;;
15469         (*)
15470
15471         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15472         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15473
15474                 ;;
15475         esac
15476         ;;
15477 (yes)
15478
15479         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15480         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15481
15482         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15483
15484         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15485                 && test -z "${cf_tst_cflags}" \
15486                 && cf_fix_cppflags=no
15487         ;;
15488 esac
15489 done
15490
15491 if test -n "$cf_new_cflags" ; then
15492         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15493
15494 echo "${as_me:-configure}:15494: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15495
15496         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15497         CFLAGS="${CFLAGS}$cf_new_cflags"
15498
15499 fi
15500
15501 if test -n "$cf_new_cppflags" ; then
15502         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15503
15504 echo "${as_me:-configure}:15504: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15505
15506         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15507         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15508
15509 fi
15510
15511 if test -n "$cf_new_extra_cppflags" ; then
15512         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15513
15514 echo "${as_me:-configure}:15514: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15515
15516         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15517         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15518
15519 fi
15520
15521 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15522 cat >"conftest.$ac_ext" <<_ACEOF
15523 #line 15523 "configure"
15524 #include "confdefs.h"
15525 #include <stdio.h>
15526 int
15527 main (void)
15528 {
15529 printf("Hello world");
15530   ;
15531   return 0;
15532 }
15533 _ACEOF
15534 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15535 if { (eval echo "$as_me:15535: \"$ac_link\"") >&5
15536   (eval $ac_link) 2>&5
15537   ac_status=$?
15538   echo "$as_me:15538: \$? = $ac_status" >&5
15539   (exit "$ac_status"); } &&
15540          { ac_try='test -s "conftest$ac_exeext"'
15541   { (eval echo "$as_me:15541: \"$ac_try\"") >&5
15542   (eval $ac_try) 2>&5
15543   ac_status=$?
15544   echo "$as_me:15544: \$? = $ac_status" >&5
15545   (exit "$ac_status"); }; }; then
15546   :
15547 else
15548   echo "$as_me: failed program was:" >&5
15549 cat "conftest.$ac_ext" >&5
15550 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15551
15552 echo "${as_me:-configure}:15552: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15553
15554          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15555                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15556
15557 echo "${as_me:-configure}:15557: testing but keeping change to \$CPPFLAGS ..." 1>&5
15558
15559          fi
15560          CFLAGS="$cf_check_cflags"
15561 fi
15562 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15563 fi
15564
15565         echo "$as_me:15565: checking for XOpenDisplay" >&5
15566 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
15567 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
15568   echo $ECHO_N "(cached) $ECHO_C" >&6
15569 else
15570   cat >"conftest.$ac_ext" <<_ACEOF
15571 #line 15571 "configure"
15572 #include "confdefs.h"
15573 #define XOpenDisplay autoconf_temporary
15574 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15575 #undef XOpenDisplay
15576
15577 #ifdef __cplusplus
15578 extern "C"
15579 #endif
15580
15581 /* We use char because int might match the return type of a gcc2
15582    builtin and then its argument prototype would still apply.  */
15583 char XOpenDisplay (void);
15584
15585 int
15586 main (void)
15587 {
15588
15589 /* The GNU C library defines stubs for functions which it implements
15590     to always fail with ENOSYS.  Some functions are actually named
15591     something starting with __ and the normal name is an alias.  */
15592 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
15593 #error found stub for XOpenDisplay
15594 #endif
15595
15596         return XOpenDisplay ();
15597   ;
15598   return 0;
15599 }
15600 _ACEOF
15601 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15602 if { (eval echo "$as_me:15602: \"$ac_link\"") >&5
15603   (eval $ac_link) 2>&5
15604   ac_status=$?
15605   echo "$as_me:15605: \$? = $ac_status" >&5
15606   (exit "$ac_status"); } &&
15607          { ac_try='test -s "conftest$ac_exeext"'
15608   { (eval echo "$as_me:15608: \"$ac_try\"") >&5
15609   (eval $ac_try) 2>&5
15610   ac_status=$?
15611   echo "$as_me:15611: \$? = $ac_status" >&5
15612   (exit "$ac_status"); }; }; then
15613   ac_cv_func_XOpenDisplay=yes
15614 else
15615   echo "$as_me: failed program was:" >&5
15616 cat "conftest.$ac_ext" >&5
15617 ac_cv_func_XOpenDisplay=no
15618 fi
15619 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15620 fi
15621 echo "$as_me:15621: result: $ac_cv_func_XOpenDisplay" >&5
15622 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
15623 if test "$ac_cv_func_XOpenDisplay" = yes; then
15624   :
15625 else
15626
15627         echo "$as_me:15627: checking for XOpenDisplay in -lX11" >&5
15628 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15629 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15630   echo $ECHO_N "(cached) $ECHO_C" >&6
15631 else
15632   ac_check_lib_save_LIBS=$LIBS
15633 LIBS="-lX11  $LIBS"
15634 cat >"conftest.$ac_ext" <<_ACEOF
15635 #line 15635 "configure"
15636 #include "confdefs.h"
15637
15638 /* Override any gcc2 internal prototype to avoid an error.  */
15639 #ifdef __cplusplus
15640 extern "C"
15641 #endif
15642 /* We use char because int might match the return type of a gcc2
15643    builtin and then its argument prototype would still apply.  */
15644 char XOpenDisplay ();
15645 int
15646 main (void)
15647 {
15648 XOpenDisplay ();
15649   ;
15650   return 0;
15651 }
15652 _ACEOF
15653 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15654 if { (eval echo "$as_me:15654: \"$ac_link\"") >&5
15655   (eval $ac_link) 2>&5
15656   ac_status=$?
15657   echo "$as_me:15657: \$? = $ac_status" >&5
15658   (exit "$ac_status"); } &&
15659          { ac_try='test -s "conftest$ac_exeext"'
15660   { (eval echo "$as_me:15660: \"$ac_try\"") >&5
15661   (eval $ac_try) 2>&5
15662   ac_status=$?
15663   echo "$as_me:15663: \$? = $ac_status" >&5
15664   (exit "$ac_status"); }; }; then
15665   ac_cv_lib_X11_XOpenDisplay=yes
15666 else
15667   echo "$as_me: failed program was:" >&5
15668 cat "conftest.$ac_ext" >&5
15669 ac_cv_lib_X11_XOpenDisplay=no
15670 fi
15671 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15672 LIBS=$ac_check_lib_save_LIBS
15673 fi
15674 echo "$as_me:15674: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15675 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15676 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
15677
15678 cf_add_libs="$LIBS"
15679 # reverse order
15680 cf_add_0lib=
15681 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15682 # filter duplicates
15683 for cf_add_1lib in $cf_add_0lib; do
15684         for cf_add_2lib in $cf_add_libs; do
15685                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15686                         cf_add_1lib=
15687                         break
15688                 fi
15689         done
15690         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15691 done
15692 LIBS="$cf_add_libs"
15693
15694 fi
15695
15696 fi
15697
15698         echo "$as_me:15698: checking for XtAppInitialize" >&5
15699 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
15700 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
15701   echo $ECHO_N "(cached) $ECHO_C" >&6
15702 else
15703   cat >"conftest.$ac_ext" <<_ACEOF
15704 #line 15704 "configure"
15705 #include "confdefs.h"
15706 #define XtAppInitialize autoconf_temporary
15707 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15708 #undef XtAppInitialize
15709
15710 #ifdef __cplusplus
15711 extern "C"
15712 #endif
15713
15714 /* We use char because int might match the return type of a gcc2
15715    builtin and then its argument prototype would still apply.  */
15716 char XtAppInitialize (void);
15717
15718 int
15719 main (void)
15720 {
15721
15722 /* The GNU C library defines stubs for functions which it implements
15723     to always fail with ENOSYS.  Some functions are actually named
15724     something starting with __ and the normal name is an alias.  */
15725 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
15726 #error found stub for XtAppInitialize
15727 #endif
15728
15729         return XtAppInitialize ();
15730   ;
15731   return 0;
15732 }
15733 _ACEOF
15734 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15735 if { (eval echo "$as_me:15735: \"$ac_link\"") >&5
15736   (eval $ac_link) 2>&5
15737   ac_status=$?
15738   echo "$as_me:15738: \$? = $ac_status" >&5
15739   (exit "$ac_status"); } &&
15740          { ac_try='test -s "conftest$ac_exeext"'
15741   { (eval echo "$as_me:15741: \"$ac_try\"") >&5
15742   (eval $ac_try) 2>&5
15743   ac_status=$?
15744   echo "$as_me:15744: \$? = $ac_status" >&5
15745   (exit "$ac_status"); }; }; then
15746   ac_cv_func_XtAppInitialize=yes
15747 else
15748   echo "$as_me: failed program was:" >&5
15749 cat "conftest.$ac_ext" >&5
15750 ac_cv_func_XtAppInitialize=no
15751 fi
15752 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15753 fi
15754 echo "$as_me:15754: result: $ac_cv_func_XtAppInitialize" >&5
15755 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
15756 if test "$ac_cv_func_XtAppInitialize" = yes; then
15757   :
15758 else
15759
15760         echo "$as_me:15760: checking for XtAppInitialize in -lXt" >&5
15761 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
15762 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
15763   echo $ECHO_N "(cached) $ECHO_C" >&6
15764 else
15765   ac_check_lib_save_LIBS=$LIBS
15766 LIBS="-lXt  $LIBS"
15767 cat >"conftest.$ac_ext" <<_ACEOF
15768 #line 15768 "configure"
15769 #include "confdefs.h"
15770
15771 /* Override any gcc2 internal prototype to avoid an error.  */
15772 #ifdef __cplusplus
15773 extern "C"
15774 #endif
15775 /* We use char because int might match the return type of a gcc2
15776    builtin and then its argument prototype would still apply.  */
15777 char XtAppInitialize ();
15778 int
15779 main (void)
15780 {
15781 XtAppInitialize ();
15782   ;
15783   return 0;
15784 }
15785 _ACEOF
15786 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15787 if { (eval echo "$as_me:15787: \"$ac_link\"") >&5
15788   (eval $ac_link) 2>&5
15789   ac_status=$?
15790   echo "$as_me:15790: \$? = $ac_status" >&5
15791   (exit "$ac_status"); } &&
15792          { ac_try='test -s "conftest$ac_exeext"'
15793   { (eval echo "$as_me:15793: \"$ac_try\"") >&5
15794   (eval $ac_try) 2>&5
15795   ac_status=$?
15796   echo "$as_me:15796: \$? = $ac_status" >&5
15797   (exit "$ac_status"); }; }; then
15798   ac_cv_lib_Xt_XtAppInitialize=yes
15799 else
15800   echo "$as_me: failed program was:" >&5
15801 cat "conftest.$ac_ext" >&5
15802 ac_cv_lib_Xt_XtAppInitialize=no
15803 fi
15804 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15805 LIBS=$ac_check_lib_save_LIBS
15806 fi
15807 echo "$as_me:15807: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15808 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15809 if test "$ac_cv_lib_Xt_XtAppInitialize" = yes; then
15810
15811 cat >>confdefs.h <<\EOF
15812 #define HAVE_LIBXT 1
15813 EOF
15814
15815                  cf_have_X_LIBS=Xt
15816                  LIBS="-lXt $LIBS"
15817 fi
15818
15819 fi
15820
15821 fi
15822
15823 if test "$cf_have_X_LIBS" = no ; then
15824         { echo "$as_me:15824: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15825 test program.  You will have to check and add the proper libraries by hand
15826 to makefile." >&5
15827 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15828 test program.  You will have to check and add the proper libraries by hand
15829 to makefile." >&2;}
15830 fi
15831
15832 cf_x_athena_root=$cf_x_athena
15833 cf_x_athena_inc=""
15834
15835 for cf_path in default \
15836         /usr/contrib/X11R6 \
15837         /usr/contrib/X11R5 \
15838         /usr/lib/X11R5 \
15839         /usr/local
15840 do
15841         if test -z "$cf_x_athena_inc" ; then
15842
15843 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15844 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15845 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15846 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15847 for cf_X_CFLAGS in $X_CFLAGS
15848 do
15849         case "x$cf_X_CFLAGS" in
15850         x-[IUD]*)
15851                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15852                 ;;
15853         *)
15854                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15855                 ;;
15856         esac
15857 done
15858
15859                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15860                 if test "$cf_path" != default ; then
15861
15862         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15863         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15864
15865                         echo "$as_me:15865: checking for $cf_test in $cf_path" >&5
15866 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15867                 else
15868                         echo "$as_me:15868: checking for $cf_test" >&5
15869 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15870                 fi
15871                 cat >"conftest.$ac_ext" <<_ACEOF
15872 #line 15872 "configure"
15873 #include "confdefs.h"
15874
15875 #include <X11/Intrinsic.h>
15876 #include <$cf_test>
15877 int
15878 main (void)
15879 {
15880
15881   ;
15882   return 0;
15883 }
15884 _ACEOF
15885 rm -f "conftest.$ac_objext"
15886 if { (eval echo "$as_me:15886: \"$ac_compile\"") >&5
15887   (eval $ac_compile) 2>&5
15888   ac_status=$?
15889   echo "$as_me:15889: \$? = $ac_status" >&5
15890   (exit "$ac_status"); } &&
15891          { ac_try='test -s "conftest.$ac_objext"'
15892   { (eval echo "$as_me:15892: \"$ac_try\"") >&5
15893   (eval $ac_try) 2>&5
15894   ac_status=$?
15895   echo "$as_me:15895: \$? = $ac_status" >&5
15896   (exit "$ac_status"); }; }; then
15897   cf_result=yes
15898 else
15899   echo "$as_me: failed program was:" >&5
15900 cat "conftest.$ac_ext" >&5
15901 cf_result=no
15902 fi
15903 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15904                 echo "$as_me:15904: result: $cf_result" >&5
15905 echo "${ECHO_T}$cf_result" >&6
15906
15907 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15908 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15909 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15910
15911                 if test "$cf_result" = yes ; then
15912                         test "$cf_path"  = default && cf_x_athena_inc=default
15913                         test "$cf_path" != default && cf_x_athena_inc="$cf_path/include"
15914                         break
15915                 fi
15916         fi
15917 done
15918
15919 if test -z "$cf_x_athena_inc" ; then
15920         { echo "$as_me:15920: WARNING: Unable to find Athena header files" >&5
15921 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15922 elif test "$cf_x_athena_inc" != default ; then
15923
15924         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15925         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15926
15927 fi
15928
15929 cf_x_athena_root=$cf_x_athena
15930 cf_x_athena_lib=""
15931
15932 for cf_path in default \
15933         /usr/contrib/X11R6 \
15934         /usr/contrib/X11R5 \
15935         /usr/lib/X11R5 \
15936         /usr/local
15937 do
15938         for cf_lib in \
15939                 ${cf_x_athena_root} \
15940                 ${cf_x_athena_root}7 \
15941                 ${cf_x_athena_root}6
15942         do
15943         for cf_libs in \
15944                 "-l$cf_lib -lXmu" \
15945                 "-l$cf_lib -lXpm -lXmu" \
15946                 "-l${cf_lib}_s -lXmu_s"
15947         do
15948                 test -n "$cf_x_athena_lib" && break
15949
15950 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15951 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15952 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15953 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15954 for cf_X_CFLAGS in $X_CFLAGS
15955 do
15956         case "x$cf_X_CFLAGS" in
15957         x-[IUD]*)
15958                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15959                 ;;
15960         *)
15961                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15962                 ;;
15963         esac
15964 done
15965
15966                 cf_test=XawSimpleMenuAddGlobalActions
15967                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15968
15969 cf_add_libs="$LIBS"
15970 # reverse order
15971 cf_add_0lib=
15972 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15973 # filter duplicates
15974 for cf_add_1lib in $cf_add_0lib; do
15975         for cf_add_2lib in $cf_add_libs; do
15976                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15977                         cf_add_1lib=
15978                         break
15979                 fi
15980         done
15981         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15982 done
15983 LIBS="$cf_add_libs"
15984
15985                 echo "$as_me:15985: checking for $cf_test in $cf_libs" >&5
15986 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15987                 cat >"conftest.$ac_ext" <<_ACEOF
15988 #line 15988 "configure"
15989 #include "confdefs.h"
15990
15991 #include <X11/Intrinsic.h>
15992 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15993
15994 int
15995 main (void)
15996 {
15997
15998 $cf_test((XtAppContext) 0)
15999   ;
16000   return 0;
16001 }
16002 _ACEOF
16003 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16004 if { (eval echo "$as_me:16004: \"$ac_link\"") >&5
16005   (eval $ac_link) 2>&5
16006   ac_status=$?
16007   echo "$as_me:16007: \$? = $ac_status" >&5
16008   (exit "$ac_status"); } &&
16009          { ac_try='test -s "conftest$ac_exeext"'
16010   { (eval echo "$as_me:16010: \"$ac_try\"") >&5
16011   (eval $ac_try) 2>&5
16012   ac_status=$?
16013   echo "$as_me:16013: \$? = $ac_status" >&5
16014   (exit "$ac_status"); }; }; then
16015   cf_result=yes
16016 else
16017   echo "$as_me: failed program was:" >&5
16018 cat "conftest.$ac_ext" >&5
16019 cf_result=no
16020 fi
16021 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16022                 echo "$as_me:16022: result: $cf_result" >&5
16023 echo "${ECHO_T}$cf_result" >&6
16024
16025 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
16026 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
16027 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
16028
16029                 if test "$cf_result" = yes ; then
16030                         cf_x_athena_lib="$cf_libs"
16031                         break
16032                 fi
16033         done # cf_libs
16034                 test -n "$cf_x_athena_lib" && break
16035         done # cf_lib
16036 done
16037
16038 if test -z "$cf_x_athena_lib" ; then
16039         { { echo "$as_me:16039: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
16040 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
16041    { (exit 1); exit 1; }; }
16042 fi
16043
16044 cf_add_libs="$LIBS"
16045 # reverse order
16046 cf_add_0lib=
16047 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16048 # filter duplicates
16049 for cf_add_1lib in $cf_add_0lib; do
16050         for cf_add_2lib in $cf_add_libs; do
16051                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16052                         cf_add_1lib=
16053                         break
16054                 fi
16055         done
16056         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16057 done
16058 LIBS="$cf_add_libs"
16059
16060 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16061
16062 cat >>confdefs.h <<EOF
16063 #define $cf_x_athena_LIBS 1
16064 EOF
16065
16066 fi
16067
16068 if test -n "$ac_tool_prefix"; then
16069   for ac_prog in xcurses-config
16070   do
16071     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
16072 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
16073 echo "$as_me:16073: checking for $ac_word" >&5
16074 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16075 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
16076   echo $ECHO_N "(cached) $ECHO_C" >&6
16077 else
16078   if test -n "$XCURSES_CONFIG"; then
16079   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
16080 else
16081   ac_save_IFS=$IFS; IFS=$ac_path_separator
16082 ac_dummy="$PATH"
16083 for ac_dir in $ac_dummy; do
16084   IFS=$ac_save_IFS
16085   test -z "$ac_dir" && ac_dir=.
16086   $as_executable_p "$ac_dir/$ac_word" || continue
16087 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
16088 echo "$as_me:16088: found $ac_dir/$ac_word" >&5
16089 break
16090 done
16091
16092 fi
16093 fi
16094 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
16095 if test -n "$XCURSES_CONFIG"; then
16096   echo "$as_me:16096: result: $XCURSES_CONFIG" >&5
16097 echo "${ECHO_T}$XCURSES_CONFIG" >&6
16098 else
16099   echo "$as_me:16099: result: no" >&5
16100 echo "${ECHO_T}no" >&6
16101 fi
16102
16103     test -n "$XCURSES_CONFIG" && break
16104   done
16105 fi
16106 if test -z "$XCURSES_CONFIG"; then
16107   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
16108   for ac_prog in xcurses-config
16109 do
16110   # Extract the first word of "$ac_prog", so it can be a program name with args.
16111 set dummy $ac_prog; ac_word=$2
16112 echo "$as_me:16112: checking for $ac_word" >&5
16113 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16114 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
16115   echo $ECHO_N "(cached) $ECHO_C" >&6
16116 else
16117   if test -n "$ac_ct_XCURSES_CONFIG"; then
16118   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
16119 else
16120   ac_save_IFS=$IFS; IFS=$ac_path_separator
16121 ac_dummy="$PATH"
16122 for ac_dir in $ac_dummy; do
16123   IFS=$ac_save_IFS
16124   test -z "$ac_dir" && ac_dir=.
16125   $as_executable_p "$ac_dir/$ac_word" || continue
16126 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
16127 echo "$as_me:16127: found $ac_dir/$ac_word" >&5
16128 break
16129 done
16130
16131 fi
16132 fi
16133 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
16134 if test -n "$ac_ct_XCURSES_CONFIG"; then
16135   echo "$as_me:16135: result: $ac_ct_XCURSES_CONFIG" >&5
16136 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
16137 else
16138   echo "$as_me:16138: result: no" >&5
16139 echo "${ECHO_T}no" >&6
16140 fi
16141
16142   test -n "$ac_ct_XCURSES_CONFIG" && break
16143 done
16144 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
16145
16146   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
16147 fi
16148
16149 if test "$XCURSES_CONFIG" != none ; then
16150
16151 cf_fix_cppflags=no
16152 cf_new_cflags=
16153 cf_new_cppflags=
16154 cf_new_extra_cppflags=
16155
16156 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
16157 do
16158 case "$cf_fix_cppflags" in
16159 (no)
16160         case "$cf_add_cflags" in
16161         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16162                 case "$cf_add_cflags" in
16163                 (-D*)
16164                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16165
16166                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16167                                 && test -z "${cf_tst_cflags}" \
16168                                 && cf_fix_cppflags=yes
16169
16170                         if test "$cf_fix_cppflags" = yes ; then
16171
16172         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16173         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16174
16175                                 continue
16176                         elif test "${cf_tst_cflags}" = "\"'" ; then
16177
16178         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16179         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16180
16181                                 continue
16182                         fi
16183                         ;;
16184                 esac
16185                 case "$CPPFLAGS" in
16186                 (*$cf_add_cflags)
16187                         ;;
16188                 (*)
16189                         case "$cf_add_cflags" in
16190                         (-D*)
16191                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16192
16193 CPPFLAGS=`echo "$CPPFLAGS" | \
16194         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16195                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16196
16197                                 ;;
16198                         esac
16199
16200         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16201         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16202
16203                         ;;
16204                 esac
16205                 ;;
16206         (*)
16207
16208         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16209         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16210
16211                 ;;
16212         esac
16213         ;;
16214 (yes)
16215
16216         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16217         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16218
16219         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16220
16221         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16222                 && test -z "${cf_tst_cflags}" \
16223                 && cf_fix_cppflags=no
16224         ;;
16225 esac
16226 done
16227
16228 if test -n "$cf_new_cflags" ; then
16229
16230         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16231         CFLAGS="${CFLAGS}$cf_new_cflags"
16232
16233 fi
16234
16235 if test -n "$cf_new_cppflags" ; then
16236
16237         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16238         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16239
16240 fi
16241
16242 if test -n "$cf_new_extra_cppflags" ; then
16243
16244         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16245         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16246
16247 fi
16248
16249 cf_add_libs="$LIBS"
16250 # reverse order
16251 cf_add_0lib=
16252 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16253 # filter duplicates
16254 for cf_add_1lib in $cf_add_0lib; do
16255         for cf_add_2lib in $cf_add_libs; do
16256                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16257                         cf_add_1lib=
16258                         break
16259                 fi
16260         done
16261         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16262 done
16263 LIBS="$cf_add_libs"
16264
16265 cf_cv_lib_XCurses=yes
16266
16267 else
16268
16269 LDFLAGS="$LDFLAGS $X_LIBS"
16270
16271 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
16272
16273 echo "${as_me:-configure}:16273: testing checking additions to CFLAGS ..." 1>&5
16274
16275 cf_check_cflags="$CFLAGS"
16276 cf_check_cppflags="$CPPFLAGS"
16277
16278 cf_fix_cppflags=no
16279 cf_new_cflags=
16280 cf_new_cppflags=
16281 cf_new_extra_cppflags=
16282
16283 for cf_add_cflags in $X_CFLAGS
16284 do
16285 case "$cf_fix_cppflags" in
16286 (no)
16287         case "$cf_add_cflags" in
16288         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16289                 case "$cf_add_cflags" in
16290                 (-D*)
16291                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16292
16293                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16294                                 && test -z "${cf_tst_cflags}" \
16295                                 && cf_fix_cppflags=yes
16296
16297                         if test "$cf_fix_cppflags" = yes ; then
16298
16299         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16300         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16301
16302                                 continue
16303                         elif test "${cf_tst_cflags}" = "\"'" ; then
16304
16305         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16306         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16307
16308                                 continue
16309                         fi
16310                         ;;
16311                 esac
16312                 case "$CPPFLAGS" in
16313                 (*$cf_add_cflags)
16314                         ;;
16315                 (*)
16316                         case "$cf_add_cflags" in
16317                         (-D*)
16318                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16319
16320 CPPFLAGS=`echo "$CPPFLAGS" | \
16321         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16322                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16323
16324                                 ;;
16325                         esac
16326
16327         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16328         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16329
16330                         ;;
16331                 esac
16332                 ;;
16333         (*)
16334
16335         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16336         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16337
16338                 ;;
16339         esac
16340         ;;
16341 (yes)
16342
16343         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16344         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16345
16346         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16347
16348         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16349                 && test -z "${cf_tst_cflags}" \
16350                 && cf_fix_cppflags=no
16351         ;;
16352 esac
16353 done
16354
16355 if test -n "$cf_new_cflags" ; then
16356         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
16357
16358 echo "${as_me:-configure}:16358: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
16359
16360         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16361         CFLAGS="${CFLAGS}$cf_new_cflags"
16362
16363 fi
16364
16365 if test -n "$cf_new_cppflags" ; then
16366         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
16367
16368 echo "${as_me:-configure}:16368: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
16369
16370         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16371         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16372
16373 fi
16374
16375 if test -n "$cf_new_extra_cppflags" ; then
16376         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
16377
16378 echo "${as_me:-configure}:16378: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
16379
16380         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16381         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16382
16383 fi
16384
16385 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
16386 cat >"conftest.$ac_ext" <<_ACEOF
16387 #line 16387 "configure"
16388 #include "confdefs.h"
16389 #include <stdio.h>
16390 int
16391 main (void)
16392 {
16393 printf("Hello world");
16394   ;
16395   return 0;
16396 }
16397 _ACEOF
16398 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16399 if { (eval echo "$as_me:16399: \"$ac_link\"") >&5
16400   (eval $ac_link) 2>&5
16401   ac_status=$?
16402   echo "$as_me:16402: \$? = $ac_status" >&5
16403   (exit "$ac_status"); } &&
16404          { ac_try='test -s "conftest$ac_exeext"'
16405   { (eval echo "$as_me:16405: \"$ac_try\"") >&5
16406   (eval $ac_try) 2>&5
16407   ac_status=$?
16408   echo "$as_me:16408: \$? = $ac_status" >&5
16409   (exit "$ac_status"); }; }; then
16410   :
16411 else
16412   echo "$as_me: failed program was:" >&5
16413 cat "conftest.$ac_ext" >&5
16414 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
16415
16416 echo "${as_me:-configure}:16416: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
16417
16418          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
16419                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
16420
16421 echo "${as_me:-configure}:16421: testing but keeping change to \$CPPFLAGS ..." 1>&5
16422
16423          fi
16424          CFLAGS="$cf_check_cflags"
16425 fi
16426 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16427 fi
16428
16429 echo "$as_me:16429: checking for XOpenDisplay in -lX11" >&5
16430 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
16431 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
16432   echo $ECHO_N "(cached) $ECHO_C" >&6
16433 else
16434   ac_check_lib_save_LIBS=$LIBS
16435 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
16436 cat >"conftest.$ac_ext" <<_ACEOF
16437 #line 16437 "configure"
16438 #include "confdefs.h"
16439
16440 /* Override any gcc2 internal prototype to avoid an error.  */
16441 #ifdef __cplusplus
16442 extern "C"
16443 #endif
16444 /* We use char because int might match the return type of a gcc2
16445    builtin and then its argument prototype would still apply.  */
16446 char XOpenDisplay ();
16447 int
16448 main (void)
16449 {
16450 XOpenDisplay ();
16451   ;
16452   return 0;
16453 }
16454 _ACEOF
16455 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16456 if { (eval echo "$as_me:16456: \"$ac_link\"") >&5
16457   (eval $ac_link) 2>&5
16458   ac_status=$?
16459   echo "$as_me:16459: \$? = $ac_status" >&5
16460   (exit "$ac_status"); } &&
16461          { ac_try='test -s "conftest$ac_exeext"'
16462   { (eval echo "$as_me:16462: \"$ac_try\"") >&5
16463   (eval $ac_try) 2>&5
16464   ac_status=$?
16465   echo "$as_me:16465: \$? = $ac_status" >&5
16466   (exit "$ac_status"); }; }; then
16467   ac_cv_lib_X11_XOpenDisplay=yes
16468 else
16469   echo "$as_me: failed program was:" >&5
16470 cat "conftest.$ac_ext" >&5
16471 ac_cv_lib_X11_XOpenDisplay=no
16472 fi
16473 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16474 LIBS=$ac_check_lib_save_LIBS
16475 fi
16476 echo "$as_me:16476: result: $ac_cv_lib_X11_XOpenDisplay" >&5
16477 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
16478 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
16479
16480 cf_add_libs="$LIBS"
16481 # reverse order
16482 cf_add_0lib=
16483 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16484 # filter duplicates
16485 for cf_add_1lib in $cf_add_0lib; do
16486         for cf_add_2lib in $cf_add_libs; do
16487                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16488                         cf_add_1lib=
16489                         break
16490                 fi
16491         done
16492         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16493 done
16494 LIBS="$cf_add_libs"
16495
16496 fi
16497
16498 echo "$as_me:16498: checking for XCurses library" >&5
16499 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
16500 if test "${cf_cv_lib_XCurses+set}" = set; then
16501   echo $ECHO_N "(cached) $ECHO_C" >&6
16502 else
16503
16504 cf_add_libs="$LIBS"
16505 # reverse order
16506 cf_add_0lib=
16507 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16508 # filter duplicates
16509 for cf_add_1lib in $cf_add_0lib; do
16510         for cf_add_2lib in $cf_add_libs; do
16511                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16512                         cf_add_1lib=
16513                         break
16514                 fi
16515         done
16516         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16517 done
16518 LIBS="$cf_add_libs"
16519
16520 cat >"conftest.$ac_ext" <<_ACEOF
16521 #line 16521 "configure"
16522 #include "confdefs.h"
16523
16524 #include <xcurses.h>
16525 char *XCursesProgramName = "test";
16526
16527 int
16528 main (void)
16529 {
16530 XCursesExit();
16531   ;
16532   return 0;
16533 }
16534 _ACEOF
16535 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16536 if { (eval echo "$as_me:16536: \"$ac_link\"") >&5
16537   (eval $ac_link) 2>&5
16538   ac_status=$?
16539   echo "$as_me:16539: \$? = $ac_status" >&5
16540   (exit "$ac_status"); } &&
16541          { ac_try='test -s "conftest$ac_exeext"'
16542   { (eval echo "$as_me:16542: \"$ac_try\"") >&5
16543   (eval $ac_try) 2>&5
16544   ac_status=$?
16545   echo "$as_me:16545: \$? = $ac_status" >&5
16546   (exit "$ac_status"); }; }; then
16547   cf_cv_lib_XCurses=yes
16548 else
16549   echo "$as_me: failed program was:" >&5
16550 cat "conftest.$ac_ext" >&5
16551 cf_cv_lib_XCurses=no
16552 fi
16553 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16554
16555 fi
16556 echo "$as_me:16556: result: $cf_cv_lib_XCurses" >&5
16557 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
16558
16559 fi
16560
16561 if test "$cf_cv_lib_XCurses" = yes ; then
16562
16563 cat >>confdefs.h <<\EOF
16564 #define UNIX 1
16565 EOF
16566
16567 cat >>confdefs.h <<\EOF
16568 #define XCURSES 1
16569 EOF
16570
16571         echo "$as_me:16571: checking for xcurses.h" >&5
16572 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
16573 if test "${ac_cv_header_xcurses_h+set}" = set; then
16574   echo $ECHO_N "(cached) $ECHO_C" >&6
16575 else
16576   cat >"conftest.$ac_ext" <<_ACEOF
16577 #line 16577 "configure"
16578 #include "confdefs.h"
16579 #include <xcurses.h>
16580 _ACEOF
16581 if { (eval echo "$as_me:16581: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16582   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16583   ac_status=$?
16584   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16585   rm -f conftest.er1
16586   cat conftest.err >&5
16587   echo "$as_me:16587: \$? = $ac_status" >&5
16588   (exit "$ac_status"); } >/dev/null; then
16589   if test -s conftest.err; then
16590     ac_cpp_err=$ac_c_preproc_warn_flag
16591   else
16592     ac_cpp_err=
16593   fi
16594 else
16595   ac_cpp_err=yes
16596 fi
16597 if test -z "$ac_cpp_err"; then
16598   ac_cv_header_xcurses_h=yes
16599 else
16600   echo "$as_me: failed program was:" >&5
16601   cat "conftest.$ac_ext" >&5
16602   ac_cv_header_xcurses_h=no
16603 fi
16604 rm -f conftest.err "conftest.$ac_ext"
16605 fi
16606 echo "$as_me:16606: result: $ac_cv_header_xcurses_h" >&5
16607 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
16608 if test "$ac_cv_header_xcurses_h" = yes; then
16609
16610 cat >>confdefs.h <<\EOF
16611 #define HAVE_XCURSES 1
16612 EOF
16613
16614 fi
16615
16616 else
16617         { { echo "$as_me:16617: error: Cannot link with XCurses" >&5
16618 echo "$as_me: error: Cannot link with XCurses" >&2;}
16619    { (exit 1); exit 1; }; }
16620 fi
16621
16622         ;;
16623 (*)
16624         { { echo "$as_me:16624: error: unexpected screen-value: $cf_cv_screen" >&5
16625 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
16626    { (exit 1); exit 1; }; }
16627         ;;
16628 esac
16629
16630 : ${cf_nculib_root:=$cf_cv_screen}
16631 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
16632 echo "$as_me:16632: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
16633 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
16634 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16635   echo $ECHO_N "(cached) $ECHO_C" >&6
16636 else
16637   ac_check_lib_save_LIBS=$LIBS
16638 LIBS="-l$cf_nculib_root  $LIBS"
16639 cat >"conftest.$ac_ext" <<_ACEOF
16640 #line 16640 "configure"
16641 #include "confdefs.h"
16642
16643 /* Override any gcc2 internal prototype to avoid an error.  */
16644 #ifdef __cplusplus
16645 extern "C"
16646 #endif
16647 /* We use char because int might match the return type of a gcc2
16648    builtin and then its argument prototype would still apply.  */
16649 char _nc_init_pthreads ();
16650 int
16651 main (void)
16652 {
16653 _nc_init_pthreads ();
16654   ;
16655   return 0;
16656 }
16657 _ACEOF
16658 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16659 if { (eval echo "$as_me:16659: \"$ac_link\"") >&5
16660   (eval $ac_link) 2>&5
16661   ac_status=$?
16662   echo "$as_me:16662: \$? = $ac_status" >&5
16663   (exit "$ac_status"); } &&
16664          { ac_try='test -s "conftest$ac_exeext"'
16665   { (eval echo "$as_me:16665: \"$ac_try\"") >&5
16666   (eval $ac_try) 2>&5
16667   ac_status=$?
16668   echo "$as_me:16668: \$? = $ac_status" >&5
16669   (exit "$ac_status"); }; }; then
16670   eval "$as_ac_Lib=yes"
16671 else
16672   echo "$as_me: failed program was:" >&5
16673 cat "conftest.$ac_ext" >&5
16674 eval "$as_ac_Lib=no"
16675 fi
16676 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16677 LIBS=$ac_check_lib_save_LIBS
16678 fi
16679 echo "$as_me:16679: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16680 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16681 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16682   cf_cv_ncurses_pthreads=yes
16683 else
16684   cf_cv_ncurses_pthreads=no
16685 fi
16686
16687 if test "$cf_cv_ncurses_pthreads" = yes
16688 then
16689
16690 cf_add_libs="$LIBS"
16691 # reverse order
16692 cf_add_0lib=
16693 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16694 # filter duplicates
16695 for cf_add_1lib in $cf_add_0lib; do
16696         for cf_add_2lib in $cf_add_libs; do
16697                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16698                         cf_add_1lib=
16699                         break
16700                 fi
16701         done
16702         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16703 done
16704 LIBS="$cf_add_libs"
16705
16706 fi
16707
16708 case $cf_cv_screen in
16709 (ncurses*)
16710         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
16711         ;;
16712 esac
16713
16714 echo "$as_me:16714: checking for X11 rgb file" >&5
16715 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
16716
16717 # Check whether --with-x11-rgb or --without-x11-rgb was given.
16718 if test "${with_x11_rgb+set}" = set; then
16719   withval="$with_x11_rgb"
16720   RGB_PATH=$withval
16721 else
16722   RGB_PATH=auto
16723 fi;
16724
16725 if test "x$RGB_PATH" = xauto
16726 then
16727         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
16728         for cf_path in \
16729                 /opt/local/share/X11/rgb.txt \
16730                 /opt/X11/share/X11/rgb.txt \
16731                 /usr/share/X11/rgb.txt \
16732                 /usr/X11/share/X11/rgb.txt \
16733                 /usr/X11/lib/X11/rgb.txt \
16734                 /usr/lib/X11/rgb.txt \
16735                 /etc/X11/rgb.txt \
16736                 /usr/pkg/lib/X11/rgb.txt \
16737                 /usr/X11R7/lib/X11/rgb.txt \
16738                 /usr/X11R6/lib/X11/rgb.txt \
16739                 /usr/X11R5/lib/X11/rgb.txt \
16740                 /usr/X11R4/lib/X11/rgb.txt \
16741                 /usr/local/lib/X11/rgb.txt \
16742                 /usr/local/share/X11/rgb.txt \
16743                 /usr/lib64/X11/rgb.txt
16744         do
16745                 if test -f "$cf_path" ; then
16746                         RGB_PATH="$cf_path"
16747                         break
16748                 fi
16749         done
16750 else
16751         cf_path=$RGB_PATH
16752
16753 if test "x$prefix" != xNONE; then
16754         cf_path_syntax="$prefix"
16755 else
16756         cf_path_syntax="$ac_default_prefix"
16757 fi
16758
16759 case ".$cf_path" in
16760 (.\$\(*\)*|.\'*\'*)
16761         ;;
16762 (..|./*|.\\*)
16763         ;;
16764 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16765         ;;
16766 (.\$\{*prefix\}*|.\$\{*dir\}*)
16767         eval cf_path="$cf_path"
16768         case ".$cf_path" in
16769         (.NONE/*)
16770                 cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16771                 ;;
16772         esac
16773         ;;
16774 (.no|.NONE/*)
16775         cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16776         ;;
16777 (*)
16778         { { echo "$as_me:16778: error: expected a pathname, not \"$cf_path\"" >&5
16779 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
16780    { (exit 1); exit 1; }; }
16781         ;;
16782 esac
16783
16784 fi
16785
16786 echo "$as_me:16786: result: $RGB_PATH" >&5
16787 echo "${ECHO_T}$RGB_PATH" >&6
16788
16789 cat >>confdefs.h <<EOF
16790 #define RGB_PATH "$cf_path"
16791 EOF
16792
16793 no_x11_rgb=
16794 if test "$RGB_PATH" = no
16795 then
16796         no_x11_rgb="#"
16797 fi
16798
16799 cf_curses_headers=
16800
16801 case $cf_cv_screen in
16802 (pdcurses)
16803         cf_default_panel=no
16804         cf_default_form=no
16805         cf_default_menu=no
16806         cf_default_tinfo=no
16807         ;;
16808 (xcurses|bsdcurses)
16809         cf_default_panel=no
16810         cf_default_form=no
16811         cf_default_menu=no
16812         cf_default_tinfo=yes
16813         ;;
16814 (*)
16815         cf_default_panel=yes
16816         cf_default_form=yes
16817         cf_default_menu=yes
16818         cf_default_tinfo=yes
16819         case $cf_cv_screen in
16820         (ncurses*)
16821                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16822                 ;;
16823         esac
16824         ;;
16825 esac
16826
16827 echo "$as_me:16827: checking for desired basename for form library" >&5
16828 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16829
16830 # Check whether --with-form-libname or --without-form-libname was given.
16831 if test "${with_form_libname+set}" = set; then
16832   withval="$with_form_libname"
16833   with_lib_basename=$withval
16834 else
16835   with_lib_basename=form
16836 fi;
16837 FORM_NAME="$with_lib_basename"
16838
16839 case "x$FORM_NAME" in
16840 (x|xno|xnone|xyes)
16841         FORM_NAME=form
16842         ;;
16843 (*)
16844         ;;
16845 esac
16846
16847 echo "$as_me:16847: result: $FORM_NAME" >&5
16848 echo "${ECHO_T}$FORM_NAME" >&6
16849
16850 echo "$as_me:16850: checking for desired basename for menu library" >&5
16851 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16852
16853 # Check whether --with-menu-libname or --without-menu-libname was given.
16854 if test "${with_menu_libname+set}" = set; then
16855   withval="$with_menu_libname"
16856   with_lib_basename=$withval
16857 else
16858   with_lib_basename=menu
16859 fi;
16860 MENU_NAME="$with_lib_basename"
16861
16862 case "x$MENU_NAME" in
16863 (x|xno|xnone|xyes)
16864         MENU_NAME=menu
16865         ;;
16866 (*)
16867         ;;
16868 esac
16869
16870 echo "$as_me:16870: result: $MENU_NAME" >&5
16871 echo "${ECHO_T}$MENU_NAME" >&6
16872
16873 echo "$as_me:16873: checking for desired basename for panel library" >&5
16874 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16875
16876 # Check whether --with-panel-libname or --without-panel-libname was given.
16877 if test "${with_panel_libname+set}" = set; then
16878   withval="$with_panel_libname"
16879   with_lib_basename=$withval
16880 else
16881   with_lib_basename=panel
16882 fi;
16883 PANEL_NAME="$with_lib_basename"
16884
16885 case "x$PANEL_NAME" in
16886 (x|xno|xnone|xyes)
16887         PANEL_NAME=panel
16888         ;;
16889 (*)
16890         ;;
16891 esac
16892
16893 echo "$as_me:16893: result: $PANEL_NAME" >&5
16894 echo "${ECHO_T}$PANEL_NAME" >&6
16895
16896 echo "$as_me:16896: checking if you want to check for panel functions" >&5
16897 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16898
16899 # Check whether --enable-panel or --disable-panel was given.
16900 if test "${enable_panel+set}" = set; then
16901   enableval="$enable_panel"
16902   test "$enableval" != no && enableval=yes
16903         if test "$enableval" != "yes" ; then
16904     cf_enable_panel=no
16905         else
16906                 cf_enable_panel=$cf_default_panel
16907         fi
16908 else
16909   enableval=yes
16910         cf_enable_panel=$cf_default_panel
16911
16912 fi;
16913 echo "$as_me:16913: result: $cf_enable_panel" >&5
16914 echo "${ECHO_T}$cf_enable_panel" >&6
16915 if test $cf_enable_panel = yes
16916 then
16917
16918 cf_have_curses_lib=no
16919
16920 : ${NCURSES_CONFIG_PKG:=none}
16921 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16922         :
16923 elif test "x${PKG_CONFIG:=none}" != xnone; then
16924         echo "$as_me:16924: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16925 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16926         if "$PKG_CONFIG" --exists "$PANEL_NAME$cf_cv_libtype" ; then
16927                 echo "$as_me:16927: result: yes" >&5
16928 echo "${ECHO_T}yes" >&6
16929
16930                 echo "$as_me:16930: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16931 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16932
16933                 cf_save_CPPFLAGS="$CPPFLAGS"
16934                 cf_save_LIBS="$LIBS"
16935
16936 cf_fix_cppflags=no
16937 cf_new_cflags=
16938 cf_new_cppflags=
16939 cf_new_extra_cppflags=
16940
16941 for cf_add_cflags in `$PKG_CONFIG --cflags "$PANEL_NAME$cf_cv_libtype"`
16942 do
16943 case "$cf_fix_cppflags" in
16944 (no)
16945         case "$cf_add_cflags" in
16946         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16947                 case "$cf_add_cflags" in
16948                 (-D*)
16949                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16950
16951                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16952                                 && test -z "${cf_tst_cflags}" \
16953                                 && cf_fix_cppflags=yes
16954
16955                         if test "$cf_fix_cppflags" = yes ; then
16956
16957         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16958         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16959
16960                                 continue
16961                         elif test "${cf_tst_cflags}" = "\"'" ; then
16962
16963         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16964         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16965
16966                                 continue
16967                         fi
16968                         ;;
16969                 esac
16970                 case "$CPPFLAGS" in
16971                 (*$cf_add_cflags)
16972                         ;;
16973                 (*)
16974                         case "$cf_add_cflags" in
16975                         (-D*)
16976                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16977
16978 CPPFLAGS=`echo "$CPPFLAGS" | \
16979         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16980                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16981
16982                                 ;;
16983                         esac
16984
16985         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16986         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16987
16988                         ;;
16989                 esac
16990                 ;;
16991         (*)
16992
16993         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16994         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16995
16996                 ;;
16997         esac
16998         ;;
16999 (yes)
17000
17001         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17002         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17003
17004         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17005
17006         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17007                 && test -z "${cf_tst_cflags}" \
17008                 && cf_fix_cppflags=no
17009         ;;
17010 esac
17011 done
17012
17013 if test -n "$cf_new_cflags" ; then
17014
17015         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17016         CFLAGS="${CFLAGS}$cf_new_cflags"
17017
17018 fi
17019
17020 if test -n "$cf_new_cppflags" ; then
17021
17022         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17023         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17024
17025 fi
17026
17027 if test -n "$cf_new_extra_cppflags" ; then
17028
17029         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17030         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17031
17032 fi
17033
17034 cf_add_libs="$LIBS"
17035 # reverse order
17036 cf_add_0lib=
17037 for cf_add_1lib in `$PKG_CONFIG --libs "$PANEL_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17038 # filter duplicates
17039 for cf_add_1lib in $cf_add_0lib; do
17040         for cf_add_2lib in $cf_add_libs; do
17041                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17042                         cf_add_1lib=
17043                         break
17044                 fi
17045         done
17046         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17047 done
17048 LIBS="$cf_add_libs"
17049
17050                 cat >"conftest.$ac_ext" <<_ACEOF
17051 #line 17051 "configure"
17052 #include "confdefs.h"
17053 #include <$PANEL_NAME.h>
17054 int
17055 main (void)
17056 {
17057 (void) new_panel ( 0 );
17058   ;
17059   return 0;
17060 }
17061 _ACEOF
17062 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17063 if { (eval echo "$as_me:17063: \"$ac_link\"") >&5
17064   (eval $ac_link) 2>&5
17065   ac_status=$?
17066   echo "$as_me:17066: \$? = $ac_status" >&5
17067   (exit "$ac_status"); } &&
17068          { ac_try='test -s "conftest$ac_exeext"'
17069   { (eval echo "$as_me:17069: \"$ac_try\"") >&5
17070   (eval $ac_try) 2>&5
17071   ac_status=$?
17072   echo "$as_me:17072: \$? = $ac_status" >&5
17073   (exit "$ac_status"); }; }; then
17074   if test "$cross_compiling" = yes; then
17075   cf_have_curses_lib=maybe
17076 else
17077   cat >"conftest.$ac_ext" <<_ACEOF
17078 #line 17078 "configure"
17079 #include "confdefs.h"
17080 #include <$PANEL_NAME.h>
17081                                 int main(void)
17082                                 { (void) new_panel ( 0 ); return 0; }
17083 _ACEOF
17084 rm -f "conftest$ac_exeext"
17085 if { (eval echo "$as_me:17085: \"$ac_link\"") >&5
17086   (eval $ac_link) 2>&5
17087   ac_status=$?
17088   echo "$as_me:17088: \$? = $ac_status" >&5
17089   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17090   { (eval echo "$as_me:17090: \"$ac_try\"") >&5
17091   (eval $ac_try) 2>&5
17092   ac_status=$?
17093   echo "$as_me:17093: \$? = $ac_status" >&5
17094   (exit "$ac_status"); }; }; then
17095   cf_have_curses_lib=yes
17096 else
17097   echo "$as_me: program exited with status $ac_status" >&5
17098 echo "$as_me: failed program was:" >&5
17099 cat "conftest.$ac_ext" >&5
17100 cf_have_curses_lib=no
17101 fi
17102 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17103 fi
17104 else
17105   echo "$as_me: failed program was:" >&5
17106 cat "conftest.$ac_ext" >&5
17107 cf_have_curses_lib=no
17108 fi
17109 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17110                 echo "$as_me:17110: result: $cf_have_curses_lib" >&5
17111 echo "${ECHO_T}$cf_have_curses_lib" >&6
17112                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17113                 if test "$cf_have_curses_lib" != "yes"
17114                 then
17115                         CPPFLAGS="$cf_save_CPPFLAGS"
17116                         LIBS="$cf_save_LIBS"
17117                 else
17118
17119 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17120
17121                         cat >>confdefs.h <<EOF
17122 #define $cf_upper 1
17123 EOF
17124
17125                 fi
17126         fi
17127 fi
17128 if test "$cf_have_curses_lib" = no; then
17129         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
17130 echo "$as_me:17130: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
17131 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
17132 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17133   echo $ECHO_N "(cached) $ECHO_C" >&6
17134 else
17135   ac_check_lib_save_LIBS=$LIBS
17136 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
17137 cat >"conftest.$ac_ext" <<_ACEOF
17138 #line 17138 "configure"
17139 #include "confdefs.h"
17140
17141 /* Override any gcc2 internal prototype to avoid an error.  */
17142 #ifdef __cplusplus
17143 extern "C"
17144 #endif
17145 /* We use char because int might match the return type of a gcc2
17146    builtin and then its argument prototype would still apply.  */
17147 char new_panel ();
17148 int
17149 main (void)
17150 {
17151 new_panel ();
17152   ;
17153   return 0;
17154 }
17155 _ACEOF
17156 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17157 if { (eval echo "$as_me:17157: \"$ac_link\"") >&5
17158   (eval $ac_link) 2>&5
17159   ac_status=$?
17160   echo "$as_me:17160: \$? = $ac_status" >&5
17161   (exit "$ac_status"); } &&
17162          { ac_try='test -s "conftest$ac_exeext"'
17163   { (eval echo "$as_me:17163: \"$ac_try\"") >&5
17164   (eval $ac_try) 2>&5
17165   ac_status=$?
17166   echo "$as_me:17166: \$? = $ac_status" >&5
17167   (exit "$ac_status"); }; }; then
17168   eval "$as_ac_Lib=yes"
17169 else
17170   echo "$as_me: failed program was:" >&5
17171 cat "conftest.$ac_ext" >&5
17172 eval "$as_ac_Lib=no"
17173 fi
17174 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17175 LIBS=$ac_check_lib_save_LIBS
17176 fi
17177 echo "$as_me:17177: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17178 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17179 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17180
17181 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17182
17183 cf_add_libs="$LIBS"
17184 # reverse order
17185 cf_add_0lib=
17186 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17187 # filter duplicates
17188 for cf_add_1lib in $cf_add_0lib; do
17189         for cf_add_2lib in $cf_add_libs; do
17190                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17191                         cf_add_1lib=
17192                         break
17193                 fi
17194         done
17195         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17196 done
17197 LIBS="$cf_add_libs"
17198
17199                 cat >>confdefs.h <<EOF
17200 #define $cf_upper 1
17201 EOF
17202
17203 fi
17204
17205 fi
17206
17207         cf_curses_headers="$cf_curses_headers panel.h"
17208 fi
17209
17210 echo "$as_me:17210: checking if you want to check for menu functions" >&5
17211 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
17212
17213 # Check whether --enable-menu or --disable-menu was given.
17214 if test "${enable_menu+set}" = set; then
17215   enableval="$enable_menu"
17216   test "$enableval" != no && enableval=yes
17217         if test "$enableval" != "yes" ; then
17218     cf_enable_menu=no
17219         else
17220                 cf_enable_menu=$cf_default_menu
17221         fi
17222 else
17223   enableval=yes
17224         cf_enable_menu=$cf_default_menu
17225
17226 fi;
17227 echo "$as_me:17227: result: $cf_enable_menu" >&5
17228 echo "${ECHO_T}$cf_enable_menu" >&6
17229 if test $cf_enable_menu = yes
17230 then
17231         case $cf_cv_screen in
17232         (ncurses*)
17233                 ;;
17234         (curses*)
17235
17236 echo "$as_me:17236: checking for NetBSD menu.h" >&5
17237 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
17238 if test "${cf_cv_netbsd_menu_h+set}" = set; then
17239   echo $ECHO_N "(cached) $ECHO_C" >&6
17240 else
17241
17242 cat >"conftest.$ac_ext" <<_ACEOF
17243 #line 17243 "configure"
17244 #include "confdefs.h"
17245
17246 #include <${cf_cv_ncurses_header:-curses.h}>
17247 #include <menu.h>
17248
17249 int
17250 main (void)
17251 {
17252
17253         MENU *menu;
17254         int y = menu->max_item_width;
17255
17256   ;
17257   return 0;
17258 }
17259 _ACEOF
17260 rm -f "conftest.$ac_objext"
17261 if { (eval echo "$as_me:17261: \"$ac_compile\"") >&5
17262   (eval $ac_compile) 2>&5
17263   ac_status=$?
17264   echo "$as_me:17264: \$? = $ac_status" >&5
17265   (exit "$ac_status"); } &&
17266          { ac_try='test -s "conftest.$ac_objext"'
17267   { (eval echo "$as_me:17267: \"$ac_try\"") >&5
17268   (eval $ac_try) 2>&5
17269   ac_status=$?
17270   echo "$as_me:17270: \$? = $ac_status" >&5
17271   (exit "$ac_status"); }; }; then
17272   cf_cv_netbsd_menu_h=yes
17273
17274 else
17275   echo "$as_me: failed program was:" >&5
17276 cat "conftest.$ac_ext" >&5
17277 cf_cv_netbsd_menu_h=no
17278 fi
17279 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17280
17281 fi
17282 echo "$as_me:17282: result: $cf_cv_netbsd_menu_h" >&5
17283 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
17284
17285 test "$cf_cv_netbsd_menu_h" = yes &&
17286 cat >>confdefs.h <<\EOF
17287 #define HAVE_NETBSD_MENU_H 1
17288 EOF
17289
17290                 ;;
17291         esac
17292
17293 cf_have_curses_lib=no
17294
17295 : ${NCURSES_CONFIG_PKG:=none}
17296 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17297         :
17298 elif test "x${PKG_CONFIG:=none}" != xnone; then
17299         echo "$as_me:17299: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
17300 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17301         if "$PKG_CONFIG" --exists "$MENU_NAME$cf_cv_libtype" ; then
17302                 echo "$as_me:17302: result: yes" >&5
17303 echo "${ECHO_T}yes" >&6
17304
17305                 echo "$as_me:17305: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
17306 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17307
17308                 cf_save_CPPFLAGS="$CPPFLAGS"
17309                 cf_save_LIBS="$LIBS"
17310
17311 cf_fix_cppflags=no
17312 cf_new_cflags=
17313 cf_new_cppflags=
17314 cf_new_extra_cppflags=
17315
17316 for cf_add_cflags in `$PKG_CONFIG --cflags "$MENU_NAME$cf_cv_libtype"`
17317 do
17318 case "$cf_fix_cppflags" in
17319 (no)
17320         case "$cf_add_cflags" in
17321         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17322                 case "$cf_add_cflags" in
17323                 (-D*)
17324                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17325
17326                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17327                                 && test -z "${cf_tst_cflags}" \
17328                                 && cf_fix_cppflags=yes
17329
17330                         if test "$cf_fix_cppflags" = yes ; then
17331
17332         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17333         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17334
17335                                 continue
17336                         elif test "${cf_tst_cflags}" = "\"'" ; then
17337
17338         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17339         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17340
17341                                 continue
17342                         fi
17343                         ;;
17344                 esac
17345                 case "$CPPFLAGS" in
17346                 (*$cf_add_cflags)
17347                         ;;
17348                 (*)
17349                         case "$cf_add_cflags" in
17350                         (-D*)
17351                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17352
17353 CPPFLAGS=`echo "$CPPFLAGS" | \
17354         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17355                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17356
17357                                 ;;
17358                         esac
17359
17360         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17361         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17362
17363                         ;;
17364                 esac
17365                 ;;
17366         (*)
17367
17368         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17369         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17370
17371                 ;;
17372         esac
17373         ;;
17374 (yes)
17375
17376         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17377         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17378
17379         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17380
17381         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17382                 && test -z "${cf_tst_cflags}" \
17383                 && cf_fix_cppflags=no
17384         ;;
17385 esac
17386 done
17387
17388 if test -n "$cf_new_cflags" ; then
17389
17390         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17391         CFLAGS="${CFLAGS}$cf_new_cflags"
17392
17393 fi
17394
17395 if test -n "$cf_new_cppflags" ; then
17396
17397         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17398         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17399
17400 fi
17401
17402 if test -n "$cf_new_extra_cppflags" ; then
17403
17404         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17405         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17406
17407 fi
17408
17409 cf_add_libs="$LIBS"
17410 # reverse order
17411 cf_add_0lib=
17412 for cf_add_1lib in `$PKG_CONFIG --libs "$MENU_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17413 # filter duplicates
17414 for cf_add_1lib in $cf_add_0lib; do
17415         for cf_add_2lib in $cf_add_libs; do
17416                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17417                         cf_add_1lib=
17418                         break
17419                 fi
17420         done
17421         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17422 done
17423 LIBS="$cf_add_libs"
17424
17425                 cat >"conftest.$ac_ext" <<_ACEOF
17426 #line 17426 "configure"
17427 #include "confdefs.h"
17428 #include <$MENU_NAME.h>
17429 int
17430 main (void)
17431 {
17432 (void) menu_driver ( 0,0 );
17433   ;
17434   return 0;
17435 }
17436 _ACEOF
17437 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17438 if { (eval echo "$as_me:17438: \"$ac_link\"") >&5
17439   (eval $ac_link) 2>&5
17440   ac_status=$?
17441   echo "$as_me:17441: \$? = $ac_status" >&5
17442   (exit "$ac_status"); } &&
17443          { ac_try='test -s "conftest$ac_exeext"'
17444   { (eval echo "$as_me:17444: \"$ac_try\"") >&5
17445   (eval $ac_try) 2>&5
17446   ac_status=$?
17447   echo "$as_me:17447: \$? = $ac_status" >&5
17448   (exit "$ac_status"); }; }; then
17449   if test "$cross_compiling" = yes; then
17450   cf_have_curses_lib=maybe
17451 else
17452   cat >"conftest.$ac_ext" <<_ACEOF
17453 #line 17453 "configure"
17454 #include "confdefs.h"
17455 #include <$MENU_NAME.h>
17456                                 int main(void)
17457                                 { (void) menu_driver ( 0,0 ); return 0; }
17458 _ACEOF
17459 rm -f "conftest$ac_exeext"
17460 if { (eval echo "$as_me:17460: \"$ac_link\"") >&5
17461   (eval $ac_link) 2>&5
17462   ac_status=$?
17463   echo "$as_me:17463: \$? = $ac_status" >&5
17464   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17465   { (eval echo "$as_me:17465: \"$ac_try\"") >&5
17466   (eval $ac_try) 2>&5
17467   ac_status=$?
17468   echo "$as_me:17468: \$? = $ac_status" >&5
17469   (exit "$ac_status"); }; }; then
17470   cf_have_curses_lib=yes
17471 else
17472   echo "$as_me: program exited with status $ac_status" >&5
17473 echo "$as_me: failed program was:" >&5
17474 cat "conftest.$ac_ext" >&5
17475 cf_have_curses_lib=no
17476 fi
17477 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17478 fi
17479 else
17480   echo "$as_me: failed program was:" >&5
17481 cat "conftest.$ac_ext" >&5
17482 cf_have_curses_lib=no
17483 fi
17484 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17485                 echo "$as_me:17485: result: $cf_have_curses_lib" >&5
17486 echo "${ECHO_T}$cf_have_curses_lib" >&6
17487                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17488                 if test "$cf_have_curses_lib" != "yes"
17489                 then
17490                         CPPFLAGS="$cf_save_CPPFLAGS"
17491                         LIBS="$cf_save_LIBS"
17492                 else
17493
17494 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17495
17496                         cat >>confdefs.h <<EOF
17497 #define $cf_upper 1
17498 EOF
17499
17500                 fi
17501         fi
17502 fi
17503 if test "$cf_have_curses_lib" = no; then
17504         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
17505 echo "$as_me:17505: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
17506 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17507 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17508   echo $ECHO_N "(cached) $ECHO_C" >&6
17509 else
17510   ac_check_lib_save_LIBS=$LIBS
17511 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
17512 cat >"conftest.$ac_ext" <<_ACEOF
17513 #line 17513 "configure"
17514 #include "confdefs.h"
17515
17516 /* Override any gcc2 internal prototype to avoid an error.  */
17517 #ifdef __cplusplus
17518 extern "C"
17519 #endif
17520 /* We use char because int might match the return type of a gcc2
17521    builtin and then its argument prototype would still apply.  */
17522 char menu_driver ();
17523 int
17524 main (void)
17525 {
17526 menu_driver ();
17527   ;
17528   return 0;
17529 }
17530 _ACEOF
17531 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17532 if { (eval echo "$as_me:17532: \"$ac_link\"") >&5
17533   (eval $ac_link) 2>&5
17534   ac_status=$?
17535   echo "$as_me:17535: \$? = $ac_status" >&5
17536   (exit "$ac_status"); } &&
17537          { ac_try='test -s "conftest$ac_exeext"'
17538   { (eval echo "$as_me:17538: \"$ac_try\"") >&5
17539   (eval $ac_try) 2>&5
17540   ac_status=$?
17541   echo "$as_me:17541: \$? = $ac_status" >&5
17542   (exit "$ac_status"); }; }; then
17543   eval "$as_ac_Lib=yes"
17544 else
17545   echo "$as_me: failed program was:" >&5
17546 cat "conftest.$ac_ext" >&5
17547 eval "$as_ac_Lib=no"
17548 fi
17549 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17550 LIBS=$ac_check_lib_save_LIBS
17551 fi
17552 echo "$as_me:17552: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17553 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17554 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17555
17556 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17557
17558 cf_add_libs="$LIBS"
17559 # reverse order
17560 cf_add_0lib=
17561 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17562 # filter duplicates
17563 for cf_add_1lib in $cf_add_0lib; do
17564         for cf_add_2lib in $cf_add_libs; do
17565                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17566                         cf_add_1lib=
17567                         break
17568                 fi
17569         done
17570         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17571 done
17572 LIBS="$cf_add_libs"
17573
17574                 cat >>confdefs.h <<EOF
17575 #define $cf_upper 1
17576 EOF
17577
17578 fi
17579
17580 fi
17581
17582         cf_curses_headers="$cf_curses_headers menu.h"
17583 fi
17584
17585 echo "$as_me:17585: checking if you want to check for form functions" >&5
17586 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
17587
17588 # Check whether --enable-form or --disable-form was given.
17589 if test "${enable_form+set}" = set; then
17590   enableval="$enable_form"
17591   test "$enableval" != no && enableval=yes
17592         if test "$enableval" != "yes" ; then
17593     cf_enable_form=no
17594         else
17595                 cf_enable_form=$cf_default_form
17596         fi
17597 else
17598   enableval=yes
17599         cf_enable_form=$cf_default_form
17600
17601 fi;
17602 echo "$as_me:17602: result: $cf_enable_form" >&5
17603 echo "${ECHO_T}$cf_enable_form" >&6
17604 if test $cf_enable_form = yes
17605 then
17606         case $cf_cv_screen in
17607         (ncurses*)
17608                 ;;
17609         (curses*)
17610
17611 echo "$as_me:17611: checking for NetBSD form.h" >&5
17612 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
17613 if test "${cf_cv_netbsd_form_h+set}" = set; then
17614   echo $ECHO_N "(cached) $ECHO_C" >&6
17615 else
17616
17617 cat >"conftest.$ac_ext" <<_ACEOF
17618 #line 17618 "configure"
17619 #include "confdefs.h"
17620
17621 #include <${cf_cv_ncurses_header:-curses.h}>
17622 #include <form.h>
17623
17624 int
17625 main (void)
17626 {
17627
17628         FORM *form;
17629         int y = current_field(form)->cursor_ypos;
17630         int x = current_field(form)->cursor_xpos;
17631
17632   ;
17633   return 0;
17634 }
17635 _ACEOF
17636 rm -f "conftest.$ac_objext"
17637 if { (eval echo "$as_me:17637: \"$ac_compile\"") >&5
17638   (eval $ac_compile) 2>&5
17639   ac_status=$?
17640   echo "$as_me:17640: \$? = $ac_status" >&5
17641   (exit "$ac_status"); } &&
17642          { ac_try='test -s "conftest.$ac_objext"'
17643   { (eval echo "$as_me:17643: \"$ac_try\"") >&5
17644   (eval $ac_try) 2>&5
17645   ac_status=$?
17646   echo "$as_me:17646: \$? = $ac_status" >&5
17647   (exit "$ac_status"); }; }; then
17648   cf_cv_netbsd_form_h=yes
17649
17650 else
17651   echo "$as_me: failed program was:" >&5
17652 cat "conftest.$ac_ext" >&5
17653 cf_cv_netbsd_form_h=no
17654 fi
17655 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17656
17657 fi
17658 echo "$as_me:17658: result: $cf_cv_netbsd_form_h" >&5
17659 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
17660
17661 test "$cf_cv_netbsd_form_h" = yes &&
17662 cat >>confdefs.h <<\EOF
17663 #define HAVE_NETBSD_FORM_H 1
17664 EOF
17665
17666                 ;;
17667         esac
17668
17669 cf_have_curses_lib=no
17670
17671 : ${NCURSES_CONFIG_PKG:=none}
17672 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17673         :
17674 elif test "x${PKG_CONFIG:=none}" != xnone; then
17675         echo "$as_me:17675: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
17676 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17677         if "$PKG_CONFIG" --exists "$FORM_NAME$cf_cv_libtype" ; then
17678                 echo "$as_me:17678: result: yes" >&5
17679 echo "${ECHO_T}yes" >&6
17680
17681                 echo "$as_me:17681: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
17682 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17683
17684                 cf_save_CPPFLAGS="$CPPFLAGS"
17685                 cf_save_LIBS="$LIBS"
17686
17687 cf_fix_cppflags=no
17688 cf_new_cflags=
17689 cf_new_cppflags=
17690 cf_new_extra_cppflags=
17691
17692 for cf_add_cflags in `$PKG_CONFIG --cflags "$FORM_NAME$cf_cv_libtype"`
17693 do
17694 case "$cf_fix_cppflags" in
17695 (no)
17696         case "$cf_add_cflags" in
17697         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17698                 case "$cf_add_cflags" in
17699                 (-D*)
17700                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17701
17702                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17703                                 && test -z "${cf_tst_cflags}" \
17704                                 && cf_fix_cppflags=yes
17705
17706                         if test "$cf_fix_cppflags" = yes ; then
17707
17708         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17709         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17710
17711                                 continue
17712                         elif test "${cf_tst_cflags}" = "\"'" ; then
17713
17714         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17715         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17716
17717                                 continue
17718                         fi
17719                         ;;
17720                 esac
17721                 case "$CPPFLAGS" in
17722                 (*$cf_add_cflags)
17723                         ;;
17724                 (*)
17725                         case "$cf_add_cflags" in
17726                         (-D*)
17727                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17728
17729 CPPFLAGS=`echo "$CPPFLAGS" | \
17730         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17731                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17732
17733                                 ;;
17734                         esac
17735
17736         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17737         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17738
17739                         ;;
17740                 esac
17741                 ;;
17742         (*)
17743
17744         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17745         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17746
17747                 ;;
17748         esac
17749         ;;
17750 (yes)
17751
17752         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17753         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17754
17755         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17756
17757         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17758                 && test -z "${cf_tst_cflags}" \
17759                 && cf_fix_cppflags=no
17760         ;;
17761 esac
17762 done
17763
17764 if test -n "$cf_new_cflags" ; then
17765
17766         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17767         CFLAGS="${CFLAGS}$cf_new_cflags"
17768
17769 fi
17770
17771 if test -n "$cf_new_cppflags" ; then
17772
17773         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17774         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17775
17776 fi
17777
17778 if test -n "$cf_new_extra_cppflags" ; then
17779
17780         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17781         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17782
17783 fi
17784
17785 cf_add_libs="$LIBS"
17786 # reverse order
17787 cf_add_0lib=
17788 for cf_add_1lib in `$PKG_CONFIG --libs "$FORM_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17789 # filter duplicates
17790 for cf_add_1lib in $cf_add_0lib; do
17791         for cf_add_2lib in $cf_add_libs; do
17792                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17793                         cf_add_1lib=
17794                         break
17795                 fi
17796         done
17797         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17798 done
17799 LIBS="$cf_add_libs"
17800
17801                 cat >"conftest.$ac_ext" <<_ACEOF
17802 #line 17802 "configure"
17803 #include "confdefs.h"
17804 #include <$FORM_NAME.h>
17805 int
17806 main (void)
17807 {
17808 (void) form_driver ( 0,0 );
17809   ;
17810   return 0;
17811 }
17812 _ACEOF
17813 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17814 if { (eval echo "$as_me:17814: \"$ac_link\"") >&5
17815   (eval $ac_link) 2>&5
17816   ac_status=$?
17817   echo "$as_me:17817: \$? = $ac_status" >&5
17818   (exit "$ac_status"); } &&
17819          { ac_try='test -s "conftest$ac_exeext"'
17820   { (eval echo "$as_me:17820: \"$ac_try\"") >&5
17821   (eval $ac_try) 2>&5
17822   ac_status=$?
17823   echo "$as_me:17823: \$? = $ac_status" >&5
17824   (exit "$ac_status"); }; }; then
17825   if test "$cross_compiling" = yes; then
17826   cf_have_curses_lib=maybe
17827 else
17828   cat >"conftest.$ac_ext" <<_ACEOF
17829 #line 17829 "configure"
17830 #include "confdefs.h"
17831 #include <$FORM_NAME.h>
17832                                 int main(void)
17833                                 { (void) form_driver ( 0,0 ); return 0; }
17834 _ACEOF
17835 rm -f "conftest$ac_exeext"
17836 if { (eval echo "$as_me:17836: \"$ac_link\"") >&5
17837   (eval $ac_link) 2>&5
17838   ac_status=$?
17839   echo "$as_me:17839: \$? = $ac_status" >&5
17840   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17841   { (eval echo "$as_me:17841: \"$ac_try\"") >&5
17842   (eval $ac_try) 2>&5
17843   ac_status=$?
17844   echo "$as_me:17844: \$? = $ac_status" >&5
17845   (exit "$ac_status"); }; }; then
17846   cf_have_curses_lib=yes
17847 else
17848   echo "$as_me: program exited with status $ac_status" >&5
17849 echo "$as_me: failed program was:" >&5
17850 cat "conftest.$ac_ext" >&5
17851 cf_have_curses_lib=no
17852 fi
17853 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17854 fi
17855 else
17856   echo "$as_me: failed program was:" >&5
17857 cat "conftest.$ac_ext" >&5
17858 cf_have_curses_lib=no
17859 fi
17860 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17861                 echo "$as_me:17861: result: $cf_have_curses_lib" >&5
17862 echo "${ECHO_T}$cf_have_curses_lib" >&6
17863                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17864                 if test "$cf_have_curses_lib" != "yes"
17865                 then
17866                         CPPFLAGS="$cf_save_CPPFLAGS"
17867                         LIBS="$cf_save_LIBS"
17868                 else
17869
17870 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17871
17872                         cat >>confdefs.h <<EOF
17873 #define $cf_upper 1
17874 EOF
17875
17876                 fi
17877         fi
17878 fi
17879 if test "$cf_have_curses_lib" = no; then
17880         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17881 echo "$as_me:17881: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17882 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17883 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17884   echo $ECHO_N "(cached) $ECHO_C" >&6
17885 else
17886   ac_check_lib_save_LIBS=$LIBS
17887 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17888 cat >"conftest.$ac_ext" <<_ACEOF
17889 #line 17889 "configure"
17890 #include "confdefs.h"
17891
17892 /* Override any gcc2 internal prototype to avoid an error.  */
17893 #ifdef __cplusplus
17894 extern "C"
17895 #endif
17896 /* We use char because int might match the return type of a gcc2
17897    builtin and then its argument prototype would still apply.  */
17898 char form_driver ();
17899 int
17900 main (void)
17901 {
17902 form_driver ();
17903   ;
17904   return 0;
17905 }
17906 _ACEOF
17907 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17908 if { (eval echo "$as_me:17908: \"$ac_link\"") >&5
17909   (eval $ac_link) 2>&5
17910   ac_status=$?
17911   echo "$as_me:17911: \$? = $ac_status" >&5
17912   (exit "$ac_status"); } &&
17913          { ac_try='test -s "conftest$ac_exeext"'
17914   { (eval echo "$as_me:17914: \"$ac_try\"") >&5
17915   (eval $ac_try) 2>&5
17916   ac_status=$?
17917   echo "$as_me:17917: \$? = $ac_status" >&5
17918   (exit "$ac_status"); }; }; then
17919   eval "$as_ac_Lib=yes"
17920 else
17921   echo "$as_me: failed program was:" >&5
17922 cat "conftest.$ac_ext" >&5
17923 eval "$as_ac_Lib=no"
17924 fi
17925 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17926 LIBS=$ac_check_lib_save_LIBS
17927 fi
17928 echo "$as_me:17928: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17929 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17930 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17931
17932 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17933
17934 cf_add_libs="$LIBS"
17935 # reverse order
17936 cf_add_0lib=
17937 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17938 # filter duplicates
17939 for cf_add_1lib in $cf_add_0lib; do
17940         for cf_add_2lib in $cf_add_libs; do
17941                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17942                         cf_add_1lib=
17943                         break
17944                 fi
17945         done
17946         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17947 done
17948 LIBS="$cf_add_libs"
17949
17950                 cat >>confdefs.h <<EOF
17951 #define $cf_upper 1
17952 EOF
17953
17954 fi
17955
17956 fi
17957
17958         cf_curses_headers="$cf_curses_headers form.h"
17959 fi
17960
17961 # look for curses-related headers
17962
17963 for ac_header in $cf_curses_headers
17964 do
17965 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17966 echo "$as_me:17966: checking for $ac_header" >&5
17967 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17968 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17969   echo $ECHO_N "(cached) $ECHO_C" >&6
17970 else
17971   cat >"conftest.$ac_ext" <<_ACEOF
17972 #line 17972 "configure"
17973 #include "confdefs.h"
17974 #include <$ac_header>
17975 _ACEOF
17976 if { (eval echo "$as_me:17976: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17977   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17978   ac_status=$?
17979   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17980   rm -f conftest.er1
17981   cat conftest.err >&5
17982   echo "$as_me:17982: \$? = $ac_status" >&5
17983   (exit "$ac_status"); } >/dev/null; then
17984   if test -s conftest.err; then
17985     ac_cpp_err=$ac_c_preproc_warn_flag
17986   else
17987     ac_cpp_err=
17988   fi
17989 else
17990   ac_cpp_err=yes
17991 fi
17992 if test -z "$ac_cpp_err"; then
17993   eval "$as_ac_Header=yes"
17994 else
17995   echo "$as_me: failed program was:" >&5
17996   cat "conftest.$ac_ext" >&5
17997   eval "$as_ac_Header=no"
17998 fi
17999 rm -f conftest.err "conftest.$ac_ext"
18000 fi
18001 echo "$as_me:18001: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18002 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18003 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18004   cat >>confdefs.h <<EOF
18005 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18006 EOF
18007
18008 fi
18009 done
18010
18011 echo "$as_me:18011: checking for ANSI C header files" >&5
18012 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
18013 if test "${ac_cv_header_stdc+set}" = set; then
18014   echo $ECHO_N "(cached) $ECHO_C" >&6
18015 else
18016   cat >"conftest.$ac_ext" <<_ACEOF
18017 #line 18017 "configure"
18018 #include "confdefs.h"
18019 #include <stdlib.h>
18020 #include <stdarg.h>
18021 #include <string.h>
18022 #include <float.h>
18023
18024 _ACEOF
18025 if { (eval echo "$as_me:18025: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18026   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18027   ac_status=$?
18028   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18029   rm -f conftest.er1
18030   cat conftest.err >&5
18031   echo "$as_me:18031: \$? = $ac_status" >&5
18032   (exit "$ac_status"); } >/dev/null; then
18033   if test -s conftest.err; then
18034     ac_cpp_err=$ac_c_preproc_warn_flag
18035   else
18036     ac_cpp_err=
18037   fi
18038 else
18039   ac_cpp_err=yes
18040 fi
18041 if test -z "$ac_cpp_err"; then
18042   ac_cv_header_stdc=yes
18043 else
18044   echo "$as_me: failed program was:" >&5
18045   cat "conftest.$ac_ext" >&5
18046   ac_cv_header_stdc=no
18047 fi
18048 rm -f conftest.err "conftest.$ac_ext"
18049
18050 if test $ac_cv_header_stdc = yes; then
18051   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
18052   cat >"conftest.$ac_ext" <<_ACEOF
18053 #line 18053 "configure"
18054 #include "confdefs.h"
18055 #include <string.h>
18056
18057 _ACEOF
18058 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18059   $EGREP "memchr" >/dev/null 2>&1; then
18060   :
18061 else
18062   ac_cv_header_stdc=no
18063 fi
18064 rm -rf conftest*
18065
18066 fi
18067
18068 if test $ac_cv_header_stdc = yes; then
18069   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
18070   cat >"conftest.$ac_ext" <<_ACEOF
18071 #line 18071 "configure"
18072 #include "confdefs.h"
18073 #include <stdlib.h>
18074
18075 _ACEOF
18076 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18077   $EGREP "free" >/dev/null 2>&1; then
18078   :
18079 else
18080   ac_cv_header_stdc=no
18081 fi
18082 rm -rf conftest*
18083
18084 fi
18085
18086 if test $ac_cv_header_stdc = yes; then
18087   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
18088   if test "$cross_compiling" = yes; then
18089   :
18090 else
18091   cat >"conftest.$ac_ext" <<_ACEOF
18092 #line 18092 "configure"
18093 #include "confdefs.h"
18094 #include <ctype.h>
18095 #if ((' ' & 0x0FF) == 0x020)
18096 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
18097 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
18098 #else
18099 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
18100                      || ('j' <= (c) && (c) <= 'r') \
18101                      || ('s' <= (c) && (c) <= 'z'))
18102 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
18103 #endif
18104
18105 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
18106 int
18107 main (void)
18108 {
18109   int i;
18110   for (i = 0; i < 256; i++)
18111     if (XOR (islower (i), ISLOWER (i))
18112         || toupper (i) != TOUPPER (i))
18113       $ac_main_return(2);
18114   $ac_main_return (0);
18115 }
18116 _ACEOF
18117 rm -f "conftest$ac_exeext"
18118 if { (eval echo "$as_me:18118: \"$ac_link\"") >&5
18119   (eval $ac_link) 2>&5
18120   ac_status=$?
18121   echo "$as_me:18121: \$? = $ac_status" >&5
18122   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
18123   { (eval echo "$as_me:18123: \"$ac_try\"") >&5
18124   (eval $ac_try) 2>&5
18125   ac_status=$?
18126   echo "$as_me:18126: \$? = $ac_status" >&5
18127   (exit "$ac_status"); }; }; then
18128   :
18129 else
18130   echo "$as_me: program exited with status $ac_status" >&5
18131 echo "$as_me: failed program was:" >&5
18132 cat "conftest.$ac_ext" >&5
18133 ac_cv_header_stdc=no
18134 fi
18135 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
18136 fi
18137 fi
18138 fi
18139 echo "$as_me:18139: result: $ac_cv_header_stdc" >&5
18140 echo "${ECHO_T}$ac_cv_header_stdc" >&6
18141 if test $ac_cv_header_stdc = yes; then
18142
18143 cat >>confdefs.h <<\EOF
18144 #define STDC_HEADERS 1
18145 EOF
18146
18147 fi
18148
18149 echo "$as_me:18149: checking whether time.h and sys/time.h may both be included" >&5
18150 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
18151 if test "${ac_cv_header_time+set}" = set; then
18152   echo $ECHO_N "(cached) $ECHO_C" >&6
18153 else
18154   cat >"conftest.$ac_ext" <<_ACEOF
18155 #line 18155 "configure"
18156 #include "confdefs.h"
18157 #include <sys/types.h>
18158 #include <sys/time.h>
18159 #include <time.h>
18160
18161 int
18162 main (void)
18163 {
18164 if ((struct tm *) 0)
18165 return 0;
18166   ;
18167   return 0;
18168 }
18169 _ACEOF
18170 rm -f "conftest.$ac_objext"
18171 if { (eval echo "$as_me:18171: \"$ac_compile\"") >&5
18172   (eval $ac_compile) 2>&5
18173   ac_status=$?
18174   echo "$as_me:18174: \$? = $ac_status" >&5
18175   (exit "$ac_status"); } &&
18176          { ac_try='test -s "conftest.$ac_objext"'
18177   { (eval echo "$as_me:18177: \"$ac_try\"") >&5
18178   (eval $ac_try) 2>&5
18179   ac_status=$?
18180   echo "$as_me:18180: \$? = $ac_status" >&5
18181   (exit "$ac_status"); }; }; then
18182   ac_cv_header_time=yes
18183 else
18184   echo "$as_me: failed program was:" >&5
18185 cat "conftest.$ac_ext" >&5
18186 ac_cv_header_time=no
18187 fi
18188 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18189 fi
18190 echo "$as_me:18190: result: $ac_cv_header_time" >&5
18191 echo "${ECHO_T}$ac_cv_header_time" >&6
18192 if test $ac_cv_header_time = yes; then
18193
18194 cat >>confdefs.h <<\EOF
18195 #define TIME_WITH_SYS_TIME 1
18196 EOF
18197
18198 fi
18199
18200 for ac_header in \
18201 getopt.h \
18202 locale.h \
18203 math.h \
18204 stdarg.h \
18205 stdint.h \
18206 sys/ioctl.h \
18207 sys/select.h \
18208 sys/time.h \
18209 termios.h \
18210 unistd.h \
18211
18212 do
18213 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18214 echo "$as_me:18214: checking for $ac_header" >&5
18215 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18216 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18217   echo $ECHO_N "(cached) $ECHO_C" >&6
18218 else
18219   cat >"conftest.$ac_ext" <<_ACEOF
18220 #line 18220 "configure"
18221 #include "confdefs.h"
18222 #include <$ac_header>
18223 _ACEOF
18224 if { (eval echo "$as_me:18224: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18225   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18226   ac_status=$?
18227   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18228   rm -f conftest.er1
18229   cat conftest.err >&5
18230   echo "$as_me:18230: \$? = $ac_status" >&5
18231   (exit "$ac_status"); } >/dev/null; then
18232   if test -s conftest.err; then
18233     ac_cpp_err=$ac_c_preproc_warn_flag
18234   else
18235     ac_cpp_err=
18236   fi
18237 else
18238   ac_cpp_err=yes
18239 fi
18240 if test -z "$ac_cpp_err"; then
18241   eval "$as_ac_Header=yes"
18242 else
18243   echo "$as_me: failed program was:" >&5
18244   cat "conftest.$ac_ext" >&5
18245   eval "$as_ac_Header=no"
18246 fi
18247 rm -f conftest.err "conftest.$ac_ext"
18248 fi
18249 echo "$as_me:18249: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18250 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18251 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18252   cat >>confdefs.h <<EOF
18253 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18254 EOF
18255
18256 fi
18257 done
18258
18259 for ac_header in unistd.h getopt.h
18260 do
18261 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18262 echo "$as_me:18262: checking for $ac_header" >&5
18263 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18264 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18265   echo $ECHO_N "(cached) $ECHO_C" >&6
18266 else
18267   cat >"conftest.$ac_ext" <<_ACEOF
18268 #line 18268 "configure"
18269 #include "confdefs.h"
18270 #include <$ac_header>
18271 _ACEOF
18272 if { (eval echo "$as_me:18272: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18273   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18274   ac_status=$?
18275   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18276   rm -f conftest.er1
18277   cat conftest.err >&5
18278   echo "$as_me:18278: \$? = $ac_status" >&5
18279   (exit "$ac_status"); } >/dev/null; then
18280   if test -s conftest.err; then
18281     ac_cpp_err=$ac_c_preproc_warn_flag
18282   else
18283     ac_cpp_err=
18284   fi
18285 else
18286   ac_cpp_err=yes
18287 fi
18288 if test -z "$ac_cpp_err"; then
18289   eval "$as_ac_Header=yes"
18290 else
18291   echo "$as_me: failed program was:" >&5
18292   cat "conftest.$ac_ext" >&5
18293   eval "$as_ac_Header=no"
18294 fi
18295 rm -f conftest.err "conftest.$ac_ext"
18296 fi
18297 echo "$as_me:18297: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18298 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18299 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18300   cat >>confdefs.h <<EOF
18301 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18302 EOF
18303
18304 fi
18305 done
18306
18307 echo "$as_me:18307: checking for header declaring getopt variables" >&5
18308 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
18309 if test "${cf_cv_getopt_header+set}" = set; then
18310   echo $ECHO_N "(cached) $ECHO_C" >&6
18311 else
18312
18313 cf_cv_getopt_header=none
18314 for cf_header in stdio.h stdlib.h unistd.h getopt.h
18315 do
18316 cat >"conftest.$ac_ext" <<_ACEOF
18317 #line 18317 "configure"
18318 #include "confdefs.h"
18319
18320 #include <$cf_header>
18321 int
18322 main (void)
18323 {
18324 int x = optind; char *y = optarg; (void)x; (void)y
18325   ;
18326   return 0;
18327 }
18328 _ACEOF
18329 rm -f "conftest.$ac_objext"
18330 if { (eval echo "$as_me:18330: \"$ac_compile\"") >&5
18331   (eval $ac_compile) 2>&5
18332   ac_status=$?
18333   echo "$as_me:18333: \$? = $ac_status" >&5
18334   (exit "$ac_status"); } &&
18335          { ac_try='test -s "conftest.$ac_objext"'
18336   { (eval echo "$as_me:18336: \"$ac_try\"") >&5
18337   (eval $ac_try) 2>&5
18338   ac_status=$?
18339   echo "$as_me:18339: \$? = $ac_status" >&5
18340   (exit "$ac_status"); }; }; then
18341   cf_cv_getopt_header=$cf_header
18342  break
18343 else
18344   echo "$as_me: failed program was:" >&5
18345 cat "conftest.$ac_ext" >&5
18346 fi
18347 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18348 done
18349
18350 fi
18351 echo "$as_me:18351: result: $cf_cv_getopt_header" >&5
18352 echo "${ECHO_T}$cf_cv_getopt_header" >&6
18353 if test "$cf_cv_getopt_header" != none ; then
18354
18355 cat >>confdefs.h <<\EOF
18356 #define HAVE_GETOPT_HEADER 1
18357 EOF
18358
18359 fi
18360 if test "$cf_cv_getopt_header" = getopt.h ; then
18361
18362 cat >>confdefs.h <<\EOF
18363 #define NEED_GETOPT_H 1
18364 EOF
18365
18366 fi
18367
18368 for ac_func in \
18369 getopt \
18370 gettimeofday \
18371 snprintf \
18372 strdup \
18373 strstr \
18374 tsearch \
18375
18376 do
18377 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18378 echo "$as_me:18378: checking for $ac_func" >&5
18379 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18380 if eval "test \"\${$as_ac_var+set}\" = set"; then
18381   echo $ECHO_N "(cached) $ECHO_C" >&6
18382 else
18383   cat >"conftest.$ac_ext" <<_ACEOF
18384 #line 18384 "configure"
18385 #include "confdefs.h"
18386 #define $ac_func autoconf_temporary
18387 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18388 #undef $ac_func
18389
18390 #ifdef __cplusplus
18391 extern "C"
18392 #endif
18393
18394 /* We use char because int might match the return type of a gcc2
18395    builtin and then its argument prototype would still apply.  */
18396 char $ac_func (void);
18397
18398 int
18399 main (void)
18400 {
18401
18402 /* The GNU C library defines stubs for functions which it implements
18403     to always fail with ENOSYS.  Some functions are actually named
18404     something starting with __ and the normal name is an alias.  */
18405 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18406 #error found stub for $ac_func
18407 #endif
18408
18409         return $ac_func ();
18410   ;
18411   return 0;
18412 }
18413 _ACEOF
18414 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18415 if { (eval echo "$as_me:18415: \"$ac_link\"") >&5
18416   (eval $ac_link) 2>&5
18417   ac_status=$?
18418   echo "$as_me:18418: \$? = $ac_status" >&5
18419   (exit "$ac_status"); } &&
18420          { ac_try='test -s "conftest$ac_exeext"'
18421   { (eval echo "$as_me:18421: \"$ac_try\"") >&5
18422   (eval $ac_try) 2>&5
18423   ac_status=$?
18424   echo "$as_me:18424: \$? = $ac_status" >&5
18425   (exit "$ac_status"); }; }; then
18426   eval "$as_ac_var=yes"
18427 else
18428   echo "$as_me: failed program was:" >&5
18429 cat "conftest.$ac_ext" >&5
18430 eval "$as_ac_var=no"
18431 fi
18432 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18433 fi
18434 echo "$as_me:18434: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18435 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18436 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18437   cat >>confdefs.h <<EOF
18438 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18439 EOF
18440
18441 fi
18442 done
18443
18444 # use a compile-check to work with ncurses*-config and subdirectory includes
18445 echo "$as_me:18445: checking if we can use termcap.h" >&5
18446 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
18447 if test "${cf_cv_have_termcap_h+set}" = set; then
18448   echo $ECHO_N "(cached) $ECHO_C" >&6
18449 else
18450
18451         cat >"conftest.$ac_ext" <<_ACEOF
18452 #line 18452 "configure"
18453 #include "confdefs.h"
18454
18455 #include <curses.h>
18456 #ifdef NCURSES_VERSION
18457 #undef NCURSES_VERSION
18458 #endif
18459 #include <termcap.h>
18460 #ifndef NCURSES_VERSION
18461 #error wrong header
18462 #endif
18463
18464 int
18465 main (void)
18466 {
18467 return 0;
18468   ;
18469   return 0;
18470 }
18471 _ACEOF
18472 rm -f "conftest.$ac_objext"
18473 if { (eval echo "$as_me:18473: \"$ac_compile\"") >&5
18474   (eval $ac_compile) 2>&5
18475   ac_status=$?
18476   echo "$as_me:18476: \$? = $ac_status" >&5
18477   (exit "$ac_status"); } &&
18478          { ac_try='test -s "conftest.$ac_objext"'
18479   { (eval echo "$as_me:18479: \"$ac_try\"") >&5
18480   (eval $ac_try) 2>&5
18481   ac_status=$?
18482   echo "$as_me:18482: \$? = $ac_status" >&5
18483   (exit "$ac_status"); }; }; then
18484   cf_cv_have_termcap_h=yes
18485 else
18486   echo "$as_me: failed program was:" >&5
18487 cat "conftest.$ac_ext" >&5
18488 cf_cv_have_termcap_h=no
18489 fi
18490 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18491 fi
18492 echo "$as_me:18492: result: $cf_cv_have_termcap_h" >&5
18493 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
18494 if test "x$cf_cv_have_termcap_h" = xyes
18495 then
18496
18497 cat >>confdefs.h <<\EOF
18498 #define HAVE_TERMCAP_H 1
18499 EOF
18500
18501 else
18502 echo "$as_me:18502: checking if we can use ncurses/termcap.h" >&5
18503 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
18504 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
18505   echo $ECHO_N "(cached) $ECHO_C" >&6
18506 else
18507
18508         cat >"conftest.$ac_ext" <<_ACEOF
18509 #line 18509 "configure"
18510 #include "confdefs.h"
18511
18512 #include <ncurses/curses.h>
18513 #ifdef NCURSES_VERSION
18514 #undef NCURSES_VERSION
18515 #endif
18516 #include <ncurses/termcap.h>
18517 #ifndef NCURSES_VERSION
18518 #error wrong header
18519 #endif
18520
18521 int
18522 main (void)
18523 {
18524 return 0;
18525   ;
18526   return 0;
18527 }
18528 _ACEOF
18529 rm -f "conftest.$ac_objext"
18530 if { (eval echo "$as_me:18530: \"$ac_compile\"") >&5
18531   (eval $ac_compile) 2>&5
18532   ac_status=$?
18533   echo "$as_me:18533: \$? = $ac_status" >&5
18534   (exit "$ac_status"); } &&
18535          { ac_try='test -s "conftest.$ac_objext"'
18536   { (eval echo "$as_me:18536: \"$ac_try\"") >&5
18537   (eval $ac_try) 2>&5
18538   ac_status=$?
18539   echo "$as_me:18539: \$? = $ac_status" >&5
18540   (exit "$ac_status"); }; }; then
18541   cf_cv_have_ncurses_termcap_h=yes
18542 else
18543   echo "$as_me: failed program was:" >&5
18544 cat "conftest.$ac_ext" >&5
18545 cf_cv_have_ncurses_termcap_h=no
18546 fi
18547 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18548 fi
18549 echo "$as_me:18549: result: $cf_cv_have_ncurses_termcap_h" >&5
18550 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
18551 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
18552 cat >>confdefs.h <<\EOF
18553 #define HAVE_NCURSES_TERMCAP_H 1
18554 EOF
18555
18556 fi
18557
18558 if test "x$ac_cv_func_getopt" = xno; then
18559         { { echo "$as_me:18559: error: getopt is required for building programs" >&5
18560 echo "$as_me: error: getopt is required for building programs" >&2;}
18561    { (exit 1); exit 1; }; }
18562 fi
18563
18564 if test "$cf_enable_widec" = yes; then
18565
18566 for ac_func in \
18567 mblen \
18568 mbrlen \
18569 mbrtowc \
18570 mbsrtowcs \
18571 mbstowcs \
18572 mbtowc \
18573 wcsrtombs \
18574 wcstombs \
18575
18576 do
18577 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18578 echo "$as_me:18578: checking for $ac_func" >&5
18579 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18580 if eval "test \"\${$as_ac_var+set}\" = set"; then
18581   echo $ECHO_N "(cached) $ECHO_C" >&6
18582 else
18583   cat >"conftest.$ac_ext" <<_ACEOF
18584 #line 18584 "configure"
18585 #include "confdefs.h"
18586 #define $ac_func autoconf_temporary
18587 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18588 #undef $ac_func
18589
18590 #ifdef __cplusplus
18591 extern "C"
18592 #endif
18593
18594 /* We use char because int might match the return type of a gcc2
18595    builtin and then its argument prototype would still apply.  */
18596 char $ac_func (void);
18597
18598 int
18599 main (void)
18600 {
18601
18602 /* The GNU C library defines stubs for functions which it implements
18603     to always fail with ENOSYS.  Some functions are actually named
18604     something starting with __ and the normal name is an alias.  */
18605 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18606 #error found stub for $ac_func
18607 #endif
18608
18609         return $ac_func ();
18610   ;
18611   return 0;
18612 }
18613 _ACEOF
18614 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18615 if { (eval echo "$as_me:18615: \"$ac_link\"") >&5
18616   (eval $ac_link) 2>&5
18617   ac_status=$?
18618   echo "$as_me:18618: \$? = $ac_status" >&5
18619   (exit "$ac_status"); } &&
18620          { ac_try='test -s "conftest$ac_exeext"'
18621   { (eval echo "$as_me:18621: \"$ac_try\"") >&5
18622   (eval $ac_try) 2>&5
18623   ac_status=$?
18624   echo "$as_me:18624: \$? = $ac_status" >&5
18625   (exit "$ac_status"); }; }; then
18626   eval "$as_ac_var=yes"
18627 else
18628   echo "$as_me: failed program was:" >&5
18629 cat "conftest.$ac_ext" >&5
18630 eval "$as_ac_var=no"
18631 fi
18632 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18633 fi
18634 echo "$as_me:18634: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18635 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18636 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18637   cat >>confdefs.h <<EOF
18638 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18639 EOF
18640
18641 fi
18642 done
18643
18644 fi
18645
18646 echo "$as_me:18646: checking definition to turn on extended curses functions" >&5
18647 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
18648 if test "${cf_cv_need_xopen_extension+set}" = set; then
18649   echo $ECHO_N "(cached) $ECHO_C" >&6
18650 else
18651
18652 cf_cv_need_xopen_extension=unknown
18653 cat >"conftest.$ac_ext" <<_ACEOF
18654 #line 18654 "configure"
18655 #include "confdefs.h"
18656
18657 #include <stdlib.h>
18658 #include <${cf_cv_ncurses_header:-curses.h}>
18659 int
18660 main (void)
18661 {
18662
18663 #if defined(NCURSES_VERSION_PATCH)
18664 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
18665         make an error
18666 #endif
18667 #endif
18668 #ifdef NCURSES_WIDECHAR
18669 make an error   /* prefer to fall-through on the second checks */
18670 #endif
18671         cchar_t check;
18672         int check2 = curs_set((int)sizeof(check));
18673         long x = winnstr(stdscr, "", 0);
18674         int x1, y1;
18675         (void)check2;
18676         getbegyx(stdscr, y1, x1);
18677         (void)x;
18678         (void)y1;
18679         (void)x1;
18680
18681   ;
18682   return 0;
18683 }
18684 _ACEOF
18685 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18686 if { (eval echo "$as_me:18686: \"$ac_link\"") >&5
18687   (eval $ac_link) 2>&5
18688   ac_status=$?
18689   echo "$as_me:18689: \$? = $ac_status" >&5
18690   (exit "$ac_status"); } &&
18691          { ac_try='test -s "conftest$ac_exeext"'
18692   { (eval echo "$as_me:18692: \"$ac_try\"") >&5
18693   (eval $ac_try) 2>&5
18694   ac_status=$?
18695   echo "$as_me:18695: \$? = $ac_status" >&5
18696   (exit "$ac_status"); }; }; then
18697   cf_cv_need_xopen_extension=none
18698 else
18699   echo "$as_me: failed program was:" >&5
18700 cat "conftest.$ac_ext" >&5
18701
18702         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
18703         do
18704                 cat >"conftest.$ac_ext" <<_ACEOF
18705 #line 18705 "configure"
18706 #include "confdefs.h"
18707
18708 #define $cf_try_xopen_extension 1
18709 #include <stdlib.h>
18710 #include <${cf_cv_ncurses_header:-curses.h}>
18711 int
18712 main (void)
18713 {
18714
18715                 cchar_t check;
18716                 int check2 = curs_set((int)sizeof(check));
18717                 long x = winnstr(stdscr, "", 0);
18718                 int x1, y1;
18719                 getbegyx(stdscr, y1, x1);
18720                 (void)check2;
18721                 (void)x;
18722                 (void)y1;
18723                 (void)x1;
18724
18725   ;
18726   return 0;
18727 }
18728 _ACEOF
18729 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18730 if { (eval echo "$as_me:18730: \"$ac_link\"") >&5
18731   (eval $ac_link) 2>&5
18732   ac_status=$?
18733   echo "$as_me:18733: \$? = $ac_status" >&5
18734   (exit "$ac_status"); } &&
18735          { ac_try='test -s "conftest$ac_exeext"'
18736   { (eval echo "$as_me:18736: \"$ac_try\"") >&5
18737   (eval $ac_try) 2>&5
18738   ac_status=$?
18739   echo "$as_me:18739: \$? = $ac_status" >&5
18740   (exit "$ac_status"); }; }; then
18741   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
18742 else
18743   echo "$as_me: failed program was:" >&5
18744 cat "conftest.$ac_ext" >&5
18745 fi
18746 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18747         done
18748
18749 fi
18750 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18751
18752 fi
18753 echo "$as_me:18753: result: $cf_cv_need_xopen_extension" >&5
18754 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
18755
18756 case "$cf_cv_need_xopen_extension" in
18757 (*_*)
18758
18759         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18760         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
18761
18762         ;;
18763 esac
18764
18765 echo "$as_me:18765: checking for term.h" >&5
18766 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
18767 if test "${cf_cv_term_header+set}" = set; then
18768   echo $ECHO_N "(cached) $ECHO_C" >&6
18769 else
18770
18771 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
18772 # for <term.h> if we do not find the variant.
18773
18774 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
18775
18776 case "${cf_cv_ncurses_header:-curses.h}" in
18777 (*/*)
18778         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
18779         cf_header_list="$cf_header_item $cf_header_list"
18780         ;;
18781 esac
18782
18783 for cf_header in $cf_header_list
18784 do
18785         cat >"conftest.$ac_ext" <<_ACEOF
18786 #line 18786 "configure"
18787 #include "confdefs.h"
18788
18789 #include <${cf_cv_ncurses_header:-curses.h}>
18790 #include <${cf_header}>
18791 int
18792 main (void)
18793 {
18794 WINDOW *x; (void)x
18795   ;
18796   return 0;
18797 }
18798 _ACEOF
18799 rm -f "conftest.$ac_objext"
18800 if { (eval echo "$as_me:18800: \"$ac_compile\"") >&5
18801   (eval $ac_compile) 2>&5
18802   ac_status=$?
18803   echo "$as_me:18803: \$? = $ac_status" >&5
18804   (exit "$ac_status"); } &&
18805          { ac_try='test -s "conftest.$ac_objext"'
18806   { (eval echo "$as_me:18806: \"$ac_try\"") >&5
18807   (eval $ac_try) 2>&5
18808   ac_status=$?
18809   echo "$as_me:18809: \$? = $ac_status" >&5
18810   (exit "$ac_status"); }; }; then
18811   cf_cv_term_header=$cf_header
18812          break
18813 else
18814   echo "$as_me: failed program was:" >&5
18815 cat "conftest.$ac_ext" >&5
18816 cf_cv_term_header=no
18817 fi
18818 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18819 done
18820
18821 case "$cf_cv_term_header" in
18822 (no)
18823         # If curses is ncurses, some packagers still mess it up by trying to make
18824         # us use GNU termcap.  This handles the most common case.
18825         for cf_header in ncurses/term.h ncursesw/term.h
18826         do
18827                 cat >"conftest.$ac_ext" <<_ACEOF
18828 #line 18828 "configure"
18829 #include "confdefs.h"
18830
18831 #include <${cf_cv_ncurses_header:-curses.h}>
18832 #ifdef NCURSES_VERSION
18833 #include <${cf_header}>
18834 #else
18835 make an error
18836 #endif
18837 int
18838 main (void)
18839 {
18840 WINDOW *x; (void)x
18841   ;
18842   return 0;
18843 }
18844 _ACEOF
18845 rm -f "conftest.$ac_objext"
18846 if { (eval echo "$as_me:18846: \"$ac_compile\"") >&5
18847   (eval $ac_compile) 2>&5
18848   ac_status=$?
18849   echo "$as_me:18849: \$? = $ac_status" >&5
18850   (exit "$ac_status"); } &&
18851          { ac_try='test -s "conftest.$ac_objext"'
18852   { (eval echo "$as_me:18852: \"$ac_try\"") >&5
18853   (eval $ac_try) 2>&5
18854   ac_status=$?
18855   echo "$as_me:18855: \$? = $ac_status" >&5
18856   (exit "$ac_status"); }; }; then
18857   cf_cv_term_header=$cf_header
18858                          break
18859 else
18860   echo "$as_me: failed program was:" >&5
18861 cat "conftest.$ac_ext" >&5
18862 cf_cv_term_header=no
18863 fi
18864 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18865         done
18866         ;;
18867 esac
18868
18869 fi
18870 echo "$as_me:18870: result: $cf_cv_term_header" >&5
18871 echo "${ECHO_T}$cf_cv_term_header" >&6
18872
18873 case "$cf_cv_term_header" in
18874 (term.h)
18875
18876 cat >>confdefs.h <<\EOF
18877 #define HAVE_TERM_H 1
18878 EOF
18879
18880         ;;
18881 (ncurses/term.h)
18882
18883 cat >>confdefs.h <<\EOF
18884 #define HAVE_NCURSES_TERM_H 1
18885 EOF
18886
18887         ;;
18888 (ncursesw/term.h)
18889
18890 cat >>confdefs.h <<\EOF
18891 #define HAVE_NCURSESW_TERM_H 1
18892 EOF
18893
18894         ;;
18895 esac
18896
18897 echo "$as_me:18897: checking for unctrl.h" >&5
18898 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18899 if test "${cf_cv_unctrl_header+set}" = set; then
18900   echo $ECHO_N "(cached) $ECHO_C" >&6
18901 else
18902
18903 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18904 # for <unctrl.h> if we do not find the variant.
18905
18906 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18907
18908 case "${cf_cv_ncurses_header:-curses.h}" in
18909 (*/*)
18910         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18911         cf_header_list="$cf_header_item $cf_header_list"
18912         ;;
18913 esac
18914
18915 for cf_header in $cf_header_list
18916 do
18917         cat >"conftest.$ac_ext" <<_ACEOF
18918 #line 18918 "configure"
18919 #include "confdefs.h"
18920
18921 #include <${cf_cv_ncurses_header:-curses.h}>
18922 #include <${cf_header}>
18923 int
18924 main (void)
18925 {
18926 WINDOW *x; (void)x
18927   ;
18928   return 0;
18929 }
18930 _ACEOF
18931 rm -f "conftest.$ac_objext"
18932 if { (eval echo "$as_me:18932: \"$ac_compile\"") >&5
18933   (eval $ac_compile) 2>&5
18934   ac_status=$?
18935   echo "$as_me:18935: \$? = $ac_status" >&5
18936   (exit "$ac_status"); } &&
18937          { ac_try='test -s "conftest.$ac_objext"'
18938   { (eval echo "$as_me:18938: \"$ac_try\"") >&5
18939   (eval $ac_try) 2>&5
18940   ac_status=$?
18941   echo "$as_me:18941: \$? = $ac_status" >&5
18942   (exit "$ac_status"); }; }; then
18943   cf_cv_unctrl_header=$cf_header
18944          break
18945 else
18946   echo "$as_me: failed program was:" >&5
18947 cat "conftest.$ac_ext" >&5
18948 cf_cv_unctrl_header=no
18949 fi
18950 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18951 done
18952
18953 fi
18954 echo "$as_me:18954: result: $cf_cv_unctrl_header" >&5
18955 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18956
18957 case "$cf_cv_unctrl_header" in
18958 (no)
18959         { echo "$as_me:18959: WARNING: unctrl.h header not found" >&5
18960 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18961         ;;
18962 esac
18963
18964 case "$cf_cv_unctrl_header" in
18965 (unctrl.h)
18966
18967 cat >>confdefs.h <<\EOF
18968 #define HAVE_UNCTRL_H 1
18969 EOF
18970
18971         ;;
18972 (ncurses/unctrl.h)
18973
18974 cat >>confdefs.h <<\EOF
18975 #define HAVE_NCURSES_UNCTRL_H 1
18976 EOF
18977
18978         ;;
18979 (ncursesw/unctrl.h)
18980
18981 cat >>confdefs.h <<\EOF
18982 #define HAVE_NCURSESW_UNCTRL_H 1
18983 EOF
18984
18985         ;;
18986 esac
18987
18988 for cf_func in \
18989 alloc_pair \
18990 assume_default_colors \
18991 chgat \
18992 color_content \
18993 color_set \
18994 copywin \
18995 delscreen \
18996 dupwin \
18997 exit_curses \
18998 exit_terminfo \
18999 filter \
19000 getbegx \
19001 getcurx \
19002 getmaxx \
19003 getnstr \
19004 getparx \
19005 getwin \
19006 halfdelay \
19007 init_extended_color \
19008 mvderwin \
19009 mvvline \
19010 mvwin \
19011 mvwvline \
19012 napms \
19013 newpad \
19014 putwin \
19015 reset_color_pairs \
19016 resize_term \
19017 resizeterm \
19018 restartterm \
19019 ripoffline \
19020 scr_dump \
19021 setupterm \
19022 slk_color \
19023 slk_init \
19024 termattrs \
19025 termname \
19026 tgetent \
19027 tigetnum \
19028 tigetstr \
19029 tputs_sp \
19030 typeahead \
19031 use_default_colors \
19032 use_env \
19033 use_extended_names \
19034 use_screen \
19035 use_window \
19036 vid_puts \
19037 vidputs \
19038 vsscanf \
19039 vw_printw \
19040 wchgat \
19041 winsdelln \
19042 winsstr \
19043 wresize \
19044 wsyncdown \
19045 _tracef \
19046
19047 do
19048
19049 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19050
19051         echo "$as_me:19051: checking for ${cf_func}" >&5
19052 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
19053
19054 echo "${as_me:-configure}:19054: testing ${cf_func} ..." 1>&5
19055
19056         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
19057   echo $ECHO_N "(cached) $ECHO_C" >&6
19058 else
19059
19060                 eval cf_result='$ac_cv_func_'$cf_func
19061                 if test ".$cf_result" != ".no"; then
19062                         cat >"conftest.$ac_ext" <<_ACEOF
19063 #line 19063 "configure"
19064 #include "confdefs.h"
19065
19066 #ifdef HAVE_XCURSES
19067 #include <xcurses.h>
19068 char * XCursesProgramName = "test";
19069 #else
19070 #include <${cf_cv_ncurses_header:-curses.h}>
19071 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19072 #include <ncursesw/term.h>
19073 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19074 #include <ncurses/term.h>
19075 #elif defined(HAVE_TERM_H)
19076 #include <term.h>
19077 #endif
19078 #endif
19079
19080 int
19081 main (void)
19082 {
19083
19084 #ifndef ${cf_func}
19085 long foo = (long)(&${cf_func});
19086 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
19087 if (foo + 1234L > 5678L)
19088         ${cf_cv_main_return:-return}(foo != 0);
19089 #endif
19090
19091   ;
19092   return 0;
19093 }
19094 _ACEOF
19095 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19096 if { (eval echo "$as_me:19096: \"$ac_link\"") >&5
19097   (eval $ac_link) 2>&5
19098   ac_status=$?
19099   echo "$as_me:19099: \$? = $ac_status" >&5
19100   (exit "$ac_status"); } &&
19101          { ac_try='test -s "conftest$ac_exeext"'
19102   { (eval echo "$as_me:19102: \"$ac_try\"") >&5
19103   (eval $ac_try) 2>&5
19104   ac_status=$?
19105   echo "$as_me:19105: \$? = $ac_status" >&5
19106   (exit "$ac_status"); }; }; then
19107   cf_result=yes
19108 else
19109   echo "$as_me: failed program was:" >&5
19110 cat "conftest.$ac_ext" >&5
19111 cf_result=no
19112 fi
19113 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19114                 fi
19115                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
19116
19117 fi
19118
19119         # use the computed/retrieved cache-value:
19120         eval 'cf_result=$cf_cv_func_'$cf_func
19121         echo "$as_me:19121: result: $cf_result" >&5
19122 echo "${ECHO_T}$cf_result" >&6
19123         if test "$cf_result" != no; then
19124                 cat >>confdefs.h <<EOF
19125 #define HAVE_${cf_tr_func} 1
19126 EOF
19127
19128         fi
19129 done
19130
19131 for cf_func in tputs
19132 do
19133
19134 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19135
19136         echo "$as_me:19136: checking for ${cf_func}" >&5
19137 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
19138
19139 echo "${as_me:-configure}:19139: testing ${cf_func} ..." 1>&5
19140
19141         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
19142   echo $ECHO_N "(cached) $ECHO_C" >&6
19143 else
19144
19145                 eval cf_result='$ac_cv_func_'$cf_func
19146                 if test ".$cf_result" != ".no"; then
19147                         cat >"conftest.$ac_ext" <<_ACEOF
19148 #line 19148 "configure"
19149 #include "confdefs.h"
19150
19151 #ifdef HAVE_XCURSES
19152 #include <xcurses.h>
19153 char * XCursesProgramName = "test";
19154 #else
19155 #include <${cf_cv_ncurses_header:-curses.h}>
19156 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19157 #include <ncursesw/term.h>
19158 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19159 #include <ncurses/term.h>
19160 #elif defined(HAVE_TERM_H)
19161 #include <term.h>
19162 #endif
19163 #endif
19164
19165 int
19166 main (void)
19167 {
19168
19169 #ifndef ${cf_func}
19170 long foo = (long)(&${cf_func});
19171 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
19172 if (foo + 1234L > 5678L)
19173         ${cf_cv_main_return:-return}(foo != 0);
19174 #endif
19175
19176   ;
19177   return 0;
19178 }
19179 _ACEOF
19180 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19181 if { (eval echo "$as_me:19181: \"$ac_link\"") >&5
19182   (eval $ac_link) 2>&5
19183   ac_status=$?
19184   echo "$as_me:19184: \$? = $ac_status" >&5
19185   (exit "$ac_status"); } &&
19186          { ac_try='test -s "conftest$ac_exeext"'
19187   { (eval echo "$as_me:19187: \"$ac_try\"") >&5
19188   (eval $ac_try) 2>&5
19189   ac_status=$?
19190   echo "$as_me:19190: \$? = $ac_status" >&5
19191   (exit "$ac_status"); }; }; then
19192   cf_result=yes
19193 else
19194   echo "$as_me: failed program was:" >&5
19195 cat "conftest.$ac_ext" >&5
19196 cf_result=no
19197 fi
19198 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19199                 fi
19200                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
19201
19202 fi
19203
19204         # use the computed/retrieved cache-value:
19205         eval 'cf_result=$cf_cv_func_'$cf_func
19206         echo "$as_me:19206: result: $cf_result" >&5
19207 echo "${ECHO_T}$cf_result" >&6
19208         if test "$cf_result" != no; then
19209                 cat >>confdefs.h <<EOF
19210 #define HAVE_${cf_tr_func} 1
19211 EOF
19212
19213         fi
19214 done
19215
19216 if test "x$cf_cv_func_tputs" = xyes
19217 then
19218         cf_done=no
19219         for cf_arg in int char
19220         do
19221                 for cf_ret in int void
19222                 do
19223                         if test "$cf_ret" = void
19224                         then
19225                                 cf_return="/* nothing */"
19226                         else
19227                                 cf_return="return value"
19228                         fi
19229                         cat >"conftest.$ac_ext" <<_ACEOF
19230 #line 19230 "configure"
19231 #include "confdefs.h"
19232
19233 #include <${cf_cv_ncurses_header:-curses.h}>
19234 #include <$cf_cv_term_header>
19235
19236 static $cf_ret outc($cf_arg value) { $cf_return; }
19237
19238 int
19239 main (void)
19240 {
19241
19242         tputs("hello", 0, outc);
19243         ${cf_cv_main_return:-return}(0);
19244
19245   ;
19246   return 0;
19247 }
19248 _ACEOF
19249 rm -f "conftest.$ac_objext"
19250 if { (eval echo "$as_me:19250: \"$ac_compile\"") >&5
19251   (eval $ac_compile) 2>&5
19252   ac_status=$?
19253   echo "$as_me:19253: \$? = $ac_status" >&5
19254   (exit "$ac_status"); } &&
19255          { ac_try='test -s "conftest.$ac_objext"'
19256   { (eval echo "$as_me:19256: \"$ac_try\"") >&5
19257   (eval $ac_try) 2>&5
19258   ac_status=$?
19259   echo "$as_me:19259: \$? = $ac_status" >&5
19260   (exit "$ac_status"); }; }; then
19261
19262                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
19263
19264 echo "${as_me:-configure}:19264: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
19265
19266                 cat >>confdefs.h <<EOF
19267 #define TPUTS_ARG               $cf_arg
19268 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
19269 #define TPUTS_RETURN(value)     $cf_return
19270 EOF
19271                 cf_done=yes
19272                 break
19273
19274 else
19275   echo "$as_me: failed program was:" >&5
19276 cat "conftest.$ac_ext" >&5
19277 fi
19278 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19279                 done
19280                 test "$cf_done" = yes && break
19281         done
19282 fi
19283
19284 echo "$as_me:19284: checking for ncurses extended functions" >&5
19285 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
19286 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
19287   echo $ECHO_N "(cached) $ECHO_C" >&6
19288 else
19289
19290 cat >"conftest.$ac_ext" <<_ACEOF
19291 #line 19291 "configure"
19292 #include "confdefs.h"
19293
19294 #include <${cf_cv_ncurses_header:-curses.h}>
19295 int
19296 main (void)
19297 {
19298
19299 int x = NCURSES_EXT_FUNCS
19300
19301   ;
19302   return 0;
19303 }
19304 _ACEOF
19305 rm -f "conftest.$ac_objext"
19306 if { (eval echo "$as_me:19306: \"$ac_compile\"") >&5
19307   (eval $ac_compile) 2>&5
19308   ac_status=$?
19309   echo "$as_me:19309: \$? = $ac_status" >&5
19310   (exit "$ac_status"); } &&
19311          { ac_try='test -s "conftest.$ac_objext"'
19312   { (eval echo "$as_me:19312: \"$ac_try\"") >&5
19313   (eval $ac_try) 2>&5
19314   ac_status=$?
19315   echo "$as_me:19315: \$? = $ac_status" >&5
19316   (exit "$ac_status"); }; }; then
19317   cf_cv_ncurses_ext_funcs=defined
19318 else
19319   echo "$as_me: failed program was:" >&5
19320 cat "conftest.$ac_ext" >&5
19321
19322 cat >"conftest.$ac_ext" <<_ACEOF
19323 #line 19323 "configure"
19324 #include "confdefs.h"
19325
19326 #include <${cf_cv_ncurses_header:-curses.h}>
19327 int
19328 main (void)
19329 {
19330
19331         (void) assume_default_colors (0, 0);
19332         (void) curses_version ();
19333         (void) define_key (0, 0);
19334         (void) is_term_resized (0, 0);
19335         (void) key_defined (0);
19336         (void) keybound (0, 0);
19337         (void) keyok (0, 0);
19338         (void) resize_term (0, 0);
19339         (void) resizeterm (0, 0);
19340         (void) use_default_colors ();
19341         (void) use_extended_names (0);
19342         (void) wresize (0, 0, 0);
19343   ;
19344   return 0;
19345 }
19346 _ACEOF
19347 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19348 if { (eval echo "$as_me:19348: \"$ac_link\"") >&5
19349   (eval $ac_link) 2>&5
19350   ac_status=$?
19351   echo "$as_me:19351: \$? = $ac_status" >&5
19352   (exit "$ac_status"); } &&
19353          { ac_try='test -s "conftest$ac_exeext"'
19354   { (eval echo "$as_me:19354: \"$ac_try\"") >&5
19355   (eval $ac_try) 2>&5
19356   ac_status=$?
19357   echo "$as_me:19357: \$? = $ac_status" >&5
19358   (exit "$ac_status"); }; }; then
19359   cf_cv_ncurses_ext_funcs=yes
19360 else
19361   echo "$as_me: failed program was:" >&5
19362 cat "conftest.$ac_ext" >&5
19363 cf_cv_ncurses_ext_funcs=no
19364 fi
19365 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19366
19367 fi
19368 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19369
19370 fi
19371 echo "$as_me:19371: result: $cf_cv_ncurses_ext_funcs" >&5
19372 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
19373 test "$cf_cv_ncurses_ext_funcs" = yes &&
19374 cat >>confdefs.h <<\EOF
19375 #define NCURSES_EXT_FUNCS 1
19376 EOF
19377
19378 if test "$cf_enable_widec" = yes
19379 then
19380         # workaround for systems with ncurses before 20111029, due to change of
19381         # feature test macro from _XPG5 to _XOPEN_SOURCE
19382         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
19383         then
19384                 cf_define_xpg5=no
19385                 echo "$as_me:19385: checking if _XPG5 should be defined to enable wide-characters" >&5
19386 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
19387
19388                 cat >"conftest.$ac_ext" <<_ACEOF
19389 #line 19389 "configure"
19390 #include "confdefs.h"
19391
19392 #include <${cf_cv_ncurses_header:-curses.h}>
19393 int
19394 main (void)
19395 {
19396 int x = _XPG5
19397   ;
19398   return 0;
19399 }
19400 _ACEOF
19401 rm -f "conftest.$ac_objext"
19402 if { (eval echo "$as_me:19402: \"$ac_compile\"") >&5
19403   (eval $ac_compile) 2>&5
19404   ac_status=$?
19405   echo "$as_me:19405: \$? = $ac_status" >&5
19406   (exit "$ac_status"); } &&
19407          { ac_try='test -s "conftest.$ac_objext"'
19408   { (eval echo "$as_me:19408: \"$ac_try\"") >&5
19409   (eval $ac_try) 2>&5
19410   ac_status=$?
19411   echo "$as_me:19411: \$? = $ac_status" >&5
19412   (exit "$ac_status"); }; }; then
19413   :
19414 else
19415   echo "$as_me: failed program was:" >&5
19416 cat "conftest.$ac_ext" >&5
19417 cf_save_cppflags="$CPPFLAGS"
19418                          CPPFLAGS="$CPPFLAGS -D_XPG5"
19419                          cat >"conftest.$ac_ext" <<_ACEOF
19420 #line 19420 "configure"
19421 #include "confdefs.h"
19422
19423 #include <${cf_cv_ncurses_header:-curses.h}>
19424 int
19425 main (void)
19426 {
19427 int x = _XPG5
19428   ;
19429   return 0;
19430 }
19431 _ACEOF
19432 rm -f "conftest.$ac_objext"
19433 if { (eval echo "$as_me:19433: \"$ac_compile\"") >&5
19434   (eval $ac_compile) 2>&5
19435   ac_status=$?
19436   echo "$as_me:19436: \$? = $ac_status" >&5
19437   (exit "$ac_status"); } &&
19438          { ac_try='test -s "conftest.$ac_objext"'
19439   { (eval echo "$as_me:19439: \"$ac_try\"") >&5
19440   (eval $ac_try) 2>&5
19441   ac_status=$?
19442   echo "$as_me:19442: \$? = $ac_status" >&5
19443   (exit "$ac_status"); }; }; then
19444   cf_define_xpg5=yes
19445 else
19446   echo "$as_me: failed program was:" >&5
19447 cat "conftest.$ac_ext" >&5
19448 fi
19449 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19450                          CPPFLAGS="$cf_save_cppflags"
19451 fi
19452 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19453                 echo "$as_me:19453: result: $cf_define_xpg5" >&5
19454 echo "${ECHO_T}$cf_define_xpg5" >&6
19455
19456                 if test "$cf_define_xpg5" = yes
19457                 then
19458                         CPPFLAGS="$CPPFLAGS -D_XPG5"
19459                 fi
19460         fi
19461
19462         echo "$as_me:19462: checking for wide-character functions" >&5
19463 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
19464 if test "${cf_cv_widechar_funcs+set}" = set; then
19465   echo $ECHO_N "(cached) $ECHO_C" >&6
19466 else
19467
19468         cat >"conftest.$ac_ext" <<_ACEOF
19469 #line 19469 "configure"
19470 #include "confdefs.h"
19471
19472 #include <${cf_cv_ncurses_header:-curses.h}>
19473 int
19474 main (void)
19475 {
19476
19477                 static wchar_t src_wchar[2];
19478                 static cchar_t dst_cchar;
19479                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
19480
19481   ;
19482   return 0;
19483 }
19484 _ACEOF
19485 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19486 if { (eval echo "$as_me:19486: \"$ac_link\"") >&5
19487   (eval $ac_link) 2>&5
19488   ac_status=$?
19489   echo "$as_me:19489: \$? = $ac_status" >&5
19490   (exit "$ac_status"); } &&
19491          { ac_try='test -s "conftest$ac_exeext"'
19492   { (eval echo "$as_me:19492: \"$ac_try\"") >&5
19493   (eval $ac_try) 2>&5
19494   ac_status=$?
19495   echo "$as_me:19495: \$? = $ac_status" >&5
19496   (exit "$ac_status"); }; }; then
19497   cf_cv_widechar_funcs=yes
19498 else
19499   echo "$as_me: failed program was:" >&5
19500 cat "conftest.$ac_ext" >&5
19501 cf_cv_widechar_funcs=no
19502 fi
19503 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19504
19505 fi
19506 echo "$as_me:19506: result: $cf_cv_widechar_funcs" >&5
19507 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
19508         if test "$cf_cv_widechar_funcs" != no ; then
19509
19510 cat >>confdefs.h <<\EOF
19511 #define USE_WIDEC_SUPPORT 1
19512 EOF
19513
19514         else
19515                 cat >>confdefs.h <<\EOF
19516 #define USE_WIDEC_SUPPORT 0
19517 EOF
19518
19519         fi
19520 else
19521         cat >>confdefs.h <<\EOF
19522 #define USE_WIDEC_SUPPORT 0
19523 EOF
19524
19525 fi
19526
19527 echo "$as_me:19527: checking if $cf_cv_screen library uses pthreads" >&5
19528 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
19529 if test "${cf_cv_use_pthreads+set}" = set; then
19530   echo $ECHO_N "(cached) $ECHO_C" >&6
19531 else
19532
19533 cat >"conftest.$ac_ext" <<_ACEOF
19534 #line 19534 "configure"
19535 #include "confdefs.h"
19536
19537 #include <${cf_cv_ncurses_header:-curses.h}>
19538 extern void _nc_init_pthreads(void);
19539
19540 int
19541 main (void)
19542 {
19543
19544         initscr();
19545         _nc_init_pthreads();
19546
19547   ;
19548   return 0;
19549 }
19550 _ACEOF
19551 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19552 if { (eval echo "$as_me:19552: \"$ac_link\"") >&5
19553   (eval $ac_link) 2>&5
19554   ac_status=$?
19555   echo "$as_me:19555: \$? = $ac_status" >&5
19556   (exit "$ac_status"); } &&
19557          { ac_try='test -s "conftest$ac_exeext"'
19558   { (eval echo "$as_me:19558: \"$ac_try\"") >&5
19559   (eval $ac_try) 2>&5
19560   ac_status=$?
19561   echo "$as_me:19561: \$? = $ac_status" >&5
19562   (exit "$ac_status"); }; }; then
19563   cf_cv_use_pthreads=yes
19564 else
19565   echo "$as_me: failed program was:" >&5
19566 cat "conftest.$ac_ext" >&5
19567 cf_cv_use_pthreads=no
19568 fi
19569 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19570
19571 fi
19572 echo "$as_me:19572: result: $cf_cv_use_pthreads" >&5
19573 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
19574 test $cf_cv_use_pthreads = yes &&
19575 cat >>confdefs.h <<\EOF
19576 #define USE_PTHREADS 1
19577 EOF
19578
19579 echo "$as_me:19579: checking if sys/time.h works with sys/select.h" >&5
19580 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
19581 if test "${cf_cv_sys_time_select+set}" = set; then
19582   echo $ECHO_N "(cached) $ECHO_C" >&6
19583 else
19584
19585 cat >"conftest.$ac_ext" <<_ACEOF
19586 #line 19586 "configure"
19587 #include "confdefs.h"
19588
19589 #include <sys/types.h>
19590 #ifdef HAVE_SYS_TIME_H
19591 #include <sys/time.h>
19592 #endif
19593 #ifdef HAVE_SYS_SELECT_H
19594 #include <sys/select.h>
19595 #endif
19596
19597 int
19598 main (void)
19599 {
19600
19601   ;
19602   return 0;
19603 }
19604 _ACEOF
19605 rm -f "conftest.$ac_objext"
19606 if { (eval echo "$as_me:19606: \"$ac_compile\"") >&5
19607   (eval $ac_compile) 2>&5
19608   ac_status=$?
19609   echo "$as_me:19609: \$? = $ac_status" >&5
19610   (exit "$ac_status"); } &&
19611          { ac_try='test -s "conftest.$ac_objext"'
19612   { (eval echo "$as_me:19612: \"$ac_try\"") >&5
19613   (eval $ac_try) 2>&5
19614   ac_status=$?
19615   echo "$as_me:19615: \$? = $ac_status" >&5
19616   (exit "$ac_status"); }; }; then
19617   cf_cv_sys_time_select=yes
19618 else
19619   echo "$as_me: failed program was:" >&5
19620 cat "conftest.$ac_ext" >&5
19621 cf_cv_sys_time_select=no
19622 fi
19623 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19624
19625 fi
19626
19627 echo "$as_me:19627: result: $cf_cv_sys_time_select" >&5
19628 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
19629 test "$cf_cv_sys_time_select" = yes &&
19630 cat >>confdefs.h <<\EOF
19631 #define HAVE_SYS_TIME_SELECT 1
19632 EOF
19633
19634 # special check for test/ditto.c
19635
19636 echo "$as_me:19636: checking for openpty in -lutil" >&5
19637 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
19638 if test "${ac_cv_lib_util_openpty+set}" = set; then
19639   echo $ECHO_N "(cached) $ECHO_C" >&6
19640 else
19641   ac_check_lib_save_LIBS=$LIBS
19642 LIBS="-lutil  $LIBS"
19643 cat >"conftest.$ac_ext" <<_ACEOF
19644 #line 19644 "configure"
19645 #include "confdefs.h"
19646
19647 /* Override any gcc2 internal prototype to avoid an error.  */
19648 #ifdef __cplusplus
19649 extern "C"
19650 #endif
19651 /* We use char because int might match the return type of a gcc2
19652    builtin and then its argument prototype would still apply.  */
19653 char openpty ();
19654 int
19655 main (void)
19656 {
19657 openpty ();
19658   ;
19659   return 0;
19660 }
19661 _ACEOF
19662 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19663 if { (eval echo "$as_me:19663: \"$ac_link\"") >&5
19664   (eval $ac_link) 2>&5
19665   ac_status=$?
19666   echo "$as_me:19666: \$? = $ac_status" >&5
19667   (exit "$ac_status"); } &&
19668          { ac_try='test -s "conftest$ac_exeext"'
19669   { (eval echo "$as_me:19669: \"$ac_try\"") >&5
19670   (eval $ac_try) 2>&5
19671   ac_status=$?
19672   echo "$as_me:19672: \$? = $ac_status" >&5
19673   (exit "$ac_status"); }; }; then
19674   ac_cv_lib_util_openpty=yes
19675 else
19676   echo "$as_me: failed program was:" >&5
19677 cat "conftest.$ac_ext" >&5
19678 ac_cv_lib_util_openpty=no
19679 fi
19680 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19681 LIBS=$ac_check_lib_save_LIBS
19682 fi
19683 echo "$as_me:19683: result: $ac_cv_lib_util_openpty" >&5
19684 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
19685 if test "$ac_cv_lib_util_openpty" = yes; then
19686   cf_cv_lib_util=yes
19687 else
19688   cf_cv_lib_util=no
19689 fi
19690
19691 echo "$as_me:19691: checking for openpty header" >&5
19692 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
19693 if test "${cf_cv_func_openpty+set}" = set; then
19694   echo $ECHO_N "(cached) $ECHO_C" >&6
19695 else
19696
19697         cf_save_LIBS="$LIBS"
19698         test "$cf_cv_lib_util" = yes && {
19699 cf_add_libs="$LIBS"
19700 # reverse order
19701 cf_add_0lib=
19702 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19703 # filter duplicates
19704 for cf_add_1lib in $cf_add_0lib; do
19705         for cf_add_2lib in $cf_add_libs; do
19706                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19707                         cf_add_1lib=
19708                         break
19709                 fi
19710         done
19711         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19712 done
19713 LIBS="$cf_add_libs"
19714  }
19715         for cf_header in pty.h libutil.h util.h
19716         do
19717         cat >"conftest.$ac_ext" <<_ACEOF
19718 #line 19718 "configure"
19719 #include "confdefs.h"
19720
19721 #include <$cf_header>
19722
19723 int
19724 main (void)
19725 {
19726
19727         int x = openpty((int *)0, (int *)0, (char *)0,
19728                                    (struct termios *)0, (struct winsize *)0);
19729
19730   ;
19731   return 0;
19732 }
19733 _ACEOF
19734 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19735 if { (eval echo "$as_me:19735: \"$ac_link\"") >&5
19736   (eval $ac_link) 2>&5
19737   ac_status=$?
19738   echo "$as_me:19738: \$? = $ac_status" >&5
19739   (exit "$ac_status"); } &&
19740          { ac_try='test -s "conftest$ac_exeext"'
19741   { (eval echo "$as_me:19741: \"$ac_try\"") >&5
19742   (eval $ac_try) 2>&5
19743   ac_status=$?
19744   echo "$as_me:19744: \$? = $ac_status" >&5
19745   (exit "$ac_status"); }; }; then
19746
19747                 cf_cv_func_openpty=$cf_header
19748                 break
19749
19750 else
19751   echo "$as_me: failed program was:" >&5
19752 cat "conftest.$ac_ext" >&5
19753
19754                 cf_cv_func_openpty=no
19755
19756 fi
19757 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19758         done
19759         LIBS="$cf_save_LIBS"
19760
19761 fi
19762 echo "$as_me:19762: result: $cf_cv_func_openpty" >&5
19763 echo "${ECHO_T}$cf_cv_func_openpty" >&6
19764
19765 if test "$cf_cv_func_openpty" != no ; then
19766
19767 cat >>confdefs.h <<EOF
19768 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
19769 EOF
19770
19771 cat >>confdefs.h <<\EOF
19772 #define USE_XTERM_PTY 1
19773 EOF
19774
19775         if test "x$cf_cv_lib_util" = xyes ; then
19776
19777 cf_add_libs="$TEST_LIBS"
19778 # reverse order
19779 cf_add_0lib=
19780 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19781 # filter duplicates
19782 for cf_add_1lib in $cf_add_0lib; do
19783         for cf_add_2lib in $cf_add_libs; do
19784                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19785                         cf_add_1lib=
19786                         break
19787                 fi
19788         done
19789         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19790 done
19791 TEST_LIBS="$cf_add_libs"
19792
19793         fi
19794 fi
19795
19796 echo "$as_me:19796: checking for function curses_version" >&5
19797 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19798 if test "${cf_cv_func_curses_version+set}" = set; then
19799   echo $ECHO_N "(cached) $ECHO_C" >&6
19800 else
19801
19802 if test "$cross_compiling" = yes; then
19803   cf_cv_func_curses_version=unknown
19804 else
19805   cat >"conftest.$ac_ext" <<_ACEOF
19806 #line 19806 "configure"
19807 #include "confdefs.h"
19808
19809 #include <${cf_cv_ncurses_header:-curses.h}>
19810 int main(void)
19811 {
19812         char temp[1024];
19813         sprintf(temp, "%s\\n", curses_version());
19814         ${cf_cv_main_return:-return}(0);
19815 }
19816
19817 _ACEOF
19818 rm -f "conftest$ac_exeext"
19819 if { (eval echo "$as_me:19819: \"$ac_link\"") >&5
19820   (eval $ac_link) 2>&5
19821   ac_status=$?
19822   echo "$as_me:19822: \$? = $ac_status" >&5
19823   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
19824   { (eval echo "$as_me:19824: \"$ac_try\"") >&5
19825   (eval $ac_try) 2>&5
19826   ac_status=$?
19827   echo "$as_me:19827: \$? = $ac_status" >&5
19828   (exit "$ac_status"); }; }; then
19829   cf_cv_func_curses_version=yes
19830
19831 else
19832   echo "$as_me: program exited with status $ac_status" >&5
19833 echo "$as_me: failed program was:" >&5
19834 cat "conftest.$ac_ext" >&5
19835 cf_cv_func_curses_version=no
19836
19837 fi
19838 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
19839 fi
19840 rm -f core
19841 fi
19842 echo "$as_me:19842: result: $cf_cv_func_curses_version" >&5
19843 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19844 test "$cf_cv_func_curses_version" = yes &&
19845 cat >>confdefs.h <<\EOF
19846 #define HAVE_CURSES_VERSION 1
19847 EOF
19848
19849 echo "$as_me:19849: checking for alternate character set array" >&5
19850 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19851 if test "${cf_cv_curses_acs_map+set}" = set; then
19852   echo $ECHO_N "(cached) $ECHO_C" >&6
19853 else
19854
19855 cf_cv_curses_acs_map=unknown
19856 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19857 do
19858 cat >"conftest.$ac_ext" <<_ACEOF
19859 #line 19859 "configure"
19860 #include "confdefs.h"
19861
19862 #include <${cf_cv_ncurses_header:-curses.h}>
19863
19864 int
19865 main (void)
19866 {
19867
19868 ${name}['k'] = ACS_PLUS
19869
19870   ;
19871   return 0;
19872 }
19873 _ACEOF
19874 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19875 if { (eval echo "$as_me:19875: \"$ac_link\"") >&5
19876   (eval $ac_link) 2>&5
19877   ac_status=$?
19878   echo "$as_me:19878: \$? = $ac_status" >&5
19879   (exit "$ac_status"); } &&
19880          { ac_try='test -s "conftest$ac_exeext"'
19881   { (eval echo "$as_me:19881: \"$ac_try\"") >&5
19882   (eval $ac_try) 2>&5
19883   ac_status=$?
19884   echo "$as_me:19884: \$? = $ac_status" >&5
19885   (exit "$ac_status"); }; }; then
19886   cf_cv_curses_acs_map=$name; break
19887 else
19888   echo "$as_me: failed program was:" >&5
19889 cat "conftest.$ac_ext" >&5
19890 fi
19891 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19892 done
19893
19894 fi
19895 echo "$as_me:19895: result: $cf_cv_curses_acs_map" >&5
19896 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19897
19898 test "$cf_cv_curses_acs_map" != unknown &&
19899 cat >>confdefs.h <<EOF
19900 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19901 EOF
19902
19903 if test "$cf_enable_widec" = yes; then
19904
19905 echo "$as_me:19905: checking for wide alternate character set array" >&5
19906 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19907 if test "${cf_cv_curses_wacs_map+set}" = set; then
19908   echo $ECHO_N "(cached) $ECHO_C" >&6
19909 else
19910
19911         cf_cv_curses_wacs_map=unknown
19912         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19913         do
19914         cat >"conftest.$ac_ext" <<_ACEOF
19915 #line 19915 "configure"
19916 #include "confdefs.h"
19917
19918 #ifndef _XOPEN_SOURCE_EXTENDED
19919 #define _XOPEN_SOURCE_EXTENDED
19920 #endif
19921 #include <${cf_cv_ncurses_header:-curses.h}>
19922 int
19923 main (void)
19924 {
19925 void *foo = &(${name}['k']); (void)foo
19926   ;
19927   return 0;
19928 }
19929 _ACEOF
19930 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19931 if { (eval echo "$as_me:19931: \"$ac_link\"") >&5
19932   (eval $ac_link) 2>&5
19933   ac_status=$?
19934   echo "$as_me:19934: \$? = $ac_status" >&5
19935   (exit "$ac_status"); } &&
19936          { ac_try='test -s "conftest$ac_exeext"'
19937   { (eval echo "$as_me:19937: \"$ac_try\"") >&5
19938   (eval $ac_try) 2>&5
19939   ac_status=$?
19940   echo "$as_me:19940: \$? = $ac_status" >&5
19941   (exit "$ac_status"); }; }; then
19942   cf_cv_curses_wacs_map=$name
19943          break
19944 else
19945   echo "$as_me: failed program was:" >&5
19946 cat "conftest.$ac_ext" >&5
19947 fi
19948 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19949         done
19950 fi
19951 echo "$as_me:19951: result: $cf_cv_curses_wacs_map" >&5
19952 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19953
19954 test "$cf_cv_curses_wacs_map" != unknown &&
19955 cat >>confdefs.h <<EOF
19956 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19957 EOF
19958
19959 echo "$as_me:19959: checking for wide alternate character constants" >&5
19960 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19961 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19962   echo $ECHO_N "(cached) $ECHO_C" >&6
19963 else
19964
19965 cf_cv_curses_wacs_symbols=no
19966 if test "$cf_cv_curses_wacs_map" != unknown
19967 then
19968         cat >"conftest.$ac_ext" <<_ACEOF
19969 #line 19969 "configure"
19970 #include "confdefs.h"
19971
19972 #ifndef _XOPEN_SOURCE_EXTENDED
19973 #define _XOPEN_SOURCE_EXTENDED
19974 #endif
19975 #include <${cf_cv_ncurses_header:-curses.h}>
19976 int
19977 main (void)
19978 {
19979 cchar_t *foo = WACS_PLUS;
19980          ${cf_cv_curses_wacs_map}['k'] = *WACS_PLUS; (void)foo
19981   ;
19982   return 0;
19983 }
19984 _ACEOF
19985 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19986 if { (eval echo "$as_me:19986: \"$ac_link\"") >&5
19987   (eval $ac_link) 2>&5
19988   ac_status=$?
19989   echo "$as_me:19989: \$? = $ac_status" >&5
19990   (exit "$ac_status"); } &&
19991          { ac_try='test -s "conftest$ac_exeext"'
19992   { (eval echo "$as_me:19992: \"$ac_try\"") >&5
19993   (eval $ac_try) 2>&5
19994   ac_status=$?
19995   echo "$as_me:19995: \$? = $ac_status" >&5
19996   (exit "$ac_status"); }; }; then
19997   cf_cv_curses_wacs_symbols=yes
19998 else
19999   echo "$as_me: failed program was:" >&5
20000 cat "conftest.$ac_ext" >&5
20001 fi
20002 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20003 else
20004         cat >"conftest.$ac_ext" <<_ACEOF
20005 #line 20005 "configure"
20006 #include "confdefs.h"
20007
20008 #ifndef _XOPEN_SOURCE_EXTENDED
20009 #define _XOPEN_SOURCE_EXTENDED
20010 #endif
20011 #include <${cf_cv_ncurses_header:-curses.h}>
20012 int
20013 main (void)
20014 {
20015 cchar_t *foo = WACS_PLUS; (void)foo
20016   ;
20017   return 0;
20018 }
20019 _ACEOF
20020 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20021 if { (eval echo "$as_me:20021: \"$ac_link\"") >&5
20022   (eval $ac_link) 2>&5
20023   ac_status=$?
20024   echo "$as_me:20024: \$? = $ac_status" >&5
20025   (exit "$ac_status"); } &&
20026          { ac_try='test -s "conftest$ac_exeext"'
20027   { (eval echo "$as_me:20027: \"$ac_try\"") >&5
20028   (eval $ac_try) 2>&5
20029   ac_status=$?
20030   echo "$as_me:20030: \$? = $ac_status" >&5
20031   (exit "$ac_status"); }; }; then
20032   cf_cv_curses_wacs_symbols=yes
20033 else
20034   echo "$as_me: failed program was:" >&5
20035 cat "conftest.$ac_ext" >&5
20036 fi
20037 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20038 fi
20039
20040 fi
20041 echo "$as_me:20041: result: $cf_cv_curses_wacs_symbols" >&5
20042 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
20043
20044 test "$cf_cv_curses_wacs_symbols" != no &&
20045 cat >>confdefs.h <<\EOF
20046 #define CURSES_WACS_SYMBOLS 1
20047 EOF
20048
20049 fi
20050
20051 echo "$as_me:20051: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20052 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20053 cat >"conftest.$ac_ext" <<_ACEOF
20054 #line 20054 "configure"
20055 #include "confdefs.h"
20056
20057 #ifndef _XOPEN_SOURCE_EXTENDED
20058 #define _XOPEN_SOURCE_EXTENDED
20059 #endif
20060 #include <${cf_cv_ncurses_header:-curses.h}>
20061 int
20062 main (void)
20063 {
20064
20065 attr_t foo
20066
20067   ;
20068   return 0;
20069 }
20070 _ACEOF
20071 rm -f "conftest.$ac_objext"
20072 if { (eval echo "$as_me:20072: \"$ac_compile\"") >&5
20073   (eval $ac_compile) 2>&5
20074   ac_status=$?
20075   echo "$as_me:20075: \$? = $ac_status" >&5
20076   (exit "$ac_status"); } &&
20077          { ac_try='test -s "conftest.$ac_objext"'
20078   { (eval echo "$as_me:20078: \"$ac_try\"") >&5
20079   (eval $ac_try) 2>&5
20080   ac_status=$?
20081   echo "$as_me:20081: \$? = $ac_status" >&5
20082   (exit "$ac_status"); }; }; then
20083   cf_result=yes
20084 else
20085   echo "$as_me: failed program was:" >&5
20086 cat "conftest.$ac_ext" >&5
20087 cf_result=no
20088 fi
20089 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20090 echo "$as_me:20090: result: $cf_result" >&5
20091 echo "${ECHO_T}$cf_result" >&6
20092 if test "$cf_result" = yes ; then
20093
20094 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20095
20096 cat >>confdefs.h <<EOF
20097 #define $cf_result 1
20098 EOF
20099
20100 else
20101
20102 cat >>confdefs.h <<EOF
20103 #define attr_t long
20104 EOF
20105
20106 fi
20107
20108 if test "$cf_enable_widec" = yes; then
20109
20110 # This is needed on Tru64 5.0 to declare mbstate_t
20111 echo "$as_me:20111: checking if we must include wchar.h to declare mbstate_t" >&5
20112 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
20113 if test "${cf_cv_mbstate_t+set}" = set; then
20114   echo $ECHO_N "(cached) $ECHO_C" >&6
20115 else
20116
20117 cat >"conftest.$ac_ext" <<_ACEOF
20118 #line 20118 "configure"
20119 #include "confdefs.h"
20120
20121 #include <stdlib.h>
20122 #include <stdarg.h>
20123 #include <stdio.h>
20124 #ifdef HAVE_LIBUTF8_H
20125 #include <libutf8.h>
20126 #endif
20127 int
20128 main (void)
20129 {
20130 mbstate_t state
20131   ;
20132   return 0;
20133 }
20134 _ACEOF
20135 rm -f "conftest.$ac_objext"
20136 if { (eval echo "$as_me:20136: \"$ac_compile\"") >&5
20137   (eval $ac_compile) 2>&5
20138   ac_status=$?
20139   echo "$as_me:20139: \$? = $ac_status" >&5
20140   (exit "$ac_status"); } &&
20141          { ac_try='test -s "conftest.$ac_objext"'
20142   { (eval echo "$as_me:20142: \"$ac_try\"") >&5
20143   (eval $ac_try) 2>&5
20144   ac_status=$?
20145   echo "$as_me:20145: \$? = $ac_status" >&5
20146   (exit "$ac_status"); }; }; then
20147   cf_cv_mbstate_t=no
20148 else
20149   echo "$as_me: failed program was:" >&5
20150 cat "conftest.$ac_ext" >&5
20151 cat >"conftest.$ac_ext" <<_ACEOF
20152 #line 20152 "configure"
20153 #include "confdefs.h"
20154
20155 #include <stdlib.h>
20156 #include <stdarg.h>
20157 #include <stdio.h>
20158 #include <wchar.h>
20159 #ifdef HAVE_LIBUTF8_H
20160 #include <libutf8.h>
20161 #endif
20162 int
20163 main (void)
20164 {
20165 mbstate_t value
20166   ;
20167   return 0;
20168 }
20169 _ACEOF
20170 rm -f "conftest.$ac_objext"
20171 if { (eval echo "$as_me:20171: \"$ac_compile\"") >&5
20172   (eval $ac_compile) 2>&5
20173   ac_status=$?
20174   echo "$as_me:20174: \$? = $ac_status" >&5
20175   (exit "$ac_status"); } &&
20176          { ac_try='test -s "conftest.$ac_objext"'
20177   { (eval echo "$as_me:20177: \"$ac_try\"") >&5
20178   (eval $ac_try) 2>&5
20179   ac_status=$?
20180   echo "$as_me:20180: \$? = $ac_status" >&5
20181   (exit "$ac_status"); }; }; then
20182   cf_cv_mbstate_t=yes
20183 else
20184   echo "$as_me: failed program was:" >&5
20185 cat "conftest.$ac_ext" >&5
20186 cf_cv_mbstate_t=unknown
20187 fi
20188 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20189 fi
20190 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20191 fi
20192 echo "$as_me:20192: result: $cf_cv_mbstate_t" >&5
20193 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
20194
20195 if test "$cf_cv_mbstate_t" = yes ; then
20196
20197 cat >>confdefs.h <<\EOF
20198 #define NEED_WCHAR_H 1
20199 EOF
20200
20201         NEED_WCHAR_H=1
20202 fi
20203
20204 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
20205 if test "$cf_cv_mbstate_t" = unknown ; then
20206         NCURSES_MBSTATE_T=1
20207 fi
20208
20209 # if we find mbstate_t in either place, use substitution to provide a fallback.
20210 if test "$cf_cv_mbstate_t" != unknown ; then
20211         NCURSES_OK_MBSTATE_T=1
20212 fi
20213
20214 # This is needed on Tru64 5.0 to declare wchar_t
20215 echo "$as_me:20215: checking if we must include wchar.h to declare wchar_t" >&5
20216 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
20217 if test "${cf_cv_wchar_t+set}" = set; then
20218   echo $ECHO_N "(cached) $ECHO_C" >&6
20219 else
20220
20221 cat >"conftest.$ac_ext" <<_ACEOF
20222 #line 20222 "configure"
20223 #include "confdefs.h"
20224
20225 #include <stdlib.h>
20226 #include <stdarg.h>
20227 #include <stdio.h>
20228 #ifdef HAVE_LIBUTF8_H
20229 #include <libutf8.h>
20230 #endif
20231 int
20232 main (void)
20233 {
20234 wchar_t state
20235   ;
20236   return 0;
20237 }
20238 _ACEOF
20239 rm -f "conftest.$ac_objext"
20240 if { (eval echo "$as_me:20240: \"$ac_compile\"") >&5
20241   (eval $ac_compile) 2>&5
20242   ac_status=$?
20243   echo "$as_me:20243: \$? = $ac_status" >&5
20244   (exit "$ac_status"); } &&
20245          { ac_try='test -s "conftest.$ac_objext"'
20246   { (eval echo "$as_me:20246: \"$ac_try\"") >&5
20247   (eval $ac_try) 2>&5
20248   ac_status=$?
20249   echo "$as_me:20249: \$? = $ac_status" >&5
20250   (exit "$ac_status"); }; }; then
20251   cf_cv_wchar_t=no
20252 else
20253   echo "$as_me: failed program was:" >&5
20254 cat "conftest.$ac_ext" >&5
20255 cat >"conftest.$ac_ext" <<_ACEOF
20256 #line 20256 "configure"
20257 #include "confdefs.h"
20258
20259 #include <stdlib.h>
20260 #include <stdarg.h>
20261 #include <stdio.h>
20262 #include <wchar.h>
20263 #ifdef HAVE_LIBUTF8_H
20264 #include <libutf8.h>
20265 #endif
20266 int
20267 main (void)
20268 {
20269 wchar_t value
20270   ;
20271   return 0;
20272 }
20273 _ACEOF
20274 rm -f "conftest.$ac_objext"
20275 if { (eval echo "$as_me:20275: \"$ac_compile\"") >&5
20276   (eval $ac_compile) 2>&5
20277   ac_status=$?
20278   echo "$as_me:20278: \$? = $ac_status" >&5
20279   (exit "$ac_status"); } &&
20280          { ac_try='test -s "conftest.$ac_objext"'
20281   { (eval echo "$as_me:20281: \"$ac_try\"") >&5
20282   (eval $ac_try) 2>&5
20283   ac_status=$?
20284   echo "$as_me:20284: \$? = $ac_status" >&5
20285   (exit "$ac_status"); }; }; then
20286   cf_cv_wchar_t=yes
20287 else
20288   echo "$as_me: failed program was:" >&5
20289 cat "conftest.$ac_ext" >&5
20290 cf_cv_wchar_t=unknown
20291 fi
20292 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20293 fi
20294 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20295 fi
20296 echo "$as_me:20296: result: $cf_cv_wchar_t" >&5
20297 echo "${ECHO_T}$cf_cv_wchar_t" >&6
20298
20299 if test "$cf_cv_wchar_t" = yes ; then
20300
20301 cat >>confdefs.h <<\EOF
20302 #define NEED_WCHAR_H 1
20303 EOF
20304
20305         NEED_WCHAR_H=1
20306 fi
20307
20308 # if we do not find wchar_t in either place, use substitution to provide a fallback.
20309 if test "$cf_cv_wchar_t" = unknown ; then
20310         NCURSES_WCHAR_T=1
20311 fi
20312
20313 # if we find wchar_t in either place, use substitution to provide a fallback.
20314 if test "$cf_cv_wchar_t" != unknown ; then
20315         NCURSES_OK_WCHAR_T=1
20316 fi
20317
20318 # This is needed on Tru64 5.0 to declare wint_t
20319 echo "$as_me:20319: checking if we must include wchar.h to declare wint_t" >&5
20320 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
20321 if test "${cf_cv_wint_t+set}" = set; then
20322   echo $ECHO_N "(cached) $ECHO_C" >&6
20323 else
20324
20325 cat >"conftest.$ac_ext" <<_ACEOF
20326 #line 20326 "configure"
20327 #include "confdefs.h"
20328
20329 #include <stdlib.h>
20330 #include <stdarg.h>
20331 #include <stdio.h>
20332 #ifdef HAVE_LIBUTF8_H
20333 #include <libutf8.h>
20334 #endif
20335 int
20336 main (void)
20337 {
20338 wint_t state
20339   ;
20340   return 0;
20341 }
20342 _ACEOF
20343 rm -f "conftest.$ac_objext"
20344 if { (eval echo "$as_me:20344: \"$ac_compile\"") >&5
20345   (eval $ac_compile) 2>&5
20346   ac_status=$?
20347   echo "$as_me:20347: \$? = $ac_status" >&5
20348   (exit "$ac_status"); } &&
20349          { ac_try='test -s "conftest.$ac_objext"'
20350   { (eval echo "$as_me:20350: \"$ac_try\"") >&5
20351   (eval $ac_try) 2>&5
20352   ac_status=$?
20353   echo "$as_me:20353: \$? = $ac_status" >&5
20354   (exit "$ac_status"); }; }; then
20355   cf_cv_wint_t=no
20356 else
20357   echo "$as_me: failed program was:" >&5
20358 cat "conftest.$ac_ext" >&5
20359 cat >"conftest.$ac_ext" <<_ACEOF
20360 #line 20360 "configure"
20361 #include "confdefs.h"
20362
20363 #include <stdlib.h>
20364 #include <stdarg.h>
20365 #include <stdio.h>
20366 #include <wchar.h>
20367 #ifdef HAVE_LIBUTF8_H
20368 #include <libutf8.h>
20369 #endif
20370 int
20371 main (void)
20372 {
20373 wint_t value
20374   ;
20375   return 0;
20376 }
20377 _ACEOF
20378 rm -f "conftest.$ac_objext"
20379 if { (eval echo "$as_me:20379: \"$ac_compile\"") >&5
20380   (eval $ac_compile) 2>&5
20381   ac_status=$?
20382   echo "$as_me:20382: \$? = $ac_status" >&5
20383   (exit "$ac_status"); } &&
20384          { ac_try='test -s "conftest.$ac_objext"'
20385   { (eval echo "$as_me:20385: \"$ac_try\"") >&5
20386   (eval $ac_try) 2>&5
20387   ac_status=$?
20388   echo "$as_me:20388: \$? = $ac_status" >&5
20389   (exit "$ac_status"); }; }; then
20390   cf_cv_wint_t=yes
20391 else
20392   echo "$as_me: failed program was:" >&5
20393 cat "conftest.$ac_ext" >&5
20394 cf_cv_wint_t=unknown
20395 fi
20396 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20397 fi
20398 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20399 fi
20400 echo "$as_me:20400: result: $cf_cv_wint_t" >&5
20401 echo "${ECHO_T}$cf_cv_wint_t" >&6
20402
20403 if test "$cf_cv_wint_t" = yes ; then
20404
20405 cat >>confdefs.h <<\EOF
20406 #define NEED_WCHAR_H 1
20407 EOF
20408
20409         NEED_WCHAR_H=1
20410 fi
20411
20412 # if we do not find wint_t in either place, use substitution to provide a fallback.
20413 if test "$cf_cv_wint_t" = unknown ; then
20414         NCURSES_WINT_T=1
20415 fi
20416
20417 # if we find wint_t in either place, use substitution to provide a fallback.
20418 if test "$cf_cv_wint_t" != unknown ; then
20419         NCURSES_OK_WINT_T=1
20420 fi
20421
20422         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
20423
20424 echo "$as_me:20424: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20425 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20426 cat >"conftest.$ac_ext" <<_ACEOF
20427 #line 20427 "configure"
20428 #include "confdefs.h"
20429
20430 #ifndef _XOPEN_SOURCE_EXTENDED
20431 #define _XOPEN_SOURCE_EXTENDED
20432 #endif
20433 #include <${cf_cv_ncurses_header:-curses.h}>
20434 int
20435 main (void)
20436 {
20437
20438 mbstate_t foo
20439
20440   ;
20441   return 0;
20442 }
20443 _ACEOF
20444 rm -f "conftest.$ac_objext"
20445 if { (eval echo "$as_me:20445: \"$ac_compile\"") >&5
20446   (eval $ac_compile) 2>&5
20447   ac_status=$?
20448   echo "$as_me:20448: \$? = $ac_status" >&5
20449   (exit "$ac_status"); } &&
20450          { ac_try='test -s "conftest.$ac_objext"'
20451   { (eval echo "$as_me:20451: \"$ac_try\"") >&5
20452   (eval $ac_try) 2>&5
20453   ac_status=$?
20454   echo "$as_me:20454: \$? = $ac_status" >&5
20455   (exit "$ac_status"); }; }; then
20456   cf_result=yes
20457 else
20458   echo "$as_me: failed program was:" >&5
20459 cat "conftest.$ac_ext" >&5
20460 cf_result=no
20461 fi
20462 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20463 echo "$as_me:20463: result: $cf_result" >&5
20464 echo "${ECHO_T}$cf_result" >&6
20465 if test "$cf_result" = yes ; then
20466
20467 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20468
20469 cat >>confdefs.h <<EOF
20470 #define $cf_result 1
20471 EOF
20472
20473 else
20474
20475 cat >>confdefs.h <<EOF
20476 #define mbstate_t long
20477 EOF
20478
20479 fi
20480
20481         fi
20482
20483         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
20484
20485 echo "$as_me:20485: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20486 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20487 cat >"conftest.$ac_ext" <<_ACEOF
20488 #line 20488 "configure"
20489 #include "confdefs.h"
20490
20491 #ifndef _XOPEN_SOURCE_EXTENDED
20492 #define _XOPEN_SOURCE_EXTENDED
20493 #endif
20494 #include <${cf_cv_ncurses_header:-curses.h}>
20495 int
20496 main (void)
20497 {
20498
20499 wchar_t foo
20500
20501   ;
20502   return 0;
20503 }
20504 _ACEOF
20505 rm -f "conftest.$ac_objext"
20506 if { (eval echo "$as_me:20506: \"$ac_compile\"") >&5
20507   (eval $ac_compile) 2>&5
20508   ac_status=$?
20509   echo "$as_me:20509: \$? = $ac_status" >&5
20510   (exit "$ac_status"); } &&
20511          { ac_try='test -s "conftest.$ac_objext"'
20512   { (eval echo "$as_me:20512: \"$ac_try\"") >&5
20513   (eval $ac_try) 2>&5
20514   ac_status=$?
20515   echo "$as_me:20515: \$? = $ac_status" >&5
20516   (exit "$ac_status"); }; }; then
20517   cf_result=yes
20518 else
20519   echo "$as_me: failed program was:" >&5
20520 cat "conftest.$ac_ext" >&5
20521 cf_result=no
20522 fi
20523 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20524 echo "$as_me:20524: result: $cf_result" >&5
20525 echo "${ECHO_T}$cf_result" >&6
20526 if test "$cf_result" = yes ; then
20527
20528 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20529
20530 cat >>confdefs.h <<EOF
20531 #define $cf_result 1
20532 EOF
20533
20534 else
20535
20536 cat >>confdefs.h <<EOF
20537 #define wchar_t long
20538 EOF
20539
20540 fi
20541
20542         fi
20543
20544         if test "$NCURSES_OK_WINT_T" = 0 ; then
20545
20546 echo "$as_me:20546: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20547 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20548 cat >"conftest.$ac_ext" <<_ACEOF
20549 #line 20549 "configure"
20550 #include "confdefs.h"
20551
20552 #ifndef _XOPEN_SOURCE_EXTENDED
20553 #define _XOPEN_SOURCE_EXTENDED
20554 #endif
20555 #include <${cf_cv_ncurses_header:-curses.h}>
20556 int
20557 main (void)
20558 {
20559
20560 wint_t foo
20561
20562   ;
20563   return 0;
20564 }
20565 _ACEOF
20566 rm -f "conftest.$ac_objext"
20567 if { (eval echo "$as_me:20567: \"$ac_compile\"") >&5
20568   (eval $ac_compile) 2>&5
20569   ac_status=$?
20570   echo "$as_me:20570: \$? = $ac_status" >&5
20571   (exit "$ac_status"); } &&
20572          { ac_try='test -s "conftest.$ac_objext"'
20573   { (eval echo "$as_me:20573: \"$ac_try\"") >&5
20574   (eval $ac_try) 2>&5
20575   ac_status=$?
20576   echo "$as_me:20576: \$? = $ac_status" >&5
20577   (exit "$ac_status"); }; }; then
20578   cf_result=yes
20579 else
20580   echo "$as_me: failed program was:" >&5
20581 cat "conftest.$ac_ext" >&5
20582 cf_result=no
20583 fi
20584 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20585 echo "$as_me:20585: result: $cf_result" >&5
20586 echo "${ECHO_T}$cf_result" >&6
20587 if test "$cf_result" = yes ; then
20588
20589 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20590
20591 cat >>confdefs.h <<EOF
20592 #define $cf_result 1
20593 EOF
20594
20595 else
20596
20597 cat >>confdefs.h <<EOF
20598 #define wint_t long
20599 EOF
20600
20601 fi
20602
20603         fi
20604 fi
20605
20606 for cf_data in \
20607 TABSIZE \
20608 curscr \
20609 ospeed \
20610 boolnames \
20611 boolfnames \
20612 ttytype
20613 do
20614 echo "$as_me:20614: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
20615 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20616
20617 cat >"conftest.$ac_ext" <<_ACEOF
20618 #line 20618 "configure"
20619 #include "confdefs.h"
20620
20621 #ifdef HAVE_XCURSES
20622 #include <xcurses.h>
20623 char * XCursesProgramName = "test";
20624 #else
20625 #include <${cf_cv_ncurses_header:-curses.h}>
20626 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20627 #include <ncursesw/term.h>
20628 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20629 #include <ncurses/term.h>
20630 #elif defined(HAVE_TERM_H)
20631 #include <term.h>
20632 #endif
20633 #endif
20634
20635 int
20636 main (void)
20637 {
20638
20639 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20640         const void *foo = (const void *)($cf_data);
20641 #else
20642         const void *foo = &($cf_data);
20643 #endif
20644         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20645
20646   ;
20647   return 0;
20648 }
20649 _ACEOF
20650 rm -f "conftest.$ac_objext"
20651 if { (eval echo "$as_me:20651: \"$ac_compile\"") >&5
20652   (eval $ac_compile) 2>&5
20653   ac_status=$?
20654   echo "$as_me:20654: \$? = $ac_status" >&5
20655   (exit "$ac_status"); } &&
20656          { ac_try='test -s "conftest.$ac_objext"'
20657   { (eval echo "$as_me:20657: \"$ac_try\"") >&5
20658   (eval $ac_try) 2>&5
20659   ac_status=$?
20660   echo "$as_me:20660: \$? = $ac_status" >&5
20661   (exit "$ac_status"); }; }; then
20662   cf_result=yes
20663
20664 else
20665   echo "$as_me: failed program was:" >&5
20666 cat "conftest.$ac_ext" >&5
20667 cf_result=no
20668 fi
20669 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20670 echo "$as_me:20670: result: $cf_result" >&5
20671 echo "${ECHO_T}$cf_result" >&6
20672
20673 if test "$cf_result" = yes ; then
20674
20675 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20676
20677         cat >>confdefs.h <<EOF
20678 #define $cf_result 1
20679 EOF
20680
20681 else
20682         echo "$as_me:20682: checking for data $cf_data in library" >&5
20683 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
20684         # BSD linkers insist on making weak linkage, but resolve at runtime.
20685         if test "$cross_compiling" = yes; then
20686
20687         # cross-compiling
20688         cat >"conftest.$ac_ext" <<_ACEOF
20689 #line 20689 "configure"
20690 #include "confdefs.h"
20691
20692 #ifdef HAVE_XCURSES
20693 #include <xcurses.h>
20694 char * XCursesProgramName = "test";
20695 #else
20696 #include <${cf_cv_ncurses_header:-curses.h}>
20697 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20698 #include <ncursesw/term.h>
20699 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20700 #include <ncurses/term.h>
20701 #elif defined(HAVE_TERM_H)
20702 #include <term.h>
20703 #endif
20704 #endif
20705
20706 extern char $cf_data;
20707 int
20708 main (void)
20709 {
20710
20711         do {
20712
20713 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20714         const void *foo = (const void *)($cf_data);
20715 #else
20716         const void *foo = &($cf_data);
20717 #endif
20718         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20719
20720                 ${cf_cv_main_return:-return}(foo == 0);
20721         } while (0)
20722
20723   ;
20724   return 0;
20725 }
20726 _ACEOF
20727 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20728 if { (eval echo "$as_me:20728: \"$ac_link\"") >&5
20729   (eval $ac_link) 2>&5
20730   ac_status=$?
20731   echo "$as_me:20731: \$? = $ac_status" >&5
20732   (exit "$ac_status"); } &&
20733          { ac_try='test -s "conftest$ac_exeext"'
20734   { (eval echo "$as_me:20734: \"$ac_try\"") >&5
20735   (eval $ac_try) 2>&5
20736   ac_status=$?
20737   echo "$as_me:20737: \$? = $ac_status" >&5
20738   (exit "$ac_status"); }; }; then
20739   cf_result=yes
20740 else
20741   echo "$as_me: failed program was:" >&5
20742 cat "conftest.$ac_ext" >&5
20743 cf_result=no
20744 fi
20745 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20746
20747 else
20748   cat >"conftest.$ac_ext" <<_ACEOF
20749 #line 20749 "configure"
20750 #include "confdefs.h"
20751
20752 #ifdef HAVE_XCURSES
20753 #include <xcurses.h>
20754 char * XCursesProgramName = "test";
20755 #else
20756 #include <${cf_cv_ncurses_header:-curses.h}>
20757 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20758 #include <ncursesw/term.h>
20759 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20760 #include <ncurses/term.h>
20761 #elif defined(HAVE_TERM_H)
20762 #include <term.h>
20763 #endif
20764 #endif
20765
20766 extern char $cf_data;
20767 int main(void)
20768 {
20769
20770 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20771         const void *foo = (const void *)($cf_data);
20772 #else
20773         const void *foo = &($cf_data);
20774 #endif
20775         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20776
20777         ${cf_cv_main_return:-return}(foo == 0);
20778 }
20779 _ACEOF
20780 rm -f "conftest$ac_exeext"
20781 if { (eval echo "$as_me:20781: \"$ac_link\"") >&5
20782   (eval $ac_link) 2>&5
20783   ac_status=$?
20784   echo "$as_me:20784: \$? = $ac_status" >&5
20785   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
20786   { (eval echo "$as_me:20786: \"$ac_try\"") >&5
20787   (eval $ac_try) 2>&5
20788   ac_status=$?
20789   echo "$as_me:20789: \$? = $ac_status" >&5
20790   (exit "$ac_status"); }; }; then
20791   cf_result=yes
20792
20793 else
20794   echo "$as_me: program exited with status $ac_status" >&5
20795 echo "$as_me: failed program was:" >&5
20796 cat "conftest.$ac_ext" >&5
20797 cf_result=no
20798 fi
20799 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
20800 fi
20801         echo "$as_me:20801: result: $cf_result" >&5
20802 echo "${ECHO_T}$cf_result" >&6
20803         if test "$cf_result" = yes ; then
20804
20805 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20806
20807                 cat >>confdefs.h <<EOF
20808 #define $cf_result 1
20809 EOF
20810
20811                 # do not exit loop here, since we prefer system's declarations
20812         fi
20813 fi
20814 done
20815
20816 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20817 then
20818         echo "$as_me:20818: checking for X" >&5
20819 echo $ECHO_N "checking for X... $ECHO_C" >&6
20820
20821 # Check whether --with-x or --without-x was given.
20822 if test "${with_x+set}" = set; then
20823   withval="$with_x"
20824
20825 fi;
20826 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20827 if test "x$with_x" = xno; then
20828   # The user explicitly disabled X.
20829   have_x=disabled
20830 else
20831   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20832     # Both variables are already set.
20833     have_x=yes
20834   else
20835     if test "${ac_cv_have_x+set}" = set; then
20836   echo $ECHO_N "(cached) $ECHO_C" >&6
20837 else
20838   # One or both of the vars are not set, and there is no cached value.
20839 ac_x_includes=no ac_x_libraries=no
20840 rm -fr conftest.dir
20841 if mkdir conftest.dir; then
20842   cd conftest.dir
20843   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20844   cat >Imakefile <<'EOF'
20845 acfindx:
20846         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20847 EOF
20848   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20849     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20850     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
20851     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20852     for ac_extension in a so sl dylib dll; do
20853       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
20854          test -f "$ac_im_libdir/libX11.$ac_extension"; then
20855         ac_im_usrlibdir=$ac_im_libdir; break
20856       fi
20857     done
20858     # Screen out bogus values from the imake configuration.  They are
20859     # bogus both because they are the default anyway, and because
20860     # using them would break gcc on systems where it needs fixed includes.
20861     case $ac_im_incroot in
20862         /usr/include) ;;
20863         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20864     esac
20865     case $ac_im_usrlibdir in
20866         /usr/lib | /lib) ;;
20867         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20868     esac
20869   fi
20870   cd ..
20871   rm -fr conftest.dir
20872 fi
20873
20874 # Standard set of common directories for X headers.
20875 # Check X11 before X11Rn because it is often a symlink to the current release.
20876 ac_x_header_dirs='
20877 /usr/X11/include
20878 /usr/X11R7/include
20879 /usr/X11R6/include
20880 /usr/X11R5/include
20881 /usr/X11R4/include
20882
20883 /opt/local/include
20884 /opt/X11/include
20885
20886 /usr/include/X11
20887 /usr/include/X11R7
20888 /usr/include/X11R6
20889 /usr/include/X11R5
20890 /usr/include/X11R4
20891
20892 /usr/local/X11/include
20893 /usr/local/X11R7/include
20894 /usr/local/X11R6/include
20895 /usr/local/X11R5/include
20896 /usr/local/X11R4/include
20897
20898 /usr/local/include/X11
20899 /usr/local/include/X11R7
20900 /usr/local/include/X11R6
20901 /usr/local/include/X11R5
20902 /usr/local/include/X11R4
20903
20904 /usr/X386/include
20905 /usr/x386/include
20906 /usr/XFree86/include/X11
20907
20908 /usr/include
20909 /usr/local/include
20910 /usr/unsupported/include
20911 /usr/athena/include
20912 /usr/local/x11r5/include
20913 /usr/lpp/Xamples/include
20914
20915 /usr/openwin/include
20916 /usr/openwin/share/include'
20917
20918 if test "$ac_x_includes" = no; then
20919   # Guess where to find include files, by looking for Intrinsic.h.
20920   # First, try using that file with no special directory specified.
20921   cat >"conftest.$ac_ext" <<_ACEOF
20922 #line 20922 "configure"
20923 #include "confdefs.h"
20924 #include <X11/Intrinsic.h>
20925 _ACEOF
20926 if { (eval echo "$as_me:20926: \"$ac_cpp "conftest.$ac_ext"\"") >&5
20927   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
20928   ac_status=$?
20929   $EGREP -v '^ *\+' conftest.er1 >conftest.err
20930   rm -f conftest.er1
20931   cat conftest.err >&5
20932   echo "$as_me:20932: \$? = $ac_status" >&5
20933   (exit "$ac_status"); } >/dev/null; then
20934   if test -s conftest.err; then
20935     ac_cpp_err=$ac_c_preproc_warn_flag
20936   else
20937     ac_cpp_err=
20938   fi
20939 else
20940   ac_cpp_err=yes
20941 fi
20942 if test -z "$ac_cpp_err"; then
20943   # We can compile using X headers with no special include directory.
20944 ac_x_includes=
20945 else
20946   echo "$as_me: failed program was:" >&5
20947   cat "conftest.$ac_ext" >&5
20948   for ac_dir in $ac_x_header_dirs; do
20949   if test -r "$ac_dir/X11/Intrinsic.h"; then
20950     ac_x_includes=$ac_dir
20951     break
20952   fi
20953 done
20954 fi
20955 rm -f conftest.err "conftest.$ac_ext"
20956 fi # $ac_x_includes = no
20957
20958 if test "$ac_x_libraries" = no; then
20959   # Check for the libraries.
20960   # See if we find them without any special options.
20961   # Don't add to $LIBS permanently.
20962   ac_save_LIBS=$LIBS
20963   LIBS="-lXt $LIBS"
20964   cat >"conftest.$ac_ext" <<_ACEOF
20965 #line 20965 "configure"
20966 #include "confdefs.h"
20967 #include <X11/Intrinsic.h>
20968 int
20969 main (void)
20970 {
20971 XtMalloc (0)
20972   ;
20973   return 0;
20974 }
20975 _ACEOF
20976 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20977 if { (eval echo "$as_me:20977: \"$ac_link\"") >&5
20978   (eval $ac_link) 2>&5
20979   ac_status=$?
20980   echo "$as_me:20980: \$? = $ac_status" >&5
20981   (exit "$ac_status"); } &&
20982          { ac_try='test -s "conftest$ac_exeext"'
20983   { (eval echo "$as_me:20983: \"$ac_try\"") >&5
20984   (eval $ac_try) 2>&5
20985   ac_status=$?
20986   echo "$as_me:20986: \$? = $ac_status" >&5
20987   (exit "$ac_status"); }; }; then
20988   LIBS=$ac_save_LIBS
20989 # We can link X programs with no special library path.
20990 ac_x_libraries=
20991 else
20992   echo "$as_me: failed program was:" >&5
20993 cat "conftest.$ac_ext" >&5
20994 LIBS=$ac_save_LIBS
20995 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
20996 do
20997   # Don't even attempt the hair of trying to link an X program!
20998   for ac_extension in a so sl dylib dll; do
20999     if test -r "$ac_dir/libXt.$ac_extension"; then
21000       ac_x_libraries=$ac_dir
21001       break 2
21002     fi
21003   done
21004 done
21005 fi
21006 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21007 fi # $ac_x_libraries = no
21008
21009 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
21010   # Didn't find X anywhere.  Cache the known absence of X.
21011   ac_cv_have_x="have_x=no"
21012 else
21013   # Record where we found X for the cache.
21014   ac_cv_have_x="have_x=yes \
21015                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
21016 fi
21017 fi
21018
21019   fi
21020   eval "$ac_cv_have_x"
21021 fi # $with_x != no
21022
21023 if test "$have_x" != yes; then
21024   echo "$as_me:21024: result: $have_x" >&5
21025 echo "${ECHO_T}$have_x" >&6
21026   no_x=yes
21027 else
21028   # If each of the values was on the command line, it overrides each guess.
21029   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
21030   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
21031   # Update the cache value to reflect the command line values.
21032   ac_cv_have_x="have_x=yes \
21033                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
21034   echo "$as_me:21034: result: libraries $x_libraries, headers $x_includes" >&5
21035 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
21036 fi
21037
21038         if test "$no_x" = yes; then
21039   # Not all programs may use this symbol, but it does not hurt to define it.
21040
21041 cat >>confdefs.h <<\EOF
21042 #define X_DISPLAY_MISSING 1
21043 EOF
21044
21045   X_CFLAGS=
21046   X_PRE_LIBS=
21047   X_LIBS=
21048   X_EXTRA_LIBS=
21049 else
21050   if test -n "$x_includes"; then
21051     X_CFLAGS="$X_CFLAGS -I$x_includes"
21052   fi
21053
21054   # It would also be nice to do this for all -L options, not just this one.
21055   if test -n "$x_libraries"; then
21056     X_LIBS="$X_LIBS -L$x_libraries"
21057     # For Solaris; some versions of Sun CC require a space after -R and
21058     # others require no space.  Words are not sufficient . . . .
21059     case `(uname -sr) 2>/dev/null` in
21060     "SunOS 5"*)
21061       echo "$as_me:21061: checking whether -R must be followed by a space" >&5
21062 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
21063       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
21064       cat >"conftest.$ac_ext" <<_ACEOF
21065 #line 21065 "configure"
21066 #include "confdefs.h"
21067
21068 int
21069 main (void)
21070 {
21071
21072   ;
21073   return 0;
21074 }
21075 _ACEOF
21076 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21077 if { (eval echo "$as_me:21077: \"$ac_link\"") >&5
21078   (eval $ac_link) 2>&5
21079   ac_status=$?
21080   echo "$as_me:21080: \$? = $ac_status" >&5
21081   (exit "$ac_status"); } &&
21082          { ac_try='test -s "conftest$ac_exeext"'
21083   { (eval echo "$as_me:21083: \"$ac_try\"") >&5
21084   (eval $ac_try) 2>&5
21085   ac_status=$?
21086   echo "$as_me:21086: \$? = $ac_status" >&5
21087   (exit "$ac_status"); }; }; then
21088   ac_R_nospace=yes
21089 else
21090   echo "$as_me: failed program was:" >&5
21091 cat "conftest.$ac_ext" >&5
21092 ac_R_nospace=no
21093 fi
21094 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21095       if test $ac_R_nospace = yes; then
21096         echo "$as_me:21096: result: no" >&5
21097 echo "${ECHO_T}no" >&6
21098         X_LIBS="$X_LIBS -R$x_libraries"
21099       else
21100         LIBS="$ac_xsave_LIBS -R $x_libraries"
21101         cat >"conftest.$ac_ext" <<_ACEOF
21102 #line 21102 "configure"
21103 #include "confdefs.h"
21104
21105 int
21106 main (void)
21107 {
21108
21109   ;
21110   return 0;
21111 }
21112 _ACEOF
21113 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21114 if { (eval echo "$as_me:21114: \"$ac_link\"") >&5
21115   (eval $ac_link) 2>&5
21116   ac_status=$?
21117   echo "$as_me:21117: \$? = $ac_status" >&5
21118   (exit "$ac_status"); } &&
21119          { ac_try='test -s "conftest$ac_exeext"'
21120   { (eval echo "$as_me:21120: \"$ac_try\"") >&5
21121   (eval $ac_try) 2>&5
21122   ac_status=$?
21123   echo "$as_me:21123: \$? = $ac_status" >&5
21124   (exit "$ac_status"); }; }; then
21125   ac_R_space=yes
21126 else
21127   echo "$as_me: failed program was:" >&5
21128 cat "conftest.$ac_ext" >&5
21129 ac_R_space=no
21130 fi
21131 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21132         if test $ac_R_space = yes; then
21133           echo "$as_me:21133: result: yes" >&5
21134 echo "${ECHO_T}yes" >&6
21135           X_LIBS="$X_LIBS -R $x_libraries"
21136         else
21137           echo "$as_me:21137: result: neither works" >&5
21138 echo "${ECHO_T}neither works" >&6
21139         fi
21140       fi
21141       LIBS=$ac_xsave_LIBS
21142     esac
21143   fi
21144
21145   # Check for system-dependent libraries X programs must link with.
21146   # Do this before checking for the system-independent R6 libraries
21147   # (-lICE), since we may need -lsocket or whatever for X linking.
21148
21149   if test "$ISC" = yes; then
21150     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
21151   else
21152     # Martyn Johnson says this is needed for Ultrix, if the X
21153     # libraries were built with DECnet support.  And Karl Berry says
21154     # the Alpha needs dnet_stub (dnet does not exist).
21155     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
21156     cat >"conftest.$ac_ext" <<_ACEOF
21157 #line 21157 "configure"
21158 #include "confdefs.h"
21159
21160 /* Override any gcc2 internal prototype to avoid an error.  */
21161 #ifdef __cplusplus
21162 extern "C"
21163 #endif
21164 /* We use char because int might match the return type of a gcc2
21165    builtin and then its argument prototype would still apply.  */
21166 char XOpenDisplay ();
21167 int
21168 main (void)
21169 {
21170 XOpenDisplay ();
21171   ;
21172   return 0;
21173 }
21174 _ACEOF
21175 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21176 if { (eval echo "$as_me:21176: \"$ac_link\"") >&5
21177   (eval $ac_link) 2>&5
21178   ac_status=$?
21179   echo "$as_me:21179: \$? = $ac_status" >&5
21180   (exit "$ac_status"); } &&
21181          { ac_try='test -s "conftest$ac_exeext"'
21182   { (eval echo "$as_me:21182: \"$ac_try\"") >&5
21183   (eval $ac_try) 2>&5
21184   ac_status=$?
21185   echo "$as_me:21185: \$? = $ac_status" >&5
21186   (exit "$ac_status"); }; }; then
21187   :
21188 else
21189   echo "$as_me: failed program was:" >&5
21190 cat "conftest.$ac_ext" >&5
21191 echo "$as_me:21191: checking for dnet_ntoa in -ldnet" >&5
21192 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
21193 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
21194   echo $ECHO_N "(cached) $ECHO_C" >&6
21195 else
21196   ac_check_lib_save_LIBS=$LIBS
21197 LIBS="-ldnet  $LIBS"
21198 cat >"conftest.$ac_ext" <<_ACEOF
21199 #line 21199 "configure"
21200 #include "confdefs.h"
21201
21202 /* Override any gcc2 internal prototype to avoid an error.  */
21203 #ifdef __cplusplus
21204 extern "C"
21205 #endif
21206 /* We use char because int might match the return type of a gcc2
21207    builtin and then its argument prototype would still apply.  */
21208 char dnet_ntoa ();
21209 int
21210 main (void)
21211 {
21212 dnet_ntoa ();
21213   ;
21214   return 0;
21215 }
21216 _ACEOF
21217 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21218 if { (eval echo "$as_me:21218: \"$ac_link\"") >&5
21219   (eval $ac_link) 2>&5
21220   ac_status=$?
21221   echo "$as_me:21221: \$? = $ac_status" >&5
21222   (exit "$ac_status"); } &&
21223          { ac_try='test -s "conftest$ac_exeext"'
21224   { (eval echo "$as_me:21224: \"$ac_try\"") >&5
21225   (eval $ac_try) 2>&5
21226   ac_status=$?
21227   echo "$as_me:21227: \$? = $ac_status" >&5
21228   (exit "$ac_status"); }; }; then
21229   ac_cv_lib_dnet_dnet_ntoa=yes
21230 else
21231   echo "$as_me: failed program was:" >&5
21232 cat "conftest.$ac_ext" >&5
21233 ac_cv_lib_dnet_dnet_ntoa=no
21234 fi
21235 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21236 LIBS=$ac_check_lib_save_LIBS
21237 fi
21238 echo "$as_me:21238: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
21239 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
21240 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
21241   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
21242 fi
21243
21244     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
21245       echo "$as_me:21245: checking for dnet_ntoa in -ldnet_stub" >&5
21246 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
21247 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
21248   echo $ECHO_N "(cached) $ECHO_C" >&6
21249 else
21250   ac_check_lib_save_LIBS=$LIBS
21251 LIBS="-ldnet_stub  $LIBS"
21252 cat >"conftest.$ac_ext" <<_ACEOF
21253 #line 21253 "configure"
21254 #include "confdefs.h"
21255
21256 /* Override any gcc2 internal prototype to avoid an error.  */
21257 #ifdef __cplusplus
21258 extern "C"
21259 #endif
21260 /* We use char because int might match the return type of a gcc2
21261    builtin and then its argument prototype would still apply.  */
21262 char dnet_ntoa ();
21263 int
21264 main (void)
21265 {
21266 dnet_ntoa ();
21267   ;
21268   return 0;
21269 }
21270 _ACEOF
21271 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21272 if { (eval echo "$as_me:21272: \"$ac_link\"") >&5
21273   (eval $ac_link) 2>&5
21274   ac_status=$?
21275   echo "$as_me:21275: \$? = $ac_status" >&5
21276   (exit "$ac_status"); } &&
21277          { ac_try='test -s "conftest$ac_exeext"'
21278   { (eval echo "$as_me:21278: \"$ac_try\"") >&5
21279   (eval $ac_try) 2>&5
21280   ac_status=$?
21281   echo "$as_me:21281: \$? = $ac_status" >&5
21282   (exit "$ac_status"); }; }; then
21283   ac_cv_lib_dnet_stub_dnet_ntoa=yes
21284 else
21285   echo "$as_me: failed program was:" >&5
21286 cat "conftest.$ac_ext" >&5
21287 ac_cv_lib_dnet_stub_dnet_ntoa=no
21288 fi
21289 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21290 LIBS=$ac_check_lib_save_LIBS
21291 fi
21292 echo "$as_me:21292: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
21293 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
21294 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
21295   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
21296 fi
21297
21298     fi
21299 fi
21300 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21301     LIBS="$ac_xsave_LIBS"
21302
21303     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
21304     # to get the SysV transport functions.
21305     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
21306     # needs -lnsl.
21307     # The nsl library prevents programs from opening the X display
21308     # on Irix 5.2, according to T.E. Dickey.
21309     # The functions gethostbyname, getservbyname, and inet_addr are
21310     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
21311     echo "$as_me:21311: checking for gethostbyname" >&5
21312 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
21313 if test "${ac_cv_func_gethostbyname+set}" = set; then
21314   echo $ECHO_N "(cached) $ECHO_C" >&6
21315 else
21316   cat >"conftest.$ac_ext" <<_ACEOF
21317 #line 21317 "configure"
21318 #include "confdefs.h"
21319 #define gethostbyname autoconf_temporary
21320 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21321 #undef gethostbyname
21322
21323 #ifdef __cplusplus
21324 extern "C"
21325 #endif
21326
21327 /* We use char because int might match the return type of a gcc2
21328    builtin and then its argument prototype would still apply.  */
21329 char gethostbyname (void);
21330
21331 int
21332 main (void)
21333 {
21334
21335 /* The GNU C library defines stubs for functions which it implements
21336     to always fail with ENOSYS.  Some functions are actually named
21337     something starting with __ and the normal name is an alias.  */
21338 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
21339 #error found stub for gethostbyname
21340 #endif
21341
21342         return gethostbyname ();
21343   ;
21344   return 0;
21345 }
21346 _ACEOF
21347 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21348 if { (eval echo "$as_me:21348: \"$ac_link\"") >&5
21349   (eval $ac_link) 2>&5
21350   ac_status=$?
21351   echo "$as_me:21351: \$? = $ac_status" >&5
21352   (exit "$ac_status"); } &&
21353          { ac_try='test -s "conftest$ac_exeext"'
21354   { (eval echo "$as_me:21354: \"$ac_try\"") >&5
21355   (eval $ac_try) 2>&5
21356   ac_status=$?
21357   echo "$as_me:21357: \$? = $ac_status" >&5
21358   (exit "$ac_status"); }; }; then
21359   ac_cv_func_gethostbyname=yes
21360 else
21361   echo "$as_me: failed program was:" >&5
21362 cat "conftest.$ac_ext" >&5
21363 ac_cv_func_gethostbyname=no
21364 fi
21365 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21366 fi
21367 echo "$as_me:21367: result: $ac_cv_func_gethostbyname" >&5
21368 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
21369
21370     if test $ac_cv_func_gethostbyname = no; then
21371       echo "$as_me:21371: checking for gethostbyname in -lnsl" >&5
21372 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
21373 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
21374   echo $ECHO_N "(cached) $ECHO_C" >&6
21375 else
21376   ac_check_lib_save_LIBS=$LIBS
21377 LIBS="-lnsl  $LIBS"
21378 cat >"conftest.$ac_ext" <<_ACEOF
21379 #line 21379 "configure"
21380 #include "confdefs.h"
21381
21382 /* Override any gcc2 internal prototype to avoid an error.  */
21383 #ifdef __cplusplus
21384 extern "C"
21385 #endif
21386 /* We use char because int might match the return type of a gcc2
21387    builtin and then its argument prototype would still apply.  */
21388 char gethostbyname ();
21389 int
21390 main (void)
21391 {
21392 gethostbyname ();
21393   ;
21394   return 0;
21395 }
21396 _ACEOF
21397 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21398 if { (eval echo "$as_me:21398: \"$ac_link\"") >&5
21399   (eval $ac_link) 2>&5
21400   ac_status=$?
21401   echo "$as_me:21401: \$? = $ac_status" >&5
21402   (exit "$ac_status"); } &&
21403          { ac_try='test -s "conftest$ac_exeext"'
21404   { (eval echo "$as_me:21404: \"$ac_try\"") >&5
21405   (eval $ac_try) 2>&5
21406   ac_status=$?
21407   echo "$as_me:21407: \$? = $ac_status" >&5
21408   (exit "$ac_status"); }; }; then
21409   ac_cv_lib_nsl_gethostbyname=yes
21410 else
21411   echo "$as_me: failed program was:" >&5
21412 cat "conftest.$ac_ext" >&5
21413 ac_cv_lib_nsl_gethostbyname=no
21414 fi
21415 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21416 LIBS=$ac_check_lib_save_LIBS
21417 fi
21418 echo "$as_me:21418: result: $ac_cv_lib_nsl_gethostbyname" >&5
21419 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
21420 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
21421   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
21422 fi
21423
21424       if test $ac_cv_lib_nsl_gethostbyname = no; then
21425         echo "$as_me:21425: checking for gethostbyname in -lbsd" >&5
21426 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
21427 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
21428   echo $ECHO_N "(cached) $ECHO_C" >&6
21429 else
21430   ac_check_lib_save_LIBS=$LIBS
21431 LIBS="-lbsd  $LIBS"
21432 cat >"conftest.$ac_ext" <<_ACEOF
21433 #line 21433 "configure"
21434 #include "confdefs.h"
21435
21436 /* Override any gcc2 internal prototype to avoid an error.  */
21437 #ifdef __cplusplus
21438 extern "C"
21439 #endif
21440 /* We use char because int might match the return type of a gcc2
21441    builtin and then its argument prototype would still apply.  */
21442 char gethostbyname ();
21443 int
21444 main (void)
21445 {
21446 gethostbyname ();
21447   ;
21448   return 0;
21449 }
21450 _ACEOF
21451 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21452 if { (eval echo "$as_me:21452: \"$ac_link\"") >&5
21453   (eval $ac_link) 2>&5
21454   ac_status=$?
21455   echo "$as_me:21455: \$? = $ac_status" >&5
21456   (exit "$ac_status"); } &&
21457          { ac_try='test -s "conftest$ac_exeext"'
21458   { (eval echo "$as_me:21458: \"$ac_try\"") >&5
21459   (eval $ac_try) 2>&5
21460   ac_status=$?
21461   echo "$as_me:21461: \$? = $ac_status" >&5
21462   (exit "$ac_status"); }; }; then
21463   ac_cv_lib_bsd_gethostbyname=yes
21464 else
21465   echo "$as_me: failed program was:" >&5
21466 cat "conftest.$ac_ext" >&5
21467 ac_cv_lib_bsd_gethostbyname=no
21468 fi
21469 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21470 LIBS=$ac_check_lib_save_LIBS
21471 fi
21472 echo "$as_me:21472: result: $ac_cv_lib_bsd_gethostbyname" >&5
21473 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
21474 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
21475   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
21476 fi
21477
21478       fi
21479     fi
21480
21481     # lieder@skyler.mavd.honeywell.com says without -lsocket,
21482     # socket/setsockopt and other routines are undefined under SCO ODT
21483     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
21484     # on later versions), says Simon Leinen: it contains gethostby*
21485     # variants that don't use the nameserver (or something).  -lsocket
21486     # must be given before -lnsl if both are needed.  We assume that
21487     # if connect needs -lnsl, so does gethostbyname.
21488     echo "$as_me:21488: checking for connect" >&5
21489 echo $ECHO_N "checking for connect... $ECHO_C" >&6
21490 if test "${ac_cv_func_connect+set}" = set; then
21491   echo $ECHO_N "(cached) $ECHO_C" >&6
21492 else
21493   cat >"conftest.$ac_ext" <<_ACEOF
21494 #line 21494 "configure"
21495 #include "confdefs.h"
21496 #define connect autoconf_temporary
21497 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21498 #undef connect
21499
21500 #ifdef __cplusplus
21501 extern "C"
21502 #endif
21503
21504 /* We use char because int might match the return type of a gcc2
21505    builtin and then its argument prototype would still apply.  */
21506 char connect (void);
21507
21508 int
21509 main (void)
21510 {
21511
21512 /* The GNU C library defines stubs for functions which it implements
21513     to always fail with ENOSYS.  Some functions are actually named
21514     something starting with __ and the normal name is an alias.  */
21515 #if defined (__stub_connect) || defined (__stub___connect)
21516 #error found stub for connect
21517 #endif
21518
21519         return connect ();
21520   ;
21521   return 0;
21522 }
21523 _ACEOF
21524 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21525 if { (eval echo "$as_me:21525: \"$ac_link\"") >&5
21526   (eval $ac_link) 2>&5
21527   ac_status=$?
21528   echo "$as_me:21528: \$? = $ac_status" >&5
21529   (exit "$ac_status"); } &&
21530          { ac_try='test -s "conftest$ac_exeext"'
21531   { (eval echo "$as_me:21531: \"$ac_try\"") >&5
21532   (eval $ac_try) 2>&5
21533   ac_status=$?
21534   echo "$as_me:21534: \$? = $ac_status" >&5
21535   (exit "$ac_status"); }; }; then
21536   ac_cv_func_connect=yes
21537 else
21538   echo "$as_me: failed program was:" >&5
21539 cat "conftest.$ac_ext" >&5
21540 ac_cv_func_connect=no
21541 fi
21542 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21543 fi
21544 echo "$as_me:21544: result: $ac_cv_func_connect" >&5
21545 echo "${ECHO_T}$ac_cv_func_connect" >&6
21546
21547     if test $ac_cv_func_connect = no; then
21548       echo "$as_me:21548: checking for connect in -lsocket" >&5
21549 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
21550 if test "${ac_cv_lib_socket_connect+set}" = set; then
21551   echo $ECHO_N "(cached) $ECHO_C" >&6
21552 else
21553   ac_check_lib_save_LIBS=$LIBS
21554 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
21555 cat >"conftest.$ac_ext" <<_ACEOF
21556 #line 21556 "configure"
21557 #include "confdefs.h"
21558
21559 /* Override any gcc2 internal prototype to avoid an error.  */
21560 #ifdef __cplusplus
21561 extern "C"
21562 #endif
21563 /* We use char because int might match the return type of a gcc2
21564    builtin and then its argument prototype would still apply.  */
21565 char connect ();
21566 int
21567 main (void)
21568 {
21569 connect ();
21570   ;
21571   return 0;
21572 }
21573 _ACEOF
21574 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21575 if { (eval echo "$as_me:21575: \"$ac_link\"") >&5
21576   (eval $ac_link) 2>&5
21577   ac_status=$?
21578   echo "$as_me:21578: \$? = $ac_status" >&5
21579   (exit "$ac_status"); } &&
21580          { ac_try='test -s "conftest$ac_exeext"'
21581   { (eval echo "$as_me:21581: \"$ac_try\"") >&5
21582   (eval $ac_try) 2>&5
21583   ac_status=$?
21584   echo "$as_me:21584: \$? = $ac_status" >&5
21585   (exit "$ac_status"); }; }; then
21586   ac_cv_lib_socket_connect=yes
21587 else
21588   echo "$as_me: failed program was:" >&5
21589 cat "conftest.$ac_ext" >&5
21590 ac_cv_lib_socket_connect=no
21591 fi
21592 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21593 LIBS=$ac_check_lib_save_LIBS
21594 fi
21595 echo "$as_me:21595: result: $ac_cv_lib_socket_connect" >&5
21596 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
21597 if test "$ac_cv_lib_socket_connect" = yes; then
21598   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
21599 fi
21600
21601     fi
21602
21603     # Guillermo Gomez says -lposix is necessary on A/UX.
21604     echo "$as_me:21604: checking for remove" >&5
21605 echo $ECHO_N "checking for remove... $ECHO_C" >&6
21606 if test "${ac_cv_func_remove+set}" = set; then
21607   echo $ECHO_N "(cached) $ECHO_C" >&6
21608 else
21609   cat >"conftest.$ac_ext" <<_ACEOF
21610 #line 21610 "configure"
21611 #include "confdefs.h"
21612 #define remove autoconf_temporary
21613 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21614 #undef remove
21615
21616 #ifdef __cplusplus
21617 extern "C"
21618 #endif
21619
21620 /* We use char because int might match the return type of a gcc2
21621    builtin and then its argument prototype would still apply.  */
21622 char remove (void);
21623
21624 int
21625 main (void)
21626 {
21627
21628 /* The GNU C library defines stubs for functions which it implements
21629     to always fail with ENOSYS.  Some functions are actually named
21630     something starting with __ and the normal name is an alias.  */
21631 #if defined (__stub_remove) || defined (__stub___remove)
21632 #error found stub for remove
21633 #endif
21634
21635         return remove ();
21636   ;
21637   return 0;
21638 }
21639 _ACEOF
21640 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21641 if { (eval echo "$as_me:21641: \"$ac_link\"") >&5
21642   (eval $ac_link) 2>&5
21643   ac_status=$?
21644   echo "$as_me:21644: \$? = $ac_status" >&5
21645   (exit "$ac_status"); } &&
21646          { ac_try='test -s "conftest$ac_exeext"'
21647   { (eval echo "$as_me:21647: \"$ac_try\"") >&5
21648   (eval $ac_try) 2>&5
21649   ac_status=$?
21650   echo "$as_me:21650: \$? = $ac_status" >&5
21651   (exit "$ac_status"); }; }; then
21652   ac_cv_func_remove=yes
21653 else
21654   echo "$as_me: failed program was:" >&5
21655 cat "conftest.$ac_ext" >&5
21656 ac_cv_func_remove=no
21657 fi
21658 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21659 fi
21660 echo "$as_me:21660: result: $ac_cv_func_remove" >&5
21661 echo "${ECHO_T}$ac_cv_func_remove" >&6
21662
21663     if test $ac_cv_func_remove = no; then
21664       echo "$as_me:21664: checking for remove in -lposix" >&5
21665 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
21666 if test "${ac_cv_lib_posix_remove+set}" = set; then
21667   echo $ECHO_N "(cached) $ECHO_C" >&6
21668 else
21669   ac_check_lib_save_LIBS=$LIBS
21670 LIBS="-lposix  $LIBS"
21671 cat >"conftest.$ac_ext" <<_ACEOF
21672 #line 21672 "configure"
21673 #include "confdefs.h"
21674
21675 /* Override any gcc2 internal prototype to avoid an error.  */
21676 #ifdef __cplusplus
21677 extern "C"
21678 #endif
21679 /* We use char because int might match the return type of a gcc2
21680    builtin and then its argument prototype would still apply.  */
21681 char remove ();
21682 int
21683 main (void)
21684 {
21685 remove ();
21686   ;
21687   return 0;
21688 }
21689 _ACEOF
21690 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21691 if { (eval echo "$as_me:21691: \"$ac_link\"") >&5
21692   (eval $ac_link) 2>&5
21693   ac_status=$?
21694   echo "$as_me:21694: \$? = $ac_status" >&5
21695   (exit "$ac_status"); } &&
21696          { ac_try='test -s "conftest$ac_exeext"'
21697   { (eval echo "$as_me:21697: \"$ac_try\"") >&5
21698   (eval $ac_try) 2>&5
21699   ac_status=$?
21700   echo "$as_me:21700: \$? = $ac_status" >&5
21701   (exit "$ac_status"); }; }; then
21702   ac_cv_lib_posix_remove=yes
21703 else
21704   echo "$as_me: failed program was:" >&5
21705 cat "conftest.$ac_ext" >&5
21706 ac_cv_lib_posix_remove=no
21707 fi
21708 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21709 LIBS=$ac_check_lib_save_LIBS
21710 fi
21711 echo "$as_me:21711: result: $ac_cv_lib_posix_remove" >&5
21712 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
21713 if test "$ac_cv_lib_posix_remove" = yes; then
21714   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
21715 fi
21716
21717     fi
21718
21719     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
21720     echo "$as_me:21720: checking for shmat" >&5
21721 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
21722 if test "${ac_cv_func_shmat+set}" = set; then
21723   echo $ECHO_N "(cached) $ECHO_C" >&6
21724 else
21725   cat >"conftest.$ac_ext" <<_ACEOF
21726 #line 21726 "configure"
21727 #include "confdefs.h"
21728 #define shmat autoconf_temporary
21729 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21730 #undef shmat
21731
21732 #ifdef __cplusplus
21733 extern "C"
21734 #endif
21735
21736 /* We use char because int might match the return type of a gcc2
21737    builtin and then its argument prototype would still apply.  */
21738 char shmat (void);
21739
21740 int
21741 main (void)
21742 {
21743
21744 /* The GNU C library defines stubs for functions which it implements
21745     to always fail with ENOSYS.  Some functions are actually named
21746     something starting with __ and the normal name is an alias.  */
21747 #if defined (__stub_shmat) || defined (__stub___shmat)
21748 #error found stub for shmat
21749 #endif
21750
21751         return shmat ();
21752   ;
21753   return 0;
21754 }
21755 _ACEOF
21756 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21757 if { (eval echo "$as_me:21757: \"$ac_link\"") >&5
21758   (eval $ac_link) 2>&5
21759   ac_status=$?
21760   echo "$as_me:21760: \$? = $ac_status" >&5
21761   (exit "$ac_status"); } &&
21762          { ac_try='test -s "conftest$ac_exeext"'
21763   { (eval echo "$as_me:21763: \"$ac_try\"") >&5
21764   (eval $ac_try) 2>&5
21765   ac_status=$?
21766   echo "$as_me:21766: \$? = $ac_status" >&5
21767   (exit "$ac_status"); }; }; then
21768   ac_cv_func_shmat=yes
21769 else
21770   echo "$as_me: failed program was:" >&5
21771 cat "conftest.$ac_ext" >&5
21772 ac_cv_func_shmat=no
21773 fi
21774 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21775 fi
21776 echo "$as_me:21776: result: $ac_cv_func_shmat" >&5
21777 echo "${ECHO_T}$ac_cv_func_shmat" >&6
21778
21779     if test $ac_cv_func_shmat = no; then
21780       echo "$as_me:21780: checking for shmat in -lipc" >&5
21781 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
21782 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21783   echo $ECHO_N "(cached) $ECHO_C" >&6
21784 else
21785   ac_check_lib_save_LIBS=$LIBS
21786 LIBS="-lipc  $LIBS"
21787 cat >"conftest.$ac_ext" <<_ACEOF
21788 #line 21788 "configure"
21789 #include "confdefs.h"
21790
21791 /* Override any gcc2 internal prototype to avoid an error.  */
21792 #ifdef __cplusplus
21793 extern "C"
21794 #endif
21795 /* We use char because int might match the return type of a gcc2
21796    builtin and then its argument prototype would still apply.  */
21797 char shmat ();
21798 int
21799 main (void)
21800 {
21801 shmat ();
21802   ;
21803   return 0;
21804 }
21805 _ACEOF
21806 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21807 if { (eval echo "$as_me:21807: \"$ac_link\"") >&5
21808   (eval $ac_link) 2>&5
21809   ac_status=$?
21810   echo "$as_me:21810: \$? = $ac_status" >&5
21811   (exit "$ac_status"); } &&
21812          { ac_try='test -s "conftest$ac_exeext"'
21813   { (eval echo "$as_me:21813: \"$ac_try\"") >&5
21814   (eval $ac_try) 2>&5
21815   ac_status=$?
21816   echo "$as_me:21816: \$? = $ac_status" >&5
21817   (exit "$ac_status"); }; }; then
21818   ac_cv_lib_ipc_shmat=yes
21819 else
21820   echo "$as_me: failed program was:" >&5
21821 cat "conftest.$ac_ext" >&5
21822 ac_cv_lib_ipc_shmat=no
21823 fi
21824 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21825 LIBS=$ac_check_lib_save_LIBS
21826 fi
21827 echo "$as_me:21827: result: $ac_cv_lib_ipc_shmat" >&5
21828 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21829 if test "$ac_cv_lib_ipc_shmat" = yes; then
21830   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21831 fi
21832
21833     fi
21834   fi
21835
21836   # Check for libraries that X11R6 Xt/Xaw programs need.
21837   ac_save_LDFLAGS=$LDFLAGS
21838   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21839   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21840   # check for ICE first), but we must link in the order -lSM -lICE or
21841   # we get undefined symbols.  So assume we have SM if we have ICE.
21842   # These have to be linked with before -lX11, unlike the other
21843   # libraries we check for below, so use a different variable.
21844   # John Interrante, Karl Berry
21845   echo "$as_me:21845: checking for IceConnectionNumber in -lICE" >&5
21846 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21847 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21848   echo $ECHO_N "(cached) $ECHO_C" >&6
21849 else
21850   ac_check_lib_save_LIBS=$LIBS
21851 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21852 cat >"conftest.$ac_ext" <<_ACEOF
21853 #line 21853 "configure"
21854 #include "confdefs.h"
21855
21856 /* Override any gcc2 internal prototype to avoid an error.  */
21857 #ifdef __cplusplus
21858 extern "C"
21859 #endif
21860 /* We use char because int might match the return type of a gcc2
21861    builtin and then its argument prototype would still apply.  */
21862 char IceConnectionNumber ();
21863 int
21864 main (void)
21865 {
21866 IceConnectionNumber ();
21867   ;
21868   return 0;
21869 }
21870 _ACEOF
21871 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21872 if { (eval echo "$as_me:21872: \"$ac_link\"") >&5
21873   (eval $ac_link) 2>&5
21874   ac_status=$?
21875   echo "$as_me:21875: \$? = $ac_status" >&5
21876   (exit "$ac_status"); } &&
21877          { ac_try='test -s "conftest$ac_exeext"'
21878   { (eval echo "$as_me:21878: \"$ac_try\"") >&5
21879   (eval $ac_try) 2>&5
21880   ac_status=$?
21881   echo "$as_me:21881: \$? = $ac_status" >&5
21882   (exit "$ac_status"); }; }; then
21883   ac_cv_lib_ICE_IceConnectionNumber=yes
21884 else
21885   echo "$as_me: failed program was:" >&5
21886 cat "conftest.$ac_ext" >&5
21887 ac_cv_lib_ICE_IceConnectionNumber=no
21888 fi
21889 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21890 LIBS=$ac_check_lib_save_LIBS
21891 fi
21892 echo "$as_me:21892: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21893 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21894 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
21895   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21896 fi
21897
21898   LDFLAGS=$ac_save_LDFLAGS
21899
21900 fi
21901
21902 fi
21903
21904 if test "$GCC" = yes || test "$GXX" = yes
21905 then
21906
21907 if test "$GCC" = yes || test "$GXX" = yes
21908 then
21909         case $CFLAGS in
21910         (*-Werror=*)
21911                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
21912
21913 echo "${as_me:-configure}:21913: testing repairing CFLAGS: $CFLAGS ..." 1>&5
21914
21915                 cf_temp_flags=
21916                 for cf_temp_scan in $CFLAGS
21917                 do
21918                         case "x$cf_temp_scan" in
21919                         (x-Werror=*)
21920
21921         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21922         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21923
21924                                 ;;
21925                         (*)
21926
21927         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21928         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21929
21930                                 ;;
21931                         esac
21932                 done
21933                 CFLAGS="$cf_temp_flags"
21934                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
21935
21936 echo "${as_me:-configure}:21936: testing ... fixed $CFLAGS ..." 1>&5
21937
21938                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21939
21940 echo "${as_me:-configure}:21940: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21941
21942                 ;;
21943         esac
21944 fi
21945
21946 if test "$GCC" = yes || test "$GXX" = yes
21947 then
21948         case $CPPFLAGS in
21949         (*-Werror=*)
21950                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
21951
21952 echo "${as_me:-configure}:21952: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
21953
21954                 cf_temp_flags=
21955                 for cf_temp_scan in $CPPFLAGS
21956                 do
21957                         case "x$cf_temp_scan" in
21958                         (x-Werror=*)
21959
21960         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21961         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21962
21963                                 ;;
21964                         (*)
21965
21966         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21967         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21968
21969                                 ;;
21970                         esac
21971                 done
21972                 CPPFLAGS="$cf_temp_flags"
21973                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
21974
21975 echo "${as_me:-configure}:21975: testing ... fixed $CPPFLAGS ..." 1>&5
21976
21977                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21978
21979 echo "${as_me:-configure}:21979: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21980
21981                 ;;
21982         esac
21983 fi
21984
21985 if test "$GCC" = yes || test "$GXX" = yes
21986 then
21987         case $LDFLAGS in
21988         (*-Werror=*)
21989                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
21990
21991 echo "${as_me:-configure}:21991: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
21992
21993                 cf_temp_flags=
21994                 for cf_temp_scan in $LDFLAGS
21995                 do
21996                         case "x$cf_temp_scan" in
21997                         (x-Werror=*)
21998
21999         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22000         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22001
22002                                 ;;
22003                         (*)
22004
22005         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22006         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22007
22008                                 ;;
22009                         esac
22010                 done
22011                 LDFLAGS="$cf_temp_flags"
22012                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
22013
22014 echo "${as_me:-configure}:22014: testing ... fixed $LDFLAGS ..." 1>&5
22015
22016                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
22017
22018 echo "${as_me:-configure}:22018: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22019
22020                 ;;
22021         esac
22022 fi
22023
22024 echo "$as_me:22024: checking if you want to turn on gcc warnings" >&5
22025 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
22026
22027 # Check whether --enable-warnings or --disable-warnings was given.
22028 if test "${enable_warnings+set}" = set; then
22029   enableval="$enable_warnings"
22030   test "$enableval" != yes && enableval=no
22031         if test "$enableval" != "no" ; then
22032     enable_warnings=yes
22033         else
22034                 enable_warnings=no
22035         fi
22036 else
22037   enableval=no
22038         enable_warnings=no
22039
22040 fi;
22041 echo "$as_me:22041: result: $enable_warnings" >&5
22042 echo "${ECHO_T}$enable_warnings" >&6
22043 if test "$enable_warnings" = "yes"
22044 then
22045
22046 if test "$GCC" = yes || test "$GXX" = yes
22047 then
22048 cat > conftest.i <<EOF
22049 #ifndef GCC_PRINTF
22050 #define GCC_PRINTF 0
22051 #endif
22052 #ifndef GCC_SCANF
22053 #define GCC_SCANF 0
22054 #endif
22055 #ifndef GCC_NORETURN
22056 #define GCC_NORETURN /* nothing */
22057 #endif
22058 #ifndef GCC_UNUSED
22059 #define GCC_UNUSED /* nothing */
22060 #endif
22061 EOF
22062 if test "$GCC" = yes
22063 then
22064         { echo "$as_me:22064: checking for $CC __attribute__ directives..." >&5
22065 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
22066 cat > "conftest.$ac_ext" <<EOF
22067 #line 22067 "${as_me:-configure}"
22068 #include "confdefs.h"
22069 #include "conftest.h"
22070 #include "conftest.i"
22071 #if     GCC_PRINTF
22072 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
22073 #else
22074 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
22075 #endif
22076 #if     GCC_SCANF
22077 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
22078 #else
22079 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
22080 #endif
22081 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
22082 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
22083 extern GCC_NORETURN void foo(void);
22084 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
22085 EOF
22086         cf_printf_attribute=no
22087         cf_scanf_attribute=no
22088         for cf_attribute in scanf printf unused noreturn
22089         do
22090
22091 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
22092
22093                 cf_directive="__attribute__(($cf_attribute))"
22094                 echo "checking for $CC $cf_directive" 1>&5
22095
22096                 case "$cf_attribute" in
22097                 (printf)
22098                         cf_printf_attribute=yes
22099                         cat >conftest.h <<EOF
22100 #define GCC_$cf_ATTRIBUTE 1
22101 EOF
22102                         ;;
22103                 (scanf)
22104                         cf_scanf_attribute=yes
22105                         cat >conftest.h <<EOF
22106 #define GCC_$cf_ATTRIBUTE 1
22107 EOF
22108                         ;;
22109                 (*)
22110                         cat >conftest.h <<EOF
22111 #define GCC_$cf_ATTRIBUTE $cf_directive
22112 EOF
22113                         ;;
22114                 esac
22115
22116                 if { (eval echo "$as_me:22116: \"$ac_compile\"") >&5
22117   (eval $ac_compile) 2>&5
22118   ac_status=$?
22119   echo "$as_me:22119: \$? = $ac_status" >&5
22120   (exit "$ac_status"); }; then
22121                         test -n "$verbose" && echo "$as_me:22121: result: ... $cf_attribute" >&5
22122 echo "${ECHO_T}... $cf_attribute" >&6
22123                         cat conftest.h >>confdefs.h
22124                         case "$cf_attribute" in
22125                         (noreturn)
22126
22127 cat >>confdefs.h <<EOF
22128 #define GCC_NORETURN $cf_directive
22129 EOF
22130
22131                                 ;;
22132                         (printf)
22133                                 cf_value='/* nothing */'
22134                                 if test "$cf_printf_attribute" != no ; then
22135                                         cf_value='__attribute__((format(printf,fmt,var)))'
22136
22137 cat >>confdefs.h <<\EOF
22138 #define GCC_PRINTF 1
22139 EOF
22140
22141                                 fi
22142
22143 cat >>confdefs.h <<EOF
22144 #define GCC_PRINTFLIKE(fmt,var) $cf_value
22145 EOF
22146
22147                                 ;;
22148                         (scanf)
22149                                 cf_value='/* nothing */'
22150                                 if test "$cf_scanf_attribute" != no ; then
22151                                         cf_value='__attribute__((format(scanf,fmt,var)))'
22152
22153 cat >>confdefs.h <<\EOF
22154 #define GCC_SCANF 1
22155 EOF
22156
22157                                 fi
22158
22159 cat >>confdefs.h <<EOF
22160 #define GCC_SCANFLIKE(fmt,var) $cf_value
22161 EOF
22162
22163                                 ;;
22164                         (unused)
22165
22166 cat >>confdefs.h <<EOF
22167 #define GCC_UNUSED $cf_directive
22168 EOF
22169
22170                                 ;;
22171                         esac
22172                 fi
22173         done
22174 else
22175         ${FGREP-fgrep} define conftest.i >>confdefs.h
22176 fi
22177 rm -rf ./conftest*
22178 fi
22179
22180 if test "x$have_x" = xyes; then
22181
22182 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
22183 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
22184 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
22185 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
22186 for cf_X_CFLAGS in $X_CFLAGS
22187 do
22188         case "x$cf_X_CFLAGS" in
22189         x-[IUD]*)
22190                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
22191                 ;;
22192         *)
22193                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
22194                 ;;
22195         esac
22196 done
22197
22198 cat >"conftest.$ac_ext" <<_ACEOF
22199 #line 22199 "configure"
22200 #include "confdefs.h"
22201
22202 #include <stdlib.h>
22203 #include <X11/Intrinsic.h>
22204
22205 int
22206 main (void)
22207 {
22208 String foo = malloc(1); free((void*)foo)
22209   ;
22210   return 0;
22211 }
22212 _ACEOF
22213 rm -f "conftest.$ac_objext"
22214 if { (eval echo "$as_me:22214: \"$ac_compile\"") >&5
22215   (eval $ac_compile) 2>&5
22216   ac_status=$?
22217   echo "$as_me:22217: \$? = $ac_status" >&5
22218   (exit "$ac_status"); } &&
22219          { ac_try='test -s "conftest.$ac_objext"'
22220   { (eval echo "$as_me:22220: \"$ac_try\"") >&5
22221   (eval $ac_try) 2>&5
22222   ac_status=$?
22223   echo "$as_me:22223: \$? = $ac_status" >&5
22224   (exit "$ac_status"); }; }; then
22225
22226 echo "$as_me:22226: checking for X11/Xt const-feature" >&5
22227 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
22228 if test "${cf_cv_const_x_string+set}" = set; then
22229   echo $ECHO_N "(cached) $ECHO_C" >&6
22230 else
22231
22232         cat >"conftest.$ac_ext" <<_ACEOF
22233 #line 22233 "configure"
22234 #include "confdefs.h"
22235
22236 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
22237 #undef  XTSTRINGDEFINES /* X11R5 and later */
22238 #include <stdlib.h>
22239 #include <X11/Intrinsic.h>
22240
22241 int
22242 main (void)
22243 {
22244 String foo = malloc(1); *foo = 0
22245   ;
22246   return 0;
22247 }
22248 _ACEOF
22249 rm -f "conftest.$ac_objext"
22250 if { (eval echo "$as_me:22250: \"$ac_compile\"") >&5
22251   (eval $ac_compile) 2>&5
22252   ac_status=$?
22253   echo "$as_me:22253: \$? = $ac_status" >&5
22254   (exit "$ac_status"); } &&
22255          { ac_try='test -s "conftest.$ac_objext"'
22256   { (eval echo "$as_me:22256: \"$ac_try\"") >&5
22257   (eval $ac_try) 2>&5
22258   ac_status=$?
22259   echo "$as_me:22259: \$? = $ac_status" >&5
22260   (exit "$ac_status"); }; }; then
22261
22262                         cf_cv_const_x_string=no
22263
22264 else
22265   echo "$as_me: failed program was:" >&5
22266 cat "conftest.$ac_ext" >&5
22267
22268                         cf_cv_const_x_string=yes
22269
22270 fi
22271 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
22272
22273 fi
22274 echo "$as_me:22274: result: $cf_cv_const_x_string" >&5
22275 echo "${ECHO_T}$cf_cv_const_x_string" >&6
22276
22277 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
22278 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
22279 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
22280
22281 case "$cf_cv_const_x_string" in
22282 (no)
22283
22284         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22285         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
22286
22287         ;;
22288 (*)
22289
22290         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22291         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
22292
22293         ;;
22294 esac
22295
22296 else
22297   echo "$as_me: failed program was:" >&5
22298 cat "conftest.$ac_ext" >&5
22299 fi
22300 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
22301  fi
22302 cat > "conftest.$ac_ext" <<EOF
22303 #line 22303 "${as_me:-configure}"
22304 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
22305 EOF
22306 if test "$INTEL_COMPILER" = yes
22307 then
22308 # The "-wdXXX" options suppress warnings:
22309 # remark #1419: external declaration in primary source file
22310 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
22311 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
22312 # remark #193: zero used for undefined preprocessing identifier
22313 # remark #593: variable "curs_sb_left_arrow" was set but never used
22314 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
22315 # remark #869: parameter "tw" was never referenced
22316 # remark #981: operands are evaluated in unspecified order
22317 # warning #279: controlling expression is constant
22318
22319         { echo "$as_me:22319: checking for $CC warning options..." >&5
22320 echo "$as_me: checking for $CC warning options..." >&6;}
22321         cf_save_CFLAGS="$CFLAGS"
22322         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
22323         for cf_opt in \
22324                 wd1419 \
22325                 wd1683 \
22326                 wd1684 \
22327                 wd193 \
22328                 wd593 \
22329                 wd279 \
22330                 wd810 \
22331                 wd869 \
22332                 wd981
22333         do
22334                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22335                 if { (eval echo "$as_me:22335: \"$ac_compile\"") >&5
22336   (eval $ac_compile) 2>&5
22337   ac_status=$?
22338   echo "$as_me:22338: \$? = $ac_status" >&5
22339   (exit "$ac_status"); }; then
22340                         test -n "$verbose" && echo "$as_me:22340: result: ... -$cf_opt" >&5
22341 echo "${ECHO_T}... -$cf_opt" >&6
22342                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22343                 fi
22344         done
22345         CFLAGS="$cf_save_CFLAGS"
22346 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
22347 then
22348         { echo "$as_me:22348: checking for $CC warning options..." >&5
22349 echo "$as_me: checking for $CC warning options..." >&6;}
22350         cf_save_CFLAGS="$CFLAGS"
22351         cf_warn_CONST=""
22352         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
22353         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
22354         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
22355         for cf_opt in W Wall \
22356                 Wbad-function-cast \
22357                 Wcast-align \
22358                 Wcast-qual \
22359                 Wdeclaration-after-statement \
22360                 Wextra \
22361                 Winline \
22362                 Wmissing-declarations \
22363                 Wmissing-prototypes \
22364                 Wnested-externs \
22365                 Wpointer-arith \
22366                 Wshadow \
22367                 Wstrict-prototypes \
22368                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
22369         do
22370                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22371                 if { (eval echo "$as_me:22371: \"$ac_compile\"") >&5
22372   (eval $ac_compile) 2>&5
22373   ac_status=$?
22374   echo "$as_me:22374: \$? = $ac_status" >&5
22375   (exit "$ac_status"); }; then
22376                         test -n "$verbose" && echo "$as_me:22376: result: ... -$cf_opt" >&5
22377 echo "${ECHO_T}... -$cf_opt" >&6
22378                         case "$cf_opt" in
22379                         (Winline)
22380                                 case "$GCC_VERSION" in
22381                                 ([34].*)
22382                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22383
22384 echo "${as_me:-configure}:22384: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22385
22386                                         continue;;
22387                                 esac
22388                                 ;;
22389                         (Wpointer-arith)
22390                                 case "$GCC_VERSION" in
22391                                 ([12].*)
22392                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22393
22394 echo "${as_me:-configure}:22394: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22395
22396                                         continue;;
22397                                 esac
22398                                 ;;
22399                         esac
22400                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22401                 fi
22402         done
22403         CFLAGS="$cf_save_CFLAGS"
22404 fi
22405 rm -rf ./conftest*
22406
22407 fi
22408
22409 fi
22410
22411 echo "$as_me:22411: checking if you want to use dmalloc for testing" >&5
22412 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
22413
22414 # Check whether --with-dmalloc or --without-dmalloc was given.
22415 if test "${with_dmalloc+set}" = set; then
22416   withval="$with_dmalloc"
22417   case "x$withval" in
22418         (x|xno) ;;
22419         (*)
22420                 : "${with_cflags:=-g}"
22421                 : "${enable_leaks:=no}"
22422                 with_dmalloc=yes
22423
22424 cat >>confdefs.h <<EOF
22425 #define USE_DMALLOC 1
22426 EOF
22427
22428                 ;;
22429         esac
22430 else
22431   with_dmalloc=
22432 fi;
22433 echo "$as_me:22433: result: ${with_dmalloc:-no}" >&5
22434 echo "${ECHO_T}${with_dmalloc:-no}" >&6
22435
22436 case ".$with_cflags" in
22437 (.*-g*)
22438         case .$CFLAGS in
22439         (.*-g*)
22440                 ;;
22441         (*)
22442
22443 cf_fix_cppflags=no
22444 cf_new_cflags=
22445 cf_new_cppflags=
22446 cf_new_extra_cppflags=
22447
22448 for cf_add_cflags in -g
22449 do
22450 case "$cf_fix_cppflags" in
22451 (no)
22452         case "$cf_add_cflags" in
22453         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22454                 case "$cf_add_cflags" in
22455                 (-D*)
22456                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22457
22458                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22459                                 && test -z "${cf_tst_cflags}" \
22460                                 && cf_fix_cppflags=yes
22461
22462                         if test "$cf_fix_cppflags" = yes ; then
22463
22464         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22465         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22466
22467                                 continue
22468                         elif test "${cf_tst_cflags}" = "\"'" ; then
22469
22470         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22471         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22472
22473                                 continue
22474                         fi
22475                         ;;
22476                 esac
22477                 case "$CPPFLAGS" in
22478                 (*$cf_add_cflags)
22479                         ;;
22480                 (*)
22481                         case "$cf_add_cflags" in
22482                         (-D*)
22483                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22484
22485 CPPFLAGS=`echo "$CPPFLAGS" | \
22486         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22487                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22488
22489                                 ;;
22490                         esac
22491
22492         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22493         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22494
22495                         ;;
22496                 esac
22497                 ;;
22498         (*)
22499
22500         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22501         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22502
22503                 ;;
22504         esac
22505         ;;
22506 (yes)
22507
22508         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22509         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22510
22511         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22512
22513         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22514                 && test -z "${cf_tst_cflags}" \
22515                 && cf_fix_cppflags=no
22516         ;;
22517 esac
22518 done
22519
22520 if test -n "$cf_new_cflags" ; then
22521
22522         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22523         CFLAGS="${CFLAGS}$cf_new_cflags"
22524
22525 fi
22526
22527 if test -n "$cf_new_cppflags" ; then
22528
22529         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22530         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22531
22532 fi
22533
22534 if test -n "$cf_new_extra_cppflags" ; then
22535
22536         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22537         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22538
22539 fi
22540
22541                 ;;
22542         esac
22543         ;;
22544 esac
22545
22546 if test "$with_dmalloc" = yes ; then
22547         echo "$as_me:22547: checking for dmalloc.h" >&5
22548 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
22549 if test "${ac_cv_header_dmalloc_h+set}" = set; then
22550   echo $ECHO_N "(cached) $ECHO_C" >&6
22551 else
22552   cat >"conftest.$ac_ext" <<_ACEOF
22553 #line 22553 "configure"
22554 #include "confdefs.h"
22555 #include <dmalloc.h>
22556 _ACEOF
22557 if { (eval echo "$as_me:22557: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22558   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22559   ac_status=$?
22560   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22561   rm -f conftest.er1
22562   cat conftest.err >&5
22563   echo "$as_me:22563: \$? = $ac_status" >&5
22564   (exit "$ac_status"); } >/dev/null; then
22565   if test -s conftest.err; then
22566     ac_cpp_err=$ac_c_preproc_warn_flag
22567   else
22568     ac_cpp_err=
22569   fi
22570 else
22571   ac_cpp_err=yes
22572 fi
22573 if test -z "$ac_cpp_err"; then
22574   ac_cv_header_dmalloc_h=yes
22575 else
22576   echo "$as_me: failed program was:" >&5
22577   cat "conftest.$ac_ext" >&5
22578   ac_cv_header_dmalloc_h=no
22579 fi
22580 rm -f conftest.err "conftest.$ac_ext"
22581 fi
22582 echo "$as_me:22582: result: $ac_cv_header_dmalloc_h" >&5
22583 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
22584 if test "$ac_cv_header_dmalloc_h" = yes; then
22585
22586 echo "$as_me:22586: checking for dmalloc_debug in -ldmalloc" >&5
22587 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
22588 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
22589   echo $ECHO_N "(cached) $ECHO_C" >&6
22590 else
22591   ac_check_lib_save_LIBS=$LIBS
22592 LIBS="-ldmalloc  $LIBS"
22593 cat >"conftest.$ac_ext" <<_ACEOF
22594 #line 22594 "configure"
22595 #include "confdefs.h"
22596
22597 /* Override any gcc2 internal prototype to avoid an error.  */
22598 #ifdef __cplusplus
22599 extern "C"
22600 #endif
22601 /* We use char because int might match the return type of a gcc2
22602    builtin and then its argument prototype would still apply.  */
22603 char dmalloc_debug ();
22604 int
22605 main (void)
22606 {
22607 dmalloc_debug ();
22608   ;
22609   return 0;
22610 }
22611 _ACEOF
22612 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22613 if { (eval echo "$as_me:22613: \"$ac_link\"") >&5
22614   (eval $ac_link) 2>&5
22615   ac_status=$?
22616   echo "$as_me:22616: \$? = $ac_status" >&5
22617   (exit "$ac_status"); } &&
22618          { ac_try='test -s "conftest$ac_exeext"'
22619   { (eval echo "$as_me:22619: \"$ac_try\"") >&5
22620   (eval $ac_try) 2>&5
22621   ac_status=$?
22622   echo "$as_me:22622: \$? = $ac_status" >&5
22623   (exit "$ac_status"); }; }; then
22624   ac_cv_lib_dmalloc_dmalloc_debug=yes
22625 else
22626   echo "$as_me: failed program was:" >&5
22627 cat "conftest.$ac_ext" >&5
22628 ac_cv_lib_dmalloc_dmalloc_debug=no
22629 fi
22630 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22631 LIBS=$ac_check_lib_save_LIBS
22632 fi
22633 echo "$as_me:22633: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
22634 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
22635 if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then
22636   cat >>confdefs.h <<EOF
22637 #define HAVE_LIBDMALLOC 1
22638 EOF
22639
22640   LIBS="-ldmalloc $LIBS"
22641
22642 fi
22643
22644 fi
22645
22646 fi
22647
22648 echo "$as_me:22648: checking if you want to use dbmalloc for testing" >&5
22649 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
22650
22651 # Check whether --with-dbmalloc or --without-dbmalloc was given.
22652 if test "${with_dbmalloc+set}" = set; then
22653   withval="$with_dbmalloc"
22654   case "x$withval" in
22655         (x|xno) ;;
22656         (*)
22657                 : "${with_cflags:=-g}"
22658                 : "${enable_leaks:=no}"
22659                 with_dbmalloc=yes
22660
22661 cat >>confdefs.h <<EOF
22662 #define USE_DBMALLOC 1
22663 EOF
22664
22665                 ;;
22666         esac
22667 else
22668   with_dbmalloc=
22669 fi;
22670 echo "$as_me:22670: result: ${with_dbmalloc:-no}" >&5
22671 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
22672
22673 case ".$with_cflags" in
22674 (.*-g*)
22675         case .$CFLAGS in
22676         (.*-g*)
22677                 ;;
22678         (*)
22679
22680 cf_fix_cppflags=no
22681 cf_new_cflags=
22682 cf_new_cppflags=
22683 cf_new_extra_cppflags=
22684
22685 for cf_add_cflags in -g
22686 do
22687 case "$cf_fix_cppflags" in
22688 (no)
22689         case "$cf_add_cflags" in
22690         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22691                 case "$cf_add_cflags" in
22692                 (-D*)
22693                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22694
22695                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22696                                 && test -z "${cf_tst_cflags}" \
22697                                 && cf_fix_cppflags=yes
22698
22699                         if test "$cf_fix_cppflags" = yes ; then
22700
22701         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22702         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22703
22704                                 continue
22705                         elif test "${cf_tst_cflags}" = "\"'" ; then
22706
22707         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22708         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22709
22710                                 continue
22711                         fi
22712                         ;;
22713                 esac
22714                 case "$CPPFLAGS" in
22715                 (*$cf_add_cflags)
22716                         ;;
22717                 (*)
22718                         case "$cf_add_cflags" in
22719                         (-D*)
22720                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22721
22722 CPPFLAGS=`echo "$CPPFLAGS" | \
22723         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22724                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22725
22726                                 ;;
22727                         esac
22728
22729         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22730         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22731
22732                         ;;
22733                 esac
22734                 ;;
22735         (*)
22736
22737         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22738         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22739
22740                 ;;
22741         esac
22742         ;;
22743 (yes)
22744
22745         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22746         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22747
22748         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22749
22750         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22751                 && test -z "${cf_tst_cflags}" \
22752                 && cf_fix_cppflags=no
22753         ;;
22754 esac
22755 done
22756
22757 if test -n "$cf_new_cflags" ; then
22758
22759         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22760         CFLAGS="${CFLAGS}$cf_new_cflags"
22761
22762 fi
22763
22764 if test -n "$cf_new_cppflags" ; then
22765
22766         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22767         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22768
22769 fi
22770
22771 if test -n "$cf_new_extra_cppflags" ; then
22772
22773         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22774         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22775
22776 fi
22777
22778                 ;;
22779         esac
22780         ;;
22781 esac
22782
22783 if test "$with_dbmalloc" = yes ; then
22784         echo "$as_me:22784: checking for dbmalloc.h" >&5
22785 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
22786 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
22787   echo $ECHO_N "(cached) $ECHO_C" >&6
22788 else
22789   cat >"conftest.$ac_ext" <<_ACEOF
22790 #line 22790 "configure"
22791 #include "confdefs.h"
22792 #include <dbmalloc.h>
22793 _ACEOF
22794 if { (eval echo "$as_me:22794: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22795   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22796   ac_status=$?
22797   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22798   rm -f conftest.er1
22799   cat conftest.err >&5
22800   echo "$as_me:22800: \$? = $ac_status" >&5
22801   (exit "$ac_status"); } >/dev/null; then
22802   if test -s conftest.err; then
22803     ac_cpp_err=$ac_c_preproc_warn_flag
22804   else
22805     ac_cpp_err=
22806   fi
22807 else
22808   ac_cpp_err=yes
22809 fi
22810 if test -z "$ac_cpp_err"; then
22811   ac_cv_header_dbmalloc_h=yes
22812 else
22813   echo "$as_me: failed program was:" >&5
22814   cat "conftest.$ac_ext" >&5
22815   ac_cv_header_dbmalloc_h=no
22816 fi
22817 rm -f conftest.err "conftest.$ac_ext"
22818 fi
22819 echo "$as_me:22819: result: $ac_cv_header_dbmalloc_h" >&5
22820 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22821 if test "$ac_cv_header_dbmalloc_h" = yes; then
22822
22823 echo "$as_me:22823: checking for debug_malloc in -ldbmalloc" >&5
22824 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22825 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22826   echo $ECHO_N "(cached) $ECHO_C" >&6
22827 else
22828   ac_check_lib_save_LIBS=$LIBS
22829 LIBS="-ldbmalloc  $LIBS"
22830 cat >"conftest.$ac_ext" <<_ACEOF
22831 #line 22831 "configure"
22832 #include "confdefs.h"
22833
22834 /* Override any gcc2 internal prototype to avoid an error.  */
22835 #ifdef __cplusplus
22836 extern "C"
22837 #endif
22838 /* We use char because int might match the return type of a gcc2
22839    builtin and then its argument prototype would still apply.  */
22840 char debug_malloc ();
22841 int
22842 main (void)
22843 {
22844 debug_malloc ();
22845   ;
22846   return 0;
22847 }
22848 _ACEOF
22849 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22850 if { (eval echo "$as_me:22850: \"$ac_link\"") >&5
22851   (eval $ac_link) 2>&5
22852   ac_status=$?
22853   echo "$as_me:22853: \$? = $ac_status" >&5
22854   (exit "$ac_status"); } &&
22855          { ac_try='test -s "conftest$ac_exeext"'
22856   { (eval echo "$as_me:22856: \"$ac_try\"") >&5
22857   (eval $ac_try) 2>&5
22858   ac_status=$?
22859   echo "$as_me:22859: \$? = $ac_status" >&5
22860   (exit "$ac_status"); }; }; then
22861   ac_cv_lib_dbmalloc_debug_malloc=yes
22862 else
22863   echo "$as_me: failed program was:" >&5
22864 cat "conftest.$ac_ext" >&5
22865 ac_cv_lib_dbmalloc_debug_malloc=no
22866 fi
22867 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22868 LIBS=$ac_check_lib_save_LIBS
22869 fi
22870 echo "$as_me:22870: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22871 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22872 if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then
22873   cat >>confdefs.h <<EOF
22874 #define HAVE_LIBDBMALLOC 1
22875 EOF
22876
22877   LIBS="-ldbmalloc $LIBS"
22878
22879 fi
22880
22881 fi
22882
22883 fi
22884
22885 echo "$as_me:22885: checking if you want to use valgrind for testing" >&5
22886 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
22887
22888 # Check whether --with-valgrind or --without-valgrind was given.
22889 if test "${with_valgrind+set}" = set; then
22890   withval="$with_valgrind"
22891   case "x$withval" in
22892         (x|xno) ;;
22893         (*)
22894                 : "${with_cflags:=-g}"
22895                 : "${enable_leaks:=no}"
22896                 with_valgrind=yes
22897
22898 cat >>confdefs.h <<EOF
22899 #define USE_VALGRIND 1
22900 EOF
22901
22902                 ;;
22903         esac
22904 else
22905   with_valgrind=
22906 fi;
22907 echo "$as_me:22907: result: ${with_valgrind:-no}" >&5
22908 echo "${ECHO_T}${with_valgrind:-no}" >&6
22909
22910 case ".$with_cflags" in
22911 (.*-g*)
22912         case .$CFLAGS in
22913         (.*-g*)
22914                 ;;
22915         (*)
22916
22917 cf_fix_cppflags=no
22918 cf_new_cflags=
22919 cf_new_cppflags=
22920 cf_new_extra_cppflags=
22921
22922 for cf_add_cflags in -g
22923 do
22924 case "$cf_fix_cppflags" in
22925 (no)
22926         case "$cf_add_cflags" in
22927         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22928                 case "$cf_add_cflags" in
22929                 (-D*)
22930                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22931
22932                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22933                                 && test -z "${cf_tst_cflags}" \
22934                                 && cf_fix_cppflags=yes
22935
22936                         if test "$cf_fix_cppflags" = yes ; then
22937
22938         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22939         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22940
22941                                 continue
22942                         elif test "${cf_tst_cflags}" = "\"'" ; then
22943
22944         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22945         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22946
22947                                 continue
22948                         fi
22949                         ;;
22950                 esac
22951                 case "$CPPFLAGS" in
22952                 (*$cf_add_cflags)
22953                         ;;
22954                 (*)
22955                         case "$cf_add_cflags" in
22956                         (-D*)
22957                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22958
22959 CPPFLAGS=`echo "$CPPFLAGS" | \
22960         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22961                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22962
22963                                 ;;
22964                         esac
22965
22966         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22967         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22968
22969                         ;;
22970                 esac
22971                 ;;
22972         (*)
22973
22974         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22975         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22976
22977                 ;;
22978         esac
22979         ;;
22980 (yes)
22981
22982         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22983         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22984
22985         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22986
22987         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22988                 && test -z "${cf_tst_cflags}" \
22989                 && cf_fix_cppflags=no
22990         ;;
22991 esac
22992 done
22993
22994 if test -n "$cf_new_cflags" ; then
22995
22996         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22997         CFLAGS="${CFLAGS}$cf_new_cflags"
22998
22999 fi
23000
23001 if test -n "$cf_new_cppflags" ; then
23002
23003         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
23004         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
23005
23006 fi
23007
23008 if test -n "$cf_new_extra_cppflags" ; then
23009
23010         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
23011         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
23012
23013 fi
23014
23015                 ;;
23016         esac
23017         ;;
23018 esac
23019
23020 echo "$as_me:23020: checking if you want to perform memory-leak testing" >&5
23021 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
23022
23023 # Check whether --enable-leaks or --disable-leaks was given.
23024 if test "${enable_leaks+set}" = set; then
23025   enableval="$enable_leaks"
23026   enable_leaks=$enableval
23027 else
23028   enable_leaks=yes
23029 fi;
23030 if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
23031 echo "$as_me:23031: result: $with_no_leaks" >&5
23032 echo "${ECHO_T}$with_no_leaks" >&6
23033
23034 if test "$enable_leaks" = no ; then
23035
23036 cat >>confdefs.h <<\EOF
23037 #define NO_LEAKS 1
23038 EOF
23039
23040 cat >>confdefs.h <<\EOF
23041 #define YY_NO_LEAKS 1
23042 EOF
23043
23044 fi
23045
23046 LD_RPATH_OPT=
23047 if test "x$cf_cv_enable_rpath" != xno
23048 then
23049         echo "$as_me:23049: checking for an rpath option" >&5
23050 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
23051         case "$cf_cv_system_name" in
23052         (irix*)
23053                 if test "$GCC" = yes; then
23054                         LD_RPATH_OPT="-Wl,-rpath,"
23055                 else
23056                         LD_RPATH_OPT="-rpath "
23057                 fi
23058                 ;;
23059         (linux*|gnu*|k*bsd*-gnu|freebsd*)
23060                 LD_RPATH_OPT="-Wl,-rpath,"
23061                 ;;
23062         (openbsd[2-9].*|mirbsd*)
23063                 LD_RPATH_OPT="-Wl,-rpath,"
23064                 ;;
23065         (dragonfly*)
23066                 LD_RPATH_OPT="-rpath "
23067                 ;;
23068         (netbsd*)
23069                 LD_RPATH_OPT="-Wl,-rpath,"
23070                 ;;
23071         (osf*|mls+*)
23072                 LD_RPATH_OPT="-rpath "
23073                 ;;
23074         (solaris2*)
23075                 LD_RPATH_OPT="-R"
23076                 ;;
23077         (*)
23078                 ;;
23079         esac
23080         echo "$as_me:23080: result: $LD_RPATH_OPT" >&5
23081 echo "${ECHO_T}$LD_RPATH_OPT" >&6
23082
23083         case "x$LD_RPATH_OPT" in
23084         (x-R*)
23085                 echo "$as_me:23085: checking if we need a space after rpath option" >&5
23086 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
23087                 cf_save_LIBS="$LIBS"
23088
23089 cf_add_libs="$LIBS"
23090 # reverse order
23091 cf_add_0lib=
23092 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
23093 # filter duplicates
23094 for cf_add_1lib in $cf_add_0lib; do
23095         for cf_add_2lib in $cf_add_libs; do
23096                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
23097                         cf_add_1lib=
23098                         break
23099                 fi
23100         done
23101         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
23102 done
23103 LIBS="$cf_add_libs"
23104
23105                 cat >"conftest.$ac_ext" <<_ACEOF
23106 #line 23106 "configure"
23107 #include "confdefs.h"
23108
23109 int
23110 main (void)
23111 {
23112
23113   ;
23114   return 0;
23115 }
23116 _ACEOF
23117 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23118 if { (eval echo "$as_me:23118: \"$ac_link\"") >&5
23119   (eval $ac_link) 2>&5
23120   ac_status=$?
23121   echo "$as_me:23121: \$? = $ac_status" >&5
23122   (exit "$ac_status"); } &&
23123          { ac_try='test -s "conftest$ac_exeext"'
23124   { (eval echo "$as_me:23124: \"$ac_try\"") >&5
23125   (eval $ac_try) 2>&5
23126   ac_status=$?
23127   echo "$as_me:23127: \$? = $ac_status" >&5
23128   (exit "$ac_status"); }; }; then
23129   cf_rpath_space=no
23130 else
23131   echo "$as_me: failed program was:" >&5
23132 cat "conftest.$ac_ext" >&5
23133 cf_rpath_space=yes
23134 fi
23135 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23136                 LIBS="$cf_save_LIBS"
23137                 echo "$as_me:23137: result: $cf_rpath_space" >&5
23138 echo "${ECHO_T}$cf_rpath_space" >&6
23139                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
23140                 ;;
23141         esac
23142 fi
23143
23144 echo "$as_me:23144: checking if rpath-hack should be disabled" >&5
23145 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
23146
23147 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
23148 if test "${enable_rpath_hack+set}" = set; then
23149   enableval="$enable_rpath_hack"
23150   test "$enableval" != no && enableval=yes
23151         if test "$enableval" != "yes" ; then
23152     enable_rpath_hack=no
23153         else
23154                 enable_rpath_hack=yes
23155         fi
23156 else
23157   enableval=yes
23158         enable_rpath_hack=yes
23159
23160 fi;
23161 if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi
23162 echo "$as_me:23162: result: $cf_disable_rpath_hack" >&5
23163 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
23164
23165 if test "$enable_rpath_hack" = yes ; then
23166
23167 echo "$as_me:23167: checking for updated LDFLAGS" >&5
23168 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
23169 if test -n "$LD_RPATH_OPT" ; then
23170         echo "$as_me:23170: result: maybe" >&5
23171 echo "${ECHO_T}maybe" >&6
23172
23173         for ac_prog in ldd
23174 do
23175   # Extract the first word of "$ac_prog", so it can be a program name with args.
23176 set dummy $ac_prog; ac_word=$2
23177 echo "$as_me:23177: checking for $ac_word" >&5
23178 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
23179 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
23180   echo $ECHO_N "(cached) $ECHO_C" >&6
23181 else
23182   if test -n "$cf_ldd_prog"; then
23183   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
23184 else
23185   ac_save_IFS=$IFS; IFS=$ac_path_separator
23186 ac_dummy="$PATH"
23187 for ac_dir in $ac_dummy; do
23188   IFS=$ac_save_IFS
23189   test -z "$ac_dir" && ac_dir=.
23190   $as_executable_p "$ac_dir/$ac_word" || continue
23191 ac_cv_prog_cf_ldd_prog="$ac_prog"
23192 echo "$as_me:23192: found $ac_dir/$ac_word" >&5
23193 break
23194 done
23195
23196 fi
23197 fi
23198 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
23199 if test -n "$cf_ldd_prog"; then
23200   echo "$as_me:23200: result: $cf_ldd_prog" >&5
23201 echo "${ECHO_T}$cf_ldd_prog" >&6
23202 else
23203   echo "$as_me:23203: result: no" >&5
23204 echo "${ECHO_T}no" >&6
23205 fi
23206
23207   test -n "$cf_ldd_prog" && break
23208 done
23209 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
23210
23211         cf_rpath_list="/usr/lib /lib"
23212         if test "$cf_ldd_prog" != no
23213         then
23214                 cf_rpath_oops=
23215
23216 cat >"conftest.$ac_ext" <<_ACEOF
23217 #line 23217 "configure"
23218 #include "confdefs.h"
23219 #include <stdio.h>
23220 int
23221 main (void)
23222 {
23223 printf("Hello");
23224   ;
23225   return 0;
23226 }
23227 _ACEOF
23228 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23229 if { (eval echo "$as_me:23229: \"$ac_link\"") >&5
23230   (eval $ac_link) 2>&5
23231   ac_status=$?
23232   echo "$as_me:23232: \$? = $ac_status" >&5
23233   (exit "$ac_status"); } &&
23234          { ac_try='test -s "conftest$ac_exeext"'
23235   { (eval echo "$as_me:23235: \"$ac_try\"") >&5
23236   (eval $ac_try) 2>&5
23237   ac_status=$?
23238   echo "$as_me:23238: \$? = $ac_status" >&5
23239   (exit "$ac_status"); }; }; then
23240   cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
23241                  cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[         ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
23242 else
23243   echo "$as_me: failed program was:" >&5
23244 cat "conftest.$ac_ext" >&5
23245 fi
23246 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23247
23248                 # If we passed the link-test, but get a "not found" on a given library,
23249                 # this could be due to inept reconfiguration of gcc to make it only
23250                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
23251                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
23252                 # /usr/local libraries.
23253                 if test -n "$cf_rpath_oops"
23254                 then
23255                         for cf_rpath_src in $cf_rpath_oops
23256                         do
23257                                 for cf_rpath_dir in \
23258                                         /usr/local \
23259                                         /usr/pkg \
23260                                         /opt/sfw
23261                                 do
23262                                         if test -f "$cf_rpath_dir/lib/$cf_rpath_src"
23263                                         then
23264                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
23265
23266 echo "${as_me:-configure}:23266: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
23267
23268                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
23269                                                 break
23270                                         fi
23271                                 done
23272                         done
23273                 fi
23274         fi
23275
23276         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23277
23278 echo "${as_me:-configure}:23278: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
23279
23280 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
23281
23282 echo "${as_me:-configure}:23282: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
23283
23284 cf_rpath_dst=
23285 for cf_rpath_src in $LDFLAGS
23286 do
23287         case "$cf_rpath_src" in
23288         (-L*)
23289
23290                 # check if this refers to a directory which we will ignore
23291                 cf_rpath_skip=no
23292                 if test -n "$cf_rpath_list"
23293                 then
23294                         for cf_rpath_item in $cf_rpath_list
23295                         do
23296                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23297                                 then
23298                                         cf_rpath_skip=yes
23299                                         break
23300                                 fi
23301                         done
23302                 fi
23303
23304                 if test "$cf_rpath_skip" = no
23305                 then
23306                         # transform the option
23307                         if test "$LD_RPATH_OPT" = "-R " ; then
23308                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23309                         else
23310                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23311                         fi
23312
23313                         # if we have not already added this, add it now
23314                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23315                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23316                         then
23317                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23318
23319 echo "${as_me:-configure}:23319: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
23320
23321                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23322                         fi
23323                 fi
23324                 ;;
23325         esac
23326         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23327 done
23328 LDFLAGS=$cf_rpath_dst
23329
23330 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
23331
23332 echo "${as_me:-configure}:23332: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
23333
23334 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
23335
23336 echo "${as_me:-configure}:23336: testing ...checking LIBS $LIBS ..." 1>&5
23337
23338 cf_rpath_dst=
23339 for cf_rpath_src in $LIBS
23340 do
23341         case "$cf_rpath_src" in
23342         (-L*)
23343
23344                 # check if this refers to a directory which we will ignore
23345                 cf_rpath_skip=no
23346                 if test -n "$cf_rpath_list"
23347                 then
23348                         for cf_rpath_item in $cf_rpath_list
23349                         do
23350                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23351                                 then
23352                                         cf_rpath_skip=yes
23353                                         break
23354                                 fi
23355                         done
23356                 fi
23357
23358                 if test "$cf_rpath_skip" = no
23359                 then
23360                         # transform the option
23361                         if test "$LD_RPATH_OPT" = "-R " ; then
23362                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23363                         else
23364                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23365                         fi
23366
23367                         # if we have not already added this, add it now
23368                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23369                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23370                         then
23371                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23372
23373 echo "${as_me:-configure}:23373: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
23374
23375                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23376                         fi
23377                 fi
23378                 ;;
23379         esac
23380         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23381 done
23382 LIBS=$cf_rpath_dst
23383
23384 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
23385
23386 echo "${as_me:-configure}:23386: testing ...checked LIBS $LIBS ..." 1>&5
23387
23388         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23389
23390 echo "${as_me:-configure}:23390: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
23391
23392 else
23393         echo "$as_me:23393: result: no" >&5
23394 echo "${ECHO_T}no" >&6
23395 fi
23396
23397 fi
23398
23399 TEST_ARGS="$LIBS"
23400 LIBS=
23401
23402 ac_config_files="$ac_config_files Makefile"
23403 ac_config_commands="$ac_config_commands default"
23404 cat >confcache <<\_ACEOF
23405 # This file is a shell script that caches the results of configure
23406 # tests run on this system so they can be shared between configure
23407 # scripts and configure runs, see configure's option --config-cache.
23408 # It is not useful on other systems.  If it contains results you don't
23409 # want to keep, you may remove or edit it.
23410 #
23411 # config.status only pays attention to the cache file if you give it
23412 # the --recheck option to rerun configure.
23413 #
23414 # `ac_cv_env_foo' variables (set or unset) will be overriden when
23415 # loading this file, other *unset* `ac_cv_foo' will be assigned the
23416 # following values.
23417
23418 _ACEOF
23419
23420 # The following way of writing the cache mishandles newlines in values,
23421 # but we know of no workaround that is simple, portable, and efficient.
23422 # So, don't put newlines in cache variables' values.
23423 # Ultrix sh set writes to stderr and can't be redirected directly,
23424 # and sets the high bit in the cache file unless we assign to the vars.
23425 {
23426   (set) 2>&1 |
23427     case `(ac_space=' '; set | grep ac_space) 2>&1` in
23428     *ac_space=\ *)
23429       # `set' does not quote correctly, so add quotes (double-quote
23430       # substitution turns \\\\ into \\, and sed turns \\ into \).
23431       sed -n \
23432         "s/'/'\\\\''/g;
23433           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
23434       ;;
23435     *)
23436       # `set' quotes correctly as required by POSIX, so do not add quotes.
23437       sed -n \
23438         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
23439       ;;
23440     esac;
23441 } |
23442   sed '
23443      t clear
23444      : clear
23445      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
23446      t end
23447      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
23448      : end' >>confcache
23449 if cmp -s $cache_file confcache; then :; else
23450   if test -w $cache_file; then
23451     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
23452     cat confcache >$cache_file
23453   else
23454     echo "not updating unwritable cache $cache_file"
23455   fi
23456 fi
23457 rm -f confcache
23458
23459 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23460 # Let make expand exec_prefix.
23461 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23462
23463 # VPATH may cause trouble with some makes, so we remove $(srcdir),
23464 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
23465 # trailing colons and then remove the whole line if VPATH becomes empty
23466 # (actually we leave an empty line to preserve line numbers).
23467 if test "x$srcdir" = x.; then
23468   ac_vpsub='/^[         ]*VPATH[        ]*=/{
23469 s/:*\$(srcdir):*/:/;
23470 s/:*\${srcdir}:*/:/;
23471 s/:*@srcdir@:*/:/;
23472 s/^\([^=]*=[    ]*\):*/\1/;
23473 s/:*$//;
23474 s/^[^=]*=[      ]*$//;
23475 }'
23476 fi
23477
23478 DEFS=-DHAVE_CONFIG_H
23479
23480 : "${CONFIG_STATUS=./config.status}"
23481 ac_clean_files_save=$ac_clean_files
23482 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
23483 { echo "$as_me:23483: creating $CONFIG_STATUS" >&5
23484 echo "$as_me: creating $CONFIG_STATUS" >&6;}
23485 cat >"$CONFIG_STATUS" <<_ACEOF
23486 #! $SHELL
23487 # Generated automatically by configure.
23488 # Run this file to recreate the current configuration.
23489 # Compiler output produced by configure, useful for debugging
23490 # configure, is in config.log if it exists.
23491
23492 debug=false
23493 SHELL=\${CONFIG_SHELL-$SHELL}
23494 ac_cs_invocation="\$0 \$@"
23495
23496 CLICOLOR_FORCE= GREP_OPTIONS=
23497 unset CLICOLOR_FORCE GREP_OPTIONS
23498 _ACEOF
23499
23500 cat >>"$CONFIG_STATUS" <<\_ACEOF
23501 # Be Bourne compatible
23502 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
23503   emulate sh
23504   NULLCMD=:
23505 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
23506   set -o posix
23507 fi
23508
23509 # Name of the executable.
23510 as_me=`echo "$0" |sed 's,.*[\\/],,'`
23511
23512 if expr a : '\(a\)' >/dev/null 2>&1; then
23513   as_expr=expr
23514 else
23515   as_expr=false
23516 fi
23517
23518 rm -f conf$$ conf$$.exe conf$$.file
23519 echo >conf$$.file
23520 if ln -s conf$$.file conf$$ 2>/dev/null; then
23521   # We could just check for DJGPP; but this test a) works b) is more generic
23522   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
23523   if test -f conf$$.exe; then
23524     # Don't use ln at all; we don't have any links
23525     as_ln_s='cp -p'
23526   else
23527     as_ln_s='ln -s'
23528   fi
23529 elif ln conf$$.file conf$$ 2>/dev/null; then
23530   as_ln_s=ln
23531 else
23532   as_ln_s='cp -p'
23533 fi
23534 rm -f conf$$ conf$$.exe conf$$.file
23535
23536 as_executable_p="test -f"
23537
23538 # Support unset when possible.
23539 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
23540   as_unset="unset"
23541 else
23542   as_unset="false"
23543 fi
23544
23545 # NLS nuisances.
23546 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
23547 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
23548 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
23549 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
23550 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
23551 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
23552 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
23553 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
23554
23555 # IFS
23556 # We need space, tab and new line, in precisely that order.
23557 as_nl='
23558 '
23559 IFS="   $as_nl"
23560
23561 # CDPATH.
23562 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
23563
23564 exec 6>&1
23565
23566 _ACEOF
23567
23568 # Files that config.status was made for.
23569 if test -n "$ac_config_files"; then
23570   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
23571 fi
23572
23573 if test -n "$ac_config_headers"; then
23574   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
23575 fi
23576
23577 if test -n "$ac_config_links"; then
23578   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
23579 fi
23580
23581 if test -n "$ac_config_commands"; then
23582   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
23583 fi
23584
23585 cat >>"$CONFIG_STATUS" <<\EOF
23586
23587 ac_cs_usage="\
23588 \`$as_me' instantiates files from templates according to the
23589 current configuration.
23590
23591 Usage: $0 [OPTIONS] [FILE]...
23592
23593   -h, --help       print this help, then exit
23594   -V, --version    print version number, then exit
23595   -d, --debug      don't remove temporary files
23596       --recheck    update $as_me by reconfiguring in the same conditions
23597   --file=FILE[:TEMPLATE]
23598                    instantiate the configuration file FILE
23599   --header=FILE[:TEMPLATE]
23600                    instantiate the configuration header FILE
23601
23602 Configuration files:
23603 $config_files
23604
23605 Configuration headers:
23606 $config_headers
23607
23608 Configuration commands:
23609 $config_commands
23610
23611 Report bugs to <dickey@invisible-island.net>."
23612 EOF
23613
23614 cat >>"$CONFIG_STATUS" <<EOF
23615 ac_cs_version="\\
23616 config.status
23617 configured by $0, generated by GNU Autoconf 2.52.20210509,
23618   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
23619
23620 Copyright 2003-2020,2021        Thomas E. Dickey
23621 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
23622 Free Software Foundation, Inc.
23623 This config.status script is free software; the Free Software Foundation
23624 gives unlimited permission to copy, distribute and modify it."
23625 srcdir="$srcdir"
23626 INSTALL="$INSTALL"
23627 EOF
23628
23629 cat >>"$CONFIG_STATUS" <<\EOF
23630 # If no file are specified by the user, then we need to provide default
23631 # value.  By we need to know if files were specified by the user.
23632 ac_need_defaults=:
23633 while test $# != 0
23634 do
23635   case $1 in
23636   --*=*)
23637     ac_option=`expr "x$1" : 'x\([^=]*\)='`
23638     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
23639     shift
23640     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
23641     shift
23642     ;;
23643   -*);;
23644   *) # This is not an option, so the user has probably given explicit
23645      # arguments.
23646      ac_need_defaults=false;;
23647   esac
23648
23649   case $1 in
23650   # Handling of the options.
23651 EOF
23652 cat >>"$CONFIG_STATUS" <<EOF
23653   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23654     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
23655     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
23656 EOF
23657 cat >>"$CONFIG_STATUS" <<\EOF
23658   --version | --vers* | -V )
23659     echo "$ac_cs_version"; exit 0 ;;
23660   --he | --h)
23661     # Conflict between --help and --header
23662     { { echo "$as_me:23662: error: ambiguous option: $1
23663 Try \`$0 --help' for more information." >&5
23664 echo "$as_me: error: ambiguous option: $1
23665 Try \`$0 --help' for more information." >&2;}
23666    { (exit 1); exit 1; }; };;
23667   --help | --hel | -h )
23668     echo "$ac_cs_usage"; exit 0 ;;
23669   --debug | --d* | -d )
23670     debug=: ;;
23671   --file | --fil | --fi | --f )
23672     shift
23673     CONFIG_FILES="$CONFIG_FILES $1"
23674     ac_need_defaults=false;;
23675   --header | --heade | --head | --hea )
23676     shift
23677     CONFIG_HEADERS="$CONFIG_HEADERS $1"
23678     ac_need_defaults=false;;
23679
23680   # This is an error.
23681   -*) { { echo "$as_me:23681: error: unrecognized option: $1
23682 Try \`$0 --help' for more information." >&5
23683 echo "$as_me: error: unrecognized option: $1
23684 Try \`$0 --help' for more information." >&2;}
23685    { (exit 1); exit 1; }; } ;;
23686
23687   *) ac_config_targets="$ac_config_targets $1" ;;
23688
23689   esac
23690   shift
23691 done
23692
23693 exec 5>>config.log
23694 cat >&5 << _ACEOF
23695
23696 ## ----------------------- ##
23697 ## Running config.status.  ##
23698 ## ----------------------- ##
23699
23700 This file was extended by $as_me 2.52.20210509, executed with
23701   CONFIG_FILES    = $CONFIG_FILES
23702   CONFIG_HEADERS  = $CONFIG_HEADERS
23703   CONFIG_LINKS    = $CONFIG_LINKS
23704   CONFIG_COMMANDS = $CONFIG_COMMANDS
23705   > "$ac_cs_invocation"
23706 on `(hostname || uname -n) 2>/dev/null | sed 1q`
23707
23708 _ACEOF
23709 EOF
23710
23711 cat >>"$CONFIG_STATUS" <<EOF
23712 #
23713 # INIT-COMMANDS section.
23714 #
23715
23716 AWK="$AWK"
23717 ECHO_CC="$ECHO_CC"
23718 ECHO_LD="$ECHO_LD"
23719 SHOW_CC="$SHOW_LD"
23720
23721 EOF
23722
23723 cat >>"$CONFIG_STATUS" <<\EOF
23724 for ac_config_target in $ac_config_targets
23725 do
23726   case "$ac_config_target" in
23727   # Handling of arguments.
23728   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
23729   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
23730   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
23731   *) { { echo "$as_me:23731: error: invalid argument: $ac_config_target" >&5
23732 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
23733    { (exit 1); exit 1; }; };;
23734   esac
23735 done
23736
23737 # If the user did not use the arguments to specify the items to instantiate,
23738 # then the envvar interface is used.  Set only those that are not.
23739 # We use the long form for the default assignment because of an extremely
23740 # bizarre bug on SunOS 4.1.3.
23741 if "$ac_need_defaults"; then
23742   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
23743   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
23744   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
23745 fi
23746
23747 # Create a temporary directory, and hook for its removal unless debugging.
23748 $debug ||
23749 {
23750   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
23751   trap '{ (exit 1); exit 1; }' 1 2 13 15
23752 }
23753
23754 # Create a (secure) tmp directory for tmp files.
23755 : ${TMPDIR=/tmp}
23756 {
23757   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
23758   test -n "$tmp" && test -d "$tmp"
23759 }  ||
23760 {
23761   tmp=$TMPDIR/cs$$-$RANDOM
23762   (umask 077 && mkdir $tmp)
23763 } ||
23764 {
23765    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
23766    { (exit 1); exit 1; }
23767 }
23768
23769 EOF
23770
23771 cat >>"$CONFIG_STATUS" <<EOF
23772
23773 #
23774 # CONFIG_FILES section.
23775 #
23776
23777 # No need to generate the scripts if there are no CONFIG_FILES.
23778 # This happens for instance when ./config.status config.h
23779 if test -n "\$CONFIG_FILES"; then
23780   # Protect against being on the right side of a sed subst in config.status.
23781   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
23782    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
23783 s,@SHELL@,$SHELL,;t t
23784 s,@exec_prefix@,$exec_prefix,;t t
23785 s,@prefix@,$prefix,;t t
23786 s,@program_transform_name@,$program_transform_name,;t t
23787 s,@bindir@,$bindir,;t t
23788 s,@sbindir@,$sbindir,;t t
23789 s,@libexecdir@,$libexecdir,;t t
23790 s,@datarootdir@,$datarootdir,;t t
23791 s,@datadir@,$datadir,;t t
23792 s,@sysconfdir@,$sysconfdir,;t t
23793 s,@sharedstatedir@,$sharedstatedir,;t t
23794 s,@localstatedir@,$localstatedir,;t t
23795 s,@runstatedir@,$runstatedir,;t t
23796 s,@libdir@,$libdir,;t t
23797 s,@includedir@,$includedir,;t t
23798 s,@oldincludedir@,$oldincludedir,;t t
23799 s,@infodir@,$infodir,;t t
23800 s,@mandir@,$mandir,;t t
23801 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
23802 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23803 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23804 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23805 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23806 s,@build_alias@,$build_alias,;t t
23807 s,@host_alias@,$host_alias,;t t
23808 s,@target_alias@,$target_alias,;t t
23809 s,@ECHO_C@,$ECHO_C,;t t
23810 s,@ECHO_N@,$ECHO_N,;t t
23811 s,@ECHO_T@,$ECHO_T,;t t
23812 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23813 s,@DEFS@,$DEFS,;t t
23814 s,@LIBS@,$LIBS,;t t
23815 s,@build@,$build,;t t
23816 s,@build_cpu@,$build_cpu,;t t
23817 s,@build_vendor@,$build_vendor,;t t
23818 s,@build_os@,$build_os,;t t
23819 s,@host@,$host,;t t
23820 s,@host_cpu@,$host_cpu,;t t
23821 s,@host_vendor@,$host_vendor,;t t
23822 s,@host_os@,$host_os,;t t
23823 s,@SET_MAKE@,$SET_MAKE,;t t
23824 s,@CC@,$CC,;t t
23825 s,@CFLAGS@,$CFLAGS,;t t
23826 s,@LDFLAGS@,$LDFLAGS,;t t
23827 s,@CPPFLAGS@,$CPPFLAGS,;t t
23828 s,@ac_ct_CC@,$ac_ct_CC,;t t
23829 s,@EXEEXT@,$EXEEXT,;t t
23830 s,@OBJEXT@,$OBJEXT,;t t
23831 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23832 s,@CPP@,$CPP,;t t
23833 s,@GREP@,$GREP,;t t
23834 s,@EGREP@,$EGREP,;t t
23835 s,@AWK@,$AWK,;t t
23836 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23837 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23838 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23839 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23840 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23841 s,@LINT@,$LINT,;t t
23842 s,@LINT_OPTS@,$LINT_OPTS,;t t
23843 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
23844 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
23845 s,@CTAGS@,$CTAGS,;t t
23846 s,@ETAGS@,$ETAGS,;t t
23847 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23848 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23849 s,@MATH_LIB@,$MATH_LIB,;t t
23850 s,@top_builddir@,$top_builddir,;t t
23851 s,@CC_G_OPT@,$CC_G_OPT,;t t
23852 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23853 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23854 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23855 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23856 s,@LD@,$LD,;t t
23857 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23858 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23859 s,@LD_MODEL@,$LD_MODEL,;t t
23860 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23861 s,@LIBTOOL@,$LIBTOOL,;t t
23862 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23863 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23864 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23865 s,@LIB_LINK@,$LIB_LINK,;t t
23866 s,@LINK_TESTS@,$LINK_TESTS,;t t
23867 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23868 s,@PACKAGE@,$PACKAGE,;t t
23869 s,@PTHREAD@,$PTHREAD,;t t
23870 s,@TEST_ARGS@,$TEST_ARGS,;t t
23871 s,@TEST_DEPS@,$TEST_DEPS,;t t
23872 s,@TEST_LIBS@,$TEST_LIBS,;t t
23873 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23874 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23875 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23876 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
23877 s,@includesubdir@,$includesubdir,;t t
23878 s,@FGREP@,$FGREP,;t t
23879 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
23880 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
23881 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
23882 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
23883 s,@ECHO_LT@,$ECHO_LT,;t t
23884 s,@ECHO_LD@,$ECHO_LD,;t t
23885 s,@RULE_CC@,$RULE_CC,;t t
23886 s,@SHOW_CC@,$SHOW_CC,;t t
23887 s,@ECHO_CC@,$ECHO_CC,;t t
23888 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
23889 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
23890 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
23891 s,@X_CFLAGS@,$X_CFLAGS,;t t
23892 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
23893 s,@X_LIBS@,$X_LIBS,;t t
23894 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
23895 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
23896 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
23897 s,@RGB_PATH@,$RGB_PATH,;t t
23898 s,@no_x11_rgb@,$no_x11_rgb,;t t
23899 s,@FORM_NAME@,$FORM_NAME,;t t
23900 s,@MENU_NAME@,$MENU_NAME,;t t
23901 s,@PANEL_NAME@,$PANEL_NAME,;t t
23902 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
23903 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
23904 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
23905 CEOF
23906
23907 EOF
23908
23909   cat >>"$CONFIG_STATUS" <<\EOF
23910   # Split the substitutions into bite-sized pieces for seds with
23911   # small command number limits, like on Digital OSF/1 and HP-UX.
23912   ac_max_sed_lines=48
23913   ac_sed_frag=1 # Number of current file.
23914   ac_beg=1 # First line for current file.
23915   ac_end=$ac_max_sed_lines # Line after last line for current file.
23916   ac_more_lines=:
23917   ac_sed_cmds=
23918   while "$ac_more_lines"; do
23919     if test "$ac_beg" -gt 1; then
23920       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23921     else
23922       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23923     fi
23924     if test ! -s $tmp/subs.frag; then
23925       ac_more_lines=false
23926     else
23927       # The purpose of the label and of the branching condition is to
23928       # speed up the sed processing (if there are no `@' at all, there
23929       # is no need to browse any of the substitutions).
23930       # These are the two extra sed commands mentioned above.
23931       (echo ':t
23932   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
23933       # It is possible to make a multiline substitution using escaped newlines.
23934       # Ensure that we do not split the substitution between script fragments.
23935       ac_BEG=$ac_end
23936       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
23937       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
23938       if test -s $tmp/subs.next; then
23939         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
23940         if test ! -s $tmp/subs.edit; then
23941           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
23942           if test ! -s $tmp/subs.edit; then
23943             if test "$ac_beg" -gt 1; then
23944               ac_end=`expr "$ac_end" - 1`
23945               continue
23946             fi
23947           fi
23948         fi
23949       fi
23950
23951       if test -z "$ac_sed_cmds"; then
23952         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
23953       else
23954         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
23955       fi
23956       ac_sed_frag=`expr "$ac_sed_frag" + 1`
23957       ac_beg=$ac_end
23958       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
23959     fi
23960   done
23961   if test -z "$ac_sed_cmds"; then
23962     ac_sed_cmds=cat
23963   fi
23964 fi # test -n "$CONFIG_FILES"
23965
23966 EOF
23967 cat >>"$CONFIG_STATUS" <<\EOF
23968 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
23969   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23970   case "$ac_file" in
23971   - | *:- | *:-:* ) # input from stdin
23972         cat >$tmp/stdin
23973         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23974         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23975   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23976         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23977   * )   ac_file_in=$ac_file.in ;;
23978   esac
23979
23980   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
23981   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23982          X"$ac_file" : 'X\(//\)[^/]' \| \
23983          X"$ac_file" : 'X\(//\)$' \| \
23984          X"$ac_file" : 'X\(/\)' \| \
23985          .     : '\(.\)' 2>/dev/null ||
23986 echo X"$ac_file" |
23987     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23988           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23989           /^X\(\/\/\)$/{ s//\1/; q; }
23990           /^X\(\/\).*/{ s//\1/; q; }
23991           s/.*/./; q'`
23992   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23993     { case "$ac_dir" in
23994   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23995   *)                      as_incr_dir=.;;
23996 esac
23997 as_dummy="$ac_dir"
23998 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23999   case $as_mkdir_dir in
24000     # Skip DOS drivespec
24001     ?:) as_incr_dir=$as_mkdir_dir ;;
24002     *)
24003       as_incr_dir=$as_incr_dir/$as_mkdir_dir
24004       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
24005     ;;
24006   esac
24007 done; }
24008
24009     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
24010     # A "../" for each directory in $ac_dir_suffix.
24011     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
24012   else
24013     ac_dir_suffix= ac_dots=
24014   fi
24015
24016   case "$srcdir" in
24017   .)  ac_srcdir=.
24018       if test -z "$ac_dots"; then
24019          ac_top_srcdir=.
24020       else
24021          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
24022       fi ;;
24023   [\\/]* | ?:[\\/]* )
24024       ac_srcdir="$srcdir$ac_dir_suffix";
24025       ac_top_srcdir="$srcdir" ;;
24026   *) # Relative path.
24027     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
24028     ac_top_srcdir="$ac_dots$srcdir" ;;
24029   esac
24030
24031   case $INSTALL in
24032   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
24033   *) ac_INSTALL=$ac_dots$INSTALL ;;
24034   esac
24035
24036   if test x"$ac_file" != x-; then
24037     { echo "$as_me:24037: creating $ac_file" >&5
24038 echo "$as_me: creating $ac_file" >&6;}
24039     rm -f "$ac_file"
24040   fi
24041   # Let's still pretend it is `configure' which instantiates (i.e., don't
24042   # use $as_me), people would be surprised to read:
24043   #    /* config.h.  Generated automatically by config.status.  */
24044   configure_input="Generated automatically from `echo $ac_file_in |
24045                                                  sed 's,.*/,,'` by configure."
24046
24047   # First look for the input files in the build tree, otherwise in the
24048   # src tree.
24049   ac_file_inputs=`IFS=:
24050     for f in $ac_file_in; do
24051       case $f in
24052       -) echo $tmp/stdin ;;
24053       [\\/$]*)
24054          # Absolute (can't be DOS-style, as IFS=:)
24055          test -f "$f" || { { echo "$as_me:24055: error: cannot find input file: $f" >&5
24056 echo "$as_me: error: cannot find input file: $f" >&2;}
24057    { (exit 1); exit 1; }; }
24058          echo $f;;
24059       *) # Relative
24060          if test -f "$f"; then
24061            # Build tree
24062            echo $f
24063          elif test -f "$srcdir/$f"; then
24064            # Source tree
24065            echo "$srcdir/$f"
24066          else
24067            # /dev/null tree
24068            { { echo "$as_me:24068: error: cannot find input file: $f" >&5
24069 echo "$as_me: error: cannot find input file: $f" >&2;}
24070    { (exit 1); exit 1; }; }
24071          fi;;
24072       esac
24073     done` || { (exit 1); exit 1; }
24074 EOF
24075 cat >>"$CONFIG_STATUS" <<\EOF
24076   ac_warn_datarootdir=no
24077   if test x"$ac_file" != x-; then
24078     for ac_item in $ac_file_inputs
24079     do
24080       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
24081       if test -n "$ac_seen"; then
24082         ac_used=`grep '@datarootdir@' "$ac_item"`
24083         if test -z "$ac_used"; then
24084           { echo "$as_me:24084: WARNING: datarootdir was used implicitly but not set:
24085 $ac_seen" >&5
24086 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
24087 $ac_seen" >&2;}
24088           ac_warn_datarootdir=yes
24089         fi
24090       fi
24091       ac_seen=`grep '${datarootdir}' "$ac_item"`
24092       if test -n "$ac_seen"; then
24093         { echo "$as_me:24093: WARNING: datarootdir was used explicitly but not set:
24094 $ac_seen" >&5
24095 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
24096 $ac_seen" >&2;}
24097         ac_warn_datarootdir=yes
24098       fi
24099     done
24100   fi
24101
24102 if test "x$ac_warn_datarootdir" = xyes; then
24103   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
24104 fi
24105
24106 EOF
24107 cat >>"$CONFIG_STATUS" <<EOF
24108   sed "$ac_vpsub
24109 $extrasub
24110 EOF
24111 cat >>"$CONFIG_STATUS" <<\EOF
24112 :t
24113 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
24114 s,@configure_input@,$configure_input,;t t
24115 s,@srcdir@,$ac_srcdir,;t t
24116 s,@top_srcdir@,$ac_top_srcdir,;t t
24117 s,@INSTALL@,$ac_INSTALL,;t t
24118 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
24119   rm -f $tmp/stdin
24120   if test x"$ac_file" != x-; then
24121     cp "$tmp/out" "$ac_file"
24122
24123     for ac_name in prefix exec_prefix datarootdir
24124     do
24125         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
24126         if test -n "$ac_seen"; then
24127             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
24128             if test -z "$ac_init"; then
24129               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
24130               { echo "$as_me:24130: WARNING: Variable $ac_name is used but was not set:
24131 $ac_seen" >&5
24132 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
24133 $ac_seen" >&2;}
24134             fi
24135         fi
24136     done
24137     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
24138     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
24139     if test -s $tmp/out; then
24140       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
24141       { echo "$as_me:24141: WARNING: Some variables may not be substituted:
24142 $ac_seen" >&5
24143 echo "$as_me: WARNING: Some variables may not be substituted:
24144 $ac_seen" >&2;}
24145     fi
24146   else
24147     cat $tmp/out
24148   fi
24149   rm -f $tmp/out
24150
24151 done
24152 EOF
24153 cat >>"$CONFIG_STATUS" <<\EOF
24154
24155 #
24156 # CONFIG_HEADER section.
24157 #
24158
24159 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
24160 # NAME is the cpp macro being defined and VALUE is the value it is being given.
24161 #
24162 # ac_d sets the value in "#define NAME VALUE" lines.
24163 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
24164 ac_dB='[        ].*$,\1#\2'
24165 ac_dC=' '
24166 ac_dD=',;t'
24167 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
24168 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24169 ac_iB='\([      ]\),\1#\2define\3'
24170 ac_iC=' '
24171 ac_iD='\4,;t'
24172 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
24173 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24174 ac_uB='$,\1#\2define\3'
24175 ac_uC=' '
24176 ac_uD=',;t'
24177
24178 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
24179   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24180   case "$ac_file" in
24181   - | *:- | *:-:* ) # input from stdin
24182         cat >$tmp/stdin
24183         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24184         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24185   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24186         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24187   * )   ac_file_in=$ac_file.in ;;
24188   esac
24189
24190   test x"$ac_file" != x- && { echo "$as_me:24190: creating $ac_file" >&5
24191 echo "$as_me: creating $ac_file" >&6;}
24192
24193   # First look for the input files in the build tree, otherwise in the
24194   # src tree.
24195   ac_file_inputs=`IFS=:
24196     for f in $ac_file_in; do
24197       case $f in
24198       -) echo $tmp/stdin ;;
24199       [\\/$]*)
24200          # Absolute (can't be DOS-style, as IFS=:)
24201          test -f "$f" || { { echo "$as_me:24201: error: cannot find input file: $f" >&5
24202 echo "$as_me: error: cannot find input file: $f" >&2;}
24203    { (exit 1); exit 1; }; }
24204          echo $f;;
24205       *) # Relative
24206          if test -f "$f"; then
24207            # Build tree
24208            echo $f
24209          elif test -f "$srcdir/$f"; then
24210            # Source tree
24211            echo "$srcdir/$f"
24212          else
24213            # /dev/null tree
24214            { { echo "$as_me:24214: error: cannot find input file: $f" >&5
24215 echo "$as_me: error: cannot find input file: $f" >&2;}
24216    { (exit 1); exit 1; }; }
24217          fi;;
24218       esac
24219     done` || { (exit 1); exit 1; }
24220   # Remove the trailing spaces.
24221   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
24222
24223 EOF
24224
24225 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
24226 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
24227 # be either 'cat' or 'sort'.
24228 cat confdefs.h | uniq >conftest.vals
24229
24230 # Break up conftest.vals because some shells have a limit on
24231 # the size of here documents, and old seds have small limits too.
24232
24233 rm -f conftest.tail
24234 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
24235 while grep . conftest.vals >/dev/null
24236 do
24237   # Write chunks of a limited-size here document to conftest.frag.
24238   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
24239   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
24240   echo 'CEOF' >> "$CONFIG_STATUS"
24241   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
24242   rm -f conftest.vals
24243   mv conftest.tail conftest.vals
24244 done
24245 rm -f conftest.vals
24246
24247 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
24248 # marker @DEFS@.
24249 echo '  cat >> conftest.edit <<CEOF
24250 /@DEFS@/r conftest.frag
24251 /@DEFS@/d
24252 CEOF
24253 sed -f conftest.edit $tmp/in > $tmp/out
24254 rm -f $tmp/in
24255 mv $tmp/out $tmp/in
24256 rm -f conftest.edit conftest.frag
24257 ' >> "$CONFIG_STATUS"
24258
24259 cat >>"$CONFIG_STATUS" <<\EOF
24260   # Let's still pretend it is `configure' which instantiates (i.e., don't
24261   # use $as_me), people would be surprised to read:
24262   #    /* config.h.  Generated automatically by config.status.  */
24263   if test x"$ac_file" = x-; then
24264     echo "/* Generated automatically by configure.  */" >$tmp/config.h
24265   else
24266     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
24267   fi
24268   cat $tmp/in >>$tmp/config.h
24269   rm -f $tmp/in
24270   if test x"$ac_file" != x-; then
24271     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
24272       { echo "$as_me:24272: $ac_file is unchanged" >&5
24273 echo "$as_me: $ac_file is unchanged" >&6;}
24274     else
24275       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
24276          X"$ac_file" : 'X\(//\)[^/]' \| \
24277          X"$ac_file" : 'X\(//\)$' \| \
24278          X"$ac_file" : 'X\(/\)' \| \
24279          .     : '\(.\)' 2>/dev/null ||
24280 echo X"$ac_file" |
24281     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
24282           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
24283           /^X\(\/\/\)$/{ s//\1/; q; }
24284           /^X\(\/\).*/{ s//\1/; q; }
24285           s/.*/./; q'`
24286       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24287         { case "$ac_dir" in
24288   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
24289   *)                      as_incr_dir=.;;
24290 esac
24291 as_dummy="$ac_dir"
24292 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
24293   case $as_mkdir_dir in
24294     # Skip DOS drivespec
24295     ?:) as_incr_dir=$as_mkdir_dir ;;
24296     *)
24297       as_incr_dir=$as_incr_dir/$as_mkdir_dir
24298       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
24299     ;;
24300   esac
24301 done; }
24302
24303       fi
24304       rm -f "$ac_file"
24305       mv "$tmp/config.h" "$ac_file"
24306     fi
24307   else
24308     cat $tmp/config.h
24309     rm -f $tmp/config.h
24310   fi
24311 done
24312 EOF
24313 cat >>"$CONFIG_STATUS" <<\EOF
24314 #
24315 # CONFIG_COMMANDS section.
24316 #
24317 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
24318   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
24319   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
24320
24321   case "$ac_dest" in
24322     default )
24323
24324 for cf_dir in .
24325 do
24326         if test ! -d "$srcdir/$cf_dir" ; then
24327                 continue
24328         elif test -f "$srcdir/$cf_dir/programs" ; then
24329                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" "$srcdir/$cf_dir/programs" >>$cf_dir/Makefile
24330         fi
24331 done
24332
24333         cat >>Makefile <<TEST_EOF
24334
24335 # These rules are generated so we do not rely on suffix rules, which do not
24336 # work consistently for different make-programs (the '\$(MODEL)/' confuses
24337 # some, and the '\$x' confuses others).
24338 TEST_EOF
24339
24340 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
24341 for N in $LIST
24342 do
24343         cat >>Makefile <<TEST_EOF
24344
24345 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
24346         \$(srcdir)/test.priv.h \\
24347         ncurses_cfg.h
24348         $SHOW_CC
24349         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
24350 TEST_EOF
24351 done
24352
24353 if test -f ../config.guess && test -f ../config.sub
24354 then
24355         cat >>Makefile <<TEST_EOF
24356
24357 # if we used CF_INHERIT for getting these files, we can remove them
24358 distclean::
24359         rm -f config.guess config.sub
24360 TEST_EOF
24361 fi
24362  ;;
24363   esac
24364 done
24365 EOF
24366
24367 cat >>"$CONFIG_STATUS" <<\EOF
24368
24369 { (exit 0); exit 0; }
24370 EOF
24371 chmod +x "$CONFIG_STATUS"
24372 ac_clean_files=$ac_clean_files_save
24373
24374 # configure is writing to config.log, and then calls config.status.
24375 # config.status does its own redirection, appending to config.log.
24376 # Unfortunately, on DOS this fails, as config.log is still kept open
24377 # by configure, so config.status won't be able to write to it; its
24378 # output is simply discarded.  So we exec the FD to /dev/null,
24379 # effectively closing config.log, so it can be properly (re)opened and
24380 # appended to by config.status.  When coming back to configure, we
24381 # need to make the FD available again.
24382 if test "$no_create" != yes; then
24383   ac_cs_success=:
24384   exec 5>/dev/null
24385   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
24386   exec 5>>config.log
24387   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
24388   # would make configure fail if this is the last instruction.
24389   "$ac_cs_success" || { (exit 1); exit 1; }
24390 fi
24391